diff --git a/rtdata/languages/default b/rtdata/languages/default index 7a7920af0..d24aa19e6 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -974,6 +974,8 @@ HISTORY_MSG_731;Local - median method HISTORY_MSG_732;Local - median iterations HISTORY_MSG_733;Local - soft radius HISTORY_MSG_734;Local - threshold +HISTORY_MSG_738;Local - Local contrast Merge L +HISTORY_MSG_739;Local - Local contrast Merge C HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2063,6 +2065,10 @@ TP_LOCALLAB_CHRRT;Chroma TP_LOCALLAB_CIRCRADIUS;Spot size TP_LOCALLAB_COFR;Color & Light - Small defects : red eyes, dust TP_LOCALLAB_EXPCOLOR_TOOLTIP;In the case of small defects.\n\nRed-eyes : red-centered circular selector, spot delimiters close to the eye, weak scope, "lightness" -100, "chrominance" -100.\n\nSpotIR :Circular selector centered on the defect, spot delimiters close to the default - reduce "chrominance", possibly act on "scope" to reduce the extent of the action.\n\nDust - grease (small) :Circular selector centered on the defect (adapt the size of the spot), spot delimiters not too close to the defect to allow an inconspicuous transition. a) "Transition" (low values) and "Transition weak" (high values); b) act on "lightness" and possibly on "chrominance" or "Color correction grid - direct" to approach the rendering of the polluted zone to that of the healthy zone; c) act moderately on "scope" to modulate the desired action.\n\nYou can also complete with Gaussian blur (Smooth Blur and noise) +TP_LOCALLAB_CLARILRES;Merge Luma +TP_LOCALLAB_CLARICRES;Merge Chroma +TP_LOCALLAB_CLARIFRA;Sharp mask and Clarity +TP_LOCALLAB_CLARI_TOOLTIP;Under or equal level wavelet 4 Sharp mask is used.\nAbove level wavelet 5 Clarity is used. TP_LOCALLAB_CONTRAST;Contrast TP_LOCALLAB_CURV;Lightness - Contrast - Chrominance "Super" TP_LOCALLAB_CURVNONE;Disable curves diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 10b7e966e..5ec59e867 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -764,6 +764,8 @@ enum ProcEventCode { EvlocallabshowmaskcolMethodinv = 734, EvlocallabshowmaskexpMethodinv = 735, EvlocallabshowmaskSHMethodinv = 736, + Evlocallabclarilres = 737, + Evlocallabclaricres = 738, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 187ab3234..634b6d48e 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2543,6 +2543,8 @@ LocallabParams::LocallabSpot::LocallabSpot() : lclightness(1.0), levelwav(4), residcont(0.0), + clarilres(0.0), + claricres(0.0), sensilc(19), fftwlc(false), localcontMethod("loc"), @@ -2794,6 +2796,8 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && lclightness == other.lclightness && levelwav == other.levelwav && residcont == other.residcont + && clarilres == other.clarilres + && claricres == other.claricres && sensilc == other.sensilc && fftwlc == other.fftwlc && localcontMethod == other.localcontMethod @@ -4026,6 +4030,8 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).lclightness, "Locallab", "Lclightness_" + std::to_string(i), spot.lclightness, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).levelwav, "Locallab", "Levelwav_" + std::to_string(i), spot.levelwav, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).residcont, "Locallab", "Residcont_" + std::to_string(i), spot.residcont, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).clarilres, "Locallab", "ClariLres_" + std::to_string(i), spot.clarilres, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).claricres, "Locallab", "ClariCres_" + std::to_string(i), spot.claricres, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensilc, "Locallab", "Sensilc_" + std::to_string(i), spot.sensilc, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).fftwlc, "Locallab", "Fftwlc_" + std::to_string(i), spot.fftwlc, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).localcontMethod, "Locallab", "localcontMethod_" + std::to_string(i), spot.localcontMethod, keyFile); @@ -5380,6 +5386,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Lclightness_" + std::to_string(i), pedited, spot.lclightness, spotEdited.lclightness); assignFromKeyfile(keyFile, "Locallab", "Levelwav_" + std::to_string(i), pedited, spot.levelwav, spotEdited.levelwav); assignFromKeyfile(keyFile, "Locallab", "Residcont_" + std::to_string(i), pedited, spot.residcont, spotEdited.residcont); + assignFromKeyfile(keyFile, "Locallab", "ClariLres_" + std::to_string(i), pedited, spot.clarilres, spotEdited.clarilres); + assignFromKeyfile(keyFile, "Locallab", "ClariCres_" + std::to_string(i), pedited, spot.claricres, spotEdited.claricres); assignFromKeyfile(keyFile, "Locallab", "Sensilc_" + std::to_string(i), pedited, spot.sensilc, spotEdited.sensilc); assignFromKeyfile(keyFile, "Locallab", "Fftwlc_" + std::to_string(i), pedited, spot.fftwlc, spotEdited.fftwlc); assignFromKeyfile(keyFile, "Locallab", "localcontMethod_" + std::to_string(i), pedited, spot.localcontMethod, spotEdited.localcontMethod); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 1825be05f..94f82514e 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1144,6 +1144,8 @@ struct LocallabParams { double lclightness; int levelwav; double residcont; + double clarilres; + double claricres; int sensilc; bool fftwlc; Glib::ustring localcontMethod; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 4a3eb67c8..a3bf765be 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -763,7 +763,9 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabepsbl LUMINANCECURVE, // EvlocallabshowmaskcolMethodinv LUMINANCECURVE, // EvlocallabshowmaskexpMethodinv - LUMINANCECURVE // EvlocallabshowmaskSHMethodinv + LUMINANCECURVE, // EvlocallabshowmaskSHMethodinv + LUMINANCECURVE, //Evlocallabclarilres + LUMINANCECURVE //Evlocallabclaricres }; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index d2df90387..3b8b962c0 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -293,6 +293,8 @@ Locallab::Locallab(): lclightness(Gtk::manage(new Adjuster(M("TP_LOCALCONTRAST_LIGHTNESS"), 0, 3.0, 0.01, 1.0))), levelwav(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LEVELWAV"), 3, 9, 1, 4))), residcont(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCONT"), -100, 100, 1, 0))), + clarilres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARILRES"), -20., 100., 0.5, 0.))), + claricres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARICRES"), -20., 100., 0.5, 0.))), sensilc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIS"), 0, 100, 1, 19))), // Contrast by detail levels chromacbdl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMACBDL"), 0., 1.5, 0.01, 0.))), @@ -399,6 +401,7 @@ Locallab::Locallab(): gridFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABGRID")))), pdeFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_PDEFRA")))), residFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RESID")))), + clariFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_CLARIFRA")))), // Others defparams(nullptr), @@ -1481,6 +1484,10 @@ Locallab::Locallab(): // localcontMethod->set_tooltip_markup(M("TP_LOCALLAB_LOCMETHOD_TOOLTIP")); } + if (showtooltip) { + clariFrame->set_tooltip_markup(M("TP_LOCALLAB_CLARI_TOOLTIP")); + } + localcontMethodConn = localcontMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::localcontMethodChanged)); lcradius->setAdjusterListener(this); @@ -1497,9 +1504,18 @@ Locallab::Locallab(): } residcont->setAdjusterListener(this); + clarilres->setAdjusterListener(this); + claricres->setAdjusterListener(this); sensilc->setAdjusterListener(this); + clariFrame->set_label_align(0.025, 0.5); + ToolParamBlock* const clariBox = Gtk::manage(new ToolParamBlock()); + clariBox->pack_start(*clarilres); + clariBox->pack_start(*claricres); + + clariFrame->add(*clariBox); + ToolParamBlock* const contrastBox = Gtk::manage(new ToolParamBlock()); contrastBox->pack_start(*localcontMethod); contrastBox->pack_start(*lcradius); @@ -1509,6 +1525,7 @@ Locallab::Locallab(): contrastBox->pack_start(*LocalcurveEditorwav, Gtk::PACK_SHRINK, 4); contrastBox->pack_start(*levelwav); contrastBox->pack_start(*residcont); +// contrastBox->pack_start(*clariFrame); contrastBox->pack_start(*sensilc); contrastBox->pack_start(*fftwlc); expcontrast->add(*contrastBox, false); @@ -2955,6 +2972,8 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).lclightness = lclightness->getValue(); pp->locallab.spots.at(pp->locallab.selspot).levelwav = levelwav->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).residcont = residcont->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).clarilres = clarilres->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).claricres = claricres->getValue(); pp->locallab.spots.at(pp->locallab.selspot).sensilc = sensilc->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).fftwlc = fftwlc->get_active(); pp->locallab.spots.at(pp->locallab.selspot).locwavcurve = wavshape->getCurve(); @@ -3214,6 +3233,8 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pe->locallab.spots.at(pp->locallab.selspot).lclightness = pe->locallab.spots.at(pp->locallab.selspot).lclightness || lclightness->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).levelwav = pe->locallab.spots.at(pp->locallab.selspot).levelwav || levelwav->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).residcont = pe->locallab.spots.at(pp->locallab.selspot).residcont || residcont->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).clarilres = pe->locallab.spots.at(pp->locallab.selspot).clarilres || clarilres->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).claricres = pe->locallab.spots.at(pp->locallab.selspot).claricres || claricres->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).sensilc = pe->locallab.spots.at(pp->locallab.selspot).sensilc || sensilc->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).fftwlc = pe->locallab.spots.at(pp->locallab.selspot).fftwlc || !fftwlc->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).localcontMethod = pe->locallab.spots.at(pp->locallab.selspot).localcontMethod || localcontMethod->get_active_text() != M("GENERAL_UNCHANGED"); @@ -3471,6 +3492,8 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pedited->locallab.spots.at(pp->locallab.selspot).lclightness = pedited->locallab.spots.at(pp->locallab.selspot).lclightness || lclightness->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).levelwav = pedited->locallab.spots.at(pp->locallab.selspot).levelwav || levelwav->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).residcont = pedited->locallab.spots.at(pp->locallab.selspot).residcont || residcont->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).clarilres = pedited->locallab.spots.at(pp->locallab.selspot).clarilres || clarilres->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).claricres = pedited->locallab.spots.at(pp->locallab.selspot).claricres || claricres->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).sensilc = pedited->locallab.spots.at(pp->locallab.selspot).sensilc || sensilc->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).fftwlc = pedited->locallab.spots.at(pp->locallab.selspot).fftwlc || !fftwlc->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).locwavcurve = pedited->locallab.spots.at(pp->locallab.selspot).locwavcurve || !wavshape->isUnChanged(); @@ -3831,6 +3854,9 @@ void Locallab::localcontMethodChanged() if (localcontMethod->get_active_row_number() == 0) { levelwav->hide(); residcont->hide(); + clarilres->hide(); + claricres->hide(); + clariFrame->hide(); lcradius->show(); lcamount->show(); lcdarkness->show(); @@ -3840,6 +3866,9 @@ void Locallab::localcontMethodChanged() } else if (localcontMethod->get_active_row_number() == 1) { levelwav->show(); residcont->show(); + clarilres->show(); + claricres->show(); + clariFrame->show(); lcradius->hide(); lcamount->hide(); lcdarkness->hide(); @@ -5104,6 +5133,8 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe lclightness->setDefault(defSpot->lclightness); levelwav->setDefault(defSpot->levelwav); residcont->setDefault(defSpot->residcont); + clarilres->setDefault(defSpot->clarilres); + claricres->setDefault(defSpot->claricres); sensilc->setDefault((double)defSpot->sensilc); // Contrast by detail levels @@ -5257,6 +5288,8 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe lclightness->setDefaultEditedState(Irrelevant); levelwav->setDefaultEditedState(Irrelevant); residcont->setDefaultEditedState(Irrelevant); + clarilres->setDefaultEditedState(Irrelevant); + claricres->setDefaultEditedState(Irrelevant); sensilc->setDefaultEditedState(Irrelevant); // Contrast by detail levels @@ -5414,6 +5447,8 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe lclightness->setDefaultEditedState(defSpotState->lclightness ? Edited : UnEdited); levelwav->setDefaultEditedState(defSpotState->levelwav ? Edited : UnEdited); residcont->setDefaultEditedState(defSpotState->residcont ? Edited : UnEdited); + clarilres->setDefaultEditedState(defSpotState->clarilres ? Edited : UnEdited); + claricres->setDefaultEditedState(defSpotState->claricres ? Edited : UnEdited); sensilc->setDefaultEditedState(defSpotState->sensilc ? Edited : UnEdited); // Contrast by detail levels @@ -6192,6 +6227,18 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) } } + if (a == clarilres) { + if (listener) { + listener->panelChanged(Evlocallabclarilres, clarilres->getTextValue()); + } + } + + if (a == claricres) { + if (listener) { + listener->panelChanged(Evlocallabclaricres, claricres->getTextValue()); + } + } + if (a == sensilc) { if (listener) { listener->panelChanged(Evlocallabsensilc, sensilc->getTextValue()); @@ -6511,6 +6558,8 @@ void Locallab::setBatchMode(bool batchMode) lclightness->showEditedCB(); levelwav->showEditedCB(); residcont->showEditedCB(); + clarilres->showEditedCB(); + claricres->showEditedCB(); sensilc->showEditedCB(); // Contrast by detail levels @@ -7108,6 +7157,8 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con lclightness->setValue(pp->locallab.spots.at(index).lclightness); levelwav->setValue(pp->locallab.spots.at(index).levelwav); residcont->setValue(pp->locallab.spots.at(index).residcont); + clarilres->setValue(pp->locallab.spots.at(index).clarilres); + claricres->setValue(pp->locallab.spots.at(index).claricres); sensilc->setValue(pp->locallab.spots.at(index).sensilc); fftwlc->set_active(pp->locallab.spots.at(index).fftwlc); @@ -7414,6 +7465,8 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con lclightness->setEditedState(spotState->lclightness ? Edited : UnEdited); levelwav->setEditedState(spotState->levelwav ? Edited : UnEdited); residcont->setEditedState(spotState->residcont ? Edited : UnEdited); + clarilres->setEditedState(spotState->clarilres ? Edited : UnEdited); + claricres->setEditedState(spotState->claricres ? Edited : UnEdited); sensilc->setEditedState(spotState->sensilc ? Edited : UnEdited); fftwlc->set_inconsistent(multiImage && !spotState->fftwlc); wavshape->setUnChanged(!spotState->locwavcurve); @@ -7674,6 +7727,9 @@ void Locallab::updateSpecificGUIState() if (localcontMethod->get_active_row_number() == 0) { levelwav->hide(); residcont->hide(); + clarilres->hide(); + claricres->hide(); + clariFrame->hide(); lcradius->show(); lcamount->show(); lcdarkness->show(); @@ -7683,6 +7739,9 @@ void Locallab::updateSpecificGUIState() } else if (localcontMethod->get_active_row_number() == 1) { levelwav->show(); residcont->show(); + clarilres->show(); + claricres->show(); + clariFrame->show(); lcradius->hide(); lcamount->hide(); lcdarkness->hide(); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 94d722634..6a162ecc5 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -241,6 +241,8 @@ private: Adjuster* const lclightness; Adjuster* const levelwav; Adjuster* const residcont; + Adjuster* const clarilres; + Adjuster* const claricres; Adjuster* const sensilc; // Contrast by detail levels Adjuster* multiplier[6]; @@ -388,6 +390,7 @@ private: Gtk::Frame* gridFrame; Gtk::Frame* pdeFrame; Gtk::Frame* residFrame; + Gtk::Frame* clariFrame; LabGrid *labgrid; // Others Gtk::HBox* ctboxsoftmethod; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 420e2ef40..afbeedca5 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1137,6 +1137,8 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).lclightness = locallab.spots.at(j).lclightness && pSpot.lclightness == otherSpot.lclightness; locallab.spots.at(j).levelwav = locallab.spots.at(j).levelwav && pSpot.levelwav == otherSpot.levelwav; locallab.spots.at(j).residcont = locallab.spots.at(j).residcont && pSpot.residcont == otherSpot.residcont; + locallab.spots.at(j).clarilres = locallab.spots.at(j).clarilres && pSpot.clarilres == otherSpot.clarilres; + locallab.spots.at(j).claricres = locallab.spots.at(j).claricres && pSpot.claricres == otherSpot.claricres; locallab.spots.at(j).sensilc = locallab.spots.at(j).sensilc && pSpot.sensilc == otherSpot.sensilc; locallab.spots.at(j).fftwlc = locallab.spots.at(j).fftwlc && pSpot.fftwlc == otherSpot.fftwlc; locallab.spots.at(j).localcontMethod = locallab.spots.at(j).localcontMethod && pSpot.localcontMethod == otherSpot.localcontMethod; @@ -3395,6 +3397,14 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).residcont = mods.locallab.spots.at(i).residcont; } + if (locallab.spots.at(i).clarilres) { + toEdit.locallab.spots.at(i).clarilres = mods.locallab.spots.at(i).clarilres; + } + + if (locallab.spots.at(i).claricres) { + toEdit.locallab.spots.at(i).claricres = mods.locallab.spots.at(i).claricres; + } + if (locallab.spots.at(i).sensilc) { toEdit.locallab.spots.at(i).sensilc = mods.locallab.spots.at(i).sensilc; } @@ -4709,6 +4719,8 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : lclightness(v), levelwav(v), residcont(v), + clarilres(v), + claricres(v), sensilc(v), fftwlc(v), localcontMethod(v), @@ -4956,6 +4968,8 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) lclightness = v; levelwav = v; residcont = v; + clarilres = v; + claricres = v; sensilc = v; fftwlc = v; localcontMethod = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 70f7ffc8b..151305f5a 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -560,6 +560,8 @@ public: bool lclightness; bool levelwav; bool residcont; + bool clarilres; + bool claricres; bool sensilc; bool fftwlc; bool localcontMethod;