diff --git a/rtdata/languages/default b/rtdata/languages/default index 607484d19..265266a7c 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -787,6 +787,7 @@ HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light HISTORY_MSG_SOFTLIGHT_STRENGTH;Soft light - Strength +HISTORY_MSG_TEMPOUT;CAM02 automatic temperature HISTORY_MSG_TM_FATTAL_ANCHOR;DRC - Anchor HISTORY_MSG_TRANS_Method;Geometry - Method HISTORY_MSG_WAVCLARI;Clarity @@ -1467,6 +1468,7 @@ TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode TP_COLORAPP_TCMODE_LIGHTNESS;Lightness TP_COLORAPP_TCMODE_SATUR;Saturation TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +TP_COLORAPP_TEMPOUT_TOOLTIP;Disable to chnage temperature and tint 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_VIEWING_ABSOLUTELUMINANCE_TOOLTIP;Absolute luminance of the viewing environment\n(usually 16 cd/m²). diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index f8a65bf8c..15d477fdc 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -1157,7 +1157,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) acListener->ybCamChanged((int) yb); //real value Yb scene } - if (params->colorappearance.enabled && params->colorappearance.presetcat02) { + if (params->colorappearance.enabled && params->colorappearance.presetcat02 && params->colorappearance.autotempout) { acListener->wbCamChanged(params->wb.temperature, params->wb.green); //real temp and tint } diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 1dee8375b..a6707fb86 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -1389,6 +1389,7 @@ ColorAppearanceParams::ColorAppearanceParams() : datacie(false), tonecie(false), tempout(5000), + autotempout(true), ybout(18), greenout(1.0), tempsc(5000), @@ -1435,6 +1436,7 @@ bool ColorAppearanceParams::operator ==(const ColorAppearanceParams& other) cons && datacie == other.datacie && tonecie == other.tonecie && tempout == other.tempout + && autotempout == other.autotempout && ybout == other.ybout && greenout == other.greenout && tempsc == other.tempsc @@ -3229,6 +3231,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->colorappearance.surrsource, "Color appearance", "SurrSource", colorappearance.surrsource, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.gamut, "Color appearance", "Gamut", colorappearance.gamut, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.tempout, "Color appearance", "Tempout", colorappearance.tempout, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.autotempout, "Color appearance", "Autotempout", colorappearance.autotempout, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.greenout, "Color appearance", "Greenout", colorappearance.greenout, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.tempsc, "Color appearance", "Tempsc", colorappearance.tempsc, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.greensc, "Color appearance", "Greensc", colorappearance.greensc, keyFile); @@ -4222,6 +4225,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Color appearance", "SurrSource", pedited, colorappearance.surrsource, pedited->colorappearance.surrsource); assignFromKeyfile(keyFile, "Color appearance", "Gamut", pedited, colorappearance.gamut, pedited->colorappearance.gamut); assignFromKeyfile(keyFile, "Color appearance", "Tempout", pedited, colorappearance.tempout, pedited->colorappearance.tempout); + assignFromKeyfile(keyFile, "Color appearance", "Autotempout", pedited, colorappearance.autotempout, pedited->colorappearance.autotempout); assignFromKeyfile(keyFile, "Color appearance", "Greenout", pedited, colorappearance.greenout, pedited->colorappearance.greenout); assignFromKeyfile(keyFile, "Color appearance", "Tempsc", pedited, colorappearance.tempsc, pedited->colorappearance.tempsc); assignFromKeyfile(keyFile, "Color appearance", "Greensc", pedited, colorappearance.greensc, pedited->colorappearance.greensc); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 034577cb6..17cf64a69 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -676,6 +676,7 @@ struct ColorAppearanceParams { bool datacie; bool tonecie; int tempout; + bool autotempout; int ybout; double greenout; int tempsc; diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index fff35a94c..ace7affd6 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -220,7 +220,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" auto m = ProcEventMapper::getInstance(); Evcatpreset = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_CAT02PRESET"); - + EvCATAutotempout = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_TEMPOUT"); //preset button cat02 presetcat02 = Gtk::manage (new Gtk::CheckButton (M ("TP_COLORAPP_PRESETCAT02"))); presetcat02->set_tooltip_markup (M("TP_COLORAPP_PRESETCAT02_TIP")); @@ -627,6 +627,8 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" 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_MEANLUMINANCE"), 5, 90, 1, 18)); tempout->set_tooltip_markup (M ("TP_COLORAPP_TEMP_TOOLTIP")); + tempout->throwOnButtonRelease(); + tempout->addAutoButton (M ("TP_COLORAPP_TEMPOUT_TOOLTIP")); tempout->show(); greenout->show(); @@ -768,6 +770,7 @@ void ColorAppearance::neutral_pressed () qcontrast->resetValue (false); colorh->resetValue (false); tempout->resetValue (false); + tempout->setAutoValue (true); greenout->resetValue (false); ybout->resetValue (false); tempsc->resetValue (false); @@ -856,6 +859,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) adapscen->setAutoInconsistent (multiImage && !pedited->colorappearance.autoadapscen); ybscen->setAutoInconsistent (multiImage && !pedited->colorappearance.autoybscen); set_inconsistent (multiImage && !pedited->colorappearance.enabled); + tempout->setAutoInconsistent (multiImage && !pedited->colorappearance.autotempout); shape->setUnChanged (!pedited->colorappearance.curve); shape2->setUnChanged (!pedited->colorappearance.curve2); @@ -982,6 +986,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) lastAutoAdapscen = pp->colorappearance.autoadapscen; lastAutoDegreeout = pp->colorappearance.autodegreeout; lastAutoybscen = pp->colorappearance.autoybscen; + lastAutotempout = pp->colorappearance.autotempout; degree->setValue (pp->colorappearance.degree); degree->setAutoValue (pp->colorappearance.autodegree); @@ -1004,6 +1009,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) qcontrast->setValue (pp->colorappearance.qcontrast); colorh->setValue (pp->colorappearance.colorh); tempout->setValue (pp->colorappearance.tempout); + tempout->setAutoValue (pp->colorappearance.autotempout); greenout->setValue (pp->colorappearance.greenout); ybout->setValue (pp->colorappearance.ybout); tempsc->setValue (pp->colorappearance.tempsc); @@ -1060,6 +1066,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited) pp->colorappearance.curve2 = shape2->getCurve (); pp->colorappearance.curve3 = shape3->getCurve (); pp->colorappearance.tempout = tempout->getValue (); + pp->colorappearance.autotempout = tempout->getAutoValue (); pp->colorappearance.greenout = greenout->getValue (); pp->colorappearance.ybout = ybout->getValue (); pp->colorappearance.tempsc = tempsc->getValue (); @@ -1135,6 +1142,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited) pedited->colorappearance.tempsc = tempsc->getEditedState (); pedited->colorappearance.greensc = greensc->getEditedState (); pedited->colorappearance.presetcat02 = presetcat02->get_inconsistent (); + pedited->colorappearance.autotempout = !tempout->getAutoInconsistent(); } @@ -1771,7 +1779,16 @@ void ColorAppearance::adjusterAutoToggled(Adjuster* a) ybscen->setAutoInconsistent (true); } - lastAutoybscen = ybscen->getAutoValue(); + lastAutotempout = tempout->getAutoValue(); + + if (tempout->getAutoInconsistent()) { + tempout->setAutoInconsistent (false); + tempout->setAutoValue (false); + } else if (lastAutotempout) { + tempout->setAutoInconsistent (true); + } + + lastAutotempout = tempout->getAutoValue(); } @@ -1818,6 +1835,15 @@ void ColorAppearance::adjusterAutoToggled(Adjuster* a) } } + if (a == tempout) { + if (tempout->getAutoInconsistent()) { + listener->panelChanged (EvCATAutotempout, M ("GENERAL_UNCHANGED")); + } else if (tempout->getAutoValue()) { + listener->panelChanged (EvCATAutotempout, M ("GENERAL_ENABLED")); + } else { + listener->panelChanged (EvCATAutotempout, M ("GENERAL_DISABLED")); + } + } } } diff --git a/rtgui/colorappearance.h b/rtgui/colorappearance.h index 2f060edea..863787118 100644 --- a/rtgui/colorappearance.h +++ b/rtgui/colorappearance.h @@ -101,7 +101,7 @@ public: private: rtengine::ProcEvent Evcatpreset; - + rtengine::ProcEvent EvCATAutotempout; bool bgTTipQuery (int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip); bool srTTipQuery (int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip); void foldAllButMe (GdkEventButton* event, MyExpander *expander); @@ -174,6 +174,7 @@ private: bool lastAutoAdapscen; bool lastAutoDegreeout; bool lastAutoybscen; + bool lastAutotempout; bool lastsurr; bool lastgamut; bool lastdatacie; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 448b1316c..52eb7dbe6 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -243,6 +243,7 @@ void ParamsEdited::set(bool v) colorappearance.curveMode2 = v; colorappearance.curveMode3 = v; colorappearance.tempout = v; + colorappearance.autotempout = v; colorappearance.greenout = v; colorappearance.ybout = v; colorappearance.tempsc = v; @@ -834,6 +835,7 @@ void ParamsEdited::initFrom(const std::vector& colorappearance.curveMode2 = colorappearance.curveMode2 && p.colorappearance.curveMode2 == other.colorappearance.curveMode2; colorappearance.curveMode3 = colorappearance.curveMode3 && p.colorappearance.curveMode3 == other.colorappearance.curveMode3; colorappearance.tempout = colorappearance.tempout && p.colorappearance.tempout == other.colorappearance.tempout; + colorappearance.autotempout = colorappearance.autotempout && p.colorappearance.autotempout == other.colorappearance.autotempout; colorappearance.greenout = colorappearance.greenout && p.colorappearance.greenout == other.colorappearance.greenout; colorappearance.ybout = colorappearance.ybout && p.colorappearance.ybout == other.colorappearance.ybout; colorappearance.tempsc = colorappearance.tempsc && p.colorappearance.tempsc == other.colorappearance.tempsc; @@ -2016,6 +2018,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.colorappearance.tempout = mods.colorappearance.tempout; } + if (colorappearance.autotempout) { + toEdit.colorappearance.autotempout = mods.colorappearance.autotempout; + } + if (colorappearance.greenout) { toEdit.colorappearance.greenout = mods.colorappearance.greenout; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 47985400e..938f1bf97 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -290,6 +290,7 @@ struct ColorAppearanceParamsEdited { bool datacie; bool tonecie; bool tempout; + bool autotempout; bool greenout; bool ybout; bool tempsc;