From 8252ce934a852e8fb35054a01d50f469dafc3802 Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 17 Sep 2020 09:22:37 +0200 Subject: [PATCH] From banch localdenois - fixed bug exlablocal - bad behavior GUI common mask --- rtengine/iplocallab.cc | 9 ++++---- rtgui/locallabtools2.cc | 49 ++++++++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 6d73ead94..b70ddee6e 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -2421,7 +2421,7 @@ void ImProcFunctions::exlabLocal(local_params& lp, int bfh, int bfw, int bfhr, i } const bool exec = (lp.expmet == 1 && linear > 0.f && lp.laplacexp > 0.1f); - if(!exec) {//for standard exposure + if(exec) {//for standard exposure const float cexp_scale = std::pow(2.f, lp.expcomp); const float ccomp = (rtengine::max(0.f, lp.expcomp) + 1.f) * lp.hlcomp / 100.f; const float cshoulder = ((maxran / rtengine::max(1.0f, cexp_scale)) * (lp.hlcompthr / 200.f)) + 0.1f; @@ -11293,7 +11293,7 @@ void ImProcFunctions::Lab_Local( } // soft light and retinex_pde - if (lp.strng > 0.f && call <= 3 && lp.sfena) { + if (lp.strng > 1.f && call <= 3 && lp.sfena) { int ystart = rtengine::max(static_cast(lp.yc - lp.lyT) - cy, 0); int yend = rtengine::min(static_cast(lp.yc + lp.ly) - cy, original->H); int xstart = rtengine::max(static_cast(lp.xc - lp.lxL) - cx, 0); @@ -12755,8 +12755,9 @@ void ImProcFunctions::Lab_Local( } else { - - ImProcFunctions::exlabLocal(lp, bfh, bfw, bfhr, bfwr, bufexporig.get(), bufexpfin.get(), hltonecurveloc, shtonecurveloc, tonecurveloc, hueref, lumaref, chromaref); + if (lp.expcomp != 0.f) { + ImProcFunctions::exlabLocal(lp, bfh, bfw, bfhr, bfwr, bufexporig.get(), bufexpfin.get(), hltonecurveloc, shtonecurveloc, tonecurveloc, hueref, lumaref, chromaref); + } } //gradient diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index a025d5791..fd67f181f 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -5549,9 +5549,9 @@ void LocallabMask::convertParamToSimple() disableListener(); // Set hidden specific GUI widgets in Simple mode to default spot values - radmask->setValue(defSpot.radmask); - chromask->setValue(defSpot.chromask); - Lmask_shape->setCurve(defSpot.Lmask_curve); + gammask->setValue(defSpot.gammask); + slopmask->setValue(defSpot.slopmask); + //Lmask_shape->setCurve(defSpot.Lmask_curve); // Enable all listeners enableListener(); @@ -5562,21 +5562,29 @@ void LocallabMask::updateGUIToMode(const modeType new_type) switch (new_type) { case Simple: // Expert and Normal mode widgets are hidden in Simple mode - softradiusmask->hide(); + softradiusmask->show(); + toolmaskFrame->show(); struFrame->hide(); blurFrame->hide(); - toolmaskFrame->hide(); + gammask->hide(); + slopmask->hide(); + shadmask->hide(); + lapmask->hide(); + mask_HCurveEditorG->hide(); + mask2CurveEditorGwav->hide(); + csThresholdmask->hide(); + gradFramemask->hide(); break; case Normal: // Expert mode widgets are hidden in Normal mode - softradiusmask->hide(); + softradiusmask->show(); struFrame->hide(); blurFrame->hide(); lapmask->hide(); - gammask->hide(); - slopmask->hide(); + gammask->show(); + slopmask->show(); shadmask->hide(); mask_HCurveEditorG->hide(); mask2CurveEditorGwav->hide(); @@ -5589,19 +5597,20 @@ void LocallabMask::updateGUIToMode(const modeType new_type) case Expert: // Show widgets hidden in Normal and Simple mode - softradiusmask->hide(); - struFrame->hide(); - blurFrame->hide(); - toolmaskFrame->hide(); - lapmask->hide(); - gammask->hide(); - slopmask->hide(); - shadmask->hide(); - mask_HCurveEditorG->hide(); - mask2CurveEditorGwav->hide(); - csThresholdmask->hide(); - gradFramemask->hide(); + softradiusmask->show(); + struFrame->show(); + blurFrame->show(); + toolmaskFrame->show(); + lapmask->show(); + gammask->show(); + slopmask->show(); + shadmask->show(); + mask_HCurveEditorG->show(); + mask2CurveEditorGwav->show(); + csThresholdmask->show(); + gradFramemask->show(); } + } void LocallabMask::updateMaskBackground(const double normChromar, const double normLumar, const double normHuer)