First batch of variable name normalisation in ICM tool, see #4478
This commit is contained in:
@@ -367,21 +367,21 @@ private:
|
||||
float multip = 1.f;
|
||||
float adjustr = 1.f;
|
||||
|
||||
if (params.icm.working == "ProPhoto") {
|
||||
if (params.icm.workingProfile == "ProPhoto") {
|
||||
adjustr = 1.f; //
|
||||
} else if (params.icm.working == "Adobe RGB") {
|
||||
} else if (params.icm.workingProfile == "Adobe RGB") {
|
||||
adjustr = 1.f / 1.3f;
|
||||
} else if (params.icm.working == "sRGB") {
|
||||
} else if (params.icm.workingProfile == "sRGB") {
|
||||
adjustr = 1.f / 1.3f;
|
||||
} else if (params.icm.working == "WideGamut") {
|
||||
} else if (params.icm.workingProfile == "WideGamut") {
|
||||
adjustr = 1.f / 1.1f;
|
||||
} else if (params.icm.working == "Rec2020") {
|
||||
} else if (params.icm.workingProfile == "Rec2020") {
|
||||
adjustr = 1.f / 1.1f;
|
||||
} else if (params.icm.working == "Beta RGB") {
|
||||
} else if (params.icm.workingProfile == "Beta RGB") {
|
||||
adjustr = 1.f / 1.2f;
|
||||
} else if (params.icm.working == "BestRGB") {
|
||||
} else if (params.icm.workingProfile == "BestRGB") {
|
||||
adjustr = 1.f / 1.2f;
|
||||
} else if (params.icm.working == "BruceRGB") {
|
||||
} else if (params.icm.workingProfile == "BruceRGB") {
|
||||
adjustr = 1.f / 1.2f;
|
||||
}
|
||||
|
||||
@@ -610,21 +610,21 @@ private:
|
||||
float MinRMoy = 0.f;
|
||||
float MinBMoy = 0.f;
|
||||
|
||||
if (params.icm.working == "ProPhoto") {
|
||||
if (params.icm.workingProfile == "ProPhoto") {
|
||||
adjustr = 1.f;
|
||||
} else if (params.icm.working == "Adobe RGB") {
|
||||
} else if (params.icm.workingProfile == "Adobe RGB") {
|
||||
adjustr = 1.f / 1.3f;
|
||||
} else if (params.icm.working == "sRGB") {
|
||||
} else if (params.icm.workingProfile == "sRGB") {
|
||||
adjustr = 1.f / 1.3f;
|
||||
} else if (params.icm.working == "WideGamut") {
|
||||
} else if (params.icm.workingProfile == "WideGamut") {
|
||||
adjustr = 1.f / 1.1f;
|
||||
} else if (params.icm.working == "Rec2020") {
|
||||
} else if (params.icm.workingProfile == "Rec2020") {
|
||||
adjustr = 1.f / 1.1f;
|
||||
} else if (params.icm.working == "Beta RGB") {
|
||||
} else if (params.icm.workingProfile == "Beta RGB") {
|
||||
adjustr = 1.f / 1.2f;
|
||||
} else if (params.icm.working == "BestRGB") {
|
||||
} else if (params.icm.workingProfile == "BestRGB") {
|
||||
adjustr = 1.f / 1.2f;
|
||||
} else if (params.icm.working == "BruceRGB") {
|
||||
} else if (params.icm.workingProfile == "BruceRGB") {
|
||||
adjustr = 1.f / 1.2f;
|
||||
}
|
||||
|
||||
@@ -876,17 +876,17 @@ private:
|
||||
const int W = baseImg->getWidth();
|
||||
const int H = baseImg->getHeight();
|
||||
LabImage labcbdl (W, H);
|
||||
ipf.rgb2lab (*baseImg, labcbdl, params.icm.working);
|
||||
ipf.rgb2lab (*baseImg, labcbdl, params.icm.workingProfile);
|
||||
ipf.dirpyrequalizer (&labcbdl, 1);
|
||||
ipf.lab2rgb (labcbdl, *baseImg, params.icm.working);
|
||||
ipf.lab2rgb (labcbdl, *baseImg, params.icm.workingProfile);
|
||||
}
|
||||
|
||||
|
||||
//gamma TRC working
|
||||
{
|
||||
if (params.icm.wtrcin == "Custom") { //exec TRC IN free
|
||||
if (params.icm.workingTRC == "Custom") { //exec TRC IN free
|
||||
Glib::ustring profile;
|
||||
profile = params.icm.working;
|
||||
profile = params.icm.workingProfile;
|
||||
|
||||
if (profile == "sRGB" || profile == "Adobe RGB" || profile == "ProPhoto" || profile == "WideGamut" || profile == "BruceRGB" || profile == "Beta RGB" || profile == "BestRGB" || profile == "Rec2020" || profile == "ACESp0" || profile == "ACESp1") {
|
||||
int cw = baseImg->getWidth();
|
||||
@@ -897,7 +897,7 @@ private:
|
||||
int mul = -5;
|
||||
double gga = 2.4, ssl = 12.92;
|
||||
|
||||
readyImg0 = ipf.workingtrc(baseImg, cw, ch, mul, params.icm.working, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6);
|
||||
readyImg0 = ipf.workingtrc(baseImg, cw, ch, mul, params.icm.workingProfile, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6);
|
||||
#pragma omp parallel for
|
||||
|
||||
for (int row = 0; row < ch; row++) {
|
||||
@@ -911,9 +911,9 @@ private:
|
||||
delete readyImg0;
|
||||
//adjust TRC
|
||||
Imagefloat* readyImg = NULL;
|
||||
gga = params.icm.gamm, ssl = params.icm.slop;
|
||||
gga = params.icm.outputGamma, ssl = params.icm.outputSlope;
|
||||
mul = 5;
|
||||
readyImg = ipf.workingtrc(baseImg, cw, ch, mul, params.icm.working, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6);
|
||||
readyImg = ipf.workingtrc(baseImg, cw, ch, mul, params.icm.workingProfile, gga, ssl, ga0, ga1, ga2, ga3, ga4, ga5, ga6);
|
||||
#pragma omp parallel for
|
||||
|
||||
for (int row = 0; row < ch; row++) {
|
||||
@@ -955,7 +955,7 @@ private:
|
||||
bool opautili = false;
|
||||
|
||||
if (params.colorToning.enabled) {
|
||||
TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.working);
|
||||
TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.workingProfile);
|
||||
double wp[3][3] = {
|
||||
{wprof[0][0], wprof[0][1], wprof[0][2]},
|
||||
{wprof[1][0], wprof[1][1], wprof[1][2]},
|
||||
@@ -1282,7 +1282,7 @@ private:
|
||||
bool useLCMS = false;
|
||||
bool bwonly = params.blackwhite.enabled && !params.colorToning.enabled && !autili && !butili ;
|
||||
|
||||
if (params.icm.freegamma /*!= "Free" || params.icm.freegamma*/) {
|
||||
if (params.icm.customOutputProfile /*!= "Custom" || params.icm.customOutputProfile*/) {
|
||||
|
||||
GammaValues ga;
|
||||
// if(params.blackwhite.enabled) params.toneCurve.hrenabled=false;
|
||||
@@ -1304,7 +1304,7 @@ private:
|
||||
readyImg = ipf.lab2rgbOut (labView, cx, cy, cw, ch, params.icm);
|
||||
|
||||
if (settings->verbose) {
|
||||
printf ("Output profile_: \"%s\"\n", params.icm.output.c_str());
|
||||
printf ("Output profile_: \"%s\"\n", params.icm.outputProfile.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1363,21 +1363,21 @@ private:
|
||||
} else {
|
||||
// use the selected output profile if present, otherwise use LCMS2 profile generate by lab2rgb16 w/ gamma
|
||||
|
||||
if (params.icm.output != "" && params.icm.output != ColorManagementParams::NoICMString) {
|
||||
if (params.icm.outputProfile != "" && params.icm.outputProfile != ColorManagementParams::NoICMString) {
|
||||
|
||||
// if ICCStore::getInstance()->getProfile send back an object, then ICCStore::getInstance()->getContent will do too
|
||||
cmsHPROFILE jprof = ICCStore::getInstance()->getProfile (params.icm.output); //get outProfile
|
||||
cmsHPROFILE jprof = ICCStore::getInstance()->getProfile (params.icm.outputProfile); //get outProfile
|
||||
|
||||
if (jprof == nullptr) {
|
||||
if (settings->verbose) {
|
||||
printf ("\"%s\" ICC output profile not found!\n - use LCMS2 substitution\n", params.icm.output.c_str());
|
||||
printf ("\"%s\" ICC output profile not found!\n - use LCMS2 substitution\n", params.icm.outputProfile.c_str());
|
||||
}
|
||||
} else {
|
||||
if (settings->verbose) {
|
||||
printf ("Using \"%s\" output profile\n", params.icm.output.c_str());
|
||||
printf ("Using \"%s\" output profile\n", params.icm.outputProfile.c_str());
|
||||
}
|
||||
|
||||
ProfileContent pc = ICCStore::getInstance()->getContent (params.icm.output);
|
||||
ProfileContent pc = ICCStore::getInstance()->getContent (params.icm.outputProfile);
|
||||
readyImg->setOutputProfile (pc.getData().c_str(), pc.getData().size());
|
||||
}
|
||||
} else {
|
||||
@@ -1424,7 +1424,7 @@ private:
|
||||
double scale_factor = ipf.resizeScale (¶ms, fw, fh, imw, imh);
|
||||
|
||||
std::unique_ptr<LabImage> tmplab (new LabImage (fw, fh));
|
||||
ipf.rgb2lab (*baseImg, *tmplab, params.icm.working);
|
||||
ipf.rgb2lab (*baseImg, *tmplab, params.icm.workingProfile);
|
||||
|
||||
if (params.crop.enabled) {
|
||||
int cx = params.crop.x;
|
||||
@@ -1461,7 +1461,7 @@ private:
|
||||
|
||||
delete baseImg;
|
||||
baseImg = new Imagefloat (fw, fh);
|
||||
ipf.lab2rgb (*tmplab, *baseImg, params.icm.working);
|
||||
ipf.lab2rgb (*tmplab, *baseImg, params.icm.workingProfile);
|
||||
}
|
||||
|
||||
void adjust_procparams (double scale_factor)
|
||||
|
||||
Reference in New Issue
Block a user