diff --git a/rtdata/languages/default b/rtdata/languages/default index d2c57707e..78db75169 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1244,6 +1244,7 @@ HISTORY_MSG_996;Local - Color recovery threshold HISTORY_MSG_997;Local - Color threshold mask low HISTORY_MSG_998;Local - Color threshold mask high HISTORY_MSG_999;Local - Color decay +HISTORY_MSG_1000;Local - Denoise gray HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2779,7 +2780,7 @@ TP_LOCALLAB_MASKDDECAY;Decay strength TP_LOCALLAB_MASKDECAY_TOOLTIP;Manages the rate of decay for the gray levels in the mask.\n Decay = 1 linear, Decay > 1 sharper parabolic transitions, Decay < 1 more gradual transitions TP_LOCALLAB_MASKH;Hue curve TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n if the mask is very dark - below the threshold 'dark' - denoise will be increased if reinforce > 1.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. -TP_LOCALLAB_MASKDE_TOOLTIP;Used to direct the Denoise based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the Denoise will be applied progressively.\n if the mask is above the ‘light’ threshold, then the Denoise will be applied progressively.\n Between the two, the image settings without the Denoise will be maintained. +TP_LOCALLAB_MASKDE_TOOLTIP;Used to direct the Denoise based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the Denoise will be applied progressively.\n if the mask is above the ‘light’ threshold, then the Denoise will be applied progressively.\n Between the two, the image settings without the Denoise will be maintained, unless you act on the slider "Gray area denoise". TP_LOCALLAB_MASKGF_TOOLTIP;Used to direct the Guided Filter based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the GF will be applied progressively.\n if the mask is above the ‘light’ threshold, then the GF will be applied progressively.\n Between the two, the image settings without the GF will be maintained. TP_LOCALLAB_MASKRECOL_TOOLTIP;Used to modulate the effect of the Color and Light settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Color and Light settings \n In between these two areas, the full value of the Color and Light settings will be applied TP_LOCALLAB_MASKDEINV_TOOLTIP;Reverses the way the algorithm interprets the mask.\nIf checked black and very light areas will be decreased. @@ -2792,6 +2793,7 @@ TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark and light areas TP_LOCALLAB_MASKLOWTHRES_TOOLTIP;Dark-tone limit below which 'Guided Filter' will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP;Dark-tone limit below which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLCTHRMID;Gray area denoise TP_LOCALLAB_MASKUSABLE;Mask enabled (Mask & modifications) TP_LOCALLAB_MASKUNUSABLE;Mask disabled (Mask & modifications) TP_LOCALLAB_MASKRECOTHRES;Recovery threshold diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 79cb1b938..642e1e772 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -584,6 +584,7 @@ struct local_params { float higthr; float recothrd; float lowthrd; + float midthrd; float higthrd; float decayd; float recothrc; @@ -1043,6 +1044,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_higthr = (float)locallab.spots.at(sp).higthres; float local_recothrd = (float)locallab.spots.at(sp).recothresd; float local_lowthrd = (float)locallab.spots.at(sp).lowthresd; + float local_midthrd = (float)locallab.spots.at(sp).midthresd; float local_higthrd = (float)locallab.spots.at(sp).higthresd; float local_decayd = (float)locallab.spots.at(sp).decayd; float local_recothrc = (float)locallab.spots.at(sp).recothresc; @@ -1400,6 +1402,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lowthr = local_lowthr; lp.higthr = local_higthr; lp.recothrd = local_recothrd; + lp.midthrd = local_midthrd; lp.lowthrd = local_lowthrd; lp.higthrd = local_higthrd; lp.decayd = local_decayd; @@ -9449,6 +9452,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl float low = lp.lowthrd; float lowc; calcdif(low, lowc); + float mid = 0.01f * lp.midthrd; if(higc < lowc) { higc = lowc + 0.01f; @@ -9469,9 +9473,9 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (lM < 327.68f * lowc) { masklum[ir][jr] = alow * lmr + blow; } else if (lM < 327.68f * higc) { - + masklum[ir][jr] = (1.f - mid); } else { - masklum[ir][jr] = ahigh * lmr + bhigh; + masklum[ir][jr] = ahigh * lmr + bhigh; } float k = masklum[ir][jr]; if(lp.invmaskd == true) { @@ -10136,6 +10140,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl float low = lp.lowthrd; float lowc; calcdif(low, lowc); + float mid = 0.01f * lp.midthrd; if(higc < lowc) { higc = lowc + 0.01f; @@ -10158,6 +10163,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (lM < 327.68f * lowc) { masklum[y-ystart][x-xstart] = alow * lmr + blow; } else if (lM < 327.68f * higc) { + masklum[y-ystart][x-xstart] = 1.f - mid; } else { masklum[y-ystart][x-xstart] = ahigh * lmr + bhigh; diff --git a/rtengine/procevents.h b/rtengine/procevents.h index efe7d5b33..06c3c50da 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1022,6 +1022,7 @@ enum ProcEventCode { Evlocallablowthresc = 996, Evlocallabhigthresc = 997, Evlocallabdecayc = 998, + Evlocallabmidthresd = 999, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index a53f2eb69..8e30a6e5c 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3307,6 +3307,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : higthres(85.), recothresd(1.), lowthresd(12.), + midthresd(0.), higthresd(85.), decayd(2.), isogr(400), @@ -4364,6 +4365,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && higthres == other.higthres && recothresd == other.recothresd && lowthresd == other.lowthresd + && midthresd == other.midthresd && higthresd == other.higthresd && decayd == other.decayd && isogr == other.isogr @@ -5963,6 +5965,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->higthres, "Locallab", "Higthres_" + index_str, spot.higthres, keyFile); saveToKeyfile(!pedited || spot_edited->recothresd, "Locallab", "Recothresd_" + index_str, spot.recothresd, keyFile); saveToKeyfile(!pedited || spot_edited->lowthresd, "Locallab", "Lowthresd_" + index_str, spot.lowthresd, keyFile); + saveToKeyfile(!pedited || spot_edited->midthresd, "Locallab", "Midthresd_" + index_str, spot.midthresd, keyFile); saveToKeyfile(!pedited || spot_edited->higthresd, "Locallab", "Higthresd_" + index_str, spot.higthresd, keyFile); saveToKeyfile(!pedited || spot_edited->decayd, "Locallab", "Decayd_" + index_str, spot.decayd, keyFile); saveToKeyfile(!pedited || spot_edited->isogr, "Locallab", "Isogr_" + index_str, spot.isogr, keyFile); @@ -7778,6 +7781,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Higthres_" + index_str, pedited, spot.higthres, spotEdited.higthres); assignFromKeyfile(keyFile, "Locallab", "Recothresd_" + index_str, pedited, spot.recothresd, spotEdited.recothresd); assignFromKeyfile(keyFile, "Locallab", "Lowthresd_" + index_str, pedited, spot.lowthresd, spotEdited.lowthresd); + assignFromKeyfile(keyFile, "Locallab", "Midthresd_" + index_str, pedited, spot.midthresd, spotEdited.midthresd); assignFromKeyfile(keyFile, "Locallab", "Higthresd_" + index_str, pedited, spot.higthresd, spotEdited.higthresd); assignFromKeyfile(keyFile, "Locallab", "Decayd_" + index_str, pedited, spot.decayd, spotEdited.decayd); assignFromKeyfile(keyFile, "Locallab", "Isogr_" + index_str, pedited, spot.isogr, spotEdited.isogr); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 451467b1a..368b7e5e7 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1214,6 +1214,7 @@ struct LocallabParams { double higthres; double recothresd; double lowthresd; + double midthresd; double higthresd; double decayd; int isogr; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 1705f8d6f..127acfb8a 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1025,7 +1025,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabrecothresc LUMINANCECURVE, // Evlocallablowthresc LUMINANCECURVE, // Evlocallabhigthresc - LUMINANCECURVE // Evlocallabdecayc + LUMINANCECURVE, // Evlocallabdecayc + LUMINANCECURVE // Evlocallabmidthresd }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 71e293c96..2641d404e 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5912,6 +5912,7 @@ LocallabBlur::LocallabBlur(): expdenoise3(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), recothresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), lowthresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + midthresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRMID"), 0., 100., 0.5, 0.))), higthresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), decayd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), invmaskd(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))), @@ -6080,6 +6081,7 @@ LocallabBlur::LocallabBlur(): setExpandAlignProperties(expdenoise3, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); recothresd->setAdjusterListener(this); lowthresd->setAdjusterListener(this); + midthresd->setAdjusterListener(this); higthresd->setAdjusterListener(this); decayd->setAdjusterListener(this); @@ -6237,6 +6239,7 @@ LocallabBlur::LocallabBlur(): wavBox3->pack_start(*maskunusable3, Gtk::PACK_SHRINK, 0); wavBox3->pack_start(*recothresd); wavBox3->pack_start(*lowthresd); + wavBox3->pack_start(*midthresd); wavBox3->pack_start(*higthresd); wavBox3->pack_start(*decayd); wavBox3->pack_start(*invmaskd); @@ -6361,6 +6364,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) sensiden->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); lowthres->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRES_TOOLTIP")); lowthresd->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP")); +// midthresd->set_tooltip_text(M("TP_LOCALLAB_MASKMIDTHRESD_TOOLTIP")); higthresd->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP")); higthres->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRES_TOOLTIP")); decayd->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); @@ -6424,6 +6428,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) lowthresd->set_tooltip_text(""); higthresd->set_tooltip_text(""); higthres->set_tooltip_text(""); +// midthresd->set_tooltip_text(""); decayd->set_tooltip_text(""); } @@ -6453,6 +6458,7 @@ void LocallabBlur::neutral_pressed () invmask->set_active(defSpot.invmask); recothresd->setValue(defSpot.recothresd); lowthresd->setValue(defSpot.lowthresd); + midthresd->setValue(defSpot.midthresd); higthresd->setValue(defSpot.higthresd); decayd->setValue(defSpot.decayd); recothres->setValue(defSpot.recothres); @@ -6572,6 +6578,7 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params sensibn->setValue((double)spot.sensibn); recothresd->setValue((double)spot.recothresd); lowthresd->setValue((double)spot.lowthresd); + midthresd->setValue((double)spot.midthresd); higthresd->setValue((double)spot.higthresd); decayd->setValue((double)spot.decayd); @@ -6706,6 +6713,7 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.sensibn = sensibn->getIntValue(); spot.recothresd = recothresd->getValue(); spot.lowthresd = lowthresd->getValue(); + spot.midthresd = midthresd->getValue(); spot.higthresd = higthresd->getValue(); spot.decayd = decayd->getValue(); @@ -6803,6 +6811,7 @@ void LocallabBlur::setDefaults(const rtengine::procparams::ProcParams* defParams sensibn->setDefault((double)defSpot.sensibn); recothresd->setDefault((double)defSpot.recothresd); lowthresd->setDefault((double)defSpot.lowthresd); + midthresd->setDefault((double)defSpot.midthresd); higthresd->setDefault((double)defSpot.higthresd); decayd->setDefault((double)defSpot.decayd); noiselumf0->setDefault(defSpot.noiselumf0); @@ -6942,6 +6951,13 @@ void LocallabBlur::adjusterChanged(Adjuster* a, double newval) } } + if (a == midthresd) { + if (listener) { + listener->panelChanged(Evlocallabmidthresd, + midthresd->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == higthresd) { if (listener) { listener->panelChanged(Evlocallabhigthresd, @@ -7295,6 +7311,7 @@ void LocallabBlur::convertParamToSimple() invmask->set_active(defSpot.invmask); recothresd->setValue(defSpot.recothresd); lowthresd->setValue(defSpot.lowthresd); + midthresd->setValue(defSpot.midthresd); higthresd->setValue(defSpot.higthresd); decayd->setValue(defSpot.decayd); recothres->setValue(defSpot.recothres); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 6d3bb9b50..03f6c0b5e 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -703,6 +703,7 @@ private: MyExpander* const expdenoise3; Adjuster* const recothresd; Adjuster* const lowthresd; + Adjuster* const midthresd; Adjuster* const higthresd; Adjuster* const decayd; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index cc5e3ef59..3a47da11a 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1285,6 +1285,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).higthres = locallab.spots.at(j).higthres && pSpot.higthres == otherSpot.higthres; locallab.spots.at(j).recothresd = locallab.spots.at(j).recothresd && pSpot.recothresd == otherSpot.recothresd; locallab.spots.at(j).lowthresd = locallab.spots.at(j).lowthresd && pSpot.lowthresd == otherSpot.lowthresd; + locallab.spots.at(j).midthresd = locallab.spots.at(j).midthresd && pSpot.midthresd == otherSpot.midthresd; locallab.spots.at(j).higthresd = locallab.spots.at(j).higthresd && pSpot.higthresd == otherSpot.higthresd; locallab.spots.at(j).decayd = locallab.spots.at(j).decayd && pSpot.decayd == otherSpot.decayd; locallab.spots.at(j).isogr = locallab.spots.at(j).isogr && pSpot.isogr == otherSpot.isogr; @@ -4073,6 +4074,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).lowthresd = mods.locallab.spots.at(i).lowthresd; } + if (locallab.spots.at(i).midthresd) { + toEdit.locallab.spots.at(i).midthresd = mods.locallab.spots.at(i).midthresd; + } + if (locallab.spots.at(i).higthresd) { toEdit.locallab.spots.at(i).higthresd = mods.locallab.spots.at(i).higthresd; } @@ -6654,6 +6659,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : higthres(v), recothresd(v), lowthresd(v), + midthresd(v), higthresd(v), decayd(v), isogr(v), @@ -7186,6 +7192,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) higthres = v; recothresd = v; lowthresd = v; + midthresd = v; higthresd = v; decayd = v; isogr = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index d48f251db..5d4047d3e 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -622,6 +622,7 @@ public: bool higthres; bool recothresd; bool lowthresd; + bool midthresd; bool higthresd; bool decayd; bool isogr;