From 2e06b4431f46d5b68f7a5dffd1d9bac42926af6d Mon Sep 17 00:00:00 2001 From: Desmis Date: Mon, 11 Nov 2019 18:24:39 +0100 Subject: [PATCH] Improve behavior sliders strumask --- rtengine/iplocallab.cc | 12 +++++++----- rtengine/procparams.cc | 4 ++-- rtengine/procparams.h | 4 ++-- rtgui/locallab.cc | 8 ++++---- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 485ba0a27..8052771a4 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -3224,7 +3224,8 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int JaggedArray blendstru(bfw, bfh); if(strumask > 0.f){ - buildBlendMask(bufcolorig->L, blendstru, bfw, bfh, strumask, 1.f); + float delstrumask = 4.f - strumask; + buildBlendMask(bufcolorig->L, blendstru, bfw, bfh, delstrumask, 1.f); float radblur = 0.02f * rad;//empirical value float rm = radblur / sk; @@ -7650,10 +7651,11 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4) { JaggedArray blendstru(GW, GH); - float strumask = 0.015f * (float) params->locallab.spots.at(sp).strumaskbl; + float strumask = 0.02f * (float) params->locallab.spots.at(sp).strumaskbl; if(strumask > 0.f){ - buildBlendMask(bufgb->L, blendstru, GW, GH, strumask, 1.f); + float delstrumask = 4.f - strumask; + buildBlendMask(bufgb->L, blendstru, GW, GH, delstrumask, 1.f); float radblur = 0.02f * lp.radmabl; float rm = radblur / sk; @@ -11795,7 +11797,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int level_hr = params->locallab.spots.at(sp).csthresholdcol.getTopRight(); int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc; int lumask = params->locallab.spots.at(sp).lumask; - float strumask = 0.015f *(float) params->locallab.spots.at(sp).strumaskcol; + float strumask = 0.02f * (float) params->locallab.spots.at(sp).strumaskcol; float conthr = 0.01f * params->locallab.spots.at(sp).conthrcol; int tonemod = 0; @@ -12591,7 +12593,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int sco = params->locallab.spots.at(sp).scopemask; int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc; int lumask = params->locallab.spots.at(sp).lumask; - float strumask = 0.01f *(float) params->locallab.spots.at(sp).strumaskcol; + float strumask = 0.02f * (float) params->locallab.spots.at(sp).strumaskcol; const int limscope = 80; const float mindE = 2.f + MINSCOPE * sco * lp.thr; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 351827128..d970c36dd 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2465,7 +2465,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : gammaskcol(1.0), slomaskcol(0.0), shadmaskcol(0), - strumaskcol(0), + strumaskcol(0.), lapmaskcol(0.0), qualitycurveMethod("none"), gridMethod("one"), @@ -2598,7 +2598,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : slomaskbl(0.0), lapmaskbl(0.0), shadmaskbl(0), - strumaskbl(0), + strumaskbl(0.), Lmaskblcurve{(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}, LLmaskblcurvewav{(double)FCT_MinMaxCPoints, 0.0, 0.5, 0.35, 0.35, 1., 0.5, 0.35, 0.35}, csthresholdblur(0, 0, 6, 5, false), diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 3827c4b0a..2176aaf49 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1008,7 +1008,7 @@ struct LocallabParams { double gammaskcol; double slomaskcol; int shadmaskcol; - int strumaskcol; + double strumaskcol; double lapmaskcol; Glib::ustring qualitycurveMethod; Glib::ustring gridMethod; @@ -1142,7 +1142,7 @@ struct LocallabParams { double slomaskbl; double lapmaskbl; int shadmaskbl; - int strumaskbl; + double strumaskbl; std::vector Lmaskblcurve; std::vector LLmaskblcurvewav; Threshold csthresholdblur; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 94afb854a..8a9f27add 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -265,7 +265,7 @@ Locallab::Locallab(): softradiuscol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.5, 0.))), opacol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_OPACOL"), 0.0, 100.0, 0.5, 100.))), conthrcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTTHR"), 0.0, 100.0, 0.5, 0.))), - strumaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUMASKCOL"), 0, 200, 1, 0))), + strumaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUMASKCOL"), 0., 200., 0.1, 0.))), // Exposure expcomp(Gtk::manage(new Adjuster(M("TP_EXPOSURE_EXPCOMP"), -2.0, 3.0, 0.05, 0.0))), hlcompr(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 0))), @@ -359,7 +359,7 @@ shadmaskbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_HIGHMASKCOL"), 0, 100, 1, 0)) isogr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ISOGR"), 20, 6400, 1, 400))), strengr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENGR"), 0, 100, 1, 0))), scalegr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALEGR"), 0, 100, 1, 100))), -strumaskbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUMASKCOL"), 0, 200, 1, 0))), +strumaskbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUMASKCOL"), 0., 200., 0.1, 0.))), // Tone Mapping stren(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STREN"), -0.5, 2.0, 0.01, 0.5))), gamma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAM"), 0.4, 4.0, 0.11, 1.0))), @@ -3704,7 +3704,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).gammaskcol = gammaskcol->getValue(); pp->locallab.spots.at(pp->locallab.selspot).slomaskcol = slomaskcol->getValue(); pp->locallab.spots.at(pp->locallab.selspot).shadmaskcol = shadmaskcol->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).strumaskcol = strumaskcol->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).strumaskcol = strumaskcol->getValue(); pp->locallab.spots.at(pp->locallab.selspot).lapmaskcol = lapmaskcol->getValue(); pp->locallab.spots.at(pp->locallab.selspot).softradiuscol = softradiuscol->getValue(); pp->locallab.spots.at(pp->locallab.selspot).opacol = opacol->getValue(); @@ -3881,7 +3881,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).slomaskbl = slomaskbl->getValue(); pp->locallab.spots.at(pp->locallab.selspot).lapmaskbl = lapmaskbl->getValue(); pp->locallab.spots.at(pp->locallab.selspot).shadmaskbl = shadmaskbl->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).strumaskbl = strumaskbl->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).strumaskbl = strumaskbl->getValue(); pp->locallab.spots.at(pp->locallab.selspot).fftwbl = fftwbl->get_active(); pp->locallab.spots.at(pp->locallab.selspot).Lmaskblcurve = Lmaskblshape->getCurve(); pp->locallab.spots.at(pp->locallab.selspot).LLmaskblcurvewav = LLmaskblshapewav->getCurve();