Merge branch 'master' into 'gtk3'

Most conflicts seemed to be simple enough. There were a lot of `append_text` to
`append` conversions for `Gtk::ComboBoxText`. The `PopUpCommon` class also saw
a lot of changes with non-trivial conflict resolutions.
This commit is contained in:
Adam Reichold
2016-01-06 23:56:12 +01:00
167 changed files with 13108 additions and 2410 deletions

View File

@@ -3,6 +3,7 @@
*/
#include "retinex.h"
#include "mycurve.h"
#include "rtimage.h"
using namespace rtengine;
using namespace rtengine::procparams;
@@ -83,6 +84,17 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
curveEditorGDH->curveListComplete();
curveEditormap = new CurveEditorGroup (options.lastRetinexDir, M("TP_RETINEX_CONTEDIT_MAP"));
curveEditormap->setCurveListener (this);
mapshape = static_cast<DiagonalCurveEditor*>(curveEditormap->addCurve(CT_Diagonal, M("TP_RETINEX_CURVEEDITOR_MAP")));
mapshape->setTooltip(M("TP_RETINEX_CURVEEDITOR_MAP_TOOLTIP"));
std::vector<GradientMilestone> milestones222;
milestones222.push_back( GradientMilestone(0., 0., 0., 0.) );
milestones222.push_back( GradientMilestone(1., 1., 1., 1.) );
mapshape->setBottomBarBgGradient(milestones222);
mapshape->setLeftBarBgGradient(milestones222);
curveEditormap->curveListComplete();
// Transmission map curve
transmissionCurveEditorG = new CurveEditorGroup (options.lastRetinexDir, M("TP_RETINEX_TRANSMISSION"));
@@ -144,7 +156,10 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
transLabels->set_tooltip_markup (M("TP_RETINEX_TLABEL_TOOLTIP"));
transLabels2 = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER));
scal = Gtk::manage (new Adjuster (M("TP_RETINEX_SCALES"), 1, 8., 1., 3.));
scal = Gtk::manage (new Adjuster (M("TP_RETINEX_SCALES"), -1, 6., 1., 3.));
iter = Gtk::manage (new Adjuster (M("TP_RETINEX_ITER"), 1, 5., 1., 1.));
grad = Gtk::manage (new Adjuster (M("TP_RETINEX_GRAD"), -2., 2., 1., 1.));
grads = Gtk::manage (new Adjuster (M("TP_RETINEX_GRADS"), -2., 2., 1., 1.));
gain = Gtk::manage (new Adjuster (M("TP_RETINEX_GAIN"), 20, 200, 1, 50));
offs = Gtk::manage (new Adjuster (M("TP_RETINEX_OFFSET"), -10000, 10000, 1, 0));
// vart = Gtk::manage (new Adjuster (M("TP_RETINEX_VARIANCE"), 50, 500, 1, 125));
@@ -153,10 +168,48 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
// grbl = Gtk::manage (new Adjuster (M("TP_RETINEX_HIGHLIGHT3"), 1, 100, 1, 50));
gain->set_tooltip_markup (M("TP_RETINEX_GAIN_TOOLTIP"));
scal->set_tooltip_markup (M("TP_RETINEX_SCALES_TOOLTIP"));
iter->set_tooltip_markup (M("TP_RETINEX_ITER_TOOLTIP"));
grad->set_tooltip_markup (M("TP_RETINEX_GRAD_TOOLTIP"));
grads->set_tooltip_markup (M("TP_RETINEX_GRADS_TOOLTIP"));
// vart->set_tooltip_markup (M("TP_RETINEX_VARIANCE_TOOLTIP"));
limd->set_tooltip_markup (M("TP_RETINEX_THRESHOLD_TOOLTIP"));
baselog->set_tooltip_markup (M("TP_RETINEX_BASELOG_TOOLTIP"));
mapbox = Gtk::manage (new Gtk::HBox ());
labmap = Gtk::manage (new Gtk::Label (M("TP_RETINEX_MAP") + ":"));
mapbox->pack_start (*labmap, Gtk::PACK_SHRINK, 1);
mapMethod = Gtk::manage (new MyComboBoxText ());
mapMethod->append (M("TP_RETINEX_MAP_NONE"));
mapMethod->append (M("TP_RETINEX_MAP_CURV"));
mapMethod->append (M("TP_RETINEX_MAP_GAUS"));
mapMethod->append (M("TP_RETINEX_MAP_MAPP"));
mapMethod->append (M("TP_RETINEX_MAP_MAPT"));
mapMethod->set_active(0);
mapMethodConn = mapMethod->signal_changed().connect ( sigc::mem_fun(*this, &Retinex::mapMethodChanged) );
mapMethod->set_tooltip_markup (M("TP_RETINEX_MAP_METHOD_TOOLTIP"));
highlights = Gtk::manage (new Adjuster (M("TP_SHADOWSHLIGHTS_HIGHLIGHTS"), 0, 100, 1, 0));
h_tonalwidth = Gtk::manage (new Adjuster (M("TP_SHADOWSHLIGHTS_HLTONALW"), 10, 100, 1, 80));
shadows = Gtk::manage (new Adjuster (M("TP_SHADOWSHLIGHTS_SHADOWS"), 0, 100, 1, 0));
s_tonalwidth = Gtk::manage (new Adjuster (M("TP_SHADOWSHLIGHTS_SHTONALW"), 10, 100, 1, 80));
radius = Gtk::manage (new Adjuster (M("TP_SHADOWSHLIGHTS_RADIUS"), 5, 100, 1, 40));
viewbox = Gtk::manage (new Gtk::HBox ());
labview = Gtk::manage (new Gtk::Label (M("TP_RETINEX_VIEW") + ":"));
viewbox->pack_start (*labview, Gtk::PACK_SHRINK, 1);
viewMethod = Gtk::manage (new MyComboBoxText ());
viewMethod->append (M("TP_RETINEX_VIEW_NONE"));
viewMethod->append (M("TP_RETINEX_VIEW_MASK"));
viewMethod->append (M("TP_RETINEX_VIEW_UNSHARP"));
viewMethod->append (M("TP_RETINEX_VIEW_TRAN"));
viewMethod->append (M("TP_RETINEX_VIEW_TRAN2"));
viewMethod->set_active(0);
viewMethodConn = viewMethod->signal_changed().connect ( sigc::mem_fun(*this, &Retinex::viewMethodChanged) );
viewMethod->set_tooltip_markup (M("TP_RETINEX_VIEW_METHOD_TOOLTIP"));
curveEditorGH = new CurveEditorGroup (options.lastRetinexDir, M("TP_RETINEX_CONTEDIT_LH"));
curveEditorGH->setCurveListener (this);
@@ -211,8 +264,17 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
slope->show ();
// settingsVBox->pack_start (*scal);
// scal->show ();
settingsVBox->pack_start (*iter);
iter->show ();
settingsVBox->pack_start (*scal);
scal->show ();
settingsVBox->pack_start (*grad);
grad->show ();
settingsVBox->pack_start (*grads);
grads->show ();
settingsVBox->pack_start (*gain);
gain->show ();
@@ -226,6 +288,30 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
settingsVBox->pack_start (*limd);
limd->show ();
settingsVBox->pack_start (*Gtk::manage (new Gtk::HSeparator()));
mapbox->pack_start(*mapMethod);
settingsVBox->pack_start(*mapbox);
settingsVBox->pack_start (*curveEditormap, Gtk::PACK_SHRINK, 4);
curveEditormap->show();
settingsVBox->pack_start (*highlights);
highlights->show();
settingsVBox->pack_start (*h_tonalwidth);
h_tonalwidth->show();
settingsVBox->pack_start (*shadows);
shadows->show();
settingsVBox->pack_start (*s_tonalwidth);
s_tonalwidth->show();
settingsVBox->pack_start (*radius);
radius->show();
viewbox->pack_start(*viewMethod);
settingsVBox->pack_start(*viewbox);
//settingsVBox->pack_start (*viewMethod);
// settingsVBox->pack_start (*highl);
// highl->show ();
@@ -234,6 +320,7 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
// settingsVBox->pack_start (*grbl);
// grbl->show ();
settingsVBox->pack_start (*Gtk::manage (new Gtk::HSeparator()));
settingsVBox->pack_start( *transmissionCurveEditorG, Gtk::PACK_SHRINK, 2);
transmissionCurveEditorG->show();
@@ -267,6 +354,24 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
scal->delay = 200;
}
iter->setAdjusterListener (this);
if (iter->delay < 200) {
iter->delay = 200;
}
grad->setAdjusterListener (this);
if (grad->delay < 200) {
grad->delay = 200;
}
grads->setAdjusterListener (this);
if (grads->delay < 200) {
grads->delay = 200;
}
gam->setAdjusterListener (this);
if (gam->delay < 500) {
@@ -321,6 +426,32 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
baselog->delay = 200;
}
radius->setAdjusterListener (this);
if (radius->delay < 200) {
radius->delay = 200;
}
highlights->setAdjusterListener (this);
if (highlights->delay < 200) {
highlights->delay = 200;
}
h_tonalwidth->setAdjusterListener (this);
if (h_tonalwidth->delay < 200) {
h_tonalwidth->delay = 200;
}
shadows->setAdjusterListener (this);
if (shadows->delay < 200) {
shadows->delay = 200;
}
s_tonalwidth->setAdjusterListener (this);
if (s_tonalwidth->delay < 200) {
s_tonalwidth->delay = 200;
}
/* grbl->setAdjusterListener (this);
if (grbl->delay < 200) {
@@ -345,6 +476,7 @@ Retinex::~Retinex()
delete curveEditorGDH;
delete transmissionCurveEditorG;
delete curveEditorGH;
delete curveEditormap;
}
void Retinex::neutral_pressed ()
@@ -354,16 +486,30 @@ void Retinex::neutral_pressed ()
offs->resetValue(false);
str->resetValue(false);
scal->resetValue(false);
iter->resetValue(false);
grad->resetValue(false);
grads->resetValue(false);
vart->resetValue(false);
limd->resetValue(false);
highl->resetValue(false);
baselog->resetValue(false);
gam->resetValue(false);
slope->resetValue(false);
highlights->resetValue(false);
h_tonalwidth->resetValue(false);
shadows->resetValue(false);
s_tonalwidth->resetValue(false);
radius->resetValue(false);
mapMethod->set_active(0);
viewMethod->set_active(0);
retinexMethod->set_active(2);
retinexcolorspace->set_active(0);
gammaretinex->set_active(0);
transmissionShape->reset();
cdshape->reset();
cdshapeH->reset();
lhshape->reset();
mapshape->reset();
}
void Retinex::foldAllButMe (GdkEventButton* event, MyExpander *expander)
@@ -473,10 +619,15 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited)
retinexMethodConn.block(true);
retinexColorSpaceConn.block(true);
gammaretinexConn.block(true);
mapMethodConn.block(true);
viewMethodConn.block(true);
if (pedited) {
scal->setEditedState (pedited->retinex.scal ? Edited : UnEdited);
iter->setEditedState (pedited->retinex.iter ? Edited : UnEdited);
grad->setEditedState (pedited->retinex.grad ? Edited : UnEdited);
grads->setEditedState (pedited->retinex.grads ? Edited : UnEdited);
neigh->setEditedState (pedited->retinex.neigh ? Edited : UnEdited);
gam->setEditedState (pedited->retinex.gam ? Edited : UnEdited);
slope->setEditedState (pedited->retinex.slope ? Edited : UnEdited);
@@ -489,12 +640,25 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited)
// grbl->setEditedState (pedited->retinex.grbl ? Edited : UnEdited);
set_inconsistent (multiImage && !pedited->retinex.enabled);
medianmap->set_inconsistent (!pedited->retinex.medianmap);
radius->setEditedState (pedited->retinex.radius ? Edited : UnEdited);
highlights->setEditedState (pedited->retinex.highlights ? Edited : UnEdited);
h_tonalwidth->setEditedState (pedited->retinex.htonalwidth ? Edited : UnEdited);
shadows->setEditedState (pedited->retinex.shadows ? Edited : UnEdited);
s_tonalwidth->setEditedState (pedited->retinex.stonalwidth ? Edited : UnEdited);
if (!pedited->retinex.retinexMethod) {
retinexMethod->set_active_text(M("GENERAL_UNCHANGED"));
}
if (!pedited->retinex.mapMethod) {
mapMethod->set_active_text(M("GENERAL_UNCHANGED"));
}
if (!pedited->retinex.viewMethod) {
viewMethod->set_active_text(M("GENERAL_UNCHANGED"));
}
if (!pedited->retinex.retinexcolorspace) {
retinexcolorspace->set_active_text(M("GENERAL_UNCHANGED"));
}
@@ -507,6 +671,7 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited)
cdshapeH->setUnChanged (!pedited->retinex.cdHcurve);
transmissionShape->setUnChanged (!pedited->retinex.transmissionCurve);
lhshape->setUnChanged (!pedited->retinex.lhcurve);
mapshape->setUnChanged (!pedited->retinex.mapcurve);
}
@@ -515,17 +680,36 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited)
offs->setValue (pp->retinex.offs);
str->setValue (pp->retinex.str);
scal->setValue (pp->retinex.scal);
iter->setValue (pp->retinex.iter);
grad->setValue (pp->retinex.grad);
grads->setValue (pp->retinex.grads);
vart->setValue (pp->retinex.vart);
limd->setValue (pp->retinex.limd);
gam->setValue (pp->retinex.gam);
slope->setValue (pp->retinex.slope);
highl->setValue (pp->retinex.highl);
baselog->setValue (pp->retinex.baselog);
radius->setValue (pp->retinex.radius);
highlights->setValue (pp->retinex.highlights);
h_tonalwidth->setValue (pp->retinex.htonalwidth);
shadows->setValue (pp->retinex.shadows);
s_tonalwidth->setValue (pp->retinex.stonalwidth);
// grbl->setValue (pp->retinex.grbl);
if(pp->retinex.iter == 1) {
grad->set_sensitive(false);
scal->set_sensitive(false);
grads->set_sensitive(false);
}
else {
grad->set_sensitive(true);
scal->set_sensitive(true);
grads->set_sensitive(true);
}
setEnabled (pp->retinex.enabled);
medianmapConn.block (true);
medianmap->set_active (pp->retinex.medianmap);
medianmapConn.block (false);
lastmedianmap = pp->retinex.medianmap;
@@ -542,6 +726,30 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited)
// retinexMethod->set_active (4);
}
if (pp->retinex.mapMethod == "none") {
mapMethod->set_active (0);
} else if (pp->retinex.mapMethod == "curv") {
mapMethod->set_active (1);
} else if (pp->retinex.mapMethod == "gaus") {
mapMethod->set_active (2);
} else if (pp->retinex.mapMethod == "map") {
mapMethod->set_active (3);
} else if (pp->retinex.mapMethod == "mapT") {
mapMethod->set_active (4);
}
if (pp->retinex.viewMethod == "none") {
viewMethod->set_active (0);
} else if (pp->retinex.viewMethod == "mask") {
viewMethod->set_active (1);
} else if (pp->retinex.viewMethod == "unsharp") {
viewMethod->set_active (2);
} else if (pp->retinex.viewMethod == "tran") {
viewMethod->set_active (3);
} else if (pp->retinex.viewMethod == "tran2") {
viewMethod->set_active (4);
}
if (pp->retinex.retinexcolorspace == "Lab") {
retinexcolorspace->set_active (0);
} else if (pp->retinex.retinexcolorspace == "HSLLOG") {
@@ -565,6 +773,8 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited)
retinexMethodChanged ();
retinexColorSpaceChanged();
gammaretinexChanged();
mapMethodChanged ();
viewMethodChanged ();
medianmapConn.block(true);
medianmapChanged ();
@@ -573,10 +783,13 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited)
cdshape->setCurve (pp->retinex.cdcurve);
cdshapeH->setCurve (pp->retinex.cdHcurve);
lhshape->setCurve (pp->retinex.lhcurve);
mapshape->setCurve (pp->retinex.mapcurve);
retinexMethodConn.block(false);
retinexColorSpaceConn.block(false);
gammaretinexConn.block(false);
mapMethodConn.block(false);
viewMethodConn.block(false);
transmissionShape->setCurve (pp->retinex.transmissionCurve);
@@ -590,6 +803,9 @@ void Retinex::write (ProcParams* pp, ParamsEdited* pedited)
pp->retinex.str = str->getValue ();
pp->retinex.scal = (int)scal->getValue ();
pp->retinex.iter = (int) iter->getValue ();
pp->retinex.grad = (int) grad->getValue ();
pp->retinex.grads = (int) grads->getValue ();
pp->retinex.gam = gam->getValue ();
pp->retinex.slope = slope->getValue ();
pp->retinex.neigh = neigh->getValue ();
@@ -603,18 +819,30 @@ void Retinex::write (ProcParams* pp, ParamsEdited* pedited)
pp->retinex.cdcurve = cdshape->getCurve ();
pp->retinex.lhcurve = lhshape->getCurve ();
pp->retinex.cdHcurve = cdshapeH->getCurve ();
pp->retinex.mapcurve = mapshape->getCurve ();
pp->retinex.transmissionCurve = transmissionShape->getCurve ();
pp->retinex.enabled = getEnabled();
pp->retinex.medianmap = medianmap->get_active();
pp->retinex.radius = (int)radius->getValue ();
pp->retinex.highlights = (int)highlights->getValue ();
pp->retinex.htonalwidth = (int)h_tonalwidth->getValue ();
pp->retinex.shadows = (int)shadows->getValue ();
pp->retinex.stonalwidth = (int)s_tonalwidth->getValue ();
if (pedited) {
pedited->retinex.retinexMethod = retinexMethod->get_active_text() != M("GENERAL_UNCHANGED");
pedited->retinex.retinexcolorspace = retinexcolorspace->get_active_text() != M("GENERAL_UNCHANGED");
pedited->retinex.gammaretinex = gammaretinex->get_active_text() != M("GENERAL_UNCHANGED");
pedited->retinex.mapMethod = mapMethod->get_active_text() != M("GENERAL_UNCHANGED");
pedited->retinex.viewMethod = viewMethod->get_active_text() != M("GENERAL_UNCHANGED");
//%%%%%%%%%%%%%%%%%%%%%%
pedited->retinex.str = str->getEditedState ();
pedited->retinex.scal = scal->getEditedState ();
pedited->retinex.iter = iter->getEditedState ();
pedited->retinex.grad = grad->getEditedState ();
pedited->retinex.grads = grads->getEditedState ();
pedited->retinex.gam = gam->getEditedState ();
pedited->retinex.slope = slope->getEditedState ();
pedited->retinex.neigh = neigh->getEditedState ();
@@ -628,10 +856,17 @@ void Retinex::write (ProcParams* pp, ParamsEdited* pedited)
pedited->retinex.cdcurve = !cdshape->isUnChanged ();
pedited->retinex.cdHcurve = !cdshapeH->isUnChanged ();
pedited->retinex.transmissionCurve = !transmissionShape->isUnChanged ();
pedited->retinex.mapcurve = !mapshape->isUnChanged ();
pedited->retinex.enabled = !get_inconsistent();
pedited->retinex.medianmap = !medianmap->get_inconsistent();
pedited->retinex.lhcurve = !lhshape->isUnChanged ();
pedited->retinex.radius = radius->getEditedState ();
pedited->retinex.highlights = highlights->getEditedState ();
pedited->retinex.htonalwidth = h_tonalwidth->getEditedState ();
pedited->retinex.shadows = shadows->getEditedState ();
pedited->retinex.stonalwidth = s_tonalwidth->getEditedState ();
}
if (retinexMethod->get_active_row_number() == 0) {
@@ -646,6 +881,30 @@ void Retinex::write (ProcParams* pp, ParamsEdited* pedited)
// pp->retinex.retinexMethod = "highliplus";
}
if (mapMethod->get_active_row_number() == 0) {
pp->retinex.mapMethod = "none";
} else if (mapMethod->get_active_row_number() == 1) {
pp->retinex.mapMethod = "curv";
} else if (mapMethod->get_active_row_number() == 2) {
pp->retinex.mapMethod = "gaus";
} else if (mapMethod->get_active_row_number() == 3) {
pp->retinex.mapMethod = "map";
} else if (mapMethod->get_active_row_number() == 4) {
pp->retinex.mapMethod = "mapT";
}
if (viewMethod->get_active_row_number() == 0) {
pp->retinex.viewMethod = "none";
} else if (viewMethod->get_active_row_number() == 1) {
pp->retinex.viewMethod = "mask";
} else if (viewMethod->get_active_row_number() == 2) {
pp->retinex.viewMethod = "unsharp";
} else if (viewMethod->get_active_row_number() == 3) {
pp->retinex.viewMethod = "tran";
} else if (viewMethod->get_active_row_number() == 4) {
pp->retinex.viewMethod = "tran2";
}
if (retinexcolorspace->get_active_row_number() == 0) {
pp->retinex.retinexcolorspace = "Lab";
} else if (retinexcolorspace->get_active_row_number() == 1) {
@@ -682,6 +941,83 @@ void Retinex::retinexMethodChanged()
}
}
void Retinex::mapMethodChanged()
{
if(mapMethod->get_active_row_number() == 1 || mapMethod->get_active_row_number() == 2) {
curveEditormap->show();
highlights->show();
h_tonalwidth->show();
shadows->show();
s_tonalwidth->show();
radius->show();
} else if(mapMethod->get_active_row_number() == 3 || mapMethod->get_active_row_number() == 4) {
curveEditormap->show();
highlights->show();
h_tonalwidth->show();
shadows->show();
s_tonalwidth->show();
radius->hide();
} else {
curveEditormap->hide();
highlights->hide();
h_tonalwidth->hide();
shadows->hide();
s_tonalwidth->hide();
radius->hide();
}
if (listener) {
listener->panelChanged (EvmapMethod, mapMethod->get_active_text ());
}
}
void Retinex::viewMethodChanged()
{
if(viewMethod->get_active_row_number() == 1 || viewMethod->get_active_row_number() == 2) {
vart->hide();
gain->hide();
offs->hide();
limd->hide();
transmissionCurveEditorG->hide();
medianmap->hide();
iter->hide();
scal->hide();
grad->hide();
grads->hide();
curveEditorGH->hide();
}
else if(viewMethod->get_active_row_number() == 3 || viewMethod->get_active_row_number() == 4) {
gain->hide();
offs->hide();
vart->hide();
curveEditorGH->hide();
}
else {
vart->show();
neigh->show();
gain->show();
offs->show();
limd->show();
transmissionCurveEditorG->show();
medianmap->show();
iter->show();
scal->show();
grad->show();
grads->show();
curveEditorGH->show();
}
if (listener) {
listener->panelChanged (EvviewMethod, viewMethod->get_active_text ());
}
}
void Retinex::ColorSpaceUpdateUI ()
{
if (!batchMode) {
@@ -770,6 +1106,9 @@ void Retinex::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi
offs->setDefault (defParams->retinex.offs);
str->setDefault (defParams->retinex.str);
scal->setDefault (defParams->retinex.scal);
iter->setDefault (defParams->retinex.iter);
grad->setDefault (defParams->retinex.grad);
grads->setDefault (defParams->retinex.grads);
vart->setDefault (defParams->retinex.vart);
limd->setDefault (defParams->retinex.limd);
highl->setDefault (defParams->retinex.highl);
@@ -778,12 +1117,21 @@ void Retinex::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi
gam->setDefault (defParams->retinex.gam);
slope->setDefault (defParams->retinex.slope);
radius->setDefault (defParams->retinex.radius);
highlights->setDefault (defParams->retinex.highlights);
h_tonalwidth->setDefault (defParams->retinex.htonalwidth);
shadows->setDefault (defParams->retinex.shadows);
s_tonalwidth->setDefault (defParams->retinex.stonalwidth);
if (pedited) {
neigh->setDefaultEditedState (pedited->retinex.neigh ? Edited : UnEdited);
gain->setDefaultEditedState (pedited->retinex.gain ? Edited : UnEdited);
offs->setDefaultEditedState (pedited->retinex.offs ? Edited : UnEdited);
str->setDefaultEditedState (pedited->retinex.str ? Edited : UnEdited);
scal->setDefaultEditedState (pedited->retinex.scal ? Edited : UnEdited);
iter->setDefaultEditedState (pedited->retinex.iter ? Edited : UnEdited);
grad->setDefaultEditedState (pedited->retinex.grad ? Edited : UnEdited);
grads->setDefaultEditedState (pedited->retinex.grads ? Edited : UnEdited);
vart->setDefaultEditedState (pedited->retinex.vart ? Edited : UnEdited);
limd->setDefaultEditedState (pedited->retinex.limd ? Edited : UnEdited);
highl->setDefaultEditedState (pedited->retinex.highl ? Edited : UnEdited);
@@ -792,6 +1140,12 @@ void Retinex::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi
gam->setDefaultEditedState (pedited->retinex.gam ? Edited : UnEdited);
slope->setDefaultEditedState (pedited->retinex.slope ? Edited : UnEdited);
radius->setDefaultEditedState (pedited->retinex.radius ? Edited : UnEdited);
highlights->setDefaultEditedState (pedited->retinex.highlights ? Edited : UnEdited);
h_tonalwidth->setDefaultEditedState (pedited->retinex.htonalwidth ? Edited : UnEdited);
shadows->setDefaultEditedState (pedited->retinex.shadows ? Edited : UnEdited);
s_tonalwidth->setDefaultEditedState (pedited->retinex.stonalwidth ? Edited : UnEdited);
} else {
neigh->setDefaultEditedState (Irrelevant);
gain->setDefaultEditedState (Irrelevant);
@@ -803,8 +1157,18 @@ void Retinex::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi
// grbl->setDefaultEditedState (Irrelevant);
str->setDefaultEditedState (Irrelevant);
scal->setDefaultEditedState (Irrelevant);
iter->setDefaultEditedState (Irrelevant);
grad->setDefaultEditedState (Irrelevant);
grads->setDefaultEditedState (Irrelevant);
gam->setDefaultEditedState (Irrelevant);
slope->setDefaultEditedState (Irrelevant);
radius->setDefaultEditedState (Irrelevant);
highlights->setDefaultEditedState (Irrelevant);
h_tonalwidth->setDefaultEditedState (Irrelevant);
shadows->setDefaultEditedState (Irrelevant);
s_tonalwidth->setDefaultEditedState (Irrelevant);
}
}
@@ -827,6 +1191,17 @@ void Retinex::adjusterChanged (Adjuster* a, double newval)
if (!listener || !getEnabled()) {
return;
}
if(iter->getTextValue() > "1") {
scal->set_sensitive(true);
grad->set_sensitive(true);
grads->set_sensitive(true);
}
else {
scal->set_sensitive(false);
grad->set_sensitive(false);
grads->set_sensitive(false);
}
if (a == neigh) {
listener->panelChanged (EvLneigh, neigh->getTextValue());
@@ -834,6 +1209,12 @@ void Retinex::adjusterChanged (Adjuster* a, double newval)
listener->panelChanged (EvLstr, str->getTextValue());
} else if (a == scal) {
listener->panelChanged (EvLscal, scal->getTextValue());
} else if (a == iter) {
listener->panelChanged (EvLiter, iter->getTextValue());
} else if (a == grad) {
listener->panelChanged (EvLgrad, grad->getTextValue());
} else if (a == grads) {
listener->panelChanged (EvLgrads, grads->getTextValue());
} else if (a == gain) {
listener->panelChanged (EvLgain, gain->getTextValue());
} else if (a == offs) {
@@ -852,8 +1233,20 @@ void Retinex::adjusterChanged (Adjuster* a, double newval)
listener->panelChanged (EvLgam, gam->getTextValue());
} else if (a == slope) {
listener->panelChanged (EvLslope, slope->getTextValue());
} else if (a == highlights) {
listener->panelChanged (EvLhighlights, highlights->getTextValue());
} else if (a == h_tonalwidth) {
listener->panelChanged (EvLh_tonalwidth, h_tonalwidth->getTextValue());
} else if (a == shadows) {
listener->panelChanged (EvLshadows, shadows->getTextValue());
} else if (a == s_tonalwidth) {
listener->panelChanged (EvLs_tonalwidth, s_tonalwidth->getTextValue());
} else if (a == radius) {
listener->panelChanged (EvLradius, radius->getTextValue());
}
}
@@ -864,6 +1257,7 @@ void Retinex::autoOpenCurve ()
cdshapeH->openIfNonlinear();
transmissionShape->openIfNonlinear();
lhshape->openIfNonlinear();
mapshape->openIfNonlinear();
}
@@ -879,6 +1273,8 @@ void Retinex::curveChanged (CurveEditor* ce)
listener->panelChanged (EvRetinextransmission, M("HISTORY_CUSTOMCURVE"));
} else if (ce == lhshape) {
listener->panelChanged (EvRetinexlhcurve, M("HISTORY_CUSTOMCURVE"));
} else if (ce == mapshape) {
listener->panelChanged (EvRetinexmapcurve, M("HISTORY_CUSTOMCURVE"));
}
}
}
@@ -902,6 +1298,9 @@ void Retinex::trimValues (rtengine::procparams::ProcParams* pp)
{
str->trimValue(pp->retinex.str);
scal->trimValue(pp->retinex.scal);
iter->trimValue(pp->retinex.iter);
grad->trimValue(pp->retinex.grad);
grads->trimValue(pp->retinex.grads);
neigh->trimValue(pp->retinex.neigh);
gain->trimValue(pp->retinex.gain);
offs->trimValue(pp->retinex.offs);
@@ -912,6 +1311,8 @@ void Retinex::trimValues (rtengine::procparams::ProcParams* pp)
// grbl->trimValue(pp->retinex.grbl);
gam->trimValue(pp->retinex.gam);
slope->trimValue(pp->retinex.slope);
highlights->trimValue(pp->retinex.highlights);
shadows->trimValue(pp->retinex.shadows);
}
void Retinex::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI)
@@ -975,17 +1376,28 @@ void Retinex::setBatchMode (bool batchMode)
offs->showEditedCB ();
str->showEditedCB ();
scal->showEditedCB ();
iter->showEditedCB ();
grad->showEditedCB ();
grads->showEditedCB ();
gam->showEditedCB ();
slope->showEditedCB ();
vart->showEditedCB ();
limd->showEditedCB ();
highl->showEditedCB ();
baselog->showEditedCB ();
radius->showEditedCB ();
highlights->showEditedCB ();
h_tonalwidth->showEditedCB ();
shadows->showEditedCB ();
s_tonalwidth->showEditedCB ();
// grbl->showEditedCB ();
curveEditorGD->setBatchMode (batchMode);
curveEditorGDH->setBatchMode (batchMode);
transmissionCurveEditorG->setBatchMode (batchMode);
curveEditorGH->setBatchMode (batchMode);
curveEditormap->setBatchMode (batchMode);
}