Fixed forgot a label in viewmethod Retinex

This commit is contained in:
Desmis
2016-01-25 08:17:19 +01:00
parent 723b6d5580
commit fa70b1be57

View File

@@ -8,9 +8,9 @@
using namespace rtengine; using namespace rtengine;
using namespace rtengine::procparams; using namespace rtengine::procparams;
Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"), false, true) Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL"), false, true)
{ {
CurveListener::setMulti(true); CurveListener::setMulti (true);
std::vector<GradientMilestone> milestones; std::vector<GradientMilestone> milestones;
nextmin = 0.; nextmin = 0.;
nextmax = 0.; nextmax = 0.;
@@ -22,120 +22,120 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
nextmaxT = 0.; nextmaxT = 0.;
Gtk::VBox * retinexVBox = Gtk::manage ( new Gtk::VBox()); Gtk::VBox * retinexVBox = Gtk::manage ( new Gtk::VBox());
retinexVBox->set_border_width(4); retinexVBox->set_border_width (4);
retinexVBox->set_spacing(2); retinexVBox->set_spacing (2);
Gtk::VBox * settingsVBox = Gtk::manage ( new Gtk::VBox()); Gtk::VBox * settingsVBox = Gtk::manage ( new Gtk::VBox());
settingsVBox->set_border_width(4); settingsVBox->set_border_width (4);
settingsVBox->set_spacing(2); settingsVBox->set_spacing (2);
dhbox = Gtk::manage (new Gtk::HBox ()); dhbox = Gtk::manage (new Gtk::HBox ());
labmdh = Gtk::manage (new Gtk::Label (M("TP_RETINEX_METHOD") + ":")); labmdh = Gtk::manage (new Gtk::Label (M ("TP_RETINEX_METHOD") + ":"));
dhbox->pack_start (*labmdh, Gtk::PACK_SHRINK, 1); dhbox->pack_start (*labmdh, Gtk::PACK_SHRINK, 1);
retinexMethod = Gtk::manage (new MyComboBoxText ()); retinexMethod = Gtk::manage (new MyComboBoxText ());
retinexMethod->append (M("TP_RETINEX_LOW")); retinexMethod->append (M ("TP_RETINEX_LOW"));
retinexMethod->append (M("TP_RETINEX_UNIFORM")); retinexMethod->append (M ("TP_RETINEX_UNIFORM"));
retinexMethod->append (M("TP_RETINEX_HIGH")); retinexMethod->append (M ("TP_RETINEX_HIGH"));
retinexMethod->append (M("TP_RETINEX_HIGHLIG")); retinexMethod->append (M ("TP_RETINEX_HIGHLIG"));
// retinexMethod->append (M("TP_RETINEX_HIGHLIGPLUS")); // retinexMethod->append (M("TP_RETINEX_HIGHLIGPLUS"));
retinexMethod->set_active(0); retinexMethod->set_active (0);
retinexMethodConn = retinexMethod->signal_changed().connect ( sigc::mem_fun(*this, &Retinex::retinexMethodChanged) ); retinexMethodConn = retinexMethod->signal_changed().connect ( sigc::mem_fun (*this, &Retinex::retinexMethodChanged) );
retinexMethod->set_tooltip_markup (M("TP_RETINEX_METHOD_TOOLTIP")); retinexMethod->set_tooltip_markup (M ("TP_RETINEX_METHOD_TOOLTIP"));
retinexcolorspace = Gtk::manage (new MyComboBoxText ()); retinexcolorspace = Gtk::manage (new MyComboBoxText ());
retinexcolorspace->append (M("TP_RETINEX_LABSPACE")); retinexcolorspace->append (M ("TP_RETINEX_LABSPACE"));
retinexcolorspace->append (M("TP_RETINEX_HSLSPACE_LOG")); retinexcolorspace->append (M ("TP_RETINEX_HSLSPACE_LOG"));
retinexcolorspace->append (M("TP_RETINEX_HSLSPACE_LIN")); retinexcolorspace->append (M ("TP_RETINEX_HSLSPACE_LIN"));
retinexcolorspace->set_active(0); retinexcolorspace->set_active (0);
retinexColorSpaceConn = retinexcolorspace->signal_changed().connect ( sigc::mem_fun(*this, &Retinex::retinexColorSpaceChanged) ); retinexColorSpaceConn = retinexcolorspace->signal_changed().connect ( sigc::mem_fun (*this, &Retinex::retinexColorSpaceChanged) );
dhbox->pack_start(*retinexMethod); dhbox->pack_start (*retinexMethod);
dhbox->pack_start(*retinexcolorspace); dhbox->pack_start (*retinexcolorspace);
retinexVBox->pack_start(*dhbox); retinexVBox->pack_start (*dhbox);
// Histogram equalizer Lab curve // Histogram equalizer Lab curve
curveEditorGD = new CurveEditorGroup (options.lastRetinexDir, M("TP_RETINEX_CONTEDIT_LAB")); curveEditorGD = new CurveEditorGroup (options.lastRetinexDir, M ("TP_RETINEX_CONTEDIT_LAB"));
curveEditorGD->setCurveListener (this); curveEditorGD->setCurveListener (this);
cdshape = static_cast<DiagonalCurveEditor*>(curveEditorGD->addCurve(CT_Diagonal, M("TP_RETINEX_CURVEEDITOR_CD"))); cdshape = static_cast<DiagonalCurveEditor*> (curveEditorGD->addCurve (CT_Diagonal, M ("TP_RETINEX_CURVEEDITOR_CD")));
cdshape->setTooltip(M("TP_RETINEX_CURVEEDITOR_CD_TOOLTIP")); cdshape->setTooltip (M ("TP_RETINEX_CURVEEDITOR_CD_TOOLTIP"));
std::vector<GradientMilestone> milestones22; std::vector<GradientMilestone> milestones22;
milestones22.push_back( GradientMilestone(0., 0., 0., 0.) ); milestones22.push_back ( GradientMilestone (0., 0., 0., 0.) );
milestones22.push_back( GradientMilestone(1., 1., 1., 1.) ); milestones22.push_back ( GradientMilestone (1., 1., 1., 1.) );
cdshape->setBottomBarBgGradient(milestones22); cdshape->setBottomBarBgGradient (milestones22);
cdshape->setLeftBarBgGradient(milestones22); cdshape->setLeftBarBgGradient (milestones22);
curveEditorGD->curveListComplete(); curveEditorGD->curveListComplete();
// Histogram equalizer HSL curve // Histogram equalizer HSL curve
curveEditorGDH = new CurveEditorGroup (options.lastRetinexDir, M("TP_RETINEX_CONTEDIT_HSL")); curveEditorGDH = new CurveEditorGroup (options.lastRetinexDir, M ("TP_RETINEX_CONTEDIT_HSL"));
curveEditorGDH->setCurveListener (this); curveEditorGDH->setCurveListener (this);
cdshapeH = static_cast<DiagonalCurveEditor*>(curveEditorGDH->addCurve(CT_Diagonal, M("TP_RETINEX_CURVEEDITOR_CD"))); cdshapeH = static_cast<DiagonalCurveEditor*> (curveEditorGDH->addCurve (CT_Diagonal, M ("TP_RETINEX_CURVEEDITOR_CD")));
cdshapeH->setTooltip(M("TP_RETINEX_CURVEEDITOR_CD_TOOLTIP")); cdshapeH->setTooltip (M ("TP_RETINEX_CURVEEDITOR_CD_TOOLTIP"));
std::vector<GradientMilestone> milestones22H; std::vector<GradientMilestone> milestones22H;
milestones22H.push_back( GradientMilestone(0., 0., 0., 0.) ); milestones22H.push_back ( GradientMilestone (0., 0., 0., 0.) );
milestones22H.push_back( GradientMilestone(1., 1., 1., 1.) ); milestones22H.push_back ( GradientMilestone (1., 1., 1., 1.) );
cdshapeH->setBottomBarBgGradient(milestones22H); cdshapeH->setBottomBarBgGradient (milestones22H);
cdshapeH->setLeftBarBgGradient(milestones22H); cdshapeH->setLeftBarBgGradient (milestones22H);
curveEditorGDH->curveListComplete(); curveEditorGDH->curveListComplete();
curveEditormap = new CurveEditorGroup (options.lastRetinexDir, M("TP_RETINEX_CONTEDIT_MAP")); curveEditormap = new CurveEditorGroup (options.lastRetinexDir, M ("TP_RETINEX_CONTEDIT_MAP"));
curveEditormap->setCurveListener (this); curveEditormap->setCurveListener (this);
mapshape = static_cast<DiagonalCurveEditor*>(curveEditormap->addCurve(CT_Diagonal, M("TP_RETINEX_CURVEEDITOR_MAP"))); mapshape = static_cast<DiagonalCurveEditor*> (curveEditormap->addCurve (CT_Diagonal, M ("TP_RETINEX_CURVEEDITOR_MAP")));
mapshape->setTooltip(M("TP_RETINEX_CURVEEDITOR_MAP_TOOLTIP")); mapshape->setTooltip (M ("TP_RETINEX_CURVEEDITOR_MAP_TOOLTIP"));
std::vector<GradientMilestone> milestones222; std::vector<GradientMilestone> milestones222;
milestones222.push_back( GradientMilestone(0., 0., 0., 0.) ); milestones222.push_back ( GradientMilestone (0., 0., 0., 0.) );
milestones222.push_back( GradientMilestone(1., 1., 1., 1.) ); milestones222.push_back ( GradientMilestone (1., 1., 1., 1.) );
mapshape->setBottomBarBgGradient(milestones222); mapshape->setBottomBarBgGradient (milestones222);
mapshape->setLeftBarBgGradient(milestones222); mapshape->setLeftBarBgGradient (milestones222);
curveEditormap->curveListComplete(); curveEditormap->curveListComplete();
// Transmission map curve // Transmission map curve
transmissionCurveEditorG = new CurveEditorGroup (options.lastRetinexDir, M("TP_RETINEX_TRANSMISSION")); transmissionCurveEditorG = new CurveEditorGroup (options.lastRetinexDir, M ("TP_RETINEX_TRANSMISSION"));
transmissionCurveEditorG->setCurveListener (this); transmissionCurveEditorG->setCurveListener (this);
std::vector<double> defaultCurve; std::vector<double> defaultCurve;
rtengine::RetinexParams::getDefaulttransmissionCurve(defaultCurve); rtengine::RetinexParams::getDefaulttransmissionCurve (defaultCurve);
transmissionShape = static_cast<FlatCurveEditor*>(transmissionCurveEditorG->addCurve(CT_Flat, "", NULL, false)); transmissionShape = static_cast<FlatCurveEditor*> (transmissionCurveEditorG->addCurve (CT_Flat, "", NULL, false));
transmissionShape->setIdentityValue(0.); transmissionShape->setIdentityValue (0.);
transmissionShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); transmissionShape->setResetCurve (FlatCurveType (defaultCurve.at (0)), defaultCurve);
transmissionShape->setBottomBarBgGradient(milestones); transmissionShape->setBottomBarBgGradient (milestones);
transmissionCurveEditorG->set_tooltip_markup (M("TP_RETINEX_TRANSMISSION_TOOLTIP")); transmissionCurveEditorG->set_tooltip_markup (M ("TP_RETINEX_TRANSMISSION_TOOLTIP"));
transmissionCurveEditorG->curveListComplete(); transmissionCurveEditorG->curveListComplete();
gambox = Gtk::manage (new Gtk::HBox ()); gambox = Gtk::manage (new Gtk::HBox ());
labgam = Gtk::manage (new Gtk::Label (M("TP_RETINEX_GAMMA") + ":")); labgam = Gtk::manage (new Gtk::Label (M ("TP_RETINEX_GAMMA") + ":"));
gambox->pack_start (*labgam, Gtk::PACK_SHRINK, 1); gambox->pack_start (*labgam, Gtk::PACK_SHRINK, 1);
gammaretinex = Gtk::manage (new MyComboBoxText ()); gammaretinex = Gtk::manage (new MyComboBoxText ());
gammaretinex->append (M("TP_RETINEX_GAMMA_NONE")); gammaretinex->append (M ("TP_RETINEX_GAMMA_NONE"));
gammaretinex->append (M("TP_RETINEX_GAMMA_LOW")); gammaretinex->append (M ("TP_RETINEX_GAMMA_LOW"));
gammaretinex->append (M("TP_RETINEX_GAMMA_MID")); gammaretinex->append (M ("TP_RETINEX_GAMMA_MID"));
gammaretinex->append (M("TP_RETINEX_GAMMA_HIGH")); gammaretinex->append (M ("TP_RETINEX_GAMMA_HIGH"));
gammaretinex->append (M("TP_RETINEX_GAMMA_FREE")); gammaretinex->append (M ("TP_RETINEX_GAMMA_FREE"));
gammaretinex->set_active(0); gammaretinex->set_active (0);
gammaretinexConn = gammaretinex->signal_changed().connect ( sigc::mem_fun(*this, &Retinex::gammaretinexChanged) ); gammaretinexConn = gammaretinex->signal_changed().connect ( sigc::mem_fun (*this, &Retinex::gammaretinexChanged) );
gammaretinex->set_tooltip_markup (M("TP_RETINEX_GAMMA_TOOLTIP")); gammaretinex->set_tooltip_markup (M ("TP_RETINEX_GAMMA_TOOLTIP"));
gam = Gtk::manage (new Adjuster (M("TP_RETINEX_FREEGAMMA"), 0.6, 3.0, 0.01, 1.30)); gam = Gtk::manage (new Adjuster (M ("TP_RETINEX_FREEGAMMA"), 0.6, 3.0, 0.01, 1.30));
slope = Gtk::manage (new Adjuster (M("TP_RETINEX_SLOPE"), 1., 20., 0.1, 3.)); slope = Gtk::manage (new Adjuster (M ("TP_RETINEX_SLOPE"), 1., 20., 0.1, 3.));
str = Gtk::manage (new Adjuster (M("TP_RETINEX_STRENGTH"), 0, 100., 1., 20.)); str = Gtk::manage (new Adjuster (M ("TP_RETINEX_STRENGTH"), 0, 100., 1., 20.));
neigh = Gtk::manage (new Adjuster (M("TP_RETINEX_NEIGHBOR"), 6, 100., 1., 80.)); neigh = Gtk::manage (new Adjuster (M ("TP_RETINEX_NEIGHBOR"), 6, 100., 1., 80.));
highl = Gtk::manage (new Adjuster (M("TP_RETINEX_HIGHLIGHT"), 1, 20, 1, 4)); highl = Gtk::manage (new Adjuster (M ("TP_RETINEX_HIGHLIGHT"), 1, 20, 1, 4));
highl->set_tooltip_markup (M("TP_RETINEX_HIGHLIGHT_TOOLTIP")); highl->set_tooltip_markup (M ("TP_RETINEX_HIGHLIGHT_TOOLTIP"));
vart = Gtk::manage (new Adjuster (M("TP_RETINEX_VARIANCE"), 50, 500, 1, 200)); vart = Gtk::manage (new Adjuster (M ("TP_RETINEX_VARIANCE"), 50, 500, 1, 200));
vart->set_tooltip_markup (M("TP_RETINEX_VARIANCE_TOOLTIP")); vart->set_tooltip_markup (M ("TP_RETINEX_VARIANCE_TOOLTIP"));
expsettings = new MyExpander (false, M("TP_RETINEX_SETTINGS")); expsettings = new MyExpander (false, M ("TP_RETINEX_SETTINGS"));
expsettings->signal_button_release_event().connect_notify( sigc::bind( sigc::mem_fun(this, &Retinex::foldAllButMe), expsettings) ); expsettings->signal_button_release_event().connect_notify ( sigc::bind ( sigc::mem_fun (this, &Retinex::foldAllButMe), expsettings) );
retinexVBox->pack_start (*str); retinexVBox->pack_start (*str);
str->show (); str->show ();
@@ -149,98 +149,99 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
retinexVBox->pack_start (*highl); retinexVBox->pack_start (*highl);
highl->show (); highl->show ();
mMLabels = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER)); mMLabels = Gtk::manage (new Gtk::Label ("---", Gtk::ALIGN_CENTER));
mMLabels->set_tooltip_markup (M("TP_RETINEX_MLABEL_TOOLTIP")); mMLabels->set_tooltip_markup (M ("TP_RETINEX_MLABEL_TOOLTIP"));
transLabels = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER)); transLabels = Gtk::manage (new Gtk::Label ("---", Gtk::ALIGN_CENTER));
transLabels->set_tooltip_markup (M("TP_RETINEX_TLABEL_TOOLTIP")); transLabels->set_tooltip_markup (M ("TP_RETINEX_TLABEL_TOOLTIP"));
transLabels2 = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER)); transLabels2 = Gtk::manage (new Gtk::Label ("---", Gtk::ALIGN_CENTER));
scal = Gtk::manage (new Adjuster (M("TP_RETINEX_SCALES"), -1, 6., 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.)); 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.)); 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.)); 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)); 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)); 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)); // vart = Gtk::manage (new Adjuster (M("TP_RETINEX_VARIANCE"), 50, 500, 1, 125));
limd = Gtk::manage (new Adjuster (M("TP_RETINEX_THRESHOLD"), 2, 100, 1, 8)); limd = Gtk::manage (new Adjuster (M ("TP_RETINEX_THRESHOLD"), 2, 100, 1, 8));
baselog = Gtk::manage (new Adjuster (M("TP_RETINEX_BASELOG"), 1.1, 100., 0.001, 2.718)); baselog = Gtk::manage (new Adjuster (M ("TP_RETINEX_BASELOG"), 1.1, 100., 0.001, 2.718));
// grbl = Gtk::manage (new Adjuster (M("TP_RETINEX_HIGHLIGHT3"), 1, 100, 1, 50)); // grbl = Gtk::manage (new Adjuster (M("TP_RETINEX_HIGHLIGHT3"), 1, 100, 1, 50));
gain->set_tooltip_markup (M("TP_RETINEX_GAIN_TOOLTIP")); gain->set_tooltip_markup (M ("TP_RETINEX_GAIN_TOOLTIP"));
scal->set_tooltip_markup (M("TP_RETINEX_SCALES_TOOLTIP")); scal->set_tooltip_markup (M ("TP_RETINEX_SCALES_TOOLTIP"));
iter->set_tooltip_markup (M("TP_RETINEX_ITER_TOOLTIP")); iter->set_tooltip_markup (M ("TP_RETINEX_ITER_TOOLTIP"));
grad->set_tooltip_markup (M("TP_RETINEX_GRAD_TOOLTIP")); grad->set_tooltip_markup (M ("TP_RETINEX_GRAD_TOOLTIP"));
grads->set_tooltip_markup (M("TP_RETINEX_GRADS_TOOLTIP")); grads->set_tooltip_markup (M ("TP_RETINEX_GRADS_TOOLTIP"));
// vart->set_tooltip_markup (M("TP_RETINEX_VARIANCE_TOOLTIP")); // vart->set_tooltip_markup (M("TP_RETINEX_VARIANCE_TOOLTIP"));
limd->set_tooltip_markup (M("TP_RETINEX_THRESHOLD_TOOLTIP")); limd->set_tooltip_markup (M ("TP_RETINEX_THRESHOLD_TOOLTIP"));
baselog->set_tooltip_markup (M("TP_RETINEX_BASELOG_TOOLTIP")); baselog->set_tooltip_markup (M ("TP_RETINEX_BASELOG_TOOLTIP"));
Gtk::Frame *p1Frame; Gtk::Frame *p1Frame;
p1Frame = Gtk::manage (new Gtk::Frame(M("TP_RETINEX_LABEL_MASK")) ); p1Frame = Gtk::manage (new Gtk::Frame (M ("TP_RETINEX_LABEL_MASK")) );
p1Frame->set_border_width(0); p1Frame->set_border_width (0);
p1Frame->set_label_align(0.025, 0.5); p1Frame->set_label_align (0.025, 0.5);
Gtk::VBox *p1VBox; Gtk::VBox *p1VBox;
p1VBox = Gtk::manage ( new Gtk::VBox()); p1VBox = Gtk::manage ( new Gtk::VBox());
p1VBox->set_border_width(4); p1VBox->set_border_width (4);
p1VBox->set_spacing(2); p1VBox->set_spacing (2);
mapbox = Gtk::manage (new Gtk::HBox ()); mapbox = Gtk::manage (new Gtk::HBox ());
labmap = Gtk::manage (new Gtk::Label (M("TP_RETINEX_MAP") + ":")); labmap = Gtk::manage (new Gtk::Label (M ("TP_RETINEX_MAP") + ":"));
mapbox->pack_start (*labmap, Gtk::PACK_SHRINK, 1); mapbox->pack_start (*labmap, Gtk::PACK_SHRINK, 1);
mapMethod = Gtk::manage (new MyComboBoxText ()); mapMethod = Gtk::manage (new MyComboBoxText ());
mapMethod->append (M("TP_RETINEX_MAP_NONE")); mapMethod->append (M ("TP_RETINEX_MAP_NONE"));
// mapMethod->append (M("TP_RETINEX_MAP_CURV")); // mapMethod->append (M("TP_RETINEX_MAP_CURV"));
mapMethod->append (M("TP_RETINEX_MAP_GAUS")); mapMethod->append (M ("TP_RETINEX_MAP_GAUS"));
mapMethod->append (M("TP_RETINEX_MAP_MAPP")); mapMethod->append (M ("TP_RETINEX_MAP_MAPP"));
mapMethod->append (M("TP_RETINEX_MAP_MAPT")); mapMethod->append (M ("TP_RETINEX_MAP_MAPT"));
mapMethod->set_active(0); mapMethod->set_active (0);
mapMethodConn = mapMethod->signal_changed().connect ( sigc::mem_fun(*this, &Retinex::mapMethodChanged) ); mapMethodConn = mapMethod->signal_changed().connect ( sigc::mem_fun (*this, &Retinex::mapMethodChanged) );
mapMethod->set_tooltip_markup (M("TP_RETINEX_MAP_METHOD_TOOLTIP")); mapMethod->set_tooltip_markup (M ("TP_RETINEX_MAP_METHOD_TOOLTIP"));
highlights = Gtk::manage (new Adjuster (M("TP_SHADOWSHLIGHTS_HIGHLIGHTS"), 0, 100, 1, 0)); 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)); 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)); 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)); 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)); radius = Gtk::manage (new Adjuster (M ("TP_SHADOWSHLIGHTS_RADIUS"), 5, 100, 1, 40));
viewbox = Gtk::manage (new Gtk::HBox ()); viewbox = Gtk::manage (new Gtk::HBox ());
labview = Gtk::manage (new Gtk::Label (M("TP_RETINEX_VIEW") + ":")); labview = Gtk::manage (new Gtk::Label (M ("TP_RETINEX_VIEW") + ":"));
viewbox->pack_start (*labview, Gtk::PACK_SHRINK, 1); viewbox->pack_start (*labview, Gtk::PACK_SHRINK, 1);
viewMethod = Gtk::manage (new MyComboBoxText ()); viewMethod = Gtk::manage (new MyComboBoxText ());
viewMethod->append (M("TP_RETINEX_VIEW_UNSHARP")); 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_MASK"));
viewMethod->append (M("TP_RETINEX_VIEW_TRAN2")); viewMethod->append (M ("TP_RETINEX_VIEW_TRAN"));
viewMethod->set_active(0); viewMethod->append (M ("TP_RETINEX_VIEW_TRAN2"));
viewMethodConn = viewMethod->signal_changed().connect ( sigc::mem_fun(*this, &Retinex::viewMethodChanged) ); viewMethod->set_active (0);
viewMethod->set_tooltip_markup (M("TP_RETINEX_VIEW_METHOD_TOOLTIP")); 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 = new CurveEditorGroup (options.lastRetinexDir, M ("TP_RETINEX_CONTEDIT_LH"));
curveEditorGH->setCurveListener (this); curveEditorGH->setCurveListener (this);
lhshape = static_cast<FlatCurveEditor*>(curveEditorGH->addCurve(CT_Flat, M("TP_RETINEX_CURVEEDITOR_LH"))); lhshape = static_cast<FlatCurveEditor*> (curveEditorGH->addCurve (CT_Flat, M ("TP_RETINEX_CURVEEDITOR_LH")));
lhshape->setTooltip(M("TP_RETINEX_CURVEEDITOR_LH_TOOLTIP")); lhshape->setTooltip (M ("TP_RETINEX_CURVEEDITOR_LH_TOOLTIP"));
lhshape->setCurveColorProvider(this, 4); lhshape->setCurveColorProvider (this, 4);
milestones.clear(); milestones.clear();
for (int i = 0; i < 7; i++) { for (int i = 0; i < 7; i++) {
float R, G, B; float R, G, B;
float x = float(i) * (1.0f / 6.0); float x = float (i) * (1.0f / 6.0);
Color::hsv2rgb01(x, 0.5f, 0.5f, R, G, B); Color::hsv2rgb01 (x, 0.5f, 0.5f, R, G, B);
milestones.push_back( GradientMilestone(double(x), double(R), double(G), double(B)) ); milestones.push_back ( GradientMilestone (double (x), double (R), double (G), double (B)) );
} }
lhshape->setBottomBarBgGradient(milestones); lhshape->setBottomBarBgGradient (milestones);
curveEditorGH->curveListComplete(); curveEditorGH->curveListComplete();
medianmap = Gtk::manage (new Gtk::CheckButton (M("TP_RETINEX_MEDIAN"))); medianmap = Gtk::manage (new Gtk::CheckButton (M ("TP_RETINEX_MEDIAN")));
medianmap->set_active (true); medianmap->set_active (true);
medianmapConn = medianmap->signal_toggled().connect( sigc::mem_fun(*this, &Retinex::medianmapChanged) ); medianmapConn = medianmap->signal_toggled().connect ( sigc::mem_fun (*this, &Retinex::medianmapChanged) );
settingsVBox->pack_start (*mMLabels); settingsVBox->pack_start (*mMLabels);
mMLabels->show (); mMLabels->show ();
@@ -260,9 +261,9 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
settingsVBox->pack_start (*curveEditorGH, Gtk::PACK_SHRINK, 4); settingsVBox->pack_start (*curveEditorGH, Gtk::PACK_SHRINK, 4);
curveEditorGH->show(); curveEditorGH->show();
gambox->pack_start(*gammaretinex); gambox->pack_start (*gammaretinex);
settingsVBox->pack_start(*gambox); settingsVBox->pack_start (*gambox);
gammaretinex->show(); gammaretinex->show();
settingsVBox->pack_start (*gam); settingsVBox->pack_start (*gam);
@@ -298,14 +299,14 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
// settingsVBox->pack_start (*Gtk::manage (new Gtk::HSeparator())); // settingsVBox->pack_start (*Gtk::manage (new Gtk::HSeparator()));
viewbox->pack_start(*viewMethod); viewbox->pack_start (*viewMethod);
// settingsVBox->pack_start(*viewbox); // settingsVBox->pack_start(*viewbox);
retinexVBox->pack_start(*viewbox); retinexVBox->pack_start (*viewbox);
//settingsVBox->pack_start (*viewMethod); //settingsVBox->pack_start (*viewMethod);
mapbox->pack_start(*mapMethod); mapbox->pack_start (*mapMethod);
// settingsVBox->pack_start(*mapbox); // settingsVBox->pack_start(*mapbox);
p1VBox->pack_start(*mapbox); p1VBox->pack_start (*mapbox);
p1VBox->pack_start (*curveEditormap, Gtk::PACK_SHRINK, 4); p1VBox->pack_start (*curveEditormap, Gtk::PACK_SHRINK, 4);
curveEditormap->show(); curveEditormap->show();
@@ -333,21 +334,21 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
// grbl->show (); // grbl->show ();
// settingsVBox->pack_start (*Gtk::manage (new Gtk::HSeparator())); // settingsVBox->pack_start (*Gtk::manage (new Gtk::HSeparator()));
settingsVBox->pack_start( *transmissionCurveEditorG, Gtk::PACK_SHRINK, 2); settingsVBox->pack_start ( *transmissionCurveEditorG, Gtk::PACK_SHRINK, 2);
transmissionCurveEditorG->show(); transmissionCurveEditorG->show();
settingsVBox->pack_start (*medianmap); settingsVBox->pack_start (*medianmap);
medianmap->show (); medianmap->show ();
expsettings->add(*settingsVBox); expsettings->add (*settingsVBox);
neutrHBox = Gtk::manage (new Gtk::HBox ()); neutrHBox = Gtk::manage (new Gtk::HBox ());
neutrHBox->set_border_width (2); neutrHBox->set_border_width (2);
neutral = Gtk::manage (new Gtk::Button (M("TP_RETINEX_NEUTRAL"))); neutral = Gtk::manage (new Gtk::Button (M ("TP_RETINEX_NEUTRAL")));
RTImage *resetImg = Gtk::manage (new RTImage ("gtk-undo-ltr-small.png", "gtk-undo-rtl-small.png")); RTImage *resetImg = Gtk::manage (new RTImage ("gtk-undo-ltr-small.png", "gtk-undo-rtl-small.png"));
neutral->set_image(*resetImg); neutral->set_image (*resetImg);
neutral->set_tooltip_text (M("TP_RETINEX_NEUTRAL_TIP")); neutral->set_tooltip_text (M ("TP_RETINEX_NEUTRAL_TIP"));
neutralconn = neutral->signal_pressed().connect( sigc::mem_fun(*this, &Retinex::neutral_pressed) ); neutralconn = neutral->signal_pressed().connect ( sigc::mem_fun (*this, &Retinex::neutral_pressed) );
neutral->show(); neutral->show();
neutrHBox->pack_start (*neutral); neutrHBox->pack_start (*neutral);
@@ -475,7 +476,7 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"),
} }
*/ */
pack_start (*retinexVBox); pack_start (*retinexVBox);
p1Frame->add(*p1VBox); p1Frame->add (*p1VBox);
pack_start (*p1Frame, Gtk::PACK_EXPAND_WIDGET, 4); pack_start (*p1Frame, Gtk::PACK_EXPAND_WIDGET, 4);
pack_start (*expsettings); pack_start (*expsettings);
@@ -500,30 +501,30 @@ Retinex::~Retinex()
} }
void Retinex::neutral_pressed () void Retinex::neutral_pressed ()
{ {
neigh->resetValue(false); neigh->resetValue (false);
gain->resetValue(false); gain->resetValue (false);
offs->resetValue(false); offs->resetValue (false);
str->resetValue(false); str->resetValue (false);
scal->resetValue(false); scal->resetValue (false);
iter->resetValue(false); iter->resetValue (false);
grad->resetValue(false); grad->resetValue (false);
grads->resetValue(false); grads->resetValue (false);
vart->resetValue(false); vart->resetValue (false);
limd->resetValue(false); limd->resetValue (false);
highl->resetValue(false); highl->resetValue (false);
baselog->resetValue(false); baselog->resetValue (false);
gam->resetValue(false); gam->resetValue (false);
slope->resetValue(false); slope->resetValue (false);
highlights->resetValue(false); highlights->resetValue (false);
h_tonalwidth->resetValue(false); h_tonalwidth->resetValue (false);
shadows->resetValue(false); shadows->resetValue (false);
s_tonalwidth->resetValue(false); s_tonalwidth->resetValue (false);
radius->resetValue(false); radius->resetValue (false);
mapMethod->set_active(0); mapMethod->set_active (0);
viewMethod->set_active(0); viewMethod->set_active (0);
retinexMethod->set_active(2); retinexMethod->set_active (2);
retinexcolorspace->set_active(0); retinexcolorspace->set_active (0);
gammaretinex->set_active(0); gammaretinex->set_active (0);
transmissionShape->reset(); transmissionShape->reset();
cdshape->reset(); cdshape->reset();
cdshapeH->reset(); cdshapeH->reset();
@@ -534,19 +535,19 @@ void Retinex::neutral_pressed ()
void Retinex::foldAllButMe (GdkEventButton* event, MyExpander *expander) void Retinex::foldAllButMe (GdkEventButton* event, MyExpander *expander)
{ {
if (event->button == 3) { if (event->button == 3) {
expsettings->set_expanded(expsettings == expander); expsettings->set_expanded (expsettings == expander);
} }
} }
void Retinex::writeOptions(std::vector<int> &tpOpen) void Retinex::writeOptions (std::vector<int> &tpOpen)
{ {
tpOpen.push_back (expsettings->get_expanded ()); tpOpen.push_back (expsettings->get_expanded ());
} }
void Retinex::updateToolState(std::vector<int> &tpOpen) void Retinex::updateToolState (std::vector<int> &tpOpen)
{ {
if(tpOpen.size() == 10) { if (tpOpen.size() == 10) {
expsettings->set_expanded(tpOpen.at(9)); expsettings->set_expanded (tpOpen.at (9));
} }
} }
@@ -557,7 +558,7 @@ void Retinex::updateToolState(std::vector<int> &tpOpen)
int minmaxChangedUI (void* data) int minmaxChangedUI (void* data)
{ {
GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected
(static_cast<Retinex*>(data))->minmaxComputed_ (); (static_cast<Retinex*> (data))->minmaxComputed_ ();
return 0; return 0;
} }
@@ -592,10 +593,10 @@ void Retinex::updateLabel ()
nX = nextmin; nX = nextmin;
nY = nextmax; nY = nextmax;
{ {
mMLabels->set_text( mMLabels->set_text (
Glib::ustring::compose(M("TP_RETINEX_MLABEL"), Glib::ustring::compose (M ("TP_RETINEX_MLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(0), nX), Glib::ustring::format (std::fixed, std::setprecision (0), nX),
Glib::ustring::format(std::fixed, std::setprecision(0), nY)) Glib::ustring::format (std::fixed, std::setprecision (0), nY))
); );
} }
} }
@@ -612,17 +613,17 @@ void Retinex::updateTrans ()
nB = nextmaxT; nB = nextmaxT;
nS = nextsigma; nS = nextsigma;
{ {
transLabels->set_text( transLabels->set_text (
Glib::ustring::compose(M("TP_RETINEX_TLABEL"), Glib::ustring::compose (M ("TP_RETINEX_TLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(1), nm), Glib::ustring::format (std::fixed, std::setprecision (1), nm),
Glib::ustring::format(std::fixed, std::setprecision(1), nM), Glib::ustring::format (std::fixed, std::setprecision (1), nM),
Glib::ustring::format(std::fixed, std::setprecision(1), nZ), Glib::ustring::format (std::fixed, std::setprecision (1), nZ),
Glib::ustring::format(std::fixed, std::setprecision(1), nS)) Glib::ustring::format (std::fixed, std::setprecision (1), nS))
); );
transLabels2->set_text( transLabels2->set_text (
Glib::ustring::compose(M("TP_RETINEX_TLABEL2"), Glib::ustring::compose (M ("TP_RETINEX_TLABEL2"),
Glib::ustring::format(std::fixed, std::setprecision(1), nA), Glib::ustring::format (std::fixed, std::setprecision (1), nA),
Glib::ustring::format(std::fixed, std::setprecision(1), nB)) Glib::ustring::format (std::fixed, std::setprecision (1), nB))
); );
@@ -635,11 +636,11 @@ void Retinex::updateTrans ()
void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited) void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited)
{ {
disableListener (); disableListener ();
retinexMethodConn.block(true); retinexMethodConn.block (true);
retinexColorSpaceConn.block(true); retinexColorSpaceConn.block (true);
gammaretinexConn.block(true); gammaretinexConn.block (true);
mapMethodConn.block(true); mapMethodConn.block (true);
viewMethodConn.block(true); viewMethodConn.block (true);
if (pedited) { if (pedited) {
@@ -667,23 +668,23 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited)
if (!pedited->retinex.retinexMethod) { if (!pedited->retinex.retinexMethod) {
retinexMethod->set_active_text(M("GENERAL_UNCHANGED")); retinexMethod->set_active_text (M ("GENERAL_UNCHANGED"));
} }
if (!pedited->retinex.mapMethod) { if (!pedited->retinex.mapMethod) {
mapMethod->set_active_text(M("GENERAL_UNCHANGED")); mapMethod->set_active_text (M ("GENERAL_UNCHANGED"));
} }
if (!pedited->retinex.viewMethod) { if (!pedited->retinex.viewMethod) {
viewMethod->set_active_text(M("GENERAL_UNCHANGED")); viewMethod->set_active_text (M ("GENERAL_UNCHANGED"));
} }
if (!pedited->retinex.retinexcolorspace) { if (!pedited->retinex.retinexcolorspace) {
retinexcolorspace->set_active_text(M("GENERAL_UNCHANGED")); retinexcolorspace->set_active_text (M ("GENERAL_UNCHANGED"));
} }
if (!pedited->retinex.gammaretinex) { if (!pedited->retinex.gammaretinex) {
gammaretinex->set_active_text(M("GENERAL_UNCHANGED")); gammaretinex->set_active_text (M ("GENERAL_UNCHANGED"));
} }
cdshape->setUnChanged (!pedited->retinex.cdcurve); cdshape->setUnChanged (!pedited->retinex.cdcurve);
@@ -716,14 +717,14 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited)
s_tonalwidth->setValue (pp->retinex.stonalwidth); s_tonalwidth->setValue (pp->retinex.stonalwidth);
// grbl->setValue (pp->retinex.grbl); // grbl->setValue (pp->retinex.grbl);
if(pp->retinex.iter == 1) { if (pp->retinex.iter == 1) {
grad->set_sensitive(false); grad->set_sensitive (false);
scal->set_sensitive(false); scal->set_sensitive (false);
grads->set_sensitive(false); grads->set_sensitive (false);
} else { } else {
grad->set_sensitive(true); grad->set_sensitive (true);
scal->set_sensitive(true); scal->set_sensitive (true);
grads->set_sensitive(true); grads->set_sensitive (true);
} }
setEnabled (pp->retinex.enabled); setEnabled (pp->retinex.enabled);
@@ -794,20 +795,20 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited)
mapMethodChanged (); mapMethodChanged ();
viewMethodChanged (); viewMethodChanged ();
medianmapConn.block(true); medianmapConn.block (true);
medianmapChanged (); medianmapChanged ();
medianmapConn.block(false); medianmapConn.block (false);
cdshape->setCurve (pp->retinex.cdcurve); cdshape->setCurve (pp->retinex.cdcurve);
cdshapeH->setCurve (pp->retinex.cdHcurve); cdshapeH->setCurve (pp->retinex.cdHcurve);
lhshape->setCurve (pp->retinex.lhcurve); lhshape->setCurve (pp->retinex.lhcurve);
mapshape->setCurve (pp->retinex.mapcurve); mapshape->setCurve (pp->retinex.mapcurve);
retinexMethodConn.block(false); retinexMethodConn.block (false);
retinexColorSpaceConn.block(false); retinexColorSpaceConn.block (false);
gammaretinexConn.block(false); gammaretinexConn.block (false);
mapMethodConn.block(false); mapMethodConn.block (false);
viewMethodConn.block(false); viewMethodConn.block (false);
transmissionShape->setCurve (pp->retinex.transmissionCurve); transmissionShape->setCurve (pp->retinex.transmissionCurve);
@@ -849,11 +850,11 @@ void Retinex::write (ProcParams* pp, ParamsEdited* pedited)
pp->retinex.stonalwidth = (int)s_tonalwidth->getValue (); pp->retinex.stonalwidth = (int)s_tonalwidth->getValue ();
if (pedited) { if (pedited) {
pedited->retinex.retinexMethod = retinexMethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->retinex.retinexMethod = retinexMethod->get_active_text() != M ("GENERAL_UNCHANGED");
pedited->retinex.retinexcolorspace = retinexcolorspace->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.gammaretinex = gammaretinex->get_active_text() != M ("GENERAL_UNCHANGED");
pedited->retinex.mapMethod = mapMethod->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.viewMethod = viewMethod->get_active_text() != M ("GENERAL_UNCHANGED");
//%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%
pedited->retinex.str = str->getEditedState (); pedited->retinex.str = str->getEditedState ();
@@ -948,7 +949,7 @@ void Retinex::write (ProcParams* pp, ParamsEdited* pedited)
void Retinex::retinexMethodChanged() void Retinex::retinexMethodChanged()
{ {
if(retinexMethod->get_active_row_number() == 3) { if (retinexMethod->get_active_row_number() == 3) {
highl->show(); highl->show();
} else { } else {
highl->hide(); highl->hide();
@@ -964,14 +965,14 @@ void Retinex::retinexMethodChanged()
void Retinex::mapMethodChanged() void Retinex::mapMethodChanged()
{ {
if(mapMethod->get_active_row_number() == 1 /*|| mapMethod->get_active_row_number() == 2*/) { if (mapMethod->get_active_row_number() == 1 /*|| mapMethod->get_active_row_number() == 2*/) {
curveEditormap->show(); curveEditormap->show();
highlights->show(); highlights->show();
h_tonalwidth->show(); h_tonalwidth->show();
shadows->show(); shadows->show();
s_tonalwidth->show(); s_tonalwidth->show();
radius->show(); radius->show();
} else if(mapMethod->get_active_row_number() == 2 || mapMethod->get_active_row_number() == 3) { } else if (mapMethod->get_active_row_number() == 2 || mapMethod->get_active_row_number() == 3) {
curveEditormap->show(); curveEditormap->show();
highlights->show(); highlights->show();
h_tonalwidth->show(); h_tonalwidth->show();
@@ -995,7 +996,7 @@ void Retinex::mapMethodChanged()
void Retinex::viewMethodChanged() void Retinex::viewMethodChanged()
{ {
if(viewMethod->get_active_row_number() == 1 || viewMethod->get_active_row_number() == 2) { if (viewMethod->get_active_row_number() == 1 || viewMethod->get_active_row_number() == 2) {
// vart->hide(); // vart->hide();
gain->hide(); gain->hide();
offs->hide(); offs->hide();
@@ -1007,7 +1008,7 @@ void Retinex::viewMethodChanged()
grad->hide(); grad->hide();
grads->hide(); grads->hide();
curveEditorGH->hide(); curveEditorGH->hide();
} else if(viewMethod->get_active_row_number() == 3 || viewMethod->get_active_row_number() == 4) { } else if (viewMethod->get_active_row_number() == 3 || viewMethod->get_active_row_number() == 4) {
gain->hide(); gain->hide();
offs->hide(); offs->hide();
// vart->hide(); // vart->hide();
@@ -1039,15 +1040,15 @@ void Retinex::ColorSpaceUpdateUI ()
if (!batchMode) { if (!batchMode) {
curveEditorGH->show(); curveEditorGH->show();
if(retinexcolorspace->get_active_row_number() == 0) { if (retinexcolorspace->get_active_row_number() == 0) {
curveEditorGD->show(); curveEditorGD->show();
curveEditorGDH->hide(); curveEditorGDH->hide();
baselog->show(); baselog->show();
} else if(retinexcolorspace->get_active_row_number() == 1) { } else if (retinexcolorspace->get_active_row_number() == 1) {
curveEditorGD->hide(); curveEditorGD->hide();
curveEditorGDH->show(); curveEditorGDH->show();
baselog->show(); baselog->show();
} else if(retinexcolorspace->get_active_row_number() == 2) { } else if (retinexcolorspace->get_active_row_number() == 2) {
curveEditorGD->hide(); curveEditorGD->hide();
curveEditorGDH->show(); curveEditorGDH->show();
baselog->hide(); baselog->hide();
@@ -1068,10 +1069,10 @@ void Retinex::retinexColorSpaceChanged()
void Retinex::gammaretinexChanged() void Retinex::gammaretinexChanged()
{ {
if (!batchMode) { if (!batchMode) {
if(gammaretinex->get_active_row_number() == 4) { if (gammaretinex->get_active_row_number() == 4) {
gam->show(); gam->show();
slope->show(); slope->show();
} else if(gammaretinex->get_active_row_number() != 4) { } else if (gammaretinex->get_active_row_number() != 4) {
gam->hide(); gam->hide();
slope->hide(); slope->hide();
} }
@@ -1102,11 +1103,11 @@ void Retinex::medianmapChanged ()
if (listener) { if (listener) {
if (medianmap->get_active()) { if (medianmap->get_active()) {
if (getEnabled()) { if (getEnabled()) {
listener->panelChanged (EvRetinexmedianmap, M("GENERAL_ENABLED")); listener->panelChanged (EvRetinexmedianmap, M ("GENERAL_ENABLED"));
} }
} else { } else {
if (getEnabled()) { if (getEnabled()) {
listener->panelChanged (EvRetinexmedianmap, M("GENERAL_DISABLED")); listener->panelChanged (EvRetinexmedianmap, M ("GENERAL_DISABLED"));
} }
} }
@@ -1190,14 +1191,14 @@ void Retinex::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi
void Retinex::setAdjusterBehavior (bool strAdd, bool neighAdd, bool limdAdd, bool gainAdd, bool offsAdd, bool vartAdd, bool gamAdd, bool slopeAdd) void Retinex::setAdjusterBehavior (bool strAdd, bool neighAdd, bool limdAdd, bool gainAdd, bool offsAdd, bool vartAdd, bool gamAdd, bool slopeAdd)
{ {
str->setAddMode(strAdd); str->setAddMode (strAdd);
neigh->setAddMode(neighAdd); neigh->setAddMode (neighAdd);
limd->setAddMode(limdAdd); limd->setAddMode (limdAdd);
gain->setAddMode(gainAdd); gain->setAddMode (gainAdd);
offs->setAddMode(offsAdd); offs->setAddMode (offsAdd);
vart->setAddMode(vartAdd); vart->setAddMode (vartAdd);
gam->setAddMode(gamAdd); gam->setAddMode (gamAdd);
slope->setAddMode(slopeAdd); slope->setAddMode (slopeAdd);
} }
@@ -1208,14 +1209,14 @@ void Retinex::adjusterChanged (Adjuster* a, double newval)
return; return;
} }
if(iter->getTextValue() > "1") { if (iter->getTextValue() > "1") {
scal->set_sensitive(true); scal->set_sensitive (true);
grad->set_sensitive(true); grad->set_sensitive (true);
grads->set_sensitive(true); grads->set_sensitive (true);
} else { } else {
scal->set_sensitive(false); scal->set_sensitive (false);
grad->set_sensitive(false); grad->set_sensitive (false);
grads->set_sensitive(false); grads->set_sensitive (false);
} }
@@ -1282,15 +1283,15 @@ void Retinex::curveChanged (CurveEditor* ce)
{ {
if (listener && getEnabled()) { if (listener && getEnabled()) {
if (ce == cdshape) { if (ce == cdshape) {
listener->panelChanged (EvLCDCurve, M("HISTORY_CUSTOMCURVE")); listener->panelChanged (EvLCDCurve, M ("HISTORY_CUSTOMCURVE"));
} else if (ce == cdshapeH) { } else if (ce == cdshapeH) {
listener->panelChanged (EvLCDHCurve, M("HISTORY_CUSTOMCURVE")); listener->panelChanged (EvLCDHCurve, M ("HISTORY_CUSTOMCURVE"));
} else if (ce == transmissionShape) { } else if (ce == transmissionShape) {
listener->panelChanged (EvRetinextransmission, M("HISTORY_CUSTOMCURVE")); listener->panelChanged (EvRetinextransmission, M ("HISTORY_CUSTOMCURVE"));
} else if (ce == lhshape) { } else if (ce == lhshape) {
listener->panelChanged (EvRetinexlhcurve, M("HISTORY_CUSTOMCURVE")); listener->panelChanged (EvRetinexlhcurve, M ("HISTORY_CUSTOMCURVE"));
} else if (ce == mapshape) { } else if (ce == mapshape) {
listener->panelChanged (EvRetinexmapcurve, M("HISTORY_CUSTOMCURVE")); listener->panelChanged (EvRetinexmapcurve, M ("HISTORY_CUSTOMCURVE"));
} }
} }
} }
@@ -1300,11 +1301,11 @@ void Retinex::enabledChanged ()
if (listener) { if (listener) {
if (get_inconsistent()) { if (get_inconsistent()) {
listener->panelChanged (EvRetinexEnabled, M("GENERAL_UNCHANGED")); listener->panelChanged (EvRetinexEnabled, M ("GENERAL_UNCHANGED"));
} else if (getEnabled()) { } else if (getEnabled()) {
listener->panelChanged (EvRetinexEnabled, M("GENERAL_ENABLED")); listener->panelChanged (EvRetinexEnabled, M ("GENERAL_ENABLED"));
} else { } else {
listener->panelChanged (EvRetinexEnabled, M("GENERAL_DISABLED")); listener->panelChanged (EvRetinexEnabled, M ("GENERAL_DISABLED"));
} }
} }
} }
@@ -1312,23 +1313,23 @@ void Retinex::enabledChanged ()
void Retinex::trimValues (rtengine::procparams::ProcParams* pp) void Retinex::trimValues (rtengine::procparams::ProcParams* pp)
{ {
str->trimValue(pp->retinex.str); str->trimValue (pp->retinex.str);
scal->trimValue(pp->retinex.scal); scal->trimValue (pp->retinex.scal);
iter->trimValue(pp->retinex.iter); iter->trimValue (pp->retinex.iter);
grad->trimValue(pp->retinex.grad); grad->trimValue (pp->retinex.grad);
grads->trimValue(pp->retinex.grads); grads->trimValue (pp->retinex.grads);
neigh->trimValue(pp->retinex.neigh); neigh->trimValue (pp->retinex.neigh);
gain->trimValue(pp->retinex.gain); gain->trimValue (pp->retinex.gain);
offs->trimValue(pp->retinex.offs); offs->trimValue (pp->retinex.offs);
vart->trimValue(pp->retinex.vart); vart->trimValue (pp->retinex.vart);
limd->trimValue(pp->retinex.limd); limd->trimValue (pp->retinex.limd);
highl->trimValue(pp->retinex.highl); highl->trimValue (pp->retinex.highl);
baselog->trimValue(pp->retinex.baselog); baselog->trimValue (pp->retinex.baselog);
// grbl->trimValue(pp->retinex.grbl); // grbl->trimValue(pp->retinex.grbl);
gam->trimValue(pp->retinex.gam); gam->trimValue (pp->retinex.gam);
slope->trimValue(pp->retinex.slope); slope->trimValue (pp->retinex.slope);
highlights->trimValue(pp->retinex.highlights); highlights->trimValue (pp->retinex.highlights);
shadows->trimValue(pp->retinex.shadows); 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) 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)
@@ -1349,24 +1350,24 @@ void Retinex::colorForValue (double valX, double valY, enum ColorCaller::ElemTyp
if (callerId == 1) { // ch - main curve if (callerId == 1) { // ch - main curve
Color::hsv2rgb01(float(valX), float(valY), 0.5f, R, G, B); Color::hsv2rgb01 (float (valX), float (valY), 0.5f, R, G, B);
} else if (callerId == 2) { // cc - bottom bar } else if (callerId == 2) { // cc - bottom bar
float value = (1.f - 0.7f) * float(valX) + 0.7f; float value = (1.f - 0.7f) * float (valX) + 0.7f;
// whole hue range // whole hue range
// Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before) // Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before)
Color::hsv2rgb01(float(valY), float(valX), value, R, G, B); Color::hsv2rgb01 (float (valY), float (valX), value, R, G, B);
} else if (callerId == 3) { // lc - bottom bar } else if (callerId == 3) { // lc - bottom bar
float value = (1.f - 0.7f) * float(valX) + 0.7f; float value = (1.f - 0.7f) * float (valX) + 0.7f;
// whole hue range // whole hue range
// Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before) // Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before)
Color::hsv2rgb01(float(valY), float(valX), value, R, G, B); Color::hsv2rgb01 (float (valY), float (valX), value, R, G, B);
} else if (callerId == 4) { // LH - bottom bar } else if (callerId == 4) { // LH - bottom bar
Color::hsv2rgb01(float(valX), 0.5f, float(valY), R, G, B); Color::hsv2rgb01 (float (valX), 0.5f, float (valY), R, G, B);
} else if (callerId == 5) { // HH - bottom bar } else if (callerId == 5) { // HH - bottom bar
float h = float((valY - 0.5) * 0.3 + valX); float h = float ((valY - 0.5) * 0.3 + valX);
if (h > 1.0f) { if (h > 1.0f) {
h -= 1.0f; h -= 1.0f;
@@ -1374,12 +1375,12 @@ void Retinex::colorForValue (double valX, double valY, enum ColorCaller::ElemTyp
h += 1.0f; h += 1.0f;
} }
Color::hsv2rgb01(h, 0.5f, 0.5f, R, G, B); Color::hsv2rgb01 (h, 0.5f, 0.5f, R, G, B);
} }
caller->ccRed = double(R); caller->ccRed = double (R);
caller->ccGreen = double(G); caller->ccGreen = double (G);
caller->ccBlue = double(B); caller->ccBlue = double (B);
} }