summaryrefslogtreecommitdiffstats
path: root/third_party/qcms
diff options
context:
space:
mode:
authornoel <noel@chromium.org>2015-12-24 03:14:50 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-24 11:15:32 +0000
commit89c17154c856d1940c2f54bf4214c8982f602c54 (patch)
tree62208662e4d2af0c335dcf59b2d701714a4a93fe /third_party/qcms
parente960d551aea3aa5ede7def77c70d58d0d5603089 (diff)
downloadchromium_src-89c17154c856d1940c2f54bf4214c8982f602c54.zip
chromium_src-89c17154c856d1940c2f54bf4214c8982f602c54.tar.gz
chromium_src-89c17154c856d1940c2f54bf4214c8982f602c54.tar.bz2
[qcms] Add a qcms_profile_get_white_point() api
BUG=565222 Review URL: https://codereview.chromium.org/1550513002 Cr-Commit-Position: refs/heads/master@{#366818}
Diffstat (limited to 'third_party/qcms')
-rw-r--r--third_party/qcms/README.chromium2
-rw-r--r--third_party/qcms/src/iccread.c13
-rw-r--r--third_party/qcms/src/qcms.h7
3 files changed, 22 insertions, 0 deletions
diff --git a/third_party/qcms/README.chromium b/third_party/qcms/README.chromium
index 4139e67..e7211bd 100644
--- a/third_party/qcms/README.chromium
+++ b/third_party/qcms/README.chromium
@@ -127,6 +127,8 @@ The following changes have been made since qcms was imported:
- http://code.google.com/p/chromium/issues/detail?id=565222
- Add an API to check for profile media white point
- http://code.google.com/p/chromium/issues/detail?id=565222
+ - Add a qcms_profile_get_white_point() api
+ - http://code.google.com/p/chromium/issues/detail?id=565222
For the Chromium changes, since the import, in a patch format run:
git diff b8456f38 src
diff --git a/third_party/qcms/src/iccread.c b/third_party/qcms/src/iccread.c
index 183840e..61b5312 100644
--- a/third_party/qcms/src/iccread.c
+++ b/third_party/qcms/src/iccread.c
@@ -348,6 +348,19 @@ qcms_bool qcms_profile_has_white_point(qcms_profile *profile)
return (wp.X != 0) && (wp.Y != 0) && (wp.Z != 0);
}
+qcms_xyz_float qcms_profile_get_white_point(qcms_profile *profile)
+{
+ qcms_xyz_float wp = { 0.0f, 0.0f, 0.0f };
+
+ if (qcms_profile_has_white_point(profile)) {
+ wp.X = s15Fixed16Number_to_float(profile->mediaWhitePoint.X);
+ wp.Y = s15Fixed16Number_to_float(profile->mediaWhitePoint.Y);
+ wp.Z = s15Fixed16Number_to_float(profile->mediaWhitePoint.Z);
+ }
+
+ return wp;
+}
+
#define TAG_bXYZ 0x6258595a
#define TAG_gXYZ 0x6758595a
#define TAG_rXYZ 0x7258595a
diff --git a/third_party/qcms/src/qcms.h b/third_party/qcms/src/qcms.h
index 790d2bc..4805375 100644
--- a/third_party/qcms/src/qcms.h
+++ b/third_party/qcms/src/qcms.h
@@ -95,6 +95,12 @@ typedef struct {
qcms_CIE_xyY blue;
} qcms_CIE_xyYTRIPLE;
+typedef struct {
+ float X;
+ float Y;
+ float Z;
+} qcms_xyz_float;
+
qcms_profile* qcms_profile_create_rgb_with_gamma(
qcms_CIE_xyY white_point,
qcms_CIE_xyYTRIPLE primaries,
@@ -112,6 +118,7 @@ void qcms_profile_release(qcms_profile *profile);
qcms_bool qcms_profile_is_bogus(qcms_profile *profile);
qcms_bool qcms_profile_has_white_point(qcms_profile *profile);
+qcms_xyz_float qcms_profile_get_white_point(qcms_profile *profile);
qcms_intent qcms_profile_get_rendering_intent(qcms_profile *profile);
qcms_color_space qcms_profile_get_color_space(qcms_profile *profile);
unsigned qcms_profile_get_version(qcms_profile *profile);