Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix boolean with lut generation for pq profile.

Wolthera van Hövell tot Westerflier8914011ac10a
diff --git a/plugins/color/lcms2engine/colorprofiles/LcmsPredefinedPipelineFunctions.cpp b/plugins/color/lcms2engine/colorprofiles/LcmsPredefinedPipelineFunctions.cpp
index 314ab9c35e..0e80182621 100644
--- a/plugins/color/lcms2engine/colorprofiles/LcmsPredefinedPipelineFunctions.cpp
+++ b/plugins/color/lcms2engine/colorprofiles/LcmsPredefinedPipelineFunctions.cpp
@@ -108,7 +108,7 @@ cmsInt32Number samplePQDummyClut(const cmsUInt16Number In[], cmsUInt16Number Out
const float val = float(In[i])/65535.0;
cmsUInt16Number finalResult = In[i];
- if (!helper->toXYZ) {
+ if (helper->toXYZ) {
const float lin = removeSmpte2048Curve(val);
finalResult = qBound(0, qRound( applyHLGCurve(lin / scale) * 65535 ), 65535);
} else {
@@ -136,6 +136,7 @@ bool LcmsPredefinedPipelineFunctions::setPerceptualQuantizerAToBDummyPipeline(cm
cmsStage *clutStage = cmsStageAllocCLut16bit(nullptr, lutSize, 3, 3, nullptr);
perceptualDummyHelper helper;
+ helper.toXYZ = true;
cmsStageSampleCLut16bit(clutStage, &samplePQDummyClut, &helper, 0);
cmsPipelineInsertStage(a2B, cmsAT_END, clutStage);