diff --git a/rtdata/languages/default b/rtdata/languages/default index 28573ee52..2d64b34be 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1189,6 +1189,7 @@ HISTORY_MSG_948;Local - Mask Common Wavelet curve HISTORY_MSG_949;Local - Mask Common Threshold levels HISTORY_MSG_950;Local - Mask Common GF strength HISTORY_MSG_951;Local - Mask Common GF angle +HISTORY_MSG_952;Local - Mask Common soft radius HISTORY_MSG_CAT02PRESET;Cat02 automatic preset HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index fe0c0a7fd..50e7a4177 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -14568,6 +14568,7 @@ void ImProcFunctions::Lab_Local( const int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc; const int lumask = params->locallab.spots.at(sp).lumask; const float strumask = 0.02f * params->locallab.spots.at(sp).strumaskmask; + const float softr = params->locallab.spots.at(sp).softradiusmask; const float mindE = 2.f + MINSCOPE * sco * lp.thr; const float maxdE = 5.f + MAXSCOPE * sco * (1 + 0.1f * lp.thr); @@ -14601,6 +14602,10 @@ void ImProcFunctions::Lab_Local( } } //perhaps we can put here a softproc to reduce artifacts between bufcolorigsav and bufcolfin, just a slider... ?? but is it necessary with this type of change ?? + if (softr > 0.f) { + softproc(bufcolorigsav.get(), bufcolfin.get(), softr, bfh, bfw, 0.0001, 0.00001, 0.1f, sk, multiThread, 1); + } + float meansob = 0.f; transit_shapedetect2(call, 20, bufcolorigsav.get(), bufcolfin.get(), originalmaskcol.get(), hueref, chromaref, lumaref, sobelref, meansob, nullptr, lp, origsav, transformed, cx, cy, sk); delete origsav; diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 8fd00238c..cea95c451 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -974,6 +974,7 @@ enum ProcEventCode { EvlocallabcsThresholdmask = 948, Evlocallabstr_mask = 949, Evlocallabang_mask = 950, + Evlocallabsoftradiusmask = 951, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index e7267bc30..88f474a84 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3739,6 +3739,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : expmask(false), sensimask(60), blendmask(0), + softradiusmask(0.0), enamask(false), fftmask(true), blurmask(0.2), @@ -4309,6 +4310,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && expmask == other.expmask && sensimask == other.sensimask && blendmask == other.blendmask + && softradiusmask == other.softradiusmask && enamask == other.enamask && fftmask == other.fftmask && blurmask == other.blurmask @@ -5830,6 +5832,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->complexmask, "Locallab", "Complexmask_" + index_str, spot.complexmask, keyFile); saveToKeyfile(!pedited || spot_edited->sensimask, "Locallab", "Sensimask_" + index_str, spot.sensimask, keyFile); saveToKeyfile(!pedited || spot_edited->blendmask, "Locallab", "Blendmaskmask_" + index_str, spot.blendmask, keyFile); + saveToKeyfile(!pedited || spot_edited->softradiusmask, "Locallab", "Softradiusmask_" + index_str, spot.softradiusmask, keyFile); saveToKeyfile(!pedited || spot_edited->enamask, "Locallab", "Enamask_" + index_str, spot.enamask, keyFile); saveToKeyfile(!pedited || spot_edited->fftmask, "Locallab", "Fftmask_" + index_str, spot.fftmask, keyFile); saveToKeyfile(!pedited || spot_edited->blurmask, "Locallab", "Blurmask_" + index_str, spot.blurmask, keyFile); @@ -7570,6 +7573,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Complexmask_" + index_str, pedited, spot.complexmask, spotEdited.complexmask); assignFromKeyfile(keyFile, "Locallab", "Sensimask_" + index_str, pedited, spot.sensimask, spotEdited.sensimask); assignFromKeyfile(keyFile, "Locallab", "Blendmaskmask_" + index_str, pedited, spot.blendmask, spotEdited.blendmask); + assignFromKeyfile(keyFile, "Locallab", "Softradiusmask_" + index_str, pedited, spot.softradiusmask, spotEdited.softradiusmask); assignFromKeyfile(keyFile, "Locallab", "Enamask_" + index_str, pedited, spot.enamask, spotEdited.enamask); assignFromKeyfile(keyFile, "Locallab", "Fftmask_" + index_str, pedited, spot.fftmask, spotEdited.fftmask); assignFromKeyfile(keyFile, "Locallab", "Blurmask_" + index_str, pedited, spot.blurmask, spotEdited.blurmask); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index f50f96058..08fc55d02 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1427,6 +1427,7 @@ struct LocallabParams { bool expmask; int sensimask; int blendmask; + double softradiusmask; bool enamask; bool fftmask; double blurmask; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 9dde3a160..b3a111b1b 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -977,8 +977,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // EvlocallabLLmask_shapewav LUMINANCECURVE, // EvlocallabcsThresholdmask LUMINANCECURVE, // Evlocallabstr_mask - LUMINANCECURVE // Evlocallabang_mask - + LUMINANCECURVE, // Evlocallabang_mask + LUMINANCECURVE // Evlocallabsoftradiusmask }; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 6e1a0df3f..4171c30b8 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -1206,6 +1206,8 @@ class LocallabMask: private: Adjuster* const sensimask; Adjuster* const blendmask; + Adjuster* const softradiusmask; + MyComboBoxText* const showmask_Method; Gtk::CheckButton* const enamask; CurveEditorGroup* const mask_CurveEditorG; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 6b64a97e3..b27eb3aeb 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -4732,6 +4732,8 @@ LocallabMask::LocallabMask(): // Comon mask specific widgets sensimask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), blendmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), + softradiusmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 1000.0, 0.5, 0.))), + showmask_Method(Gtk::manage(new MyComboBoxText())), enamask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), mask_CurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASKCOL"))), @@ -4771,6 +4773,7 @@ LocallabMask::LocallabMask(): sensimask->setAdjusterListener(this); blendmask->setAdjusterListener(this); + softradiusmask->setAdjusterListener(this); showmask_Method->append(M("TP_LOCALLAB_SHOWMNONE")); showmask_Method->append(M("TP_LOCALLAB_SHOWMODIFMASK")); showmask_Method->append(M("TP_LOCALLAB_SHOWMASK")); @@ -4844,7 +4847,7 @@ LocallabMask::LocallabMask(): pack_start(*sensimask, Gtk::PACK_SHRINK, 0); pack_start(*blendmask, Gtk::PACK_SHRINK, 0); - + pack_start(*softradiusmask, Gtk::PACK_SHRINK, 0); ToolParamBlock* const maskmaskBox = Gtk::manage(new ToolParamBlock()); maskmaskBox->pack_start(*showmask_Method, Gtk::PACK_SHRINK, 4); maskmaskBox->pack_start(*mask_CurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor @@ -5018,6 +5021,7 @@ void LocallabMask::read(const rtengine::procparams::ProcParams* pp, const Params blurmask->setValue(spot.blurmask); blendmask->setValue(spot.blendmask); + softradiusmask->setValue(spot.softradiusmask); enamask->set_active(spot.enamask); CCmask_shape->setCurve(spot.CCmask_curve); LLmask_shape->setCurve(spot.LLmask_curve); @@ -5063,6 +5067,7 @@ void LocallabMask::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.sensimask = sensimask->getIntValue(); spot.blendmask = blendmask->getIntValue(); + spot.softradiusmask = softradiusmask->getValue(); spot.enamask = enamask->get_active(); spot.CCmask_curve = CCmask_shape->getCurve(); spot.LLmask_curve = LLmask_shape->getCurve(); @@ -5119,6 +5124,7 @@ void LocallabMask::setDefaults(const rtengine::procparams::ProcParams* defParams strumaskmask->setDefault(defSpot.strumaskmask); toolmask->set_active(defSpot.toolmask); blendmask->setDefault((double)defSpot.blendmask); + softradiusmask->setDefault((double)defSpot.softradiusmask); radmask->setDefault(defSpot.radmask); lapmask->setDefault(defSpot.lapmask); chromask->setDefault(defSpot.chromask); @@ -5346,6 +5352,13 @@ void LocallabMask::adjusterChanged(Adjuster* a, double newval) } } + if (a == softradiusmask) { + if (listener) { + listener->panelChanged(Evlocallabsoftradiusmask, + softradiusmask->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == radmask) { if (listener) { listener->panelChanged(Evlocallabradmask, diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 84a283ea9..2031a7e8a 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1483,6 +1483,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).expmask = locallab.spots.at(j).expmask && pSpot.expmask == otherSpot.expmask; locallab.spots.at(j).sensimask = locallab.spots.at(j).sensimask && pSpot.sensimask == otherSpot.sensimask; locallab.spots.at(j).blendmask = locallab.spots.at(j).blendmask && pSpot.blendmask == otherSpot.blendmask; + locallab.spots.at(j).softradiusmask = locallab.spots.at(j).softradiusmask && pSpot.softradiusmask == otherSpot.softradiusmask; locallab.spots.at(j).enamask = locallab.spots.at(j).enamask && pSpot.enamask == otherSpot.enamask; locallab.spots.at(j).fftmask = locallab.spots.at(j).fftmask && pSpot.fftmask == otherSpot.fftmask; locallab.spots.at(j).blurmask = locallab.spots.at(j).blurmask && pSpot.blurmask == otherSpot.blurmask; @@ -4830,6 +4831,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).blendmask = mods.locallab.spots.at(i).blendmask; } + if (locallab.spots.at(i).softradiusmask) { + toEdit.locallab.spots.at(i).softradiusmask = mods.locallab.spots.at(i).softradiusmask; + } + if (locallab.spots.at(i).enamask) { toEdit.locallab.spots.at(i).enamask = mods.locallab.spots.at(i).enamask; } @@ -6489,6 +6494,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : expmask(v), sensimask(v), blendmask(v), + softradiusmask(v), enamask(v), fftmask(v), blurmask(v), @@ -6977,6 +6983,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) expmask = v; sensimask = v; blendmask = v; + softradiusmask = v; enamask = v; fftmask = v; blurmask = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index b58a96b46..e6e6a2b2b 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -841,6 +841,7 @@ public: bool expmask; bool sensimask; bool blendmask; + bool softradiusmask; bool enamask; bool fftmask; bool blurmask;