Added GUI sigmaed to edge sharpness wavelet

This commit is contained in:
Desmis 2020-04-21 13:23:49 +02:00
parent 4af3ffadc2
commit 07e6d07d46
9 changed files with 33 additions and 1 deletions

View File

@ -1152,6 +1152,7 @@ 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_915;Local - Edge Wavelet Sigma ED
HISTORY_MSG_CAT02PRESET;Cat02 automatic preset
HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors
HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction

View File

@ -937,6 +937,7 @@ enum ProcEventCode {
Evlocallabstrbl = 911,
Evlocallabsigmadr = 912,
Evlocallabsigmabl = 913,
Evlocallabsigmaed = 914,
NUMOFEVENTS
};

View File

@ -2840,6 +2840,7 @@ LocallabParams::LocallabSpot::LocallabSpot() :
strwav(0.0),
angwav(0.0),
strengthw(0.0),
sigmaed(1.0),
radiusw(15.0),
detailw(10.0),
gradw(90.0),
@ -3284,6 +3285,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
&& strwav == other.strwav
&& angwav == other.angwav
&& strengthw == other.strengthw
&& sigmaed == other.sigmaed
&& radiusw == other.radiusw
&& detailw == other.detailw
&& gradw == other.gradw
@ -4724,6 +4726,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).strwav, "Locallab", "Strwav_" + std::to_string(i), spot.strwav, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).angwav, "Locallab", "Angwav_" + std::to_string(i), spot.angwav, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).strengthw, "Locallab", "Strengthw_" + std::to_string(i), spot.strengthw, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sigmaed, "Locallab", "Sigmaed_" + std::to_string(i), spot.sigmaed, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).radiusw, "Locallab", "Radiusw_" + std::to_string(i), spot.radiusw, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).detailw, "Locallab", "Detailw_" + std::to_string(i), spot.detailw, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).gradw, "Locallab", "Gradw_" + std::to_string(i), spot.gradw, keyFile);
@ -6369,6 +6372,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Locallab", "Strwav_" + std::to_string(i), pedited, spot.strwav, spotEdited.strwav);
assignFromKeyfile(keyFile, "Locallab", "Angwav_" + std::to_string(i), pedited, spot.angwav, spotEdited.angwav);
assignFromKeyfile(keyFile, "Locallab", "Strengthw_" + std::to_string(i), pedited, spot.strengthw, spotEdited.strengthw);
assignFromKeyfile(keyFile, "Locallab", "Sigmaed_" + std::to_string(i), pedited, spot.sigmaed, spotEdited.sigmaed);
assignFromKeyfile(keyFile, "Locallab", "Radiusw_" + std::to_string(i), pedited, spot.radiusw, spotEdited.radiusw);
assignFromKeyfile(keyFile, "Locallab", "Detailw_" + std::to_string(i), pedited, spot.detailw, spotEdited.detailw);
assignFromKeyfile(keyFile, "Locallab", "Gradw_" + std::to_string(i), pedited, spot.gradw, spotEdited.gradw);

View File

@ -1316,6 +1316,7 @@ struct LocallabParams {
double strwav;
double angwav;
double strengthw;
double sigmaed;
double radiusw;
double detailw;
double gradw;

View File

@ -940,7 +940,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
LUMINANCECURVE, // EvlocallabchroMethod
LUMINANCECURVE, // Evlocallabstrbl
LUMINANCECURVE, // Evlocallabsigmadr
LUMINANCECURVE // Evlocallabsigmabl
LUMINANCECURVE, // Evlocallabsigmabl
LUMINANCECURVE // Evlocallabsigmaed
};

View File

@ -902,6 +902,7 @@ private:
Gtk::CheckButton* const wavedg;
ToolParamBlock* const edgsBox;
Adjuster* const strengthw;
Adjuster* const sigmaed;
CurveEditorGroup* const LocalcurveEditorwavedg;
FlatCurveEditor* const wavshapeedg;
Adjuster* const gradw;

View File

@ -2023,6 +2023,7 @@ LocallabContrast::LocallabContrast():
wavedg(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_EDGFRA")))),
edgsBox(Gtk::manage(new ToolParamBlock())),
strengthw(Gtk::manage(new Adjuster(M("TP_WAVELET_EDVAL"), 0., 100.0, 0.5, 0.))),
sigmaed(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGMAWAV"), 0.2, 2.5, 0.01, 1.))),
LocalcurveEditorwavedg(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVEDG"))),
wavshapeedg(static_cast<FlatCurveEditor*>(LocalcurveEditorwavedg->addCurve(CT_Flat, "", nullptr, false, false))),
gradw(Gtk::manage(new Adjuster(M("TP_WAVELET_EDGEDETECT"), 0., 100.0, 0.5, 90.))),
@ -2171,6 +2172,7 @@ LocallabContrast::LocallabContrast():
wavedgConn = wavedg->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::wavedgChanged));
strengthw->setAdjusterListener(this);
sigmaed->setAdjusterListener(this);
LocalcurveEditorwavedg->setCurveListener(this);
@ -2405,6 +2407,7 @@ LocallabContrast::LocallabContrast():
blurcontBox->pack_start(*gradwavFrame);
edgFrame->set_label_widget(*wavedg);
edgsBox->pack_start(*strengthw);
edgsBox->pack_start(*sigmaed);
edgsBox->pack_start(*LocalcurveEditorwavedg, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor
edgsBox->pack_start(*gradw);
edgsBox->pack_start(*waveshow);
@ -2612,6 +2615,7 @@ void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const Pa
angwav->setValue(pp->locallab.spots.at(index).angwav);
wavedg->set_active(pp->locallab.spots.at(index).wavedg);
strengthw->setValue(pp->locallab.spots.at(index).strengthw);
sigmaed->setValue(pp->locallab.spots.at(index).sigmaed);
wavshapeedg->setCurve(pp->locallab.spots.at(index).locedgwavcurve);
gradw->setValue(pp->locallab.spots.at(index).gradw);
waveshow->set_active(pp->locallab.spots.at(index).waveshow);
@ -2729,6 +2733,7 @@ void LocallabContrast::write(rtengine::procparams::ProcParams* pp, ParamsEdited*
pp->locallab.spots.at(index).angwav = angwav->getValue();
pp->locallab.spots.at(index).wavedg = wavedg->get_active();
pp->locallab.spots.at(index).strengthw = strengthw->getValue();
pp->locallab.spots.at(index).sigmaed = sigmaed->getValue();
pp->locallab.spots.at(index).locedgwavcurve = wavshapeedg->getCurve();
pp->locallab.spots.at(index).gradw = gradw->getValue();
pp->locallab.spots.at(index).waveshow = waveshow->get_active();
@ -2815,6 +2820,7 @@ void LocallabContrast::setDefaults(const rtengine::procparams::ProcParams* defPa
strwav->setDefault(defSpot.strwav);
angwav->setDefault(defSpot.angwav);
strengthw->setDefault(defSpot.strengthw);
sigmaed->setDefault(defSpot.sigmaed);
gradw->setDefault(defSpot.gradw);
radiusw->setDefault(defSpot.radiusw);
detailw->setDefault(defSpot.detailw);
@ -2944,6 +2950,13 @@ void LocallabContrast::adjusterChanged(Adjuster* a, double newval)
}
}
if (a == sigmaed) {
if (listener) {
listener->panelChanged(Evlocallabsigmaed,
sigmaed->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == gradw) {
if (listener) {
listener->panelChanged(Evlocallabgradw,
@ -3461,6 +3474,7 @@ void LocallabContrast::updateContrastGUI1()
strwav->hide();
angwav->hide();
strengthw->hide();
sigmaed->hide();
LocalcurveEditorwavedg->hide();
gradw->hide();
radiusw->hide();
@ -3501,6 +3515,7 @@ void LocallabContrast::updateContrastGUI1()
strwav->show();
angwav->show();
strengthw->show();
sigmaed->show();
LocalcurveEditorwavedg->show();
gradw->show();
radiusw->show();

View File

@ -1343,6 +1343,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
locallab.spots.at(j).strwav = locallab.spots.at(j).strwav && pSpot.strwav == otherSpot.strwav;
locallab.spots.at(j).angwav = locallab.spots.at(j).angwav && pSpot.angwav == otherSpot.angwav;
locallab.spots.at(j).strengthw = locallab.spots.at(j).strengthw && pSpot.strengthw == otherSpot.strengthw;
locallab.spots.at(j).sigmaed = locallab.spots.at(j).sigmaed && pSpot.sigmaed == otherSpot.sigmaed;
locallab.spots.at(j).radiusw = locallab.spots.at(j).radiusw && pSpot.radiusw == otherSpot.radiusw;
locallab.spots.at(j).detailw = locallab.spots.at(j).detailw && pSpot.detailw == otherSpot.detailw;
locallab.spots.at(j).gradw = locallab.spots.at(j).gradw && pSpot.gradw == otherSpot.gradw;
@ -4296,6 +4297,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).strengthw = mods.locallab.spots.at(i).strengthw;
}
if (locallab.spots.at(i).sigmaed) {
toEdit.locallab.spots.at(i).sigmaed = mods.locallab.spots.at(i).sigmaed;
}
if (locallab.spots.at(i).radiusw) {
toEdit.locallab.spots.at(i).radiusw = mods.locallab.spots.at(i).radiusw;
}
@ -6012,6 +6017,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
strwav(v),
angwav(v),
strengthw(v),
sigmaed(v),
radiusw(v),
detailw(v),
gradw(v),
@ -6449,6 +6455,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
strwav = v;
angwav = v;
strengthw = v;
sigmaed = v;
radiusw = v;
detailw = v;
gradw = v;

View File

@ -743,6 +743,7 @@ public:
bool strwav;
bool angwav;
bool strengthw;
bool sigmaed;
bool radiusw;
bool detailw;
bool gradw;