From 371add936b54b6b41df1fadf07d68bf0450bae0a Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 9 Jun 2020 13:16:34 +0200 Subject: [PATCH] Improve finer and coarser levels with maxlevels --- rtengine/ipwavelet.cc | 3 ++- rtgui/wavelet.cc | 17 +++++++++++++++-- rtgui/wavelet.h | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 5b0c8e922..87229d651 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -469,7 +469,8 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const cp.t_lsl = static_cast(params->wavelet.bllev.getTopLeft()); cp.b_rsl = static_cast(params->wavelet.bllev.getBottomRight()); cp.t_rsl = static_cast(params->wavelet.bllev.getTopRight()); - cp.numlevS = 9 - params->wavelet.threshold2; +// cp.numlevS = 9 - params->wavelet.threshold2; + cp.numlevS = params->wavelet.thres - params->wavelet.threshold2; int maxlevS = cp.numlevH; cp.numlevS = rtengine::max(cp.numlevS, maxlevS); //highlight diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index 446e62b5e..5e03b0ebb 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -1165,11 +1165,20 @@ void Wavelet::updateGUI() { const int temp2 = threshold2->getValue(); const int temp = threshold->getValue(); - const int tempmax = (temp + 1) > 9 ? 9 : temp + 1; - threshold2->setLimits(temp, 9, 1, tempmax); + const int maxlev = thres->getValue(); + const int tempmax = (temp + 1) > maxlev ? maxlev : temp + 1; + threshold2->setLimits(temp, maxlev, 1, maxlev + 1); threshold2 ->setValue(temp2); } +void Wavelet::updateGUImaxlev() +{ + const int temp4 = threshold->getValue(); + const int temp3 = thres->getValue(); + // const int tempmax = (temp3) > 9 ? 9 : temp + 1; + threshold->setLimits(1, temp3, 1, temp3); + threshold ->setValue(temp4); +} void Wavelet::wavChanged(double nlevel) @@ -1477,6 +1486,7 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited) skinprotect->setValue(pp->wavelet.skinprotect); hueskin->setValue(pp->wavelet.hueskin); hueskin2->setValue(pp->wavelet.hueskin2); + updateGUImaxlev(); threshold->setValue(pp->wavelet.threshold); updateGUI(); threshold2->setValue(pp->wavelet.threshold2); @@ -3076,6 +3086,7 @@ void Wavelet::adjusterChanged(Adjuster* a, double newval) } else if (a == threshold) { listener->panelChanged(EvWavThreshold, threshold->getTextValue()); updateGUI(); + updateGUImaxlev(); } else if (a == threshold2) { listener->panelChanged(EvWavThreshold2, threshold2->getTextValue()); @@ -3122,6 +3133,8 @@ void Wavelet::adjusterChanged(Adjuster* a, double newval) } listener->panelChanged(EvWavthres, thres->getTextValue()); + updateGUImaxlev(); + updateGUI(); } else if (a == skinprotect) { listener->panelChanged(EvWavSkin, skinprotect->getTextValue()); } else if (a == strength) { diff --git a/rtgui/wavelet.h b/rtgui/wavelet.h index 0738ae382..6daabcd67 100644 --- a/rtgui/wavelet.h +++ b/rtgui/wavelet.h @@ -142,6 +142,7 @@ private: void wavChanged(double nlevel) override; void ushamethodChanged(); void updateGUI(); + void updateGUImaxlev(); void HSmethodUpdateUI(); void CHmethodUpdateUI();