From f2d867bef1d62c8a82cdb91f4f43ae37ab047f14 Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 21 Apr 2020 10:32:38 +0200 Subject: [PATCH] Added slider sigmabl - disactivated blurcbdl --- rtdata/languages/default | 1 + rtengine/iplocallab.cc | 2 +- rtengine/procevents.h | 1 + rtengine/procparams.cc | 4 ++++ rtengine/procparams.h | 1 + rtengine/refreshmap.cc | 3 ++- rtgui/locallabtools.h | 1 + rtgui/locallabtools2.cc | 17 ++++++++++++++++- rtgui/paramsedited.cc | 7 +++++++ rtgui/paramsedited.h | 1 + 10 files changed, 35 insertions(+), 3 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 8e6a29af4..c3b472809 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1151,6 +1151,7 @@ HISTORY_MSG_910;Local - Wavelet Edge performance HISTORY_MSG_911;Local - Blur Chroma Luma HISTORY_MSG_912;Local - Blur Guide filter strength HISTORY_MSG_913;Local - Contrast Wavelet Sigma DR +HISTORY_MSG_914;Local - Blur Wavelet Sigma BL 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 5a2ce11e4..bc04bcfc9 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -864,7 +864,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall int local_sensicb = locallab.spots.at(sp).sensicb; float local_clarityml = (float) locallab.spots.at(sp).clarityml; float local_contresid = (float) locallab.spots.at(sp).contresid; - int local_blurcbdl = (float) locallab.spots.at(sp).blurcbdl; + int local_blurcbdl = 0; //(float) locallab.spots.at(sp).blurcbdl; int local_contrast = locallab.spots.at(sp).contrast; float local_lightness = (float) locallab.spots.at(sp).lightness; float labgridALowloc = locallab.spots.at(sp).labgridALow; diff --git a/rtengine/procevents.h b/rtengine/procevents.h index b762a4062..41ae2d5c1 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -936,6 +936,7 @@ enum ProcEventCode { EvlocallabchroMethod = 910, Evlocallabstrbl = 911, Evlocallabsigmadr = 912, + Evlocallabsigmabl = 913, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 2996bcdc9..aed65997f 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2822,6 +2822,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : residcont(0.0), residblur(0.0), levelblur(0.0), + sigmabl(1.0), residchro(0.0), residcomp(0.0), sigma(1.0), @@ -3265,6 +3266,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && residcont == other.residcont && residblur == other.residblur && levelblur == other.levelblur + && sigmabl == other.sigmabl && residchro == other.residchro && residcomp == other.residcomp && sigma == other.sigma @@ -4704,6 +4706,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).residcont, "Locallab", "Residcont_" + std::to_string(i), spot.residcont, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).residblur, "Locallab", "Residblur_" + std::to_string(i), spot.residblur, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).levelblur, "Locallab", "Levelblur_" + std::to_string(i), spot.levelblur, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sigmabl, "Locallab", "Sigmabl_" + std::to_string(i), spot.sigmabl, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).residchro, "Locallab", "Residchro_" + std::to_string(i), spot.residchro, keyFile); 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); @@ -6348,6 +6351,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Residcont_" + std::to_string(i), pedited, spot.residcont, spotEdited.residcont); assignFromKeyfile(keyFile, "Locallab", "Residblur_" + std::to_string(i), pedited, spot.residblur, spotEdited.residblur); assignFromKeyfile(keyFile, "Locallab", "Levelblur_" + std::to_string(i), pedited, spot.levelblur, spotEdited.levelblur); + assignFromKeyfile(keyFile, "Locallab", "Sigmabl_" + std::to_string(i), pedited, spot.sigmabl, spotEdited.sigmabl); assignFromKeyfile(keyFile, "Locallab", "Residchro_" + std::to_string(i), pedited, spot.residchro, spotEdited.residchro); 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); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 203c859c6..d3f8bde6e 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1298,6 +1298,7 @@ struct LocallabParams { double residcont; double residblur; double levelblur; + double sigmabl; double residchro; double residcomp; double sigma; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 2973da732..dfbb2fa8e 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -939,7 +939,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // EvLocallabSpotwavMethod LUMINANCECURVE, // EvlocallabchroMethod LUMINANCECURVE, // Evlocallabstrbl - LUMINANCECURVE // Evlocallabsigmadr + LUMINANCECURVE, // Evlocallabsigmadr + LUMINANCECURVE // Evlocallabsigmabl }; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index ebc00c3ca..41136cccb 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -919,6 +919,7 @@ private: Gtk::Frame* const blurlevelFrame; Gtk::CheckButton* const wavblur; Adjuster* const levelblur; + Adjuster* const sigmabl; Adjuster* const chromablu; CurveEditorGroup* const LocalcurveEditorwavlev; FlatCurveEditor* const wavshapelev; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index b2a4854d0..a0836affc 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -2040,6 +2040,7 @@ LocallabContrast::LocallabContrast(): blurlevelFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_BLURLEVELFRA")))), wavblur(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_BLURLEVELFRA")))), levelblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LEVELBLUR"), 0., 100., 0.5, 0.))), + sigmabl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGMAWAV"), 0.2, 2.5, 0.01, 1.))), chromablu(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMABLU"), 0.01, 5., 0.01, 1.))), LocalcurveEditorwavlev(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVLEV"))), wavshapelev(static_cast(LocalcurveEditorwavlev->addCurve(CT_Flat, "", nullptr, false, false))), @@ -2211,6 +2212,7 @@ LocallabContrast::LocallabContrast(): wavblurConn = wavblur->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::wavblurChanged)); levelblur->setAdjusterListener(this); + sigmabl->setAdjusterListener(this); chromablu->setAdjusterListener(this); @@ -2432,6 +2434,7 @@ LocallabContrast::LocallabContrast(): Gtk::VBox* const blurlevcontBox = Gtk::manage(new Gtk::VBox()); blurlevcontBox->set_spacing(2); blurlevcontBox->pack_start(*levelblur); + blurlevcontBox->pack_start(*sigmabl); blurlevcontBox->pack_start(*chromablu); blurlevcontBox->pack_start(*LocalcurveEditorwavlev, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor Gtk::HSeparator* const separatorblu = Gtk::manage(new Gtk::HSeparator()); @@ -2638,6 +2641,7 @@ void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const Pa wavblur->set_active(pp->locallab.spots.at(index).wavblur); levelblur->setValue(pp->locallab.spots.at(index).levelblur); + sigmabl->setValue(pp->locallab.spots.at(index).sigmabl); chromablu->setValue(pp->locallab.spots.at(index).chromablu); wavshapelev->setCurve(pp->locallab.spots.at(index).loclevwavcurve); residblur->setValue(pp->locallab.spots.at(index).residblur); @@ -2754,6 +2758,7 @@ void LocallabContrast::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pp->locallab.spots.at(index).wavblur = wavblur->get_active(); pp->locallab.spots.at(index).levelblur = levelblur->getValue(); + pp->locallab.spots.at(index).sigmabl = sigmabl->getValue(); pp->locallab.spots.at(index).chromablu = chromablu->getValue(); pp->locallab.spots.at(index).loclevwavcurve = wavshapelev->getCurve(); pp->locallab.spots.at(index).residblur = residblur->getValue(); @@ -2818,6 +2823,7 @@ void LocallabContrast::setDefaults(const rtengine::procparams::ProcParams* defPa edgw->setDefault(defSpot.edgw); basew->setDefault(defSpot.basew); levelblur->setDefault(defSpot.levelblur); + sigmabl->setDefault(defSpot.sigmabl); chromablu->setDefault(defSpot.chromablu); residblur->setDefault(defSpot.residblur); sigma->setDefault(defSpot.sigma); @@ -2994,6 +3000,13 @@ void LocallabContrast::adjusterChanged(Adjuster* a, double newval) } } + if (a == sigmabl) { + if (listener) { + listener->panelChanged(Evlocallabsigmabl, + sigmabl->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == chromablu) { if (listener) { listener->panelChanged(Evlocallabchromablu, @@ -3457,6 +3470,7 @@ void LocallabContrast::updateContrastGUI1() edgw->hide(); basew->hide(); levelblur->hide(); + sigmabl->hide(); chromablu->hide(); LocalcurveEditorwavlev->hide(); residblur->hide(); @@ -3496,6 +3510,7 @@ void LocallabContrast::updateContrastGUI1() edgw->show(); basew->show(); levelblur->show(); + sigmabl->show(); chromablu->show(); LocalcurveEditorwavlev->show(); residblur->show(); @@ -3748,7 +3763,7 @@ LocallabCBDL::LocallabCBDL(): pack_start(*separator, Gtk::PACK_SHRINK, 2); pack_start(*chromacbdl); pack_start(*threshold); - pack_start(*blurcbdl); + // pack_start(*blurcbdl); ToolParamBlock* const residBox = Gtk::manage(new ToolParamBlock()); residBox->pack_start(*clarityml); residBox->pack_start(*contresid); diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index ce35488ec..3e66c3924 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1325,6 +1325,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).residcont = locallab.spots.at(j).residcont && pSpot.residcont == otherSpot.residcont; locallab.spots.at(j).residblur = locallab.spots.at(j).residblur && pSpot.residblur == otherSpot.residblur; locallab.spots.at(j).levelblur = locallab.spots.at(j).levelblur && pSpot.levelblur == otherSpot.levelblur; + locallab.spots.at(j).sigmabl = locallab.spots.at(j).sigmabl && pSpot.sigmabl == otherSpot.sigmabl; locallab.spots.at(j).residchro = locallab.spots.at(j).residchro && pSpot.residchro == otherSpot.residchro; 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; @@ -4223,6 +4224,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).levelblur = mods.locallab.spots.at(i).levelblur; } + if (locallab.spots.at(i).sigmabl) { + toEdit.locallab.spots.at(i).sigmabl = mods.locallab.spots.at(i).sigmabl; + } + if (locallab.spots.at(i).residchro) { toEdit.locallab.spots.at(i).residchro = mods.locallab.spots.at(i).residchro; } @@ -5989,6 +5994,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : residcont(v), residblur(v), levelblur(v), + sigmabl(v), residchro(v), residcomp(v), sigma(v), @@ -6425,6 +6431,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) residcont = v; residblur = v; levelblur = v; + sigmabl = v; residchro = v; residcomp = v; sigma = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 7c5e2a65d..ad1743c45 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -725,6 +725,7 @@ public: bool residcont; bool residblur; bool levelblur; + bool sigmabl; bool residchro; bool residcomp; bool sigma;