Roll skia/third_party/skcms 78ee9e8..5b9549a (1 commits)

https://skia.googlesource.com/skcms.git/+log/78ee9e8..5b9549a

2018-05-09 brianosman@google.com Add utilities for programmatically making profiles


The AutoRoll server is located here: https://skcms-skia-roll.skia.org

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.



CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
TBR=egdaniel@google.com

Change-Id: I35b0a56b6a4e478cdf3442104ffda22131bc4d8d
Reviewed-on: https://skia-review.googlesource.com/127112
Reviewed-by: skcms-skia-autoroll <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Commit-Queue: skcms-skia-autoroll <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
diff --git a/third_party/skcms/skcms.h b/third_party/skcms/skcms.h
index 79d0abf..0451a58 100644
--- a/third_party/skcms/skcms.h
+++ b/third_party/skcms/skcms.h
@@ -16,6 +16,7 @@
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
+#include <string.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -238,6 +239,28 @@
                                        float wx, float wy,
                                        skcms_Matrix3x3* toXYZD50);
 
+// Utilities for programmatically constructing profiles
+static inline void skcms_Init(skcms_ICCProfile* p) {
+    memset(p, 0, sizeof(*p));
+    p->data_color_space = skcms_Signature_RGB;
+    p->pcs = skcms_Signature_XYZ;
+}
+
+static inline void skcms_SetTransferFunction(skcms_ICCProfile* p,
+                                             const skcms_TransferFunction* tf) {
+    p->has_trc = true;
+    for (int i = 0; i < 3; ++i) {
+        p->trc[i].table_entries = 0;
+        p->trc[i].parametric = *tf;
+        p->has_poly_tf[i] = false;
+    }
+}
+
+static inline void skcms_SetXYZD50(skcms_ICCProfile* p, const skcms_Matrix3x3* m) {
+    p->has_toXYZD50 = true;
+    p->toXYZD50 = *m;
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/third_party/skcms/version.sha1 b/third_party/skcms/version.sha1
index c733dd8..6a74e30 100755
--- a/third_party/skcms/version.sha1
+++ b/third_party/skcms/version.sha1
@@ -1 +1 @@
-78ee9e8913e0ab2ddb5208b7844b24f1301ce37e
\ No newline at end of file
+5b9549acaa26e3e2cae8919a0ee0e4cdeb59e1e8
\ No newline at end of file