summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMarti Maria <marti.maria@littlecms.com>2022-07-24 10:42:59 +0200
committerMarti Maria <marti.maria@littlecms.com>2022-07-24 10:42:59 +0200
commit89c9d176b4349367ecd45f85b94aea3bf6f372c9 (patch)
treeac6ec6a28b7d6585db310d5d2cb0c8595e8832b5 /plugins
parent6849af422fd296cb8ce160d376978ef5d79f9417 (diff)
downloadlcms2-89c9d176b4349367ecd45f85b94aea3bf6f372c9.tar.gz
Fix CMYK range on fast float plugin
Range should be in %
Diffstat (limited to 'plugins')
-rw-r--r--plugins/fast_float/src/fast_float_tethra.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/plugins/fast_float/src/fast_float_tethra.c b/plugins/fast_float/src/fast_float_tethra.c
index 72c872b..ef4fccf 100644
--- a/plugins/fast_float/src/fast_float_tethra.c
+++ b/plugins/fast_float/src/fast_float_tethra.c
@@ -273,9 +273,29 @@ cmsBool OptimizeCLUTRGBTransform(_cmsTransform2Fn* TransformFn,
// Add the CLUT to the destination LUT
cmsPipelineInsertStage(OptimizedLUT, cmsAT_BEGIN, OptimizedCLUTmpe);
+ // If output is CMYK, add a conversion stage to get %
+ if (T_COLORSPACE(*OutputFormat) == PT_CMYK) {
+
+ static const cmsFloat64Number mat[] = { 100.0, 0, 0, 0,
+ 0, 100.0, 0, 0,
+ 0, 0, 100.0, 0,
+ 0, 0, 0, 100.0 };
+
+ cmsStage* percent = cmsStageAllocMatrix(ContextID, 4, 4, mat, NULL);
+ if (percent == NULL) goto Error;
+
+ cmsPipelineInsertStage(OriginalLut, cmsAT_END, percent);
+ }
+
// Resample the LUT
if (!cmsStageSampleCLutFloat(OptimizedCLUTmpe, XFormSampler, (void*)OriginalLut, 0)) goto Error;
+
+ if (T_COLORSPACE(*OutputFormat) == PT_CMYK) {
+
+ cmsPipelineUnlinkStage(OriginalLut, cmsAT_END, NULL);
+ }
+
// Set the evaluator, copy parameters
data = (_cmsStageCLutData*) cmsStageData(OptimizedCLUTmpe);