merge with dev
This commit is contained in:
@@ -305,7 +305,7 @@ void ImProcFunctions::updateColorProfiles(const Glib::ustring& monitorProfile, R
|
||||
#if !defined(__APPLE__) // No support for monitor profiles on OS X, all data is sRGB
|
||||
monitor = ICCStore::getInstance()->getProfile(monitorProfile);
|
||||
#else
|
||||
monitor = ICCStore::getInstance()->getProfile("RT_sRGB");
|
||||
monitor = ICCStore::getInstance()->getProfile (options.rtSettings.srgb);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -333,7 +333,7 @@ void ImProcFunctions::updateColorProfiles(const Glib::ustring& monitorProfile, R
|
||||
}
|
||||
outIntent = settings->printerIntent;
|
||||
} else {
|
||||
oprof = ICCStore::getInstance()->getProfile(params->icm.output);
|
||||
oprof = ICCStore::getInstance()->getProfile(params->icm.outputProfile);
|
||||
if (params->icm.outputBPC) {
|
||||
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
|
||||
}
|
||||
@@ -406,7 +406,7 @@ void ImProcFunctions::updateColorProfiles(const Glib::ustring& monitorProfile, R
|
||||
void ImProcFunctions::firstAnalysis(const Imagefloat* const original, const ProcParams ¶ms, LUTu & histogram)
|
||||
{
|
||||
|
||||
TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params.icm.working);
|
||||
TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.workingProfile);
|
||||
|
||||
lumimul[0] = wprof[1][0];
|
||||
lumimul[1] = wprof[1][1];
|
||||
@@ -971,7 +971,7 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb
|
||||
|
||||
|
||||
//matrix for current working space
|
||||
TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.working);
|
||||
TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.workingProfile);
|
||||
const float wip[3][3] = {
|
||||
{ (float)wiprof[0][0], (float)wiprof[0][1], (float)wiprof[0][2]},
|
||||
{ (float)wiprof[1][0], (float)wiprof[1][1], (float)wiprof[1][2]},
|
||||
@@ -2061,8 +2061,8 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
|
||||
}
|
||||
}
|
||||
|
||||
TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.working);
|
||||
TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.working);
|
||||
TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params->icm.workingProfile);
|
||||
TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.workingProfile);
|
||||
|
||||
float toxyz[3][3] = {
|
||||
{
|
||||
@@ -2171,7 +2171,7 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
|
||||
hald_clut = CLUTStore::getInstance().getClut(params->filmSimulation.clutFilename);
|
||||
|
||||
if (hald_clut) {
|
||||
clutAndWorkingProfilesAreSame = hald_clut->getProfile() == params->icm.working;
|
||||
clutAndWorkingProfilesAreSame = hald_clut->getProfile() == params->icm.workingProfile;
|
||||
|
||||
if (!clutAndWorkingProfilesAreSame) {
|
||||
xyz2clut = ICCStore::getInstance()->workingSpaceInverseMatrix(hald_clut->getProfile());
|
||||
@@ -2200,7 +2200,7 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
|
||||
const float comp = (max(0.0, expcomp) + 1.0) * hlcompr / 100.0;
|
||||
const float shoulder = ((65536.0 / max(1.0f, exp_scale)) * (hlcomprthresh / 200.0)) + 0.1;
|
||||
const float hlrange = 65536.0 - shoulder;
|
||||
const bool isProPhoto = (params->icm.working == "ProPhoto");
|
||||
const bool isProPhoto = (params->icm.workingProfile == "ProPhoto");
|
||||
// extracting datas from 'params' to avoid cache flush (to be confirmed)
|
||||
ToneCurveParams::TcMode curveMode = params->toneCurve.curveMode;
|
||||
ToneCurveParams::TcMode curveMode2 = params->toneCurve.curveMode2;
|
||||
@@ -2217,12 +2217,12 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
|
||||
|
||||
if (hasToneCurve1 && curveMode == ToneCurveParams::TcMode::PERCEPTUAL) {
|
||||
const PerceptualToneCurve& userToneCurve = static_cast<const PerceptualToneCurve&>(customToneCurve1);
|
||||
userToneCurve.initApplyState(ptc1ApplyState, params->icm.working);
|
||||
userToneCurve.initApplyState (ptc1ApplyState, params->icm.workingProfile);
|
||||
}
|
||||
|
||||
if (hasToneCurve2 && curveMode2 == ToneCurveParams::TcMode::PERCEPTUAL) {
|
||||
const PerceptualToneCurve& userToneCurve = static_cast<const PerceptualToneCurve&>(customToneCurve2);
|
||||
userToneCurve.initApplyState(ptc2ApplyState, params->icm.working);
|
||||
userToneCurve.initApplyState (ptc2ApplyState, params->icm.workingProfile);
|
||||
}
|
||||
|
||||
bool hasColorToning = params->colorToning.enabled && bool (ctOpacityCurve) && bool (ctColorCurve) && params->colorToning.method != "LabGrid";
|
||||
@@ -4100,24 +4100,22 @@ void ImProcFunctions::labtoning(float r, float g, float b, float &ro, float &go,
|
||||
|
||||
// get the opacity and tweak it to preserve saturated colors
|
||||
//float l_ = Color::gamma_srgb(l*65535.f)/65535.f;
|
||||
float opacity;
|
||||
opacity = (1.f - min<float> (s / satLimit, 1.f) * (1.f - satLimitOpacity)) * ctOpacityCurve.lutOpacityCurve[l * 500.f];
|
||||
float opacity = (1.f - min<float> (s / satLimit, 1.f) * (1.f - satLimitOpacity)) * ctOpacityCurve.lutOpacityCurve[l * 500.f];
|
||||
float opacity2 = (1.f - min<float> (s / satLimit, 1.f) * (1.f - satLimitOpacity));
|
||||
|
||||
//float ro, go, bo;
|
||||
float lm = l;
|
||||
float chromat, luma;
|
||||
l *= 65535.f;
|
||||
float chromat = 0.f, luma = 0.f;
|
||||
|
||||
if (clToningcurve[lm * 65535.f] / (lm * 65535.f) < 1.f) {
|
||||
chromat = (clToningcurve[(lm) * 65535.f] / (lm * 65535.f)) - 1.f; //special effect
|
||||
} else {
|
||||
chromat = 1.f - SQR(SQR((lm * 65535.f) / clToningcurve[(lm) * 65535.f])); //apply C=f(L) acts on 'a' and 'b'
|
||||
if (clToningcurve[l] < l) {
|
||||
chromat = clToningcurve[l] / l - 1.f; //special effect
|
||||
} else if (clToningcurve[l] > l) {
|
||||
chromat = 1.f - SQR(SQR(l / clToningcurve[l])); //apply C=f(L) acts on 'a' and 'b'
|
||||
}
|
||||
|
||||
if (cl2Toningcurve[lm * 65535.f] / (lm * 65535.f) < 1.f) {
|
||||
luma = (cl2Toningcurve[(lm) * 65535.f] / (lm * 65535.f)) - 1.f; //special effect
|
||||
} else {
|
||||
luma = 1.f - SQR(SQR((lm * 65535.f) / (cl2Toningcurve[(lm) * 65535.f]))); //apply C2=f(L) acts only on 'b'
|
||||
if (cl2Toningcurve[l] < l) {
|
||||
luma = cl2Toningcurve[l] / l - 1.f; //special effect
|
||||
} else if (cl2Toningcurve[l] > l) {
|
||||
luma = 1.f - SQR(SQR(l / cl2Toningcurve[l])); //apply C2=f(L) acts only on 'b'
|
||||
}
|
||||
|
||||
if (algm == 1) {
|
||||
@@ -4264,19 +4262,19 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW
|
||||
// if(params->labCurve.avoidclip ){
|
||||
// parameter to adapt curve C=f(C) to gamut
|
||||
|
||||
if (params->icm.working == "ProPhoto") {
|
||||
if (params->icm.workingProfile == "ProPhoto") {
|
||||
adjustr = 1.2f; // 1.2 instead 1.0 because it's very rare to have C>170..
|
||||
} else if (params->icm.working == "Adobe RGB") {
|
||||
} else if (params->icm.workingProfile == "Adobe RGB") {
|
||||
adjustr = 1.8f;
|
||||
} else if (params->icm.working == "sRGB") {
|
||||
} else if (params->icm.workingProfile == "sRGB") {
|
||||
adjustr = 2.0f;
|
||||
} else if (params->icm.working == "WideGamut") {
|
||||
} else if (params->icm.workingProfile == "WideGamut") {
|
||||
adjustr = 1.2f;
|
||||
} else if (params->icm.working == "Beta RGB") {
|
||||
} else if (params->icm.workingProfile == "Beta RGB") {
|
||||
adjustr = 1.4f;
|
||||
} else if (params->icm.working == "BestRGB") {
|
||||
} else if (params->icm.workingProfile == "BestRGB") {
|
||||
adjustr = 1.4f;
|
||||
} else if (params->icm.working == "BruceRGB") {
|
||||
} else if (params->icm.workingProfile == "BruceRGB") {
|
||||
adjustr = 1.8f;
|
||||
}
|
||||
|
||||
@@ -4343,14 +4341,14 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW
|
||||
const bool gamutLch = settings->gamutLch;
|
||||
const float amountchroma = (float) settings->amchroma;
|
||||
|
||||
TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.working);
|
||||
TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.workingProfile);
|
||||
const double wip[3][3] = {
|
||||
{wiprof[0][0], wiprof[0][1], wiprof[0][2]},
|
||||
{wiprof[1][0], wiprof[1][1], wiprof[1][2]},
|
||||
{wiprof[2][0], wiprof[2][1], wiprof[2][2]}
|
||||
};
|
||||
|
||||
TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.working);
|
||||
TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params->icm.workingProfile);
|
||||
const double wp[3][3] = {
|
||||
{wprof[0][0], wprof[0][1], wprof[0][2]},
|
||||
{wprof[1][0], wprof[1][1], wprof[1][2]},
|
||||
|
||||
Reference in New Issue
Block a user