C'tor init for (ToneCurve|Retinex|LCurve|ColorToning)Params

This commit is contained in:
Flössie
2017-11-18 19:07:23 +01:00
parent 0a9d81bc7f
commit 05505803ae
4 changed files with 226 additions and 247 deletions

View File

@@ -54,14 +54,14 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR
colorShape->setLeftBarBgGradient(milestones);
const ColorToningParams default_params;
// luminance gradient
milestones.clear();
milestones.push_back( GradientMilestone(0., 0., 0., 0.) );
milestones.push_back( GradientMilestone(1., 1., 1., 1.) );
colorShape->setBottomBarBgGradient(milestones);
std::vector<double> defaultCurve;
rtengine::ColorToningParams::getDefaultColorCurve(defaultCurve);
colorShape->setResetCurve(FCT_MinMaxCPoints, defaultCurve);
colorShape->setResetCurve(FCT_MinMaxCPoints, default_params.colorCurve);
// This will add the reset button at the end of the curveType buttons
colorCurveEditorG->curveListComplete();
@@ -88,10 +88,9 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR
opacityCurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_OPACITY"));
opacityCurveEditorG->setCurveListener (this);
rtengine::ColorToningParams::getDefaultOpacityCurve(defaultCurve);
opacityShape = static_cast<FlatCurveEditor*>(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false));
opacityShape->setIdentityValue(0.);
opacityShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve);
opacityShape->setResetCurve(FlatCurveType(default_params.opacityCurve.at(0)), default_params.opacityCurve);
opacityShape->setBottomBarBgGradient(milestones);
// This will add the reset button at the end of the curveType buttons
@@ -107,9 +106,8 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR
clCurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_CHROMAC"));
clCurveEditorG->setCurveListener (this);
rtengine::ColorToningParams::getDefaultCLCurve(defaultCurve);
clshape = static_cast<DiagonalCurveEditor*>(clCurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_AB"), irg, false));
clshape->setResetCurve(DiagonalCurveType(defaultCurve.at(0)), defaultCurve);
clshape->setResetCurve(DiagonalCurveType(default_params.clcurve.at(0)), default_params.clcurve);
clshape->setTooltip(M("TP_COLORTONING_CURVEEDITOR_CL_TOOLTIP"));
clshape->setLeftBarColorProvider(this, 1);
@@ -127,9 +125,8 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR
cl2CurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_CHROMAC"));
cl2CurveEditorG->setCurveListener (this);
rtengine::ColorToningParams::getDefaultCL2Curve(defaultCurve);
cl2shape = static_cast<DiagonalCurveEditor*>(cl2CurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_BY"), iby, false));
cl2shape->setResetCurve(DiagonalCurveType(defaultCurve.at(0)), defaultCurve);
cl2shape->setResetCurve(DiagonalCurveType(default_params.cl2curve.at(0)), default_params.cl2curve);
cl2shape->setTooltip(M("TP_COLORTONING_CURVEEDITOR_CL_TOOLTIP"));
cl2shape->setLeftBarColorProvider(this, 1);

View File

@@ -380,14 +380,15 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL")
Gtk::Grid *tranGrid = Gtk::manage (new Gtk::Grid());
setExpandAlignProperties (tranGrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
const RetinexParams default_params;
// Transmission map curve
transmissionCurveEditorG = new CurveEditorGroup (options.lastRetinexDir, M ("TP_RETINEX_TRANSMISSION"));
setExpandAlignProperties (transmissionCurveEditorG, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
transmissionCurveEditorG->setCurveListener (this);
rtengine::RetinexParams::getDefaulttransmissionCurve (defaultCurve);
transmissionShape = static_cast<FlatCurveEditor*> (transmissionCurveEditorG->addCurve (CT_Flat, "", nullptr, false, false));
transmissionShape->setIdentityValue (0.);
transmissionShape->setResetCurve (FlatCurveType (defaultCurve.at (0)), defaultCurve);
transmissionShape->setResetCurve (FlatCurveType (default_params.transmissionCurve.at (0)), default_params.transmissionCurve);
// transmissionShape->setBottomBarBgGradient(milestones);
transmissionCurveEditorG->curveListComplete();
transmissionCurveEditorG->set_tooltip_markup (M ("TP_RETINEX_TRANSMISSION_TOOLTIP"));
@@ -439,10 +440,9 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL")
gaintransmissionCurve = new CurveEditorGroup (options.lastRetinexDir, M ("TP_RETINEX_GAINTRANSMISSION"));
setExpandAlignProperties (gaintransmissionCurve, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
gaintransmissionCurve->setCurveListener (this);
rtengine::RetinexParams::getDefaultgaintransmissionCurve (defaultCurve);
gaintransmissionShape = static_cast<FlatCurveEditor*> (gaintransmissionCurve->addCurve (CT_Flat, "", nullptr, false, false));
gaintransmissionShape->setIdentityValue (0.);
gaintransmissionShape->setResetCurve (FlatCurveType (defaultCurve.at (0)), defaultCurve);
gaintransmissionShape->setResetCurve (FlatCurveType (default_params.gaintransmissionCurve.at (0)), default_params.gaintransmissionCurve);
//gaintransmissionShape->setBottomBarBgGradient(milestones);
gaintransmissionCurve->set_tooltip_markup (M ("TP_RETINEX_GAINTRANSMISSION_TOOLTIP"));
gaintransmissionCurve->curveListComplete();