From 691fe8089601c08986f00d06f3629d7a70312e84 Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 14 Nov 2024 10:29:29 +0100 Subject: [PATCH] Revert "Generalized Hyperbolic Stretch in Selective Editing (#7210)" (#7250) This reverts commit 16db6186ddf4f1d8e2cc0c6d744071ce1195163d. --- .github/workflows/appimage.yml | 2 +- .github/workflows/windows.yml | 2 +- rtdata/languages/default | 64 +- rtengine/dcrop.cc | 22 +- rtengine/improccoordinator.cc | 52 +- rtengine/improccoordinator.h | 1 - rtengine/improcfun.h | 15 +- rtengine/iplab2rgb.cc | 48 +- rtengine/iplocallab.cc | 1056 ++------------------------ rtengine/procparams.cc | 165 +--- rtengine/procparams.h | 37 - rtengine/rtengine.h | 12 - rtengine/simpleprocess.cc | 15 +- rtgui/colortoning.cc | 13 +- rtgui/curveeditor.cc | 22 +- rtgui/curveeditor.h | 2 +- rtgui/curveeditorgroup.cc | 6 +- rtgui/curveeditorgroup.h | 2 +- rtgui/diagonalcurveeditorsubgroup.cc | 26 +- rtgui/diagonalcurveeditorsubgroup.h | 4 +- rtgui/icmpanel.cc | 19 +- rtgui/labgrid.cc | 276 ++----- rtgui/labgrid.h | 49 +- rtgui/locallab.cc | 35 - rtgui/locallab.h | 10 - rtgui/locallabtools.cc | 669 +--------------- rtgui/locallabtools.h | 56 +- rtgui/locallabtools2.cc | 23 +- rtgui/options.cc | 7 - rtgui/options.h | 1 - rtgui/paramsedited.cc | 263 ------- rtgui/paramsedited.h | 37 - rtgui/wavelet.cc | 9 +- 33 files changed, 255 insertions(+), 2765 deletions(-) diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index dd9be1866..787b2822c 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -15,7 +15,7 @@ on: workflow_dispatch: env: - publish_pre_dev_labels: '["Beep6581:ghs"]' + publish_pre_dev_labels: '[]' jobs: build: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 46de249bd..6e36f3b5e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -15,7 +15,7 @@ on: workflow_dispatch: env: - publish_pre_dev_labels: '["Beep6581:ghs"]' + publish_pre_dev_labels: '[]' jobs: diff --git a/rtdata/languages/default b/rtdata/languages/default index 06a811c12..e3437d07c 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1522,25 +1522,11 @@ HISTORY_MSG_LOCAL_FEATHERSH;Local - SH Gradient feather HISTORY_MSG_LOCAL_FEATHERVIB;Local - Vib Gradient feather HISTORY_MSG_LOCAL_FEATHERWAV;Local - Wav Gradient feather HISTORY_MSG_LOCAL_GAMUTMUNSEL;Local - SC - Avoid Color Shift -HISTORY_MSG_LOCAL_GHSMETHOD;Local - GHS - Method -HISTORY_MSG_LOCAL_GHS_D;Local - GHS - Strech factor -HISTORY_MSG_LOCAL_GHS_SLOPE;Local - GHS - Lab slope factor -HISTORY_MSG_LOCAL_GHS_CHRO;Local - GHS - Lab chromaticity factor -HISTORY_MSG_LOCAL_GHS_B;Local - GHS - Local intensity -HISTORY_MSG_LOCAL_GHS_SP;Local - GHS - Symmetry point -HISTORY_MSG_LOCAL_GHS_LP;Local - GHS - Protect shadows -HISTORY_MSG_LOCAL_GHS_HP;Local - GHS - Protect highlights -HISTORY_MSG_LOCAL_GHS_LC;Local - GHS - Local Contrast -HISTORY_MSG_LOCAL_GHS_BLP;Local - GHS - Black point -HISTORY_MSG_LOCAL_GHS_HLP;Local - GHS - White point -HISTORY_MSG_LOCAL_GHS_INV;Local - GHS - Inverse -HISTORY_MSG_LOCAL_GHS_SMOOTH;Local - GHS - Highlight Attenuation HISTORY_MSG_LOCAL_LOG_BLACKS;Local - Log Blacks distribution HISTORY_MSG_LOCAL_LOG_COMPR;Local - Log Compress brightness HISTORY_MSG_LOCAL_LOG_SAT;Local - Log Saturation control HISTORY_MSG_LOCAL_LOG_WHITES;Local - Log Whites distribution HISTORY_MSG_LOCAL_TMO_SATUR;Local Exp Fattal Saturation -HISTORY_MSG_LOCAL_NLITER;Local - Nlmeans - Iterations HISTORY_MSG_METADATA_MODE;Metadata copy mode HISTORY_MSG_MICROCONTRAST_CONTRAST;Microcontrast - Contrast threshold HISTORY_MSG_PDSHARPEN_AUTO_CONTRAST;CS - Auto threshold @@ -3147,49 +3133,6 @@ TP_LOCALLAB_GAMUTNON;None TP_LOCALLAB_GAMUTXYZABSO;XYZ Absolute TP_LOCALLAB_GAMUTXYZRELA;XYZ Relative TP_LOCALLAB_GAMW;Gamma (wavelet pyramids) -TP_LOCALLAB_GHSBPWP;Clipped Black point=%1 White point=%2 -TP_LOCALLAB_GHSBPWPVALUE;Value Black point=%1 White point=%2 -TP_LOCALLAB_GHS_GHSDIAG;GHS Simulation -TP_LOCALLAB_GHS_SIMUL_TOOLTIP;Gives a simplified representation of the GHS function - it only uses 7 points for the sake of code simplification. -TP_LOCALLAB_GHSRGBLUM;RGB Luminance -TP_LOCALLAB_GHSRGBSTD;RGB Standard -TP_LOCALLAB_GHSLAB;Luminance & chromaticity (Lab) -TP_LOCALLAB_GHSHUE;Hue (HSL) -TP_LOCALLAB_GHSLUM;Luminance (HSL) -TP_LOCALLAB_GHSSAT;Saturation (HSL) -TP_LOCALLAB_GHSFRA;Stretch settings -TP_LOCALLAB_GHS_D;Stretch factor (D) -TP_LOCALLAB_GHS_B;Local intensity (b) -TP_LOCALLAB_GHS_SP;Symmetry point (SP) -TP_LOCALLAB_GHS_LP;Protect shadows (LP) -TP_LOCALLAB_GHS_HP;Protect highlights (HP) -TP_LOCALLAB_GHS_LC;Value (LC) -TP_LOCALLAB_GHS_LC_FRAME;Stetch Regularization -TP_LOCALLAB_GHS_LC_TOOLTIP;Slightly increases local contrast that was weakened by stretching.\nCan be completed by other tools specific to local contrast (wavelets,...). -TP_LOCALLAB_GHS_BLACKPOINT_FRAME;Black point/White point/Highlights -TP_LOCALLAB_GHS_BPFRAME_TOOLTIP;Sets the Black point, White point and Highlight for a linear stretch of the image. -TP_LOCALLAB_GHS_BLP;Black point (BP linear) -TP_LOCALLAB_GHS_BLP_TOOLTIP;Sets the Black point for a linear stretch of the image.\n For positive slider values, in GHS ‘normal’, shadows are raised linearly to avoid excessive noise build-up and facilitate GHS work.\n For negative slider values, the histogram is shifted to the left. For Raw images you can also use Raw-Tab > Raw Black Points – Dehaze, which is more precise. Contrast gained by performing the linear stretch will be evenly distributed over the image.\n\nYou can adjust a linear black point offset either:\n -to account for noise in the dark parts.\n -adjust the histogram.\n\n It is recommended to act on this sliders before implementing the GHS algorithm to avoid clipping data.\n The label 'Clipped Black point=x White point=y' shows you the number of pixels that would be clipped without action on the 2 sliders.\n\nIn ‘Inverse GHS’ mode the trends are differents and there are possible interactions with the White point. -TP_LOCALLAB_GHS_HLP;White point (WP linear) -TP_LOCALLAB_GHS_METHOD_TOOLTIP;The Generalized Hyperbolic Stretch (GHS) process allows you to transform the values of pixels in your image to improve the representation of the underlying data for human visualisation. \nThe generalised hyperbolic equations used in the GHS process have five defining parameters. This allows significant flexibility in designing the "shape" of the transformation.\n\nTypical uses of pixel intensity transformations include:\n * Initial stretch of pixel data from linear state.\n * Addition of contrast to key areas of the image.\n * Overall brightening or darkening of the image.\n * Adjustment of the dynamic range of the image.\n * Adjustment of pixel data in RGB Luminance, RGB standard, Luminance - chromaticity (Lab/Lch), Luminance (hsv), Saturation (hsv), Hue (hsv), channels.\n\nFor a better treatment, you can proceed in several steps, creating 2 or more RT-spots each superimposed with the GHS tool. For each of the RT-Spots, the Symmetry point (SP) base value will be different. Use the peak marker on the histogram to position the SP value.\n For example, you can start the system in RGB mode (1st Spot), then the 2nd Spot in RGB mode with a different SP, and the 3rd in Saturation or Hue mode.\n You can mix RT-spots in 'Normal' mode and 'Inverse' mode to restore contrast balance.\n Full Image allows you to differentiate the action according to the color based on the deltaE. -TP_LOCALLAB_GHS_HLP_TOOLTIP;Sets the White point for a linear stretch of the image. Any pixel with value greater than the White point input will be clipped and the data lost.\n Contrast gained by performing the linear stretch will be evenly distributed over the image, which will be brightened. Pixels with values greater than the Whitepoint will appear white and have a value of 1.0.\n Setting this parameter to a value greater than 1 will extend the dynamic range at the high end.\n It is recommended to act on this slider before implementing the GHS algorithm to avoid clipping data.\n The label 'Clipped Black point=x White point=y' shows you the number of pixels that would be clipped without action on the 2 sliders.\n\nIn ‘Inverse GHS’ mode the trends are reversed and there are possible interactions with the Black point. -TP_LOCALLAB_GHS_MODELIN;Linear -TP_LOCALLAB_GHS_MODECUR;GHS -TP_LOCALLAB_GHS_D_TOOLTIP;This parameter controls the amount of stretch. If the Stretch factor is set to zero there is no stretch, ie the transformation is the identity transformation. -TP_LOCALLAB_GHS_B_TOOLTIP;This parameter controls how tightly focused the stretch is around the Symmetry point (SP) by changing the form of the transform itself:\n * For concentrated stretches (such as initial stretches on linear images) a large 'b' factor should be employed to focus a stretch within a histogram peak while de-focusing the stretch away from the histogram peak.\n * For adjustment of non-linear images, lower 'b' parameters should be employed to distribute contrast and brightness more evenly.\n * Large positive values of 'b' can be thought of as a histogram widener, ie spreading the histogram wider about the focus point, SP.\n * By contrast, lower values of 'b' tend to shift the histogram to a brighter (or dimmer) position without affecting its width too greatly.\n * As a general rule, the level of 'b' employed will decrease as a stretch sequence nears completion, although larger 'b' values can still be employed for precise placement of additional contrast. -TP_LOCALLAB_GHS_SLOPE;Slope Lab factor (S) -TP_LOCALLAB_GHS_SLOPE_TOOLTIP;Changes the slope of the Lab transform to improve shadow rendering. -TP_LOCALLAB_GHS_CHRO;Chromaticity Lab factor (C) -TP_LOCALLAB_GHS_CHRO_TOOLTIP;GHS chromaticity - compensate large stretches -TP_LOCALLAB_GHSLABFRA;Lab settings -TP_LOCALLAB_GHS_SP_TOOLTIP;Default 0.03 to avoid the zero value which can never be suitable. For exposure balanced images, a value of 0.18 will likely be suitable.\n This is the key balance value of the GHS system.\nSets the focus point around which the stretch is applied - contrast will be distributed symmetrically about SP.\n While 'b' provides the degree of focus of the stretch, SP determines where that focus is applied.\n SP should generally be placed within a histogram peak so that the stretch will widen and lower the peak by adding the most contrast in the stretch at that point. Pixel values will move away from the SP location. -TP_LOCALLAB_GHS_LP_TOOLTIP;Sets a value below which the stretch is modified to preserve contrast in the shadows/lowlights. This is done by performing a linear stretch of the data below the 'LP' level by reserving contrast from the rest of the image. Moving the LP level towards the current setting of SP changes both the scope (range) and the amount of this contrast reservation, the net effect is to push the overal stretch to higher brightness levels while keeping the contrast and definition in the background. The amount of contrast reserved for the lowlights is such that the continuity of the stretch is preserved.\n This parameter must be greater than or equal to 0 and not greater than the Symmetry point.\n The GUI - and the code - takes into account the value of the Symmetry Point (SP) to set the maximum value. -TP_LOCALLAB_GHS_HP_TOOLTIP;Sets a value above which the stretch is modified to preserve contrast in the highlights/stars. This is done by performing a linear stretch of the data above the 'HP' level by reserving contrast from the rest of the image. Moving the HP level towards the current setting of SP increases both the scope (range) and the amount of this contrast reservation, the net effect is to push the overal stretch to lower brightness levels while keeping the contrast and definition in the highlights. The amount of contrast reserved for the highlights is such that the continuity of the stretch is preserved.\n This parameter must be less than or equal to 1 and not less than the Symmetry point.\n The GUI - and the code - takes into account the value of the Symmetry Point (SP) to set the minimum value. -TP_LOCALLAB_GHS_SMOOTH_TOOLTIP;Smooth and soften highlight areas. Amplifies 'Protect highlights (HP)' action. -TP_LOCALLAB_GHS_SMOOTH;Highlight Attenuation -TP_LOCALLAB_GHS_CURVE_TOOLTIP;Shows the 'S' curve generated by GHS calculations. Mainly for educational purposes.\n\n * You cannot modify this 'GHS curve' via the GUI (mouse,..). -TP_LOCALLAB_GHS_INV;Inverse GHS -TP_LOCALLAB_GHS_INV_TOOLTIP;The inverse GHS is useful for working in negative space. Inverted transform add contrast on the far right and left histogram, brighten the dims, dim the brights and squeez the histogram to the middle.\n\nThe Generalised Hyperbolic inverse transformation allows you to recover your original image subject to mathematical precision. But you can use it for its own features.\n\nIn 'Inverse GHS' mode, the White Point and Black point values ​​will probably need to be changed - often lowered for White Point. There is interaction between the two settings. TP_LOCALLAB_GRADANG;Gradient angle TP_LOCALLAB_GRADANG_TOOLTIP;Rotation angle in degrees: -180 0 +180. TP_LOCALLAB_GRADFRA;Graduated Filter Mask @@ -3451,7 +3394,6 @@ TP_LOCALLAB_MRONE;None TP_LOCALLAB_MRTHR;Original Image TP_LOCALLAB_MULTIPL_TOOLTIP;Wide-range tone adjustment: -18EV to +4EV. The first slider acts on very dark tones between -18EV and -6EV. The last slider acts on light tones up to 4EV. TP_LOCALLAB_NEIGH;Radius -TP_LOCALLAB_NLDENOISENLITER_TOOLTIP;Run multiple iterations of Nlmeans. Results are often better with multiple iterations and low Strength. TP_LOCALLAB_NLDENOISENLGAM_TOOLTIP;Lower values preserve details and texture, higher values increase denoise.\nIf gamma = 3.0 Luminance 'linear' is used. TP_LOCALLAB_NLDENOISENLPAT_TOOLTIP;Use this slider to adapt the amount of denoise to the size of the objects to be processed. TP_LOCALLAB_NLDENOISENLRAD_TOOLTIP;Higher values increase denoise at the expense of processing time. @@ -3460,7 +3402,6 @@ TP_LOCALLAB_NLDET;Detail recovery TP_LOCALLAB_NLFRA;Non-local Means: Luminance TP_LOCALLAB_NLFRAME_TOOLTIP;Non-local means denoising takes a mean of all pixels in the image, weighted by how similar they are to the target pixel.\nReduces loss of detail compared with local mean algorithms.\nOnly luminance noise is taken into account. Chrominance noise is best processed using wavelets and Fourier transforms (DCT).\nCan be used in conjunction with 'Luminance denoise by level' or on its own. TP_LOCALLAB_NLGAM;Gamma -TP_LOCALLAB_NLITER;Iterations TP_LOCALLAB_NLLUM;Strength TP_LOCALLAB_NLPAT;Maximum patch size TP_LOCALLAB_NLRAD;Maximum radius size @@ -3562,10 +3503,9 @@ TP_LOCALLAB_SENSI_TOOLTIP;Adjusts the scope of the action:\nSmall values limit t TP_LOCALLAB_SETTINGS;Settings TP_LOCALLAB_SH1;Shadows Highlights TP_LOCALLAB_SH2;Equalizer -TP_LOCALLAB_SH3;Generalized Hyperbolic Stretch TP_LOCALLAB_SHADEX;Shadows TP_LOCALLAB_SHADEXCOMP;Shadow compression -TP_LOCALLAB_SHADHIGH;Shadows/Highlights, Equalizer & GHS +TP_LOCALLAB_SHADHIGH;Shadows/Highlights & Tone Equalizer TP_LOCALLAB_SHADHMASK_TOOLTIP;Lowers the highlights of the mask in the same way as the shadows/highlights algorithm. TP_LOCALLAB_SHADMASK_TOOLTIP;Lifts the shadows of the mask in the same way as the shadows/highlights algorithm. TP_LOCALLAB_SHADOWHIGHLIGHT_TOOLTIP;Adjust shadows and highlights either with shadows & highlights sliders or with a tone equalizer.\nCan be used instead of, or in conjunction with the Exposure module.\nCan also be used as a graduated filter. @@ -3613,7 +3553,7 @@ TP_LOCALLAB_SHOWT;Mask and modifications TP_LOCALLAB_SHOWVI;Mask and modifications TP_LOCALLAB_SHRESFRA;Shadows/Highlights & TRC TP_LOCALLAB_SHTRC_TOOLTIP;Based on 'working profile' (only those provided), modifies the tones of the image by acting on a TRC (Tone Response Curve).\nGamma acts mainly on light tones.\nSlope acts mainly on dark tones.\nIt is recommended that the TRC of both devices (monitor and output profile) be sRGB (default). -TP_LOCALLAB_SH_TOOLNAME;Shadows/Highlights & Equalizer & GHS +TP_LOCALLAB_SH_TOOLNAME;Shadows/Highlights & Tone Equalizer TP_LOCALLAB_SIGBLACKSSCIE;Blacks distribution TP_LOCALLAB_SIGCIE;Sigmoid TP_LOCALLAB_SIGFRA;Sigmoid Q diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 9376fff35..bbb2d4bfa 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -855,7 +855,6 @@ void Crop::update(int todo) //I made a little change here. Rather than have luminanceCurve (and others) use in/out lab images, we can do more if we copy right here. parent->ipf.rgb2lab(*baseCrop, *laboCrop, params.icm.workingProfile); - PreviewProps pp(trafx, trafy, trafw * skip, trafh * skip, skip); labnCrop->CopyFrom(laboCrop); @@ -872,7 +871,6 @@ void Crop::update(int todo) auto& lmasklocalcurve2 = parent->lmasklocalcurve; auto& lmaskexplocalcurve2 = parent->lmaskexplocalcurve; auto& lmaskSHlocalcurve2 = parent->lmaskSHlocalcurve; - // auto& ghslocalcurve2 = parent->ghslocalcurve; auto& lmaskviblocalcurve2 = parent->lmaskviblocalcurve; auto& lmasktmlocalcurve2 = parent->lmasktmlocalcurve; auto& lmaskretilocalcurve2 = parent->lmaskretilocalcurve; @@ -1024,7 +1022,6 @@ void Crop::update(int todo) const bool localmaskutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskcurve, lmasklocalcurve2, skip); const bool localmaskexputili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskexpcurve, lmaskexplocalcurve2, skip); const bool localmaskSHutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).LmaskSHcurve, lmaskSHlocalcurve2, skip); - // const bool localghsutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).ghscurve, ghslocalcurve2, skip); const bool localmaskvibutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskvibcurve, lmaskviblocalcurve2, skip); const bool localmasktmutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmasktmcurve, lmasktmlocalcurve2, skip); const bool localmaskretiutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskreticurve, lmaskretilocalcurve2, skip); @@ -1090,11 +1087,8 @@ void Crop::update(int todo) float Lhighresi46 = 0.f; float Lnresi46 = 0.f; float contsig = params.locallab.spots.at(sp).contsigqcie; + float lightsig = params.locallab.spots.at(sp).lightsigqcie; - float ghscur[24];//20 +4 12 11 - int ghsbpwp[2]; - float ghsbpwpvalue[2]; - /* huerefp[sp] = huere; chromarefp[sp] = chromare; lumarefp[sp] = lumare; @@ -1108,7 +1102,7 @@ void Crop::update(int todo) if (sp == params.locallab.selspot) { - parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop.get(), savenormtmCrop.get(), savenormretiCrop.get(), lastorigCrop.get(), fw, fh, cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), trafx, trafy, trafw, trafh , skip, locRETgainCurve, locRETtransCurve, + parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop.get(), savenormtmCrop.get(), savenormretiCrop.get(), lastorigCrop.get(), fw, fh, cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, locRETtransCurve, lllocalcurve2,locallutili, cllocalcurve2, localclutili, lclocalcurve2, locallcutili, @@ -1118,7 +1112,6 @@ void Crop::update(int todo) lmasklocalcurve2, localmaskutili, lmaskexplocalcurve2, localmaskexputili, lmaskSHlocalcurve2, localmaskSHutili, - // ghslocalcurve2, localghsutili, lmaskviblocalcurve2, localmaskvibutili, lmasktmlocalcurve2, localmasktmutili, lmaskretilocalcurve2, localmaskretiutili, @@ -1166,9 +1159,7 @@ void Crop::update(int todo) 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->localllogMask, parent->locall_Mask, parent->locallcieMask, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, meantme, stdtme, meanretie, stdretie, fab, maxicam,rdx, rdy, grx, gry, blx, bly, meanx, meany, meanxe, meanye, prim, ill, contsig, lightsig, - highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46, - ghscur, ghsbpwp, ghsbpwpvalue -); + highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46); LocallabListener::locallabDenoiseLC denoiselc; denoiselc.highres = highresi; @@ -1226,7 +1217,7 @@ void Crop::update(int todo) } } else { - parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop.get(), savenormtmCrop.get(), savenormretiCrop.get(), lastorigCrop.get(), fw, fh, cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), trafx, trafy, trafw , trafh, skip, locRETgainCurve, locRETtransCurve, + parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop.get(), savenormtmCrop.get(), savenormretiCrop.get(), lastorigCrop.get(), fw, fh, cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, locRETtransCurve, lllocalcurve2,locallutili, cllocalcurve2, localclutili, lclocalcurve2, locallcutili, @@ -1235,7 +1226,6 @@ void Crop::update(int todo) lmasklocalcurve2, localmaskutili, lmaskexplocalcurve2, localmaskexputili, lmaskSHlocalcurve2, localmaskSHutili, - // ghslocalcurve2, localghsutili, lmaskviblocalcurve2, localmaskvibutili, lmasktmlocalcurve2, localmasktmutili, lmaskretilocalcurve2, localmaskretiutili, @@ -1282,9 +1272,7 @@ void Crop::update(int todo) 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, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, meantme, stdtme, meanretie, stdretie, fab, maxicam, rdx, rdy, grx, gry, blx, bly, meanx, meany, meanxe, meanye, prim, ill, contsig, lightsig, - highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46, - ghscur, ghsbpwp, ghsbpwpvalue - ); + highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46); } diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index b231f2700..4949699fe 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -211,7 +211,6 @@ ImProcCoordinator::ImProcCoordinator() : lmasklocalcurve(65536, LUT_CLIP_OFF), lmaskexplocalcurve(65536, LUT_CLIP_OFF), lmaskSHlocalcurve(65536, LUT_CLIP_OFF), - ghslocalcurve(65536, LUT_CLIP_OFF), lmaskviblocalcurve(65536, LUT_CLIP_OFF), lmasktmlocalcurve(65536, LUT_CLIP_OFF), lmaskretilocalcurve(65536, LUT_CLIP_OFF), @@ -1148,8 +1147,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) //std::vector locallref; std::vector locallretiminmax; std::vector locallcielc; - std::vector locallshgsh; - std::vector locallshgshbw; std::vector locallsetlc; std::vector locallciesig; huerefs.resize(params->locallab.spots.size()); @@ -1264,7 +1261,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) const bool localmaskutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskcurve, lmasklocalcurve, sca); const bool localmaskexputili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskexpcurve, lmaskexplocalcurve, sca); const bool localmaskSHutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).LmaskSHcurve, lmaskSHlocalcurve, sca); - // const bool localghsutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).ghscurve, ghslocalcurve, sca); const bool localmaskvibutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskvibcurve, lmaskviblocalcurve, sca); const bool localmasktmutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmasktmcurve, lmasktmlocalcurve, sca); const bool localmaskretiutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskreticurve, lmaskretilocalcurve, sca); @@ -1398,21 +1394,12 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) float Lnresi = 0.f; float Lhighresi46 = 0.f; float Lnresi46 = 0.f; - float ghscur[24];//42 +4 12 11 - int ghsbpwp[2]; - ghsbpwp[0] = 0; - ghsbpwp[1] = 0; - float ghsbpwpvalue[2]; - ghsbpwpvalue[0] = 0.f; - ghsbpwpvalue[1] = 1.f;; - - Glib::ustring prof = params->icm.workingProfile; if(params->locallab.spots.at(sp).complexcie == 2) { params->locallab.spots.at(sp).primMethod = prof;//in Basic mode set to Working profile } - ipf.Lab_Local(3, sp, (float**)shbuffer, nprevl, nprevl, reserv.get(), savenormtm.get(), savenormreti.get(), lastorigimp.get(), fw, fh, 0, 0, pW, pH, pW, pH, pW, pH, scale, locRETgainCurve, locRETtransCurve, + ipf.Lab_Local(3, sp, (float**)shbuffer, nprevl, nprevl, reserv.get(), savenormtm.get(), savenormreti.get(), lastorigimp.get(), fw, fh, 0, 0, pW, pH, scale, locRETgainCurve, locRETtransCurve, lllocalcurve, locallutili, cllocalcurve, localclutili, lclocalcurve, locallcutili, @@ -1421,7 +1408,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) lmasklocalcurve, localmaskutili, lmaskexplocalcurve, localmaskexputili, lmaskSHlocalcurve, localmaskSHutili, - // ghslocalcurve, localghsutili, lmaskviblocalcurve, localmaskvibutili, lmasktmlocalcurve, localmasktmutili, lmaskretilocalcurve, localmaskretiutili, @@ -1468,9 +1454,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) 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, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, meantm, stdtm, meanreti, stdreti, fab, maxicam, rdx, rdy, grx, gry, blx, bly, meanx, meany, meanxe, meanye, prim, ill, contsig, lightsig, - highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46, - ghscur, ghsbpwp, ghsbpwpvalue -); + highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46); fabrefp[sp] = fab; @@ -1579,33 +1563,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) locciesig.contsigq = contsig; locciesig.lightsigq = lightsig; locallciesig.push_back(locciesig); - /* - int reset = 0; - if(params->locallab.spots.at(sp).ghsMode == "lin") { - reset = 0; - } else { - reset = 1; - } - */ - LocallabListener::locallabshGHS locshghs;//ghs S curve 42 or labgrid 12 - for(int j = 0; j < 24; j++) {//+4 12 11 - locshghs.ghsc[j] = ghscur[j]; - } - // locshghs.licur = reset; - /* - printf("ghsc0=%f ghsc1=%f\n", (double) locshghs.ghsc[0], (double) locshghs.ghsc[1]); - printf("ghsc20=%f ghsc21=%f\n", (double) locshghs.ghsc[20], (double) locshghs.ghsc[21]); - printf("ghsc40=%f ghsc41=%f\n", (double) locshghs.ghsc[40], (double) locshghs.ghsc[41]); - printf("OK 2 impro\n"); - */ - locallshgsh.push_back(locshghs); - - LocallabListener::locallabshGHSbw locshghsbw;//ghs S curve - for(int j = 0; j < 2; j++) { - locshghsbw.ghsbw[j] = ghsbpwp[j]; - locshghsbw.ghsbwvalue[j] = ghsbpwpvalue[j]; - } - locallshgshbw.push_back(locshghsbw); // Recalculate references after @@ -1676,11 +1633,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) locallListener->cieChanged(locallcielc,params->locallab.selspot); } locallListener->sigChanged(locallciesig,params->locallab.selspot); - if (params->locallab.spots.at(sp).expshadhigh && params->locallab.spots.at(sp).shMethod == "ghs") { - locallListener->ghsChanged(locallshgsh,params->locallab.selspot);//curve - locallListener->ghsbwChanged(locallshgshbw,params->locallab.selspot);//Black and White point - } - /* if(params->locallab.spots.at(sp).colorscope != 0) {//compatibility with old method in controlspotpanel locallListener->scopeChangedcol(scopefp[sp], params->locallab.selspot, iscolor); diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 271b1cf09..f8d4424f1 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -279,7 +279,6 @@ protected: LUTf lmasklocalcurve; LUTf lmaskexplocalcurve; LUTf lmaskSHlocalcurve; - LUTf ghslocalcurve; LUTf lmaskviblocalcurve; LUTf lmasktmlocalcurve; LUTf lmaskretilocalcurve; diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 05a78473b..db07fd91f 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -251,7 +251,7 @@ enum class BlurType { void idirpyr(LabImage* data_coarse, LabImage* data_fine, int level, LUTf &rangefn_L, LUTf & nrwt_l, LUTf & nrwt_ab, int pitch, int scale, const int luma, const int chroma/*, LUTf & Lcurve, LUTf & abcurve*/); //locallab Local adjustments - void maskcalccol(int call, bool invmask, bool pde, int bfw, int bfh, int oW, int oH, int tX, int tY, int tW, int tH, int xstart, int ystart, int xend, int yend, int sk, int cx, int cy, LabImage* bufcolorig, LabImage* bufmaskblurcol, LabImage* originalmaskcol, LabImage* original, LabImage* reserved, int inv, struct local_params & lp, + void maskcalccol(bool invmask, bool pde, int bfw, int bfh, int xstart, int ystart, int sk, int cx, int cy, LabImage* bufcolorig, LabImage* bufmaskblurcol, LabImage* originalmaskcol, LabImage* original, LabImage* reserved, int inv, struct local_params & lp, float strumask, bool astool, const LocCCmaskCurve & locccmasCurve, bool lcmasutili, const LocLLmaskCurve & locllmasCurve, bool llmasutili, @@ -260,7 +260,7 @@ enum class BlurType { const LUTf& lmasklocalcurve, bool localmaskutili, const LocwavCurve & loclmasCurvecolwav, bool lmasutilicolwav, int level_bl, int level_hl, int level_br, int level_hr, int shortcu, bool delt, const float hueref, const float chromaref, const float lumaref, - float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, bool fftt, float blu_ma, float cont_ma, int indic, float &fab, int fw, int fh); + float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, bool fftt, float blu_ma, float cont_ma, int indic, float &fab); void avoidcolshi(const struct local_params& lp, int sp, LabImage *transformed, LabImage *reserved, int cy, int cx, int sk); @@ -310,7 +310,7 @@ enum class BlurType { void calc_ref(int sp, LabImage* original, LabImage* transformed, int cx, int cy, int oW, int oH, int sk, double &huerefblur, double &chromarefblur, double &lumarefblur, double &hueref, double &chromaref, double &lumaref, double &sobelref, float &avg, const LocwavCurve & locwavCurveden, bool locwavdenutili); void copy_ref(LabImage* spotbuffer, LabImage* original, LabImage* transformed, int cx, int cy, int sk, const struct local_params & lp, double &huerefspot, double &chromarefspot, double &lumarefspot); void paste_ref(LabImage* spotbuffer, LabImage* transformed, int cx, int cy, int sk, const struct local_params & lp); - void Lab_Local(int call, int sp, float** shbuffer, LabImage* original, LabImage* transformed, LabImage* reserved, LabImage * savenormtm, LabImage * savenormreti, LabImage* lastorig, int fw, int fh, int cx, int cy, int oW, int oH, int tX, int tY, int tW, int tH, int sk, const LocretigainCurve& locRETgainCcurve, const LocretitransCurve &locRETtransCcurve, + void Lab_Local(int call, int sp, float** shbuffer, LabImage* original, LabImage* transformed, LabImage* reserved, LabImage * savenormtm, LabImage * savenormreti, LabImage* lastorig, int fw, int fh, int cx, int cy, int oW, int oH, int sk, const LocretigainCurve& locRETgainCcurve, const LocretitransCurve &locRETtransCcurve, const LUTf& lllocalcurve, bool locallutili, const LUTf& cllocalcurve, bool localclutili, const LUTf& lclocalcurve, bool locallcutili, @@ -319,7 +319,6 @@ enum class BlurType { const LUTf& lmasklocalcurve, bool localmaskutili, const LUTf& lmaskexplocalcurve, bool localmaskexputili, const LUTf& lmaskSHlocalcurve, bool localmaskSHutili, - // const LUTf& ghslocalcurve, bool localghsutili, const LUTf& lmaskviblocalcurve, bool localmaskvibutili, const LUTf& lmasktmlocalcurve, bool localmasktmutili, LUTf& lmaskretilocalcurve, bool localmaskretiutili, @@ -368,9 +367,7 @@ enum class BlurType { 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, int llcieMask, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax, float& meantm, float& stdtm, float& meanreti, float& stdreti, float &fab, float &maxicam, float &rdx, float &rdy, float &grx, float &gry, float &blx, float &bly, float &meanx, float &meany, float &meanxe, float &meanye, int &prim, int &ill, float &contsig, float &lightsig, - float &highresi, float &nresi, float &highresi46, float &nresi46, float &Lhighresi, float &Lnresi, float &Lhighresi46, float &Lnresi46, - float *ghscur, int *ghsbpwp, float *ghsbpwpvalue -); + float &highresi, float &nresi, float &highresi46, float &nresi46, float &Lhighresi, float &Lnresi, float &Lhighresi46, float &Lnresi46); void tone_eqcam2(ImProcFunctions *ipf, Imagefloat *rgb, int whits, int blacks, const Glib::ustring &workingProfile, double scale, bool multithread); void tone_eqdehaz(ImProcFunctions *ipf, Imagefloat *rgb, int whits, int blacks, const Glib::ustring &workingProfile, double scale, bool multithread); @@ -384,13 +381,13 @@ enum class BlurType { static void strcurv_data(std::string retistr, int *s_datc, int &siz); void blendstruc(int bfw, int bfh, LabImage* bufcolorig, float radius, float stru, array2D & blend2, int sk, bool multiThread); - void wavcontrast4(int call, struct local_params& lp, float ** tmp, float ** tmpa, float ** tmpb, float contrast, float radblur, float radlevblur, int bfw, int bfh, int oW, int oH, int tX, int tY, int tW, int tH, int level_bl, int level_hl, int level_br, int level_hr, int sk, int numThreads, const LocwavCurve & locwavCurve, bool locwavutili, bool wavcurve, + void wavcontrast4(struct local_params& lp, float ** tmp, float ** tmpa, float ** tmpb, float contrast, float radblur, float radlevblur, int bfw, int bfh, int level_bl, int level_hl, int level_br, int level_hr, int sk, int numThreads, const LocwavCurve & locwavCurve, bool locwavutili, bool wavcurve, const LocwavCurve & loclevwavCurve, bool loclevwavutili, bool wavcurvelev, const LocwavCurve & locconwavCurve, bool locconwavutili, bool wavcurvecon, const LocwavCurve & loccompwavCurve, bool loccompwavutili, bool wavcurvecomp, const LocwavCurve & loccomprewavCurve, bool loccomprewavutili, bool wavcurvecompre, const LocwavCurve & locedgwavCurve, bool locedgwavutili, - float sigm, float offs,int & maxlvl, float sigmadc, float deltad, float chromalev, float chromablu, bool blurlc, bool blurena, bool levelena, bool comprena, bool compreena, float compress, float thres, int fw, int fh); + float sigm, float offs,int & maxlvl, float sigmadc, float deltad, float chromalev, float chromablu, bool blurlc, bool blurena, bool levelena, bool comprena, bool compreena, float compress, float thres); void wavcont(const struct local_params& lp, float ** tmp, wavelet_decomposition &wdspot, int level_bl, int maxlvl, const LocwavCurve & loclevwavCurve, bool loclevwavutili, diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index 7a21dddcc..d2b2c9f2c 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -45,7 +45,7 @@ inline void copyAndClampLine(const float *src, unsigned char *dst, const int W) } -inline void copyAndClamp(const LabImage *src, unsigned char *dst, const double rgb_xyz[3][3], bool multiThread, int pro)//int pro to switch to Working Profile histogram mode without gamma +inline void copyAndClamp(const LabImage *src, unsigned char *dst, const double rgb_xyz[3][3], bool multiThread) { const int W = src->W; const int H = src->H; @@ -89,15 +89,9 @@ inline void copyAndClamp(const LabImage *src, unsigned char *dst, const double r vfloat x_, y_, z_; Color::Lab2XYZ(LVFU(rL[j]), LVFU(ra[j]), LVFU(rb[j]), x_, y_, z_); Color::xyz2rgb(x_, y_, z_, R, G, B, rgb_xyzv); - if(pro == 0) { - STVF(rbuffer[j], Color::gamma2curve[R]); - STVF(gbuffer[j], Color::gamma2curve[G]); - STVF(bbuffer[j], Color::gamma2curve[B]); - } else {//Working profile and gamma=1 - STVF(rbuffer[j], R); - STVF(gbuffer[j], G); - STVF(bbuffer[j], B); - } + STVF(rbuffer[j], Color::gamma2curve[R]); + STVF(gbuffer[j], Color::gamma2curve[G]); + STVF(bbuffer[j], Color::gamma2curve[B]); } for (; j < W; ++j) { @@ -105,15 +99,9 @@ inline void copyAndClamp(const LabImage *src, unsigned char *dst, const double r float x_, y_, z_; Color::Lab2XYZ(rL[j], ra[j], rb[j], x_, y_, z_); Color::xyz2rgb(x_, y_, z_, R, G, B, rgb_xyzf); - if(pro == 0) { - rbuffer[j] = Color::gamma2curve[R]; - gbuffer[j] = Color::gamma2curve[G]; - bbuffer[j] = Color::gamma2curve[B]; - } else {//Working profile and gamma=1 - rbuffer[j] = R; - gbuffer[j] = G; - bbuffer[j] = B; - } + rbuffer[j] = Color::gamma2curve[R]; + gbuffer[j] = Color::gamma2curve[G]; + bbuffer[j] = Color::gamma2curve[B]; } for (j = 0; j < W; ++j) { @@ -129,15 +117,10 @@ inline void copyAndClamp(const LabImage *src, unsigned char *dst, const double r float x_, y_, z_; Color::Lab2XYZ(rL[j], ra[j], rb[j], x_, y_, z_); Color::xyz2rgb(x_, y_, z_, R, G, B, rgb_xyzf); - if(pro == 0) { - dst[ix++] = uint16ToUint8Rounded(Color::gamma2curve[R]); - dst[ix++] = uint16ToUint8Rounded(Color::gamma2curve[G]); - dst[ix++] = uint16ToUint8Rounded(Color::gamma2curve[B]); - } else {//Working profile and gamma=1 - dst[ix++] = uint16ToUint8Rounded(R); - dst[ix++] = uint16ToUint8Rounded(G); - dst[ix++] = uint16ToUint8Rounded(B); - } + + dst[ix++] = uint16ToUint8Rounded(Color::gamma2curve[R]); + dst[ix++] = uint16ToUint8Rounded(Color::gamma2curve[G]); + dst[ix++] = uint16ToUint8Rounded(Color::gamma2curve[B]); } #endif @@ -221,7 +204,7 @@ void ImProcFunctions::lab2monitorRgb(LabImage* lab, Image8* image) } } // End of parallelization } else { - copyAndClamp(lab, image->data, sRGB_xyz, multiThread, 0);//int pro = 0 always sent 'normal' to monitor + copyAndClamp(lab, image->data, sRGB_xyz, multiThread); } } @@ -256,13 +239,12 @@ Image8* ImProcFunctions::lab2rgb(LabImage* lab, int cx, int cy, int cw, int ch, Glib::ustring profile; cmsHPROFILE oprof = nullptr; - int pro = 0;//int pro to switch to Working Profile histogram mode without gamma + if (settings->HistogramWorking && consider_histogram_settings) { profile = icm.workingProfile; - pro = 1;//no gamma for histogram and navigator panel and Lockable color picker } else { profile = icm.outputProfile; - //pro = 0 histogram and navigator panel and Lockable color picker with gamma + if (icm.outputProfile.empty() || icm.outputProfile == ColorManagementParams::NoICMString) { profile = "sRGB"; } @@ -318,7 +300,7 @@ Image8* ImProcFunctions::lab2rgb(LabImage* lab, int cx, int cy, int cw, int ch, } else { const auto xyz_rgb = ICCStore::getInstance()->workingSpaceInverseMatrix(profile); - copyAndClamp(lab, image->data, xyz_rgb, multiThread, pro);//int pro = 1 to switch to Working Profile for histogram and navigator panel and Lockable color picker whitout gamma + copyAndClamp(lab, image->data, xyz_rgb, multiThread); } return image; diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 4fc422ca0..13f974d1a 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -127,479 +127,6 @@ float softlig(float a, float b, float minc, float maxc) } } -// GHT filter ported from Siril. -// -// see https://siril.org/tutorials/ghs/ for more info -// -// Copyright of the original code follows -/* - * Copyright (C) 2005-2011 Francois Meyer (dulle at free.fr) - * Copyright (C) 2012-2023 team free-astro (see more in AUTHORS file) - * Reference site is https://free-astro.org/index.php/Siril - * - * Siril is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Siril is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Siril. If not, see . - */ -/* -//Copyright algorithm Pixlnsight David Payne 2021 -https://www.ghsastro.co.uk/doc/tools/GeneralizedHyperbolicStretch/GeneralizedHyperbolicStretch.html#__Description_:_About_GHS__ -*/ -/* - * Thanks to Alberto Griggio for the code CTL ght.ctl -*/ - -/* -https://www.ghsastro.co.uk/doc/tools/GeneralizedHyperbolicStretch/GeneralizedHyperbolicStretch.html#equationLabel - -Summary of calculations made during GHS - - -5.2.1 Definition of variables -D = e(Stretch factor) - 1 -b = Local intensity -SP = Symmetry point -LP = Protect shadows -HP = Protect highlights -m = 0.5 / (D + 1) - -5.2.2 Base transformation equations -The base transformation for each transformation type is defined by T : x → T(x) in the following table. The table also shows the first derivative of T, denoted T', as this is needed to build the full transformation. - -Generalised hyperbolic -Exponential -b = 0 -T ->1 - e-D.x -T'->D.e-D.x - -Generalised hyperbolic -Logarithmic -b = -1 -T ->ln( 1 + D.x ) -T'= D/( 1 + D.x ) - -Generalised hyperbolic -Integral -b < 0, b ≠ -1 -T->(1 - (1 - b.D.x)((b + 1)/b))/(D.(b + 1)) -T'->( 1 - b.D.x )(1/b) - -Generalised hyperbolic -Harmonic -b = 1 -T->1 - ( 1 + D.x )-1 -T'-> D.( 1 + D.x )-2 - -Generalised hyperbolic -Hyperbolic -b > 0, b ≠ 1 -T-> 1 - ( 1 + b.D.x )(-1/b) -T'->D.(1 + b.D.x)(-(1+b)/b) - -Midtone transfer -(m - 1).x / ( (2m - 1).x - m ) -m.(1 - m).((2m - 1).x - m)-2 - -Power law -T(x) = 1 - (1 - x)1 + D -T'(x) = (1 + D).(1 - x)D - - -The maximum gradient for the base equations occurs at x=0. This point defines the point of maximum intensity and we want that to occur at x = SP. So we transform the equation by defining: -T3(x) = T(x-SP). -This broadly defines the transformation for the range SP ≤ x < HP although it will need to be normalised as described later below. -The transformation for LP ≤ x < SP is defined by symmetry as follows: -T2(x) = -T(SP-x). -This, in effect, is equivalent to rotating the graph above SP through 180° around the point (SP, 0) - hence the name, Symmetry point. -For the range 0.0 ≤ x < LP we want a linear transformation so we calculate the gradient of T2 at LP, ie T2'(LP), where the prime represents the first derivative. We also want the line to pass through the point (LP, T2(LP)). So we define: -T1(x) = T2'(LP) * (x - LP) + T2(LP) -Similarly for the range HP ≤ x ≤ 1.0, we calculate a linear transformation as follows: -T4(x) = T3'(HP) * (x - HP) + T3(HP) -Finally we want the transformed values to run from 0.0 to 1.0 so we need to normalise. We define: -NormTi(x) = (Ti(x) - T1(0))/(T4(1) - T1(0)), for i = 1, 2, 3, 4 - -We then define the full transformation: NormT: x → NormT(x), as follows: -0 ≤ x < LP -NormT1(x) - -LP ≤ x < SP -NormT2(x) - -SP ≤ x < HP -NormT3(x) - -HP ≤ x ≤ 1 -NormT4(x) - - -Inverse transformation equations -Generalised hyperbolic -Exponential -b = 0 -InvT(x) = -ln(1 - x)/D - -Generalised hyperbolic -Logarithmic -b = -1 -InvT(x) = (ex - 1)/D - -Generalised hyperbolic -Integral -b < 0, b ≠ -1 -InvT(x) = ((1 - (1 - (b+1).D.x)(b/(b+1)))/(D.b) - -Generalised hyperbolic -Harmonic -b = 1 -InvT(x) = /(D.(1 - x)) - -Generalised hyperbolic -Hyperbolic -b > 0, b ≠ 1 -InvT(x) = ((1 - x)-b - 1)/(b.D) - -Power law -InvT(x) = 1 - (1 - x)1/(1 + D) - -Then we can define the full inverse transformation InvNormT: x -> InvNormT(x), as follows: - -0 ≤ x < NormT(LP) -LP + (x' - T2(LP))/T2'(LP) - -NormT(LP) ≤ x < NormT(SP) -SP - InvT(-x') - -NormT(SP) ≤ x < NormT(HP) -SP + InvT(x') - -NormT(HP) ≤ x ≤ 1 -HP + (x' - T3(HP))/T3'(HP) - -where -x' = T1(0) + x.(T4(1) - T1(0)) -*/ - -/* -In a simplified way, an S-curve (or inverted S-curve) modifies the image. -The inflection point is defined by SP (Symmetry Point), for example 0.5 will generate a symmetrical 'S-curve' for RGB values ​​lower than SP or Higher. - -Stretch factor will make this curve more or less pronounced with very gradual asymptotes in the low and high lights. - -Linear factor will change the shape of the S, reducing or increasing the "length" of the asymptotic parts. - -All 3 allow you to modify the contrast of the image by filling the valleys and reducing the peaks - -*/ -struct ght_compute_params { - float qlp;//protect shadows - float q0; - float qwp;//protect highlights - white point - float q1; - float q; - float b1; - float a1; - float a2; - float b2; - float c2; - float d2; - float e2; - float a3; - float b3; - float c3; - float d3; - float e3; - float a4; - float b4; - float LPT;//inverse protect shadow - float SPT;//inverse symmetric point - float HPT;//inverse protect highlight -}; - -ght_compute_params GHT_setup(float in_B, float D, float LP, float SP, float HP, int strtype) -{ - ght_compute_params c; - float B = in_B; - if(strtype == 0) {//Normal Stretch - if (B == -1.0f) { - c.qlp = -1.0f * log(1.f + D * (SP - LP)); - c.q0 = c.qlp - D * LP / (1.0f + D * (SP - LP)); - c.qwp = log(1.f + D * (HP - SP)); - c.q1 = c.qwp + D * (1.0f - HP) / (1.0f + D * (HP - SP)); - c.q = 1.0f / (c.q1 - c.q0); - c.b1 = (1.0f + D * (SP - LP)) / (D * c.q); - c.a2 = (-c.q0) * c.q; - c.b2 = -c.q; - c.c2 = 1.0f + D * SP; - c.d2 = -D; - c.a3 = (-c.q0) * c.q; - c.b3 = c.q; - c.c3 = 1.0f - D * SP; - c.d3 = D; - c.a4 = (c.qwp - c.q0 - D * HP / (1.0f + D * (HP - SP))) * c.q; - c.b4 = c.q * D / (1.0f + D * (HP - SP)); - } else if (B < 0.0f) { - B = -B; - c.qlp = (1.0f - pow((1.0f + D * B * (SP - LP)), (B - 1.0f) / B)) / (B - 1.0f); - c.q0 = c.qlp - D * LP * (pow((1.0f + D * B * (SP - LP)), -1.0f / B)); - c.qwp = (pow((1.0f + D * B * (HP - SP)), (B - 1.0f) / B) - 1.0f) / (B - 1.0f); - c.q1 = c.qwp + D * (1.0f - HP) * (pow((1.0f + D * B * (HP - SP)), -1.0f / B)); - c.q = 1.0f / (c.q1 - c.q0); - c.b1 = D * pow(1.0f + D * B * (SP - LP), -1.0f / B) *c.q; - c.a2 = (1.0f / (B - 1.0f) - c.q0) * c.q; - c.b2 = -c.q / (B - 1.0f); - c.c2 = 1.0f + D * B * SP; - c.d2 = -D * B; - c.e2 = (B - 1.0f) / B; - c.a3 = (-1.0f / (B-1.0f) - c.q0) *c.q; - c.b3 = c.q/(B-1.0f); - c.c3 = 1.0f - D * B * SP; - c.d3 = D * B; - c.e3 = (B - 1.0f) / B; - c.a4 = (c.qwp - c.q0 - D * HP * pow((1.0f + D * B * (HP - SP)), -1.0f / B)) * c.q; - c.b4 = D * pow((1.0f + D * B * (HP - SP)), -1.0f / B) * c.q; - } else if (B == 0.0f) { - c.qlp = exp(-D * (SP - LP)); - c.q0 = c.qlp - D * LP * exp(-D*(SP - LP)); - c.qwp = 2.0f - exp(-D * (HP -SP)); - c.q1 = c.qwp + D * (1.0f - HP) * exp (-D * (HP - SP)); - c.q = 1.0f / (c.q1 - c.q0); - c.a1 = 0.0f; - c.b1 = D * exp (-D * (SP - LP)) * c.q; - c.a2 = -c.q0 * c.q; - c.b2 = c.q; - c.c2 = -D * SP; - c.d2 = D; - c.a3 = (2.0f - c.q0) * c.q; - c.b3 = -c.q; - c.c3 = D * SP; - c.d3 = -D; - c.a4 = (c.qwp - c.q0 - D * HP * exp(-D * (HP - SP))) * c.q; - c.b4 = D * exp(-D * (HP - SP)) * c.q; - } else if (B > 0.0f) { - c.qlp = pow((1.0f + D * B * (SP - LP)), -1.0f / B); - c.q0 = c.qlp - D * LP * pow((1.f + D * B * (SP - LP)), -(1.0f + B) / B); - c.qwp = 2.0f - pow(1.0f + D * B * (HP - SP), -1.0f / B); - c.q1 = c.qwp + D * (1.0f - HP) * pow((1.0f + D * B * (HP - SP)), -(1.0f + B) / B); - c.q = 1.0f / (c.q1 - c.q0); - c.b1 = D * pow((1.0f + D * B * (SP - LP)), -(1.0f+B)/B) * c.q; - c.a2 = -c.q0 * c.q; - c.b2 = c.q; - c.c2 = 1.0f + D * B * SP; - c.d2 = -D * B; - c.e2 = -1.0f / B; - c.a3 = (2.0f - c.q0) * c.q; - c.b3 = -c.q; - c.c3 = 1.0f - D * B * SP; - c.d3 = D * B; - c.e3 = -1.0f / B; - c.a4 = (c.qwp - c.q0 - D * HP * pow((1.0f + D * B * (HP - SP)), -(B + 1.0f) / B)) * c.q; - c.b4 = (D * pow((1.0f + D * B * (HP - SP)), -(B + 1.0f) / B)) * c.q; - } - } else if (strtype == 1) {//Inverse stretch - if (B == -1.0f) { - c.qlp = -1.0f * log(1.f + D * (SP - LP)); - c.q0 = c.qlp - D * LP / (1.0f + D * (SP - LP)); - c.qwp = log(1.f + D * (HP - SP)); - c.q1 = c.qwp + D * (1.0f - HP) / (1.0f + D * (HP - SP)); - c.q = 1.0f / (c.q1 - c.q0); - c.LPT = (c.qlp-c.q0)*c.q; - c.SPT = c.q0*c.q; - c.HPT = (c.qwp-c.q0)*c.q; - c.b1 = (1.0f + D * (SP - LP)) / (D * c.q); - c.a2 = (1.0f + D * SP) / D; - c.b2 = -1.0f / D; - c.c2 = - c.q0; - c.d2 = - 1.0f/c.q; - c.a3 = - (1.0f - D * SP) / D; - c.b3 = 1.0f / D; - c.c3 = c.q0; - c.d3 = 1.0f / c.q; - c.a4 = HP + (c.q0 - c.qwp) * (1.f + D * (HP-SP)) / D; - c.b4 = (1.0f + D * (HP - SP) )/(c.q * D) ; - } else if (B < 0.0f) { - B = -B; - c.qlp = (1.0f - pow((1.0f + D * B * (SP - LP)), (B - 1.0f) / B)) / (B - 1.0f); - c.q0 = c.qlp - D * LP * (pow((1.0f + D * B * (SP - LP)), -1.0f / B)); - c.qwp = (pow((1.0f + D * B * (HP - SP)), (B - 1.0f) / B) - 1.0f) / (B - 1.0f); - c.q1 = c.qwp + D * (1.0f - HP) * (pow((1.0f + D * B * (HP - SP)), -1.0f / B)); - c.q = 1.0f / (c.q1 - c.q0); - c.LPT = (c.qlp - c.q0)*c.q; - c.SPT = -c.q0 * c.q; - c.HPT = (c.qwp - c.q0) * c.q; - c.b1 = pow(1.0f + D * B * (SP - LP), 1.0f / B) / (c.q * D); - c.a2 = (1.0f + D * B * SP) / (D * B); - c.b2 = -1.0f / (D * B); - c.c2 = -c.q0 * (B-1.0f) + 1.0f; - c.d2 = (1.0f - B) / c.q; - c.e2 = B / (B - 1.0f); - c.a3 = (D * B * SP - 1.0f) / (D * B); - c.b3 = 1.0f / (D * B); - c.c3 = 1.0f + c.q0 * (B - 1); - c.d3 = (B - 1.0f) / c.q; - c.e3 = B / (B - 1.0f); - c.a4 = (c.q0 - c.qwp)/(D * pow((1.0f + D * B * (HP - SP)), -1.0f / B)) + HP; - c.b4 = 1.0f / (D * pow((1.0f + D * B * (HP - SP)), -1.0f / B) * c.q) ; - } else if (B == 0.0f) { - c.qlp = exp(-D * (SP - LP)); - c.q0 = c.qlp - D * LP * exp(-D*(SP - LP)); - c.qwp = 2.0f - exp(-D * (HP -SP)); - c.q1 = c.qwp + D * (1.0f - HP) * exp (-D * (HP - SP)); - c.q = 1.0f / (c.q1 - c.q0); - c.LPT = (c.qlp - c.q0) * c.q; - c.SPT = (1.0f - c.q0) * c.q; - c.HPT = (c.qwp - c.q0) * c.q; - c.a1 = 0.0f; - c.b1 = 1.0f / (D * exp(-D * (SP - LP)) * c.q); - c.a2 = SP; - c.b2 = 1.0f / D; - c.c2 = c.q0; - c.d2 = 1.0f / c.q; - c.a3 = SP; - c.b3 = -1.0f / D; - c.c3 = (2.0f - c.q0); - c.d3 = -1.0f / c.q; - c.a4 = (c.q0 - c.qwp)/(D * exp(-D * (HP - SP))) + HP; - c.b4 = 1.0f / (D * exp(-D * (HP - SP)) * c.q); - } else if (B > 0.0f) { - c.qlp = pow(( 1.0f + D * B * (SP - LP)), -1.0f/B); - c.q0 = c.qlp - D * LP * pow((1.0f + D * B * (SP - LP)), -(1.0f + B) / B); - c.qwp = 2.0f - pow(1.0f + D * B * (HP - SP), -1.0f / B); - c.q1 = c.qwp + D * (1.0f - HP) * pow((1.0f + D * B * (HP - SP)), -(1.0f + B) / B); - c.q = 1.0f / (c.q1 - c.q0); - c.LPT = (c.qlp - c.q0) * c.q; - c.SPT = (1.0f - c.q0) * c.q; - c.HPT = (c.qwp - c.q0) * c.q; - c.b1 = 1.f / (D * pow((1.0f + D * B * (SP - LP)), -(1.0f + B) / B) * c.q); - c.a2 = 1.0f / (D * B) + SP; - c.b2 = -1.0f / (D * B); - c.c2 = c.q0; - c.d2 = 1.0f / c.q; - c.e2 = -B; - c.a3 = -1.0f / (D * B) + SP; - c.b3 = 1.0f / (D * B); - c.c3 = (2.0f - c.q0); - c.d3 = -1.0f / c.q; - c.e3 = -B; - c.a4 = (c.q0 - c.qwp)/(D * pow((1.0f + D * B * (HP - SP)), -(B + 1.0f) / B)) + HP; - c.b4 = 1.0f/((D * pow((1.0f + D * B * (HP - SP)), -(B + 1.0f) / B)) * c.q); - } - } - return c; -} - -float clamp(float x, float lo, float hi) -{ - return fmax(fmin(x, hi), lo); -} - -float GHT(float x, float B, float D, float LP, float SP, float HP, ght_compute_params c, int strtype) -{ - float out; - float in = clamp(x, 0.f, 1.f);//never negatives values or > 1. hence the need to control the Black point and White point - if (D == 0.0f) {//no stretch - out = in; - } else { - if(strtype == 0) {//Normal stretch - if (B == -1.0f) { - if (in < LP) { - out = c.b1 * in; - } else if (in < SP) { - out = c.a2 + c.b2 * log(c.c2 + c.d2 * in); - } else if (in < HP) { - out = c.a3 + c.b3 * log(c.c3 + c.d3 * in); - } else { - out = c.a4 + c.b4 * in; - } - } else if (B < 0.0f) { - if (in < LP) { - out = c.b1 * in; - } else if (in < SP) { - out = c.a2 + c.b2 * pow((c.c2 + c.d2 * in), c.e2); - } else if (in < HP) { - out = c.a3 + c.b3 * pow((c.c3 + c.d3 * in), c.e3); - } else { - out = c.a4 + c.b4 * in; - } - } else if (B == 0.0f) { - if (in < LP) { - out = c.a1 + c.b1 * in; - } else if (in < SP) { - out = c.a2 + c.b2 * exp(c.c2 + c.d2 * in); - } else if (in < HP) { - out = c.a3 + c.b3 * exp(c.c3 + c.d3 * in); - } else { - out = c.a4 + c.b4 * in; - } - } else /*if (B > 0)*/ { - if (in < LP) { - out = c.b1 * in; - } else if (in < SP) { - out = c.a2 + c.b2 * pow((c.c2 + c.d2 * in), c.e2); - } else if (in < HP) { - out = c.a3 + c.b3 * pow((c.c3 + c.d3 * in), c.e3); - } else { - out = c.a4 + c.b4 * in; - } - } - } if(strtype == 1) {//Inverse Stretch - if (B == -1.0f) { - if (in < c.LPT) { - out = c.b1 * in; - } else if (in < c.SPT) { - out = c.a2 + c.b2 * exp(c.c2 + c.d2 * in); - } else if (in < c.HPT) { - out = c.a3 + c.b3 * exp(c.c3 + c.d3 * in); - } else { - out = c.a4 + c.b4 * in; - } - } else if (B < 0.0f) { - if (in < c.LPT) { - out = c.b1 * in; - } else if (in < c.SPT) { - out = c.a2 + c.b2 * pow((c.c2 + c.d2 * in), c.e2); - } else if (in < c.HPT) { - out = c.a3 + c.b3 * pow((c.c3 + c.d3 * in), c.e3); - } else { - out = c.a4 + c.b4 * in; - } - } else if (B == 0.0f) { - if (in < c.LPT) { - out = c.a1 + c.b1 * in; - } else if (in < c.SPT) { - out = c.a2 + c.b2 * logf(c.c2 + c.d2 * in); - } else if (in < c.HPT) { - out = c.a3 + c.b3 * logf(c.c3 + c.d3 * in); - } else { - out = c.a4 + c.b4 * in; - } - } else /* if (B > 0) */{ - if (in < c.LPT) { - out = c.b1 * in; - } else if (in < c.SPT) { - out = c.a2 + c.b2 * pow((c.c2 + c.d2 * in), c.e2); - } else if (in < c.HPT) { - out = c.a3 + c.b3 * pow((c.c3 + c.d3 * in), c.e3); - } else { - out = c.a4 + c.b4 * in; - } - } - } - } - return out; -} - -// end GHT Siril - - float softlig3(float a, float b) { // as w3C @@ -943,7 +470,6 @@ using namespace procparams; struct local_params { float yc, xc; - float ycent, xcent; float lx, ly; float lxL, lyT; float transweak; @@ -1189,8 +715,6 @@ struct local_params { float contciemask; bool islogcie; bool issmoothcie; - bool issmoothghs; - float ghshp; int noiselequal; float noisechrodetail; float bilat; @@ -1198,7 +722,6 @@ struct local_params { int nldet; int nlpat; int nlrad; - int nliter; float nlgam; float noisegam; float noiselc; @@ -1470,8 +993,6 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.fftcieMask = locallab.spots.at(sp).fftcieMask; lp.islogcie = locallab.spots.at(sp).logcie && locallab.spots.at(sp).expprecam; lp.issmoothcie = locallab.spots.at(sp).smoothcie; - lp.issmoothghs = locallab.spots.at(sp).ghs_smooth; - lp.ghshp = locallab.spots.at(sp).ghs_HP; lp.enaColorMask = locallab.spots.at(sp).enaColorMask && llsoftMask == 0 && llColorMaskinv == 0 && llSHMaskinv == 0 && llColorMask == 0 && llExpMaskinv == 0 && lllcMask == 0 && llsharMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0 && llcieMask == 0;// Exposure mask is deactivated if Color & Light mask is visible lp.enaColorMaskinv = locallab.spots.at(sp).enaColorMask && llColorMaskinv == 0 && llSHMaskinv == 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 && llcieMask == 0;// Exposure mask is deactivated if Color & Light mask is visible lp.enaExpMask = locallab.spots.at(sp).enaExpMask && llExpMask == 0 && llExpMaskinv == 0 && llSHMaskinv == 0 && llColorMask == 0 && llColorMaskinv == 0 && llsoftMask == 0 && lllcMask == 0 && llsharMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && lllogMask == 0 && ll_Mask == 0 && llcieMask == 0;// Exposure mask is deactivated if Color & Light mask is visible @@ -1536,8 +1057,6 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.shmeth = 0; } else if (locallab.spots.at(sp).shMethod == "tone") { lp.shmeth = 1; - } else if (locallab.spots.at(sp).shMethod == "ghs") { - lp.shmeth = 2; } @@ -2030,9 +1549,6 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.actsp = acti; lp.xc = w * local_center_x; lp.yc = h * local_center_y; - lp.xcent = local_center_x; - lp.ycent = local_center_y; - // printf("lp.xc=%f lp.yc=%f \n", (double) lp.xc, (double) lp.yc); lp.lx = w * local_x; lp.ly = h * local_y; lp.lxL = w * local_xL; @@ -2276,7 +1792,6 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.nlpat = locallab.spots.at(sp).nlpat; lp.nlrad = locallab.spots.at(sp).nlrad; lp.nlgam = locallab.spots.at(sp).nlgam; - lp.nliter = locallab.spots.at(sp).nliter; lp.noisegam = locallab.spots.at(sp).noisegam; lp.adjch = (float) locallab.spots.at(sp).adjblur; lp.strengt = streng; @@ -2693,7 +2208,6 @@ void ImProcFunctions::log_encode(Imagefloat *rgb, struct local_params & lp, bool [=](float s, float c) -> float { if (c > noise) { - return 1.f - min(std::abs(s) / c, 1.f); } else { return 0.f; @@ -2990,6 +2504,7 @@ void ImProcFunctions::getAutoLogloc(int sp, ImageSource *imgsrc, float *sourceg, void tone_eq(ImProcFunctions *ipf, Imagefloat *rgb, const struct local_params &lp, const Glib::ustring &workingProfile, double scale, bool multithread) { + ToneEqualizerParams params; params.enabled = true; params.regularization = lp.detailsh; @@ -3014,6 +2529,7 @@ void ImProcFunctions::tone_eqcam(ImProcFunctions *ipf, Imagefloat *rgb, int midt params.bands[1] = sign(midtone) * (mid - threshmid); params.bands[3] = sign(midtone) * (mid - threshmid); } + ipf->toneEqualizer(rgb, params, workingProfile, scale, multithread); } @@ -3033,18 +2549,14 @@ void tone_eqsmooth(ImProcFunctions *ipf, Imagefloat *rgb, const struct local_par if(lp.whiteevjz < 6) {//EV = 6 majority of images params.bands[4] = -15; } - if(lp.islogcie || lp.issmoothghs) {//with log encoding Cie and GHS shadows Highlight - if(!lp.issmoothghs) { - params.bands[4] = -15; - params.bands[5] = -50; - } else { - params.bands[4] = -15 -(1.f-lp.ghshp) * 60.f;//in function of HP GHS highligt protection - params.bands[5] = -30 -(1.f-lp.ghshp) * 50.f;; - } - if(lp.whiteevjz < 6 && !lp.issmoothghs) { + if(lp.islogcie) {//with log encoding Cie + params.bands[4] = -15; + params.bands[5] = -50; + if(lp.whiteevjz < 6) { params.bands[4] = -10; } } + ipf->toneEqualizer(rgb, params, workingProfile, scale, multithread); } @@ -3065,7 +2577,7 @@ void ImProcFunctions::tone_eqcam2(ImProcFunctions *ipf, Imagefloat *rgb, int whi if(bla > threshblawhi2) { params.bands[2] = sign(blacks) * (bla - threshblawhi2); } - + params.bands[4] = whits; int whi = abs(whits); if(whi > threshblawhi) { @@ -3074,17 +2586,7 @@ void ImProcFunctions::tone_eqcam2(ImProcFunctions *ipf, Imagefloat *rgb, int whi if(whi > threshblawhi3) { params.bands[5] = sign(whits) * (whi - threshblawhi3); } - ipf->toneEqualizer(rgb, params, workingProfile, scale, multithread); -} - - -void tone_eqblack(ImProcFunctions *ipf, Imagefloat *rgb, int blacks, const Glib::ustring &workingProfile, double scale, bool multithread) -{ - ToneEqualizerParams params; - params.enabled = true; - params.regularization = 0.f; - params.pivot = 0.f; - params.bands[0] = blacks; + ipf->toneEqualizer(rgb, params, workingProfile, scale, multithread); } @@ -3263,12 +2765,13 @@ void ImProcFunctions::tone_eqdehaz(ImProcFunctions *ipf, Imagefloat *rgb, int wh if(bla > threshblawhi2) { params.bands[2] = blred * sign(blacks) * (bla - threshblawhi2); } - + params.bands[4] = whits; int whi = abs(whits); if(whi > threshblawhi) { params.bands[3] = sign(whits) * (whi - threshblawhi); } + ipf->toneEqualizer(rgb, params, workingProfile, scale, multithread); } @@ -6142,31 +5645,13 @@ struct grad_params { int h; }; -void calclocalGradientParams(int call, const struct local_params& lp, struct grad_params& gp, float ystart, float xstart, float yend, float xend, int bfw, int bfh, int oW, int oH, int tX, int tY, int tW, int tH, int indic, int sk, int fw, int fh) +void calclocalGradientParams(const struct local_params& lp, struct grad_params& gp, float ystart, float xstart, int bfw, int bfh, int indic) { - int w = bfw;//??? oW, tW.. - int h = bfh;//??? oH, tH.. + int w = bfw; + int h = bfh; float stops = 0.f; float angs = 0.f; - double varfeath = 0.25; - // big problem with preview as soon as the preview no longer covers the entire image - // I have tried a lot of things adding parameters that may have an impact oW, oH, tX, tY, tW, tH, fW, fH, sk, call, etc. - // but nothing works really... - // Perhaps with PreviewProps, but I don't know how to do ? - // It seems that you need to change the position of the center of the GF which varies depending on the preview, but how? - // parameters passe to calcGradientFactor may also be involved - // ?? bufmaskblurcol->L[ir][jr] *= ImProcFunctions::calcGradientFactor(gp, jr, ir);// jr - xstart, ir - ystart ?? or others factors - - double gradient_center_x = LIM01((lp.xcent * bfw - xstart) / bfw);//??? - double gradient_center_y = LIM01((lp.ycent * bfh - ystart) / bfh);//??? - - PreviewProps pp(tX, tY, tW * sk, tH * sk, sk);//perhaps needs ? - - if (settings->verbose) { - printf("call=%i xcent=%f ycent=%f \n", call, (double) lp.xcent, (double) lp.ycent); - printf("fw=%i fh=%i bfw=%i bfh=%i oW=%i oH=%i tW=%i tH=%i xstart=%f ystrat=%f xend=%f yend=%f xc=%f yc=%f yT=%f xL=%f sk=%i\n", fw, fh, bfw, bfh, oW, oH, tW, tH, (double) xstart, (double) ystart, (double) xend, (double) yend, (double) lp.xc, (double) lp.yc, (double) lp.lyT, (double)lp.lxL, sk); - printf("PreviewProps: getx=%i gety=%i getW=%i getH=%i\n", pp.getX(), pp.getY(), pp.getWidth(), pp.getHeight()); - } + double varfeath = 0.25; //0.01f * lp.feath; if (indic == 0) { stops = -lp.strmaexp; @@ -6240,10 +5725,12 @@ void calclocalGradientParams(int call, const struct local_params& lp, struct gra varfeath = 0.01f * lp.feathercie; } - int sk2 = sk; - sk2 = 1; - double gradient_stops = stops / sk2;//to test with Skip but does not work well + + double gradient_stops = stops; + double gradient_center_x = LIM01((lp.xc - xstart) / bfw); + double gradient_center_y = LIM01((lp.yc - ystart) / bfh); double gradient_angle = static_cast(angs) / 180.0 * rtengine::RT_PI; + // double varfeath = 0.01f * lp.feath; //printf("xstart=%f ysta=%f lpxc=%f lpyc=%f stop=%f bb=%f cc=%f ang=%f ff=%d gg=%d\n", xstart, ystart, lp.xc, lp.yc, gradient_stops, gradient_center_x, gradient_center_y, gradient_angle, w, h); @@ -6987,7 +6474,7 @@ void ImProcFunctions::retinex_pde(const float * datain, float * dataout, int bfw #endif } -void ImProcFunctions::maskcalccol(int call, bool invmask, bool pde, int bfw, int bfh, int oW, int oH, int tX, int tY, int tW, int tH, int xstart, int ystart, int xend, int yend, int sk, int cx, int cy, LabImage* bufcolorig, LabImage* bufmaskblurcol, LabImage* originalmaskcol, LabImage* original, LabImage* reserved, int inv, struct local_params & lp, +void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int xstart, int ystart, int sk, int cx, int cy, LabImage* bufcolorig, LabImage* bufmaskblurcol, LabImage* originalmaskcol, LabImage* original, LabImage* reserved, int inv, struct local_params & lp, float strumask, bool astool, const LocCCmaskCurve & locccmasCurve, bool lcmasutili, const LocLLmaskCurve & locllmasCurve, bool llmasutili, @@ -6997,7 +6484,7 @@ void ImProcFunctions::maskcalccol(int call, bool invmask, bool pde, int bfw, int const LocwavCurve & loclmasCurvecolwav, bool lmasutilicolwav, int level_bl, int level_hl, int level_br, int level_hr, int shortcu, bool delt, const float hueref, const float chromaref, const float lumaref, float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, - bool fftt, float blu_ma, float cont_ma, int indic, float &fab, int fw, int fh + bool fftt, float blu_ma, float cont_ma, int indic, float &fab ) @@ -7685,7 +7172,7 @@ void ImProcFunctions::maskcalccol(int call, bool invmask, bool pde, int bfw, int struct grad_params gp; if ((indic == 0 && lp.strmaexp != 0.f) || (indic == 12 && lp.str_mas != 0.f)) { - calclocalGradientParams(call, lp, gp, ystart, xstart, yend, xend, bfw, bfh, oW, oH, tX, tY, tW, tH, indic, sk, fw, fh); + calclocalGradientParams(lp, gp, ystart, xstart, bfw, bfh, indic); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif @@ -9482,7 +8969,6 @@ void ImProcFunctions::transit_shapedetect2(int sp, float meantm, float stdtm, in int xend = rtengine::min(static_cast(lp.xc + lp.lx) - cx, original->W); int bfw = xend - xstart; int bfh = yend - ystart; -// printf("DETECT2 lp.xc=%f lp.yc=%f xend=%i\n", (double) lp.xc, (double) lp.yc, xend); //initialize scope @@ -10904,13 +10390,13 @@ void ImProcFunctions::wavcont(const struct local_params& lp, float ** tmp, wavel } -void ImProcFunctions::wavcontrast4(int call, struct local_params& lp, float ** tmp, float ** tmpa, float ** tmpb, float contrast, float radblur, float radlevblur, int bfw, int bfh, int oW, int oH, int tX, int tY, int tW, int tH, int level_bl, int level_hl, int level_br, int level_hr, int sk, int numThreads, +void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float ** tmpa, float ** tmpb, float contrast, float radblur, float radlevblur, int bfw, int bfh, int level_bl, int level_hl, int level_br, int level_hr, int sk, int numThreads, const LocwavCurve & locwavCurve, bool locwavutili, bool wavcurve, const LocwavCurve& loclevwavCurve, bool loclevwavutili, bool wavcurvelev, const LocwavCurve & locconwavCurve, bool locconwavutili, bool wavcurvecon, const LocwavCurve & loccompwavCurve, bool loccompwavutili, bool wavcurvecomp, const LocwavCurve & loccomprewavCurve, bool loccomprewavutili, bool wavcurvecompre, const LocwavCurve & locedgwavCurve, bool locedgwavutili, - float sigm, float offs, int & maxlvl, float sigmadc, float deltad, float chromalev, float chromablu, bool blurlc, bool blurena, bool levelena, bool comprena, bool compreena, float compress, float thres, int fw, int fh) + float sigm, float offs, int & maxlvl, float sigmadc, float deltad, float chromalev, float chromablu, bool blurlc, bool blurena, bool levelena, bool comprena, bool compreena, float compress, float thres) { //BENCHFUN std::unique_ptr wdspot(new wavelet_decomposition(tmp[0], bfw, bfh, maxlvl, 1, sk, numThreads, lp.daubLen)); @@ -10930,7 +10416,7 @@ void ImProcFunctions::wavcontrast4(int call, struct local_params& lp, float ** t if (lp.strwav != 0.f && lp.wavgradl) { array2D factorwav(W_Lm, H_Lm); - calclocalGradientParams(call, lp, gpwav, 0, 0, W_Lm, H_Lm, W_Lm, H_Lm, oW, oH, tX, tY, tW, tH, 10, sk, fw, fh); + calclocalGradientParams(lp, gpwav, 0, 0, W_Lm, H_Lm, 10); const float mult = lp.strwav < 0.f ? -1.f : 1.f; #ifdef _OPENMP #pragma omp parallel for if (multiThread) @@ -11998,10 +11484,7 @@ void ImProcFunctions::DeNoise(int call, int aut, bool noiscfactiv, const struct tmp1.b[ir][jr] = original->b[ir][jr]; } if(lp.nlstr > 0) { - int iter = lp.nliter;//iterations Nlmeans - for(int it = 0; it < iter; it++) { - NLMeans(tmp1.L, lp.nlstr, lp.nldet, lp.nlpat, lp.nlrad, lp.nlgam, GW, GH, float (sk), multiThread); - } + NLMeans(tmp1.L, lp.nlstr, lp.nldet, lp.nlpat, lp.nlrad, lp.nlgam, GW, GH, float (sk), multiThread); } float gamma = lp.noisegam; @@ -13250,10 +12733,7 @@ void ImProcFunctions::DeNoise(int call, int aut, bool noiscfactiv, const struct } if (lp.nlstr > 0) { - int iter = lp.nliter;//iterations Nlmeans - for(int it = 0; it < iter; it++) { - NLMeans(bufwv.L, lp.nlstr, lp.nldet, lp.nlpat, lp.nlrad , lp.nlgam, bfw, bfh, 1.f, multiThread); - } + NLMeans(bufwv.L, lp.nlstr, lp.nldet, lp.nlpat, lp.nlrad, lp.nlgam, bfw, bfh, 1.f, multiThread); } @@ -14347,7 +13827,7 @@ void ImProcFunctions::NLMeans(float **img, int strength, int detail_thresh, int } void ImProcFunctions::Lab_Local( - int call, int sp, float** shbuffer, LabImage * original, LabImage * transformed, LabImage * reserved, LabImage * savenormtm, LabImage * savenormreti, LabImage * lastorig, int fw, int fh, int cx, int cy, int oW, int oH, int tX, int tY, int tW, int tH, int sk, + int call, int sp, float** shbuffer, LabImage * original, LabImage * transformed, LabImage * reserved, LabImage * savenormtm, LabImage * savenormreti, LabImage * lastorig, int fw, int fh, int cx, int cy, int oW, int oH, int sk, const LocretigainCurve& locRETgainCcurve, const LocretitransCurve& locRETtransCcurve, const LUTf& lllocalcurve, bool locallutili, const LUTf& cllocalcurve, bool localclutili, @@ -14357,7 +13837,6 @@ void ImProcFunctions::Lab_Local( const LUTf& lmasklocalcurve, bool localmaskutili, const LUTf& lmaskexplocalcurve, bool localmaskexputili, const LUTf& lmaskSHlocalcurve, bool localmaskSHutili, -// const LUTf& ghslocalcurve, bool localghsutili, const LUTf& lmaskviblocalcurve, bool localmaskvibutili, const LUTf& lmasktmlocalcurve, bool localmasktmutili, LUTf& lmaskretilocalcurve, bool localmaskretiutili, @@ -14406,10 +13885,7 @@ void ImProcFunctions::Lab_Local( 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, int llcieMask, float& minCD, float& maxCD, float& mini, float& maxi, float& Tmean, float& Tsigma, float& Tmin, float& Tmax, float& meantm, float& stdtm, float& meanreti, float& stdreti, float &fab,float &maxicam, float &rdx, float &rdy, float &grx, float &gry, float &blx, float &bly, float &meanx, float &meany, float &meanxe, float &meanye, int &prim, int &ill, float &contsig, float &lightsig, - float& highresi, float& nresi, float& highresi46, float& nresi46, float& Lhighresi, float& Lnresi, float& Lhighresi46, float& Lnresi46, - float *ghscur, int *ghsbpwp, float *ghsbpwpvalue - - + float& highresi, float& nresi, float& highresi46, float& nresi46, float& Lhighresi, float& Lnresi, float& Lhighresi46, float& Lnresi46 ) { @@ -14419,7 +13895,7 @@ void ImProcFunctions::Lab_Local( } //BENCHFUN - // printf("OHWTHW ow=%i oh=%i tw=%i th=%i sk=%i\n", oW, oH, tW, tH, sk); + 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, lllogMask, ll_Mask, llcieMask, locwavCurveden, locwavdenutili); @@ -14601,12 +14077,12 @@ void ImProcFunctions::Lab_Local( int lumask = params->locallab.spots.at(sp).lumask; LocHHmaskCurve lochhhmasCurve; const int highl = 0; - maskcalccol(call, false, pde, bfw, bfh, oW, oH, tX, tY, tW, tH, xstart, ystart, xend, yend, sk, cx, cy, bufexporig.get(), bufmaskoriglog.get(), originalmasklog.get(), original, reserved, inv, lp, + 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, false, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskloglocalcurve, localmasklogutili, dummy, false, 1, 1, 5, 5, shortcu, delt, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1, fab ); if (lp.showmasklogmet == 3) { @@ -14680,11 +14156,11 @@ void ImProcFunctions::Lab_Local( //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(call, lp, gplog, ystart, xstart, yend, xend, bfw, bfh, oW, oH, tX, tY, tW, tH, 11, sk, fw, fh); - + 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); @@ -14819,11 +14295,11 @@ void ImProcFunctions::Lab_Local( LocHHmaskCurve lochhhmasCurve; const float strumask = 0.02 * params->locallab.spots.at(sp).strumaskbl; const bool astool = params->locallab.spots.at(sp).toolbl; - maskcalccol(call, false, pde, TW, TH, oW, oH, tX, tY, tW, tH, 0, 0, 0, 0, sk, cx, cy, bufblorig.get(), bufmaskblurbl.get(), originalmaskbl.get(), original, reserved, inv, lp, + maskcalccol(false, pde, TW, TH, 0, 0, sk, cx, cy, bufblorig.get(), bufmaskblurbl.get(), originalmaskbl.get(), original, reserved, inv, lp, strumask, astool, locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, lochhhmasCurve, false, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskbllocalcurve, localmaskblutili, loclmasCurveblwav, lmasutiliblwav, 1, 1, 5, 5, shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, 0, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, 0, fab ); if (lp.showmaskblmet == 3) { @@ -15637,12 +15113,12 @@ void ImProcFunctions::Lab_Local( float anchorcd = 50.f; LocHHmaskCurve lochhhmasCurve; const int highl = 0; - maskcalccol(call, false, pde, bfw, bfh, oW, oH, tX, tY, tW, tH, xstart, ystart, xend, yend, sk, cx, cy, bufgbm.get(), bufmaskorigtm.get(), originalmasktm.get(), original, reserved, inv, lp, + maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufgbm.get(), bufmaskorigtm.get(), originalmasktm.get(), original, reserved, inv, lp, 0.f, false, locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, lochhhmasCurve, false, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmasktmlocalcurve, localmasktmutili, dummy, false, 1, 1, 5, 5, shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1, fab ); if (lp.showmasktmmet == 3) { @@ -15709,12 +15185,12 @@ void ImProcFunctions::Lab_Local( float anchorcd = 50.f; LocHHmaskCurve lochhhmasCurve; const int highl = 0; - maskcalccol(call, false, pde, bfw, bfh, oW, oH, tX, tY, tW, tH, xstart, ystart, xend, yend, sk, cx, cy, tmp1.get(), bufmaskorigtm.get(), originalmasktm.get(), original, reserved, inv, lp, + maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, tmp1.get(), bufmaskorigtm.get(), originalmasktm.get(), original, reserved, inv, lp, 0.f, false, locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, lochhhmasCurve, false, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmasktmlocalcurve, localmasktmutili, dummy, false, 1, 1, 5, 5, shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1, fab ); if (lp.showmasktmmet == 3) {//display mask @@ -16662,12 +16138,12 @@ void ImProcFunctions::Lab_Local( int shortcu = 0; //lp.mergemet; //params->locallab.spots.at(sp).shortc; LocHHmaskCurve lochhhmasCurve; const int highl = 0; - maskcalccol(call, false, pde, bfw, bfh, oW, oH, tX, tY, tW, tH, xstart, ystart, xend, yend, sk, cx, cy, loctemp.get(), bufmaskorigcb.get(), originalmaskcb.get(), original, reserved, inv, lp, + maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, loctemp.get(), bufmaskorigcb.get(), originalmaskcb.get(), original, reserved, inv, lp, 0.f, false, locccmascbCurve, lcmascbutili, locllmascbCurve, llmascbutili, lochhmascbCurve, lhmascbutili, lochhhmasCurve, false, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskcblocalcurve, localmaskcbutili, dummy, false, 1, 1, 5, 5, shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.0f, 0.f, -1, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.0f, 0.f, -1, fab ); if (lp.showmaskcbmet == 3) { @@ -16894,12 +16370,12 @@ void ImProcFunctions::Lab_Local( float amountcd = 0.f; float anchorcd = 50.f; const int highl = 0; - maskcalccol(call, false, pde, bfw, bfh, oW, oH, tX, tY, tW, tH, xstart, ystart, xend, yend, sk, cx, cy, bufexporig.get(), bufmaskorigvib.get(), originalmaskvib.get(), original, reserved, inv, lp, + maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufexporig.get(), bufmaskorigvib.get(), originalmaskvib.get(), original, reserved, inv, lp, 0.f, false, locccmasvibCurve, lcmasvibutili, locllmasvibCurve, llmasvibutili, lochhmasvibCurve, lhmasvibutili, lochhhmasCurve, false, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskviblocalcurve, localmaskvibutili, dummy, false, 1, 1, 5, 5, shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1, fab ); if (lp.showmaskvibmet == 3) { @@ -16952,8 +16428,9 @@ void ImProcFunctions::Lab_Local( } if (lp.strvibh != 0.f) { + printf("a\n"); struct grad_params gph; - calclocalGradientParams(call, lp, gph, ystart, xstart, yend, xend, bfw, bfh, oW, oH, tX, tY, tW, tH, 9, sk, fw, fh); + calclocalGradientParams(lp, gph, ystart, xstart, bfw, bfh, 9); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif @@ -16992,7 +16469,7 @@ void ImProcFunctions::Lab_Local( if (lp.strvib != 0.f) { struct grad_params gp; - calclocalGradientParams(call, lp, gp, ystart, xstart, yend, xend, bfw, bfh, oW, oH, tX, tY, tW, tH, 7, sk, fw, fh); + calclocalGradientParams(lp, gp, ystart, xstart, bfw, bfh, 7); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif @@ -17005,9 +16482,10 @@ void ImProcFunctions::Lab_Local( } if (lp.strvibab != 0.f) { + printf("c\n"); struct grad_params gpab; - calclocalGradientParams(call, lp, gpab, ystart, xstart, yend, xend, bfw, bfh, oW, oH, tX, tY, tW, tH, 8, sk, fw, fh); + calclocalGradientParams(lp, gpab, ystart, xstart, bfw, bfh, 8); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif @@ -17134,27 +16612,14 @@ void ImProcFunctions::Lab_Local( tonecurv = true; } - bool ghsactiv = false; - float D = params->locallab.spots.at(sp).ghs_D;//enable GHS and Stretch factor - float BLP = params->locallab.spots.at(sp).ghs_BLP; - float HLP = params->locallab.spots.at(sp).ghs_HLP; - bool smoth = params->locallab.spots.at(sp).ghs_smooth;//Highlight attenuation - for(int i = 0; i < 26; i += 2) {//reinit simulation GHS with diagonale +4 12 11 - ghscur[i] = 0.0416f * i; - ghscur[i + 1] = 0.0416f * i; - } - - if(D != 0.f || BLP != 0.f || HLP != 1.f || smoth) { - ghsactiv = true; - } - if (! lp.invsh && (lp.highlihs > 0.f || lp.shadowhs > 0.f || tonequ || tonecurv || ghsactiv || lp.strSH != 0.f || lp.showmaskSHmet == 2 || lp.enaSHMask || lp.showmaskSHmet == 3 || lp.showmaskSHmet == 4 || lp.prevdE) && call <= 3 && lp.hsena) { + if (! lp.invsh && (lp.highlihs > 0.f || lp.shadowhs > 0.f || tonequ || tonecurv || lp.strSH != 0.f || lp.showmaskSHmet == 2 || lp.enaSHMask || lp.showmaskSHmet == 3 || lp.showmaskSHmet == 4 || lp.prevdE) && call <= 3 && lp.hsena) { 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); const int xend = rtengine::min(static_cast(lp.xc + lp.lx) - cx, original->W); const int bfh = yend - ystart; const int bfw = xend - xstart; - // printf("LP.XC=%f LP.YC=%f\n", (double) lp.xc, (double) lp.yc); + if (bfw >= mSP && bfh >= mSP) { @@ -17233,12 +16698,12 @@ void ImProcFunctions::Lab_Local( int lumask = params->locallab.spots.at(sp).lumask; LocHHmaskCurve lochhhmasCurve; const int highl = 0; - maskcalccol(call, false, pde, bfw, bfh, oW, oH, tX, tY, tW, tH, xstart, ystart, xend, yend, sk, cx, cy, bufexporig.get(), bufmaskorigSH.get(), originalmaskSH.get(), original, reserved, inv, lp, + maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufexporig.get(), bufmaskorigSH.get(), originalmaskSH.get(), original, reserved, inv, lp, 0.f, false, locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, lochhhmasCurve, false, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskSHlocalcurve, localmaskSHutili, dummy, false, 1, 1, 5, 5, shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1, fab ); if (lp.showmaskSHmet == 3) { @@ -17272,7 +16737,7 @@ void ImProcFunctions::Lab_Local( struct grad_params gp; if (lp.strSH != 0.f) { - calclocalGradientParams(call, lp, gp, ystart, xstart, yend, xend, bfw, bfh, oW, oH, tX, tY, tW, tH, 2, sk, fw, fh); + calclocalGradientParams(lp, gp, ystart, xstart, bfw, bfh, 2); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif @@ -17311,367 +16776,6 @@ void ImProcFunctions::Lab_Local( delete tmpImage; } - - if (lp.shmeth == 2) { - if(ghsactiv) { - // GHT filter ported from Siril - help with ART CTL thanks to Alberto Griggio - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile); - - float B = params->locallab.spots.at(sp).ghs_B;//Local intensity - float LP = params->locallab.spots.at(sp).ghs_LP;//Protect shadows - float SP = params->locallab.spots.at(sp).ghs_SP;//Symmetry point - float HP = params->locallab.spots.at(sp).ghs_HP;//Protect highlights - int blackpoint = 100. * params->locallab.spots.at(sp).ghs_BLP;//Black point - float shiftblackpoint = - params->locallab.spots.at(sp).ghs_BLP;//Black point - float shiftwhitepoint = params->locallab.spots.at(sp).ghs_HLP;//White point - if(LP > SP) { - LP = SP; - } - if(HP < SP) { - HP = SP; - } - //ghshp2 = HP; - bool ghsinv = params->locallab.spots.at(sp).ghs_inv;//Inverse stretch - int met = 0; - int strtype = 0;//to allow more choice than boolean - if(ghsinv) { - strtype = 1; - } else { - strtype = 0; - } - if (params->locallab.spots.at(sp).ghsMethod == "rgb") {//mode RGB default in luminance mode - met = 0; - } else if (params->locallab.spots.at(sp).ghsMethod == "rgbstd") {//mode RGB standard - met = 1; - } else if (params->locallab.spots.at(sp).ghsMethod == "llab") {//Mode Lab - met = 2; - } else if (params->locallab.spots.at(sp).ghsMethod == "lum") {// L hsl - met = 3; - } else if (params->locallab.spots.at(sp).ghsMethod == "sat") {// sat hsl - met = 4; - } else if (params->locallab.spots.at(sp).ghsMethod == "hue") {// hue hsl - met = 5; - } - - const ght_compute_params c = GHT_setup(B, D, LP, SP, HP, strtype);//setup system with entries - - Imagefloat *tmpImage = nullptr; - tmpImage = new Imagefloat(bfw, bfh); - lab2rgb(*bufexpfin, *tmpImage, params->icm.workingProfile); - Glib::ustring prof = params->icm.workingProfile; - float ghsslop = params->locallab.spots.at(sp).ghs_slope; - float ghschro = params->locallab.spots.at(sp).ghs_chro; - rtengine::GammaValues g_a; //gamma parameters - float gamma1 = 3.0f; //params->locallab.spots.at(sp).shargam; - - double pwr1 = 1.0 / (double) 3.0;//default 3.0 - gamma Lab - double ts1 = ghsslop;//always the same 'slope' in the extreme shadows - slope Lab - rtengine::Color::calcGamma(pwr1, ts1, g_a); // call to calcGamma with selected gamma and slope - const float noise = pow_F(2.f, -16.f);//GHS - do not process very low values ​​which are probably noise. - - if(shiftblackpoint < 0.f && strtype == 0) {//change only Black point with positives values for in some cases out of gamut values - //rgb value can be very weakly negatives (eg working space sRGB in some rare cases) - tone_eqblack prevents it - //also change black value to help "ghs" and avoid noise - tone_eqblack(this, tmpImage, blackpoint, params->icm.workingProfile, sk, multiThread);//Ev -16 to -8 - } - {//change black point and white point for GHS - // Sets the Blackpoint and Whitepoint for a linear stretch of the image - float shiftblackpoint2 = shiftblackpoint; - if(shiftblackpoint < 0.f && strtype == 0) { - shiftblackpoint2 = 0.f; - } - if(strtype == 1) { - shiftblackpoint2 = -shiftblackpoint; - } - int bpnb = 0; - int wpnb = 0; - float minbp = 1.f; - float maxwp = 0.f; - - -#ifdef _OPENMP - # pragma omp parallel for reduction(+:bpnb, wpnb) reduction(min:minbp) reduction(max:maxwp) if (multiThread) //for schedule(dynamic,16) -#endif - for (int i = 0; i < bfh; ++i) - for (int j = 0; j < bfw; ++j) { - float r = tmpImage->r(i, j)/65535.f; - float g = tmpImage->g(i, j)/65535.f; - float b = tmpImage->b(i, j)/65535.f; - float Ro, Go, Bo; - if(strtype == 0) { - Ro = (r - shiftblackpoint2)/(shiftwhitepoint - shiftblackpoint2); - Go = (g - shiftblackpoint2)/(shiftwhitepoint - shiftblackpoint2); - Bo = (b - shiftblackpoint2)/(shiftwhitepoint - shiftblackpoint2); - } else { - Ro = (shiftblackpoint2) + r * (shiftwhitepoint - shiftblackpoint2); - Go = (shiftblackpoint2) + g * (shiftwhitepoint - shiftblackpoint2); - Bo = (shiftblackpoint2) + b * (shiftwhitepoint - shiftblackpoint2); - } - float minrgb = rtengine::min(Ro, Go, Bo); - if(minrgb < minbp){ - minbp = minrgb; - } - - float maxrgb = rtengine::max(Ro, Go, Bo); - if(maxrgb > maxwp){ - maxwp = maxrgb; - } - - if(Ro < 0.f || Go < 0.f || Bo < 0.f) { - bpnb++; - } - if(Ro > 1.f || Go > 1.f || Bo > 1.f) { - wpnb++; - } - if( strtype == 0 ) { //strtype == 0 only strtype == 0 if crash - tmpImage->r(i, j) = rtengine::max(0.00001f, Ro * 65535.f);//0.00001f to avoid crash - tmpImage->g(i, j) = rtengine::max(0.00001f, Go * 65535.f); - tmpImage->b(i, j) = rtengine::max(0.00001f, Bo * 65535.f); - } else if( strtype == 1) {//to uncomment if crash - tmpImage->r(i, j) = clipR(rtengine::max(0.00001f, Ro * 65535.f));//0.0001f to avoid crash different from 'normal' - tmpImage->g(i, j) = clipR(rtengine::max(0.00001f, Go * 65535.f));//clipR to avoid crash in some cases - tmpImage->b(i, j) = clipR(rtengine::max(0.00001f, Bo * 65535.f)); - } - } - ghsbpwp[0] = bpnb; - ghsbpwp[1] = wpnb; - ghsbpwpvalue[0] = minbp; - ghsbpwpvalue[1] = maxwp; - // if (settings->verbose) { - // printf("Black Point-nb=%i White Point-nb=%i min-BlackPoint val=%f max-WhitePointPval=%f \n", ghsbpwp[0], ghsbpwp[1], (double)ghsbpwpvalue[0] , (double) ghsbpwpvalue[1]); - // } - - } - - if(met == 0 || met == 1) {//RGB mode - const auto sf = - [=](float s, float c) -> float - { - if (c > noise) { - return 1.f - min(std::abs(s) / c, 1.f); - } else { - return 0.f; - } - }; - //saturation - const auto apply_sat = - [&](float &r, float &g, float &b, float f, float ll) -> void - { - float rl = r - ll; - float gl = g - ll; - float bl = b - ll; - float s = intp(max(sf(rl, r), sf(gl, g), sf(bl, b)), pow_F(f, 0.3f) * 0.6f + 0.4f, 1.f); - r = ll + s * rl; - g = ll + s * gl; - b = ll + s * bl; - }; - - //local contrast with guidedfilter incorporated in RGB luminance met = 0 - array2D Yc(bfw, bfh); - { - constexpr float base_posterization = 20.f; - array2D Y2(bfw, bfh); - -#ifdef _OPENMP - #pragma omp parallel for if (multiThread) -#endif - for (int y = 0; y < bfh; ++y) { - for (int x = 0; x < bfw; ++x) { - Y2[y][x] = norm2(tmpImage->r(y, x), tmpImage->g(y, x), tmpImage->b(y, x), wprof) / 65535.f;//norm ? - float l = xlogf(rtengine::max(Y2[y][x], 1e-9f)); - float ll = round(l * base_posterization) / base_posterization; - Yc[y][x] = xexpf(ll); - assert(std::isfinite(Yc[y][x])); - } - } - - const float radius = rtengine::max(bfw, bfh) / 30.f; - const float epsilon = 0.005f; - rtengine::guidedFilter(Y2, Yc, Yc, radius, epsilon, multiThread); - } - float blend = 0.01 * params->locallab.spots.at(sp).ghs_LC; - blend = rtengine::max(0.0001f, blend); - //end local contrast integrate to stretch - -#ifdef _OPENMP - # pragma omp parallel for schedule(dynamic,16) if (multiThread) -#endif - for (int i = 0; i < bfh; ++i) - for (int j = 0; j < bfw; ++j) { - float r = tmpImage->r(i, j)/65535.f; - float g = tmpImage->g(i, j)/65535.f; - float b = tmpImage->b(i, j)/65535.f; - float Ro = 0.f; - float Go = 0.f; - float Bo = 0.f; - if(met == 0) { - float tlc = Yc[i][j]; - tlc = rtengine::max(tlc, noise); - float ci = GHT(tlc, B, D, LP, SP, HP, c, strtype); - float flc = ci / tlc; - float gh = norm2(r, g, b, wprof);//Calculate Luminance in function working profile Wprof norm ? - gh = rtengine::max(gh, noise); - float Mgh = GHT(gh, B, D, LP, SP, HP, c, strtype);//ghs transform with "luminance" - float fgh = Mgh / gh; - fgh = intp(blend, flc, fgh); - - Ro = r * fgh;//new values for r, g, b - Go = g * fgh; - Bo = b * fgh; - apply_sat(Ro, Go, Bo, fgh, gh);//always apply saturation - - } else if (met == 1) { - float gh = norm(r, g, b, wprof);//Calculate Luminance in function working profile Wprof - r = rtengine::max(r, noise); - g = rtengine::max(g, noise); - b = rtengine::max(b, noise); - - Ro = GHT(r, B, D, LP, SP, HP, c, strtype);//ghs R RGB standard - Go = GHT(g, B, D, LP, SP, HP, c, strtype);//ghs G RGB standard - Bo = GHT(b, B, D, LP, SP, HP, c, strtype);//ghs B RGB standard - - float fgh = 0.333f * ((Ro / r) + (Go / g) + (Bo /b));//linear average of the 3 channels - apply_sat(Ro, Go, Bo, fgh, gh);//always apply saturation - } - tmpImage->r(i, j) = rtengine::max(0.00001f, Ro * 65535.f);//0.00001f to avoid crash - tmpImage->g(i, j) = rtengine::max(0.00001f, Go * 65535.f); - tmpImage->b(i, j) = rtengine::max(0.00001f, Bo * 65535.f); - } - } else if(met ==3 || met == 4 || met == 5) {//Luminance Saturation Hue HSL -#ifdef _OPENMP - # pragma omp parallel for schedule(dynamic,16) if (multiThread) -#endif - for (int i = 0; i < bfh; ++i) - for (int j = 0; j < bfw; ++j) { - float r = tmpImage->r(i, j); - float g = tmpImage->g(i, j); - float b = tmpImage->b(i, j); - float h, s, l; - Color::rgb2hsl(r, g, b, h, s, l); - if(met == 4) {//saturation - s = GHT(s, B, D, LP, SP, HP, c, strtype); - } else if (met == 3) {//luminance HSL - l = rtengine::max(l, noise); - l = GHT(l, B, D, LP, SP, HP, c, strtype); - } else if (met == 5) {//hue - h = GHT(h, B, D, LP, SP, HP, c, strtype); - } - float R, G, B; - Color::hsl2rgb(h, s, l, R, G, B); - tmpImage->r(i, j) = rtengine::max(0.00001f, R);//0.00001f to avoid crash - tmpImage->g(i, j) = rtengine::max(0.00001f, G); - tmpImage->b(i, j) = rtengine::max(0.00001f, B); - } - } else if(met == 2) {// Luminance chromaticity Lab mode - const std::unique_ptr labtemp(new LabImage(bfw, bfh)); - rgb2lab(*tmpImage, *labtemp, params->icm.workingProfile); - const float satreal = ghschro; - - DiagonalCurve color_satur({//curve for smoothing chroma ++ - DCT_NURBS, - 0, 0, - 0.2, 0.2f + satreal / 250.f, - 0.6, rtengine::min(1.f, 0.6f + satreal / 250.f), - 1, 1 - }); - - DiagonalCurve color_saturmoins({//curve for smoothing chroma -- - DCT_NURBS, - 0, 0, - 0.1f - satreal / 150.f, 0.1f, - rtengine::min(1.f, 0.7f - satreal / 300.f), 0.7, - 1, 1 - }); - -#ifdef _OPENMP - # pragma omp parallel for schedule(dynamic,16) if (multiThread) -#endif - for (int i = 0; i < bfh; ++i) - for (int j = 0; j < bfw; ++j) { - float lLab = labtemp->L[i][j]/32768.f; - float alab = labtemp->a[i][j]; - float blab = labtemp->b[i][j]; - //Chromaticity - float Chprov = std::sqrt(SQR(alab) + SQR(blab)); - float2 sincosval; - sincosval.y = Chprov == 0.0f ? 1.f : alab / Chprov; - sincosval.x = Chprov == 0.0f ? 0.f : blab / Chprov; - if(ghschro > 0.f){ - Chprov = static_cast(color_satur.getVal(LIM01(Chprov / 35000.f))); - } else { - Chprov = static_cast(color_saturmoins.getVal(LIM01(Chprov / 35000.f))); - } - float chl = LIM01(Chprov);//in case of very very strong chromaticity to be sure no clip - chl = GHT(chl, B, D, LP, SP, HP, c, strtype);//Chromaticity GHS - Chprov = chl * 35000.f; - alab = Chprov * sincosval.y; - blab = Chprov * sincosval.x; - //Luminance with new slope - lLab = gammalog(lLab, gamma1, ts1, g_a[3], g_a[4]);//slope factor - lLab = rtengine::max(lLab, noise); - lLab = GHT(lLab, B, D, LP, SP, HP, c, strtype);//Luminance GHS - lLab = igammalog(lLab, gamma1, ts1, g_a[2], g_a[4]);//inverse slope factor - - labtemp->L[i][j] = lLab * 32768.f; - labtemp->a[i][j] = alab;//restore Lab values - labtemp->b[i][j] = blab; - } - lab2rgb(*labtemp, *tmpImage, params->icm.workingProfile); - } - /* - //11 points with equal interval - for(int i = 0; i < 26; i += 2) {//Labgrid curve simulation with 9 points +4 12 11 - ghscur[i] = 0.041666f * i; - ghscur[i + 1] = GHT(ghscur[i], B, D, LP, SP, HP, c, strtype); - //printf("gi=%f ghs=%f \n", (double) ghscur[i], (double) ghscur[i + 1]); - } - */ - //first value with 0.05 range - ghscur[0] = 0.05f; - ghscur[1] = GHT(ghscur[0], B, D, LP, SP, HP, c, strtype); - - for(int i = 2; i < 20; i += 2) {//Labgrid curve simulation with 9 points interval 0.1 +4 12 11 - //others with 0.1 range - ghscur[i] = 0.05f * i; - ghscur[i + 1] = GHT(ghscur[i], B, D, LP, SP, HP, c, strtype); - } - //last values with 0.05f - ghscur[20] = 0.95f; - ghscur[21] = GHT(ghscur[20], B, D, LP, SP, HP, c, strtype); - - - if(smoth) {//Highlight attenuation in function of HP - protect highlight - tone_eqsmooth(this, tmpImage, lp, params->icm.workingProfile, sk, multiThread);//reduce Ev > 0 < 12 - } - - if(strtype == 1) {//inverse GHS -#ifdef _OPENMP - #pragma omp parallel for if (multiThread) -#endif - for (int i = 0; i < bfh; ++i) - for (int j = 0; j < bfw; ++j) { - tmpImage->r(i, j) = clipR(rtengine::max(0.00001f, tmpImage->r(i, j)));//0.0001f to avoid crash - tmpImage->g(i, j) = clipR(rtengine::max(0.00001f, tmpImage->g(i, j)));//clipR to avoid crash in inverse GHS - tmpImage->b(i, j) = clipR(rtengine::max(0.00001f, tmpImage->b(i, j))); - } - } - - - - rgb2lab(*tmpImage, *bufexpfin, params->icm.workingProfile); - - delete tmpImage; - //local contrast minimum - double kmod = 2.2; - if(met == 0) { - kmod = 1.6; - } - float rad = kmod * params->locallab.spots.at(sp).ghs_LC; - float stren = 15.f * (1.f + D);//take into account D stretch - loccont(bfw, bfh, bufexpfin.get(), rad, stren , sk); - } - } - } if (lp.enaSHMask && lp.recothrs != 1.f) { @@ -17778,12 +16882,12 @@ void ImProcFunctions::Lab_Local( int lumask = params->locallab.spots.at(sp).lumask; LocHHmaskCurve lochhhmasCurve; const int highl = 0; - maskcalccol(call, false, pde, TW, TH, oW, oH, tX, tY, tW, tH, 0, 0, 0, 0, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskSH.get(), original, reserved, inv, lp, + maskcalccol(false, pde, TW, TH, 0, 0, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskSH.get(), original, reserved, inv, lp, 0.f, false, locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, lochhhmasCurve, false, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskSHlocalcurve, localmaskSHutili, dummy, false, 1, 1, 5, 5, shortcu, false, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1, fab ); @@ -18055,12 +17159,12 @@ void ImProcFunctions::Lab_Local( int lumask = params->locallab.spots.at(sp).lumask; LocHHmaskCurve lochhhmasCurve; const int highl = 0; - maskcalccol(call, false, pde, bfw, bfh, oW, oH, tX, tY, tW, tH, xstart, ystart, xend, yend, sk, cx, cy, bufgb.get(), bufmaskoriglc.get(), originalmasklc.get(), original, reserved, inv, lp, + maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufgb.get(), bufmaskoriglc.get(), originalmasklc.get(), original, reserved, inv, lp, 0.f, false, locccmaslcCurve, lcmaslcutili, locllmaslcCurve, llmaslcutili, lochhmaslcCurve, lhmaslcutili, lochhhmasCurve, false, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmasklclocalcurve, localmasklcutili, dummy, false, 1, 1, 5, 5, shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1, fab ); if (lp.showmasklcmet == 3) { @@ -18195,7 +17299,7 @@ void ImProcFunctions::Lab_Local( } } - wavcontrast4(call, lp, tmp1->L, tmp1->a, tmp1->b, contrast, radblur, radlevblur, tmp1->W, tmp1->H, oW, oH, tX, tY, tW, tH, level_bl, level_hl, level_br, level_hr, sk, numThreads, locwavCurve, locwavutili, wavcurve, loclevwavCurve, loclevwavutili, wavcurvelev, locconwavCurve, locconwavutili, wavcurvecon, loccompwavCurve, loccompwavutili, wavcurvecomp, loccomprewavCurve, loccomprewavutili, wavcurvecompre, locedgwavCurve, locedgwavutili, sigma, offs, maxlvl, sigmadc, deltad, chrol, chrobl, blurlc, blurena, levelena, comprena, compreena, compress, thres, fw, fh); + wavcontrast4(lp, tmp1->L, tmp1->a, tmp1->b, contrast, radblur, radlevblur, tmp1->W, tmp1->H, level_bl, level_hl, level_br, level_hr, sk, numThreads, locwavCurve, locwavutili, wavcurve, loclevwavCurve, loclevwavutili, wavcurvelev, locconwavCurve, locconwavutili, wavcurvecon, loccompwavCurve, loccompwavutili, wavcurvecomp, loccomprewavCurve, loccomprewavutili, wavcurvecompre, locedgwavCurve, locedgwavutili, sigma, offs, maxlvl, sigmadc, deltad, chrol, chrobl, blurlc, blurena, levelena, comprena, compreena, compress, thres); if (params->locallab.spots.at(sp).expcie && params->locallab.spots.at(sp).modecie == "wav") { bool HHcurvejz = false, CHcurvejz = false, LHcurvejz = false; @@ -18871,12 +17975,12 @@ void ImProcFunctions::Lab_Local( int lumask = params->locallab.spots.at(sp).lumask; LocHHmaskCurve lochhhmasCurve; const int highl = 0; - maskcalccol(call, false, pde, bfw, bfh, oW, oH, tX, tY, tW, tH, xstart, ystart, xend, yend, sk, cx, cy, bufexporig.get(), bufmaskblurexp.get(), originalmaskexp.get(), original, reserved, inv, lp, + maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufexporig.get(), bufmaskblurexp.get(), originalmaskexp.get(), original, reserved, inv, lp, 0.f, false, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, lochhhmasCurve, false, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskexplocalcurve, localmaskexputili, dummy, false, 1, 1, 5, 5, shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, 0, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, 0, fab ); if (lp.showmaskexpmet == 3) { @@ -18940,7 +18044,7 @@ void ImProcFunctions::Lab_Local( if (lp.strexp != 0.f) { - calclocalGradientParams(call, lp, gp, ystart, xstart, yend, xend, bfw, bfh, oW, oH, tX, tY, tW, tH, 1, sk, fw, fh); + calclocalGradientParams(lp, gp, ystart, xstart, bfw, bfh, 1); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif @@ -19239,12 +18343,12 @@ void ImProcFunctions::Lab_Local( constexpr float anchorcd = 50.f; LocHHmaskCurve lochhhmasCurve; const int highl = 0; - maskcalccol(call, false, pde, TW, TH, oW, oH, tX, tY, tW, tH, 0, 0, 0, 0, sk, cx, cy, bufexporig.get(), bufmaskblurexp.get(), originalmaskexp.get(), original, reserved, inv, lp, + maskcalccol(false, pde, TW, TH, 0, 0, sk, cx, cy, bufexporig.get(), bufmaskblurexp.get(), originalmaskexp.get(), original, reserved, inv, lp, 0.f, false, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, lochhhmasCurve, false, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskexplocalcurve, localmaskexputili, dummy, false, 1, 1, 5, 5, shortcu, false, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, 0, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, 0, fab ); if (lp.showmaskexpmetinv == 1) { @@ -19467,13 +18571,13 @@ void ImProcFunctions::Lab_Local( const float anchorcd = 50.f; const int highl = 0; bool astool = params->locallab.spots.at(sp).toolcol; - maskcalccol(call, false, pde, bfw, bfh, oW, oH, tX, tY, tW, tH, xstart, ystart, xend, yend, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskcol.get(), original, reserved, inv, lp, + maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskcol.get(), original, reserved, inv, lp, strumask, astool, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, llochhhmasCurve, lhhmasutili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmasklocalcurve, localmaskutili, loclmasCurvecolwav, lmasutilicolwav, level_bl, level_hl, level_br, level_hr, shortcu, delt, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, lp.fftColorMask, lp.blurcolmask, lp.contcolmask, -1, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, lp.fftColorMask, lp.blurcolmask, lp.contcolmask, -1, fab ); if (lp.showmaskcolmet == 3) { @@ -19849,7 +18953,7 @@ void ImProcFunctions::Lab_Local( if (lp.strcol != 0.f) { struct grad_params gp; - calclocalGradientParams(call, lp, gp, ystart, xstart, yend, xend, bfw, bfh, oW, oH, tX, tY, tW, tH, 3, sk, fw, fh); + calclocalGradientParams(lp, gp, ystart, xstart, bfw, bfh, 3); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif @@ -19864,7 +18968,7 @@ void ImProcFunctions::Lab_Local( if (lp.strcolab != 0.f) { struct grad_params gpab; - calclocalGradientParams(call, lp, gpab, ystart, xstart, yend, xend, bfw, bfh, oW, oH, tX, tY, tW, tH, 4, sk, fw, fh); + calclocalGradientParams(lp, gpab, ystart, xstart, bfw, bfh, 4); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif @@ -19880,7 +18984,7 @@ void ImProcFunctions::Lab_Local( if (lp.strcolh != 0.f) { struct grad_params gph; - calclocalGradientParams(call, lp, gph, ystart, xstart, yend, xend, bfw, bfh, oW, oH, tX, tY, tW, tH, 6, sk, fw, fh); + calclocalGradientParams(lp, gph, ystart, xstart, bfw, bfh, 6); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif @@ -20374,7 +19478,7 @@ void ImProcFunctions::Lab_Local( //gradient if (lp.strcol != 0.f) { struct grad_params gp; - calclocalGradientParams(call, lp, gp, ystart, xstart, yend, xend, bfw, bfh, oW, oH, tX, tY, tW, tH, 3, sk, fw, fh); + calclocalGradientParams(lp, gp, ystart, xstart, bfw, bfh, 3); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif @@ -20388,7 +19492,7 @@ void ImProcFunctions::Lab_Local( if (lp.strcolab != 0.f) { struct grad_params gpab; - calclocalGradientParams(call, lp, gpab, ystart, xstart, yend, xend, bfw, bfh, oW, oH, tX, tY, tW, tH, 5, sk, fw, fh); + calclocalGradientParams(lp, gpab, ystart, xstart, bfw, bfh, 5); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif @@ -20403,7 +19507,7 @@ void ImProcFunctions::Lab_Local( if (lp.strcolh != 0.f) { struct grad_params gph; - calclocalGradientParams(call, lp, gph, ystart, xstart, yend, xend, bfw, bfh, oW, oH, tX, tY, tW, tH, 6, sk, fw, fh); + calclocalGradientParams(lp, gph, ystart, xstart, bfw, bfh, 6); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif @@ -20599,13 +19703,13 @@ void ImProcFunctions::Lab_Local( constexpr float amountcd = 0.f; constexpr float anchorcd = 50.f; const int highl = 0; - maskcalccol(call, false, pde, TW, TH, oW, oH, tX, tY, tW, tH, 0, 0, 0, 0, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskcol.get(), original, reserved, inv, lp, + maskcalccol(false, pde, TW, TH, 0, 0, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskcol.get(), original, reserved, inv, lp, strumask, params->locallab.spots.at(sp).toolcol, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, llochhhmasCurve, lhhmasutili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmasklocalcurve, localmaskutili, loclmasCurvecolwav, lmasutilicolwav, level_bl, level_hl, level_br, level_hr, shortcu, false, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, lp.fftColorMask, lp.blurcolmask, lp.contcolmask, -1, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, lp.fftColorMask, lp.blurcolmask, lp.contcolmask, -1, fab ); if (lp.showmaskcolmetinv == 1) { @@ -20727,13 +19831,13 @@ void ImProcFunctions::Lab_Local( const float anchorcd = 50.f; const int highl = 0; bool astool = params->locallab.spots.at(sp).toolmask; - maskcalccol(call, false, pde, bfw, bfh, oW, oH, tX, tY, tW, tH, xstart, ystart, xend, yend, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskcol.get(), original, reserved, inv, lp, + maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskcol.get(), original, reserved, inv, lp, strumask, astool, locccmas_Curve, lcmas_utili, locllmas_Curve, llmas_utili, lochhmas_Curve, lhmas_utili, lochhhmas_Curve, lhhmas_utili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendmab, shado, highl, amountcd, anchorcd, lmasklocal_curve, localmask_utili, loclmasCurve_wav, lmasutili_wav, level_bl, level_hl, level_br, level_hr, shortcu, delt, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, lp.fftma, lp.blurma, lp.contma, 12, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, lp.fftma, lp.blurma, lp.contma, 12, fab ); @@ -20948,13 +20052,13 @@ void ImProcFunctions::Lab_Local( const int shado = params->locallab.spots.at(sp).shadmaskcie; const int highl = params->locallab.spots.at(sp).highmaskcie; - maskcalccol(call, false, pde, bfw, bfh, oW, oH, tX, tY, tW, tH, xstart, ystart, xend, yend, sk, cx, cy, bufexporig.get(), bufmaskorigcie.get(), originalmaskcie.get(), original, reserved, inv, lp, + maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufexporig.get(), bufmaskorigcie.get(), originalmaskcie.get(), original, reserved, inv, lp, strumask, astool, locccmascieCurve, lcmascieutili, locllmascieCurve, llmascieutili, lochhmascieCurve, lhmascieutili, llochhhmascieCurve, lhhmascieutili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskcielocalcurve, localmaskcieutili, loclmasCurveciewav, lmasutiliciewav, level_bl, level_hl, level_br, level_hr, shortcu, delt, hueref, chromaref, lumaref, - maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, lp.fftcieMask, lp.blurciemask, lp.contciemask, -1, fab, fw, fh + maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, lp.fftcieMask, lp.blurciemask, lp.contciemask, -1, fab ); if (lp.showmaskciemet == 3) { @@ -21303,7 +20407,7 @@ void ImProcFunctions::Lab_Local( if (lp.strgradcie != 0.f) { struct grad_params gp; - calclocalGradientParams(call, lp, gp, ystart, xstart, yend, xend, bfw, bfh, oW, oH, tX, tY, tW, tH, 15, sk, fw, fh); + calclocalGradientParams(lp, gp, ystart, xstart, bfw, bfh, 15); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 653ffa73f..9398af56b 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3388,43 +3388,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : visishadhigh(false), expshadhigh(false), complexshadhigh(0), - shMethod("ghs"), - ghsMethod("rgb"), - ghsMode("ghs"), - ghs_D(0.), - ghs_slope(9.03296), - ghs_chro(0.0), - ghs_B(0.), - ghs_SP(0.015),//initialized with a low value to avoid zero - ghs_LP(0.), - ghs_HP(1.), - ghs_LC(30.), - ghs_BLP(0.), - ghs_HLP(1.0001), - ghs_smooth(false), - ghs_inv(false), - ghsx1(0.05), - ghsy1(0.05), - ghsx2(0.1), - ghsy2(0.1), - ghsx3(0.2), - ghsy3(0.2), - ghsx4(0.3), - ghsy4(0.3), - ghsx5(0.4), - ghsy5(0.4), - ghsx6(0.5), - ghsy6(0.5), - ghsx7(0.6), - ghsy7(0.6), - ghsx8(0.7), - ghsy8(0.7), - ghsx9(0.8), - ghsy9(0.8), - ghsx10(0.9), - ghsy10(0.9), - ghsx11(0.95), - ghsy11(0.95), + shMethod("tone"), multsh{0, 0, 0, 0, 0, 0}, highlights(0), h_tonalwidth(70), @@ -3652,7 +3616,6 @@ LocallabParams::LocallabSpot::LocallabSpot() : nlpat(2), nlrad(5), nlgam(3.), - nliter(1), sensiden(60), reparden(100.), detailthr(50), @@ -4693,6 +4656,16 @@ LocallabParams::LocallabSpot::LocallabSpot() : refi(0.), shiftxl(0.), shiftyl(0.), + labgridcieALow(0.51763),//Prophoto red = (0.7347+0.1) * 1.81818 - 1 + labgridcieBLow(-0.33582), + labgridcieAHigh(-0.75163),//Prophoto blue + labgridcieBHigh(-0.8180), + labgridcieGx(-0.528),//Prophoto green 0.1596 + labgridcieGy(0.7096),//0.84 + labgridcieWx(-0.18964),//D50 0.3457, 0.3585, + labgridcieWy(-0.16636),// + labgridcieMx(0.), + labgridcieMy(0.),// whitescie(0), blackscie(0), illMethod("d50"), @@ -5059,44 +5032,6 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && expshadhigh == other.expshadhigh && complexshadhigh == other.complexshadhigh && shMethod == other.shMethod - && ghsMethod == other.ghsMethod - && ghsMode == other.ghsMode - && ghs_D == other.ghs_D - && ghs_slope == other.ghs_slope - && ghs_chro == other.ghs_chro - && ghs_B == other.ghs_B - && ghs_SP == other.ghs_SP - && ghs_LP == other.ghs_LP - && ghs_HP == other.ghs_HP - && ghs_LC == other.ghs_LC - && ghs_BLP == other.ghs_BLP - && ghs_HLP == other.ghs_HLP - && ghs_smooth == other.ghs_smooth - && ghs_inv == other.ghs_inv - && ghsx1 == other.ghsx1 - && ghsy1 == other.ghsy1 - && ghsx2 == other.ghsx2 - && ghsy2 == other.ghsy2 - && ghsx3 == other.ghsx3 - && ghsy3 == other.ghsy3 - && ghsx4 == other.ghsx4 - && ghsy4 == other.ghsy4 - && ghsx5 == other.ghsx5 - && ghsy5 == other.ghsy5 - && ghsx6 == other.ghsx6 - && ghsy6 == other.ghsy6 - && ghsx7 == other.ghsx7 - && ghsy7 == other.ghsy7 - && ghsx8 == other.ghsx8 - && ghsy8 == other.ghsy8 - && ghsx9 == other.ghsx9 - && ghsy9 == other.ghsy9 - && ghsx10 == other.ghsx10 - && ghsy10 == other.ghsy10 - && ghsx11 == other.ghsx11 - && ghsy11 == other.ghsy11 - - && [this, &other]() -> bool { for (int i = 0; i < 6; ++i) { @@ -5234,7 +5169,6 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && nlpat == other.nlpat && nlrad == other.nlrad && nlgam == other.nlgam - && nliter == other.nliter && sensiden == other.sensiden && reparden == other.reparden && detailthr == other.detailthr @@ -7060,43 +6994,6 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->expshadhigh, "Locallab", "Expshadhigh_" + index_str, spot.expshadhigh, keyFile); saveToKeyfile(!pedited || spot_edited->complexshadhigh, "Locallab", "Complexshadhigh_" + index_str, spot.complexshadhigh, keyFile); saveToKeyfile(!pedited || spot_edited->shMethod, "Locallab", "ShMethod_" + index_str, spot.shMethod, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsMethod, "Locallab", "GhsMethod_" + index_str, spot.ghsMethod, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsMode, "Locallab", "GhsMode_" + index_str, spot.ghsMode, keyFile); - saveToKeyfile(!pedited || spot_edited->ghs_D, "Locallab", "Ghs_D_" + index_str, spot.ghs_D, keyFile); - saveToKeyfile(!pedited || spot_edited->ghs_slope, "Locallab", "Ghs_slope_" + index_str, spot.ghs_slope, keyFile); - saveToKeyfile(!pedited || spot_edited->ghs_chro, "Locallab", "Ghs_chro_" + index_str, spot.ghs_chro, keyFile); - saveToKeyfile(!pedited || spot_edited->ghs_B, "Locallab", "Ghs_B_" + index_str, spot.ghs_B, keyFile); - saveToKeyfile(!pedited || spot_edited->ghs_SP, "Locallab", "Ghs_SP_" + index_str, spot.ghs_SP, keyFile); - saveToKeyfile(!pedited || spot_edited->ghs_LP, "Locallab", "Ghs_LP_" + index_str, spot.ghs_LP, keyFile); - saveToKeyfile(!pedited || spot_edited->ghs_HP, "Locallab", "Ghs_HP_" + index_str, spot.ghs_HP, keyFile); - saveToKeyfile(!pedited || spot_edited->ghs_LC, "Locallab", "Ghs_LC_" + index_str, spot.ghs_LC, keyFile); - saveToKeyfile(!pedited || spot_edited->ghs_BLP, "Locallab", "Ghs_BLP_" + index_str, spot.ghs_BLP, keyFile); - saveToKeyfile(!pedited || spot_edited->ghs_HLP, "Locallab", "Ghs_HLP_" + index_str, spot.ghs_HLP, keyFile); - saveToKeyfile(!pedited || spot_edited->ghs_smooth, "Locallab", "Ghs_smooth_" + index_str, spot.ghs_smooth, keyFile); - saveToKeyfile(!pedited || spot_edited->ghs_inv, "Locallab", "Ghs_inv_" + index_str, spot.ghs_inv, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsx1, "Locallab", "Ghsx1_" + index_str, spot.ghsx1, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsy1, "Locallab", "Ghsy1_" + index_str, spot.ghsy1, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsx2, "Locallab", "Ghsx2_" + index_str, spot.ghsx2, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsy2, "Locallab", "Ghsy2_" + index_str, spot.ghsy2, keyFile); - - saveToKeyfile(!pedited || spot_edited->ghsx3, "Locallab", "Ghsx3_" + index_str, spot.ghsx3, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsy3, "Locallab", "Ghsy3_" + index_str, spot.ghsy3, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsx4, "Locallab", "Ghsx4_" + index_str, spot.ghsx4, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsy4, "Locallab", "Ghsy4_" + index_str, spot.ghsy4, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsx5, "Locallab", "Ghsx5_" + index_str, spot.ghsx5, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsy5, "Locallab", "Ghsy5_" + index_str, spot.ghsy5, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsx6, "Locallab", "Ghsx6_" + index_str, spot.ghsx6, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsy6, "Locallab", "Ghsy6_" + index_str, spot.ghsy6, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsx7, "Locallab", "Ghsx7_" + index_str, spot.ghsx7, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsy7, "Locallab", "Ghsy7_" + index_str, spot.ghsy7, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsx8, "Locallab", "Ghsx8_" + index_str, spot.ghsx8, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsy8, "Locallab", "Ghsy8_" + index_str, spot.ghsy8, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsx9, "Locallab", "Ghsx9_" + index_str, spot.ghsx9, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsy9, "Locallab", "Ghsy9_" + index_str, spot.ghsy9, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsx10, "Locallab", "Ghsx10_" + index_str, spot.ghsx10, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsy10, "Locallab", "Ghsy10_" + index_str, spot.ghsy10, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsx11, "Locallab", "Ghsx11_" + index_str, spot.ghsx11, keyFile); - saveToKeyfile(!pedited || spot_edited->ghsy11, "Locallab", "Ghsy11_" + index_str, spot.ghsy11, keyFile); for (int j = 0; j < 6; j++) { saveToKeyfile(!pedited || spot_edited->multsh[j], "Locallab", "Multsh" + std::to_string(j) + "_" + index_str, spot.multsh[j], keyFile); @@ -7232,7 +7129,6 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->nlpat, "Locallab", "Nlpat_" + index_str, spot.nlpat, keyFile); saveToKeyfile(!pedited || spot_edited->nlrad, "Locallab", "Nlrad_" + index_str, spot.nlrad, keyFile); saveToKeyfile(!pedited || spot_edited->nlgam, "Locallab", "Nlgam_" + index_str, spot.nlgam, keyFile); - saveToKeyfile(!pedited || spot_edited->nliter, "Locallab", "Nliter_" + index_str, spot.nliter, keyFile); saveToKeyfile(!pedited || spot_edited->sensiden, "Locallab", "Sensiden_" + index_str, spot.sensiden, keyFile); saveToKeyfile(!pedited || spot_edited->reparden, "Locallab", "Reparden_" + index_str, spot.reparden, keyFile); saveToKeyfile(!pedited || spot_edited->detailthr, "Locallab", "Detailthr_" + index_str, spot.detailthr, keyFile); @@ -9430,44 +9326,6 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Complexshadhigh_" + index_str, spot.complexshadhigh, spotEdited.complexshadhigh); assignFromKeyfile(keyFile, "Locallab", "ShMethod_" + index_str, spot.shMethod, spotEdited.shMethod); - assignFromKeyfile(keyFile, "Locallab", "GhsMethod_" + index_str, spot.ghsMethod, spotEdited.ghsMethod); - assignFromKeyfile(keyFile, "Locallab", "GhsMode_" + index_str, spot.ghsMode, spotEdited.ghsMode); - assignFromKeyfile(keyFile, "Locallab", "Ghs_D_" + index_str, spot.ghs_D, spotEdited.ghs_D); - assignFromKeyfile(keyFile, "Locallab", "Ghs_slope_" + index_str, spot.ghs_slope, spotEdited.ghs_slope); - assignFromKeyfile(keyFile, "Locallab", "Ghs_chro_" + index_str, spot.ghs_chro, spotEdited.ghs_chro); - assignFromKeyfile(keyFile, "Locallab", "Ghs_B_" + index_str, spot.ghs_B, spotEdited.ghs_B); - assignFromKeyfile(keyFile, "Locallab", "Ghs_SP_" + index_str, spot.ghs_SP, spotEdited.ghs_SP); - assignFromKeyfile(keyFile, "Locallab", "Ghs_LP_" + index_str, spot.ghs_LP, spotEdited.ghs_LP); - assignFromKeyfile(keyFile, "Locallab", "Ghs_HP_" + index_str, spot.ghs_HP, spotEdited.ghs_HP); - assignFromKeyfile(keyFile, "Locallab", "Ghs_LC_" + index_str, spot.ghs_LC, spotEdited.ghs_LC); - assignFromKeyfile(keyFile, "Locallab", "Ghs_BLP_" + index_str, spot.ghs_BLP, spotEdited.ghs_BLP); - assignFromKeyfile(keyFile, "Locallab", "Ghs_HLP_" + index_str, spot.ghs_HLP, spotEdited.ghs_HLP); - assignFromKeyfile(keyFile, "Locallab", "Ghs_smooth_" + index_str, spot.ghs_smooth, spotEdited.ghs_smooth); - assignFromKeyfile(keyFile, "Locallab", "Ghs_inv_" + index_str, spot.ghs_inv, spotEdited.ghs_inv); - - assignFromKeyfile(keyFile, "Locallab", "Ghsx1_" + index_str, spot.ghsx1, spotEdited.ghsx1); - assignFromKeyfile(keyFile, "Locallab", "Ghsy1_" + index_str, spot.ghsy1, spotEdited.ghsy1); - assignFromKeyfile(keyFile, "Locallab", "Ghsx2_" + index_str, spot.ghsx2, spotEdited.ghsx2); - assignFromKeyfile(keyFile, "Locallab", "Ghsy2_" + index_str, spot.ghsy2, spotEdited.ghsy2); - - assignFromKeyfile(keyFile, "Locallab", "Ghsx3_" + index_str, spot.ghsx3, spotEdited.ghsx3); - assignFromKeyfile(keyFile, "Locallab", "Ghsy3_" + index_str, spot.ghsy3, spotEdited.ghsy3); - assignFromKeyfile(keyFile, "Locallab", "Ghsx4_" + index_str, spot.ghsx4, spotEdited.ghsx4); - assignFromKeyfile(keyFile, "Locallab", "Ghsy4_" + index_str, spot.ghsy4, spotEdited.ghsy4); - assignFromKeyfile(keyFile, "Locallab", "Ghsx5_" + index_str, spot.ghsx5, spotEdited.ghsx5); - assignFromKeyfile(keyFile, "Locallab", "Ghsy5_" + index_str, spot.ghsy5, spotEdited.ghsy5); - assignFromKeyfile(keyFile, "Locallab", "Ghsx6_" + index_str, spot.ghsx6, spotEdited.ghsx6); - assignFromKeyfile(keyFile, "Locallab", "Ghsy6_" + index_str, spot.ghsy6, spotEdited.ghsy6); - assignFromKeyfile(keyFile, "Locallab", "Ghsx7_" + index_str, spot.ghsx7, spotEdited.ghsx7); - assignFromKeyfile(keyFile, "Locallab", "Ghsy7_" + index_str, spot.ghsy7, spotEdited.ghsy7); - assignFromKeyfile(keyFile, "Locallab", "Ghsx8_" + index_str, spot.ghsx8, spotEdited.ghsx8); - assignFromKeyfile(keyFile, "Locallab", "Ghsy8_" + index_str, spot.ghsy8, spotEdited.ghsy8); - assignFromKeyfile(keyFile, "Locallab", "Ghsx9_" + index_str, spot.ghsx9, spotEdited.ghsx9); - assignFromKeyfile(keyFile, "Locallab", "Ghsy9_" + index_str, spot.ghsy9, spotEdited.ghsy9); - assignFromKeyfile(keyFile, "Locallab", "Ghsx10_" + index_str, spot.ghsx10, spotEdited.ghsx10); - assignFromKeyfile(keyFile, "Locallab", "Ghsy10_" + index_str, spot.ghsy10, spotEdited.ghsy10); - assignFromKeyfile(keyFile, "Locallab", "Ghsx11_" + index_str, spot.ghsx11, spotEdited.ghsx11); - assignFromKeyfile(keyFile, "Locallab", "Ghsy11_" + index_str, spot.ghsy11, spotEdited.ghsy11); for (int j = 0; j < 6; j ++) { assignFromKeyfile(keyFile, "Locallab", "Multsh" + std::to_string(j) + "_" + index_str, spot.multsh[j], spotEdited.multsh[j]); @@ -9654,7 +9512,6 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Nlpat_" + index_str, spot.nlpat, spotEdited.nlpat); assignFromKeyfile(keyFile, "Locallab", "Nlrad_" + index_str, spot.nlrad, spotEdited.nlrad); assignFromKeyfile(keyFile, "Locallab", "Nlgam_" + index_str, spot.nlgam, spotEdited.nlgam); - assignFromKeyfile(keyFile, "Locallab", "Nliter_" + index_str, spot.nliter, spotEdited.nliter); assignFromKeyfile(keyFile, "Locallab", "Sensiden_" + index_str, spot.sensiden, spotEdited.sensiden); assignFromKeyfile(keyFile, "Locallab", "Reparden_" + index_str, spot.reparden, spotEdited.reparden); assignFromKeyfile(keyFile, "Locallab", "Detailthr_" + index_str, spot.detailthr, spotEdited.detailthr); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 5f536dd29..117c8b3d6 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1233,42 +1233,6 @@ struct LocallabParams { bool expshadhigh; int complexshadhigh; Glib::ustring shMethod; // std, tone - Glib::ustring ghsMethod; // rgb, lum, sat - Glib::ustring ghsMode; // lin, ghs - double ghs_D; - double ghs_slope; - double ghs_chro; - double ghs_B; - double ghs_SP; - double ghs_LP; - double ghs_HP; - double ghs_LC; - double ghs_BLP; - double ghs_HLP; - bool ghs_smooth; - bool ghs_inv; - double ghsx1; - double ghsy1; - double ghsx2; - double ghsy2; - double ghsx3; - double ghsy3; - double ghsx4; - double ghsy4; - double ghsx5; - double ghsy5; - double ghsx6; - double ghsy6; - double ghsx7; - double ghsy7; - double ghsx8; - double ghsy8; - double ghsx9; - double ghsy9; - double ghsx10; - double ghsy10; - double ghsx11; - double ghsy11; int multsh[6]; int highlights; int h_tonalwidth; @@ -1398,7 +1362,6 @@ struct LocallabParams { int nlpat; int nlrad; double nlgam; - int nliter; int sensiden; double reparden; int detailthr; diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index 7ddae5c89..cb4dc36c5 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -475,16 +475,6 @@ public: int primlc; }; - struct locallabshGHS {//To draw GHS S curve - double ghsc[24];//+4 12 11 - }; - - - struct locallabshGHSbw {//To draw GHS S curve - int ghsbw[2]; - double ghsbwvalue[2]; - }; - //select spot settings struct locallabsetLC { int mainf; @@ -514,8 +504,6 @@ public: virtual void minmaxChanged(const std::vector &minmax, int selspot) = 0; virtual void denChanged(const std::vector &denlc, int selspot) = 0; virtual void cieChanged(const std::vector &cielc, int selspot) = 0; - virtual void ghsChanged(const std::vector &shghs, int selspot) = 0; - virtual void ghsbwChanged(const std::vector &shghsbw, int selspot) = 0; virtual void maiChanged(const std::vector &csetlc, int selspot) = 0; virtual void sigChanged(const std::vector &ciesig, int selspot) = 0; virtual void ciebefChanged(const std::vector &ciebef, int selspot) = 0; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 3eb3ca075..4850863f8 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1120,7 +1120,6 @@ private: LUTf lmasklocalcurve(65536, LUT_CLIP_OFF); LUTf lmaskexplocalcurve(65536, LUT_CLIP_OFF); LUTf lmaskSHlocalcurve(65536, LUT_CLIP_OFF); - // LUTf ghslocalcurve(65536, LUT_CLIP_OFF); LUTf lmaskviblocalcurve(65536, LUT_CLIP_OFF); LUTf lmasktmlocalcurve(65536, LUT_CLIP_OFF); LUTf lmaskretilocalcurve(65536, LUT_CLIP_OFF); @@ -1218,7 +1217,6 @@ private: const bool localmaskutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskcurve, lmasklocalcurve, 1); const bool localmaskexputili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskexpcurve, lmaskexplocalcurve, 1); const bool localmaskSHutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).LmaskSHcurve, lmaskSHlocalcurve, 1); - // const bool localghsutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).ghscurve, ghslocalcurve, 1); const bool localmaskvibutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskvibcurve, lmaskviblocalcurve, 1); const bool localmasktmutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmasktmcurve, lmasktmlocalcurve, 1); const bool localmaskretiutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskreticurve, lmaskretilocalcurve, 1); @@ -1291,16 +1289,9 @@ private: float Lnresi = 0.f; float Lhighresi46 = 0.f; float Lnresi46 = 0.f; - float ghscur[24];//+4 12 11 - int ghsbpwp[2]; - ghsbpwp[0] = 0; - ghsbpwp[1] = 0; - float ghsbpwpvalue[2]; - ghsbpwpvalue[0] = 0.f; - ghsbpwpvalue[1] = 1.f; // No Locallab mask is shown in exported picture - ipf.Lab_Local(2, sp, shbuffer, labView, labView, reservView.get(), savenormtmView.get(), savenormretiView.get(), lastorigView.get(), fw, fh, 0, 0, fw, fh, fw, fh, fw, fh, 1, locRETgainCurve, locRETtransCurve, + ipf.Lab_Local(2, sp, shbuffer, labView, labView, reservView.get(), savenormtmView.get(), savenormretiView.get(), lastorigView.get(), fw, fh, 0, 0, fw, fh, 1, locRETgainCurve, locRETtransCurve, lllocalcurve, locallutili, cllocalcurve, localclutili, lclocalcurve, locallcutili, @@ -1309,7 +1300,6 @@ private: lmasklocalcurve, localmaskutili, lmaskexplocalcurve, localmaskexputili, lmaskSHlocalcurve, localmaskSHutili, - // ghslocalcurve, localghsutili, lmaskviblocalcurve, localmaskvibutili, lmasktmlocalcurve, localmasktmutili, lmaskretilocalcurve, localmaskretiutili, @@ -1355,8 +1345,7 @@ private: 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, 0, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, meantme, stdtme, meanretie, stdretie, fab, maxicam, rdx, rdy, grx, gry, blx, bly, meanx, meany, meanxe, meanye, prim, ill, contsig, lightsig, - highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46, - ghscur, ghsbpwp, ghsbpwpvalue + highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46 ); if (sp + 1u < params.locallab.spots.size()) { diff --git a/rtgui/colortoning.cc b/rtgui/colortoning.cc index b5ea9ef2a..d5e570994 100644 --- a/rtgui/colortoning.cc +++ b/rtgui/colortoning.cc @@ -647,8 +647,7 @@ void ColorToning::read (const ProcParams* pp, const ParamsEdited* pedited) lastLumamode = pp->colorToning.lumamode; - labgrid->setParams(pp->colorToning.labgridALow / ColorToningParams::LABGRID_CORR_MAX, pp->colorToning.labgridBLow / ColorToningParams::LABGRID_CORR_MAX, pp->colorToning.labgridAHigh / ColorToningParams::LABGRID_CORR_MAX, pp->colorToning.labgridBHigh / ColorToningParams::LABGRID_CORR_MAX, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false);//+4 12 11 + labgrid->setParams(pp->colorToning.labgridALow / ColorToningParams::LABGRID_CORR_MAX, pp->colorToning.labgridBLow / ColorToningParams::LABGRID_CORR_MAX, pp->colorToning.labgridAHigh / ColorToningParams::LABGRID_CORR_MAX, pp->colorToning.labgridBHigh / ColorToningParams::LABGRID_CORR_MAX, 0, 0, 0, 0, 0, 0,false); if (pedited && !pedited->colorToning.method) { method->set_active (7); @@ -720,8 +719,7 @@ void ColorToning::write (ProcParams* pp, ParamsEdited* pedited) double zerox = 0.; double zeroy = 0.; - labgrid->getParams(pp->colorToning.labgridALow, pp->colorToning.labgridBLow, pp->colorToning.labgridAHigh, pp->colorToning.labgridBHigh, - zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy);//+4 12 11 + labgrid->getParams(pp->colorToning.labgridALow, pp->colorToning.labgridBLow, pp->colorToning.labgridAHigh, pp->colorToning.labgridBHigh, zerox, zeroy, zerox, zeroy, zerox, zeroy); pp->colorToning.labgridALow *= ColorToningParams::LABGRID_CORR_MAX; pp->colorToning.labgridAHigh *= ColorToningParams::LABGRID_CORR_MAX; pp->colorToning.labgridBLow *= ColorToningParams::LABGRID_CORR_MAX; @@ -837,8 +835,7 @@ void ColorToning::setDefaults (const ProcParams* defParams, const ParamsEdited* hlColSat->setDefault (defParams->colorToning.hlColSat); shadowsColSat->setDefault (defParams->colorToning.shadowsColSat); strength->setDefault (defParams->colorToning.strength); - labgrid->setDefault(defParams->colorToning.labgridALow / ColorToningParams::LABGRID_CORR_MAX, defParams->colorToning.labgridBLow / ColorToningParams::LABGRID_CORR_MAX, defParams->colorToning.labgridAHigh / ColorToningParams::LABGRID_CORR_MAX, defParams->colorToning.labgridBHigh / ColorToningParams::LABGRID_CORR_MAX, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);//+4 12 11 + labgrid->setDefault(defParams->colorToning.labgridALow / ColorToningParams::LABGRID_CORR_MAX, defParams->colorToning.labgridBLow / ColorToningParams::LABGRID_CORR_MAX, defParams->colorToning.labgridAHigh / ColorToningParams::LABGRID_CORR_MAX, defParams->colorToning.labgridBHigh / ColorToningParams::LABGRID_CORR_MAX, 0, 0, 0, 0, 0, 0); if (pedited) { @@ -1438,7 +1435,7 @@ void ColorToning::labRegionGet(int idx) double la, lb; double zerox = 0.; double zeroy = 0.; - labRegionAB->getParams(la, lb, r.a, r.b, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy);//+4 12 11 + labRegionAB->getParams(la, lb, r.a, r.b, zerox, zeroy, zerox, zeroy, zerox, zeroy); r.saturation = labRegionSaturation->getValue(); r.slope = labRegionSlope->getValue(); r.offset = labRegionOffset->getValue(); @@ -1576,7 +1573,7 @@ void ColorToning::labRegionShow(int idx, bool list_only) rtengine::procparams::ColorToningParams::LabCorrectionRegion dflt; auto &r = labRegionData[idx]; if (!list_only) { - labRegionAB->setParams(0, 0, r.a, r.b,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false);//+4 12 11 + labRegionAB->setParams(0, 0, r.a, r.b,0, 0, 0, 0, 0, 0, false); labRegionSaturation->setValue(r.saturation); labRegionSlope->setValue(r.slope); labRegionOffset->setValue(r.offset); diff --git a/rtgui/curveeditor.cc b/rtgui/curveeditor.cc index c307b69db..efe2ef200 100644 --- a/rtgui/curveeditor.cc +++ b/rtgui/curveeditor.cc @@ -72,23 +72,15 @@ bool CurveEditor::reset() return subGroup->curveReset(this); } -DiagonalCurveEditor::DiagonalCurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEditorSubGroup* ceSubGroup, int typ) : CurveEditor::CurveEditor(text, static_cast(ceGroup), ceSubGroup) +DiagonalCurveEditor::DiagonalCurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEditorSubGroup* ceSubGroup) : CurveEditor::CurveEditor(text, static_cast(ceGroup), ceSubGroup) { - if(typ == 0) { - curveType->addEntry("curve-linear-small", M("CURVEEDITOR_LINEAR")); // 0 Linear - curveType->addEntry("curve-spline-small", M("CURVEEDITOR_CUSTOM")); // 1 Spline - curveType->addEntry("curve-catmullrom-small", M("CURVEEDITOR_CATMULLROM")); // 4 CatmullRom - curveType->addEntry("curve-parametric-small", M("CURVEEDITOR_PARAMETRIC")); // 2 Parametric - curveType->addEntry("curve-nurbs-small", M("CURVEEDITOR_NURBS")); // 3 NURBS - } else if(typ == 1) { - curveType->addEntry("curve-nurbs-small", M("CURVEEDITOR_NURBS")); // 3 NURBS - } - if(typ == 0) { - static_cast(curveType)->setPosIndexMap({ 0, 1, 4, 2, 3 }); - } else if (typ == 1) { - static_cast(curveType)->setPosIndexMap({3}); - } + curveType->addEntry("curve-linear-small", M("CURVEEDITOR_LINEAR")); // 0 Linear + curveType->addEntry("curve-spline-small", M("CURVEEDITOR_CUSTOM")); // 1 Spline + curveType->addEntry("curve-catmullrom-small", M("CURVEEDITOR_CATMULLROM")); // 4 CatmullRom + curveType->addEntry("curve-parametric-small", M("CURVEEDITOR_PARAMETRIC")); // 2 Parametric + curveType->addEntry("curve-nurbs-small", M("CURVEEDITOR_NURBS")); // 3 NURBS + static_cast(curveType)->setPosIndexMap({ 0, 1, 4, 2, 3 }); curveType->setSelected(DCT_Linear); curveType->show(); diff --git a/rtgui/curveeditor.h b/rtgui/curveeditor.h index 6f3762cdf..398c63603 100644 --- a/rtgui/curveeditor.h +++ b/rtgui/curveeditor.h @@ -163,7 +163,7 @@ protected: double rangeMilestones[3]; public: - DiagonalCurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEditorSubGroup* ceSubGroup, int type = 0); + DiagonalCurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEditorSubGroup* ceSubGroup); std::vector getCurve () override; void setRangeLabels(Glib::ustring r1, Glib::ustring r2, Glib::ustring r3, Glib::ustring r4); void getRangeLabels(Glib::ustring &r1, Glib::ustring &r2, Glib::ustring &r3, Glib::ustring &r4); diff --git a/rtgui/curveeditorgroup.cc b/rtgui/curveeditorgroup.cc index 9de05d018..5ce3765a2 100644 --- a/rtgui/curveeditorgroup.cc +++ b/rtgui/curveeditorgroup.cc @@ -84,16 +84,16 @@ void CurveEditorGroup::hideCurrentCurve() * periodic: for FlatCurve only, ask the curve to be periodic (default: True) * */ -CurveEditor* CurveEditorGroup::addCurve(CurveType cType, Glib::ustring curveLabel, Gtk::Widget *relatedWidget, bool expandRelatedWidget, bool periodic, int typ) +CurveEditor* CurveEditorGroup::addCurve(CurveType cType, Glib::ustring curveLabel, Gtk::Widget *relatedWidget, bool expandRelatedWidget, bool periodic) { switch (cType) { case (CT_Diagonal): { if (!diagonalSubGroup) { - diagonalSubGroup = new DiagonalCurveEditorSubGroup(this, curveDir, typ); + diagonalSubGroup = new DiagonalCurveEditorSubGroup(this, curveDir); } // We add it to the curve editor list - DiagonalCurveEditor* newCE = diagonalSubGroup->addCurve(curveLabel, typ); + DiagonalCurveEditor* newCE = diagonalSubGroup->addCurve(curveLabel); newCE->relatedWidget = relatedWidget; newCE->expandRelatedWidget = expandRelatedWidget; curveEditors.push_back(newCE); diff --git a/rtgui/curveeditorgroup.h b/rtgui/curveeditorgroup.h index 561a65d60..55d438b2d 100644 --- a/rtgui/curveeditorgroup.h +++ b/rtgui/curveeditorgroup.h @@ -87,7 +87,7 @@ public: return displayedCurve; } //void on_realize (); - CurveEditor* addCurve(CurveType cType, Glib::ustring curveLabel, Gtk::Widget *relatedWidget = nullptr, bool expandRelatedWidget = true, bool periodic = true, int typ = 0); + CurveEditor* addCurve(CurveType cType, Glib::ustring curveLabel, Gtk::Widget *relatedWidget = nullptr, bool expandRelatedWidget = true, bool periodic = true); void attachCurve (Gtk::Grid* curve); protected: diff --git a/rtgui/diagonalcurveeditorsubgroup.cc b/rtgui/diagonalcurveeditorsubgroup.cc index 911405e2a..88d9a14c5 100644 --- a/rtgui/diagonalcurveeditorsubgroup.cc +++ b/rtgui/diagonalcurveeditorsubgroup.cc @@ -36,7 +36,7 @@ #include "../rtengine/curves.h" -DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, Glib::ustring& curveDir, int typ) : CurveEditorSubGroup(curveDir) +DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, Glib::ustring& curveDir) : CurveEditorSubGroup(curveDir) { editedAdjuster = nullptr; @@ -125,6 +125,7 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, customCurveGrid->attach_next_to(*custombbox, *customCurveBox, Gtk::POS_LEFT, 1, 1); customCurveGrid->attach_next_to(*customCoordAdjuster, *custombbox, Gtk::POS_BOTTOM, 2, 1); } + customCurveGrid->show_all (); customCoordAdjuster->hide(); @@ -218,21 +219,6 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, } NURBSCurveGrid->show_all (); - if(typ == 1) {//for GHS curve... not a curve ! - editPointNURBS->hide(); - editNURBS->hide(); - copyNURBS->hide(); - pasteNURBS->hide(); - loadNURBS->hide(); - saveNURBS->hide(); - } else if(typ ==0) { - editPointNURBS->show(); - editNURBS->show(); - copyNURBS->show(); - pasteNURBS->show(); - loadNURBS->show(); - saveNURBS->show(); - } NURBSCoordAdjuster->hide(); saveNURBS->signal_clicked().connect( sigc::mem_fun(*this, &DiagonalCurveEditorSubGroup::savePressed) ); @@ -401,17 +387,15 @@ DiagonalCurveEditorSubGroup::~DiagonalCurveEditorSubGroup() /* * Add a new curve to the curves list */ -DiagonalCurveEditor* DiagonalCurveEditorSubGroup::addCurve(Glib::ustring curveLabel, int typ) +DiagonalCurveEditor* DiagonalCurveEditorSubGroup::addCurve(Glib::ustring curveLabel) { - DiagonalCurveEditor* newCE = new DiagonalCurveEditor(curveLabel, parent, this, typ); - - // Initialization of the new curve + DiagonalCurveEditor* newCE = new DiagonalCurveEditor(curveLabel, parent, this); + // Initialization of the new curve storeCurveValues(newCE, getCurveFromGUI(DCT_Spline)); storeCurveValues(newCE, getCurveFromGUI(DCT_Parametric)); storeCurveValues(newCE, getCurveFromGUI(DCT_NURBS)); storeCurveValues(newCE, getCurveFromGUI(DCT_CatumullRom)); - return newCE; } diff --git a/rtgui/diagonalcurveeditorsubgroup.h b/rtgui/diagonalcurveeditorsubgroup.h index 64dd9e9f6..08e0828f5 100644 --- a/rtgui/diagonalcurveeditorsubgroup.h +++ b/rtgui/diagonalcurveeditorsubgroup.h @@ -81,10 +81,10 @@ protected: int activeParamControl; public: - DiagonalCurveEditorSubGroup(CurveEditorGroup* prt, Glib::ustring& curveDir, int typ = 0); + DiagonalCurveEditorSubGroup(CurveEditorGroup* prt, Glib::ustring& curveDir); ~DiagonalCurveEditorSubGroup() override; - DiagonalCurveEditor* addCurve(Glib::ustring curveLabel = "", int typ = 0); + DiagonalCurveEditor* addCurve(Glib::ustring curveLabel = ""); void updateBackgroundHistogram (CurveEditor* ce) override; void switchGUI() override; void refresh(CurveEditor *curveToRefresh) override; diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index b0cb28d8f..649978cf9 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -78,7 +78,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iu ipDialog = Gtk::manage(new MyFileChooserButton(M("TP_ICM_INPUTDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); ipDialog->set_tooltip_text(M("TP_ICM_INPUTCUSTOM_TOOLTIP")); bindCurrentFolder(*ipDialog, options.lastIccDir); - labgridcie = Gtk::manage(new LabGrid(EvICMLabGridciexy, M("TP_ICM_LABGRID_CIEXY"), true, true, false, true)); + labgridcie = Gtk::manage(new LabGrid(EvICMLabGridciexy, M("TP_ICM_LABGRID_CIEXY"), true, true, true)); // ------------------------------- Input profile @@ -701,7 +701,7 @@ void ICMPanel::iprimChanged (float r_x, float r_y, float b_x, float b_y, float g [this]() -> bool { disableListener(); - labgridcie->setParams(nextrx, nextry, nextbx, nextby, nextgx, nextgy, nextwx, nextwy, nextmx, nextmy, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false);//+4 12 11 + labgridcie->setParams(nextrx, nextry, nextbx, nextby, nextgx, nextgy, nextwx, nextwy, nextmx, nextmy, false); enableListener(); return false; } @@ -963,8 +963,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited) shiftx->setValue(pp->icm.shiftx); shifty->setValue(pp->icm.shifty); preser->setValue(pp->icm.preser); - labgridcie->setParams(pp->icm.labgridcieALow, pp->icm.labgridcieBLow, pp->icm.labgridcieAHigh, pp->icm.labgridcieBHigh, pp->icm.labgridcieGx, pp->icm.labgridcieGy, pp->icm.labgridcieWx, pp->icm.labgridcieWy, pp->icm.labgridcieMx, - pp->icm.labgridcieMy, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false);//+4 12 11 + labgridcie->setParams(pp->icm.labgridcieALow, pp->icm.labgridcieBLow, pp->icm.labgridcieAHigh, pp->icm.labgridcieBHigh, pp->icm.labgridcieGx, pp->icm.labgridcieGy, pp->icm.labgridcieWx, pp->icm.labgridcieWy, pp->icm.labgridcieMx, pp->icm.labgridcieMy, false); if (pedited) { iunchanged->set_active(!pedited->icm.inputProfile); @@ -1299,11 +1298,7 @@ void ICMPanel::write(ProcParams* pp, ParamsEdited* pedited) pp->icm.workingProfile = wProfNames->get_active_text(); pp->icm.dcpIlluminant = rtengine::max(dcpIll->get_active_row_number(), 0); - double zerox = 0.; - double zeroy = 0.; - - labgridcie->getParams(pp->icm.labgridcieALow, pp->icm.labgridcieBLow, pp->icm.labgridcieAHigh, pp->icm.labgridcieBHigh, pp->icm.labgridcieGx, pp->icm.labgridcieGy, pp->icm.labgridcieWx, pp->icm.labgridcieWy, pp->icm.labgridcieMx, pp->icm.labgridcieMy, - zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy);//+4 12 11 + labgridcie->getParams(pp->icm.labgridcieALow, pp->icm.labgridcieBLow, pp->icm.labgridcieAHigh, pp->icm.labgridcieBHigh, pp->icm.labgridcieGx, pp->icm.labgridcieGy, pp->icm.labgridcieWx, pp->icm.labgridcieWy, pp->icm.labgridcieMx, pp->icm.labgridcieMy); if (oProfNames->get_active_text() == M("TP_ICM_NOICM")) { pp->icm.outputProfile = ColorManagementParams::NoICMString; @@ -1400,11 +1395,7 @@ void ICMPanel::setDefaults(const ProcParams* defParams, const ParamsEdited* pedi shiftx->setDefault(defParams->icm.shiftx); shifty->setDefault(defParams->icm.shifty); preser->setDefault(defParams->icm.preser); - double zerox = 0.; - double zeroy = 0.; - - labgridcie->setDefault(defParams->icm.labgridcieALow, defParams->icm.labgridcieBLow , defParams->icm.labgridcieAHigh, defParams->icm.labgridcieBHigh, defParams->icm.labgridcieGx, defParams->icm.labgridcieGy, defParams->icm.labgridcieWx, defParams->icm.labgridcieWy, defParams->icm.labgridcieMx, defParams->icm.labgridcieMy, - zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy);//+4 12 11 + labgridcie->setDefault(defParams->icm.labgridcieALow, defParams->icm.labgridcieBLow , defParams->icm.labgridcieAHigh, defParams->icm.labgridcieBHigh, defParams->icm.labgridcieGx, defParams->icm.labgridcieGy, defParams->icm.labgridcieWx, defParams->icm.labgridcieWy, defParams->icm.labgridcieMx, defParams->icm.labgridcieMy); if (pedited) { wGamma->setDefaultEditedState(pedited->icm.workingTRCGamma ? Edited : UnEdited); diff --git a/rtgui/labgrid.cc b/rtgui/labgrid.cc index a664cd8a9..9babe17ca 100644 --- a/rtgui/labgrid.cc +++ b/rtgui/labgrid.cc @@ -60,9 +60,9 @@ bool LabGridArea::notifyListener() { return int(v * 1000) / 1000.f; }; - if (! ciexy_enabled && !ghs_enabled){ + if (! ciexy_enabled){ listener->panelChanged(evt, Glib::ustring::compose(evtMsg, round(high_a), round(high_b), round(low_a), round(low_b))); - } else if (ciexy_enabled) { + } else { float high_a1 = 0.55f * (high_a + 1.f) - 0.1f; float high_b1 = 0.55f * (high_b + 1.f) - 0.1f; float low_a1 = 0.55f * (low_a + 1.f) - 0.1f; @@ -76,20 +76,17 @@ bool LabGridArea::notifyListener() } -LabGridArea::LabGridArea(rtengine::ProcEvent evt, const Glib::ustring &msg, bool enable_low, bool ciexy, bool ghs, bool mous): +LabGridArea::LabGridArea(rtengine::ProcEvent evt, const Glib::ustring &msg, bool enable_low, bool ciexy, bool mous): Gtk::DrawingArea(), evt(evt), evtMsg(msg), litPoint(NONE), - low_a(0.f), high_a(0.f), low_b(0.f), high_b(0.f), gre_x(0.f), gre_y(0.f), whi_x(0.f), whi_y(0.f), me_x(0.f), me_y(0.f),ghs_x6(0.f), ghs_y6(0.f), ghs_x7(0.f), ghs_y7(0.f), - ghs_x8(0.f), ghs_y8(0.f), ghs_x9(0.f), ghs_y9(0.f), ghs_x10(0.f), ghs_y10(0.f), ghs_x11(0.f), ghs_y11(0.f), //these variables are used as xy in Ciexy - no change labels +4 12 11 + low_a(0.f), high_a(0.f), low_b(0.f), high_b(0.f), gre_x(0.f), gre_y(0.f), whi_x(0.f), whi_y(0.f), me_x(0.f), me_y(0.f),//these variables are used as xy in Ciexy - no change labels defaultLow_a(0.f), defaultHigh_a(0.f), defaultLow_b(0.f), defaultHigh_b(0.f), defaultgre_x(0.f), defaultgre_y(0.f), defaultwhi_x(0.f), defaultwhi_y(0.f), defaultme_x(0.f), defaultme_y(0.f), - default_gsx6(0.f), default_gsy6(0.f), default_gsx7(0.f), default_gsy7(0.f), default_gsx8(0.f), default_gsy8(0.f), default_gsx9(0.f), default_gsy9(0.f), default_gsx10(0.f), default_gsy10(0.f), default_gsx11(0.f), default_gsy11(0.f),//+4 12 11 listener(nullptr), edited(false), isDragged(false), low_enabled(enable_low), ciexy_enabled(ciexy), - ghs_enabled(ghs), mous_enabled(mous) @@ -100,8 +97,7 @@ LabGridArea::LabGridArea(rtengine::ProcEvent evt, const Glib::ustring &msg, bool get_style_context()->add_class("drawingarea"); } -void LabGridArea::getParams(double &la, double &lb, double &ha, double &hb, double &gx, double &gy, double &wx, double &wy, double &mx, double &my, - double &gx6, double &gy6, double &gx7, double &gy7, double &gx8, double &gy8, double &gx9, double &gy9, double &gx10, double &gy10, double &gx11, double &gy11) const +void LabGridArea::getParams(double &la, double &lb, double &ha, double &hb, double &gx, double &gy, double &wx, double &wy, double &mx, double &my) const { la = low_a; ha = high_a; @@ -113,25 +109,11 @@ void LabGridArea::getParams(double &la, double &lb, double &ha, double &hb, doub wy = whi_y; mx = me_x; my = me_y; - gx6 = ghs_x6; - gy6 = ghs_y6; - gx7 = ghs_x7; - gy7 = ghs_y7; - gx8 = ghs_x8; - gy8 = ghs_y8; - gx9 = ghs_x9; - gy9 = ghs_y9; - gx10 = ghs_x10;//+4 12 11 - gy10 = ghs_y10; - gx11 = ghs_x11; - gy11 = ghs_y11; - // printf("la=%f ha=%f lb=%f hb=%f gx=%f gy=%f\n", la, ha, lb, hb, gx, gy); } -void LabGridArea::setParams(double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my, - double gx6, double gy6, double gx7, double gy7, double gx8, double gy8, double gx9, double gy9, double gx10, double gy10, double gx11, double gy11, bool notify) +void LabGridArea::setParams(double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my, bool notify) { const double lo = -1.0; const double hi = 1.0; @@ -145,28 +127,14 @@ void LabGridArea::setParams(double la, double lb, double ha, double hb, double g whi_y = rtengine::LIM(wy, lo, hi); me_x = rtengine::LIM(mx, lo, hi); me_y = rtengine::LIM(my, lo, hi); - ghs_x6 = rtengine::LIM(gx6, lo, hi); - ghs_y6 = rtengine::LIM(gy6, lo, hi); - ghs_x7 = rtengine::LIM(gx7, lo, hi); - ghs_y7 = rtengine::LIM(gy7, lo, hi); - ghs_x8 = rtengine::LIM(gx8, lo, hi); - ghs_y8 = rtengine::LIM(gy8, lo, hi); - ghs_x9 = rtengine::LIM(gx9, lo, hi); - ghs_y9 = rtengine::LIM(gy9, lo, hi); - ghs_x10 = rtengine::LIM(gx10, lo, hi);//+4 12 11 - ghs_y10 = rtengine::LIM(gy10, lo, hi); - ghs_x11 = rtengine::LIM(gx11, lo, hi); - ghs_y11 = rtengine::LIM(gy11, lo, hi); - - + queue_draw(); if (notify) { notifyListener(); } } -void LabGridArea::setDefault (double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my, - double gx6, double gy6, double gx7, double gy7, double gx8, double gy8, double gx9, double gy9, double gx10, double gy10, double gx11, double gy11) +void LabGridArea::setDefault (double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my) { defaultLow_a = la; defaultLow_b = lb; @@ -178,30 +146,16 @@ void LabGridArea::setDefault (double la, double lb, double ha, double hb, double defaultwhi_y = wy; defaultme_x = mx; defaultme_y = my; - default_gsx6 = gx6; - default_gsy6= gy6; - default_gsx7 = gx7; - default_gsy7= gy7; - default_gsx8 = gx8; - default_gsy8= gy8; - default_gsx9 = gx9; - default_gsy9= gy9; - default_gsx10 = gx10; - default_gsy10= gy10; - default_gsx11 = gx11; - default_gsy11= gy11; - } void LabGridArea::reset(bool toInitial) { if (toInitial) { - setParams(defaultLow_a, defaultLow_b, defaultHigh_a, defaultHigh_b, defaultgre_x, defaultgre_y, defaultwhi_x, defaultwhi_y, defaultme_x, defaultme_y, - default_gsx6, default_gsy6, default_gsx7, default_gsy7, default_gsx8, default_gsy8, default_gsx9, default_gsy9, default_gsx10, default_gsy10, default_gsx11, default_gsy11, true);//+4 12 11 + setParams(defaultLow_a, defaultLow_b, defaultHigh_a, defaultHigh_b, defaultgre_x, defaultgre_y, defaultwhi_x, defaultwhi_y, defaultme_x, defaultme_y, true); } else { // printf("RESET \n"); - setParams(0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., true);//+4 12 11 + setParams(0., 0., 0., 0., 0., 0., 0., 0., 0., 0., true); } } @@ -270,7 +224,7 @@ bool LabGridArea::on_draw(const ::Cairo::RefPtr &cr) cr->translate(0., static_cast(height)); cr->scale(1., -1.); - if (! ciexy_enabled && !ghs_enabled) {//draw cells for general Labgrid + if (! ciexy_enabled) {//draw cells for Labgrid const int cells = 8; const float step = 12000.f / static_cast(cells/2); const double cellW = static_cast(width) / static_cast(cells); @@ -303,7 +257,7 @@ bool LabGridArea::on_draw(const ::Cairo::RefPtr &cr) cellYMin = cellYMax; cellYMax = std::floor(cellH * static_cast(j+2) + 0.01); } - } else if (ciexy_enabled) {//cells for CIE xy in SE and Abstract profile + } else {//cells for CIE xy const int cells = 600; const float step = 1.f / static_cast(cells); const double cellW = static_cast(width) / static_cast(cells); @@ -372,134 +326,36 @@ bool LabGridArea::on_draw(const ::Cairo::RefPtr &cr) cellYMin = cellYMax; cellYMax = std::floor(cellH * static_cast(j+2) + 0.001); } - } else if (ghs_enabled) {//cells for GHS and simulation GHS - const int cells = 600; - const double cellW = static_cast(width) / static_cast(cells); - const double cellH = static_cast(height) / static_cast(cells); - double cellYMin = 0.; - double cellYMax = std::floor(cellH); - - for (int j = 0; j < cells; j++) { - double cellXMin = 0.; - double cellXMax = std::floor(cellW); - for (int i = 0; i < cells; i++) { - float R, G, B; - R = 0.7f; G = 0.7f; B = 0.7f; - cr->set_source_rgb(R , G , B); - cr->rectangle( - cellXMin, - cellYMin, - cellXMax - cellXMin, - cellYMax - cellYMin); - cellXMin = cellXMax; - cellXMax = std::floor(cellW * static_cast(i+2) + 0.001); - cr->fill(); - } - cellYMin = cellYMax; - cellYMax = std::floor(cellH * static_cast(j+2) + 0.001); - } - } // Drawing the connection line cr->set_antialias(Cairo::ANTIALIAS_DEFAULT); // float loa, hia, lob, hib, grx, gry, whx, why, mex, mey; - double loa = .5 * (static_cast(width) + static_cast(width) * low_a); - double hia = .5 * (static_cast(width) + static_cast(width) * high_a); - double lob = .5 * (static_cast(height) + static_cast(height) * low_b); - double hib = .5 * (static_cast(height) + static_cast(height) * high_b); - double grx = .5 * (static_cast(width) + static_cast(width) * gre_x); - double gry = .5 * (static_cast(height) + static_cast(height) * gre_y); - double whx = .5 * (static_cast(width) + static_cast(width) * whi_x); - double why = .5 * (static_cast(height) + static_cast(height) * whi_y); + const double loa = .5 * (static_cast(width) + static_cast(width) * low_a); + const double hia = .5 * (static_cast(width) + static_cast(width) * high_a); + const double lob = .5 * (static_cast(height) + static_cast(height) * low_b); + const double hib = .5 * (static_cast(height) + static_cast(height) * high_b); + const double grx = .5 * (static_cast(width) + static_cast(width) * gre_x); + const double gry = .5 * (static_cast(height) + static_cast(height) * gre_y); + const double whx = .5 * (static_cast(width) + static_cast(width) * whi_x); + const double why = .5 * (static_cast(height) + static_cast(height) * whi_y); double mex = .5 * (static_cast(width) + static_cast(width) * me_x); double mey = .5 * (static_cast(height) + static_cast(height) * me_y); cr->set_line_width(1.5); - if (ciexy_enabled) { mex = .5 * (width + width * me_x); mey = .5 * (height + height * me_y); - } cr->set_source_rgb(0.6, 0.6, 0.6); - if (!ghs_enabled) { - cr->move_to(loa, lob); - cr->line_to(hia, hib); - } + cr->move_to(loa, lob); + cr->line_to(hia, hib); if (ciexy_enabled) { cr->move_to(loa, lob); cr->line_to(grx, gry); cr->move_to(grx, gry); cr->line_to(hia, hib); - } else if (ghs_enabled) { - cr->set_line_width(3.); - cr->set_source_rgb(0.2, 0.2, 0.2); - - loa = (static_cast(width) * low_a); - hia = (static_cast(width) * high_a); - lob = (static_cast(height) * low_b); - hib = (static_cast(height) * high_b); - grx = (static_cast(width) * gre_x); - gry = (static_cast(height) * gre_y); - whx = (static_cast(width) * whi_x); - why = (static_cast(height) * whi_y); - mex = (static_cast(width) * me_x); - mey = (static_cast(height) * me_y); - double gx6 = (static_cast(width) * ghs_x6); - double gy6 = (static_cast(height) * ghs_y6); - double gx7 = (static_cast(width) * ghs_x7); - double gy7 = (static_cast(height) * ghs_y7); - double gx8 = (static_cast(width) * ghs_x8); - double gy8 = (static_cast(height) * ghs_y8); - double gx9 = (static_cast(width) * ghs_x9); - double gy9 = (static_cast(height) * ghs_y9); - double gx10 = (static_cast(width) * ghs_x10); - double gy10 = (static_cast(height) * ghs_y10); - double gx11 = (static_cast(width) * ghs_x11); - double gy11 = (static_cast(height) * ghs_y11); - - double onex = (static_cast(width) * 1.); - double oney = (static_cast(height) * 1.); - cr->move_to(0., 0.); - cr->line_to(loa, lob); - cr->move_to(loa, lob); - cr->line_to(hia, hib); - cr->move_to(hia, hib); - cr->line_to(grx, gry); - cr->move_to(grx, gry); - cr->line_to(whx, why); - cr->move_to(whx, why); - cr->line_to(mex, mey); - cr->move_to(mex, mey); - cr->line_to(gx6, gy6); - cr->move_to(gx6, gy6); - cr->line_to(gx7, gy7); - cr->move_to(gx7, gy7); - cr->line_to(gx8, gy8); - cr->move_to(gx8, gy8); - cr->line_to(gx9, gy9); - cr->move_to(gx9, gy9); - cr->line_to(gx10, gy10); - cr->move_to(gx10, gy10); - cr->line_to(gx11, gy11); - cr->move_to(gx11, gy11); - cr->line_to(onex, oney); } cr->stroke(); - if(ghs_enabled) {//only 10 * 10 squares - cr->set_line_width(0.2); - cr->set_source_rgb(0.1, 0.1, 0.1); - //draw horiz and vertical lines - for(int i = 0; i < 10; i++) { - cr->move_to(0.1 * static_cast(i * width), 0.); - cr->line_to(0.1 * static_cast(i * width), static_cast(height)); - } - for(int i = 0; i < 10; i++) { - cr->move_to(0., 0.1 * static_cast(i * height)); - cr->line_to(static_cast(width), 0.1 * static_cast(i * height)); - } - cr->stroke(); - - } else if (ciexy_enabled) {//for CIExy + if (ciexy_enabled) { cr->set_line_width(0.2); cr->set_source_rgb(0.1, 0.1, 0.1); //draw horiz and vertical lines @@ -541,33 +397,33 @@ bool LabGridArea::on_draw(const ::Cairo::RefPtr &cr) cr->stroke(); } - if(!ghs_enabled) {//no points with GHS + // Drawing points - if (low_enabled) { - cr->set_source_rgb(0.1, 0.1, 0.1);//black for red in Ciexy - if (litPoint == LOW) { - cr->arc(loa, lob, 5., 0., 2. * rtengine::RT_PI); - } else { - cr->arc(loa, lob, 3., 0., 2. * rtengine::RT_PI); - } - cr->fill(); + if (low_enabled) { + cr->set_source_rgb(0.1, 0.1, 0.1);//black for red in Ciexy + if (litPoint == LOW) { + cr->arc(loa, lob, 5., 0., 2. * rtengine::RT_PI); + } else { + cr->arc(loa, lob, 3., 0., 2. * rtengine::RT_PI); } + cr->fill(); + } - if (ciexy_enabled) { - cr->set_source_rgb(0.5, 0.5, 0.5);//gray for green - if (litPoint == GRE) { - cr->arc(grx, gry, 5., 0., 2. * rtengine::RT_PI); - } else { - cr->arc(grx, gry, 3., 0., 2. * rtengine::RT_PI); - } - cr->fill(); + if (ciexy_enabled) { + cr->set_source_rgb(0.5, 0.5, 0.5);//gray for green + if (litPoint == GRE) { + cr->arc(grx, gry, 5., 0., 2. * rtengine::RT_PI); + } else { + cr->arc(grx, gry, 3., 0., 2. * rtengine::RT_PI); } + cr->fill(); + } - if (ciexy_enabled) {//White Point - cr->set_source_rgb(1., 1., 1.);//White - cr->arc(whx, why, 3., 0., 2. * rtengine::RT_PI); - cr->fill(); - } + if (ciexy_enabled) {//White Point + cr->set_source_rgb(1., 1., 1.);//White + cr->arc(whx, why, 3., 0., 2. * rtengine::RT_PI); + cr->fill(); + } if (ciexy_enabled) {//Dominant cr->set_source_rgb(0.3, 0.4, 0.3); @@ -575,14 +431,13 @@ bool LabGridArea::on_draw(const ::Cairo::RefPtr &cr) cr->fill(); } - cr->set_source_rgb(0.9, 0.9, 0.9);//white for blue en Ciexy - if (litPoint == HIGH) { - cr->arc(hia, hib, 5., 0., 2. * rtengine::RT_PI); - } else { - cr->arc(hia, hib, 3., 0., 2. * rtengine::RT_PI); - } - cr->fill(); -} + cr->set_source_rgb(0.9, 0.9, 0.9);//white for blue en Ciexy + if (litPoint == HIGH) { + cr->arc(hia, hib, 5., 0., 2. * rtengine::RT_PI); + } else { + cr->arc(hia, hib, 3., 0., 2. * rtengine::RT_PI); + } + cr->fill(); return false; } @@ -591,7 +446,7 @@ bool LabGridArea::on_draw(const ::Cairo::RefPtr &cr) bool LabGridArea::on_button_press_event(GdkEventButton *event) { if (event->button == 1 && mous_enabled) { - if (!ciexy_enabled && !ghs_enabled) { + if (!ciexy_enabled) { if (event->type == GDK_2BUTTON_PRESS) { switch (litPoint) { case NONE: @@ -692,7 +547,7 @@ bool LabGridArea::on_motion_notify_event(GdkEventMotion *event) litPoint = LOW; } else if (disthi < thrs * thrs && disthi <= distlo) { litPoint = HIGH; - } else if (ciexy_enabled && !ghs_enabled && distgxy < thrs * thrs && distgxy <= distlo) { + } else if (ciexy_enabled && distgxy < thrs * thrs && distgxy <= distlo) { litPoint = GRE; } if ((oldLitPoint == NONE && litPoint != NONE) || (oldLitPoint != NONE && litPoint == NONE)) { @@ -740,11 +595,6 @@ bool LabGridArea::ciexyEnabled() const return ciexy_enabled; } -bool LabGridArea::ghsEnabled() const -{ - return ghs_enabled; -} - void LabGridArea::setLowEnabled(bool yes) { if (low_enabled != yes) { @@ -761,14 +611,6 @@ void LabGridArea::setciexyEnabled(bool yes) } } -void LabGridArea::setghsEnabled(bool yes) -{ - if (ghs_enabled != yes) { - ghs_enabled = yes; - queue_draw(); - } -} - void LabGridArea::setmousEnabled(bool yes) { if (mous_enabled != yes) { @@ -782,12 +624,12 @@ void LabGridArea::setmousEnabled(bool yes) // LabGrid //----------------------------------------------------------------------------- -LabGrid::LabGrid(rtengine::ProcEvent evt, const Glib::ustring &msg, bool enable_low, bool ciexy, bool ghs, bool mous): - grid(evt, msg, enable_low, ciexy, ghs, mous) +LabGrid::LabGrid(rtengine::ProcEvent evt, const Glib::ustring &msg, bool enable_low, bool ciexy, bool mous): + grid(evt, msg, enable_low, ciexy, mous) { Gtk::Button *reset = Gtk::manage(new Gtk::Button()); reset->set_tooltip_markup(M("ADJUSTER_RESET_TO_DEFAULT")); - if(!ciexy || !ghs) {//disabled for Cie xy and GHS + if(!ciexy) {//disabled for Cie xy reset->add(*Gtk::manage(new RTImage("undo-small", Gtk::ICON_SIZE_BUTTON))); } reset->signal_button_release_event().connect(sigc::mem_fun(*this, &LabGrid::resetPressed)); @@ -799,9 +641,7 @@ LabGrid::LabGrid(rtengine::ProcEvent evt, const Glib::ustring &msg, bool enable_ reset->set_size_request(-1, 20); pack_start(grid, true, true, true); - if(!ghs) {//disable reset when GHS - pack_start(*reset, false, false); - } + pack_start(*reset, false, false); show_all_children(); } diff --git a/rtgui/labgrid.h b/rtgui/labgrid.h index 938ee3c78..9756af626 100644 --- a/rtgui/labgrid.h +++ b/rtgui/labgrid.h @@ -60,18 +60,6 @@ private: double whi_y; double me_x; double me_y; - double ghs_x6; - double ghs_y6; - double ghs_x7; - double ghs_y7; - double ghs_x8; - double ghs_y8; - double ghs_x9; - double ghs_y9; - double ghs_x10; - double ghs_y10; - double ghs_x11; - double ghs_y11;//+4 12 11 double defaultLow_a; double defaultHigh_a; double defaultLow_b; @@ -82,18 +70,6 @@ private: double defaultwhi_y; double defaultme_x; double defaultme_y; - double default_gsx6;//added for GHS - double default_gsy6; - double default_gsx7; - double default_gsy7; - double default_gsx8; - double default_gsy8; - double default_gsx9; - double default_gsy9; - double default_gsx10;//+4 12 11 - double default_gsy10; - double default_gsx11; - double default_gsy11; ToolPanelListener *listener; bool edited; @@ -103,19 +79,17 @@ private: bool low_enabled; bool ciexy_enabled; - bool ghs_enabled; bool mous_enabled; bool notifyListener(); void getLitPoint(); public: - LabGridArea(rtengine::ProcEvent evt, const Glib::ustring &msg, bool enable_low=true, bool ciexy=false, bool ghs=false, bool mous=false); + LabGridArea(rtengine::ProcEvent evt, const Glib::ustring &msg, bool enable_low=true, bool ciexy=false, bool mous=false); - void getParams(double &la, double &lb, double &ha, double &hb, double &gx, double &gy, double &wx, double &wy, double &mx, double &my, - double &gx6, double &gy6, double &gx7, double &gy7, double &gx8, double &gy8, double &gx9, double &gy9, double &gx10, double &gy10, double &gx11, double &gy11) const;//+4 12 11 - void setParams(double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my, double gx6, double gy6, double gx7, double gy7, double gx8, double gy8, double gx9, double gy9, double gx10, double gy10, double gx11, double gy11, bool notify);//+4 12 11 - void setDefault (double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my, double gx6, double gy6, double gx7, double gy7, double gx8, double gy8, double gx9, double gy9, double gx10, double gy10, double gx11, double gy11);//+4 12 11 + void getParams(double &la, double &lb, double &ha, double &hb, double &gx, double &gy, double &wx, double &wy, double &mx, double &my) const; + void setParams(double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my, bool notify); + void setDefault (double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my); void setEdited(bool yes); bool getEdited() const; void reset(bool toInitial); @@ -125,8 +99,6 @@ public: void setLowEnabled(bool yes); bool ciexyEnabled() const; void setciexyEnabled(bool yes); - bool ghsEnabled() const; - void setghsEnabled(bool yes); bool mousEnabled() const; void setmousEnabled(bool yes); @@ -148,14 +120,11 @@ private: bool resetPressed(GdkEventButton *event); public: - LabGrid(rtengine::ProcEvent evt, const Glib::ustring &msg, bool enable_low=true, bool ciexy=false, bool ghs=false, bool mous=true); + LabGrid(rtengine::ProcEvent evt, const Glib::ustring &msg, bool enable_low=true, bool ciexy=false, bool mous=true); - void getParams(double &la, double &lb, double &ha, double &hb, double &gx, double &gy, double &wx, double &wy, double &mx, double &my, double &gx6, double &gy6, double &gx7, double &gy7, double &gx8, double &gy8, double &gx9, double &gy9, double &gx10, double &gy10, double &gx11, double &gy11) - const { return grid.getParams(la, lb, ha, hb, gx, gy, wx, wy, mx, my, gx6, gy6, gx7, gy7, gx8, gy8, gx9, gy9, gx10, gy10, gx11, gy11); }//+4 12 11 - void setParams(double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my, double gx6, double gy6, double gx7, double gy7, double gx8, double gy8, double gx9, double gy9, double gx10, double gy10, double gx11, double gy11, bool notify) - { grid.setParams(la, lb, ha, hb, gx, gy, wx, wy, mx, my, gx6, gy6, gx7, gy7, gx8, gy8, gx9, gy9, gx10, gy10, gx11, gy11, notify); }//+4 12 11 - void setDefault (double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my, double gx6, double gy6, double gx7, double gy7, double gx8, double gy8, double gx9, double gy9, double gx10, double gy10, double gx11, double gy11) - { grid.setDefault(la, lb, ha, hb, gx, gy, wx, wy, mx, my, gx6, gy6, gx7, gy7, gx8, gy8, gx9, gy9, gx10, gy10, gx11, gy11); }//+4 12 11 + void getParams(double &la, double &lb, double &ha, double &hb, double &gx, double &gy, double &wx, double &wy, double &mx, double &my) const { return grid.getParams(la, lb, ha, hb, gx, gy, wx, wy, mx, my); } + void setParams(double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my, bool notify) { grid.setParams(la, lb, ha, hb, gx, gy, wx, wy, mx, my, notify); } + void setDefault (double la, double lb, double ha, double hb, double gx, double gy, double wx, double wy, double mx, double my) { grid.setDefault(la, lb, ha, hb, gx, gy, wx, wy, mx, my); } void setEdited(bool yes) { grid.setEdited(yes); } bool getEdited() const { return grid.getEdited(); } void reset(bool toInitial) { grid.reset(toInitial); } @@ -164,8 +133,6 @@ public: void setLowEnabled(bool yes) { grid.setLowEnabled(yes); } bool ciexyEnabled() const { return grid.ciexyEnabled(); } void setciexyEnabled(bool yes) { grid.setciexyEnabled(yes); } - bool ghsEnabled() const { return grid.ghsEnabled(); } - void setghsEnabled(bool yes) { grid.setghsEnabled(yes); } bool mousEnabled() const { return grid.mousEnabled(); } void setmousEnabled(bool yes) { grid.setmousEnabled(yes); } diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index e2293577f..13b68ba6d 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -1379,45 +1379,10 @@ void Locallab::maiChanged(const std::vector &setlc, int selspot) } } -//Draw Simulation for GHS - with 9 points -void Locallab::ghsChanged(const std::vector &shghs, int selspot) -{ - sh_ghs = shghs; - double gx[22];//not the 2 last values 1 1 - if (selspot < (int) sh_ghs.size()) { - for(int i=0; i < 22; i++) { - gx[i] = sh_ghs.at(selspot).ghsc[i]; - // printf("i=%i gx=%f\n", i, (double) gx[i]); - } - expshadhigh.updateghs(gx); - } -} - -void Locallab::ghsbwChanged(const std::vector &shghsbw, int selspot) -{ - sh_ghsbw = shghsbw; - int bw[2]; - bw[0] = 0; - bw[1] = 1; - double bwvalue[2]; - bwvalue[0] = 0.; - bwvalue[1] = 1.; - - if (selspot < (int) sh_ghsbw.size()) { - for(int i=0; i < 2; i++) { - bw[i] = sh_ghsbw.at(selspot).ghsbw[i]; - bwvalue[i] = sh_ghsbw.at(selspot).ghsbwvalue[i]; - } - - expshadhigh.updateghsbw(bw[0], bw[1], bwvalue[0], bwvalue[1]); - } - -} void Locallab::cieChanged(const std::vector &cielc, int selspot) { // Saving transmitted min/max data cie_lc = cielc; - //Update Locallab Denoise tool lum chro if (selspot < (int) cie_lc.size()) { diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 787ebda13..0add444ac 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -134,10 +134,6 @@ private: std::vector cie_lc; - std::vector sh_ghs; - - std::vector sh_ghsbw; - std::vector set_lc; std::vector cie_sig; @@ -180,12 +176,6 @@ public: // Locallab CIE tool primaries function void cieChanged(const std::vector &cielc, int selspot) override; - // Locallab SH GHS tool Curve S GHS function - void ghsChanged(const std::vector &shghs, int selspot) override; - - // Locallab SH GHS tool Black point & White point GHS function - void ghsbwChanged(const std::vector &shghsbw, int selspot) override; - // Locallab Log Encoding and Cam16 autocompute function void ciebefChanged(const std::vector &ciebef, int selspot) override; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 680137bd2..c7ae99269 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -1285,7 +1285,7 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param spot.labgridBLow / LocallabParams::LABGRIDL_CORR_MAX, spot.labgridAHigh / LocallabParams::LABGRIDL_CORR_MAX, spot.labgridBHigh / LocallabParams::LABGRIDL_CORR_MAX, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , false);//+4 - 12-11 + 0, 0, 0, 0, 0, 0, false); // printf("labgridlow=%f \n", spot.labgridALow); if (spot.gridMethod == "one") { gridMethod->set_active(0); @@ -1399,7 +1399,7 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param labgridmerg->setParams(0, 0, spot.labgridAHighmerg / LocallabParams::LABGRIDL_CORR_MAX, spot.labgridBHighmerg / LocallabParams::LABGRIDL_CORR_MAX, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false);//+4 12 11 + 0, 0, 0, 0, 0, 0, false); merlucol->setValue(spot.merlucol); enaColorMask->set_active(spot.enaColorMask); CCmaskshape->setCurve(spot.CCmaskcurve); @@ -1463,7 +1463,7 @@ void LocallabColor::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pe labgrid->getParams(spot.labgridALow, spot.labgridBLow, spot.labgridAHigh, - spot.labgridBHigh, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy);//+4 12 11 + spot.labgridBHigh, zerox, zeroy, zerox, zeroy, zerox, zeroy); spot.labgridALow *= LocallabParams::LABGRIDL_CORR_MAX; spot.labgridAHigh *= LocallabParams::LABGRIDL_CORR_MAX; spot.labgridBLow *= LocallabParams::LABGRIDL_CORR_MAX; @@ -1583,7 +1583,7 @@ void LocallabColor::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pe labgridmerg->getParams(spot.labgridALowmerg, spot.labgridBLowmerg, spot.labgridAHighmerg, - spot.labgridBHighmerg, zerox1, zeroy1, zerox1, zeroy1, zerox1, zeroy1, zerox1, zeroy1, zerox1, zeroy1, zerox1, zeroy1, zerox1, zeroy1, zerox1, zeroy1, zerox1, zeroy1);//+4 12 11 + spot.labgridBHighmerg, zerox1, zeroy1, zerox1, zeroy1, zerox1, zeroy1); spot.labgridALowmerg *= LocallabParams::LABGRIDL_CORR_MAX; spot.labgridAHighmerg *= LocallabParams::LABGRIDL_CORR_MAX; spot.labgridBLowmerg *= LocallabParams::LABGRIDL_CORR_MAX; @@ -1630,7 +1630,7 @@ void LocallabColor::setDefaults(const rtengine::procparams::ProcParams* defParam labgrid->setDefault(defSpot.labgridALow / LocallabParams::LABGRIDL_CORR_MAX, defSpot.labgridBLow / LocallabParams::LABGRIDL_CORR_MAX, defSpot.labgridAHigh / LocallabParams::LABGRIDL_CORR_MAX, - defSpot.labgridBHigh / LocallabParams::LABGRIDL_CORR_MAX, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);//+4 12 11 + defSpot.labgridBHigh / LocallabParams::LABGRIDL_CORR_MAX, 0, 0, 0, 0, 0, 0); strengthgrid->setDefault((double) defSpot.strengthgrid); sensi->setDefault((double)defSpot.sensi); structcol->setDefault((double)defSpot.structcol); @@ -1647,7 +1647,7 @@ void LocallabColor::setDefaults(const rtengine::procparams::ProcParams* defParam labgridmerg->setDefault(defSpot.labgridALowmerg / LocallabParams::LABGRIDL_CORR_MAX, defSpot.labgridBLowmerg / LocallabParams::LABGRIDL_CORR_MAX, defSpot.labgridAHighmerg / LocallabParams::LABGRIDL_CORR_MAX, - defSpot.labgridBHighmerg / LocallabParams::LABGRIDL_CORR_MAX, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);//+4 12 11 + defSpot.labgridBHighmerg / LocallabParams::LABGRIDL_CORR_MAX, 0, 0, 0, 0, 0, 0); merlucol->setDefault(defSpot.merlucol); strumaskcol->setDefault(defSpot.strumaskcol); contcol->setDefault(defSpot.contcol); @@ -2132,7 +2132,7 @@ void LocallabColor::convertParamToNormal() labgridmerg->setParams(0, 0, defSpot.labgridAHighmerg / LocallabParams::LABGRIDL_CORR_MAX, defSpot.labgridBHighmerg / LocallabParams::LABGRIDL_CORR_MAX, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false);//+4 12 11 + 0, 0, 0, 0, 0, 0, false); merlucol->setValue(defSpot.merlucol); strumaskcol->setValue(defSpot.strumaskcol); toolcol->set_active(defSpot.toolcol); @@ -4288,27 +4288,6 @@ LocallabShadow::LocallabShadow(): gamFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GAMFRA")))), gamSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMSH"), 0.25, 15.0, 0.01, 2.4))), sloSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOSH"), 0.0, 500.0, 0.01, 12.92))), - ghsMethod(Gtk::manage(new MyComboBoxText())), - gridFrameghs(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GHS_GHSDIAG")))),// - labgridghs(Gtk::manage(new LabGrid(EvlocallabGridciexy, M("TP_LOCALLAB_GHS_GHSDIAG"), true, false, true, false))), - ghsFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GHSFRA")))), - ghs_D(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GHS_D"), 0., 20.0, 0.001, 0.0))), - Lab_Frame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GHSLABFRA")))), - ghs_slope(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GHS_SLOPE"), 1.0, 100.0, 0.01, 9.03296))), - ghs_chro(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GHS_CHRO"), -30., 100.0, 0.001, 0.))), - ghs_B(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GHS_B"), -5.0, 15.0, 0.001, 0.0))), - ghs_SP(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GHS_SP"), 0.0, 1.0, 0.00001, 0.015))), - ghs_LP(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GHS_LP"), 0.0, 1.0, 0.00001, 0.0))), - ghs_HP(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GHS_HP"), 0.0, 1.0, 0.00001, 1.0))), - LC_Frame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GHS_LC_FRAME")))), - ghs_LC(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GHS_LC"), 0.0, 100.0, 0.1, 30.0))), - BP_Frame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GHS_BLACKPOINT_FRAME")))), - ghs_BLP(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GHS_BLP"), -0.2, 1.0, 0.0001, 0.0))), - ghs_HLP(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GHS_HLP"), 0.2002, 3.0, 0.0001, 1.0001))), - ghsbpwpLabels(Gtk::manage(new Gtk::Label("---"))), - ghsbpwpvalueLabels(Gtk::manage(new Gtk::Label("---"))), - ghs_smooth(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_GHS_SMOOTH")))), - ghs_inv(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_GHS_INV")))), expgradsh(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_EXPGRAD")))), strSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTR"), -4., 4., 0.05, 0.))), angSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADANG"), -180, 180, 0.1, 0.))), @@ -4339,20 +4318,7 @@ LocallabShadow::LocallabShadow(): auto m = ProcEventMapper::getInstance(); Evlocallabpreviewsh = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_PREVIEWSH"); EvlocallabfeatherSH = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_FEATHERSH"); - EvlocallabghsMethod = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GHSMETHOD"); - Evlocallabghs_D = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GHS_D"); - Evlocallabghs_slope = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GHS_SLOPE"); - Evlocallabghs_chro = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GHS_CHRO"); - Evlocallabghs_B = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GHS_B"); - Evlocallabghs_SP = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GHS_SP"); - Evlocallabghs_LP = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GHS_LP"); - Evlocallabghs_HP = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GHS_HP"); - Evlocallabghs_LC = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GHS_LC"); - Evlocallabghs_BLP = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GHS_BLP"); - Evlocallabghs_HLP = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GHS_HLP"); - Evlocallabghs_smooth = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GHS_SMOOTH"); - Evlocallabghs_inv = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GHS_INV"); - EvlocallabGridghs = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_LABGRIDGHS"); + set_orientation(Gtk::ORIENTATION_VERTICAL); const LocallabParams::LocallabSpot defSpot; @@ -4360,30 +4326,9 @@ LocallabShadow::LocallabShadow(): // Parameter Shadow highlight specific widgets shMethod->append(M("TP_LOCALLAB_SH1")); shMethod->append(M("TP_LOCALLAB_SH2")); - shMethod->append(M("TP_LOCALLAB_SH3")); - shMethod->set_active(3); + shMethod->set_active(0); shMethodConn = shMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabShadow::shMethodChanged)); -/* - * This file is part of Siril, an astronomy image processor. - * Copyright (C) 2005-2011 Francois Meyer (dulle at free.fr) - * Copyright (C) 2012-2023 team free-astro (see more in AUTHORS file) - * Reference site is https://free-astro.org/index.php/Siril -*/ -/* -//Copyright algorithm Pixlnsight David Payne 2021 -https://www.ghsastro.co.uk/doc/tools/GeneralizedHyperbolicStretch/GeneralizedHyperbolicStretch.html#__Description_:_About_GHS__ -*/ - ghsMethod->append(M("TP_LOCALLAB_GHSRGBLUM")); - ghsMethod->append(M("TP_LOCALLAB_GHSRGBSTD")); - ghsMethod->append(M("TP_LOCALLAB_GHSLAB")); - ghsMethod->append(M("TP_LOCALLAB_GHSLUM")); - ghsMethod->append(M("TP_LOCALLAB_GHSSAT")); - ghsMethod->append(M("TP_LOCALLAB_GHSHUE")); - ghsMethod->set_active(0); - ghsMethodConn = ghsMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabShadow::ghsMethodChanged)); - ghsMethod->set_tooltip_text(M("TP_LOCALLAB_GHS_METHOD_TOOLTIP")); - for (const auto multiplier : multipliersh) { multiplier->setAdjusterListener(this); } @@ -4418,29 +4363,6 @@ https://www.ghsastro.co.uk/doc/tools/GeneralizedHyperbolicStretch/GeneralizedHyp sloSH->setAdjusterListener(this); - ghs_D->setAdjusterListener(this); - ghs_slope->setAdjusterListener(this); - ghs_chro->setAdjusterListener(this); - ghs_B->setAdjusterListener(this); - ghs_SP->setAdjusterListener(this); - ghs_LP->setAdjusterListener(this); - ghs_HP->setAdjusterListener(this); - ghs_LC->setAdjusterListener(this); - ghs_BLP->setAdjusterListener(this); - ghs_HLP->setAdjusterListener(this); - setExpandAlignProperties(ghsbpwpLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); - setExpandAlignProperties(ghsbpwpvalueLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START); - ghs_D->setLogScale(10, 0); - //ghs_B->setLogScale(10, -5); - ghs_slope->setLogScale(10, 1); - ghs_chro->setLogScale(10, -30); - - ghs_SP->setLogScale(10, 0); - ghs_BLP->setLogScale(10, -0.2); - ghs_smoothConn = ghs_smooth->signal_toggled().connect(sigc::mem_fun(*this, &LocallabShadow::ghs_smoothChanged)); - ghs_invConn = ghs_inv->signal_toggled().connect(sigc::mem_fun(*this, &LocallabShadow::ghs_invChanged)); - - setExpandAlignProperties(expgradsh, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); strSH->setAdjusterListener(this); @@ -4518,10 +4440,6 @@ https://www.ghsastro.co.uk/doc/tools/GeneralizedHyperbolicStretch/GeneralizedHyp fatamountSH->setAdjusterListener(this); fatanchorSH->setAdjusterListener(this); - gridFrameghs->set_label_align(0.025, 0.5); - ToolParamBlock* const gridBox = Gtk::manage(new ToolParamBlock()); - gridBox->pack_start(*labgridghs); - gridFrameghs->add(*gridBox); // Add Shadow highlight specific widgets to GUI pack_start(*reparsh); @@ -4530,39 +4448,6 @@ https://www.ghsastro.co.uk/doc/tools/GeneralizedHyperbolicStretch/GeneralizedHyp pack_start(*inverssh); pack_start(*shMethod); - pack_start(*ghsMethod); - ghsFrame->set_label_align(0.025, 0.5); - ToolParamBlock* const ghsBox = Gtk::manage(new ToolParamBlock()); - ghsBox->pack_start(*ghs_D); - Lab_Frame->set_label_align(0.025, 0.5); - ToolParamBlock* const LabBox = Gtk::manage(new ToolParamBlock()); - LabBox->pack_start(*ghs_slope); - LabBox->pack_start(*ghs_chro); - Lab_Frame->add(*LabBox); - ghsBox->pack_start(*Lab_Frame); - ghsBox->pack_start(*ghs_B); - ghsBox->pack_start(*ghs_SP); - ghsBox->pack_start(*ghs_LP); - ghsBox->pack_start(*ghs_HP); - LC_Frame->set_label_align(0.025, 0.5); - ToolParamBlock* const LCBox = Gtk::manage(new ToolParamBlock()); - LCBox->pack_start(*ghs_LC); - LC_Frame->add(*LCBox); - ghsBox->pack_start(*LC_Frame); - BP_Frame->set_label_align(0.025, 0.5); - ToolParamBlock* const BPBox = Gtk::manage(new ToolParamBlock()); - BPBox->pack_start(*ghs_BLP); - BPBox->pack_start(*ghs_HLP); - BPBox->pack_start(*ghsbpwpLabels); - BPBox->pack_start(*ghsbpwpvalueLabels); - BPBox->pack_start(*ghs_smooth); - BP_Frame->add(*BPBox); - ghsBox->pack_start(*BP_Frame); - ghsBox->pack_start(*ghs_inv); - ghsFrame->add(*ghsBox); - ghsBox->pack_start(*gridFrameghs); - pack_start(*ghsFrame); - for (const auto multiplier : multipliersh) { pack_start(*multiplier); @@ -4593,13 +4478,13 @@ https://www.ghsastro.co.uk/doc/tools/GeneralizedHyperbolicStretch/GeneralizedHyp gammBox->pack_start(*sloSH); gamFrame->add(*gammBox); pack_start(*gamFrame); - ToolParamBlock* const gradSHBox = Gtk::manage(new ToolParamBlock()); gradSHBox->pack_start(*strSH); gradSHBox->pack_start(*angSH); gradSHBox->pack_start(*featherSH); expgradsh->add(*gradSHBox, false); - pack_start(*expgradsh, false, false); + pack_start(*expgradsh); +// pack_start(*inverssh); ToolParamBlock* const maskSHBox = Gtk::manage(new ToolParamBlock()); maskSHBox->pack_start(*showmaskSHMethod, Gtk::PACK_SHRINK, 4); maskSHBox->pack_start(*showmaskSHMethodinv, Gtk::PACK_SHRINK, 4); @@ -4702,11 +4587,8 @@ void LocallabShadow::updateguishad(int spottype) } else { previewsh->hide(); } - if (shMethod->get_active_row_number() == 2) { - inverssh->hide(); - inverssh->set_active(false); - } updateGUIToMode(static_cast(complexity->get_active_row_number())); + } enableListener(); @@ -4786,21 +4668,7 @@ void LocallabShadow::updateAdviceTooltips(const bool showTooltips) decays->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); lowthress->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESS_TOOLTIP")); higthress->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESS_TOOLTIP")); - ghs_D->set_tooltip_text(M("TP_LOCALLAB_GHS_D_TOOLTIP")); - ghs_slope->set_tooltip_text(M("TP_LOCALLAB_GHS_SLOPE_TOOLTIP")); - ghs_chro->set_tooltip_text(M("TP_LOCALLAB_GHS_CHRO_TOOLTIP")); - ghs_B->set_tooltip_text(M("TP_LOCALLAB_GHS_B_TOOLTIP")); - ghs_SP->set_tooltip_text(M("TP_LOCALLAB_GHS_SP_TOOLTIP")); - ghs_LP->set_tooltip_text(M("TP_LOCALLAB_GHS_LP_TOOLTIP")); - ghs_HP->set_tooltip_text(M("TP_LOCALLAB_GHS_HP_TOOLTIP")); - ghs_LC->set_tooltip_text(M("TP_LOCALLAB_GHS_LC_TOOLTIP")); - ghs_BLP->set_tooltip_text(M("TP_LOCALLAB_GHS_BLP_TOOLTIP")); - ghs_HLP->set_tooltip_text(M("TP_LOCALLAB_GHS_HLP_TOOLTIP")); - ghs_smooth->set_tooltip_text(M("TP_LOCALLAB_GHS_SMOOTH_TOOLTIP")); - ghs_inv->set_tooltip_text(M("TP_LOCALLAB_GHS_INV_TOOLTIP")); - BP_Frame->set_tooltip_text(M("TP_LOCALLAB_GHS_BPFRAME_TOOLTIP")); - ghsFrame->set_tooltip_text(M("TP_LOCALLAB_GHS_METHOD_TOOLTIP")); - gridFrameghs->set_tooltip_text(M("TP_LOCALLAB_GHS_SIMUL_TOOLTIP")); + } else { exp->set_tooltip_text(""); @@ -4835,21 +4703,6 @@ void LocallabShadow::updateAdviceTooltips(const bool showTooltips) decays->set_tooltip_text(""); lowthress->set_tooltip_text(""); higthress->set_tooltip_text(""); - ghs_D->set_tooltip_text(""); - ghs_slope->set_tooltip_text(""); - ghs_chro->set_tooltip_text(""); - ghs_B->set_tooltip_text(""); - ghs_SP->set_tooltip_text(""); - ghs_LP->set_tooltip_text(""); - ghs_HP->set_tooltip_text(""); - ghs_LC->set_tooltip_text(""); - ghs_BLP->set_tooltip_text(""); - ghs_HLP->set_tooltip_text(""); - ghs_smooth->set_tooltip_text(""); - ghs_inv->set_tooltip_text(""); - BP_Frame->set_tooltip_text(""); - ghsFrame->set_tooltip_text(""); - gridFrameghs->set_tooltip_text(""); } } @@ -4866,10 +4719,7 @@ void LocallabShadow::disableListener() LocallabTool::disableListener(); shMethodConn.block(true); - ghsMethodConn.block(true); inversshConn.block(true); - ghs_smoothConn.block(true); - ghs_invConn.block(true); showmaskSHMethodConn.block(true); showmaskSHMethodConninv.block(true); enaSHMaskConn.block(true); @@ -4880,9 +4730,6 @@ void LocallabShadow::enableListener() LocallabTool::enableListener(); shMethodConn.block(false); - ghsMethodConn.block(false); - ghs_smoothConn.block(false); - ghs_invConn.block(false); inversshConn.block(false); showmaskSHMethodConn.block(false); showmaskSHMethodConninv.block(false); @@ -4908,23 +4755,8 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para shMethod->set_active(0); } else if (spot.shMethod == "tone") { shMethod->set_active(1); - } else if (spot.shMethod == "ghs") { - shMethod->set_active(2); } - if (spot.ghsMethod == "rgb") { - ghsMethod->set_active(0); - } else if (spot.ghsMethod == "rgbstd") { - ghsMethod->set_active(1); - } else if (spot.ghsMethod == "llab") { - ghsMethod->set_active(2); - } else if (spot.ghsMethod == "lum") { - ghsMethod->set_active(3); - } else if (spot.ghsMethod == "sat") { - ghsMethod->set_active(4); - } else if (spot.ghsMethod == "hue") { - ghsMethod->set_active(5); - } for (int i = 0; i < 6; i++) { multipliersh[i]->setValue((double)spot.multsh[i]); } @@ -4933,17 +4765,6 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para higthress->setValue((double)spot.higthress); decays->setValue((double)spot.decays); - ghs_D->setValue((double)spot.ghs_D); - ghs_slope->setValue((double)spot.ghs_slope); - ghs_chro->setValue((double)spot.ghs_chro); - ghs_B->setValue((double)spot.ghs_B); - ghs_SP->setValue((double)spot.ghs_SP); - ghs_LP->setValue((double)spot.ghs_LP); - ghs_HP->setValue((double)spot.ghs_HP); - ghs_LC->setValue((double)spot.ghs_LC); - ghs_BLP->setValue((double)spot.ghs_BLP); - ghs_HLP->setValue((double)spot.ghs_HLP); - detailSH->setValue((double)spot.detailSH); tePivot->setValue(spot.tePivot); reparsh->setValue(spot.reparsh); @@ -4960,8 +4781,6 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para angSH->setValue(spot.angSH); featherSH->setValue(spot.featherSH); inverssh->set_active(spot.inverssh); - ghs_smooth->set_active(spot.ghs_smooth); - ghs_inv->set_active(spot.ghs_inv); enaSHMask->set_active(spot.enaSHMask); CCmaskSHshape->setCurve(spot.CCmaskSHcurve); LLmaskSHshape->setCurve(spot.LLmaskSHcurve); @@ -4975,33 +4794,8 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para LmaskSHshape->setCurve(spot.LmaskSHcurve); fatamountSH->setValue(spot.fatamountSH); fatanchorSH->setValue(spot.fatanchorSH); - - labgridghs->setParams(spot.ghsx1, - spot.ghsy1, - spot.ghsx2, - spot.ghsy2, - spot.ghsx3, - spot.ghsy3, - spot.ghsx4, - spot.ghsy4, - spot.ghsx5, - spot.ghsy5, - spot.ghsx6, - spot.ghsy6, - spot.ghsx7, - spot.ghsy7, - spot.ghsx8, - spot.ghsy8, - spot.ghsx9, - spot.ghsy9, - spot.ghsx10, - spot.ghsy10, - spot.ghsx11, - spot.ghsy11, //+4 gsh10 11 - false); - } - ghsMethodChanged(); + // Enable all listeners enableListener(); @@ -5011,9 +4805,8 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para // Update shadow highlight GUI according to inverssh button state updateShadowGUI1(); - // Update shadow highlight GUI according to shMethod and ghsmethod combobox state + // Update shadow highlight GUI according to shMethod combobox state updateShadowGUI2(); - updateShadowGUI3(); // Note: No need to manage pedited as batch mode is deactivated for Locallab } @@ -5033,39 +4826,12 @@ void LocallabShadow::write(rtengine::procparams::ProcParams* pp, ParamsEdited* p spot.shMethod = "std"; } else if (shMethod->get_active_row_number() == 1) { spot.shMethod = "tone"; - } else if (shMethod->get_active_row_number() == 2) { - spot.shMethod = "ghs"; - } - - if (ghsMethod->get_active_row_number() == 0) { - spot.ghsMethod = "rgb"; - } else if (ghsMethod->get_active_row_number() == 1) { - spot.ghsMethod = "rgbstd"; - } else if (ghsMethod->get_active_row_number() == 2) { - spot.ghsMethod = "llab"; - } else if (ghsMethod->get_active_row_number() == 3) { - spot.ghsMethod = "lum"; - } else if (ghsMethod->get_active_row_number() == 4) { - spot.ghsMethod = "sat"; - } else if (ghsMethod->get_active_row_number() == 5) { - spot.ghsMethod = "hue"; } for (int i = 0; i < 6; i++) { spot.multsh[i] = multipliersh[i]->getIntValue(); } - spot.ghs_D = ghs_D->getValue(); - spot.ghs_slope = ghs_slope->getValue(); - spot.ghs_chro = ghs_chro->getValue(); - spot.ghs_B = ghs_B->getValue(); - spot.ghs_SP = ghs_SP->getValue(); - spot.ghs_LP = ghs_LP->getValue(); - spot.ghs_HP = ghs_HP->getValue(); - spot.ghs_LC = ghs_LC->getValue(); - spot.ghs_BLP = ghs_BLP->getValue(); - spot.ghs_HLP = ghs_HLP->getValue(); - spot.detailSH = detailSH->getIntValue(); spot.tePivot = tePivot->getValue(); spot.reparsh = reparsh->getValue(); @@ -5082,8 +4848,6 @@ void LocallabShadow::write(rtengine::procparams::ProcParams* pp, ParamsEdited* p spot.angSH = angSH->getValue(); spot.featherSH = featherSH->getValue(); spot.inverssh = inverssh->get_active(); - spot.ghs_smooth = ghs_smooth->get_active(); - spot.ghs_inv = ghs_inv->get_active(); spot.enaSHMask = enaSHMask->get_active(); spot.LLmaskSHcurve = LLmaskSHshape->getCurve(); spot.CCmaskSHcurve = CCmaskSHshape->getCurve(); @@ -5101,31 +4865,6 @@ void LocallabShadow::write(rtengine::procparams::ProcParams* pp, ParamsEdited* p spot.lowthress = lowthress->getValue(); spot.higthress = higthress->getValue(); spot.decays = decays->getValue(); - labgridghs->getParams(spot.ghsx1, - spot.ghsy1, - spot.ghsx2, - spot.ghsy2, - spot.ghsx3, - spot.ghsy3, - spot.ghsx4, - spot.ghsy4, - spot.ghsx5, - spot.ghsy5, - spot.ghsx6, - spot.ghsy6, - spot.ghsx7, - spot.ghsy7, - spot.ghsx8, - spot.ghsy8, - spot.ghsx9, - spot.ghsy9, - spot.ghsx10, - spot.ghsy10, - spot.ghsx11,//+4 12 11 - spot.ghsy11 - ); - - } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -5143,17 +4882,6 @@ void LocallabShadow::setDefaults(const rtengine::procparams::ProcParams* defPara multipliersh[i]->setDefault(defSpot.multsh[i]); } - ghs_D->setDefault(defSpot.ghs_D); - ghs_slope->setDefault(defSpot.ghs_slope); - ghs_chro->setDefault(defSpot.ghs_chro); - ghs_B->setDefault(defSpot.ghs_B); - ghs_SP->setDefault(defSpot.ghs_SP); - ghs_LP->setDefault(defSpot.ghs_LP); - ghs_HP->setDefault(defSpot.ghs_HP); - ghs_LC->setDefault(defSpot.ghs_LC); - ghs_BLP->setDefault(defSpot.ghs_BLP); - ghs_HLP->setDefault(defSpot.ghs_HLP); - detailSH->setDefault((double)defSpot.detailSH); tePivot->setDefault(defSpot.tePivot); reparsh->setDefault(defSpot.reparsh); @@ -5181,32 +4909,6 @@ void LocallabShadow::setDefaults(const rtengine::procparams::ProcParams* defPara lowthress->setDefault((double)defSpot.lowthress); higthress->setDefault((double)defSpot.higthress); decays->setDefault((double)defSpot.decays); - - labgridghs->setDefault(defSpot.ghsx1, - defSpot.ghsy1, - defSpot.ghsx2, - defSpot.ghsy2, - defSpot.ghsx3, - defSpot.ghsy3, - defSpot.ghsx4, - defSpot.ghsy4, - defSpot.ghsx5, - defSpot.ghsy5, - defSpot.ghsx6, - defSpot.ghsy6, - defSpot.ghsx7, - defSpot.ghsy7, - defSpot.ghsx8, - defSpot.ghsy8, - defSpot.ghsx9, - defSpot.ghsy9, - defSpot.ghsx10, - defSpot.ghsy10, - defSpot.ghsx11, - defSpot.ghsy11 - - ); - } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -5214,8 +4916,6 @@ void LocallabShadow::setDefaults(const rtengine::procparams::ProcParams* defPara void LocallabShadow::adjusterChanged(Adjuster* a, double newval) { - updateShadowGUI3(); - if (isLocActivated && exp->getEnabled()) { if (a == multipliersh[0] || a == multipliersh[1] || a == multipliersh[2] || a == multipliersh[3] || a == multipliersh[4] || a == multipliersh[5]) { if (listener) { @@ -5230,76 +4930,6 @@ void LocallabShadow::adjusterChanged(Adjuster* a, double newval) } } - if (a == ghs_D) { - if (listener) { - listener->panelChanged(Evlocallabghs_D, - ghs_D->getTextValue() + " (" + escapeHtmlChars(getSpotName()) + ")"); - } - } - - if (a == ghs_slope) { - if (listener) { - listener->panelChanged(Evlocallabghs_slope, - ghs_slope->getTextValue() + " (" + escapeHtmlChars(getSpotName()) + ")"); - } - } - - if (a == ghs_chro) { - if (listener) { - listener->panelChanged(Evlocallabghs_chro, - ghs_chro->getTextValue() + " (" + escapeHtmlChars(getSpotName()) + ")"); - } - } - - if (a == ghs_B) { - if (listener) { - listener->panelChanged(Evlocallabghs_B, - ghs_B->getTextValue() + " (" + escapeHtmlChars(getSpotName()) + ")"); - } - } - - if (a == ghs_SP) { - if (listener) { - listener->panelChanged(Evlocallabghs_SP, - ghs_SP->getTextValue() + " (" + escapeHtmlChars(getSpotName()) + ")"); - } - } - - if (a == ghs_LP) { - if (listener) { - listener->panelChanged(Evlocallabghs_LP, - ghs_LP->getTextValue() + " (" + escapeHtmlChars(getSpotName()) + ")"); - } - } - - if (a == ghs_HP) { - if (listener) { - listener->panelChanged(Evlocallabghs_HP, - ghs_HP->getTextValue() + " (" + escapeHtmlChars(getSpotName()) + ")"); - } - } - - if (a == ghs_LC) { - if (listener) { - listener->panelChanged(Evlocallabghs_LC, - ghs_LC->getTextValue() + " (" + escapeHtmlChars(getSpotName()) + ")"); - } - } - - if (a == ghs_BLP) { - if (listener) { - listener->panelChanged(Evlocallabghs_BLP, - ghs_BLP->getTextValue() + " (" + escapeHtmlChars(getSpotName()) + ")"); - } - } - - if (a == ghs_HLP) { - if (listener) { - listener->panelChanged(Evlocallabghs_HLP, - ghs_HLP->getTextValue() + " (" + escapeHtmlChars(getSpotName()) + ")"); - } - } - if (a == detailSH) { if (listener) { listener->panelChanged(EvlocallabdetailSH, @@ -5494,42 +5124,6 @@ void LocallabShadow::adjusterChanged(Adjuster* a, double newval) } } - -void LocallabShadow::updateghs(double *gx) - -{ - disableListener(); - labgridghs->setParams(gx[0], gx[1], gx[2], gx[3], gx[4], gx[5], gx[6], gx[7], gx[8], gx[9], gx[10], gx[11], - gx[12], gx[13], gx[14], gx[15], gx[16], gx[17], gx[18], gx[19], gx[20], gx[21], false);//+4 12 11 - - enableListener(); -} - -void LocallabShadow::updateghsbw(int bp, int wp, double minbp, double maxwp) -{ - idle_register.add( - [this, bp, wp, minbp, maxwp]() -> bool { - GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected - - ghsbpwpLabels->set_text( - Glib::ustring::compose(M("TP_LOCALLAB_GHSBPWP"), - Glib::ustring::format(std::fixed, std::setprecision(0), bp), - Glib::ustring::format(std::fixed, std::setprecision(0), wp)) - ); - - ghsbpwpvalueLabels->set_text( - Glib::ustring::compose(M("TP_LOCALLAB_GHSBPWPVALUE"), - Glib::ustring::format(std::fixed, std::setprecision(2), minbp), - Glib::ustring::format(std::fixed, std::setprecision(2), maxwp)) - ); - - enableListener(); - return false; - } - ); - -} - void LocallabShadow::curveChanged(CurveEditor* ce) { if (isLocActivated && exp->getEnabled()) { @@ -5581,10 +5175,10 @@ void LocallabShadow::enabledChanged() void LocallabShadow::convertParamToNormal() { const LocallabParams::LocallabSpot defSpot; - // const int mode = complexity->get_active_row_number(); // Disable all listeners disableListener(); + // Set hidden GUI widgets in Normal mode to default spot values blurSHde->setValue((double)defSpot.blurSHde); lapmaskSH->setValue(defSpot.lapmaskSH); @@ -5593,8 +5187,6 @@ void LocallabShadow::convertParamToNormal() fatamountSH->setValue(defSpot.fatamountSH); fatanchorSH->setValue(defSpot.fatanchorSH); decays->setValue(defSpot.decays); - ghs_slope->setValue(defSpot.ghs_slope); - updateShadowGUI3(); // Enable all listeners enableListener(); @@ -5606,14 +5198,13 @@ void LocallabShadow::convertParamToSimple() // Disable all listeners disableListener(); - // Set hidden specific GUI widgets in Simple mode to default spot values - ghsMethod->set_active(0); + // Set hidden specific GUI widgets in Simple mode to default spot values gamSH->setValue(defSpot.gamSH); sloSH->setValue(defSpot.sloSH); + strSH->setValue(defSpot.strSH); angSH->setValue(defSpot.angSH); featherSH->setValue(defSpot.featherSH); - strSH->setValue(defSpot.strSH); showmaskSHMethod->set_active(0); showmaskSHMethodinv->set_active(0); enaSHMask->set_active(defSpot.enaSHMask); @@ -5636,8 +5227,6 @@ void LocallabShadow::convertParamToSimple() void LocallabShadow::updateGUIToMode(const modeType new_type) { - const LocallabParams::LocallabSpot defSpot; - switch (new_type) { case Simple: // Expert and Normal mode widgets are hidden in Simple mode @@ -5649,9 +5238,7 @@ void LocallabShadow::updateGUIToMode(const modeType new_type) maskusables->hide(); maskunusables->hide(); decays->hide(); - ghsMethod->hide(); - ghs_slope->hide(); - Lab_Frame->hide(); + break; case Normal: @@ -5662,18 +5249,12 @@ void LocallabShadow::updateGUIToMode(const modeType new_type) slomaskSH->hide(); fatSHFrame->hide(); exprecovs->show(); - expgradsh->show(); // Specific Simple mode widgets are shown in Normal mode - if (shMethod->get_active_row_number() == 1) { // Keep widget hidden when shMethod is equal to 0 + if (shMethod->get_active_row_number() != 0) { // Keep widget hidden when shMethod is equal to 0 gamFrame->show(); } - if (shMethod->get_active_row_number() != 1 ) { // Keep widget hidden when shMethod is equal to 0 - gamFrame->hide(); - } - - if (enaSHMask->get_active()) { maskusables->show(); maskunusables->hide(); @@ -5687,14 +5268,9 @@ void LocallabShadow::updateGUIToMode(const modeType new_type) expgradsh->show(); exprecovs->show(); } + expmasksh->show(); decays->hide(); - ghsMethod->show(); - Lab_Frame->hide(); - if (ghsMethod->get_active_row_number() == 2 && shMethod->get_active_row_number() == 2) { - Lab_Frame->show(); - } - ghs_slope->hide(); break; @@ -5702,15 +5278,10 @@ void LocallabShadow::updateGUIToMode(const modeType new_type) // Show widgets hidden in Normal and Simple mode blurSHde->show(); - if (shMethod->get_active_row_number() == 1) { // Keep widget hidden when shMethod is equal to 0 + if (shMethod->get_active_row_number() != 0) { // Keep widget hidden when shMethod is equal to 0 gamFrame->show(); } - if (shMethod->get_active_row_number() != 1 ) { // Keep widget hidden when shMethod is equal to 0 - gamFrame->hide(); - } - - if (!inverssh->get_active()) { // Keep widget hidden when inverssh is toggled expgradsh->show(); exprecovs->show(); @@ -5724,7 +5295,6 @@ void LocallabShadow::updateGUIToMode(const modeType new_type) maskunusables->show(); } exprecovs->show(); - expgradsh->show(); decays->show(); expmasksh->show(); @@ -5732,15 +5302,6 @@ void LocallabShadow::updateGUIToMode(const modeType new_type) gammaskSH->show(); slomaskSH->show(); fatSHFrame->show(); - ghsMethod->show(); - Lab_Frame->hide(); - - if (ghsMethod->get_active_row_number() == 2 && shMethod->get_active_row_number() == 2) { - Lab_Frame->show(); - - } - ghs_slope->show(); - } } @@ -5755,6 +5316,7 @@ void LocallabShadow::updateMaskBackground(const double normChromar, const double LLmaskSHshape->updateLocallabBackground(normLumar); HHmaskSHshape->updateLocallabBackground(normHuer); LmaskSHshape->updateLocallabBackground(normLumar); + return false; } ); @@ -5763,7 +5325,7 @@ void LocallabShadow::updateMaskBackground(const double normChromar, const double void LocallabShadow::shMethodChanged() { - // Update shadow highlight GUI according to shmethod combobox state + // Update shadow highlight GUI according to shMethod combobox state updateShadowGUI2(); if (isLocActivated && exp->getEnabled()) { @@ -5774,36 +5336,6 @@ void LocallabShadow::shMethodChanged() } } -void LocallabShadow::ghsMethodChanged() -{ - const int mode = complexity->get_active_row_number(); - - // Update shadow highlight GUI according to ghsMethod combobox state - updateShadowGUI2(); - if (ghsMethod->get_active_row_number() == 2) { - Lab_Frame->show(); - ghs_slope->hide(); - - if (mode == Expert) { - ghs_slope->show(); - } - ghs_chro->show(); - } else { - Lab_Frame->hide(); - ghs_slope->hide(); - ghs_chro->hide(); - Lab_Frame->hide(); - - } - - if (isLocActivated && exp->getEnabled()) { - if (listener) { - listener->panelChanged(EvlocallabghsMethod, - ghsMethod->get_active_text() + " (" + escapeHtmlChars(getSpotName()) + ")"); - } - } -} - void LocallabShadow::inversshChanged() { const bool maskPreviewActivated = isMaskViewActive(); @@ -5831,62 +5363,6 @@ void LocallabShadow::inversshChanged() } } -void LocallabShadow::ghs_smoothChanged() -{ - const bool maskPreviewActivated = isMaskViewActive(); - - // Update shadow highlight GUI according to inverssh button state - updateShadowGUI1(); - - if (maskPreviewActivated) { - // This event is called to transmit reset mask state - if (listener) { - listener->panelChanged(EvlocallabshowmaskMethod, ""); - } - } - - if (isLocActivated && exp->getEnabled()) { - if (listener) { - if (ghs_smooth->get_active()) { - listener->panelChanged(Evlocallabghs_smooth, - M("GENERAL_ENABLED") + " (" + escapeHtmlChars(getSpotName()) + ")"); - } else { - listener->panelChanged(Evlocallabghs_smooth, - M("GENERAL_DISABLED") + " (" + escapeHtmlChars(getSpotName()) + ")"); - } - } - } -} - - -void LocallabShadow::ghs_invChanged() -{ - const bool maskPreviewActivated = isMaskViewActive(); - - // Update shadow highlight GUI according to inverssh button state - updateShadowGUI1(); - - if (maskPreviewActivated) { - // This event is called to transmit reset mask state - if (listener) { - listener->panelChanged(EvlocallabshowmaskMethod, ""); - } - } - - if (isLocActivated && exp->getEnabled()) { - if (listener) { - if (ghs_inv->get_active()) { - listener->panelChanged(Evlocallabghs_inv, - M("GENERAL_ENABLED") + " (" + escapeHtmlChars(getSpotName()) + ")"); - } else { - listener->panelChanged(Evlocallabghs_inv, - M("GENERAL_DISABLED") + " (" + escapeHtmlChars(getSpotName()) + ")"); - } - } - } -} - - void LocallabShadow::showmaskSHMethodChanged() { // If mask preview is activated, deactivate other Shadow highlight mask preview @@ -5952,7 +5428,6 @@ void LocallabShadow::enaSHMaskChanged() void LocallabShadow::updateShadowGUI1() { const int mode = complexity->get_active_row_number(); - const LocallabParams::LocallabSpot defSpot; // Update shadow highlight GUI according to inverssh button state if (inverssh->get_active()) { @@ -5966,22 +5441,9 @@ void LocallabShadow::updateShadowGUI1() exprecovs->hide(); reparsh->hide(); } else { - expgradsh->hide(); - ghsMethod->hide(); - ghs_slope->hide(); - Lab_Frame->hide(); - if (mode == Expert || mode == Normal) { // Keep widget hidden in Simple mode expgradsh->show(); exprecovs->show(); - ghsMethod->show(); - } - if (ghsMethod->get_active_row_number() == 2 && shMethod->get_active_row_number() == 2) { - Lab_Frame->show(); - } - - if (mode == Expert) { - ghs_slope->show(); } reparsh->show(); @@ -5994,32 +5456,6 @@ void LocallabShadow::updateShadowGUI1() } } -void LocallabShadow::updateShadowGUI3() -{ - // Update adjuster range to avoid black screen according to Symmetry ghs_SP - - - double tempLP = ghs_LP->getValue();//Low values Protect shadows - const double tempSP = rtengine::LIM(ghs_SP->getValue(), 0.0001, 0.9999);//avoid 0 and 1 no real sens for symmetry must be enough for most cases - double tempHP = ghs_HP->getValue();//high values Protect highlight - double secur = 0.001;//keep range security to avoid crash and wrong GUI - no or small incidence on usage - double HPL = rtengine::LIM(tempSP - secur, 0.0001, 0.9999); - double BPH = rtengine::LIM(tempSP + secur, 0.0001, 0.9999); - ghs_LP->setLimits(0., HPL, 0.00001, 0.0);// - ghs_HP->setLimits(BPH, 1.0, 0.00001, 0.0); - //avoid crash at limits - if(tempHP - tempSP <= 0.) { - tempHP = tempSP + 0.0001; - } - if(tempSP - tempLP <= 0.) { - tempLP = tempSP - 0.0001; - } - ghs_LP->setValue(tempLP); - ghs_HP->setValue(tempHP); - -} - - void LocallabShadow::updateShadowGUI2() { const int mode = complexity->get_active_row_number(); @@ -6038,8 +5474,6 @@ void LocallabShadow::updateShadowGUI2() shadows->show(); s_tonalwidth->show(); sh_radius->show(); - ghsFrame->hide(); - ghsMethod->hide(); } else if (shMethod->get_active_row_number() == 1) { for (const auto multiplier : multipliersh) { multiplier->show(); @@ -6056,40 +5490,6 @@ void LocallabShadow::updateShadowGUI2() shadows->hide(); s_tonalwidth->hide(); sh_radius->hide(); - ghsFrame->hide(); - ghsMethod->hide(); - expgradsh->show(); - } else if (shMethod->get_active_row_number() == 2) { - for (const auto multiplier : multipliersh) { - multiplier->hide(); - } - gamFrame->hide(); - detailSH->hide(); - tePivot->hide(); - highlights->hide(); - h_tonalwidth->hide(); - shadows->hide(); - s_tonalwidth->hide(); - sh_radius->hide(); - ghsFrame->show(); - inverssh->hide(); - inverssh->set_active(false); - expgradsh->hide(); - ghsMethod->hide(); - ghs_slope->hide(); - Lab_Frame->hide(); - - if (mode == Expert || mode == Normal) { // Keep widget hidden in Simple mode - expgradsh->show(); - ghsMethod->show(); - if (ghsMethod->get_active_row_number() == 2) { - Lab_Frame->show(); - } - } - if (mode == Expert) { - ghs_slope->show(); - - } } } @@ -7686,9 +7086,8 @@ LocallabBlur::LocallabBlur(): nlstr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLLUM"), 0, 100, 1, 0))), nldet(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLDET"), 0, 100, 1, 50))), nlpat(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLPAT"), 1, 5, 1, 2))), - nlrad(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLRAD"), 1, 10, 1, 3))), + nlrad(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLRAD"), 3, 10, 1, 5))), nlgam(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLGAM"), 2., 5., 0.1, 3.))), - nliter(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLITER"), 1., 5., 1., 1.))), bilateral(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BILATERAL"), 0, 100, 1, 0))), sensiden(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), reparden(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LOGREPART"), 1.0, 100.0, 1., 100.0))), @@ -7721,9 +7120,6 @@ LocallabBlur::LocallabBlur(): quaHBox(Gtk::manage(new Gtk::Box())), csThresholdblur(Gtk::manage(new ThresholdAdjuster(M("TP_LOCALLAB_CSTHRESHOLDBLUR"), 0, 9, 0, 0, 6, 5, 0, false))) { - auto m = ProcEventMapper::getInstance(); - Evlocallabnliter = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_NLITER"); - set_orientation(Gtk::ORIENTATION_VERTICAL); const LocallabParams::LocallabSpot defSpot; @@ -7891,7 +7287,6 @@ LocallabBlur::LocallabBlur(): nlpat->setAdjusterListener(this); nlrad->setAdjusterListener(this); nlgam->setAdjusterListener(this); - nliter->setAdjusterListener(this); sensiden->setAdjusterListener(this); reparden->setAdjusterListener(this); @@ -8039,7 +7434,6 @@ LocallabBlur::LocallabBlur(): nlbox->pack_start(*nlgam); nlbox->pack_start(*nlpat); nlbox->pack_start(*nlrad); - nlbox->pack_start(*nliter); expdenoisenl->add(*nlbox); wavBox->pack_start(*expdenoisenl); @@ -8237,7 +7631,6 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) nlpat->set_tooltip_text(M("TP_LOCALLAB_NLDENOISENLPAT_TOOLTIP")); nlrad->set_tooltip_text(M("TP_LOCALLAB_NLDENOISENLRAD_TOOLTIP")); nlgam->set_tooltip_text(M("TP_LOCALLAB_NLDENOISENLGAM_TOOLTIP")); - nliter->set_tooltip_text(M("TP_LOCALLAB_NLDENOISENLITER_TOOLTIP")); noiselumc->set_tooltip_text(M("TP_LOCALLAB_NOISECHROC_TOOLTIP")); expmaskbl->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); showmaskblMethodtyp->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKTYP_TOOLTIP")); @@ -8306,7 +7699,6 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) nlpat->set_tooltip_text(""); nlrad->set_tooltip_text(""); nlgam->set_tooltip_text(""); - nliter->set_tooltip_text(""); blurMethod->set_tooltip_markup(""); expdenoise->set_tooltip_markup(""); wavshapeden->setTooltip(""); @@ -8365,7 +7757,6 @@ void LocallabBlur::neutral_pressed () nlpat->setValue(defSpot.nlpat); nlrad->setValue(defSpot.nlrad); nlgam->setValue(defSpot.nlgam); - nliter->setValue(defSpot.nliter); sensiden->setValue(defSpot.sensiden); quamethod->set_active (0); wavshapeden->setCurve(defSpot.locwavcurveden); @@ -8581,7 +7972,6 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params nlpat->setValue((double)spot.nlpat); nlrad->setValue((double)spot.nlrad); nlgam->setValue((double)spot.nlgam); - nliter->setValue((double)spot.nliter); sensiden->setValue((double)spot.sensiden); if (spot.showmaskblMethodtyp == "blur") { @@ -8730,7 +8120,6 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.nldet = nldet->getIntValue(); spot.nlpat = nlpat->getIntValue(); spot.nlrad = nlrad->getIntValue(); - spot.nliter = nliter->getIntValue(); spot.nlgam = nlgam->getValue(); if (showmaskblMethodtyp->get_active_row_number() == 0) { @@ -8813,7 +8202,6 @@ void LocallabBlur::setDefaults(const rtengine::procparams::ProcParams* defParams nldet->setDefault((double)defSpot.nldet); nlpat->setDefault((double)defSpot.nlpat); nlrad->setDefault((double)defSpot.nlrad); - nliter->setDefault((double)defSpot.nliter); nlgam->setDefault(defSpot.nlgam); sensiden->setDefault((double)defSpot.sensiden); strumaskbl->setDefault(defSpot.strumaskbl); @@ -9110,13 +8498,6 @@ void LocallabBlur::adjusterChanged(Adjuster* a, double newval) } } - if (a == nliter) { - if (listener) { - listener->panelChanged(Evlocallabnliter, - nliter->getTextValue() + " (" + escapeHtmlChars(getSpotName()) + ")"); - } - } - if (a == nldet) { if (listener) { listener->panelChanged(Evlocallabnldet, diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index b3cffc3db..828615ba3 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -111,7 +111,6 @@ protected: rtengine::ProcEvent Evlocallabbluxl; rtengine::ProcEvent Evlocallabbluyl; rtengine::ProcEvent EvlocallabGridciexy; - rtengine::ProcEvent EvlocallabGridghs; rtengine::ProcEvent Evlocallabgamutcie; rtengine::ProcEvent Evlocallabbwcie; rtengine::ProcEvent Evlocallabexpprecam; @@ -567,31 +566,6 @@ private: Gtk::Frame* const gamFrame; Adjuster* const gamSH; Adjuster* const sloSH; - - MyComboBoxText* const ghsMethod; - Gtk::Frame* const gridFrameghs; - LabGrid* const labgridghs; - - Gtk::Frame* const ghsFrame; - Adjuster* const ghs_D; - Gtk::Frame* const Lab_Frame; - Adjuster* const ghs_slope; - Adjuster* const ghs_chro; - Adjuster* const ghs_B; - Adjuster* const ghs_SP; - Adjuster* const ghs_LP; - Adjuster* const ghs_HP; - Gtk::Frame* const LC_Frame; - Adjuster* const ghs_LC; - Gtk::Frame* const BP_Frame; - Adjuster* const ghs_BLP; - Adjuster* const ghs_HLP; - Gtk::Label* const ghsbpwpLabels; - Gtk::Label* const ghsbpwpvalueLabels; - - Gtk::CheckButton* const ghs_smooth; - Gtk::CheckButton* const ghs_inv; - MyExpander* const expgradsh; Adjuster* const strSH; Adjuster* const angSH; @@ -618,21 +592,8 @@ private: Adjuster* const fatanchorSH; rtengine::ProcEvent EvlocallabTePivot; - rtengine::ProcEvent EvlocallabghsMethod; - rtengine::ProcEvent Evlocallabghs_D; - rtengine::ProcEvent Evlocallabghs_slope; - rtengine::ProcEvent Evlocallabghs_chro; - rtengine::ProcEvent Evlocallabghs_B; - rtengine::ProcEvent Evlocallabghs_SP; - rtengine::ProcEvent Evlocallabghs_LP; - rtengine::ProcEvent Evlocallabghs_HP; - rtengine::ProcEvent Evlocallabghs_LC; - rtengine::ProcEvent Evlocallabghs_BLP; - rtengine::ProcEvent Evlocallabghs_HLP; - rtengine::ProcEvent Evlocallabghs_smooth; - rtengine::ProcEvent Evlocallabghs_inv; - sigc::connection shMethodConn, ghsMethodConn, previewshConn, inversshConn, ghs_smoothConn, ghs_invConn, showmaskSHMethodConn, showmaskSHMethodConninv, enaSHMaskConn; + sigc::connection shMethodConn, previewshConn, inversshConn, showmaskSHMethodConn, showmaskSHMethodConninv, enaSHMaskConn; public: LocallabShadow(); @@ -648,10 +609,7 @@ public: void updateAdviceTooltips(const bool showTooltips) override; void updateguishad(int spottype); void updateguiscopesahd(int scope); - - void updateghs(double *gx); - - void updateghsbw(int bp, int wp, double minbp, double maxwp); + void setDefaultExpanderVisibility() override; void disableListener() override; void enableListener() override; @@ -671,18 +629,13 @@ private: void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer, const double normHuerjz) override; void shMethodChanged(); - void ghsMethodChanged(); void inversshChanged(); - void ghs_smoothChanged(); - void ghs_invChanged(); void showmaskSHMethodChanged(); void showmaskSHMethodChangedinv(); void enaSHMaskChanged(); void updateShadowGUI1(); void updateShadowGUI2(); - void updateShadowGUI3(); - }; /* ==== LocallabVibrance ==== */ @@ -926,12 +879,9 @@ private: Adjuster* const nlpat; Adjuster* const nlrad; Adjuster* const nlgam; - Adjuster* const nliter; Adjuster* const bilateral; Adjuster* const sensiden; - - rtengine::ProcEvent Evlocallabnliter; - + Adjuster* const reparden; Gtk::Button* neutral; MyExpander* const expmaskbl; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index b6d32de81..1ef6d7202 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -8103,7 +8103,7 @@ Locallabcie::Locallabcie(): refi(Gtk::manage(new Adjuster(M("TC_PRIM_REFI"), -0.5, 1., 0.0001, 0.))), gridFramecie(Gtk::manage(new Gtk::Frame(M("TP_ICM_WORKING_CIEDIAG")))), - labgridcie(Gtk::manage(new LabGrid(EvlocallabGridciexy, M("TP_ICM_LABGRID_CIEXY"), true, true, false, false))), + labgridcie(Gtk::manage(new LabGrid(EvlocallabGridciexy, M("TP_ICM_LABGRID_CIEXY"), true, true, false))), colorFramecie(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_COLORFRAME")))), catBox(Gtk::manage(new Gtk::Box())), @@ -9981,9 +9981,6 @@ void Locallabcie::read(const rtengine::procparams::ProcParams* pp, const ParamsE spot.labgridcieWy, spot.labgridcieMx, spot.labgridcieMy, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, //+4 12 11 false); strgradcie->setValue((double)spot.strgradcie); @@ -10083,8 +10080,6 @@ void Locallabcie::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedi spot.refi = refi->getValue(); spot.shiftxl = shiftxl->getValue(); spot.shiftyl = shiftyl->getValue(); - double zerox = 0.; - double zeroy = 0.; labgridcie->getParams(spot.labgridcieALow, spot.labgridcieBLow, spot.labgridcieAHigh, @@ -10094,11 +10089,7 @@ void Locallabcie::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedi spot.labgridcieWx, spot.labgridcieWy, spot.labgridcieMx, - spot.labgridcieMy, - zerox, zeroy, zerox, zeroy, - zerox, zeroy, zerox, zeroy, - zerox, zeroy, zerox, zeroy //+4 12 11 - ); + spot.labgridcieMy); spot.Autograycie = Autograycie->get_active(); spot.forcejz = forcejz->get_active(); @@ -10454,7 +10445,7 @@ void Locallabcie::updateiPrimloc(const float r_x, const float r_y, const float g greyl->setValue(g_y); bluxl->setValue(b_x); bluyl->setValue(b_y); - labgridcie->setParams(nextrx, nextry, nextbx, nextby, nextgx, nextgy, nextwx, nextwy, nextmx, nextmy, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false);//+4 12 11 + labgridcie->setParams(nextrx, nextry, nextbx, nextby, nextgx, nextgy, nextwx, nextwy, nextmx, nextmy, false); enableListener(); return false; } @@ -12198,8 +12189,6 @@ void Locallabcie::setDefaults(const rtengine::procparams::ProcParams* defParams, shiftxl->setDefault(defSpot.shiftxl); shiftyl->setDefault(defSpot.shiftyl); refi->setDefault(defSpot.refi); - double zerox = 0.; - double zeroy = 0.; labgridcie->setDefault(defSpot.labgridcieALow, defSpot.labgridcieBLow, defSpot.labgridcieAHigh, @@ -12209,11 +12198,7 @@ void Locallabcie::setDefaults(const rtengine::procparams::ProcParams* defParams, defSpot.labgridcieWx, defSpot.labgridcieWy, defSpot.labgridcieMx, - defSpot.labgridcieMy, - zerox, zeroy, zerox, zeroy, - zerox, zeroy, zerox, zeroy, - zerox, zeroy, zerox, zeroy //+4 12 11 - ); + defSpot.labgridcieMy); } } diff --git a/rtgui/options.cc b/rtgui/options.cc index ae9d1c934..bdc595f5c 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -185,10 +185,6 @@ void Options::updatePaths() lastlocalCurvesDir = preferredPath; } - if (lastlocalCurvesDirghs.empty() || !Glib::file_test(lastlocalCurvesDirghs, Glib::FILE_TEST_EXISTS) || !Glib::file_test(lastlocalCurvesDirghs, Glib::FILE_TEST_IS_DIR)) { - lastlocalCurvesDirghs = preferredPath; - } - if (lastPFCurvesDir.empty() || !Glib::file_test(lastPFCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test(lastPFCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastPFCurvesDir = preferredPath; } @@ -692,7 +688,6 @@ void Options::setDefaults() lastDenoiseCurvesDir = ""; lastWaveletCurvesDir = ""; lastlocalCurvesDir = ""; - lastlocalCurvesDirghs = ""; lastPFCurvesDir = ""; lastHsvCurvesDir = ""; lastToneCurvesDir = ""; @@ -2314,7 +2309,6 @@ void Options::readFromFile(Glib::ustring fname) safeDirGet(keyFile, "Dialogs", "LastDenoiseCurvesDir", lastDenoiseCurvesDir); safeDirGet(keyFile, "Dialogs", "LastWaveletCurvesDir", lastWaveletCurvesDir); safeDirGet(keyFile, "Dialogs", "LastlocalCurvesDir", lastlocalCurvesDir); - safeDirGet(keyFile, "Dialogs", "LastlocalCurvesDirghs", lastlocalCurvesDirghs); safeDirGet(keyFile, "Dialogs", "LastPFCurvesDir", lastPFCurvesDir); safeDirGet(keyFile, "Dialogs", "LastHsvCurvesDir", lastHsvCurvesDir); @@ -2813,7 +2807,6 @@ void Options::saveToFile(Glib::ustring fname) keyFile.set_string("Dialogs", "LastDenoiseCurvesDir", lastDenoiseCurvesDir); keyFile.set_string("Dialogs", "LastWaveletCurvesDir", lastWaveletCurvesDir); keyFile.set_string("Dialogs", "LastlocalCurvesDir", lastlocalCurvesDir); - keyFile.set_string("Dialogs", "LastlocalCurvesDirghs", lastlocalCurvesDirghs); keyFile.set_string("Dialogs", "LastPFCurvesDir", lastPFCurvesDir); keyFile.set_string("Dialogs", "LastHsvCurvesDir", lastHsvCurvesDir); keyFile.set_string("Dialogs", "LastBWCurvesDir", lastBWCurvesDir); diff --git a/rtgui/options.h b/rtgui/options.h index 0c4f61fd2..6a2b0c35d 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -487,7 +487,6 @@ public: Glib::ustring lastDenoiseCurvesDir; Glib::ustring lastWaveletCurvesDir; Glib::ustring lastlocalCurvesDir; - Glib::ustring lastlocalCurvesDirghs; Glib::ustring lastPFCurvesDir; Glib::ustring lastHsvCurvesDir; Glib::ustring lastToneCurvesDir; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 8bda5dc79..27f36f46a 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1296,43 +1296,6 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).expshadhigh = locallab.spots.at(j).expshadhigh && pSpot.expshadhigh == otherSpot.expshadhigh; locallab.spots.at(j).complexshadhigh = locallab.spots.at(j).complexshadhigh && pSpot.complexshadhigh == otherSpot.complexshadhigh; locallab.spots.at(j).shMethod = locallab.spots.at(j).shMethod && pSpot.shMethod == otherSpot.shMethod; - locallab.spots.at(j).ghsMethod = locallab.spots.at(j).ghsMethod && pSpot.ghsMethod == otherSpot.ghsMethod; - locallab.spots.at(j).ghsMode = locallab.spots.at(j).ghsMode && pSpot.ghsMode == otherSpot.ghsMode; - locallab.spots.at(j).ghs_D = locallab.spots.at(j).ghs_D && pSpot.ghs_D == otherSpot.ghs_D; - locallab.spots.at(j).ghs_slope = locallab.spots.at(j).ghs_slope && pSpot.ghs_slope == otherSpot.ghs_slope; - locallab.spots.at(j).ghs_chro = locallab.spots.at(j).ghs_chro && pSpot.ghs_chro == otherSpot.ghs_chro; - locallab.spots.at(j).ghs_B = locallab.spots.at(j).ghs_B && pSpot.ghs_B == otherSpot.ghs_B; - locallab.spots.at(j).ghs_SP = locallab.spots.at(j).ghs_SP && pSpot.ghs_SP == otherSpot.ghs_SP; - locallab.spots.at(j).ghs_LP = locallab.spots.at(j).ghs_LP && pSpot.ghs_LP == otherSpot.ghs_LP; - locallab.spots.at(j).ghs_HP = locallab.spots.at(j).ghs_HP && pSpot.ghs_HP == otherSpot.ghs_HP; - locallab.spots.at(j).ghs_LC = locallab.spots.at(j).ghs_LC && pSpot.ghs_LC == otherSpot.ghs_LC; - locallab.spots.at(j).ghs_BLP = locallab.spots.at(j).ghs_BLP && pSpot.ghs_BLP == otherSpot.ghs_BLP; - locallab.spots.at(j).ghs_HLP = locallab.spots.at(j).ghs_HLP && pSpot.ghs_HLP == otherSpot.ghs_HLP; - locallab.spots.at(j).ghs_smooth = locallab.spots.at(j).ghs_smooth && pSpot.ghs_smooth == otherSpot.ghs_smooth; - locallab.spots.at(j).ghs_inv = locallab.spots.at(j).ghs_inv && pSpot.ghs_inv == otherSpot.ghs_inv; - locallab.spots.at(j).ghsx1 = locallab.spots.at(j).ghsx1 && pSpot.ghsx1 == otherSpot.ghsx1; - locallab.spots.at(j).ghsy1 = locallab.spots.at(j).ghsy1 && pSpot.ghsy1 == otherSpot.ghsy1; - locallab.spots.at(j).ghsx2 = locallab.spots.at(j).ghsx2 && pSpot.ghsx2 == otherSpot.ghsx2; - locallab.spots.at(j).ghsy2 = locallab.spots.at(j).ghsy2 && pSpot.ghsy2 == otherSpot.ghsy2; - - locallab.spots.at(j).ghsx3 = locallab.spots.at(j).ghsx3 && pSpot.ghsx3 == otherSpot.ghsx3; - locallab.spots.at(j).ghsy3 = locallab.spots.at(j).ghsy3 && pSpot.ghsy3 == otherSpot.ghsy3; - locallab.spots.at(j).ghsx4 = locallab.spots.at(j).ghsx4 && pSpot.ghsx4 == otherSpot.ghsx4; - locallab.spots.at(j).ghsy4 = locallab.spots.at(j).ghsy4 && pSpot.ghsy4 == otherSpot.ghsy4; - locallab.spots.at(j).ghsx5 = locallab.spots.at(j).ghsx5 && pSpot.ghsx5 == otherSpot.ghsx5; - locallab.spots.at(j).ghsy5 = locallab.spots.at(j).ghsy5 && pSpot.ghsy5 == otherSpot.ghsy5; - locallab.spots.at(j).ghsx6 = locallab.spots.at(j).ghsx6 && pSpot.ghsx6 == otherSpot.ghsx6; - locallab.spots.at(j).ghsy6 = locallab.spots.at(j).ghsy6 && pSpot.ghsy6 == otherSpot.ghsy6; - locallab.spots.at(j).ghsx7 = locallab.spots.at(j).ghsx7 && pSpot.ghsx7 == otherSpot.ghsx7; - locallab.spots.at(j).ghsy7 = locallab.spots.at(j).ghsy7 && pSpot.ghsy7 == otherSpot.ghsy7; - locallab.spots.at(j).ghsx8 = locallab.spots.at(j).ghsx8 && pSpot.ghsx8 == otherSpot.ghsx8; - locallab.spots.at(j).ghsy8 = locallab.spots.at(j).ghsy8 && pSpot.ghsy8 == otherSpot.ghsy8; - locallab.spots.at(j).ghsx9 = locallab.spots.at(j).ghsx9 && pSpot.ghsx9 == otherSpot.ghsx9; - locallab.spots.at(j).ghsy9 = locallab.spots.at(j).ghsy9 && pSpot.ghsy9 == otherSpot.ghsy9; - locallab.spots.at(j).ghsx8 = locallab.spots.at(j).ghsx10 && pSpot.ghsx10 == otherSpot.ghsx10; - locallab.spots.at(j).ghsy8 = locallab.spots.at(j).ghsy10 && pSpot.ghsy10 == otherSpot.ghsy10; - locallab.spots.at(j).ghsx9 = locallab.spots.at(j).ghsx11 && pSpot.ghsx11 == otherSpot.ghsx11; - locallab.spots.at(j).ghsy9 = locallab.spots.at(j).ghsy11 && pSpot.ghsy11 == otherSpot.ghsy11; for (int k = 0; k < 6; k++) { locallab.spots.at(j).multsh[k] = locallab.spots.at(j).multsh[k] && pSpot.multsh[k] == otherSpot.multsh[k]; @@ -1466,7 +1429,6 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).nlpat = locallab.spots.at(j).nlpat && pSpot.nlpat == otherSpot.nlpat; locallab.spots.at(j).nlrad = locallab.spots.at(j).nlrad && pSpot.nlrad == otherSpot.nlrad; locallab.spots.at(j).nlgam = locallab.spots.at(j).nlgam && pSpot.nlgam == otherSpot.nlgam; - locallab.spots.at(j).nliter = locallab.spots.at(j).nliter && pSpot.nliter == otherSpot.nliter; locallab.spots.at(j).sensiden = locallab.spots.at(j).sensiden && pSpot.sensiden == otherSpot.sensiden; locallab.spots.at(j).reparden = locallab.spots.at(j).reparden && pSpot.reparden == otherSpot.reparden; locallab.spots.at(j).detailthr = locallab.spots.at(j).detailthr && pSpot.detailthr == otherSpot.detailthr; @@ -4310,151 +4272,6 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).shMethod = mods.locallab.spots.at(i).shMethod; } - if (locallab.spots.at(i).ghsMethod) { - toEdit.locallab.spots.at(i).ghsMethod = mods.locallab.spots.at(i).ghsMethod; - } - - if (locallab.spots.at(i).ghsx1) { - toEdit.locallab.spots.at(i).ghsx1 = mods.locallab.spots.at(i).ghsx1; - } - - if (locallab.spots.at(i).ghsy1) { - toEdit.locallab.spots.at(i).ghsy1 = mods.locallab.spots.at(i).ghsy1; - } - - if (locallab.spots.at(i).ghsx2) { - toEdit.locallab.spots.at(i).ghsx2 = mods.locallab.spots.at(i).ghsx2; - } - - if (locallab.spots.at(i).ghsy2) { - toEdit.locallab.spots.at(i).ghsy2 = mods.locallab.spots.at(i).ghsy2; - } - - if (locallab.spots.at(i).ghsx3) { - toEdit.locallab.spots.at(i).ghsx3 = mods.locallab.spots.at(i).ghsx3; - } - - if (locallab.spots.at(i).ghsy3) { - toEdit.locallab.spots.at(i).ghsy3 = mods.locallab.spots.at(i).ghsy3; - } - - if (locallab.spots.at(i).ghsx4) { - toEdit.locallab.spots.at(i).ghsx4 = mods.locallab.spots.at(i).ghsx4; - } - - if (locallab.spots.at(i).ghsy4) { - toEdit.locallab.spots.at(i).ghsy4 = mods.locallab.spots.at(i).ghsy4; - } - - if (locallab.spots.at(i).ghsx5) { - toEdit.locallab.spots.at(i).ghsx5 = mods.locallab.spots.at(i).ghsx5; - } - - if (locallab.spots.at(i).ghsy5) { - toEdit.locallab.spots.at(i).ghsy5 = mods.locallab.spots.at(i).ghsy5; - } - - if (locallab.spots.at(i).ghsx6) { - toEdit.locallab.spots.at(i).ghsx6 = mods.locallab.spots.at(i).ghsx6; - } - - if (locallab.spots.at(i).ghsy6) { - toEdit.locallab.spots.at(i).ghsy6 = mods.locallab.spots.at(i).ghsy6; - } - - if (locallab.spots.at(i).ghsx7) { - toEdit.locallab.spots.at(i).ghsx7 = mods.locallab.spots.at(i).ghsx7; - } - - if (locallab.spots.at(i).ghsy7) { - toEdit.locallab.spots.at(i).ghsy7 = mods.locallab.spots.at(i).ghsy7; - } - - if (locallab.spots.at(i).ghsx8) { - toEdit.locallab.spots.at(i).ghsx8 = mods.locallab.spots.at(i).ghsx8; - } - - if (locallab.spots.at(i).ghsy8) { - toEdit.locallab.spots.at(i).ghsy8 = mods.locallab.spots.at(i).ghsy8; - } - - if (locallab.spots.at(i).ghsx9) { - toEdit.locallab.spots.at(i).ghsx9 = mods.locallab.spots.at(i).ghsx9; - } - - if (locallab.spots.at(i).ghsy9) { - toEdit.locallab.spots.at(i).ghsy9 = mods.locallab.spots.at(i).ghsy9; - } - - if (locallab.spots.at(i).ghsx10) { - toEdit.locallab.spots.at(i).ghsx10 = mods.locallab.spots.at(i).ghsx10; - } - - if (locallab.spots.at(i).ghsy10) { - toEdit.locallab.spots.at(i).ghsy10 = mods.locallab.spots.at(i).ghsy10; - } - - if (locallab.spots.at(i).ghsx11) { - toEdit.locallab.spots.at(i).ghsx11 = mods.locallab.spots.at(i).ghsx11; - } - - if (locallab.spots.at(i).ghsy11) { - toEdit.locallab.spots.at(i).ghsy11 = mods.locallab.spots.at(i).ghsy11; - } - - if (locallab.spots.at(i).ghsMode) { - toEdit.locallab.spots.at(i).ghsMode = mods.locallab.spots.at(i).ghsMode; - } - - if (locallab.spots.at(i).ghs_D) { - toEdit.locallab.spots.at(i).ghs_D = mods.locallab.spots.at(i).ghs_D; - } - - if (locallab.spots.at(i).ghs_slope) { - toEdit.locallab.spots.at(i).ghs_slope = mods.locallab.spots.at(i).ghs_slope; - } - - if (locallab.spots.at(i).ghs_chro) { - toEdit.locallab.spots.at(i).ghs_chro = mods.locallab.spots.at(i).ghs_chro; - } - - if (locallab.spots.at(i).ghs_B) { - toEdit.locallab.spots.at(i).ghs_B = mods.locallab.spots.at(i).ghs_B; - } - - if (locallab.spots.at(i).ghs_SP) { - toEdit.locallab.spots.at(i).ghs_SP = mods.locallab.spots.at(i).ghs_SP; - } - - if (locallab.spots.at(i).ghs_LP) { - toEdit.locallab.spots.at(i).ghs_LP = mods.locallab.spots.at(i).ghs_LP; - } - - if (locallab.spots.at(i).ghs_HP) { - toEdit.locallab.spots.at(i).ghs_HP = mods.locallab.spots.at(i).ghs_HP; - } - - if (locallab.spots.at(i).ghs_LC) { - toEdit.locallab.spots.at(i).ghs_LC = mods.locallab.spots.at(i).ghs_LC; - } - - if (locallab.spots.at(i).ghs_BLP) { - toEdit.locallab.spots.at(i).ghs_BLP = mods.locallab.spots.at(i).ghs_BLP; - } - - if (locallab.spots.at(i).ghs_HLP) { - toEdit.locallab.spots.at(i).ghs_HLP = mods.locallab.spots.at(i).ghs_HLP; - } - - if (locallab.spots.at(i).ghs_smooth) { - toEdit.locallab.spots.at(i).ghs_smooth = mods.locallab.spots.at(i).ghs_smooth; - } - - if (locallab.spots.at(i).ghs_inv) { - toEdit.locallab.spots.at(i).ghs_inv = mods.locallab.spots.at(i).ghs_inv; - } - - for (int j = 0; j < 6; j++) { if (locallab.spots.at(i).multsh[j]) { toEdit.locallab.spots.at(i).multsh[j] = mods.locallab.spots.at(i).multsh[j]; @@ -4964,10 +4781,6 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).nlgam = mods.locallab.spots.at(i).nlgam; } - if (locallab.spots.at(i).nliter) { - toEdit.locallab.spots.at(i).nliter = mods.locallab.spots.at(i).nliter; - } - if (locallab.spots.at(i).sensiden) { toEdit.locallab.spots.at(i).sensiden = mods.locallab.spots.at(i).sensiden; } @@ -8298,43 +8111,6 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : expshadhigh(v), complexshadhigh(v), shMethod(v), - ghsMethod(v), - ghsMode(v), - ghs_D(v), - ghs_slope(v), - ghs_chro(v), - ghs_B(v), - ghs_SP(v), - ghs_LP(v), - ghs_HP(v), - ghs_LC(v), - ghs_BLP(v), - ghs_HLP(v), - ghs_smooth(v), - ghs_inv(v), - ghsx1(v), - ghsy1(v), - ghsx2(v), - ghsy2(v), - ghsx3(v), - ghsy3(v), - ghsx4(v), - ghsy4(v), - ghsx5(v), - ghsy5(v), - ghsx6(v), - ghsy6(v), - ghsx7(v), - ghsy7(v), - ghsx8(v), - ghsy8(v), - ghsx9(v), - ghsy9(v), - ghsx10(v), - ghsy10(v), - ghsx11(v), - ghsy11(v), - multsh{v, v, v, v, v, v, v}, highlights(v), h_tonalwidth(v), @@ -8464,7 +8240,6 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : nlpat(v), nlrad(v), nlgam(v), - nliter(v), sensiden(v), reparden(v), detailthr(v), @@ -9096,43 +8871,6 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) expshadhigh = v; complexshadhigh = v; shMethod = v; - ghsMethod = v; - ghsMode = v; - ghs_D = v; - ghs_slope = v; - ghs_chro = v; - ghs_B = v; - ghs_SP = v; - ghs_LP = v; - ghs_HP = v; - ghs_LC = v; - ghs_BLP = v; - ghs_HLP = v; - ghs_smooth = v; - ghs_inv = v; - ghsx1 = v; - ghsy1 = v; - ghsx2 = v; - ghsy2 = v; - ghsx3 = v; - ghsy3 = v; - ghsx4 = v; - ghsy4 = v; - ghsx5 = v; - ghsy5 = v; - ghsx6 = v; - ghsy6 = v; - ghsx7 = v; - ghsy7 = v; - ghsx8 = v; - ghsy8 = v; - ghsx9 = v; - ghsy9 = v; - ghsx10 = v; - ghsy10 = v; - ghsx11 = v; - ghsy11 = v; - for (int i = 0; i < 6; i++) { multsh[i] = v; @@ -9266,7 +9004,6 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) nlpat = v; nlrad = v; nlgam = v; - nliter = v; sensiden = v; reparden = v; detailthr = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 4a2555b9c..0293aec69 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -582,42 +582,6 @@ public: bool expshadhigh; bool complexshadhigh; bool shMethod; - bool ghsMethod; - bool ghsMode; - bool ghs_D; - bool ghs_slope; - bool ghs_chro; - bool ghs_B; - bool ghs_SP; - bool ghs_LP; - bool ghs_HP; - bool ghs_LC; - bool ghs_BLP; - bool ghs_HLP; - bool ghs_smooth; - bool ghs_inv; - bool ghsx1; - bool ghsy1; - bool ghsx2; - bool ghsy2; - bool ghsx3; - bool ghsy3; - bool ghsx4; - bool ghsy4; - bool ghsx5; - bool ghsy5; - bool ghsx6; - bool ghsy6; - bool ghsx7; - bool ghsy7; - bool ghsx8; - bool ghsy8; - bool ghsx9; - bool ghsy9; - bool ghsx10; - bool ghsy10; - bool ghsx11; - bool ghsy11; bool multsh[7]; bool highlights; bool h_tonalwidth; @@ -747,7 +711,6 @@ public: bool nlpat; bool nlrad; bool nlgam; - bool nliter; bool sensiden; bool reparden; bool detailthr; diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index 31ed658b0..c807a1bd2 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -1749,8 +1749,7 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited) strend->setValue(pp->wavelet.strend); detend->setValue(pp->wavelet.detend); thrend->setValue(pp->wavelet.thrend); - labgrid->setParams(pp->wavelet.labgridALow / WaveletParams::LABGRID_CORR_MAX, pp->wavelet.labgridBLow / WaveletParams::LABGRID_CORR_MAX, pp->wavelet.labgridAHigh / WaveletParams::LABGRID_CORR_MAX, pp->wavelet.labgridBHigh / WaveletParams::LABGRID_CORR_MAX, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false);//+4 12 11 + labgrid->setParams(pp->wavelet.labgridALow / WaveletParams::LABGRID_CORR_MAX, pp->wavelet.labgridBLow / WaveletParams::LABGRID_CORR_MAX, pp->wavelet.labgridAHigh / WaveletParams::LABGRID_CORR_MAX, pp->wavelet.labgridBHigh / WaveletParams::LABGRID_CORR_MAX, 0, 0, 0, 0, 0, 0, false); sigm->setValue(pp->wavelet.sigm); levden->setValue(pp->wavelet.levden); @@ -2213,8 +2212,7 @@ void Wavelet::write(ProcParams* pp, ParamsEdited* pedited) pp->wavelet.chromco = chromco->getValue(); double zerox = 0.; double zeroy = 0.; - labgrid->getParams(pp->wavelet.labgridALow, pp->wavelet.labgridBLow, pp->wavelet.labgridAHigh, pp->wavelet.labgridBHigh, - zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy, zerox, zeroy);//4 12 11 + labgrid->getParams(pp->wavelet.labgridALow, pp->wavelet.labgridBLow, pp->wavelet.labgridAHigh, pp->wavelet.labgridBHigh, zerox, zeroy, zerox, zeroy, zerox, zeroy); pp->wavelet.labgridALow *= WaveletParams::LABGRID_CORR_MAX; pp->wavelet.labgridAHigh *= WaveletParams::LABGRID_CORR_MAX; pp->wavelet.labgridBLow *= WaveletParams::LABGRID_CORR_MAX; @@ -2674,8 +2672,7 @@ void Wavelet::setDefaults(const ProcParams* defParams, const ParamsEdited* pedit balchrom->setDefault(defParams->wavelet.balchrom); chromfi->setDefault(defParams->wavelet.chromfi); chromco->setDefault(defParams->wavelet.chromco); - labgrid->setDefault(defParams->wavelet.labgridALow / WaveletParams::LABGRID_CORR_MAX, defParams->wavelet.labgridBLow / WaveletParams::LABGRID_CORR_MAX, defParams->wavelet.labgridAHigh / WaveletParams::LABGRID_CORR_MAX, defParams->wavelet.labgridBHigh / WaveletParams::LABGRID_CORR_MAX, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);//4 12 11 + labgrid->setDefault(defParams->wavelet.labgridALow / WaveletParams::LABGRID_CORR_MAX, defParams->wavelet.labgridBLow / WaveletParams::LABGRID_CORR_MAX, defParams->wavelet.labgridAHigh / WaveletParams::LABGRID_CORR_MAX, defParams->wavelet.labgridBHigh / WaveletParams::LABGRID_CORR_MAX, 0, 0, 0, 0, 0, 0); greenlow->setDefault(defParams->wavelet.greenlow); bluelow->setDefault(defParams->wavelet.bluelow);