From 06131b5bf8f23d4c27636162eac8b9598974d5ec Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 22 Nov 2019 10:46:33 +0100 Subject: [PATCH] Fixed bug and add graduated filter to shadowsHighlight --- rtdata/languages/default | 2 ++ rtengine/iplocallab.cc | 45 ++++++++++++++++++++++++++++----- rtengine/procevents.h | 2 ++ rtengine/procparams.cc | 8 ++++++ rtengine/procparams.h | 2 ++ rtengine/refreshmap.cc | 4 ++- rtgui/locallab.cc | 54 ++++++++++++++++++++++++++++++++++++++++ rtgui/locallab.h | 3 +++ rtgui/paramsedited.cc | 14 +++++++++++ rtgui/paramsedited.h | 2 ++ 10 files changed, 129 insertions(+), 7 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 25565c394..6acd4f76a 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1064,6 +1064,8 @@ HISTORY_MSG_824;Local - Exp gradient mask strength HISTORY_MSG_825;Local - Exp gradient mask angle HISTORY_MSG_826;Local - Exp gradient strength HISTORY_MSG_827;Local - Exp gradient angle +HISTORY_MSG_828;Local - SH gradient strength +HISTORY_MSG_829;Local - SH gradient angle HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index c750b5a9e..44bdbb402 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -214,6 +214,8 @@ struct local_params { float angmaexp; float strexp; float angexp; + float strSH; + float angSH; float softradiusexp; float softradiuscol; float softradiuscb; @@ -738,6 +740,8 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float angmaskexpo = ((float) locallab.spots.at(sp).angmaskexp); float strexpo = ((float) locallab.spots.at(sp).strexp); float angexpo = ((float) locallab.spots.at(sp).angexp); + float strSH = ((float) locallab.spots.at(sp).strSH); + float angSH = ((float) locallab.spots.at(sp).angSH); float softradiusexpo = ((float) locallab.spots.at(sp).softradiusexp); float softradiuscolor = ((float) locallab.spots.at(sp).softradiuscol); float softradiusreti = ((float) locallab.spots.at(sp).softradiusret); @@ -845,6 +849,8 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.angmaexp = angmaskexpo; lp.strexp = strexpo; lp.angexp = angexpo; + lp.strSH = strSH; + lp.angSH = angSH; lp.softradiusexp = softradiusexpo; lp.softradiuscol = softradiuscolor; lp.softradiusret = softradiusreti; @@ -2577,7 +2583,7 @@ struct grad_params { int h; }; -static void calclocalGradientParams (const struct local_params& lp, struct grad_params& gp, float ystart, float xstart, int bfw, int bfh, int indic) +void calclocalGradientParams (const struct local_params& lp, struct grad_params& gp, float ystart, float xstart, int bfw, int bfh, int indic) { int w = bfw; @@ -2591,13 +2597,18 @@ static void calclocalGradientParams (const struct local_params& lp, struct grad_ } else if (indic == 1) { stops = lp.strexp; angs = lp.angexp; + } else if (indic == 2) { + stops = lp.strSH; + angs = lp.angSH; } + //printf("Indic=%d strex=%f stop=%f\n", indic, lp.strexp, stops); + double gradient_stops = stops; double gradient_center_x = LIM01((lp.xc - xstart) / bfw); double gradient_center_y = LIM01((lp.yc - ystart) / bfh); double gradient_angle = angs / 180.0 * rtengine::RT_PI; - // printf("xstart=%f ysta=%f lpxc=%f lpyc=%f aa=%f bb=%f cc=%f dd=%f ff=%d gg=%d\n", xstart, ystart, lp.xc, lp.yc, gradient_stops, gradient_center_x, gradient_center_y, gradient_angle, w, h); + //printf("xstart=%f ysta=%f lpxc=%f lpyc=%f stop=%f bb=%f cc=%f ang=%f ff=%d gg=%d\n", xstart, ystart, lp.xc, lp.yc, gradient_stops, gradient_center_x, gradient_center_y, gradient_angle, w, h); // make 0.0 <= gradient_angle < 2 * rtengine::RT_PI gradient_angle = fmod (gradient_angle, 2 * rtengine::RT_PI); @@ -3719,10 +3730,13 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int if (lp.strmaexp != 0.f) { calclocalGradientParams (lp, gp, ystart, xstart, bfw, bfh, 0); +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif for (int ir = 0; ir < bfh; ir++) for (int jr = 0; jr < bfw; jr++) { double factor = 1.0; - factor = calcGradientFactor (gp, jr, ir); + factor = ImProcFunctions::calcGradientFactor (gp, jr, ir); bufmaskblurcol->L[ir][jr] *= factor; } } @@ -9385,7 +9399,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o tonecurv = true; } - if (! lp.invsh && (lp.highlihs > 0.f || lp.shadowhs > 0.f || tonequ || tonecurv || lp.showmaskSHmet == 2 || lp.enaSHMask || lp.showmaskSHmet == 3 || lp.showmaskSHmet == 4) && call < 3 && lp.hsena) { + if (! lp.invsh && (lp.highlihs > 0.f || lp.shadowhs > 0.f || tonequ || tonecurv || lp.strSH != 0.f || lp.showmaskSHmet == 2 || lp.enaSHMask || lp.showmaskSHmet == 3 || lp.showmaskSHmet == 4) && call < 3 && lp.hsena) { const int ystart = std::max(static_cast(lp.yc - lp.lyT) - cy, 0); const int yend = std::min(static_cast(lp.yc + lp.ly) - cy, original->H); const int xstart = std::max(static_cast(lp.xc - lp.lxL) - cx, 0); @@ -9513,6 +9527,22 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o ImProcFunctions::shadowsHighlights(bufexpfin.get(), lp.hsena, 1, lp.highlihs, lp.shadowhs, lp.radiushs, sk, lp.hltonalhs, lp.shtonalhs); } +//gradient + struct grad_params gp; + + if (lp.strSH != 0.f) { + calclocalGradientParams (lp, gp, ystart, xstart, bfw, bfh, 2); +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + double factor = 1.0; + factor = ImProcFunctions::calcGradientFactor (gp, jr, ir); + bufexpfin->L[ir][jr] *= factor; + } + } + if (params->locallab.spots.at(sp).shMethod == "tone") { double scal = (double)(sk); Imagefloat *tmpImage = nullptr; @@ -11500,7 +11530,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o enablefat = true; } - bool execex = (lp.exposena && (lp.expcomp != 0.f || lp.war != 0 || lp.laplacexp > 0.1f || lp.strexp > 0.f || enablefat || lp.showmaskexpmet == 2 || lp.enaExpMask || lp.showmaskexpmet == 3 || lp.showmaskexpmet == 4 || lp.showmaskexpmet == 5 || (exlocalcurve && localexutili))); + bool execex = (lp.exposena && (lp.expcomp != 0.f || lp.war != 0 || lp.laplacexp > 0.1f || lp.strexp != 0.f || enablefat || lp.showmaskexpmet == 2 || lp.enaExpMask || lp.showmaskexpmet == 3 || lp.showmaskexpmet == 4 || lp.showmaskexpmet == 5 || (exlocalcurve && localexutili))); if (!lp.invex && execex) { int ystart = std::max(static_cast(lp.yc - lp.lyT) - cy, 0); @@ -11776,10 +11806,13 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (lp.strexp != 0.f) { calclocalGradientParams (lp, gp, ystart, xstart, bfw, bfh, 1); +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif for (int ir = 0; ir < bfh; ir++) for (int jr = 0; jr < bfw; jr++) { double factor = 1.0; - factor = calcGradientFactor (gp, jr, ir); + factor = ImProcFunctions::calcGradientFactor (gp, jr, ir); bufexpfin->L[ir][jr] *= factor; } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index b8f5de78d..04407fe4d 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -851,6 +851,8 @@ enum ProcEventCode { Evlocallabangmaskexp = 824, Evlocallabstrexp = 825, Evlocallabangexp = 826, + EvlocallabstrSH = 827, + EvlocallabangSH = 828, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index f51b162a3..c979e4f5c 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2557,6 +2557,8 @@ LocallabParams::LocallabSpot::LocallabSpot() : blendmaskSH(0), radmaskSH(0.0), blurSHde(5), + strSH(0.), + angSH(0.), inverssh(false), chromaskSH(0.0), gammaskSH(1.0), @@ -2909,6 +2911,8 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && blendmaskSH == other.blendmaskSH && radmaskSH == other.radmaskSH && blurSHde == other.blurSHde + && strSH == other.strSH + && angSH == other.angSH && inverssh == other.inverssh && chromaskSH == other.chromaskSH && gammaskSH == other.gammaskSH @@ -4237,6 +4241,8 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blendmaskSH, "Locallab", "BlendmaskSH_" + std::to_string(i), spot.blendmaskSH, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).radmaskSH, "Locallab", "RadmaskSH_" + std::to_string(i), spot.radmaskSH, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blurSHde, "Locallab", "BlurSHde_" + std::to_string(i), spot.blurSHde, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).strSH, "Locallab", "StrSH_" + std::to_string(i), spot.strSH, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).angSH, "Locallab", "AngSH_" + std::to_string(i), spot.angSH, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).inverssh, "Locallab", "Inverssh_" + std::to_string(i), spot.inverssh, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).chromaskSH, "Locallab", "ChromaskSH_" + std::to_string(i), spot.chromaskSH, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).gammaskSH, "Locallab", "GammaskSH_" + std::to_string(i), spot.gammaskSH, keyFile); @@ -5694,6 +5700,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "BlendmaskSH_" + std::to_string(i), pedited, spot.blendmaskSH, spotEdited.blendmaskSH); assignFromKeyfile(keyFile, "Locallab", "RadmaskSH_" + std::to_string(i), pedited, spot.radmaskSH, spotEdited.radmaskSH); assignFromKeyfile(keyFile, "Locallab", "BlurSHde_" + std::to_string(i), pedited, spot.blurSHde, spotEdited.blurSHde); + assignFromKeyfile(keyFile, "Locallab", "StrSH_" + std::to_string(i), pedited, spot.strSH, spotEdited.strSH); + assignFromKeyfile(keyFile, "Locallab", "AngSH_" + std::to_string(i), pedited, spot.angSH, spotEdited.angSH); assignFromKeyfile(keyFile, "Locallab", "Inverssh_" + std::to_string(i), pedited, spot.inverssh, spotEdited.inverssh); assignFromKeyfile(keyFile, "Locallab", "ChromaskSH_" + std::to_string(i), pedited, spot.chromaskSH, spotEdited.chromaskSH); assignFromKeyfile(keyFile, "Locallab", "GammaskSH_" + std::to_string(i), pedited, spot.gammaskSH, spotEdited.gammaskSH); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 3921dede1..431edc3e0 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1100,6 +1100,8 @@ struct LocallabParams { int blendmaskSH; double radmaskSH; int blurSHde; + double strSH; + double angSH; bool inverssh; double chromaskSH; double gammaskSH; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 8d5c22239..6b48d0692 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -854,7 +854,9 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //Evlocallabstrmaskexp LUMINANCECURVE, //Evlocallabangmaskexp LUMINANCECURVE, // Evlocallabstrexp - LUMINANCECURVE // Evlocallabangexp + LUMINANCECURVE, // Evlocallabangexp + LUMINANCECURVE, //EvlocallabstrSH + LUMINANCECURVE //EvlocallabangSH }; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 711e4fdff..acdd851a5 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -342,6 +342,8 @@ sensihs(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), blendmaskSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), radmaskSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), 0.0, 100.0, 0.1, 0.))), blurSHde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))), +strSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTR"), -4., 4., 0.05, 0.))), +angSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADANG"), -90, 90, 0.1, 0.))), chromaskSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0, 0.1, 0.))), gammaskSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMMASKCOL"), 0.25, 4.0, 0.01, 1.))), slomaskSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOMASKCOL"), 0.0, 15.0, 0.1, 0.))), @@ -592,6 +594,7 @@ merge1colFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_MERGE1COLFRA")))), pdeFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_PDEFRA")))), fatFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_FATFRA")))), gradFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADFRA")))), +gradSHFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADFRA")))), fatSHFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_FATSHFRA")))), gamFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GAMFRA")))), dehaFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_DEHAFRA")))), @@ -1356,6 +1359,8 @@ pe(nullptr) blendmaskSH->setAdjusterListener(this); radmaskSH->setAdjusterListener(this); blurSHde->setAdjusterListener(this); + strSH->setAdjusterListener(this); + angSH->setAdjusterListener(this); chromaskSH->setAdjusterListener(this); gammaskSH->setAdjusterListener(this); slomaskSH->setAdjusterListener(this); @@ -1458,6 +1463,12 @@ pe(nullptr) gammBox->pack_start(*sloSH); gamFrame->add(*gammBox); + gradSHFrame->set_label_align(0.025, 0.5); + ToolParamBlock* const gradSHBox = Gtk::manage(new ToolParamBlock()); + gradSHBox->pack_start(*strSH); + gradSHBox->pack_start(*angSH); + gradSHFrame->add(*gradSHBox); + shadhighBox->pack_start(*detailSH); shadhighBox->pack_start(*gamFrame); shadhighBox->pack_start(*highlights); @@ -1467,6 +1478,7 @@ pe(nullptr) shadhighBox->pack_start(*sh_radius); shadhighBox->pack_start(*sensihs); shadhighBox->pack_start(*blurSHde); + shadhighBox->pack_start(*gradSHFrame); shadhighBox->pack_start(*inverssh); fatSHFrame->set_label_align(0.025, 0.5); @@ -4025,6 +4037,8 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).blendmaskSH = blendmaskSH->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).radmaskSH = radmaskSH->getValue(); pp->locallab.spots.at(pp->locallab.selspot).blurSHde = blurSHde->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).strSH = strSH->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).angSH = angSH->getValue(); pp->locallab.spots.at(pp->locallab.selspot).inverssh = inverssh->get_active(); pp->locallab.spots.at(pp->locallab.selspot).chromaskSH = chromaskSH->getValue(); pp->locallab.spots.at(pp->locallab.selspot).gammaskSH = gammaskSH->getValue(); @@ -4420,6 +4434,8 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pe->locallab.spots.at(pp->locallab.selspot).blendmaskSH = pe->locallab.spots.at(pp->locallab.selspot).blendmaskSH || blendmaskSH->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).radmaskSH = pe->locallab.spots.at(pp->locallab.selspot).radmaskSH || radmaskSH->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).blurSHde = pe->locallab.spots.at(pp->locallab.selspot).blurSHde || blurSHde->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).strSH = pe->locallab.spots.at(pp->locallab.selspot).strSH || strSH->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).angSH = pe->locallab.spots.at(pp->locallab.selspot).angSH || angSH->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).inverssh = pe->locallab.spots.at(pp->locallab.selspot).inverssh || !inverssh->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).chromaskSH = pe->locallab.spots.at(pp->locallab.selspot).chromaskSH || chromaskSH->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).gammaskSH = pe->locallab.spots.at(pp->locallab.selspot).gammaskSH || gammaskSH->getEditedState(); @@ -4768,6 +4784,8 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pedited->locallab.spots.at(pp->locallab.selspot).blendmaskSH = pedited->locallab.spots.at(pp->locallab.selspot).blendmaskSH || blendmaskSH->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).radmaskSH = pedited->locallab.spots.at(pp->locallab.selspot).radmaskSH || radmaskSH->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).blurSHde = pedited->locallab.spots.at(pp->locallab.selspot).blurSHde || blurSHde->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).strSH = pedited->locallab.spots.at(pp->locallab.selspot).strSH || strSH->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).angSH = pedited->locallab.spots.at(pp->locallab.selspot).angSH || angSH->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).inverssh = pedited->locallab.spots.at(pp->locallab.selspot).inverssh || !inverssh->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).chromaskSH = pedited->locallab.spots.at(pp->locallab.selspot).chromaskSH || chromaskSH->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).gammaskSH = pedited->locallab.spots.at(pp->locallab.selspot).gammaskSH || gammaskSH->getEditedState(); @@ -6532,6 +6550,7 @@ void Locallab::inversexChanged() shadex->show(); expMethod->show(); exnoiseMethod->show(); + gradFrame->show(); if (expMethod->get_active_row_number() == 0) { pdeFrame->hide(); @@ -6560,6 +6579,7 @@ void Locallab::inversexChanged() showmaskexpMethod->hide(); showmaskexpMethodinv->show(); expMethod->set_active(0); + gradFrame->hide(); if (expMethod->get_active_row_number() == 0) { pdeFrame->hide(); @@ -6581,6 +6601,7 @@ void Locallab::inversexChanged() shadex->show(); expMethod->show(); exnoiseMethod->show(); + gradFrame->show(); if (expMethod->get_active_row_number() == 0) { pdeFrame->hide(); @@ -6633,6 +6654,7 @@ void Locallab::inversshChanged() expmasksh->show(); showmaskSHMethod->show(); showmaskSHMethodinv->hide(); + gradSHFrame->show(); showmaskSHMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode } else if (inverssh->get_active()) { @@ -6643,6 +6665,7 @@ void Locallab::inversshChanged() showmaskSHMethod->hide(); showmaskSHMethodinv->show(); // shMethod->set_active(0); + gradSHFrame->hide(); } else { // printf("Pas Inv SH\n"); @@ -6651,6 +6674,7 @@ void Locallab::inversshChanged() blurSHde->show(); showmaskSHMethod->show(); showmaskSHMethodinv->hide(); + gradSHFrame->show(); if (batchMode) { showmaskSHMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode @@ -7069,6 +7093,8 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c blendmaskSH->setDefault((double)defSpot->blendmaskSH); radmaskSH->setDefault(defSpot->radmaskSH); blurSHde->setDefault((double)defSpot->blurSHde); + strSH->setDefault((double)defSpot->strSH); + angSH->setDefault((double)defSpot->angSH); chromaskSH->setDefault(defSpot->chromaskSH); gammaskSH->setDefault(defSpot->gammaskSH); slomaskSH->setDefault(defSpot->slomaskSH); @@ -7278,6 +7304,8 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c blendmaskSH->setDefaultEditedState(Irrelevant); radmaskSH->setDefaultEditedState(Irrelevant); blurSHde->setDefaultEditedState(Irrelevant); + strSH->setDefaultEditedState(Irrelevant); + angSH->setDefaultEditedState(Irrelevant); chromaskSH->setDefaultEditedState(Irrelevant); gammaskSH->setDefaultEditedState(Irrelevant); slomaskSH->setDefaultEditedState(Irrelevant); @@ -7491,6 +7519,8 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c blendmaskSH->setDefaultEditedState(defSpotState->blendmaskSH ? Edited : UnEdited); radmaskSH->setDefaultEditedState(defSpotState->radmaskSH ? Edited : UnEdited); blurSHde->setDefaultEditedState(defSpotState->blurSHde ? Edited : UnEdited); + strSH->setDefaultEditedState(defSpotState->strSH ? Edited : UnEdited); + angSH->setDefaultEditedState(defSpotState->angSH ? Edited : UnEdited); chromaskSH->setDefaultEditedState(defSpotState->chromaskSH ? Edited : UnEdited); gammaskSH->setDefaultEditedState(defSpotState->gammaskSH ? Edited : UnEdited); slomaskSH->setDefaultEditedState(defSpotState->slomaskSH ? Edited : UnEdited); @@ -8087,6 +8117,18 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) } } + if (a == strSH) { + if (listener) { + listener->panelChanged(EvlocallabstrSH, strSH->getTextValue()); + } + } + + if (a == angSH) { + if (listener) { + listener->panelChanged(EvlocallabangSH, angSH->getTextValue()); + } + } + if (a == chromaskSH) { if (listener) { listener->panelChanged(EvlocallabchromaskSH, chromaskSH->getTextValue()); @@ -8961,6 +9003,8 @@ void Locallab::setBatchMode(bool batchMode) blendmaskSH->showEditedCB(); radmaskSH->showEditedCB(); blurSHde->showEditedCB(); + strSH->showEditedCB(); + angSH->showEditedCB(); chromaskSH->showEditedCB(); gammaskSH->showEditedCB(); slomaskSH->showEditedCB(); @@ -9665,6 +9709,8 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con blendmaskSH->setValue(pp->locallab.spots.at(index).blendmaskSH); radmaskSH->setValue(pp->locallab.spots.at(index).radmaskSH); blurSHde->setValue(pp->locallab.spots.at(index).blurSHde); + strSH->setValue(pp->locallab.spots.at(index).strSH); + angSH->setValue(pp->locallab.spots.at(index).angSH); inverssh->set_active(pp->locallab.spots.at(index).inverssh); chromaskSH->setValue(pp->locallab.spots.at(index).chromaskSH); gammaskSH->setValue(pp->locallab.spots.at(index).gammaskSH); @@ -10101,6 +10147,8 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con blendmaskSH->setEditedState(spotState->blendmaskSH ? Edited : UnEdited); radmaskSH->setEditedState(spotState->radmaskSH ? Edited : UnEdited); blurSHde->setEditedState(spotState->blurSHde ? Edited : UnEdited); + strSH->setEditedState(spotState->strSH ? Edited : UnEdited); + angSH->setEditedState(spotState->angSH ? Edited : UnEdited); inverssh->set_inconsistent(multiImage && !spotState->inverssh); chromaskSH->setEditedState(spotState->chromaskSH ? Edited : UnEdited); gammaskSH->setEditedState(spotState->gammaskSH ? Edited : UnEdited); @@ -10462,6 +10510,7 @@ void Locallab::updateSpecificGUIState() expMethod->show(); expmaskexp->show(); exnoiseMethod->show(); + gradFrame->show(); if (expMethod->get_active_row_number() == 0) { pdeFrame->hide(); @@ -10487,6 +10536,7 @@ void Locallab::updateSpecificGUIState() showmaskexpMethodinv->show(); showmaskexpMethod->hide(); softradiusexp->show(); + gradFrame->hide(); expMethod->set_active(0); @@ -10508,6 +10558,7 @@ void Locallab::updateSpecificGUIState() expmaskexp->show(); showmaskexpMethodinv->hide(); showmaskexpMethod->show(); + gradFrame->show(); if (expMethod->get_active_row_number() == 0) { pdeFrame->hide(); @@ -10537,6 +10588,7 @@ void Locallab::updateSpecificGUIState() showmaskSHMethodinv->show(); showmaskSHMethod->hide(); // shMethod->set_active(0); + gradSHFrame->hide(); if (shMethod->get_active_row_number() == 0) { for (int i = 0; i < 5; i++) { @@ -10556,6 +10608,7 @@ void Locallab::updateSpecificGUIState() } gamFrame->show(); + gradSHFrame->show(); detailSH->show(); highlights->hide(); @@ -10571,6 +10624,7 @@ void Locallab::updateSpecificGUIState() expmasksh->show(); showmaskSHMethodinv->hide(); showmaskSHMethod->show(); + gradSHFrame->show(); if (batchMode) { showmaskSHMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 138cbba95..8d77287fe 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -224,6 +224,8 @@ private: Adjuster* const blendmaskSH; Adjuster* const radmaskSH; Adjuster* const blurSHde; + Adjuster* const strSH; + Adjuster* const angSH; Adjuster* const chromaskSH; Adjuster* const gammaskSH; Adjuster* const slomaskSH; @@ -512,6 +514,7 @@ private: Gtk::Frame* const pdeFrame; Gtk::Frame* const fatFrame; Gtk::Frame* const gradFrame; + Gtk::Frame* const gradSHFrame; Gtk::Frame* const fatSHFrame; Gtk::Frame* const gamFrame; Gtk::Frame* const dehaFrame; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 2cdebb66e..4eb1bb046 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1091,6 +1091,8 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).blendmaskSH = locallab.spots.at(j).blendmaskSH && pSpot.blendmaskSH == otherSpot.blendmaskSH; locallab.spots.at(j).radmaskSH = locallab.spots.at(j).radmaskSH && pSpot.radmaskSH == otherSpot.radmaskSH; locallab.spots.at(j).blurSHde = locallab.spots.at(j).blurSHde && pSpot.blurSHde == otherSpot.blurSHde; + locallab.spots.at(j).strSH = locallab.spots.at(j).strSH && pSpot.strSH == otherSpot.strSH; + locallab.spots.at(j).angSH = locallab.spots.at(j).angSH && pSpot.angSH == otherSpot.angSH; locallab.spots.at(j).inverssh = locallab.spots.at(j).inverssh && pSpot.inverssh == otherSpot.inverssh; locallab.spots.at(j).chromaskSH = locallab.spots.at(j).chromaskSH && pSpot.chromaskSH == otherSpot.chromaskSH; locallab.spots.at(j).gammaskSH = locallab.spots.at(j).gammaskSH && pSpot.gammaskSH == otherSpot.gammaskSH; @@ -3305,6 +3307,14 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).blurSHde = mods.locallab.spots.at(i).blurSHde; } + if (locallab.spots.at(i).strSH) { + toEdit.locallab.spots.at(i).strSH = mods.locallab.spots.at(i).strSH; + } + + if (locallab.spots.at(i).angSH) { + toEdit.locallab.spots.at(i).angSH = mods.locallab.spots.at(i).angSH; + } + if (locallab.spots.at(i).inverssh) { toEdit.locallab.spots.at(i).inverssh = mods.locallab.spots.at(i).inverssh; } @@ -5170,6 +5180,8 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : blendmaskSH(v), radmaskSH(v), blurSHde(v), + strSH(v), + angSH(v), inverssh(v), chromaskSH(v), gammaskSH(v), @@ -5512,6 +5524,8 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) blendmaskSH = v; radmaskSH = v; blurSHde = v; + strSH = v; + angSH = v; inverssh = v; chromaskSH = v; gammaskSH = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 2b2bab17b..8335a4920 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -526,6 +526,8 @@ public: bool blendmaskSH; bool radmaskSH; bool blurSHde; + bool strSH; + bool angSH; bool inverssh; bool chromaskSH; bool gammaskSH;