From 3a6cd9ed1507bb7c2710c7196b9aa25194e1d185 Mon Sep 17 00:00:00 2001 From: Desmis Date: Mon, 11 Nov 2019 11:26:24 +0100 Subject: [PATCH] Add Mask Structure to mask Color and Light --- rtdata/languages/default | 9 ++++++--- rtengine/improcfun.h | 1 + rtengine/iplocallab.cc | 36 +++++++++++++++++++++++++++++++++--- rtengine/procevents.h | 1 + rtengine/procparams.cc | 4 ++++ rtengine/procparams.h | 1 + rtengine/refreshmap.cc | 3 ++- rtgui/locallab.cc | 24 ++++++++++++++++++++++-- rtgui/locallab.h | 1 + rtgui/paramsedited.cc | 7 +++++++ rtgui/paramsedited.h | 1 + 11 files changed, 79 insertions(+), 9 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 2364208ce..bebed7ff5 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1041,6 +1041,7 @@ HISTORY_MSG_800;Local - Color ToneCurve Method HISTORY_MSG_801;Local - Color ToneCurve Special HISTORY_MSG_802;Local - Contrast threshold HISTORY_MSG_803;Local - Color Merge +HISTORY_MSG_804;Local - Color mask Structure HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2113,7 +2114,7 @@ TP_LOCALLAB_ARTIF_TOOLTIP;Increase deltaE Weakening improve shape detection, but TP_LOCALLAB_AVOID;Avoid color shift TP_LOCALLAB_BALAN;Balance deltaE ab-L TP_LOCALLAB_BILATERAL;Bilateral filter -TP_LOCALLAB_MASK_TOOLTIP;You can enable multiple masks for a single tool, this requires activating another tool (but without using the tool : sliders to 0,...) where is the mask you want to activate.\nMasks with this ability are marked '+'\nMasks with additional features are marked '*'\nThe number indicates the order of use of the masks.\n\nYou can combine the mask associated with the tool with an inverse mask.\nIn this case the new tool associated with the mask must be selected in inverse; you must use the tool with very small values (ex Exposure 0.01) +TP_LOCALLAB_MASK_TOOLTIP;You can enable multiple masks for a single tool, this requires activating another tool (but without using the tool : sliders to 0,...) where is the mask you want to activate.\nMasks with this ability are marked '+'\nMasks with additional features are marked '*'\nThe number indicates the order of use of the masks.\n\nYou can combine the mask associated with the tool with an inverse mask.\nIn this case the new tool associated with the mask must be selected in inverse. TP_LOCALLAB_CHROMASK_TOOLTIP;You can use this slider to desaturated background (inverse mask - curve near 0).\nAlso to attenuate or enhance the action of a mask on the chroma TP_LOCALLAB_BLENDMASKCOL;Blend TP_LOCALLAB_BLUR;Gaussian Blur - Noise - Grain @@ -2144,6 +2145,7 @@ TP_LOCALLAB_CHROMASKCOL;Chroma mask TP_LOCALLAB_GAMMASKCOL;Gamma mask TP_LOCALLAB_SLOMASKCOL;Slope mask TP_LOCALLAB_SHAMASKCOL;Shadows mask +TP_LOCALLAB_STRUMASKCOL;Structure mask TP_LOCALLAB_HIGHMASKCOL;Highlights mask TP_LOCALLAB_LAPMASKCOL;Laplacian threshold mask TP_LOCALLAB_LUMADARKEST;Darkest @@ -2173,7 +2175,7 @@ TP_LOCALLAB_MERGE1COLFRA;Merge with Original or Previous TP_LOCALLAB_OPACOL;Opacity TP_LOCALLAB_CONTTHR;Contrast Threshold TP_LOCALLAB_MERGEOPA_TOOLTIP;Opacity merge % current Spot with original or previous Spot.\nContrast threshold : adjust result in function of Original contrast -TP_LOCALLAB_MERGECOLFRA;Mask LCH +TP_LOCALLAB_MERGECOLFRA;Mask: LCH & Structure TP_LOCALLAB_MERONE;Normal TP_LOCALLAB_MERTWO;Substract TP_LOCALLAB_MERTHR;Difference @@ -2392,7 +2394,7 @@ TP_LOCALLAB_SHOWMNONE;None TP_LOCALLAB_SHOWMODIF;Show modifications whithout mask TP_LOCALLAB_SHOWMODIFMASK;Show modifications whith mask TP_LOCALLAB_SHOWMASK;Show mask -TP_LOCALLAB_SHOWSTRUC;Show structure +TP_LOCALLAB_SHOWSTRUC;Show structure Spot TP_LOCALLAB_USEMASK;Use mask TP_LOCALLAB_SHADHIGH;Shadows Highlights-Gradient- Tone Equalizer-TRC TP_LOCALLAB_SOFTRADIUSCOL;Soft radius @@ -2403,6 +2405,7 @@ TP_LOCALLAB_RETIM;Original Retinex TP_LOCALLAB_STRENG;Strength TP_LOCALLAB_STRENGTH;Noise TP_LOCALLAB_STRUCCOL;Structure +TP_LOCALLAB_STRUCCOL1;Structure Spot TP_LOCALLAB_STYPE;Shape method TP_LOCALLAB_STYPE_TOOLTIP;You can choose between:\nSymmetrical - left handle linked to right, top handle linked to bottom.\nIndependent - all handles are independent. TP_LOCALLAB_SYMSL;Symmetrical (mouse + sliders) diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 9b5455b11..12f8e1051 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -216,6 +216,7 @@ public: int pitch, int scale, const int luma, const int chroma/*, LUTf & Lcurve, LUTf & abcurve*/); //locallab void maskcalccol(bool invmask, bool pde, int bfw, int bfh, int xstart, int ystart, int sk, int cx, int cy, LabImage* bufcolorig, LabImage* bufmaskblurcol, LabImage* originalmaskcol, LabImage* original, int inv, const struct local_params & lp, + float strumask, const LocCCmaskCurve & locccmasCurve, bool & lcmasutili, const LocLLmaskCurve & locllmasCurve, bool & llmasutili, const LocHHmaskCurve & lochhmasCurve, bool &lhmasutili, diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 2c4633b21..d68ca69b2 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -2541,11 +2541,11 @@ void ImProcFunctions::blendstruc(int bfw, int bfh, LabImage* bufcolorig, float r for (int ir = 0; ir < bfh; ir++) { for (int jr = 0; jr < bfw; jr++) { - ble[ir][jr] *= 32768.f; + blend2[ir][jr] = 32768.f * ble[ir][jr]; } } - Median_Denoise(ble, blend2, bfw, bfh, Median::TYPE_3X3_STRONG, 1, multiThread); + // Median_Denoise(ble, blend2, bfw, bfh, Median::TYPE_3X3_STRONG, 1, multiThread); } @@ -3184,6 +3184,7 @@ void ImProcFunctions::retinex_pde(float * datain, float * dataout, int bfw, int } void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int xstart, int ystart, int sk, int cx, int cy, LabImage* bufcolorig, LabImage* bufmaskblurcol, LabImage* originalmaskcol, LabImage* original, int inv, const struct local_params & lp, + float strumask, const LocCCmaskCurve & locccmasCurve, bool & lcmasutili, const LocLLmaskCurve & locllmasCurve, bool & llmasutili, const LocHHmaskCurve & lochhmasCurve, bool &lhmasutili, @@ -3220,6 +3221,20 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int } } + JaggedArray blendstru(bfw, bfh); + + if(strumask > 0.f){ + buildBlendMask(bufcolorig->L, blendstru, bfw, bfh, strumask, 1.f); + float radblur = 0.02f * rad;//empirical value + float rm = radblur / sk; + + if (rm > 0) { + float **mb = blendstru; + gaussianBlur(mb, mb, bfw, bfh, rm); + } + + } + #ifdef _OPENMP #pragma omp parallel #endif @@ -3253,6 +3268,11 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int float kmaskC = 0.f; float kmaskHL = 0.f; float kmaskH = 0.f; + float kmasstru = 0.f; + + if(strumask > 0.f){ + kmasstru = bufcolorig->L[ir][jr]* blendstru[ir][jr]; + } if (locllmasCurve && llmasutili) { kmaskL = 32768.f * LIM01(kinv - kneg * locllmasCurve[(500.f / 32768.f) * bufcolorig->L[ir][jr]]); @@ -3284,7 +3304,7 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int kmaskHL = 32768.f * valHH; } - bufmaskblurcol->L[ir][jr] = CLIPLOC(kmaskL + kmaskHL); + bufmaskblurcol->L[ir][jr] = CLIPLOC(kmaskL + kmaskHL + kmasstru); bufmaskblurcol->a[ir][jr] = CLIPC(kmaskC + kmaskH); bufmaskblurcol->b[ir][jr] = CLIPC(kmaskC + kmaskH); @@ -8412,6 +8432,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int shortcu = 0; //lp.mergemet; //params->locallab.spots.at(sp).shortc; maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, loctemp.get(), bufmaskorigcb.get(), originalmaskcb.get(), original, inv, lp, + 0.f, locccmascbCurve, lcmascbutili, locllmascbCurve, llmascbutili, lochhmascbCurve, lhmascbutili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, shado, amountcd, anchorcd, lmaskcblocalcurve, localmaskcbutili, dummy, lmasutilicolwav, 1, 1, 5, 5, shortcu, delt, hueref, chromaref, lumaref, @@ -8720,6 +8741,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o float anchorcd = 50.f; maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufgbm.get(), bufmaskorigtm.get(), originalmasktm.get(), original, inv, lp, + 0.f, locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, shado, amountcd, anchorcd, lmasktmlocalcurve, localmasktmutili, dummy, lmasutilicolwav, 1, 1, 5, 5, shortcu, delt, hueref, chromaref, lumaref, @@ -8761,6 +8783,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o float anchorcd = 50.f; maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, tmp1.get(), bufmaskorigtm.get(), originalmasktm.get(), original, inv, lp, + 0.f, locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, shado, amountcd, anchorcd, lmasktmlocalcurve, localmasktmutili, dummy, lmasutilicolwav, 1, 1, 5, 5, shortcu, delt, hueref, chromaref, lumaref, @@ -8963,6 +8986,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int lumask = params->locallab.spots.at(sp).lumask; maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufexporig.get(), bufmaskorigSH.get(), originalmaskSH.get(), original, inv, lp, + 0.f, locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, shado, amountcd, anchorcd, lmaskSHlocalcurve, localmaskSHutili, dummy, lmasutilicolwav, 1, 1, 5, 5, shortcu, delt, hueref, chromaref, lumaref, @@ -9114,6 +9138,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int lumask = params->locallab.spots.at(sp).lumask; maskcalccol(false, pde, GW, GH, 0, 0, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskSH.get(), original, inv, lp, + 0.f, locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, shado, amountcd, anchorcd, lmaskSHlocalcurve, localmaskSHutili, dummy, lmasutilicolwav, 1, 1, 5, 5, shortcu, delt, hueref, chromaref, lumaref, @@ -11187,6 +11212,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int lumask = params->locallab.spots.at(sp).lumask; maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufexporig.get(), bufmaskblurexp.get(), originalmaskexp.get(), original, inv, lp, + 0.f, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, shado, amountcd, anchorcd, lmaskexplocalcurve, localmaskexputili, dummy, lmasutilicolwav, 1, 1, 5, 5, shortcu, delt, hueref, chromaref, lumaref, @@ -11479,6 +11505,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o float anchorcd = 50.f; maskcalccol(false, pde, GW, GH, 0, 0, sk, cx, cy, bufexporig.get(), bufmaskblurexp.get(), originalmaskexp.get(), original, inv, lp, + 0.f, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, shado, amountcd, anchorcd, lmaskexplocalcurve, localmaskexputili, dummy, lmasutilicolwav, 1, 1, 5, 5, shortcu, delt, hueref, chromaref, lumaref, @@ -11749,6 +11776,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int level_hr = params->locallab.spots.at(sp).csthresholdcol.getTopRight(); int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc; int lumask = params->locallab.spots.at(sp).lumask; + float strumask = 0.01f *(float) params->locallab.spots.at(sp).strumaskcol; float conthr = 0.01f * params->locallab.spots.at(sp).conthrcol; int tonemod = 0; @@ -11772,6 +11800,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o // if (lp.mergemet != 2) { maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskcol.get(), original, inv, lp, + strumask, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, shado, amountcd, anchorcd, lmasklocalcurve, localmaskutili, loclmasCurvecolwav, lmasutilicolwav, level_bl, level_hl, level_br, level_hr, @@ -12553,6 +12582,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o float anchorcd = 50.f; maskcalccol(false, pde, GW, GH, 0, 0, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskcol.get(), original, inv, lp, + 0.f, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, shado, amountcd, anchorcd, lmasklocalcurve, localmaskutili, loclmasCurvecolwav, lmasutilicolwav, level_bl, level_hl, level_br, level_hr, diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 2fdcd1df0..1b33e1dcb 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -827,6 +827,7 @@ enum ProcEventCode { EvLocallabspecial = 800, Evlocallabconthrcol = 801, EvLocallabmerMethod = 802, + Evlocallabstrumaskcol = 803, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 2d02eaa37..85cfdb287 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2465,6 +2465,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : gammaskcol(1.0), slomaskcol(0.0), shadmaskcol(0), + strumaskcol(0), lapmaskcol(0.0), qualitycurveMethod("none"), gridMethod("one"), @@ -2781,6 +2782,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && gammaskcol == other.gammaskcol && slomaskcol == other.slomaskcol && shadmaskcol == other.shadmaskcol + && strumaskcol == other.strumaskcol && lapmaskcol == other.lapmaskcol && qualitycurveMethod == other.qualitycurveMethod && gridMethod == other.gridMethod @@ -4094,6 +4096,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).gammaskcol, "Locallab", "Gammaskcol_" + std::to_string(i), spot.gammaskcol, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).slomaskcol, "Locallab", "Slomaskcol_" + std::to_string(i), spot.slomaskcol, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).shadmaskcol, "Locallab", "shadmaskcol_" + std::to_string(i), spot.shadmaskcol, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).strumaskcol, "Locallab", "strumaskcol_" + std::to_string(i), spot.strumaskcol, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).lapmaskcol, "Locallab", "Lapmaskcol_" + std::to_string(i), spot.lapmaskcol, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).qualitycurveMethod, "Locallab", "QualityCurveMethod_" + std::to_string(i), spot.qualitycurveMethod, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).gridMethod, "Locallab", "gridMethod_" + std::to_string(i), spot.gridMethod, keyFile); @@ -5514,6 +5517,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Gammaskcol_" + std::to_string(i), pedited, spot.gammaskcol, spotEdited.gammaskcol); assignFromKeyfile(keyFile, "Locallab", "Slomaskcol_" + std::to_string(i), pedited, spot.slomaskcol, spotEdited.slomaskcol); assignFromKeyfile(keyFile, "Locallab", "shadmaskcol_" + std::to_string(i), pedited, spot.shadmaskcol, spotEdited.shadmaskcol); + assignFromKeyfile(keyFile, "Locallab", "strumaskcol_" + std::to_string(i), pedited, spot.strumaskcol, spotEdited.strumaskcol); assignFromKeyfile(keyFile, "Locallab", "Lapmaskcol_" + std::to_string(i), pedited, spot.lapmaskcol, spotEdited.lapmaskcol); assignFromKeyfile(keyFile, "Locallab", "QualityCurveMethod_" + std::to_string(i), pedited, spot.qualitycurveMethod, spotEdited.qualitycurveMethod); assignFromKeyfile(keyFile, "Locallab", "gridMethod_" + std::to_string(i), pedited, spot.gridMethod, spotEdited.gridMethod); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index c665f59cb..b6a092fec 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1008,6 +1008,7 @@ struct LocallabParams { double gammaskcol; double slomaskcol; int shadmaskcol; + int strumaskcol; double lapmaskcol; Glib::ustring qualitycurveMethod; Glib::ustring gridMethod; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 567f3b82f..77554aa49 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -830,7 +830,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //EvLocallabtoneMethod LUMINANCECURVE, // EvLocallabspecial LUMINANCECURVE, //EvLocallabconthrcol - LUMINANCECURVE //EvLocallabmerMethod + LUMINANCECURVE, //EvLocallabmerMethod + LUMINANCECURVE //EvLocallabstrumaskcol }; namespace rtengine diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 9aba310a3..a46c44829 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -253,7 +253,7 @@ Locallab::Locallab(): chroma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMA"), -100, 150, 1, 0))), strengthgrid(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRGRID"), 0, 100, 1, 30))), sensi(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), - structcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))), + structcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL1"), 0, 100, 1, 0))), blurcolde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))), blendmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), radmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), 0.0, 100.0, 0.1, 0.))), @@ -265,8 +265,9 @@ Locallab::Locallab(): softradiuscol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.5, 0.))), opacol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_OPACOL"), 0.0, 100.0, 0.5, 100.))), conthrcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTTHR"), 0.0, 100.0, 0.5, 0.))), + strumaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUMASKCOL"), 0, 100, 1, 0))), // Exposure - expcomp(Gtk::manage(new Adjuster(M("TP_EXPOSURE_EXPCOMP"), -2.0, 4.0, 0.05, 0.0))), + expcomp(Gtk::manage(new Adjuster(M("TP_EXPOSURE_EXPCOMP"), -2.0, 3.0, 0.05, 0.0))), hlcompr(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 0))), hlcomprthresh(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 0))), black(Gtk::manage(new Adjuster(M("TP_EXPOSURE_BLACKLEVEL"), -16384, 32768, 10, 0))), @@ -645,6 +646,7 @@ pe(nullptr) gammaskcol->setAdjusterListener(this); slomaskcol->setAdjusterListener(this); shadmaskcol->setAdjusterListener(this); + strumaskcol->setAdjusterListener(this); softradiuscol->setAdjusterListener(this); opacol->setAdjusterListener(this); conthrcol->setAdjusterListener(this); @@ -932,12 +934,15 @@ pe(nullptr) mergecolBox->pack_start(*opacol); mergecolBox->pack_start(*conthrcol); merge1colFrame->add(*mergecolBox); + Gtk::HSeparator* const separatorstru = Gtk::manage(new Gtk::HSeparator()); ToolParamBlock* const maskcolBox = Gtk::manage(new ToolParamBlock()); maskcolBox->pack_start(*showmaskcolMethod, Gtk::PACK_SHRINK, 4); maskcolBox->pack_start(*showmaskcolMethodinv, Gtk::PACK_SHRINK, 4); maskcolBox->pack_start(*enaColorMask, Gtk::PACK_SHRINK, 0); maskcolBox->pack_start(*maskCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + maskcolBox->pack_start(*strumaskcol, Gtk::PACK_SHRINK, 0); + maskcolBox->pack_start(*separatorstru, Gtk::PACK_SHRINK, 2); maskcolBox->pack_start(*blendmaskcol, Gtk::PACK_SHRINK, 0); maskcolBox->pack_start(*radmaskcol, Gtk::PACK_SHRINK, 0); maskcolBox->pack_start(*lapmaskcol, Gtk::PACK_SHRINK, 0); @@ -3694,6 +3699,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).gammaskcol = gammaskcol->getValue(); pp->locallab.spots.at(pp->locallab.selspot).slomaskcol = slomaskcol->getValue(); pp->locallab.spots.at(pp->locallab.selspot).shadmaskcol = shadmaskcol->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).strumaskcol = strumaskcol->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).lapmaskcol = lapmaskcol->getValue(); pp->locallab.spots.at(pp->locallab.selspot).softradiuscol = softradiuscol->getValue(); pp->locallab.spots.at(pp->locallab.selspot).opacol = opacol->getValue(); @@ -4089,6 +4095,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pe->locallab.spots.at(pp->locallab.selspot).gammaskcol = pe->locallab.spots.at(pp->locallab.selspot).gammaskcol || gammaskcol->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).slomaskcol = pe->locallab.spots.at(pp->locallab.selspot).slomaskcol || slomaskcol->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).shadmaskcol = pe->locallab.spots.at(pp->locallab.selspot).shadmaskcol || shadmaskcol->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).strumaskcol = pe->locallab.spots.at(pp->locallab.selspot).strumaskcol || strumaskcol->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).lapmaskcol = pe->locallab.spots.at(pp->locallab.selspot).lapmaskcol || lapmaskcol->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).softradiuscol = pe->locallab.spots.at(pp->locallab.selspot).softradiuscol || softradiuscol->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).opacol = pe->locallab.spots.at(pp->locallab.selspot).opacol || opacol->getEditedState(); @@ -4415,6 +4422,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pedited->locallab.spots.at(pp->locallab.selspot).gammaskcol = pedited->locallab.spots.at(pp->locallab.selspot).gammaskcol || gammaskcol->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).slomaskcol = pedited->locallab.spots.at(pp->locallab.selspot).slomaskcol || slomaskcol->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).shadmaskcol = pedited->locallab.spots.at(pp->locallab.selspot).shadmaskcol || shadmaskcol->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).strumaskcol = pedited->locallab.spots.at(pp->locallab.selspot).strumaskcol || strumaskcol->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).lapmaskcol = pedited->locallab.spots.at(pp->locallab.selspot).lapmaskcol || lapmaskcol->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).softradiuscol = pedited->locallab.spots.at(pp->locallab.selspot).softradiuscol || softradiuscol->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).opacol = pedited->locallab.spots.at(pp->locallab.selspot).opacol || opacol->getEditedState(); @@ -6528,6 +6536,7 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c gammaskcol->setDefault(defSpot->gammaskcol); slomaskcol->setDefault(defSpot->slomaskcol); shadmaskcol->setDefault(defSpot->shadmaskcol); + strumaskcol->setDefault(defSpot->strumaskcol); lapmaskcol->setDefault(defSpot->lapmaskcol); softradiuscol->setDefault(defSpot->softradiuscol); opacol->setDefault(defSpot->opacol); @@ -6722,6 +6731,7 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c gammaskcol->setDefaultEditedState(Irrelevant); slomaskcol->setDefaultEditedState(Irrelevant); shadmaskcol->setDefaultEditedState(Irrelevant); + strumaskcol->setDefaultEditedState(Irrelevant); lapmaskcol->setDefaultEditedState(Irrelevant); softradiuscol->setDefaultEditedState(Irrelevant); opacol->setDefaultEditedState(Irrelevant); @@ -6920,6 +6930,7 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c gammaskcol->setDefaultEditedState(defSpotState->gammaskcol ? Edited : UnEdited); slomaskcol->setDefaultEditedState(defSpotState->slomaskcol ? Edited : UnEdited); shadmaskcol->setDefaultEditedState(defSpotState->shadmaskcol ? Edited : UnEdited); + strumaskcol->setDefaultEditedState(defSpotState->strumaskcol ? Edited : UnEdited); lapmaskcol->setDefaultEditedState(defSpotState->lapmaskcol ? Edited : UnEdited); softradiuscol->setDefaultEditedState(defSpotState->softradiuscol ? Edited : UnEdited); opacol->setDefaultEditedState(defSpotState->opacol ? Edited : UnEdited); @@ -7236,6 +7247,12 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) } } + if (a == strumaskcol) { + if (listener) { + listener->panelChanged(Evlocallabstrumaskcol, strumaskcol->getTextValue()); + } + } + if (a == lapmaskcol) { if (listener) { listener->panelChanged(Evlocallablapmaskcol, lapmaskcol->getTextValue()); @@ -8291,6 +8308,7 @@ void Locallab::setBatchMode(bool batchMode) gammaskcol->showEditedCB(); slomaskcol->showEditedCB(); shadmaskcol->showEditedCB(); + strumaskcol->showEditedCB(); lapmaskcol->showEditedCB(); softradiuscol->showEditedCB(); opacol->showEditedCB(); @@ -8907,6 +8925,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con gammaskcol->setValue(pp->locallab.spots.at(index).gammaskcol); slomaskcol->setValue(pp->locallab.spots.at(index).slomaskcol); shadmaskcol->setValue(pp->locallab.spots.at(index).shadmaskcol); + strumaskcol->setValue(pp->locallab.spots.at(index).strumaskcol); lapmaskcol->setValue(pp->locallab.spots.at(index).lapmaskcol); softradiuscol->setValue(pp->locallab.spots.at(index).softradiuscol); opacol->setValue(pp->locallab.spots.at(index).opacol); @@ -9335,6 +9354,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con gammaskcol->setEditedState(spotState->gammaskcol ? Edited : UnEdited); slomaskcol->setEditedState(spotState->slomaskcol ? Edited : UnEdited); shadmaskcol->setEditedState(spotState->shadmaskcol ? Edited : UnEdited); + strumaskcol->setEditedState(spotState->strumaskcol ? Edited : UnEdited); lapmaskcol->setEditedState(spotState->lapmaskcol ? Edited : UnEdited); softradiuscol->setEditedState(spotState->softradiuscol ? Edited : UnEdited); opacol->setEditedState(spotState->opacol ? Edited : UnEdited); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 372064862..06481c6f6 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -168,6 +168,7 @@ private: Adjuster* const softradiuscol; Adjuster* const opacol; Adjuster* const conthrcol; + Adjuster* const strumaskcol; // Exposure Adjuster* const expcomp; Adjuster* const hlcompr; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 2b50ec54b..9e0ef2713 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1001,6 +1001,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).gammaskcol = locallab.spots.at(j).gammaskcol && pSpot.gammaskcol == otherSpot.gammaskcol; locallab.spots.at(j).slomaskcol = locallab.spots.at(j).slomaskcol && pSpot.slomaskcol == otherSpot.slomaskcol; locallab.spots.at(j).shadmaskcol = locallab.spots.at(j).shadmaskcol && pSpot.shadmaskcol == otherSpot.shadmaskcol; + locallab.spots.at(j).strumaskcol = locallab.spots.at(j).strumaskcol && pSpot.strumaskcol == otherSpot.strumaskcol; locallab.spots.at(j).lapmaskcol = locallab.spots.at(j).lapmaskcol && pSpot.lapmaskcol == otherSpot.lapmaskcol; locallab.spots.at(j).qualitycurveMethod = locallab.spots.at(j).qualitycurveMethod && pSpot.qualitycurveMethod == otherSpot.qualitycurveMethod; locallab.spots.at(j).gridMethod = locallab.spots.at(j).gridMethod && pSpot.gridMethod == otherSpot.gridMethod; @@ -2929,6 +2930,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).shadmaskcol = mods.locallab.spots.at(i).shadmaskcol; } + if (locallab.spots.at(i).strumaskcol) { + toEdit.locallab.spots.at(i).strumaskcol = mods.locallab.spots.at(i).strumaskcol; + } + if (locallab.spots.at(i).lapmaskcol) { toEdit.locallab.spots.at(i).lapmaskcol = mods.locallab.spots.at(i).lapmaskcol; } @@ -4948,6 +4953,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : gammaskcol(v), slomaskcol(v), shadmaskcol(v), + strumaskcol(v), lapmaskcol(v), qualitycurveMethod(v), gridMethod(v), @@ -5262,6 +5268,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) gammaskcol = v; slomaskcol = v; shadmaskcol = v; + strumaskcol = v; lapmaskcol = v; qualitycurveMethod = v; gridMethod = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 0833b798e..6df4199a0 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -431,6 +431,7 @@ public: bool gammaskcol; bool slomaskcol; bool shadmaskcol; + bool strumaskcol; bool lapmaskcol; bool qualitycurveMethod; bool gridMethod;