aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party
diff options
context:
space:
mode:
Diffstat (limited to 'third_party')
-rw-r--r--third_party/skcms/skcms.h23
-rwxr-xr-xthird_party/skcms/version.sha12
2 files changed, 24 insertions, 1 deletions
diff --git a/third_party/skcms/skcms.h b/third_party/skcms/skcms.h
index 79d0abf5cd..0451a582e3 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 @@ SKCMS_API bool skcms_PrimariesToXYZD50(float rx, float ry,
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 c733dd87f7..6a74e30c81 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