diff --git a/rtdata/languages/default b/rtdata/languages/default index 9efd1e29d..855ef24ca 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1104,6 +1104,7 @@ HISTORY_MSG_864;Local - Contrast Detail HISTORY_MSG_865;Local - Contrast Anchor HISTORY_MSG_867;Local - Contrast Amount residual HISTORY_MSG_868;Local - balance ΔE C-H +HISTORY_MSG_869;Local - denoise curve luminance HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2594,6 +2595,7 @@ TP_LOCALLAB_WARM_TOOLTIP;This slider use Ciecam algorithm and acts as White Bala TP_LOCALLAB_WAV;Levels local contrast TP_LOCALLAB_WAVCOMP;Compression by Level TP_LOCALLAB_WAVCON;Contrast by Level +TP_LOCALLAB_WAVDEN;Luminance denoise by level (0 - 4) TP_LOCALLAB_WAVE;Ψ Wavelet TP_LOCALLAB_WAVHIGH;Ψ Wavelet high TP_LOCALLAB_WAVLEV;Blur by Level diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 0addd1c5d..cbbc78148 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -927,6 +927,7 @@ void Crop::update(int todo) bool lcmasblutili = parent->lcmasblutili; bool llmasblutili = parent->llmasblutili; bool locwavutili = parent->locwavutili; + bool locwavdenutili = parent->locwavdenutili; bool loclevwavutili = parent->loclevwavutili; bool locconwavutili = parent->locconwavutili; bool loccompwavutili = parent->loccompwavutili; @@ -972,6 +973,7 @@ void Crop::update(int todo) LocwavCurve loclevwavCurve; LocwavCurve locconwavCurve; LocwavCurve loccompwavCurve; + LocwavCurve locwavCurveden; LocretigainCurverab locRETgainCurverab; locallutili = false; @@ -1015,6 +1017,7 @@ void Crop::update(int todo) loclmasCurvecolwav.Set(params.locallab.spots.at(sp).LLmaskcolcurvewav, lmasutilicolwav); locwavCurve.Set(params.locallab.spots.at(sp).locwavcurve, locwavutili); + locwavCurveden.Set(params.locallab.spots.at(sp).locwavcurveden, locwavdenutili); loclevwavCurve.Set(params.locallab.spots.at(sp).loclevwavcurve, loclevwavutili); locconwavCurve.Set(params.locallab.spots.at(sp).locconwavcurve, locconwavutili); loccompwavCurve.Set(params.locallab.spots.at(sp).loccompwavcurve, loccompwavutili); @@ -1112,6 +1115,7 @@ void Crop::update(int todo) loclevwavCurve, loclevwavutili, locconwavCurve, locconwavutili, loccompwavCurve, loccompwavutili, + locwavCurveden, locwavdenutili, LHutili, HHutili, cclocalcurve2, localcutili, rgblocalcurve2, localrgbutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, parent->locallColorMask, parent->locallColorMaskinv, parent->locallExpMask, parent->locallExpMaskinv, parent->locallSHMask, parent->locallSHMaskinv, parent->locallvibMask, parent->locallcbMask, parent->locallretiMask, parent->locallsoftMask, parent->localltmMask, parent->locallblMask, @@ -1146,6 +1150,7 @@ void Crop::update(int todo) loclevwavCurve, loclevwavutili, locconwavCurve, locconwavutili, loccompwavCurve, loccompwavutili, + locwavCurveden, locwavdenutili, LHutili, HHutili, cclocalcurve2, localcutili, rgblocalcurve2, localrgbutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); @@ -1203,7 +1208,8 @@ void Crop::update(int todo) locwavCurve.Reset(); loclevwavCurve.Reset(); locconwavCurve.Reset(); - loccompwavCurve.Reset(); + locconwavCurve.Reset(); + locwavCurveden.Reset(); loclmasCurveblwav.Reset(); loclmasCurvecolwav.Reset(); diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index adef1c550..0d12e241b 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -219,6 +219,7 @@ ImProcCoordinator::ImProcCoordinator() : lhmascbutili(false), llmascbutili(false), locwavutili(false), + locwavdenutili(false), loclevwavutili(false), locconwavutili(false), loccompwavutili(false), @@ -1082,6 +1083,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) llmasblutili = false; lcmasutili = false; locwavutili = false; + locwavdenutili = false; loclevwavutili = false; locconwavutili = false; loccompwavutili = false; @@ -1123,6 +1125,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) loclevwavCurve.Set(params->locallab.spots.at(sp).loclevwavcurve, loclevwavutili); locconwavCurve.Set(params->locallab.spots.at(sp).locconwavcurve, locconwavutili); loccompwavCurve.Set(params->locallab.spots.at(sp).loccompwavcurve, loccompwavutili); + locwavCurveden.Set(params->locallab.spots.at(sp).locwavcurveden, locwavdenutili); CurveFactory::curveLocal(locallutili, params->locallab.spots.at(sp).llcurve, lllocalcurve, sca); CurveFactory::curveLocal(localclutili, params->locallab.spots.at(sp).clcurve, cllocalcurve, sca); CurveFactory::curveLocal(locallcutili, params->locallab.spots.at(sp).lccurve, lclocalcurve, sca); @@ -1151,9 +1154,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) // Reference parameters computation if (params->locallab.spots.at(sp).spotMethod == "exc") { - ipf.calc_ref(sp, reserv, reserv, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge); + ipf.calc_ref(sp, reserv, reserv, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili); } else { - ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge); + ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili); } /* @@ -1233,6 +1236,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) loclevwavCurve, loclevwavutili, locconwavCurve, locconwavutili, loccompwavCurve, loccompwavutili, + locwavCurveden, locwavdenutili, LHutili, HHutili, cclocalcurve, localcutili, rgblocalcurve, localrgbutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerblu, chromarblu, lumarblu, huer, chromar, lumar, sobeler, lastsav, locallColorMask, locallColorMaskinv, locallExpMask, locallExpMaskinv, locallSHMask, locallSHMaskinv, locallvibMask, locallcbMask, locallretiMask, locallsoftMask, localltmMask, locallblMask, @@ -1272,6 +1276,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) loclevwavCurve, loclevwavutili, locconwavCurve, locconwavutili, loccompwavCurve, loccompwavutili, + locwavCurveden, locwavdenutili, LHutili, HHutili, cclocalcurve, localcutili, rgblocalcurve, localrgbutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerblu, chromarblu, lumarblu, huer, chromar, lumar, sobeler, lastsav, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); @@ -1281,9 +1286,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) //recalculate references after if (params->locallab.spots.at(sp).spotMethod == "exc") { - ipf.calc_ref(sp, reserv, reserv, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huer, chromar, lumar, sobeler, avg); + ipf.calc_ref(sp, reserv, reserv, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huer, chromar, lumar, sobeler, avg, locwavCurveden, locwavdenutili); } else { - ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huer, chromar, lumar, sobeler, avg); + ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huer, chromar, lumar, sobeler, avg, locwavCurveden, locwavdenutili); } if (sp == params->locallab.selspot && params->locallab.spots.at(sp).recurs) { @@ -1351,7 +1356,8 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) locwavCurve.Reset(); loclevwavCurve.Reset(); locconwavCurve.Reset(); - loccompwavCurve.Reset(); + locwavCurveden.Reset(); + locwavCurve.Reset(); loclmasCurveblwav.Reset(); loclmasCurvecolwav.Reset(); } diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index fb8ff3d9a..ea31db06e 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -287,6 +287,7 @@ protected: LocwavCurve loclevwavCurve; LocwavCurve locconwavCurve; LocwavCurve loccompwavCurve; + LocwavCurve locwavCurveden; bool locallutili; bool localclutili; @@ -328,6 +329,7 @@ protected: bool lhmasblutili; bool llmasblutili; bool locwavutili; + bool locwavdenutili; bool loclevwavutili; bool locconwavutili; bool loccompwavutili; diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index cedbd5241..d73fa467e 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -271,7 +271,7 @@ public: float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, float balance, float balanceh, float lumask); - void calc_ref(int sp, LabImage* original, LabImage* transformed, int cx, int cy, int oW, int oH, int sk, double &huerefblur, double &chromarefblur, double &lumarefblur, double &hueref, double &chromaref, double &lumaref, double &sobelref, float &avg); + void calc_ref(int sp, LabImage* original, LabImage* transformed, int cx, int cy, int oW, int oH, int sk, double &huerefblur, double &chromarefblur, double &lumarefblur, double &hueref, double &chromaref, double &lumaref, double &sobelref, float &avg, const LocwavCurve & locwavCurveden, bool & locwavdenutili); void copy_ref(LabImage* spotbuffer, LabImage* original, LabImage* transformed, int cx, int cy, int sk, const struct local_params & lp, double &huerefspot, double &chromarefspot, double &lumarefspot); void paste_ref(LabImage* spotbuffer, LabImage* transformed, int cx, int cy, int sk, const struct local_params & lp); void Lab_Local(int call, int sp, float** shbuffer, LabImage* original, LabImage* transformed, LabImage* reserved, LabImage* lastorig, int cx, int cy, int oW, int oH, int sk, const LocretigainCurve & locRETgainCcurve, const LocretitransCurve &locRETtransCcurve, @@ -301,6 +301,7 @@ public: const LocwavCurve & loclevwavCurve, bool & loclevwavutili, const LocwavCurve & locconwavCurve, bool & locconwavutili, const LocwavCurve & loccompwavCurve, bool & loccompwavutili, + const LocwavCurve & locwavCurveden, bool & locwavdenutili, bool &LHutili, bool &HHutili, LUTf & cclocalcurve, bool & localcutili, LUTf & rgblocalcurve, bool & localrgbutili, bool & localexutili, LUTf & exlocalcurve, LUTf & hltonecurveloc, LUTf & shtonecurveloc, LUTf & tonecurveloc, LUTf & lightCurveloc, double & huerefblur, double &chromarefblur, double & lumarefblur, double &hueref, double &chromaref, double &lumaref, double &sobelref, int &lastsav, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 92538fb1f..cd95baaa0 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -498,7 +498,7 @@ static void SobelCannyLuma(float **sobelL, float **luma, int bfw, int bfh, float -static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locallab, struct local_params& lp, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask) +static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locallab, struct local_params& lp, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, const LocwavCurve & locwavCurveden, bool & locwavdenutili) { int w = oW; int h = oH; @@ -712,10 +712,37 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.shapmet = 1; } - float local_noiself = (float)locallab.spots.at(sp).noiselumf; - float local_noiself0 = (float)locallab.spots.at(sp).noiselumf0; - float local_noiself2 = (float)locallab.spots.at(sp).noiselumf2; - float local_noiselc = (float)locallab.spots.at(sp).noiselumc; + lp.denoiena = locallab.spots.at(sp).expdenoi; + + bool wavcurveden = false; + float local_noiself = 0.f; + float local_noiself0 = 0.f; + float local_noiself2 = 0.f; + float local_noiselc = 0.f; + + if (locwavCurveden && locwavdenutili) { + if (lp.denoiena) { + for (int i = 0; i < 500; i++) { + if (locwavCurveden[i] != 0.) { + wavcurveden = true; + } + } + } + } + + if (wavcurveden) { + if (lp.denoiena) { + local_noiself0 = 150.f * locwavCurveden[0]; + local_noiself = 150.f * locwavCurveden[166]; + local_noiself2 = 150.f * locwavCurveden[323]; + local_noiselc = 100.f * locwavCurveden[500]; + } + } + +// float local_noiself = (float)locallab.spots.at(sp).noiselumf; +// float local_noiself0 = (float)locallab.spots.at(sp).noiselumf0; +// float local_noiself2 = (float)locallab.spots.at(sp).noiselumf2; +// float local_noiselc = (float)locallab.spots.at(sp).noiselumc; float local_noiseldetail = (float)locallab.spots.at(sp).noiselumdetail; int local_noiselequal = locallab.spots.at(sp).noiselequal; float local_noisechrodetail = (float)locallab.spots.at(sp).noisechrodetail; @@ -1071,7 +1098,6 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lcena = locallab.spots.at(sp).expcontrast; lp.sfena = locallab.spots.at(sp).expsoft; lp.cbdlena = locallab.spots.at(sp).expcbdl && llExpMask == 0 && llSHMask == 0 && llretiMask == 0 && llColorMask == 0 && lltmMask == 0 && llvibMask == 0; - lp.denoiena = locallab.spots.at(sp).expdenoi; lp.expvib = locallab.spots.at(sp).expvibrance; lp.sensv = local_sensiv; lp.past = chromaPastel; @@ -5551,12 +5577,12 @@ void ImProcFunctions::InverseColorLight_Local(bool tonequ, bool tonecurv, int sp } -void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transformed, int cx, int cy, int oW, int oH, int sk, double & huerefblur, double & chromarefblur, double & lumarefblur, double & hueref, double & chromaref, double & lumaref, double & sobelref, float & avg) +void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transformed, int cx, int cy, int oW, int oH, int sk, double & huerefblur, double & chromarefblur, double & lumarefblur, double & hueref, double & chromaref, double & lumaref, double & sobelref, float & avg, const LocwavCurve & locwavCurveden, bool & locwavdenutili) { if (params->locallab.enabled) { //always calculate hueref, chromaref, lumaref before others operations use in normal mode for all modules exceprt denoise struct local_params lp; - calcLocalParams(sp, oW, oH, params->locallab, lp, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + calcLocalParams(sp, oW, oH, params->locallab, lp, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, locwavCurveden, locwavdenutili); int begy = lp.yc - lp.lyT; int begx = lp.xc - lp.lxL; int yEn = lp.yc + lp.ly; @@ -7698,7 +7724,6 @@ void ImProcFunctions::DeNoise(int call, int del, float * slidL, float * slida, f bool execbdl = (lp.mulloc[0] != 1.f || lp.mulloc[1] != 1.f || lp.mulloc[2] != 1.f || lp.mulloc[3] != 1.f || lp.mulloc[4] != 1.f || lp.mulloc[5] != 1.f) ;//only if user want cbdl bool execdenoi = noiscfactiv && ((lp.colorena && execcolor) || (lp.tonemapena && lp.strengt != 0.f) || (lp.cbdlena && execbdl) || (lp.sfena && lp.strng > 0.f) || (lp.lcena && lp.lcamount > 0.f) || (lp.sharpena && lp.shrad > 0.42) || (lp.retiena && lp.str > 0.f) || (lp.exposena && lp.expcomp != 0.f) || (lp.expvib && lp.past != 0.f)); - if (((lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f || lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4 || aut == 1 || aut == 2) && lp.denoiena) || execdenoi) { // sk == 1 ?? @@ -9025,6 +9050,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o const LocwavCurve & loclevwavCurve, bool & loclevwavutili, const LocwavCurve & locconwavCurve, bool & locconwavutili, const LocwavCurve & loccompwavCurve, bool & loccompwavutili, + const LocwavCurve & locwavCurveden, bool & locwavdenutili, bool & LHutili, bool & HHutili, LUTf & cclocalcurve, bool & localcutili, LUTf & rgblocalcurve, bool & localrgbutili, bool & localexutili, LUTf & exlocalcurve, LUTf & hltonecurveloc, LUTf & shtonecurveloc, LUTf & tonecurveloc, LUTf & lightCurveloc, double & huerefblur, double & chromarefblur, double & lumarefblur, double & hueref, double & chromaref, double & lumaref, double & sobelref, int &lastsav, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, @@ -9043,7 +9069,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int del = 3; // to avoid crash with [loy - begy] and [lox - begx] and bfh bfw // with gtk2 [loy - begy-1] [lox - begx -1 ] and del = 1 int delxy = 0; struct local_params lp; - calcLocalParams(sp, oW, oH, params->locallab, lp, llColorMask, llColorMaskinv, llExpMask, llExpMaskinv, llSHMask, llSHMaskinv, llvibMask, llcbMask, llretiMask, llsoftMask, lltmMask, llblMask); + calcLocalParams(sp, oW, oH, params->locallab, lp, llColorMask, llColorMaskinv, llExpMask, llExpMaskinv, llSHMask, llSHMaskinv, llvibMask, llcbMask, llretiMask, llsoftMask, lltmMask, llblMask, locwavCurveden, locwavdenutili); const float radius = lp.rad / (sk * 1.4f); //0 to 70 ==> see skip int strred = 1;//(lp.strucc - 1); @@ -9174,7 +9200,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } } @@ -9923,7 +9949,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } } else if (lp.blurmet == 1) { @@ -9933,7 +9959,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } } @@ -9987,7 +10013,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } @@ -10003,7 +10029,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } @@ -10228,7 +10254,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } } @@ -10451,7 +10477,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } } @@ -10682,7 +10708,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } } @@ -10888,7 +10914,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } } else if (lp.invsh && (lp.highlihs > 0.f || lp.shadowhs > 0.f || tonequ || tonecurv || lp.showmaskSHmetinv == 1 || lp.enaSHMaskinv) && call < 3 && lp.hsena) { @@ -10982,7 +11008,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } @@ -11074,7 +11100,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } } @@ -11447,7 +11473,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } } @@ -11492,7 +11518,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } else if (lp.invshar && lp.shrad > 0.42 && call < 3 && lp.sharpena && sk == 1) { @@ -11508,7 +11534,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge,locwavCurveden, locwavdenutili ); } } @@ -11563,7 +11589,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } } @@ -11781,7 +11807,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } else { @@ -11896,7 +11922,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } else { // @@ -12163,7 +12189,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } else { @@ -12277,7 +12303,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } else { // @@ -12692,7 +12718,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } @@ -12789,7 +12815,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } @@ -14302,7 +14328,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } @@ -14422,7 +14448,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); float avge; - calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge); + calc_ref(sp, original, transformed, 0, 0, original->W, original->H, sk, huerefblur, chromarefblur, lumarefblur, hueref, chromaref, lumaref, sobelref, avge, locwavCurveden, locwavdenutili); } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 0951cfc62..e6154c7b1 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -894,6 +894,7 @@ enum ProcEventCode { EvlocallabwavCurvecomp = 865, Evlocallabfatres = 866, EvLocallabSpotbalanh = 867, + EvlocallabwavCurveden = 868, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 698125b36..8f5090fa0 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2779,6 +2779,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : bilateral(0), sensiden(20), detailthr(0), + locwavcurveden{(double)FCT_MinMaxCPoints, 0.0, 0.0, 0.0, 0.35, 0.5, 0., 0.35, 0.35, 1.0, 0.0, 0.35, 0.35}, //log encoding explog(false), autocompute(false), @@ -3183,6 +3184,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && bilateral == other.bilateral && sensiden == other.sensiden && detailthr == other.detailthr + && locwavcurveden == other.locwavcurveden //log encoding && expdenoi == other.expdenoi && autocompute == other.autocompute @@ -4553,6 +4555,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).bilateral, "Locallab", "Bilateral_" + std::to_string(i), spot.bilateral, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensiden, "Locallab", "Sensiden_" + std::to_string(i), spot.sensiden, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).detailthr, "Locallab", "Detailthr_" + std::to_string(i), spot.detailthr, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).locwavcurveden, "Locallab", "LocwavCurveden_" + std::to_string(i), spot.locwavcurveden, keyFile); //log encoding saveToKeyfile(!pedited || pedited->locallab.spots.at(i).explog, "Locallab", "Explog_" + std::to_string(i), spot.explog, keyFile); @@ -6089,6 +6092,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Bilateral_" + std::to_string(i), pedited, spot.bilateral, spotEdited.bilateral); assignFromKeyfile(keyFile, "Locallab", "Sensiden_" + std::to_string(i), pedited, spot.sensiden, spotEdited.sensiden); assignFromKeyfile(keyFile, "Locallab", "Detailthr_" + std::to_string(i), pedited, spot.detailthr, spotEdited.detailthr); + assignFromKeyfile(keyFile, "Locallab", "LocwavCurveden_" + std::to_string(i), pedited, spot.locwavcurveden, spotEdited.locwavcurveden); //log encoding assignFromKeyfile(keyFile, "Locallab", "Explog_" + std::to_string(i), pedited, spot.explog, spotEdited.explog); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 9b7224114..b7813891a 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1323,6 +1323,7 @@ struct LocallabParams { int bilateral; int sensiden; int detailthr; + std::vector locwavcurveden; //log encoding bool explog; bool autocompute; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 3325be9bf..4e045aafc 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -897,7 +897,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabfatanch LUMINANCECURVE, //EvlocallabwavCurvecomp LUMINANCECURVE, //Evlocallabfatres - LUMINANCECURVE //EvLocallabSpotbalanh + LUMINANCECURVE, //EvLocallabSpotbalanh + LUMINANCECURVE // EvlocallabwavCurveden }; namespace rtengine diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 2d0d4c356..3dacd44a2 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1119,6 +1119,7 @@ private: LocwavCurve loclevwavCurve; LocwavCurve locconwavCurve; LocwavCurve loccompwavCurve; + LocwavCurve locwavCurveden; LUTf lllocalcurve(65536, 0); LUTf lclocalcurve(65536, 0); LUTf cllocalcurve(65536, 0); @@ -1193,6 +1194,7 @@ private: bool lhmasblutili = false; bool llmasblutili = false; bool locwavutili = false; + bool locwavdenutili = false; bool loclevwavutili = false; bool locconwavutili = false; bool loccompwavutili = false; @@ -1231,6 +1233,7 @@ private: loclmasCurvecolwav.Set(params.locallab.spots.at(sp).LLmaskcolcurvewav, lmasutilicolwav); locwavCurve.Set(params.locallab.spots.at(sp).locwavcurve, locwavutili); + locwavCurveden.Set(params.locallab.spots.at(sp).locwavcurveden, locwavdenutili); loclevwavCurve.Set(params.locallab.spots.at(sp).loclevwavcurve, loclevwavutili); locconwavCurve.Set(params.locallab.spots.at(sp).locconwavcurve, locconwavutili); loccompwavCurve.Set(params.locallab.spots.at(sp).loccompwavcurve, loccompwavutili); @@ -1265,9 +1268,9 @@ private: int lastsav; float avge; if (params.locallab.spots.at(sp).spotMethod == "exc") { - ipf.calc_ref(sp, reservView, reservView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge); + ipf.calc_ref(sp, reservView, reservView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili); } else { - ipf.calc_ref(sp, labView, labView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge); + ipf.calc_ref(sp, labView, labView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili); } CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lumare, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, avge, @@ -1308,6 +1311,7 @@ private: loclevwavCurve, loclevwavutili, locconwavCurve, locconwavutili, loccompwavCurve, loccompwavutili, + locwavCurveden, locwavdenutili, LHutili, HHutili, cclocalcurve, localcutili, rgblocalcurve, localrgbutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); @@ -1315,9 +1319,9 @@ private: lastorigView->CopyFrom(labView); if (params.locallab.spots.at(sp).spotMethod == "exc") { - ipf.calc_ref(sp, reservView, reservView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge); + ipf.calc_ref(sp, reservView, reservView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili); } else { - ipf.calc_ref(sp, labView, labView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge); + ipf.calc_ref(sp, labView, labView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili); } // Clear local curves diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index bcda0bc98..2cd3ef1cd 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -363,7 +363,11 @@ Locallab::Locallab(): CCmaskcbshape(static_cast(maskcbCurveEditorG->addCurve(CT_Flat, "C(C)", nullptr, false, false))), LLmaskcbshape(static_cast(maskcbCurveEditorG->addCurve(CT_Flat, "L(L)", nullptr, false, false))), HHmaskcbshape(static_cast(maskcbCurveEditorG->addCurve(CT_Flat, "LC(H)", nullptr, false, true))), + //Denoise + LocalcurveEditorwavden(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVDEN"))), + wavshapeden(static_cast(LocalcurveEditorwavden->addCurve(CT_Flat, "", nullptr, false, false))), + // Adjuster widgets // Color & Light lightness(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LIGHTNESS"), -100, 500, 1, 0))), @@ -3476,6 +3480,18 @@ pe(nullptr) expdenoi->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expdenoi)); enabledenoiConn = expdenoi->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expdenoi)); + LocalcurveEditorwavden->setCurveListener(this); + + wavshapeden->setIdentityValue(0.); + wavshapeden->setResetCurve(FlatCurveType(defSpot.locwavcurveden.at(0)), defSpot.locwavcurveden); + + if (showtooltip) { +// wavshape->setTooltip(M("TP_RETINEX_WAV_TOOLTIP")); + } + + LocalcurveEditorwavden->curveListComplete(); + + noiselumf->setAdjusterListener(this); noiselumf0->setAdjusterListener(this); noiselumf2->setAdjusterListener(this); @@ -3518,10 +3534,11 @@ pe(nullptr) ToolParamBlock* const denoisBox = Gtk::manage(new ToolParamBlock()); Gtk::Frame* const wavFrame = Gtk::manage(new Gtk::Frame()); ToolParamBlock* const wavBox = Gtk::manage(new ToolParamBlock()); - wavBox->pack_start(*noiselumf0); - wavBox->pack_start(*noiselumf); - wavBox->pack_start(*noiselumf2); - wavBox->pack_start(*noiselumc); + wavBox->pack_start(*LocalcurveEditorwavden, Gtk::PACK_SHRINK, 4); +// wavBox->pack_start(*noiselumf0); +// wavBox->pack_start(*noiselumf); +// wavBox->pack_start(*noiselumf2); +// wavBox->pack_start(*noiselumc); wavBox->pack_start(*noiselumdetail); wavBox->pack_start(*noiselequal); wavBox->pack_start(*noisechrof); @@ -3628,6 +3645,7 @@ Locallab::~Locallab() delete LocalcurveEditorgainT; delete LocalcurveEditorwav; delete LocalcurveEditorwavlev; + delete LocalcurveEditorwavden; delete LocalcurveEditorwavcon; delete LocalcurveEditorwavcomp; delete masktmCurveEditorG; @@ -5175,6 +5193,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).bilateral = bilateral->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).sensiden = sensiden->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).detailthr = detailthr->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).locwavcurveden = wavshapeden->getCurve(); //log encoding pp->locallab.spots.at(pp->locallab.selspot).explog = explog->getEnabled(); @@ -5567,6 +5586,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pe->locallab.spots.at(pp->locallab.selspot).bilateral = pe->locallab.spots.at(pp->locallab.selspot).bilateral || bilateral->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).sensiden = pe->locallab.spots.at(pp->locallab.selspot).sensiden || sensiden->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).detailthr = pe->locallab.spots.at(pp->locallab.selspot).detailthr || detailthr->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).locwavcurveden = pe->locallab.spots.at(pp->locallab.selspot).locwavcurveden || !wavshapeden->isUnChanged(); //log encoding pe->locallab.spots.at(pp->locallab.selspot).explog = pe->locallab.spots.at(pp->locallab.selspot).explog || !explog->get_inconsistent(); @@ -5961,6 +5981,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pedited->locallab.spots.at(pp->locallab.selspot).bilateral = pedited->locallab.spots.at(pp->locallab.selspot).bilateral || bilateral->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).sensiden = pedited->locallab.spots.at(pp->locallab.selspot).sensiden || sensiden->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).detailthr = pedited->locallab.spots.at(pp->locallab.selspot).detailthr || detailthr->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).locwavcurveden = pedited->locallab.spots.at(pp->locallab.selspot).locwavcurveden || !wavshapeden->isUnChanged(); //log encoding pedited->locallab.spots.at(pp->locallab.selspot).explog = pedited->locallab.spots.at(pp->locallab.selspot).explog || !explog->get_inconsistent(); @@ -6416,9 +6437,24 @@ void Locallab::curveChanged(CurveEditor* ce) } } + //denoise + if (getEnabled() && expdenoi->getEnabled()) { + + if (ce == wavshapeden) { + if (listener) { + listener->panelChanged(EvlocallabwavCurveden, M("HISTORY_CUSTOMCURVE")); + } + } + + } + } + + + + void Locallab::localcontMethodChanged() { if (localcontMethod->get_active_row_number() == 0) { @@ -11756,6 +11792,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con bilateral->setValue(pp->locallab.spots.at(index).bilateral); sensiden->setValue(pp->locallab.spots.at(index).sensiden); detailthr->setValue(pp->locallab.spots.at(index).detailthr); + wavshapeden->setCurve(pp->locallab.spots.at(index).locwavcurveden); if (complexsoft == 2) { noiselumf->setValue(0); @@ -12221,6 +12258,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con bilateral->setEditedState(spotState->bilateral ? Edited : UnEdited); sensiden->setEditedState(spotState->sensiden ? Edited : UnEdited); detailthr->setEditedState(spotState->detailthr ? Edited : UnEdited); + wavshapeden->setUnChanged(!spotState->locwavcurveden); //log encoding explog->set_inconsistent(!spotState->explog); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 9a59c779e..72ab3aa09 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -181,6 +181,10 @@ private: FlatCurveEditor* const LLmaskcbshape; FlatCurveEditor* const HHmaskcbshape; + //Denoise + CurveEditorGroup* const LocalcurveEditorwavden; + FlatCurveEditor* const wavshapeden; + // Adjuster widgets // Color & Light Adjuster* const lightness; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 3ab734806..bfc729a3d 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1319,6 +1319,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).bilateral = locallab.spots.at(j).bilateral && pSpot.bilateral == otherSpot.bilateral; locallab.spots.at(j).sensiden = locallab.spots.at(j).sensiden && pSpot.sensiden == otherSpot.sensiden; locallab.spots.at(j).detailthr = locallab.spots.at(j).detailthr && pSpot.detailthr == otherSpot.detailthr; + locallab.spots.at(j).locwavcurveden = locallab.spots.at(j).locwavcurveden && pSpot.locwavcurveden == otherSpot.locwavcurveden; //log encoding locallab.spots.at(j).explog = locallab.spots.at(j).explog && pSpot.explog == otherSpot.explog; @@ -4219,6 +4220,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).detailthr = mods.locallab.spots.at(i).detailthr; } + if (locallab.spots.at(i).locwavcurveden) { + toEdit.locallab.spots.at(i).locwavcurveden = mods.locallab.spots.at(i).locwavcurveden; + } + //log encoding if (locallab.spots.at(i).explog) { toEdit.locallab.spots.at(i).explog = mods.locallab.spots.at(i).explog; @@ -5601,6 +5606,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : bilateral(v), sensiden(v), detailthr(v), + locwavcurveden(v), //log encoding explog(v), autocompute(v), @@ -5990,6 +5996,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) bilateral = v; sensiden = v; detailthr = v; + locwavcurveden = v; //log encoding explog = v; autocompute = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index e76d09e20..4515a68bc 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -749,6 +749,7 @@ public: bool bilateral; bool sensiden; bool detailthr; + bool locwavcurveden; //log encoding bool explog;