diff --git a/rtdata/languages/default b/rtdata/languages/default index aabac4c05..241b9c237 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1033,6 +1033,7 @@ HISTORY_MSG_792;Local - Mask Luminance Background HISTORY_MSG_793;Local - SH TRC gamma HISTORY_MSG_794;Local - SH TRC slope HISTORY_MSG_795;Local - Mask save restore image +HISTORY_MSG_796;Local - Recursive references HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2202,6 +2203,7 @@ TP_LOCALLAB_EXCLUF_TOOLTIP;Can be used to exclude this part of datas - move Scop TP_LOCALLAB_LABGRID_VALUES;High(a)=%1 High(b)=%2\nLow(a)=%3 Low(b)=%4 TP_LOCALLAB_LABGRID;Color correction grid TP_LOCALLAB_LEVELWAV_TOOLTIP;The Level is automatically adapted to the size of the spot and the preview.\nFrom level 9 size max 512 to level 1 size max = 4 +TP_LOCALLAB_RECURS;Recursive references TP_LOCALLAB_SATUR;Saturation TP_LOCALLAB_SENSIDEN;Scope TP_LOCALLAB_SENSIEXCLU;Scope diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 7a5b9d260..a44bff2a9 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -1118,9 +1118,14 @@ 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, huere, chromare, lumare, sobelre, avg); + ipf.calc_ref(sp, reserv, reserv, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huer, chromar, lumar, sobeler, avg); } else { - ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avg); + ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huer, chromar, lumar, sobeler, avg); + } + if (sp == params->locallab.selspot && params->locallab.spots.at(sp).recurs) { + if (locallListener) { + locallListener->refChanged(huer, lumar, chromar); + } } lllocalcurve.clear(); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index abe12884c..de402f5d0 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -7345,6 +7345,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o levred = 7; noiscfactiv = false; } + //lastsav for save restore image lastsav = 0; @@ -8069,10 +8070,22 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (tmp1.get()) { BlurNoise_Local(tmp1.get(), originalmaskbl, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); + + 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); + } } } else if (lp.blurmet == 1) { if (tmp1.get()) { InverseBlurNoise_Local(originalmaskbl, bufchroi, lp, hueref, chromaref, lumaref, original, transformed, tmp1.get(), cx, cy, sk); + + 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); + } } } @@ -8121,6 +8134,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } DeNoise_Local(call, lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, *(bufwv.get()), cx, cy, sk); + + 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); + } } //local denoise @@ -8131,6 +8150,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (lp.denoiena) { DeNoise(call, del, slidL, slida, slidb, aut, noiscfactiv, lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, cx, cy, sk); + + 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); + } } if (denoiz || blurz || lp.denoiena || lp.blurena) { @@ -8346,6 +8371,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } transit_shapedetect(7, loctemp.get(), nullptr, buflight, bufchrom, nullptr, nullptr, nullptr, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); + + 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); + } } } } @@ -8410,6 +8441,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o bufexpfin.reset(); transit_shapedetect(2, bufexporig.get(), nullptr, buflight, bufl_ab, nullptr, nullptr, nullptr, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); + + 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); + } } } } @@ -8647,6 +8684,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o transit_shapedetect(8, tmp1.get(), originalmasktm.get(), buflight, bufchro, nullptr, nullptr, nullptr, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); bufgb.reset(); + + 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); + } } } } @@ -8834,6 +8877,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } transit_shapedetect(9, bufexpfin.get(), originalmaskSH.get(), buflight, bufl_ab, nullptr, nullptr, nullptr, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); + + 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); + } } } } else if (lp.invsh && (lp.highlihs > 0.f || lp.shadowhs > 0.f || tonequ || tonecurv || lp.showmaskSHmetinv == 1 || lp.enaSHMaskinv) && call < 3 && lp.hsena) { @@ -8919,6 +8968,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o float adjustr = 2.f; InverseColorLight_Local(tonequ, tonecurv, sp, 2, lp, originalmaskSH.get(), lightCurveloc, hltonecurveloc, shtonecurveloc, tonecurveloc, exlocalcurve, cclocalcurve, adjustr, localcutili, lllocalcurve, locallutili, original, transformed, cx, cy, hueref, chromaref, lumaref, sk); + + 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); + } } @@ -9101,6 +9156,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o bufexpfin.reset(); transit_shapedetect(3, bufexporig.get(), nullptr, buflight, bufl_ab, nullptr, nullptr, nullptr, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); + + 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); + } } } @@ -9564,6 +9625,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o bufgb.reset(); transit_shapedetect(10, tmp1.get(), nullptr, buflight, bufchro, nullptr, nullptr, nullptr, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); tmp1.reset(); + + 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); + } } } @@ -9604,6 +9671,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o //sharpen ellipse and transition Sharp_Local(call, loctemp, 0, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); + 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); + } + } else if (lp.invshar && lp.shrad > 0.42 && call < 3 && lp.sharpena && sk == 1) { int GW = original->W; int GH = original->H; @@ -9613,6 +9686,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o InverseSharp_Local(loctemp, hueref, lumaref, chromaref, lp, original, transformed, cx, cy, sk); + + 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); + } } // } @@ -9717,6 +9796,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o bufexpfin.reset(); transit_shapedetect(30, bufexporig.get(), nullptr, buflight, bufl_ab, nullptr, nullptr, nullptr, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); + + 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); + } } } @@ -9981,8 +10066,20 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o transit_shapedetect_retinex(call, 4, bufreti, bufmask, buforigmas, buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); + 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); + } + } else { InverseReti_Local(lp, hueref, chromaref, lumaref, original, transformed, tmpl, cx, cy, 0, sk); + + 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); + } } @@ -10124,8 +10221,20 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (!lp.invret) { transit_shapedetect_retinex(call, 5, tmpl, bufmask, buforigmas, buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); + + 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); + } } else { InverseReti_Local(lp, hueref, chromaref, lumaref, original, transformed, tmpl, cx, cy, 1, sk); + + 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); + } } } @@ -10507,8 +10616,20 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o */ transit_shapedetect_retinex(call, 4, bufreti, bufmask, buforigmas, buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); + 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); + } + } else { InverseReti_Local(lp, hueref, chromaref, lumaref, original, transformed, tmpl, cx, cy, 0, sk); + + 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); + } } if (params->locallab.spots.at(sp).chrrt > 0) { @@ -10649,8 +10770,20 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (!lp.invret) { transit_shapedetect_retinex(call, 5, tmpl, bufmask, buforigmas, buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); + + 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); + } } else { InverseReti_Local(lp, hueref, chromaref, lumaref, original, transformed, tmpl, cx, cy, 1, sk); + + 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); + } } } @@ -11103,10 +11236,15 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o transit_shapedetect(1, bufexporig.get(), originalmaskexp.get(), buflight, bufl_ab, buf_a_cat, buf_b_cat, nullptr, false, hueref, chromaref, lumaref, sobelref, meansob, blend2, lp, original, transformed, cx, cy, sk); bufexporig.reset(); + 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); + } + } } } - //inverse else if (lp.invex && (lp.expcomp != 0.0 || lp.war != 0 || lp.laplacexp > 0.1f || params->locallab.spots.at(sp).fatamount > 1.f || (exlocalcurve && localexutili) || lp.enaExpMaskinv || lp.showmaskexpmetinv == 1) && lp.exposena) { @@ -11191,6 +11329,13 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } InverseColorLight_Local(false, false, sp, 1, lp, originalmaskexp.get(), lightCurveloc, hltonecurveloc, shtonecurveloc, tonecurveloc, exlocalcurve, cclocalcurve, adjustr, localcutili, lllocalcurve, locallutili, original, transformed, cx, cy, hueref, chromaref, lumaref, sk); + + 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); + } + } @@ -11571,6 +11716,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o transit_shapedetect(0, bufcolorig.get(), originalmaskcol.get(), buflight, bufchro, buf_a, buf_b, bufhh, HHutili, hueref, chromaref, lumaref, sobelref, meansob, temp, lp, original, transformed, cx, cy, sk); + 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); + } + } } } @@ -11681,6 +11832,13 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (lp.showmaskcolmetinv == 0 || lp.enaColorMaskinv) { InverseColorLight_Local(false, false, sp, 0, lp, originalmaskcol.get(), lightCurveloc, hltonecurveloc, shtonecurveloc, tonecurveloc, exlocalcurve, cclocalcurve, adjustr, localcutili, lllocalcurve, locallutili, original, transformed, cx, cy, hueref, chromaref, lumaref, sk); + + 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); + } + } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 3d374ca98..dd90f1ede 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -822,6 +822,7 @@ enum ProcEventCode { EvlocallabgamSH = 792, EvlocallabsloSH = 793, Evlocallabsavrest = 794, + Evlocallabrecurs = 795, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index cebfb5713..dee3baf81 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2432,6 +2432,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : transitweak(1.0), transitgrad(0.0), avoid(false), + recurs(true), laplac(false), deltae(true), shortc(false), @@ -2740,6 +2741,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && transitweak == other.transitweak && transitgrad == other.transitgrad && avoid == other.avoid + && recurs == other.recurs && laplac == other.laplac && deltae == other.deltae && shortc == other.shortc @@ -4043,6 +4045,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).transitweak, "Locallab", "Transitweak_" + std::to_string(i), spot.transitweak, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).transitgrad, "Locallab", "Transitgrad_" + std::to_string(i), spot.transitgrad, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).avoid, "Locallab", "Avoid_" + std::to_string(i), spot.avoid, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).recurs, "Locallab", "Recurs_" + std::to_string(i), spot.recurs, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).laplac, "Locallab", "Laplac_" + std::to_string(i), spot.laplac, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).deltae, "Locallab", "Deltae_" + std::to_string(i), spot.deltae, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).shortc, "Locallab", "Shortc_" + std::to_string(i), spot.shortc, keyFile); @@ -5454,6 +5457,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Transitweak_" + std::to_string(i), pedited, spot.transitweak, spotEdited.transitweak); assignFromKeyfile(keyFile, "Locallab", "Transitgrad_" + std::to_string(i), pedited, spot.transitgrad, spotEdited.transitgrad); assignFromKeyfile(keyFile, "Locallab", "Avoid_" + std::to_string(i), pedited, spot.avoid, spotEdited.avoid); + assignFromKeyfile(keyFile, "Locallab", "Recurs_" + std::to_string(i), pedited, spot.recurs, spotEdited.recurs); assignFromKeyfile(keyFile, "Locallab", "Laplac_" + std::to_string(i), pedited, spot.laplac, spotEdited.laplac); assignFromKeyfile(keyFile, "Locallab", "Deltae_" + std::to_string(i), pedited, spot.deltae, spotEdited.deltae); assignFromKeyfile(keyFile, "Locallab", "Shortc_" + std::to_string(i), pedited, spot.shortc, spotEdited.shortc); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 408cd38b0..6bc3d9714 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -979,6 +979,7 @@ struct LocallabParams { double transitweak; double transitgrad; bool avoid; + bool recurs; bool laplac; bool deltae; bool shortc; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 47abc0b67..5fbdd996c 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -821,7 +821,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //EvLocallabSpotlumask LUMINANCECURVE, //EvlocallabgamSH LUMINANCECURVE, //EvlocallabsloSH - LUMINANCECURVE //Evlocallabsavrest + LUMINANCECURVE, //Evlocallabsavrest + LUMINANCECURVE //Evlocallabrecurs }; namespace rtengine diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index 72a09c2b3..65a0a5fb9 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -72,6 +72,7 @@ ControlSpotPanel::ControlSpotPanel(): lumask_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LUMASK"), 0, 30, 1, 10))), avoid_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_AVOID")))), + recurs_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_RECURS")))), laplac_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_LAPLACC")))), deltae_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_DELTAEC")))), shortc_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_SHORTC")))), @@ -283,6 +284,9 @@ ControlSpotPanel::ControlSpotPanel(): avoidConn_ = avoid_->signal_toggled().connect( sigc::mem_fun(*this, &ControlSpotPanel::avoidChanged)); pack_start(*avoid_); + recursConn_ = recurs_->signal_toggled().connect( + sigc::mem_fun(*this, &ControlSpotPanel::recursChanged)); + pack_start(*recurs_); Gtk::Frame* const maskFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_MASFRAME"))); maskFrame->set_label_align(0.025, 0.5); @@ -610,6 +614,7 @@ void ControlSpotPanel::load_ControlSpot_param() scopemask_->setValue((double)row[spots_.scopemask]); lumask_->setValue((double)row[spots_.lumask]); avoid_->set_active(row[spots_.avoid]); + recurs_->set_active(row[spots_.recurs]); laplac_->set_active(row[spots_.laplac]); deltae_->set_active(row[spots_.deltae]); shortc_->set_active(row[spots_.shortc]); @@ -1095,6 +1100,42 @@ void ControlSpotPanel::avoidChanged() } } +void ControlSpotPanel::recursChanged() +{ + // printf("recursChanged\n"); + + // Get selected control spot + const auto s = treeview_->get_selection(); + + if (!s->count_selected_rows()) { + return; + } + + const auto iter = s->get_selected(); + Gtk::TreeModel::Row row = *iter; + + if (multiImage) { + if (recurs_->get_inconsistent()) { + recurs_->set_inconsistent(false); + recursConn_.block(true); + recurs_->set_active(false); + recursConn_.block(false); + } + } + + row[spots_.recurs] = recurs_->get_active(); + + // Raise event + if (listener) { + if (recurs_->get_active()) { + listener->panelChanged(Evlocallabrecurs, M("GENERAL_ENABLED")); + } else { + listener->panelChanged(Evlocallabrecurs, M("GENERAL_DISABLED")); + } + } +} + + void ControlSpotPanel::laplacChanged() { // printf("laplacChanged\n"); @@ -1268,6 +1309,7 @@ void ControlSpotPanel::disableParamlistener(bool cond) scopemask_->block(cond); lumask_->block(cond); avoidConn_.block(cond); + recursConn_.block(cond); laplacConn_.block(cond); deltaeConn_.block(cond); shortcConn_.block(cond); @@ -1301,6 +1343,7 @@ void ControlSpotPanel::setParamEditable(bool cond) scopemask_->set_sensitive(cond); lumask_->set_sensitive(cond); avoid_->set_sensitive(cond); + recurs_->set_sensitive(cond); laplac_->set_sensitive(cond); deltae_->set_sensitive(cond); shortc_->set_sensitive(cond); @@ -1940,6 +1983,7 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(const int id) r->scopemask = row[spots_.scopemask]; r->lumask = row[spots_.lumask]; r->avoid = row[spots_.avoid]; + r->recurs = row[spots_.recurs]; r->laplac = row[spots_.laplac]; r->deltae = row[spots_.deltae]; r->shortc = row[spots_.shortc]; @@ -2072,6 +2116,7 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot) row[spots_.scopemask] = newSpot->scopemask; row[spots_.lumask] = newSpot->lumask; row[spots_.avoid] = newSpot->avoid; + row[spots_.recurs] = newSpot->recurs; row[spots_.laplac] = newSpot->laplac; row[spots_.deltae] = newSpot->deltae; row[spots_.shortc] = newSpot->shortc; @@ -2123,6 +2168,7 @@ int ControlSpotPanel::updateControlSpot(SpotRow* spot) row[spots_.scopemask] = spot->scopemask; row[spots_.lumask] = spot->lumask; row[spots_.avoid] = spot->avoid; + row[spots_.recurs] = spot->recurs; row[spots_.laplac] = spot->laplac; row[spots_.deltae] = spot->deltae; row[spots_.shortc] = spot->shortc; @@ -2220,6 +2266,7 @@ ControlSpotPanel::SpotEdited* ControlSpotPanel::getEditedStates() se->scopemask = scopemask_->getEditedState(); se->lumask = lumask_->getEditedState(); se->avoid = !avoid_->get_inconsistent(); + se->recurs = !recurs_->get_inconsistent(); se->laplac = !laplac_->get_inconsistent(); se->deltae = !deltae_->get_inconsistent(); se->shortc = !shortc_->get_inconsistent(); @@ -2295,6 +2342,7 @@ void ControlSpotPanel::setEditedStates(SpotEdited* se) scopemask_->setEditedState(se->scopemask ? Edited : UnEdited); lumask_->setEditedState(se->lumask ? Edited : UnEdited); avoid_->set_inconsistent(multiImage && !se->avoid); + recurs_->set_inconsistent(multiImage && !se->recurs); laplac_->set_inconsistent(multiImage && !se->laplac); deltae_->set_inconsistent(multiImage && !se->deltae); shortc_->set_inconsistent(multiImage && !se->shortc); @@ -2459,6 +2507,7 @@ ControlSpotPanel::ControlSpots::ControlSpots() add(scopemask); add(lumask); add(avoid); + add(recurs); add(laplac); add(deltae); add(shortc); diff --git a/rtgui/controlspotpanel.h b/rtgui/controlspotpanel.h index 1775a5744..828d06048 100644 --- a/rtgui/controlspotpanel.h +++ b/rtgui/controlspotpanel.h @@ -68,6 +68,7 @@ public: int scopemask; int lumask; bool avoid; + bool recurs; bool laplac; bool deltae; bool shortc; @@ -105,6 +106,7 @@ public: bool scopemask; bool lumask; bool avoid; + bool recurs; bool laplac; bool deltae; bool shortc; @@ -275,6 +277,7 @@ private: void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight); void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR); void avoidChanged(); + void recursChanged(); void laplacChanged(); void deltaeChanged(); void shortcChanged(); @@ -328,6 +331,7 @@ private: Gtk::TreeModelColumn scopemask; Gtk::TreeModelColumn lumask; Gtk::TreeModelColumn avoid; + Gtk::TreeModelColumn recurs; Gtk::TreeModelColumn laplac; Gtk::TreeModelColumn deltae; Gtk::TreeModelColumn shortc; @@ -400,6 +404,8 @@ private: Gtk::CheckButton* const avoid_; sigc::connection avoidConn_; + Gtk::CheckButton* const recurs_; + sigc::connection recursConn_; Gtk::CheckButton* const laplac_; sigc::connection laplacConn_; Gtk::CheckButton* const deltae_; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 84b37620b..848865694 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -2884,6 +2884,7 @@ void Locallab::read(const ProcParams* pp, const ParamsEdited* pedited) r->scopemask = pp->locallab.spots.at(i).scopemask; r->lumask = pp->locallab.spots.at(i).lumask; r->avoid = pp->locallab.spots.at(i).avoid; + r->recurs = pp->locallab.spots.at(i).recurs; r->laplac = pp->locallab.spots.at(i).laplac; r->deltae = pp->locallab.spots.at(i).deltae; r->shortc = pp->locallab.spots.at(i).shortc; @@ -3017,6 +3018,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) r->scopemask = newSpot->scopemask; r->lumask = newSpot->lumask; r->avoid = newSpot->avoid; + r->recurs = newSpot->recurs; r->laplac = newSpot->laplac; r->deltae = newSpot->deltae; r->shortc = newSpot->shortc; @@ -3239,6 +3241,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) r->scopemask = newSpot->scopemask; r->lumask = newSpot->lumask; r->avoid = newSpot->avoid; + r->recurs = newSpot->recurs; r->laplac = newSpot->laplac; r->deltae = newSpot->deltae; r->shortc = newSpot->shortc; @@ -3359,6 +3362,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).scopemask = r->scopemask; pp->locallab.spots.at(pp->locallab.selspot).lumask = r->lumask; pp->locallab.spots.at(pp->locallab.selspot).avoid = r->avoid; + pp->locallab.spots.at(pp->locallab.selspot).recurs = r->recurs; pp->locallab.spots.at(pp->locallab.selspot).laplac = r->laplac; pp->locallab.spots.at(pp->locallab.selspot).deltae = r->deltae; pp->locallab.spots.at(pp->locallab.selspot).shortc = r->shortc; @@ -3760,6 +3764,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pe->locallab.spots.at(pp->locallab.selspot).lumask = pe->locallab.spots.at(pp->locallab.selspot).lumask || se->lumask; pe->locallab.spots.at(pp->locallab.selspot).balan = pe->locallab.spots.at(pp->locallab.selspot).balan || se->balan; pe->locallab.spots.at(pp->locallab.selspot).avoid = pe->locallab.spots.at(pp->locallab.selspot).avoid || se->avoid; + pe->locallab.spots.at(pp->locallab.selspot).recurs = pe->locallab.spots.at(pp->locallab.selspot).recurs || se->recurs; pe->locallab.spots.at(pp->locallab.selspot).laplac = pe->locallab.spots.at(pp->locallab.selspot).laplac || se->laplac; pe->locallab.spots.at(pp->locallab.selspot).deltae = pe->locallab.spots.at(pp->locallab.selspot).deltae || se->deltae; pe->locallab.spots.at(pp->locallab.selspot).shortc = pe->locallab.spots.at(pp->locallab.selspot).shortc || se->shortc; @@ -4077,6 +4082,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pedited->locallab.spots.at(pp->locallab.selspot).scopemask = pedited->locallab.spots.at(pp->locallab.selspot).scopemask || se->scopemask; pedited->locallab.spots.at(pp->locallab.selspot).lumask = pedited->locallab.spots.at(pp->locallab.selspot).lumask || se->lumask; pedited->locallab.spots.at(pp->locallab.selspot).avoid = pedited->locallab.spots.at(pp->locallab.selspot).avoid || se->avoid; + pedited->locallab.spots.at(pp->locallab.selspot).recurs = pedited->locallab.spots.at(pp->locallab.selspot).recurs || se->recurs; pedited->locallab.spots.at(pp->locallab.selspot).laplac = pedited->locallab.spots.at(pp->locallab.selspot).laplac || se->laplac; pedited->locallab.spots.at(pp->locallab.selspot).deltae = pedited->locallab.spots.at(pp->locallab.selspot).deltae || se->deltae; pedited->locallab.spots.at(pp->locallab.selspot).shortc = pedited->locallab.spots.at(pp->locallab.selspot).shortc || se->shortc; @@ -8803,6 +8809,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con se->scopemask = spotState->scopemask; se->lumask = spotState->lumask; se->avoid = spotState->avoid; + se->recurs = spotState->recurs; se->laplac = spotState->laplac; se->deltae = spotState->deltae; se->shortc = spotState->shortc; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 6400adb7b..0665834f3 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -973,6 +973,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).transitweak = locallab.spots.at(j).transitweak && pSpot.transitweak == otherSpot.transitweak; locallab.spots.at(j).transitgrad = locallab.spots.at(j).transitgrad && pSpot.transitgrad == otherSpot.transitgrad; locallab.spots.at(j).avoid = locallab.spots.at(j).avoid && pSpot.avoid == otherSpot.avoid; + locallab.spots.at(j).recurs = locallab.spots.at(j).recurs && pSpot.recurs == otherSpot.recurs; locallab.spots.at(j).laplac = locallab.spots.at(j).laplac && pSpot.laplac == otherSpot.laplac; locallab.spots.at(j).deltae = locallab.spots.at(j).deltae && pSpot.deltae == otherSpot.deltae; locallab.spots.at(j).shortc = locallab.spots.at(j).shortc && pSpot.shortc == otherSpot.shortc; @@ -2819,6 +2820,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).avoid = mods.locallab.spots.at(i).avoid; } + if (locallab.spots.at(i).recurs) { + toEdit.locallab.spots.at(i).recurs = mods.locallab.spots.at(i).recurs; + } + if (locallab.spots.at(i).laplac) { toEdit.locallab.spots.at(i).laplac = mods.locallab.spots.at(i).laplac; } @@ -4875,6 +4880,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : transitweak(v), transitgrad(v), avoid(v), + recurs(v), laplac(v), deltae(v), shortc(v), @@ -5180,6 +5186,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) transitweak = v; transitgrad = v; avoid = v; + recurs = v; laplac = v; deltae = v; shortc = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index b15802ab7..f95eb2382 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -391,6 +391,7 @@ public: bool transitweak; bool transitgrad; bool avoid; + bool recurs; bool laplac; bool deltae; bool shortc;