Other changes for Elle

This commit is contained in:
Desmis 2017-08-14 08:21:35 +02:00
parent be82e1bde2
commit 0bb824e2c1
13 changed files with 199 additions and 46 deletions

View File

@ -1347,6 +1347,7 @@ TP_COLORAPP_TCMODE_LABEL2;Curve mode 2
TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode
TP_COLORAPP_TCMODE_LIGHTNESS;Lightness TP_COLORAPP_TCMODE_LIGHTNESS;Lightness
TP_COLORAPP_TCMODE_SATUR;Saturation TP_COLORAPP_TCMODE_SATUR;Saturation
TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always Tint=1.\nA temp=2856\nD50 temp=5001\nD55 temp=5500\nD65 temp=6504\nD75 temp=7500
TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 TP_COLORAPP_TONECIE;Tone mapping using CIECAM02
TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect.
TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output]

View File

@ -962,10 +962,10 @@ void Crop::update (int todo)
parent->ipf.ciecam_02float (cieCrop, float (adap), begh, endh, 1, 2, labnCrop, &params, parent->customColCurve1, parent->customColCurve2, parent->customColCurve3, parent->ipf.ciecam_02float (cieCrop, float (adap), begh, endh, 1, 2, labnCrop, &params, parent->customColCurve1, parent->customColCurve2, parent->customColCurve3,
dummy, dummy, parent->CAMBrightCurveJ, parent->CAMBrightCurveQ, parent->CAMMean, 5, skip, execsharp, d, dj, yb, 1); dummy, dummy, parent->CAMBrightCurveJ, parent->CAMBrightCurveQ, parent->CAMMean, 5, skip, execsharp, d, dj, yb, 1);
} else { } else {
double dd, dj; // not used after this block double dd, dj, yb; // not used after this block
parent->ipf.ciecam_02 (cieCrop, adap, begh, endh, 1, 2, labnCrop, &params, parent->customColCurve1, parent->customColCurve2, parent->customColCurve3, parent->ipf.ciecam_02 (cieCrop, adap, begh, endh, 1, 2, labnCrop, &params, parent->customColCurve1, parent->customColCurve2, parent->customColCurve3,
dummy, dummy, parent->CAMBrightCurveJ, parent->CAMBrightCurveQ, parent->CAMMean, 5, skip, execsharp, dd, dj, 1); dummy, dummy, parent->CAMBrightCurveJ, parent->CAMBrightCurveQ, parent->CAMMean, 5, skip, execsharp, dd, dj, yb, 1);
} }
} else { } else {
// CIECAM is disbaled, we free up its image buffer to save some space // CIECAM is disbaled, we free up its image buffer to save some space

View File

@ -772,8 +772,12 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
acListener->autoCamChanged(100.*(double)d, 100.*(double)dj); acListener->autoCamChanged(100.*(double)d, 100.*(double)dj);
} }
if((params.colorappearance.autoadapscen || params.colorappearance.autoybscen) && acListener && params.colorappearance.enabled) { if(params.colorappearance.autoadapscen && acListener && params.colorappearance.enabled) {
acListener->adapCamChanged(adap, (int) yb); //real value of adapt scene luminosity and Yb scene acListener->adapCamChanged(adap); //real value of adapt scene
}
if(params.colorappearance.autoybscen && acListener && params.colorappearance.enabled) {
acListener->ybCamChanged((int) yb); //real value Yb scene
} }
readyphase++; readyphase++;

View File

@ -210,7 +210,7 @@ void ImProcFunctions::firstAnalysis (const Imagefloat* const original, const Pro
// Copyright (c) 2012 Jacques Desmis <jdesmis@gmail.com> // Copyright (c) 2012 Jacques Desmis <jdesmis@gmail.com>
void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh, int pW, int pwb, LabImage* lab, const ProcParams* params, void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh, int pW, int pwb, LabImage* lab, const ProcParams* params,
const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve2, const ColorAppearance & customColCurve3, const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve2, const ColorAppearance & customColCurve3,
LUTu & histLCAM, LUTu & histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, double &d, double &dj, int rtt) LUTu & histLCAM, LUTu & histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, double &d, double &dj, double &yb, int rtt)
{ {
if (params->colorappearance.enabled) { if (params->colorappearance.enabled) {
//int lastskip; //int lastskip;
@ -266,7 +266,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
double Xwout, Zwout; double Xwout, Zwout;
double Xwsc, Zwsc; double Xwsc, Zwsc;
double f, c, nc, yb = 0., la, xw, yw, zw, f2 = 0., c2 = 0., nc2 = 0., yb2 = 0., la2; double f = 0., c = 0., nc = 0., yb = 0., la, xw, yw, zw, f2 = 0., c2 = 0., nc2 = 0., yb2 = 0., la2;
double fl, n, nbb, ncb, aw; double fl, n, nbb, ncb, aw;
double xwd = 0., ywd, zwd = 0.; double xwd = 0., ywd, zwd = 0.;
double xws, yws, zws; double xws, yws, zws;
@ -280,36 +280,50 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
ColorTemp::temp2mulxyz (params->colorappearance.tempout, params->colorappearance.greenout, "Custom", Xwout, Zwout); ColorTemp::temp2mulxyz (params->colorappearance.tempout, params->colorappearance.greenout, "Custom", Xwout, Zwout);
ColorTemp::temp2mulxyz (params->colorappearance.tempsc, params->colorappearance.greensc, "Custom", Xwsc, Zwsc); ColorTemp::temp2mulxyz (params->colorappearance.tempsc, params->colorappearance.greensc, "Custom", Xwsc, Zwsc);
//viewing condition for surround //viewing condition for surrsrc
if (params->colorappearance.surround == "Average") { if (params->colorappearance.surrsrc == "Average") {
f = 1.00; f = 1.00;
c = 0.69; c = 0.69;
nc = 1.00; nc = 1.00;
} else if (params->colorappearance.surrsrc == "Dim") {
f = 0.9;
c = 0.59;
nc = 0.9;
} else if (params->colorappearance.surrsrc == "Dark") {
f = 0.8;
c = 0.525;
nc = 0.8;
} else if (params->colorappearance.surrsrc == "ExtremelyDark") {
f = 0.8;
c = 0.41;
nc = 0.8;
}
//viewing condition for surround
if (params->colorappearance.surround == "Average") {
f2 = 1.0, c2 = 0.69, nc2 = 1.0; f2 = 1.0, c2 = 0.69, nc2 = 1.0;
} else if (params->colorappearance.surround == "Dim") { } else if (params->colorappearance.surround == "Dim") {
f2 = 0.9; f2 = 0.9;
c2 = 0.59; c2 = 0.59;
nc2 = 0.9; nc2 = 0.9;
f = 1.0, c = 0.69, nc = 1.0;
} else if (params->colorappearance.surround == "Dark") { } else if (params->colorappearance.surround == "Dark") {
f2 = 0.8; f2 = 0.8;
c2 = 0.525; c2 = 0.525;
nc2 = 0.8; nc2 = 0.8;
f = 1.0, c = 0.69, nc = 1.0;
} else if (params->colorappearance.surround == "ExtremelyDark") { } else if (params->colorappearance.surround == "ExtremelyDark") {
f2 = 0.8; f2 = 0.8;
c2 = 0.41; c2 = 0.41;
nc2 = 0.8; nc2 = 0.8;
f = 1.0, c = 0.69, nc = 1.0;
} }
/*
//scene condition for surround //scene condition for surround
if (params->colorappearance.surrsource) { if (params->colorappearance.surrsource) {
f = 0.85; // if user => source image has surround very dark f = 0.85; // if user => source image has surround very dark
c = 0.55; c = 0.55;
nc = 0.85; nc = 0.85;
} }
*/
//with which algorithme //with which algorithme
if (params->colorappearance.algo == "JC") { if (params->colorappearance.algo == "JC") {
alg = 0; alg = 0;
@ -513,7 +527,9 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
} }
} }
if (settings->viewinggreySc == 0) { //auto // if (settings->viewinggreySc == 0) { //auto
if (params->colorappearance.autoybscen && pwb == 2) {//auto
if (mean < 15.f) { if (mean < 15.f) {
yb = 3.0; yb = 3.0;
} else if (mean < 30.f) { } else if (mean < 30.f) {
@ -537,6 +553,8 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
} else { } else {
yb = 90.0; yb = 90.0;
} }
} else {
yb = params->colorappearance.ybscen;
} }
if (settings->viewinggreySc == 1) { if (settings->viewinggreySc == 1) {
@ -1514,7 +1532,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int
float Yw; float Yw;
Yw = 1.0; Yw = 1.0;
double Xw, Zw; double Xw, Zw;
float f, nc, la, c, xw, yw, zw, f2 = 1.f, c2 = 1.f, nc2 = 1.f, yb2; float f = 0.f, nc = 0.f, la, c = 0.f, xw, yw, zw, f2 = 1.f, c2 = 1.f, nc2 = 1.f, yb2;
float fl, n, nbb, ncb, aw; //d float fl, n, nbb, ncb, aw; //d
float xwd, ywd, zwd, xws, yws, zws; float xwd, ywd, zwd, xws, yws, zws;
int alg = 0; int alg = 0;
@ -1531,36 +1549,50 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int
ColorTemp::temp2mulxyz (params->colorappearance.tempout, params->colorappearance.greenout, "Custom", Xwout, Zwout); ColorTemp::temp2mulxyz (params->colorappearance.tempout, params->colorappearance.greenout, "Custom", Xwout, Zwout);
ColorTemp::temp2mulxyz (params->colorappearance.tempsc, params->colorappearance.greensc, "Custom", Xwsc, Zwsc); ColorTemp::temp2mulxyz (params->colorappearance.tempsc, params->colorappearance.greensc, "Custom", Xwsc, Zwsc);
//viewing condition for surround //viewing condition for surrsrc
if (params->colorappearance.surround == "Average") { if (params->colorappearance.surrsrc == "Average") {
f = 1.00f; f = 1.00f;
c = 0.69f; c = 0.69f;
nc = 1.00f; nc = 1.00f;
} else if (params->colorappearance.surrsrc == "Dim") {
f = 0.9f;
c = 0.59f;
nc = 0.9f;
} else if (params->colorappearance.surrsrc == "Dark") {
f = 0.8f;
c = 0.525f;
nc = 0.8f;
} else if (params->colorappearance.surrsrc == "ExtremelyDark") {
f = 0.8f;
c = 0.41f;
nc = 0.8f;
}
//viewing condition for surround
if (params->colorappearance.surround == "Average") {
f2 = 1.0f, c2 = 0.69f, nc2 = 1.0f; f2 = 1.0f, c2 = 0.69f, nc2 = 1.0f;
} else if (params->colorappearance.surround == "Dim") { } else if (params->colorappearance.surround == "Dim") {
f2 = 0.9f; f2 = 0.9f;
c2 = 0.59f; c2 = 0.59f;
nc2 = 0.9f; nc2 = 0.9f;
f = 1.0f, c = 0.69f, nc = 1.0f;
} else if (params->colorappearance.surround == "Dark") { } else if (params->colorappearance.surround == "Dark") {
f2 = 0.8f; f2 = 0.8f;
c2 = 0.525f; c2 = 0.525f;
nc2 = 0.8f; nc2 = 0.8f;
f = 1.0f, c = 0.69f, nc = 1.0f;
} else if (params->colorappearance.surround == "ExtremelyDark") { } else if (params->colorappearance.surround == "ExtremelyDark") {
f2 = 0.8f; f2 = 0.8f;
c2 = 0.41f; c2 = 0.41f;
nc2 = 0.8f; nc2 = 0.8f;
f = 1.0f, c = 0.69f, nc = 1.0f;
} }
/*
//scene condition for surround //scene condition for surround
if (params->colorappearance.surrsource) { if (params->colorappearance.surrsource) {
f = 0.85f; // if user => source image has surround very dark f = 0.85f; // if user => source image has surround very dark
c = 0.55f; c = 0.55f;
nc = 0.85f; nc = 0.85f;
} }
*/
//with which algorithm //with which algorithm
if (params->colorappearance.algo == "JC") { if (params->colorappearance.algo == "JC") {
alg = 0; alg = 0;

View File

@ -229,7 +229,7 @@ public:
LUTu &histLCAM, LUTu &histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, float &d, float &dj, float &yb, int rtt); LUTu &histLCAM, LUTu &histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, float &d, float &dj, float &yb, int rtt);
void ciecam_02 (CieImage* ncie, double adap, int begh, int endh, int pW, int pwb, LabImage* lab, const ProcParams* params, void ciecam_02 (CieImage* ncie, double adap, int begh, int endh, int pW, int pwb, LabImage* lab, const ProcParams* params,
const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve, const ColorAppearance & customColCurve3, const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve, const ColorAppearance & customColCurve3,
LUTu &histLCAM, LUTu &histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, double &d, double &dj, int rtt); LUTu &histLCAM, LUTu &histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, double &d, double &dj, double &yb, int rtt);
void chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, LUTf &acurve, LUTf &bcurve, LUTf & satcurve, LUTf & satclcurve, LUTf &clcurve, LUTf &curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLurve); void chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, LUTf &acurve, LUTf &bcurve, LUTf & satcurve, LUTf & satclcurve, LUTf &clcurve, LUTf &curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLurve);
void vibrance (LabImage* lab);//Jacques' vibrance void vibrance (LabImage* lab);//Jacques' vibrance
void colorCurve (LabImage* lold, LabImage* lnew); void colorCurve (LabImage* lold, LabImage* lnew);

View File

@ -1155,6 +1155,7 @@ void ProcParams::setDefaults ()
colorappearance.degreeout = 90; colorappearance.degreeout = 90;
colorappearance.autodegreeout = true; colorappearance.autodegreeout = true;
colorappearance.surround = "Average"; colorappearance.surround = "Average";
colorappearance.surrsrc = "Average";
colorappearance.adaplum = 16; colorappearance.adaplum = 16;
colorappearance.badpixsl = 0; colorappearance.badpixsl = 0;
colorappearance.adapscen = 2000.0; colorappearance.adapscen = 2000.0;
@ -2110,6 +2111,10 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b
keyFile.set_string ("Color appearance", "Surround", colorappearance.surround); keyFile.set_string ("Color appearance", "Surround", colorappearance.surround);
} }
if (!pedited || pedited->colorappearance.surrsrc) {
keyFile.set_string ("Color appearance", "Surrsrc", colorappearance.surrsrc);
}
// if (!pedited || pedited->colorappearance.backgrd) keyFile.set_integer ("Color appearance", "Background", colorappearance.backgrd); // if (!pedited || pedited->colorappearance.backgrd) keyFile.set_integer ("Color appearance", "Background", colorappearance.backgrd);
if (!pedited || pedited->colorappearance.adaplum) { if (!pedited || pedited->colorappearance.adaplum) {
keyFile.set_double ("Color appearance", "AdaptLum", colorappearance.adaplum); keyFile.set_double ("Color appearance", "AdaptLum", colorappearance.adaplum);
@ -5025,6 +5030,14 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited)
} }
} }
if (keyFile.has_key ("Color appearance", "Surrsrc")) {
colorappearance.surrsrc = keyFile.get_string ("Color appearance", "Surrsrc");
if (pedited) {
pedited->colorappearance.surrsrc = true;
}
}
// if (keyFile.has_key ("Color appearance", "Background")) {colorappearance.backgrd = keyFile.get_integer ("Color appearance", "Background"); if (pedited) pedited->colorappearance.backgrd = true; } // if (keyFile.has_key ("Color appearance", "Background")) {colorappearance.backgrd = keyFile.get_integer ("Color appearance", "Background"); if (pedited) pedited->colorappearance.backgrd = true; }
if (keyFile.has_key ("Color appearance", "AdaptLum")) { if (keyFile.has_key ("Color appearance", "AdaptLum")) {
colorappearance.adaplum = keyFile.get_double ("Color appearance", "AdaptLum"); colorappearance.adaplum = keyFile.get_double ("Color appearance", "AdaptLum");
@ -8326,6 +8339,7 @@ bool ProcParams::operator== (const ProcParams& other)
&& colorappearance.degreeout == other.colorappearance.degreeout && colorappearance.degreeout == other.colorappearance.degreeout
&& colorappearance.autodegreeout == other.colorappearance.autodegreeout && colorappearance.autodegreeout == other.colorappearance.autodegreeout
&& colorappearance.surround == other.colorappearance.surround && colorappearance.surround == other.colorappearance.surround
&& colorappearance.surrsrc == other.colorappearance.surrsrc
&& colorappearance.adapscen == other.colorappearance.adapscen && colorappearance.adapscen == other.colorappearance.adapscen
&& colorappearance.autoadapscen == other.colorappearance.autoadapscen && colorappearance.autoadapscen == other.colorappearance.autoadapscen
&& colorappearance.ybscen == other.colorappearance.ybscen && colorappearance.ybscen == other.colorappearance.ybscen

View File

@ -595,6 +595,7 @@ public:
eCTCModeId curveMode3; eCTCModeId curveMode3;
Glib::ustring surround; Glib::ustring surround;
Glib::ustring surrsrc;
double adapscen; double adapscen;
bool autoadapscen; bool autoadapscen;
int ybscen; int ybscen;

View File

@ -274,7 +274,9 @@ class AutoCamListener
public : public :
virtual ~AutoCamListener() {} virtual ~AutoCamListener() {}
virtual void autoCamChanged (double ccam, double ccamout) {} virtual void autoCamChanged (double ccam, double ccamout) {}
virtual void adapCamChanged (double cadap, int ybscn) {} virtual void adapCamChanged (double cadap) {}
virtual void ybCamChanged (int yb) {}
}; };
class AutoChromaListener class AutoChromaListener

View File

@ -1125,16 +1125,16 @@ private:
float d, dj, yb; float d, dj, yb;
ipf.ciecam_02float (cieView, float(adap), begh, endh, 1, 2, labView, &params, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, d, dj, yb, 1); ipf.ciecam_02float (cieView, float(adap), begh, endh, 1, 2, labView, &params, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, d, dj, yb, 1);
} else { } else {
double dd, dj; double dd, dj, yb;
ipf.ciecam_02 (cieView, adap, begh, endh, 1, 2, labView, &params, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, dd, dj, 1); ipf.ciecam_02 (cieView, adap, begh, endh, 1, 2, labView, &params, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, dd, dj, yb, 1);
} }
} else { } else {
if(settings->ciecamfloat) { if(settings->ciecamfloat) {
float d, dj, yb; float d, dj, yb;
ipf.ciecam_02float (cieView, float(adap), begh, endh, 1, 2, labView, &params, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, d, dj, yb, 1); ipf.ciecam_02float (cieView, float(adap), begh, endh, 1, 2, labView, &params, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, d, dj, yb, 1);
} else { } else {
double dd, dj; double dd, dj, yb;
ipf.ciecam_02 (cieView, adap, begh, endh, 1, 2, labView, &params, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, dd, dj, 1); ipf.ciecam_02 (cieView, adap, begh, endh, 1, 2, labView, &params, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, dd, dj, yb, 1);
} }
} }
} }

View File

@ -147,9 +147,25 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
degree->set_tooltip_markup (M ("TP_COLORAPP_DEGREE_TOOLTIP")); degree->set_tooltip_markup (M ("TP_COLORAPP_DEGREE_TOOLTIP"));
p1VBox->pack_start (*degree); p1VBox->pack_start (*degree);
surrsource = Gtk::manage (new Gtk::CheckButton (M ("TP_COLORAPP_SURSOURCE"))); // surrsource = Gtk::manage (new Gtk::CheckButton (M ("TP_COLORAPP_SURSOURCE")));
surrsource->set_tooltip_markup (M ("TP_COLORAPP_SURSOURCE_TOOLTIP")); // surrsource->set_tooltip_markup (M ("TP_COLORAPP_SURSOURCE_TOOLTIP"));
p1VBox->pack_start (*surrsource, Gtk::PACK_SHRINK);
Gtk::HBox* surrHBox1 = Gtk::manage (new Gtk::HBox ());
surrHBox1->set_spacing (2);
surrHBox1->set_tooltip_markup (M ("TP_COLORAPP_SURROUND_TOOLTIP"));
Gtk::Label* surrLabel1 = Gtk::manage (new Gtk::Label (M ("TP_COLORAPP_SURROUND") + ":"));
surrHBox1->pack_start (*surrLabel1, Gtk::PACK_SHRINK);
surrsrc = Gtk::manage (new MyComboBoxText ());
surrsrc->append (M ("TP_COLORAPP_SURROUND_AVER"));
surrsrc->append (M ("TP_COLORAPP_SURROUND_DIM"));
surrsrc->append (M ("TP_COLORAPP_SURROUND_DARK"));
surrsrc->append (M ("TP_COLORAPP_SURROUND_EXDARK"));
surrsrc->set_active (0);
surrHBox1->pack_start (*surrsrc);
p1VBox->pack_start (*surrHBox1);
// p1VBox->pack_start (*surrsource, Gtk::PACK_SHRINK);
Gtk::HBox* wbmHBox = Gtk::manage (new Gtk::HBox ()); Gtk::HBox* wbmHBox = Gtk::manage (new Gtk::HBox ());
wbmHBox->set_spacing (2); wbmHBox->set_spacing (2);
@ -173,6 +189,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
tempsc = Gtk::manage (new Adjuster (M ("TP_WBALANCE_TEMPERATURE"), MINTEMP0, MAXTEMP0, 5, CENTERTEMP0, itempL, itempR, &wbSlider2Temp, &wbTemp2Slider)); tempsc = Gtk::manage (new Adjuster (M ("TP_WBALANCE_TEMPERATURE"), MINTEMP0, MAXTEMP0, 5, CENTERTEMP0, itempL, itempR, &wbSlider2Temp, &wbTemp2Slider));
greensc = Gtk::manage (new Adjuster (M ("TP_WBALANCE_GREEN"), MINGREEN0, MAXGREEN0, 0.001, 1.0, igreenL, igreenR)); greensc = Gtk::manage (new Adjuster (M ("TP_WBALANCE_GREEN"), MINGREEN0, MAXGREEN0, 0.001, 1.0, igreenL, igreenR));
tempsc->set_tooltip_markup (M ("TP_COLORAPP_TEMP_TOOLTIP"));
tempsc->show(); tempsc->show();
greensc->show(); greensc->show();
@ -502,6 +519,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
tempout = Gtk::manage (new Adjuster (M ("TP_WBALANCE_TEMPERATURE"), MINTEMP0, MAXTEMP0, 5, CENTERTEMP0, itempR1, itempL1, &wbSlider2Temp, &wbTemp2Slider)); tempout = Gtk::manage (new Adjuster (M ("TP_WBALANCE_TEMPERATURE"), MINTEMP0, MAXTEMP0, 5, CENTERTEMP0, itempR1, itempL1, &wbSlider2Temp, &wbTemp2Slider));
greenout = Gtk::manage (new Adjuster (M ("TP_WBALANCE_GREEN"), MINGREEN0, MAXGREEN0, 0.001, 1.0, igreenR1, igreenL1)); greenout = Gtk::manage (new Adjuster (M ("TP_WBALANCE_GREEN"), MINGREEN0, MAXGREEN0, 0.001, 1.0, igreenR1, igreenL1));
ybout = Gtk::manage (new Adjuster (M ("TP_COLORAPP_YB"), 5, 90, 1, 18)); ybout = Gtk::manage (new Adjuster (M ("TP_COLORAPP_YB"), 5, 90, 1, 18));
tempout->set_tooltip_markup (M ("TP_COLORAPP_TEMP_TOOLTIP"));
tempout->show(); tempout->show();
greenout->show(); greenout->show();
@ -572,10 +590,11 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
// ------------------------ Listening events // ------------------------ Listening events
surrconn = surrsource->signal_toggled().connect ( sigc::mem_fun (*this, &ColorAppearance::surrsource_toggled) ); // surrconn = surrsource->signal_toggled().connect ( sigc::mem_fun (*this, &ColorAppearance::surrsource_toggled) );
wbmodelconn = wbmodel->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::wbmodelChanged) ); wbmodelconn = wbmodel->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::wbmodelChanged) );
algoconn = algo->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::algoChanged) ); algoconn = algo->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::algoChanged) );
surroundconn = surround->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::surroundChanged) ); surroundconn = surround->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::surroundChanged) );
surrsrcconn = surrsrc->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::surrsrcChanged) );
degree->setAdjusterListener (this); degree->setAdjusterListener (this);
degreeout->setAdjusterListener (this); degreeout->setAdjusterListener (this);
@ -654,6 +673,9 @@ void ColorAppearance::neutral_pressed ()
shape->reset(); shape->reset();
shape2->reset(); shape2->reset();
shape3->reset(); shape3->reset();
gamutconn.block (true);
gamut->set_active (true);
gamutconn.block (false);
degree->setAutoValue (true); degree->setAutoValue (true);
degree->resetValue (false); degree->resetValue (false);
adapscen->resetValue (false); adapscen->resetValue (false);
@ -710,7 +732,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
contrast->setEditedState (pedited->colorappearance.contrast ? Edited : UnEdited); contrast->setEditedState (pedited->colorappearance.contrast ? Edited : UnEdited);
qcontrast->setEditedState (pedited->colorappearance.qcontrast ? Edited : UnEdited); qcontrast->setEditedState (pedited->colorappearance.qcontrast ? Edited : UnEdited);
colorh->setEditedState (pedited->colorappearance.colorh ? Edited : UnEdited); colorh->setEditedState (pedited->colorappearance.colorh ? Edited : UnEdited);
surrsource->set_inconsistent (!pedited->colorappearance.surrsource); // surrsource->set_inconsistent (!pedited->colorappearance.surrsource);
gamut->set_inconsistent (!pedited->colorappearance.gamut); gamut->set_inconsistent (!pedited->colorappearance.gamut);
// badpix->set_inconsistent (!pedited->colorappearance.badpix); // badpix->set_inconsistent (!pedited->colorappearance.badpix);
datacie->set_inconsistent (!pedited->colorappearance.datacie); datacie->set_inconsistent (!pedited->colorappearance.datacie);
@ -744,6 +766,25 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
setEnabled (pp->colorappearance.enabled); setEnabled (pp->colorappearance.enabled);
surrsrcconn.block (true);
if (pedited && !pedited->colorappearance.surrsrc) {
surrsrc->set_active (4);
} else if (pp->colorappearance.surrsrc == "Average") {
surrsrc->set_active (0);
} else if (pp->colorappearance.surrsrc == "Dim") {
surrsrc->set_active (1);
} else if (pp->colorappearance.surrsrc == "Dark") {
surrsrc->set_active (2);
} else if (pp->colorappearance.surrsrc == "ExtremelyDark") {
surrsrc->set_active (3);
}
surrsrcconn.block (false);
// Have to be manually called to handle initial state update
surrsrcChanged();
surroundconn.block (true); surroundconn.block (true);
if (pedited && !pedited->colorappearance.surround) { if (pedited && !pedited->colorappearance.surround) {
@ -762,6 +803,8 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
// Have to be manually called to handle initial state update // Have to be manually called to handle initial state update
surroundChanged(); surroundChanged();
wbmodelconn.block (true); wbmodelconn.block (true);
if (pedited && !pedited->colorappearance.wbmodel) { if (pedited && !pedited->colorappearance.wbmodel) {
@ -796,9 +839,9 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
// Have to be manually called to handle initial state update // Have to be manually called to handle initial state update
algoChanged(); algoChanged();
surrconn.block (true); // surrconn.block (true);
surrsource->set_active (pp->colorappearance.surrsource); // surrsource->set_active (pp->colorappearance.surrsource);
surrconn.block (false); // surrconn.block (false);
gamutconn.block (true); gamutconn.block (true);
gamut->set_active (pp->colorappearance.gamut); gamut->set_active (pp->colorappearance.gamut);
gamutconn.block (false); gamutconn.block (false);
@ -815,7 +858,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
// sharpcie->set_active (pp->colorappearance.sharpcie); // sharpcie->set_active (pp->colorappearance.sharpcie);
// sharpcieconn.block (false); // sharpcieconn.block (false);
lastsurr = pp->colorappearance.surrsource; // lastsurr = pp->colorappearance.surrsource;
lastgamut = pp->colorappearance.gamut; lastgamut = pp->colorappearance.gamut;
// lastbadpix=pp->colorappearance.badpix; // lastbadpix=pp->colorappearance.badpix;
lastdatacie = pp->colorappearance.datacie; lastdatacie = pp->colorappearance.datacie;
@ -890,7 +933,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited)
pp->colorappearance.qcontrast = qcontrast->getValue (); pp->colorappearance.qcontrast = qcontrast->getValue ();
pp->colorappearance.colorh = colorh->getValue (); pp->colorappearance.colorh = colorh->getValue ();
pp->colorappearance.rstprotection = rstprotection->getValue (); pp->colorappearance.rstprotection = rstprotection->getValue ();
pp->colorappearance.surrsource = surrsource->get_active(); // pp->colorappearance.surrsource = surrsource->get_active();
pp->colorappearance.gamut = gamut->get_active(); pp->colorappearance.gamut = gamut->get_active();
// pp->colorappearance.badpix = badpix->get_active(); // pp->colorappearance.badpix = badpix->get_active();
pp->colorappearance.datacie = datacie->get_active(); pp->colorappearance.datacie = datacie->get_active();
@ -953,9 +996,10 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited)
pedited->colorappearance.autoybscen = !ybscen->getAutoInconsistent(); pedited->colorappearance.autoybscen = !ybscen->getAutoInconsistent();
pedited->colorappearance.enabled = !get_inconsistent(); pedited->colorappearance.enabled = !get_inconsistent();
pedited->colorappearance.surround = surround->get_active_text() != M ("GENERAL_UNCHANGED"); pedited->colorappearance.surround = surround->get_active_text() != M ("GENERAL_UNCHANGED");
pedited->colorappearance.surrsrc = surrsrc->get_active_text() != M ("GENERAL_UNCHANGED");
pedited->colorappearance.wbmodel = wbmodel->get_active_text() != M ("GENERAL_UNCHANGED"); pedited->colorappearance.wbmodel = wbmodel->get_active_text() != M ("GENERAL_UNCHANGED");
pedited->colorappearance.algo = algo->get_active_text() != M ("GENERAL_UNCHANGED"); pedited->colorappearance.algo = algo->get_active_text() != M ("GENERAL_UNCHANGED");
pedited->colorappearance.surrsource = !surrsource->get_inconsistent(); // pedited->colorappearance.surrsource = !surrsource->get_inconsistent();
pedited->colorappearance.gamut = !gamut->get_inconsistent(); pedited->colorappearance.gamut = !gamut->get_inconsistent();
// pedited->colorappearance.badpix = !badpix->get_inconsistent(); // pedited->colorappearance.badpix = !badpix->get_inconsistent();
pedited->colorappearance.datacie = !datacie->get_inconsistent(); pedited->colorappearance.datacie = !datacie->get_inconsistent();
@ -975,6 +1019,17 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited)
} }
if (surrsrc->get_active_row_number() == 0) {
pp->colorappearance.surrsrc = "Average";
} else if (surrsrc->get_active_row_number() == 1) {
pp->colorappearance.surrsrc = "Dim";
} else if (surrsrc->get_active_row_number() == 2) {
pp->colorappearance.surrsrc = "Dark";
} else if (surrsrc->get_active_row_number() == 3) {
pp->colorappearance.surrsrc = "ExtremelyDark";
}
if (surround->get_active_row_number() == 0) { if (surround->get_active_row_number() == 0) {
pp->colorappearance.surround = "Average"; pp->colorappearance.surround = "Average";
} else if (surround->get_active_row_number() == 1) { } else if (surround->get_active_row_number() == 1) {
@ -1079,7 +1134,7 @@ bool ColorAppearance::curveMode3Changed_ ()
return false; return false;
} }
/*
void ColorAppearance::surrsource_toggled () void ColorAppearance::surrsource_toggled ()
{ {
@ -1104,7 +1159,7 @@ void ColorAppearance::surrsource_toggled ()
} }
} }
} }
*/
void ColorAppearance::gamut_toggled () void ColorAppearance::gamut_toggled ()
{ {
@ -1326,10 +1381,9 @@ bool ColorAppearance::autoCamComputed_ ()
return false; return false;
} }
void ColorAppearance::adapCamChanged (double cadap, int ybsc) void ColorAppearance::adapCamChanged (double cadap)
{ {
nextCadap = cadap; nextCadap = cadap;
nextYbscn = ybsc;
const auto func = [] (gpointer data) -> gboolean { const auto func = [] (gpointer data) -> gboolean {
static_cast<ColorAppearance*> (data)->adapCamComputed_(); static_cast<ColorAppearance*> (data)->adapCamComputed_();
@ -1345,12 +1399,35 @@ bool ColorAppearance::adapCamComputed_ ()
disableListener (); disableListener ();
// degree->setEnabled (true); // degree->setEnabled (true);
adapscen->setValue (nextCadap); adapscen->setValue (nextCadap);
ybscen->setValue (nextYbscn); // ybscen->setValue (nextYbscn);
enableListener (); enableListener ();
return false; return false;
} }
void ColorAppearance::ybCamChanged (int ybsc)
{
nextYbscn = ybsc;
const auto func = [] (gpointer data) -> gboolean {
static_cast<ColorAppearance*> (data)->ybCamComputed_();
return FALSE;
};
idle_register.add (func, this);
}
bool ColorAppearance::ybCamComputed_ ()
{
disableListener ();
// degree->setEnabled (true);
// adapscen->setValue (nextCadap);
ybscen->setValue (nextYbscn);
enableListener ();
return false;
}
void ColorAppearance::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller) void ColorAppearance::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller)
{ {
@ -1528,6 +1605,15 @@ void ColorAppearance::enabledChanged ()
} }
} }
void ColorAppearance::surrsrcChanged ()
{
if (listener && (multiImage || getEnabled()) ) {
listener->panelChanged (EvCATsurr, surrsrc->get_active_text ());
}
}
void ColorAppearance::surroundChanged () void ColorAppearance::surroundChanged ()
{ {
@ -1652,6 +1738,7 @@ void ColorAppearance::setBatchMode (bool batchMode)
greensc->showEditedCB (); greensc->showEditedCB ();
surround->append (M ("GENERAL_UNCHANGED")); surround->append (M ("GENERAL_UNCHANGED"));
surrsrc->append (M ("GENERAL_UNCHANGED"));
wbmodel->append (M ("GENERAL_UNCHANGED")); wbmodel->append (M ("GENERAL_UNCHANGED"));
algo->append (M ("GENERAL_UNCHANGED")); algo->append (M ("GENERAL_UNCHANGED"));
toneCurveMode->append (M ("GENERAL_UNCHANGED")); toneCurveMode->append (M ("GENERAL_UNCHANGED"));

View File

@ -49,6 +49,7 @@ public:
// void adjusterAdapToggled (Adjuster* a, bool newval); // void adjusterAdapToggled (Adjuster* a, bool newval);
void enabledChanged (); void enabledChanged ();
void surroundChanged (); void surroundChanged ();
void surrsrcChanged ();
void wbmodelChanged (); void wbmodelChanged ();
void algoChanged (); void algoChanged ();
void surrsource_toggled (); void surrsource_toggled ();
@ -59,8 +60,10 @@ public:
// void sharpcie_toggled (); // void sharpcie_toggled ();
void autoCamChanged (double ccam, double ccamout); void autoCamChanged (double ccam, double ccamout);
bool autoCamComputed_ (); bool autoCamComputed_ ();
void adapCamChanged (double cadap, int ybscn); void adapCamChanged (double cadap);
bool adapCamComputed_ (); bool adapCamComputed_ ();
void ybCamChanged (int yb);
bool ybCamComputed_ ();
void curveChanged (CurveEditor* ce); void curveChanged (CurveEditor* ce);
void curveMode1Changed (); void curveMode1Changed ();
@ -127,6 +130,8 @@ private:
Gtk::CheckButton* tonecie; Gtk::CheckButton* tonecie;
// Gtk::CheckButton* sharpcie; // Gtk::CheckButton* sharpcie;
Gtk::Button* neutral; Gtk::Button* neutral;
MyComboBoxText* surrsrc;
sigc::connection surrsrcconn;
MyComboBoxText* surround; MyComboBoxText* surround;
sigc::connection surroundconn; sigc::connection surroundconn;

View File

@ -178,6 +178,7 @@ void ParamsEdited::set (bool v)
colorappearance.degreeout = v; colorappearance.degreeout = v;
colorappearance.autodegreeout = v; colorappearance.autodegreeout = v;
colorappearance.surround = v; colorappearance.surround = v;
colorappearance.surrsrc = v;
colorappearance.adapscen = v; colorappearance.adapscen = v;
colorappearance.autoadapscen = v; colorappearance.autoadapscen = v;
colorappearance.ybscen = v; colorappearance.ybscen = v;
@ -708,6 +709,7 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
colorappearance.degreeout = colorappearance.degreeout && p.colorappearance.degreeout == other.colorappearance.degreeout; colorappearance.degreeout = colorappearance.degreeout && p.colorappearance.degreeout == other.colorappearance.degreeout;
colorappearance.autodegreeout = colorappearance.autodegreeout && p.colorappearance.autodegreeout == other.colorappearance.autodegreeout; colorappearance.autodegreeout = colorappearance.autodegreeout && p.colorappearance.autodegreeout == other.colorappearance.autodegreeout;
colorappearance.surround = colorappearance.surround && p.colorappearance.surround == other.colorappearance.surround; colorappearance.surround = colorappearance.surround && p.colorappearance.surround == other.colorappearance.surround;
colorappearance.surrsrc = colorappearance.surrsrc && p.colorappearance.surrsrc == other.colorappearance.surrsrc;
colorappearance.adapscen = colorappearance.adapscen && p.colorappearance.adapscen == other.colorappearance.adapscen; colorappearance.adapscen = colorappearance.adapscen && p.colorappearance.adapscen == other.colorappearance.adapscen;
colorappearance.autoadapscen = colorappearance.autoadapscen && p.colorappearance.autoadapscen == other.colorappearance.autoadapscen; colorappearance.autoadapscen = colorappearance.autoadapscen && p.colorappearance.autoadapscen == other.colorappearance.autoadapscen;
colorappearance.ybscen = colorappearance.ybscen && p.colorappearance.ybscen == other.colorappearance.ybscen; colorappearance.ybscen = colorappearance.ybscen && p.colorappearance.ybscen == other.colorappearance.ybscen;
@ -1735,6 +1737,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
toEdit.colorappearance.surround = mods.colorappearance.surround; toEdit.colorappearance.surround = mods.colorappearance.surround;
} }
if (colorappearance.surrsrc) {
toEdit.colorappearance.surrsrc = mods.colorappearance.surrsrc;
}
if (colorappearance.autoadapscen) { if (colorappearance.autoadapscen) {
toEdit.colorappearance.autoadapscen = mods.colorappearance.autoadapscen; toEdit.colorappearance.autoadapscen = mods.colorappearance.autoadapscen;
} }

View File

@ -294,6 +294,7 @@ public:
bool autoadapscen; bool autoadapscen;
bool autoybscen; bool autoybscen;
bool surround; bool surround;
bool surrsrc;
bool adapscen; bool adapscen;
bool adaplum; bool adaplum;
bool ybscen; bool ybscen;