diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index 52d25d85b..1483d7cc5 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -1929,7 +1929,7 @@ TP_LOCALLAB_EXPRETITOOLS;Outils Retinex avancés TP_LOCALLAB_EXPSHARP_TOOLTIP;RT-Spot minimum 39*39.\nUtiliser de basses valeurs de transition et de hautes valeurs de transition affaiblissement et Etendue pour simuler un petit RT-spot. TP_LOCALLAB_EXPTOOL;Outils exposition TP_LOCALLAB_EXPTRC;Courbe de réponse Tonale - TRC -TP_LOCALLAB_EXP_TOOLNAME;Atténuation contraste -Compression Dynamique & Exposition- 10 +TP_LOCALLAB_EXP_TOOLNAME;Atténuation Contraste -Compression Dynamique & Exposition- 10 TP_LOCALLAB_FATAMOUNT;Quantité TP_LOCALLAB_FATANCHOR;Ancre TP_LOCALLAB_FATANCHORA;Décalage @@ -1987,10 +1987,10 @@ TP_LOCALLAB_LABGRIDMERG;Arrière plan TP_LOCALLAB_LABGRID_VALUES;Haut(a)=%1 Haut(b)=%2\nBas(a)=%3 Bas(b)=%4 TP_LOCALLAB_LABSTRUM;Masque Structure TP_LOCALLAB_LAPLACC;ΔØ Masque Laplacien résoud PDE -TP_LOCALLAB_LAPLACE;Δ - Laplacien seuil ΔE -TP_LOCALLAB_LAPLACEXP;∆ - Laplacian seuil -TP_LOCALLAB_LAPMASKCOL;∆ - Laplacian seuil masque -TP_LOCALLAB_LAPRAD_TOOLTIP;Eviter d'utiliser Radius and Laplace Seuil en même temps.\nLaplacien seuil reduit le contraste, artéfacts, adoucit le résultat (si PDE réglages activé). +TP_LOCALLAB_LAPLACE;Laplacien seuil ΔE +TP_LOCALLAB_LAPLACEXP;Laplacien seuil +TP_LOCALLAB_LAPMASKCOL;Laplacien seuil masque +TP_LOCALLAB_LAPRAD_TOOLTIP;Eviter d'utiliser Radius and Laplace Seuil en même temps.\nLaplacien seuil reduit le contraste, artéfacts, adoucit le résultat. TP_LOCALLAB_LAP_MASK_TOOLTIP;Résoud PDE (Equation aux dérivées partielles) pour tous les masques Laplacien.\nSi activé Laplacien masque seuil reduit les artéfacts et adoucit les résultats.\nSi désactivé réponse linaire. TP_LOCALLAB_LC_FFTW_TOOLTIP;FFT améliore la qualité et autorise de grands rayons, mais accroît les temps de traitement.\nCe temps dépends de la surface devant être traitée.\nA utiliser de préférences pour de grands rayons.\n\nLes Dimensions peuvent être réduites de quelques pixels pour optimiser FFTW.\nCette optimisation peut réduire le temps de traitement d'un facteur de 1.5 à 10.\n TP_LOCALLAB_LC_TOOLNAME;Constrast Local & Ondelettes (Défauts) - 7 @@ -2004,7 +2004,7 @@ TP_LOCALLAB_LIGHTN_TOOLTIP;En mode inverse: selection = -100 force la luminance TP_LOCALLAB_LIGHTRETI;Luminosité TP_LOCALLAB_LINEAR;Linéarité TP_LOCALLAB_LIST_NAME;Ajoute un outil au spot courant... -TP_LOCALLAB_LIST_TOOLTIP;Choisir un outil et ensuite son niveau de complexité "Normal" ou "Expert".\nLe nombre traduit la place de l'outil dans le processus de chaque RT-Spot +TP_LOCALLAB_LIST_TOOLTIP;Vous pouvez choisir 3 niveaux de complexité pour chaque outil: Basic, Normal & Avancé.\nLe réglage par défaut est Basic mais il peut être changé dans Préférences.\nVous pouvez aussi changer ce niveau pour chaque outil en cours. TP_LOCALLAB_LMASK_LEVEL_TOOLTIP;Donne priorité à l'action sur les tons moyens et hautes lumières en choisissant les niveaux concernés d'ondelettes TP_LOCALLAB_LMASK_LL_TOOLTIP;Give priority to action on midtones and high lights TP_LOCALLAB_LOCCONT;Masque Flou @@ -2083,8 +2083,8 @@ TP_LOCALLAB_MERTWO;Soustrait TP_LOCALLAB_METHOD_TOOLTIP;'Enhanced + chroma denoise' significantly increases processing times.\nBut reduce artifacts. TP_LOCALLAB_MLABEL;Récupère les données Min=%1 Max=%2 (Clip - décalage) TP_LOCALLAB_MLABEL_TOOLTIP;'Doit être' près de min=0 max=32768 (log mode) mais d'autres valeurs sont possibles.\nVous pouvez agir sur les données récupérées (CLIP) et décalage pour normaliser.\n\nRécupère les données image sans mélange. -TP_LOCALLAB_MODE_EXPERT;Expert -TP_LOCALLAB_MODE_NORMAL;Normal +TP_LOCALLAB_MODE_EXPERT;Avancé +TP_LOCALLAB_MODE_NORMAL;Standard TP_LOCALLAB_MRFIV;Arrière plan TP_LOCALLAB_MRFOU;Spot précédent TP_LOCALLAB_MRONE;Rien @@ -2112,7 +2112,7 @@ TP_LOCALLAB_ORIGLC;Fusion seulement avec image originale TP_LOCALLAB_ORRETILAP_TOOLTIP;Agit sur un deuxième seuil Laplacien, pour prendre en compte ΔE pour différencier l'action nottament avec l'arrière plan (différent de Etendue) TP_LOCALLAB_ORRETISTREN_TOOLTIP;Aagit sur un seuil Laplacien, plus grande est l'action, plus les différences de contraste seront réduites TP_LOCALLAB_PASTELS2;Vibrance -TP_LOCALLAB_PDE;Atténuation de contraste - Compression dynamique +TP_LOCALLAB_PDE;Atténuation de Contraste - Compression dynamique TP_LOCALLAB_PDEFRA;Contraste atténuation ƒ TP_LOCALLAB_PDEFRAME_TOOLTIP;PDE IPOL - algorithme personnel adapté de IPOL à Rawtherapee: conduit à des résultats très variés et a besoin de différents réglages que Standard (Noir négatif, gamma < 1,...)\nPeut être utils pour des iamges sous-exposées ou avec une étendue dynamique importante.\n TP_LOCALLAB_PREVIEW;Prévisualisation ΔE @@ -2219,8 +2219,8 @@ TP_LOCALLAB_SHOWPOISSON;Poisson (pde ƒ) TP_LOCALLAB_SHOWR;Masque et modifications TP_LOCALLAB_SHOWREF;Prévisualisation ΔE TP_LOCALLAB_SHOWS;Masque et modifications -TP_LOCALLAB_SHOWSTRUC;Montrer Spot structure (expert) -TP_LOCALLAB_SHOWSTRUCEX;Montrer Spot structure (expert) +TP_LOCALLAB_SHOWSTRUC;Montrer Spot structure (avancé) +TP_LOCALLAB_SHOWSTRUCEX;Montrer Spot structure (avancé) TP_LOCALLAB_SHOWT;Masque et modifications TP_LOCALLAB_SHOWVI;Masque et modifications TP_LOCALLAB_SHRESFRA;Ombres/Lumières @@ -2255,7 +2255,7 @@ TP_LOCALLAB_STRRETI_TOOLTIP;Si force Retinex < 0.2 seul Dehaze est activé.\nSi TP_LOCALLAB_STRUC;Structure TP_LOCALLAB_STRUCCOL;Structure TP_LOCALLAB_STRUCCOL1;Spot Structure -TP_LOCALLAB_STRUCT_TOOLTIP;Utilise l'algorithme de Sobel pour prendre en compte la structure dans la détection de forme.\nvous pouvez prévisualiser avec "masque et modifications - Montrer structure spot".\n\nPeut être utilisé avec masques (expert) structure, flouter, ondelettes pour améliorer la détection de bords.\n\nA besoin de réglages sans-masque pour êtrre activé (luminosité, exposition...) +TP_LOCALLAB_STRUCT_TOOLTIP;Utilise l'algorithme de Sobel pour prendre en compte la structure dans la détection de forme.\nvous pouvez prévisualiser avec "masque et modifications - Montrer structure spot".\n\nPeut être utilisé avec masques (avancé) structure, flouter, ondelettes pour améliorer la détection de bords.\n\nA besoin de réglages sans-masque pour êtrre activé (luminosité, exposition...) TP_LOCALLAB_STRUMASKCOL;Structure masque force TP_LOCALLAB_STRUMASK_TOOLTIP;Génère un masque structure qui va différencier les aplats et reliefs.\nSi structure masque comme outil est activé, ce masque est untilisé en plus des autres outils (gamma, slope, courbe contraste ...) TP_LOCALLAB_STYPE;Forme méthode @@ -2653,6 +2653,8 @@ TP_WAVELET_CHR_TOOLTIP;Ajuste le chroma en fonction des "niveaux de contraste" e TP_WAVELET_CHSL;Curseurs TP_WAVELET_CHTYPE;Méthode de chrominance TP_WAVELET_COLORT;Opacité Rouge-Vert +TP_WAVELET_COMPLEX_TOOLTIP;Standard: l’application dispose du nécessaire pour assurer les opérations courantes, l’interface graphique est simplifiée.\nAvancé: toutes les fonctionnalités sont présentes, certaines nécessitent un apprentissage important +TP_WAVELET_COMPEXPERT;Avancé TP_WAVELET_COMPCONT;Contraste TP_WAVELET_COMPGAMMA;Compression gamma TP_WAVELET_COMPGAMMA_TOOLTIP;Ajuster le gamma de l'image résiduelle vous permet d'équiilibrer les données de l'histogramme. diff --git a/rtdata/languages/default b/rtdata/languages/default index 83c1025f3..041bb29f7 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -569,10 +569,10 @@ HISTORY_MSG_314;W - Gamut - Reduce artifacts HISTORY_MSG_315;W - Residual - Contrast HISTORY_MSG_316;W - Gamut - Skin tar/prot HISTORY_MSG_317;W - Gamut - Skin hue -HISTORY_MSG_318;W - Contrast - Fine levels -HISTORY_MSG_319;W - Contrast - Fine range -HISTORY_MSG_320;W - Contrast - Coarse range -HISTORY_MSG_321;W - Contrast - Coarse levels +HISTORY_MSG_318;W - Contrast - Finer levels +HISTORY_MSG_319;W - Contrast - Finer range +HISTORY_MSG_320;W - Contrast - Coarser range +HISTORY_MSG_321;W - Contrast - Coarser levels HISTORY_MSG_322;W - Gamut - Avoid color shift HISTORY_MSG_323;W - ES - Local contrast HISTORY_MSG_324;W - Chroma - Pastel @@ -636,14 +636,14 @@ HISTORY_MSG_381;PRS RLD - Radius HISTORY_MSG_382;PRS RLD - Amount HISTORY_MSG_383;PRS RLD - Damping HISTORY_MSG_384;PRS RLD - Iterations -HISTORY_MSG_385;W - Residual - Color Balance +HISTORY_MSG_385;W - Residual - Color balance HISTORY_MSG_386;W - Residual - CB green high HISTORY_MSG_387;W - Residual - CB blue high HISTORY_MSG_388;W - Residual - CB green mid HISTORY_MSG_389;W - Residual - CB blue mid HISTORY_MSG_390;W - Residual - CB green low HISTORY_MSG_391;W - Residual - CB blue low -HISTORY_MSG_392;W - Residual - Color Balance +HISTORY_MSG_392;W - Residual - Color balance HISTORY_MSG_393;DCP - Look table HISTORY_MSG_394;DCP - Baseline exposure HISTORY_MSG_395;DCP - Base table @@ -1087,7 +1087,7 @@ HISTORY_MSG_841;Local - LC curve HISTORY_MSG_842;Local - Contrast Threshold Mask blur HISTORY_MSG_843;Local - Radius Mask blur HISTORY_MSG_844;Local - Color Mask fftw -HISTORY_MSG_845;Local - Encoding log +HISTORY_MSG_845;Local - log encoding HISTORY_MSG_846;Local - Encoding auto HISTORY_MSG_847;Local - Source Gray HISTORY_MSG_848;Local - Source Gray auto @@ -1133,8 +1133,8 @@ HISTORY_MSG_888;Local - Contrast Wavelet Balance Threshold HISTORY_MSG_889;Local - Contrast Wavelet Graduated Strength HISTORY_MSG_890;Local - Contrast Wavelet Graduated angle HISTORY_MSG_891;Local - Contrast Wavelet Graduated -HISTORY_MSG_892;Local - Encoding log Graduated Strength -HISTORY_MSG_893;Local - Encoding log Graduated angle +HISTORY_MSG_892;Local - Log Encoding Graduated Strength +HISTORY_MSG_893;Local - Log Encoding Graduated angle HISTORY_MSG_894;Local - Color Preview dE HISTORY_MSG_897;Local - Contrast Wavelet ES strength HISTORY_MSG_898;Local - Contrast Wavelet ES radius @@ -1196,10 +1196,11 @@ HISTORY_MSG_953;Local - Mask Common blend chroma HISTORY_MSG_954;Local - Show-hide tools HISTORY_MSG_955;Local - Enable Spot HISTORY_MSG_956;Local - CH Curve +HISTORY_MSG_957;Local - Tool complexity mode HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance -HISTORY_MSG_BLUWAV;Attenuation Response +HISTORY_MSG_BLUWAV;Attenuation response HISTORY_MSG_CAT02PRESET;Cat02 automatic preset HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction @@ -1216,6 +1217,8 @@ HISTORY_MSG_COLORTONING_LABREGION_POWER;CT - region power HISTORY_MSG_COLORTONING_LABREGION_SATURATION;CT - Saturation HISTORY_MSG_COLORTONING_LABREGION_SHOWMASK;CT - region show mask HISTORY_MSG_COLORTONING_LABREGION_SLOPE;CT - region slope +HISTORY_MSG_COMPLEX;Wavelet complexity +HISTORY_MSG_COMPLEXRETI;Retinex complexity HISTORY_MSG_DEHAZE_DEPTH;Dehaze - Depth HISTORY_MSG_DEHAZE_ENABLED;Haze Removal HISTORY_MSG_DEHAZE_LUMINANCE;Dehaze - Luminance only @@ -1223,7 +1226,7 @@ HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP;Dehaze - Show depth map HISTORY_MSG_DEHAZE_STRENGTH;Dehaze - Strength HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;Dual demosaic - Auto threshold HISTORY_MSG_DUALDEMOSAIC_CONTRAST;Dual demosaic - Contrast threshold -HISTORY_MSG_EDGEFFECT;Edge Attenuation Response +HISTORY_MSG_EDGEFFECT;Edge Attenuation response HISTORY_MSG_FILMNEGATIVE_ENABLED;Film Negative HISTORY_MSG_FILMNEGATIVE_FILMBASE;Film base color HISTORY_MSG_FILMNEGATIVE_VALUES;Film negative values @@ -1270,10 +1273,10 @@ HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace -HISTORY_MSG_SIGMACOL;Chroma Attenuation Response -HISTORY_MSG_SIGMADIR;Dir Attenuation Response -HISTORY_MSG_SIGMAFIN;Final contrast Attenuation Response -HISTORY_MSG_SIGMATON;Toning Attenuation Response +HISTORY_MSG_SIGMACOL;Chroma Attenuation response +HISTORY_MSG_SIGMADIR;Dir Attenuation response +HISTORY_MSG_SIGMAFIN;Final contrast Attenuation response +HISTORY_MSG_SIGMATON;Toning Attenuation response HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light HISTORY_MSG_SOFTLIGHT_STRENGTH;Soft light - Strength HISTORY_MSG_TEMPOUT;CAM02 automatic temperature @@ -1292,10 +1295,10 @@ HISTORY_MSG_WAVMERGEC;Merge C HISTORY_MSG_WAVMERGEL;Merge L HISTORY_MSG_WAVOFFSET;Offset HISTORY_MSG_WAVOLDSH;Old algorithm -HISTORY_MSG_WAVRADIUS;Radius Shadows-Highlight +HISTORY_MSG_WAVRADIUS;Radius shadows-highlights HISTORY_MSG_WAVSCALE;Scale HISTORY_MSG_WAVSHOWMASK;Show wavelet mask -HISTORY_MSG_WAVSIGMA;Attenuation Response +HISTORY_MSG_WAVSIGMA;Attenuation response HISTORY_MSG_WAVSOFTRAD;Soft radius clarity HISTORY_MSG_WAVSOFTRADEND;Soft radius final HISTORY_MSG_WAVUSHAMET;Clarity method @@ -1602,8 +1605,9 @@ PREFERENCES_CLUTSCACHE_LABEL;Maximum number of cached CLUTs PREFERENCES_CLUTSDIR;HaldCLUT directory PREFERENCES_CMMBPC;Black point compensation PREFERENCES_COMPLEXITYLOC;Default complexity for Local Adjustments -PREFERENCES_COMPLEXITY_EXP;Expert -PREFERENCES_COMPLEXITY_NORM;Normal +PREFERENCES_COMPLEXITY_EXP;Advanced +PREFERENCES_COMPLEXITY_NORM;Standard +PREFERENCES_COMPLEXITY_SIMP;Basic PREFERENCES_INSPECTORWINDOW;Open inspector in own window or fullscreen PREFERENCES_ZOOMONSCROLL;Zoom images by scrolling PREFERENCES_CROP;Crop Editing @@ -2364,7 +2368,7 @@ TP_LOCALLAB_BLMETHOD_TOOLTIP;Normal - direct blur and noise with all settings.\n TP_LOCALLAB_BLNOI_EXP;Blur & Noise TP_LOCALLAB_BLNORM;Normal TP_LOCALLAB_BLSYM;Symmetric -TP_LOCALLAB_BLUFR;Smooth - Blur - Grain - Denoise +TP_LOCALLAB_BLUFR;Blur - Grain & Denoise TP_LOCALLAB_BLUMETHOD_TOOLTIP;To blur the background and isolate the foreground:\n*Blur the background by a RT-spot fully covering the image (high values for scope and transition) - normal or inverse.\n*Isolate the foreground by one or more excluding RT-spot with the tools you want (increse scope).\n\nThis module can be used in additional noise reduction,including "median" and "Guided filter" TP_LOCALLAB_BLUR;Gaussian Blur - Noise - Grain TP_LOCALLAB_BLURCBDL;Blur levels 0-1-2-3-4 @@ -2374,7 +2378,7 @@ TP_LOCALLAB_BLURLC;Luminance Only TP_LOCALLAB_BLURLEVELFRA;Blur Levels TP_LOCALLAB_BLURMASK_TOOLTIP;Generate a blur mask, take into account the structure with the contrast threshold Mask Blur slider. TP_LOCALLAB_BLURRESIDFRA;Blur Residual -TP_LOCALLAB_BLUR_TOOLNAME;Smooth Blur Gain & Denoise - 1 +TP_LOCALLAB_BLUR_TOOLNAME;Blur Grain & Denoise - 1 TP_LOCALLAB_BLWH;All changes forced in Black and White TP_LOCALLAB_BLWH_TOOLTIP;Force color change composante "a" and "b" to zero.\nUsefull when the user chooses black and white processes, or film. TP_LOCALLAB_BUTTON_ADD;Add @@ -2386,7 +2390,7 @@ TP_LOCALLAB_CBDL;Contrast by detail levels TP_LOCALLAB_CBDLCLARI_TOOLTIP;Takes the midtones and enhance them. TP_LOCALLAB_CBDL_ADJ_TOOLTIP;Acts as a wavelet tools.\nThe first level (0) acts on 2x2 details.\nThe last level (5) acts on 64x64 details. TP_LOCALLAB_CBDL_THRES_TOOLTIP;Prevent the sharpening of noise -TP_LOCALLAB_CBDL_TOOLNAME;CBDL (Defects) - 2 +TP_LOCALLAB_CBDL_TOOLNAME;CBDL - 2 TP_LOCALLAB_CENTER_X;Center X TP_LOCALLAB_CENTER_Y;Center Y TP_LOCALLAB_CH;Curves CL - LC @@ -2415,7 +2419,7 @@ TP_LOCALLAB_COLORDEPREV_TOOLTIP;Button Preview ΔE needs that only one tool is e TP_LOCALLAB_COLORDE_TOOLTIP;Show preview selection ΔE in blue if negative and in green if positive.\n\nMask and modifications (show modifications without mask): show real modifications if positive, show enhanced modifications (only luminance) with blue and yellow if negative. TP_LOCALLAB_COLORSCOPE;Scope Color Tools TP_LOCALLAB_COLORSCOPE_TOOLTIP;Use a common Scope for Color and light, Shadows highlight, Vibrance.\nOthers tools have their specific scope. -TP_LOCALLAB_COLOR_TOOLNAME;Color&Light (Defects) - 11 +TP_LOCALLAB_COLOR_TOOLNAME;Color & Light - 11 TP_LOCALLAB_COL_NAME;Name TP_LOCALLAB_COL_VIS;Status TP_LOCALLAB_COMPFRA;Levels Directional Contrast @@ -2505,13 +2509,13 @@ TP_LOCALLAB_EXPMERGEFILE_TOOLTIP;Allows various possibilities to blend image (as TP_LOCALLAB_EXPMETHOD_TOOLTIP;Standard : use an algorithm similar as main Exposure but in L*a*b* and taking account of deltaE.\n\nContrast attenuator : use another algorithm also with deltaE and with Poisson equation to solve Laplacian in Fourier space.\nContrast attenuator, Dynamic range compression and Standard can be combined.\nFFTW Fourier Transform is optimized in size to reduce processing time.\nReduce artifacts and noise. TP_LOCALLAB_EXPNOISEMETHOD_TOOLTIP;Apply a median before Laplace transform to prevent artifacts (noise).\nYou can also use "Denoise" tool. TP_LOCALLAB_EXPOSE;Dynamic Range Compr. & Exposure -//TP_LOCALLAB_EXPOSURE_TOOLTIP;In some cases (strong shadows ..) you can use others modules "Shadows Highlights", "Tone equalizer", "TRC", "Encoding Log"... +//TP_LOCALLAB_EXPOSURE_TOOLTIP;In some cases (strong shadows ..) you can use others modules "Shadows Highlights", "Tone equalizer", "TRC", "Log Encoding"... TP_LOCALLAB_EXPOSURE_TOOLTIP;Modify exposure in L*a*b space using Laplacian PDE algorithms to take into account dE and minimize artifacts. TP_LOCALLAB_EXPRETITOOLS;Advanced Retinex Tools TP_LOCALLAB_EXPSHARP_TOOLTIP;RT-Spot minimum 39*39.\nUse low transition values and high decay transition values and scope to simulate small RT-spot. TP_LOCALLAB_EXPTOOL;Tools exposure TP_LOCALLAB_EXPTRC;Tone Response Curve - TRC -TP_LOCALLAB_EXP_TOOLNAME;Contrast attenuator -Dynamic Range Compression & Exposure- 10 +TP_LOCALLAB_EXP_TOOLNAME;Contrast Attenuator -Dynamic Range Compression & Exposure- 10 TP_LOCALLAB_FATAMOUNT;Amount TP_LOCALLAB_FATANCHOR;Anchor TP_LOCALLAB_FATANCHORA;Offset @@ -2536,7 +2540,7 @@ TP_LOCALLAB_GAMSH;Gamma TP_LOCALLAB_GRADANG;Gradient angle TP_LOCALLAB_GRADANG_TOOLTIP;Rotation angle in degrees : -180 0 +180 TP_LOCALLAB_GRADFRA;Graduated Filter Mask -TP_LOCALLAB_GRADGEN_TOOLTIP;Graduated filter is supplied with Color and Light & merge file, Exposure & mask, Shadows Highlight, Vibrance, Encoding log.\n\nVibrance, Color and Light & merge file, are provided with GF luminance, chrominance, Hue.\nFeather is located in settings. +TP_LOCALLAB_GRADGEN_TOOLTIP;Graduated filter is supplied with Color and Light & merge file, Exposure & mask, Shadows Highlight, Vibrance, Log Encoding.\n\nVibrance, Color and Light & merge file, are provided with GF luminance, chrominance, Hue.\nFeather is located in settings. TP_LOCALLAB_GRADLOGFRA;Graduated Filter Luminance TP_LOCALLAB_GRADSTR;Gradient strength TP_LOCALLAB_GRADSTRAB_TOOLTIP;Filter chroma strength @@ -2569,13 +2573,13 @@ TP_LOCALLAB_LABGRIDMERG;Background TP_LOCALLAB_LABGRID_VALUES;High(a)=%1 High(b)=%2\nLow(a)=%3 Low(b)=%4 TP_LOCALLAB_LABSTRUM;Mask Structure TP_LOCALLAB_LAPLACC;ΔØ Mask Laplacian solve PDE -TP_LOCALLAB_LAPLACE;Δ - Laplacian threshold ΔE -TP_LOCALLAB_LAPLACEXP;∆ - Laplacian threshold -TP_LOCALLAB_LAPMASKCOL;∆ - Laplacian threshold mask -TP_LOCALLAB_LAPRAD_TOOLTIP;Avoid using Radius and Laplace Threshold (expert) simultaneously.\nLaplacian threshold reduce contrast, artifacts, smooth result. +TP_LOCALLAB_LAPLACE;Laplacian threshold ΔE +TP_LOCALLAB_LAPLACEXP;Laplacian threshold +TP_LOCALLAB_LAPMASKCOL;Laplacian threshold mask +TP_LOCALLAB_LAPRAD_TOOLTIP;Avoid using Radius and Laplace Threshold (advanced) simultaneously.\nLaplacian threshold reduce contrast, artifacts, smooth result. TP_LOCALLAB_LAP_MASK_TOOLTIP;Solve PDE for all Laplacian masks.\nIf enabled Laplacian threshold mask reduce artifacts and smooth result.\nIf disabled linear response. TP_LOCALLAB_LC_FFTW_TOOLTIP;FFT improve quality and allow big radius, but increases the treatment time.\nThe treatment time depends on the surface to be treated.\nTo be used preferably for large radius.\n\nDimensions can be reduced by a few pixels to optimize FFTW.\nThis optimization can reduce the treatment time by a factor of 1.5 to 10.\n -TP_LOCALLAB_LC_TOOLNAME;Local Constrast & Wavelet (Defects) - 7 +TP_LOCALLAB_LC_TOOLNAME;Local Contrast & Wavelets - 7 TP_LOCALLAB_LEVELBLUR;Maximum Blur levels TP_LOCALLAB_LEVELLOCCONTRAST_TOOLTIP;On the abscissa local contrast (near concept luminance). On the ordinate, amplification or reduction local contrast. TP_LOCALLAB_LEVELWAV;Ψ Wavelets Levels @@ -2586,17 +2590,17 @@ TP_LOCALLAB_LIGHTN_TOOLTIP;In inverse mode: selection = -100 force luminance to TP_LOCALLAB_LIGHTRETI;Lightness TP_LOCALLAB_LINEAR;Linearity TP_LOCALLAB_LIST_NAME;Add tool to current spot... -TP_LOCALLAB_LIST_TOOLTIP;Choose a tool and then its level of complexity "Normal" or "Expert".\nThe number reflects the place of the tool in the process of each RT-Spot +TP_LOCALLAB_LIST_TOOLTIP;You can select 3 levels of complexity for each tool: Basic, Standard & Advanced.\nThe default setting for all tools is Basic but this can be changed in the Preferences window.\nYou can also change the level of complexity on a per-tool basis while you are editing TP_LOCALLAB_LMASK_LEVEL_TOOLTIP;Give priority to action on midtones and high lights and by choosing the concerned wavelet levels TP_LOCALLAB_LMASK_LL_TOOLTIP;Give priority to action on midtones and high lights TP_LOCALLAB_LOCCONT;Unsharp Mask -TP_LOCALLAB_LOC_CONTRAST;Local contrast -Wavelet-defects +TP_LOCALLAB_LOC_CONTRAST;Local contrast & Wavelets TP_LOCALLAB_LOC_CONTRASTPYR;Ψ Pyramid 1: TP_LOCALLAB_LOC_CONTRASTPYR2;Ψ Pyramid 2: TP_LOCALLAB_LOC_CONTRASTPYR2LAB;Contrast by Levels- Tone Mapping - Dir.Contrast TP_LOCALLAB_LOC_CONTRASTPYRLAB;Graduated Filter - Edge Sharpness - Blur -TP_LOCALLAB_LOC_RESIDPYR;Residual Image Main -TP_LOCALLAB_LOG;Encoding log +TP_LOCALLAB_LOC_RESIDPYR;Residual Image (Main) +TP_LOCALLAB_LOG;Log Encoding TP_LOCALLAB_LOGAUTO;Automatic TP_LOCALLAB_LOGAUTO_TOOLTIP;Pressing this button will bring an evaluation of dynamic range and Source Gray point (if "Automatic" Source gray enabled).\nTo be able to touch up the automatic values, press the button again TP_LOCALLAB_LOGBASE_TOOLTIP;Default = 2.\nValues less than 2 reduce the action of the algorithm, the shadows are darker, the highlights are brighter.\nValues greater than 2 change the action of the algorithm, the shadows are grayer the highlights are more washed out @@ -2608,7 +2612,7 @@ TP_LOCALLAB_LOGLIN;Logarithm mode TP_LOCALLAB_LOGPFRA;Relative Exposure Levels TP_LOCALLAB_LOGSRCGREY_TOOLTIP;Estimated gray point value of the image, early in the process TP_LOCALLAB_LOGTARGGREY_TOOLTIP;You can change this value to adapt it to your taste. -TP_LOCALLAB_LOG_TOOLNAME;Encoding log - 0 +TP_LOCALLAB_LOG_TOOLNAME;Log Encoding - 0 TP_LOCALLAB_LUM;Curves LL - CC TP_LOCALLAB_LUMADARKEST;Darkest TP_LOCALLAB_LUMASK;Luminance Background Mask @@ -2617,7 +2621,8 @@ TP_LOCALLAB_LUMAWHITESEST;Whiteest TP_LOCALLAB_LUMFRA;L*a*b* standard TP_LOCALLAB_LUMONLY;Luminance only TP_LOCALLAB_MASKCOM;Common Color Mask -TP_LOCALLAB_MASKCOM_TOOLTIP;These masks works as all tools, they take into account scope color.\nThey are different from others masks which complete a tool (Color and Light, Exposure...) +TP_LOCALLAB_MASKCOM_TOOLTIP;A tool in its own right.\nCan be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope. +//These masks works as all tools, they take into account scope color.\nThey are different from others masks which complete a tool (Color and Light, Exposure...) TP_LOCALLAB_MASFRAME;Mask and Merge TP_LOCALLAB_MASFRAME_TOOLTIP;For all masks.\nTake into account deltaE image to avoid retouching the selection area when sliders gamma mask, slope mask, chroma mask and curves contrast , levels contrasts, and mask blur, structure(if enabled tool) are used.\nDisabled in Inverse TP_LOCALLAB_MASK;Mask @@ -2666,8 +2671,9 @@ TP_LOCALLAB_MERTWO;Substract TP_LOCALLAB_METHOD_TOOLTIP;'Enhanced + chroma denoise' significantly increases processing times.\nBut reduce artifacts. TP_LOCALLAB_MLABEL;Restored datas Min=%1 Max=%2 (Clip - Offset) TP_LOCALLAB_MLABEL_TOOLTIP;'Should be' near min=0 max=32768 (log mode) but others values are possible.\nYou can act on Clip Restored datas and Offset to normalize.\n\nRestored image with no mixture. -TP_LOCALLAB_MODE_EXPERT;Expert -TP_LOCALLAB_MODE_NORMAL;Normal +TP_LOCALLAB_MODE_EXPERT;Advanced +TP_LOCALLAB_MODE_NORMAL;Standard +TP_LOCALLAB_MODE_SIMPLE;Basic TP_LOCALLAB_MRFIV;Background TP_LOCALLAB_MRFOU;Previous Spot TP_LOCALLAB_MRONE;None @@ -2695,12 +2701,12 @@ TP_LOCALLAB_ORIGLC;Merge only with original image TP_LOCALLAB_ORRETILAP_TOOLTIP;Acts on a second Laplacian threshold, to take into account ΔE to differentiate the action especially with the background (different from Scope) TP_LOCALLAB_ORRETISTREN_TOOLTIP;Acts on the Laplacian threshold, the greater the action, the more the differences in contrast will be reduced TP_LOCALLAB_PASTELS2;Vibrance -TP_LOCALLAB_PDE;Contrast attenuator - Dynamic Range compression -TP_LOCALLAB_PDEFRA;Contrast attenuator ƒ +TP_LOCALLAB_PDE;Contrast Attenuator - Dynamic Range compression +TP_LOCALLAB_PDEFRA;Contrast Attenuator ƒ TP_LOCALLAB_PDEFRAME_TOOLTIP;PDE IPOL - personal algorithm adapted from IPOL to Rawtherapee: lead to very different results and needs differents settings that Standard (negative black, gamma < 1,...)\nMay be usefull for low exposure or high dynamic range.\n TP_LOCALLAB_PREVIEW;Preview ΔE -TP_LOCALLAB_PREVHIDE;Hide all settings -TP_LOCALLAB_PREVSHOW;Show all settings +TP_LOCALLAB_PREVHIDE;Hide additional settings +TP_LOCALLAB_PREVSHOW;Show additional settings TP_LOCALLAB_PROXI;ΔE decay TP_LOCALLAB_QUALCURV_METHOD;Curves type TP_LOCALLAB_QUAL_METHOD;Global quality @@ -2723,7 +2729,7 @@ TP_LOCALLAB_RESIDHI;Highlights TP_LOCALLAB_RESIDHITHR;Highlights threshold TP_LOCALLAB_RESIDSHA;Shadows TP_LOCALLAB_RESIDSHATHR;Shadows threshold -TP_LOCALLAB_RETI;Dehaze - Retinex Strong contrast +TP_LOCALLAB_RETI;Dehaze - Retinex TP_LOCALLAB_RETIFRA;Retinex TP_LOCALLAB_RETIM;Original Retinex TP_LOCALLAB_RETITOOLFRA;Retinex Tools @@ -2763,8 +2769,9 @@ TP_LOCALLAB_SH1;Shadows Highlights TP_LOCALLAB_SH2;Equalizer TP_LOCALLAB_SHADEX;Shadows TP_LOCALLAB_SHADEXCOMP;Shadows compression & tonal width -TP_LOCALLAB_SHADHIGH;ShadowsHighlight - Tone equalizer -TP_LOCALLAB_SHADOWHIGHLIGHT_TOOLTIP;Can be used instead - or in complement - of exposure module in difficult cases.\nThe use of Denoise may be necessary : lightening the shadows.\n\nCan be used as graduated filter (increase Scope) +TP_LOCALLAB_SHADHIGH;Shadows/Highlights-Tone equalizer +TP_LOCALLAB_SHADOWHIGHLIGHT_TOOLTIP;Adjust shadows & 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. +//Can be used instead - or in complement - of exposure module in difficult cases.\nThe use of Denoise may be necessary : lightening the shadows.\n\nCan be used as graduated filter (increase Scope) TP_LOCALLAB_SHAMASKCOL;Shadows mask TP_LOCALLAB_SHAPETYPE;Shape RT-spot area TP_LOCALLAB_SHAPE_TOOLTIP;Elipse is normal mode.\nRectangle can be used in some cases, for example to work in full image in conjonction with delimiters outside preview, transition = 100.\n\nPolygone - Beziers are waiting for GUI... @@ -2802,13 +2809,13 @@ TP_LOCALLAB_SHOWPOISSON;Poisson (pde ƒ) TP_LOCALLAB_SHOWR;Mask and modifications TP_LOCALLAB_SHOWREF;Preview ΔE TP_LOCALLAB_SHOWS;Mask and modifications -TP_LOCALLAB_SHOWSTRUC;Show structure Spot(expert) -TP_LOCALLAB_SHOWSTRUCEX;Show structure Spot(expert) +TP_LOCALLAB_SHOWSTRUC;Show structure Spot(advanced) +TP_LOCALLAB_SHOWSTRUCEX;Show structure Spot(advanced) TP_LOCALLAB_SHOWT;Mask and modifications TP_LOCALLAB_SHOWVI;Mask and modifications TP_LOCALLAB_SHRESFRA;Shadows/Highlights TP_LOCALLAB_SHTRC_TOOLTIP;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 -TP_LOCALLAB_SH_TOOLNAME;Shadows Highlight & Tone Equalizer - 5 +TP_LOCALLAB_SH_TOOLNAME;Shadows Highlights & Tone Equalizer - 5 TP_LOCALLAB_SIGMAWAV;Attenuation Response TP_LOCALLAB_SIM;Simple TP_LOCALLAB_SLOMASKCOL;Slope mask @@ -2822,7 +2829,7 @@ TP_LOCALLAB_SOFTRETI;Reduce artifact ΔE TP_LOCALLAB_SOFTRETI_TOOLTIP;Take into account deltaE to improve Transmission map TP_LOCALLAB_SOFT_TOOLNAME;Soft Light & Original Retinex - 6 TP_LOCALLAB_SOURCE_GRAY;Value -TP_LOCALLAB_SPECCASE; Specific cases +TP_LOCALLAB_SPECCASE;Specific cases TP_LOCALLAB_SPECIAL;Special use of RGB curves TP_LOCALLAB_SPECIAL_TOOLTIP;Only for this RGB curve, disabled (or reduce effects) of Scope, mask...for example, if you want to have a negative effect. TP_LOCALLAB_SPOTNAME;New Spot @@ -2838,7 +2845,7 @@ TP_LOCALLAB_STRRETI_TOOLTIP;if Strength Retinex < 0.2 only Dehaze is enabled.\ni TP_LOCALLAB_STRUC;Structure TP_LOCALLAB_STRUCCOL;Structure TP_LOCALLAB_STRUCCOL1;Structure Spot -TP_LOCALLAB_STRUCT_TOOLTIP;Use Sobel algorithm to take into account structure in shape detection.\nyou can have a preview by activating "mask and modifications - Show structure spot".\n\nCan be used in conjunction with masks (expert) structure, blur, wavelet to improve edge detection.\n\nNeeds maskless adjustments to be activated (lightness, exposure...) +TP_LOCALLAB_STRUCT_TOOLTIP;Use Sobel algorithm to take into account structure in shape detection.\nyou can have a preview by activating "mask and modifications - Show structure spot".\n\nCan be used in conjunction with masks (advanced) structure, blur, wavelet to improve edge detection.\n\nNeeds maskless adjustments to be activated (lightness, exposure...) TP_LOCALLAB_STRUMASKCOL;Structure mask strength TP_LOCALLAB_STRUMASK_TOOLTIP;Generate a structure mask with difference between surface areas and reliefs.\nIf structure mask as tool is enabled, this mask is used in addition to the other tools (gamma, slope, contrast curve ...) TP_LOCALLAB_STYPE;Shape method @@ -2858,7 +2865,8 @@ TP_LOCALLAB_TM_MASK;Use transmission map TP_LOCALLAB_TONEMAPESTOP_TOOLTIP;This parameter affects sensitivity to edges.\n The greater it is the more likely an illumination change is to be considered an "edge".\n If set to zero tone mapping will have an effect similar to unsharp masking. TP_LOCALLAB_TONEMAPGAM_TOOLTIP;Gamma moves the action of tone-mapping to shadows or highlights. TP_LOCALLAB_TONEMAPREWEI_TOOLTIP;In some cases tone mapping may result in a cartoonish appearance, and in some rare cases soft but wide halos may appear.\n Increasing the number of reweighting iterates will help fight some of these problems. -TP_LOCALLAB_TONEMAP_TOOLTIP;Tone Mapping - main menu must be disabled +TP_LOCALLAB_TONEMAP_TOOLTIP;Same as the tone mapping tool in the main menu.\nThe main menu tool must be de-activated if this tool is used. +//Tone Mapping - main menu must be disabled TP_LOCALLAB_TONEMASCALE_TOOLTIP;This control gives meaning to the difference between "local" and "global" contrast.\nThe greater it is the larger a detail needs to be in order to be boosted TP_LOCALLAB_TONE_TOOLNAME;Tone Mapping - 4 TP_LOCALLAB_TOOLCOL;Structure mask as tool @@ -2876,15 +2884,16 @@ TP_LOCALLAB_TRANSMISSION_TOOLTIP;Transmission according to transmission.\nAbscis TP_LOCALLAB_USEMASK;Use mask TP_LOCALLAB_VART;Variance (contrast) TP_LOCALLAB_VIBRANCE;Vibrance - Warm & Cool +TP_LOCALLAB_VIBRA_TOOLTIP;Adjust vibrance (essentially the same as the global adjustment).\nCarry out the equivalent of a white-balance adjustment using a CIECAM algorithm. TP_LOCALLAB_VIB_TOOLNAME;Vibrance - Warm & Cool - 3 TP_LOCALLAB_SOFT_TOOLNAME;Soft Light & Original Retinex - 6 -TP_LOCALLAB_BLUR_TOOLNAME;Smooth Blur Gain & Denoise - 1 +TP_LOCALLAB_BLUR_TOOLNAME;Smooth Blur Grain & Denoise - 1 TP_LOCALLAB_TONE_TOOLNAME;Tone Mapping - 4 TP_LOCALLAB_RET_TOOLNAME;Dehaze & Retinex - 9 TP_LOCALLAB_SHARP_TOOLNAME;Sharpening - 8 -TP_LOCALLAB_LC_TOOLNAME;Local Constrast & Wavelet (Defects) - 7 -TP_LOCALLAB_CBDL_TOOLNAME;CBDL (Defects) - 2 -TP_LOCALLAB_LOG_TOOLNAME;Encoding log - 0 +TP_LOCALLAB_LC_TOOLNAME;Local Contrast & Wavelet - 7 +TP_LOCALLAB_CBDL_TOOLNAME;CBDL - 2 +TP_LOCALLAB_LOG_TOOLNAME;Log Encoding - 0 TP_LOCALLAB_MASKCOM_TOOLNAME;Common Color Mask - 13 TP_LOCALLAB_VIS_TOOLTIP;Click to show/hide selected Control Spot.\nCtrl+click to show/hide all Control Spot. TP_LOCALLAB_WAMASKCOL;Ψ Mask Wavelet level @@ -3239,18 +3248,18 @@ TP_WAVELET_6;Level 6 TP_WAVELET_7;Level 7 TP_WAVELET_8;Level 8 TP_WAVELET_9;Level 9 -TP_WAVELET_APPLYTO;Apply To +TP_WAVELET_APPLYTO;Apply to TP_WAVELET_AVOID;Avoid color shift TP_WAVELET_B0;Black -TP_WAVELET_B1;Grey +TP_WAVELET_B1;Gray TP_WAVELET_B2;Residual TP_WAVELET_BACKGROUND;Background TP_WAVELET_BACUR;Curve TP_WAVELET_BALANCE;Contrast balance d/v-h TP_WAVELET_BALANCE_TOOLTIP;Alters the balance between the wavelet directions: vertical-horizontal and diagonal.\nIf contrast, chroma or residual tone mapping are activated, the effect due to balance is amplified. -TP_WAVELET_BALCHRO;Chrominance balance -TP_WAVELET_BALCHROM;Denoise Equalizer Blue-yellow Red-green +TP_WAVELET_BALANCE_TOOLTIP;Alters the balance between the vertical, horizontal and diagonal wavelet directions: .\nActivating contrast, chroma or residual tone mapping amplifies the effect due to balance TP_WAVELET_BALCHRO_TOOLTIP;If enabled, the 'Contrast balance' curve or slider also modifies chroma balance. +TP_WAVELET_BALCHROM;Denoise equalizer blue-yellow red-green TP_WAVELET_BALLUM;Denoise Equalizer White-Black TP_WAVELET_BANONE;None TP_WAVELET_BASLI;Slider @@ -3258,9 +3267,9 @@ TP_WAVELET_BATYPE;Contrast balance method TP_WAVELET_BL;Blur levels TP_WAVELET_BLCURVE;Blur by levels TP_WAVELET_BLURFRAME;Blur -TP_WAVELET_BLUWAV;Attenuation Response -TP_WAVELET_CBENAB;Toning and Color Balance -TP_WAVELET_CB_TOOLTIP;For strong values product color-toning by combining it or not with levels decomposition 'toning'\nFor low values you can change the white balance of the background (sky, ...) without changing that of the front plane, generally more contrasted +TP_WAVELET_BLUWAV;Attenuation response +TP_WAVELET_CBENAB;Toning and Color balance +TP_WAVELET_CB_TOOLTIP;With high values you can create special effects, similar to those achieved with the Chroma Module, but focused on the residual image\nWith moderate values you can manually correct the white balance TP_WAVELET_CCURVE;Local contrast TP_WAVELET_CH1;Whole chroma range TP_WAVELET_CH2;Saturated/pastel @@ -3268,7 +3277,7 @@ TP_WAVELET_CH3;Link contrast levels TP_WAVELET_CHCU;Curve TP_WAVELET_CHR;Chroma-contrast link strength TP_WAVELET_CHRO;Saturated/pastel threshold -TP_WAVELET_CHROFRAME;Denoise Chrominance +TP_WAVELET_CHROFRAME;Denoise chrominance TP_WAVELET_CHROMAFRAME;Chroma TP_WAVELET_CHROMCO;Chrominance Coarse TP_WAVELET_CHROMFI;Chrominance Fine @@ -3279,10 +3288,14 @@ TP_WAVELET_CHSL;Sliders TP_WAVELET_CHTYPE;Chrominance method TP_WAVELET_CLA;Clarity TP_WAVELET_CLARI;Sharp-mask and Clarity -TP_WAVELET_COLORT;Opacity Red-Green +TP_WAVELET_COLORT;Opacity red-green TP_WAVELET_COMPCONT;Contrast TP_WAVELET_COMPGAMMA;Compression gamma TP_WAVELET_COMPGAMMA_TOOLTIP;Adjusting the gamma of the residual image allows you to equilibrate the data and histogram. +TP_WAVELET_COMPLEXLAB;Complexity +TP_WAVELET_COMPLEX_TOOLTIP;Standard: shows a reduced set of tools suitable for most processing operations.\nAdvanced: shows the complete set of tools for advanced processing operations +TP_WAVELET_COMPNORMAL;Standard +TP_WAVELET_COMPEXPERT;Advanced TP_WAVELET_COMPTM;Tone mapping TP_WAVELET_CONTEDIT;'After' contrast curve TP_WAVELET_CONTFRAME;Contrast - Compression @@ -3291,16 +3304,16 @@ TP_WAVELET_CONTRA;Contrast TP_WAVELET_CONTRASTEDIT;Finer - Coarser levels TP_WAVELET_CONTRAST_MINUS;Contrast - TP_WAVELET_CONTRAST_PLUS;Contrast + -TP_WAVELET_CONTRA_TOOLTIP;Changes contrast of the residual image. +TP_WAVELET_CONTRA_TOOLTIP;Changes the residual image contrast. TP_WAVELET_CTYPE;Chrominance control TP_WAVELET_CURVEEDITOR_BL_TOOLTIP;Disabled if zoom > about 300% TP_WAVELET_CURVEEDITOR_CC_TOOLTIP;Modifies local contrast as a function of the original local contrast (abscissa).\nLow abscissa values represent small local contrast (real values about 10..20).\n50% abscissa represents average local contrast (real value about 100..300).\n66% abscissa represents standard deviation of local contrast (real value about 300..800).\n100% abscissa represents maximum local contrast (real value about 3000..8000). TP_WAVELET_CURVEEDITOR_CH;Contrast levels=f(Hue) TP_WAVELET_CURVEEDITOR_CH_TOOLTIP;Modifies each level's contrast as a function of hue.\nTake care not to overwrite changes made with the Gamut sub-tool's hue controls.\nThe curve will only have an effect when wavelet contrast level sliders are non-zero. TP_WAVELET_CURVEEDITOR_CL;L -TP_WAVELET_CURVEEDITOR_CL_TOOLTIP;Applies a final contrast luminance curve at the end of the wavelet treatment. +TP_WAVELET_CURVEEDITOR_CL_TOOLTIP;Applies a final contrast-luminance curve at the end of the wavelet processing. TP_WAVELET_CURVEEDITOR_HH;HH -TP_WAVELET_CURVEEDITOR_HH_TOOLTIP;Modifies the residual image's hue as a function of hue. +TP_WAVELET_CURVEEDITOR_HH_TOOLTIP;Modifies the residual image hue as a function of hue. TP_WAVELET_DALL;All directions TP_WAVELET_DAUB;Edge performance TP_WAVELET_DAUB2;D2 - low @@ -3309,34 +3322,34 @@ TP_WAVELET_DAUB6;D6 - standard plus TP_WAVELET_DAUB10;D10 - medium TP_WAVELET_DAUB14;D14 - high TP_WAVELET_DAUBLOCAL;Wavelet Edge performance -TP_WAVELET_DAUB_TOOLTIP;Changes Daubechies coefficients:\nD4 = Standard,\nD14 = Often best performance, 10% more time-intensive.\n\nAffects edge detection as well as the general quality of the firsts levels. However the quality is not strictly related to this coefficient and can vary with images and uses. +TP_WAVELET_DAUB_TOOLTIP;Changes Daubechies coefficients:\nD4 = Standard,\nD14 = Often best performance, 10% more time-intensive.\n\nAffects edge detection as well as the general quality of the first levels. However the quality is not strictly related to this coefficient and can vary depending on image and use. TP_WAVELET_DIRFRAME;Directional contrast TP_WAVELET_DONE;Vertical TP_WAVELET_DTHR;Diagonal TP_WAVELET_DTWO;Horizontal TP_WAVELET_EDCU;Curve -TP_WAVELET_EDEFFECT;Attenuation Response -TP_WAVELET_EDEFFECT_TOOLTIP;This slider controls how wide the range of contrast values are that receive the maximum effect from the tool.\nMaximum value (2.5) disabled the tool +TP_WAVELET_EDEFFECT;Attenuation response +TP_WAVELET_EDEFFECT_TOOLTIP;This slider selects the range of contrast values that will receive the full effect of any adjustment TP_WAVELET_EDGCONT;Local contrast -TP_WAVELET_EDGCONT_TOOLTIP;Adjusting the points to the left decreases contrast, and to the right increases it.\nBottom-left, top-left, top-right and bottom-right represent respectively local contrast for low values, mean, mean+stdev and maxima. +TP_WAVELET_EDGCONT_TOOLTIP;Adjusting the points to the left decreases contrast, and to the right increases it.\nBottom-left, top-left, top-right and bottom-right represent respectively local contrast for low values, mean, mean+std. dev. and maxima. TP_WAVELET_EDGE;Edge Sharpness TP_WAVELET_EDGEAMPLI;Base amplification TP_WAVELET_EDGEDETECT;Gradient sensitivity TP_WAVELET_EDGEDETECTTHR;Threshold low (noise) -TP_WAVELET_EDGEDETECTTHR2;Threshold high (detection) -TP_WAVELET_EDGEDETECTTHR_TOOLTIP;This adjuster lets you target edge detection for example to avoid applying edge sharpness to fine details, such as noise in the sky. +TP_WAVELET_EDGEDETECTTHR2;Edge enhancement +TP_WAVELET_EDGEDETECTTHR_TOOLTIP;This slider sets a threshold below which finer details won't be considered as an edge TP_WAVELET_EDGEDETECT_TOOLTIP;Moving the slider to the right increases edge sensitivity. This affects local contrast, edge settings and noise. TP_WAVELET_EDGESENSI;Edge sensitivity TP_WAVELET_EDGREINF_TOOLTIP;Reinforce or reduce the action of the first level, do the opposite to the second level, and leave the rest unchanged. TP_WAVELET_EDGTHRESH;Detail TP_WAVELET_EDGTHRESH_TOOLTIP;Change the repartition between the first levels and the others. The higher the threshold the more the action is centered on the first levels. Be careful with negative values, they increase the action of high levels and can introduce artifacts. TP_WAVELET_EDRAD;Radius -TP_WAVELET_EDRAD_TOOLTIP;This radius adjustment is very different from those in other sharpening tools. Its value is compared to each level through a complex function. In this sense, a value of zero still has an effect. -TP_WAVELET_EDSL;Threshold Sliders +TP_WAVELET_EDRAD_TOOLTIP;This adjustment controls the local enhancement. A value of zero still has an effect +TP_WAVELET_EDSL;Threshold sliders TP_WAVELET_EDTYPE;Local contrast method TP_WAVELET_EDVAL;Strength TP_WAVELET_FINAL;Final Touchup -TP_WAVELET_FINCFRAME;Final Local Contrast +TP_WAVELET_FINCFRAME;Final local contrast TP_WAVELET_FINCOAR_TOOLTIP;The left (positive) part of the curve acts on the finer levels (increase).\nThe 2 points on the abscissa represent the respective action limits of finer and coarser levels 5 and 6 (default).\nThe right (negative) part of the curve acts on the coarser levels (increase).\nAvoid moving the left part of the curve with negative values. Avoid moving the right part of the curve with positives values TP_WAVELET_FINEST;Finest TP_WAVELET_HIGHLIGHT;Finer levels luminance range @@ -3344,7 +3357,7 @@ TP_WAVELET_HS1;Whole luminance range TP_WAVELET_HS2;Selective luminance range TP_WAVELET_HUESKIN;Skin hue TP_WAVELET_HUESKIN_TOOLTIP;The bottom points set the beginning of the transition zone, and the upper points the end of it, where the effect is at its maximum.\n\nIf you need to move the area significantly, or if there are artifacts, then the white balance is incorrect. -TP_WAVELET_HUESKY;Sky hue +TP_WAVELET_HUESKY;Hue range TP_WAVELET_HUESKY_TOOLTIP;The bottom points set the beginning of the transition zone, and the upper points the end of it, where the effect is at its maximum.\n\nIf you need to move the area significantly, or if there are artifacts, then the white balance is incorrect. TP_WAVELET_ITER;Delta balance levels TP_WAVELET_ITER_TOOLTIP;Left: increase low levels and reduce high levels,\nRight: reduce low levels and increase high levels. @@ -3352,18 +3365,18 @@ TP_WAVELET_LABEL;Wavelet Levels TP_WAVELET_LARGEST;Coarsest TP_WAVELET_LEVCH;Chroma TP_WAVELET_LEVDIR_ALL;All levels, in all directions -TP_WAVELET_LEVDIR_INF;Finer details levels, with selected level +TP_WAVELET_LEVDIR_INF;Finer detail levels, including selected level TP_WAVELET_LEVDIR_ONE;One level -TP_WAVELET_LEVDIR_SUP;Coarser details levels, without selected level +TP_WAVELET_LEVDIR_SUP;Coarser detail levels, excluding selected level TP_WAVELET_LEVELS;Wavelet levels -TP_WAVELET_LEVELS_TOOLTIP;Choose the number of detail levels the image is to be decomposed into. More levels require more RAM and require a longer processing time. +TP_WAVELET_LEVELS_TOOLTIP;Choose the number of wavelet decomposition levels for the image.\nMore levels require more RAM and require a longer processing time. TP_WAVELET_LEVF;Contrast TP_WAVELET_LEVLABEL;Preview maximum possible levels = %1 TP_WAVELET_LEVONE;Level 2 TP_WAVELET_LEVTHRE;Level 4 TP_WAVELET_LEVTWO;Level 3 TP_WAVELET_LEVZERO;Level 1 -TP_WAVELET_LINKEDG;Link with Edge Sharpness' Strength +TP_WAVELET_LINKEDG;Link to Edge Sharpness Strength TP_WAVELET_LIPST;Enhanced algoritm TP_WAVELET_LOWLIGHT;Coarser levels luminance range TP_WAVELET_LOWTHR_TOOLTIP;Prevents amplification of fine textures and noise @@ -3371,7 +3384,7 @@ TP_WAVELET_MEDGREINF;First level TP_WAVELET_MEDI;Reduce artifacts in blue sky TP_WAVELET_MEDILEV;Edge detection TP_WAVELET_MEDILEV_TOOLTIP;When you enable Edge Detection, it is recommanded:\n- to disabled low contrast levels to avoid artifacts,\n- to use high values of gradient sensitivity.\n\nYou can modulate the strength with 'refine' from Denoise and Refine. -TP_WAVELET_MERGEC;Merge Chroma +TP_WAVELET_MERGEC;Merge chroma TP_WAVELET_MERGEL;Merge Luma TP_WAVELET_NEUTRAL;Neutral TP_WAVELET_NOIS;Denoise @@ -3382,24 +3395,24 @@ TP_WAVELET_NPLOW;Low TP_WAVELET_NPNONE;None TP_WAVELET_NPTYPE;Neighboring pixels TP_WAVELET_NPTYPE_TOOLTIP;This algorithm uses the proximity of a pixel and eight of its neighbors. If less difference, edges are reinforced. -TP_WAVELET_OFFSET_TOOLTIP;Offset modifies the balance between shadows and highlights.\nHigh values here will amplify the contrast change of the highlights, whereas low values will amplify the contrast change of the shadows.\nAlong with a low Attenuation Response value you will able to select the contrasts that will be enhanced. +TP_WAVELET_OFFSET_TOOLTIP;Offset modifies the balance between low contrast and high contrast details.\nHigh values will amplify contrast changes to the higher contrast details, whereas low values will amplify contrast changes to low contrast details.\nBy using a low Attenuation response value you can select which contrast values will be enhanced. TP_WAVELET_OLDSH;Algorithm using negatives values -TP_WAVELET_OPACITY;Opacity Blue-Yellow +TP_WAVELET_OPACITY;Opacity blue-yellow TP_WAVELET_OPACITYW;Contrast balance d/v-h curve TP_WAVELET_OPACITYWL;Local contrast TP_WAVELET_OPACITYWL_TOOLTIP;Modify the final local contrast at the end of the wavelet treatment.\n\nThe left side represents the smallest local contrast, progressing to the largest local contrast on the right. TP_WAVELET_PASTEL;Pastel chroma TP_WAVELET_PROC;Process TP_WAVELET_PROTAB;Protection -TP_WAVELET_RADIUS;Radius Shadows - Highlight +TP_WAVELET_RADIUS;Radius shadows - highlight TP_WAVELET_RANGEAB;Range a and b % TP_WAVELET_RE1;Reinforced TP_WAVELET_RE2;Unchanged TP_WAVELET_RE3;Reduced -TP_WAVELET_RESBLUR;Blur Luminance -TP_WAVELET_RESBLURC;Blur Chroma +TP_WAVELET_RESBLUR;Blur luminance +TP_WAVELET_RESBLURC;Blur chroma TP_WAVELET_RESBLUR_TOOLTIP;Disabled if zoom > about 500% -TP_WAVELET_RESCHRO;Intensity +TP_WAVELET_RESCHRO;Strength TP_WAVELET_RESCON;Shadows TP_WAVELET_RESCONH;Highlights TP_WAVELET_RESID;Residual Image @@ -3408,15 +3421,15 @@ TP_WAVELET_SETTINGS;Wavelet Settings TP_WAVELET_SHA;Sharp mask TP_WAVELET_SHFRAME;Shadows/Highlights TP_WAVELET_SHOWMASK;Show wavelet 'mask' -TP_WAVELET_SIGMA;Attenuation Response -TP_WAVELET_SIGMAFIN;Attenuation Response +TP_WAVELET_SIGMA;Attenuation response +TP_WAVELET_SIGMAFIN;Attenuation response TP_WAVELET_SIGMA_TOOLTIP;The effect of the contrast sliders is stronger in medium contrast details, and weaker in high and low contrast details.\n With this slider you can control how quickly the effect dampens towards the extreme contrasts.\n The higher the slider is set, the wider the range of contrasts which will get a strong change, and the higher the risk to generate artifacts.\n .The lower it is, the more the effect will be pinpointed towards a narrow range of contrast values TP_WAVELET_SKIN;Skin targetting/protection TP_WAVELET_SKIN_TOOLTIP;At -100 skin-tones are targetted.\nAt 0 all tones are treated equally.\nAt +100 skin-tones are protected while all other tones are affected. -TP_WAVELET_SKY;Sky targetting/protection -TP_WAVELET_SKY_TOOLTIP;At -100 sky-tones are targetted.\nAt 0 all tones are treated equally.\nAt +100 sky-tones are protected while all other tones are affected. -TP_WAVELET_SOFTRAD;Soft Radius -TP_WAVELET_STREN;Strength +TP_WAVELET_SKY;Hue targetting/protection +TP_WAVELET_SKY_TOOLTIP;Allows you to target or protect a range of hues.\nAt -100 selected hues are targetted.\nAt 0 all hues are treated equally.\nAt +100 selected hues are protected while all other hues are targetted. +TP_WAVELET_SOFTRAD;Soft radius +TP_WAVELET_STREN;Refine TP_WAVELET_STRENGTH;Strength TP_WAVELET_SUPE;Extra TP_WAVELET_THR;Shadows threshold @@ -3424,7 +3437,7 @@ TP_WAVELET_THRESHOLD;Finer levels TP_WAVELET_THRESHOLD2;Coarser levels TP_WAVELET_THRESHOLD2_TOOLTIP;Only levels from the chosen value to the selected number of ‘wavelet levels’ will be affected by the Shadow luminance range. TP_WAVELET_THRESHOLD_TOOLTIP;Only levels below and including the chosen value will be affected by the Highlight luminance range. -TP_WAVELET_THRESWAV;Balance Threshold +TP_WAVELET_THRESWAV;Balance threshold TP_WAVELET_THRH;Highlights threshold TP_WAVELET_TILESBIG;Tiles TP_WAVELET_TILESFULL;Full image @@ -3437,11 +3450,11 @@ TP_WAVELET_TMSTRENGTH;Compression strength TP_WAVELET_TMSTRENGTH_TOOLTIP;Control the strength of tone mapping or contrast compression of the residual image. TP_WAVELET_TMTYPE;Compression method TP_WAVELET_TON;Toning -TP_WAVELET_TONFRAME;Excluded Colors +TP_WAVELET_TONFRAME;Excluded colors TP_WAVELET_USH;None TP_WAVELET_USHARP;Clarity method TP_WAVELET_USHARP_TOOLTIP;Origin : the source file is the file before Wavelet.\nWavelet : the source file is the file including wavelet threatment -TP_WAVELET_USH_TOOLTIP;If you select Sharp-mask, wavelet settings will be automatically positioned :\nBackground=black, Process=below, level=3...you can change level between 1 and 4.\n\nIf you select Clarity, wavelet settings will be automatically positioned :\nBackground=residual, Process=above, level=7..you can change level between 5 and 10 and wavelet levels. +TP_WAVELET_USH_TOOLTIP;If you select Sharp-mask, you can choose any level (in Settings) from 1 to 4 for processing.\nIf you select Clarity, you can choose any level (in Settings) between 5 and Extra. TP_WAVELET_WAVLOWTHR;Low contrast threshold TP_WAVELET_WAVOFFSET;Offset TP_WBALANCE_AUTO;Auto diff --git a/rtengine/array2D.h b/rtengine/array2D.h index 4b301383b..512f7bcc1 100644 --- a/rtengine/array2D.h +++ b/rtengine/array2D.h @@ -27,7 +27,7 @@ * * creates an array which is valid within the normal C/C++ scope "{ ... }" * - * access to elements is a simple as: + * access to elements is as simple as: * * array2D my_array (10,10); // creates 10x10 array of floats * value = my_array[3][5]; @@ -48,25 +48,20 @@ * array2D my_array ; // empty container. * my_array(10,10) ; // resize to 10x10 array * my_array(10,10,ARRAY2D_CLEAR_DATA) ; // resize to 10x10 and clear data - * my_array(10,10,ARRAY2D_CLEAR_DATA|ARRAY2D_LOCK_DATA) ; same but set a lock on changes * - * !! locked arrays cannot be resized and cannot be unlocked again !! */ #pragma once -#include // for raise() #include +#include +#include +#include +#include "noncopyable.h" // flags for use -#define ARRAY2D_LOCK_DATA 1 -#define ARRAY2D_CLEAR_DATA 2 -#define ARRAY2D_BYREFERENCE 4 -#define ARRAY2D_VERBOSE 8 +constexpr unsigned int ARRAY2D_CLEAR_DATA = 1; +constexpr unsigned int ARRAY2D_BYREFERENCE = 2; -#include -#include - -#include "noncopyable.h" template class array2D : @@ -74,249 +69,158 @@ class array2D : { private: - int x, y, owner; - unsigned int flags; - T ** ptr; - T * data; - bool lock; // useful lock to ensure data is not changed anymore. - void ar_realloc(int w, int h, int offset = 0) + ssize_t width; + std::vector rows; + std::vector buffer; + + void initRows(ssize_t h, int offset = 0) { - if ((ptr) && ((h > y) || (4 * h < y))) { - delete[] ptr; - ptr = nullptr; + rows.resize(h); + T* start = buffer.data() + offset; + for (ssize_t i = 0; i < h; ++i) { + rows[i] = start + width * i; } + } - if ((data) && (((h * w) > (x * y)) || ((h * w) < ((x * y) / 4)))) { - delete[] data; - data = nullptr; - } - - if (ptr == nullptr) { - ptr = new T*[h]; - } - - if (data == nullptr) { - data = new T[h * w + offset]; - } - - x = w; - y = h; - - for (int i = 0; i < h; i++) { - ptr[i] = data + offset + w * i; - } - - owner = 1; + void ar_realloc(ssize_t w, ssize_t h, int offset = 0) + { + width = w; + buffer.resize(h * width + offset); + initRows(h, offset); } public: // use as empty declaration, resize before use! // very useful as a member object - array2D() : - x(0), y(0), owner(0), flags(0), ptr(nullptr), data(nullptr), lock(false) - { - //printf("got empty array2D init\n"); - } + array2D() : width(0) {} // creator type1 - array2D(int w, int h, unsigned int flgs = 0) + array2D(int w, int h, unsigned int flags = 0) : width(w) { - flags = flgs; - lock = flags & ARRAY2D_LOCK_DATA; - data = new T[h * w]; - owner = 1; - x = w; - y = h; - ptr = new T*[h]; - - for (int i = 0; i < h; i++) { - ptr[i] = data + i * w; - } - if (flags & ARRAY2D_CLEAR_DATA) { - memset(data, 0, w * h * sizeof(T)); + buffer.resize(h * width, 0); + } else { + buffer.resize(h * width); } + initRows(h); } // creator type 2 - array2D(int w, int h, T ** source, unsigned int flgs = 0) + array2D(int w, int h, T ** source, unsigned int flags = 0) : width(w) { - flags = flgs; - //if (lock) { printf("array2D attempt to overwrite data\n");raise(SIGSEGV);} - lock = flags & ARRAY2D_LOCK_DATA; - // when by reference - // TODO: improve this code with ar_realloc() - owner = (flags & ARRAY2D_BYREFERENCE) ? 0 : 1; - - if (owner) { - data = new T[h * w]; - } else { - data = nullptr; - } - - x = w; - y = h; - ptr = new T*[h]; - - for (int i = 0; i < h; i++) { - if (owner) { - ptr[i] = data + i * w; - - for (int j = 0; j < w; j++) { - ptr[i][j] = source[i][j]; + rows.resize(h); + if (!(flags & ARRAY2D_BYREFERENCE)) { + buffer.resize(h * width); + T* start = buffer.data(); + for (ssize_t i = 0; i < h; ++i) { + rows[i] = start + i * width; + for (ssize_t j = 0; j < width; ++j) { + rows[i][j] = source[i][j]; } - } else { - ptr[i] = source[i]; } - } - } - - // destructor - ~array2D() - { - - if (flags & ARRAY2D_VERBOSE) { - printf(" deleting array2D size %dx%d \n", x, y); - } - - if ((owner) && (data)) { - delete[] data; - } - - if (ptr) { - delete[] ptr; + } else { + for (ssize_t i = 0; i < h; ++i) { + rows[i] = source[i]; + } } } void fill(const T val, bool multiThread = false) { + const ssize_t height = rows.size(); #ifdef _OPENMP #pragma omp parallel for if(multiThread) #endif - for (int i = 0; i < x * y; ++i) { - data[i] = val; + for (ssize_t i = 0; i < width * height; ++i) { + buffer[i] = val; } } void free() { - if ((owner) && (data)) { - delete[] data; - data = nullptr; - } - - if (ptr) { - delete [] ptr; - ptr = nullptr; - } + buffer.clear(); + rows.clear(); } // use with indices T * operator[](int index) { - assert((index >= 0) && (index < y)); - return ptr[index]; + assert((index >= 0) && (index < rows.size())); + return rows[index]; + } + + const T * operator[](int index) const + { + assert((index >= 0) && (index < rows.size())); + return rows[index]; } // use as pointer to T** operator T**() { - return ptr; + return rows.data(); } // use as pointer to T** operator const T* const *() const { - return ptr; + return rows.data(); } - // use as pointer to data + // use as pointer to buffer operator T*() { // only if owner this will return a valid pointer - return data; + return buffer.data(); + } + + operator const T*() const + { + // only if owner this will return a valid pointer + return buffer.data(); } // useful within init of parent object // or use as resize of 2D array - void operator()(int w, int h, unsigned int flgs = 0, int offset = 0) + void operator()(int w, int h, unsigned int flags = 0, int offset = 0) { - flags = flgs; - - if (flags & ARRAY2D_VERBOSE) { - printf("got init request %dx%d flags=%u\n", w, h, flags); - printf("previous was data %p ptr %p \n", data, ptr); - } - - if (lock) { // our object was locked so don't allow a change. - printf("got init request but object was locked!\n"); - raise( SIGSEGV); - } - - lock = flags & ARRAY2D_LOCK_DATA; - ar_realloc(w, h, offset); if (flags & ARRAY2D_CLEAR_DATA) { - memset(data + offset, 0, static_cast(w) * h * sizeof(T)); + fill(0); } } - // import from flat data - void operator()(int w, int h, T* copy, unsigned int flgs = 0) + int getWidth() const { - flags = flgs; - - if (flags & ARRAY2D_VERBOSE) { - printf("got init request %dx%d flags=%u\n", w, h, flags); - printf("previous was data %p ptr %p \n", data, ptr); - } - - if (lock) { // our object was locked so don't allow a change. - printf("got init request but object was locked!\n"); - raise( SIGSEGV); - } - - lock = flags & ARRAY2D_LOCK_DATA; - - ar_realloc(w, h); - memcpy(data, copy, w * h * sizeof(T)); + return width; } - int width() const + int getHeight() const { - return x; - } - int height() const - { - return y; + return rows.size(); } operator bool() { - return (x > 0 && y > 0); + return (width > 0 && !rows.empty()); } }; template -class multi_array2D +class multi_array2D : public rtengine::NonCopyable { private: array2D list[num]; public: - multi_array2D(int x, int y, int flags = 0, int offset = 0) + multi_array2D(int width, int height, int flags = 0, int offset = 0) { - for (size_t i = 0; i < num; i++) { - list[i](x, y, flags, (i + 1) * offset); + for (size_t i = 0; i < num; ++i) { + list[i](width, height, flags, (i + 1) * offset); } } - ~multi_array2D() - { - //printf("trying to delete the list of array2D objects\n"); - } - array2D & operator[](int index) { assert(static_cast(index) < num); diff --git a/rtengine/camconst.json b/rtengine/camconst.json index de06f670f..578ff1811 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -1401,9 +1401,17 @@ Camera constants: "ranges": { "white": [ 16105, 16270, 16082 ] } // These values are the lowest pixel values >16000 for all ISOs. LENR has a negligble effect. // No aperture scaling data provided, but likely negligible }, - - { // Quality C, only raw crop - "make_model": [ "FUJIFILM X-T3", "FUJIFILM X-T30", "FUJIFILM X-PRO3", "FUJIFILM X100V", "FUJIFILM X-T4" ], + + { // Quality A, samples provided by Daniel Catalina (#5839) and pi99y (#5860) + "make_model": [ "FUJIFILM X-T3", "FUJIFILM X-PRO3" ], + "dcraw_matrix": [ 13426,-6334,-1177,-4244,12136,2371,-580,1303,5980 ], // DNG_v11, standard_v2 d65 + "raw_crop": [ 0, 5, 6252, 4176], + "white": [ 16170, 16275, 16170 ] // typical safe-margins with LENR + // negligible aperture scaling effect + }, + + { // Quality B + "make_model": [ "FUJIFILM X-T30", "FUJIFILM X100V", "FUJIFILM X-T4" ], "dcraw_matrix": [ 13426,-6334,-1177,-4244,12136,2371,-580,1303,5980 ], // DNG_v11, standard_v2 d65 "raw_crop": [ 0, 5, 6252, 4176] }, @@ -2747,6 +2755,12 @@ Camera constants: "ranges": { "black": 0, "white": 64400 } }, + { // Quality B + "make_model": ["HASSELBLAD NEX-7", "SONY NEX-7"], // Hasselblad NEX-7 also known as Hasselblad Lunar + "dcraw_matrix": [ 5491,-1192,-363,-4951,12342,2948,-911,1722,7192 ], // adobe DNGv12.2 d65 + "ranges": { "black": 512, "white": 16372 } // Typical white level (samples provided by @ggc on Pixls, influence from LENR unknown + }, + { // Quality A for tested CFV, the other models have the same sensor (16 megapixel square sensor) "make_model": [ "Hasselblad V96C", "Hasselblad CFV", "Hasselblad CFV-II" ], "dcraw_matrix": [ 8519, -3260, -280, -5081, 13459, 1738, -1449, 2960, 7809 ] // borrowed from Adobe's DNG converter diff --git a/rtengine/guidedfilter.cc b/rtengine/guidedfilter.cc index b3f843bc1..3f5e00e05 100644 --- a/rtengine/guidedfilter.cc +++ b/rtengine/guidedfilter.cc @@ -82,8 +82,8 @@ int calculate_subsampling(int w, int h, int r) void guidedFilter(const array2D &guide, const array2D &src, array2D &dst, int r, float epsilon, bool multithread, int subsampling) { - const int W = src.width(); - const int H = src.height(); + const int W = src.getWidth(); + const int H = src.getHeight(); if (subsampling <= 0) { subsampling = calculate_subsampling(W, H, r); @@ -94,8 +94,8 @@ void guidedFilter(const array2D &guide, const array2D &src, array2 const auto apply = [=](Op op, array2D &res, const array2D &a, const array2D &b, const array2D &c=array2D()) -> void { - const int w = res.width(); - const int h = res.height(); + const int w = res.getWidth(); + const int h = res.getHeight(); #ifdef _OPENMP #pragma omp parallel for if (multithread) @@ -142,12 +142,12 @@ void guidedFilter(const array2D &guide, const array2D &src, array2 const auto f_subsample = [=](array2D &d, const array2D &s) -> void { - if (d.width() == s.width() && d.height() == s.height()) { + if (d.getWidth() == s.getWidth() && d.getHeight() == s.getHeight()) { #ifdef _OPENMP # pragma omp parallel for if (multithread) #endif - for (int y = 0; y < s.height(); ++y) { - for (int x = 0; x < s.width(); ++x) { + for (int y = 0; y < s.getHeight(); ++y) { + for (int x = 0; x < s.getWidth(); ++x) { d[y][x] = s[y][x]; } } @@ -164,9 +164,9 @@ void guidedFilter(const array2D &guide, const array2D &src, array2 const auto f_mean = [multithread](array2D &d, array2D &s, int rad) -> void { - rad = LIM(rad, 0, (min(s.width(), s.height()) - 1) / 2 - 1); - // boxblur(s, d, rad, s.width(), s.height(), multithread); - boxblur(static_cast(s), static_cast(d), rad, s.width(), s.height(), multithread); + rad = LIM(rad, 0, (min(s.getWidth(), s.getHeight()) - 1) / 2 - 1); + // boxblur(s, d, rad, s.getWidth(), s.getHeight(), multithread); + boxblur(static_cast(s), static_cast(d), rad, s.getWidth(), s.getHeight(), multithread); }; array2D I1(w, h); @@ -225,10 +225,10 @@ void guidedFilter(const array2D &guide, const array2D &src, array2 DEBUG_DUMP(meanb); // speedup by heckflosse67 - const int Ws = meana.width(); - const int Hs = meana.height(); - const int Wd = q.width(); - const int Hd = q.height(); + const int Ws = meana.getWidth(); + const int Hs = meana.getHeight(); + const int Wd = q.getWidth(); + const int Hd = q.getHeight(); const float col_scale = float(Ws) / float(Wd); const float row_scale = float(Hs) / float(Hd); @@ -249,8 +249,8 @@ void guidedFilterLog(const array2D &guide, float base, array2D &ch #ifdef _OPENMP # pragma omp parallel for if (multithread) #endif - for (int y = 0; y < chan.height(); ++y) { - for (int x = 0; x < chan.width(); ++x) { + for (int y = 0; y < chan.getHeight(); ++y) { + for (int x = 0; x < chan.getWidth(); ++x) { chan[y][x] = xlin2log(max(chan[y][x], 0.f), base); } } @@ -260,8 +260,8 @@ void guidedFilterLog(const array2D &guide, float base, array2D &ch #ifdef _OPENMP # pragma omp parallel for if (multithread) #endif - for (int y = 0; y < chan.height(); ++y) { - for (int x = 0; x < chan.width(); ++x) { + for (int y = 0; y < chan.getHeight(); ++y) { + for (int x = 0; x < chan.getWidth(); ++x) { chan[y][x] = xlog2lin(max(chan[y][x], 0.f), base); } } diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 113667262..d9618ba9f 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -390,7 +390,7 @@ public: std::unique_ptr buildMeaLut(const float inVals[11], const float mea[10], float& lutFactor); void Aver(const float* HH_Coeffs, int datalen, float &averagePlus, float &averageNeg, float &max, float &min, int numThreads); void Sigma(const float* HH_Coeffs, int datalen, float averagePlus, float averageNeg, float &sigmaPlus, float &sigmaNeg, int numThreads); - void calckoe(const float* const* WavCoeffs_LL, float gradw, float tloww, float ** koeLi, int level, int dir, int W_L, int H_L, float edd, float &maxkoeLi, float **tmC = nullptr); + void calckoe(const float* WavCoeffs_LL, float gradw, float tloww, float *koeLi, int level, int W_L, int H_L, float edd, float &maxkoeLi, float **tmC, bool multiThread = false); void Median_Denoise(float **src, float **dst, int width, int height, Median medianType, int iterations, int numThreads, float **buffer = nullptr); void Median_Denoise(float **src, float **dst, float upperBound, int width, int height, Median medianType, int iterations, int numThreads, float **buffer = nullptr); diff --git a/rtengine/ipdehaze.cc b/rtengine/ipdehaze.cc index 4376808f8..6526d0d1e 100644 --- a/rtengine/ipdehaze.cc +++ b/rtengine/ipdehaze.cc @@ -105,8 +105,8 @@ void restore(Imagefloat *rgb, float maxval, bool multithread) int get_dark_channel(const array2D &R, const array2D &G, const array2D &B, array2D &dst, int patchsize, const float ambient[3], bool clip, bool multithread, float strength) { - const int W = R.width(); - const int H = R.height(); + const int W = R.getWidth(); + const int H = R.getHeight(); #ifdef _OPENMP #pragma omp parallel for if (multithread) @@ -164,8 +164,8 @@ int get_dark_channel(const array2D &R, const array2D &G, const arr int get_dark_channel_downsized(const array2D &R, const array2D &G, const array2D &B, array2D &dst, int patchsize, bool multithread) { - const int W = R.width(); - const int H = R.height(); + const int W = R.getWidth(); + const int H = R.getHeight(); #ifdef _OPENMP #pragma omp parallel for if (multithread) @@ -195,8 +195,8 @@ int get_dark_channel_downsized(const array2D &R, const array2D &G, float estimate_ambient_light(const array2D &R, const array2D &G, const array2D &B, const array2D &dark, int patchsize, int npatches, float ambient[3]) { - const int W = R.width(); - const int H = R.height(); + const int W = R.getWidth(); + const int H = R.getHeight(); float darklim = RT_INFINITY_F; { diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index b349a454a..cfd4a271e 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -1840,8 +1840,8 @@ void tone_eq(array2D &R, array2D &G, array2D &B, const stru { BENCHFUN - const int W = R.width(); - const int H = R.height(); + const int W = R.getWidth(); + const int H = R.getHeight(); array2D Y(W, H); const auto log2 = @@ -3724,6 +3724,13 @@ void ImProcFunctions::retinex_pde(const float * datain, float * dataout, int bfw fftwf_free(data_fft04); fftwf_free(data_tmp04); } + if (show == 2) { + for (int y = 0; y < bfh ; y++) { + for (int x = 0; x < bfw; x++) { + datashow[y * bfw + x] = data_fft[y * bfw + x]; + } + } + } /* solve the Poisson PDE in Fourier space */ /* 1. / (float) (bfw * bfh)) is the DCT normalisation term, see libfftw */ @@ -7402,7 +7409,7 @@ BENCHFUN CompressDR(wav_L0, W_L, H_L, Compression, DetailBoost); } - if ((lp.residsha != 0.f || lp.residhi != 0.f)) { + if ((lp.residsha < 0.f || lp.residhi < 0.f)) { float tran = 5.f;//transition shadow if (lp.residshathr > (100.f - tran)) { @@ -7439,6 +7446,31 @@ BENCHFUN } } + if ((lp.residsha > 0.f || lp.residhi > 0.f)) { + const std::unique_ptr temp(new LabImage(W_L, H_L)); +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + + for (int i = 0; i < H_L; i++) { + for (int j = 0; j < W_L; j++) { + temp->L[i][j] = wav_L0[i * W_L + j]; + } + } + + ImProcFunctions::shadowsHighlights(temp.get(), true, 1, lp.residhi, lp.residsha , 40, sk, lp.residhithr, lp.residshathr); + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + + for (int i = 0; i < H_L; i++) { + for (int j = 0; j < W_L; j++) { + wav_L0[i * W_L + j] = temp->L[i][j]; + } + } + } + if (contrast != 0.) { double avedbl = 0.0; // use double precision for large summations @@ -7515,9 +7547,9 @@ BENCHFUN float eddlipampl = 1.f + lp.basew / 50.f; int W_L = wdspot->level_W(0);//provisory W_L H_L int H_L = wdspot->level_H(0); + float *koeLi[12]; float maxkoeLi[12] = {0.f}; - float *beta = new float[W_L * H_L]; float *koeLibuffer = new float[12 * H_L * W_L]; //12 @@ -7525,65 +7557,21 @@ BENCHFUN koeLi[i] = &koeLibuffer[i * W_L * H_L]; } - for (int j = 0; j < 12; j++) { - for (int i = 0; i < W_L * H_L; i++) { - koeLi[j][i] = 0.f; - } - } - array2D tmC(W_L, H_L); float gradw = lp.gradw; float tloww = lp.tloww; -//StopWatch Stop1("test"); for (int lvl = 0; lvl < 4; lvl++) { for (int dir = 1; dir < 4; dir++) { const int W_L = wdspot->level_W(lvl); const int H_L = wdspot->level_H(lvl); float* const* wav_L = wdspot->level_coeffs(lvl); - if (lvl == 3 && dir == 3) { - const float effect = lp.sigmaed; - constexpr float offset = 1.f; - float mea[10]; - calceffect(lvl, mean, sigma, mea, effect, offset); - -#ifdef _OPENMP - #pragma omp parallel for if(multiThread) -#endif - for (int co = 0; co < H_L * W_L; co++) { - const float WavCL = std::fabs(wav_L[dir][co]); - - if (WavCL < mea[0]) { - beta[co] = 0.05f; - } else if (WavCL < mea[1]) { - beta[co] = 0.2f; - } else if (WavCL < mea[2]) { - beta[co] = 0.7f; - } else if (WavCL < mea[3]) { - beta[co] = 1.f; //standard - } else if (WavCL < mea[4]) { - beta[co] = 1.f; - } else if (WavCL < mea[5]) { - beta[co] = 0.8f; //+sigma - } else if (WavCL < mea[6]) { - beta[co] = 0.5f; - } else if (WavCL < mea[7]) { - beta[co] = 0.3f; - } else if (WavCL < mea[8]) { - beta[co] = 0.2f; // + 2 sigma - } else if (WavCL < mea[9]) { - beta[co] = 0.1f; - } else { - beta[co] = 0.05f; - } - } - } - calckoe(wav_L, gradw, tloww, koeLi, lvl, dir, W_L, H_L, edd, maxkoeLi[lvl * 3 + dir - 1], tmC); + calckoe(wav_L[dir], gradw, tloww, koeLi[lvl * 3 + dir - 1], lvl, W_L, H_L, edd, maxkoeLi[lvl * 3 + dir - 1], tmC, true); // return convolution KoeLi and maxkoeLi of level 0 1 2 3 and Dir Horiz, Vert, Diag } } + tmC.free(); -//Stop1.stop(); float aamp = 1.f + lp.thigw / 100.f; const float alipinfl = (eddlipampl - 1.f) / (1.f - eddlipinfl); @@ -7743,6 +7731,14 @@ BENCHFUN constexpr float da_abssd = (maxampd - abssd) / 0.333f; constexpr float db_abssd = maxampd - da_abssd; constexpr float am = (abssd - bbssd) / 0.666f; + const float effect = lp.sigmaed; + constexpr float offset = 1.f; + float mea[10]; + calceffect(lvl, mean, sigma, mea, effect, offset); + float lutFactor; + const float inVals[] = {0.05f, 0.2f, 0.7f, 1.f, 1.f, 0.8f, 0.5f, 0.3f, 0.2f, 0.1f, 0.05f}; + const auto meaLut = buildMeaLut(inVals, mea, lutFactor); + for (int dir = 1; dir < 4; dir++) { #ifdef _OPENMP #pragma omp parallel for schedule(dynamic, 16) if(multiThread) @@ -7800,7 +7796,7 @@ BENCHFUN } edge = std::max(edge * kinterm, 1.f); - wav_L[dir][k] *= 1.f + (edge - 1.f) * beta[k]; + wav_L[dir][k] *= 1.f + (edge - 1.f) * (*meaLut)[std::fabs(wav_L[dir][k]) * lutFactor]; } } } @@ -7810,8 +7806,6 @@ BENCHFUN if (koeLibuffer) { delete [] koeLibuffer; } - - delete[] beta; } //edge sharpness end diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 499ee7812..21fffb76c 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -323,14 +323,14 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const } cp.CHSLmet = 1; - cp.EDmet = 1; - + cp.EDmet = 2; +/* if (params->wavelet.EDmethod == "SL") { cp.EDmet = 1; } else if (params->wavelet.EDmethod == "CU") { cp.EDmet = 2; } - +*/ cp.cbena = params->wavelet.cbenab; cp.blhigh = (float)params->wavelet.bluehigh; cp.grhigh = (float)params->wavelet.greenhigh; @@ -2079,7 +2079,8 @@ void ImProcFunctions::WaveletcontAllL(LabImage * labco, float ** varhue, float * ContrastResid(WavCoeffs_L0, cp, W_L, H_L, maxp); } - if ((cp.conres >= 0.f || cp.conresH >= 0.f) && cp.resena && !cp.oldsh) { // cp.conres = 0.f and cp.comresH = 0.f means that all will be multiplied by 1.f, so we can skip this step + // if ((cp.conres >= 0.f || cp.conresH >= 0.f) && cp.resena && !cp.oldsh) { // cp.conres = 0.f and cp.comresH = 0.f means that all will be multiplied by 1.f, so we can skip this step + if ((cp.conres >= 0.f || cp.conresH >= 0.f) && cp.resena) { // cp.conres = 0.f and cp.comresH = 0.f means that all will be multiplied by 1.f, so we can skip this step const std::unique_ptr temp(new LabImage(W_L, H_L)); #ifdef _OPENMP #pragma omp parallel for num_threads(wavNestedLevels) if (wavNestedLevels>1) @@ -2104,7 +2105,8 @@ void ImProcFunctions::WaveletcontAllL(LabImage * labco, float ** varhue, float * } } - if ((cp.conres != 0.f || cp.conresH != 0.f) && cp.resena && cp.oldsh) { // cp.conres = 0.f and cp.comresH = 0.f means that all will be multiplied by 1.f, so we can skip this step + // if ((cp.conres != 0.f || cp.conresH != 0.f) && cp.resena && cp.oldsh) { // cp.conres = 0.f and cp.comresH = 0.f means that all will be multiplied by 1.f, so we can skip this step + if ((cp.conres < 0.f || cp.conresH < 0.f) && cp.resena) { // cp.conres = 0.f and cp.comresH = 0.f means that all will be multiplied by 1.f, so we can skip this step #ifdef _OPENMP #pragma omp parallel for #endif @@ -2215,7 +2217,7 @@ void ImProcFunctions::WaveletcontAllL(LabImage * labco, float ** varhue, float * for (int dir = 1; dir < 4; dir++) { const float* const* WavCoeffs_LL = WaveletCoeffs_L.level_coeffs(lvl); float tempkoeli = 0.f; - calckoe (WavCoeffs_LL, gradw, tloww, koeLi, lvl , dir, W_L, H_L, edd, tempkoeli, tmC); + calckoe (WavCoeffs_LL[dir], gradw, tloww, koeLi[lvl * 3 + dir - 1], lvl, W_L, H_L, edd, tempkoeli, tmC); maxkoeLi[lvl * 3 + dir - 1] = tempkoeli ; // return convolution KoeLi and maxkoeLi of level 0 1 2 3 and Dir Horiz, Vert, Diag } @@ -2643,13 +2645,11 @@ BENCHFUN } } -void ImProcFunctions::calckoe (const float* const* WavCoeffs_LL, float gradw, float tloww, float *koeLi[12], int level, int dir, int W_L, int H_L, float edd, float &maxkoeLi, float **tmC) +void ImProcFunctions::calckoe (const float* WavCoeffs, float gradw, float tloww, float *koeLi, int level, int W_L, int H_L, float edd, float &maxkoeLi, float **tmC, bool multiThread) { - int borderL = 2; - - if (tloww < 30.f) { - borderL = 1; + const int borderL = tloww < 75.f ? 1 : 2; + if (tloww < 75.f) { // I calculate coefficients with r size matrix 3x3 r=1 ; 5x5 r=2; 7x7 r=3 /* float k[2*r][2*r]; @@ -2661,123 +2661,144 @@ void ImProcFunctions::calckoe (const float* const* WavCoeffs_LL, float gradw, fl //I could also use Gauss.h for 3x3 // If necessary I can put a 7x7 matrix */ - for (int i = 1; i < H_L - 1; i++) { //sigma=0.55 - for (int j = 1; j < W_L - 1; j++) { - tmC[i][j] = (8.94f * WavCoeffs_LL[dir][i * W_L + j] + 1.71f * (WavCoeffs_LL[dir][(i - 1) * W_L + j] + 1.71f * WavCoeffs_LL[dir][(i + 1) * W_L + j] - + 1.71f * WavCoeffs_LL[dir][i * W_L + j + 1] + 1.71f * WavCoeffs_LL[dir][i * W_L + j - 1]) + 0.33f * WavCoeffs_LL[dir][(i - 1) * W_L + j - 1] - + 0.33f * WavCoeffs_LL[dir][(i - 1) * W_L + j + 1] + 0.33f * WavCoeffs_LL[dir][(i + 1) * W_L + j - 1] + 0.33f * WavCoeffs_LL[dir][(i + 1) * W_L + j + 1]) * 0.0584795f; - // apply to each direction Wavelet level : horizontal / vertiacle / diagonal - - - } + float c0, c1, c2, mult; + if (tloww < 30.f) { //sigma=0.55 + c0 = 8.94f; + c1 = 1.71f; + c2 = 0.33f; + mult = 0.0584795f; + } else if (tloww < 50.f) { //sigma=0.85 + c0 = 4.0091f; + c1 = 2.0068f; + c2 = 1.0045f; + mult = 0.062288f; + } else { //sigma=1.1 + c0 = 3.025f; + c1 = 2.001f; + c2 = 1.323f; + mult = 0.06127f; } - } else if (tloww < 50.f) { - borderL = 1; - - for (int i = 1; i < H_L - 1; i++) { //sigma=0.85 - for (int j = 1; j < W_L - 1; j++) { - tmC[i][j] = (4.0091f * WavCoeffs_LL[dir][i * W_L + j] + 2.0068f * (WavCoeffs_LL[dir][(i - 1) * W_L + j] + 2.0068f * WavCoeffs_LL[dir][(i + 1) * W_L + j] - + 2.0068f * WavCoeffs_LL[dir][i * W_L + j + 1] + 2.0068f * WavCoeffs_LL[dir][i * W_L + j - 1]) + 1.0045f * WavCoeffs_LL[dir][(i - 1) * W_L + j - 1] - + 1.0045f * WavCoeffs_LL[dir][(i - 1) * W_L + j + 1] + 1.0045f * WavCoeffs_LL[dir][(i + 1) * W_L + j - 1] + 1.0045f * WavCoeffs_LL[dir][(i + 1) * W_L + j + 1]) * 0.062288f; - // apply to each direction Wavelet level : horizontal / vertiacle / diagonal - - - } - } - } - - - else if (tloww < 75.f) { - borderL = 1; - + c0 *= mult; + c1 *= mult; + c2 *= mult; +#ifdef _OPENMP + #pragma omp parallel for if(multiThread) +#endif for (int i = 1; i < H_L - 1; i++) { - for (int j = 1; j < W_L - 1; j++) { //sigma=1.1 - tmC[i][j] = (3.025f * WavCoeffs_LL[dir][i * W_L + j] + 2.001f * (WavCoeffs_LL[dir][(i - 1) * W_L + j] + 2.001f * WavCoeffs_LL[dir][(i + 1) * W_L + j] - + 2.001f * WavCoeffs_LL[dir][i * W_L + j + 1] + 2.001f * WavCoeffs_LL[dir][i * W_L + j - 1]) + 1.323f * WavCoeffs_LL[dir][(i - 1) * W_L + j - 1] - + 1.323f * WavCoeffs_LL[dir][(i - 1) * W_L + j + 1] + 1.323f * WavCoeffs_LL[dir][(i + 1) * W_L + j - 1] + 1.323f * WavCoeffs_LL[dir][(i + 1) * W_L + j + 1]) * 0.06127f; + for (int j = 1; j < W_L - 1; j++) { + tmC[i][j] = c0 * WavCoeffs[i * W_L + j] + + c1 * ((WavCoeffs[(i - 1) * W_L + j] + WavCoeffs[(i + 1) * W_L + j]) + (WavCoeffs[i * W_L + j + 1] + WavCoeffs[i * W_L + j - 1])) + + c2 * ((WavCoeffs[(i - 1) * W_L + j - 1] + WavCoeffs[(i - 1) * W_L + j + 1]) + (WavCoeffs[(i + 1) * W_L + j - 1] + WavCoeffs[(i + 1) * W_L + j + 1])); } } - } - - else if (tloww >= 75.f) { - borderL = 2; - + } else { if (level > 1) { // do not activate 5x5 if level 0 or 1 + // Gaussian 1.1 + // 0.5 2 3 2 0.5 + // 2 7 10 7 2 + // 3 10 15 10 3 + // 2 7 10 7 2 + // 0.5 2 3 2 0.5 + // divi 113 + //Gaussian 1.4 + // 2 4 5 4 2 + // 4 9 12 9 4 + // 5 12 15 12 5 + // 4 9 12 9 4 + // 2 4 5 4 2 + // divi 159 + float c0, c1, c2, c3, c4, c5, mult; + if (tloww < 85.f) { //sigma=1.1 + c0 = 15.f; + c1 = 10.f; + c2 = 7.f; + c3 = 3.f; + c4 = 2.f; + c5 = 0.5f; + mult = 0.0088495f; + } else { //sigma=1.4 + c0 = 15.f; + c1 = 12.f; + c2 = 9.f; + c3 = 5.f; + c4 = 4.f; + c5 = 2.f; + mult = 0.0062893f; + } + c0 *= mult; + c1 *= mult; + c2 *= mult; + c3 *= mult; + c4 *= mult; + c5 *= mult; +#ifdef _OPENMP + #pragma omp parallel for if(multiThread) +#endif for (int i = 2; i < H_L - 2; i++) { for (int j = 2; j < W_L - 2; j++) { - // Gaussian 1.1 - // 0.5 2 3 2 0.5 - // 2 7 10 7 2 - // 3 10 15 10 3 - // 2 7 10 7 2 - // 0.5 2 3 2 0.5 - // divi 113 - //Gaussian 1.4 - // 2 4 5 4 2 - // 4 9 12 9 4 - // 5 12 15 12 5 - // 4 9 12 9 4 - // 2 4 5 4 2 - // divi 159 - if (tloww < 85.f) { //sigma=1.1 - tmC[i][j] = (15.f * WavCoeffs_LL[dir][i * W_L + j] + 10.f * WavCoeffs_LL[dir][(i - 1) * W_L + j] + 10.f * WavCoeffs_LL[dir][(i + 1) * W_L + j] - + 10.f * WavCoeffs_LL[dir][i * W_L + j + 1] + 10.f * WavCoeffs_LL[dir][i * W_L + j - 1] + 7.f * WavCoeffs_LL[dir][(i - 1) * W_L + j - 1] - + 7.f * WavCoeffs_LL[dir][(i - 1) * W_L + j + 1] + 7.f * WavCoeffs_LL[dir][(i + 1) * W_L + j - 1] + 7.f * WavCoeffs_LL[dir][(i + 1) * W_L + j + 1] - + 3.f * WavCoeffs_LL[dir][(i - 2) * W_L + j] + 3.f * WavCoeffs_LL[dir][(i + 2) * W_L + j] + 3.f * WavCoeffs_LL[dir][i * W_L + j - 2] + 3.f * WavCoeffs_LL[dir][i * W_L + j + 2] - + 2.f * WavCoeffs_LL[dir][(i - 2) * W_L + j - 1] + 2.f * WavCoeffs_LL[dir][(i - 2) * W_L + j + 1] + 2.f * WavCoeffs_LL[dir][(i + 2) * W_L + j + 1] + 2.f * WavCoeffs_LL[dir][(i + 2) * W_L + j - 1] - + 2.f * WavCoeffs_LL[dir][(i - 1) * W_L + j - 2] + 2.f * WavCoeffs_LL[dir][(i - 1) * W_L + j + 2] + 2.f * WavCoeffs_LL[dir][(i + 1) * W_L + j + 2] + 2.f * WavCoeffs_LL[dir][(i + 1) * W_L + j - 2] - + 0.5f * WavCoeffs_LL[dir][(i - 2) * W_L + j - 2] + 0.5f * WavCoeffs_LL[dir][(i - 2) * W_L + j + 2] + 0.5f * WavCoeffs_LL[dir][(i + 2) * W_L + j - 2] + 0.5f * WavCoeffs_LL[dir][(i + 2) * W_L + j + 2] - ) * 0.0088495f; - - } - - else {//sigma=1.4 - tmC[i][j] = (15.f * WavCoeffs_LL[dir][i * W_L + j] + 12.f * WavCoeffs_LL[dir][(i - 1) * W_L + j] + 12.f * WavCoeffs_LL[dir][(i + 1) * W_L + j] - + 12.f * WavCoeffs_LL[dir][i * W_L + j + 1] + 12.f * WavCoeffs_LL[dir][i * W_L + j - 1] + 9.f * WavCoeffs_LL[dir][(i - 1) * W_L + j - 1] - + 9.f * WavCoeffs_LL[dir][(i - 1) * W_L + j + 1] + 9.f * WavCoeffs_LL[dir][(i + 1) * W_L + j - 1] + 9.f * WavCoeffs_LL[dir][(i + 1) * W_L + j + 1] - + 5.f * WavCoeffs_LL[dir][(i - 2) * W_L + j] + 5.f * WavCoeffs_LL[dir][(i + 2) * W_L + j] + 5.f * WavCoeffs_LL[dir][i * W_L + j - 2] + 5.f * WavCoeffs_LL[dir][i * W_L + j + 2] - + 4.f * WavCoeffs_LL[dir][(i - 2) * W_L + j - 1] + 4.f * WavCoeffs_LL[dir][(i - 2) * W_L + j + 1] + 4.f * WavCoeffs_LL[dir][(i + 2) * W_L + j + 1] + 4.f * WavCoeffs_LL[dir][(i + 2) * W_L + j - 1] - + 4.f * WavCoeffs_LL[dir][(i - 1) * W_L + j - 2] + 4.f * WavCoeffs_LL[dir][(i - 1) * W_L + j + 2] + 4.f * WavCoeffs_LL[dir][(i + 1) * W_L + j + 2] + 4.f * WavCoeffs_LL[dir][(i + 1) * W_L + j - 2] - + 2.f * WavCoeffs_LL[dir][(i - 2) * W_L + j - 2] + 2.f * WavCoeffs_LL[dir][(i - 2) * W_L + j + 2] + 2.f * WavCoeffs_LL[dir][(i + 2) * W_L + j - 2] + 2.f * WavCoeffs_LL[dir][(i + 2) * W_L + j + 2] - ) * 0.0062893f; - } - - - // apply to each direction Wavelet level : horizontal / vertiacle / diagonal + tmC[i][j] = c0 * WavCoeffs[i * W_L + j] + + c1 * ((WavCoeffs[(i - 1) * W_L + j] + WavCoeffs[(i + 1) * W_L + j]) + (WavCoeffs[i * W_L + j + 1] + WavCoeffs[i * W_L + j - 1])) + + c2 * ((WavCoeffs[(i - 1) * W_L + j - 1] + WavCoeffs[(i - 1) * W_L + j + 1]) + (WavCoeffs[(i + 1) * W_L + j - 1] + WavCoeffs[(i + 1) * W_L + j + 1])) + + c3 * ((WavCoeffs[(i - 2) * W_L + j] + WavCoeffs[(i + 2) * W_L + j]) + (WavCoeffs[i * W_L + j - 2] + WavCoeffs[i * W_L + j + 2])) + + c4 * ((WavCoeffs[(i - 2) * W_L + j - 1] + WavCoeffs[(i - 2) * W_L + j + 1]) + (WavCoeffs[(i + 2) * W_L + j + 1] + WavCoeffs[(i + 2) * W_L + j - 1]) + + (WavCoeffs[(i - 1) * W_L + j - 2] + WavCoeffs[(i - 1) * W_L + j + 2]) + (WavCoeffs[(i + 1) * W_L + j + 2] + WavCoeffs[(i + 1) * W_L + j - 2])) + + c5 * ((WavCoeffs[(i - 2) * W_L + j - 2] + WavCoeffs[(i - 2) * W_L + j + 2]) + (WavCoeffs[(i + 2) * W_L + j - 2] + WavCoeffs[(i + 2) * W_L + j + 2])); } } + } else { +#ifdef _OPENMP + #pragma omp parallel for if(multiThread) +#endif + for (int i = 0; i < H_L; i++) { + for (int j = 0; j < W_L; j++) { + koeLi[i * W_L + j] = 0.f; + } + } + return; } - } - float thr = 40.f; //avoid artifact eg. noise...to test - float thr2 = 1.5f * edd; //edd can be modified in option ed_detect - thr2 += gradw / 30.f; //to test - float diffFactor = (gradw / 100.f); - - for (int i = 0; i < H_L; i++) { + // fill borders with 1.f + int ii = 0; + for (; ii < borderL; ii++) { for (int j = 0; j < W_L; j++) { - koeLi[level * 3 + dir - 1][i * W_L + j] = 1.f; + koeLi[ii * W_L + j] = 1.f; } } + for (; ii < H_L - borderL; ii++) { + for (int j = 0; j < borderL; j++) { + koeLi[ii * W_L + j] = 1.f; + } + for (int j = W_L - borderL; j < W_L; j++) { + koeLi[ii * W_L + j] = 1.f; + } + } + for (; ii < H_L; ii++) { + for (int j = 0; j < W_L; j++) { + koeLi[ii * W_L + j] = 1.f; + } + } + + constexpr float thr = 40.f; //avoid artifact eg. noise...to test + const float thr2 = 1.5f * edd + gradw / 30.f; //edd can be modified in option ed_detect + const float diffFactor = gradw / 100.f; for (int i = borderL; i < H_L - borderL; i++) { for (int j = borderL; j < W_L - borderL; j++) { // my own algo : probably a little false, but simpler as Lipschitz ! // Thr2 = maximum of the function ==> Lipsitch says = probably edge - float temp = rtengine::max(std::fabs(WavCoeffs_LL[dir][i * W_L + j]), thr); - koeLi[level * 3 + dir - 1][i * W_L + j] = rtengine::min(thr2, std::fabs(tmC[i][j] / temp)); // limit maxi + float temp = rtengine::max(std::fabs(WavCoeffs[i * W_L + j]), thr); + koeLi[i * W_L + j] = rtengine::min(thr2, std::fabs(tmC[i][j] / temp)); // limit maxi //it will be more complicated to calculate both Wh and Wv, but we have also Wd==> pseudo Lipschitz - if (koeLi[level * 3 + dir - 1][i * W_L + j] > maxkoeLi) { - maxkoeLi = koeLi[level * 3 + dir - 1][i * W_L + j]; + if (koeLi[i * W_L + j] > maxkoeLi) { + maxkoeLi = koeLi[i * W_L + j]; } - float diff = maxkoeLi - koeLi[level * 3 + dir - 1][i * W_L + j]; + float diff = maxkoeLi - koeLi[i * W_L + j]; diff *= diffFactor; - koeLi[level * 3 + dir - 1][i * W_L + j] = maxkoeLi - diff; + koeLi[i * W_L + j] = maxkoeLi - diff; } } - } void ImProcFunctions::finalContAllL(float* const* WavCoeffs_L, float * WavCoeffs_L0, int level, int dir, const cont_params &cp, @@ -3093,10 +3114,13 @@ void ImProcFunctions::ContAllL(float *koeLi[12], float maxkoeLi, bool lipschitz, float atten01234 = 0.80f; value *= (atten01234 * scaleskip[1]); //for zoom < 100% reduce strength...I choose level 1...but!! } - + float edghig = settings->edghi;//increase or reduce "reinforce" + float edglow = settings->edglo;//increase or reduce "reduce" + float limrad = settings->limrad;//threshold action in function radius (rad) + printf("edghi=%f edglo=%f limrad=%f\n", edghig, edglow, limrad); // value *= beta; float edge = 1.f; - float lim0 = 20.f; //arbitrary limit for low radius and level between 2 or 3 to 30 maxi + float lim0 = limrad; //arbitrary limit for low radius and level between 2 or 3 to 30 maxi float lev = float (level); float repart = (float)cp.til; @@ -3104,15 +3128,14 @@ void ImProcFunctions::ContAllL(float *koeLi[12], float maxkoeLi, bool lipschitz, if (cp.reinforce != 2) { const float brepart = cp.reinforce == 1 - ? 3.f - : 0.5f; + ? edghig + : edglow; const float arepart = -(brepart - 1.f) / (lim0 / 60.f); - if (rad < lim0 / 60.f) { + if (rad < (lim0 / 60.f)) { repart *= (arepart * rad + brepart); //linear repartition of repart } } - float al0 = 1.f + (repart) / 50.f; float al10 = 1.0f; //arbitrary value ==> less = take into account high levels // float ak =-(al0-al10)/10.f;//10 = maximum levels @@ -3120,15 +3143,16 @@ void ImProcFunctions::ContAllL(float *koeLi[12], float maxkoeLi, bool lipschitz, float bk = al0; float koef = ak * level + bk; //modulate for levels : more levels high, more koef low ==> concentrated action on low levels, without or near for high levels float expkoef = -std::pow(std::fabs(rad - lev), koef); //reduce effect for high levels + printf("repart=%f\n", repart); if (cp.reinforce == 3) { - if (rad < lim0 / 60.f && level == 0) { + if (rad < (lim0 / 60.f) && level == 0) { expkoef *= abs(repart); //reduce effect for low values of rad and level=0==> quasi only level 1 is effective } } if (cp.reinforce == 1) { - if (rad < lim0 / 60.f && level == 1) { + if (rad < (lim0 / 60.f) && level == 1) { expkoef /= repart; //increase effect for low values of rad and level=1==> quasi only level 0 is effective } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index dbdd5161f..b64748d22 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -946,7 +946,7 @@ enum ProcEventCode { Evlocallabsigmalc2 = 920, Evlocallabblwh = 921, EvlocallabcomplexityWithRefresh = 922, - EvlocallabcomplexityWithoutRefresh = 923, + // EvlocallabcomplexityWithoutRefresh = 923, EvLocallabSpotcolorscope = 924, EvlocallabshowmasktypMethod = 925, Evlocallabshadmaskblsha = 926, diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 863c7fc79..acad7d34d 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -459,6 +459,7 @@ RetinexParams::RetinexParams() : shadows(0), stonalwidth(80), radius(40), + complexmethod("normal"), retinexMethod("high"), retinexcolorspace("Lab"), gammaretinex("none"), @@ -496,6 +497,7 @@ bool RetinexParams::operator ==(const RetinexParams& other) const && shadows == other.shadows && stonalwidth == other.stonalwidth && radius == other.radius + && complexmethod == other.complexmethod && retinexMethod == other.retinexMethod && retinexcolorspace == other.retinexcolorspace && gammaretinex == other.gammaretinex @@ -2395,6 +2397,7 @@ WaveletParams::WaveletParams() : CLmethod("all"), Backmethod("grey"), Tilesmethod("full"), + complexmethod("normal"), daubcoeffmethod("4_"), CHmethod("without"), Medgreinf("less"), @@ -2527,6 +2530,7 @@ bool WaveletParams::operator ==(const WaveletParams& other) const && CLmethod == other.CLmethod && Backmethod == other.Backmethod && Tilesmethod == other.Tilesmethod + && complexmethod == other.complexmethod && daubcoeffmethod == other.daubcoeffmethod && CHmethod == other.CHmethod && Medgreinf == other.Medgreinf @@ -2652,7 +2656,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : // Color & Light visicolor(false), expcolor(false), - complexcolor(0), + complexcolor(2), curvactiv(false), lightness(0), contrast(0), @@ -3289,7 +3293,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : scaltm(1.0), rewei(0), satur(0.), - sensitm(30), + sensitm(60), softradiustm(0.0), amount(95.), equiltm(true), @@ -5025,6 +5029,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->retinex.limd, "Retinex", "Limd", retinex.limd, keyFile); saveToKeyfile(!pedited || pedited->retinex.highl, "Retinex", "highl", retinex.highl, keyFile); saveToKeyfile(!pedited || pedited->retinex.skal, "Retinex", "skal", retinex.skal, keyFile); + saveToKeyfile(!pedited || pedited->retinex.complexmethod, "Retinex", "complexMethod", retinex.complexmethod, keyFile); saveToKeyfile(!pedited || pedited->retinex.retinexMethod, "Retinex", "RetinexMethod", retinex.retinexMethod, keyFile); saveToKeyfile(!pedited || pedited->retinex.mapMethod, "Retinex", "mapMethod", retinex.mapMethod, keyFile); saveToKeyfile(!pedited || pedited->retinex.viewMethod, "Retinex", "viewMethod", retinex.viewMethod, keyFile); @@ -5988,6 +5993,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->wavelet.iter, "Wavelet", "Iter", wavelet.iter, keyFile); saveToKeyfile(!pedited || pedited->wavelet.thres, "Wavelet", "MaxLev", wavelet.thres, keyFile); saveToKeyfile(!pedited || pedited->wavelet.Tilesmethod, "Wavelet", "TilesMethod", wavelet.Tilesmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.complexmethod, "Wavelet", "complexMethod", wavelet.complexmethod, keyFile); saveToKeyfile(!pedited || pedited->wavelet.daubcoeffmethod, "Wavelet", "DaubMethod", wavelet.daubcoeffmethod, keyFile); saveToKeyfile(!pedited || pedited->wavelet.CLmethod, "Wavelet", "ChoiceLevMethod", wavelet.CLmethod, keyFile); saveToKeyfile(!pedited || pedited->wavelet.Backmethod, "Wavelet", "BackMethod", wavelet.Backmethod, keyFile); @@ -6494,6 +6500,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) if (keyFile.has_group("Retinex")) { assignFromKeyfile(keyFile, "Retinex", "Median", pedited, retinex.medianmap, pedited->retinex.medianmap); + assignFromKeyfile(keyFile, "Retinex", "complexMethod", pedited, retinex.complexmethod, pedited->retinex.complexmethod); assignFromKeyfile(keyFile, "Retinex", "RetinexMethod", pedited, retinex.retinexMethod, pedited->retinex.retinexMethod); assignFromKeyfile(keyFile, "Retinex", "mapMethod", pedited, retinex.mapMethod, pedited->retinex.mapMethod); assignFromKeyfile(keyFile, "Retinex", "viewMethod", pedited, retinex.viewMethod, pedited->retinex.viewMethod); @@ -7858,6 +7865,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Wavelet", "ChoiceLevMethod", pedited, wavelet.CLmethod, pedited->wavelet.CLmethod); assignFromKeyfile(keyFile, "Wavelet", "BackMethod", pedited, wavelet.Backmethod, pedited->wavelet.Backmethod); assignFromKeyfile(keyFile, "Wavelet", "TilesMethod", pedited, wavelet.Tilesmethod, pedited->wavelet.Tilesmethod); + assignFromKeyfile(keyFile, "Wavelet", "complexMethod", pedited, wavelet.complexmethod, pedited->wavelet.complexmethod); assignFromKeyfile(keyFile, "Wavelet", "DaubMethod", pedited, wavelet.daubcoeffmethod, pedited->wavelet.daubcoeffmethod); assignFromKeyfile(keyFile, "Wavelet", "CHromaMethod", pedited, wavelet.CHmethod, pedited->wavelet.CHmethod); assignFromKeyfile(keyFile, "Wavelet", "Medgreinf", pedited, wavelet.Medgreinf, pedited->wavelet.Medgreinf); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 7d609494e..0af03eaee 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -336,6 +336,7 @@ struct RetinexParams { int stonalwidth; int radius; + Glib::ustring complexmethod; Glib::ustring retinexMethod; Glib::ustring retinexcolorspace; Glib::ustring gammaretinex; @@ -1790,6 +1791,7 @@ struct WaveletParams { Glib::ustring CLmethod; Glib::ustring Backmethod; Glib::ustring Tilesmethod; + Glib::ustring complexmethod; Glib::ustring daubcoeffmethod; Glib::ustring CHmethod; Glib::ustring Medgreinf; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 4b48d7740..1be81a7de 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -950,7 +950,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabsigmalc2 LUMINANCECURVE, // Evlocallabblwh LUMINANCECURVE, // EvlocallabcomplexityWithRefresh - M_VOID, // EvlocallabcomplexityWithoutRefresh + 0, // can be reused LUMINANCECURVE, // EvLocallabSpotcolorscope LUMINANCECURVE, // EvlocallabshowmasktypMethod LUMINANCECURVE, // Evlocallabshadmaskblsha @@ -982,7 +982,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabblendmaskab LUMINANCECURVE, // EvLocallabSpotprevMethod LUMINANCECURVE, // Evlocallabactiv - LUMINANCECURVE // EvlocallabCHshape + LUMINANCECURVE, // EvlocallabCHshape }; diff --git a/rtengine/rescale.h b/rtengine/rescale.h index 2138cd8e8..3126a7c58 100644 --- a/rtengine/rescale.h +++ b/rtengine/rescale.h @@ -31,8 +31,8 @@ namespace rtengine inline float getBilinearValue(const array2D &src, float x, float y) { - const int W = src.width(); - const int H = src.height(); + const int W = src.getWidth(); + const int H = src.getHeight(); // Get integer and fractional parts of numbers int xi = x; @@ -57,10 +57,10 @@ inline float getBilinearValue(const array2D &src, float x, float y) inline void rescaleBilinear(const array2D &src, array2D &dst, bool multithread) { - const int Ws = src.width(); - const int Hs = src.height(); - const int Wd = dst.width(); - const int Hd = dst.height(); + const int Ws = src.getWidth(); + const int Hs = src.getHeight(); + const int Wd = dst.getWidth(); + const int Hd = dst.getHeight(); float col_scale = float (Ws) / float (Wd); float row_scale = float (Hs) / float (Hd); @@ -81,10 +81,10 @@ inline void rescaleBilinear(const array2D &src, array2D &dst, bool inline void rescaleNearest(const array2D &src, array2D &dst, bool multithread) { - const int width = src.width(); - const int height = src.height(); - const int nw = dst.width(); - const int nh = dst.height(); + const int width = src.getWidth(); + const int height = src.getHeight(); + const int nw = dst.getWidth(); + const int nh = dst.getHeight(); #ifdef _OPENMP #pragma omp parallel for if (multithread) diff --git a/rtengine/settings.h b/rtengine/settings.h index fde6fa132..0fb4996df 100644 --- a/rtengine/settings.h +++ b/rtengine/settings.h @@ -99,6 +99,10 @@ public: int itcwb_delta; bool itcwb_stdobserver10; int itcwb_precis; +//wavelet levels + double edghi; + double edglo; + double limrad; enum class ThumbnailInspectorMode { diff --git a/rtengine/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index bef41d953..f49fe9c53 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -123,12 +123,12 @@ public: int getRows() const { - return const_cast(*this).height(); + return const_cast(*this).getHeight(); } int getCols() const { - return const_cast(*this).width(); + return const_cast(*this).getWidth(); } float *data() diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index 89e851e2e..0b66eb986 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -95,6 +95,7 @@ ControlSpotPanel::ControlSpotPanel(): preview_(Gtk::manage(new Gtk::ToggleButton(M("TP_LOCALLAB_PREVIEW")))), ctboxshape(Gtk::manage(new Gtk::HBox())), + ctboxshapemethod(Gtk::manage(new Gtk::HBox())), controlPanelListener(nullptr), lastObject_(-1), @@ -250,7 +251,7 @@ ControlSpotPanel::ControlSpotPanel(): pack_start(*excluFrame); - Gtk::HBox* const ctboxshapemethod = Gtk::manage(new Gtk::HBox()); +// Gtk::HBox* const ctboxshapemethod = Gtk::manage(new Gtk::HBox()); Gtk::Label* const labelshapemethod = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_STYPE") + ":")); ctboxshapemethod->pack_start(*labelshapemethod, Gtk::PACK_SHRINK, 4); @@ -914,6 +915,7 @@ void ControlSpotPanel::prevMethodChanged() expMaskMerge_->hide(); circrad_->hide(); ctboxshape->hide(); + shapeMethod_->set_active(0); } else { // Excluding case expTransGrad_->show(); @@ -1730,6 +1732,25 @@ void ControlSpotPanel::setParamEditable(bool cond) savrest_->set_sensitive(cond); complexMethod_->set_sensitive(cond); wavMethod_->set_sensitive(cond); + preview_->set_sensitive(cond); + + if (!cond) { + // Reset complex parameters visibility to default state + expTransGrad_->hide(); + expShapeDetect_->hide(); + expSpecCases_->hide(); + expMaskMerge_->hide(); + circrad_->hide(); + ctboxshape->hide(); + excluFrame->hide(); +// ctboxshapemethod->hide(); + locX_->hide(); + locXL_->hide(); + locY_->hide(); + locYT_->hide(); + centerX_->hide(); + centerY_->hide(); + } } void ControlSpotPanel::setDefaultExpanderVisibility() diff --git a/rtgui/controlspotpanel.h b/rtgui/controlspotpanel.h index 81a79fb61..720bdf0c1 100644 --- a/rtgui/controlspotpanel.h +++ b/rtgui/controlspotpanel.h @@ -419,6 +419,7 @@ private: sigc::connection previewConn_; Gtk::HBox* const ctboxshape; + Gtk::HBox* const ctboxshapemethod; // Internal variables ControlPanelListener* controlPanelListener; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 0c35b5bba..42574d15c 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . - * 2019 Pierre Cabrera + * 2019-2020 Pierre Cabrera */ #include "locallabtools.h" @@ -149,7 +149,8 @@ LocallabTool::LocallabTool(Gtk::Box* content, Glib::ustring toolName, Glib::ustr if (needMode) { complexity->append(M("TP_LOCALLAB_MODE_EXPERT")); complexity->append(M("TP_LOCALLAB_MODE_NORMAL")); - complexity->set_active(0); + complexity->append(M("TP_LOCALLAB_MODE_SIMPLE")); + complexity->set_active(2); complexity->setPreferredWidth(100, -1); complexityConn = complexity->signal_changed().connect(sigc::mem_fun(*this, &LocallabTool::complexityModeChanged)); titleBox->pack_end(*complexity, Gtk::PACK_SHRINK, 2); @@ -201,9 +202,15 @@ void LocallabTool::addLocallabTool(bool raiseEvent) if (complexity->get_active_row_number() == Normal) { convertParamToNormal(); updateGUIToMode(Normal); - } else { + } else if (complexity->get_active_row_number() == Expert) { updateGUIToMode(Expert); + } else if (complexity->get_active_row_number() == Simple) { + convertParamToNormal(); + updateGUIToMode(Normal); + convertParamToSimple(); + updateGUIToMode(Simple); } + } if (listener) { @@ -253,7 +260,7 @@ void LocallabTool::refChanged(const double huer, const double lumar, const doubl // Hue reference normalization (between 0 and 1) double normHuer = huer; float h = Color::huelab_to_huehsv2(normHuer); - // h += 1.f / 6.f; + // h += 1.f / 6.f; if (h > 1.f) { h -= 1.f; @@ -359,25 +366,42 @@ void LocallabTool::foldThemAll(GdkEventButton* event) void LocallabTool::complexityModeChanged() { - if (complexity->get_active_row_number() == Normal) { // New selected mode is Normal one + if (complexity->get_active_row_number() == Simple) { // New selected mode is Simple one + const bool maskPreviewActivated = isMaskViewActive(); + + // Convert tool widget parameters + convertParamToNormal(); // From Expert mode to Normal mode + convertParamToSimple(); // From Normal mode to Simple mode + // Update GUI based on new mode + updateGUIToMode(Simple); + + if (maskPreviewActivated) { + // This event is called to transmit reset mask state + if (listener) { + listener->panelChanged(EvlocallabshowmaskMethod, ""); + } + } + + if (listener && isLocActivated) { + listener->panelChanged(EvlocallabcomplexityWithRefresh, + M("TP_LOCALLAB_MODE_SIMPLE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } else if (complexity->get_active_row_number() == Normal) { // New selected mode is Normal one // Convert tool widget parameters convertParamToNormal(); - // Update GUI based on new mode updateGUIToMode(Normal); - // Raise event with refreshing - if (listener) { + if (listener && isLocActivated) { listener->panelChanged(EvlocallabcomplexityWithRefresh, M("TP_LOCALLAB_MODE_NORMAL") + " (" + escapeHtmlChars(spotName) + ")"); } - } else { // New selected mode is Expert one + } else if (complexity->get_active_row_number() == Expert) { // New selected mode is Expert one // Update GUI based on new mode updateGUIToMode(Expert); - // Raise event without refreshing - if (listener) { - listener->panelChanged(EvlocallabcomplexityWithoutRefresh, + if (listener && isLocActivated) { + listener->panelChanged(EvlocallabcomplexityWithRefresh, M("TP_LOCALLAB_MODE_EXPERT") + " (" + escapeHtmlChars(spotName) + ")"); } } @@ -389,10 +413,10 @@ LocallabColor::LocallabColor(): // Color & Light specific widgets lumFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LUMFRA")))), - curvactiv(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_CURV")))), lightness(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LIGHTNESS"), -100, 500, 1, 0))), contrast(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTRAST"), -100, 100, 1, 0))), chroma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMA"), -100, 150, 1, 0))), + curvactiv(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_CURV")))), gridFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABGRID")))), labgrid(Gtk::manage(new LabGrid(EvLocallabLabGridValue, M("TP_LOCALLAB_LABGRID_VALUES")))), gridMethod(Gtk::manage(new MyComboBoxText())), @@ -418,10 +442,10 @@ LocallabColor::LocallabColor(): lcshape(static_cast(clCurveEditorG->addCurve(CT_Diagonal, "L(C)"))), HCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_HLH"))), LHshape(static_cast(HCurveEditorG->addCurve(CT_Flat, "L(H)", nullptr, false, true))), - H2CurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_HLH"))), - HHshape(static_cast(H2CurveEditorG->addCurve(CT_Flat, "H(H)", nullptr, false, true))), H3CurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_HLH"))), CHshape(static_cast(H3CurveEditorG->addCurve(CT_Flat, "C(H)", nullptr, false, true))), + H2CurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_HLH"))), + HHshape(static_cast(H2CurveEditorG->addCurve(CT_Flat, "H(H)", nullptr, false, true))), rgbCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_RGB"))), toneMethod(Gtk::manage(new MyComboBoxText())), rgbshape(static_cast(rgbCurveEditorG->addCurve(CT_Diagonal, "", toneMethod))), @@ -479,7 +503,6 @@ LocallabColor::LocallabColor(): const LocallabParams::LocallabSpot defSpot; // Parameter Color & Light specific widgets - curvactivConn = curvactiv->signal_toggled().connect(sigc::mem_fun(*this, &LocallabColor::curvactivChanged)); lumFrame->set_label_align(0.025, 0.5); lightness->setAdjusterListener(this); @@ -488,6 +511,8 @@ LocallabColor::LocallabColor(): chroma->setAdjusterListener(this); + curvactivConn = curvactiv->signal_toggled().connect(sigc::mem_fun(*this, &LocallabColor::curvactivChanged)); + gridFrame->set_label_align(0.025, 0.5); gridMethod->append(M("TP_LOCALLAB_GRIDONE")); @@ -566,16 +591,6 @@ LocallabColor::LocallabColor(): HCurveEditorG->curveListComplete(); - H2CurveEditorG->setCurveListener(this); - - HHshape->setIdentityValue(0.); - HHshape->setResetCurve(FlatCurveType(defSpot.HHcurve.at(0)), defSpot.HHcurve); - HHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); - HHshape->setCurveColorProvider(this, 3); - HHshape->setBottomBarBgGradient(six_shape); - - H2CurveEditorG->curveListComplete(); - H3CurveEditorG->setCurveListener(this); CHshape->setIdentityValue(0.); @@ -586,6 +601,16 @@ LocallabColor::LocallabColor(): H3CurveEditorG->curveListComplete(); + H2CurveEditorG->setCurveListener(this); + + HHshape->setIdentityValue(0.); + HHshape->setResetCurve(FlatCurveType(defSpot.HHcurve.at(0)), defSpot.HHcurve); + HHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); + HHshape->setCurveColorProvider(this, 3); + HHshape->setBottomBarBgGradient(six_shape); + + H2CurveEditorG->curveListComplete(); + rgbCurveEditorG->setCurveListener(this); toneMethod->append(M("TP_EXPOSURE_TCMODE_STANDARD")); @@ -607,7 +632,7 @@ LocallabColor::LocallabColor(): setExpandAlignProperties(expmaskcol1, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); merMethod->append(M("TP_LOCALLAB_MRONE")); -// merMethod->append(M("TP_LOCALLAB_MRTWO")); + // merMethod->append(M("TP_LOCALLAB_MRTWO")); merMethod->append(M("TP_LOCALLAB_MRTHR")); merMethod->append(M("TP_LOCALLAB_MRFOU")); merMethod->append(M("TP_LOCALLAB_MRFIV")); @@ -699,7 +724,6 @@ LocallabColor::LocallabColor(): blendmaskcol->setAdjusterListener(this); - // radmaskcol->setLogScale(10, -10); radmaskcol->setAdjusterListener(this); lapmaskcol->setAdjusterListener(this); @@ -716,7 +740,6 @@ LocallabColor::LocallabColor(): HHhmaskshape->setIdentityValue(0.); HHhmaskshape->setResetCurve(FlatCurveType(defSpot.HHhmaskcurve.at(0)), defSpot.HHhmaskcurve); -// HHhmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); HHhmaskshape->setCurveColorProvider(this, 2); HHhmaskshape->setBottomBarColorProvider(this, 2); @@ -741,17 +764,16 @@ LocallabColor::LocallabColor(): csThresholdcol->setAdjusterListener(this); // Add Color & Light specific widgets to GUI - Gtk::Frame* const superFrame = Gtk::manage(new Gtk::Frame()); - superFrame->set_label_align(0.025, 0.5); - // superFrame->set_label_widget(*curvactiv); ToolParamBlock* const lumBox = Gtk::manage(new ToolParamBlock()); lumBox->pack_start(*lightness); lumBox->pack_start(*contrast); lumBox->pack_start(*chroma); lumFrame->add(*lumBox); pack_start(*lumFrame); + Gtk::Frame* const superFrame = Gtk::manage(new Gtk::Frame()); + superFrame->set_label_align(0.025, 0.5); + // superFrame->set_label_widget(*curvactiv); ToolParamBlock* const superBox = Gtk::manage(new ToolParamBlock()); - ToolParamBlock* const gridBox = Gtk::manage(new ToolParamBlock()); gridBox->pack_start(*labgrid); gridBox->pack_start(*gridMethod); @@ -760,7 +782,7 @@ LocallabColor::LocallabColor(): superBox->pack_start(*gridFrame); superFrame->add(*superBox); pack_start(*superFrame); -// pack_start(*sensi); + // pack_start(*sensi); pack_start(*structcol); pack_start(*blurcolde); pack_start(*softradiuscol); @@ -852,8 +874,8 @@ LocallabColor::~LocallabColor() delete llCurveEditorG; delete clCurveEditorG; delete HCurveEditorG; - delete H2CurveEditorG; delete H3CurveEditorG; + delete H2CurveEditorG; delete rgbCurveEditorG; delete maskCurveEditorG; delete maskHCurveEditorG; @@ -897,13 +919,13 @@ void LocallabColor::updateAdviceTooltips(const bool showTooltips) if (showTooltips) { lumFrame->set_tooltip_text(M("TP_LOCALLAB_EXPCOLOR_TOOLTIP")); lightness->set_tooltip_text(M("TP_LOCALLAB_LIGHTN_TOOLTIP")); - contrast->set_tooltip_text(M(" ")); - chroma->set_tooltip_text(M(" ")); - structcol->set_tooltip_text(M("TP_LOCALLAB_STRUCT_TOOLTIP")); sensi->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); + structcol->set_tooltip_text(M("TP_LOCALLAB_STRUCT_TOOLTIP")); strcol->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); angcol->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); qualitycurveMethod->set_tooltip_markup(M("TP_LOCALLAB_CURVEMETHOD_TOOLTIP")); + special->set_tooltip_text(M("TP_LOCALLAB_SPECIAL_TOOLTIP")); + expmaskcol1->set_tooltip_text(M("TP_LOCALLAB_EXPMERGEFILE_TOOLTIP")); mercol->set_tooltip_text(M("TP_LOCALLAB_MERGEMER_TOOLTIP")); opacol->set_tooltip_text(M("TP_LOCALLAB_MERGEOPA_TOOLTIP")); conthrcol->set_tooltip_text(M("TP_LOCALLAB_MERGEOPA_TOOLTIP")); @@ -912,20 +934,44 @@ void LocallabColor::updateAdviceTooltips(const bool showTooltips) CCmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); LLmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); HHmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - radmaskcol->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - lapmaskcol->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - Lmaskshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - LLmaskcolshapewav->setTooltip(M("TP_LOCALLAB_LMASK_LEVEL_TOOLTIP")); - expmaskcol1->set_tooltip_text(M("TP_LOCALLAB_EXPMERGEFILE_TOOLTIP")); - blendmaskcol->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); struFrame->set_tooltip_text(M("TP_LOCALLAB_STRUMASK_TOOLTIP")); blurFrame->set_tooltip_text(M("TP_LOCALLAB_BLURMASK_TOOLTIP")); + blendmaskcol->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); + radmaskcol->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + lapmaskcol->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); maskHCurveEditorG->set_tooltip_text(M("TP_LOCALLAB_HHMASK_TOOLTIP")); - mask2CurveEditorGwav->set_tooltip_text(M("TP_LOCALLAB_WAVMASK_TOOLTIP")); mask2CurveEditorG->set_tooltip_text(M("TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP")); - special->set_tooltip_text(M("TP_LOCALLAB_SPECIAL_TOOLTIP")); + Lmaskshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); + mask2CurveEditorGwav->set_tooltip_text(M("TP_LOCALLAB_WAVMASK_TOOLTIP")); + LLmaskcolshapewav->setTooltip(M("TP_LOCALLAB_LMASK_LEVEL_TOOLTIP")); } else { - exp->set_tooltip_text(""); + lumFrame->set_tooltip_text(""); + lightness->set_tooltip_text(""); + sensi->set_tooltip_text(""); + structcol->set_tooltip_text(""); + strcol->set_tooltip_text(""); + angcol->set_tooltip_text(""); + qualitycurveMethod->set_tooltip_text(""); + special->set_tooltip_text(""); + expmaskcol1->set_tooltip_text(""); + mercol->set_tooltip_text(""); + opacol->set_tooltip_text(""); + conthrcol->set_tooltip_text(""); + gridmerFrame->set_tooltip_text(""); + expmaskcol->set_tooltip_text(""); + CCmaskshape->setTooltip(""); + LLmaskshape->setTooltip(""); + HHmaskshape->setTooltip(""); + struFrame->set_tooltip_text(""); + blurFrame->set_tooltip_text(""); + blendmaskcol->set_tooltip_text(""); + radmaskcol->set_tooltip_text(""); + lapmaskcol->set_tooltip_text(""); + maskHCurveEditorG->set_tooltip_text(""); + mask2CurveEditorG->set_tooltip_text(""); + Lmaskshape->setTooltip(""); + mask2CurveEditorGwav->set_tooltip_text(""); + LLmaskcolshapewav->setTooltip(""); } } @@ -992,10 +1038,10 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param exp->setEnabled(spot.expcolor); complexity->set_active(spot.complexcolor); - curvactiv->set_active(spot.curvactiv); lightness->setValue(spot.lightness); contrast->setValue(spot.contrast); chroma->setValue(spot.chroma); + curvactiv->set_active(spot.curvactiv); labgrid->setParams(spot.labgridALow / LocallabParams::LABGRIDL_CORR_MAX, spot.labgridBLow / LocallabParams::LABGRIDL_CORR_MAX, spot.labgridAHigh / LocallabParams::LABGRIDL_CORR_MAX, @@ -1048,8 +1094,8 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param if (spot.merMethod == "mone") { merMethod->set_active(0); -// } else if (spot.merMethod == "mtwo") { -// merMethod->set_active(1); + // } else if (spot.merMethod == "mtwo") { + // merMethod->set_active(1); } else if (spot.merMethod == "mthr") { merMethod->set_active(1); } else if (spot.merMethod == "mfou") { @@ -1161,10 +1207,10 @@ void LocallabColor::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pe spot.visicolor = exp->get_visible(); spot.complexcolor = complexity->get_active_row_number(); - spot.curvactiv = curvactiv->get_active(); spot.lightness = lightness->getIntValue(); spot.contrast = contrast->getIntValue(); spot.chroma = chroma->getIntValue(); + spot.curvactiv = curvactiv->get_active(); labgrid->getParams(spot.labgridALow, spot.labgridBLow, spot.labgridAHigh, @@ -1220,8 +1266,8 @@ void LocallabColor::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pe if (merMethod->get_active_row_number() == 0) { spot.merMethod = "mone"; -// } else if (merMethod->get_active_row_number() == 1) { -// spot.merMethod = "mtwo"; + // } else if (merMethod->get_active_row_number() == 1) { + // spot.merMethod = "mtwo"; } else if (merMethod->get_active_row_number() == 1) { spot.merMethod = "mthr"; } else if (merMethod->get_active_row_number() == 2) { @@ -1686,14 +1732,13 @@ void LocallabColor::convertParamToNormal() // Set hidden GUI widgets in Normal mode to default spot values blurcolde->setValue((double)defSpot.blurcolde); structcol->setValue((double)defSpot.structcol); - // softradiuscol->setValue(defSpot.softradiuscol); strcolab->setValue(defSpot.strcolab); strcolh->setValue(defSpot.strcolh); clshape->setCurve(defSpot.clcurve); lcshape->setCurve(defSpot.lccurve); LHshape->setCurve(defSpot.LHcurve); - HHshape->setCurve(defSpot.HHcurve); CHshape->setCurve(defSpot.CHcurve); + HHshape->setCurve(defSpot.HHcurve); if (defSpot.toneMethod == "one") { toneMethod->set_active(0); @@ -1710,8 +1755,8 @@ void LocallabColor::convertParamToNormal() if (defSpot.merMethod == "mone") { merMethod->set_active(0); -// } else if (defSpot.merMethod == "mtwo") { -// merMethod->set_active(1); + // } else if (defSpot.merMethod == "mtwo") { + // merMethod->set_active(1); } else if (defSpot.merMethod == "mthr") { merMethod->set_active(1); } else if (defSpot.merMethod == "mfou") { @@ -1795,66 +1840,128 @@ void LocallabColor::convertParamToNormal() updateColorGUI3(); } +void LocallabColor::convertParamToSimple() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden specific GUI widgets in Simple mode to default spot values + softradiuscol->setValue(defSpot.softradiuscol); + strcol->setValue(defSpot.strcol); + angcol->setValue(defSpot.angcol); + + if (defSpot.qualitycurveMethod == "none") { + qualitycurveMethod->set_active(0); + } else if (defSpot.qualitycurveMethod == "std") { + qualitycurveMethod->set_active(1); + } + + llshape->setCurve(defSpot.llcurve); + ccshape->setCurve(defSpot.cccurve); + showmaskcolMethod->set_active(0); + showmaskcolMethodinv->set_active(0); + enaColorMask->set_active(defSpot.enaColorMask); + CCmaskshape->setCurve(defSpot.CCmaskcurve); + LLmaskshape->setCurve(defSpot.LLmaskcurve); + HHmaskshape->setCurve(defSpot.HHmaskcurve); + blendmaskcol->setValue((double)defSpot.blendmaskcol); + radmaskcol->setValue(defSpot.radmaskcol); + chromaskcol->setValue(defSpot.chromaskcol); + Lmaskshape->setCurve(defSpot.Lmaskcurve); + + // Enable all listeners + enableListener(); +} + void LocallabColor::updateGUIToMode(const modeType new_type) { - if (new_type == Normal) { - // Advanced widgets are hidden in Normal mode - blurcolde->hide(); - softradiuscol->show(); - strcolab->hide(); - strcolh->hide(); - clCurveEditorG->hide(); - HCurveEditorG->hide(); - H2CurveEditorG->hide(); - H3CurveEditorG->hide(); - rgbCurveEditorG->hide(); - special->hide(); - expmaskcol1->hide(); - struFrame->hide(); - blurFrame->hide(); - lapmaskcol->hide(); - gammaskcol->hide(); - slomaskcol->hide(); - shadmaskcol->hide(); - maskHCurveEditorG->hide(); - mask2CurveEditorGwav->hide(); - csThresholdcol->hide(); - structcol->hide(); - } else { - // Advanced widgets are shown in Expert mode - blurcolde->show(); - structcol->show(); + switch (new_type) { + case Simple: + // Expert and Normal mode widgets are hidden in Simple mode + structcol->hide(); + blurcolde->hide(); + softradiuscol->hide(); + expgradcol->hide(); + expcurvcol->hide(); + expmaskcol1->hide(); + expmaskcol->hide(); - if (!invers->get_active()) { // Keep widget hidden when invers is toggled + break; + + case Normal: + // Expert mode widgets are hidden in Normal mode + structcol->hide(); + blurcolde->hide(); + strcolab->hide(); + strcolh->hide(); + clCurveEditorG->hide(); + HCurveEditorG->hide(); + H3CurveEditorG->hide(); + H2CurveEditorG->hide(); + rgbCurveEditorG->hide(); + special->hide(); + expmaskcol1->hide(); + struFrame->hide(); + blurFrame->hide(); + lapmaskcol->hide(); + gammaskcol->hide(); + slomaskcol->hide(); + shadmaskcol->hide(); + maskHCurveEditorG->hide(); + mask2CurveEditorGwav->hide(); + csThresholdcol->hide(); + // Specific Simple mode widgets are shown in Normal mode softradiuscol->show(); - } - strcolab->show(); - strcolh->show(); + if (!invers->get_active()) { // Keep widget hidden when invers is toggled + expgradcol->show(); + } - if (!invers->get_active()) { // Keep widgets hidden when invers is toggled - clCurveEditorG->show(); - HCurveEditorG->show(); - H3CurveEditorG->show(); - } + expcurvcol->show(); + expmaskcol->show(); - H2CurveEditorG->show(); - rgbCurveEditorG->show(); - special->show(); + break; - if (!invers->get_active()) { // Keep widget hidden when invers is toggled - expmaskcol1->show(); - } + case Expert: + // Show widgets hidden in Normal and Simple mode + structcol->show(); + blurcolde->show(); - struFrame->show(); - blurFrame->show(); - lapmaskcol->show(); - gammaskcol->show(); - slomaskcol->show(); - shadmaskcol->show(); - maskHCurveEditorG->show(); - mask2CurveEditorGwav->show(); - csThresholdcol->show(); + if (!invers->get_active()) { // Keep widget hidden when invers is toggled + softradiuscol->show(); + expgradcol->show(); + } + + strcolab->show(); + strcolh->show(); + expcurvcol->show(); + + if (!invers->get_active()) { // Keep widgets hidden when invers is toggled + clCurveEditorG->show(); + HCurveEditorG->show(); + H3CurveEditorG->show(); + } + + H2CurveEditorG->show(); + rgbCurveEditorG->show(); + special->show(); + + if (!invers->get_active()) { // Keep widget hidden when invers is toggled + expmaskcol1->show(); + } + + expmaskcol->show(); + struFrame->show(); + blurFrame->show(); + lapmaskcol->show(); + gammaskcol->show(); + slomaskcol->show(); + shadmaskcol->show(); + maskHCurveEditorG->show(); + mask2CurveEditorGwav->show(); + csThresholdcol->show(); } } @@ -1864,13 +1971,12 @@ void LocallabColor::updateMaskBackground(const double normChromar, const double [this, normHuer, normLumar, normChromar]() -> bool { GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected - // Update mask background and H curves + // Update mask background CCmaskshape->updateLocallabBackground(normChromar); LLmaskshape->updateLocallabBackground(normLumar); HHmaskshape->updateLocallabBackground(normHuer); HHhmaskshape->updateLocallabBackground(normHuer); Lmaskshape->updateLocallabBackground(normLumar); - //H curves HHshape->updateLocallabBackground(normHuer); CHshape->updateLocallabBackground(normHuer); LHshape->updateLocallabBackground(normHuer); @@ -1878,7 +1984,7 @@ void LocallabColor::updateMaskBackground(const double normChromar, const double ccshape->updateLocallabBackground(normChromar); clshape->updateLocallabBackground(normLumar); lcshape->updateLocallabBackground(normChromar); - + return false; } ); @@ -1911,11 +2017,16 @@ void LocallabColor::gridMethodChanged() void LocallabColor::inversChanged() { - updateColorGUI1(); // Update GUI according to invers button state + const bool maskPreviewActivated = isMaskViewActive(); - // This event is called to transmit potentially reset mask state - if (listener) { - listener->panelChanged(EvlocallabshowmaskMethod, ""); + // Update GUI according to invers button state + updateColorGUI1(); + + if (maskPreviewActivated) { + // This event is called to transmit reset mask state + if (listener) { + listener->panelChanged(EvlocallabshowmaskMethod, ""); + } } if (isLocActivated && exp->getEnabled()) { @@ -2094,18 +2205,20 @@ void LocallabColor::updateColorGUI1() blurcol->hide(); } else { gridFrame->show(); - structcol->show(); - if (mode == Normal) { // Keep widget hidden in Normal mode - softradiuscol->show(); - structcol->hide(); + if (mode == Expert) { // Keep widget hidden in Normal and Simple mode + structcol->show(); + } + + if (mode == Expert || mode == Normal) { // Keep widget hidden in Simple mode + softradiuscol->show(); + expgradcol->show(); } - expgradcol->show(); labqualcurv->show(); qualitycurveMethod->show(); - if (mode == Normal) { // Keep widgets hidden in Normal mode + if (mode == Expert) { // Keep widgets hidden in Normal and Simple mode clCurveEditorG->show(); HCurveEditorG->show(); H3CurveEditorG->show(); @@ -2136,17 +2249,18 @@ void LocallabColor::updateColorGUI2() conthrcol->hide(); gridmerFrame->hide(); break; -/* - case 1: - invers->set_sensitive(false); - H2CurveEditorG->set_sensitive(true); - rgbCurveEditorG->set_sensitive(true); - special->set_sensitive(true); - mask7->hide(); - conthrcol->hide(); - gridmerFrame->hide(); - break; -*/ + + /* + case 1: + invers->set_sensitive(false); + H2CurveEditorG->set_sensitive(true); + rgbCurveEditorG->set_sensitive(true); + special->set_sensitive(true); + mask7->hide(); + conthrcol->hide(); + gridmerFrame->hide(); + break; + */ case 1: invers->set_sensitive(false); H2CurveEditorG->set_sensitive(true); @@ -2212,7 +2326,7 @@ LocallabExposure::LocallabExposure(): structexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))), blurexpde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))), exptoolexp(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_EXPTOOL")))), - expcomp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_EXPCOMP"), MINEXP, MAXEXP, 0.01, 0.))), + expcomp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_EXPCOMP"), MINEXP, MAXEXP, 0.01, 0.))), black(Gtk::manage(new Adjuster(M("TP_EXPOSURE_BLACKLEVEL"), -16384, 32768, 10, 0))), hlcompr(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 20))), hlcomprthresh(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 0))), @@ -2289,8 +2403,6 @@ LocallabExposure::LocallabExposure(): setExpandAlignProperties(exptoolexp, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - // expcomp->setLogScale(10, 0); - expcomp->setAdjusterListener(this); black->setAdjusterListener(this); @@ -2367,7 +2479,6 @@ LocallabExposure::LocallabExposure(): blendmaskexp->setAdjusterListener(this); - //radmaskexp->setLogScale(10, -10); radmaskexp->setAdjusterListener(this); lapmaskexp->setAdjusterListener(this); @@ -2419,7 +2530,6 @@ LocallabExposure::LocallabExposure(): pack_start(*structexp); pack_start(*blurexpde); ToolParamBlock* const toolBox = Gtk::manage(new ToolParamBlock()); -// toolBox->pack_start(*expcomp); toolBox->pack_start(*black); toolBox->pack_start(*hlcompr); toolBox->pack_start(*hlcomprthresh); @@ -2492,32 +2602,56 @@ void LocallabExposure::updateAdviceTooltips(const bool showTooltips) { if (showTooltips) { exp->set_tooltip_text(M("TP_LOCALLAB_EXPOSURE_TOOLTIP")); - expcomp->set_tooltip_text(M("TP_LOCALLAB_EXPCOMP_TOOLTIP")); expMethod->set_tooltip_text(M("TP_LOCALLAB_EXPMETHOD_TOOLTIP")); - structexp->set_tooltip_text(M("TP_LOCALLAB_STRUCT_TOOLTIP")); pdeFrame->set_tooltip_text(M("TP_LOCALLAB_PDEFRAME_TOOLTIP")); laplacexp->set_tooltip_text(M("TP_LOCALLAB_EXPLAP_TOOLTIP")); + linear->set_tooltip_text(M("TP_LOCALLAB_EXPLAPLIN_TOOLTIP")); balanexp->set_tooltip_text(M("TP_LOCALLAB_EXPLAPBAL_TOOLTIP")); gamm->set_tooltip_text(M("TP_LOCALLAB_EXPLAPGAMM_TOOLTIP")); - linear->set_tooltip_text(M("TP_LOCALLAB_EXPLAPLIN_TOOLTIP")); exnoiseMethod->set_tooltip_text(M("TP_LOCALLAB_EXPNOISEMETHOD_TOOLTIP")); fatFrame->set_tooltip_text(M("TP_LOCALLAB_FATFRAME_TOOLTIP")); + expcomp->set_tooltip_text(M("TP_LOCALLAB_EXPCOMP_TOOLTIP")); sensiex->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); + structexp->set_tooltip_text(M("TP_LOCALLAB_STRUCT_TOOLTIP")); + expchroma->set_tooltip_text(M("TP_LOCALLAB_EXPCHROMA_TOOLTIP")); shapeexpos->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_TONES_TOOLTIP")); strexp->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); expmaskexp->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); CCmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); LLmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); HHmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + blendmaskexp->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); radmaskexp->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); lapmaskexp->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); strmaskexp->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); - Lmaskexpshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - blendmaskexp->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); mask2expCurveEditorG->set_tooltip_text(M("TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP")); - expchroma->set_tooltip_text(M("TP_LOCALLAB_EXPCHROMA_TOOLTIP")); + Lmaskexpshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); } else { exp->set_tooltip_text(""); + expMethod->set_tooltip_text(""); + pdeFrame->set_tooltip_text(""); + laplacexp->set_tooltip_text(""); + linear->set_tooltip_text(""); + balanexp->set_tooltip_text(""); + gamm->set_tooltip_text(""); + exnoiseMethod->set_tooltip_text(""); + fatFrame->set_tooltip_text(""); + expcomp->set_tooltip_text(""); + sensiex->set_tooltip_text(""); + structexp->set_tooltip_text(""); + expchroma->set_tooltip_text(""); + shapeexpos->setTooltip(""); + strexp->set_tooltip_text(""); + expmaskexp->set_tooltip_text(""); + CCmaskexpshape->setTooltip(""); + LLmaskexpshape->setTooltip(""); + HHmaskexpshape->setTooltip(""); + blendmaskexp->set_tooltip_text(""); + radmaskexp->set_tooltip_text(""); + lapmaskexp->set_tooltip_text(""); + strmaskexp->set_tooltip_text(""); + mask2expCurveEditorG->set_tooltip_text(""); + Lmaskexpshape->setTooltip(""); } } @@ -3029,18 +3163,38 @@ void LocallabExposure::convertParamToNormal() disableListener(); // Set hidden GUI widgets in Normal mode to default spot values + structexp->setValue((double)defSpot.structexp); blurexpde->setValue((double)defSpot.blurexpde); lapmaskexp->setValue(defSpot.lapmaskexp); gammaskexp->setValue(defSpot.gammaskexp); slomaskexp->setValue(defSpot.slomaskexp); strmaskexp->setValue(defSpot.strmaskexp); angmaskexp->setValue(defSpot.angmaskexp); - structexp->setValue((double)defSpot.structexp); - // laplacexp->setValue(defSpot.laplacexp); - // linear->setValue(defSpot.linear); - // balanexp->setValue(defSpot.balanexp); - // gamm->setValue(defSpot.gamm); + // Enable all listeners + enableListener(); +} + +void LocallabExposure::convertParamToSimple() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden specific GUI widgets in Simple mode to default spot values + strexp->setValue(defSpot.strexp); + angexp->setValue(defSpot.angexp); + softradiusexp->setValue(defSpot.softradiusexp); + enaExpMask->set_active(defSpot.enaExpMask); + enaExpMaskaft->set_active(defSpot.enaExpMaskaft); + CCmaskexpshape->setCurve(defSpot.CCmaskexpcurve); + LLmaskexpshape->setCurve(defSpot.CCmaskexpcurve); + HHmaskexpshape->setCurve(defSpot.HHmaskexpcurve); + blendmaskexp->setValue((double)defSpot.blendmaskexp); + radmaskexp->setValue(defSpot.radmaskexp); + chromaskexp->setValue(defSpot.chromaskexp); + Lmaskexpshape->setCurve(defSpot.Lmaskexpcurve); // Enable all listeners enableListener(); @@ -3048,24 +3202,54 @@ void LocallabExposure::convertParamToNormal() void LocallabExposure::updateGUIToMode(const modeType new_type) { - if (new_type == Normal) { - // Advanced widgets are hidden in Normal mode - lapmaskexp->hide(); - gammaskexp->hide(); - slomaskexp->hide(); - gradFramemask->hide(); - blurexpde->hide(); - structexp->hide(); - // pdeFrame->hide(); - } else { - // Advanced widgets are shown in Expert mode - lapmaskexp->show(); - gammaskexp->show(); - slomaskexp->show(); - gradFramemask->show(); - blurexpde->show(); - structexp->show(); - // pdeFrame->show(); + switch (new_type) { + case Simple: + // Expert and Normal mode widgets are hidden in Simple mode + structexp->hide(); + blurexpde->hide(); + expgradexp->hide(); + softradiusexp->hide(); + expmaskexp->hide(); + + break; + + case Normal: + // Expert mode widgets are hidden in Normal mode + structexp->hide(); + blurexpde->hide(); + lapmaskexp->hide(); + gammaskexp->hide(); + slomaskexp->hide(); + gradFramemask->hide(); + + // Specific Simple mode widgets are shown in Normal mode + if (!inversex->get_active()) { // Keep widget hidden when invers is toggled + expgradexp->show(); + softradiusexp->show(); + } + + expmaskexp->show(); + + break; + + case Expert: + // Show widgets hidden in Normal and Simple mode + if (!inversex->get_active()) { // Keep widget hidden when invers is toggled + structexp->show(); + } + + blurexpde->show(); + + if (!inversex->get_active()) { // Keep widget hidden when invers is toggled + expgradexp->show(); + softradiusexp->show(); + } + + expmaskexp->show(); + lapmaskexp->show(); + gammaskexp->show(); + slomaskexp->show(); + gradFramemask->show(); } } @@ -3111,19 +3295,18 @@ void LocallabExposure::exnoiseMethodChanged() void LocallabExposure::inversexChanged() { + const bool maskPreviewActivated = isMaskViewActive(); + // Update exposure GUI according to inversex button state updateExposureGUI3(); - // This event is called to transmit potentially reset mask state - if (listener) { - listener->panelChanged(EvlocallabshowmaskMethod, ""); + if (maskPreviewActivated) { + // This event is called to transmit reset mask state + if (listener) { + listener->panelChanged(EvlocallabshowmaskMethod, ""); + } } - if (inversex->get_active()) { - expcomp->setLabel(M("TP_LOCALLAB_EXPCOMPINV")); - } else { - expcomp->setLabel(M("TP_LOCALLAB_EXPCOMP")); - } - + if (isLocActivated && exp->getEnabled()) { if (listener) { if (inversex->get_active()) { @@ -3229,6 +3412,8 @@ void LocallabExposure::updateExposureGUI2() void LocallabExposure::updateExposureGUI3() { + const int mode = complexity->get_active_row_number(); + // Update exposure GUI according to inversex button state if (inversex->get_active()) { expMethod->hide(); @@ -3244,9 +3429,6 @@ void LocallabExposure::updateExposureGUI3() updateExposureGUI2(); } - //structexp->hide(); - // shadex->hide(); - shadex->show(); softradiusexp->hide(); expgradexp->hide(); showmaskexpMethod->hide(); @@ -3257,11 +3439,13 @@ void LocallabExposure::updateExposureGUI3() showmaskexpMethodinv->show(); } else { expMethod->show(); - //structexp->show(); expcomp->setLabel(M("TP_LOCALLAB_EXPCOMP")); - shadex->show(); - softradiusexp->show(); - expgradexp->show(); + + if (mode == Expert || mode == Normal) { // Keep widgets hidden in Simple mode + softradiusexp->show(); + expgradexp->show(); + } + showmaskexpMethodinv->hide(); // Reset hidden mask combobox showmaskexpMethodConninv.block(true); @@ -3339,8 +3523,8 @@ LocallabShadow::LocallabShadow(): shMethod->set_active(0); shMethodConn = shMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabShadow::shMethodChanged)); - for (unsigned int i = 0; i < multipliersh.size(); i++) { - multipliersh[i]->setAdjusterListener(this); + for (const auto multiplier : multipliersh) { + multiplier->setAdjusterListener(this); } detailSH->setAdjusterListener(this); @@ -3411,7 +3595,6 @@ LocallabShadow::LocallabShadow(): blendmaskSH->setAdjusterListener(this); - //radmaskSH->setLogScale(10, -10); radmaskSH->setAdjusterListener(this); lapmaskSH->setAdjusterListener(this); @@ -3439,8 +3622,8 @@ LocallabShadow::LocallabShadow(): // Add Shadow highlight specific widgets to GUI pack_start(*shMethod); - for (int i = 0; i < 5; ++i) { - pack_start(*multipliersh[i]); + for (const auto multiplier : multipliersh) { + pack_start(*multiplier); } pack_start(*detailSH); @@ -3449,9 +3632,8 @@ LocallabShadow::LocallabShadow(): pack_start(*shadows); pack_start(*s_tonalwidth); pack_start(*sh_radius); -// pack_start(*sensihs); + // pack_start(*sensihs); pack_start(*blurSHde); -// Gtk::Frame* const gamFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GAMFRA"))); gamFrame->set_label_align(0.025, 0.5); ToolParamBlock* const gammBox = Gtk::manage(new ToolParamBlock()); gammBox->pack_start(*gamSH); @@ -3480,7 +3662,7 @@ LocallabShadow::LocallabShadow(): fatSHBox->pack_start(*fatamountSH); fatSHBox->pack_start(*fatanchorSH); fatSHFrame->add(*fatSHBox); -// maskSHBox->pack_start(*fatSHFrame); + // maskSHBox->pack_start(*fatSHFrame); expmasksh->add(*maskSHBox, false); pack_start(*expmasksh, false, false); } @@ -3518,23 +3700,42 @@ void LocallabShadow::updateAdviceTooltips(const bool showTooltips) { if (showTooltips) { exp->set_tooltip_text(M("TP_LOCALLAB_SHADOWHIGHLIGHT_TOOLTIP")); + + for (const auto multiplier : multipliersh) { + multiplier->set_tooltip_text(M("TP_LOCALLAB_MULTIPL_TOOLTIP")); + } + + gamSH->set_tooltip_text(M("TP_LOCALLAB_SHTRC_TOOLTIP")); + sloSH->set_tooltip_text(M("TP_LOCALLAB_SHTRC_TOOLTIP")); strSH->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); expmasksh->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); CCmaskSHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); LLmaskSHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); HHmaskSHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + blendmaskSH->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); radmaskSH->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); lapmaskSH->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - LmaskSHshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - for (unsigned int i = 0; i < multipliersh.size(); i++) { - multipliersh[i]->set_tooltip_text(M("TP_LOCALLAB_MULTIPL_TOOLTIP")); - } - gamSH->set_tooltip_text(M("TP_LOCALLAB_SHTRC_TOOLTIP")); - sloSH->set_tooltip_text(M("TP_LOCALLAB_SHTRC_TOOLTIP")); - blendmaskSH->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); mask2SHCurveEditorG->set_tooltip_text(M("TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP")); + LmaskSHshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); } else { exp->set_tooltip_text(""); + + for (const auto multiplier : multipliersh) { + multiplier->set_tooltip_text(""); + } + + gamSH->set_tooltip_text(""); + sloSH->set_tooltip_text(""); + strSH->set_tooltip_text(""); + expmasksh->set_tooltip_text(""); + CCmaskSHshape->setTooltip(""); + LLmaskSHshape->setTooltip(""); + HHmaskSHshape->setTooltip(""); + blendmaskSH->set_tooltip_text(""); + radmaskSH->set_tooltip_text(""); + lapmaskSH->set_tooltip_text(""); + mask2SHCurveEditorG->set_tooltip_text(""); + LmaskSHshape->setTooltip(""); } } @@ -3950,22 +4151,83 @@ void LocallabShadow::convertParamToNormal() enableListener(); } +void LocallabShadow::convertParamToSimple() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // 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); + showmaskSHMethod->set_active(0); + showmaskSHMethodinv->set_active(0); + enaSHMask->set_active(defSpot.enaSHMask); + CCmaskSHshape->setCurve(defSpot.CCmaskSHcurve); + LLmaskSHshape->setCurve(defSpot.LLmaskSHcurve); + HHmaskSHshape->setCurve(defSpot.HHmaskSHcurve); + blendmaskSH->setValue((double)defSpot.blendmaskSH); + radmaskSH->setValue(defSpot.radmaskSH); + chromaskSH->setValue(defSpot.chromaskSH); + LmaskSHshape->setCurve(defSpot.LmaskSHcurve); + + // Enable all listeners + enableListener(); +} + void LocallabShadow::updateGUIToMode(const modeType new_type) { - if (new_type == Normal) { - // Advanced widgets are hidden in Normal mode - blurSHde->hide(); - lapmaskSH->hide(); - gammaskSH->hide(); - slomaskSH->hide(); - fatSHFrame->hide(); - } else { - // Advanced widgets are shown in Expert mode - blurSHde->show(); - lapmaskSH->show(); - gammaskSH->show(); - slomaskSH->show(); - fatSHFrame->show(); + switch (new_type) { + case Simple: + // Expert and Normal mode widgets are hidden in Simple mode + blurSHde->hide(); + gamFrame->hide(); + expgradsh->hide(); + expmasksh->hide(); + + break; + + case Normal: + // Expert mode widgets are hidden in Normal mode + blurSHde->hide(); + lapmaskSH->hide(); + gammaskSH->hide(); + slomaskSH->hide(); + fatSHFrame->hide(); + + // Specific Simple mode widgets are shown in Normal mode + if (shMethod->get_active_row_number() != 0) { // Keep widget hidden when shMethod is equal to 0 + gamFrame->show(); + } + + if (!inverssh->get_active()) { // Keep widget hidden when inverssh is toggled + expgradsh->show(); + } + + expmasksh->show(); + + break; + + case Expert: + // Show widgets hidden in Normal and Simple mode + blurSHde->show(); + + if (shMethod->get_active_row_number() != 0) { // Keep widget hidden when shMethod is equal to 0 + gamFrame->show(); + } + + if (!inverssh->get_active()) { // Keep widget hidden when inverssh is toggled + expgradsh->show(); + } + + expmasksh->show(); + lapmaskSH->show(); + gammaskSH->show(); + slomaskSH->show(); + fatSHFrame->show(); } } @@ -4002,12 +4264,16 @@ void LocallabShadow::shMethodChanged() void LocallabShadow::inversshChanged() { + const bool maskPreviewActivated = isMaskViewActive(); + // Update shadow highlight GUI according to inverssh button state updateShadowGUI1(); - // This event is called to transmit potentially reset mask state - if (listener) { - listener->panelChanged(EvlocallabshowmaskMethod, ""); + if (maskPreviewActivated) { + // This event is called to transmit reset mask state + if (listener) { + listener->panelChanged(EvlocallabshowmaskMethod, ""); + } } if (isLocActivated && exp->getEnabled()) { @@ -4074,6 +4340,8 @@ void LocallabShadow::enaSHMaskChanged() void LocallabShadow::updateShadowGUI1() { + const int mode = complexity->get_active_row_number(); + // Update shadow highlight GUI according to inverssh button state if (inverssh->get_active()) { expgradsh->hide(); @@ -4084,7 +4352,10 @@ void LocallabShadow::updateShadowGUI1() showmaskSHMethodConn.block(false); showmaskSHMethodinv->show(); } else { - expgradsh->show(); + if (mode == Expert || mode == Normal) { // Keep widget hidden in Simple mode + expgradsh->show(); + } + showmaskSHMethod->show(); showmaskSHMethodinv->hide(); // Reset hidden mask combobox @@ -4096,11 +4367,14 @@ void LocallabShadow::updateShadowGUI1() void LocallabShadow::updateShadowGUI2() { + const int mode = complexity->get_active_row_number(); + // Update shadow highlight GUI according to shMethod combobox state if (shMethod->get_active_row_number() == 0) { - for (int i = 0; i < 5; i++) { - multipliersh[i]->hide(); + for (const auto multiplier : multipliersh) { + multiplier->hide(); } + gamFrame->hide(); detailSH->hide(); highlights->show(); @@ -4109,10 +4383,13 @@ void LocallabShadow::updateShadowGUI2() s_tonalwidth->show(); sh_radius->show(); } else if (shMethod->get_active_row_number() == 1) { - for (int i = 0; i < 5; i++) { - multipliersh[i]->show(); + for (const auto multiplier : multipliersh) { + multiplier->show(); + } + + if (mode == Expert || mode == Normal) { // Keep widget hidden in Simple mode + gamFrame->show(); } - gamFrame->show(); detailSH->show(); highlights->hide(); @@ -4245,7 +4522,6 @@ LocallabVibrance::LocallabVibrance(): blendmaskvib->setAdjusterListener(this); - //radmaskvib->setLogScale(10, -10); radmaskvib->setAdjusterListener(this); lapmaskvib->setAdjusterListener(this); @@ -4272,7 +4548,7 @@ LocallabVibrance::LocallabVibrance(): pack_start(*protectSkins, Gtk::PACK_SHRINK, 0); pack_start(*avoidColorShift, Gtk::PACK_SHRINK, 0); pack_start(*pastSatTog, Gtk::PACK_SHRINK, 0); -// pack_start(*sensiv, Gtk::PACK_SHRINK, 0); + // pack_start(*sensiv, Gtk::PACK_SHRINK, 0); pack_start(*curveEditorGG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor ToolParamBlock* const gradvibBox = Gtk::manage(new ToolParamBlock()); gradvibBox->pack_start(*strvib); @@ -4323,17 +4599,27 @@ void LocallabVibrance::getMaskView(int &colorMask, int &colorMaskinv, int &expMa void LocallabVibrance::updateAdviceTooltips(const bool showTooltips) { if (showTooltips) { + exp->set_tooltip_text(M("TP_LOCALLAB_VIBRA_TOOLTIP")); warm->set_tooltip_text(M("TP_LOCALLAB_WARM_TOOLTIP")); strvib->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); expmaskvib->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); CCmaskvibshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); LLmaskvibshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); HHmaskvibshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - Lmaskvibshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); blendmaskvib->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); mask2vibCurveEditorG->set_tooltip_text(M("TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP")); + Lmaskvibshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); } else { exp->set_tooltip_text(""); + warm->set_tooltip_text(""); + strvib->set_tooltip_text(""); + expmaskvib->set_tooltip_text(""); + CCmaskvibshape->setTooltip(""); + LLmaskvibshape->setTooltip(""); + HHmaskvibshape->setTooltip(""); + blendmaskvib->set_tooltip_text(""); + mask2vibCurveEditorG->set_tooltip_text(""); + Lmaskvibshape->setTooltip(""); } } @@ -4737,36 +5023,83 @@ void LocallabVibrance::convertParamToNormal() updateVibranceGUI(); } +void LocallabVibrance::convertParamToSimple() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden specific GUI widgets in Simple mode to default spot values + strvib->setValue(defSpot.strvib); + angvib->setValue(defSpot.angvib); + showmaskvibMethod->set_active(0); + enavibMask->set_active(defSpot.enavibMask); + CCmaskvibshape->setCurve(defSpot.CCmaskvibcurve); + LLmaskvibshape->setCurve(defSpot.LLmaskvibcurve); + HHmaskvibshape->setCurve(defSpot.HHmaskvibcurve); + blendmaskvib->setValue((double)defSpot.blendmaskvib); + radmaskvib->setValue(defSpot.radmaskvib); + chromaskvib->setValue(defSpot.chromaskvib); + Lmaskvibshape->setCurve(defSpot.Lmaskvibcurve); + + // Enable all listener + enableListener(); +} + void LocallabVibrance::updateGUIToMode(const modeType new_type) { - if (new_type == Normal) { - // Advanced widgets are hidden in Normal mode - saturated->hide(); - pastels->setLabel(M("TP_LOCALLAB_PASTELS2")); - psThreshold->hide(); - protectSkins->hide(); - avoidColorShift->hide(); - pastSatTog->hide(); - curveEditorGG->hide(); - strvibab->hide(); - strvibh->hide(); - lapmaskvib->hide(); - gammaskvib->hide(); - slomaskvib->hide(); - } else { - // Advanced widgets are shown in Expert mode - saturated->show(); - pastels->setLabel(M("TP_VIBRANCE_PASTELS")); - psThreshold->show(); - protectSkins->show(); - avoidColorShift->show(); - pastSatTog->show(); - curveEditorGG->show(); - strvibab->show(); - strvibh->show(); - lapmaskvib->show(); - gammaskvib->show(); - slomaskvib->show(); + switch (new_type) { + case Simple: + // Expert and Normal mode widgets are hidden in Simple mode + saturated->hide(); + pastels->setLabel(M("TP_LOCALLAB_PASTELS2")); + psThreshold->hide(); + protectSkins->hide(); + avoidColorShift->hide(); + pastSatTog->hide(); + curveEditorGG->hide(); + expgradvib->hide(); + expmaskvib->hide(); + + break; + + case Normal: + // Expert mode widgets are hidden in Normal mode + saturated->hide(); + pastels->setLabel(M("TP_LOCALLAB_PASTELS2")); + psThreshold->hide(); + protectSkins->hide(); + avoidColorShift->hide(); + pastSatTog->hide(); + curveEditorGG->hide(); + strvibab->hide(); + strvibh->hide(); + lapmaskvib->hide(); + gammaskvib->hide(); + slomaskvib->hide(); + // Specific Simple mode widgets are shown in Normal mode + expgradvib->show(); + expmaskvib->show(); + + break; + + case Expert: + // Show widgets hidden in Normal and Simple mode + saturated->show(); + pastels->setLabel(M("TP_VIBRANCE_PASTELS")); + psThreshold->show(); + protectSkins->show(); + avoidColorShift->show(); + pastSatTog->show(); + curveEditorGG->show(); + expgradvib->show(); + strvibab->show(); + strvibh->show(); + expmaskvib->show(); + lapmaskvib->show(); + gammaskvib->show(); + slomaskvib->show(); } } @@ -4902,7 +5235,6 @@ LocallabSoft::LocallabSoft(): showmasksoftMethod->append(M("TP_LOCALLAB_SHOWNORMAL")); showmasksoftMethod->append(M("TP_LOCALLAB_SHOWMODIF")); showmasksoftMethod->set_active(0); -// showmasksoftMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKSOFT_TOOLTIP")); showmasksoftMethodConn = showmasksoftMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabSoft::showmasksoftMethodChanged)); streng->setAdjusterListener(this); @@ -4942,14 +5274,15 @@ void LocallabSoft::getMaskView(int &colorMask, int &colorMaskinv, int &expMask, void LocallabSoft::updateAdviceTooltips(const bool showTooltips) { if (showTooltips) { - exp->set_tooltip_markup(M("TP_LOCALLAB_SOFTMETHOD_TOOLTIP")); - //softMethod->set_tooltip_markup(M("TP_LOCALLAB_SOFTMETHOD_TOOLTIP")); - // ctboxsoftmethod->set_tooltip_markup(M("TP_LOCALLAB_ORRETISTEP_TOOLTIP")); + exp->set_tooltip_markup(M("TP_LOCALLAB_SOFTMETHOD_TOOLTIP")); showmasksoftMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKSOFT_TOOLTIP")); streng->set_tooltip_text(M("TP_LOCALLAB_ORRETISTREN_TOOLTIP")); laplace->set_tooltip_text(M("TP_LOCALLAB_ORRETILAP_TOOLTIP")); } else { exp->set_tooltip_text(""); + showmasksoftMethod->set_tooltip_text(""); + streng->set_tooltip_text(""); + laplace->set_tooltip_text(""); } } @@ -5076,6 +5409,58 @@ void LocallabSoft::adjusterChanged(Adjuster* a, double newval) } } +void LocallabSoft::complexityModeChanged() +{ + if (complexity->get_active_row_number() == Simple) { // New selected mode is Simple one + const bool maskPreviewActivated = isMaskViewActive(); + + // Convert tool widget parameters + convertParamToNormal(); // From Expert mode to Normal mode + convertParamToSimple(); // From Normal mode to Simple mode + // Update GUI based on new mode + updateGUIToMode(Simple); + + if (maskPreviewActivated) { + // This event is called to transmit reset mask state + if (listener) { + listener->panelChanged(EvlocallabshowmaskMethod, ""); + } + } + + if (listener && isLocActivated) { + listener->panelChanged(EvlocallabcomplexityWithRefresh, + M("TP_LOCALLAB_MODE_SIMPLE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } else if (complexity->get_active_row_number() == Normal) { // New selected mode is Normal one + const bool maskPreviewActivated = isMaskViewActive(); + + // Convert tool widget parameters + convertParamToNormal(); + // Update GUI based on new mode + updateGUIToMode(Normal); + + if (maskPreviewActivated) { + // This event is called to transmit reset mask state + if (listener) { + listener->panelChanged(EvlocallabshowmaskMethod, ""); + } + } + + if (listener && isLocActivated) { + listener->panelChanged(EvlocallabcomplexityWithRefresh, + M("TP_LOCALLAB_MODE_NORMAL") + " (" + escapeHtmlChars(spotName) + ")"); + } + } else if (complexity->get_active_row_number() == Expert) { // New selected mode is Expert one + // Update GUI based on new mode + updateGUIToMode(Expert); + + if (listener && isLocActivated) { + listener->panelChanged(EvlocallabcomplexityWithRefresh, + M("TP_LOCALLAB_MODE_EXPERT") + " (" + escapeHtmlChars(spotName) + ")"); + } + } +} + void LocallabSoft::enabledChanged() { if (isLocActivated) { @@ -5099,6 +5484,20 @@ void LocallabSoft::convertParamToNormal() disableListener(); // Set hidden GUI widgets in Normal mode to default spot values + showmasksoftMethod->set_active(0); + + // Enable all listeners + enableListener(); +} + +void LocallabSoft::convertParamToSimple() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden specific GUI widgets in Simple mode to default spot values if (defSpot.softMethod == "soft") { softMethod->set_active(0); } else if (defSpot.softMethod == "reti") { @@ -5115,23 +5514,44 @@ void LocallabSoft::convertParamToNormal() void LocallabSoft::updateGUIToMode(const modeType new_type) { - if (new_type == Normal) { - // Advanced widgets are hidden in Normal mode - softMethod->hide(); - } else { - // Advanced widgets are shown in Expert mode - softMethod->show(); + switch (new_type) { + case Simple: + // Expert and Normal mode widgets are hidden in Simple mode + softMethod->hide(); + ctboxsoftmethod->hide(); + + break; + + case Normal: + // Expert mode widgets are hidden in Normal mode + ctboxsoftmethod->hide(); + // Specific Simple mode widgets are shown in Normal mode + softMethod->show(); + + break; + + case Expert: + // Show widgets hidden in Normal and Simple mode + softMethod->show(); + + if (softMethod->get_active_row_number() != 0) { // Keep widget hidden when softMethod is equal to 0 + ctboxsoftmethod->show(); + } } } void LocallabSoft::softMethodChanged() { + const bool maskPreviewActivated = isMaskViewActive(); + // Update soft light GUI according to softMethod combobox updateSoftGUI(); - // This event is called to transmit potentially reset mask state - if (listener) { - listener->panelChanged(EvlocallabshowmaskMethod, ""); + if (maskPreviewActivated) { + // This event is called to transmit reset mask state + if (listener) { + listener->panelChanged(EvlocallabshowmaskMethod, ""); + } } if (isLocActivated && exp->getEnabled()) { @@ -5157,6 +5577,8 @@ void LocallabSoft::showmasksoftMethodChanged() void LocallabSoft::updateSoftGUI() { // Update soft light GUI according to softMethod combobox + const int comp = complexity->get_active_row_number(); + if (softMethod->get_active_row_number() == 0) { ctboxsoftmethod->hide(); // Reset hidden mask combobox @@ -5165,7 +5587,10 @@ void LocallabSoft::updateSoftGUI() showmasksoftMethodConn.block(false); laplace->hide(); } else { - ctboxsoftmethod->show(); + if (comp == Expert) { // Keep widget hidden in Simple and Normal mode + ctboxsoftmethod->show(); + } + laplace->show(); } } @@ -5332,7 +5757,6 @@ LocallabBlur::LocallabBlur(): showmaskblMethod->append(M("TP_LOCALLAB_SHOWMODIF")); showmaskblMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); showmaskblMethod->append(M("TP_LOCALLAB_SHOWMASK")); -// showmaskblMethod->append(M("TP_LOCALLAB_SHOWREF")); showmaskblMethod->set_active(0); showmaskblMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); showmaskblMethodConn = showmaskblMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabBlur::showmaskblMethodChanged)); @@ -5474,10 +5898,10 @@ LocallabBlur::LocallabBlur(): LocallabBlur::~LocallabBlur() { + delete LocalcurveEditorwavden; delete maskblCurveEditorG; delete mask2blCurveEditorG; delete mask2blCurveEditorGwav; - delete LocalcurveEditorwavden; } bool LocallabBlur::isMaskViewActive() @@ -5508,17 +5932,33 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) wavshapeden->setTooltip(M("TP_LOCALLAB_WASDEN_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")); CCmaskblshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); LLmaskblshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); HHmaskblshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + blendmaskbl->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); radmaskbl->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); lapmaskbl->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); Lmaskblshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); LLmaskblshapewav->setTooltip(M("TP_LOCALLAB_LMASK_LEVEL_TOOLTIP")); - blendmaskbl->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); - showmaskblMethodtyp->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKTYP_TOOLTIP")); } else { - exp->set_tooltip_text(""); + expblnoise->set_tooltip_text(""); + radius->set_tooltip_text(""); + sensibn->set_tooltip_text(""); + blurMethod->set_tooltip_text(""); + expdenoise->set_tooltip_text(""); + wavshapeden->setTooltip(""); + noiselumc->set_tooltip_text(""); + expmaskbl->set_tooltip_text(""); + showmaskblMethodtyp->set_tooltip_text(""); + CCmaskblshape->setTooltip(""); + LLmaskblshape->setTooltip(""); + HHmaskblshape->setTooltip(""); + blendmaskbl->set_tooltip_text(""); + radmaskbl->set_tooltip_text(""); + lapmaskbl->set_tooltip_text(""); + Lmaskblshape->setTooltip(""); + LLmaskblshapewav->setTooltip(""); } } @@ -5625,15 +6065,6 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params chroMethod->set_active(2); } - - if (spot.showmaskblMethodtyp == "blur") { - showmaskblMethodtyp ->set_active(0); - } else if (spot.showmaskblMethodtyp == "nois") { - showmaskblMethodtyp->set_active(1); - } else if (spot.showmaskblMethodtyp == "all") { - showmaskblMethodtyp->set_active(2); - } - activlum->set_active(spot.activlum); wavshapeden->setCurve(spot.locwavcurveden); noiselumf0->setValue(spot.noiselumf0); @@ -5649,6 +6080,15 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params adjblur->setValue((double)spot.adjblur); bilateral->setValue((double)spot.bilateral); sensiden->setValue((double)spot.sensiden); + + if (spot.showmaskblMethodtyp == "blur") { + showmaskblMethodtyp ->set_active(0); + } else if (spot.showmaskblMethodtyp == "nois") { + showmaskblMethodtyp->set_active(1); + } else if (spot.showmaskblMethodtyp == "all") { + showmaskblMethodtyp->set_active(2); + } + enablMask->set_active(spot.enablMask); CCmaskblshape->setCurve(spot.CCmaskblcurve); LLmaskblshape->setCurve(spot.LLmaskblcurve); @@ -5738,15 +6178,6 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.chroMethod = "all"; } - - if (showmaskblMethodtyp->get_active_row_number() == 0) { - spot.showmaskblMethodtyp = "blur"; - } else if (showmaskblMethodtyp->get_active_row_number() == 1) { - spot.showmaskblMethodtyp = "nois"; - } else if (showmaskblMethodtyp->get_active_row_number() == 2) { - spot.showmaskblMethodtyp = "all"; - } - spot.activlum = activlum->get_active(); spot.locwavcurveden = wavshapeden->getCurve(); spot.noiselumf0 = noiselumf0->getValue(); @@ -5762,6 +6193,15 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.adjblur = adjblur->getIntValue(); spot.bilateral = bilateral->getIntValue(); spot.sensiden = sensiden->getIntValue(); + + if (showmaskblMethodtyp->get_active_row_number() == 0) { + spot.showmaskblMethodtyp = "blur"; + } else if (showmaskblMethodtyp->get_active_row_number() == 1) { + spot.showmaskblMethodtyp = "nois"; + } else if (showmaskblMethodtyp->get_active_row_number() == 2) { + spot.showmaskblMethodtyp = "all"; + } + spot.enablMask = enablMask->get_active(); spot.LLmaskblcurve = LLmaskblshape->getCurve(); spot.CCmaskblcurve = CCmaskblshape->getCurve(); @@ -6056,7 +6496,7 @@ void LocallabBlur::adjusterChanged(Adjuster* a, double newval) shadmaskblsha->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); } } - + } } @@ -6144,8 +6584,6 @@ void LocallabBlur::convertParamToNormal() strumaskbl->setValue(defSpot.strumaskbl); toolbl->set_active(defSpot.toolbl); lapmaskbl->setValue(defSpot.lapmaskbl); -// gammaskbl->setValue(defSpot.gammaskbl); -// slomaskbl->setValue(defSpot.slomaskbl); shadmaskbl->setValue((double)defSpot.shadmaskbl); shadmaskblsha->setValue((double)defSpot.shadmaskblsha); LLmaskblshapewav->setCurve(defSpot.LLmaskblcurvewav); @@ -6155,35 +6593,79 @@ void LocallabBlur::convertParamToNormal() enableListener(); } +void LocallabBlur::convertParamToSimple() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden specific GUI widgets in Simple mode to default spot values + showmaskblMethod->set_active(0); + + if (defSpot.showmaskblMethodtyp == "blur") { + showmaskblMethodtyp ->set_active(0); + } else if (defSpot.showmaskblMethodtyp == "nois") { + showmaskblMethodtyp->set_active(1); + } else if (defSpot.showmaskblMethodtyp == "all") { + showmaskblMethodtyp->set_active(2); + } + + enablMask->set_active(defSpot.enablMask); + CCmaskblshape->setCurve(defSpot.CCmaskblcurve); + LLmaskblshape->setCurve(defSpot.LLmaskblcurve); + HHmaskblshape->setCurve(defSpot.HHmaskblcurve); + blendmaskbl->setValue((double)defSpot.blendmaskbl); + radmaskbl->setValue(defSpot.radmaskbl); + chromaskbl->setValue(defSpot.chromaskbl); + gammaskbl->setValue(defSpot.gammaskbl); + slomaskbl->setValue(defSpot.slomaskbl); + Lmaskblshape->setCurve(defSpot.Lmasklccurve); + + // Enable all listeners + enableListener(); +} + void LocallabBlur::updateGUIToMode(const modeType new_type) { - if (new_type == Normal) { - // Advanced widgets are hidden in Normal mode - fftwbl->hide(); - strumaskbl->hide(); - toolbl->hide(); - lapmaskbl->hide(); - gammaskbl->show(); - slomaskbl->show(); - shadmaskbl->hide(); - shadmaskblsha->hide(); - mask2blCurveEditorGwav->hide(); - csThresholdblur->hide(); - } else { - // Advanced widgets are shown in Expert mode - if (blMethod->get_active_row_number() == 0) { // Keep widget hidden when blMethod is > 0 - fftwbl->show(); - } + switch (new_type) { + case Simple: + // Expert and Normal mode widgets are hidden in Simple mode + fftwbl->hide(); + expmaskbl->hide(); - strumaskbl->show(); - toolbl->show(); - lapmaskbl->show(); - gammaskbl->show(); - slomaskbl->show(); - shadmaskbl->show(); - shadmaskblsha->show(); - mask2blCurveEditorGwav->show(); - csThresholdblur->show(); + break; + + case Normal: + // Expert mode widgets are hidden in Normal mode + fftwbl->hide(); + strumaskbl->hide(); + toolbl->hide(); + lapmaskbl->hide(); + shadmaskbl->hide(); + shadmaskblsha->hide(); + mask2blCurveEditorGwav->hide(); + csThresholdblur->hide(); + // Specific Simple mode widgets are shown in Normal mode + expmaskbl->show(); + + break; + + case Expert: + + // Show widgets hidden in Normal and Simple mode + if (blMethod->get_active_row_number() == 0) { // Keep widget hidden when blMethod is > 0 + fftwbl->show(); + } + + expmaskbl->show(); + strumaskbl->show(); + toolbl->show(); + lapmaskbl->show(); + shadmaskbl->show(); + shadmaskblsha->show(); + mask2blCurveEditorGwav->show(); + csThresholdblur->show(); } } @@ -6334,8 +6816,13 @@ void LocallabBlur::toolblChanged() void LocallabBlur::updateBlurGUI() { + const int mode = complexity->get_active_row_number(); + if (blMethod->get_active_row_number() == 0) { - fftwbl->show(); + if (mode == Expert) { // Keep widget hidden in Normal and Simple mode + fftwbl->show(); + } + radius->show(); strength->show(); grainFrame->show(); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index a43e76fe8..8b5152968 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . - * 2019 Pierre Cabrera + * 2019-2020 Pierre Cabrera */ #ifndef _LOCALLABTOOLS_H_ #define _LOCALLABTOOLS_H_ @@ -52,7 +52,8 @@ protected: // LocallabTool mode enumeration enum modeType { Expert = 0, - Normal = 1 + Normal = 1, + Simple = 2 }; // LocallabTool parameters @@ -162,7 +163,8 @@ private: // To be implemented virtual void enabledChanged() {}; - virtual void convertParamToNormal() {}; // Only necessary when using mode + virtual void convertParamToNormal() {}; // From Expert mode to Normal mode; Only necessary when using mode + virtual void convertParamToSimple() {}; // From Normal mode to Simple mode; Only necessary when using mode virtual void updateGUIToMode(const modeType new_type) {}; // Only necessary when using mode }; @@ -175,10 +177,10 @@ class LocallabColor: private: // Color & Light specific widgets Gtk::Frame* const lumFrame; - Gtk::CheckButton* const curvactiv; Adjuster* const lightness; Adjuster* const contrast; Adjuster* const chroma; + Gtk::CheckButton* const curvactiv; Gtk::Frame* const gridFrame; LabGrid* const labgrid; MyComboBoxText* const gridMethod; @@ -204,10 +206,10 @@ private: DiagonalCurveEditor* const lcshape; CurveEditorGroup* const HCurveEditorG; FlatCurveEditor* const LHshape; - CurveEditorGroup* const H2CurveEditorG; - FlatCurveEditor* const HHshape; CurveEditorGroup* const H3CurveEditorG; FlatCurveEditor* const CHshape; + CurveEditorGroup* const H2CurveEditorG; + FlatCurveEditor* const HHshape; CurveEditorGroup* const rgbCurveEditorG; MyComboBoxText* const toneMethod; DiagonalCurveEditor* const rgbshape; @@ -283,6 +285,7 @@ public: private: void enabledChanged() override; void convertParamToNormal() override; + void convertParamToSimple() override; void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -388,6 +391,7 @@ public: private: void enabledChanged() override; void convertParamToNormal() override; + void convertParamToSimple() override; void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -473,6 +477,7 @@ public: private: void enabledChanged() override; void convertParamToNormal() override; + void convertParamToSimple() override; void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -557,6 +562,7 @@ public: private: void enabledChanged() override; void convertParamToNormal() override; + void convertParamToSimple() override; void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -603,8 +609,11 @@ public: void adjusterChanged(Adjuster* a, double newval) override; private: + void complexityModeChanged(); + void enabledChanged() override; void convertParamToNormal() override; + void convertParamToSimple() override; void updateGUIToMode(const modeType new_type) override; void softMethodChanged(); @@ -708,6 +717,7 @@ public: private: void enabledChanged() override; void convertParamToNormal() override; + void convertParamToSimple() override; void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -784,6 +794,7 @@ public: private: void enabledChanged() override; void convertParamToNormal() override; + void convertParamToSimple() override; void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -874,6 +885,7 @@ public: private: void enabledChanged() override; void convertParamToNormal() override; + void convertParamToSimple() override; void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -907,6 +919,7 @@ private: Adjuster* const sharradius; Adjuster* const sensisha; Gtk::CheckButton* const inverssha; + Gtk::Frame* const sharFrame; MyComboBoxText* const showmasksharMethod; sigc::connection inversshaConn, showmasksharMethodConn; @@ -930,6 +943,7 @@ public: private: void enabledChanged() override; void convertParamToNormal() override; + void convertParamToSimple() override; void updateGUIToMode(const modeType new_type) override; void inversshaChanged(); @@ -952,8 +966,8 @@ private: Adjuster* const sigmalc; CurveEditorGroup* const LocalcurveEditorwav; FlatCurveEditor* const wavshape; - Adjuster* const levelwav; ThresholdAdjuster* const csThreshold; + Adjuster* const levelwav; MyExpander* const expresidpyr; Adjuster* const residcont; Adjuster* const residchro; @@ -1058,6 +1072,7 @@ public: private: void enabledChanged() override; void convertParamToNormal() override; + void convertParamToSimple() override; void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -1089,8 +1104,8 @@ class LocallabCBDL: public LocallabTool { private: - const std::array multiplier; Gtk::Frame* const levFrame; + const std::array multiplier; Adjuster* const chromacbdl; Adjuster* const threshold; Adjuster* const clarityml; @@ -1143,6 +1158,7 @@ public: private: void enabledChanged() override; void convertParamToNormal() override; + void convertParamToSimple() override; void updateGUIToMode(const modeType new_type) override; void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; @@ -1212,7 +1228,6 @@ private: Adjuster* const blendmask; Adjuster* const blendmaskab; Adjuster* const softradiusmask; - MyComboBoxText* const showmask_Method; Gtk::CheckButton* const enamask; CurveEditorGroup* const mask_CurveEditorG; @@ -1226,7 +1241,7 @@ private: Gtk::CheckButton* const fftmask; Adjuster* const contmask; Adjuster* const blurmask; - + Gtk::Frame* const toolmaskFrame; Adjuster* const radmask; Adjuster* const lapmask; Adjuster* const chromask; @@ -1269,18 +1284,22 @@ public: void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) override; void curveChanged(CurveEditor* ce) override; - private: + void complexityModeChanged(); + void enabledChanged() override; + void convertParamToNormal() override; + void convertParamToSimple() override; + void updateGUIToMode(const modeType new_type) override; + + void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; + void showmask_MethodChanged(); void enamaskChanged(); void toolmaskChanged(); - void convertParamToNormal() override; - void updateGUIToMode(const modeType new_type) override; void fftmaskChanged(); - void updatemaskGUI3(); - void updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) override; + + void updateMaskGUI(); }; - #endif diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 91d1b08a6..a025d5791 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . - * 2019 Pierre Cabrera + * 2019-2020 Pierre Cabrera */ #include "locallabtools.h" @@ -127,7 +127,7 @@ LocallabTone::LocallabTone(): scaltm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALTM"), 0.1, 10.0, 0.01, 1.0))), rewei(Gtk::manage(new Adjuster(M("TP_LOCALLAB_REWEI"), 0, 3, 1, 0))), softradiustm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.1, 0.))), - sensitm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 30))), + sensitm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), expmasktm(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOWT")))), showmasktmMethod(Gtk::manage(new MyComboBoxText())), enatmMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), @@ -205,7 +205,6 @@ LocallabTone::LocallabTone(): lapmasktm->setAdjusterListener(this); - //radmasktm->setLogScale(10, -10); radmasktm->setAdjusterListener(this); chromasktm->setAdjusterListener(this); @@ -275,23 +274,38 @@ void LocallabTone::updateAdviceTooltips(const bool showTooltips) { if (showTooltips) { exp->set_tooltip_text(M("TP_LOCALLAB_TONEMAP_TOOLTIP")); - estop->set_tooltip_text(M("TP_LOCALLAB_TONEMAPESTOP_TOOLTIP")); - rewei->set_tooltip_text(M("TP_LOCALLAB_TONEMAPREWEI_TOOLTIP")); - scaltm->set_tooltip_text(M("TP_LOCALLAB_TONEMASCALE_TOOLTIP")); - gamma->set_tooltip_text(M("TP_LOCALLAB_TONEMAPGAM_TOOLTIP")); equiltm->set_tooltip_text(M("TP_LOCALLAB_EQUILTM_TOOLTIP")); + gamma->set_tooltip_text(M("TP_LOCALLAB_TONEMAPGAM_TOOLTIP")); + estop->set_tooltip_text(M("TP_LOCALLAB_TONEMAPESTOP_TOOLTIP")); + scaltm->set_tooltip_text(M("TP_LOCALLAB_TONEMASCALE_TOOLTIP")); + rewei->set_tooltip_text(M("TP_LOCALLAB_TONEMAPREWEI_TOOLTIP")); sensitm->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); expmasktm->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); CCmasktmshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); LLmasktmshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); HHmasktmshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + blendmasktm->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); lapmasktm->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); radmasktm->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - Lmasktmshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - blendmasktm->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); mask2tmCurveEditorG->set_tooltip_text(M("TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP")); + Lmasktmshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); } else { exp->set_tooltip_text(""); + equiltm->set_tooltip_text(""); + gamma->set_tooltip_text(""); + estop->set_tooltip_text(""); + scaltm->set_tooltip_text(""); + rewei->set_tooltip_text(""); + sensitm->set_tooltip_text(""); + expmasktm->set_tooltip_text(""); + CCmasktmshape->setTooltip(""); + LLmasktmshape->setTooltip(""); + HHmasktmshape->setTooltip(""); + blendmasktm->set_tooltip_text(""); + lapmasktm->set_tooltip_text(""); + radmasktm->set_tooltip_text(""); + mask2tmCurveEditorG->set_tooltip_text(""); + Lmasktmshape->setTooltip(""); } } @@ -440,6 +454,7 @@ void LocallabTone::adjusterChanged(Adjuster* a, double newval) { if (isLocActivated && exp->getEnabled() && listener) { const auto spName = " (" + escapeHtmlChars(spotName) + ")"; + if (a == amount) { listener->panelChanged(Evlocallabamount, amount->getTextValue() + spName); } else if (a == stren) { @@ -478,6 +493,7 @@ void LocallabTone::curveChanged(CurveEditor* ce) { if (isLocActivated && exp->getEnabled() && listener) { const auto spName = M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"; + if (ce == CCmasktmshape) { listener->panelChanged(EvlocallabCCmasktmshape, spName); } else if (ce == LLmasktmshape) { @@ -494,7 +510,7 @@ void LocallabTone::enabledChanged() { if (isLocActivated && listener) { listener->panelChanged(EvLocenatonemap, (exp->getEnabled() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")) - + " (" + escapeHtmlChars(spotName) + ")"); + + " (" + escapeHtmlChars(spotName) + ")"); } } @@ -517,24 +533,63 @@ void LocallabTone::convertParamToNormal() enableListener(); } +void LocallabTone::convertParamToSimple() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden specific GUI widgets in Simple mode to default spot values + showmasktmMethod->set_active(0); + enatmMask->set_active(defSpot.enatmMask); + enatmMaskaft->set_active(defSpot.enatmMaskaft); + CCmasktmshape->setCurve(defSpot.CCmasktmcurve); + LLmasktmshape->setCurve(defSpot.LLmasktmcurve); + HHmasktmshape->setCurve(defSpot.HHmasktmcurve); + blendmasktm->setValue((double)defSpot.blendmasktm); + radmasktm->setValue(defSpot.radmasktm); + chromasktm->setValue(defSpot.chromasktm); + Lmasktmshape->setCurve(defSpot.Lmasktmcurve); + + // Enable all listeners + enableListener(); +} + void LocallabTone::updateGUIToMode(const modeType new_type) { - if (new_type == Normal) { - // Advanced widgets are hidden in Normal mode - gamma->hide(); - satur->hide(); - rewei->hide(); - lapmasktm->hide(); - gammasktm->hide(); - slomasktm->hide(); - } else { - // Advanced widgets are shown in Expert mode - gamma->show(); - satur->show(); - rewei->show(); - lapmasktm->show(); - gammasktm->show(); - slomasktm->show(); + switch (new_type) { + case Simple: + // Expert and Normal mode widgets are hidden in Simple mode + gamma->hide(); + satur->hide(); + rewei->hide(); + expmasktm->hide(); + + break; + + case Normal: + // Expert mode widgets are hidden in Normal mode + gamma->hide(); + satur->hide(); + rewei->hide(); + lapmasktm->hide(); + gammasktm->hide(); + slomasktm->hide(); + // Specific Simple mode widgets are shown in Normal mode + expmasktm->show(); + + break; + + case Expert: + // Show widgets hidden in Normal and Simple mode + gamma->show(); + satur->show(); + rewei->show(); + expmasktm->show(); + lapmasktm->show(); + gammasktm->show(); + slomasktm->show(); } } @@ -909,18 +964,18 @@ void LocallabRetinex::getMaskView(int &colorMask, int &colorMaskinv, int &expMas void LocallabRetinex::updateAdviceTooltips(const bool showTooltips) { if (showTooltips) { + loglin->set_tooltip_text(M("TP_LOCALLAB_RETI_LOGLIN_TOOLTIP")); sensih->set_tooltip_text(M("TP_LOCALLAB_SENSIH_TOOLTIP")); fftwreti->set_tooltip_text(M("TP_LOCALLAB_RETI_FFTW_TOOLTIP")); - loglin->set_tooltip_text(M("TP_LOCALLAB_RETI_LOGLIN_TOOLTIP")); + equilret->set_tooltip_text(M("TP_LOCALLAB_EQUILTM_TOOLTIP")); + neigh->set_tooltip_text(M("TP_LOCALLAB_RETI_NEIGH_VART_TOOLTIP")); + vart->set_tooltip_text(M("TP_LOCALLAB_RETI_NEIGH_VART_TOOLTIP")); scalereti->set_tooltip_text(M("TP_LOCALLAB_RETI_SCALE_TOOLTIP")); limd->set_tooltip_text(M("TP_LOCALLAB_RETI_LIMDOFFS_TOOLTIP")); offs->set_tooltip_text(M("TP_LOCALLAB_RETI_LIMDOFFS_TOOLTIP")); - cliptm->set_tooltip_text(M("TP_LOCALLAB_RETI_LIMDOFFS_TOOLTIP")); - lightnessreti->set_tooltip_text(M("TP_LOCALLAB_RETI_LIGHTDARK_TOOLTIP")); darkness->set_tooltip_text(M("TP_LOCALLAB_RETI_LIGHTDARK_TOOLTIP")); - neigh->set_tooltip_text(M("TP_LOCALLAB_RETI_NEIGH_VART_TOOLTIP")); - vart->set_tooltip_text(M("TP_LOCALLAB_RETI_NEIGH_VART_TOOLTIP")); - equilret->set_tooltip_text(M("TP_LOCALLAB_EQUILTM_TOOLTIP")); + lightnessreti->set_tooltip_text(M("TP_LOCALLAB_RETI_LIGHTDARK_TOOLTIP")); + cliptm->set_tooltip_text(M("TP_LOCALLAB_RETI_LIMDOFFS_TOOLTIP")); softradiusret->set_tooltip_text(M("TP_LOCALLAB_GUIDFILTER_TOOLTIP")); cTtransshape->setTooltip(M("TP_LOCALLAB_TRANSMISSION_TOOLTIP")); mMLabels->set_tooltip_markup(M("TP_LOCALLAB_MLABEL_TOOLTIP")); @@ -931,14 +986,40 @@ void LocallabRetinex::updateAdviceTooltips(const bool showTooltips) CCmaskretishape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); LLmaskretishape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); HHmaskretishape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + blendmaskreti->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); radmaskreti->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); lapmaskreti->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - Lmaskretishape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - blendmaskreti->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); mask2retiCurveEditorG->set_tooltip_text(M("TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP")); - } else { - exp->set_tooltip_text(""); - } + Lmaskretishape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); + } else { + loglin->set_tooltip_text(""); + sensih->set_tooltip_text(""); + fftwreti->set_tooltip_text(""); + equilret->set_tooltip_text(""); + neigh->set_tooltip_text(""); + vart->set_tooltip_text(""); + scalereti->set_tooltip_text(""); + limd->set_tooltip_text(""); + offs->set_tooltip_text(""); + darkness->set_tooltip_text(""); + lightnessreti->set_tooltip_text(""); + cliptm->set_tooltip_text(""); + softradiusret->set_tooltip_text(""); + cTtransshape->setTooltip(""); + mMLabels->set_tooltip_text(""); + transLabels->set_tooltip_text(""); + cTgainshape->setTooltip(""); + expmaskreti->set_tooltip_text(""); + enaretiMasktmap->set_tooltip_text(""); + CCmaskretishape->setTooltip(""); + LLmaskretishape->setTooltip(""); + HHmaskretishape->setTooltip(""); + blendmaskreti->set_tooltip_text(""); + radmaskreti->set_tooltip_text(""); + lapmaskreti->set_tooltip_text(""); + mask2retiCurveEditorG->set_tooltip_text(""); + Lmaskretishape->setTooltip(""); + } } void LocallabRetinex::setDefaultExpanderVisibility() @@ -1397,6 +1478,7 @@ void LocallabRetinex::convertParamToNormal() softradiusret->setValue(defSpot.softradiusret); cTtransshape->setCurve(defSpot.localTtranscurve); cTgainshape->setCurve(defSpot.localTgaincurve); + showmaskretiMethod->set_active(0); enaretiMask->set_active(defSpot.enaretiMask); enaretiMasktmap->set_active(defSpot.enaretiMasktmap); CCmaskretishape->setCurve(defSpot.CCmaskreticurve); @@ -1423,16 +1505,45 @@ void LocallabRetinex::convertParamToNormal() updateRetinexGUI3(); } +void LocallabRetinex::convertParamToSimple() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden specific GUI widgets in Simple mode to default spot values + lumonly->set_active(defSpot.lumonly); + + // Enable all listeners + enableListener(); +} + void LocallabRetinex::updateGUIToMode(const modeType new_type) { - if (new_type == Normal) { - // Advanced widgets are hidden in Normal mode - retiFrame->hide(); - retitoolFrame->hide(); - } else { - // Advanced widgets are shown in Expert mode - retiFrame->show(); - retitoolFrame->show(); + switch (new_type) { + case Simple: + // Expert and Normal mode widgets are hidden in Simple mode + lumonly->hide(); + retiFrame->hide(); + retitoolFrame->hide(); + + break; + + case Normal: + // Expert mode widgets are hidden in Normal mode + retiFrame->hide(); + retitoolFrame->hide(); + // Specific Simple mode widgets are shown in Normal mode + lumonly->show(); + + break; + + case Expert: + // Show widgets hidden in Normal and Simple mode + lumonly->show(); + retiFrame->show(); + retitoolFrame->show(); } } @@ -1567,9 +1678,18 @@ void LocallabRetinex::enaretiMasktmapChanged() void LocallabRetinex::inversretChanged() { + const bool maskPreviewActivated = isMaskViewActive(); + // Update Retinex GUI according to inversret button state updateRetinexGUI2(); + if (maskPreviewActivated) { + // This event is called to transmit reset mask state + if (listener) { + listener->panelChanged(EvlocallabshowmaskMethod, ""); + } + } + if (isLocActivated && exp->getEnabled()) { if (listener) { if (inversret->get_active()) { @@ -1604,6 +1724,9 @@ void LocallabRetinex::updateRetinexGUI2() // Update Retinex GUI according to inversret button state if (inversret->get_active()) { expmaskreti->hide(); + showmaskretiMethodConn.block(true); + showmaskretiMethod->set_active(0); + showmaskretiMethodConn.block(false); } else { expmaskreti->show(); } @@ -1631,6 +1754,7 @@ LocallabSharp::LocallabSharp(): sharradius(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARRADIUS"), 0.4, 2.5, 0.01, 0.75))), sensisha(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIS"), 0, 100, 1, 40))), inverssha(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))), + sharFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHARFRAME")))), showmasksharMethod(Gtk::manage(new MyComboBoxText())) { // Parameter Sharpening specific widgets @@ -1666,7 +1790,6 @@ LocallabSharp::LocallabSharp(): pack_start(*shariter); pack_start(*sensisha); pack_start(*inverssha); - Gtk::Frame* const sharFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHARFRAME"))); sharFrame->set_label_align(0.025, 0.5); ToolParamBlock* const sharfBox = Gtk::manage(new ToolParamBlock()); sharfBox->pack_start(*showmasksharMethod); @@ -1698,6 +1821,7 @@ void LocallabSharp::updateAdviceTooltips(const bool showTooltips) sensisha->set_tooltip_text(M("TP_LOCALLAB_SENSIS_TOOLTIP")); } else { exp->set_tooltip_text(""); + sensisha->set_tooltip_text(""); } } @@ -1874,31 +1998,66 @@ void LocallabSharp::convertParamToNormal() disableListener(); // Set hidden GUI widgets in Normal mode to default spot values - shardamping->setValue((double)defSpot.shardamping); - shariter->setValue((double)defSpot.shariter); + sharcontrast->setValue((double)defSpot.sharcontrast); sharblur->setValue(defSpot.sharblur); sharamount->setValue(defSpot.sharamount); + shardamping->setValue((double)defSpot.shardamping); + shariter->setValue((double)defSpot.shariter); // Enable all listeners enableListener(); } +void LocallabSharp::convertParamToSimple() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden specific GUI widgets in Simple mode to default spot values + showmasksharMethod->set_active(0); + + // Enable all listeners + enableListener(); + + // Update GUI based on converted widget parameters: +} + void LocallabSharp::updateGUIToMode(const modeType new_type) { - if (new_type == Normal) { - // Advanced widgets are hidden in Normal mode - shardamping->hide(); - shariter->hide(); - sharblur->hide(); - sharcontrast->hide(); - sharamount->hide(); - } else { - // Advanced widgets are shown in Expert mode - shardamping->show(); - shariter->show(); - sharblur->hide(); - sharcontrast->hide(); - sharamount->show(); + switch (new_type) { + case Simple: + // Expert and Normal mode widgets are hidden in Simple mode + sharcontrast->hide(); + sharblur->hide(); + sharamount->hide(); + shardamping->hide(); + shariter->hide(); + sharFrame->hide(); + + break; + + case Normal: + // Expert mode widgets are hidden in Normal mode + sharcontrast->hide(); + sharblur->hide(); + sharamount->hide(); + shardamping->hide(); + shariter->hide(); + // Specific Simple mode widgets are shown in Normal mode + sharFrame->show(); + + break; + + case Expert: + // Show widgets hidden in Normal and Simple mode + sharcontrast->show(); + sharblur->show(); + sharamount->show(); + shardamping->show(); + shariter->show(); + sharFrame->show(); } } @@ -1943,8 +2102,8 @@ LocallabContrast::LocallabContrast(): sigmalc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGMAWAV"), 0.2, 2.5, 0.01, 1.))), LocalcurveEditorwav(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAV"))), wavshape(static_cast(LocalcurveEditorwav->addCurve(CT_Flat, "", nullptr, false, false))), - levelwav(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LEVELWAV"), 1, 9, 1, 4))), csThreshold(Gtk::manage(new ThresholdAdjuster(M("TP_LOCALLAB_CSTHRESHOLD"), 0, 9, 0, 0, 6, 6, 0, false))), + levelwav(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LEVELWAV"), 1, 9, 1, 4))), expresidpyr(Gtk::manage(new MyExpander(false, Gtk::manage(new Gtk::HBox())))), residcont(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCONT"), -100, 100, 1, 0))), residchro(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCHRO"), -100., 100., 1., 0.))), @@ -2048,10 +2207,10 @@ LocallabContrast::LocallabContrast(): LocalcurveEditorwav->curveListComplete(); - levelwav->setAdjusterListener(this); - csThreshold->setAdjusterListener(this); + levelwav->setAdjusterListener(this); + Gtk::HBox* const LresTitleHBox = Gtk::manage(new Gtk::HBox()); Gtk::Label* const LresLabel = Gtk::manage(new Gtk::Label()); LresLabel->set_markup(Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_LOC_RESIDPYR")) + Glib::ustring("")); @@ -2251,7 +2410,6 @@ LocallabContrast::LocallabContrast(): blendmasklc->setAdjusterListener(this); - // radmasklc->setLogScale(10, -10); radmasklc->setAdjusterListener(this); chromasklc->setAdjusterListener(this); @@ -2265,28 +2423,23 @@ LocallabContrast::LocallabContrast(): mask2lcCurveEditorG->curveListComplete(); // Add Local contrast specific widgets to GUI - ToolParamBlock* const coBox = Gtk::manage(new ToolParamBlock()); - coBox->pack_start(*sigmalc); - coBox->pack_start(*LocalcurveEditorwav, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - // pack_start(*levelwav); - coBox->pack_start(*csThreshold); - contFrame->add(*coBox); - pack_start(*localcontMethod); pack_start(*lcradius); pack_start(*lcamount); pack_start(*lcdarkness); pack_start(*lclightness); - pack_start(*contFrame); -// pack_start(*sigmalc); -// pack_start(*LocalcurveEditorwav, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + ToolParamBlock* const coBox = Gtk::manage(new ToolParamBlock()); + coBox->pack_start(*sigmalc); + coBox->pack_start(*LocalcurveEditorwav, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + coBox->pack_start(*csThreshold); + contFrame->add(*coBox); + pack_start(*contFrame); // pack_start(*levelwav); -// pack_start(*csThreshold); - Gtk::Frame* const shresFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHRESFRA"))); - shresFrame->set_label_align(0.025, 0.5); ToolParamBlock* const resiBox = Gtk::manage(new ToolParamBlock()); resiBox->pack_start(*residcont); resiBox->pack_start(*residchro); + Gtk::Frame* const shresFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHRESFRA"))); + shresFrame->set_label_align(0.025, 0.5); ToolParamBlock* const shresBox = Gtk::manage(new ToolParamBlock()); shresBox->pack_start(*residsha); shresBox->pack_start(*residshathr); @@ -2366,22 +2519,22 @@ LocallabContrast::LocallabContrast(): expcontrastpyr->add(*blurcontBox, false); pack_start(*expcontrastpyr); ToolParamBlock* const blurcontBox2 = Gtk::manage(new ToolParamBlock()); - Gtk::Frame* const contFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_CONTFRA"))); - contFrame->set_label_align(0.025, 0.5); + Gtk::Frame* const contFrame2 = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_CONTFRA"))); + contFrame2->set_label_align(0.025, 0.5); + contFrame2->set_label_widget(*wavcont); Gtk::VBox* const contlevBox = Gtk::manage(new Gtk::VBox()); contlevBox->set_spacing(2); - contFrame->set_label_widget(*wavcont); contlevBox->pack_start(*sigma); contlevBox->pack_start(*offset); contlevBox->pack_start(*chromalev); contlevBox->pack_start(*LocalcurveEditorwavcon, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - contFrame->add(*contlevBox); - blurcontBox2->pack_start(*contFrame); + contFrame2->add(*contlevBox); + blurcontBox2->pack_start(*contFrame2); Gtk::Frame* const compreFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_COMPREFRA"))); compreFrame->set_label_align(0.025, 0.5); + compreFrame->set_label_widget(*wavcompre); Gtk::VBox* const compreBox = Gtk::manage(new Gtk::VBox()); compreBox->set_spacing(2); - compreFrame->set_label_widget(*wavcompre); compreBox->pack_start(*LocalcurveEditorwavcompre, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor compreBox->pack_start(*sigmadr); compreBox->pack_start(*threswav); @@ -2390,9 +2543,9 @@ LocallabContrast::LocallabContrast(): blurcontBox2->pack_start(*compreFrame); Gtk::Frame* const compFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_COMPFRA"))); compFrame->set_label_align(0.025, 0.5); + compFrame->set_label_widget(*wavcomp); Gtk::VBox* const compBox = Gtk::manage(new Gtk::VBox()); compBox->set_spacing(2); - compFrame->set_label_widget(*wavcomp); compBox->pack_start(*sigmadc); compBox->pack_start(*deltad); compBox->pack_start(*LocalcurveEditorwavcomp, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor @@ -2449,30 +2602,52 @@ void LocallabContrast::updateAdviceTooltips(const bool showTooltips) { if (showTooltips) { contFrame->set_tooltip_text(M("TP_LOCALLAB_EXPCONTRAST_TOOLTIP")); - levelwav->set_tooltip_markup(M("TP_LOCALLAB_LEVELWAV_TOOLTIP")); LocalcurveEditorwav->set_tooltip_markup(M("TP_LOCALLAB_LEVELLOCCONTRAST_TOOLTIP")); - wavgradl->set_tooltip_text(M("TP_LOCALLAB_WAVGRAD_TOOLTIP")); + levelwav->set_tooltip_markup(M("TP_LOCALLAB_LEVELWAV_TOOLTIP")); clariFrame->set_tooltip_markup(M("TP_LOCALLAB_CLARI_TOOLTIP")); clarisoft->set_tooltip_markup(M("TP_LOCALLAB_CLARISOFT_TOOLTIP")); + expcontrastpyr->set_tooltip_text(M("TP_LOCALLAB_EXPCONTRASTPYR_TOOLTIP")); + wavgradl->set_tooltip_text(M("TP_LOCALLAB_WAVGRAD_TOOLTIP")); wavedg->set_tooltip_text(M("TP_LOCALLAB_WAVEEDG_TOOLTIP")); wavblur->set_tooltip_text(M("TP_LOCALLAB_WAVBLUR_TOOLTIP")); + chromablu->set_tooltip_text(M("TP_LOCALLAB_CHROMABLU_TOOLTIP")); + expcontrastpyr2->set_tooltip_text(M("TP_LOCALLAB_EXPCONTRASTPYR_TOOLTIP")); wavcont->set_tooltip_text(M("TP_LOCALLAB_WAVCONTF_TOOLTIP")); + chromalev->set_tooltip_text(M("TP_LOCALLAB_CHROMABLU_TOOLTIP")); wavcompre->set_tooltip_text(M("TP_LOCALLAB_WAVCOMPRE_TOOLTIP")); wavcomp->set_tooltip_text(M("TP_LOCALLAB_WAVCOMP_TOOLTIP")); - chromablu->set_tooltip_text(M("TP_LOCALLAB_CHROMABLU_TOOLTIP")); - chromalev->set_tooltip_text(M("TP_LOCALLAB_CHROMABLU_TOOLTIP")); fftwlc->set_tooltip_text(M("TP_LOCALLAB_LC_FFTW_TOOLTIP")); expmasklc->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); CCmasklcshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); LLmasklcshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); HHmasklcshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); - Lmasklcshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - expcontrastpyr->set_tooltip_text(M("TP_LOCALLAB_EXPCONTRASTPYR_TOOLTIP")); - expcontrastpyr2->set_tooltip_text(M("TP_LOCALLAB_EXPCONTRASTPYR_TOOLTIP")); blendmasklc->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); mask2lcCurveEditorG->set_tooltip_text(M("TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP")); + Lmasklcshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); } else { - exp->set_tooltip_text(""); + contFrame->set_tooltip_text(""); + LocalcurveEditorwav->set_tooltip_text(""); + levelwav->set_tooltip_text(""); + clariFrame->set_tooltip_text(""); + clarisoft->set_tooltip_text(""); + expcontrastpyr->set_tooltip_text(""); + wavgradl->set_tooltip_text(""); + wavedg->set_tooltip_text(""); + wavblur->set_tooltip_text(""); + chromablu->set_tooltip_text(""); + expcontrastpyr2->set_tooltip_text(""); + wavcont->set_tooltip_text(""); + chromalev->set_tooltip_text(""); + wavcompre->set_tooltip_text(""); + wavcomp->set_tooltip_text(""); + fftwlc->set_tooltip_text(""); + expmasklc->set_tooltip_text(""); + CCmasklcshape->setTooltip(""); + LLmasklcshape->setTooltip(""); + HHmasklcshape->setTooltip(""); + blendmasklc->set_tooltip_text(""); + mask2lcCurveEditorG->set_tooltip_text(""); + Lmasklcshape->setTooltip(""); } } @@ -2551,7 +2726,7 @@ void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const Pa fftwlc->set_active(spot.fftwlc); // Update Local contrast GUI according to fftwlc button state - // Note: Contrary to the others, shall be called before setting 'lcradius' value + // Note: Contrary to the others, shall be called before setting lcradius value updateContrastGUI3(); lcradius->setValue((double)spot.lcradius); lcamount->setValue(spot.lcamount); @@ -2559,8 +2734,8 @@ void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const Pa lclightness->setValue(spot.lclightness); sigmalc->setValue(spot.sigmalc); wavshape->setCurve(spot.locwavcurve); - levelwav->setValue((double)spot.levelwav); csThreshold->setValue(spot.csthreshold); + levelwav->setValue((double)spot.levelwav); residcont->setValue(spot.residcont); residchro->setValue(spot.residchro); residsha->setValue(spot.residsha); @@ -2676,8 +2851,8 @@ void LocallabContrast::write(rtengine::procparams::ProcParams* pp, ParamsEdited* spot.lclightness = lclightness->getValue(); spot.sigmalc = sigmalc->getValue(); spot.locwavcurve = wavshape->getCurve(); - spot.levelwav = levelwav->getIntValue(); spot.csthreshold = csThreshold->getValue(); + spot.levelwav = levelwav->getIntValue(); spot.residcont = residcont->getValue(); spot.residchro = residchro->getValue(); spot.residsha = residsha->getValue(); @@ -3239,13 +3414,96 @@ void LocallabContrast::convertParamToNormal() disableListener(); // Set hidden GUI widgets in Normal mode to default spot values + origlc->set_active(defSpot.origlc); + wavgradl->set_active(defSpot.wavgradl); + sigmalc2->setValue(defSpot.sigmalc2); + strwav->setValue(defSpot.strwav); + angwav->setValue(defSpot.angwav); + wavedg->set_active(defSpot.wavedg); + strengthw->setValue(defSpot.strengthw); + sigmaed->setValue(defSpot.sigmaed); + wavshapeedg->setCurve(defSpot.locedgwavcurve); + gradw->setValue(defSpot.gradw); + waveshow->set_active(defSpot.waveshow); + radiusw->setValue(defSpot.radiusw); + detailw->setValue(defSpot.detailw); + + if (defSpot.localedgMethod == "fir") { + localedgMethod->set_active(0); + } else if (defSpot.localedgMethod == "sec") { + localedgMethod->set_active(1); + } else if (defSpot.localedgMethod == "thr") { + localedgMethod->set_active(2); + } + + tloww->setValue(defSpot.tloww); + thigw->setValue(defSpot.thigw); + edgw->setValue(defSpot.edgw); + basew->setValue(defSpot.basew); + + if (defSpot.localneiMethod == "none") { + localneiMethod->set_active(0); + } else if (defSpot.localneiMethod == "low") { + localneiMethod->set_active(1); + } else if (defSpot.localneiMethod == "high") { + localneiMethod->set_active(2); + } + + wavblur->set_active(defSpot.wavblur); + levelblur->setValue(defSpot.levelblur); + sigmabl->setValue(defSpot.sigmabl); + chromablu->setValue(defSpot.chromablu); + wavshapelev->setCurve(defSpot.loclevwavcurve); + residblur->setValue(defSpot.residblur); + blurlc->set_active(defSpot.blurlc); + wavcont->set_active(defSpot.wavcont); + sigma->setValue(defSpot.sigma); + offset->setValue(defSpot.offset); + chromalev->setValue(defSpot.chromalev); + wavshapecon->setCurve(defSpot.locconwavcurve); + wavcompre->set_active(defSpot.wavcompre); + wavshapecompre->setCurve(defSpot.loccomprewavcurve); + sigmadr->setValue(defSpot.sigmadr); + threswav->setValue(defSpot.threswav); + residcomp->setValue(defSpot.residcomp); + wavcomp->set_active(defSpot.wavcomp); + sigmadc->setValue(defSpot.sigmadc); + deltad->setValue(defSpot.deltad); + wavshapecomp->setCurve(defSpot.loccompwavcurve); + fatres->setValue(defSpot.fatres); + fftwlc->set_active(defSpot.fftwlc); + + // Enable all listeners + enableListener(); + + // Update GUI based on converted widget parameters: + // - Update Local contrast GUI according to fftwlc button state + updateContrastGUI3(); +} + +void LocallabContrast::convertParamToSimple() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden specific GUI widgets in Simple mode to default spot values if (defSpot.localcontMethod == "loc") { localcontMethod->set_active(0); } else if (defSpot.localcontMethod == "wav") { localcontMethod->set_active(1); } - fftwlc->set_active(defSpot.fftwlc); + showmasklcMethod->set_active(0); + enalcMask->set_active(defSpot.enalcMask); + CCmasklcshape->setCurve(defSpot.CCmasklccurve); + LLmasklcshape->setCurve(defSpot.LLmasklccurve); + HHmasklcshape->setCurve(defSpot.HHmasklccurve); + blendmasklc->setValue((double)defSpot.blendmasklc); + radmasklc->setValue(defSpot.radmasklc); + chromasklc->setValue(defSpot.chromasklc); + Lmasklcshape->setCurve(defSpot.Lmasklccurve); // Enable all listeners enableListener(); @@ -3253,20 +3511,49 @@ void LocallabContrast::convertParamToNormal() // Update GUI based on converted widget parameters: // - Update Local contrast GUI according to localcontMethod combobox value updateContrastGUI1(); - // - Update Local contrast GUI according to fftwlc button state - updateContrastGUI3(); } void LocallabContrast::updateGUIToMode(const modeType new_type) { - if (new_type == Normal) { - // Advanced widgets are hidden in Normal mode - localcontMethod->hide(); - fftwlc->hide(); - } else { - // Advanced widgets are shown in Expert mode - localcontMethod->show(); - fftwlc->show(); + switch (new_type) { + case Simple: + // Expert and Normal mode widgets are hidden in Simple mode + localcontMethod->hide(); + origlc->hide(); + expcontrastpyr->hide(); + expcontrastpyr2->hide(); + fftwlc->hide(); + expmasklc->hide(); + + break; + + case Normal: + // Expert mode widgets are hidden in Normal mode + origlc->hide(); + expcontrastpyr->hide(); + expcontrastpyr2->hide(); + fftwlc->hide(); + // Specific Simple mode widgets are shown in Normal mode + localcontMethod->show(); + expmasklc->show(); + + break; + + case Expert: + // Show widgets hidden in Normal and Simple mode + localcontMethod->show(); + origlc->show(); + + if (localcontMethod->get_active_row_number() != 0) { // Keep widgets hidden when localcontMethod is equal to 0 + expcontrastpyr->show(); + expcontrastpyr2->show(); + } + + if (localcontMethod->get_active_row_number() != 1) { // Keep widget hidden when localcontMethod is equal to 1 + fftwlc->show(); + } + + expmasklc->show(); } } @@ -3505,6 +3792,8 @@ void LocallabContrast::enalcMaskChanged() void LocallabContrast::updateContrastGUI1() { + const int mode = complexity->get_active_row_number(); + // Update Local contrast GUI according to localcontMethod combobox value if (localcontMethod->get_active_row_number() == 0) { lcradius->show(); @@ -3512,33 +3801,33 @@ void LocallabContrast::updateContrastGUI1() lcdarkness->show(); lclightness->show(); contFrame->hide(); - sigmalc->hide(); - LocalcurveEditorwav->hide(); levelwav->hide(); - csThreshold->hide(); expresidpyr->hide(); clariFrame->hide(); expcontrastpyr->hide(); expcontrastpyr2->hide(); - fftwlc->show(); + + if (mode == Expert) { // Keep widget hidden in Normal and Simple mode + fftwlc->show(); + } } else if (localcontMethod->get_active_row_number() == 1) { lcradius->hide(); lcamount->hide(); lcdarkness->hide(); lclightness->hide(); contFrame->show(); - sigmalc->show(); - LocalcurveEditorwav->show(); levelwav->show(); - csThreshold->show(); expresidpyr->show(); clariFrame->show(); - expcontrastpyr->show(); - expcontrastpyr2->show(); + + if (mode == Expert) { // Keep widget hidden in Normal and Simple mode + expcontrastpyr->show(); + expcontrastpyr2->show(); + } + fftwlc->hide(); } } - void LocallabContrast::updateContrastGUI2() { // Update Local contrast GUI according to waveshow button state @@ -3568,6 +3857,7 @@ LocallabCBDL::LocallabCBDL(): LocallabTool(this, M("TP_LOCALLAB_CBDL_TOOLNAME"), M("TP_LOCALLAB_CBDL"), true), // CBDL specific widgets + levFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LEVFRA")))), multiplier([]() -> std::array { std::array res = {}; @@ -3587,7 +3877,6 @@ LocallabCBDL::LocallabCBDL(): return res; } ()), - levFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LEVFRA")))), chromacbdl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMACBDL"), 0., 1.5, 0.01, 0.))), threshold(Gtk::manage(new Adjuster(M("TP_DIRPYREQUALIZER_THRESHOLD"), 0, 1., 0.01, 0.2))), clarityml(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARITYML"), 0.1, 100., 0.1, 0.1))), @@ -3664,7 +3953,6 @@ LocallabCBDL::LocallabCBDL(): blendmaskcb->setAdjusterListener(this); - // radmaskcb->setLogScale(10, -10); radmaskcb->setAdjusterListener(this); lapmaskcb->setAdjusterListener(this); @@ -3706,7 +3994,7 @@ LocallabCBDL::LocallabCBDL(): levBox->pack_start(*chromacbdl); levBox->pack_start(*threshold); levFrame->add(*levBox); - pack_start(*levFrame); + pack_start(*levFrame); Gtk::Frame* const residFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RESID"))); residFrame->set_label_align(0.025, 0.5); ToolParamBlock* const residBox = Gtk::manage(new ToolParamBlock()); @@ -3759,24 +4047,44 @@ void LocallabCBDL::updateAdviceTooltips(const bool showTooltips) { if (showTooltips) { levFrame->set_tooltip_text(M("TP_LOCALLAB_EXPCBDL_TOOLTIP")); + for (const auto adj : multiplier) { adj->set_tooltip_text(M("TP_LOCALLAB_CBDL_ADJ_TOOLTIP")); } - threshold->set_tooltip_text(M("TP_LOCALLAB_CBDL_THRES_TOOLTIP")); + chromacbdl->set_tooltip_text(M("TP_LOCALLAB_CHROMACB_TOOLTIP")); + threshold->set_tooltip_text(M("TP_LOCALLAB_CBDL_THRES_TOOLTIP")); clarityml->set_tooltip_text(M("TP_LOCALLAB_CBDLCLARI_TOOLTIP")); sensicb->set_tooltip_text(M("TP_LOCALLAB_SENSIH_TOOLTIP")); expmaskcb->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); CCmaskcbshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); LLmaskcbshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); HHmaskcbshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + blendmaskcb->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); radmaskcb->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); lapmaskcb->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); - Lmaskcbshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); - blendmaskcb->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP")); mask2cbCurveEditorG->set_tooltip_text(M("TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP")); + Lmaskcbshape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); } else { - exp->set_tooltip_text(""); + levFrame->set_tooltip_text(""); + + for (const auto adj : multiplier) { + adj->set_tooltip_text(""); + } + + chromacbdl->set_tooltip_text(""); + threshold->set_tooltip_text(""); + clarityml->set_tooltip_text(""); + sensicb->set_tooltip_text(""); + expmaskcb->set_tooltip_text(""); + CCmaskcbshape->setTooltip(""); + LLmaskcbshape->setTooltip(""); + HHmaskcbshape->setTooltip(""); + blendmaskcb->set_tooltip_text(""); + radmaskcb->set_tooltip_text(""); + lapmaskcb->set_tooltip_text(""); + mask2cbCurveEditorG->set_tooltip_text(""); + Lmaskcbshape->setTooltip(""); } } @@ -4089,14 +4397,55 @@ void LocallabCBDL::convertParamToNormal() enableListener(); } +void LocallabCBDL::convertParamToSimple() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden specific GUI widgets in Simple mode to default spot values + softradiuscb->setValue(defSpot.softradiuscb); + showmaskcbMethod->set_active(0); + enacbMask->set_active(defSpot.enacbMask); + CCmaskcbshape->setCurve(defSpot.CCmaskcbcurve); + LLmaskcbshape->setCurve(defSpot.LLmaskcbcurve); + HHmaskcbshape->setCurve(defSpot.HHmaskcbcurve); + blendmaskcb->setValue((double)defSpot.blendmaskcb); + radmaskcb->setValue(defSpot.radmaskcb); + chromaskcb->setValue(defSpot.chromaskcb); + gammaskcb->setValue(defSpot.gammaskcb); + slomaskcb->setValue(defSpot.slomaskcb); + Lmaskcbshape->setCurve(defSpot.Lmaskcbcurve); + + // Enable all listers + enableListener(); +} + void LocallabCBDL::updateGUIToMode(const modeType new_type) { - if (new_type == Normal) { - // Advanced widgets are hidden in Normal mode - lapmaskcb->hide(); - } else { - // Advanced widgets are shown in Expert mode - lapmaskcb->show(); + switch (new_type) { + case Simple: + // Expert and Normal mode widgets are hidden in Simple mode + softradiuscb->hide(); + expmaskcb->hide(); + + break; + + case Normal: + // Expert mode widgets are hidden in Normal mode + lapmaskcb->hide(); + // Specific Simple mode widgets are shown in Normal mode + softradiuscb->show(); + expmaskcb->show(); + + break; + + case Expert: + // Show widgets hidden in Normal and Simple mode + softradiuscb->show(); + expmaskcb->show(); + lapmaskcb->show(); } } @@ -4259,17 +4608,22 @@ void LocallabLog::updateAdviceTooltips(const bool showTooltips) autocompute->set_tooltip_text(M("TP_LOCALLAB_LOGAUTO_TOOLTIP")); blackEv->set_tooltip_text(M("TP_LOCALLAB_LOGBLACKWHEV_TOOLTIP")); whiteEv->set_tooltip_text(M("TP_LOCALLAB_LOGBLACKWHEV_TOOLTIP")); - // Autogray->set_tooltip_text(M("TP_LOCALLAB_LOGAUTOGREY_TOOLTIP")); - Autogray->set_tooltip_text(M("")); sourceGray->set_tooltip_text(M("TP_LOCALLAB_LOGSRCGREY_TOOLTIP")); targetGray->set_tooltip_text(M("TP_LOCALLAB_LOGTARGGREY_TOOLTIP")); - // detail->set_tooltip_text(M("TP_LOCALLAB_LOGDET_TOOLTIP")); - detail->set_tooltip_text(M("")); baselog->set_tooltip_text(M("TP_LOCALLAB_LOGBASE_TOOLTIP")); strlog->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); anglog->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); } else { - exp->set_tooltip_text(M("")); + exp->set_tooltip_text(""); + logPFrame->set_tooltip_text(""); + autocompute->set_tooltip_text(""); + blackEv->set_tooltip_text(""); + whiteEv->set_tooltip_text(""); + sourceGray->set_tooltip_text(""); + targetGray->set_tooltip_text(""); + baselog->set_tooltip_text(""); + strlog->set_tooltip_text(""); + anglog->set_tooltip_text(""); } } @@ -4537,12 +4891,10 @@ void LocallabLog::updateLogGUI() blackEv->set_sensitive(false); whiteEv->set_sensitive(false); sourceGray->set_sensitive(false); - // targetGray->set_sensitive(true); } else { blackEv->set_sensitive(true); whiteEv->set_sensitive(true); sourceGray->set_sensitive(true); - // targetGray->set_sensitive(true); } } @@ -4551,19 +4903,17 @@ void LocallabLog::updateLogGUI() LocallabMask::LocallabMask(): LocallabTool(this, M("TP_LOCALLAB_MASKCOM_TOOLNAME"), M("TP_LOCALLAB_MASKCOM"), false), - // Comon mask specific widgets + // Common mask specific widgets sensimask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), blendmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKMASK"), -100., 100., 0.1, -10.))), blendmaskab(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKMASKAB"), -100., 100., 0.1, -10.))), softradiusmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.5, 1.))), - showmask_Method(Gtk::manage(new MyComboBoxText())), enamask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), mask_CurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASKCOL"))), CCmask_shape(static_cast(mask_CurveEditorG->addCurve(CT_Flat, "C(C)", nullptr, false, false))), LLmask_shape(static_cast(mask_CurveEditorG->addCurve(CT_Flat, "L(L)", nullptr, false, false))), HHmask_shape(static_cast(mask_CurveEditorG->addCurve(CT_Flat, "LC(H)", nullptr, false, true))), - struFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABSTRUM")))), strumaskmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUMASKCOL"), 0., 200., 0.1, 0.))), toolmask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_TOOLCOL")))), @@ -4571,14 +4921,13 @@ LocallabMask::LocallabMask(): fftmask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_FFTCOL_MASK")))), contmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTCOL"), 0., 200., 0.5, 0.))), blurmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURCOL"), 0.2, 100., 0.5, 0.2))), - + toolmaskFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_TOOLMASK")))), radmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), 0.0, 100.0, 0.1, 0.))), lapmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPMASKCOL"), 0.0, 100.0, 0.1, 0.))), chromask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0, 0.1, 0.))), gammask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMMASKCOL"), 0.25, 4.0, 0.01, 1.))), slopmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOMASKCOL"), 0.0, 15.0, 0.1, 0.))), shadmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHAMASKCOL"), 0, 100, 1, 0))), - mask_HCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASKH"))), HHhmask_shape(static_cast(mask_HCurveEditorG->addCurve(CT_Flat, "H(H)", nullptr, false, true))), mask2CurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK2"))), @@ -4589,142 +4938,154 @@ LocallabMask::LocallabMask(): gradFramemask(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADFRA")))), str_mask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTR"), -2., 2., 0.05, 0.))), ang_mask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADANG"), -180., 180., 0.1, 0.))) - { + const LocallabParams::LocallabSpot defSpot; + // Parameter Mask common specific widgets - const LocallabParams::LocallabSpot defSpot; - - sensimask->setAdjusterListener(this); - blendmask->setLogScale(10, 0); - blendmaskab->setLogScale(10, 0); - blendmask->setAdjusterListener(this); - blendmaskab->setAdjusterListener(this); - // softradiusmask->setLogScale(10, -10); - softradiusmask->setAdjusterListener(this); - showmask_Method->append(M("TP_LOCALLAB_SHOWMNONE")); - showmask_Method->append(M("TP_LOCALLAB_SHOWMODIFMASK")); - showmask_Method->append(M("TP_LOCALLAB_SHOWMASK")); - showmask_Method->append(M("TP_LOCALLAB_SHOWREF")); - showmask_Method->set_active(0); - showmask_Method->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); - showmask_MethodConn = showmask_Method->signal_changed().connect(sigc::mem_fun(*this, &LocallabMask::showmask_MethodChanged)); - enamaskConn = enamask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabMask::enamaskChanged)); - mask_CurveEditorG->setCurveListener(this); + sensimask->setAdjusterListener(this); - CCmask_shape->setIdentityValue(0.); - CCmask_shape->setResetCurve(FlatCurveType(defSpot.CCmask_curve.at(0)), defSpot.CCmask_curve); - CCmask_shape->setBottomBarColorProvider(this, 1); + blendmask->setLogScale(10, 0); + blendmask->setAdjusterListener(this); - LLmask_shape->setIdentityValue(0.); - LLmask_shape->setResetCurve(FlatCurveType(defSpot.LLmask_curve.at(0)), defSpot.LLmask_curve); - LLmask_shape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); + blendmaskab->setLogScale(10, 0); + blendmaskab->setAdjusterListener(this); - HHmask_shape->setIdentityValue(0.); - HHmask_shape->setResetCurve(FlatCurveType(defSpot.HHmask_curve.at(0)), defSpot.HHmask_curve); - HHmask_shape->setCurveColorProvider(this, 2); - HHmask_shape->setBottomBarColorProvider(this, 2); + softradiusmask->setAdjusterListener(this); - mask_CurveEditorG->curveListComplete(); + showmask_Method->append(M("TP_LOCALLAB_SHOWMNONE")); + showmask_Method->append(M("TP_LOCALLAB_SHOWMODIFMASK")); + showmask_Method->append(M("TP_LOCALLAB_SHOWMASK")); + showmask_Method->append(M("TP_LOCALLAB_SHOWREF")); + showmask_Method->set_active(0); + showmask_Method->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); + showmask_MethodConn = showmask_Method->signal_changed().connect(sigc::mem_fun(*this, &LocallabMask::showmask_MethodChanged)); - struFrame->set_label_align(0.025, 0.5); + enamaskConn = enamask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabMask::enamaskChanged)); - strumaskmask->setAdjusterListener(this); + mask_CurveEditorG->setCurveListener(this); - toolmaskConn = toolmask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabMask::toolmaskChanged)); - blurFrame->set_label_align(0.025, 0.5); + CCmask_shape->setIdentityValue(0.); + CCmask_shape->setResetCurve(FlatCurveType(defSpot.CCmask_curve.at(0)), defSpot.CCmask_curve); + CCmask_shape->setBottomBarColorProvider(this, 1); - fftmaskConn = fftmask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabMask::fftmaskChanged)); - contmask->setAdjusterListener(this); + LLmask_shape->setIdentityValue(0.); + LLmask_shape->setResetCurve(FlatCurveType(defSpot.LLmask_curve.at(0)), defSpot.LLmask_curve); + LLmask_shape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); - blurmask->setAdjusterListener(this); + HHmask_shape->setIdentityValue(0.); + HHmask_shape->setResetCurve(FlatCurveType(defSpot.HHmask_curve.at(0)), defSpot.HHmask_curve); + HHmask_shape->setCurveColorProvider(this, 2); + HHmask_shape->setBottomBarColorProvider(this, 2); - radmask->setAdjusterListener(this); - lapmask->setAdjusterListener(this); - chromask->setAdjusterListener(this); - gammask->setAdjusterListener(this); - slopmask->setAdjusterListener(this); - shadmask->setAdjusterListener(this); + mask_CurveEditorG->curveListComplete(); - mask_HCurveEditorG->setCurveListener(this); + struFrame->set_label_align(0.025, 0.5); - HHhmask_shape->setIdentityValue(0.); - HHhmask_shape->setResetCurve(FlatCurveType(defSpot.HHhmask_curve.at(0)), defSpot.HHhmask_curve); - HHhmask_shape->setCurveColorProvider(this, 2); - HHhmask_shape->setBottomBarColorProvider(this, 2); + strumaskmask->setAdjusterListener(this); - mask_HCurveEditorG->curveListComplete(); + toolmaskConn = toolmask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabMask::toolmaskChanged)); - mask2CurveEditorG->setCurveListener(this); + blurFrame->set_label_align(0.025, 0.5); - Lmask_shape->setResetCurve(DiagonalCurveType(defSpot.Lmask_curve.at(0)), defSpot.Lmask_curve); - Lmask_shape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); - Lmask_shape->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); + fftmaskConn = fftmask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabMask::fftmaskChanged)); - mask2CurveEditorG->curveListComplete(); + contmask->setAdjusterListener(this); - mask2CurveEditorGwav->setCurveListener(this); + blurmask->setAdjusterListener(this); - csThresholdmask->setAdjusterListener(this); + toolmaskFrame->set_label_align(0.025, 0.5); - LLmask_shapewav->setIdentityValue(0.); - LLmask_shapewav->setResetCurve(FlatCurveType(defSpot.LLmask_curvewav.at(0)), defSpot.LLmask_curvewav); - LLmask_shapewav->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); + radmask->setAdjusterListener(this); - mask2CurveEditorGwav->curveListComplete(); + lapmask->setAdjusterListener(this); - pack_start(*sensimask, Gtk::PACK_SHRINK, 0); - pack_start(*blendmask, Gtk::PACK_SHRINK, 0); - pack_start(*blendmaskab, Gtk::PACK_SHRINK, 0); - pack_start(*softradiusmask, Gtk::PACK_SHRINK, 0); - ToolParamBlock* const maskmaskBox = Gtk::manage(new ToolParamBlock()); - maskmaskBox->pack_start(*showmask_Method, Gtk::PACK_SHRINK, 4); - maskmaskBox->pack_start(*mask_CurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - maskmaskBox->pack_start(*enamask, Gtk::PACK_SHRINK, 0); + chromask->setAdjusterListener(this); - ToolParamBlock* const strumBox = Gtk::manage(new ToolParamBlock()); - strumBox->pack_start(*strumaskmask); - strumBox->pack_start(*toolmask); - - struFrame->add(*strumBox); - maskmaskBox->pack_start(*struFrame, Gtk::PACK_SHRINK, 0); + gammask->setAdjusterListener(this); - ToolParamBlock* const blurmBox = Gtk::manage(new ToolParamBlock()); - blurmBox->pack_start(*fftmask, Gtk::PACK_SHRINK, 0); - blurmBox->pack_start(*contmask); - blurmBox->pack_start(*blurmask); - blurFrame->add(*blurmBox); - maskmaskBox->pack_start(*blurFrame, Gtk::PACK_SHRINK, 0); + slopmask->setAdjusterListener(this); + shadmask->setAdjusterListener(this); - gradFramemask->set_label_align(0.025, 0.5); + mask_HCurveEditorG->setCurveListener(this); - str_mask->setAdjusterListener(this); + HHhmask_shape->setIdentityValue(0.); + HHhmask_shape->setResetCurve(FlatCurveType(defSpot.HHhmask_curve.at(0)), defSpot.HHhmask_curve); + HHhmask_shape->setCurveColorProvider(this, 2); + HHhmask_shape->setBottomBarColorProvider(this, 2); - ang_mask->setAdjusterListener(this); - ang_mask->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); - ToolParamBlock* const gradmaskBox = Gtk::manage(new ToolParamBlock()); - gradmaskBox->pack_start(*str_mask); - gradmaskBox->pack_start(*ang_mask); - gradFramemask->add(*gradmaskBox); + mask_HCurveEditorG->curveListComplete(); - Gtk::Frame* const toolmaskFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_TOOLMASK"))); - toolmaskFrame->set_label_align(0.025, 0.5); - ToolParamBlock* const toolmaskBox = Gtk::manage(new ToolParamBlock()); - - toolmaskBox->pack_start(*radmask, Gtk::PACK_SHRINK, 0); - toolmaskBox->pack_start(*lapmask, Gtk::PACK_SHRINK, 0); - toolmaskBox->pack_start(*chromask, Gtk::PACK_SHRINK, 0); - toolmaskBox->pack_start(*gammask, Gtk::PACK_SHRINK, 0); - toolmaskBox->pack_start(*slopmask, Gtk::PACK_SHRINK, 0); - toolmaskBox->pack_start(*shadmask, Gtk::PACK_SHRINK, 0); - toolmaskBox->pack_start(*mask_HCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - toolmaskBox->pack_start(*mask2CurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - toolmaskBox->pack_start(*mask2CurveEditorGwav, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - toolmaskBox->pack_start(*csThresholdmask, Gtk::PACK_SHRINK, 0); - toolmaskBox->pack_start(*gradFramemask, Gtk::PACK_SHRINK, 0); - toolmaskFrame->add(*toolmaskBox); - maskmaskBox->pack_start(*toolmaskFrame); - pack_start(*maskmaskBox); + mask2CurveEditorG->setCurveListener(this); + + Lmask_shape->setResetCurve(DiagonalCurveType(defSpot.Lmask_curve.at(0)), defSpot.Lmask_curve); + Lmask_shape->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); + Lmask_shape->setLeftBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); + + mask2CurveEditorG->curveListComplete(); + + mask2CurveEditorGwav->setCurveListener(this); + + LLmask_shapewav->setIdentityValue(0.); + LLmask_shapewav->setResetCurve(FlatCurveType(defSpot.LLmask_curvewav.at(0)), defSpot.LLmask_curvewav); + LLmask_shapewav->setBottomBarBgGradient({{0., 0., 0., 0.}, {1., 1., 1., 1.}}); + + mask2CurveEditorGwav->curveListComplete(); + + csThresholdmask->setAdjusterListener(this); + + gradFramemask->set_label_align(0.025, 0.5); + + str_mask->setAdjusterListener(this); + + ang_mask->setAdjusterListener(this); + ang_mask->set_tooltip_text(M("TP_LOCALLAB_GRADANG_TOOLTIP")); + + // Add Common mask specific widgets to GUI + pack_start(*sensimask); + pack_start(*blendmask); + pack_start(*blendmaskab); + pack_start(*softradiusmask); + pack_start(*showmask_Method); + pack_start(*enamask); + pack_start(*mask_CurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + ToolParamBlock* const strumBox = Gtk::manage(new ToolParamBlock()); + strumBox->pack_start(*strumaskmask); + strumBox->pack_start(*toolmask); + struFrame->add(*strumBox); + pack_start(*struFrame); + ToolParamBlock* const blurmBox = Gtk::manage(new ToolParamBlock()); + blurmBox->pack_start(*fftmask, Gtk::PACK_SHRINK, 0); + blurmBox->pack_start(*contmask); + blurmBox->pack_start(*blurmask); + blurFrame->add(*blurmBox); + pack_start(*blurFrame); + ToolParamBlock* const toolmaskBox = Gtk::manage(new ToolParamBlock()); + toolmaskBox->pack_start(*radmask, Gtk::PACK_SHRINK, 0); + toolmaskBox->pack_start(*lapmask, Gtk::PACK_SHRINK, 0); + toolmaskBox->pack_start(*chromask, Gtk::PACK_SHRINK, 0); + toolmaskBox->pack_start(*gammask, Gtk::PACK_SHRINK, 0); + toolmaskBox->pack_start(*slopmask, Gtk::PACK_SHRINK, 0); + toolmaskBox->pack_start(*shadmask, Gtk::PACK_SHRINK, 0); + toolmaskBox->pack_start(*mask_HCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + toolmaskBox->pack_start(*mask2CurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + toolmaskBox->pack_start(*mask2CurveEditorGwav, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + toolmaskBox->pack_start(*csThresholdmask, Gtk::PACK_SHRINK, 0); + ToolParamBlock* const gradmaskBox = Gtk::manage(new ToolParamBlock()); + gradmaskBox->pack_start(*str_mask); + gradmaskBox->pack_start(*ang_mask); + gradFramemask->add(*gradmaskBox); + toolmaskBox->pack_start(*gradFramemask, Gtk::PACK_SHRINK, 0); + toolmaskFrame->add(*toolmaskBox); + pack_start(*toolmaskFrame); +} + +LocallabMask::~LocallabMask() +{ + delete mask_CurveEditorG; + delete mask_HCurveEditorG; + delete mask2CurveEditorG; + delete mask2CurveEditorGwav; } bool LocallabMask::isMaskViewActive() @@ -4732,13 +5093,10 @@ bool LocallabMask::isMaskViewActive() return ((showmask_Method->get_active_row_number() != 0)); } - void LocallabMask::resetMaskView() { showmask_MethodConn.block(true); - showmask_Method->set_active(0); - showmask_MethodConn.block(false); } @@ -4758,60 +5116,52 @@ void LocallabMask::updateAdviceTooltips(const bool showTooltips) LLmask_shape->setTooltip(M("TP_LOCALLAB_CURVEEDITORM_CC_TOOLTIP")); HHmask_shape->setTooltip(M("TP_LOCALLAB_CURVEEDITORM_CC_TOOLTIP")); struFrame->set_tooltip_text(M("TP_LOCALLAB_STRUMASK_TOOLTIP")); - mask_HCurveEditorG->set_tooltip_text(M("TP_LOCALLAB_HHMASK_TOOLTIP")); radmask->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); lapmask->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); + mask_HCurveEditorG->set_tooltip_text(M("TP_LOCALLAB_HHMASK_TOOLTIP")); mask2CurveEditorG->set_tooltip_text(M("TP_LOCALLAB_WAVMASK_TOOLTIP")); Lmask_shape->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); mask2CurveEditorGwav->set_tooltip_text(M("TP_LOCALLAB_WAVMASK_TOOLTIP")); LLmask_shapewav->setTooltip(M("TP_LOCALLAB_LMASK_LEVEL_TOOLTIP")); } else { - exp->set_tooltip_text(M("")); + exp->set_tooltip_text(""); + sensimask->set_tooltip_text(""); + blendmask->set_tooltip_text(""); + blendmaskab->set_tooltip_text(""); + CCmask_shape->setTooltip(""); + LLmask_shape->setTooltip(""); + HHmask_shape->setTooltip(""); + struFrame->set_tooltip_text(""); + radmask->set_tooltip_text(""); + lapmask->set_tooltip_text(""); + mask_HCurveEditorG->set_tooltip_text(""); + mask2CurveEditorG->set_tooltip_text(""); + Lmask_shape->setTooltip(""); + mask2CurveEditorGwav->set_tooltip_text(""); + LLmask_shapewav->setTooltip(""); } } -LocallabMask::~LocallabMask() -{ - delete mask_CurveEditorG; - delete mask_HCurveEditorG; - delete mask2CurveEditorG; - delete mask2CurveEditorGwav; -} - void LocallabMask::disableListener() { LocallabTool::disableListener(); + showmask_MethodConn.block(true); enamaskConn.block(true); toolmaskConn.block(true); fftmaskConn.block(true); - } void LocallabMask::enableListener() { LocallabTool::enableListener(); + showmask_MethodConn.block(false); enamaskConn.block(false); toolmaskConn.block(false); fftmaskConn.block(false); - } -void LocallabMask::showmask_MethodChanged() -{ - - // If mask preview is activated, deactivate all other tool mask preview - if (locToolListener) { - locToolListener->resetOtherMaskView(this); - } - - if (listener) { - listener->panelChanged(EvlocallabshowmaskMethod, ""); - } -} - - void LocallabMask::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { // Disable all listeners @@ -4829,35 +5179,34 @@ void LocallabMask::read(const rtengine::procparams::ProcParams* pp, const Params exp->setEnabled(spot.expmask); complexity->set_active(spot.complexmask); - - sensimask->setValue(spot.sensimask); - contmask->setValue(spot.contmask); - updatemaskGUI3(); - blurmask->setValue(spot.blurmask); - + sensimask->setValue((double)spot.sensimask); blendmask->setValue(spot.blendmask); blendmaskab->setValue(spot.blendmaskab); - softradiusmask->setValue(spot.softradiusmask); + softradiusmask->setValue(spot.softradiusmask); enamask->set_active(spot.enamask); CCmask_shape->setCurve(spot.CCmask_curve); LLmask_shape->setCurve(spot.LLmask_curve); HHmask_shape->setCurve(spot.HHmask_curve); strumaskmask->setValue(spot.strumaskmask); toolmask->set_active(spot.toolmask); + fftmask->set_active(spot.fftmask); + contmask->setValue(spot.contmask); + // Update Common mask GUI according to fftmask button state + // Note: Contrary to the others, shall be called before setting blurmask value + updateMaskGUI(); + blurmask->setValue(spot.blurmask); radmask->setValue(spot.radmask); lapmask->setValue(spot.lapmask); chromask->setValue(spot.chromask); gammask->setValue(spot.gammask); slopmask->setValue(spot.slopmask); shadmask->setValue(spot.shadmask); - str_mask->setValue(spot.str_mask); - ang_mask->setValue(spot.ang_mask); HHhmask_shape->setCurve(spot.HHhmask_curve); - fftmask->set_active(spot.fftmask); Lmask_shape->setCurve(spot.Lmask_curve); LLmask_shapewav->setCurve(spot.LLmask_curvewav); csThresholdmask->setValue(spot.csthresholdmask); - + str_mask->setValue((double)spot.str_mask); + ang_mask->setValue((double)spot.ang_mask); } // Enable all listeners @@ -4866,7 +5215,6 @@ void LocallabMask::read(const rtengine::procparams::ProcParams* pp, const Params // Update GUI according to complexity mode updateGUIToMode(static_cast(complexity->get_active_row_number())); - // Note: No need to manage pedited as batch mode is deactivated for Locallab } @@ -4891,44 +5239,26 @@ void LocallabMask::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.HHmask_curve = HHmask_shape->getCurve(); spot.strumaskmask = strumaskmask->getValue(); spot.toolmask = toolmask->get_active(); + spot.fftmask = fftmask->get_active(); + spot.contmask = contmask->getValue(); + spot.blurmask = blurmask->getValue(); spot.radmask = radmask->getValue(); spot.lapmask = lapmask->getValue(); spot.chromask = chromask->getValue(); spot.gammask = gammask->getValue(); spot.slopmask = slopmask->getValue(); spot.shadmask = shadmask->getValue(); - spot.str_mask = str_mask->getIntValue(); - spot.ang_mask = ang_mask->getIntValue(); spot.HHhmask_curve = HHhmask_shape->getCurve(); - spot.fftmask = fftmask->get_active(); - spot.contmask = contmask->getValue(); - spot.blurmask = blurmask->getValue(); spot.Lmask_curve = Lmask_shape->getCurve(); spot.LLmask_curvewav = LLmask_shapewav->getCurve(); spot.csthresholdmask = csThresholdmask->getValue(); - + spot.str_mask = str_mask->getIntValue(); + spot.ang_mask = ang_mask->getIntValue(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab } -void LocallabMask::enamaskChanged() -{ - if (isLocActivated && exp->getEnabled()) { - if (listener) { - if (enamask->get_active()) { - listener->panelChanged(EvLocallabEnaMask, - M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")"); - } else { - listener->panelChanged(EvLocallabEnaMask, - M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")"); - } - } - } -} - - - void LocallabMask::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { const int index = defParams->locallab.selspot; @@ -4938,200 +5268,26 @@ void LocallabMask::setDefaults(const rtengine::procparams::ProcParams* defParams // Set default value for adjuster widgets sensimask->setDefault((double)defSpot.sensimask); - strumaskmask->setDefault(defSpot.strumaskmask); - toolmask->set_active(defSpot.toolmask); blendmask->setDefault(defSpot.blendmask); blendmaskab->setDefault(defSpot.blendmaskab); - softradiusmask->setDefault((double)defSpot.softradiusmask); + softradiusmask->setDefault(defSpot.softradiusmask); + strumaskmask->setDefault(defSpot.strumaskmask); + contmask->setDefault(defSpot.contmask); + blurmask->setDefault(defSpot.blurmask); radmask->setDefault(defSpot.radmask); lapmask->setDefault(defSpot.lapmask); chromask->setDefault(defSpot.chromask); - lapmask->setDefault(defSpot.lapmask); + gammask->setDefault(defSpot.lapmask); slopmask->setDefault(defSpot.slopmask); shadmask->setDefault(defSpot.shadmask); - str_mask->setDefault(defSpot.str_mask); - ang_mask->setDefault(defSpot.ang_mask); - HHhmask_shape->setCurve(defSpot.HHhmask_curve); - contmask->setDefault(defSpot.contmask); - blurmask->setDefault(defSpot.blurmask); csThresholdmask->setDefault(defSpot.csthresholdmask); - + str_mask->setDefault((double)defSpot.str_mask); + ang_mask->setDefault((double)defSpot.ang_mask); } // Note: No need to manage pedited as batch mode is deactivated for Locallab } -void LocallabMask::updateGUIToMode(const modeType new_type) -{ - if (new_type == Normal) { - // Advanced widgets are hidden in Normal mode - lapmask->hide(); - gammask->hide(); - slopmask->hide(); - shadmask->hide(); - str_mask->hide(); - ang_mask->hide(); - struFrame->hide(); - blurFrame->hide(); - gradFramemask->hide(); - mask_HCurveEditorG->hide(); -// mask2CurveEditorG->hide(); - mask2CurveEditorGwav->hide(); - csThresholdmask->hide(); - softradiusmask->hide(); - } else { - // Advanced widgets are shown in Expert mode - lapmask->show(); - gammask->show(); - slopmask->show(); - shadmask->show(); - str_mask->show(); - ang_mask->show(); - struFrame->show(); - blurFrame->show(); - gradFramemask->show(); - mask_HCurveEditorG->show(); -// mask2CurveEditorG->show(); - mask2CurveEditorGwav->show(); - csThresholdmask->show(); - softradiusmask->show(); - - } -} - -void LocallabMask::convertParamToNormal() -{ - const LocallabParams::LocallabSpot defSpot; - - // Disable all listeners - disableListener(); - - softradiusmask->setValue(defSpot.softradiusmask); - lapmask->setValue(defSpot.lapmask); - gammask->setValue(defSpot.gammask); - slopmask->setValue(defSpot.slopmask); - shadmask->setValue(defSpot.shadmask); - str_mask->setValue(defSpot.str_mask); - ang_mask->setValue(defSpot.ang_mask); - strumaskmask->setValue(defSpot.strumaskmask); - toolmask->set_active(defSpot.toolmask); - fftmask->set_active(defSpot.fftmask); - blurmask->setValue(defSpot.blurmask); - contmask->setValue(defSpot.contmask); - HHhmask_shape->setCurve(defSpot.HHhmask_curve); -// Lmask_shape->setCurve(defSpot.Lmask_curve); - LLmask_shapewav->setCurve(defSpot.LLmask_curvewav); - csThresholdmask->setValue(defSpot.csthresholdmask); - updatemaskGUI3(); - // Enable all listeners - enableListener(); - -} - -void LocallabMask::updatemaskGUI3() -{ - const double temp = blurmask->getValue(); - - if (fftmask->get_active()) { - blurmask->setLimits(0.2, 1000., 0.5, 0.2); - } else { - blurmask->setLimits(0.2, 100., 0.5, 0.2); - } - - blurmask->setValue(temp); - -} - -void LocallabMask::updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) -{ - idle_register.add( - [this, normHuer, normLumar, normChromar]() -> bool { - GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected - - // Update mask background - CCmask_shape->updateLocallabBackground(normChromar); - LLmask_shape->updateLocallabBackground(normLumar); - HHmask_shape->updateLocallabBackground(normHuer); - HHhmask_shape->updateLocallabBackground(normHuer); - Lmask_shape->updateLocallabBackground(normLumar); - - return false; - } - ); -} - - -void LocallabMask::fftmaskChanged() -{ - updatemaskGUI3(); // Update GUI according to fftmask button state - - if (isLocActivated && exp->getEnabled()) { - if (listener) { - if (fftmask->get_active()) { - listener->panelChanged(EvLocallabfftmask, - M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")"); - } else { - listener->panelChanged(EvLocallabfftmask, - M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")"); - } - } - } -} - - - - -void LocallabMask::curveChanged(CurveEditor* ce) -{ - if (isLocActivated && exp->getEnabled()) { - - if (ce == CCmask_shape) { - if (listener) { - listener->panelChanged(EvlocallabCCmask_shape, - M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); - } - } - - if (ce == LLmask_shape) { - if (listener) { - listener->panelChanged(EvlocallabLLmask_shape, - M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); - } - } - - if (ce == HHmask_shape) { - if (listener) { - listener->panelChanged(EvlocallabHHmask_shape, - M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); - } - } - - if (ce == HHhmask_shape) { - if (listener) { - listener->panelChanged(EvlocallabHHhmask_shape, - M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); - } - } - - if (ce == Lmask_shape) { - if (listener) { - listener->panelChanged(EvlocallabLmask_shape, - M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); - } - } - - if (ce == LLmask_shapewav) { - if (listener) { - listener->panelChanged(EvlocallabLLmask_shapewav, - M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); - } - } - - } -} - - - void LocallabMask::adjusterChanged(Adjuster* a, double newval) { if (isLocActivated && exp->getEnabled()) { @@ -5143,6 +5299,27 @@ void LocallabMask::adjusterChanged(Adjuster* a, double newval) } } + if (a == blendmask) { + if (listener) { + listener->panelChanged(Evlocallabblendmask, + blendmask->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == blendmaskab) { + if (listener) { + listener->panelChanged(Evlocallabblendmaskab, + blendmaskab->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == softradiusmask) { + if (listener) { + listener->panelChanged(Evlocallabsoftradiusmask, + softradiusmask->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == strumaskmask) { if (listener) { listener->panelChanged(Evlocallabstrumaskmask, @@ -5164,28 +5341,6 @@ void LocallabMask::adjusterChanged(Adjuster* a, double newval) } } - - if (a == blendmask) { - if (listener) { - listener->panelChanged(Evlocallabblendmask, - blendmask->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); - } - } - - if (a == blendmaskab) { - if (listener) { - listener->panelChanged(Evlocallabblendmaskab, - blendmaskab->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); - } - } - - if (a == softradiusmask) { - if (listener) { - listener->panelChanged(Evlocallabsoftradiusmask, - softradiusmask->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); - } - } - if (a == radmask) { if (listener) { listener->panelChanged(Evlocallabradmask, @@ -5257,6 +5412,88 @@ void LocallabMask::adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int ne } } +void LocallabMask::curveChanged(CurveEditor* ce) +{ + if (isLocActivated && exp->getEnabled()) { + if (ce == CCmask_shape) { + if (listener) { + listener->panelChanged(EvlocallabCCmask_shape, + M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (ce == LLmask_shape) { + if (listener) { + listener->panelChanged(EvlocallabLLmask_shape, + M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (ce == HHmask_shape) { + if (listener) { + listener->panelChanged(EvlocallabHHmask_shape, + M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (ce == HHhmask_shape) { + if (listener) { + listener->panelChanged(EvlocallabHHhmask_shape, + M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (ce == Lmask_shape) { + if (listener) { + listener->panelChanged(EvlocallabLmask_shape, + M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (ce == LLmask_shapewav) { + if (listener) { + listener->panelChanged(EvlocallabLLmask_shapewav, + M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + } +} + +void LocallabMask::complexityModeChanged() +{ + if (complexity->get_active_row_number() == Simple) { // New selected mode is Simple one + // Convert tool widget parameters + convertParamToNormal(); // From Expert mode to Normal mode + convertParamToSimple(); // From Normal mode to Simple mode + // Update GUI based on new mode + updateGUIToMode(Simple); + + if (listener && isLocActivated) { + listener->panelChanged(EvlocallabcomplexityWithRefresh, + M("TP_LOCALLAB_MODE_SIMPLE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } else if (complexity->get_active_row_number() == Normal) { // New selected mode is Normal one + // Convert tool widget parameters + convertParamToNormal(); + // Update GUI based on new mode + updateGUIToMode(Normal); + + if (listener && isLocActivated) { + listener->panelChanged(EvlocallabcomplexityWithRefresh, + M("TP_LOCALLAB_MODE_NORMAL") + " (" + escapeHtmlChars(spotName) + ")"); + } + } else if (complexity->get_active_row_number() == Expert) { // New selected mode is Expert one + // Update GUI based on new mode + updateGUIToMode(Expert); + + if (listener && isLocActivated) { + listener->panelChanged(EvlocallabcomplexityWithRefresh, + M("TP_LOCALLAB_MODE_EXPERT") + " (" + escapeHtmlChars(spotName) + ")"); + } + } +} + void LocallabMask::enabledChanged() { if (isLocActivated) { @@ -5272,6 +5509,146 @@ void LocallabMask::enabledChanged() } } +void LocallabMask::convertParamToNormal() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden GUI widgets in Normal mode to default spot values + softradiusmask->setValue(defSpot.softradiusmask); + strumaskmask->setValue(defSpot.strumaskmask); + toolmask->set_active(defSpot.toolmask); + fftmask->set_active(defSpot.fftmask); + contmask->setValue(defSpot.contmask); + blurmask->setValue(defSpot.blurmask); + lapmask->setValue(defSpot.lapmask); + gammask->setValue(defSpot.gammask); + slopmask->setValue(defSpot.slopmask); + shadmask->setValue(defSpot.shadmask); + HHhmask_shape->setCurve(defSpot.HHhmask_curve); + LLmask_shapewav->setCurve(defSpot.LLmask_curvewav); + csThresholdmask->setValue(defSpot.csthresholdmask); + str_mask->setValue((double)defSpot.str_mask); + ang_mask->setValue((double)defSpot.ang_mask); + + // Enable all listeners + enableListener(); + + // Update GUI based on converted widget parameters: + // - Update Common mask GUI according to fftmask button state + updateMaskGUI(); +} + +void LocallabMask::convertParamToSimple() +{ + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + // Set hidden specific GUI widgets in Simple mode to default spot values + radmask->setValue(defSpot.radmask); + chromask->setValue(defSpot.chromask); + Lmask_shape->setCurve(defSpot.Lmask_curve); + + // Enable all listeners + enableListener(); +} + +void LocallabMask::updateGUIToMode(const modeType new_type) +{ + switch (new_type) { + case Simple: + // Expert and Normal mode widgets are hidden in Simple mode + softradiusmask->hide(); + struFrame->hide(); + blurFrame->hide(); + toolmaskFrame->hide(); + + break; + + case Normal: + // Expert mode widgets are hidden in Normal mode + softradiusmask->hide(); + struFrame->hide(); + blurFrame->hide(); + lapmask->hide(); + gammask->hide(); + slopmask->hide(); + shadmask->hide(); + mask_HCurveEditorG->hide(); + mask2CurveEditorGwav->hide(); + csThresholdmask->hide(); + gradFramemask->hide(); + // Specific Simple mode widgets are shown in Normal mode + toolmaskFrame->show(); + + break; + + case Expert: + // Show widgets hidden in Normal and Simple mode + softradiusmask->hide(); + struFrame->hide(); + blurFrame->hide(); + toolmaskFrame->hide(); + lapmask->hide(); + gammask->hide(); + slopmask->hide(); + shadmask->hide(); + mask_HCurveEditorG->hide(); + mask2CurveEditorGwav->hide(); + csThresholdmask->hide(); + gradFramemask->hide(); + } +} + +void LocallabMask::updateMaskBackground(const double normChromar, const double normLumar, const double normHuer) +{ + idle_register.add( + [this, normHuer, normLumar, normChromar]() -> bool { + GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected + + // Update mask background + CCmask_shape->updateLocallabBackground(normChromar); + LLmask_shape->updateLocallabBackground(normLumar); + HHmask_shape->updateLocallabBackground(normHuer); + HHhmask_shape->updateLocallabBackground(normHuer); + Lmask_shape->updateLocallabBackground(normLumar); + + return false; + } + ); +} + +void LocallabMask::showmask_MethodChanged() +{ + // If mask preview is activated, deactivate all other tool mask preview + if (locToolListener) { + locToolListener->resetOtherMaskView(this); + } + + if (listener) { + listener->panelChanged(EvlocallabshowmaskMethod, ""); + } +} + +void LocallabMask::enamaskChanged() +{ + if (isLocActivated && exp->getEnabled()) { + if (listener) { + if (enamask->get_active()) { + listener->panelChanged(EvLocallabEnaMask, + M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } else { + listener->panelChanged(EvLocallabEnaMask, + M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + } +} + void LocallabMask::toolmaskChanged() { if (isLocActivated && exp->getEnabled()) { @@ -5286,3 +5663,34 @@ void LocallabMask::toolmaskChanged() } } } + +void LocallabMask::fftmaskChanged() +{ + // Update Common mask GUI according to fftmask button state + updateMaskGUI(); + + if (isLocActivated && exp->getEnabled()) { + if (listener) { + if (fftmask->get_active()) { + listener->panelChanged(EvLocallabfftmask, + M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } else { + listener->panelChanged(EvLocallabfftmask, + M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + } +} + +void LocallabMask::updateMaskGUI() +{ + const double temp = blurmask->getValue(); + + if (fftmask->get_active()) { + blurmask->setLimits(0.2, 1000., 0.5, 0.2); + } else { + blurmask->setLimits(0.2, 100., 0.5, 0.2); + } + + blurmask->setValue(temp); +} diff --git a/rtgui/options.cc b/rtgui/options.cc index 7beffdc8e..625ac9918 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -451,7 +451,7 @@ void Options::setDefaults() histogramHeight = 200; histogramDrawMode = 0; curvebboxpos = 1; - complexity = 1; + complexity = 2; inspectorWindow = false; zoomOnScroll = true; prevdemo = PD_Sidecar; @@ -619,6 +619,12 @@ void Options::setDefaults() rtSettings.itcwb_precis = 5;//3 or 5 or 9 // end locallab +//wavelet + rtSettings.edghi = 3.0;//1.1 and 5. + rtSettings.edglo = 0.5;//0.1 and 0.95 + rtSettings.limrad = 20.;//1 and 60 + + rtSettings.protectred = 60; rtSettings.protectredh = 0.3; rtSettings.CRI_color = 0; @@ -1713,6 +1719,22 @@ void Options::readFromFile(Glib::ustring fname) } + if (keyFile.has_group("Wavelet")) { + if (keyFile.has_key("Wavelet", "Edghi")) { + rtSettings.edghi = keyFile.get_double("Wavelet", "Edghi"); + } + + if (keyFile.has_key("Wavelet", "Edglo")) { + rtSettings.edglo = keyFile.get_double("Wavelet", "Edglo"); + } + + if (keyFile.has_key("Wavelet", "Limrad")) { + rtSettings.limrad = keyFile.get_double("Wavelet", "Limrad"); + } + + } + + if (keyFile.has_group("ICC Profile Creator")) { if (keyFile.has_key("ICC Profile Creator", "PimariesPreset")) { ICCPC_primariesPreset = keyFile.get_string("ICC Profile Creator", "PimariesPreset"); @@ -2313,6 +2335,11 @@ void Options::saveToFile(Glib::ustring fname) keyFile.set_integer("Color Management", "Previewselection", rtSettings.previewselection); keyFile.set_double("Color Management", "Cbdlsensi", rtSettings.cbdlsensi); + keyFile.set_double("Wavelet", "Edghi", rtSettings.edghi); + keyFile.set_double("Wavelet", "Edglo", rtSettings.edglo); + keyFile.set_double("Wavelet", "Limrad", rtSettings.limrad); + + keyFile.set_string("ICC Profile Creator", "PimariesPreset", ICCPC_primariesPreset); keyFile.set_double("ICC Profile Creator", "RedPrimaryX", ICCPC_redPrimaryX); keyFile.set_double("ICC Profile Creator", "RedPrimaryY", ICCPC_redPrimaryY); diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index db830c6c1..3cd93064e 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -60,6 +60,7 @@ void ParamsEdited::set(bool v) retinex.mapcurve = v; retinex.cdHcurve = v; retinex.lhcurve = v; + retinex.complexmethod = v; retinex.retinexMethod = v; retinex.mapMethod = v; retinex.viewMethod = v; @@ -531,6 +532,7 @@ void ParamsEdited::set(bool v) wavelet.CLmethod = v; wavelet.Backmethod = v; wavelet.Tilesmethod = v; + wavelet.complexmethod = v; wavelet.daubcoeffmethod = v; wavelet.CHmethod = v; wavelet.CHSLmethod = v; @@ -710,6 +712,7 @@ void ParamsEdited::initFrom(const std::vector& retinex.lhcurve = retinex.lhcurve && p.retinex.lhcurve == other.retinex.lhcurve; retinex.transmissionCurve = retinex.transmissionCurve && p.retinex.transmissionCurve == other.retinex.transmissionCurve; retinex.gaintransmissionCurve = retinex.gaintransmissionCurve && p.retinex.gaintransmissionCurve == other.retinex.gaintransmissionCurve; + retinex.complexmethod = retinex.complexmethod && p.retinex.complexmethod == other.retinex.complexmethod; retinex.retinexMethod = retinex.retinexMethod && p.retinex.retinexMethod == other.retinex.retinexMethod; retinex.mapMethod = retinex.mapMethod && p.retinex.mapMethod == other.retinex.mapMethod; retinex.viewMethod = retinex.viewMethod && p.retinex.viewMethod == other.retinex.viewMethod; @@ -1679,6 +1682,7 @@ void ParamsEdited::initFrom(const std::vector& wavelet.CLmethod = wavelet.CLmethod && p.wavelet.CLmethod == other.wavelet.CLmethod; wavelet.Backmethod = wavelet.Backmethod && p.wavelet.Backmethod == other.wavelet.Backmethod; wavelet.Tilesmethod = wavelet.Tilesmethod && p.wavelet.Tilesmethod == other.wavelet.Tilesmethod; + wavelet.complexmethod = wavelet.complexmethod && p.wavelet.complexmethod == other.wavelet.complexmethod; wavelet.daubcoeffmethod = wavelet.daubcoeffmethod && p.wavelet.daubcoeffmethod == other.wavelet.daubcoeffmethod; wavelet.CHmethod = wavelet.CHmethod && p.wavelet.CHmethod == other.wavelet.CHmethod; wavelet.CHSLmethod = wavelet.CHSLmethod && p.wavelet.CHSLmethod == other.wavelet.CHSLmethod; @@ -1915,6 +1919,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.retinex.gaintransmissionCurve = mods.retinex.gaintransmissionCurve; } + if (retinex.complexmethod) { + toEdit.retinex.complexmethod = mods.retinex.complexmethod; + } + if (retinex.retinexMethod) { toEdit.retinex.retinexMethod = mods.retinex.retinexMethod; } @@ -5574,6 +5582,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.wavelet.Tilesmethod = mods.wavelet.Tilesmethod; } + if (wavelet.complexmethod) { + toEdit.wavelet.complexmethod = mods.wavelet.complexmethod; + } + if (wavelet.daubcoeffmethod) { toEdit.wavelet.daubcoeffmethod = mods.wavelet.daubcoeffmethod; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 98a427796..f8230a577 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -73,6 +73,7 @@ struct RetinexParamsEdited { bool slope; bool neigh; bool offs; + bool complexmethod; bool retinexMethod; bool mapMethod; bool viewMethod; @@ -1039,6 +1040,7 @@ struct WaveletParamsEdited { bool CLmethod; bool Backmethod; bool Tilesmethod; + bool complexmethod; bool daubcoeffmethod; bool Dirmethod; bool sigma; diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 72ad32391..b18e9e66c 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -10,8 +10,8 @@ * * RawTherapee 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. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . @@ -946,7 +946,8 @@ Gtk::Widget* Preferences::getGeneralPanel() setExpandAlignProperties(complexitylocal, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); complexitylocal->append(M("PREFERENCES_COMPLEXITY_EXP")); complexitylocal->append(M("PREFERENCES_COMPLEXITY_NORM")); - complexitylocal->set_active(1); + complexitylocal->append(M("PREFERENCES_COMPLEXITY_SIMP")); + complexitylocal->set_active(2); workflowGrid->attach_next_to(*complexityL, *curveBBoxPosL, Gtk::POS_BOTTOM, 1, 1); workflowGrid->attach_next_to(*complexitylocal, *curveBBoxPosC, Gtk::POS_BOTTOM, 1, 1); diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index 2fdd8f319..feab8e6a5 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -9,6 +9,7 @@ #include "rtimage.h" #include "options.h" #include "../rtengine/color.h" +#include "eventmapper.h" using namespace rtengine; using namespace rtengine::procparams; @@ -25,13 +26,26 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") nextsigma = 0.; nextminT = 0.; nextmaxT = 0.; + auto m = ProcEventMapper::getInstance(); + EvReticomplex = m->newEvent(DEMOSAIC, "HISTORY_MSG_COMPLEXRETI"); + const RetinexParams default_params; // MAIN Expander ================================================================== + complexmethod = Gtk::manage (new MyComboBoxText ()); + complexmethod->append(M("TP_WAVELET_COMPNORMAL")); + complexmethod->append(M("TP_WAVELET_COMPEXPERT")); + complexmethodconn = complexmethod->signal_changed().connect(sigc::mem_fun(*this, &Retinex::complexmethodChanged)); + complexmethod->set_tooltip_text(M("TP_WAVELET_COMPLEX_TOOLTIP")); + Gtk::HBox* const complexHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Label* const complexLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_COMPLEXLAB") + ":")); + complexHBox->pack_start(*complexLabel, Gtk::PACK_SHRINK, 4); + complexHBox->pack_start(*complexmethod); + pack_start(*complexHBox); Gtk::Grid *retinexGrid = Gtk::manage ( new Gtk::Grid()); @@ -116,7 +130,8 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") // MAP (MASK) Frame --------------------------------------------------------------- - Gtk::Frame *maskFrame = Gtk::manage (new Gtk::Frame (M ("TP_RETINEX_LABEL_MASK")) ); + // Gtk::Frame *maskFrame = Gtk::manage (new Gtk::Frame (M ("TP_RETINEX_LABEL_MASK")) ); + maskFrame = Gtk::manage (new Gtk::Frame (M ("TP_RETINEX_LABEL_MASK")) ); setExpandAlignProperties (maskFrame, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); Gtk::Grid *maskGrid = Gtk::manage ( new Gtk::Grid()); @@ -384,7 +399,6 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") Gtk::Grid *tranGrid = Gtk::manage (new Gtk::Grid()); setExpandAlignProperties (tranGrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - const RetinexParams default_params; // Transmission map curve transmissionCurveEditorG = new CurveEditorGroup (options.lastRetinexDir, M ("TP_RETINEX_TRANSMISSION")); @@ -628,12 +642,14 @@ void Retinex::neutral_pressed () limd->resetValue (false); highl->resetValue (false); gam->resetValue (false); + skal->resetValue (false); slope->resetValue (false); highlights->resetValue (false); h_tonalwidth->resetValue (false); shadows->resetValue (false); s_tonalwidth->resetValue (false); radius->resetValue (false); + medianmap->set_active (false); mapMethod->set_active (0); viewMethod->set_active (0); retinexMethod->set_active (2); @@ -742,7 +758,53 @@ void Retinex::updateTrans () } } +void Retinex::convertParamToNormal() +{ + const RetinexParams def_params; + disableListener(); + iter->setValue(def_params.iter); + viewMethod->set_active(0); + mapMethod->set_active(0); + cdshape->reset(); + cdshapeH->reset(); + lhshape->reset(); + transmissionShape->reset(); + medianmap->set_active(def_params.medianmap); + enableListener(); +} +void Retinex::updateGUIToMode(int mode) +{ + + if(mode ==0) { + iterFrame->hide(); + maskFrame->hide(); + equalFrame->hide(); + viewMethod->hide(); + mapMethod->hide(); + transmissionCurveEditorG->hide(); + medianmap->hide(); + } else { + iterFrame->show(); + maskFrame->show(); + equalFrame->show(); + viewMethod->show(); + transmissionCurveEditorG->show(); + medianmap->show(); + mapMethod->show(); + if (iter->getIntValue() > 1) { + grad->set_sensitive (true); + scal->set_sensitive (true); + grads->set_sensitive (true); + } else { + grad->set_sensitive (false); + scal->set_sensitive (false); + grads->set_sensitive (false); + } + + } + +} void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited) { @@ -752,6 +814,7 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited) gammaretinexConn.block (true); mapMethodConn.block (true); viewMethodConn.block (true); + complexmethodconn.block (true); if (pedited) { @@ -775,6 +838,9 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited) shadows->setEditedState (pedited->retinex.shadows ? Edited : UnEdited); s_tonalwidth->setEditedState (pedited->retinex.stonalwidth ? Edited : UnEdited); + if (!pedited->retinex.complexmethod) { + complexmethod->set_active_text (M ("GENERAL_UNCHANGED")); + } if (!pedited->retinex.retinexMethod) { retinexMethod->set_active_text (M ("GENERAL_UNCHANGED")); @@ -844,6 +910,13 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited) medianmapConn.block (false); lastmedianmap = pp->retinex.medianmap; + if (pp->retinex.complexmethod == "normal") { + complexmethod->set_active(0); + } else if (pp->retinex.complexmethod == "expert") { + complexmethod->set_active(1); + } + + if (pp->retinex.retinexMethod == "low") { retinexMethod->set_active (0); } else if (pp->retinex.retinexMethod == "uni") { @@ -906,6 +979,7 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited) mapMethodChanged (); viewMethodChanged (); + medianmapConn.block (true); medianmapChanged (); medianmapConn.block (false); @@ -914,7 +988,7 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited) cdshapeH->setCurve (pp->retinex.cdHcurve); lhshape->setCurve (pp->retinex.lhcurve); mapshape->setCurve (pp->retinex.mapcurve); - + retinexMethodConn.block (false); retinexColorSpaceConn.block (false); gammaretinexConn.block (false); @@ -923,8 +997,18 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited) transmissionShape->setCurve (pp->retinex.transmissionCurve); gaintransmissionShape->setCurve (pp->retinex.gaintransmissionCurve); + complexmethodconn.block (false); enableListener (); + + if (complexmethod->get_active_row_number() == 0) { + updateGUIToMode(0); + // convertParamToNormal(); + + } else { + updateGUIToMode(1); + } + } @@ -961,6 +1045,7 @@ void Retinex::write (ProcParams* pp, ParamsEdited* pedited) pp->retinex.stonalwidth = (int)s_tonalwidth->getValue (); if (pedited) { + pedited->retinex.complexmethod = complexmethod->get_active_text() != M ("GENERAL_UNCHANGED"); pedited->retinex.retinexMethod = retinexMethod->get_active_text() != M ("GENERAL_UNCHANGED"); pedited->retinex.retinexcolorspace = retinexcolorspace->get_active_text() != M ("GENERAL_UNCHANGED"); pedited->retinex.gammaretinex = gammaretinex->get_active_text() != M ("GENERAL_UNCHANGED"); @@ -998,6 +1083,12 @@ void Retinex::write (ProcParams* pp, ParamsEdited* pedited) } + if (complexmethod->get_active_row_number() == 0) { + pp->retinex.complexmethod = "normal"; + } else if (complexmethod->get_active_row_number() == 1) { + pp->retinex.complexmethod = "expert"; + } + if (retinexMethod->get_active_row_number() == 0) { pp->retinex.retinexMethod = "low"; } else if (retinexMethod->get_active_row_number() == 1) { @@ -1056,6 +1147,27 @@ void Retinex::write (ProcParams* pp, ParamsEdited* pedited) } +void Retinex::complexmethodChanged() +{ + + if (!batchMode) { + if (complexmethod->get_active_row_number() == 0) { + updateGUIToMode(0); + convertParamToNormal(); + + } else { + updateGUIToMode(1); + } + } + + if (listener) { + listener->panelChanged(EvReticomplex, complexmethod->get_active_text()); + } + +} + + + void Retinex::retinexMethodChanged() { @@ -1138,8 +1250,11 @@ void Retinex::viewMethodChanged() limd->show(); transmissionCurveEditorG->show(); medianmap->show(); - - iterFrame->show(); + if (complexmethod->get_active_row_number() == 0) { + iterFrame->hide(); + } else { + iterFrame->show(); + } /* iter->show(); scal->show(); @@ -1522,6 +1637,7 @@ void Retinex::setBatchMode (bool batchMode) h_tonalwidth->showEditedCB (); shadows->showEditedCB (); s_tonalwidth->showEditedCB (); + // complexmethod->append(M("GENERAL_UNCHANGED")); skal->showEditedCB (); curveEditorGD->setBatchMode (batchMode); diff --git a/rtgui/retinex.h b/rtgui/retinex.h index dea65daab..bf480c9cc 100644 --- a/rtgui/retinex.h +++ b/rtgui/retinex.h @@ -28,6 +28,7 @@ class Retinex final : { private: IdleRegister idle_register; + rtengine::ProcEvent EvReticomplex; protected: CurveEditorGroup* curveEditorGD; @@ -72,6 +73,9 @@ protected: MyComboBoxText* mapMethod; MyComboBoxText* viewMethod; Gtk::CheckButton* medianmap; + MyComboBoxText* complexmethod; + sigc::connection complexmethodconn; + double nextmin; double nextmax; double nextminiT; @@ -87,6 +91,7 @@ protected: Gtk::Frame *gainFrame; Gtk::Frame *tranFrame; Gtk::Frame *iterFrame; + Gtk::Frame *maskFrame; Gtk::Frame *equalFrame; DiagonalCurveEditor* cdshape; @@ -148,4 +153,7 @@ public: private: void foldAllButMe(GdkEventButton* event, MyExpander *expander); + void convertParamToNormal(); + void updateGUIToMode(int mode); + void complexmethodChanged(); }; diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index ac8c6100b..19d458dad 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -158,6 +158,7 @@ Wavelet::Wavelet() : HSmethod(Gtk::manage(new MyComboBoxText())), CLmethod(Gtk::manage(new MyComboBoxText())), Backmethod(Gtk::manage(new MyComboBoxText())), + complexmethod(Gtk::manage(new MyComboBoxText())), Tilesmethod(Gtk::manage(new MyComboBoxText())), daubcoeffmethod(Gtk::manage(new MyComboBoxText())), Dirmethod(Gtk::manage(new MyComboBoxText())), @@ -190,7 +191,10 @@ Wavelet::Wavelet() : expclari(Gtk::manage(new MyExpander(true, M("TP_WAVELET_CLARI")))), expbl(Gtk::manage(new MyExpander(true, M("TP_WAVELET_BL")))), neutrHBox(Gtk::manage(new Gtk::HBox())), - usharpHBox(Gtk::manage(new Gtk::HBox())) + usharpHBox(Gtk::manage(new Gtk::HBox())), + ctboxch(Gtk::manage(new Gtk::HBox())), + ctboxBA(Gtk::manage(new Gtk::VBox())) + { CurveListener::setMulti(true); auto m = ProcEventMapper::getInstance(); @@ -227,6 +231,7 @@ Wavelet::Wavelet() : EvWavrangeab = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_RANGEAB"); EvWavprotab = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_PROTAB"); EvWavlevelshc = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_LEVELSHC"); + EvWavcomplexmet = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_COMPLEX"); labgrid = Gtk::manage(new LabGrid(EvWavLabGridValue, M("TP_WAVELET_LABGRID_VALUES"))); @@ -269,6 +274,16 @@ Wavelet::Wavelet() : thres->set_tooltip_text(M("TP_WAVELET_LEVELS_TOOLTIP")); thres->setAdjusterListener(this); + complexmethod->append(M("TP_WAVELET_COMPNORMAL")); + complexmethod->append(M("TP_WAVELET_COMPEXPERT")); + complexmethodconn = complexmethod->signal_changed().connect(sigc::mem_fun(*this, &Wavelet::complexmethodChanged)); + complexmethod->set_tooltip_text(M("TP_WAVELET_COMPLEX_TOOLTIP")); + Gtk::HBox* const complexHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Label* const complexLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_COMPLEXLAB") + ":")); + complexHBox->pack_start(*complexLabel, Gtk::PACK_SHRINK, 4); + complexHBox->pack_start(*complexmethod); + + Tilesmethod->append(M("TP_WAVELET_TILESFULL")); Tilesmethod->append(M("TP_WAVELET_TILESBIG")); // Tilesmethod->append(M("TP_WAVELET_TILESLIT")); @@ -335,6 +350,7 @@ Wavelet::Wavelet() : levdirSubHBox->pack_start(*Lmethod); levdirSubHBox->pack_start(*Dirmethod, Gtk::PACK_EXPAND_WIDGET, 2); // same, but 2 not 4? + settingsBox->pack_start(*complexHBox); settingsBox->pack_start(*strength); settingsBox->pack_start(*thres); settingsBox->pack_start(*tilesizeHBox); @@ -452,7 +468,7 @@ Wavelet::Wavelet() : ToolParamBlock* const chBox = Gtk::manage(new ToolParamBlock()); Gtk::Label* const labmch = Gtk::manage(new Gtk::Label(M("TP_WAVELET_CHTYPE") + ":")); - Gtk::HBox* const ctboxch = Gtk::manage(new Gtk::HBox()); +// Gtk::HBox* const ctboxch = Gtk::manage(new Gtk::HBox()); ctboxch->pack_start(*labmch, Gtk::PACK_SHRINK, 1); CHmethod->append(M("TP_WAVELET_CH1")); @@ -674,7 +690,7 @@ Wavelet::Wavelet() : EDmethod->append(M("TP_WAVELET_EDCU")); EDmethodconn = EDmethod->signal_changed().connect(sigc::mem_fun(*this, &Wavelet::EDmethodChanged)); ctboxED->pack_start(*EDmethod); - edgBox->pack_start(*ctboxED); + // edgBox->pack_start(*ctboxED); edgcont->setAdjusterListener(this); edgcont->setBgGradient(milestones2); @@ -838,7 +854,7 @@ Wavelet::Wavelet() : thrH->setAdjusterListener(this); radius->setAdjusterListener(this); - radius->hide(); +// radius->hide(); shFrame->set_label_align(0.025, 0.5); ToolParamBlock* const shBox = Gtk::manage(new ToolParamBlock()); @@ -1007,7 +1023,7 @@ Wavelet::Wavelet() : resBox->pack_start(*neutrHBox); // Final Touchup - Gtk::VBox* const ctboxBA = Gtk::manage(new Gtk::VBox()); + // Gtk::VBox* const ctboxBA = Gtk::manage(new Gtk::VBox()); ctboxBA->set_spacing(2); @@ -1236,6 +1252,7 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited) CLmethodconn.block(true); Backmethodconn.block(true); Tilesmethodconn.block(true); + complexmethodconn.block(true); daubcoeffmethodconn.block(true); Dirmethodconn.block(true); CHmethodconn.block(true); @@ -1357,6 +1374,12 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited) } else if (pp->wavelet.CLmethod == "all") { CLmethod->set_active(3); } + if (pp->wavelet.complexmethod == "normal") { + complexmethod->set_active(0); + } else if (pp->wavelet.complexmethod == "expert") { + complexmethod->set_active(1); + } + //Tilesmethod->set_active (2); if (pp->wavelet.Tilesmethod == "full") { @@ -1558,6 +1581,11 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited) Backmethod->set_active_text(M("GENERAL_UNCHANGED")); } + if (!pedited->wavelet.complexmethod) { + complexmethod->set_active_text(M("GENERAL_UNCHANGED")); + } + + if (!pedited->wavelet.Tilesmethod) { Tilesmethod->set_active_text(M("GENERAL_UNCHANGED")); } @@ -1774,6 +1802,15 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited) } else { sup->hide(); } + + if (complexmethod->get_active_row_number() == 0) { + updateGUIToMode(0); + convertParamToNormal(); + + } else { + updateGUIToMode(1); + } + } /***************************************************************************************************** @@ -1786,6 +1823,7 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited) CLmethodconn.block(false); Backmethodconn.block(false); Tilesmethodconn.block(false); + complexmethodconn.block(false); daubcoeffmethodconn.block(false); CHmethodconn.block(false); CHSLmethodconn.block(false); @@ -1965,6 +2003,7 @@ void Wavelet::write(ProcParams* pp, ParamsEdited* pedited) pedited->wavelet.CLmethod = CLmethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->wavelet.Backmethod = Backmethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->wavelet.Tilesmethod = Tilesmethod->get_active_text() != M("GENERAL_UNCHANGED"); + pedited->wavelet.complexmethod = complexmethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->wavelet.daubcoeffmethod = daubcoeffmethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->wavelet.CHmethod = CHmethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->wavelet.CHSLmethod = CHSLmethod->get_active_text() != M("GENERAL_UNCHANGED"); @@ -2168,6 +2207,12 @@ void Wavelet::write(ProcParams* pp, ParamsEdited* pedited) // pp->wavelet.Tilesmethod = "lit"; } + if (complexmethod->get_active_row_number() == 0) { + pp->wavelet.complexmethod = "normal"; + } else if (complexmethod->get_active_row_number() == 1) { + pp->wavelet.complexmethod = "expert"; + } + if (daubcoeffmethod->get_active_row_number() == 0) { pp->wavelet.daubcoeffmethod = "2_"; } else if (daubcoeffmethod->get_active_row_number() == 1) { @@ -2835,6 +2880,110 @@ void Wavelet::ushamethodChanged() } + +void Wavelet::convertParamToNormal() +{ + const WaveletParams def_params; + disableListener(); + //contrast + offset->setValue(def_params.offset); + sigma->setValue(def_params.sigma); + lowthr->setValue(def_params.lowthr); + //chroma + expchroma->setEnabled(def_params.expchroma); + sigmacol->setValue(def_params.sigmacol); + CHmethod->set_active(2); + //denoise + chromfi->setValue(def_params.chromfi); + chromco->setValue(def_params.chromco); + //toning + exptoning->setEnabled(def_params.exptoning); + //gamut + median->set_active(def_params.median); + avoid->set_active(def_params.avoid); + hueskin->setValue(def_params.hueskin); + skinprotect->setValue(def_params.skinprotect); + //blur + expbl->setEnabled(def_params.expbl); + //edge sharpness + lipst->set_active(def_params.lipst); + lipstUpdateUI(); + edgesensi->setValue(def_params.edgesensi); + edgeampli->setValue(def_params.edgeampli); + NPmethod->set_active(0); + //resid + // oldsh->set_active(true); + radius->setValue(def_params.radius); + resblur->setValue(def_params.resblur); + resblurc->setValue(def_params.resblurc); + cbenab->set_active(false); + + //final touchup + BAmethod->set_active(0); + sigmafin->setValue(def_params.sigmafin); + enableListener(); + + // Update GUI based on converted widget parameters: +} + +void Wavelet::updateGUIToMode(int mode) +{ + if(mode ==0) { + offset->hide(); + sigma->hide(); + lowthr->hide(); + ctboxch->hide(); + sigmacol->hide(); + expgamut->hide(); + exptoning->hide(); + chroFrame->hide(); + expbl->hide(); + lipst->hide(); + dirFrame->hide(); + oldsh->hide(); + radius->hide(); + blurFrame->hide(); + cbenab->hide(); + sigmafin->hide(); + } else { + offset->show(); + sigma->show(); + lowthr->show(); + ctboxch->show(); + sigmacol->show(); + expgamut->show(); + exptoning->show(); + chroFrame->show(); + expbl->show(); + lipst->show(); + dirFrame->show(); + oldsh->hide(); + radius->show(); + blurFrame->show(); + cbenab->show(); + sigmafin->show(); + } + +} + + +void Wavelet::complexmethodChanged() +{ + if (complexmethod->get_active_row_number() == 0) { + updateGUIToMode(0); + convertParamToNormal(); + + } else { + updateGUIToMode(1); + } + + if (listener && (multiImage || getEnabled())) { + listener->panelChanged(EvWavcomplexmet, complexmethod->get_active_text()); + } +} + + + void Wavelet::TilesmethodChanged() { //TilesmethodUpdateUI(); @@ -2916,6 +3065,7 @@ void Wavelet::setBatchMode(bool batchMode) CLmethod->append(M("GENERAL_UNCHANGED")); Backmethod->append(M("GENERAL_UNCHANGED")); Tilesmethod->append(M("GENERAL_UNCHANGED")); + complexmethod->append(M("GENERAL_UNCHANGED")); daubcoeffmethod->append(M("GENERAL_UNCHANGED")); CHmethod->append(M("GENERAL_UNCHANGED")); Medgreinf->append(M("GENERAL_UNCHANGED")); diff --git a/rtgui/wavelet.h b/rtgui/wavelet.h index 6daabcd67..a497d2c4f 100644 --- a/rtgui/wavelet.h +++ b/rtgui/wavelet.h @@ -47,7 +47,6 @@ class Wavelet final : public: Wavelet(); ~Wavelet() override; - bool wavComputed_(); void adjusterChanged(Adjuster* a, double newval) override; void autoOpenCurve() override; @@ -102,6 +101,7 @@ private: rtengine::ProcEvent EvWavrangeab; rtengine::ProcEvent EvWavprotab; rtengine::ProcEvent EvWavlevelshc; + rtengine::ProcEvent EvWavcomplexmet; LabGrid *labgrid; @@ -121,6 +121,7 @@ private: void LmethodChanged(); void MedgreinfChanged(); void TMmethodChanged(); + void complexmethodChanged(); void TilesmethodChanged(); void avoidToggled(); void showmaskToggled (); @@ -143,7 +144,8 @@ private: void ushamethodChanged(); void updateGUI(); void updateGUImaxlev(); - + void convertParamToNormal(); + void updateGUIToMode(int mode); void HSmethodUpdateUI(); void CHmethodUpdateUI(); // void CHSLmethodChangedUI(); @@ -297,6 +299,8 @@ private: sigc::connection CLmethodconn; MyComboBoxText* const Backmethod; sigc::connection Backmethodconn; + MyComboBoxText* const complexmethod; + sigc::connection complexmethodconn; MyComboBoxText* const Tilesmethod; sigc::connection Tilesmethodconn; MyComboBoxText* const daubcoeffmethod; @@ -338,6 +342,8 @@ private: Gtk::HBox* const neutrHBox; Gtk::HBox* const usharpHBox; + Gtk::HBox* const ctboxch; + Gtk::VBox* const ctboxBA;// = Gtk::manage(new Gtk::VBox()); sigc::connection enableChromaConn, enableContrastConn, enableEdgeConn, enabletmConn, enableFinalConn, enableclariConn; sigc::connection enableNoiseConn, enableResidConn, enableToningConn;