diff --git a/rtdata/languages/default b/rtdata/languages/default index b4f3082d8..569f59a99 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1106,7 +1106,7 @@ HISTORY_MSG_851;Local - Log encoding W_Ev HISTORY_MSG_852;Local - Log encoding Target HISTORY_MSG_853;Local - Log encodind loc contrast HISTORY_MSG_854;Local - Log encodind Scope -HISTORY_MSG_855;Local - Log encoding Entire image +HISTORY_MSG_855;Local - Log encoding Whole image HISTORY_MSG_856;Local - Log encoding Shadows range HISTORY_MSG_857;Local - Wavelet blur residual HISTORY_MSG_858;Local - Wavelet blur luminance only @@ -1211,8 +1211,22 @@ HISTORY_MSG_961;Local - Log encoding Ciecam HISTORY_MSG_962;Local - Log encoding Absolute luminance source HISTORY_MSG_963;Local - Log encoding Absolute luminance target HISTORY_MSG_964;Local - Log encoding Surround -HISTORY_MSG_965;Local - Log encoding Saturation s HISTORY_MSG_966;Local - Log encoding Contrast J +HISTORY_MSG_965;Local - Log encoding Saturation s +HISTORY_MSG_967;Local - Log encoding Mask curve C +HISTORY_MSG_968;Local - Log encoding Mask curve L +HISTORY_MSG_969;Local - Log encoding Mask curve H +HISTORY_MSG_970;Local - Log encoding Mask enable +HISTORY_MSG_971;Local - Log encoding Mask blend +HISTORY_MSG_972;Local - Log encoding Mask radius +HISTORY_MSG_973;Local - Log encoding Mask chroma +HISTORY_MSG_974;Local - Log encoding Mask contrast +HISTORY_MSG_975;Local - Log encoding Lightness J +HISTORY_MSG_977;Local - Log encoding Contrast Q +HISTORY_MSG_978;Local - Log encoding Sursource +HISTORY_MSG_979;Local - Log encoding Brightness Q +HISTORY_MSG_980;Local - Log encoding Colorfulness M +HISTORY_MSG_981;Local - Log encoding Strength HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -1953,7 +1967,7 @@ TP_COARSETRAF_TOOLTIP_ROTLEFT;Rotate left.\n\nShortcuts:\n[ - Multiple Ed TP_COARSETRAF_TOOLTIP_ROTRIGHT;Rotate right.\n\nShortcuts:\n] - Multiple Editor Tabs Mode,\nAlt-] - Single Editor Tab Mode. TP_COARSETRAF_TOOLTIP_VFLIP;Flip vertically. TP_COLORAPP_ABSOLUTELUMINANCE;Absolute luminance -TP_COLORAPP_ADAPSCEN_TOOLTIP;It corresponds to the luminance at the time of the shooting in candelas per m2, calculated automatically from the exif data. +TP_COLORAPP_ADAPSCEN_TOOLTIP;Corresponds to the luminance in candelas per m2 at the time of shooting, calculated automatically from the exif data. TP_COLORAPP_ALGO;Algorithm TP_COLORAPP_ALGO_ALL;All TP_COLORAPP_ALGO_JC;Lightness + Chroma (JC) @@ -2391,7 +2405,7 @@ TP_LOCALLAB_ALL;All rubrics TP_LOCALLAB_AMOUNT;Amount TP_LOCALLAB_ARTIF;Shape detection TP_LOCALLAB_ARTIF_TOOLTIP;ΔE scope threshold increases the range of deltaE scope. High values are for very wide gamut images.\nIncreasing deltaE decay can improve shape detection, but can also reduce the scope. -TP_LOCALLAB_AUTOGRAY;Automatic +TP_LOCALLAB_AUTOGRAY;Auto mean luminance (Yb%) TP_LOCALLAB_AVOID;Avoid color shift TP_LOCALLAB_BALAN;ab-L balance (ΔE) TP_LOCALLAB_BALANEXP;Laplacian balance @@ -2456,7 +2470,7 @@ TP_LOCALLAB_CHROMASK_TOOLTIP;You can use this slider to desaturated background ( TP_LOCALLAB_CHRRT;Chroma TP_LOCALLAB_CIEC;Use Ciecam environment parameters //TP_LOCALLAB_CIECAMLOG_TOOLTIP;This module is based on the CIECAM02 color appearance model which was designed to better simulate how human vision perceives colors under different lighting conditions.\nOnly the third Ciecam process (Viewing conditions - Target) is taken into account, as well as part of the second (contrast J, saturation s) , as well as some data from the first process (Scene conditions - Source) which is used for the Log encoding.\nIt also adapts the output to the intended viewing conditions (monitor, TV, projector, printer, etc.) so that the chromatic and contrast appearance is preserved across the display environment. -TP_LOCALLAB_CIECAMLOG_TOOLTIP;This module is based on the CIECAM02 color appearance model which was designed to better simulate how human vision perceives colors under different lighting conditions.\nThe first Ciecam process 'Scene conditions' is carried out by Log encoding, it also uses 'Absolute luminance' at the time of the shooting.\nThe second Ciecam process 'Image adjustments' is simplified and uses only 3 variables (local contrast, contrast J, saturation s).\nThe third Ciecam process 'Viewing conditions' adapts the output to the intended viewing conditions (monitor, TV, projector, printer, etc.) so that the chromatic and contrast appearance is preserved across the display environment. +TP_LOCALLAB_CIECAMLOG_TOOLTIP;This module is based on the CIECAM02 color appearance model which was designed to better simulate how human vision perceives colors under different lighting conditions.\nThe first Ciecam process 'Scene conditions' is carried out by Log encoding, it also uses 'Absolute luminance' at the time of shooting.\nThe second Ciecam process 'Image adjustments' is simplified and uses only 3 variables (local contrast, contrast J, saturation s).\nThe third Ciecam process 'Viewing conditions' adapts the output to the intended viewing conditions (monitor, TV, projector, printer, etc.) so that the chromatic and contrast appearance is preserved across the display environment. TP_LOCALLAB_CIRCRADIUS;Spot size TP_LOCALLAB_CIRCRAD_TOOLTIP;Contains the references of the RT-spot, useful for shape detection (hue, luma, chroma, Sobel).\nLow values may be useful for treating foliage.\nHigh values may be useful for treating skin TP_LOCALLAB_CLARICRES;Merge chroma @@ -2487,6 +2501,7 @@ TP_LOCALLAB_CONTFRA;Contrast by level TP_LOCALLAB_CONTL;Contrast (J) TP_LOCALLAB_CONTTHMASK_TOOLTIP;Allows you to determine which parts of the image will be impacted based on the texture. TP_LOCALLAB_CONTRAST;Contrast +TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP;Allows you to freely change the contrast of the mask. May create artifacts. TP_LOCALLAB_CONTRASTCURVMASK1_TOOLTIP;Allows you to freely modify the contrast of the mask (gamma & slope), instead of using a continuous & progressive curve. However it can create artifacts that have to be dealt with using the “Smooth radius” or “Laplacian threshold sliders”. TP_LOCALLAB_CONTRESID;Contrast TP_LOCALLAB_CONTTHR;Contrast Threshold @@ -2596,8 +2611,8 @@ TP_LOCALLAB_FFTW;ƒ - Use Fast Fourier Transform TP_LOCALLAB_FFTW2;ƒ - Use Fast Fourier Transform (TIF, JPG,..) TP_LOCALLAB_FFTMASK_TOOLTIP;Use a Fourier transform for better quality (increased processing time and memory requirements) TP_LOCALLAB_FFTWBLUR;ƒ - Always Use Fast Fourier Transform -TP_LOCALLAB_FULLIMAGE;Dark-Ev & white-Ev for the entire image -TP_LOCALLAB_FULLIMAGELOG_TOOLTIP;Calculates the Ev levels for the entire image. +TP_LOCALLAB_FULLIMAGE;Dark-Ev & white-Ev for the whole image +TP_LOCALLAB_FULLIMAGELOG_TOOLTIP;Calculates the Ev levels for the whole image. TP_LOCALLAB_GAM;Gamma TP_LOCALLAB_GAMFRA;Tone response curve (TRC) TP_LOCALLAB_GAMM;Gamma @@ -2652,6 +2667,7 @@ TP_LOCALLAB_LAPLACEXP;Laplacian threshold TP_LOCALLAB_LAPMASKCOL;Laplacian threshold TP_LOCALLAB_LAPRAD_TOOLTIP;Avoid using “Smooth radius” and “Laplacian threshold” (advanced) together.\nSmooth radius uses a guided filter to decrease artifacts and smooth out the transition TP_LOCALLAB_LAPRAD1_TOOLTIP;Avoid using “Smooth radius” and “Laplacian threshold” (advanced) together.\nTransforms the mask to eliminate values lower than the threshold.\nReduces artifacts and noise, and allows local contrast to be modified. +TP_LOCALLAB_LAPRAD2_TOOLTIP;Smooth radius uses a guided filter to decrease artifacts and smooth out the transition TP_LOCALLAB_LAP_MASK_TOOLTIP;Solve PDE for all Laplacian masks.\nIf enabled Laplacian threshold mask reduce artifacts and smooth result.\nIf disabled linear response. TP_LOCALLAB_LC_FFTW_TOOLTIP;FFT improves quality and allows the use of large radii, but increases processing time (depends on the area to be processed). Preferable to use only for large radii. The size of the area can be reduced by a few pixels to optimize the FFTW. This can reduce the processing time by a factor of 1.5 to 10. TP_LOCALLAB_LC_TOOLNAME;Local Contrast & Wavelets - 7 @@ -2676,23 +2692,37 @@ TP_LOCALLAB_LOC_CONTRASTPYRLAB; Graduated Filter - Edge Sharpness - Blur TP_LOCALLAB_LOC_RESIDPYR;Residual image (Main) TP_LOCALLAB_LOG;Log Encoding TP_LOCALLAB_LOGAUTO;Automatic -TP_LOCALLAB_LOGAUTO_TOOLTIP;Pressing this button will calculate the dynamic range and Source Gray Point (if "Automatic Source Gray Point” enabled).\nPress the button again to adjust the automatically calculated values. +TP_LOCALLAB_LOGAUTO_TOOLTIP;Pressing this button will calculate the 'dynamic range' and 'mean luminance' for the scene conditions if the "Auto mean luminance (Yb%)” is checked).\nAlso calculates the absolute luminance at the time of shooting.\nPress the button again to adjust the automatically calculated values. +TP_LOCALLAB_LOGAUTOGRAY_TOOLTIP;Automatically calculates the 'mean luminance' for the scene conditons when the ‘Automatic’ button in Relative Exposure Levels is pressed. TP_LOCALLAB_LOGBASE_TOOLTIP;Default = 2.\nValues less than 2 reduce the action of the algorithm making the shadows darker and the highlights brighter.\nWith values greater than 2, the shadows are grayer and the highlights become more washed out. TP_LOCALLAB_LOGBLACKWHEV_TOOLTIP;Estimated values of Dynamic Range i.e. Black Ev and White Ev TP_LOCALLAB_LOGCONTL_TOOLTIP;Contrast (J) in CIECAM02 takes into account the increase in perceived coloration with luminance. +TP_LOCALLAB_LOGCONTQ_TOOLTIP;Contrast (Q) in CIECAM02 takes into account the increase in perceived coloration with brightness. TP_LOCALLAB_LOGDETAIL_TOOLTIP;Acts mainly on high frequencies. TP_LOCALLAB_LOGCATAD_TOOLTIP;The chromatic adaptation allows us to interpret a color according to its spatio-temporal environment.\nUseful when the white balance is far from reference D50.\nAdapts colors to the illuminant of the output device. +TP_LOCALLAB_LOGCOLORFL;Colorfulness (M) +TP_LOCALLAB_LOGCOLORF_TOOLTIP;Perceived amount of hue in relation to gray.\nIndicator that a stimulus appears more or less colored. +TP_LOCALLAB_LOGCONTL;Contrast (J) +TP_LOCALLAB_LOGCONQL;Contrast (Q) TP_LOCALLAB_LOGENCOD_TOOLTIP;Tone Mapping with Logarithmic encoding (ACES).\nUseful for underexposed images or images with high dynamic range.\n\nTwo-step process : 1) Dynamic Range calculation 2) Manual adjustment +TP_LOCALLAB_LOGEXP;All tools TP_LOCALLAB_LOGFRA;Scene Conditions TP_LOCALLAB_LOG1FRA;Image Adjustments TP_LOCALLAB_LOG2FRA;Viewing Conditions -TP_LOCALLAB_LOGFRAME_TOOLTIP;Allows you to calculate and adjust the Ev levels and the Source Gray Point for the spot area. The resulting values will be used by all Lab operations and most RGB operations in the pipeline.\nTakes into account exposure compensation in the main-menu Exposure tab.\nAlso calculates the absolute luminance at the time of the shooting. -TP_LOCALLAB_LOGIMAGE_TOOLTIP;Takes into account corresponding Ciecam variables (mainly Contrast 'J' and Saturation 's'). +TP_LOCALLAB_LOGFRAME_TOOLTIP;Allows you to calculate and adjust the Ev levels and the 'Mean luminance Yb%' (source gray point) for the spot area. The resulting values will be used by all Lab operations and most RGB operations in the pipeline.\nTakes into account exposure compensation in the main-menu Exposure tab.\nAlso calculates the absolute luminance at the time of shooting. +TP_LOCALLAB_LOGIMAGE_TOOLTIP;Takes into account corresponding Ciecam variables (mainly Contrast 'J' and Saturation 's', and also 'advanced' Contrast 'Q' , Brightness 'Q', Lightness (J), Colorfulness (M)). +TP_LOCALLAB_LOGLIGHTL;Lightness (J) +TP_LOCALLAB_LOGLIGHTQ;Brightness (Q) +TP_LOCALLAB_LOGLIGHTL_TOOLTIP;Close to lightness (L*a*b*), takes into account the increase in perceived coloration. +TP_LOCALLAB_LOGLIGHTQ_TOOLTIP;Perceived amount of light emanating from a stimulus.\nIndicator that a stimulus appears to be more or less bright, clear. TP_LOCALLAB_LOGLIN;Logarithm mode TP_LOCALLAB_LOGPFRA;Relative Exposure Levels +TP_LOCALLAB_LOGREPART;Strength +TP_LOCALLAB_LOGREPART_TOOLTIP;Allows you to adjust the relative strength of the log-encoded image with respect to the original image.\nDoes not affect the Ciecam component. TP_LOCALLAB_LOGSATURL_TOOLTIP;Saturation (s) in CIECAM02 corresponds to the color of a stimulus in relation to its own brightness.\nActs mainly on medium and highlights tones TP_LOCALLAB_LOGSCENE_TOOLTIP;Corresponds to the shooting conditions. TP_LOCALLAB_LOGSRCGREY_TOOLTIP;Estimated gray point value of the image. +TP_LOCALLAB_LOGSURSOUR_TOOLTIP;Changes tones and colors to take into account the Scene conditions.\n\nAverage: Average light environment (standard). The image will not change.\n\nDim: Dim environment. The image will become slightly bright. TP_LOCALLAB_LOGTARGGREY_TOOLTIP;You can adjust this value to suit. TP_LOCALLAB_LOG_TOOLNAME;Log Encoding - 0 TP_LOCALLAB_LOGVIEWING_TOOLTIP;Corresponds to the medium on which the final image will be viewed (monitor, TV, projector, printer,..), as well as its environment. @@ -3531,7 +3561,7 @@ TP_WAVELET_LEVONE;Level 2 TP_WAVELET_LEVTHRE;Level 4 TP_WAVELET_LEVTWO;Level 3 TP_WAVELET_LEVZERO;Level 1 -TP_WAVELET_LIMDEN;Interaction levels 56 on levels 14 +TP_WAVELET_LIMDEN;Interaction levels 5-6 on levels 1-4 TP_WAVELET_LINKEDG;Link to Edge Sharpness Strength TP_WAVELET_LIPST;Enhanced algoritm TP_WAVELET_LOWLIGHT;Coarser levels luminance range diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index d5596c8ce..e5eb18330 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -873,6 +873,7 @@ void Crop::update(int todo) auto& lmaskcblocalcurve2 = parent->lmaskcblocalcurve; auto& lmaskbllocalcurve2 = parent->lmaskbllocalcurve; auto& lmasklclocalcurve2 = parent->lmasklclocalcurve; + auto& lmaskloglocalcurve2 = parent->lmaskloglocalcurve; auto& hltonecurveloc2 = parent->hltonecurveloc; auto& shtonecurveloc2 = parent->shtonecurveloc; auto& tonecurveloc2 = parent->tonecurveloc; @@ -910,6 +911,10 @@ void Crop::update(int todo) auto& locccmasblCurve = parent->locccmasblCurve; auto& locllmasblCurve = parent->locllmasblCurve; auto& lochhmasblCurve = parent->lochhmasblCurve; + auto& locccmaslogCurve = parent->locccmaslogCurve; + auto& locllmaslogCurve = parent->locllmaslogCurve; + auto& lochhmaslogCurve = parent->lochhmaslogCurve; + auto& locccmas_Curve = parent->locccmas_Curve; auto& locllmas_Curve = parent->locllmas_Curve; auto& lochhmas_Curve = parent->lochhmas_Curve; @@ -957,6 +962,10 @@ void Crop::update(int todo) const bool lcmasblutili = locccmasblCurve.Set(params.locallab.spots.at(sp).CCmaskblcurve); const bool llmasblutili = locllmasblCurve.Set(params.locallab.spots.at(sp).LLmaskblcurve); const bool lhmasblutili = lochhmasblCurve.Set(params.locallab.spots.at(sp).HHmaskblcurve); + const bool lcmaslogutili = locccmaslogCurve.Set(params.locallab.spots.at(sp).CCmaskcurveL); + const bool llmaslogutili = locllmaslogCurve.Set(params.locallab.spots.at(sp).LLmaskcurveL); + const bool lhmaslogutili = lochhmaslogCurve.Set(params.locallab.spots.at(sp).HHmaskcurveL); + const bool lcmas_utili = locccmas_Curve.Set(params.locallab.spots.at(sp).CCmask_curve); const bool llmas_utili = locllmas_Curve.Set(params.locallab.spots.at(sp).LLmask_curve); const bool lhmas_utili = lochhmas_Curve.Set(params.locallab.spots.at(sp).HHmask_curve); @@ -989,6 +998,7 @@ void Crop::update(int todo) const bool localmaskcbutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskcbcurve, lmaskcblocalcurve2, skip); const bool localmasklcutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmasklccurve, lmasklclocalcurve2, skip); const bool localmaskblutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskblcurve, lmaskbllocalcurve2, skip); + const bool localmasklogutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).LmaskcurveL, lmaskloglocalcurve2, skip); const bool localmask_utili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmask_curve, lmasklocal_curve2, skip); double ecomp = params.locallab.spots.at(sp).expcomp; @@ -1040,6 +1050,7 @@ void Crop::update(int todo) lmaskcblocalcurve2, localmaskcbutili, lmaskbllocalcurve2, localmaskblutili, lmasklclocalcurve2, localmasklcutili, + lmaskloglocalcurve2, localmasklogutili, lmasklocal_curve2, localmask_utili, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, lochhhmasCurve, lhhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, @@ -1050,6 +1061,8 @@ void Crop::update(int todo) locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, locccmaslcCurve, lcmaslcutili, locllmaslcCurve, llmaslcutili, lochhmaslcCurve, lhmaslcutili, + locccmaslogCurve, lcmaslogutili, locllmaslogCurve, llmaslogutili, lochhmaslogCurve, lhmaslogutili, + locccmas_Curve, lcmas_utili, locllmas_Curve, llmas_utili, lochhmas_Curve, lhmas_utili, lochhhmas_Curve, lhhmas_utili, loclmasCurveblwav,lmasutiliblwav, @@ -1065,7 +1078,7 @@ void Crop::update(int todo) LHutili, HHutili, CHutili, cclocalcurve2, localcutili, rgblocalcurve2, localrgbutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, parent->previewDeltaE, parent->locallColorMask, parent->locallColorMaskinv, parent->locallExpMask, parent->locallExpMaskinv, parent->locallSHMask, parent->locallSHMaskinv, parent->locallvibMask, parent->localllcMask, parent->locallsharMask, parent->locallcbMask, parent->locallretiMask, parent->locallsoftMask, parent->localltmMask, parent->locallblMask, - parent->locall_Mask, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); + parent->localllogMask, parent->locall_Mask, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); } else { parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop.get(), lastorigCrop.get(), cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, locRETtransCurve, lllocalcurve2,locallutili, @@ -1081,6 +1094,7 @@ void Crop::update(int todo) lmaskcblocalcurve2, localmaskcbutili, lmaskbllocalcurve2, localmaskblutili, lmasklclocalcurve2, localmasklcutili, + lmaskloglocalcurve2, localmasklogutili, lmasklocal_curve2, localmask_utili, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili,lochhhmasCurve, lhhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, @@ -1091,6 +1105,8 @@ void Crop::update(int todo) locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, locccmaslcCurve, lcmaslcutili, locllmaslcCurve, llmaslcutili, lochhmaslcCurve, lhmaslcutili, + locccmaslogCurve, lcmaslogutili, locllmaslogCurve, llmaslogutili, lochhmaslogCurve, lhmaslogutili, + locccmas_Curve, lcmas_utili, locllmas_Curve, llmas_utili, lochhmas_Curve, lhmas_utili, lochhhmas_Curve, lhhmas_utili, @@ -1105,7 +1121,7 @@ void Crop::update(int todo) locedgwavCurve, locedgwavutili, loclmasCurve_wav,lmasutili_wav, LHutili, HHutili, CHutili, cclocalcurve2, localcutili, rgblocalcurve2, localrgbutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, - huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); } diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index a564676ef..09a226ded 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -222,6 +222,7 @@ ImProcCoordinator::ImProcCoordinator() : lmaskcblocalcurve(65536, LUT_CLIP_OFF), lmaskbllocalcurve(65536, LUT_CLIP_OFF), lmasklclocalcurve(65536, LUT_CLIP_OFF), + lmaskloglocalcurve(65536, LUT_CLIP_OFF), lmasklocal_curve(65536, LUT_CLIP_OFF), lastspotdup(false), previewDeltaE(false), @@ -239,6 +240,7 @@ ImProcCoordinator::ImProcCoordinator() : localltmMask(0), locallblMask(0), locallsharMask(0), + localllogMask(0), locall_Mask(0), retistrsav(nullptr) { @@ -1115,6 +1117,10 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) const bool llmasblutili = locllmasblCurve.Set(params->locallab.spots.at(sp).LLmaskblcurve); const bool lcmasblutili = locccmasblCurve.Set(params->locallab.spots.at(sp).CCmaskblcurve); const bool lhmasblutili = lochhmasblCurve.Set(params->locallab.spots.at(sp).HHmaskblcurve); + const bool llmaslogutili = locllmaslogCurve.Set(params->locallab.spots.at(sp).LLmaskcurveL); + const bool lcmaslogutili = locccmaslogCurve.Set(params->locallab.spots.at(sp).CCmaskcurveL); + const bool lhmaslogutili = lochhmaslogCurve.Set(params->locallab.spots.at(sp).HHmaskcurveL); + const bool lcmas_utili = locccmas_Curve.Set(params->locallab.spots.at(sp).CCmask_curve); const bool llmas_utili = locllmas_Curve.Set(params->locallab.spots.at(sp).LLmask_curve); const bool lhmas_utili = lochhmas_Curve.Set(params->locallab.spots.at(sp).HHmask_curve); @@ -1144,6 +1150,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) const bool localmaskcbutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskcbcurve, lmaskcblocalcurve, sca); const bool localmaskblutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskblcurve, lmaskbllocalcurve, sca); const bool localmasklcutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmasklccurve, lmasklclocalcurve, sca); + const bool localmasklogutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).LmaskcurveL, lmaskloglocalcurve, sca); const bool localmask_utili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmask_curve, lmasklocal_curve, sca); double ecomp = params->locallab.spots.at(sp).expcomp; double black = params->locallab.spots.at(sp).black; @@ -1211,6 +1218,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) lmaskcblocalcurve, localmaskcbutili, lmaskbllocalcurve, localmaskblutili, lmasklclocalcurve, localmasklcutili, + lmaskloglocalcurve, localmasklogutili, lmasklocal_curve, localmask_utili, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, lochhhmasCurve, lhhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, @@ -1221,6 +1229,8 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, locccmaslcCurve, lcmaslcutili, locllmaslcCurve, llmaslcutili, lochhmaslcCurve, lhmaslcutili, + locccmaslogCurve, lcmaslogutili, locllmaslogCurve, llmaslogutili, lochhmaslogCurve, lhmaslogutili, + locccmas_Curve, lcmas_utili, locllmas_Curve, llmas_utili, lochhmas_Curve, lhmas_utili, lochhhmas_Curve, lhhmas_utili, loclmasCurveblwav, lmasutiliblwav, @@ -1234,7 +1244,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) locedgwavCurve, locedgwavutili, loclmasCurve_wav, lmasutili_wav, LHutili, HHutili, CHutili, cclocalcurve, localcutili, rgblocalcurve, localrgbutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, - huerblu, chromarblu, lumarblu, huer, chromar, lumar, sobeler, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + huerblu, chromarblu, lumarblu, huer, chromar, lumar, sobeler, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); if (sp + 1u < params->locallab.spots.size()) { diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 83bee6955..3d84a0aad 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -274,6 +274,7 @@ protected: LUTf lmaskcblocalcurve; LUTf lmaskbllocalcurve; LUTf lmasklclocalcurve; + LUTf lmaskloglocalcurve; LUTf lmasklocal_curve; LocretigainCurve locRETgainCurve; @@ -314,6 +315,9 @@ protected: LocLLmaskCurve locllmas_Curve; LocHHmaskCurve lochhmas_Curve; LocHHmaskCurve lochhhmas_Curve; + LocCCmaskCurve locccmaslogCurve; + LocLLmaskCurve locllmaslogCurve; + LocHHmaskCurve lochhmaslogCurve; LocwavCurve locwavCurve; LocwavCurve loclmasCurveblwav; @@ -350,6 +354,7 @@ protected: int localltmMask; int locallblMask; int locallsharMask; + int localllogMask; int locall_Mask; public: @@ -421,7 +426,7 @@ public: updaterThreadStart.unlock(); } - void setLocallabMaskVisibility(bool previewDeltaE, int locallColorMask, int locallColorMaskinv, int locallExpMask, int locallExpMaskinv, int locallSHMask, int locallSHMaskinv, int locallvibMask, int locallsoftMask, int locallblMask, int localltmMask, int locallretiMask, int locallsharMask, int localllcMask, int locallcbMask, int locall_Mask) override + void setLocallabMaskVisibility(bool previewDeltaE, int locallColorMask, int locallColorMaskinv, int locallExpMask, int locallExpMaskinv, int locallSHMask, int locallSHMaskinv, int locallvibMask, int locallsoftMask, int locallblMask, int localltmMask, int locallretiMask, int locallsharMask, int localllcMask, int locallcbMask, int localllogMask, int locall_Mask) override { this->previewDeltaE = previewDeltaE; this->locallColorMask = locallColorMask; @@ -438,6 +443,7 @@ public: this->locallsharMask = locallsharMask; this->localllcMask = localllcMask; this->locallcbMask = locallcbMask; + this->localllogMask = localllogMask; this->locall_Mask = locall_Mask; } diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 3f0d2c0e4..a709b6586 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -293,6 +293,7 @@ public: const LUTf& lmaskcblocalcurve, bool localmaskcbutili, const LUTf& lmaskbllocalcurve, bool localmaskblutili, const LUTf& lmasklclocalcurve, bool localmasklcutili, + const LUTf& lmaskloglocalcurve, bool localmasklogutili, const LUTf& lmasklocal_curve, bool localmask_utili, const LocCCmaskCurve& locccmasCurve, bool lcmasutili, const LocLLmaskCurve& locllmasCurve, bool llmasutili, const LocHHmaskCurve& lochhmasCurve, bool lhmasutili, const LocHHmaskCurve& lochhhmasCurve, bool lhhmasutili, @@ -304,6 +305,7 @@ public: const LocCCmaskCurve& locccmastmCurve, bool lcmastmutili, const LocLLmaskCurve& locllmastmCurve, bool llmastmutili, const LocHHmaskCurve& lochhmastmCurve, bool lhmastmutili, const LocCCmaskCurve& locccmasblCurve, bool lcmasblutili, const LocLLmaskCurve& locllmasblCurve, bool llmasblutili, const LocHHmaskCurve& lochhmasblCurve, bool lhmasblutili, const LocCCmaskCurve& locccmaslcCurve, bool lcmaslcutili, const LocLLmaskCurve& locllmaslcCurve, bool llmaslcutili, const LocHHmaskCurve& lochhmaslcCurve, bool lhmaslcutili, + const LocCCmaskCurve& locccmaslogCurve, bool lcmaslogutili, const LocLLmaskCurve& locllmaslogCurve, bool llmaslogutili, const LocHHmaskCurve& lochhmaslogCurve, bool lhmaslogutili, const LocCCmaskCurve& locccmas_Curve, bool lcmas_utili, const LocLLmaskCurve& locllmas_Curve, bool llmas_utili, const LocHHmaskCurve& lochhmas_Curve, bool lhmas_utili, const LocHHmaskCurve& lochhhmas_Curve, bool lhhmas_utili, @@ -319,7 +321,7 @@ public: const LocwavCurve& loclmasCurve_wav, bool lmasutili_wav, bool LHutili, bool HHutili, bool CHutili, const LUTf& cclocalcurve, bool localcutili, const LUTf& rgblocalcurve, bool localrgbutili, bool localexutili, const LUTf& exlocalcurve, const LUTf& hltonecurveloc, const LUTf& shtonecurveloc, const LUTf& tonecurveloc, const LUTf& lightCurveloc, double& huerefblur, double &chromarefblur, double& lumarefblur, double &hueref, double &chromaref, double &lumaref, double &sobelref, int &lastsav, - bool prevDeltaE, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int lllcMask, int llsharMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, int ll_Mask, + bool prevDeltaE, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int lllcMask, int llsharMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, int lllogMask, int ll_Mask, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax); void addGaNoise(LabImage *lab, LabImage *dst, const float mean, const float variance, const int sk); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index b81985143..94f341bf6 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -425,6 +425,9 @@ struct local_params { float angvib; float angwav; float strwav; + float blendmaL; + float radmaL; + float chromaL; float strengthw; float radiusw; @@ -527,6 +530,7 @@ struct local_params { int showmasksoftmet; int showmasktmmet; int showmaskblmet; + int showmasklogmet; int showmask_met; bool fftbl; float laplacexp; @@ -613,6 +617,7 @@ struct local_params { bool enaretiMasktmap; bool enatmMask; bool enablMask; + bool enaLMask; bool ena_Mask; int highlihs; int shadowhs; @@ -651,7 +656,7 @@ struct local_params { }; -static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locallab, struct local_params& lp, bool prevDeltaE, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int lllcMask, int llsharMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, int ll_Mask, const LocwavCurve & locwavCurveden, bool locwavdenutili) +static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locallab, struct local_params& lp, bool prevDeltaE, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int lllcMask, int llsharMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, int lllogMask, int ll_Mask, const LocwavCurve & locwavCurveden, bool locwavdenutili) { int w = oW; int h = oH; @@ -745,23 +750,25 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.showmasktmmet = lltmMask; lp.showmaskblmet = llblMask; + lp.showmasklogmet = lllogMask; lp.showmask_met = ll_Mask; - // printf("mask=%i \n", lp.showmask_met); + printf("mask=%i \n", lp.showmasklogmet); - lp.enaColorMask = locallab.spots.at(sp).enaColorMask && llsoftMask == 0 && llColorMask == 0 && lllcMask == 0 && llsharMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && ll_Mask == 0;// Exposure mask is deactivated if Color & Light mask is visible - lp.enaColorMaskinv = locallab.spots.at(sp).enaColorMask && llColorMaskinv == 0 && llsoftMask == 0 && lllcMask == 0 && llsharMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && ll_Mask == 0;// Exposure mask is deactivated if Color & Light mask is visible - lp.enaExpMask = locallab.spots.at(sp).enaExpMask && llExpMask == 0 && llColorMask == 0 && llsoftMask == 0 && lllcMask == 0 && llsharMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && ll_Mask == 0;// Exposure mask is deactivated if Color & Light mask is visible - lp.enaExpMaskinv = locallab.spots.at(sp).enaExpMask && llExpMaskinv == 0 && llColorMask == 0 && llsoftMask == 0 && lllcMask == 0 && llsharMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && ll_Mask == 0;// Exposure mask is deactivated if Color & Light mask is visible - lp.enaSHMask = locallab.spots.at(sp).enaSHMask && llSHMask == 0 && llColorMask == 0 && llsoftMask == 0 && lllcMask == 0 && llsharMask == 0 && llExpMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && ll_Mask == 0; - lp.enaSHMaskinv = locallab.spots.at(sp).enaSHMask && llSHMaskinv == 0 && lllcMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && ll_Mask == 0; - lp.enacbMask = locallab.spots.at(sp).enacbMask && llcbMask == 0 && lllcMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && ll_Mask == 0; - lp.enaretiMask = locallab.spots.at(sp).enaretiMask && lllcMask == 0 && llsharMask == 0 && llsoftMask == 0 && llretiMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && ll_Mask == 0; - lp.enatmMask = locallab.spots.at(sp).enatmMask && lltmMask == 0 && lllcMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && llblMask == 0 && llvibMask == 0 && ll_Mask == 0; - lp.enablMask = locallab.spots.at(sp).enablMask && llblMask == 0 && lllcMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llvibMask == 0 && ll_Mask == 0; - lp.enavibMask = locallab.spots.at(sp).enavibMask && llvibMask == 0 && lllcMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llSHMask == 0 && ll_Mask == 0; - lp.enalcMask = locallab.spots.at(sp).enalcMask && lllcMask == 0 && llcbMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && ll_Mask == 0 ; - lp.enasharMask = lllcMask == 0 && llcbMask == 0 && llsharMask == 0 && llsoftMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && ll_Mask == 0; - lp.ena_Mask = locallab.spots.at(sp).enamask && lllcMask == 0 && llcbMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0; + lp.enaColorMask = locallab.spots.at(sp).enaColorMask && llsoftMask == 0 && llColorMask == 0 && lllcMask == 0 && llsharMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0;// Exposure mask is deactivated if Color & Light mask is visible + lp.enaColorMaskinv = locallab.spots.at(sp).enaColorMask && llColorMaskinv == 0 && llsoftMask == 0 && lllcMask == 0 && llsharMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0;// Exposure mask is deactivated if Color & Light mask is visible + lp.enaExpMask = locallab.spots.at(sp).enaExpMask && llExpMask == 0 && llColorMask == 0 && llsoftMask == 0 && lllcMask == 0 && llsharMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0;// Exposure mask is deactivated if Color & Light mask is visible + lp.enaExpMaskinv = locallab.spots.at(sp).enaExpMask && llExpMaskinv == 0 && llColorMask == 0 && llsoftMask == 0 && lllcMask == 0 && llsharMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0;// Exposure mask is deactivated if Color & Light mask is visible + lp.enaSHMask = locallab.spots.at(sp).enaSHMask && llSHMask == 0 && llColorMask == 0 && llsoftMask == 0 && lllcMask == 0 && llsharMask == 0 && llExpMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0; + lp.enaSHMaskinv = locallab.spots.at(sp).enaSHMask && llSHMaskinv == 0 && lllcMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0; + lp.enacbMask = locallab.spots.at(sp).enacbMask && llcbMask == 0 && lllcMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0; + lp.enaretiMask = locallab.spots.at(sp).enaretiMask && lllcMask == 0 && llsharMask == 0 && llsoftMask == 0 && llretiMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0; + lp.enatmMask = locallab.spots.at(sp).enatmMask && lltmMask == 0 && lllcMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && llblMask == 0 && llvibMask == 0&& lllogMask == 0 && ll_Mask == 0; + lp.enablMask = locallab.spots.at(sp).enablMask && llblMask == 0 && lllcMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0; + lp.enavibMask = locallab.spots.at(sp).enavibMask && llvibMask == 0 && lllcMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llSHMask == 0 && lllogMask == 0 && ll_Mask == 0; + lp.enalcMask = locallab.spots.at(sp).enalcMask && lllcMask == 0 && llcbMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0 ; + lp.enasharMask = lllcMask == 0 && llcbMask == 0 && llsharMask == 0 && llsoftMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0; + lp.ena_Mask = locallab.spots.at(sp).enamask && lllcMask == 0 && llcbMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && lllogMask == 0 && llvibMask == 0; + lp.enaLMask = locallab.spots.at(sp).enaLMask && lllogMask == 0 && llColorMask == 0 && lllcMask == 0 && llsharMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && ll_Mask == 0;// Exposure mask is deactivated if Color & Light mask is visible // printf("llColorMask=%i lllcMask=%i llExpMask=%i llSHMask=%i llcbMask=%i llretiMask=%i lltmMask=%i llblMask=%i llvibMask=%i\n", llColorMask, lllcMask, llExpMask, llSHMask, llcbMask, llretiMask, lltmMask, llblMask, llvibMask); if (locallab.spots.at(sp).softMethod == "soft") { @@ -1095,6 +1102,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall bool fftwlc = locallab.spots.at(sp).fftwlc; bool fftwreti = locallab.spots.at(sp).fftwreti; + float blendmaskL = ((float) locallab.spots.at(sp).blendmaskL) / 100.f ; + float radmaskL = ((float) locallab.spots.at(sp).radmaskL); + float chromaskL = ((float) locallab.spots.at(sp).chromaskL); + bool equilret = locallab.spots.at(sp).equilret; bool inverserad = false; // Provision bool inverseret = locallab.spots.at(sp).inversret; @@ -1216,6 +1227,9 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.gammatm = gammasktm; lp.slomatm = slomasktm; lp.wavgradl = wavgradl; + lp.blendmaL = blendmaskL; + lp.radmaL = radmaskL; + lp.chromaL = chromaskL; lp.strengthw = ((float) locallab.spots.at(sp).strengthw); lp.radiusw = ((float) locallab.spots.at(sp).radiusw); @@ -1335,24 +1349,25 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall } lp.activspot = locallab.spots.at(sp).activ; - lp.logena = locallab.spots.at(sp).explog && lp.activspot; lp.detailsh = locallab.spots.at(sp).detailSH; lp.threshol = thresho; lp.chromacb = chromcbdl; lp.expvib = locallab.spots.at(sp).expvibrance && lp.activspot ; - lp.colorena = locallab.spots.at(sp).expcolor && lp.activspot && llExpMask == 0 && llsoftMask == 0 && llSHMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llretiMask == 0 && lltmMask == 0 && llvibMask == 0 && ll_Mask == 0; // Color & Light tool is deactivated if Exposure mask is visible or SHMask - lp.blurena = locallab.spots.at(sp).expblur && lp.activspot && llExpMask == 0 && llsoftMask == 0 && llSHMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llretiMask == 0 && llColorMask == 0 && lltmMask == 0 && llvibMask == 0 && ll_Mask == 0; - lp.tonemapena = locallab.spots.at(sp).exptonemap && lp.activspot && llExpMask == 0 && llsoftMask == 0 && llSHMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llretiMask == 0 && llColorMask == 0 && llvibMask == 0 && ll_Mask == 0; - lp.retiena = locallab.spots.at(sp).expreti && lp.activspot && llExpMask == 0 && llsoftMask == 0 && llSHMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llColorMask == 0 && lltmMask == 0 && llvibMask == 0 && llSHMask == 0 && ll_Mask == 0; - lp.lcena = locallab.spots.at(sp).expcontrast && lp.activspot && llExpMask == 0 && llsoftMask == 0 && llSHMask == 0 && llcbMask == 0 && llsharMask == 0 && llColorMask == 0 && lltmMask == 0 && llvibMask == 0 && llSHMask == 0 && ll_Mask == 0; - lp.cbdlena = locallab.spots.at(sp).expcbdl && lp.activspot && llExpMask == 0 && llsoftMask == 0 && llSHMask == 0 && llretiMask == 0 && lllcMask == 0 && llsharMask == 0 && lllcMask == 0 && llColorMask == 0 && lltmMask == 0 && llvibMask == 0 && ll_Mask == 0; - lp.exposena = locallab.spots.at(sp).expexpose && lp.activspot && llColorMask == 0 && llsoftMask == 0 && llSHMask == 0 && lllcMask == 0 && llsharMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llvibMask == 0 && ll_Mask == 0; // Exposure tool is deactivated if Color & Light mask SHmask is visible - lp.hsena = locallab.spots.at(sp).expshadhigh && lp.activspot && llColorMask == 0 && llsoftMask == 0 && llExpMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llretiMask == 0 && lltmMask == 0 && llvibMask == 0 && ll_Mask == 0;// Shadow Highlight tool is deactivated if Color & Light mask or SHmask is visible - lp.vibena = locallab.spots.at(sp).expvibrance && lp.activspot && llColorMask == 0 && llsoftMask == 0 && llExpMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llretiMask == 0 && llcbMask == 0 && lltmMask == 0 && llSHMask == 0 && ll_Mask == 0;// vibrance tool is deactivated if Color & Light mask or SHmask is visible - lp.sharpena = locallab.spots.at(sp).expsharp && lp.activspot && llColorMask == 0 && llsoftMask == 0 && llExpMask == 0 && llcbMask == 0 && lllcMask == 0 && llretiMask == 0 && llcbMask == 0 && lltmMask == 0 && llSHMask == 0 && llvibMask == 0 && ll_Mask == 0; - lp.sfena = locallab.spots.at(sp).expsoft && lp.activspot && llColorMask == 0 && llExpMask == 0 && llcbMask == 0 && lllcMask == 0 && llretiMask == 0 && llcbMask == 0 && lltmMask == 0 && llSHMask == 0 && llvibMask == 0 && ll_Mask == 0; - lp.maskena = locallab.spots.at(sp).expmask && lp.activspot && llColorMask == 0 && llsoftMask == 0 && llExpMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llretiMask == 0 && llcbMask == 0 && lltmMask == 0 && llSHMask == 0;// vibrance tool is deactivated if Color & Light mask or SHmask is visible + lp.colorena = locallab.spots.at(sp).expcolor && lp.activspot && llExpMask == 0 && llsoftMask == 0 && llSHMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llretiMask == 0 && lltmMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0; // Color & Light tool is deactivated if Exposure mask is visible or SHMask + lp.blurena = locallab.spots.at(sp).expblur && lp.activspot && llExpMask == 0 && llsoftMask == 0 && llSHMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llretiMask == 0 && llColorMask == 0 && lltmMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0; + lp.tonemapena = locallab.spots.at(sp).exptonemap && lp.activspot && llExpMask == 0 && llsoftMask == 0 && llSHMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llretiMask == 0 && llColorMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0; + lp.retiena = locallab.spots.at(sp).expreti && lp.activspot && llExpMask == 0 && llsoftMask == 0 && llSHMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llColorMask == 0 && lltmMask == 0 && llvibMask == 0 && llSHMask == 0 && lllogMask == 0 && ll_Mask == 0; + lp.lcena = locallab.spots.at(sp).expcontrast && lp.activspot && llExpMask == 0 && llsoftMask == 0 && llSHMask == 0 && llcbMask == 0 && llsharMask == 0 && llColorMask == 0 && lltmMask == 0 && llvibMask == 0 && llSHMask == 0 && lllogMask == 0 && ll_Mask == 0; + lp.cbdlena = locallab.spots.at(sp).expcbdl && lp.activspot && llExpMask == 0 && llsoftMask == 0 && llSHMask == 0 && llretiMask == 0 && lllcMask == 0 && llsharMask == 0 && lllcMask == 0 && llColorMask == 0 && lltmMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0; + lp.exposena = locallab.spots.at(sp).expexpose && lp.activspot && llColorMask == 0 && llsoftMask == 0 && llSHMask == 0 && lllcMask == 0 && llsharMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0; // Exposure tool is deactivated if Color & Light mask SHmask is visible + lp.hsena = locallab.spots.at(sp).expshadhigh && lp.activspot && llColorMask == 0 && llsoftMask == 0 && llExpMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llretiMask == 0 && lltmMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0;// Shadow Highlight tool is deactivated if Color & Light mask or SHmask is visible + lp.vibena = locallab.spots.at(sp).expvibrance && lp.activspot && llColorMask == 0 && llsoftMask == 0 && llExpMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llretiMask == 0 && llcbMask == 0 && lltmMask == 0 && llSHMask == 0 && lllogMask == 0 && ll_Mask == 0;// vibrance tool is deactivated if Color & Light mask or SHmask is visible + lp.sharpena = locallab.spots.at(sp).expsharp && lp.activspot && llColorMask == 0 && llsoftMask == 0 && llExpMask == 0 && llcbMask == 0 && lllcMask == 0 && llretiMask == 0 && llcbMask == 0 && lltmMask == 0 && llSHMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0; + lp.sfena = locallab.spots.at(sp).expsoft && lp.activspot && llColorMask == 0 && llExpMask == 0 && llcbMask == 0 && lllcMask == 0 && llretiMask == 0 && llcbMask == 0 && lltmMask == 0 && llSHMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0; + lp.maskena = locallab.spots.at(sp).expmask && lp.activspot && llColorMask == 0 && llsoftMask == 0 && llExpMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llretiMask == 0 && llcbMask == 0 && lltmMask == 0 && lllogMask == 0 && llSHMask == 0;// vibrance tool is deactivated if Color & Light mask or SHmask is visible + lp.logena = locallab.spots.at(sp).explog && lp.activspot && llColorMask == 0 && llsoftMask == 0 && llExpMask == 0 && llcbMask == 0 && lllcMask == 0 && llsharMask == 0 && llretiMask == 0 && llcbMask == 0 && lltmMask == 0 && llSHMask == 0;// vibrance tool is deactivated if Color & Light mask or SHmask is visible + lp.sensv = local_sensiv; lp.past = chromaPastel; @@ -2122,25 +2137,35 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) double Xwsc, Zwsc; LUTu hist16J; + LUTu hist16Q; //for J light and contrast LUTf CAMBrightCurveJ; CAMBrightCurveJ(32768, LUT_CLIP_ABOVE); CAMBrightCurveJ.dirty = true; + + LUTf CAMBrightCurveQ; + CAMBrightCurveQ(32768, LUT_CLIP_ABOVE); + CAMBrightCurveQ.dirty = true; - if (CAMBrightCurveJ.dirty) { + if (CAMBrightCurveJ.dirty || CAMBrightCurveQ.dirty) { hist16J(32768); hist16J.clear(); + hist16Q(32768); + hist16Q.clear(); double sum = 0.0; // use double precision for large summations #ifdef _OPENMP const int numThreads = min(max(width * height / 65536, 1), omp_get_max_threads()); - #pragma omp parallel num_threads(numThreads) if(numThreads>1) + #pragma omp parallel num_threads(numThreads) if(numThreads>1) #endif { LUTu hist16Jthr; + LUTu hist16Qthr; hist16Jthr(hist16J.getSize()); hist16Jthr.clear(); + hist16Qthr(hist16Q.getSize()); + hist16Qthr.clear(); #ifdef _OPENMP #pragma omp for reduction(+:sum) @@ -2186,6 +2211,7 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) } hist16Jthr[(int)((koef * lab->L[i][j]))]++; //evaluate histogram luminance L # J + hist16Qthr[CLIP((int)(32768.f * sqrt((koef * (lab->L[i][j])) / 32768.f)))]++; //for brightness Q : approximation for Q=wh*sqrt(J/100) J not equal L sum += static_cast(koef) * static_cast(lab->L[i][j]); //evaluate mean J to calculate Yb //sum not used, but perhaps... } @@ -2196,7 +2222,8 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) #endif { hist16J += hist16Jthr; - } + hist16Q += hist16Qthr; + } } #ifdef _OPENMP static_cast(numThreads); // to silence cppcheck warning @@ -2205,19 +2232,28 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) //evaluate lightness, contrast } - - - - float contL = 0.f; + float lightL = 0.f; + float contQ = 0.f; + float lightQ = 0.f; + if (ciec) { contL = 0.6f *params->locallab.spots.at(sp).contl;//0.6 less effect, no need 1. + lightL = 0.4f *params->locallab.spots.at(sp).lightl;//0.4 less effect, no need 1. + contQ = 0.5f *params->locallab.spots.at(sp).contq;//0.5 less effect, no need 1. + lightQ = 0.4f *params->locallab.spots.at(sp).lightq;//0.4 less effect, no need 1. if (CAMBrightCurveJ.dirty) { - Ciecam02::curveJfloat(0.f, contL, hist16J, CAMBrightCurveJ); //contrast J + Ciecam02::curveJfloat(lightL, contL, hist16J, CAMBrightCurveJ); //lightness J and contrast J CAMBrightCurveJ /= 327.68f; CAMBrightCurveJ.dirty = false; } + + if (CAMBrightCurveQ.dirty) { + Ciecam02::curveJfloat(lightQ, contQ, hist16Q, CAMBrightCurveQ); //brightness Q and contrast Q + CAMBrightCurveQ.dirty = false; + } + } int tempo = 5000; if(params->locallab.spots.at(sp).expvibrance && call == 2) { @@ -2236,7 +2272,6 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) } } - ColorTemp::temp2mulxyz(params->wb.temperature, params->wb.method, Xw, Zw); //compute white Xw Yw Zw : white current WB ColorTemp::temp2mulxyz(tempo, "Custom", Xwout, Zwout); ColorTemp::temp2mulxyz(5000, "Custom", Xwsc, Zwsc); @@ -2248,6 +2283,15 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) //viewing condition for surround f2 = 1.0f, c2 = 0.69f, nc2 = 1.0f; if(ciec) { + //surround source with only 2 choices (because Log encoding before) + if (params->locallab.spots.at(sp).sursour == "Average") { + f = 1.0f, c = 0.69f, nc = 1.0f; + } else if (params->locallab.spots.at(sp).sursour == "Dim") { + f = 0.9f; + c = 0.59f; + nc = 0.9f; + } + //viewing condition for surround if (params->locallab.spots.at(sp).surround == "Average") { f2 = 1.0f, c2 = 0.69f, nc2 = 1.0f; @@ -2266,8 +2310,6 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) } } - - xwd = 100.0 * Xwout; zwd = 100.0 * Zwout; ywd = 100.f; @@ -2285,12 +2327,11 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) la2 = params->locallab.spots.at(sp).targabs; } - + const float pilot = 2.f; const float pilotout = 2.f; //algoritm's params - LUTu hist16Q; float yb = 18.f; yb2 = 18; if(ciec) { @@ -2300,6 +2341,7 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) } float schr = 0.f; + float mchr = 0.f; if (ciec) { schr = params->locallab.spots.at(sp).saturl; @@ -2311,6 +2353,15 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) if (schr == -100.f) { schr = -99.8f; } + + mchr = params->locallab.spots.at(sp).colorfl; + + if (mchr == -100.0f) { + mchr = -99.8f ; + } + if (mchr == 100.0f) { + mchr = 99.9f; + } } float d, dj; @@ -2320,20 +2371,16 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) yw = 100.f * Yw; zw = 100.0 * Zw; float xw1 = xws, yw1 = yws, zw1 = zws, xw2 = xwd, yw2 = ywd, zw2 = zwd; -/* - xw1 = 96.46f; //use RT WB; CAT 02 is used for output device (see prefreneces) - yw1 = 100.0f; - zw1 = 82.445f; -*/ float cz, wh, pfl; Ciecam02::initcam1float(yb, pilot, f, la, xw, yw, zw, n, d, nbb, ncb, cz, aw, wh, pfl, fl, c); -// const float chr = 0.f; const float pow1 = pow_F(1.64f - pow_F(0.29f, n), 0.73f); float nj, nbbj, ncbj, czj, awj, flj; Ciecam02::initcam2float(yb2, pilotout, f2, la2, xw2, yw2, zw2, nj, dj, nbbj, ncbj, czj, awj, flj); #ifdef __SSE2__ const float reccmcz = 1.f / (c2 * czj); #endif + const float epsil = 0.0001f; + const float coefQ = 32767.f / wh; const float pow1n = pow_F(1.64f - pow_F(0.29f, nj), 0.73f); const float coe = pow_F(fl, 0.25f); const float QproFactor = (0.4f / c) * (aw + 4.0f) ; @@ -2449,19 +2496,39 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) /* */ if(ciec) { - Jpro = CAMBrightCurveJ[Jpro * 327.68f]; //CIECAM02 + contrast - float sres; - float rstprotection = 50.f;//arbitrary 50% protection skin tones - float Sp = spro / 100.0f; - float parsat = 1.5f; //parsat=1.5 =>saturation ; 1.8 => chroma ; 2.5 => colorfullness (personal evaluation) - Ciecam02::curvecolorfloat(schr, Sp, sres, parsat); - float dred = 100.f; // in C mode + Qpro = CAMBrightCurveQ[(float)(Qpro * coefQ)] / coefQ; //brightness and contrast + float rstprotection = 50.f;//default value to avoid 1 slider + float chr = 0.f;//no use of chroma + float Mp, sres; + Mp = Mpro / 100.0f; + Ciecam02::curvecolorfloat(mchr, Mp, sres, 2.5f); + float dred = 100.f; //in C mode float protect_red = 80.0f; // in C mode - dred = 100.0f * sqrtf((dred * coe) / Qpro); - protect_red = 100.0f * sqrtf((protect_red * coe) / Qpro); + dred *= coe; //in M mode + protect_red *= coe; //M mode + Color::skinredfloat(Jpro, hpro, sres, Mp, dred, protect_red, 0, rstprotection, 100.f, Mpro); + Jpro = SQR((10.f * Qpro) / wh); + Cpro = Mpro / coe; + Qpro = (Qpro == 0.f ? epsil : Qpro); // avoid division by zero + spro = 100.0f * sqrtf(Mpro / Qpro); + + if (Jpro > 99.9f) { + Jpro = 99.9f; + } + + Jpro = CAMBrightCurveJ[(float)(Jpro * 327.68f)]; //lightness CIECAM02 + contrast + float Sp = spro / 100.0f; + Ciecam02::curvecolorfloat(schr, Sp, sres, 1.5f); + dred = 100.f; // in C mode + protect_red = 80.0f; // in C mode + dred = 100.0f * sqrtf((dred * coe) / Q); + protect_red = 100.0f * sqrtf((protect_red * coe) / Q); Color::skinredfloat(Jpro, hpro, sres, Sp, dred, protect_red, 0, rstprotection, 100.f, spro); Qpro = QproFactor * sqrtf(Jpro); - Cpro = (spro * spro * Qpro) / (10000.0f); + float Cp = (spro * spro * Qpro) / (1000000.f); + Cpro = Cp * 100.f; + Ciecam02::curvecolorfloat(chr, Cp, sres, 1.8f); + Color::skinredfloat(Jpro, hpro, sres, Cp, 55.f, 30.f, 1, rstprotection, 100.f, Cpro); } //retrieve values C,J...s @@ -5830,7 +5897,7 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform 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, 0, 0, 0, 0, locwavCurveden, locwavdenutili); + calcLocalParams(sp, oW, oH, params->locallab, lp, 0, 0, 0, 0, 0, 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; @@ -6348,6 +6415,7 @@ void ImProcFunctions::transit_shapedetect2(int call, int senstype, const LabImag const bool tmshow = ((lp.showmasktmmet == 1 || lp.showmasktmmet == 2) && senstype == 8); const bool lcshow = ((lp.showmasklcmet == 1 || lp.showmasklcmet == 2) && senstype == 10); const bool origshow = ((lp.showmasksoftmet == 5) && senstype == 3 && lp.softmet == 1); + const bool logshow = ((lp.showmasklogmet == 1 || lp.showmasklogmet == 2) && senstype == 11); const bool masshow = ((lp.showmask_met == 1) && senstype == 20); @@ -6359,6 +6427,7 @@ void ImProcFunctions::transit_shapedetect2(int call, int senstype, const LabImag const bool previewlc = ((lp.showmasklcmet == 4) && senstype == 10); const bool previeworig = ((lp.showmasksoftmet == 6) && senstype == 3 && lp.softmet == 1); const bool previewmas = ((lp.showmask_met == 3) && senstype == 20); + const bool previewlog = ((lp.showmasklogmet == 4) && senstype == 11); float radius = 3.f / sk; @@ -6397,7 +6466,8 @@ void ImProcFunctions::transit_shapedetect2(int call, int senstype, const LabImag const bool usemasktm = (lp.showmasktmmet == 2 || lp.enatmMask || lp.showmasktmmet == 4) && senstype == 8; const bool usemasklc = (lp.showmasklcmet == 2 || lp.enalcMask || lp.showmasklcmet == 4) && senstype == 10; const bool usemaskmas = (lp.showmask_met == 1 || lp.ena_Mask || lp.showmask_met == 3) && senstype == 20; - const bool usemaskall = (usemaskexp || usemaskvib || usemaskcol || usemaskSH || usemasktm || usemasklc || usemaskmas); + const bool usemasklog = (lp.showmasklogmet == 2 || lp.enaLMask || lp.showmasklogmet == 4) && senstype == 11; + const bool usemaskall = (usemaskexp || usemaskvib || usemaskcol || usemaskSH || usemasktm || usemasklc || usemasklog || usemaskmas); //blur a little mask if (usemaskall) { @@ -6582,13 +6652,13 @@ void ImProcFunctions::transit_shapedetect2(int call, int senstype, const LabImag const float difb = factorx * realstrbdE; float maxdifab = rtengine::max(std::fabs(difa), std::fabs(difb)); - if ((expshow || vibshow || colshow || SHshow || tmshow || lcshow || origshow || masshow) && lp.colorde < 0) { //show modifications with use "b" + if ((expshow || vibshow || colshow || SHshow || tmshow || lcshow || logshow || origshow || masshow) && lp.colorde < 0) { //show modifications with use "b" // (origshow && lp.colorde < 0) { //original Retinex transformed->a[y + ystart][x + xstart] = 0.f; transformed->b[y + ystart][x + xstart] = ampli * 8.f * diflc * reducdE; transformed->L[y + ystart][x + xstart] = CLIP(12000.f + 0.5f * ampli * diflc); - } else if ((expshow || vibshow || colshow || SHshow || tmshow || lcshow || origshow || masshow) && lp.colorde > 0) {//show modifications without use "b" + } else if ((expshow || vibshow || colshow || SHshow || tmshow || lcshow || logshow || origshow || masshow) && lp.colorde > 0) {//show modifications without use "b" if (diflc < 1000.f) {//if too low to be view use ab diflc += 0.5f * maxdifab; } @@ -6596,7 +6666,7 @@ void ImProcFunctions::transit_shapedetect2(int call, int senstype, const LabImag transformed->L[y + ystart][x + xstart] = CLIP(12000.f + 0.5f * ampli * diflc); transformed->a[y + ystart][x + xstart] = clipC(ampli * difa); transformed->b[y + ystart][x + xstart] = clipC(ampli * difb); - } else if (previewexp || previewvib || previewcol || previewSH || previewtm || previewlc || previeworig || previewmas || lp.prevdE) {//show deltaE + } else if (previewexp || previewvib || previewcol || previewSH || previewtm || previewlc || previewlog || previeworig || previewmas || lp.prevdE) {//show deltaE float difbdisp = reducdE * 10000.f * lp.colorde; if (transformed->L[y + ystart][x + xstart] < darklim) { //enhance dark luminance as user can see! @@ -9734,6 +9804,7 @@ void ImProcFunctions::Lab_Local( const LUTf& lmaskcblocalcurve, bool localmaskcbutili, const LUTf& lmaskbllocalcurve, bool localmaskblutili, const LUTf& lmasklclocalcurve, bool localmasklcutili, + const LUTf& lmaskloglocalcurve, bool localmasklogutili, const LUTf& lmasklocal_curve, bool localmask_utili, const LocCCmaskCurve& locccmasCurve, bool lcmasutili, const LocLLmaskCurve& locllmasCurve, bool llmasutili, const LocHHmaskCurve& lochhmasCurve, bool lhmasutili, const LocHHmaskCurve& lochhhmasCurve, bool lhhmasutili, @@ -9745,6 +9816,7 @@ void ImProcFunctions::Lab_Local( const LocCCmaskCurve& locccmastmCurve, bool lcmastmutili, const LocLLmaskCurve& locllmastmCurve, bool llmastmutili, const LocHHmaskCurve& lochhmastmCurve, bool lhmastmutili, const LocCCmaskCurve& locccmasblCurve, bool lcmasblutili, const LocLLmaskCurve& locllmasblCurve, bool llmasblutili, const LocHHmaskCurve& lochhmasblCurve, bool lhmasblutili, const LocCCmaskCurve& locccmaslcCurve, bool lcmaslcutili, const LocLLmaskCurve& locllmaslcCurve, bool llmaslcutili, const LocHHmaskCurve& lochhmaslcCurve, bool lhmaslcutili, + const LocCCmaskCurve& locccmaslogCurve, bool lcmaslogutili, const LocLLmaskCurve& locllmaslogCurve, bool llmaslogutili, const LocHHmaskCurve& lochhmaslogCurve, bool lhmaslogutili, const LocCCmaskCurve& locccmas_Curve, bool lcmas_utili, const LocLLmaskCurve& locllmas_Curve, bool llmas_utili, const LocHHmaskCurve& lochhmas_Curve, bool lhmas_utili, const LocHHmaskCurve& lochhhmas_Curve, bool lhhmas_utili, const LocwavCurve& loclmasCurveblwav, bool lmasutiliblwav, @@ -9760,7 +9832,7 @@ void ImProcFunctions::Lab_Local( bool LHutili, bool HHutili, bool CHutili, const LUTf& cclocalcurve, bool localcutili, const LUTf& rgblocalcurve, bool localrgbutili, bool localexutili, const LUTf& exlocalcurve, const LUTf& hltonecurveloc, const LUTf& shtonecurveloc, const LUTf& tonecurveloc, const LUTf& lightCurveloc, double& huerefblur, double& chromarefblur, double& lumarefblur, double& hueref, double& chromaref, double& lumaref, double& sobelref, int &lastsav, - bool prevDeltaE, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int lllcMask, int llsharMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, int ll_Mask, + bool prevDeltaE, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int lllcMask, int llsharMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, int lllogMask, int ll_Mask, float& minCD, float& maxCD, float& mini, float& maxi, float& Tmean, float& Tsigma, float& Tmin, float& Tmax ) { @@ -9773,7 +9845,7 @@ void ImProcFunctions::Lab_Local( constexpr 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 struct local_params lp; - calcLocalParams(sp, oW, oH, params->locallab, lp, prevDeltaE, llColorMask, llColorMaskinv, llExpMask, llExpMaskinv, llSHMask, llSHMaskinv, llvibMask, lllcMask, llsharMask, llcbMask, llretiMask, llsoftMask, lltmMask, llblMask, ll_Mask, locwavCurveden, locwavdenutili); + calcLocalParams(sp, oW, oH, params->locallab, lp, prevDeltaE, llColorMask, llColorMaskinv, llExpMask, llExpMaskinv, llSHMask, llSHMaskinv, llvibMask, lllcMask, llsharMask, llcbMask, llretiMask, llsoftMask, lltmMask, llblMask, lllogMask, ll_Mask, locwavCurveden, locwavdenutili); const float radius = lp.rad / (sk * 1.4f); //0 to 70 ==> see skip int levred; @@ -9790,7 +9862,7 @@ void ImProcFunctions::Lab_Local( //lastsav for save restore image lastsav = 0; - if (lp.excmet == 1 && call <= 3) {//exclude + if (lp.excmet == 1 && call <= 3 && lp.activspot) {//exclude const int bfh = int (lp.ly + lp.lyT) + del; //bfw bfh real size of square zone const int bfw = int (lp.lx + lp.lxL) + del; const int begy = lp.yc - lp.lyT; @@ -9859,7 +9931,8 @@ void ImProcFunctions::Lab_Local( } //encoding lab at the beginning - if (lp.logena) { + if (lp.logena || lp.showmasklogmet == 2 || lp.enaLMask || lp.showmasklogmet == 3 || lp.showmasklogmet == 4) { + const int ystart = rtengine::max(static_cast(lp.yc - lp.lyT) - cy, 0); const int yend = rtengine::min(static_cast(lp.yc + lp.ly) - cy, original->H); const int xstart = rtengine::max(static_cast(lp.xc - lp.lxL) - cx, 0); @@ -9871,6 +9944,16 @@ void ImProcFunctions::Lab_Local( const std::unique_ptr bufexporig(new LabImage(bfw, bfh)); //buffer for data in zone limit const std::unique_ptr bufexpfin(new LabImage(bfw, bfh)); //buffer for data in zone limit + std::unique_ptr bufmaskblurlog; + std::unique_ptr originalmasklog; + std::unique_ptr bufmaskoriglog; + + if (lp.showmasklogmet == 2 || lp.enaLMask || lp.showmasklogmet == 3 || lp.showmasklogmet == 4) { + bufmaskblurlog.reset(new LabImage(bfw, bfh)); + originalmasklog.reset(new LabImage(bfw, bfh)); + bufmaskoriglog.reset(new LabImage(bfw, bfh)); + } + #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if(multiThread) #endif @@ -9882,34 +9965,131 @@ void ImProcFunctions::Lab_Local( } } - bufexpfin->CopyFrom(bufexporig.get(), multiThread); - std::unique_ptr tmpImage(new Imagefloat(bfw, bfh)); - lab2rgb(*bufexpfin, *tmpImage, params->icm.workingProfile); - log_encode(tmpImage.get(), lp, multiThread, bfw, bfh); - rgb2lab(*(tmpImage.get()), *bufexpfin, params->icm.workingProfile); - tmpImage.reset(); - if (params->locallab.spots.at(sp).ciecam) { - ImProcFunctions::ciecamloc_02float(sp, bufexpfin.get(), 1); + int inv = 0; + bool showmaske = false; + bool enaMask = false; + bool deltaE = false; + bool modmask = false; + bool zero = false; + bool modif = false; + + if (lp.showmasklogmet == 3) { + showmaske = true; } - //here begin graduated filter - //first solution "easy" but we can do other with log_encode...to see the results - if (lp.strlog != 0.f) { - struct grad_params gplog; - calclocalGradientParams(lp, gplog, ystart, xstart, bfw, bfh, 11); + if (lp.enaLMask) { + enaMask = true; + } + + if (lp.showmasklogmet == 4) { + deltaE = true; + } + + if (lp.showmasklogmet == 2) { + modmask = true; + } + + if (lp.showmasklogmet == 1) { + modif = true; + } + + if (lp.showmasklogmet == 0) { + zero = true; + } + float chrom = lp.chromaL; + float rad = lp.radmaL; + float blendm = lp.blendmaL; + float gamma = 1.f; + float slope = 0.f; + float lap = 0.f; //params->locallab.spots.at(sp).lapmaskexp; + bool pde = false; //params->locallab.spots.at(sp).laplac; + LocwavCurve dummy; + bool lmasutilicolwav = false; + bool delt = params->locallab.spots.at(sp).deltae; + int sco = params->locallab.spots.at(sp).scopemask; + int shado = 0; + int shortcu = 0;//lp.mergemet; //params->locallab.spots.at(sp).shortc; + const float mindE = 2.f + MINSCOPE * sco * lp.thr; + const float maxdE = 5.f + MAXSCOPE * sco * (1 + 0.1f * lp.thr); + const float mindElim = 2.f + MINSCOPE * limscope * lp.thr; + const float maxdElim = 5.f + MAXSCOPE * limscope * (1 + 0.1f * lp.thr); + float amountcd = 0.f; + float anchorcd = 50.f; + int lumask = params->locallab.spots.at(sp).lumask; + LocHHmaskCurve lochhhmasCurve; + bool lhhmasutili = false; + const int highl = 0; + maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufexporig.get(), bufmaskoriglog.get(), originalmasklog.get(), original, reserved, inv, lp, + 0.f, false, + locccmaslogCurve, lcmaslogutili, locllmaslogCurve, llmaslogutili, lochhmaslogCurve, lhmaslogutili, lochhhmasCurve, lhhmasutili, multiThread, + enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskloglocalcurve, localmasklogutili, dummy, lmasutilicolwav, 1, 1, 5, 5, + shortcu, delt, hueref, chromaref, lumaref, + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1 + ); + + if (lp.showmasklogmet == 3) { + showmask(lumask, lp, xstart, ystart, cx, cy, bfw, bfh, bufexporig.get(), transformed, bufmaskoriglog.get(), 0); + + return; + } + if (lp.showmasklogmet == 0 || lp.showmasklogmet == 1 || lp.showmasklogmet == 2 || lp.showmasklogmet == 4 || lp.enaLMask) { + + bufexpfin->CopyFrom(bufexporig.get(), multiThread); + std::unique_ptr tmpImage(new Imagefloat(bfw, bfh)); + std::unique_ptr tmpImageorig(new Imagefloat(bfw, bfh)); + lab2rgb(*bufexpfin, *tmpImage, params->icm.workingProfile); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if(multiThread) #endif - for (int ir = 0; ir < bfh; ir++) { - for (int jr = 0; jr < bfw; jr++) { - bufexpfin->L[ir][jr] *= ImProcFunctions::calcGradientFactor(gplog, jr, ir); + for (int y = 0; y < bfh; y++) { + for (int x = 0; x < bfw; x++) { + tmpImageorig->r(y, x) = tmpImage->r(y, x); + tmpImageorig->g(y, x) = tmpImage->g(y, x); + tmpImageorig->b(y, x) = tmpImage->b(y, x); + } + } + + log_encode(tmpImage.get(), lp, multiThread, bfw, bfh); + float repart = 1.f - 0.01f * params->locallab.spots.at(sp).repar; + +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) if(multiThread) +#endif + for (int y = 0; y < bfh; y++) { + for (int x = 0; x < bfw; x++) { + tmpImage->r(y, x) = intp(repart, tmpImageorig->r(y, x), tmpImage->r(y, x)); + tmpImage->g(y, x) = intp(repart, tmpImageorig->g(y, x), tmpImage->g(y, x)); + tmpImage->b(y, x) = intp(repart, tmpImageorig->b(y, x), tmpImage->b(y, x)); + } + } + + rgb2lab(*(tmpImage.get()), *bufexpfin, params->icm.workingProfile); + + tmpImageorig.reset(); + tmpImage.reset(); + if (params->locallab.spots.at(sp).ciecam) { + ImProcFunctions::ciecamloc_02float(sp, bufexpfin.get(), 1); + } + + //here begin graduated filter + //first solution "easy" but we can do other with log_encode...to see the results + if (lp.strlog != 0.f) { + struct grad_params gplog; + calclocalGradientParams(lp, gplog, ystart, xstart, bfw, bfh, 11); +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) if(multiThread) +#endif + for (int ir = 0; ir < bfh; ir++) { + for (int jr = 0; jr < bfw; jr++) { + bufexpfin->L[ir][jr] *= ImProcFunctions::calcGradientFactor(gplog, jr, ir); + } } } - } //end graduated - transit_shapedetect2(call, 11, bufexporig.get(), bufexpfin.get(), nullptr, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); - + transit_shapedetect2(call, 11, bufexporig.get(), bufexpfin.get(), originalmasklog.get(), hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); + } + if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed, multiThread); float avge; @@ -13004,7 +13184,10 @@ void ImProcFunctions::Lab_Local( } else { - if (lp.expcomp != 0.f || lp.laplacexp > 0.1f) { + if (lp.expcomp != 0.f ) { // || lp.laplacexp > 0.1f + if(lp.laplacexp <= 0.1f) { + lp.laplacexp = 0.2f; //force to use Laplacian wth very small values + } ImProcFunctions::exlabLocal(lp, bfh, bfw, bfhr, bfwr, bufexporig.get(), bufexpfin.get(), hltonecurveloc, shtonecurveloc, tonecurveloc, hueref, lumaref, chromaref); } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 22b967ee7..ceea08f42 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -989,6 +989,21 @@ enum ProcEventCode { Evlocallabsurround = 963, Evlocallabsaturl = 964, Evlocallabcontl = 965, + EvlocallabCCmaskshapeL = 966, + EvlocallabLLmaskshapeL = 967, + EvlocallabHHmaskshapeL = 968, + EvLocallabEnaLMask = 969, + EvLocallabblendmaskL = 970, + EvLocallabradmaskL = 971, + EvLocallabchromaskL = 972, + EvlocallabLmaskshapeL = 973, + Evlocallablightl = 974, + EvlocallabLshapeL = 975, + Evlocallabcontq = 976, + Evlocallabsursour = 977, + Evlocallablightq = 978, + Evlocallabcolorfl = 979, + Evlocallabrepar = 980, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 9142ea109..29739506c 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3842,18 +3842,87 @@ LocallabParams::LocallabSpot::LocallabSpot() : targetGray(18.), catad(0.), saturl(0.), + lightl(0.), + lightq(0.), contl(0.), + contq(0.), + colorfl(0.), + LcurveL{ + static_cast(DCT_NURBS), + 0.0, + 0.0, + 1.0, + 1.0 + }, Autogray(true), fullimage(true), + repar(100.0), ciecam(false), blackEv(-5.0), whiteEv(10.0), detail(0.6), sensilog(60), + sursour("Average"), surround("Average"), baselog(2.), strlog(0.0), anglog(0.0), + CCmaskcurveL{ + static_cast(FCT_MinMaxCPoints), + 0.0, + 1.0, + 0.35, + 0.35, + 0.50, + 1.0, + 0.35, + 0.35, + 1.00, + 1.0, + 0.35, + 0.35 + }, + LLmaskcurveL{ + static_cast(FCT_MinMaxCPoints), + 0.0, + 1.0, + 0.35, + 0.35, + 0.50, + 1.0, + 0.35, + 0.35, + 1.00, + 1.0, + 0.35, + 0.35 + }, + HHmaskcurveL{ + static_cast(FCT_MinMaxCPoints), + 0.0, + 1.0, + 0.35, + 0.35, + 0.50, + 1.0, + 0.35, + 0.35, + 1.00, + 1.0, + 0.35, + 0.35 + }, + enaLMask(false), + blendmaskL(0), + radmaskL(0.), + chromaskL(0.), + LmaskcurveL{ + static_cast(DCT_NURBS), + 0.0, + 0.0, + 1.0, + 1.0 + }, // mask visimask(false), complexmask(0), @@ -4419,6 +4488,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const // Log encoding && visilog == other.visilog && explog == other.explog + && complexlog == other.complexlog && autocompute == other.autocompute && sourceGray == other.sourceGray && sourceabs == other.sourceabs @@ -4426,18 +4496,34 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && targetGray == other.targetGray && catad == other.catad && saturl == other.saturl + && lightl == other.lightl + && lightq == other.lightq && contl == other.contl + && contq == other.contq + && colorfl == other.colorfl + && LcurveL == other.LcurveL && Autogray == other.Autogray && fullimage == other.fullimage + && repar == other.repar && ciecam == other.ciecam && blackEv == other.blackEv && whiteEv == other.whiteEv && detail == other.detail && sensilog == other.sensilog && baselog == other.baselog + && sursour == other.sursour && surround == other.surround && strlog == other.strlog && anglog == other.anglog + && CCmaskcurveL == other.CCmaskcurveL + && LLmaskcurveL == other.LLmaskcurveL + && HHmaskcurveL == other.HHmaskcurveL + && enaLMask == other.enaLMask + && blendmaskL == other.blendmaskL + && radmaskL == other.radmaskL + && chromaskL == other.chromaskL + && LmaskcurveL == other.LmaskcurveL + // mask && visimask == other.visimask && complexmask == other.complexmask @@ -5960,6 +6046,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Log encoding if ((!pedited || spot_edited->visilog) && spot.visilog) { saveToKeyfile(!pedited || spot_edited->explog, "Locallab", "Explog_" + index_str, spot.explog, keyFile); + saveToKeyfile(!pedited || spot_edited->complexlog, "Locallab", "Complexlog_" + index_str, spot.complexlog, keyFile); saveToKeyfile(!pedited || spot_edited->autocompute, "Locallab", "Autocompute_" + index_str, spot.autocompute, keyFile); saveToKeyfile(!pedited || spot_edited->sourceGray, "Locallab", "SourceGray_" + index_str, spot.sourceGray, keyFile); saveToKeyfile(!pedited || spot_edited->sourceabs, "Locallab", "Sourceabs_" + index_str, spot.sourceabs, keyFile); @@ -5967,18 +6054,34 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->targetGray, "Locallab", "TargetGray_" + index_str, spot.targetGray, keyFile); saveToKeyfile(!pedited || spot_edited->catad, "Locallab", "Catad_" + index_str, spot.catad, keyFile); saveToKeyfile(!pedited || spot_edited->saturl, "Locallab", "Saturl_" + index_str, spot.saturl, keyFile); + saveToKeyfile(!pedited || spot_edited->LcurveL, "Locallab", "LCurveL_" + index_str, spot.LcurveL, keyFile); + saveToKeyfile(!pedited || spot_edited->lightl, "Locallab", "Lightl_" + index_str, spot.lightl, keyFile); + saveToKeyfile(!pedited || spot_edited->lightq, "Locallab", "Brightq_" + index_str, spot.lightq, keyFile); saveToKeyfile(!pedited || spot_edited->contl, "Locallab", "Contl_" + index_str, spot.contl, keyFile); + saveToKeyfile(!pedited || spot_edited->contq, "Locallab", "Contq_" + index_str, spot.contq, keyFile); + saveToKeyfile(!pedited || spot_edited->colorfl, "Locallab", "Colorfl_" + index_str, spot.colorfl, keyFile); saveToKeyfile(!pedited || spot_edited->Autogray, "Locallab", "Autogray_" + index_str, spot.Autogray, keyFile); saveToKeyfile(!pedited || spot_edited->fullimage, "Locallab", "Fullimage_" + index_str, spot.fullimage, keyFile); + saveToKeyfile(!pedited || spot_edited->repar, "Locallab", "Repart_" + index_str, spot.repar, keyFile); saveToKeyfile(!pedited || spot_edited->ciecam, "Locallab", "Ciecam_" + index_str, spot.ciecam, keyFile); saveToKeyfile(!pedited || spot_edited->blackEv, "Locallab", "BlackEv_" + index_str, spot.blackEv, keyFile); saveToKeyfile(!pedited || spot_edited->whiteEv, "Locallab", "WhiteEv_" + index_str, spot.whiteEv, keyFile); saveToKeyfile(!pedited || spot_edited->detail, "Locallab", "Detail_" + index_str, spot.detail, keyFile); saveToKeyfile(!pedited || spot_edited->sensilog, "Locallab", "Sensilog_" + index_str, spot.sensilog, keyFile); saveToKeyfile(!pedited || spot_edited->baselog, "Locallab", "Baselog_" + index_str, spot.baselog, keyFile); + saveToKeyfile(!pedited || spot_edited->sursour, "Locallab", "Sursour_" + index_str, spot.sursour, keyFile); saveToKeyfile(!pedited || spot_edited->surround, "Locallab", "Surround_" + index_str, spot.surround, keyFile); saveToKeyfile(!pedited || spot_edited->strlog, "Locallab", "Strlog_" + index_str, spot.strlog, keyFile); saveToKeyfile(!pedited || spot_edited->anglog, "Locallab", "Anglog_" + index_str, spot.anglog, keyFile); + saveToKeyfile(!pedited || spot_edited->CCmaskcurveL, "Locallab", "CCmaskCurveL_" + index_str, spot.CCmaskcurveL, keyFile); + saveToKeyfile(!pedited || spot_edited->LLmaskcurveL, "Locallab", "LLmaskCurveL_" + index_str, spot.LLmaskcurveL, keyFile); + saveToKeyfile(!pedited || spot_edited->HHmaskcurveL, "Locallab", "HHmaskCurveL_" + index_str, spot.HHmaskcurveL, keyFile); + saveToKeyfile(!pedited || spot_edited->enaLMask, "Locallab", "EnaLMask_" + index_str, spot.enaLMask, keyFile); + saveToKeyfile(!pedited || spot_edited->blendmaskL, "Locallab", "blendmaskL_" + index_str, spot.blendmaskL, keyFile); + saveToKeyfile(!pedited || spot_edited->radmaskL, "Locallab", "radmaskL_" + index_str, spot.radmaskL, keyFile); + saveToKeyfile(!pedited || spot_edited->chromaskL, "Locallab", "chromaskL_" + index_str, spot.chromaskL, keyFile); + saveToKeyfile(!pedited || spot_edited->LmaskcurveL, "Locallab", "LmaskCurveL_" + index_str, spot.LmaskcurveL, keyFile); + } //mask if ((!pedited || spot_edited->visimask) && spot.visimask) { @@ -7742,6 +7845,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) if (spot.visilog) { spotEdited.visilog = true; } + assignFromKeyfile(keyFile, "Locallab", "Complexlog_" + index_str, pedited, spot.complexlog, spotEdited.complexlog); assignFromKeyfile(keyFile, "Locallab", "Autocompute_" + index_str, pedited, spot.autocompute, spotEdited.autocompute); assignFromKeyfile(keyFile, "Locallab", "SourceGray_" + index_str, pedited, spot.sourceGray, spotEdited.sourceGray); @@ -7750,18 +7854,34 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "TargetGray_" + index_str, pedited, spot.targetGray, spotEdited.targetGray); assignFromKeyfile(keyFile, "Locallab", "Catad_" + index_str, pedited, spot.catad, spotEdited.catad); assignFromKeyfile(keyFile, "Locallab", "Saturl_" + index_str, pedited, spot.saturl, spotEdited.saturl); + assignFromKeyfile(keyFile, "Locallab", "Lightl_" + index_str, pedited, spot.lightl, spotEdited.lightl); + assignFromKeyfile(keyFile, "Locallab", "Brightq_" + index_str, pedited, spot.lightq, spotEdited.lightq); assignFromKeyfile(keyFile, "Locallab", "Contl_" + index_str, pedited, spot.contl, spotEdited.contl); + assignFromKeyfile(keyFile, "Locallab", "Contq_" + index_str, pedited, spot.contq, spotEdited.contq); + assignFromKeyfile(keyFile, "Locallab", "Colorfl_" + index_str, pedited, spot.colorfl, spotEdited.colorfl); + assignFromKeyfile(keyFile, "Locallab", "LCurveL_" + index_str, pedited, spot.LcurveL, spotEdited.LcurveL); assignFromKeyfile(keyFile, "Locallab", "AutoGray_" + index_str, pedited, spot.Autogray, spotEdited.Autogray); assignFromKeyfile(keyFile, "Locallab", "Fullimage_" + index_str, pedited, spot.fullimage, spotEdited.fullimage); + assignFromKeyfile(keyFile, "Locallab", "Repart_" + index_str, pedited, spot.repar, spotEdited.repar); assignFromKeyfile(keyFile, "Locallab", "Ciecam_" + index_str, pedited, spot.ciecam, spotEdited.ciecam); assignFromKeyfile(keyFile, "Locallab", "BlackEv_" + index_str, pedited, spot.blackEv, spotEdited.blackEv); assignFromKeyfile(keyFile, "Locallab", "WhiteEv_" + index_str, pedited, spot.whiteEv, spotEdited.whiteEv); assignFromKeyfile(keyFile, "Locallab", "Detail_" + index_str, pedited, spot.detail, spotEdited.detail); assignFromKeyfile(keyFile, "Locallab", "Sensilog_" + index_str, pedited, spot.sensilog, spotEdited.sensilog); assignFromKeyfile(keyFile, "Locallab", "Baselog_" + index_str, pedited, spot.baselog, spotEdited.baselog); + assignFromKeyfile(keyFile, "Locallab", "Sursour_" + index_str, pedited, spot.sursour, spotEdited.sursour); assignFromKeyfile(keyFile, "Locallab", "Surround_" + index_str, pedited, spot.surround, spotEdited.surround); assignFromKeyfile(keyFile, "Locallab", "Strlog_" + index_str, pedited, spot.strlog, spotEdited.strlog); assignFromKeyfile(keyFile, "Locallab", "Anglog_" + index_str, pedited, spot.anglog, spotEdited.anglog); + assignFromKeyfile(keyFile, "Locallab", "CCmaskCurveL_" + index_str, pedited, spot.CCmaskcurveL, spotEdited.CCmaskcurveL); + assignFromKeyfile(keyFile, "Locallab", "LLmaskCurveL_" + index_str, pedited, spot.LLmaskcurveL, spotEdited.LLmaskcurveL); + assignFromKeyfile(keyFile, "Locallab", "HHmaskCurveL_" + index_str, pedited, spot.HHmaskcurveL, spotEdited.HHmaskcurveL); + assignFromKeyfile(keyFile, "Locallab", "EnaLMask_" + index_str, pedited, spot.enaLMask, spotEdited.enaLMask); + assignFromKeyfile(keyFile, "Locallab", "blendmaskL_" + index_str, pedited, spot.blendmaskL, spotEdited.blendmaskL); + assignFromKeyfile(keyFile, "Locallab", "radmaskL_" + index_str, pedited, spot.radmaskL, spotEdited.radmaskL); + assignFromKeyfile(keyFile, "Locallab", "chromaskL_" + index_str, pedited, spot.chromaskL, spotEdited.chromaskL); + assignFromKeyfile(keyFile, "Locallab", "LmaskCurveL_" + index_str, pedited, spot.LmaskcurveL, spotEdited.LmaskcurveL); + // mask spot.visimask = assignFromKeyfile(keyFile, "Locallab", "Expmask_" + index_str, pedited, spot.expmask, spotEdited.expmask); assignFromKeyfile(keyFile, "Locallab", "Complexmask_" + index_str, pedited, spot.complexmask, spotEdited.complexmask); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 76561414f..3e3c5c424 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1422,6 +1422,7 @@ struct LocallabParams { // Log encoding bool visilog; bool explog; + int complexlog; bool autocompute; double sourceGray; double sourceabs; @@ -1429,18 +1430,34 @@ struct LocallabParams { double targetGray; double catad; double saturl; + double lightl; + double lightq; double contl; + double contq; + double colorfl; + std::vector LcurveL; bool Autogray; bool fullimage; + double repar; bool ciecam; double blackEv; double whiteEv; double detail; int sensilog; + Glib::ustring sursour; Glib::ustring surround; double baselog; double strlog; double anglog; + std::vector CCmaskcurveL; + std::vector LLmaskcurveL; + std::vector HHmaskcurveL; + bool enaLMask; + double blendmaskL; + double radmaskL; + double chromaskL; + std::vector LmaskcurveL; + // mask bool visimask; int complexmask; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 593e5b9c9..0a2cae7fa 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -992,7 +992,22 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabtargabs LUMINANCECURVE, // Evlocallabsurround LUMINANCECURVE, // Evlocallabsaturl - LUMINANCECURVE // Evlocallabcontl + LUMINANCECURVE, // Evlocallabcontl + LUMINANCECURVE, //EvlocallabCCmaskshapeL + LUMINANCECURVE, //EvlocallabLLmaskshapeL + LUMINANCECURVE, // EvlocallabHHmaskshapeL + LUMINANCECURVE, // EvlocallabenaLMask + LUMINANCECURVE, // EvlocallabblendmaskL + LUMINANCECURVE, // EvlocallabradmaskL + LUMINANCECURVE, // EvlocallabchromaskL + LUMINANCECURVE, //EvlocallabLmaskshapeL + LUMINANCECURVE, // Evlocallablightl + LUMINANCECURVE, // EvlocallabLshapeL + LUMINANCECURVE, // Evlocallabcontq + LUMINANCECURVE, // Evlocallabsursour + LUMINANCECURVE, // Evlocallablightq + LUMINANCECURVE, // Evlocallabcolorfl + LUMINANCECURVE // Evlocallabrepar }; diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index 74214737e..f9832ab9a 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -589,7 +589,7 @@ public: virtual void updateUnLock() = 0; - virtual void setLocallabMaskVisibility(bool previewDeltaE, int locallColorMask, int locallColorMaskinv, int locallExpMask, int locallExpMaskinv, int locallSHMask, int locallSHMaskinv, int locallvibMask, int locallsoftMask, int locallblMask, int localltmMask, int locallretiMask, int locallsharMask, int localllcMask, int locallcbMask, int locall_Mask) = 0; + virtual void setLocallabMaskVisibility(bool previewDeltaE, int locallColorMask, int locallColorMaskinv, int locallExpMask, int locallExpMaskinv, int locallSHMask, int locallSHMaskinv, int locallvibMask, int locallsoftMask, int locallblMask, int localltmMask, int locallretiMask, int locallsharMask, int localllcMask, int locallcbMask, int localllogMask, int locall_Mask) = 0; /** Creates and returns a Crop instance that acts as a window on the image * @param editDataProvider pointer to the EditDataProvider that communicates with the EditSubscriber diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index e56111806..6f0c3b29a 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1115,6 +1115,10 @@ private: LocCCmaskCurve locccmasblCurve; LocLLmaskCurve locllmasblCurve; LocHHmaskCurve lochhmasblCurve; + LocCCmaskCurve locccmaslogCurve; + LocLLmaskCurve locllmaslogCurve; + LocHHmaskCurve lochhmaslogCurve; + LocCCmaskCurve locccmas_Curve; LocLLmaskCurve locllmas_Curve; LocHHmaskCurve lochhmas_Curve; @@ -1149,6 +1153,7 @@ private: LUTf lmaskcblocalcurve(65536, LUT_CLIP_OFF); LUTf lmaskbllocalcurve(65536, LUT_CLIP_OFF); LUTf lmasklclocalcurve(65536, LUT_CLIP_OFF); + LUTf lmaskloglocalcurve(65536, LUT_CLIP_OFF); LUTf lmasklocal_curve(65536, LUT_CLIP_OFF); array2D shbuffer; @@ -1192,6 +1197,10 @@ private: const bool lcmasblutili = locccmasblCurve.Set(params.locallab.spots.at(sp).CCmaskblcurve); const bool llmasblutili = locllmasblCurve.Set(params.locallab.spots.at(sp).LLmaskblcurve); const bool lhmasblutili = lochhmasblCurve.Set(params.locallab.spots.at(sp).HHmaskblcurve); + const bool lcmaslogutili = locccmaslogCurve.Set(params.locallab.spots.at(sp).CCmaskcurveL); + const bool llmaslogutili = locllmaslogCurve.Set(params.locallab.spots.at(sp).LLmaskcurveL); + const bool lhmaslogutili = lochhmaslogCurve.Set(params.locallab.spots.at(sp).HHmaskcurveL); + const bool lcmas_utili = locccmas_Curve.Set(params.locallab.spots.at(sp).CCmask_curve); const bool llmas_utili = locllmas_Curve.Set(params.locallab.spots.at(sp).LLmask_curve); const bool lhmas_utili = lochhmas_Curve.Set(params.locallab.spots.at(sp).HHmask_curve); @@ -1223,6 +1232,7 @@ private: const bool localmaskcbutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskcbcurve, lmaskcblocalcurve, 1); const bool localmaskblutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskblcurve, lmaskbllocalcurve, 1); const bool localmasklcutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmasklccurve, lmasklclocalcurve, 1); + const bool localmasklogutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).LmaskcurveL, lmaskloglocalcurve, 1); const bool localmask_utili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmask_curve, lmasklocal_curve, 1); //provisory @@ -1273,6 +1283,7 @@ private: lmaskcblocalcurve, localmaskcbutili, lmaskbllocalcurve, localmaskblutili, lmasklclocalcurve, localmasklcutili, + lmaskloglocalcurve, localmasklogutili, lmasklocal_curve, localmask_utili, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, lochhhmasCurve, lhhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, @@ -1283,6 +1294,8 @@ private: locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, locccmaslcCurve, lcmaslcutili, locllmaslcCurve, llmaslcutili, lochhmaslcCurve, lhmaslcutili, + locccmaslogCurve, lcmaslogutili, locllmaslogCurve, llmaslogutili, lochhmaslogCurve, lhmaslogutili, + locccmas_Curve, lcmas_utili, locllmas_Curve, llmas_utili, lochhmas_Curve, lhmas_utili, lochhhmas_Curve, lhhmas_utili, loclmasCurveblwav,lmasutiliblwav, @@ -1296,7 +1309,7 @@ private: locedgwavCurve, locedgwavutili, loclmasCurve_wav,lmasutili_wav, LHutili, HHutili, CHutili, cclocalcurve, localcutili, rgblocalcurve, localrgbutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, - huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); if (sp + 1u < params.locallab.spots.size()) { diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 5ca46bc99..886fbaf64 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -1060,20 +1060,20 @@ Locallab::llMaskVisibility Locallab::getMaskVisibility() const const bool prevDeltaE = expsettings->isDeltaEPrevActive(); // Get mask preview from Locallab tools - int colorMask, colorMaskinv, expMask, expMaskinv, shMask, shMaskinv, vibMask, softMask, blMask, tmMask, retiMask, sharMask, lcMask, cbMask, maskMask; + int colorMask, colorMaskinv, expMask, expMaskinv, shMask, shMaskinv, vibMask, softMask, blMask, tmMask, retiMask, sharMask, lcMask, cbMask, logMask, maskMask; for (auto tool : locallabTools) { - tool->getMaskView(colorMask, colorMaskinv, expMask, expMaskinv, shMask, shMaskinv, vibMask, softMask, blMask, tmMask, retiMask, sharMask, lcMask, cbMask, maskMask); + tool->getMaskView(colorMask, colorMaskinv, expMask, expMaskinv, shMask, shMaskinv, vibMask, softMask, blMask, tmMask, retiMask, sharMask, lcMask, cbMask, logMask, maskMask); } // Indicate to spot control panel if one mask preview is active const bool isMaskActive = (colorMask == 0) || (colorMaskinv == 0) || (expMask == 0) || (expMaskinv == 0) || (shMask == 0) || (shMaskinv == 0) || (vibMask == 0) || (softMask == 0) || (blMask == 0) || (tmMask == 0) || (retiMask == 0) || (sharMask == 0) || - (lcMask == 0) || (cbMask == 0) || (maskMask == 0); + (lcMask == 0) || (cbMask == 0) || (logMask == 0) || (maskMask == 0); expsettings->setMaskPrevActive(isMaskActive); - return {prevDeltaE, colorMask, colorMaskinv, expMask, expMaskinv, shMask, shMaskinv, vibMask, softMask, blMask, tmMask, retiMask, sharMask, lcMask, cbMask, maskMask}; + return {prevDeltaE, colorMask, colorMaskinv, expMask, expMaskinv, shMask, shMaskinv, vibMask, softMask, blMask, tmMask, retiMask, sharMask, lcMask, cbMask, logMask, maskMask}; } void Locallab::resetshowPressed() diff --git a/rtgui/locallab.h b/rtgui/locallab.h index a6491ebd6..511e28c03 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -163,6 +163,7 @@ public: int sharMask; int lcMask; int cbMask; + int logMask; int maskMask; }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 68908b33a..da5f746dd 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -908,7 +908,7 @@ void LocallabColor::resetMaskView() showmaskcolMethodConninv.block(false); } -void LocallabColor::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) +void LocallabColor::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) { colorMask = showmaskcolMethod->get_active_row_number(); colorMaskinv = showmaskcolMethodinv->get_active_row_number(); @@ -2639,7 +2639,7 @@ void LocallabExposure::resetMaskView() showmaskexpMethodConninv.block(false); } -void LocallabExposure::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) +void LocallabExposure::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) { expMask = showmaskexpMethod->get_active_row_number(); expMaskinv = showmaskexpMethodinv->get_active_row_number(); @@ -3758,7 +3758,7 @@ void LocallabShadow::resetMaskView() showmaskSHMethodConninv.block(false); } -void LocallabShadow::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) +void LocallabShadow::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) { shMask = showmaskSHMethod->get_active_row_number(); shMaskinv = showmaskSHMethodinv->get_active_row_number(); @@ -4687,7 +4687,7 @@ void LocallabVibrance::resetMaskView() showmaskvibMethodConn.block(false); } -void LocallabVibrance::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) +void LocallabVibrance::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) { vibMask = showmaskvibMethod->get_active_row_number(); } @@ -5400,7 +5400,7 @@ void LocallabSoft::resetMaskView() showmasksoftMethodConn.block(false); } -void LocallabSoft::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) +void LocallabSoft::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) { softMask = showmasksoftMethod->get_active_row_number(); } @@ -6067,7 +6067,7 @@ void LocallabBlur::resetMaskView() showmaskblMethodConn.block(false); } -void LocallabBlur::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) +void LocallabBlur::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) { blMask = showmaskblMethod->get_active_row_number(); } @@ -6924,6 +6924,19 @@ void LocallabBlur::blMethodChanged() { // Update Blur & Noise GUI according to blMethod combobox state updateBlurGUI(); + const LocallabParams::LocallabSpot defSpot; + + if (invbl->get_active() && blMethod->get_active_row_number() == 2) { + radius->setValue(defSpot.radius); + medMethod->set_active(0); + } else if(invbl->get_active() && blMethod->get_active_row_number() == 0) { + guidbl->setValue(defSpot.guidbl); + medMethod->set_active(0); + } else if(invbl->get_active() && blMethod->get_active_row_number() == 1) { + radius->setValue(defSpot.radius); + guidbl->setValue(defSpot.guidbl); + } + if (isLocActivated && exp->getEnabled()) { if (listener) { @@ -6950,6 +6963,21 @@ void LocallabBlur::fftwblChanged() void LocallabBlur::invblChanged() { + const LocallabParams::LocallabSpot defSpot; + + if (invbl->get_active() && blMethod->get_active_row_number() == 2) { + radius->setValue(defSpot.radius); + medMethod->set_active(0); + } else if(invbl->get_active() && blMethod->get_active_row_number() == 0) { + guidbl->setValue(defSpot.guidbl); + medMethod->set_active(0); + } else if(invbl->get_active() && blMethod->get_active_row_number() == 1) { + radius->setValue(defSpot.radius); + guidbl->setValue(defSpot.guidbl); + } + + + if (isLocActivated && exp->getEnabled()) { if (listener) { if (invbl->get_active()) { @@ -7076,6 +7104,20 @@ void LocallabBlur::toolblChanged() void LocallabBlur::updateBlurGUI() { + const LocallabParams::LocallabSpot defSpot; + + if (invbl->get_active() && blMethod->get_active_row_number() == 2) { + radius->setValue(defSpot.radius); + medMethod->set_active(0); + } else if(invbl->get_active() && blMethod->get_active_row_number() == 0) { + guidbl->setValue(defSpot.guidbl); + medMethod->set_active(0); + } else if(invbl->get_active() && blMethod->get_active_row_number() == 1) { + radius->setValue(defSpot.radius); + guidbl->setValue(defSpot.guidbl); + } + + const int mode = complexity->get_active_row_number(); if (blMethod->get_active_row_number() == 0) { diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index ff8d6e6f6..1e4b1ad30 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -124,7 +124,7 @@ public: return false; }; virtual void resetMaskView() {}; - virtual void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) {}; + virtual void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) {}; // Advice tooltips management function virtual void updateAdviceTooltips(const bool showTooltips) {}; @@ -266,7 +266,7 @@ public: bool isMaskViewActive() override; void resetMaskView() override; - void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) override; + void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) override; void updateAdviceTooltips(const bool showTooltips) override; @@ -380,7 +380,7 @@ public: bool isMaskViewActive() override; void resetMaskView() override; - void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) override; + void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) override; void updateAdviceTooltips(const bool showTooltips) override; @@ -467,7 +467,7 @@ public: bool isMaskViewActive() override; void resetMaskView() override; - void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) override; + void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) override; void updateAdviceTooltips(const bool showTooltips) override; @@ -546,7 +546,7 @@ public: bool isMaskViewActive() override; void resetMaskView() override; - void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) override; + void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) override; void updateAdviceTooltips(const bool showTooltips) override; @@ -603,7 +603,7 @@ public: bool isMaskViewActive() override; void resetMaskView() override; - void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) override; + void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) override; void updateAdviceTooltips(const bool showTooltips) override; @@ -706,7 +706,7 @@ public: bool isMaskViewActive() override; void resetMaskView() override; - void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) override; + void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) override; void updateAdviceTooltips(const bool showTooltips) override; @@ -790,7 +790,7 @@ public: bool isMaskViewActive() override; void resetMaskView() override; - void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) override; + void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) override; void updateAdviceTooltips(const bool showTooltips) override; @@ -882,7 +882,7 @@ public: bool isMaskViewActive() override; void resetMaskView() override; - void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) override; + void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) override; void updateAdviceTooltips(const bool showTooltips) override; @@ -942,7 +942,7 @@ public: bool isMaskViewActive() override; void resetMaskView() override; - void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) override; + void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) override; void updateAdviceTooltips(const bool showTooltips) override; @@ -1064,7 +1064,7 @@ public: bool isMaskViewActive() override; void resetMaskView() override; - void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) override; + void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) override; void updateAdviceTooltips(const bool showTooltips) override; @@ -1155,7 +1155,7 @@ public: bool isMaskViewActive() override; void resetMaskView() override; - void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) override; + void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) override; void updateAdviceTooltips(const bool showTooltips) override; @@ -1190,6 +1190,7 @@ class LocallabLog: public LocallabTool { private: + Adjuster* const repar; Gtk::CheckButton* const ciecam; Gtk::ToggleButton* const autocompute; Gtk::Frame* const logPFrame; @@ -1200,29 +1201,59 @@ private: Gtk::CheckButton* const Autogray; Adjuster* const sourceGray; Adjuster* const sourceabs; + MyComboBoxText* const sursour; + Gtk::HBox* const surHBox; Gtk::Frame* const log1Frame; Gtk::Frame* const log2Frame; Adjuster* const targetGray; Adjuster* const detail; Adjuster* const catad; + Adjuster* const lightl; + Adjuster* const lightq; Adjuster* const contl; + Adjuster* const contq; + Adjuster* const colorfl; Adjuster* const saturl; + MyExpander* const expL; + CurveEditorGroup* const CurveEditorL; + DiagonalCurveEditor* const LshapeL; Adjuster* const targabs; MyComboBoxText* const surround; Gtk::HBox* const surrHBox; Adjuster* const baselog; Adjuster* const sensilog; + Gtk::Frame* const gradlogFrame; Adjuster* const strlog; Adjuster* const anglog; + MyExpander* const expmaskL; + MyComboBoxText* const showmaskLMethod; + Gtk::CheckButton* const enaLMask; + CurveEditorGroup* const maskCurveEditorL; + FlatCurveEditor* const CCmaskshapeL; + FlatCurveEditor* const LLmaskshapeL; + FlatCurveEditor* const HHmaskshapeL; + Adjuster* const blendmaskL; + Adjuster* const radmaskL; + Adjuster* const chromaskL; + CurveEditorGroup* const mask2CurveEditorL; + DiagonalCurveEditor* const LmaskshapeL; sigc::connection autoconn, ciecamconn, fullimageConn, AutograyConn; - sigc::connection surroundconn; - + sigc::connection surroundconn, sursourconn; + sigc::connection showmaskLMethodConn, enaLMaskConn; public: LocallabLog(); + ~LocallabLog(); + + bool isMaskViewActive() override; + void resetMaskView() override; + void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) override; + void updateAdviceTooltips(const bool showTooltips) override; void surroundChanged(); + void sursourChanged(); + void setDefaultExpanderVisibility() override; void disableListener() override; void enableListener() override; @@ -1230,16 +1261,24 @@ public: void write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr) override; void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; void adjusterChanged(Adjuster* a, double newval) override; + void curveChanged(CurveEditor* ce) override; void updateAutocompute(const float blackev, const float whiteev, const float sourceg, const float sourceab, const float targetg); private: void enabledChanged() override; + void convertParamToNormal() override; + void convertParamToSimple() override; + void updateGUIToMode(const modeType new_type) override; + void complexityModeChanged(); void autocomputeToggled(); void fullimageChanged(); void AutograyChanged(); void ciecamChanged(); + void showmaskLMethodChanged(); + void enaLMaskChanged(); + void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; void updateLogGUI(); void updateLogGUI2(); @@ -1296,7 +1335,7 @@ public: bool isMaskViewActive() override; void resetMaskView() override; - void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) override; + void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) override; void updateAdviceTooltips(const bool showTooltips) override; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index a87e35786..972a4257d 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -265,7 +265,7 @@ void LocallabTone::resetMaskView() showmasktmMethodConn.block(false); } -void LocallabTone::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) +void LocallabTone::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) { tmMask = showmasktmMethod->get_active_row_number(); } @@ -967,7 +967,7 @@ void LocallabRetinex::resetMaskView() showmaskretiMethodConn.block(false); } -void LocallabRetinex::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) +void LocallabRetinex::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) { retiMask = showmaskretiMethod->get_active_row_number(); } @@ -1837,7 +1837,7 @@ void LocallabSharp::resetMaskView() showmasksharMethodConn.block(false); } -void LocallabSharp::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) +void LocallabSharp::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) { sharMask = showmasksharMethod->get_active_row_number(); } @@ -2622,7 +2622,7 @@ void LocallabContrast::resetMaskView() showmasklcMethodConn.block(false); } -void LocallabContrast::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) +void LocallabContrast::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) { lcMask = showmasklcMethod->get_active_row_number(); } @@ -4152,7 +4152,7 @@ void LocallabCBDL::resetMaskView() showmaskcbMethodConn.block(false); } -void LocallabCBDL::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) +void LocallabCBDL::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) { cbMask = showmaskcbMethod->get_active_row_number(); } @@ -4649,9 +4649,10 @@ void LocallabCBDL::lumacontrastPlusPressed() /* ==== LocallabLog ==== */ LocallabLog::LocallabLog(): - LocallabTool(this, M("TP_LOCALLAB_LOG_TOOLNAME"), M("TP_LOCALLAB_LOG"), false, false), + LocallabTool(this, M("TP_LOCALLAB_LOG_TOOLNAME"), M("TP_LOCALLAB_LOG"), false), // Log encoding specific widgets + repar(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LOGREPART"), 1.0, 100.0, 1., 100.0))), ciecam(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_CIEC")))), autocompute(Gtk::manage(new Gtk::ToggleButton(M("TP_LOCALLAB_LOGAUTO")))), logPFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LOGPFRA")))), @@ -4662,24 +4663,49 @@ LocallabLog::LocallabLog(): Autogray(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_AUTOGRAY")))), sourceGray(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOURCE_GRAY"), 1.0, 100.0, 0.1, 10.0))), sourceabs(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOURCE_ABS"), 0.01, 16384.0, 0.01, 2000.0))), + sursour(Gtk::manage (new MyComboBoxText ())), + surHBox(Gtk::manage(new Gtk::HBox())), log1Frame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LOG1FRA")))), log2Frame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LOG2FRA")))), targetGray(Gtk::manage(new Adjuster(M("TP_LOCALLAB_TARGET_GRAY"), 5.0, 80.0, 0.1, 18.0))), detail(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DETAIL"), 0., 1., 0.01, 0.6))), catad(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CATAD"), -100., 100., 0.5, 0., Gtk::manage(new RTImage("circle-blue-small.png")), Gtk::manage(new RTImage("circle-orange-small.png"))))), - contl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTL"), -100., 100., 0.5, 0.))), + lightl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LOGLIGHTL"), -100., 100., 0.5, 0.))), + lightq(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LOGLIGHTQ"), -100., 100., 0.5, 0.))), + contl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LOGCONTL"), -100., 100., 0.5, 0.))), + contq(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LOGCONQL"), -100., 100., 0.5, 0.))), + colorfl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LOGCOLORFL"), -100., 100., 0.5, 0.))), saturl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SATURV"), -100., 100., 0.5, 0.))), + expL(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_LOGEXP")))), + CurveEditorL(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_LOGCONTQ"))), + LshapeL(static_cast(CurveEditorL->addCurve(CT_Diagonal, "Q(Q)"))), targabs(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOURCE_ABS"), 0.01, 16384.0, 0.01, 16.0))), surround(Gtk::manage (new MyComboBoxText ())), surrHBox(Gtk::manage(new Gtk::HBox())), - - baselog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BASELOG"), 1.3, 3., 0.05, 2., Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))), + baselog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BASELOG"), 1.3, 3., 0.05, 2.))),//, Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))), sensilog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), + gradlogFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADLOGFRA")))), strlog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTR"), -2.0, 2.0, 0.05, 0.))), - anglog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADANG"), -180, 180, 0.1, 0.))) + anglog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADANG"), -180, 180, 0.1, 0.))), + expmaskL(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOWC")))), + showmaskLMethod(Gtk::manage(new MyComboBoxText())), + enaLMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), + maskCurveEditorL(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASKCOL"))), + CCmaskshapeL(static_cast(maskCurveEditorL->addCurve(CT_Flat, "C(C)", nullptr, false, false))), + LLmaskshapeL(static_cast(maskCurveEditorL->addCurve(CT_Flat, "L(L)", nullptr, false, false))), + HHmaskshapeL(static_cast(maskCurveEditorL->addCurve(CT_Flat, "LC(H)", nullptr, false, true))), + blendmaskL(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), + radmaskL(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), 0.0, 100.0, 0.1, 0.))), + chromaskL(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0, 0.1, 0.))), + mask2CurveEditorL(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK2"))), + LmaskshapeL(static_cast(mask2CurveEditorL->addCurve(CT_Diagonal, "L(L)"))) + + { // Parameter Log encoding specific widgets autoconn = autocompute->signal_toggled().connect(sigc::mem_fun(*this, &LocallabLog::autocomputeToggled)); + const LocallabParams::LocallabSpot defSpot; + repar->setAdjusterListener(this); blackEv->setLogScale(2, -8); blackEv->setAdjusterListener(this); @@ -4704,10 +4730,27 @@ LocallabLog::LocallabLog(): catad->setAdjusterListener(this); + setExpandAlignProperties(expL, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + saturl->setAdjusterListener(this); + lightl->setAdjusterListener(this); + + lightq->setAdjusterListener(this); contl->setAdjusterListener(this); + contq->setAdjusterListener(this); + colorfl->setAdjusterListener(this); + + CurveEditorL->setCurveListener(this); + + LshapeL->setResetCurve(DiagonalCurveType(defSpot.LcurveL.at(0)), defSpot.LcurveL); + LshapeL->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); + LshapeL->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); + + CurveEditorL->curveListComplete(); + + targabs->setLogScale(500, 0); targabs->setAdjusterListener(this); @@ -4719,6 +4762,19 @@ LocallabLog::LocallabLog(): strlog->setAdjusterListener(this); anglog->setAdjusterListener(this); + + surHBox->set_spacing (2); + surHBox->set_tooltip_markup (M ("TP_LOCALLAB_LOGSURSOUR_TOOLTIP")); + Gtk::Label* surLabel = Gtk::manage (new Gtk::Label (M ("TP_COLORAPP_SURROUND") + ":")); + surHBox->pack_start (*surLabel, Gtk::PACK_SHRINK); + sursour->append (M ("TP_COLORAPP_SURROUND_AVER")); + sursour->append (M ("TP_COLORAPP_SURROUND_DIM")); +// sursour->append (M ("TP_COLORAPP_SURROUND_DARK")); + sursour->set_active (0); + surHBox->pack_start (*sursour); + sursourconn = sursour->signal_changed().connect ( sigc::mem_fun (*this, &LocallabLog::sursourChanged) ); + + // Gtk::HBox* surrHBox = Gtk::manage (new Gtk::HBox ()); surrHBox->set_spacing (2); @@ -4733,7 +4789,51 @@ LocallabLog::LocallabLog(): surrHBox->pack_start (*surround); surroundconn = surround->signal_changed().connect ( sigc::mem_fun (*this, &LocallabLog::surroundChanged) ); + setExpandAlignProperties(expmaskL, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + + showmaskLMethod->append(M("TP_LOCALLAB_SHOWMNONE")); + showmaskLMethod->append(M("TP_LOCALLAB_SHOWMODIF")); + showmaskLMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); + showmaskLMethod->append(M("TP_LOCALLAB_SHOWMASK")); + showmaskLMethod->append(M("TP_LOCALLAB_SHOWREF")); + showmaskLMethod->set_active(0); + showmaskLMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); + showmaskLMethodConn = showmaskLMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabLog::showmaskLMethodChanged)); + + + enaLMaskConn = enaLMask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabLog::enaLMaskChanged)); + + maskCurveEditorL->setCurveListener(this); + + CCmaskshapeL->setIdentityValue(0.); + CCmaskshapeL->setResetCurve(FlatCurveType(defSpot.CCmaskcurveL.at(0)), defSpot.CCmaskcurveL); + CCmaskshapeL->setBottomBarColorProvider(this, 1); + + LLmaskshapeL->setIdentityValue(0.); + LLmaskshapeL->setResetCurve(FlatCurveType(defSpot.LLmaskcurveL.at(0)), defSpot.LLmaskcurveL); + LLmaskshapeL->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); + + HHmaskshapeL->setIdentityValue(0.); + HHmaskshapeL->setResetCurve(FlatCurveType(defSpot.HHmaskcurveL.at(0)), defSpot.HHmaskcurveL); + HHmaskshapeL->setCurveColorProvider(this, 2); + HHmaskshapeL->setBottomBarColorProvider(this, 2); + + maskCurveEditorL->curveListComplete(); + + blendmaskL->setAdjusterListener(this); + radmaskL->setAdjusterListener(this); + chromaskL->setAdjusterListener(this); + + mask2CurveEditorL->setCurveListener(this); + + LmaskshapeL->setResetCurve(DiagonalCurveType(defSpot.LmaskcurveL.at(0)), defSpot.LmaskcurveL); + LmaskshapeL->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); + LmaskshapeL->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); + + mask2CurveEditorL->curveListComplete(); + // Add Log encoding specific widgets to GUI + pack_start(*repar); pack_start(*ciecam); logPFrame->set_label_align(0.025, 0.5); ToolParamBlock* const logPBox = Gtk::manage(new ToolParamBlock()); @@ -4749,6 +4849,7 @@ LocallabLog::LocallabLog(): logFBox->pack_start(*Autogray); logFBox->pack_start(*sourceGray); logFBox->pack_start(*sourceabs); + logFBox->pack_start (*surHBox); // logFBox->pack_start(*baselog); logFrame->add(*logFBox); pack_start(*logFrame); @@ -4757,6 +4858,15 @@ LocallabLog::LocallabLog(): logP1Box->pack_start(*detail); logP1Box->pack_start(*contl); logP1Box->pack_start(*saturl); + ToolParamBlock* const logP11Box = Gtk::manage(new ToolParamBlock()); + logP11Box->pack_start(*lightl); + logP11Box->pack_start(*lightq); + logP11Box->pack_start(*contq); + logP11Box->pack_start(*colorfl); + expL->add(*logP11Box, false); + logP1Box->pack_start(*expL, false, false); + +// logP1Box->pack_start(*CurveEditorL, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor log1Frame->add(*logP1Box); pack_start(*log1Frame); log2Frame->set_label_align(0.025, 0.5); @@ -4765,11 +4875,25 @@ LocallabLog::LocallabLog(): logP2Box->pack_start(*targabs); logP2Box->pack_start(*catad); logP2Box->pack_start (*surrHBox); + ToolParamBlock* const logP3Box = Gtk::manage(new ToolParamBlock()); + logP3Box->pack_start(*showmaskLMethod, Gtk::PACK_SHRINK, 4); + logP3Box->pack_start(*enaLMask, Gtk::PACK_SHRINK, 0); + logP3Box->pack_start(*maskCurveEditorL, Gtk::PACK_SHRINK, 4); + logP3Box->pack_start(*blendmaskL); + logP3Box->pack_start(*radmaskL); + logP3Box->pack_start(*chromaskL); + logP3Box->pack_start(*mask2CurveEditorL, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + expmaskL->add(*logP3Box, false); + + log2Frame->add(*logP2Box); pack_start(*log2Frame); + // pack_start(*baselog); pack_start(*sensilog); - Gtk::Frame* const gradlogFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADLOGFRA"))); + pack_start(*expmaskL, false, false); + + // Gtk::Frame* const gradlogFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADLOGFRA"))); gradlogFrame->set_label_align(0.025, 0.5); ToolParamBlock* const gradlogBox = Gtk::manage(new ToolParamBlock()); gradlogBox->pack_start(*strlog); @@ -4778,15 +4902,32 @@ LocallabLog::LocallabLog(): pack_start(*gradlogFrame); } +LocallabLog::~LocallabLog() +{ + delete maskCurveEditorL; + delete mask2CurveEditorL; + delete CurveEditorL; + +} + +void LocallabLog::setDefaultExpanderVisibility() +{ + expmaskL->set_expanded(false); + expL->set_expanded(false); + +} + void LocallabLog::updateAdviceTooltips(const bool showTooltips) { if (showTooltips) { exp->set_tooltip_text(M("TP_LOCALLAB_LOGENCOD_TOOLTIP")); + repar->set_tooltip_text(M("TP_LOCALLAB_LOGREPART_TOOLTIP")); logPFrame->set_tooltip_text(M("TP_LOCALLAB_LOGFRAME_TOOLTIP")); logFrame->set_tooltip_text(M("TP_LOCALLAB_LOGSCENE_TOOLTIP")); log1Frame->set_tooltip_text(M("TP_LOCALLAB_LOGIMAGE_TOOLTIP")); log2Frame->set_tooltip_text(M("TP_LOCALLAB_LOGVIEWING_TOOLTIP")); autocompute->set_tooltip_text(M("TP_LOCALLAB_LOGAUTO_TOOLTIP")); + Autogray->set_tooltip_text(M("TP_LOCALLAB_LOGAUTOGRAY_TOOLTIP")); // blackEv->set_tooltip_text(M("TP_LOCALLAB_LOGBLACKWHEV_TOOLTIP")); // whiteEv->set_tooltip_text(M("TP_LOCALLAB_LOGBLACKWHEV_TOOLTIP")); blackEv->set_tooltip_text(""); @@ -4799,18 +4940,30 @@ void LocallabLog::updateAdviceTooltips(const bool showTooltips) strlog->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); anglog->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); contl->set_tooltip_text(M("TP_LOCALLAB_LOGCONTL_TOOLTIP")); + contq->set_tooltip_text(M("TP_LOCALLAB_LOGCONTQ_TOOLTIP")); + colorfl->set_tooltip_text(M("TP_LOCALLAB_LOGCOLORF_TOOLTIP")); + lightl->set_tooltip_text(M("TP_LOCALLAB_LOGLIGHTL_TOOLTIP")); + lightq->set_tooltip_text(M("TP_LOCALLAB_LOGLIGHTQ_TOOLTIP")); saturl->set_tooltip_text(M("TP_LOCALLAB_LOGSATURL_TOOLTIP")); detail->set_tooltip_text(M("TP_LOCALLAB_LOGDETAIL_TOOLTIP")); catad->set_tooltip_text(M("TP_LOCALLAB_LOGCATAD_TOOLTIP")); - // detail->set_tooltip_text(M("TP_LOCALLAB_NUL_TOOLTIP")); - // Autogray->set_tooltip_text(M("TP_LOCALLAB_NUL_TOOLTIP")); - // sensilog->set_tooltip_text(M("TP_LOCALLAB_NUL_TOOLTIP")); - Autogray->set_tooltip_text(""); sensilog->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); fullimage->set_tooltip_text(M("TP_LOCALLAB_FULLIMAGELOG_TOOLTIP")); ciecam->set_tooltip_text(M("TP_LOCALLAB_CIECAMLOG_TOOLTIP")); + expmaskL->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); + CCmaskshapeL->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + LLmaskshapeL->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + HHmaskshapeL->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + blendmaskL->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); + radmaskL->set_tooltip_text(M("TP_LOCALLAB_LAPRAD2_TOOLTIP")); + chromaskL->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP")); +// mask2CurveEditorL->set_tooltip_text(M("TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP")); + LmaskshapeL->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); + + } else { exp->set_tooltip_text(""); + repar->set_tooltip_text(""); logPFrame->set_tooltip_text(""); logFrame->set_tooltip_text(""); log1Frame->set_tooltip_text(""); @@ -4831,8 +4984,22 @@ void LocallabLog::updateAdviceTooltips(const bool showTooltips) fullimage->set_tooltip_text(""); ciecam->set_tooltip_text(""); contl->set_tooltip_text(""); + lightl->set_tooltip_text(""); + lightq->set_tooltip_text(""); + contq->set_tooltip_text(""); + colorfl->set_tooltip_text(""); saturl->set_tooltip_text(""); catad->set_tooltip_text(""); + expmaskL->set_tooltip_markup(""); + CCmaskshapeL->setTooltip(""); + LLmaskshapeL->setTooltip(""); + HHmaskshapeL->setTooltip(""); + blendmaskL->set_tooltip_text(""); + radmaskL->set_tooltip_text(""); + chromaskL->set_tooltip_text(""); + mask2CurveEditorL->set_tooltip_text(""); + LmaskshapeL->setTooltip(""); + } } @@ -4843,8 +5010,11 @@ void LocallabLog::disableListener() autoconn.block(true); fullimageConn.block(true); ciecamconn.block(true); + enaLMaskConn.block(true); surroundconn.block (true); + sursourconn.block (true); AutograyConn.block(true); + showmaskLMethodConn.block(true); } void LocallabLog::enableListener() @@ -4854,10 +5024,33 @@ void LocallabLog::enableListener() autoconn.block(false); fullimageConn.block(false); ciecamconn.block(false); + enaLMaskConn.block(false); surroundconn.block (false); + sursourconn.block (false); AutograyConn.block(false); + showmaskLMethodConn.block(false); } +bool LocallabLog::isMaskViewActive() +{ + return ((showmaskLMethod->get_active_row_number() != 0)); +} + +void LocallabLog::resetMaskView() +{ + showmaskLMethodConn.block(true); + + showmaskLMethod->set_active(0); + + showmaskLMethodConn.block(false); +} + +void LocallabLog::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) +{ + logMask = showmaskLMethod->get_active_row_number(); +} + + void LocallabLog::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { // Disable all listeners @@ -4873,15 +5066,24 @@ void LocallabLog::read(const rtengine::procparams::ProcParams* pp, const ParamsE exp->set_visible(spot.visilog); exp->setEnabled(spot.explog); + complexity->set_active(spot.complexlog); autocompute->set_active(spot.autocompute); blackEv->setValue(spot.blackEv); + repar->setValue(spot.repar); whiteEv->setValue(spot.whiteEv); /* if(whiteEv->getValue() < 1.5){ whiteEv->setValue(1.5); } */ + if (spot.sursour == "Average") { + sursour->set_active (0); + } else if (spot.sursour == "Dim") { + sursour->set_active (1); + } + + if (spot.surround == "Average") { surround->set_active (0); } else if (spot.surround == "Dim") { @@ -4899,7 +5101,12 @@ void LocallabLog::read(const rtengine::procparams::ProcParams* pp, const ParamsE sourceabs->setValue(spot.sourceabs); catad->setValue(spot.catad); saturl->setValue(spot.saturl); + lightl->setValue(spot.lightl); + lightq->setValue(spot.lightq); contl->setValue(spot.contl); + contq->setValue(spot.contq); + colorfl->setValue(spot.colorfl); + LshapeL->setCurve(spot.LcurveL); targabs->setValue(spot.targabs); targetGray->setValue(spot.targetGray); detail->setValue(spot.detail); @@ -4907,11 +5114,24 @@ void LocallabLog::read(const rtengine::procparams::ProcParams* pp, const ParamsE sensilog->setValue((double)spot.sensilog); strlog->setValue(spot.strlog); anglog->setValue(spot.anglog); + CCmaskshapeL->setCurve(spot.CCmaskcurveL); + LLmaskshapeL->setCurve(spot.LLmaskcurveL); + HHmaskshapeL->setCurve(spot.HHmaskcurveL); + enaLMask->set_active(spot.enaLMask); + blendmaskL->setValue(spot.blendmaskL); + radmaskL->setValue(spot.radmaskL); + chromaskL->setValue(spot.chromaskL); + LmaskshapeL->setCurve(spot.LmaskcurveL); + + } // Enable all listeners enableListener(); + // Update GUI according to complexity mode + updateGUIToMode(static_cast(complexity->get_active_row_number())); + // Update Log Encoding GUI according to autocompute button state updateLogGUI(); updateLogGUI2(); @@ -4928,8 +5148,10 @@ void LocallabLog::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedi spot.explog = exp->getEnabled(); spot.visilog = exp->get_visible(); + spot.complexlog = complexity->get_active_row_number(); spot.autocompute = autocompute->get_active(); + spot.repar = repar->getValue(); spot.blackEv = blackEv->getValue(); spot.whiteEv = whiteEv->getValue(); spot.fullimage = fullimage->get_active(); @@ -4941,13 +5163,31 @@ void LocallabLog::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedi spot.targetGray = targetGray->getValue(); spot.catad = catad->getValue(); spot.saturl = saturl->getValue(); + spot.lightl = lightl->getValue(); + spot.lightq = lightq->getValue(); spot.contl = contl->getValue(); + spot.contq = contq->getValue(); + spot.colorfl = colorfl->getValue(); + spot.LcurveL = LshapeL->getCurve(); spot.detail = detail->getValue(); spot.baselog = baselog->getValue(); spot.sensilog = sensilog->getIntValue(); spot.strlog = strlog->getValue(); spot.anglog = anglog->getValue(); - + spot.CCmaskcurveL = CCmaskshapeL->getCurve(); + spot.LLmaskcurveL = LLmaskshapeL->getCurve(); + spot.HHmaskcurveL = HHmaskshapeL->getCurve(); + spot.enaLMask = enaLMask->get_active(); + spot.blendmaskL = blendmaskL->getValue(); + spot.radmaskL = radmaskL->getValue(); + spot.chromaskL = chromaskL->getValue(); + spot.LmaskcurveL = LmaskshapeL->getCurve(); + + if (sursour->get_active_row_number() == 0) { + spot.sursour = "Average"; + } else if (sursour->get_active_row_number() == 1) { + spot.sursour = "Dim"; + } if (surround->get_active_row_number() == 0) { spot.surround = "Average"; @@ -4964,6 +5204,189 @@ void LocallabLog::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedi // Note: No need to manage pedited as batch mode is deactivated for Locallab } +void LocallabLog::enaLMaskChanged() +{ + if (isLocActivated && exp->getEnabled()) { + if (listener) { + if (enaLMask->get_active()) { + listener->panelChanged(EvLocallabEnaLMask, + M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } else { + listener->panelChanged(EvLocallabEnaLMask, + M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + } +} + + + +void LocallabLog::updateGUIToMode(const modeType new_type) +{ + + switch (new_type) { + case Simple: + // Expert and Normal mode widgets are hidden in Simple mode + ciecam->hide(); + ciecam->set_active(false); + sourceabs->hide(); + targabs->hide(); + saturl->hide(); + contl->hide(); + lightl->hide(); + lightq->hide(); + contq->hide(); + colorfl->hide(); + catad->hide(); + surrHBox->hide(); + expL->hide(); + surHBox->hide(); + expmaskL->hide(); + gradlogFrame->hide(); + break; + + case Normal: + // Expert mode widgets are hidden in Normal mode + ciecam->hide(); + ciecam->set_active(true); + + sourceabs->show(); + targabs->show(); + catad->show(); + saturl->show(); + lightl->show(); + lightq->show(); + contl->show(); + contq->show(); + colorfl->show(); + surrHBox->show(); + expL->hide(); + surHBox->hide(); + expmaskL->hide(); + gradlogFrame->show(); + + break; + + case Expert: + // Show widgets hidden in Normal and Simple mode + ciecam->hide(); + ciecam->set_active(true); + sourceabs->show(); + targabs->show(); + catad->show(); + saturl->show(); + lightl->show(); + lightq->show(); + contl->show(); + contq->show(); + colorfl->show(); + surrHBox->show(); + expL->show(); + expmaskL->show(); + gradlogFrame->show(); + surHBox->show(); + + } +} + + + + +void LocallabLog::convertParamToSimple() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + ciecam->set_active(false); + contq->setValue(defSpot.contq); + colorfl->setValue(defSpot.colorfl); + lightl->setValue(defSpot.lightl); + lightq->setValue(defSpot.lightq); + sursour->set_active(0); + strlog->setValue(defSpot.strlog); + anglog->setValue(defSpot.anglog); + enaLMask->set_active(false); + // Enable all listeners + enableListener(); +} + + +void LocallabLog::convertParamToNormal() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + ciecam->set_active(true); + contq->setValue(defSpot.contq); + colorfl->setValue(defSpot.colorfl); + lightl->setValue(defSpot.lightl); + lightq->setValue(defSpot.lightq); + sursour->set_active(0); + enaLMask->set_active(false); + // Enable all listeners + enableListener(); + +} + + + +void LocallabLog::showmaskLMethodChanged() +{ + + // If mask preview is activated, deactivate all other tool mask preview + if (locToolListener) { + locToolListener->resetOtherMaskView(this); + } + + if (listener) { + listener->panelChanged(EvlocallabshowmaskMethod, ""); + } +} + +void LocallabLog::curveChanged(CurveEditor* ce) +{ + if (isLocActivated && exp->getEnabled()) { + if (ce == HHmaskshapeL) { + if (listener) { + listener->panelChanged(EvlocallabHHmaskshapeL, + M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (ce == LLmaskshapeL) { + if (listener) { + listener->panelChanged(EvlocallabLLmaskshapeL, + M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (ce == CCmaskshapeL) { + if (listener) { + listener->panelChanged(EvlocallabCCmaskshapeL, + M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (ce == LmaskshapeL) { + if (listener) { + listener->panelChanged(EvlocallabLmaskshapeL, + M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (ce == LshapeL) { + if (listener) { + listener->panelChanged(EvlocallabLshapeL, + M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + } +} + + void LocallabLog::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { const int index = defParams->locallab.selspot; @@ -4972,6 +5395,7 @@ void LocallabLog::setDefaults(const rtengine::procparams::ProcParams* defParams, const LocallabParams::LocallabSpot& defSpot = defParams->locallab.spots.at(index); // Set default value for adjuster widgets + repar->setDefault(defSpot.repar); blackEv->setDefault(defSpot.blackEv); whiteEv->setDefault(defSpot.whiteEv); sourceGray->setDefault(defSpot.sourceGray); @@ -4980,12 +5404,21 @@ void LocallabLog::setDefaults(const rtengine::procparams::ProcParams* defParams, targetGray->setDefault(defSpot.targetGray); catad->setDefault(defSpot.catad); saturl->setDefault(defSpot.saturl); + lightl->setDefault(defSpot.lightl); + lightq->setDefault(defSpot.lightq); contl->setDefault(defSpot.contl); + contq->setDefault(defSpot.contq); + colorfl->setDefault(defSpot.colorfl); detail->setDefault(defSpot.detail); baselog->setDefault(defSpot.baselog); sensilog->setDefault((double)defSpot.sensilog); strlog->setDefault(defSpot.strlog); anglog->setDefault(defSpot.anglog); + blendmaskL->setDefault(defSpot.blendmaskL); + radmaskL->setDefault(defSpot.radmaskL); + chromaskL->setDefault(defSpot.chromaskL); + + } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -4994,6 +5427,13 @@ void LocallabLog::setDefaults(const rtengine::procparams::ProcParams* defParams, void LocallabLog::adjusterChanged(Adjuster* a, double newval) { if (isLocActivated && exp->getEnabled()) { + if (a == repar) { + if (listener) { + listener->panelChanged(Evlocallabrepar, + repar->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == blackEv) { if (listener) { listener->panelChanged(EvlocallabblackEv, @@ -5050,6 +5490,21 @@ void LocallabLog::adjusterChanged(Adjuster* a, double newval) } } + if (a == lightl) { + if (listener) { + listener->panelChanged(Evlocallablightl, + lightl->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lightq) { + if (listener) { + listener->panelChanged(Evlocallablightq, + lightq->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == contl) { if (listener) { listener->panelChanged(Evlocallabcontl, @@ -5057,6 +5512,20 @@ void LocallabLog::adjusterChanged(Adjuster* a, double newval) } } + if (a == contq) { + if (listener) { + listener->panelChanged(Evlocallabcontq, + contq->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == colorfl) { + if (listener) { + listener->panelChanged(Evlocallabcolorfl, + colorfl->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == detail) { if (listener) { listener->panelChanged(Evlocallabdetail, @@ -5091,6 +5560,29 @@ void LocallabLog::adjusterChanged(Adjuster* a, double newval) anglog->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); } } + + if (a == blendmaskL) { + if (listener) { + listener->panelChanged(EvLocallabblendmaskL, + blendmaskL->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == radmaskL) { + if (listener) { + listener->panelChanged(EvLocallabradmaskL, + radmaskL->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == chromaskL) { + if (listener) { + listener->panelChanged(EvLocallabchromaskL, + chromaskL->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + } } @@ -5131,6 +5623,17 @@ void LocallabLog::enabledChanged() } } +void LocallabLog::sursourChanged() +{ + if (isLocActivated && exp->getEnabled()) { + if (listener) { + listener->panelChanged(Evlocallabsursour, + sursour->get_active_text() + " (" + escapeHtmlChars(spotName) + ")"); + } + } +} + + void LocallabLog::surroundChanged() { if (isLocActivated && exp->getEnabled()) { @@ -5161,27 +5664,32 @@ void LocallabLog::autocomputeToggled() void LocallabLog::ciecamChanged() { + /* if(ciecam->get_active()){ - /* sourceabs->set_sensitive(true); + sourceabs->set_sensitive(true); targabs->set_sensitive(true); catad->set_sensitive(true); surrHBox->set_sensitive(true); - */ + sourceabs->show(); targabs->show(); catad->show(); saturl->show(); + lightl->show(); contl->show(); + contq->show(); surrHBox->show(); } else { sourceabs->hide(); targabs->hide(); saturl->hide(); contl->hide(); + lightl->hide(); + contq->hide(); catad->hide(); surrHBox->hide(); } - +*/ if (isLocActivated && exp->getEnabled()) { if (listener) { if (ciecam->get_active()) { @@ -5211,6 +5719,25 @@ void LocallabLog::fullimageChanged() } } +void LocallabLog::updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) +{ + idle_register.add( + [this, normHuer, normLumar, normChromar]() -> bool { + GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected + + // Update mask background + CCmaskshapeL->updateLocallabBackground(normChromar); + LLmaskshapeL->updateLocallabBackground(normLumar); + HHmaskshapeL->updateLocallabBackground(normHuer); + LmaskshapeL->updateLocallabBackground(normLumar); + + return false; + } + ); +} + + + void LocallabLog::AutograyChanged() { if (isLocActivated && exp->getEnabled()) { @@ -5228,39 +5755,51 @@ void LocallabLog::AutograyChanged() void LocallabLog::updateLogGUI2() { + /* if(ciecam->get_active()){ sourceabs->show(); targabs->show(); catad->show(); saturl->show(); contl->show(); + lightl->show(); + contq->show(); surrHBox->show(); } else { sourceabs->hide(); targabs->hide(); catad->hide(); saturl->hide(); + lightl->hide(); contl->hide(); + contq->hide(); surrHBox->hide(); } + */ } void LocallabLog::updateLogGUI() { + const int mode = complexity->get_active_row_number(); + if (autocompute->get_active()) { blackEv->set_sensitive(false); whiteEv->set_sensitive(false); sourceGray->set_sensitive(false); - sourceabs->set_sensitive(false); + if (mode == Expert || mode == Normal) { + sourceabs->set_sensitive(false); + } else { + sourceabs->hide(); + } } else { blackEv->set_sensitive(true); whiteEv->set_sensitive(true); sourceGray->set_sensitive(true); - if(ciecam->get_active()){ + if (mode == Expert || mode == Normal){ sourceabs->set_sensitive(true); } else { - sourceabs->set_sensitive(false); + sourceabs->hide(); } } } @@ -5467,7 +6006,7 @@ void LocallabMask::resetMaskView() showmask_MethodConn.block(false); } -void LocallabMask::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &maskMask) +void LocallabMask::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) { maskMask = showmask_Method->get_active_row_number(); } diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 83341592a..5e5fade1f 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1494,6 +1494,7 @@ void ParamsEdited::initFrom(const std::vector& // Log encoding locallab.spots.at(j).visilog = locallab.spots.at(j).visilog && pSpot.visilog == otherSpot.visilog; locallab.spots.at(j).explog = locallab.spots.at(j).explog && pSpot.explog == otherSpot.explog; + locallab.spots.at(j).complexlog = locallab.spots.at(j).complexlog && pSpot.complexlog == otherSpot.complexlog; locallab.spots.at(j).autocompute = locallab.spots.at(j).autocompute && pSpot.autocompute == otherSpot.autocompute; locallab.spots.at(j).sourceGray = locallab.spots.at(j).sourceGray && pSpot.sourceGray == otherSpot.sourceGray; locallab.spots.at(j).sourceabs = locallab.spots.at(j).sourceabs && pSpot.sourceabs == otherSpot.sourceabs; @@ -1501,18 +1502,35 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).targetGray = locallab.spots.at(j).targetGray && pSpot.targetGray == otherSpot.targetGray; locallab.spots.at(j).catad = locallab.spots.at(j).catad && pSpot.catad == otherSpot.catad; locallab.spots.at(j).saturl = locallab.spots.at(j).saturl && pSpot.saturl == otherSpot.saturl; + locallab.spots.at(j).lightl = locallab.spots.at(j).lightl && pSpot.lightl == otherSpot.lightl; + locallab.spots.at(j).lightq = locallab.spots.at(j).lightq && pSpot.lightq == otherSpot.lightq; locallab.spots.at(j).contl = locallab.spots.at(j).contl && pSpot.contl == otherSpot.contl; + locallab.spots.at(j).contq = locallab.spots.at(j).contq && pSpot.contq == otherSpot.contq; + locallab.spots.at(j).colorfl = locallab.spots.at(j).colorfl && pSpot.colorfl == otherSpot.colorfl; + locallab.spots.at(j).LcurveL = locallab.spots.at(j).LcurveL && pSpot.LcurveL == otherSpot.LcurveL; locallab.spots.at(j).Autogray = locallab.spots.at(j).Autogray && pSpot.Autogray == otherSpot.Autogray; locallab.spots.at(j).fullimage = locallab.spots.at(j).fullimage && pSpot.fullimage == otherSpot.fullimage; locallab.spots.at(j).ciecam = locallab.spots.at(j).ciecam && pSpot.ciecam == otherSpot.ciecam; + locallab.spots.at(j).enaLMask = locallab.spots.at(j).enaLMask && pSpot.enaLMask == otherSpot.enaLMask; + locallab.spots.at(j).repar = locallab.spots.at(j).repar && pSpot.repar == otherSpot.repar; locallab.spots.at(j).blackEv = locallab.spots.at(j).blackEv && pSpot.blackEv == otherSpot.blackEv; locallab.spots.at(j).whiteEv = locallab.spots.at(j).whiteEv && pSpot.whiteEv == otherSpot.whiteEv; locallab.spots.at(j).detail = locallab.spots.at(j).detail && pSpot.detail == otherSpot.detail; + locallab.spots.at(j).sursour = locallab.spots.at(j).sursour && pSpot.sursour == otherSpot.sursour; locallab.spots.at(j).surround = locallab.spots.at(j).surround && pSpot.surround == otherSpot.surround; locallab.spots.at(j).sensilog = locallab.spots.at(j).sensilog && pSpot.sensilog == otherSpot.sensilog; locallab.spots.at(j).baselog = locallab.spots.at(j).baselog && pSpot.baselog == otherSpot.baselog; locallab.spots.at(j).strlog = locallab.spots.at(j).strlog && pSpot.strlog == otherSpot.strlog; locallab.spots.at(j).anglog = locallab.spots.at(j).anglog && pSpot.anglog == otherSpot.anglog; + locallab.spots.at(j).CCmaskcurveL = locallab.spots.at(j).CCmaskcurveL && pSpot.CCmaskcurveL == otherSpot.CCmaskcurveL; + locallab.spots.at(j).LLmaskcurveL = locallab.spots.at(j).LLmaskcurveL && pSpot.LLmaskcurveL == otherSpot.LLmaskcurveL; + locallab.spots.at(j).HHmaskcurveL = locallab.spots.at(j).HHmaskcurveL && pSpot.HHmaskcurveL == otherSpot.HHmaskcurveL; + locallab.spots.at(j).blendmaskL = locallab.spots.at(j).blendmaskL && pSpot.blendmaskL == otherSpot.blendmaskL; + locallab.spots.at(j).radmaskL = locallab.spots.at(j).radmaskL && pSpot.radmaskL == otherSpot.radmaskL; + locallab.spots.at(j).chromaskL = locallab.spots.at(j).chromaskL && pSpot.chromaskL == otherSpot.chromaskL; + locallab.spots.at(j).LmaskcurveL = locallab.spots.at(j).LmaskcurveL && pSpot.LmaskcurveL == otherSpot.LmaskcurveL; + + //mask locallab.spots.at(j).visimask = locallab.spots.at(j).visimask && pSpot.visimask == otherSpot.visimask; locallab.spots.at(j).complexmask = locallab.spots.at(j).complexmask && pSpot.complexmask == otherSpot.complexmask; @@ -4850,6 +4868,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).explog = mods.locallab.spots.at(i).explog; } + if (locallab.spots.at(i).complexlog) { + toEdit.locallab.spots.at(i).complexlog = mods.locallab.spots.at(i).complexlog; + } + if (locallab.spots.at(i).autocompute) { toEdit.locallab.spots.at(i).autocompute = mods.locallab.spots.at(i).autocompute; } @@ -4878,10 +4900,30 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).saturl = mods.locallab.spots.at(i).saturl; } + if (locallab.spots.at(i).lightl) { + toEdit.locallab.spots.at(i).lightl = mods.locallab.spots.at(i).lightl; + } + + if (locallab.spots.at(i).lightq) { + toEdit.locallab.spots.at(i).lightq = mods.locallab.spots.at(i).lightq; + } + if (locallab.spots.at(i).contl) { toEdit.locallab.spots.at(i).contl = mods.locallab.spots.at(i).contl; } + if (locallab.spots.at(i).contq) { + toEdit.locallab.spots.at(i).contq = mods.locallab.spots.at(i).contq; + } + + if (locallab.spots.at(i).colorfl) { + toEdit.locallab.spots.at(i).colorfl = mods.locallab.spots.at(i).colorfl; + } + + if (locallab.spots.at(i).LcurveL) { + toEdit.locallab.spots.at(i).LcurveL = mods.locallab.spots.at(i).LcurveL; + } + if (locallab.spots.at(i).Autogray) { toEdit.locallab.spots.at(i).Autogray = mods.locallab.spots.at(i).Autogray; } @@ -4894,6 +4936,14 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).ciecam = mods.locallab.spots.at(i).ciecam; } + if (locallab.spots.at(i).enaLMask) { + toEdit.locallab.spots.at(i).enaLMask = mods.locallab.spots.at(i).enaLMask; + } + + if (locallab.spots.at(i).repar) { + toEdit.locallab.spots.at(i).repar = mods.locallab.spots.at(i).repar; + } + if (locallab.spots.at(i).blackEv) { toEdit.locallab.spots.at(i).blackEv = mods.locallab.spots.at(i).blackEv; } @@ -4914,6 +4964,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).baselog = mods.locallab.spots.at(i).baselog; } + if (locallab.spots.at(i).sursour) { + toEdit.locallab.spots.at(i).sursour = mods.locallab.spots.at(i).sursour; + } + if (locallab.spots.at(i).surround) { toEdit.locallab.spots.at(i).surround = mods.locallab.spots.at(i).surround; } @@ -4925,7 +4979,35 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng if (locallab.spots.at(i).anglog) { toEdit.locallab.spots.at(i).anglog = mods.locallab.spots.at(i).anglog; } - + + if (locallab.spots.at(i).CCmaskcurveL) { + toEdit.locallab.spots.at(i).CCmaskcurveL = mods.locallab.spots.at(i).CCmaskcurveL; + } + + if (locallab.spots.at(i).LLmaskcurveL) { + toEdit.locallab.spots.at(i).LLmaskcurveL = mods.locallab.spots.at(i).LLmaskcurveL; + } + + if (locallab.spots.at(i).HHmaskcurveL) { + toEdit.locallab.spots.at(i).HHmaskcurveL = mods.locallab.spots.at(i).HHmaskcurveL; + } + + if (locallab.spots.at(i).blendmaskL) { + toEdit.locallab.spots.at(i).blendmaskL = mods.locallab.spots.at(i).blendmaskL; + } + + if (locallab.spots.at(i).radmaskL) { + toEdit.locallab.spots.at(i).radmaskL = mods.locallab.spots.at(i).radmaskL; + } + + if (locallab.spots.at(i).chromaskL) { + toEdit.locallab.spots.at(i).chromaskL = mods.locallab.spots.at(i).chromaskL; + } + + if (locallab.spots.at(i).LmaskcurveL) { + toEdit.locallab.spots.at(i).LmaskcurveL = mods.locallab.spots.at(i).LmaskcurveL; + } + // mask if (locallab.spots.at(i).visimask) { toEdit.locallab.spots.at(i).visimask = mods.locallab.spots.at(i).visimask; @@ -6673,6 +6755,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : // Log encoding visilog(v), explog(v), + complexlog(v), autocompute(v), sourceGray(v), sourceabs(v), @@ -6680,18 +6763,33 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : targetGray(v), catad(v), saturl(v), + lightl(v), + lightq(v), contl(v), + contq(v), + colorfl(v), + LcurveL(v), Autogray(v), fullimage(v), + repar(v), ciecam(v), blackEv(v), whiteEv(v), detail(v), + sursour(v), surround(v), sensilog(v), baselog(v), strlog(v), anglog(v), + CCmaskcurveL(v), + LLmaskcurveL(v), + HHmaskcurveL(v), + enaLMask(v), + blendmaskL(v), + radmaskL(v), + chromaskL(v), + LmaskcurveL(v), // mask visimask(v), complexmask(v), @@ -7175,6 +7273,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) // Log encoding visilog = v; explog = v; + complexlog = v; autocompute = v; sourceGray = v; sourceabs = v; @@ -7182,18 +7281,33 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) targetGray = v; catad = v; saturl = v; + lightl = v; + lightq = v; contl = v; + contq = v; + colorfl = v; + LcurveL = v; Autogray = v; fullimage = v; + repar = v; ciecam = v; blackEv = v; whiteEv = v; detail = v; + sursour = v; surround = v; sensilog = v; baselog = v; strlog = v; anglog = v; + CCmaskcurveL = v; + LLmaskcurveL = v; + HHmaskcurveL = v; + enaLMask = v; + blendmaskL = v; + radmaskL = v; + chromaskL = v; + LmaskcurveL = v; // mask visimask = v; complexmask = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 10996c27c..7d682c4f9 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -830,6 +830,7 @@ public: // Log encoding bool visilog; bool explog; + bool complexlog; bool autocompute; bool sourceGray; bool sourceabs; @@ -837,18 +838,33 @@ public: bool targetGray; bool catad; bool saturl; + bool lightl; + bool lightq; bool contl; + bool contq; + bool colorfl; + bool LcurveL; bool Autogray; bool fullimage; + bool repar; bool ciecam; bool blackEv; bool whiteEv; bool detail; + bool sursour; bool surround; bool sensilog; bool baselog; bool strlog; bool anglog; + bool CCmaskcurveL; + bool LLmaskcurveL; + bool HHmaskcurveL; + bool enaLMask; + bool blendmaskL; + bool radmaskL; + bool chromaskL; + bool LmaskcurveL; //mask bool visimask; bool complexmask; diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 30c3d22ef..cd24897a5 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -537,12 +537,12 @@ void ToolPanelCoordinator::panelChanged(const rtengine::ProcEvent& event, const ipc->setLocallabMaskVisibility(maskStruc.previewDeltaE, maskStruc.colorMask, maskStruc.colorMaskinv, maskStruc.expMask, maskStruc.expMaskinv, maskStruc.SHMask, maskStruc.SHMaskinv, maskStruc.vibMask, maskStruc.softMask, maskStruc.blMask, maskStruc.tmMask, maskStruc.retiMask, maskStruc.sharMask, - maskStruc.lcMask, maskStruc.cbMask, maskStruc.maskMask); + maskStruc.lcMask, maskStruc.cbMask, maskStruc.logMask, maskStruc.maskMask); } else if (event == rtengine::EvLocallabSpotCreated || event == rtengine::EvLocallabSpotSelectedWithMask || event == rtengine::EvLocallabSpotDeleted || event == rtengine::Evlocallabshowreset || event == rtengine::EvlocallabToolRemovedWithRefresh) { locallab->resetMaskVisibility(); - ipc->setLocallabMaskVisibility(false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + ipc->setLocallabMaskVisibility(false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } ipc->endUpdateParams(changeFlags); // starts the IPC processing @@ -652,7 +652,7 @@ void ToolPanelCoordinator::profileChange( // Reset Locallab mask visibility locallab->resetMaskVisibility(); - ipc->setLocallabMaskVisibility(false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + ipc->setLocallabMaskVisibility(false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); // start the IPC processing if (filterRawRefresh) { diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index 909b906ad..2057847df 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -3254,9 +3254,9 @@ void Wavelet::convertParamToNormal() levelsigm->setValue(def_params.levelsigm); leveldenoise->setValue(def_params.leveldenoise); limden->setValue(def_params.limden); - + thrden->setValue(def_params.thrden); // quamethod->set_active(0); -// sigm->setValue(def_params.sigm); + sigm->setValue(def_params.sigm); //toning exptoning->setEnabled(def_params.exptoning); //gamut @@ -3309,12 +3309,12 @@ void Wavelet::updateGUIToMode(int mode) denHBox->hide(); mixHBox->hide(); sliHBox->hide(); - sigm->show(); + sigm->hide(); levelsigm->hide(); CurveEditorwavnoiseh->hide(); CurveEditorwavnoise->hide(); // levden->hide(); - thrden->show(); + thrden->hide(); leveldenoise->hide(); limden->hide(); } else {