diff --git a/rtdata/languages/default b/rtdata/languages/default index bb33ef2ff..15303048a 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1096,6 +1096,17 @@ HISTORY_MSG_840;Local - CL Curve HISTORY_MSG_841;Local - LC curve HISTORY_MSG_842;Local - Contrast Threshold HISTORY_MSG_843;Local - Radius +HISTORY_MSG_845;Local - Log encoding +HISTORY_MSG_846;Local - Log encoding auto +HISTORY_MSG_847;Local - Log encoding Source +HISTORY_MSG_849;Local - Log encoding Source auto +HISTORY_MSG_850;Local - Log encoding B_Ev +HISTORY_MSG_851;Local - Log encoding W_Ev +HISTORY_MSG_852;Local - Log encoding Target +HISTORY_MSG_853;Local - Log encodind loc contrast +HISTORY_MSG_854;Local - Log encodind Scope +HISTORY_MSG_855;Local - Log encoding Entire image +HISTORY_MSG_856;Local - Log encoding Shadows range HISTORY_MSG_888;Local - Contrast Wavelet Balance Threshold HISTORY_MSG_889;Local - Contrast Wavelet Graduated Strength HISTORY_MSG_890;Local - Contrast Wavelet Graduated angle @@ -1166,6 +1177,7 @@ HISTORY_MSG_956;Local - CH Curve HISTORY_MSG_957;Local - Denoise mode HISTORY_MSG_958;Local - Show/hide settings HISTORY_MSG_959;Local - Inverse blur +HISTORY_MSG_960;Local - Log encoding - cat02 HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2386,6 +2398,7 @@ TP_LOCALLAB_BUTTON_DEL;Delete TP_LOCALLAB_BUTTON_DUPL;Duplicate TP_LOCALLAB_BUTTON_REN;Rename TP_LOCALLAB_BUTTON_VIS;Show/Hide +TP_LOCALLAB_CATAD;Chromatic adaptation - Cat02 TP_LOCALLAB_CBDL;Contrast by Detail Levels TP_LOCALLAB_CBDLCLARI_TOOLTIP;Enhances local contrast of the midtones. TP_LOCALLAB_CBDL_ADJ_TOOLTIP;Same as wavelets.\nThe first level (0) acts on 2x2 pixel details.\nThe last level (5) acts on 64x64 pixel details. diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 8f4c17a39..53d37ecad 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -2088,14 +2088,21 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab) double Xwout, Zwout; double Xwsc, Zwsc; - int tempo; + int tempo = 5000; if (params->locallab.spots.at(sp).warm > 0) { tempo = 5000 - 30 * params->locallab.spots.at(sp).warm; - } else { + } else if (params->locallab.spots.at(sp).warm < 0){ tempo = 5000 - 49 * params->locallab.spots.at(sp).warm; } + if (params->locallab.spots.at(sp).catad > 0) { + tempo = 5000 - 30 * params->locallab.spots.at(sp).catad; + } else if (params->locallab.spots.at(sp).catad < 0){ + tempo = 5000 - 49 * params->locallab.spots.at(sp).catad; + } + + ColorTemp::temp2mulxyz(params->wb.temperature, params->wb.method, Xw, Zw); //compute white Xw Yw Zw : white current WB ColorTemp::temp2mulxyz(tempo, "Custom", Xwout, Zwout); ColorTemp::temp2mulxyz(5000, "Custom", Xwsc, Zwsc); @@ -9686,6 +9693,9 @@ void ImProcFunctions::Lab_Local( log_encode(tmpImage.get(), lp, multiThread, bfw, bfh); rgb2lab(*(tmpImage.get()), *bufexpfin, params->icm.workingProfile); tmpImage.reset(); + if (params->locallab.spots.at(sp).catad != 0) { + ImProcFunctions::ciecamloc_02float(sp, bufexpfin.get()); + } //here begin graduated filter //first solution "easy" but we can do other with log_encode...to see the results diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 7c711a3da..b9d815612 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -982,6 +982,7 @@ enum ProcEventCode { EvlocallabquaMethod = 956, Evlocallabhishow = 957, Evlocallabinvbl = 958, + Evlocallabcatad = 959, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 0528f0e49..574123762 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3838,6 +3838,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : autocompute(false), sourceGray(10.), targetGray(18.), + catad(0.), Autogray(true), fullimage(true), blackEv(-5.0), @@ -4415,6 +4416,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && autocompute == other.autocompute && sourceGray == other.sourceGray && targetGray == other.targetGray + && catad == other.catad && Autogray == other.Autogray && fullimage == other.fullimage && blackEv == other.blackEv @@ -5949,6 +5951,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->autocompute, "Locallab", "Autocompute_" + index_str, spot.autocompute, keyFile); saveToKeyfile(!pedited || spot_edited->sourceGray, "Locallab", "SourceGray_" + index_str, spot.sourceGray, keyFile); saveToKeyfile(!pedited || spot_edited->targetGray, "Locallab", "TargetGray_" + index_str, spot.targetGray, keyFile); + saveToKeyfile(!pedited || spot_edited->catad, "Locallab", "Catad_" + index_str, spot.catad, keyFile); saveToKeyfile(!pedited || spot_edited->Autogray, "Locallab", "Autogray_" + index_str, spot.Autogray, keyFile); saveToKeyfile(!pedited || spot_edited->fullimage, "Locallab", "Fullimage_" + index_str, spot.fullimage, keyFile); saveToKeyfile(!pedited || spot_edited->blackEv, "Locallab", "BlackEv_" + index_str, spot.blackEv, keyFile); @@ -7725,6 +7728,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Autocompute_" + index_str, pedited, spot.autocompute, spotEdited.autocompute); assignFromKeyfile(keyFile, "Locallab", "SourceGray_" + index_str, pedited, spot.sourceGray, spotEdited.sourceGray); assignFromKeyfile(keyFile, "Locallab", "TargetGray_" + index_str, pedited, spot.targetGray, spotEdited.targetGray); + assignFromKeyfile(keyFile, "Locallab", "Catad_" + index_str, pedited, spot.catad, spotEdited.catad); assignFromKeyfile(keyFile, "Locallab", "AutoGray_" + index_str, pedited, spot.Autogray, spotEdited.Autogray); assignFromKeyfile(keyFile, "Locallab", "Fullimage_" + index_str, pedited, spot.fullimage, spotEdited.fullimage); assignFromKeyfile(keyFile, "Locallab", "BlackEv_" + index_str, pedited, spot.blackEv, spotEdited.blackEv); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 7cf8bf4a2..53a008a29 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1425,6 +1425,7 @@ struct LocallabParams { bool autocompute; double sourceGray; double targetGray; + double catad; bool Autogray; bool fullimage; double blackEv; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 255d080ac..6daf01621 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -985,7 +985,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // EvlocallabCHshape LUMINANCECURVE, //EvlocallabquaMethod LUMINANCECURVE, //Evlocallabhishow - LUMINANCECURVE // Evlocallabinvbl + LUMINANCECURVE, // Evlocallabinvbl + LUMINANCECURVE // Evlocallabcatad }; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index d66f6ab33..ff4062f0f 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -1200,6 +1200,7 @@ private: Gtk::Frame* const log2Frame; Adjuster* const targetGray; Adjuster* const detail; + Adjuster* const catad; Adjuster* const baselog; Adjuster* const sensilog; Adjuster* const strlog; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 918d1897c..67917c700 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -4662,6 +4662,7 @@ LocallabLog::LocallabLog(): log2Frame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LOG2FRA")))), targetGray(Gtk::manage(new Adjuster(M("TP_LOCALLAB_TARGET_GRAY"), 5.0, 80.0, 0.1, 18.0))), detail(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DETAIL"), 0., 1., 0.01, 0.6))), + catad(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CATAD"), -100., 100., 0.5, 0.))), baselog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BASELOG"), 1.3, 8., 0.05, 2., Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))), sensilog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), strlog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTR"), -2.0, 2.0, 0.05, 0.))), @@ -4686,6 +4687,8 @@ LocallabLog::LocallabLog(): detail->setAdjusterListener(this); + catad->setAdjusterListener(this); + baselog->setAdjusterListener(this); sensilog->setAdjusterListener(this); @@ -4715,6 +4718,7 @@ LocallabLog::LocallabLog(): ToolParamBlock* const logP2Box = Gtk::manage(new ToolParamBlock()); logP2Box->pack_start(*targetGray); logP2Box->pack_start(*detail); + logP2Box->pack_start(*catad); log2Frame->add(*logP2Box); pack_start(*log2Frame); // pack_start(*baselog); @@ -4849,6 +4853,7 @@ void LocallabLog::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedi spot.Autogray = Autogray->get_active(); spot.sourceGray = sourceGray->getValue(); spot.targetGray = targetGray->getValue(); + spot.catad = catad->getValue(); spot.detail = detail->getValue(); spot.baselog = baselog->getValue(); spot.sensilog = sensilog->getIntValue(); @@ -4871,6 +4876,7 @@ void LocallabLog::setDefaults(const rtengine::procparams::ProcParams* defParams, whiteEv->setDefault(defSpot.whiteEv); sourceGray->setDefault(defSpot.sourceGray); targetGray->setDefault(defSpot.targetGray); + catad->setDefault(defSpot.catad); detail->setDefault(defSpot.detail); baselog->setDefault(defSpot.baselog); sensilog->setDefault((double)defSpot.sensilog); @@ -4912,6 +4918,13 @@ void LocallabLog::adjusterChanged(Adjuster* a, double newval) } } + if (a == catad) { + if (listener) { + listener->panelChanged(Evlocallabcatad, + catad->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == detail) { if (listener) { listener->panelChanged(Evlocallabdetail, diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 94d706dc7..ae756feeb 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1497,6 +1497,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).autocompute = locallab.spots.at(j).autocompute && pSpot.autocompute == otherSpot.autocompute; locallab.spots.at(j).sourceGray = locallab.spots.at(j).sourceGray && pSpot.sourceGray == otherSpot.sourceGray; locallab.spots.at(j).targetGray = locallab.spots.at(j).targetGray && pSpot.targetGray == otherSpot.targetGray; + locallab.spots.at(j).catad = locallab.spots.at(j).catad && pSpot.catad == otherSpot.catad; locallab.spots.at(j).Autogray = locallab.spots.at(j).Autogray && pSpot.Autogray == otherSpot.Autogray; locallab.spots.at(j).fullimage = locallab.spots.at(j).fullimage && pSpot.fullimage == otherSpot.fullimage; locallab.spots.at(j).blackEv = locallab.spots.at(j).blackEv && pSpot.blackEv == otherSpot.blackEv; @@ -4855,6 +4856,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).targetGray = mods.locallab.spots.at(i).targetGray; } + if (locallab.spots.at(i).catad) { + toEdit.locallab.spots.at(i).catad = mods.locallab.spots.at(i).catad; + } + if (locallab.spots.at(i).Autogray) { toEdit.locallab.spots.at(i).Autogray = mods.locallab.spots.at(i).Autogray; } @@ -6641,6 +6646,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : autocompute(v), sourceGray(v), targetGray(v), + catad(v), Autogray(v), fullimage(v), blackEv(v), @@ -7136,6 +7142,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) autocompute = v; sourceGray = v; targetGray = v; + catad = v; Autogray = v; fullimage = v; blackEv = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 0cacef527..2a50b2cf1 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -833,6 +833,7 @@ public: bool autocompute; bool sourceGray; bool targetGray; + bool catad; bool Autogray; bool fullimage; bool blackEv;