Chromium Code Reviews| Index: third_party/qcms/src/tests/qcms_test_internal_srgb.c |
| diff --git a/third_party/qcms/src/tests/qcms_test_internal_srgb.c b/third_party/qcms/src/tests/qcms_test_internal_srgb.c |
| index 58855a1b6c924edcc0c4a50a1f42afdbf5f5d731..fa4c912d19f9e3d376bf890973b94a487b9feb8e 100644 |
| --- a/third_party/qcms/src/tests/qcms_test_internal_srgb.c |
| +++ b/third_party/qcms/src/tests/qcms_test_internal_srgb.c |
| @@ -9,11 +9,14 @@ |
| #include <stdint.h> |
| #include <stdlib.h> |
| -// Colorant matrix for the official sRGB IEC61966-2.1 color (D50) primaries. |
| +// Colorant matrix and media white point for the official sRGB IEC61966-2.1 color (D50) primaries. |
|
Noel Gordon
2016/03/11 15:19:21
// D50 adapted color primaries of the sRGB IEC6196
radu.velea
2016/03/11 15:32:02
Done.
|
| static s15Fixed16Number sRGB_reference[3][3] = { |
| {0x06fa2 /*0.436066*/, /*0.385147*/ 0x06299, /*0.143066*/ 0x024a0}, |
| {0x038f5 /*0.222488*/, /*0.716873*/ 0x0b785, /*0.060608*/ 0x00f84}, |
| {0x00390 /*0.013916*/, /*0.097076*/ 0x018da, /*0.714096*/ 0x0b6cf}}; |
|
Noel Gordon
2016/03/11 15:19:21
0x0b6cf}}; ->
0x0b6cf}
};
radu.velea
2016/03/11 15:32:02
Done.
|
| +static struct XYZNumber D65 = { |
|
Noel Gordon
2016/03/11 15:19:21
space before this line
// Reference media white po
radu.velea
2016/03/11 15:32:02
Done.
|
| + 0xf351, 0x10000, 0x116cc // ( 0.950455, 1.000000, 1.089050 ) |
| +}; |
| static int qcms_test_internal_srgb(size_t width, |
| size_t height, |
| @@ -27,6 +30,12 @@ static int qcms_test_internal_srgb(size_t width, |
| s15Fixed16Number diff = 0; |
| int i, j; |
| + if (qcms_profile_is_bogus(profile)) { |
| + fprintf(stderr, "Profile is bogus\n"); |
|
Noel Gordon
2016/03/11 15:19:21
"Failure: the internal sRGB profile failed the bog
radu.velea
2016/03/11 15:32:02
Done.
|
| + qcms_profile_release(profile); |
| + return -1; |
| + } |
| + |
| printf("Test qcms internal sRGB colorant matrix against official sRGB IEC61966-2.1 color (D50) primaries\n"); |
|
Noel Gordon
2016/03/11 15:19:21
printf("Test qcms internal sRGB colorant primaries
radu.velea
2016/03/11 15:32:02
Done.
|
| sRGB_internal[0][0] = profile->redColorant.X; |
| @@ -48,9 +57,16 @@ static int qcms_test_internal_srgb(size_t width, |
| printf("\n"); |
| } |
| - qcms_profile_release(profile); |
| + printf("Total error = 0x%x [%.6f]\n\n", diff, diff / 65536.0); |
| - printf("Total error = 0x%x [%.6f]\n", diff, diff / 65536.0); |
| + printf("Test media white point against official sRGB IEC61966-2.1 D65 XYZ values\n"); |
|
Noel Gordon
2016/03/11 15:19:21
printf("Test media white point against expected sR
radu.velea
2016/03/11 15:32:02
Done.
|
| + printf("Internal values = [0x%X, 0x%X, 0x%X]\n", |
| + profile->mediaWhitePoint.X, profile->mediaWhitePoint.Y, profile->mediaWhitePoint.Z); |
| + |
| + printf("White point error = [0x%X, 0x%X, 0x%X]\n", |
| + profile->mediaWhitePoint.X - D65.X, profile->mediaWhitePoint.Y - D65.Y, profile->mediaWhitePoint.Z - D65.Z); |
| + |
| + qcms_profile_release(profile); |
| return diff; |
| } |