From a07638e1a6974de5b4654c14aee725acc4aa93f6 Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 22 Sep 2020 17:43:56 +0200 Subject: [PATCH] Local adjustments - Change label - fixed bad behavior contrast attenuator (#5916) * Change label Structure exposure * Fixed bad behavior contrast attenuator --- rtdata/languages/default | 2 +- rtengine/iplocallab.cc | 10 +++++++--- rtgui/locallabtools.cc | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 5a85773f0..bc20c9c17 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2815,7 +2815,7 @@ TP_LOCALLAB_STRENGTH;Noise TP_LOCALLAB_STRGRID;Strength TP_LOCALLAB_STRRETI_TOOLTIP;if Strength Retinex < 0.2 only Dehaze is enabled.\nif Strength Retinex >= 0.1 Dehaze is in luminance mode. TP_LOCALLAB_STRUC;Structure -TP_LOCALLAB_STRUCCOL;Structure +TP_LOCALLAB_STRUCCOL;Spot Structure TP_LOCALLAB_STRUCCOL1;Spot Structure TP_LOCALLAB_STRUCT_TOOLTIP;Use Sobel algorithm to take into account structure in shape detection.\nyou can have a preview by activating "mask and modifications - Show spot structure".\n\nCan be used in conjunction with masks (advanced) structure, blur, wavelet to improve edge detection.\n\nNeeds maskless adjustments to be activated (lightness, exposure...) TP_LOCALLAB_STRUMASKCOL;Structure mask strength diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 3fc2c667f..e7bf6d167 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -2422,6 +2422,10 @@ void ImProcFunctions::exlabLocal(local_params& lp, int bfh, int bfw, int bfhr, i //exposure local constexpr float maxran = 65536.f; + if(lp.laplacexp == 0.f) { + lp.linear = 0.f; + } + const float linear = lp.linear; int bw = bfw; int bh = bfh; @@ -2430,7 +2434,7 @@ void ImProcFunctions::exlabLocal(local_params& lp, int bfh, int bfw, int bfhr, i } const bool exec = (lp.expmet == 1 && linear > 0.f && lp.laplacexp > 0.1f); - if(exec) {//for standard exposure + if(!exec) {//for standard exposure const float cexp_scale = std::pow(2.f, lp.expcomp); const float ccomp = (rtengine::max(0.f, lp.expcomp) + 1.f) * lp.hlcomp / 100.f; const float cshoulder = ((maxran / rtengine::max(1.0f, cexp_scale)) * (lp.hlcompthr / 200.f)) + 0.1f; @@ -12765,14 +12769,14 @@ void ImProcFunctions::Lab_Local( } if (lp.expcomp == 0.f) { - lp.expcomp = 0.001f; // to enabled + lp.expcomp = 0.001f;// to enabled } ImProcFunctions::exlabLocal(lp, bfh, bfw, bfhr, bfwr, bufexpfin.get(), bufexpfin.get(), hltonecurveloc, shtonecurveloc, tonecurveloc, hueref, lumaref, chromaref); } else { - if (lp.expcomp != 0.f) { + if (lp.expcomp != 0.f || lp.laplacexp > 0.1f) { ImProcFunctions::exlabLocal(lp, bfh, bfw, bfhr, bfwr, bufexporig.get(), bufexpfin.get(), hltonecurveloc, shtonecurveloc, tonecurveloc, hueref, lumaref, chromaref); } } diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index fc9242bcd..f47f28447 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -2314,7 +2314,7 @@ LocallabExposure::LocallabExposure(): // pdeFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_PDEFRA")))), exppde(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_PDEFRA")))), laplacexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPLACEXP"), 0.0, 100.0, 0.1, 0.))), - linear(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LINEAR"), 0., 1., 0.01, 0.05))), + linear(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LINEAR"), 0.01, 1., 0.01, 0.05))), balanexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BALANEXP"), 0.5, 1.5, 0.01, 1.0))), gamm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMM"), 0.2, 1.3, 0.01, 0.4))), exnoiseMethod(Gtk::manage(new MyComboBoxText())),