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

Unified Diff: third_party/qcms/src/transform_util.c

Issue 2021663003: [qcms] Add API to get parametric gamma curve data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/qcms/src/qcms.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/qcms/src/transform_util.c
diff --git a/third_party/qcms/src/transform_util.c b/third_party/qcms/src/transform_util.c
index e60744742c393fdba7c68293066a47b1e2a0269d..c27a152d8abc6de4371a93db969abd174268cc43 100644
--- a/third_party/qcms/src/transform_util.c
+++ b/third_party/qcms/src/transform_util.c
@@ -637,3 +637,37 @@ void build_output_lut(struct curveType *trc,
}
}
+
+size_t qcms_profile_get_parametric_curve(qcms_profile *profile, qcms_trc_channel channel, float data[7])
+{
+ static const uint32_t COUNT_TO_LENGTH[5] = {1, 3, 4, 5, 7};
+ struct curveType *curve = NULL;
+ size_t size;
+
+ if (profile->color_space != RGB_SIGNATURE)
+ return 0;
+
+ switch(channel) {
+ case QCMS_TRC_RED:
+ curve = profile->redTRC;
+ break;
+ case QCMS_TRC_GREEN:
+ curve = profile->greenTRC;
+ break;
+ case QCMS_TRC_BLUE:
+ curve = profile->blueTRC;
+ break;
+ default:
+ return 0;
+ }
+
+ if (!curve || curve->type != PARAMETRIC_CURVE_TYPE)
+ return 0;
+
+ size = COUNT_TO_LENGTH[curve->count];
+
+ if (data)
+ memcpy(data, curve->parameter, size * sizeof(float));
+
+ return size;
+}
« no previous file with comments | « third_party/qcms/src/qcms.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698