From efb601c0289b2f97b03ac71016513980fa9e0fb4 Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 8 Jan 2021 13:17:28 +0100 Subject: [PATCH] Local adjustments - Shadows highlights - Recovery based on luminance mask (#6050) * LA GUI for recovery using luminance mask * LA Shadows Highlights Enable Recovery based on luminance mask --- rtdata/languages/default | 7 +++ rtengine/iplocallab.cc | 22 ++++++++ rtengine/procevents.h | 4 ++ rtengine/procparams.cc | 16 ++++++ rtengine/procparams.h | 4 ++ rtengine/refreshmap.cc | 6 +- rtgui/locallabtools.cc | 119 +++++++++++++++++++++++++++++++++++++++ rtgui/locallabtools.h | 7 +++ rtgui/paramsedited.cc | 28 +++++++++ rtgui/paramsedited.h | 4 ++ 10 files changed, 216 insertions(+), 1 deletion(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index a45dae36f..90af69bdb 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1253,6 +1253,10 @@ HISTORY_MSG_1005;Local - Exp recovery threshold HISTORY_MSG_1006;Local - Exp threshold mask low HISTORY_MSG_1007;Local - Exp threshold mask high HISTORY_MSG_1008;Local - Exp decay +HISTORY_MSG_1009;Local - SH recovery threshold +HISTORY_MSG_1010;Local - SH threshold mask low +HISTORY_MSG_1011;Local - SH threshold mask high +HISTORY_MSG_1012;Local - SH decay HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2792,9 +2796,11 @@ TP_LOCALLAB_MASKDE_TOOLTIP;Used to direct the Denoise based on the image luminan 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_MASKREEXP_TOOLTIP;Used to modulate the effect of the 'Dynamic range and Exposure' 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 'Dynamic range and Exposure' settings \n In between these two areas, the full value of the 'Dynamic range and Exposure' settings will be applied +TP_LOCALLAB_MASKRESH_TOOLTIP;Used to modulate the effect of the Shadows Highlights 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 Shadows Highlights settings \n In between these two areas, the full value of the Shadows Highlights settings will be applied TP_LOCALLAB_MASKRELOG_TOOLTIP;Used to modulate the effect of the Log encoding 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 Log encoding settings - can be used to restore highlights reconstructed by Color propagation \n In between these two areas, the full value of the Log encoding 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. TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP;Light-tone limit above 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’, 'Blur 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_MASKHIGTHRESS_TOOLTIP;Light-tone limit above which Shadows Highlights will be restored progressively to their original values prior to being modified by the Shadows Highlights settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\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_MASKHIGTHRESE_TOOLTIP;Light-tone limit above which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\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_MASKHIGTHRESL_TOOLTIP;Light-tone limit above which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\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_MASKHIGTHRESD_TOOLTIP;Light-tone limit above 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 @@ -2807,6 +2813,7 @@ TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP;Dark-tone limit below which denoise will be pr 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’, 'blur 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_MASKLOWTHRESL_TOOLTIP;Dark-tone limit below which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\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_MASKLOWTHRESE_TOOLTIP;Dark-tone limit below which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\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_MASKLOWTHRESS_TOOLTIP;Dark-tone limit below which Shadows Highligts will be restored progressively to their original values prior to being modified by the Shadows Highlights settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\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) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 28d5d847c..5d00d5bd8 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -595,6 +595,10 @@ struct local_params { float lowthre; float higthre; float decaye; + float recothrs; + float lowthrs; + float higthrs; + float decays; float recothrl; float lowthrl; float higthrl; @@ -1065,6 +1069,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_higthre = (float)locallab.spots.at(sp).higthrese; float local_decaye = (float)locallab.spots.at(sp).decaye; + float local_recothrs = (float)locallab.spots.at(sp).recothress; + float local_lowthrs = (float)locallab.spots.at(sp).lowthress; + float local_higthrs = (float)locallab.spots.at(sp).higthress; + float local_decays = (float)locallab.spots.at(sp).decays; + float local_recothrl = (float)locallab.spots.at(sp).recothresl; float local_lowthrl = (float)locallab.spots.at(sp).lowthresl; float local_higthrl = (float)locallab.spots.at(sp).higthresl; @@ -1432,6 +1441,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lowthre = local_lowthre; lp.higthre = local_higthre; lp.decaye = local_decaye; + lp.recothrs = local_recothrs; + lp.lowthrs = local_lowthrs; + lp.higthrs = local_higthrs; + lp.decays = local_decays; lp.recothrl = local_recothrl; lp.lowthrl = local_lowthrl; @@ -12602,6 +12615,15 @@ void ImProcFunctions::Lab_Local( } } + if(lp.enaSHMask && lp.recothrs != 1.f) { + float hig = lp.higthrs; + float low = lp.lowthrs; + float recoth = lp.recothrs; + float decay = lp.decays; + bool invmask = false; + maskrecov(bufexpfin.get(), original, bufmaskorigSH.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); + } + transit_shapedetect2(call, 9, bufexporig.get(), bufexpfin.get(), originalmaskSH.get(), hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); if (params->locallab.spots.at(sp).recurs) { diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 31e1da96d..292b0cfbc 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1031,6 +1031,10 @@ enum ProcEventCode { Evlocallablowthrese = 1005, Evlocallabhigthrese = 1006, Evlocallabdecaye = 1007, + Evlocallabrecothress = 1008, + Evlocallablowthress = 1009, + Evlocallabhigthress = 1010, + Evlocallabdecays = 1011, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 7dace90c8..96587733f 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3210,6 +3210,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : fatanchorSH(50.0), gamSH(2.4), sloSH(12.92), + recothress(1.), + lowthress(12.), + higthress(85.), + decays(2.), // Vibrance visivibrance(false), expvibrance(false), @@ -4326,6 +4330,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && fatanchorSH == other.fatanchorSH && gamSH == other.gamSH && sloSH == other.sloSH + && recothress == other.recothress + && lowthress == other.lowthress + && higthress == other.higthress + && decays == other.decays // Vibrance && visivibrance == other.visivibrance && expvibrance == other.expvibrance @@ -5931,6 +5939,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->fatanchorSH, "Locallab", "FatanchorSH_" + index_str, spot.fatanchorSH, keyFile); saveToKeyfile(!pedited || spot_edited->gamSH, "Locallab", "GamSH_" + index_str, spot.gamSH, keyFile); saveToKeyfile(!pedited || spot_edited->sloSH, "Locallab", "SloSH_" + index_str, spot.sloSH, keyFile); + saveToKeyfile(!pedited || spot_edited->recothress, "Locallab", "Recothress_" + index_str, spot.recothress, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthress, "Locallab", "Lowthress_" + index_str, spot.lowthress, keyFile); + saveToKeyfile(!pedited || spot_edited->higthress, "Locallab", "Higthress_" + index_str, spot.higthress, keyFile); + saveToKeyfile(!pedited || spot_edited->decays, "Locallab", "Decays_" + index_str, spot.decays, keyFile); } // Vibrance if ((!pedited || spot_edited->visivibrance) && spot.visivibrance) { @@ -7736,6 +7748,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "FatanchorSH_" + index_str, pedited, spot.fatanchorSH, spotEdited.fatanchorSH); assignFromKeyfile(keyFile, "Locallab", "GamSH_" + index_str, pedited, spot.gamSH, spotEdited.gamSH); assignFromKeyfile(keyFile, "Locallab", "SloSH_" + index_str, pedited, spot.sloSH, spotEdited.sloSH); + assignFromKeyfile(keyFile, "Locallab", "Recothress_" + index_str, pedited, spot.recothress, spotEdited.recothress); + assignFromKeyfile(keyFile, "Locallab", "Lowthress_" + index_str, pedited, spot.lowthress, spotEdited.lowthress); + assignFromKeyfile(keyFile, "Locallab", "Higthress_" + index_str, pedited, spot.higthress, spotEdited.higthress); + assignFromKeyfile(keyFile, "Locallab", "Decays_" + index_str, pedited, spot.decays, spotEdited.decays); // Vibrance spot.visivibrance = assignFromKeyfile(keyFile, "Locallab", "Expvibrance_" + index_str, pedited, spot.expvibrance, spotEdited.expvibrance); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 659ccb652..9008805ad 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1167,6 +1167,10 @@ struct LocallabParams { double fatanchorSH; double gamSH; double sloSH; + double recothress; + double lowthress; + double higthress; + double decays; // Vibrance bool visivibrance; bool expvibrance; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 6e7c6a3d2..940b9882c 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1034,7 +1034,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabrecothrese LUMINANCECURVE, // Evlocallablowthrese LUMINANCECURVE, // Evlocallabhigthrese - LUMINANCECURVE // Evlocallabdecaye + LUMINANCECURVE, // Evlocallabdecaye + LUMINANCECURVE, // Evlocallabrecothress + LUMINANCECURVE, // Evlocallablowthress + LUMINANCECURVE, // Evlocallabhigthress + LUMINANCECURVE // Evlocallabdecays }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index bf8b2e344..45eab0939 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -3784,6 +3784,13 @@ LocallabShadow::LocallabShadow(): sh_radius(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_RADIUS"), 0, 100, 1, 40))), sensihs(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), blurSHde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))), + exprecovs(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + maskusables(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusables(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + recothress(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthress(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthress(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + decays(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), gamFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GAMFRA")))), gamSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMSH"), 0.25, 15.0, 0.01, 2.4))), sloSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOSH"), 0.0, 500.0, 0.01, 12.92))), @@ -3835,6 +3842,13 @@ LocallabShadow::LocallabShadow(): sh_radius->setAdjusterListener(this); + + recothress->setAdjusterListener(this); + lowthress->setAdjusterListener(this); + higthress->setAdjusterListener(this); + decays->setAdjusterListener(this); + setExpandAlignProperties(exprecovs, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + sensihs->setAdjusterListener(this); blurSHde->setAdjusterListener(this); @@ -3931,6 +3945,16 @@ LocallabShadow::LocallabShadow(): pack_start(*sh_radius); // pack_start(*sensihs); pack_start(*blurSHde); + ToolParamBlock* const shBox3 = Gtk::manage(new ToolParamBlock()); + shBox3->pack_start(*maskusables, Gtk::PACK_SHRINK, 0); + shBox3->pack_start(*maskunusables, Gtk::PACK_SHRINK, 0); + shBox3->pack_start(*recothress); + shBox3->pack_start(*lowthress); + shBox3->pack_start(*higthress); + shBox3->pack_start(*decays); + // colBox3->pack_start(*invmaskc); + exprecovs->add(*shBox3, false); + pack_start(*exprecovs, false, false); gamFrame->set_label_align(0.025, 0.5); ToolParamBlock* const gammBox = Gtk::manage(new ToolParamBlock()); gammBox->pack_start(*gamSH); @@ -4005,6 +4029,7 @@ void LocallabShadow::updateAdviceTooltips(const bool showTooltips) gamSH->set_tooltip_text(M("TP_LOCALLAB_SHTRC_TOOLTIP")); sloSH->set_tooltip_text(M("TP_LOCALLAB_SHTRC_TOOLTIP")); strSH->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); + exprecovs->set_tooltip_markup(M("TP_LOCALLAB_MASKRESH_TOOLTIP")); expmasksh->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); blurSHde->set_tooltip_text(M("TP_LOCALLAB_BLURCOLDE_TOOLTIP")); CCmaskSHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); @@ -4031,6 +4056,9 @@ void LocallabShadow::updateAdviceTooltips(const bool showTooltips) shadows->set_tooltip_text(""); s_tonalwidth->set_tooltip_text(""); sh_radius->set_tooltip_text(""); + decays->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); + lowthress->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESS_TOOLTIP")); + higthress->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESS_TOOLTIP")); } else { exp->set_tooltip_text(""); @@ -4060,12 +4088,17 @@ void LocallabShadow::updateAdviceTooltips(const bool showTooltips) shadows->set_tooltip_text(""); s_tonalwidth->set_tooltip_text(""); sh_radius->set_tooltip_text(""); + exprecovs->set_tooltip_markup(""); + decays->set_tooltip_text(""); + lowthress->set_tooltip_text(""); + higthress->set_tooltip_text(""); } } void LocallabShadow::setDefaultExpanderVisibility() { + exprecovs->set_expanded(false); expgradsh->set_expanded(false); expmasksh->set_expanded(false); } @@ -4118,6 +4151,10 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para for (int i = 0; i < 5; i++) { multipliersh[i]->setValue((double)spot.multsh[i]); } + recothress->setValue((double)spot.recothress); + lowthress->setValue((double)spot.lowthress); + higthress->setValue((double)spot.higthress); + decays->setValue((double)spot.decays); detailSH->setValue((double)spot.detailSH); highlights->setValue((double)spot.highlights); @@ -4209,6 +4246,10 @@ void LocallabShadow::write(rtengine::procparams::ProcParams* pp, ParamsEdited* p spot.LmaskSHcurve = LmaskSHshape->getCurve(); spot.fatamountSH = fatamountSH->getValue(); spot.fatanchorSH = fatanchorSH->getValue(); + spot.recothress = recothress->getValue(); + spot.lowthress = lowthress->getValue(); + spot.higthress = higthress->getValue(); + spot.decays = decays->getValue(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -4246,6 +4287,10 @@ void LocallabShadow::setDefaults(const rtengine::procparams::ProcParams* defPara slomaskSH->setDefault(defSpot.slomaskSH); fatamountSH->setDefault(defSpot.fatamountSH); fatanchorSH->setDefault(defSpot.fatanchorSH); + recothress->setDefault((double)defSpot.recothress); + lowthress->setDefault((double)defSpot.lowthress); + higthress->setDefault((double)defSpot.higthress); + decays->setDefault((double)defSpot.decays); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -4308,6 +4353,36 @@ void LocallabShadow::adjusterChanged(Adjuster* a, double newval) } } + if (a == recothress) { + + if (listener) { + listener->panelChanged(Evlocallabrecothress, + recothress->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lowthress) { + if (listener) { + listener->panelChanged(Evlocallablowthress, + lowthress->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == higthress) { + if (listener) { + listener->panelChanged(Evlocallabhigthress, + higthress->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == decays) { + if (listener) { + listener->panelChanged(Evlocallabdecays, + decays->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == sensihs) { if (listener) { listener->panelChanged(Evlocallabsensihs, @@ -4471,6 +4546,7 @@ void LocallabShadow::convertParamToNormal() slomaskSH->setValue(defSpot.slomaskSH); fatamountSH->setValue(defSpot.fatamountSH); fatanchorSH->setValue(defSpot.fatanchorSH); + decays->setValue(defSpot.decays); // Enable all listeners enableListener(); @@ -4498,6 +4574,11 @@ void LocallabShadow::convertParamToSimple() // radmaskSH->setValue(defSpot.radmaskSH); // chromaskSH->setValue(defSpot.chromaskSH); // LmaskSHshape->setCurve(defSpot.LmaskSHcurve); + + recothress->setValue(defSpot.recothress); + lowthress->setValue(defSpot.lowthress); + higthress->setValue(defSpot.higthresc); + decays->setValue(defSpot.decays); // Enable all listeners enableListener(); @@ -4512,6 +4593,10 @@ void LocallabShadow::updateGUIToMode(const modeType new_type) gamFrame->hide(); expgradsh->hide(); expmasksh->hide(); + exprecovs->hide(); + maskusables->hide(); + maskunusables->hide(); + decays->hide(); break; @@ -4522,17 +4607,29 @@ void LocallabShadow::updateGUIToMode(const modeType new_type) gammaskSH->hide(); slomaskSH->hide(); fatSHFrame->hide(); + exprecovs->show(); // Specific Simple mode widgets are shown in Normal mode if (shMethod->get_active_row_number() != 0) { // Keep widget hidden when shMethod is equal to 0 gamFrame->show(); } + if (enaSHMask->get_active()) { + maskusables->show(); + maskunusables->hide(); + + } else { + maskusables->hide(); + maskunusables->show(); + } + if (!inverssh->get_active()) { // Keep widget hidden when inverssh is toggled expgradsh->show(); + exprecovs->show(); } expmasksh->show(); + decays->hide(); break; @@ -4546,7 +4643,18 @@ void LocallabShadow::updateGUIToMode(const modeType new_type) if (!inverssh->get_active()) { // Keep widget hidden when inverssh is toggled expgradsh->show(); + exprecovs->show(); } + if (enaSHMask->get_active()) { + maskusables->show(); + maskunusables->hide(); + + } else { + maskusables->hide(); + maskunusables->show(); + } + exprecovs->show(); + decays->show(); expmasksh->show(); lapmaskSH->show(); @@ -4650,6 +4758,15 @@ void LocallabShadow::showmaskSHMethodChangedinv() void LocallabShadow::enaSHMaskChanged() { + if (enaSHMask->get_active()) { + maskusables->show(); + maskunusables->hide(); + + } else { + maskusables->hide(); + maskunusables->show(); + } + if (isLocActivated && exp->getEnabled()) { if (listener) { if (enaSHMask->get_active()) { @@ -4676,9 +4793,11 @@ void LocallabShadow::updateShadowGUI1() showmaskSHMethod->set_active(0); showmaskSHMethodConn.block(false); showmaskSHMethodinv->show(); + exprecovs->hide(); } else { if (mode == Expert || mode == Normal) { // Keep widget hidden in Simple mode expgradsh->show(); + exprecovs->show(); } showmaskSHMethod->show(); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index d8378748a..140946972 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -448,6 +448,13 @@ private: Adjuster* const sh_radius; Adjuster* const sensihs; Adjuster* const blurSHde; + MyExpander* const exprecovs; + Gtk::Label* const maskusables; + Gtk::Label* const maskunusables; + Adjuster* const recothress; + Adjuster* const lowthress; + Adjuster* const higthress; + Adjuster* const decays; Gtk::Frame* const gamFrame; Adjuster* const gamSH; Adjuster* const sloSH; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index f7ea7f554..9bed07130 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1238,6 +1238,10 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).fatanchorSH = locallab.spots.at(j).fatanchorSH && pSpot.fatanchorSH == otherSpot.fatanchorSH; locallab.spots.at(j).gamSH = locallab.spots.at(j).gamSH && pSpot.gamSH == otherSpot.gamSH; locallab.spots.at(j).sloSH = locallab.spots.at(j).sloSH && pSpot.sloSH == otherSpot.sloSH; + locallab.spots.at(j).recothress = locallab.spots.at(j).recothress && pSpot.recothress == otherSpot.recothress; + locallab.spots.at(j).lowthress = locallab.spots.at(j).lowthress && pSpot.lowthress == otherSpot.lowthress; + locallab.spots.at(j).higthress = locallab.spots.at(j).higthress && pSpot.higthress == otherSpot.higthress; + locallab.spots.at(j).decays = locallab.spots.at(j).decays && pSpot.decays == otherSpot.decays; // Vibrance locallab.spots.at(j).visivibrance = locallab.spots.at(j).visivibrance && pSpot.visivibrance == otherSpot.visivibrance; locallab.spots.at(j).expvibrance = locallab.spots.at(j).expvibrance && pSpot.expvibrance == otherSpot.expvibrance; @@ -3903,6 +3907,22 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).sloSH = mods.locallab.spots.at(i).sloSH; } + if (locallab.spots.at(i).recothress) { + toEdit.locallab.spots.at(i).recothress = mods.locallab.spots.at(i).recothress; + } + + if (locallab.spots.at(i).lowthress) { + toEdit.locallab.spots.at(i).lowthress = mods.locallab.spots.at(i).lowthress; + } + + if (locallab.spots.at(i).higthress) { + toEdit.locallab.spots.at(i).higthress = mods.locallab.spots.at(i).higthress; + } + + if (locallab.spots.at(i).decays) { + toEdit.locallab.spots.at(i).decays = mods.locallab.spots.at(i).decays; + } + // Vibrance if (locallab.spots.at(i).visivibrance) { toEdit.locallab.spots.at(i).visivibrance = mods.locallab.spots.at(i).visivibrance; @@ -6652,6 +6672,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : fatanchorSH(v), gamSH(v), sloSH(v), + recothress(v), + lowthress(v), + higthress(v), + decays(v), // Vibrance visivibrance(v), expvibrance(v), @@ -7193,6 +7217,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) fatanchorSH = v; gamSH = v; sloSH = v; + recothress = v; + lowthress = v; + higthress = v; + decays = v; // Vibrance visivibrance = v; expvibrance = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index a30fa2022..c1fb0a232 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -575,6 +575,10 @@ public: bool fatanchorSH; bool gamSH; bool sloSH; + bool recothress; + bool lowthress; + bool higthress; + bool decays; // Vibrance bool visivibrance; bool expvibrance;