Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Side by Side Diff: third_party/qcms/src/tests/qcms_test_ntsc_gamut.c

Issue 1703553002: [qcms] Provide an API to compute xyY gamut area relative to NTSC 1953 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
Noel Gordon 2016/02/17 10:42:24 nit: 2015 -> 2016.
radu.velea 2016/02/17 11:31:00 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the Chromium LICENSE file.
4
5 #include "qcms_test_util.h"
6
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <time.h>
10
11 static qcms_bool invalid_rgb_color_profile(qcms_profile *profile)
12 {
13 return rgbData != qcms_profile_get_color_space(profile) || qcms_profile_is_b ogus(profile);
14 }
15
16 static int qcms_test_ntsc_gamut(size_t width,
17 size_t height,
18 int iterations,
19 const char *input_path,
20 const char *referece_path,
21 const int force_software)
22 {
23 qcms_profile *input_profile;
24 qcms_profile *reference_profile = qcms_profile_sRGB();
25 qcms_transform *transform;
26 float input_gamut_metric, reference_gamut_metric;
27
28 if (input_path == NULL) {
Noel Gordon 2016/02/17 10:42:25 if (!input_path)
radu.velea 2016/02/17 11:31:00 Done.
29 fprintf(stderr, "%s: please provide valid ICC profiles via -i/o options\ n", __FUNCTION__);
30 return EXIT_FAILURE;
31 }
32
33 input_profile = qcms_profile_from_path(input_path);
34 if (!input_profile || invalid_rgb_color_profile(input_profile)) {
35 fprintf(stderr, "Invalid input profile\n");
36 return EXIT_FAILURE;
37 }
38
39 transform = qcms_transform_create(input_profile, QCMS_DATA_RGBA_8, reference _profile, QCMS_DATA_RGBA_8, QCMS_INTENT_DEFAULT);
40 if (!transform) {
41 fprintf(stderr, "Could not create transform\n");
42 return EXIT_FAILURE;
43 }
44 else if (!(transform->transform_flags & TRANSFORM_FLAG_MATRIX)) {
Noel Gordon 2016/02/17 10:42:24 nite: space before this line and then write it as
radu.velea 2016/02/17 11:31:00 Done.
45 fprintf(stderr, "Transform is not matrix\n");
46 qcms_transform_release(transform);
47 qcms_profile_release(input_profile);
48 qcms_profile_release(reference_profile);
49 return EXIT_FAILURE;
50 }
51
52 printf("NTSC 1953 relative gamut area test\n");
53
54 input_gamut_metric = qcms_profile_ntsc_relative_gamut_size(input_profile);
55 printf("Input profile\n\tDescription: %s\n\tNTSC relative gamut area: %.3f % %\n",
56 input_profile->description, input_gamut_metric);
57
58 reference_gamut_metric = qcms_profile_ntsc_relative_gamut_size(reference_pro file);
59 printf("Internal reference profile\n\tDescription: %s\n\tNTSC relative gamut area: %.3f %%\n",
60 reference_profile->description, reference_gamut_metric);
61
62 qcms_transform_release(transform);
63 qcms_profile_release(input_profile);
64 qcms_profile_release(reference_profile);
65
66 return 0;
67 }
68
69 struct qcms_test_case qcms_test_ntsc_gamut_info = {
70 "qcms_test_ntsc_gamut",
71 qcms_test_ntsc_gamut,
72 QCMS_TEST_DISABLED
73 };
OLDNEW
« third_party/qcms/src/qcms_util.c ('K') | « third_party/qcms/src/tests/qcms_test_main.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698