Wavelet - Give possibility to use old algo SH residual image

This commit is contained in:
Desmis
2020-03-24 11:29:50 +01:00
parent d63fb77c8c
commit 6d154bcdae
8 changed files with 106 additions and 5 deletions

View File

@@ -494,6 +494,7 @@ void ParamsEdited::set(bool v)
wavelet.ushamethod = v;
wavelet.avoid = v;
wavelet.showmask = v;
wavelet.oldsh = v;
wavelet.tmr = v;
wavelet.Lmethod = v;
wavelet.CLmethod = v;
@@ -1090,6 +1091,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
wavelet.ushamethod = wavelet.ushamethod && p.wavelet.ushamethod == other.wavelet.ushamethod;
wavelet.avoid = wavelet.avoid && p.wavelet.avoid == other.wavelet.avoid;
wavelet.showmask = wavelet.showmask && p.wavelet.showmask == other.wavelet.showmask;
wavelet.oldsh = wavelet.oldsh && p.wavelet.oldsh == other.wavelet.oldsh;
wavelet.tmr = wavelet.tmr && p.wavelet.tmr == other.wavelet.tmr;
wavelet.Lmethod = wavelet.Lmethod && p.wavelet.Lmethod == other.wavelet.Lmethod;
wavelet.CLmethod = wavelet.CLmethod && p.wavelet.CLmethod == other.wavelet.CLmethod;
@@ -2945,6 +2947,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.wavelet.showmask = mods.wavelet.showmask;
}
if (wavelet.oldsh) {
toEdit.wavelet.oldsh = mods.wavelet.oldsh;
}
if (wavelet.tmr) {
toEdit.wavelet.tmr = mods.wavelet.tmr;
}

View File

@@ -508,6 +508,7 @@ struct WaveletParamsEdited {
bool ushamethod;
bool avoid;
bool showmask;
bool oldsh;
bool tmr;
bool c[9];
bool ch[9];

View File

@@ -79,10 +79,11 @@ Wavelet::Wavelet() :
avoid(Gtk::manage(new Gtk::CheckButton(M("TP_WAVELET_AVOID")))),
tmr(Gtk::manage(new Gtk::CheckButton(M("TP_WAVELET_BALCHRO")))),
showmask(Gtk::manage(new Gtk::CheckButton(M("TP_WAVELET_SHOWMASK")))),
oldsh(Gtk::manage(new Gtk::CheckButton(M("TP_WAVELET_OLDSH")))),
neutralchButton(Gtk::manage(new Gtk::Button(M("TP_WAVELET_NEUTRAL")))),
sigma(Gtk::manage(new Adjuster(M("TP_WAVELET_SIGMA"), 0.2, 2.5, 0.01, 1.))),
rescon(Gtk::manage(new Adjuster(M("TP_WAVELET_RESCON"), 0, 100, 1, 0))),
resconH(Gtk::manage(new Adjuster(M("TP_WAVELET_RESCONH"), 0, 100, 1, 0))),
rescon(Gtk::manage(new Adjuster(M("TP_WAVELET_RESCON"), -100, 100, 1, 0))),
resconH(Gtk::manage(new Adjuster(M("TP_WAVELET_RESCONH"), -100, 100, 1, 0))),
reschro(Gtk::manage(new Adjuster(M("TP_WAVELET_RESCHRO"), -100, 100, 1, 0))),
tmrs(Gtk::manage(new Adjuster(M("TP_WAVELET_TMSTRENGTH"), -1.0, 2.0, 0.01, 0.0))),
edgs(Gtk::manage(new Adjuster(M("TP_WAVELET_TMEDGS"), 0.1, 4.0, 0.01, 1.4))),
@@ -175,6 +176,7 @@ Wavelet::Wavelet() :
EvWavscale = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_WAVSCALE");
EvWavradius = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_WAVRADIUS");
EvWavsigma = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_WAVSIGMA");
EvWavoldsh = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_WAVOLDSH");
expsettings->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Wavelet::foldAllButMe), expsettings));
@@ -675,6 +677,9 @@ Wavelet::Wavelet() :
// Residual Image
ToolParamBlock* const resBox = Gtk::manage(new ToolParamBlock());
oldsh->set_active(true);
oldshConn = oldsh->signal_toggled().connect(sigc::mem_fun(*this, &Wavelet::oldshToggled));
resBox->pack_start(*oldsh);
rescon->setAdjusterListener(this);
resBox->pack_start(*rescon, Gtk::PACK_SHRINK);
@@ -1200,6 +1205,9 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited)
showmaskConn.block(true);
showmask->set_active(pp->wavelet.showmask);
showmaskConn.block(false);
oldshConn.block(true);
oldsh->set_active(pp->wavelet.oldsh);
oldshConn.block(false);
tmrConn.block(true);
tmr->set_active(pp->wavelet.tmr);
tmrConn.block(false);
@@ -1230,6 +1238,7 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited)
lastlipst = pp->wavelet.lipst;
lastavoid = pp->wavelet.avoid;
lastshowmask = pp->wavelet.showmask;
lastoldsh = pp->wavelet.oldsh;
lasttmr = pp->wavelet.tmr;
sigma->setValue(pp->wavelet.sigma);
rescon->setValue(pp->wavelet.rescon);
@@ -1380,6 +1389,7 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited)
clshape->setUnChanged(!pedited->wavelet.wavclCurve);
avoid->set_inconsistent(!pedited->wavelet.avoid);
showmask->set_inconsistent(!pedited->wavelet.showmask);
oldsh->set_inconsistent(!pedited->wavelet.oldsh);
tmr->set_inconsistent(!pedited->wavelet.tmr);
edgthresh->setEditedState(pedited->wavelet.edgthresh ? Edited : UnEdited);
rescon->setEditedState(pedited->wavelet.rescon ? Edited : UnEdited);
@@ -1564,6 +1574,7 @@ void Wavelet::write(ProcParams* pp, ParamsEdited* pedited)
pp->wavelet.enabled = getEnabled();
pp->wavelet.avoid = avoid->get_active();
pp->wavelet.showmask = showmask->get_active();
pp->wavelet.oldsh = oldsh->get_active();
pp->wavelet.tmr = tmr->get_active();
pp->wavelet.sigma = sigma->getValue();
pp->wavelet.rescon = rescon->getValue();
@@ -1654,6 +1665,7 @@ void Wavelet::write(ProcParams* pp, ParamsEdited* pedited)
pedited->wavelet.enabled = !get_inconsistent();
pedited->wavelet.avoid = !avoid->get_inconsistent();
pedited->wavelet.showmask = !showmask->get_inconsistent();
pedited->wavelet.oldsh = !oldsh->get_inconsistent();
pedited->wavelet.tmr = !tmr->get_inconsistent();
pedited->wavelet.median = !median->get_inconsistent();
pedited->wavelet.medianlev = !medianlev->get_inconsistent();
@@ -3120,6 +3132,32 @@ void Wavelet::showmaskToggled()
}
}
void Wavelet::oldshToggled()
{
if (multiImage) {
if (oldsh->get_inconsistent()) {
oldsh->set_inconsistent(false);
oldshConn.block(true);
oldsh->set_active(false);
oldshConn.block(false);
} else if (lastoldsh) {
oldsh->set_inconsistent(true);
}
lastoldsh = oldsh->get_active();
}
if (listener && (multiImage || getEnabled())) {
if (oldsh->get_inconsistent()) {
listener->panelChanged(EvWavoldsh, M("GENERAL_UNCHANGED"));
} else if (oldsh->get_active()) {
listener->panelChanged(EvWavoldsh, M("GENERAL_ENABLED"));
} else {
listener->panelChanged(EvWavoldsh, M("GENERAL_DISABLED"));
}
}
}
void Wavelet::tmrToggled()
{

View File

@@ -79,6 +79,7 @@ private:
rtengine::ProcEvent EvWavscale;
rtengine::ProcEvent EvWavradius;
rtengine::ProcEvent EvWavsigma;
rtengine::ProcEvent EvWavoldsh;
void foldAllButMe(GdkEventButton* event, MyExpander *expander);
@@ -98,6 +99,7 @@ private:
void TilesmethodChanged();
void avoidToggled();
void showmaskToggled ();
void oldshToggled ();
void cbenabToggled();
void contrastMinusPressed();
void contrastPlusPressed();
@@ -166,6 +168,7 @@ private:
Gtk::CheckButton* const avoid;
Gtk::CheckButton* const tmr;
Gtk::CheckButton* const showmask;
Gtk::CheckButton* const oldsh;
Gtk::Button* const neutralchButton;
Adjuster* correction[9];
@@ -281,13 +284,13 @@ private:
sigc::connection enableChromaConn, enableContrastConn, enableEdgeConn, enableFinalConn, enableclariConn;
sigc::connection enableNoiseConn, enableResidConn, enableToningConn;
sigc::connection medianConn, avoidConn, tmrConn, medianlevConn, linkedgConn, lipstConn, cbenabConn, neutralconn, showmaskConn;
sigc::connection medianConn, avoidConn, tmrConn, medianlevConn, linkedgConn, lipstConn, cbenabConn, neutralconn, showmaskConn, oldshConn;
sigc::connection neutralPressedConn;
sigc::connection contrastPlusPressedConn;
sigc::connection contrastMinusPressedConn;
sigc::connection neutralchPressedConn;
bool lastmedian, lastmedianlev, lastlinkedg, lastavoid, lastlipst, lasttmr, lastcbenab, lastshowmask;
bool lastmedian, lastmedianlev, lastlinkedg, lastavoid, lastlipst, lasttmr, lastcbenab, lastshowmask, lastoldsh;
int nextnlevel;
IdleRegister idle_register;