diff --git a/rtdata/languages/default b/rtdata/languages/default index f783845ca..7ded1c447 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -354,6 +354,7 @@ HISTORY_MSG_162;Tone Mapping HISTORY_MSG_163;RGB Curves - R HISTORY_MSG_164;RGB Curves - G HISTORY_MSG_165;RGB Curves - B +HISTORY_MSG_166;Neutral levels HISTORY_NEWSNAPSHOTAS;As... HISTORY_NEWSNAPSHOT;Add HISTORY_NEWSSDIALOGLABEL;Label of the snapshot: @@ -835,9 +836,11 @@ TP_EQUALIZER_LARGEST;coarsest TP_EQUALIZER_NEUTRAL;Neutral TP_EXPOSCORR_LABEL;Raw white-black point TP_EXPOSURE_AUTOLEVELS;Auto Levels +TP_EXPOSURE_AUTOLEVELS_TIP;Toggle execution of Auto Levels to automatically set parameter values based on image analysis TP_EXPOSURE_BLACKLEVEL;Black TP_EXPOSURE_BRIGHTNESS;Brightness TP_EXPOSURE_CLIP;Clip +TP_EXPOSURE_CLIP_TIP;The fraction of pixels to be clipped in auto levels operation TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD;Highlight recovery threshold TP_EXPOSURE_COMPRHIGHLIGHTS;Highlight recovery amount TP_EXPOSURE_COMPRSHADOWS;Shadow recovery @@ -917,6 +920,8 @@ TP_LENSGEOM_LABEL;Lens / Geometry TP_LUMADENOISE_EDGETOLERANCE;Edge Tolerance TP_LUMADENOISE_LABEL;Luminance Noise Reduction TP_LUMADENOISE_RADIUS;Radius +TP_NEUTRAL;Neutral +TP_NEUTRAL_TIP;Reset exposure controls to neutral values TP_PERSPECTIVE_HORIZONTAL;Horizontal TP_PERSPECTIVE_LABEL;Perspective TP_PERSPECTIVE_VERTICAL;Vertical diff --git a/rtengine/procevents.h b/rtengine/procevents.h index d3d1bae11..353215f3e 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -187,7 +187,8 @@ enum ProcEvent { EvRGBrCurve=162, EvRGBgCurve=163, EvRGBbCurve=164, - NUMOFEVENTS=165 + EvNeutralExp=165, + NUMOFEVENTS=166 }; } #endif diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 9a747daf9..42858e9da 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -184,7 +184,8 @@ SHARPENING, // EvEPDReweightingIterates SHARPENING, // EvEPDEnabled RGBCURVE, // EvRGBrCurve RGBCURVE, // EvRGBgCurve -RGBCURVE // EvRGBbCurve +RGBCURVE, // EvRGBbCurve +RGBCURVE // EvNeutralExp }; diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 86e0d4234..c35b34767 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -32,6 +32,7 @@ ToneCurve::ToneCurve () : Gtk::VBox(), FoldableToolPanel(this) { abox->set_border_width (2); autolevels = Gtk::manage (new Gtk::ToggleButton (M("TP_EXPOSURE_AUTOLEVELS"))); + autolevels->set_tooltip_markup (M("TP_EXPOSURE_AUTOLEVELS_TIP")); autoconn = autolevels->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::autolevels_toggled) ); sclip = Gtk::manage (new MySpinButton ()); @@ -39,9 +40,18 @@ ToneCurve::ToneCurve () : Gtk::VBox(), FoldableToolPanel(this) { sclip->set_increments (0.001, 0.01); sclip->set_value (0.002); sclip->set_digits (4); + sclip->set_tooltip_text (M("TP_EXPOSURE_CLIP_TIP")); sclip->signal_value_changed().connect( sigc::mem_fun(*this, &ToneCurve::clip_changed) ); + neutral = Gtk::manage (new Gtk::Button (M("TP_NEUTRAL"))); + neutral->set_tooltip_text (M("TP_NEUTRAL_TIP")); + neutralconn = neutral->signal_pressed().connect( sigc::mem_fun(*this, &ToneCurve::neutral_pressed) ); + neutral->show(); + abox->pack_start (*autolevels); + // pack_end is used for these controls as autolevels is replaceable using pack_start in batchmode + abox->pack_end (*neutral); + abox->pack_end (*Gtk::manage (new Gtk::Label (" "))); //spacer abox->pack_end (*sclip); abox->pack_end (*Gtk::manage (new Gtk::Label (M("TP_EXPOSURE_CLIP")))); pack_start (*abox); @@ -242,6 +252,35 @@ void ToneCurve::adjusterChanged (Adjuster* a, double newval) { listener->panelChanged (EvSHCompr, costr); } +void ToneCurve::neutral_pressed () { +// This method deselects auto levels +// and sets neutral values to params in exposure panel + + if (batchMode) { + autolevels->set_inconsistent (false); + autoconn.block (true); + autolevels->set_active (false); + autoconn.block (false); + + lastAuto = autolevels->get_active (); + } + else { //!batchMode + autolevels->set_active (false); + autolevels->set_inconsistent (false); + } + + expcomp->setValue(0); + hlcompr->setValue(0); + hlcomprthresh->setValue(0); + brightness->setValue(0); + black->setValue(0); + shcompr->setValue(0); + if (!black->getAddMode()) shcompr->set_sensitive(!((int)black->getValue ()==0)); //at black=0 shcompr value has no effect + contrast->setValue(0); + //saturation->setValue(0); + + listener->panelChanged (EvNeutralExp, M("GENERAL_ENABLED")); +} void ToneCurve::autolevels_toggled () { if (batchMode) { @@ -370,6 +409,7 @@ void ToneCurve::setBatchMode (bool batchMode) { removeIfThere (abox, autolevels, false); autolevels = Gtk::manage (new Gtk::CheckButton (M("TP_EXPOSURE_AUTOLEVELS"))); + autolevels->set_tooltip_markup (M("TP_EXPOSURE_AUTOLEVELS_TIP")); autoconn = autolevels->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::autolevels_toggled) ); abox->pack_start (*autolevels); diff --git a/rtgui/tonecurve.h b/rtgui/tonecurve.h index 768cbbf64..cc93e2c6c 100644 --- a/rtgui/tonecurve.h +++ b/rtgui/tonecurve.h @@ -33,6 +33,7 @@ class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableTool Gtk::HBox* abox; Gtk::ToggleButton* autolevels; MySpinButton* sclip; + Gtk::Button* neutral; Adjuster* expcomp; Adjuster* brightness; Adjuster* black; @@ -43,7 +44,7 @@ class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableTool Adjuster* saturation; bool clipDirty, lastAuto; - sigc::connection autoconn; + sigc::connection autoconn, neutralconn; CurveEditorGroup* curveEditorG; DiagonalCurveEditor* shape; @@ -68,6 +69,7 @@ class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableTool void adjusterChanged (Adjuster* a, double newval); + void neutral_pressed (); void autolevels_toggled (); void clip_changed (); bool clip_changed_ ();