dehaze: added lumimance mode from ART, #5456, thanks to @agriggio
This commit is contained in:
@@ -36,6 +36,7 @@ Dehaze::Dehaze(): FoldableToolPanel(this, "dehaze", M("TP_DEHAZE_LABEL"), false,
|
||||
EvDehazeStrength = m->newEvent(HDR, "HISTORY_MSG_DEHAZE_STRENGTH");
|
||||
EvDehazeShowDepthMap = m->newEvent(HDR, "HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP");
|
||||
EvDehazeDepth = m->newEvent(HDR, "HISTORY_MSG_DEHAZE_DEPTH");
|
||||
EvDehazeLuminance = m->newEvent(HDR, "HISTORY_MSG_DEHAZE_LUMINANCE");
|
||||
|
||||
strength = Gtk::manage(new Adjuster(M("TP_DEHAZE_STRENGTH"), 0., 100., 1., 50.));
|
||||
strength->setAdjusterListener(this);
|
||||
@@ -45,12 +46,17 @@ Dehaze::Dehaze(): FoldableToolPanel(this, "dehaze", M("TP_DEHAZE_LABEL"), false,
|
||||
depth->setAdjusterListener(this);
|
||||
depth->show();
|
||||
|
||||
luminance = Gtk::manage(new Gtk::CheckButton(M("TP_DEHAZE_LUMINANCE")));
|
||||
luminance->signal_toggled().connect(sigc::mem_fun(*this, &Dehaze::luminanceChanged));
|
||||
luminance->show();
|
||||
|
||||
showDepthMap = Gtk::manage(new Gtk::CheckButton(M("TP_DEHAZE_SHOW_DEPTH_MAP")));
|
||||
showDepthMap->signal_toggled().connect(sigc::mem_fun(*this, &Dehaze::showDepthMapChanged));
|
||||
showDepthMap->show();
|
||||
|
||||
pack_start(*strength);
|
||||
pack_start(*depth);
|
||||
pack_start(*luminance);
|
||||
pack_start(*showDepthMap);
|
||||
}
|
||||
|
||||
@@ -64,12 +70,14 @@ void Dehaze::read(const ProcParams *pp, const ParamsEdited *pedited)
|
||||
depth->setEditedState(pedited->dehaze.depth ? Edited : UnEdited);
|
||||
set_inconsistent(multiImage && !pedited->dehaze.enabled);
|
||||
showDepthMap->set_inconsistent(!pedited->dehaze.showDepthMap);
|
||||
luminance->set_inconsistent(!pedited->dehaze.luminance);
|
||||
}
|
||||
|
||||
setEnabled(pp->dehaze.enabled);
|
||||
strength->setValue(pp->dehaze.strength);
|
||||
depth->setValue(pp->dehaze.depth);
|
||||
showDepthMap->set_active(pp->dehaze.showDepthMap);
|
||||
luminance->set_active(pp->dehaze.luminance);
|
||||
|
||||
enableListener();
|
||||
}
|
||||
@@ -81,12 +89,14 @@ void Dehaze::write(ProcParams *pp, ParamsEdited *pedited)
|
||||
pp->dehaze.depth = depth->getValue();
|
||||
pp->dehaze.enabled = getEnabled();
|
||||
pp->dehaze.showDepthMap = showDepthMap->get_active();
|
||||
pp->dehaze.luminance = luminance->get_active();
|
||||
|
||||
if (pedited) {
|
||||
pedited->dehaze.strength = strength->getEditedState();
|
||||
pedited->dehaze.depth = depth->getEditedState();
|
||||
pedited->dehaze.enabled = !get_inconsistent();
|
||||
pedited->dehaze.showDepthMap = !showDepthMap->get_inconsistent();
|
||||
pedited->dehaze.luminance = !luminance->get_inconsistent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,6 +148,12 @@ void Dehaze::showDepthMapChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void Dehaze::luminanceChanged()
|
||||
{
|
||||
if (listener) {
|
||||
listener->panelChanged(EvDehazeLuminance, luminance->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
|
||||
void Dehaze::setBatchMode(bool batchMode)
|
||||
{
|
||||
|
Reference in New Issue
Block a user