From 59ca037fd75ab97a6127b7d528004661e915d970 Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Sun, 2 Sep 2018 16:58:20 +0200 Subject: [PATCH] Disable highlight recovery threshold when highlight recovery = 0 and set threshold default to 0 --- rtengine/improcfun.cc | 2 +- rtengine/procparams.cc | 2 +- rtgui/tonecurve.cc | 14 +++++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 945eaf29f..7d9d080e2 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -5466,7 +5466,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double //now tune hlcompr to bring back rawmax to 65535 - hlcomprthresh = 33; + hlcomprthresh = 0; //this is a series approximation of the actual formula for comp, //which is a transcendental equation float comp = (gain * ((float)whiteclip) / scale - 1.f) * 2.3f; // 2.3 instead of 2 to increase slightly comp diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index e7225e993..90c472290 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -330,7 +330,7 @@ ToneCurveParams::ToneCurveParams() : saturation(0), shcompr(50), hlcompr(0), - hlcomprthresh(33), + hlcomprthresh(0), histmatching(false), fromHistMatching(false), clampOOG(true) diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 30c9dadee..1354dd81b 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -111,7 +111,7 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA //----------- Highlight recovery & threshold ------------- hlcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 0)); pack_start (*hlcompr); - hlcomprthresh = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 33)); + hlcomprthresh = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 0)); pack_start (*hlcomprthresh); //----------- Black Level & Compression ------------------- @@ -232,6 +232,10 @@ void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited) if (!black->getAddMode()) { shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect } + + if (!hlcompr->getAddMode()) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } brightness->setValue (pp->toneCurve.brightness); contrast->setValue (pp->toneCurve.contrast); @@ -620,6 +624,10 @@ void ToneCurve::adjusterChanged (Adjuster* a, double newval) listener->panelChanged (EvSaturation, costr); } else if (a == hlcompr) { listener->panelChanged (EvHLCompr, costr); + + if (!hlcompr->getAddMode()) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } } else if (a == hlcomprthresh) { listener->panelChanged (EvHLComprThreshold, costr); } else if (a == shcompr) { @@ -663,6 +671,10 @@ void ToneCurve::neutral_pressed () if (!black->getAddMode()) { shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect } + + if (!hlcompr->getAddMode()) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } contrast->setValue(0); //saturation->setValue(0);