diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/fast_float/src/fast_float_tethra.c | 20 |
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); |