From 17dc4af424f5d9543e8260a70515f2e720ddcf79 Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Sat, 17 Mar 2018 22:54:48 +0100 Subject: [PATCH] fixed bug in discriminating between matrix and lut profiles for the OOG check --- rtengine/gamutwarning.cc | 5 +++-- rtengine/gamutwarning.h | 2 +- rtengine/improcfun.cc | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/rtengine/gamutwarning.cc b/rtengine/gamutwarning.cc index a52f08429..dde784db5 100644 --- a/rtengine/gamutwarning.cc +++ b/rtengine/gamutwarning.cc @@ -24,15 +24,16 @@ */ #include "gamutwarning.h" +#include namespace rtengine { -GamutWarning::GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, bool gamutbpc): +GamutWarning::GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, RenderingIntent intent, bool gamutbpc): lab2ref(nullptr), lab2softproof(nullptr), softproof2ref(nullptr) { - if (cmsIsMatrixShaper(gamutprof)) { + if (cmsIsMatrixShaper(gamutprof) && !cmsIsCLUT(gamutprof, intent, LCMS_USED_AS_OUTPUT)) { cmsHPROFILE aces = ICCStore::getInstance()->getProfile("ACES"); if (aces) { lab2ref = cmsCreateTransform(iprof, TYPE_Lab_FLT, aces, TYPE_RGB_FLT, INTENT_ABSOLUTE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE); diff --git a/rtengine/gamutwarning.h b/rtengine/gamutwarning.h index 2e21883d4..be6d7b61b 100644 --- a/rtengine/gamutwarning.h +++ b/rtengine/gamutwarning.h @@ -33,7 +33,7 @@ namespace rtengine { class GamutWarning: public NonCopyable { public: - GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, bool bpc); + GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, RenderingIntent intent, bool bpc); ~GamutWarning(); void markLine(Image8 *image, int y, float *srcbuf, float *buf1, float *buf2); diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index c50c4f6f5..44edd8b17 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -298,6 +298,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile, cmsHPROFILE iprof = cmsCreateLab4Profile (nullptr); cmsHPROFILE gamutprof = nullptr; cmsUInt32Number gamutbpc = 0; + RenderingIntent gamutintent = RI_RELATIVE; bool softProofCreated = false; @@ -345,6 +346,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile, if (params->icm.outputBPC) { gamutbpc = cmsFLAGS_BLACKPOINTCOMPENSATION; } + gamutintent = outIntent; } } } else if (gamutCheck) { @@ -362,6 +364,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile, if (settings->monitorBPC) { gamutbpc = cmsFLAGS_BLACKPOINTCOMPENSATION; } + gamutintent = monitorIntent; } if (!softProofCreated) { @@ -375,7 +378,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile, } if (gamutCheck) { - gamutWarning.reset(new GamutWarning(iprof, gamutprof, gamutbpc)); + gamutWarning.reset(new GamutWarning(iprof, gamutprof, gamutintent, gamutbpc)); } cmsCloseProfile (iprof);