diff --git a/rtdata/languages/default b/rtdata/languages/default index 2ca94c476..5f0d712e3 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1149,7 +1149,8 @@ HISTORY_MSG_908;Local - Contrast Wavelet ES neighboring HISTORY_MSG_909;Local - Contrast Wavelet ES show HISTORY_MSG_910;Local - Wavelet Edge performance HISTORY_MSG_911;Local - Blur Chroma Luma -HISTORY_MSG_912;Local - Blur Guide filter strength +HISTORY_MSG_912;Local - Blur Guide filter strength +HISTORY_MSG_913;Local - Contrast Wavelet Sigma DR 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/procevents.h b/rtengine/procevents.h index eb4aa1484..b762a4062 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -935,6 +935,7 @@ enum ProcEventCode { EvLocallabSpotwavMethod = 909, EvlocallabchroMethod = 910, Evlocallabstrbl = 911, + Evlocallabsigmadr = 912, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index e41177c29..2996bcdc9 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2826,6 +2826,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : residcomp(0.0), sigma(1.0), offset(1.0), + sigmadr(1.0), threswav(1.4), chromalev(1.0), chromablu(1.0), @@ -3268,6 +3269,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && residcomp == other.residcomp && sigma == other.sigma && offset == other.offset + && sigmadr == other.sigmadr && threswav == other.threswav && chromalev == other.chromalev && chromablu == other.chromablu @@ -4706,6 +4708,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).residcomp, "Locallab", "Residcomp_" + std::to_string(i), spot.residcomp, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sigma, "Locallab", "Sigma_" + std::to_string(i), spot.sigma, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).offset, "Locallab", "Offset_" + std::to_string(i), spot.offset, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sigmadr, "Locallab", "Sigmadr_" + std::to_string(i), spot.sigmadr, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).threswav, "Locallab", "Threswav_" + std::to_string(i), spot.threswav, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).chromalev, "Locallab", "Chromalev_" + std::to_string(i), spot.chromalev, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).chromablu, "Locallab", "Chromablu_" + std::to_string(i), spot.chromablu, keyFile); @@ -6349,6 +6352,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Residcomp_" + std::to_string(i), pedited, spot.residcomp, spotEdited.residcomp); assignFromKeyfile(keyFile, "Locallab", "Sigma_" + std::to_string(i), pedited, spot.sigma, spotEdited.sigma); assignFromKeyfile(keyFile, "Locallab", "Offset_" + std::to_string(i), pedited, spot.offset, spotEdited.offset); + assignFromKeyfile(keyFile, "Locallab", "Sigmadr_" + std::to_string(i), pedited, spot.sigmadr, spotEdited.sigmadr); assignFromKeyfile(keyFile, "Locallab", "Threswav_" + std::to_string(i), pedited, spot.threswav, spotEdited.threswav); assignFromKeyfile(keyFile, "Locallab", "Chromalev_" + std::to_string(i), pedited, spot.chromalev, spotEdited.chromalev); assignFromKeyfile(keyFile, "Locallab", "Chromablu_" + std::to_string(i), pedited, spot.chromablu, spotEdited.chromablu); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index f0f285c71..203c859c6 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1302,6 +1302,7 @@ struct LocallabParams { double residcomp; double sigma; double offset; + double sigmadr; double threswav; double chromalev; double chromablu; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index b9073d880..2973da732 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -938,7 +938,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabwaveshow LUMINANCECURVE, // EvLocallabSpotwavMethod LUMINANCECURVE, // EvlocallabchroMethod - LUMINANCECURVE // Evlocallabstrbl + LUMINANCECURVE, // Evlocallabstrbl + LUMINANCECURVE // Evlocallabsigmadr }; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index e884d4238..ebc00c3ca 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -936,6 +936,7 @@ private: Gtk::CheckButton* const wavcompre; CurveEditorGroup* const LocalcurveEditorwavcompre; FlatCurveEditor* const wavshapecompre; + Adjuster* const sigmadr; Adjuster* const threswav; Adjuster* const residcomp; Gtk::Frame* const compFrame; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index fb89cc55f..b2a4854d0 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -2057,6 +2057,7 @@ LocallabContrast::LocallabContrast(): wavcompre(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_COMPREFRA")))), LocalcurveEditorwavcompre(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVCOMPRE"))), wavshapecompre(static_cast(LocalcurveEditorwavcompre->addCurve(CT_Flat, "", nullptr, false, false))), + sigmadr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGMAWAV"), 0.2, 2.5, 0.01, 1.))), threswav(Gtk::manage(new Adjuster(M("TP_LOCALLAB_THRESWAV"), 0.9, 2., 0.01, 1.4))), residcomp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCOMP"), -1., 1., 0.01, 0.))), compFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_COMPFRA")))), @@ -2264,6 +2265,7 @@ LocallabContrast::LocallabContrast(): LocalcurveEditorwavcompre->curveListComplete(); + sigmadr->setAdjusterListener(this); threswav->setAdjusterListener(this); residcomp->setAdjusterListener(this); @@ -2454,6 +2456,7 @@ LocallabContrast::LocallabContrast(): compreBox->set_spacing(2); compreFrame->set_label_widget(*wavcompre); compreBox->pack_start(*LocalcurveEditorwavcompre, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + compreBox->pack_start(*sigmadr); compreBox->pack_start(*threswav); compreBox->pack_start(*residcomp); compreFrame->add(*compreBox); @@ -2468,7 +2471,7 @@ LocallabContrast::LocallabContrast(): compBox->pack_start(*separatorcomp); compBox->pack_start(*fatres); compFrame->add(*compBox); - blurcontBox2->pack_start(*compFrame); +// blurcontBox2->pack_start(*compFrame); expcontrastpyr2->add(*blurcontBox2, false); pack_start(*expcontrastpyr2); @@ -2646,6 +2649,7 @@ void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const Pa wavshapecon->setCurve(pp->locallab.spots.at(index).locconwavcurve); wavcompre->set_active(pp->locallab.spots.at(index).wavcompre); wavshapecompre->setCurve(pp->locallab.spots.at(index).loccomprewavcurve); + sigmadr->setValue(pp->locallab.spots.at(index).sigmadr); threswav->setValue(pp->locallab.spots.at(index).threswav); residcomp->setValue(pp->locallab.spots.at(index).residcomp); wavcomp->set_active(pp->locallab.spots.at(index).wavcomp); @@ -2761,6 +2765,7 @@ void LocallabContrast::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pp->locallab.spots.at(index).locconwavcurve = wavshapecon->getCurve(); pp->locallab.spots.at(index).wavcompre = wavcompre->get_active(); pp->locallab.spots.at(index).loccomprewavcurve = wavshapecompre->getCurve(); + pp->locallab.spots.at(index).sigmadr = sigmadr->getValue(); pp->locallab.spots.at(index).threswav = threswav->getValue(); pp->locallab.spots.at(index).residcomp = residcomp->getValue(); pp->locallab.spots.at(index).wavcomp = wavcomp->get_active(); @@ -2818,6 +2823,7 @@ void LocallabContrast::setDefaults(const rtengine::procparams::ProcParams* defPa sigma->setDefault(defSpot.sigma); offset->setDefault(defSpot.offset); chromalev->setDefault(defSpot.chromalev); + sigmadr->setDefault(defSpot.sigmadr); threswav->setDefault(defSpot.threswav); residcomp->setDefault(defSpot.residcomp); fatdet->setDefault(defSpot.fatdet); @@ -3023,6 +3029,14 @@ void LocallabContrast::adjusterChanged(Adjuster* a, double newval) } } + if (a == sigmadr) { + if (listener) { + listener->panelChanged(Evlocallabsigmadr, + sigmadr->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == threswav) { if (listener) { listener->panelChanged(Evlocallabthreswav, @@ -3359,6 +3373,7 @@ void LocallabContrast::wavcompreChanged() void LocallabContrast::wavcompChanged() { if (isLocActivated && exp->getEnabled()) { + wavcomp->set_active(false);//always disabled if (listener) { if (wavcomp->get_active()) { listener->panelChanged(Evlocallabwavcomp, @@ -3450,6 +3465,7 @@ void LocallabContrast::updateContrastGUI1() chromalev->hide(); LocalcurveEditorwavcon->hide(); LocalcurveEditorwavcompre->hide(); + sigmadr->hide(); threswav->hide(); residcomp->hide(); fatdet->hide(); @@ -3488,6 +3504,7 @@ void LocallabContrast::updateContrastGUI1() chromalev->show(); LocalcurveEditorwavcon->show(); LocalcurveEditorwavcompre->show(); + sigmadr->show(); threswav->show(); residcomp->show(); fatdet->show(); diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index ebb2f5081..ce35488ec 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1329,6 +1329,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).residcomp = locallab.spots.at(j).residcomp && pSpot.residcomp == otherSpot.residcomp; locallab.spots.at(j).sigma = locallab.spots.at(j).sigma && pSpot.sigma == otherSpot.sigma; locallab.spots.at(j).offset = locallab.spots.at(j).offset && pSpot.offset == otherSpot.offset; + locallab.spots.at(j).sigmadr = locallab.spots.at(j).sigmadr && pSpot.sigmadr == otherSpot.sigmadr; locallab.spots.at(j).threswav = locallab.spots.at(j).threswav && pSpot.threswav == otherSpot.threswav; locallab.spots.at(j).chromalev = locallab.spots.at(j).chromalev && pSpot.chromalev == otherSpot.chromalev; locallab.spots.at(j).chromablu = locallab.spots.at(j).chromablu && pSpot.chromablu == otherSpot.chromablu; @@ -4238,6 +4239,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).offset = mods.locallab.spots.at(i).offset; } + if (locallab.spots.at(i).sigmadr) { + toEdit.locallab.spots.at(i).sigmadr = mods.locallab.spots.at(i).sigmadr; + } + if (locallab.spots.at(i).threswav) { toEdit.locallab.spots.at(i).threswav = mods.locallab.spots.at(i).threswav; } @@ -5988,6 +5993,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : residcomp(v), sigma(v), offset(v), + sigmadr(v), threswav(v), chromalev(v), chromablu(v), @@ -6423,6 +6429,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) residcomp = v; sigma = v; offset = v; + sigmadr = v; threswav = v; chromalev = v; chromablu = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index cdd2f51ab..7c5e2a65d 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -729,6 +729,7 @@ public: bool residcomp; bool sigma; bool offset; + bool sigmadr; bool threswav; bool chromalev; bool chromablu;