diff --git a/rtdata/languages/default b/rtdata/languages/default
index f4546245e..346c96a2d 100644
--- a/rtdata/languages/default
+++ b/rtdata/languages/default
@@ -707,10 +707,10 @@ HISTORY_MSG_475;PS - Equalize channel
HISTORY_MSG_476;CAM02 - Temp out
HISTORY_MSG_477;CAM02 - Green out
HISTORY_MSG_478;CAM02 - Yb out
-HISTORY_MSG_479;CAM02 - CAT adaptation out
-HISTORY_MSG_480;CAM02 - CAT auto out
-HISTORY_MSG_481;CAM02 - temp scene
-HISTORY_MSG_482;CAM02 - green scene
+HISTORY_MSG_479;CAM02 - CAT02 adaptation out
+HISTORY_MSG_480;CAM02 - Automatic CAT02 out
+HISTORY_MSG_481;CAM02 - Temp scene
+HISTORY_MSG_482;CAM02 - Green scene
HISTORY_NEWSNAPSHOT;Add
HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s
HISTORY_SNAPSHOT;Snapshot
diff --git a/rtengine/ciecam02.cc b/rtengine/ciecam02.cc
index c9053f8bd..5a2c96395 100644
--- a/rtengine/ciecam02.cc
+++ b/rtengine/ciecam02.cc
@@ -724,13 +724,18 @@ void Ciecam02::initcam1float(float gamu, float yb, float pilotd, float f, float
#endif
}
-void Ciecam02::initcam2(double gamu, double yb, double f, double la, double xw, double yw, double zw, double &n, double &d, double &nbb, double &ncb,
+void Ciecam02::initcam2(double gamu, double yb, double pilotd, double f, double la, double xw, double yw, double zw, double &n, double &d, double &nbb, double &ncb,
double &cz, double &aw, double &fl)
{
n = yb / yw;
+ if (pilotd == 2.0) {
+ d = d_factorfloat( f, la );
+ } else {
+ d = pilotd;
+ }
- d = d_factor( f, la );
+// d = d_factor( f, la );
fl = calculate_fl_from_la_ciecam02( la );
nbb = ncb = 0.725 * pow( 1.0 / n, 0.2 );
cz = 1.48 + sqrt( n );
diff --git a/rtengine/ciecam02.h b/rtengine/ciecam02.h
index 2e6e18295..76a7cf5bb 100644
--- a/rtengine/ciecam02.h
+++ b/rtengine/ciecam02.h
@@ -102,7 +102,7 @@ public:
static void initcam1(double gamu, double yb, double pilotd, double f, double la, double xw, double yw, double zw, double &n, double &d, double &nbb, double &ncb,
double &cz, double &aw, double &wh, double &pfl, double &fl, double &c);
- static void initcam2(double gamu, double yb, double f, double la, double xw, double yw, double zw, double &n, double &d, double &nbb, double &ncb,
+ static void initcam2(double gamu, double yb, double pilotd, double f, double la, double xw, double yw, double zw, double &n, double &d, double &nbb, double &ncb,
double &cz, double &aw, double &fl);
static void initcam1float(float gamu, float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb,
diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc
index f4fc7f734..a93238664 100644
--- a/rtengine/dcrop.cc
+++ b/rtengine/dcrop.cc
@@ -962,10 +962,10 @@ void Crop::update (int todo)
parent->ipf.ciecam_02float (cieCrop, float (adap), begh, endh, 1, 2, labnCrop, ¶ms, parent->customColCurve1, parent->customColCurve2, parent->customColCurve3,
dummy, dummy, parent->CAMBrightCurveJ, parent->CAMBrightCurveQ, parent->CAMMean, 5, skip, execsharp, d, dj, 1);
} else {
- double dd; // not used after this block
+ double dd, dj; // not used after this block
parent->ipf.ciecam_02 (cieCrop, adap, begh, endh, 1, 2, labnCrop, ¶ms, parent->customColCurve1, parent->customColCurve2, parent->customColCurve3,
- dummy, dummy, parent->CAMBrightCurveJ, parent->CAMBrightCurveQ, parent->CAMMean, 5, skip, execsharp, dd, 1);
+ dummy, dummy, parent->CAMBrightCurveJ, parent->CAMBrightCurveQ, parent->CAMMean, 5, skip, execsharp, dd, dj, 1);
}
} else {
// CIECAM is disbaled, we free up its image buffer to save some space
diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc
index 1429b3b68..5d56f01fd 100644
--- a/rtengine/improcfun.cc
+++ b/rtengine/improcfun.cc
@@ -210,7 +210,7 @@ void ImProcFunctions::firstAnalysis (const Imagefloat* const original, const Pro
// Copyright (c) 2012 Jacques Desmis
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,
- LUTu & histLCAM, LUTu & histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, double &d, int rtt)
+ LUTu & histLCAM, LUTu & histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, double &d, double &dj, int rtt)
{
if (params->colorappearance.enabled) {
//int lastskip;
@@ -264,9 +264,12 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
Yw = 1.0;
double Xw, Zw;
double Xwout, Zwout;
+ double Xwsc, Zwsc;
+
double f, c, nc, yb = 0., la, xw, yw, zw, f2 = 0., c2 = 0., nc2 = 0., yb2 = 0., la2;
double fl, n, nbb, ncb, aw;
double xwd = 0., ywd, zwd = 0.;
+ double xws, yws, zws;
int alg = 0;
bool algepd = false;
float sum = 0.f;
@@ -275,6 +278,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
ColorTemp::temp2mulxyz (params->wb.temperature, params->wb.green, params->wb.method, Xw, Zw); //compute white Xw Yw Zw : white current WB
ColorTemp::temp2mulxyz (params->colorappearance.tempout, params->colorappearance.greenout, "Custom", Xwout, Zwout);
+ ColorTemp::temp2mulxyz (params->colorappearance.tempsc, params->colorappearance.greensc, "Custom", Xwsc, Zwsc);
//viewing condition for surround
if (params->colorappearance.surround == "Average") {
@@ -362,6 +366,10 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
zwd = 100. * Zwout;
ywd = 100. / params->colorappearance.greenout;//approximation to simplify
+ xws = 100. * Xwsc;
+ zws = 100. * Zwsc;
+ yws = 100. / params->colorappearance.greensc;//approximation to simplify
+
/*
//settings mean Luminance Y of output device or viewing
if (settings->viewingdevicegrey == 0) {
@@ -397,6 +405,10 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
double deg = (params->colorappearance.degree) / 100.0;
double pilot = params->colorappearance.autodegree ? 2.0 : deg;
+
+ const float degout = (params->colorappearance.degreeout) / 100.0;
+ const float pilotout = params->colorappearance.autodegreeout ? 2.0 : degout;
+
//algoritm's params
float jli = params->colorappearance.jlight;
float chr = params->colorappearance.chroma;
@@ -551,19 +563,26 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
xw2 = xwd;
yw2 = ywd;
zw2 = zwd;
- } else { /*if(params->colorappearance.wbmodel == "RawTCAT02")*/
+ } else if(params->colorappearance.wbmodel == "RawTCAT02") {
xw1 = xw; // Settings RT WB are used for CAT02 => mix , CAT02 is use for output device (screen: D50 D65, projector: lamp, LED) see preferences
yw1 = yw;
zw1 = zw;
xw2 = xwd;
yw2 = ywd;
zw2 = zwd;
- }
+ }else if(params->colorappearance.wbmodel == "free") {
+ xw1 = xws; // free temp and green
+ yw1 = yws;
+ zw1 = zws;
+ xw2 = xwd;
+ yw2 = ywd;
+ zw2 = zwd;
+ }
double cz, wh, pfl;
Ciecam02::initcam1 (gamu, yb, pilot, f, la, xw, yw, zw, n, d, nbb, ncb, cz, aw, wh, pfl, fl, c);
- double nj, dj, nbbj, ncbj, czj, awj, flj;
- Ciecam02::initcam2 (gamu, yb2, f2, la2, xw2, yw2, zw2, nj, dj, nbbj, ncbj, czj, awj, flj);
+ double nj, nbbj, ncbj, czj, awj, flj;
+ Ciecam02::initcam2 (gamu, yb2, pilotout, f2, la2, xw2, yw2, zw2, nj, dj, nbbj, ncbj, czj, awj, flj);
diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h
index 6f8307141..5ef287139 100644
--- a/rtengine/improcfun.h
+++ b/rtengine/improcfun.h
@@ -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, int rtt);
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,
- LUTu &histLCAM, LUTu &histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, double &d, int rtt);
+ LUTu &histLCAM, LUTu &histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, double &d, double &dj, 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 vibrance (LabImage* lab);//Jacques' vibrance
void colorCurve (LabImage* lold, LabImage* lnew);
diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc
index cc70823ff..d72a69bab 100644
--- a/rtengine/simpleprocess.cc
+++ b/rtengine/simpleprocess.cc
@@ -1125,16 +1125,16 @@ private:
float d, dj;
ipf.ciecam_02float (cieView, float(adap), begh, endh, 1, 2, labView, ¶ms, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, d, dj, 1);
} else {
- double dd;
- ipf.ciecam_02 (cieView, adap, begh, endh, 1, 2, labView, ¶ms, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, dd, 1);
+ double dd, dj;
+ ipf.ciecam_02 (cieView, adap, begh, endh, 1, 2, labView, ¶ms, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, dd, dj, 1);
}
} else {
if(settings->ciecamfloat) {
float d, dj;
ipf.ciecam_02float (cieView, float(adap), begh, endh, 1, 2, labView, ¶ms, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, d, dj, 1);
} else {
- double dd;
- ipf.ciecam_02 (cieView, adap, begh, endh, 1, 2, labView, ¶ms, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, dd, 1);
+ double dd, dj;
+ ipf.ciecam_02 (cieView, adap, begh, endh, 1, 2, labView, ¶ms, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, dd, dj, 1);
}
}
}
diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc
index 983ea7552..ddf120c1a 100644
--- a/rtgui/colorappearance.cc
+++ b/rtgui/colorappearance.cc
@@ -171,8 +171,8 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
Gtk::Image* igreenR = Gtk::manage (new RTImage ("ajd-wb-green2.png"));
- tempsc = Gtk::manage (new Adjuster (M ("TP_WBALANCE_TEMPERATURE"), MINTEMP0, MAXTEMP0, 5, CENTERTEMP0, itempR, itempL, &wbSlider2Temp, &wbTemp2Slider));
- greensc = Gtk::manage (new Adjuster (M ("TP_WBALANCE_GREEN"), MINGREEN0, MAXGREEN0, 0.001, 1.0, igreenR, igreenL));
+ 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));
tempsc->show();
greensc->show();
@@ -474,8 +474,13 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
degreeout->set_tooltip_markup (M ("TP_COLORAPP_DEGREE_TOOLTIP"));
p3VBox->pack_start (*degreeout);
- tempout = Gtk::manage (new Adjuster (M ("TP_WBALANCE_TEMPERATURE"), MINTEMP0, MAXTEMP0, 5, CENTERTEMP0, itempR, itempL, &wbSlider2Temp, &wbTemp2Slider));
- greenout = Gtk::manage (new Adjuster (M ("TP_WBALANCE_GREEN"), MINGREEN0, MAXGREEN0, 0.001, 1.0, igreenR, igreenL));
+ Gtk::Image* itempL1 = Gtk::manage (new RTImage ("ajd-wb-temp1.png"));
+ Gtk::Image* itempR1 = Gtk::manage (new RTImage ("ajd-wb-temp2.png"));
+ Gtk::Image* igreenL1 = Gtk::manage (new RTImage ("ajd-wb-green1.png"));
+ Gtk::Image* igreenR1 = Gtk::manage (new RTImage ("ajd-wb-green2.png"));
+
+ 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));
ybout = Gtk::manage (new Adjuster (M ("TP_COLORAPP_YB"), 5, 50, 1, 18));
tempout->show();