fixed bug in discriminating between matrix and lut profiles for the OOG check
This commit is contained in:
@@ -24,15 +24,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gamutwarning.h"
|
#include "gamutwarning.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
namespace rtengine {
|
namespace rtengine {
|
||||||
|
|
||||||
GamutWarning::GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, bool gamutbpc):
|
GamutWarning::GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, RenderingIntent intent, bool gamutbpc):
|
||||||
lab2ref(nullptr),
|
lab2ref(nullptr),
|
||||||
lab2softproof(nullptr),
|
lab2softproof(nullptr),
|
||||||
softproof2ref(nullptr)
|
softproof2ref(nullptr)
|
||||||
{
|
{
|
||||||
if (cmsIsMatrixShaper(gamutprof)) {
|
if (cmsIsMatrixShaper(gamutprof) && !cmsIsCLUT(gamutprof, intent, LCMS_USED_AS_OUTPUT)) {
|
||||||
cmsHPROFILE aces = ICCStore::getInstance()->getProfile("ACES");
|
cmsHPROFILE aces = ICCStore::getInstance()->getProfile("ACES");
|
||||||
if (aces) {
|
if (aces) {
|
||||||
lab2ref = cmsCreateTransform(iprof, TYPE_Lab_FLT, aces, TYPE_RGB_FLT, INTENT_ABSOLUTE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE);
|
lab2ref = cmsCreateTransform(iprof, TYPE_Lab_FLT, aces, TYPE_RGB_FLT, INTENT_ABSOLUTE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE);
|
||||||
|
@@ -33,7 +33,7 @@ namespace rtengine {
|
|||||||
|
|
||||||
class GamutWarning: public NonCopyable {
|
class GamutWarning: public NonCopyable {
|
||||||
public:
|
public:
|
||||||
GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, bool bpc);
|
GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, RenderingIntent intent, bool bpc);
|
||||||
~GamutWarning();
|
~GamutWarning();
|
||||||
void markLine(Image8 *image, int y, float *srcbuf, float *buf1, float *buf2);
|
void markLine(Image8 *image, int y, float *srcbuf, float *buf1, float *buf2);
|
||||||
|
|
||||||
|
@@ -298,6 +298,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile,
|
|||||||
cmsHPROFILE iprof = cmsCreateLab4Profile (nullptr);
|
cmsHPROFILE iprof = cmsCreateLab4Profile (nullptr);
|
||||||
cmsHPROFILE gamutprof = nullptr;
|
cmsHPROFILE gamutprof = nullptr;
|
||||||
cmsUInt32Number gamutbpc = 0;
|
cmsUInt32Number gamutbpc = 0;
|
||||||
|
RenderingIntent gamutintent = RI_RELATIVE;
|
||||||
|
|
||||||
bool softProofCreated = false;
|
bool softProofCreated = false;
|
||||||
|
|
||||||
@@ -345,6 +346,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile,
|
|||||||
if (params->icm.outputBPC) {
|
if (params->icm.outputBPC) {
|
||||||
gamutbpc = cmsFLAGS_BLACKPOINTCOMPENSATION;
|
gamutbpc = cmsFLAGS_BLACKPOINTCOMPENSATION;
|
||||||
}
|
}
|
||||||
|
gamutintent = outIntent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (gamutCheck) {
|
} else if (gamutCheck) {
|
||||||
@@ -362,6 +364,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile,
|
|||||||
if (settings->monitorBPC) {
|
if (settings->monitorBPC) {
|
||||||
gamutbpc = cmsFLAGS_BLACKPOINTCOMPENSATION;
|
gamutbpc = cmsFLAGS_BLACKPOINTCOMPENSATION;
|
||||||
}
|
}
|
||||||
|
gamutintent = monitorIntent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!softProofCreated) {
|
if (!softProofCreated) {
|
||||||
@@ -375,7 +378,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (gamutCheck) {
|
if (gamutCheck) {
|
||||||
gamutWarning.reset(new GamutWarning(iprof, gamutprof, gamutbpc));
|
gamutWarning.reset(new GamutWarning(iprof, gamutprof, gamutintent, gamutbpc));
|
||||||
}
|
}
|
||||||
|
|
||||||
cmsCloseProfile (iprof);
|
cmsCloseProfile (iprof);
|
||||||
|
Reference in New Issue
Block a user