Merge branch 'dev' into metadata-exiv2

This commit is contained in:
Lawrence Lee 2023-08-06 10:25:49 -07:00
commit c5a0067eee
No known key found for this signature in database
GPG Key ID: 048FF2B76A63895F
95 changed files with 8220 additions and 2998 deletions

View File

@ -99,6 +99,10 @@ jobs:
run: |
echo "Listing shared library dependencies."
ldd "./build/${{matrix.build_type}}/rawtherapee.exe"
echo "Finding DLLs to include."
DLLS=($(ldd "./build/${{matrix.build_type}}/rawtherapee.exe" | grep '/mingw64/bin/' | awk '{print($1)'}))
echo "Required DLLs are: ${DLLS[*]}"
echo "Getting workspace path."
export BUILD_DIR="$(pwd)/build/${{matrix.build_type}}"
echo "Build directory is '$BUILD_DIR'."
@ -111,77 +115,7 @@ jobs:
"gdbus.exe" \
"gspawn-win64-helper.exe" \
"gspawn-win64-helper-console.exe" \
"libatk-1.0-0.dll" \
"libatkmm-1.6-1.dll" \
"libbrotlicommon.dll" \
"libbrotlidec.dll" \
"libbz2-1.dll" \
"libcairo-2.dll" \
"libcairo-gobject-2.dll" \
"libcairomm-1.0-1.dll" \
"libcrypto-3-x64.dll" \
"libcurl-4.dll" \
"libdatrie-1.dll" \
"libdeflate.dll" \
"libepoxy-0.dll" \
"libexiv2.dll" \
"libexpat-1.dll" \
libffi-*.dll \
"libfftw3f-3.dll" \
"libfftw3f_omp-3.dll" \
"libfontconfig-1.dll" \
"libfreetype-6.dll" \
"libfribidi-0.dll" \
"libgcc_s_seh-1.dll" \
"libgdk_pixbuf-2.0-0.dll" \
"libgdk-3-0.dll" \
"libgdkmm-3.0-1.dll" \
"libgio-2.0-0.dll" \
"libgiomm-2.4-1.dll" \
"libglib-2.0-0.dll" \
"libglibmm-2.4-1.dll" \
"libgmodule-2.0-0.dll" \
"libgobject-2.0-0.dll" \
"libgomp-1.dll" \
"libgraphite2.dll" \
"libgtk-3-0.dll" \
"libgtkmm-3.0-1.dll" \
"libharfbuzz-0.dll" \
"libiconv-2.dll" \
"libidn2-0.dll" \
"libintl-8.dll" \
"libjbig-0.dll" \
"libjpeg-8.dll" \
"liblcms2-2.dll" \
"liblensfun.dll" \
"libLerc.dll" \
"liblzma-5.dll" \
"libnghttp2-14.dll" \
"libpango-1.0-0.dll" \
"libpangocairo-1.0-0.dll" \
"libpangoft2-1.0-0.dll" \
"libpangomm-1.4-1.dll" \
"libpangowin32-1.0-0.dll" \
"libpcre2-8-0.dll" \
"libpixman-1-0.dll" \
"libpng16-16.dll" \
"libpsl-5.dll" \
"librsvg-2-2.dll" \
"libsharpyuv-0.dll" \
"libsigc-2.0-0.dll" \
"libssh2-1.dll" \
"libssl-3-x64.dll" \
"libstdc++-6.dll" \
"libsystre-0.dll" \
"libthai-0.dll" \
"libtiff-6.dll" \
"libtre-5.dll" \
"libunistring-5.dll" \
"libwebp-7.dll" \
"libwinpthread-1.dll" \
"libxml2-2.dll" \
"libzstd.dll" \
"zlib1.dll" \
${DLLS[*]} \
"$BUILD_DIR"
cd -

3
.gitignore vendored
View File

@ -6,6 +6,8 @@
.settings
.directory
.vscode
.DS_Store
.idea
CMakeCache.txt
CMakeFiles
@ -42,4 +44,3 @@ clean
*.tar
*.xz
*.zip

View File

@ -2732,8 +2732,8 @@ TP_RGBCURVES_BLUE;B
TP_RGBCURVES_CHANNEL;Canal
TP_RGBCURVES_GREEN;V
TP_RGBCURVES_LABEL;Courbes RVB
TP_RGBCURVES_LUMAMODE;Mode Lominosité
TP_RGBCURVES_LUMAMODE_TOOLTIP;<b>Mode Lominosité</b> permet de faire varier la contribution des canaux R, V et B à la luminosité de l'image, sans altérer les couleurs de l'image.
TP_RGBCURVES_LUMAMODE;Mode Luminosité
TP_RGBCURVES_LUMAMODE_TOOLTIP;<b>Mode Luminosité</b> permet de faire varier la contribution des canaux R, V et B à la luminosité de l'image, sans altérer les couleurs de l'image.
TP_RGBCURVES_RED;R
TP_ROTATE_DEGREE;Degré
TP_ROTATE_LABEL;Rotation

View File

@ -1447,6 +1447,7 @@ HISTORY_MSG_LOCALCONTRAST_ENABLED;Local Contrast
HISTORY_MSG_LOCALCONTRAST_LIGHTNESS;Local Contrast - Lightness
HISTORY_MSG_LOCALCONTRAST_RADIUS;Local Contrast - Radius
HISTORY_MSG_LOCAL_GAMUTMUNSEL;Local - Gamut-Munsell
HISTORY_MSG_LOCALLAB_TE_PIVOT;Local - Equalizer pivot
HISTORY_MSG_METADATA_MODE;Metadata copy mode
HISTORY_MSG_MICROCONTRAST_CONTRAST;Microcontrast - Contrast threshold
HISTORY_MSG_PDSHARPEN_AUTO_CONTRAST;CS - Auto threshold
@ -1492,6 +1493,11 @@ HISTORY_MSG_SPOT_ENTRY;Spot removal - Point modif.
HISTORY_MSG_TEMPOUT;CAM02 automatic temperature
HISTORY_MSG_THRESWAV;Balance threshold
HISTORY_MSG_TM_FATTAL_ANCHOR;DRC - Anchor
HISTORY_MSG_TONE_EQUALIZER_BANDS;Tone equalizer - Bands
HISTORY_MSG_TONE_EQUALIZER_ENABLED;Tone equalizer
HISTORY_MSG_TONE_EQUALIZER_PIVOT;Tone equalizer - Pivot
HISTORY_MSG_TONE_EQUALIZER_REGULARIZATION;Tone equalizer - Regularization
HISTORY_MSG_TONE_EQUALIZER_SHOW_COLOR_MAP;Tone equalizer - Tonal map
HISTORY_MSG_TRANS_METHOD;Geometry - Method
HISTORY_MSG_WAVBALCHROM;Equalizer chrominance
HISTORY_MSG_WAVBALLUM;Equalizer luminance
@ -1532,6 +1538,22 @@ HISTORY_MSG_WAVTHRDEN;Threshold local contrast
HISTORY_MSG_WAVTHREND;Threshold local contrast
HISTORY_MSG_WAVUSHAMET;Clarity method
HISTORY_MSG_WBALANCE_OBSERVER10;Observer 10°
HISTORY_MSG_WBITC_OBS;Remove algo 2 passes
HISTORY_MSG_WBITC_CUSTOM;Itcwb Custom
HISTORY_MSG_WBITC_SAMPLING;Low sampling
HISTORY_MSG_WBITC_THRES;Itcwb Theshold
HISTORY_MSG_WBITC_NOPURPLE;Itcwb Nopurple
HISTORY_MSG_WBITC_PRIM;Primaries
HISTORY_MSG_WBITC_SORTED;Itcwb ponderated
HISTORY_MSG_WBITC_FORCE;Itcwb Force
HISTORY_MSG_WBITC_SIZE;Itcwb Size
HISTORY_MSG_WBITC_PRECIS;Itcwb Precision
HISTORY_MSG_WBITC_DELTA;Itcwb Delta green
HISTORY_MSG_WBITC_FGREEN;Itcwb Green - student
HISTORY_MSG_WBITC_RGREEN;Itcwb Green range
HISTORY_MSG_WBITC_MINSIZE;Patch min size
HISTORY_MSG_WBITC_PONDER;Itcwb ponderated
HISTORY_MSG_WBITC_GREEN;Grren refinement
HISTORY_NEWSNAPSHOT;Add
HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: <b>Alt-s</b>
HISTORY_SNAPSHOT;Snapshot
@ -1799,6 +1821,7 @@ PARTIALPASTE_SHARPENMICRO;Microcontrast
PARTIALPASTE_SOFTLIGHT;Soft light
PARTIALPASTE_SPOT;Spot removal
PARTIALPASTE_TM_FATTAL;Dynamic range compression
PARTIALPASTE_TONE_EQUALIZER;Tone equalizer
PARTIALPASTE_VIBRANCE;Vibrance
PARTIALPASTE_VIGNETTING;Vignetting correction
PARTIALPASTE_WHITEBALANCE;White balance
@ -1837,6 +1860,17 @@ PREFERENCES_CHUNKSIZE_RGB;RGB processing
PREFERENCES_CIE;Ciecam
PREFERENCES_CIEARTIF;Avoid artifacts
PREFERENCES_WBA;White Balance
PREFERENCES_WBACORR;White Balance - Automatic temperature correlation
PREFERENCES_WBACORR_TOOLTIP;These settings allow, depending on the images (type of raw file, colorimetry, etc.), an adaptation of the " Temperature correlation " algorithm in order to obtain the best overall results. There is no absolute rule, linking these parameters to the results obtained.\n\nThe settings are of 3 types: \n* those accessible to the user from the GUI.\n* those accessible only in reading from each pp3 file : Itcwb_minsize=20, Itcwb_delta=4 Itcwb_rgreen=1 Itcwb_nopurple=false (See Rawpedia)\n* those accessible to the user in 'options' (see Rawpedia)\n You can use "Awb temperature bias" and "Green refinement" to adjust the results. Each movement of these commands brings a new calculation of temperature, tint and correlation.\n\nPlease note that the 3 indicators 'Correlation factor', 'Patch chroma' and ΔE are given for information only. It is not because one of these indicators is better that the result will necessarily be better.
PREFERENCES_WBAENA;Show White Balance auto Temperature correlation Settings
PREFERENCES_WBAENACUSTOM;Use Custom temperature & tint
PREFERENCES_WBAPATCH;Number maximum of colors used in picture
PREFERENCES_WBAFORC;Forces Extra algoritm
PREFERENCES_WBAGREENDELTA;Delta temperature in green iterate loop (if Force Extra enabled)
PREFERENCES_WBANOPURP;No purple color used
PREFERENCES_WBAPRECIS;Precision algorithm - scale used
PREFERENCES_WBASIZEREF;Size of reference color compare to size of histogram color
PREFERENCES_WBASORT;Sort in chroma order instead of histogram
PREFERENCES_CLIPPINGIND;Clipping Indication
PREFERENCES_CLUTSCACHE;HaldCLUT Cache
PREFERENCES_CLUTSCACHE_LABEL;Maximum number of cached CLUTs
@ -2620,6 +2654,7 @@ TP_ICM_WORKING_PRIM_BRU;BruceRGB
TP_ICM_WORKING_PRIM_BST;BestRGB
TP_ICM_WORKING_PRIM_CUS;Custom (sliders)
TP_ICM_WORKING_PRIM_CUSGR;Custom (CIE xy Diagram)
TP_ICM_WORKING_PRIM_JDCMAX;JDC Max
TP_ICM_WORKING_PRIM_NONE;Default
TP_ICM_WORKING_PRIM_PROP;ProPhoto
TP_ICM_WORKING_PRIM_REC;Rec2020
@ -2850,13 +2885,15 @@ TP_LOCALLAB_DENOIMASK;Denoise chroma mask
TP_LOCALLAB_DENOIMASK_TOOLTIP;For all tools, allows you to control the chromatic noise level of the mask.\nUseful for better control of chrominance and to avoid artifacts when using the LC(h) curve.
TP_LOCALLAB_DENOIQUA_TOOLTIP;Conservative mode preserves low frequency detail. Aggressive mode removes low frequency detail.\nConservative and Aggressive modes use wavelets and DCT and can be used in conjunction with 'Non-local Means Luminance'.
TP_LOCALLAB_DENOITHR_TOOLTIP;Adjusts edge detection to help reduce noise in uniform, low-contrast areas.
TP_LOCALLAB_DENOIWAVCH;Wavelets: Chrominance
TP_LOCALLAB_DENOIWAVLUM;Wavelets: Luminance
TP_LOCALLAB_DENOI_EXP;Denoise
TP_LOCALLAB_DENOI_TOOLTIP;This module can be used for noise reduction either on its own (at the end of the processing pipeline) or in addition to the Noise Reduction module in the Detail tab (which works at the beginning of the pipeline).\n Scope allows you to differentiate the action based on color (ΔE).\nMinimum RT-spot size: 128x128.
TP_LOCALLAB_DEPTH;Depth
TP_LOCALLAB_DETAIL;Local contrast
TP_LOCALLAB_DETAILFRA;Edge detection - DCT
TP_LOCALLAB_DETAILSH;Details
TP_LOCALLAB_DETAILTHR;Luma-chro detail threshold
TP_LOCALLAB_DETAILTHR;Lum/chrom detail threshold
TP_LOCALLAB_DIVGR;Gamma
TP_LOCALLAB_DUPLSPOTNAME;Copy
TP_LOCALLAB_EDGFRA;Edge sharpness
@ -3121,7 +3158,7 @@ TP_LOCALLAB_MASKLCTHRLOW;Dark area luminance threshold
TP_LOCALLAB_MASKLCTHRLOW2;Dark area luma threshold
TP_LOCALLAB_MASKLCTHRMID;Gray area luma denoise
TP_LOCALLAB_MASKLCTHRMIDCH;Gray area chroma denoise
TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n 'Dark area luminance threshold'. If 'Reinforce denoise in dark and light areas' > 1 the denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by mask).\n 'Light area luminance threshold'. The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by mask).\n In the area between the two thresholds, the denoise settings are not affected by the mask.
TP_LOCALLAB_MASKLC_TOOLTIP;Used by wavelet luminance.\nThis allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n 'Dark area luminance threshold'. If 'Reinforce denoise in dark and light areas' > 1 the denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (determined by mask).\n 'Light area luminance threshold'. The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by mask).\n In the area between the two thresholds, the denoise settings are not affected by the mask.
TP_LOCALLAB_MASKLNOISELOW;Reinforce dark/light areas
TP_LOCALLAB_MASKLOWTHRESCB_TOOLTIP;Dark-tone limit below which the CBDL parameters (Luminance only) will be restored progressively to their original values prior to being modified by the CBDL settings.\n You can use certain tools in 'Mask and modifications' to change the gray levels: 'Smooth radius', Gamma and Slope, 'Contrast curve'.\n Use a 'lockable color picker' on the mask to see which areas will be affected. Make sure you set 'Background color mask' = 0 in Settings.
TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which the parameters will be restored progressively to their original values prior to being modified by the Color and Light settings.\n You can use certain tools in 'Mask and modifications' to change the gray levels: 'Structure mask', 'blur mask', 'Smooth radius', Gamma and Slope, 'Contrast curve', 'Local contrast' (wavelets).\n Use a 'lockable color picker' on the mask to see which areas will be affected. Make sure you set 'Background color mask' = 0 in Settings.
@ -3180,6 +3217,12 @@ TP_LOCALLAB_MERTHR;Difference
TP_LOCALLAB_MERTWE;Exclusion
TP_LOCALLAB_MERTWO;Subtract
TP_LOCALLAB_METHOD_TOOLTIP;'Enhanced + chroma denoise' significantly increases processing times.\nBut reduce artifacts.
TP_LOCALLAB_LCLABELS;Residual noise levels
TP_LOCALLAB_LCLABELS_TOOLTIP;Displays the mean and high-end noise values for the area shown in the Preview Panel (at 100% zoom). The noise values are grouped by wavelet levels 0,1,2,3 and 4,5,6.\nThe displayed values are indicative only and are designed to assist with denoise adjustments. They should not be interpreted as absolute noise levels.\n\n 300: Very noisy\n 100-300: Noisy\n 50-100: Moderatly noisy\n < 50: Low noise\n\nThey allow you to see:\n*The impact of Noise Reduction in the main-menu Detail tab.\n*The influence of Non-local Means, Wavelets and DCT on the luminance noise.\n*The influence of Wavelets and DCT on the chroma noise.\n*The influence of Capture Sharpening and Demosaicing.
TP_LOCALLAB_LUMLABEL;Luma levels 0123: Mean=%1 High=%2
TP_LOCALLAB_LUM46LABEL;Luma levels 456: Mean=%1 High=%2
TP_LOCALLAB_CHROLABEL;Chroma levels 0123: Mean=%1 High=%2
TP_LOCALLAB_CHRO46LABEL;Chroma levels 456: Mean=%1 High=%2
TP_LOCALLAB_MLABEL;Restored data Min=%1 Max=%2
TP_LOCALLAB_MLABEL_TOOLTIP;The values should be close to Min=0 Max=32768 (log mode) but other values are possible.You can adjust 'Clip restored data (gain)' and 'Offset' to normalize.\nRecovers image data without blending.
TP_LOCALLAB_MODE_EXPERT;Advanced
@ -3196,7 +3239,7 @@ TP_LOCALLAB_NLDENOISENLPAT_TOOLTIP;Use this slider to adapt the amount of denois
TP_LOCALLAB_NLDENOISENLRAD_TOOLTIP;Higher values increase denoise at the expense of processing time.
TP_LOCALLAB_NLDENOISE_TOOLTIP;'Detail recovery' acts on a Laplacian transform to target uniform areas rather than areas with detail.
TP_LOCALLAB_NLDET;Detail recovery
TP_LOCALLAB_NLFRA;Non-local Means - Luminance
TP_LOCALLAB_NLFRA;Non-local Means: Luminance
TP_LOCALLAB_NLFRAME_TOOLTIP;Non-local means denoising takes a mean of all pixels in the image, weighted by how similar they are to the target pixel.\nReduces loss of detail compared with local mean algorithms.\nOnly luminance noise is taken into account. Chrominance noise is best processed using wavelets and Fourier transforms (DCT).\nCan be used in conjunction with 'Luminance denoise by level' or on its own.
TP_LOCALLAB_NLGAM;Gamma
TP_LOCALLAB_NLLUM;Strength
@ -3390,6 +3433,7 @@ TP_LOCALLAB_STYPE_TOOLTIP;You can choose between:\nSymmetrical - left handle lin
TP_LOCALLAB_SYM;Symmetrical (mouse)
TP_LOCALLAB_SYMSL;Symmetrical (mouse + sliders)
TP_LOCALLAB_TARGET_GRAY;Mean luminance (Yb%)
TP_LOCALLAB_TE_PIVOT;Pivot (Ev)
TP_LOCALLAB_THRES;Threshold structure
TP_LOCALLAB_THRESDELTAE;ΔE scope threshold
TP_LOCALLAB_THRESRETI;Threshold
@ -3786,6 +3830,16 @@ TP_TM_FATTAL_AMOUNT;Amount
TP_TM_FATTAL_ANCHOR;Anchor
TP_TM_FATTAL_LABEL;Dynamic Range Compression
TP_TM_FATTAL_THRESHOLD;Detail
TP_TONE_EQUALIZER_BAND_0;Blacks
TP_TONE_EQUALIZER_BAND_1;Shadows
TP_TONE_EQUALIZER_BAND_2;Midtones
TP_TONE_EQUALIZER_BAND_3;Highlights
TP_TONE_EQUALIZER_BAND_4;Whites
TP_TONE_EQUALIZER_BANDS;Bands
TP_TONE_EQUALIZER_DETAIL;Regularization
TP_TONE_EQUALIZER_LABEL;Tone Equalizer
TP_TONE_EQUALIZER_PIVOT;Pivot (Ev)
TP_TONE_EQUALIZER_SHOW_COLOR_MAP;Show tonal map
TP_VIBRANCE_AVOIDCOLORSHIFT;Avoid color shift
TP_VIBRANCE_CURVEEDITOR_SKINTONES;HH
TP_VIBRANCE_CURVEEDITOR_SKINTONES_LABEL;Skin-tones
@ -4062,7 +4116,7 @@ TP_WAVELET_WAVOFFSET;Offset
TP_WBALANCE_AUTO;Auto
TP_WBALANCE_AUTOITCGREEN;Temperature correlation
TP_WBALANCE_AUTOOLD;RGB grey
TP_WBALANCE_AUTO_HEADER;Automatic
TP_WBALANCE_AUTO_HEADER;Automatic & Refinement
TP_WBALANCE_CAMERA;Camera
TP_WBALANCE_CLOUDY;Cloudy
TP_WBALANCE_CUSTOM;Custom
@ -4089,6 +4143,47 @@ TP_WBALANCE_FLUO_HEADER;Fluorescent
TP_WBALANCE_GREEN;Tint
TP_WBALANCE_GTI;GTI
TP_WBALANCE_HMI;HMI
TP_WBALANCE_ITCWB_DELTA;Delta temperature in green loop
TP_WBALANCE_ITCWBDELTA_TOOLTIP;Fixed for each "green" iteration tried, the temperature difference to be taken into account.
//TP_WBALANCE_ITCWB_FORCED;Forces use of the entire CIE diagram
TP_WBALANCE_ITCWB_FORCED;Close to full CIE diagram
TP_WBALANCE_ITCWFORCED_TOOLTIP;By default (box not checked) the data scanned during sampling is brought back to the sRGB profile, which is the most widespread, both for calibrating DCP or ICC profiles with the Colorchecker24, or used on the web.\n If you have very high gamut images (some flowers, artificial colors), then it may be necessary to use the entire CIExy diagram, the profile used will be ACESP0. In this second case, the number of colors that can be used in internal to the algorithm will be more important.
TP_WBALANCE_ITCWB_FGREEN;Find green student
TP_WBALANCE_ITCWGREEN;Green refinement
TP_WBALANCE_ITCWGREEN_TOOLTIP;Allows you to change the "tint" (green) which will serve as a reference when starting the algorithm. It has substantially the same role for greens as "AWB temperature bias" for temperature.\nThe whole algorithm is recalculated.
TP_WBALANCE_ITCWBFGREEN_TOOLTIP;Find the best compromise between Student and green.
TP_WBALANCE_ITCWB_FRA;Auto Temperature correlation Settings
TP_WBALANCE_ITCWB_FRA_TOOLTIP;These settings allow, depending on the images (type of raw, colorimetry, etc.), an adaptation of the 'Temperature correlation' algorithm. There is no absolute rule linking these parameters to the results obtained.
TP_WBALANCE_ITCWB_MINSIZEPATCH;Patch minimum size
TP_WBALANCE_ITCWBMINSIZEPATCH_TOOLTIP;Allows you to set the minimum patch value. values that are too low can lead to a lack of correlation.
TP_WBALANCE_ITCWB_NOPURPLE;Filter on purple color
//TP_WBALANCE_ITCWBNOPURPLE_TOOLTIP;By default when "Inpaint opposed" is activated, purple colors are not taken into account. However, if the image does not need highlight reconstruction, or if this image naturally contains purple tints (flowers, etc.), it may be necessary to deactivate, to take into account all the colors.
TP_WBALANCE_ITCWBNOPURPLE_TOOLTIP;Allows you to filter magenta/purple data from the image. If the box is checked a filter limiting the value of Y is applied. By default this value is 0.4. You can change it in 'options' Itcwb_Ypurple (Maximum 1)
TP_WBALANCE_ITCWB_ALG;Remove 2 pass algorithm
TP_WBALANCE_ITCWB_CUSTOM;Use Custom temperature & tint
TP_WBALANCE_ITCWCUSTOM_TOOLTIP;Allows you to use Custom settings Temperature and Green (tint).\n\nUsage tips:\n1) start Itcwb , enable 'Use Custom temperature and tint'.\n2) Set 'Temperature and tint' to your liking :free, Pick,...(Custom)\n3) go back to 'Temperature correlation'.\n\nYou cannot use : 2 passes, AWB temperature bias, Green refinement.
TP_WBALANCE_ITCWALG_TOOLTIP;Allows you to switch to the other Alternative temperature (Alt_temp), when possible.\nInactive in the "single choice" case.
TP_WBALANCE_ITCWB_PRECIS;Precision algorithm - scale used
TP_WBALANCE_ITCWBPRECIS_TOOLTIP;The lower the value, the more relevant the data, but increases the processing time. Since the processing time is low, this parameter should generally be able to remain at the default value
TP_WBALANCE_ITCWB_PRIM_SRGB;Low sampling & No use Camera settings
TP_WBALANCE_ITCWB_PRIM_ADOB;Medium sampling
TP_WBALANCE_ITCWB_PRIM_BETA;Medium sampling - near Pointer's gamut
TP_WBALANCE_ITCWB_PRIM_REC;High sampling
TP_WBALANCE_ITCWB_PRIM_ACE;Forces use of the entire CIE diagram
TP_WBALANCE_ITCWB_PRIM_JDCMAX;Close to full CIE diagram
TP_WBALANCE_ITCWB_PRIM_XYZCAM;Camera XYZ matrix
TP_WBALANCE_ITCWB_PRIM_XYZCAM2;JDCmax after Camera XYZ matrix
TP_WBALANCE_ITCWPRIM_TOOLTIP;Allows you to select the image sampling.\n'Close to full CIE diagram' almost uses the data present on the sensor, possibly including the imaginary colors.\n'Camera XYZ matrix' - uses the matrix directly derived from Color Matrix.\n'Medium sampling' (default) - near Pointer's gamut: corresponds substantially to the most common cases of human vision.\nThe other choice 'Low sampling and No use camera settings' allow you to isolate high gamut parts of the image and forces the algorithm in some cases (tint > 0.8,...) not to use camera settings. This will obviously have an impact on the result.\n\nThis sampling only has an influence on the channel multipliers, it has nothing to do with the "working profile" and does not modify the gamut of the image.
TP_WBALANCE_ITCWB_RGREEN;Green range
TP_WBALANCE_ITCWBRGREEN_TOOLTIP;Sets the green value review amplitude in iterations, from low amplitude 0.82 to 1.25 to maximum amplitude 0.4 to 4.
TP_WBALANCE_ITCWB_SAMPLING;Low sampling 5.9
TP_WBALANCE_ITCWSAMPLING_TOOLTIP;Allows you to use the old sampling algorithm to ensure better compatibility with 5.9. You must enable Observer 10° (default).
TP_WBALANCE_ITCWB_SIZE;Size of ref. color compare to histogram
TP_WBALANCE_ITCWB_SIZEPATCH;Size of color patch
TP_WBALANCE_ITCWBSIZEPATCH_TOOLTIP;This setting sets the size of color datas used by algorithm.
TP_WBALANCE_ITCWBSIZE_TOOLTIP;This setting sets the number of iterations to find the best correspondence between the reference spectral colors and those in xyY value of the image. A value of 3 seams a good compromise.
TP_WBALANCE_ITCWB_THRES;Colors used in picture (preset)
TP_WBALANCE_ITCWBTHRES_TOOLTIP;Limits comparison sampling between spectral data and image data.
TP_WBALANCE_JUDGEIII;JudgeIII
TP_WBALANCE_LABEL;White Balance
TP_WBALANCE_LAMP_HEADER;Lamp
@ -4100,6 +4195,10 @@ TP_WBALANCE_MULLABEL;Multipliers: r=%1 g=%2 b=%3
TP_WBALANCE_MULLABEL_TOOLTIP;Values given for information purposes. You cannot change them.
TP_WBALANCE_OBSERVER10;Observer 10° instead of Observer 2°
TP_WBALANCE_OBSERVER10_TOOLTIP;The color management in Rawtherapee (White balance, channel multipliers, highlight recovery,...) uses the spectral data of the illuminants and colors. Observer is an important parameter of this management which takes into account the angle of perception of the eye. In 1931 it was fixed at 2° (privileges the use of the cones). In 1964 it was fixed at 10° (privileges the use of the cones, but partially takes into account the rods).\nTo avoid a (rare) drift of the colors due to the choice Observer 10° - probably due to the conversion matrix - Observer 2° must be selected.\nIn a majority of cases Observer 10° (default) will be a more relevant choice.
TP_WBALANCE_PATCHLABEL;Read colors:%1 Patch: Chroma:%2 Size=%3
TP_WBALANCE_PATCHLABEL_TOOLTIP;Display number of read colors (max=237).\nDisplay calculated Patch Chroma.\nAWB temperature bias, lets try to reduce this value, a minimum may seem to optimize the algorithm.\n\nPatch size matching chroma optimization.
TP_WBALANCE_PATCHLEVELLABEL;Patch: ΔE=%1 - datas x 9 Min:%2 Max=%3
TP_WBALANCE_PATCHLEVELLABEL_TOOLTIP;Display ΔE patch (this assumes there is enough spectral data), between image and spectral datas.\n Display read datas found. The 2 values correspond to the minimum and maximum data values taken into account. The coefficient x9 must be taken into account to obtain the number of pixels concerned in the image.
TP_WBALANCE_PICKER;Pick
TP_WBALANCE_SHADE;Shade
TP_WBALANCE_SIZE;Size:
@ -4108,10 +4207,12 @@ TP_WBALANCE_SOLUX41;Solux 4100K
TP_WBALANCE_SOLUX47;Solux 4700K (vendor)
TP_WBALANCE_SOLUX47_NG;Solux 4700K (Nat. Gallery)
TP_WBALANCE_SPOTWB;Use the pipette to pick the white balance from a neutral patch in the preview.
TP_WBALANCE_STUDLABEL;Correlation factor: %1
TP_WBALANCE_STUDLABEL_TOOLTIP;Display calculated Student correlation.\nLower values are better, where <0.005 is excellent,\n<0.01 is good, and >0.5 is poor.\nLow values do not mean that the white balance is good:\nif the illuminant is non-standard the results can be erratic.\nA value of 1000 means previous calculations are used and\nthe resultsare probably good.
TP_WBALANCE_STUDLABEL;Correlation factor: %1 Passes:%2 Worst_alt=%3
TP_WBALANCE_STUDLABEL1;Correlation factor: %1 Passes:%2 Best_alt=%3
TP_WBALANCE_STUDLABEL0;Correlation factor: %1 Passes:%2 Alt=%3
TP_WBALANCE_STUDLABEL_TOOLTIP;Display calculated Student correlation.\nLower values are better, where <0.005 is excellent,\n<0.01 is good, and >0.5 is poor.\nLow values do not mean that the white balance is good:\nif the illuminant is non-standard the results can be erratic.\nA value of 1000 means previous calculations are used and\nthe resultsare probably good.\n\nPasses : number of passes made.\nAlt_temp : Alternative temperature.
TP_WBALANCE_TEMPBIAS;AWB temperature bias
TP_WBALANCE_TEMPBIAS_TOOLTIP;Allows to alter the computation of the 'auto white balance'\nby biasing it towards warmer or cooler temperatures. The bias\nis expressed as a percentage of the computed temperature,\nso that the result is given by 'computedTemp + computedTemp * bias'.
TP_WBALANCE_TEMPBIAS_TOOLTIP;Allows to alter the computation of the 'auto white balance'\nby biasing it towards warmer or cooler temperatures. The bias\nis expressed as a percentage of the computed temperature,\nso that the result is given by 'computedTemp + computedTemp * bias'.\n\nYou can use "Awb temperature bias" to adjust the "Temperature correlation" results. Each movement of this command brings a new calculation of temperature, tint and correlation.
TP_WBALANCE_TEMPERATURE;Temperature
TP_WBALANCE_TUNGSTEN;Tungsten
TP_WBALANCE_WATER1;UnderWater 1

View File

@ -946,7 +946,7 @@ dialog notebook stack {
}
/* Adds a line on top of the notebook as a separtor for the titlebar (only on CSD) */
/* Adds a line on top of the notebook as a separator for the titlebar (only on CSD) */
dialog.csd #PrefNotebook > header,
dialog.csd #AboutNotebook > header,
window.csd:not(.fullscreen) #MainNotebook > header.top {

View File

@ -102,7 +102,7 @@ notebook > header.left > tabs > arrow {
}
/* Adds a line on top of the notebook as a separtor for the titlebar (only on CSD) */
/* Adds a line on top of the notebook as a separator for the titlebar (only on CSD) */
dialog.csd #PrefNotebook > header,
dialog.csd #AboutNotebook > header,
window.csd:not(.fullscreen) #MainNotebook > header.top {

View File

@ -102,7 +102,7 @@ notebook > header.left > tabs > arrow {
}
/* Adds a line on top of the notebook as a separtor for the titlebar (only on CSD) */
/* Adds a line on top of the notebook as a separator for the titlebar (only on CSD) */
dialog.csd #PrefNotebook > header,
dialog.csd #AboutNotebook > header,
window.csd:not(.fullscreen) #MainNotebook > header.top {

View File

@ -136,6 +136,7 @@ set(RTENGINESOURCEFILES
ipsharpen.cc
ipsharpenedges.cc
ipsoftlight.cc
iptoneequalizer.cc
iptransform.cc
ipvibrance.cc
ipwavelet.cc

View File

@ -1203,7 +1203,7 @@ BENCHFUN
if (!memoryAllocationFailed) {
if (kall == 0) {
Noise_residualAB(*adecomp, chresid, chmaxresid, denoiseMethodRgb);
Noise_residualAB(*adecomp, chresid, chmaxresid, denoiseMethodRgb, 0, levwav);
chresidtemp = chresid;
chmaxresidtemp = chmaxresid;
}
@ -1240,12 +1240,13 @@ BENCHFUN
if (!memoryAllocationFailed) {
if (kall == 0) {
Noise_residualAB(*bdecomp, chresid, chmaxresid, denoiseMethodRgb);
Noise_residualAB(*bdecomp, chresid, chmaxresid, denoiseMethodRgb, 0, levwav);
chresid += chresidtemp;
chmaxresid += chmaxresidtemp;
chresid = sqrt(chresid / (6 * (levwav)));
highresi = chresid + 0.66f * (sqrt(chmaxresid) - chresid); //evaluate sigma
nresi = chresid;
printf("Nresi=%f Highresi=%f lev=%i\n", (double) nresi, (double) highresi, levwav);
}
bdecomp->reconstruct(labdn->b[0]);
@ -2158,16 +2159,18 @@ float ImProcFunctions::MadRgb(const float * DataList, const int datalen)
void ImProcFunctions::Noise_residualAB(const wavelet_decomposition &WaveletCoeffs_ab, float &chresid, float &chmaxresid, bool denoiseMethodRgb)
void ImProcFunctions::Noise_residualAB(const wavelet_decomposition &WaveletCoeffs_ab, float &chresid, float &chmaxresid, bool denoiseMethodRgb, int beg, int end)
{
float resid = 0.f;
float maxresid = 0.f;
// int maxlev = WaveletCoeffs_ab.maxlevel();
// end = maxlev;
#ifdef _OPENMP
#pragma omp parallel for schedule(dynamic) collapse(2) reduction(+:resid) reduction(max:maxresid) num_threads(denoiseNestedLevels) if (denoiseNestedLevels>1)
#endif
for (int lvl = 0; lvl < WaveletCoeffs_ab.maxlevel(); ++lvl) {
// for (int lvl = 0; lvl < WaveletCoeffs_ab.maxlevel(); ++lvl) {
for (int lvl = beg; lvl < end; ++lvl) {
// compute median absolute deviation (MAD) of detail coefficients as robust noise estimator
for (int dir = 1; dir < 4; ++dir) {
const int Wlvl_ab = WaveletCoeffs_ab.level_W(lvl);

View File

@ -19,7 +19,7 @@
#ifndef _ALPHA_H_
#define _ALPHA_H_
#include <gtkmm.h>
#include <cairomm/cairomm.h>
#include <assert.h>
#define CHECK_BOUNDS 0

View File

@ -126,7 +126,7 @@ typedef struct internal_hooks
} internal_hooks;
#if defined(_MSC_VER)
/* work around MSVC error C2322: '...' address of dillimport '...' is not static */
/* work around MSVC error C2322: '...' address of dllimport '...' is not static */
static void *internal_malloc(size_t size)
{
return malloc(size);

View File

@ -84,7 +84,7 @@ int calcDistortion(unsigned char* img1, unsigned char* img2, int ncols, int nrow
r0[n] = sqrt((x0 - wc) * (x0 - wc) + (y0 - hc) * (y0 - hc)) / radius;
// dots too close to the center tends to have big diviation and create noise, extract them
// dots too close to the center tends to have big deviation and create noise, extract them
if (r0[n] < CENTER_R) {
continue;
}

View File

@ -1230,7 +1230,7 @@ Camera constants:
"raw_crop": [ 160, 120, 6024, 4024 ]
},
{ // Quality C
{ // Quality A
"make_model": "Canon EOS R5",
"dcraw_matrix" : [9766, -2953, -1254, -4276, 12116, 2433, -437, 1336, 5131],
"raw_crop" : [
@ -1241,7 +1241,7 @@ Camera constants:
{ "frame" : [ 8352, 5586 ], "areas": [ 94, 20, 5578, 122 ] },
{ "frame" : [ 5248, 3510 ], "areas": [ 94, 20, 3510, 122 ] }
],
"ranges" : { "white" : 16382 }
"ranges" : { "white" : 16300 } // 16382 without LENR, add margin for LENR. Dual-pixel frame 2 is lower for low ISOs.
},
{ // Quality C
@ -1258,6 +1258,19 @@ Camera constants:
"ranges" : { "white" : 16382 }
},
{ // Quality C
"make_model": ["Canon EOS R6m2", "Canon EOS R8"],
"dcraw_matrix": [9539, -2795, -1224, -4175, 11998, 2458, -465, 1755, 6048],
"raw_crop": [
{"frame": [6188, 4120], "crop": [154, 96, 6024, 4024]},
{"frame": [3936, 2612], "crop": [156, 96, 3780, 2516]}
],
"masked_areas": [
{"frame": [6188, 4120], "areas": [4, 4, 4116, 150, 4, 150, 92, 6184]},
{"frame": [3936, 2612], "areas": [4, 4, 2608, 150, 4, 150, 92, 3932]}
]
},
{ // Quality C
"make_model": "Canon EOS R7",
"dcraw_matrix" : [10424, -3138, -1300, -4221, 11938, 2584, -547, 1658, 6183],
@ -1565,7 +1578,10 @@ Camera constants:
{ // Quality B
"make_model": [ "FUJIFILM X-T30", "FUJIFILM X-T30 II", "FUJIFILM X100V", "FUJIFILM X-T4", "FUJIFILM X-S10" ],
"dcraw_matrix": [ 13426,-6334,-1177,-4244,12136,2371,-580,1303,5980 ], // DNG_v11, standard_v2 d65
"raw_crop": [ 0, 5, 6252, 4176]
"raw_crop": [
{"frame": [6384, 3348], "crop": [624, 0, 5004, 3347]}, // Sports finder mode.
{"frame": [0, 0], "crop": [0, 5, 6252, 4176]}
]
},
{ // Quality B
@ -1739,7 +1755,7 @@ Camera constants:
{ // Quality B, lacks aperture and ISO scaling, known to exist, but little to gain as the levels are so close to white_max
"make_model": "Nikon D7000",
"dcraw_matrix": [ 7530,-1942,-255,-4318,11390,3362,-926,1694,7649 ], // matrix provided by Tanveer(tsk1979)
//"dcraw_matrix": [ 8198, -2239, -725, -4871, 12388, 2798, -1043, 2050, 7181 ], // DNG v13.2
// "dcraw_matrix": [ 8198, -2239, -725, -4871, 12388, 2798, -1043, 2050, 7181 ], // DNG v13.2
"ranges": {
// measured at ISO 100. ISO differences not measured, but known to exist
"white": [ 16300, 15700, 16300 ], // typical R 16383, G 15778, B 16383
@ -2187,8 +2203,8 @@ Camera constants:
{ // Quality B
"make_model": [ "Panasonic DC-LX100M2" ],
"dcraw_matrix": [ 11577, -4230, -1106, -3967, 12211, 1957, -759, 1762, 5610 ], // DNG v13.2
//"dcraw_matrix": [ 8585, -3127, -833, -4005, 12250, 1953, -650, 1494, 4862 ], // DNG v13.2 alternate
//"dcraw_matrix": [ 11577, -4230, -1106, -3967, 12211, 1957, -759, 1762, 5610 ], // DNG v13.2
"dcraw_matrix": [ 8585, -3127, -833, -4005, 12250, 1953, -650, 1494, 4862 ], // DNG v13.2 alternate
"raw_crop": [ 0, 0, 0, 0 ],
"ranges": { "black": 15 }
},
@ -3123,6 +3139,15 @@ Camera constants:
"dcraw_matrix": [ 6344, -1612, -462, -4863, 12477, 2681, -865, 1786, 6899 ] // DNG
},
{ // Quality A
"make_model": "Sony ZV-1",
"dcraw_matrix": [ 8280, -2987, -703, -3531, 11645, 2133, -550, 1542, 5312 ], // DNG v15.2
"ranges": { "black": 800 }, // White level from EXIF.
"raw_crop": [ 0, 0, 5496, 3672 ],
"pdaf_pattern": [0, 24, 48, 72, 88, 120],
"pdaf_offset": 17
},
{ // Quality C, No proper color data, beta samples, frame set to official jpeg,
"make_model": [ "XIAOYI M1", "YI TECHNOLOGY M1" ],
"dcraw_matrix": [ 7158,-1911,-606,-3603,10669,2530,-659,1236,5530 ], // XIAO YI DNG D65

View File

@ -2895,7 +2895,7 @@ void Color::SkinSat (float lum, float hue, float chrom, float &satreduc)
*
* data (Munsell ==> Lab) obtained with WallKillcolor and http://www.cis.rit.edu/research/mcsl2/online/munsell.php
* each LUT give Hue in function of C, for each color Munsell and Luminance
* eg: _6PB20 : color Munsell 6PB for L=20 c=5 c=45 c=85 c=125..139 when possible: interpolation betwwen values
* eg: _6PB20 : color Munsell 6PB for L=20 c=5 c=45 c=85 c=125..139 when possible: interpolation between values
* no value for C<5 (gray)
* low memory footprint -- maximum: 195 LUTf * 140 values
* errors due to small number of samples in LUT and linearization are very low (1 to 2%)

File diff suppressed because it is too large Load Diff

View File

@ -56,13 +56,13 @@ private:
void temp2mul (double temp, double green, double equal, StandardObserver observer, double& rmul, double& gmul, double& bmul) const;
const static std::map<std::string,const double *> spectMap;
public:
static constexpr StandardObserver DEFAULT_OBSERVER = StandardObserver::TEN_DEGREES;
// static constexpr StandardObserver DEFAULT_OBSERVER = StandardObserver::TEN_DEGREES;
static constexpr StandardObserver DEFAULT_OBSERVER = StandardObserver::TWO_DEGREES;
ColorTemp () : temp(-1.), green(-1.), equal (1.), method("Custom") {}
explicit ColorTemp (double e) : temp(-1.), green(-1.), equal (e), method("Custom") {}
ColorTemp (double t, double g, double e, const std::string &m, StandardObserver o);
ColorTemp (double mulr, double mulg, double mulb, double e, StandardObserver observer);
static void tempxy(bool separated, int repref, float **Tx, float **Ty, float **Tz, float **Ta, float **Tb, float **TL, double *TX, double *TY, double *TZ, const procparams::WBParams & wbpar);
static void tempxy(bool separated, int repref, float **Tx, float **Ty, float **Tz, float **Ta, float **Tb, float **TL, double *TX, double *TY, double *TZ, const procparams::WBParams & wbpar, int ttbeg, int ttend, double &wpx, double &wpz, double *WPX, double *WPZ);
void update (const double rmul, const double gmul, const double bmul, const double equal, StandardObserver observer, const double tempBias=0.0)
{
@ -169,6 +169,8 @@ public:
static const double ColorchechGreE2_spect[97];
static const double ColorchechGreB3_spect[97];
static const double ColorchechCyaF3_spect[97];
static const double ColorchechCyaF3_spect2[97];
static const double ColorchechCyaF3_spect3[97];
static const double ColorchechPurD2_spect[97];
static const double ColorchechMagE3_spect[97];
static const double ColorchechSkiA138_13_14_spect[97];
@ -376,21 +378,259 @@ public:
static const double J570_NeuD17_spect[97];//neutral
static const double J570_NeuJ11_spect[97];//neutral
static const double J570_NeuL4_spect[97];//neutral
static const double J570_NeuN8_spect2[97];//neutral
static const double J570_NeuN9_spect2[97];//neutral
static const double J570_NeuO8_spect2[97];//neutral
static const double J570_NeuO11_spect2[97];//neutral
static const double J570_NeuD5_spect2[97];//neutral
static const double J570_NeuE11_spect2[97];//neutral
static const double J570_NeuK16_spect2[97];//neutral
static const double J570_NeuM3_spect2[97];//neutral
static const double J570_NeuN18_spect2[97];//neutral
static const double J570_NeuQ1_spect2[97];//neutral
static const double J570_NeuS7_spect2[97];//neutral
static const double J570_NeuV10_spect2[97];//neutral
static const double J570_NeuW18_spect2[97];//neutral
static const double J570_NeuZ14_spect2[97];//neutral
static const double J570_NeuC18_spect2[97];//neutral
static const double J570_NeuD17_spect2[97];//neutral
static const double J570_NeuJ11_spect2[97];//neutral
static const double J570_NeuL4_spect2[97];//neutral
static const double Colorlab_n72_n2_spect[97];
static const double Colorlab_10_n70_spect[97];
static const double Colorlab_10_n70_spect2[97];
static const double Colorlab_10_n70_spect3[97];
static const double Colorlab_10_n70_spect4[97];
static const double Colorlab_n33_n70_spect[97];
static const double Colorlab_n8_n74_spect[97];
static const double Colorlab_19_n69_spect[97];
static const double Colorlab_n80_10_spect[97];
static const double Colorlab_n80_26_spect[97];
static const double Colorlab_n80_5_9_5_9spect[97];
// static const double JDC468_greyc14_66_spect[97];
// static const double JDC468_greym13_325_spect[97];
// static const double JDC468_greyf26_156_spect[97];
// static const double Colorlab_n57_5_6_9spect[97];
/*
static const double JDC468_greyc14_66_spect[97];
static const double JDC468_greym13_325_spect[97];
static const double JDC468_greyf26_156_spect[97];
*/
static const double Colorlab_L61_110_110Rec2020spect[97];
static const double Colorlab_L63_120_m56Rec2020spect[97];
static const double Colorlab_L63_m50_m60Rec2020spect[97];
static const double Colorlab_L63_m120_80Rec2020spect[97];
static const double Colorlab_L42_110_m100Prospect[97];
static const double Colorlab_L42_m70_m100Prospect[97];
static const double Colorlab_L56_m120_90Prospect[97];
static const double Colorlab_L25_60_m120Prospect[97];
static const double Colorlab_L75_50_120Prospect[97];
static const double Colorlab_L75_m120_0Prospect[97];
static const double Colorlab_L22_2_1_3Prospect[97];
static const double Colorlab_L44_2_8_3_9spect[97];
static const double Colorlab_L44_2_8_3_9spect2[97];
static const double Colorlab_L95_2_3_15_6spect[97];
static const double Colorlab_L95_2_3_15_6spect2[97];
static const double Colorlab_L40_3_5_10_7spect[97];
static const double Colorlab_L40_3_5_10_7spect2[97];
static const double Colorlab_L40_3_5_10_7spect3[97];
static const double Colorlab_L34_1_8_1_9spect[97];
static const double Colorlab_L34_1_8_1_9spect2[97];
static const double Colorlab_L64_1_8_m1_9spect[97];
static const double Colorlab_L84_0_8_m1spect[97];
static const double Colorlab_L63_1_3_m2spect[97];
static const double Colorlab_L44_2_3_m3spect[97];
static const double Colorlab_L65_96_45spect[97];
static const double Colorlab_L52_47_57spect[97];
static const double Colorlab_L31_62_27spect[97];
static const double Colorlab_L79_m9_m28spect[97];
static const double Colorlab_L58_50_31spect[97];
static const double Colorlab_L31_m52_27spect[97];
static const double Colorlab_L44_2_2_m7_35spect[97];
static const double Colorlab_L47_m10_8_0_41spect[97];
static const double Colorlab_L32_4_8_m3_2spect[97];
static const double Colorlab_L57_m6_9_2_9spect[97];
static const double Colorlab_L33_2_4_m4_5spect[97];
static const double Colorlab_L35_11_65_m1_1spect[97];
static const double Colorlab_L52_m2_7_8_9spect[97];
static const double Colorlab_L32_7_m2_5spect[97];
static const double Colorlab_L32_3_4_m3_8spect[97];
static const double Colorlab_L50_m5_3_6_5spect[97];
static const double Colorlab_L44_3_96_m8_8spect[97];
static const double Colorlab_L34_3_6_m5_4spect[97];
static const double Colorlab_L31_5_9_m4spect[97];
static const double Colorlab_L35_3_4_m11spect[97];
static const double Colorlab_L31_4_5_m4_7spect[97];
static const double Colorlab_L35_4_8_m6_4spect[97];
static const double Colorlab_L95_10_7_m14_3spect[97];
static const double Colorlab_L36_34_m7_5spect[97];
static const double Colorlab_L37_59_2spect[97];
static const double Colorlab_L69_14_m9spect[97];
static const double Colorlab_L92_13_m16spect[97];
static const double Colorlab_L49_21_m12spect[97];
static const double Colorlab_L56_20_m15spect[97];
static const double Colorlab_L68_21_m19spect[97];
static const double Colorlab_L98_m2_m32spect[97];
static const double Colorlab_L98_m2_m32spect2[97];
static const double Colorlab_L41_m27_m16spect[97];
static const double Colorlab_L41_m27_m16spect2[97];
static const double Colorlab_L15_m9_4spect[97];
static const double Colorlab_L15_m9_4spect2[97];
static const double Colorlab_L11_m11_2spect[97];
static const double Colorlab_L14_m4_3spect[97];
static const double Colorlab_L41_38_24spect[97];
static const double Colorlab_L41_38_24spect2[97];
static const double Colorlab_L53_48_58spect[97];
static const double Colorlab_L53_48_58spect2[97];
static const double Colorlab_L70_44_86spect[97];
static const double Colorlab_L70_44_86spect2[97];
static const double Colorlab_L38_42_19spect[97];
static const double Colorlab_L38_42_19spect2[97];
static const double Colorlab_L60_63_85spect[97];
static const double Colorlab_L60_63_85spect2[97];
static const double Colorlab_L80_75_30spect[97];
static const double Colorlab_L80_75_30spect2[97];
static const double Colorlab_L28_m21_24spect[97];
static const double Colorlab_L28_m21_24spect2[97];
static const double Colorlab_L45_m33_47spect[97];
static const double Colorlab_L45_m33_47spect2[97];
static const double Colorlab_L26_m7_404spect[97];
static const double Colorlab_L34_m61_2spect[97];
static const double Colorlab_L32_m16_17spect[97];
static const double Colorlab_L30_m19_15spect[97];
static const double Colorlab_L30_m17_16spect[97];
static const double Colorlab_L35_m8_4spect[97];
static const double Colorlab_L37_m7_5spect[97];
static const double Colorlab_L45_m7_2spect[97];
static const double Colorlab_L40_m6_5spect[97];
static const double Colorlab_L46_m6_2spect[97];
static const double Colorlab_L48_m69_16spect[97];
static const double Colorlab_L51_89_53spect[97];
static const double Colorlab_L49_84_33spect[97];
static const double Colorlab_L59_m51_31spect[97];
static const double Colorlab_L48_m69_16spect2[97];
static const double Colorlab_L53_m71_6spect[97];
static const double Colorlab_L51_m89_53spect2[97];
static const double Colorlab_L49_84_33spect2[97];
static const double Colorlab_L36_m27_28spect[97];
static const double Colorlab_L36_m27_28spect2[97];
static const double Colorlab_L36_m27_28spect3[97];
static const double Colorlab_L63_16_71spect[97];
static const double Colorlab_L84_4_46spect[97];
static const double Colorlab_L84_4_46spect2[97];
static const double Colorlab_L75_m66_19spect[97];
static const double Colorlab_L75_m66_19spect2[97];
static const double Colorlab_L64_m82_m6spect[97];
static const double Colorlab_L64_m82_m6spect2[97];
static const double Colorlab_L66_m71_m17spect[97];
static const double Colorlab_L66_m71_m17spect2[97];
static const double Colorlab_L22_m8_m60spect[97];
static const double Colorlab_L22_m8_m60spect2[97];
static const double Colorlab_L15_m4_m42spect[97];
static const double Colorlab_L15_m4_m42spect2[97];
static const double Colorlab_L13_3_m23spect[97];
static const double Colorlab_L27_4_m90spect[97];
static const double Colorlab_L19_1_m29spect[97];
static const double Colorlab_L27_4_m90spect2[97];
static const double Colorlab_L16_0_m44spect[97];
static const double Colorlab_L16_0_m44spect2[97];
static const double Colorlab_L13_m3_m36spect[97];
static const double Colorlab_L13_m3_m36spect2[97];
static const double Colorlab_L31_m23_m60spect[97];
static const double Colorlab_L31_m23_m60spect2[97];
static const double Colorlab_L17_3_m40spect[97];
static const double Colorlab_L17_3_m40spect2[97];
static const double Colorlab_L17_3_m40spect3[97];
static const double Colorlab_L17_3_m40spect4[97];
static const double Colorlab_L17_3_m40spect5[97];
static const double Colorlab_L17_3_m40spect6[97];
static const double Colorlab_L21_9_m7spect[97];
static const double Colorlab_L78_4_m74spect[97];
static const double Colorlab_L31_m58_m66spect[97];
static const double Colorlab_L61_m11_m12spect[97];
static const double Colorlab_L61_m11_m12spect2[97];
static const double Colorlab_L29_1_m13spect[97];
static const double Colorlab_L29_1_m13spect2[97];
static const double Colorlab_L2_14_m1spect[97];
static const double Colorlab_L5_39_m7spect[97];
static const double Colorlab_L15_5_m13spect[97];
static const double Colorlab_L12_5_m6spect[97];
static const double Colorlab_L12_5_m6spect2[97];
static const double Colorlab_L37_m59_m24spect[97];
static const double Colorlab_L37_m59_m24spect2[97];
static const double Colorlab_L15_55_23spect[97];
static const double Colorlab_L11_m55_m11spect[97];
static const double Colorlab_L8_m10_m2spect[97];
static const double Colorlab_L14_m10_m7spect[97];
static const double Colorlab_L20_m16_m13spect[97];
static const double Colorlab_L8_m10_m2spect2[97];
static const double Colorlab_L14_m10_m7spect2[97];
static const double Colorlab_L20_m16_m13spect2[97];
static const double Colorlab_L6_m9_1spect[97];
static const double Colorlab_L20_m9_m10spect[97];
static const double Colorlab_L85_10_45spect[97];
static const double Colorlab_L90_m7_82spect[97];
static const double Colorlab_L95_2_18spect[97];
static const double Colorlab_L39_7_4spect[97];
static const double Colorlab_L39_4_1spect[97];
static const double Colorlab_L39_3_m1spect[97];
static const double Colorlab_L40_3_m2spect[97];
static const double Colorlab_L36_2_2spect[97];
static const double Colorlab_L39_7_4spect2[97];
static const double Colorlab_L39_4_1spect2[97];
static const double Colorlab_L39_3_m1spect2[97];
static const double Colorlab_L40_3_m2spect2[97];
static const double Colorlab_L36_2_2spect2[97];
static const double Colorlab_L40_4_m2spect[97];
static const double Colorlab_L41_1_m6spect[97];
static const double Colorlab_L40_4_m2spect2[97];
static const double Colorlab_L41_1_m6spect2[97];
static const double Colorlab_L41_12_14spect[97];
static const double Colorlab_L41_12_14spect2[97];
static const double Colorlab_L10_0_m22spect[97];
static const double Colorlab_L38_60_8spect[97];
static const double Colorlab_L49_85_39spect[97];
static const double Colorlab_L42_1_m18spect[97];
static const double Colorlab_L48_19_m25spect[97];
static const double Colorlab_L30_21_m25spect[97];
static const double Colorlab_L15_10_m15spect[97];
static const double Colorlab_L48_19_m25spect2[97];
static const double Colorlab_L30_21_m25spect2[97];
static const double Colorlab_L15_10_m15spect2[97];
static const double Colorlab_L60_26_m25spect[97];
static const double Colorlab_L40_26_m45spect[97];
static const double Colorlab_L40_26_m45spect2[97];
static const double Colorlab_L20_10_m45spect[97];
static const double Colorlab_L20_10_m45spect2[97];
static const double Colorlab_L20_10_m45spect3[97];
static const double ColorBlueSkyK3_spect2[97];
static const double ColorBlueSkyK9_spect2[97];
static const double ColorBlueSkyC4_spect2[97];
static const double ColorBlueSkyC14_spect2[97];
static const double ColorBlueSkyE4_spect2[97];
static const double ColorBlueSkyM1_spect2[97];
static const double ColorBlueSky2B1_spect2[97];
static const double ColorBlueSkyT7_spect2[97];
static const double ColorBlueSkyU19_spect2[97];
static const double ColorBlueSkyU2_spect2[97];
static const double Colorlab_L40_1_m40spect[97];
static const double Colorlab_L30_4_m30spect[97];
static const double Colorlab_L8_11_m25spect[97];
static const double Colorlab_L40_1_m40spect2[97];
static const double Colorlab_L30_4_m30spect2[97];
static const double Colorlab_L8_11_m25spect2[97];
static const double Colorlab_L26_m8_m25spect[97];
static const double Colorlab_L26_m8_m25spect2[97];
static const double Colorlab_L26_m8_m25spect3[97];
static const double Colorlab_L22_1_m42spect[97];
static const double Colorlab_L22_1_m42spect2[97];
static const double Colorlab_L22_1_m42spect3[97];
static const double Colorlab_L22_1_m42spect4[97];
static const double Colorlab_L27_m1_m47spect[97];
static const double Colorlab_L27_m1_m47spect2[97];
static const double Colorlab_L40_30_m30spect[97];
static const double Colorlab_L40_30_m30spect2[97];
static const double Colorlab_L40_20_m35spect[97];
static const double Colorlab_L40_20_m35spect2[97];
static void spectrum_to_xyz_daylight (double _m1, double _m2, double &x, double &y, double &z, const color_match_type &color_match);
static void spectrum_to_xyz_blackbody (double _temp, double &x, double &y, double &z, const color_match_type &color_match);
static void spectrum_to_xyz_preset (const double* spec_intens, double &x, double &y, double &z, const color_match_type &color_match);
@ -398,6 +638,9 @@ public:
static void spectrum_to_color_xyz_daylight (const double* spec_color, double _m1, double _m2, double &xx, double &yy, double &zz, const color_match_type &color_match);
static void spectrum_to_color_xyz_blackbody (const double* spec_color, double _temp, double &xx, double &yy, double &zz, const color_match_type &color_match);
static void spectrum_to_color_xyz_preset (const double* spec_color, const double* spec_intens, double &xx, double &yy, double &zz, const color_match_type &color_match);
static void spectrum_to_whitepoint_xyz_daylight (double _m1, double _m2, double &xx, double &yy, double &zz, const color_match_type &color_match);
static void spectrum_to_whitepoint_xyz_blackbody (double _temp, double &xx, double &yy, double &zz, const color_match_type &color_match);
static void whitepoint (double tempw, double &xx, double &yy, double &zz,const color_match_type &color_match);
};
}

View File

@ -4422,10 +4422,10 @@ void CLASS crop_masked_pixels()
}
} else {
if (height + top_margin > raw_height) {
top_margin = raw_height - height;
top_margin = raw_height - MIN(height, raw_height);
}
if (width + left_margin > raw_width) {
left_margin = raw_width - width;
left_margin = raw_width - MIN(width, raw_width);
}
#ifdef _OPENMP
#pragma omp parallel for
@ -6812,17 +6812,17 @@ guess_cfa_pc:
linear_table (len);
break;
case 50713: /* BlackLevelRepeatDim */
if (tiff_ifd[ifd].new_sub_file_type != 0) continue;
if (tiff_ifd[ifd].new_sub_file_type != 0) break;
cblack[4] = get2();
cblack[5] = get2();
if (cblack[4] * cblack[5] > sizeof cblack / sizeof *cblack - 6)
cblack[4] = cblack[5] = 1;
break;
case 61450:
if (tiff_ifd[ifd].new_sub_file_type != 0) continue;
if (tiff_ifd[ifd].new_sub_file_type != 0) break;
cblack[4] = cblack[5] = MIN(sqrt(len),64);
case 50714: /* BlackLevel */
if (tiff_ifd[ifd].new_sub_file_type != 0) continue;
if (tiff_ifd[ifd].new_sub_file_type != 0) break;
RT_blacklevel_from_constant = ThreeValBool::F;
//-----------------------------------------------------------------------------
// taken from LibRaw.
@ -8675,7 +8675,8 @@ void CLASS adobe_coeff (const char *make, const char *model)
{ "Olympus E-M5MarkII", 0, 0,
{ 9422,-3258,-711,-2655,10898,2015,-512,1354,5512 } },
{ "Olympus E-M5", 0, 0xfe1,
{ 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } },
{ 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } },//D65
// { 9033,-3597, 26,-2351, 9700, 3111, -181, 807, 5838} },//stDA
{ "Olympus PEN-F", 0, 0,
{ 9476,-3182,-765,-2613,10958,1893,-449,1315,5268 } },
{ "Olympus SH-2", 0, 0,
@ -9807,9 +9808,9 @@ void CLASS identify()
if (!strncasecmp (model, make, i) && model[i++] == ' ')
memmove (model, model+i, 64-i);
if (!strncmp (model,"FinePix ",8))
strcpy (model, model+8);
/* RT */ memmove (model, model+8, 64-8);
if (!strncmp (model,"Digital Camera ",15))
strcpy (model, model+15);
/* RT */ memmove (model, model+15, 64-15);
desc[511] = artist[63] = make[63] = model[63] = model2[63] = 0;
if (!is_raw) goto notraw;
@ -10138,8 +10139,8 @@ canon_a5:
width = raw_width = 5504;
height = raw_height = 3856;
}
top_margin = (raw_height - height) >> 2 << 1;
left_margin = (raw_width - width ) >> 2 << 1;
top_margin = (raw_height - MIN(height, raw_height)) >> 2 << 1;
left_margin = (raw_width - MIN(width, raw_width) ) >> 2 << 1;
if (width == 2848 || width == 3664) filters = 0x16161616;
if (width == 4032 || width == 4952 || width == 6032 || width == 8280) left_margin = 0;
if (width == 3328 && (width -= 66)) left_margin = 34;

View File

@ -18,6 +18,9 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include <glibmm/ustring.h>
#include <glibmm/timer.h>
#include "cieimage.h"
#include "color.h"
#include "curves.h"
@ -597,7 +600,6 @@ void Crop::update(int todo)
params.dirpyrDenoise.redchro = maxr;
params.dirpyrDenoise.bluechro = maxb;
parent->denoiseInfoStore.valid = true;
if (parent->adnListener) {
parent->adnListener->chromaChanged(params.dirpyrDenoise.chroma, params.dirpyrDenoise.redchro, params.dirpyrDenoise.bluechro);
}
@ -845,7 +847,7 @@ void Crop::update(int todo)
if ((todo & (M_AUTOEXP | M_RGBCURVE)) && params.locallab.enabled && !params.locallab.spots.empty()) {
//I made a little change here. Rather than have luminanceCurve (and others) use in/out lab images, we can do more if we copy right here.
parent->ipf.rgb2lab(*baseCrop, *laboCrop, params.icm.workingProfile);
@ -942,16 +944,7 @@ void Crop::update(int todo)
auto& locwavCurveden = parent->locwavCurveden;
auto& lmasklocal_curve2 = parent->lmasklocal_curve;
auto& loclmasCurve_wav = parent->loclmasCurve_wav;
// const int sizespot = (int)params.locallab.spots.size();
/* float *huerefp = nullptr;
huerefp = new float[sizespot];
float *chromarefp = nullptr;
chromarefp = new float[sizespot];
float *lumarefp = nullptr;
lumarefp = new float[sizespot];
float *fabrefp = nullptr;
fabrefp = new float[sizespot];
*/
for (int sp = 0; sp < (int)params.locallab.spots.size(); sp++) {
locRETgainCurve.Set(params.locallab.spots.at(sp).localTgaincurve);
locRETtransCurve.Set(params.locallab.spots.at(sp).localTtranscurve);
@ -1045,6 +1038,7 @@ void Crop::update(int todo)
if (black < 0. && params.locallab.spots.at(sp).expMethod == "pde" ) {
black *= 1.5;
}
std::vector<LocallabListener::locallabDenoiseLC> localldenoiselc;
double cont = params.locallab.spots.at(sp).contrast;
double huere, chromare, lumare, huerefblu, chromarefblu, lumarefblu, sobelre;
@ -1060,6 +1054,7 @@ void Crop::update(int todo)
float stdtme = parent->stdtms[sp];
float meanretie = parent->meanretis[sp];
float stdretie = parent->stdretis[sp];
float fab = 1.f;
float minCD;
float maxCD;
@ -1070,7 +1065,14 @@ void Crop::update(int todo)
float Tmin;
float Tmax;
int lastsav;
float highresi = 0.f;
float nresi = 0.f;
float highresi46 =0.f;
float nresi46 = 0.f;
float Lhighresi = 0.f;
float Lnresi = 0.f;
float Lhighresi46 = 0.f;
float Lnresi46 = 0.f;
/* huerefp[sp] = huere;
chromarefp[sp] = chromare;
lumarefp[sp] = lumare;
@ -1139,9 +1141,20 @@ void Crop::update(int todo)
huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav,
parent->previewDeltaE, parent->locallColorMask, parent->locallColorMaskinv, parent->locallExpMask, parent->locallExpMaskinv, parent->locallSHMask, parent->locallSHMaskinv, parent->locallvibMask, parent->localllcMask, parent->locallsharMask, parent->locallcbMask, parent->locallretiMask, parent->locallsoftMask, parent->localltmMask, parent->locallblMask,
parent->localllogMask, parent->locall_Mask, parent->locallcieMask, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax,
meantme, stdtme, meanretie, stdretie, fab);
// fabrefp[sp] = fab;
meantme, stdtme, meanretie, stdretie, fab,
highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46);
LocallabListener::locallabDenoiseLC denoiselc;
denoiselc.highres = highresi;
denoiselc.nres = nresi;
denoiselc.highres46 = highresi46;
denoiselc.nres46 = nresi46;
denoiselc.Lhighres = Lhighresi;
denoiselc.Lnres = Lnresi;
denoiselc.Lhighres46 = Lhighresi46;
denoiselc.Lnres46 = Lnresi46;
localldenoiselc.push_back(denoiselc);
if (parent->previewDeltaE || parent->locallColorMask == 5 || parent->locallvibMask == 4 || parent->locallExpMask == 5 || parent->locallSHMask == 4 || parent->localllcMask == 4 || parent->localltmMask == 4 || parent->localllogMask == 4 || parent->locallsoftMask == 6 || parent->localllcMask == 4 || parent->locallcieMask == 4) {
params.blackwhite.enabled = false;
params.colorToning.enabled = false;
@ -1171,6 +1184,20 @@ void Crop::update(int todo)
}
*/
denoiselc.highres = highresi;
denoiselc.nres = nresi;
denoiselc.highres46 = highresi46;
denoiselc.nres46 = nresi46;
denoiselc.Lhighres = Lhighresi;
denoiselc.Lnres = Lnresi;
denoiselc.Lhighres46 = Lhighresi46;
denoiselc.Lnres46 = Lnresi46;
localldenoiselc.push_back(denoiselc);
if (parent->locallListener) {
parent->locallListener->denChanged(localldenoiselc, params.locallab.selspot);
}
} else {
parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop.get(), savenormtmCrop.get(), savenormretiCrop.get(), lastorigCrop.get(), fw, fh, cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, locRETtransCurve,
@ -1226,8 +1253,11 @@ void Crop::update(int todo)
LHutili, HHutili, CHutili, HHutilijz, CHutilijz, LHutilijz, cclocalcurve2, localcutili, rgblocalcurve2, localrgbutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2,
huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax,
meantme, stdtme, meanretie, stdretie, fab);
meantme, stdtme, meanretie, stdretie, fab,
highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46);
}
if (sp + 1u < params.locallab.spots.size()) {
// do not copy for last spot as it is not needed anymore
lastorigCrop->CopyFrom(labnCrop);
@ -1735,6 +1765,11 @@ void Crop::freeAll()
shbuffer = nullptr;
}
if (shbuf_real) {
delete [] shbuf_real;
shbuf_real = nullptr;
}
PipetteBuffer::flush();
}

View File

@ -19,6 +19,7 @@
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <vector>
#include "gauss.h"
@ -1129,40 +1130,45 @@ template<class T> void gaussVertical (T** src, T** dst, const int W, const int H
// process 'numcols' columns for better usage of L1 cpu cache (especially faster for large values of H)
static const int numcols = 8;
double temp2[H][numcols] ALIGNED16;
std::vector<double> temp2(H * numcols);
double temp2Hm1[numcols], temp2H[numcols], temp2Hp1[numcols];
auto coord =
[](const int &x, const int &y) -> int {
return x * numcols + y;
};
#ifdef _OPENMP
#pragma omp for nowait
#endif
for (unsigned int i = 0; i < static_cast<unsigned>(std::max(0, W - numcols + 1)); i += numcols) {
for (int k = 0; k < numcols; k++) {
temp2[0][k] = B * src[0][i + k] + b1 * src[0][i + k] + b2 * src[0][i + k] + b3 * src[0][i + k];
temp2[1][k] = B * src[1][i + k] + b1 * temp2[0][k] + b2 * src[0][i + k] + b3 * src[0][i + k];
temp2[2][k] = B * src[2][i + k] + b1 * temp2[1][k] + b2 * temp2[0][k] + b3 * src[0][i + k];
temp2[coord(0, k)] = B * src[0][i + k] + b1 * src[0][i + k] + b2 * src[0][i + k] + b3 * src[0][i + k];
temp2[coord(1, k)] = B * src[1][i + k] + b1 * temp2[coord(0, k)] + b2 * src[0][i + k] + b3 * src[0][i + k];
temp2[coord(2, k)] = B * src[2][i + k] + b1 * temp2[coord(1, k)] + b2 * temp2[coord(0, k)] + b3 * src[0][i + k];
}
for (int j = 3; j < H; j++) {
for (int k = 0; k < numcols; k++) {
temp2[j][k] = B * src[j][i + k] + b1 * temp2[j - 1][k] + b2 * temp2[j - 2][k] + b3 * temp2[j - 3][k];
temp2[coord(j, k)] = B * src[j][i + k] + b1 * temp2[coord(j - 1, k)] + b2 * temp2[coord(j - 2, k)] + b3 * temp2[coord(j - 3, k)];
}
}
for (int k = 0; k < numcols; k++) {
temp2Hm1[k] = src[H - 1][i + k] + M[0][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[0][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[0][2] * (temp2[H - 3][k] - src[H - 1][i + k]);
temp2H[k] = src[H - 1][i + k] + M[1][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[1][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[1][2] * (temp2[H - 3][k] - src[H - 1][i + k]);
temp2Hp1[k] = src[H - 1][i + k] + M[2][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[2][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[2][2] * (temp2[H - 3][k] - src[H - 1][i + k]);
temp2Hm1[k] = src[H - 1][i + k] + M[0][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[0][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[0][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]);
temp2H[k] = src[H - 1][i + k] + M[1][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[1][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[1][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]);
temp2Hp1[k] = src[H - 1][i + k] + M[2][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[2][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[2][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]);
}
for (int k = 0; k < numcols; k++) {
dst[H - 1][i + k] = temp2[H - 1][k] = temp2Hm1[k];
dst[H - 2][i + k] = temp2[H - 2][k] = B * temp2[H - 2][k] + b1 * temp2[H - 1][k] + b2 * temp2H[k] + b3 * temp2Hp1[k];
dst[H - 3][i + k] = temp2[H - 3][k] = B * temp2[H - 3][k] + b1 * temp2[H - 2][k] + b2 * temp2[H - 1][k] + b3 * temp2H[k];
dst[H - 1][i + k] = temp2[coord(H - 1, k)] = temp2Hm1[k];
dst[H - 2][i + k] = temp2[coord(H - 2, k)] = B * temp2[coord(H - 2, k)] + b1 * temp2[coord(H - 1, k)] + b2 * temp2H[k] + b3 * temp2Hp1[k];
dst[H - 3][i + k] = temp2[coord(H - 3, k)] = B * temp2[coord(H - 3, k)] + b1 * temp2[coord(H - 2, k)] + b2 * temp2[coord(H - 1, k)] + b3 * temp2H[k];
}
for (int j = H - 4; j >= 0; j--) {
for (int k = 0; k < numcols; k++) {
dst[j][i + k] = temp2[j][k] = B * temp2[j][k] + b1 * temp2[j + 1][k] + b2 * temp2[j + 2][k] + b3 * temp2[j + 3][k];
dst[j][i + k] = temp2[coord(j, k)] = B * temp2[coord(j, k)] + b1 * temp2[coord(j + 1, k)] + b2 * temp2[coord(j + 2, k)] + b3 * temp2[coord(j + 3, k)];
}
}
}
@ -1173,24 +1179,24 @@ template<class T> void gaussVertical (T** src, T** dst, const int W, const int H
// process remaining columns
for (int i = W - (W % numcols); i < W; i++) {
temp2[0][0] = B * src[0][i] + b1 * src[0][i] + b2 * src[0][i] + b3 * src[0][i];
temp2[1][0] = B * src[1][i] + b1 * temp2[0][0] + b2 * src[0][i] + b3 * src[0][i];
temp2[2][0] = B * src[2][i] + b1 * temp2[1][0] + b2 * temp2[0][0] + b3 * src[0][i];
temp2[coord(0, 0)] = B * src[0][i] + b1 * src[0][i] + b2 * src[0][i] + b3 * src[0][i];
temp2[coord(1, 0)] = B * src[1][i] + b1 * temp2[coord(0, 0)] + b2 * src[0][i] + b3 * src[0][i];
temp2[coord(2, 0)] = B * src[2][i] + b1 * temp2[coord(1, 0)] + b2 * temp2[coord(0, 0)] + b3 * src[0][i];
for (int j = 3; j < H; j++) {
temp2[j][0] = B * src[j][i] + b1 * temp2[j - 1][0] + b2 * temp2[j - 2][0] + b3 * temp2[j - 3][0];
temp2[coord(j, 0)] = B * src[j][i] + b1 * temp2[coord(j - 1, 0)] + b2 * temp2[coord(j - 2, 0)] + b3 * temp2[coord(j - 3, 0)];
}
double temp2Hm1 = src[H - 1][i] + M[0][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[0][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[0][2] * (temp2[H - 3][0] - src[H - 1][i]);
double temp2H = src[H - 1][i] + M[1][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[1][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[1][2] * (temp2[H - 3][0] - src[H - 1][i]);
double temp2Hp1 = src[H - 1][i] + M[2][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[2][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[2][2] * (temp2[H - 3][0] - src[H - 1][i]);
double temp2Hm1 = src[H - 1][i] + M[0][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[0][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[0][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]);
double temp2H = src[H - 1][i] + M[1][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[1][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[1][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]);
double temp2Hp1 = src[H - 1][i] + M[2][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[2][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[2][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]);
dst[H - 1][i] = temp2[H - 1][0] = temp2Hm1;
dst[H - 2][i] = temp2[H - 2][0] = B * temp2[H - 2][0] + b1 * temp2[H - 1][0] + b2 * temp2H + b3 * temp2Hp1;
dst[H - 3][i] = temp2[H - 3][0] = B * temp2[H - 3][0] + b1 * temp2[H - 2][0] + b2 * temp2[H - 1][0] + b3 * temp2H;
dst[H - 1][i] = temp2[coord(H - 1, 0)] = temp2Hm1;
dst[H - 2][i] = temp2[coord(H - 2, 0)] = B * temp2[coord(H - 2, 0)] + b1 * temp2[coord(H - 1, 0)] + b2 * temp2H + b3 * temp2Hp1;
dst[H - 3][i] = temp2[coord(H - 3, 0)] = B * temp2[coord(H - 3, 0)] + b1 * temp2[coord(H - 2, 0)] + b2 * temp2[coord(H - 1, 0)] + b3 * temp2H;
for (int j = H - 4; j >= 0; j--) {
dst[j][i] = temp2[j][0] = B * temp2[j][0] + b1 * temp2[j + 1][0] + b2 * temp2[j + 2][0] + b3 * temp2[j + 3][0];
dst[j][i] = temp2[coord(j, 0)] = B * temp2[coord(j, 0)] + b1 * temp2[coord(j + 1, 0)] + b2 * temp2[coord(j + 2, 0)] + b3 * temp2[coord(j + 3, 0)];
}
}
}
@ -1208,40 +1214,45 @@ template<class T> void gaussVerticaldiv (T** src, T** dst, T** divBuffer, const
// process 'numcols' columns for better usage of L1 cpu cache (especially faster for large values of H)
static const int numcols = 8;
double temp2[H][numcols] ALIGNED16;
std::vector<double> temp2(H * numcols);
double temp2Hm1[numcols], temp2H[numcols], temp2Hp1[numcols];
auto coord =
[](const int &x, const int &y) -> int {
return x * numcols + y;
};
#ifdef _OPENMP
#pragma omp for nowait
#endif
for (int i = 0; i < W - numcols + 1; i += numcols) {
for (int k = 0; k < numcols; k++) {
temp2[0][k] = B * src[0][i + k] + b1 * src[0][i + k] + b2 * src[0][i + k] + b3 * src[0][i + k];
temp2[1][k] = B * src[1][i + k] + b1 * temp2[0][k] + b2 * src[0][i + k] + b3 * src[0][i + k];
temp2[2][k] = B * src[2][i + k] + b1 * temp2[1][k] + b2 * temp2[0][k] + b3 * src[0][i + k];
temp2[coord(0, k)] = B * src[0][i + k] + b1 * src[0][i + k] + b2 * src[0][i + k] + b3 * src[0][i + k];
temp2[coord(1, k)] = B * src[1][i + k] + b1 * temp2[coord(0, k)] + b2 * src[0][i + k] + b3 * src[0][i + k];
temp2[coord(2, k)] = B * src[2][i + k] + b1 * temp2[coord(1, k)] + b2 * temp2[coord(0, k)] + b3 * src[0][i + k];
}
for (int j = 3; j < H; j++) {
for (int k = 0; k < numcols; k++) {
temp2[j][k] = B * src[j][i + k] + b1 * temp2[j - 1][k] + b2 * temp2[j - 2][k] + b3 * temp2[j - 3][k];
temp2[coord(j, k)] = B * src[j][i + k] + b1 * temp2[coord(j - 1, k)] + b2 * temp2[coord(j - 2, k)] + b3 * temp2[coord(j - 3, k)];
}
}
for (int k = 0; k < numcols; k++) {
temp2Hm1[k] = src[H - 1][i + k] + M[0][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[0][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[0][2] * (temp2[H - 3][k] - src[H - 1][i + k]);
temp2H[k] = src[H - 1][i + k] + M[1][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[1][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[1][2] * (temp2[H - 3][k] - src[H - 1][i + k]);
temp2Hp1[k] = src[H - 1][i + k] + M[2][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[2][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[2][2] * (temp2[H - 3][k] - src[H - 1][i + k]);
temp2Hm1[k] = src[H - 1][i + k] + M[0][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[0][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[0][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]);
temp2H[k] = src[H - 1][i + k] + M[1][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[1][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[1][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]);
temp2Hp1[k] = src[H - 1][i + k] + M[2][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[2][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[2][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]);
}
for (int k = 0; k < numcols; k++) {
dst[H - 1][i + k] = rtengine::max(divBuffer[H - 1][i + k] / (temp2[H - 1][k] = temp2Hm1[k]), 0.0);
dst[H - 2][i + k] = rtengine::max(divBuffer[H - 2][i + k] / (temp2[H - 2][k] = B * temp2[H - 2][k] + b1 * temp2[H - 1][k] + b2 * temp2H[k] + b3 * temp2Hp1[k]), 0.0);
dst[H - 3][i + k] = rtengine::max(divBuffer[H - 3][i + k] / (temp2[H - 3][k] = B * temp2[H - 3][k] + b1 * temp2[H - 2][k] + b2 * temp2[H - 1][k] + b3 * temp2H[k]), 0.0);
dst[H - 1][i + k] = rtengine::max(divBuffer[H - 1][i + k] / (temp2[coord(H - 1, k)] = temp2Hm1[k]), 0.0);
dst[H - 2][i + k] = rtengine::max(divBuffer[H - 2][i + k] / (temp2[coord(H - 2, k)] = B * temp2[coord(H - 2, k)] + b1 * temp2[coord(H - 1, k)] + b2 * temp2H[k] + b3 * temp2Hp1[k]), 0.0);
dst[H - 3][i + k] = rtengine::max(divBuffer[H - 3][i + k] / (temp2[coord(H - 3, k)] = B * temp2[coord(H - 3, k)] + b1 * temp2[coord(H - 2, k)] + b2 * temp2[coord(H - 1, k)] + b3 * temp2H[k]), 0.0);
}
for (int j = H - 4; j >= 0; j--) {
for (int k = 0; k < numcols; k++) {
dst[j][i + k] = rtengine::max(divBuffer[j][i + k] / (temp2[j][k] = B * temp2[j][k] + b1 * temp2[j + 1][k] + b2 * temp2[j + 2][k] + b3 * temp2[j + 3][k]), 0.0);
dst[j][i + k] = rtengine::max(divBuffer[j][i + k] / (temp2[coord(j, k)] = B * temp2[coord(j, k)] + b1 * temp2[coord(j + 1, k)] + b2 * temp2[coord(j + 2, k)] + b3 * temp2[coord(j + 3, k)]), 0.0);
}
}
}
@ -1252,24 +1263,24 @@ template<class T> void gaussVerticaldiv (T** src, T** dst, T** divBuffer, const
// process remaining columns
for (int i = W - (W % numcols); i < W; i++) {
temp2[0][0] = B * src[0][i] + b1 * src[0][i] + b2 * src[0][i] + b3 * src[0][i];
temp2[1][0] = B * src[1][i] + b1 * temp2[0][0] + b2 * src[0][i] + b3 * src[0][i];
temp2[2][0] = B * src[2][i] + b1 * temp2[1][0] + b2 * temp2[0][0] + b3 * src[0][i];
temp2[coord(0, 0)] = B * src[0][i] + b1 * src[0][i] + b2 * src[0][i] + b3 * src[0][i];
temp2[coord(1, 0)] = B * src[1][i] + b1 * temp2[coord(0, 0)] + b2 * src[0][i] + b3 * src[0][i];
temp2[coord(2, 0)] = B * src[2][i] + b1 * temp2[coord(1, 0)] + b2 * temp2[coord(0, 0)] + b3 * src[0][i];
for (int j = 3; j < H; j++) {
temp2[j][0] = B * src[j][i] + b1 * temp2[j - 1][0] + b2 * temp2[j - 2][0] + b3 * temp2[j - 3][0];
temp2[coord(j, 0)] = B * src[j][i] + b1 * temp2[coord(j - 1, 0)] + b2 * temp2[coord(j - 2, 0)] + b3 * temp2[coord(j - 3, 0)];
}
double temp2Hm1 = src[H - 1][i] + M[0][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[0][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[0][2] * (temp2[H - 3][0] - src[H - 1][i]);
double temp2H = src[H - 1][i] + M[1][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[1][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[1][2] * (temp2[H - 3][0] - src[H - 1][i]);
double temp2Hp1 = src[H - 1][i] + M[2][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[2][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[2][2] * (temp2[H - 3][0] - src[H - 1][i]);
double temp2Hm1 = src[H - 1][i] + M[0][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[0][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[0][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]);
double temp2H = src[H - 1][i] + M[1][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[1][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[1][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]);
double temp2Hp1 = src[H - 1][i] + M[2][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[2][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[2][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]);
dst[H - 1][i] = rtengine::max(divBuffer[H - 1][i] / (temp2[H - 1][0] = temp2Hm1), 0.0);
dst[H - 2][i] = rtengine::max(divBuffer[H - 2][i] / (temp2[H - 2][0] = B * temp2[H - 2][0] + b1 * temp2[H - 1][0] + b2 * temp2H + b3 * temp2Hp1), 0.0);
dst[H - 3][i] = rtengine::max(divBuffer[H - 3][i] / (temp2[H - 3][0] = B * temp2[H - 3][0] + b1 * temp2[H - 2][0] + b2 * temp2[H - 1][0] + b3 * temp2H), 0.0);
dst[H - 1][i] = rtengine::max(divBuffer[H - 1][i] / (temp2[coord(H - 1, 0)] = temp2Hm1), 0.0);
dst[H - 2][i] = rtengine::max(divBuffer[H - 2][i] / (temp2[coord(H - 2, 0)] = B * temp2[coord(H - 2, 0)] + b1 * temp2[coord(H - 1, 0)] + b2 * temp2H + b3 * temp2Hp1), 0.0);
dst[H - 3][i] = rtengine::max(divBuffer[H - 3][i] / (temp2[coord(H - 3, 0)] = B * temp2[coord(H - 3, 0)] + b1 * temp2[coord(H - 2, 0)] + b2 * temp2[coord(H - 1, 0)] + b3 * temp2H), 0.0);
for (int j = H - 4; j >= 0; j--) {
dst[j][i] = rtengine::max(divBuffer[j][i] / (temp2[j][0] = B * temp2[j][0] + b1 * temp2[j + 1][0] + b2 * temp2[j + 2][0] + b3 * temp2[j + 3][0]), 0.0);
dst[j][i] = rtengine::max(divBuffer[j][i] / (temp2[coord(j, 0)] = B * temp2[coord(j, 0)] + b1 * temp2[coord(j + 1, 0)] + b2 * temp2[coord(j + 2, 0)] + b3 * temp2[coord(j + 3, 0)]), 0.0);
}
}
}
@ -1286,40 +1297,45 @@ template<class T> void gaussVerticalmult (T** src, T** dst, const int W, const i
// process 'numcols' columns for better usage of L1 cpu cache (especially faster for large values of H)
static const int numcols = 8;
double temp2[H][numcols] ALIGNED16;
std::vector<double> temp2(H * numcols);
double temp2Hm1[numcols], temp2H[numcols], temp2Hp1[numcols];
auto coord =
[](const int &x, const int &y) -> int {
return x * numcols + y;
};
#ifdef _OPENMP
#pragma omp for nowait
#endif
for (int i = 0; i < W - numcols + 1; i += numcols) {
for (int k = 0; k < numcols; k++) {
temp2[0][k] = B * src[0][i + k] + b1 * src[0][i + k] + b2 * src[0][i + k] + b3 * src[0][i + k];
temp2[1][k] = B * src[1][i + k] + b1 * temp2[0][k] + b2 * src[0][i + k] + b3 * src[0][i + k];
temp2[2][k] = B * src[2][i + k] + b1 * temp2[1][k] + b2 * temp2[0][k] + b3 * src[0][i + k];
temp2[coord(0, k)] = B * src[0][i + k] + b1 * src[0][i + k] + b2 * src[0][i + k] + b3 * src[0][i + k];
temp2[coord(1, k)] = B * src[1][i + k] + b1 * temp2[coord(0, k)] + b2 * src[0][i + k] + b3 * src[0][i + k];
temp2[coord(2, k)] = B * src[2][i + k] + b1 * temp2[coord(1, k)] + b2 * temp2[coord(0, k)] + b3 * src[0][i + k];
}
for (int j = 3; j < H; j++) {
for (int k = 0; k < numcols; k++) {
temp2[j][k] = B * src[j][i + k] + b1 * temp2[j - 1][k] + b2 * temp2[j - 2][k] + b3 * temp2[j - 3][k];
temp2[coord(j, k)] = B * src[j][i + k] + b1 * temp2[coord(j - 1, k)] + b2 * temp2[coord(j - 2, k)] + b3 * temp2[coord(j - 3, k)];
}
}
for (int k = 0; k < numcols; k++) {
temp2Hm1[k] = src[H - 1][i + k] + M[0][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[0][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[0][2] * (temp2[H - 3][k] - src[H - 1][i + k]);
temp2H[k] = src[H - 1][i + k] + M[1][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[1][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[1][2] * (temp2[H - 3][k] - src[H - 1][i + k]);
temp2Hp1[k] = src[H - 1][i + k] + M[2][0] * (temp2[H - 1][k] - src[H - 1][i + k]) + M[2][1] * (temp2[H - 2][k] - src[H - 1][i + k]) + M[2][2] * (temp2[H - 3][k] - src[H - 1][i + k]);
temp2Hm1[k] = src[H - 1][i + k] + M[0][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[0][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[0][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]);
temp2H[k] = src[H - 1][i + k] + M[1][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[1][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[1][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]);
temp2Hp1[k] = src[H - 1][i + k] + M[2][0] * (temp2[coord(H - 1, k)] - src[H - 1][i + k]) + M[2][1] * (temp2[coord(H - 2, k)] - src[H - 1][i + k]) + M[2][2] * (temp2[coord(H - 3, k)] - src[H - 1][i + k]);
}
for (int k = 0; k < numcols; k++) {
dst[H - 1][i + k] *= temp2[H - 1][k] = temp2Hm1[k];
dst[H - 2][i + k] *= temp2[H - 2][k] = B * temp2[H - 2][k] + b1 * temp2[H - 1][k] + b2 * temp2H[k] + b3 * temp2Hp1[k];
dst[H - 3][i + k] *= temp2[H - 3][k] = B * temp2[H - 3][k] + b1 * temp2[H - 2][k] + b2 * temp2[H - 1][k] + b3 * temp2H[k];
dst[H - 1][i + k] *= temp2[coord(H - 1, k)] = temp2Hm1[k];
dst[H - 2][i + k] *= temp2[coord(H - 2, k)] = B * temp2[coord(H - 2, k)] + b1 * temp2[coord(H - 1, k)] + b2 * temp2H[k] + b3 * temp2Hp1[k];
dst[H - 3][i + k] *= temp2[coord(H - 3, k)] = B * temp2[coord(H - 3, k)] + b1 * temp2[coord(H - 2, k)] + b2 * temp2[coord(H - 1, k)] + b3 * temp2H[k];
}
for (int j = H - 4; j >= 0; j--) {
for (int k = 0; k < numcols; k++) {
dst[j][i + k] *= (temp2[j][k] = B * temp2[j][k] + b1 * temp2[j + 1][k] + b2 * temp2[j + 2][k] + b3 * temp2[j + 3][k]);
dst[j][i + k] *= (temp2[coord(j, k)] = B * temp2[coord(j, k)] + b1 * temp2[coord(j + 1, k)] + b2 * temp2[coord(j + 2, k)] + b3 * temp2[coord(j + 3, k)]);
}
}
}
@ -1330,24 +1346,24 @@ template<class T> void gaussVerticalmult (T** src, T** dst, const int W, const i
// process remaining columns
for (int i = W - (W % numcols); i < W; i++) {
temp2[0][0] = B * src[0][i] + b1 * src[0][i] + b2 * src[0][i] + b3 * src[0][i];
temp2[1][0] = B * src[1][i] + b1 * temp2[0][0] + b2 * src[0][i] + b3 * src[0][i];
temp2[2][0] = B * src[2][i] + b1 * temp2[1][0] + b2 * temp2[0][0] + b3 * src[0][i];
temp2[coord(0, 0)] = B * src[0][i] + b1 * src[0][i] + b2 * src[0][i] + b3 * src[0][i];
temp2[coord(1, 0)] = B * src[1][i] + b1 * temp2[coord(0, 0)] + b2 * src[0][i] + b3 * src[0][i];
temp2[coord(2, 0)] = B * src[2][i] + b1 * temp2[coord(1, 0)] + b2 * temp2[coord(0, 0)] + b3 * src[0][i];
for (int j = 3; j < H; j++) {
temp2[j][0] = B * src[j][i] + b1 * temp2[j - 1][0] + b2 * temp2[j - 2][0] + b3 * temp2[j - 3][0];
temp2[coord(j, 0)] = B * src[j][i] + b1 * temp2[coord(j - 1, 0)] + b2 * temp2[coord(j - 2, 0)] + b3 * temp2[coord(j - 3, 0)];
}
double temp2Hm1 = src[H - 1][i] + M[0][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[0][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[0][2] * (temp2[H - 3][0] - src[H - 1][i]);
double temp2H = src[H - 1][i] + M[1][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[1][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[1][2] * (temp2[H - 3][0] - src[H - 1][i]);
double temp2Hp1 = src[H - 1][i] + M[2][0] * (temp2[H - 1][0] - src[H - 1][i]) + M[2][1] * (temp2[H - 2][0] - src[H - 1][i]) + M[2][2] * (temp2[H - 3][0] - src[H - 1][i]);
double temp2Hm1 = src[H - 1][i] + M[0][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[0][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[0][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]);
double temp2H = src[H - 1][i] + M[1][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[1][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[1][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]);
double temp2Hp1 = src[H - 1][i] + M[2][0] * (temp2[coord(H - 1, 0)] - src[H - 1][i]) + M[2][1] * (temp2[coord(H - 2, 0)] - src[H - 1][i]) + M[2][2] * (temp2[coord(H - 3, 0)] - src[H - 1][i]);
dst[H - 1][i] *= temp2[H - 1][0] = temp2Hm1;
dst[H - 2][i] *= temp2[H - 2][0] = B * temp2[H - 2][0] + b1 * temp2[H - 1][0] + b2 * temp2H + b3 * temp2Hp1;
dst[H - 3][i] *= temp2[H - 3][0] = B * temp2[H - 3][0] + b1 * temp2[H - 2][0] + b2 * temp2[H - 1][0] + b3 * temp2H;
dst[H - 1][i] *= temp2[coord(H - 1, 0)] = temp2Hm1;
dst[H - 2][i] *= temp2[coord(H - 2, 0)] = B * temp2[coord(H - 2, 0)] + b1 * temp2[coord(H - 1, 0)] + b2 * temp2H + b3 * temp2Hp1;
dst[H - 3][i] *= temp2[coord(H - 3, 0)] = B * temp2[coord(H - 3, 0)] + b1 * temp2[coord(H - 2, 0)] + b2 * temp2[coord(H - 1, 0)] + b3 * temp2H;
for (int j = H - 4; j >= 0; j--) {
dst[j][i] *= (temp2[j][0] = B * temp2[j][0] + b1 * temp2[j + 1][0] + b2 * temp2[j + 2][0] + b3 * temp2[j + 3][0]);
dst[j][i] *= (temp2[coord(j, 0)] = B * temp2[coord(j, 0)] + b1 * temp2[coord(j + 1, 0)] + b2 * temp2[coord(j + 2, 0)] + b3 * temp2[coord(j + 3, 0)]);
}
}
}

View File

@ -90,6 +90,19 @@ constexpr double ACESp0_xyz[3][3] = {
{0.00845768, -0.01403193, 1.21893277}
};
constexpr double xyz_jdcmax[3][3] = {//prim red 0.734702 0.265302 gr 0.021908 0.930288 bl 0.120593 0.001583
{0.8394088, 0.0163780, 0.1084133},
{0.3031122, 0.6954651, 0.0014227},
{-0.000048, 0.0357376, 0.7891671}
};
constexpr double jdcmax_xyz[3][3] = {
{1.1984508, -0.0197646, -0.1646037},
{-0.5223824, 1.4466349, 0.0691553},
{0.0236634, -0.0655113, 1.2640260}
};
constexpr double xyz_ACESp1[3][3] = {
{0.689697, 0.149944, 0.124559},
{0.284448, 0.671758 , 0.043794},

View File

@ -17,6 +17,7 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include <cstring>
#include <map>
#include <glibmm/ustring.h>
#include <glibmm/fileutils.h>
@ -195,9 +196,9 @@ cmsHPROFILE createXYZProfile()
return rtengine::ICCStore::createFromMatrix(mat, false, "XYZ");
}
const double(*wprofiles[])[3] = {xyz_sRGB, xyz_adobe, xyz_prophoto, xyz_widegamut, xyz_bruce, xyz_beta, xyz_best, xyz_rec2020, xyz_ACESp0, xyz_ACESp1};//
const double(*iwprofiles[])[3] = {sRGB_xyz, adobe_xyz, prophoto_xyz, widegamut_xyz, bruce_xyz, beta_xyz, best_xyz, rec2020_xyz, ACESp0_xyz, ACESp1_xyz};//
const char* wpnames[] = {"sRGB", "Adobe RGB", "ProPhoto", "WideGamut", "BruceRGB", "Beta RGB", "BestRGB", "Rec2020", "ACESp0", "ACESp1"};//
const double(*wprofiles[])[3] = {xyz_sRGB, xyz_adobe, xyz_prophoto, xyz_widegamut, xyz_jdcmax, xyz_beta, xyz_best, xyz_rec2020, xyz_ACESp0, xyz_ACESp1, xyz_bruce};//
const double(*iwprofiles[])[3] = {sRGB_xyz, adobe_xyz, prophoto_xyz, widegamut_xyz, jdcmax_xyz, beta_xyz, best_xyz, rec2020_xyz, ACESp0_xyz, ACESp1_xyz, bruce_xyz};//
const char* wpnames[] = {"sRGB", "Adobe RGB", "ProPhoto", "WideGamut", "JDCmax", "Beta RGB", "BestRGB", "Rec2020", "ACESp0", "ACESp1", "BruceRGB"};//
//default = gamma inside profile
//BT709 g=2.22 s=4.5 sRGB g=2.4 s=12.92310
//linear g=1.0
@ -454,6 +455,8 @@ public:
if (loadAll) {
loadProfiles(profilesDir, &fileProfiles, &fileProfileContents, nullptr, false);
loadProfiles(userICCDir, &fileProfiles, &fileProfileContents, nullptr, false);
Glib::ustring user_output_icc_dir = Glib::build_filename(options.rtdir, "iccprofiles", "output");
loadProfiles(user_output_icc_dir, &fileProfiles, &fileProfileContents, nullptr, false);
}
// Input profiles

View File

@ -111,7 +111,7 @@ public:
{
rm = gm = bm = 1.0;
}
virtual void getAutoWBMultipliersitc(double &tempref, double &greenref, double &tempitc, double &greenitc, float &studgood, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double &rm, double &gm, double &bm, const procparams::WBParams & wbpar, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp)
virtual void getAutoWBMultipliersitc(bool extra, double &tempref, double &greenref, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double &rm, double &gm, double &bm, const procparams::WBParams & wbpar, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp)
{
rm = gm = bm = 1.0;
}
@ -1858,7 +1858,7 @@ class IImage : virtual public ImageDimensions
public:
virtual ~IImage() {}
/** @brief Returns a mutex that can is useful in many situations. No image operations shuold be performed without locking this mutex.
/** @brief Returns a mutex that can is useful in many situations. No image operations should be performed without locking this mutex.
* @return The mutex */
virtual MyMutex& getMutex () = 0;
virtual cmsHPROFILE getProfile () const = 0;

View File

@ -341,6 +341,38 @@ void Imagefloat::getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* imag
#endif
}
// From ART.
void Imagefloat::multiply(float factor, bool multithread)
{
const int W = width;
const int H = height;
#ifdef __SSE2__
vfloat vfactor = F2V(factor);
#endif
#ifdef _OPENMP
# pragma omp parallel for firstprivate(W, H) schedule(dynamic, 5) if (multithread)
#endif
for (int y = 0; y < H; y++) {
int x = 0;
#ifdef __SSE2__
for (; x < W-3; x += 4) {
vfloat rv = LVF(r(y, x));
vfloat gv = LVF(g(y, x));
vfloat bv = LVF(b(y, x));
STVF(r(y, x), rv * vfactor);
STVF(g(y, x), gv * vfactor);
STVF(b(y, x), bv * vfactor);
}
#endif
for (; x < W; ++x) {
r(y, x) *= factor;
g(y, x) *= factor;
b(y, x) *= factor;
}
}
}
void Imagefloat::normalizeFloat(float srcMinVal, float srcMaxVal)
{
@ -362,43 +394,15 @@ void Imagefloat::normalizeFloat(float srcMinVal, float srcMaxVal)
}
// convert values's range to [0;1] ; this method assumes that the input values's range is [0;65535]
void Imagefloat::normalizeFloatTo1()
void Imagefloat::normalizeFloatTo1(bool multithread)
{
const int w = width;
const int h = height;
#ifdef _OPENMP
#pragma omp parallel for schedule(dynamic, 5)
#endif
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
r(y, x) /= 65535.f;
g(y, x) /= 65535.f;
b(y, x) /= 65535.f;
}
}
multiply(1.f/65535.f, multithread);
}
// convert values's range to [0;65535 ; this method assumes that the input values's range is [0;1]
void Imagefloat::normalizeFloatTo65535()
void Imagefloat::normalizeFloatTo65535(bool multithread)
{
const int w = width;
const int h = height;
#ifdef _OPENMP
#pragma omp parallel for schedule(dynamic, 5)
#endif
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
r(y, x) *= 65535.f;
g(y, x) *= 65535.f;
b(y, x) *= 65535.f;
}
}
multiply(65535.f, multithread);
}
// Parallelized transformation; create transform with cmsFLAGS_NOCACHE!

View File

@ -213,9 +213,10 @@ public:
return (uint32_t) ((lsign << 31) | (exponent << 23) | mantissa);
}
void multiply(float factor, bool multithread);
void normalizeFloat(float srcMinVal, float srcMaxVal) override;
void normalizeFloatTo1();
void normalizeFloatTo65535();
void normalizeFloatTo1(bool multithread=true);
void normalizeFloatTo65535(bool multithread=true);
void ExecCMSTransform(cmsHTRANSFORM hTransform);
void ExecCMSTransform(cmsHTRANSFORM hTransform, const LabImage &labImage, int cx, int cy);
};

View File

@ -117,10 +117,10 @@ public:
virtual void convertColorSpace (Imagefloat* image, const procparams::ColorManagementParams &cmp, const ColorTemp &wb) = 0; // DIRTY HACK: this method is derived in rawimagesource and strimagesource, but (...,RAWParams raw) will be used ONLY for raw images
virtual void getAutoWBMultipliers (double &rm, double &gm, double &bm) = 0;
virtual void getAutoWBMultipliersitc(double &tempref, double &greenref, double &tempitc, double & greenitc, float &studgood, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double &rm, double &gm, double &bm, const procparams::WBParams & wbpar, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) = 0;
virtual void getAutoWBMultipliersitc(bool extra, double &tempref, double &greenref, double &tempitc, double & greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double &rm, double &gm, double &bm, const procparams::WBParams & wbpar, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) = 0;
virtual ColorTemp getWB () const = 0;
virtual ColorTemp getSpotWB (std::vector<Coord2D> &red, std::vector<Coord2D> &green, std::vector<Coord2D> &blue, int tran, double equal, StandardObserver observer) = 0;
virtual void WBauto(double &tempref, double &greenref, array2D<float> &redloc, array2D<float> &greenloc, array2D<float> &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, double &tempitc, double &greenitc, float &studgood, bool &twotimes, const procparams::WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) = 0;
virtual void WBauto(bool extra, double &tempref, double &greenref, array2D<float> &redloc, array2D<float> &greenloc, array2D<float> &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, bool &twotimes, const procparams::WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) = 0;
virtual void getrgbloc(int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, const procparams::WBParams & wbpar) = 0;
virtual double getDefGain () const

File diff suppressed because it is too large Load Diff

View File

@ -74,6 +74,7 @@ protected:
ImageSource* imgsrc;
ColorTemp currWB;
ColorTemp currWBcust;
ColorTemp autoWB;
ColorTemp currWBloc;
ColorTemp autoWBloc;
@ -365,6 +366,7 @@ protected:
std::vector<float> stdtms;
std::vector<float> meanretis;
std::vector<float> stdretis;
bool lastspotdup;
bool previewDeltaE;
int locallColorMask;

View File

@ -1979,11 +1979,13 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
stop.reset(new StopWatch("rgb processing"));
}
Imagefloat *tmpImage = nullptr;
const bool split_tiled_parts_1_2 = params->toneEqualizer.enabled;
std::unique_ptr<Imagefloat> tmpImage;
Imagefloat* editImgFloat = nullptr;
PlanarWhateverData<float>* editWhatever = nullptr;
EditUniqueID editID = pipetteBuffer ? pipetteBuffer->getEditID() : EUID_None;
EditUniqueID editID = pipetteBuffer && pipetteBuffer->bufferCreated() ? pipetteBuffer->getEditID() : EUID_None;
if (editID != EUID_None) {
switch (pipetteBuffer->getDataProvider()->getCurrSubscriber()->getPipetteBufferType()) {
@ -2139,6 +2141,7 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
const float comp = (max(0.0, expcomp) + 1.0) * hlcompr / 100.0;
const float shoulder = ((65536.f / max(1.0f, exp_scale)) * (hlcomprthresh / 200.f)) + 0.1f;
const float hlrange = 65536.f - shoulder;
const int tone_curve_black = params->toneCurve.black;
const bool isProPhoto = (params->icm.workingProfile == "ProPhoto");
// extracting data from 'params' to avoid cache flush (to be confirmed)
ToneCurveMode curveMode = params->toneCurve.curveMode;
@ -2247,8 +2250,8 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
}
bool hasgammabw = gammabwr != 1.f || gammabwg != 1.f || gammabwb != 1.f;
if (hasColorToning || blackwhite || (params->dirpyrequalizer.cbdlMethod == "bef" && params->dirpyrequalizer.enabled)) {
tmpImage = new Imagefloat(working->getWidth(), working->getHeight());
if (hasColorToning || blackwhite || (params->dirpyrequalizer.cbdlMethod == "bef" && params->dirpyrequalizer.enabled) || split_tiled_parts_1_2) {
tmpImage.reset(new Imagefloat(working->getWidth(), working->getHeight()));
}
// For tonecurve histogram
@ -2263,9 +2266,53 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
// For tonecurve histogram
const float lumimulf[3] = {static_cast<float>(lumimul[0]), static_cast<float>(lumimul[1]), static_cast<float>(lumimul[2])};
#define TS 112
const auto tiled_part_1 =
[working,
mixchannels,
&hltonecurve, &shtonecurve,
chMixRR, chMixRG, chMixRB,
chMixGR, chMixGG, chMixGB,
chMixBR, chMixBG, chMixBB,
exp_scale, comp, hlrange, tone_curve_black](
int istart, int jstart, int tH, int tW,
float *rtemp, float *gtemp, float *btemp) {
for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) {
rtemp[ti * TS + tj] = working->r(i, j);
gtemp[ti * TS + tj] = working->g(i, j);
btemp[ti * TS + tj] = working->b(i, j);
}
}
if (mixchannels) {
for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) {
float r = rtemp[ti * TS + tj];
float g = gtemp[ti * TS + tj];
float b = btemp[ti * TS + tj];
// if (i==100 & j==100) printf("rgbProc input R= %f G= %f B= %f \n",r,g,b);
float rmix = (r * chMixRR + g * chMixRG + b * chMixRB) / 100.f;
float gmix = (r * chMixGR + g * chMixGG + b * chMixGB) / 100.f;
float bmix = (r * chMixBR + g * chMixBG + b * chMixBB) / 100.f;
rtemp[ti * TS + tj] = rmix;
gtemp[ti * TS + tj] = gmix;
btemp[ti * TS + tj] = bmix;
}
}
}
highlightToneCurve(hltonecurve, rtemp, gtemp, btemp, istart, tH, jstart, tW, TS, exp_scale, comp, hlrange);
if (tone_curve_black != 0) {
shadowToneCurve(shtonecurve, rtemp, gtemp, btemp, istart, tH, jstart, tW, TS);
}
};
#ifdef _OPENMP
#pragma omp parallel if (multiThread)
#endif
@ -2316,6 +2363,41 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
histToneCurveThr.clear();
}
if (split_tiled_parts_1_2) {
#ifdef _OPENMP
#pragma omp for schedule(dynamic, chunkSize) collapse(2)
#endif
for (int ii = 0; ii < working->getHeight(); ii += TS) {
for (int jj = 0; jj < working->getWidth(); jj += TS) {
istart = ii;
jstart = jj;
tH = min(ii + TS, working->getHeight());
tW = min(jj + TS, working->getWidth());
tiled_part_1(istart, jstart, tH, tW, rtemp, gtemp, btemp);
// Copy tile to image.
for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) {
tmpImage->r(i, j) = rtemp[ti * TS + tj];
tmpImage->g(i, j) = gtemp[ti * TS + tj];
tmpImage->b(i, j) = btemp[ti * TS + tj];
}
}
}
}
}
#ifdef _OPENMP
#pragma omp single
#endif
if (params->toneEqualizer.enabled) {
toneEqualizer(tmpImage.get());
}
#ifdef _OPENMP
#pragma omp for schedule(dynamic, chunkSize) collapse(2)
#endif
@ -2327,38 +2409,16 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
tH = min(ii + TS, working->getHeight());
tW = min(jj + TS, working->getWidth());
for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) {
rtemp[ti * TS + tj] = working->r(i, j);
gtemp[ti * TS + tj] = working->g(i, j);
btemp[ti * TS + tj] = working->b(i, j);
}
}
if (mixchannels) {
if (split_tiled_parts_1_2) {
for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) {
float r = rtemp[ti * TS + tj];
float g = gtemp[ti * TS + tj];
float b = btemp[ti * TS + tj];
//if (i==100 & j==100) printf("rgbProc input R= %f G= %f B= %f \n",r,g,b);
float rmix = (r * chMixRR + g * chMixRG + b * chMixRB) / 100.f;
float gmix = (r * chMixGR + g * chMixGG + b * chMixGB) / 100.f;
float bmix = (r * chMixBR + g * chMixBG + b * chMixBB) / 100.f;
rtemp[ti * TS + tj] = rmix;
gtemp[ti * TS + tj] = gmix;
btemp[ti * TS + tj] = bmix;
rtemp[ti * TS + tj] = tmpImage->r(i, j);
gtemp[ti * TS + tj] = tmpImage->g(i, j);
btemp[ti * TS + tj] = tmpImage->b(i, j);
}
}
}
highlightToneCurve(hltonecurve, rtemp, gtemp, btemp, istart, tH, jstart, tW, TS, exp_scale, comp, hlrange);
if (params->toneCurve.black != 0.0) {
shadowToneCurve(shtonecurve, rtemp, gtemp, btemp, istart, tH, jstart, tW, TS);
} else {
tiled_part_1(istart, jstart, tH, tW, rtemp, gtemp, btemp);
}
if (dcpProf) {
@ -3509,10 +3569,6 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
}
if (tmpImage) {
delete tmpImage;
}
if (hCurveEnabled) {
delete hCurve;
}
@ -4176,9 +4232,6 @@ void ImProcFunctions::chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW,
}
const float histLFactor = pW != 1 ? histLCurve.getSize() / 100.f : 1.f;
const float histCFactor = pW != 1 ? histCCurve.getSize() / 48000.f : 1.f;
float adjustr = 1.0f;
// if(params->labCurve.avoidclip ){
@ -4200,6 +4253,9 @@ void ImProcFunctions::chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW,
adjustr = 1.8f;
}
const float histLFactor = pW != 1 ? histLCurve.getSize() / 100.f : 1.f;
const float histCFactor = pW != 1 ? histCCurve.getSize() * adjustr / 65536.f : 1.f;
// reference to the params structure has to be done outside of the parallelization to avoid CPU cache problem
const bool highlight = params->toneCurve.hrenabled; //Get the value if "highlight reconstruction" is activated
const int chromaticity = params->labCurve.chromaticity;
@ -4359,11 +4415,11 @@ void ImProcFunctions::chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW,
if (editPipette) {
if (editID == EUID_Lab_aCurve) { // Lab a pipette
float chromapipa = lold->a[i][j] + (32768.f * 1.28f);
editWhatever->v(i, j) = LIM01<float> ((chromapipa) / (65536.f * 1.28f));
float chromapipa = lold->a[i][j] + 32768.f;
editWhatever->v(i, j) = LIM01<float> ((chromapipa) / (65536.f));
} else if (editID == EUID_Lab_bCurve) { //Lab b pipette
float chromapipb = lold->b[i][j] + (32768.f * 1.28f);
editWhatever->v(i, j) = LIM01<float> ((chromapipb) / (65536.f * 1.28f));
float chromapipb = lold->b[i][j] + 32768.f;
editWhatever->v(i, j) = LIM01<float> ((chromapipb) / (65536.f));
}
}
@ -4602,7 +4658,7 @@ void ImProcFunctions::chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW,
// I have placed C=f(C) after all C treatments to assure maximum amplitude of "C"
if (editPipette && editID == EUID_Lab_CCurve) {
float chromapip = sqrt(SQR(atmp) + SQR(btmp) + 0.001f);
editWhatever->v(i, j) = LIM01<float> ((chromapip) / (48000.f));
editWhatever->v(i, j) = LIM01<float> ((chromapip) / (65536.f / adjustr));
}//Lab C=f(C) pipette
if (ccut) {
@ -4669,7 +4725,7 @@ void ImProcFunctions::chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW,
if (editPipette && editID == EUID_Lab_LCCurve) {
float chromapiplc = sqrt(SQR(atmp) + SQR(btmp) + 0.001f);
editWhatever->v(i, j) = LIM01<float> ((chromapiplc) / (48000.f));
editWhatever->v(i, j) = LIM01<float> ((chromapiplc) / (65536.f / adjustr));
}//Lab L=f(C) pipette
@ -5667,6 +5723,11 @@ void ImProcFunctions::rgb2lab(const Imagefloat &src, LabImage &dst, const Glib::
}
void ImProcFunctions::rgb2lab(const Image8 &src, int x, int y, int w, int h, float L[], float a[], float b[], const procparams::ColorManagementParams &icm, bool consider_histogram_settings) const
{
rgb2lab(src, x, y, w, h, L, a, b, icm, consider_histogram_settings, multiThread);
}
void ImProcFunctions::rgb2lab(const Image8 &src, int x, int y, int w, int h, float L[], float a[], float b[], const procparams::ColorManagementParams &icm, bool consider_histogram_settings, bool multiThread)
{
// Adapted from ImProcFunctions::lab2rgb
const int src_width = src.getWidth();
@ -5779,6 +5840,21 @@ void ImProcFunctions::rgb2lab(const Image8 &src, int x, int y, int w, int h, flo
}
}
void ImProcFunctions::rgb2lab(std::uint8_t red, std::uint8_t green, std::uint8_t blue, float &L, float &a, float &b, const procparams::ColorManagementParams &icm, bool consider_histogram_settings)
{
float l_channel[1];
float a_channel[1];
float b_channel[1];
rtengine::Image8 buf(1, 1);
buf.r(0, 0) = red;
buf.g(0, 0) = green;
buf.b(0, 0) = blue;
ImProcFunctions::rgb2lab(buf, 0, 0, 1, 1, l_channel, a_channel, b_channel, icm, consider_histogram_settings, false);
L = l_channel[0];
a = a_channel[0];
b = b_channel[0];
}
void ImProcFunctions::lab2rgb(const LabImage &src, Imagefloat &dst, const Glib::ustring &workingSpace)
{
TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(workingSpace);

View File

@ -97,6 +97,7 @@ struct LocalContrastParams;
struct LocallabParams;
struct SharpeningParams;
struct SoftLightParams;
struct ToneEqualizerParams;
struct VibranceParams;
struct VignettingParams;
struct WaveletParams;
@ -116,6 +117,7 @@ class ImProcFunctions
bool multiThread;
void calcVignettingParams(int oW, int oH, const procparams::VignettingParams& vignetting, double &w2, double &h2, double& maxRadius, double &v, double &b, double &mul);
static void rgb2lab(const Image8 &src, int x, int y, int w, int h, float L[], float a[], float b[], const procparams::ColorManagementParams &icm, bool consider_histogram_settings, bool multithread);
void transformLuminanceOnly(Imagefloat* original, Imagefloat* transformed, int cx, int cy, int oW, int oH, int fW, int fH);
void transformGeneral(bool highQuality, Imagefloat *original, Imagefloat *transformed, int cx, int cy, int sx, int sy, int oW, int oH, int fW, int fH, const LensCorrection *pLCPMap, bool useOriginalBuffer);
@ -360,7 +362,8 @@ enum class BlurType {
double& huerefblur, double &chromarefblur, double& lumarefblur, double &hueref, double &chromaref, double &lumaref, double &sobelref, int &lastsav,
bool prevDeltaE, int llColorMask, int llColorMaskinv, int llExpMask, int llExpMaskinv, int llSHMask, int llSHMaskinv, int llvibMask, int lllcMask, int llsharMask, int llcbMask, int llretiMask, int llsoftMask, int lltmMask, int llblMask, int lllogMask, int ll_Mask, int llcieMask,
float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax,
float& meantm, float& stdtm, float& meanreti, float& stdreti, float &fab);
float& meantm, float& stdtm, float& meanreti, float& stdreti, float &fab,
float &highresi, float &nresi, float &highresi46, float &nresi46, float &Lhighresi, float &Lnresi, float &Lhighresi46, float &Lnresi46);
void addGaNoise(LabImage *lab, LabImage *dst, const float mean, const float variance, const int sk);
void BlurNoise_Localold(int call, const struct local_params& lp, LabImage* original, LabImage* transformed, const LabImage* const tmp1, int cx, int cy);
@ -399,7 +402,8 @@ enum class BlurType {
void DeNoise_Local(int call, const struct local_params& lp, LabImage* originalmask, int levred, float hueref, float lumaref, float chromaref, LabImage* original, LabImage* transformed, const LabImage &tmp1, int cx, int cy, int sk);
void DeNoise_Local2(const struct local_params& lp, LabImage* originalmask, int levred, float hueref, float lumaref, float chromaref, LabImage* original, LabImage* transformed, const LabImage &tmp1, int cx, int cy, int sk);
void DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params& lp, LabImage* originalmaskbl, LabImage * bufmaskblurbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage* original, LabImage* transformed, int cx, int cy, int sk, const LocwavCurve& locwavCurvehue, bool locwavhueutili);
void DeNoise(int call, int aut, bool noiscfactiv, const struct local_params& lp, LabImage* originalmaskbl, LabImage * bufmaskblurbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage* original, LabImage* transformed,
int cx, int cy, int sk, const LocwavCurve& locwavCurvehue, bool locwavhueutili, float& highresi, float& nresi, float& highresi46, float& nresi46, float& Lhighresi, float& Lnresi, float& Lhighresi46, float& Lnresi46);
void fftw_denoise(int sk, int GW, int GH, int max_numblox_W, int min_numblox_W, float **tmp1, array2D<float> *Lin, int numThreads, const struct local_params & lp, int chrom);
@ -436,7 +440,7 @@ enum class BlurType {
void Sigma(const float* HH_Coeffs, int datalen, float averagePlus, float averageNeg, float &sigmaPlus, float &sigmaNeg, int numThreads);
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);
static 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);
void RGB_denoise(int kall, Imagefloat * src, Imagefloat * dst, Imagefloat * calclum, float * ch_M, float *max_r, float *max_b, bool isRAW, const procparams::DirPyrDenoiseParams & dnparams, const double expcomp, const NoiseCurve & noiseLCurve, const NoiseCurve & noiseCCurve, float &nresi, float &highresi);
void RGB_denoise_infoGamCurve(const procparams::DirPyrDenoiseParams & dnparams, const bool isRAW, LUTf &gamcurve, float &gam, float &gamthresh, float &gamslope);
@ -462,7 +466,7 @@ enum class BlurType {
void ShrinkAll_info(const float* const* WavCoeffs_a, const float* const* WavCoeffs_b,
int W_ab, int H_ab, float **noisevarlum, float **noisevarchrom, float **noisevarhue, float &chaut, int &Nb, float &redaut, float &blueaut, float &maxredaut, float &maxblueaut, float &minredaut, float &minblueaut, int schoice, int lvl, float &chromina, float &sigma, float &lumema, float &sigma_L, float &redyel, float &skinc, float &nsknc,
float &maxchred, float &maxchblue, float &minchred, float &minchblue, int &nb, float &chau, float &chred, float &chblue, bool denoiseMethodRgb);
void Noise_residualAB(const wavelet_decomposition &WaveletCoeffs_ab, float &chresid, float &chmaxresid, bool denoiseMethodRgb);
void Noise_residualAB(const wavelet_decomposition &WaveletCoeffs_ab, float &chresid, float &chmaxresid, bool denoiseMethodRgb, int beg, int end);
void calcautodn_info(float &chaut, float &delta, int Nb, int levaut, float maxmax, float lumema, float chromina, int mode, int lissage, float redyel, float skinc, float nsknc);
float Mad(const float * DataList, int datalen);
float MadRgb(const float * DataList, int datalen);
@ -491,12 +495,14 @@ enum class BlurType {
void colorToningLabGrid(LabImage *lab, int xstart, int xend, int ystart, int yend, bool MultiThread);
//void shadowsHighlights(LabImage *lab);
void shadowsHighlights(LabImage *lab, bool ena, int labmode, int hightli, int shado, int rad, int scal, int hltonal, int shtonal);
void toneEqualizer(Imagefloat *rgb);
void toneEqualizer(Imagefloat *rgb, const procparams::ToneEqualizerParams &params, const Glib::ustring &workingProfile, double scale, bool multiThread);
void softLight(LabImage *lab, const procparams::SoftLightParams &softLightParams);
void labColorCorrectionRegions(LabImage *lab);
Image8* lab2rgb(LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm, bool consider_histogram_settings = true);
void rgb2lab(const Image8 &src, int x, int y, int w, int h, float L[], float a[], float b[], const procparams::ColorManagementParams &icm, bool consider_histogram_settings = true) const;
static void rgb2lab(std::uint8_t red, std::uint8_t green, std::uint8_t blue, float &L, float &a, float &b, const procparams::ColorManagementParams &icm, bool consider_histogram_settings = true);
Imagefloat* lab2rgbOut(LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm);
// CieImage *ciec;
void workingtrc(const Imagefloat* src, Imagefloat* dst, int cw, int ch, int mul, Glib::ustring &profile, double gampos, double slpos, int &illum, int prim, cmsHTRANSFORM &transform, bool normalizeIn = true, bool normalizeOut = true, bool keepTransForm = false) const;

View File

@ -17,7 +17,8 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include <fftw3.h>
#include "../rtgui/profilestorecombobox.h"
#include <glibmm/miscutils.h>
#include <glibmm/ustring.h>
#include "color.h"
#include "rtengine.h"
#include "iccstore.h"

View File

@ -434,7 +434,7 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
}
};
if (profile == "sRGB" || profile == "Adobe RGB" || profile == "ProPhoto" || profile == "WideGamut" || profile == "BruceRGB" || profile == "Beta RGB" || profile == "BestRGB" || profile == "Rec2020" || profile == "ACESp0" || profile == "ACESp1") {
if (profile == "sRGB" || profile == "Adobe RGB" || profile == "ProPhoto" || profile == "WideGamut" || profile == "BruceRGB" || profile == "Beta RGB" || profile == "BestRGB" || profile == "Rec2020" || profile == "ACESp0" || profile == "ACESp1" || profile == "JDCmax") {
if (settings->verbose) {
printf("Profile=%s\n", profile.c_str());
}
@ -509,7 +509,7 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
float greyy = params->icm.grey;
float epsil = 0.0001f;
if (prim == 12) {//convert datas area to xy
if (prim == 13) {//convert datas area to xy
float redgraphx = params->icm.labgridcieALow;
float redgraphy = params->icm.labgridcieBLow;
float blugraphx = params->icm.labgridcieAHigh;
@ -597,6 +597,12 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
}
case ColorManagementParams::Primaries::ACES_P0: {
profile = "ACESp0";
break;
}
case ColorManagementParams::Primaries::JDC_MAX: {
profile = "JDCmax";
break;
}
@ -754,6 +760,17 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw,
Wx = 0.952646075;
Wz = 1.008825184;
} else if (profile == "JDCmax") {
p[0] = 0.734702; // JDC max primaries
p[1] = 0.265302;
p[2] = 0.021908;
p[3] = 0.930288;
p[4] = 0.120593;
p[5] = 0.001583;
illum = toUnderlying(ColorManagementParams::Illuminant::D50);
Wx = 0.964295676;
Wz = 0.825104603;
} else if (profile == "ACESp1") {
p[0] = 0.713; // ACES P1 primaries
p[1] = 0.293;

File diff suppressed because it is too large Load Diff

373
rtengine/iptoneequalizer.cc Normal file
View File

@ -0,0 +1,373 @@
#include "color.h"
#include "guidedfilter.h"
#include "iccstore.h"
#include "imagefloat.h"
#include "improcfun.h"
#include "sleef.h"
#include "StopWatch.h"
namespace
{
const std::vector<std::array<float, 3>> colormap = {
{0.5f, 0.f, 0.5f},
{0.5f, 0.f, 0.5f},
{0.5f, 0.f, 0.5f},
{0.5f, 0.f, 0.5f},
{0.5f, 0.f, 0.5f}, // blacks
{0.f, 0.f, 1.f}, // shadows
{0.5f, 0.5f, 0.5f}, // midtones
{1.f, 1.f, 0.f}, // highlights
{1.f, 0.f, 0.f}, // whites
{1.f, 0.f, 0.f},
{1.f, 0.f, 0.f},
{1.f, 0.f, 0.f}
};
void toneEqualizer(
array2D<float> &R, array2D<float> &G, array2D<float> &B,
const rtengine::ToneEqualizerParams &params,
const Glib::ustring &workingProfile,
double scale,
bool multithread)
// adapted from the tone equalizer of darktable
/*
Copyright 2019 Alberto Griggio <alberto.griggio@gmail.com>
Small adaptation to Local Adjustment 10 2019 Jacques Desmis <jdesmis@gmail.com>
This file is part of darktable,
copyright (c) 2018 Aurelien Pierre.
darktable is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
darktable is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with darktable. If not, see <http://www.gnu.org/licenses/>.
*/
{
// BENCHFUN
const int W = R.getWidth();
const int H = R.getHeight();
array2D<float> Y(W, H);
const auto log2 =
[](float x) -> float {
static const float l2 = xlogf(2);
return xlogf(x) / l2;
};
const auto exp2 =
[](float x) -> float {
return pow_F(2.f, x);
};
// Build the luma channels: band-pass filters with gaussian windows of
// std 2 EV, spaced by 2 EV
const float centers[12] = {
-16.0f, -14.0f, -12.0f, -10.0f, -8.0f, -6.0f,
-4.0f, -2.0f, 0.0f, 2.0f, 4.0f, 6.0f
};
const auto conv = [&](int v, float lo, float hi) -> float {
const float f = v < 0 ? lo : hi;
return exp2(float(v) / 100.f * f);
};
const float factors[12] = {
conv(params.bands[0], 2.f, 3.f), // -16 EV
conv(params.bands[0], 2.f, 3.f), // -14 EV
conv(params.bands[0], 2.f, 3.f), // -12 EV
conv(params.bands[0], 2.f, 3.f), // -10 EV
conv(params.bands[0], 2.f, 3.f), // -8 EV
conv(params.bands[1], 2.f, 3.f), // -6 EV
conv(params.bands[2], 2.5f, 2.5f), // -4 EV
conv(params.bands[3], 3.f, 2.f), // -2 EV
conv(params.bands[4], 3.f, 2.f), // 0 EV
conv(params.bands[4], 3.f, 2.f), // 2 EV
conv(params.bands[4], 3.f, 2.f), // 4 EV
conv(params.bands[4], 3.f, 2.f) // 6 EV
};
rtengine::TMatrix ws = rtengine::ICCStore::getInstance()->workingSpaceMatrix(workingProfile);
#ifdef _OPENMP
#pragma omp parallel for if (multithread)
#endif
for (int y = 0; y < H; ++y) {
for (int x = 0; x < W; ++x) {
Y[y][x] = rtengine::Color::rgbLuminance(R[y][x], G[y][x], B[y][x], ws);
}
}
int detail = rtengine::LIM(params.regularization + 5, 0, 5);
int radius = detail / scale + 0.5;
float epsilon2 = 0.01f + 0.002f * rtengine::max(detail - 3, 0);
if (radius > 0) {
rtengine::guidedFilterLog(10.f, Y, radius, epsilon2, multithread);
}
if (params.regularization > 0) {
array2D<float> Y2(W, H);
constexpr float base_epsilon = 0.02f;
constexpr float base_posterization = 5.f;
#ifdef _OPENMP
#pragma omp parallel for if (multithread)
#endif
for (int y = 0; y < H; ++y) {
for (int x = 0; x < W; ++x) {
float l = rtengine::LIM(log2(rtengine::max(Y[y][x], 1e-9f)), centers[0], centers[11]);
float ll = round(l * base_posterization) / base_posterization;
Y2[y][x] = Y[y][x];
Y[y][x] = exp2(ll);
}
}
radius = 350.0 / scale;
epsilon2 = base_epsilon / float(6 - rtengine::min(params.regularization, 5));
rtengine::guidedFilter(Y2, Y, Y, radius, epsilon2, multithread);
}
const auto gauss =
[](float b, float x) -> float {
return xexpf((-rtengine::SQR(x - b) / 4.0f));
};
// For every pixel luminance, the sum of the gaussian masks
float w_sum = 0.f;
for (int i = 0; i < 12; ++i) {
w_sum += gauss(centers[i], 0.f);
}
constexpr float luma_lo = -14.f;
constexpr float luma_hi = 4.f;
const auto process_pixel =
[&](float y) -> float {
// convert to log space
const float luma = rtengine::LIM(log2(rtengine::max(y, 0.f)), luma_lo, luma_hi);
// build the correction as the sum of the contribution of each
// luminance channel to current pixel
float correction = 0.0f;
for (int c = 0; c < 12; ++c)
{
correction += gauss(centers[c], luma) * factors[c];
}
correction /= w_sum;
return correction;
};
std::vector<std::array<float, 3>> cur_colormap;
if (params.show_colormap) {
rtengine::lcmsMutex->lock();
cmsHPROFILE in = rtengine::ICCStore::getInstance()->getsRGBProfile();
cmsHPROFILE out = rtengine::ICCStore::getInstance()->workingSpace(workingProfile);
cmsHTRANSFORM xform = cmsCreateTransform(in, TYPE_RGB_FLT, out, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE);
rtengine::lcmsMutex->unlock();
for (auto &c : colormap) {
cur_colormap.push_back(c);
auto &cc = cur_colormap.back();
cmsDoTransform(xform, &cc[0], &cc[0], 1);
}
cmsDeleteTransform(xform);
}
const auto process_colormap =
[&](float y) -> std::array<float, 3>
{
std::array<float, 3> ret = { 0.f, 0.f, 0.f };
// convert to log space
const float luma = rtengine::LIM(log2(rtengine::max(y, 0.f)), luma_lo, luma_hi);
// build the correction as the sum of the contribution of each
// luminance channel to current pixel
for (int c = 0; c < 12; ++c) {
float w = gauss(centers[c], luma);
for (int i = 0; i < 3; ++i) {
ret[i] += w * cur_colormap[c][i];
}
}
for (int i = 0; i < 3; ++i) {
ret[i] = rtengine::LIM01(ret[i] / w_sum);
}
return ret;
};
#ifdef __SSE2__
vfloat vfactors[12];
vfloat vcenters[12];
for (int i = 0; i < 12; ++i) {
vfactors[i] = F2V(factors[i]);
vcenters[i] = F2V(centers[i]);
}
const auto vgauss =
[](vfloat b, vfloat x) -> vfloat {
static const vfloat fourv = F2V(4.f);
return xexpf((-rtengine::SQR(x - b) / fourv));
};
vfloat zerov = F2V(0.f);
vfloat vw_sum = F2V(w_sum);
const vfloat vluma_lo = F2V(luma_lo);
const vfloat vluma_hi = F2V(luma_hi);
const vfloat xlog2v = F2V(xlogf(2.f));
const auto vprocess_pixel =
[&](vfloat y) -> vfloat {
const vfloat luma = vminf(vmaxf(xlogf(vmaxf(y, zerov)) / xlog2v, vluma_lo), vluma_hi);
vfloat correction = zerov;
for (int c = 0; c < 12; ++c)
{
correction += vgauss(vcenters[c], luma) * vfactors[c];
}
correction /= vw_sum;
return correction;
};
vfloat v1 = F2V(1.f);
vfloat v65535 = F2V(65535.f);
#endif // __SSE2__
if (params.show_colormap) {
LUTf lut_r(65537), lut_g(65537), lut_b(65537);
for (int i = 0; i < 65536; ++i) {
float y = float(i)/65535.f;
auto rgb = process_colormap(y);
lut_r[i] = rgb[0];
lut_g[i] = rgb[1];
lut_b[i] = rgb[2];
}
lut_r[65536] = cur_colormap.back()[0];
lut_g[65536] = cur_colormap.back()[1];
lut_b[65536] = cur_colormap.back()[2];
#ifdef _OPENMP
# pragma omp parallel for if (multithread)
#endif
for (int y = 0; y < H; ++y) {
for (int x = 0; x < W; ++x) {
float cY = Y[y][x] * 65535.f;
R[y][x] = lut_r[cY];
G[y][x] = lut_g[cY];
B[y][x] = lut_b[cY];
}
}
return;
}
LUTf lut(65536);
for (int i = 0; i < 65536; ++i) {
float y = float(i) / 65535.f;
float c = process_pixel(y);
lut[i] = c;
}
#ifdef _OPENMP
#pragma omp parallel for if (multithread)
#endif
for (int y = 0; y < H; ++y) {
int x = 0;
#ifdef __SSE2__
for (; x < W - 3; x += 4) {
vfloat cY = LVFU(Y[y][x]);
vmask m = vmaskf_gt(cY, v1);
vfloat corr;
if (_mm_movemask_ps((vfloat)m)) {
corr = vprocess_pixel(cY);
} else {
corr = lut[cY * v65535];
}
STVF(R[y][x], LVF(R[y][x]) * corr);
STVF(G[y][x], LVF(G[y][x]) * corr);
STVF(B[y][x], LVF(B[y][x]) * corr);
}
#endif // __SSE2__
for (; x < W; ++x) {
float cY = Y[y][x];
float corr = cY > 1.f ? process_pixel(cY) : lut[cY * 65535.f];
R[y][x] *= corr;
G[y][x] *= corr;
B[y][x] *= corr;
}
}
}
}
namespace rtengine
{
void ImProcFunctions::toneEqualizer(
Imagefloat *rgb,
const ToneEqualizerParams &params,
const Glib::ustring &workingProfile,
double scale,
bool multiThread)
{
if (!params.enabled) {
return;
}
BENCHFUN
const float gain = 1.f / 65535.f * std::pow(2.f, -params.pivot);
rgb->multiply(gain, multiThread);
const int W = rgb->getWidth();
const int H = rgb->getHeight();
array2D<float> R(W, H, rgb->r.ptrs, ARRAY2D_BYREFERENCE);
array2D<float> G(W, H, rgb->g.ptrs, ARRAY2D_BYREFERENCE);
array2D<float> B(W, H, rgb->b.ptrs, ARRAY2D_BYREFERENCE);
::toneEqualizer(R, G, B, params, workingProfile, scale, multiThread);
rgb->multiply(params.show_colormap ? 65535.f : 1.f/gain, multiThread);
}
void ImProcFunctions::toneEqualizer(Imagefloat *rgb)
{
toneEqualizer(rgb, params->toneEqualizer, params->icm.workingProfile, scale, multiThread);
}
}

View File

@ -2270,7 +2270,7 @@ void ImProcFunctions::Aver(const float* RESTRICT DataList, int datalen, float &a
int countP = 0, countN = 0;
double averaP = 0.0, averaN = 0.0; // use double precision for large summations
constexpr float thres = 32.7f;//different fom zero to take into account only data large enough 32.7 = 0.1 in range 0..100 very low value
constexpr float thres = 32.7f;//different from zero to take into account only data large enough 32.7 = 0.1 in range 0..100 very low value
max = 0.f;
min = RT_INFINITY_F;
#ifdef _OPENMP
@ -2322,7 +2322,7 @@ void ImProcFunctions::Sigma(const float* RESTRICT DataList, int datalen, float a
{
int countP = 0, countN = 0;
double variP = 0.0, variN = 0.0; // use double precision for large summations
float thres = 32.7f;//different fom zero to take into account only data large enough 32.7 = 0.1 in range 0..100
float thres = 32.7f;//different from zero to take into account only data large enough 32.7 = 0.1 in range 0..100
#ifdef _OPENMP
#pragma omp parallel for reduction(+:variP,variN,countP,countN) num_threads(numThreads) if (numThreads>1)

View File

@ -275,7 +275,11 @@ int PDAFLinesFilter::mark(const array2D<float> &rawData, PixelsMap &bpMap)
for (int y = 1; y < H_-1; ++y) {
int yy = pattern_[idx] + off;
if (y == yy) {
int n = markLine(rawData, bpMap, y) + markLine(rawData, bpMap, y-1) + markLine(rawData, bpMap, y+1);
int n = 0;
n += markLine(rawData, bpMap, y);
n += (y-1 <= 0 ) ? 0 : markLine(rawData, bpMap, y-1);
n += (y+1 >= H_-1) ? 0 : markLine(rawData, bpMap, y+1);
if (n) {
found += n;
if (settings->verbose) {

View File

@ -1410,16 +1410,12 @@ WBParams::WBParams() :
equal(1.0),
tempBias(0.0),
observer(ColorTemp::DEFAULT_OBSERVER),
itcwb_thres(34),
itcwb_precis(3),
itcwb_size(3),
itcwb_delta(2),
itcwb_fgreen(5),
itcwb_rgreen(1),
itcwb_nopurple(true),
itcwb_sorted(false),
itcwb_forceextra(false),
itcwb_sampling(false)
itcwb_green(0.),//slider
itcwb_rgreen(1),//keep for settings
itcwb_nopurple(false),//keep for settings
itcwb_alg(false),//checkbox
itcwb_prim("beta"),//combobox
itcwb_sampling(false)//keep for 5.9 and for settings
{
}
@ -1441,6 +1437,10 @@ bool WBParams::isPanningRelatedChange(const WBParams& other) const
&& equal == other.equal
&& tempBias == other.tempBias
&& observer == other.observer
&& itcwb_green == other.itcwb_green
&& itcwb_prim == other.itcwb_prim
&& itcwb_alg == other.itcwb_alg
)
)
);
@ -1456,15 +1456,11 @@ bool WBParams::operator ==(const WBParams& other) const
&& equal == other.equal
&& tempBias == other.tempBias
&& observer == other.observer
&& itcwb_thres == other.itcwb_thres
&& itcwb_precis == other.itcwb_precis
&& itcwb_size == other.itcwb_size
&& itcwb_delta == other.itcwb_delta
&& itcwb_fgreen == other.itcwb_fgreen
&& itcwb_green == other.itcwb_green
&& itcwb_rgreen == other.itcwb_rgreen
&& itcwb_nopurple == other.itcwb_nopurple
&& itcwb_sorted == other.itcwb_sorted
&& itcwb_forceextra == other.itcwb_forceextra
&& itcwb_alg == other.itcwb_alg
&& itcwb_prim == other.itcwb_prim
&& itcwb_sampling == other.itcwb_sampling;
}
@ -1889,6 +1885,30 @@ bool SHParams::operator !=(const SHParams& other) const
return !(*this == other);
}
ToneEqualizerParams::ToneEqualizerParams() :
enabled(false),
bands{0, 0, 0, 0, 0},
regularization(0),
show_colormap(false),
pivot(0)
{
}
bool ToneEqualizerParams::operator ==(const ToneEqualizerParams &other) const
{
return
enabled == other.enabled
&& bands == other.bands
&& regularization == other.regularization
&& show_colormap == other.show_colormap
&& pivot == other.pivot;
}
bool ToneEqualizerParams::operator !=(const ToneEqualizerParams &other) const
{
return !(*this == other);
}
CropParams::CropParams() :
enabled(false),
x(-1),
@ -3404,6 +3424,7 @@ LocallabParams::LocallabSpot::LocallabSpot() :
slomaskSH(0.0),
lapmaskSH(0.0),
detailSH(0),
tePivot(0.),
reparsh(100.),
LmaskSHcurve{
static_cast<double>(DCT_NURBS),
@ -4848,6 +4869,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
&& slomaskSH == other.slomaskSH
&& lapmaskSH == other.lapmaskSH
&& detailSH == other.detailSH
&& tePivot == other.tePivot
&& reparsh == other.reparsh
&& LmaskSHcurve == other.LmaskSHcurve
&& fatamountSH == other.fatamountSH
@ -5994,6 +6016,8 @@ void ProcParams::setDefaults()
sh = {};
toneEqualizer = {};
crop = {};
coarse = {};
@ -6288,15 +6312,11 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->wb.equal, "White Balance", "Equal", wb.equal, keyFile);
saveToKeyfile(!pedited || pedited->wb.tempBias, "White Balance", "TemperatureBias", wb.tempBias, keyFile);
saveToKeyfile(!pedited || pedited->wb.observer, "White Balance", "StandardObserver", Glib::ustring(wb.observer == StandardObserver::TWO_DEGREES ? "TWO_DEGREES" : "TEN_DEGREES"), keyFile);
saveToKeyfile(!pedited || pedited->wb.itcwb_thres, "White Balance", "Itcwb_thres", wb.itcwb_thres, keyFile);
saveToKeyfile(!pedited || pedited->wb.itcwb_precis, "White Balance", "Itcwb_precis", wb.itcwb_precis, keyFile);
saveToKeyfile(!pedited || pedited->wb.itcwb_size, "White Balance", "Itcwb_size", wb.itcwb_size, keyFile);
saveToKeyfile(!pedited || pedited->wb.itcwb_delta, "White Balance", "Itcwb_delta", wb.itcwb_delta, keyFile);
saveToKeyfile(!pedited || pedited->wb.itcwb_fgreen, "White Balance", "Itcwb_findgreen", wb.itcwb_fgreen, keyFile);
saveToKeyfile(!pedited || pedited->wb.itcwb_green, "White Balance", "Itcwb_green", wb.itcwb_green, keyFile);
saveToKeyfile(!pedited || pedited->wb.itcwb_rgreen, "White Balance", "Itcwb_rangegreen", wb.itcwb_rgreen, keyFile);
saveToKeyfile(!pedited || pedited->wb.itcwb_nopurple, "White Balance", "Itcwb_nopurple", wb.itcwb_nopurple, keyFile);
saveToKeyfile(!pedited || pedited->wb.itcwb_sorted, "White Balance", "Itcwb_sorted", wb.itcwb_sorted, keyFile);
saveToKeyfile(!pedited || pedited->wb.itcwb_forceextra, "White Balance", "Itcwb_forceextra", wb.itcwb_forceextra, keyFile);
saveToKeyfile(!pedited || pedited->wb.itcwb_alg, "White Balance", "Itcwb_alg", wb.itcwb_alg, keyFile);
saveToKeyfile(!pedited || pedited->wb.itcwb_prim, "White Balance", "Itcwb_prim", wb.itcwb_prim, keyFile);
saveToKeyfile(!pedited || pedited->wb.itcwb_sampling, "White Balance", "Itcwb_sampling", wb.itcwb_sampling, keyFile);
// Colorappearance
@ -6434,6 +6454,14 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->sh.radius, "Shadows & Highlights", "Radius", sh.radius, keyFile);
saveToKeyfile(!pedited || pedited->sh.lab, "Shadows & Highlights", "Lab", sh.lab, keyFile);
// Tone equalizer
saveToKeyfile(!pedited || pedited->toneEqualizer.enabled, "ToneEqualizer", "Enabled", toneEqualizer.enabled, keyFile);
for (size_t i = 0; i < toneEqualizer.bands.size(); ++i) {
saveToKeyfile(!pedited || pedited->toneEqualizer.bands[i], "ToneEqualizer", "Band" + std::to_string(i), toneEqualizer.bands[i], keyFile);
}
saveToKeyfile(!pedited || pedited->toneEqualizer.regularization, "ToneEqualizer", "Regularization", toneEqualizer.regularization, keyFile);
saveToKeyfile(!pedited || pedited->toneEqualizer.pivot, "ToneEqualizer", "Pivot", toneEqualizer.pivot, keyFile);
// Crop
saveToKeyfile(!pedited || pedited->crop.enabled, "Crop", "Enabled", crop.enabled, keyFile);
saveToKeyfile(!pedited || pedited->crop.x, "Crop", "X", crop.x, keyFile);
@ -6720,6 +6748,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || spot_edited->gammaskSH, "Locallab", "GammaskSH_" + index_str, spot.gammaskSH, keyFile);
saveToKeyfile(!pedited || spot_edited->slomaskSH, "Locallab", "SlomaskSH_" + index_str, spot.slomaskSH, keyFile);
saveToKeyfile(!pedited || spot_edited->detailSH, "Locallab", "DetailSH_" + index_str, spot.detailSH, keyFile);
saveToKeyfile(!pedited || spot_edited->tePivot, "Locallab", "TePivot_" + index_str, spot.tePivot, keyFile);
saveToKeyfile(!pedited || spot_edited->reparsh, "Locallab", "Reparsh_" + index_str, spot.reparsh, keyFile);
saveToKeyfile(!pedited || spot_edited->LmaskSHcurve, "Locallab", "LmaskSHCurve_" + index_str, spot.LmaskSHcurve, keyFile);
saveToKeyfile(!pedited || spot_edited->fatamountSH, "Locallab", "FatamountSH_" + index_str, spot.fatamountSH, keyFile);
@ -7356,6 +7385,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
{ColorManagementParams::Primaries::ACES_P1, "aces"},
{ColorManagementParams::Primaries::WIDE_GAMUT, "wid"},
{ColorManagementParams::Primaries::ACES_P0, "ac0"},
{ColorManagementParams::Primaries::JDC_MAX, "jdcmax"},
{ColorManagementParams::Primaries::BRUCE_RGB, "bru"},
{ColorManagementParams::Primaries::BETA_RGB, "bet"},
{ColorManagementParams::Primaries::BEST_RGB, "bst"},
@ -8272,15 +8302,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
} else if (standard_observer == "TWO_DEGREES") {
wb.observer = StandardObserver::TWO_DEGREES;
}
assignFromKeyfile(keyFile, "White Balance", "Itcwb_thres", pedited, wb.itcwb_thres, pedited->wb.itcwb_thres);
assignFromKeyfile(keyFile, "White Balance", "Itcwb_precis", pedited, wb.itcwb_precis, pedited->wb.itcwb_precis);
assignFromKeyfile(keyFile, "White Balance", "Itcwb_size", pedited, wb.itcwb_size, pedited->wb.itcwb_size);
assignFromKeyfile(keyFile, "White Balance", "Itcwb_delta", pedited, wb.itcwb_delta, pedited->wb.itcwb_delta);
assignFromKeyfile(keyFile, "White Balance", "Itcwb_findgreen", pedited, wb.itcwb_fgreen, pedited->wb.itcwb_fgreen);
assignFromKeyfile(keyFile, "White Balance", "Itcwb_green", pedited, wb.itcwb_green, pedited->wb.itcwb_green);
assignFromKeyfile(keyFile, "White Balance", "Itcwb_rangegreen", pedited, wb.itcwb_rgreen, pedited->wb.itcwb_rgreen);
assignFromKeyfile(keyFile, "White Balance", "Itcwb_nopurple", pedited, wb.itcwb_nopurple, pedited->wb.itcwb_nopurple);
assignFromKeyfile(keyFile, "White Balance", "Itcwb_sorted", pedited, wb.itcwb_sorted, pedited->wb.itcwb_sorted);
assignFromKeyfile(keyFile, "White Balance", "Itcwb_forceextra", pedited, wb.itcwb_forceextra, pedited->wb.itcwb_forceextra);
assignFromKeyfile(keyFile, "White Balance", "Itcwb_alg", pedited, wb.itcwb_alg, pedited->wb.itcwb_alg);
assignFromKeyfile(keyFile, "White Balance", "Itcwb_prim", pedited, wb.itcwb_prim, pedited->wb.itcwb_prim);
if (ppVersion <= 349) { // 5.9 and earlier.
wb.itcwb_sampling = true;
if (pedited) {
@ -8487,6 +8513,15 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
}
}
if (keyFile.has_group("ToneEqualizer")) {
assignFromKeyfile(keyFile, "ToneEqualizer", "Enabled", pedited, toneEqualizer.enabled, pedited->toneEqualizer.enabled);
for (size_t i = 0; i < toneEqualizer.bands.size(); ++i) {
assignFromKeyfile(keyFile, "ToneEqualizer", "Band" + std::to_string(i), pedited, toneEqualizer.bands[i], pedited->toneEqualizer.bands[i]);
}
assignFromKeyfile(keyFile, "ToneEqualizer", "Regularization", pedited, toneEqualizer.regularization, pedited->toneEqualizer.regularization);
assignFromKeyfile(keyFile, "ToneEqualizer", "Pivot", pedited, toneEqualizer.pivot, pedited->toneEqualizer.pivot);
}
if (keyFile.has_group("Crop")) {
assignFromKeyfile(keyFile, "Crop", "Enabled", pedited, crop.enabled, pedited->crop.enabled);
assignFromKeyfile(keyFile, "Crop", "X", pedited, crop.x, pedited->crop.x);
@ -8894,6 +8929,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Locallab", "SlomaskSH_" + index_str, pedited, spot.slomaskSH, spotEdited.slomaskSH);
assignFromKeyfile(keyFile, "Locallab", "LapmaskSH_" + index_str, pedited, spot.lapmaskSH, spotEdited.lapmaskSH);
assignFromKeyfile(keyFile, "Locallab", "DetailSH_" + index_str, pedited, spot.detailSH, spotEdited.detailSH);
assignFromKeyfile(keyFile, "Locallab", "TePivot_" + index_str, pedited, spot.tePivot, spotEdited.tePivot);
assignFromKeyfile(keyFile, "Locallab", "Reparsh_" + index_str, pedited, spot.reparsh, spotEdited.reparsh);
assignFromKeyfile(keyFile, "Locallab", "LmaskSHCurve_" + index_str, pedited, spot.LmaskSHcurve, spotEdited.LmaskSHcurve);
assignFromKeyfile(keyFile, "Locallab", "FatamountSH_" + index_str, pedited, spot.fatamountSH, spotEdited.fatamountSH);
@ -9698,6 +9734,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
{"aces", ColorManagementParams::Primaries::ACES_P1},
{"wid", ColorManagementParams::Primaries::WIDE_GAMUT},
{"ac0", ColorManagementParams::Primaries::ACES_P0},
{"jdcmax", ColorManagementParams::Primaries::JDC_MAX},
{"bru", ColorManagementParams::Primaries::BRUCE_RGB},
{"bet", ColorManagementParams::Primaries::BETA_RGB},
{"bst", ColorManagementParams::Primaries::BEST_RGB},
@ -10741,6 +10778,7 @@ bool ProcParams::operator ==(const ProcParams& other) const
&& fattal == other.fattal
&& defringe == other.defringe
&& sh == other.sh
&& toneEqualizer == other.toneEqualizer
&& crop == other.crop
&& coarse == other.coarse
&& rotate == other.rotate

View File

@ -18,6 +18,7 @@
*/
#pragma once
#include <array>
#include <cmath>
#include <cstdio>
#include <map>
@ -642,15 +643,11 @@ struct WBParams {
double equal;
double tempBias;
StandardObserver observer;
int itcwb_thres;
int itcwb_precis;
int itcwb_size;
int itcwb_delta;
int itcwb_fgreen;
double itcwb_green;
int itcwb_rgreen;
bool itcwb_nopurple;
bool itcwb_sorted;
bool itcwb_forceextra;
bool itcwb_alg;
Glib::ustring itcwb_prim;
bool itcwb_sampling;
WBParams();
@ -840,6 +837,22 @@ struct SHParams {
bool operator !=(const SHParams& other) const;
};
/**
* Tone equalizer parameters.
*/
struct ToneEqualizerParams {
bool enabled;
std::array<int, 5> bands;
int regularization;
bool show_colormap;
double pivot;
ToneEqualizerParams();
bool operator ==(const ToneEqualizerParams &other) const;
bool operator !=(const ToneEqualizerParams &other) const;
};
/**
* Parameters of the cropping
*/
@ -1210,6 +1223,7 @@ struct LocallabParams {
double slomaskSH;
double lapmaskSH;
int detailSH;
double tePivot;
double reparsh;
std::vector<double> LmaskSHcurve;
double fatamountSH;
@ -1922,6 +1936,7 @@ struct ColorManagementParams {
ACES_P1,
WIDE_GAMUT,
ACES_P0,
JDC_MAX,
BRUCE_RGB,
BETA_RGB,
BEST_RGB,
@ -2591,6 +2606,7 @@ public:
EPDParams epd; ///< Edge Preserving Decomposition parameters
FattalToneMappingParams fattal; ///< Fattal02 tone mapping
SHParams sh; ///< Shadow/highlight enhancement parameters
ToneEqualizerParams toneEqualizer; ///< Tone equalizer parameters
CropParams crop; ///< Crop parameters
CoarseTransformParams coarse; ///< Coarse transformation (90, 180, 270 deg rotation, h/v flipping) parameters
CommonTransformParams commonTrans; ///< Common transformation parameters (autofill)

View File

@ -17,6 +17,9 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include <algorithm>
#include <map>
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>

View File

@ -18,6 +18,7 @@
*/
#pragma once
#include <list>
#include <map>
#include <vector>

File diff suppressed because it is too large Load Diff

View File

@ -112,7 +112,7 @@ protected:
void hlRecovery(const std::string &method, float* red, float* green, float* blue, int width, float* hlmax);
void transformRect(const PreviewProps &pp, int tran, int &sx1, int &sy1, int &width, int &height, int &fw);
void transformPosition(int x, int y, int tran, int& tx, int& ty);
void ItcWB(bool extra, double &tempref, double &greenref, double &tempitc, double &greenitc, float &studgood, array2D<float> &redloc, array2D<float> &greenloc, array2D<float> &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::WBParams & wbpar, const procparams::ToneCurveParams &hrp);
void ItcWB(bool extra, double &tempref, double &greenref, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, array2D<float> &redloc, array2D<float> &greenloc, array2D<float> &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::WBParams & wbpar, const procparams::ToneCurveParams &hrp);
unsigned FC(int row, int col) const;
inline void getRowStartEnd (int x, int &start, int &end);
@ -141,8 +141,8 @@ public:
void processFlatField(const procparams::RAWParams &raw, const RawImage *riFlatFile, array2D<float> &rawData, const float black[4]);
void copyOriginalPixels(const procparams::RAWParams &raw, RawImage *ri, const RawImage *riDark, RawImage *riFlatFile, array2D<float> &rawData );
void scaleColors (int winx, int winy, int winw, int winh, const procparams::RAWParams &raw, array2D<float> &rawData); // raw for cblack
void WBauto(double &tempref, double &greenref, array2D<float> &redloc, array2D<float> &greenloc, array2D<float> &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, double &tempitc, double &greenitc, float &studgood, bool &twotimes, const procparams::WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) override;
void getAutoWBMultipliersitc(double &tempref, double &greenref, double &tempitc, double &greenitc, float &studgood, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double &rm, double &gm, double &bm, const procparams::WBParams & wbpar, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) override;
void WBauto(bool extra, double &tempref, double &greenref, array2D<float> &redloc, array2D<float> &greenloc, array2D<float> &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, bool &twotimes, const procparams::WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) override;
void getAutoWBMultipliersitc(bool extra, double &tempref, double &greenref, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double &rm, double &gm, double &bm, const procparams::WBParams & wbpar, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) override;
void getrgbloc(int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, const procparams::WBParams & wbpar) override;
void getWBMults (const ColorTemp &ctemp, const procparams::RAWParams &raw, std::array<float, 4>& scale_mul, float &autoGainComp, float &rm, float &gm, float &bm) const override;

View File

@ -413,9 +413,21 @@ public:
double Tmax;
};
struct locallabDenoiseLC {
double highres;
double nres;
double highres46;
double nres46;
double Lhighres;
double Lnres;
double Lhighres46;
double Lnres46;
};
virtual ~LocallabListener() = default;
// virtual void refChanged(const std::vector<locallabRef> &ref, int selspot) = 0;
virtual void minmaxChanged(const std::vector<locallabRetiMinMax> &minmax, int selspot) = 0;
virtual void denChanged(const std::vector<locallabDenoiseLC> &denlc, int selspot) = 0;
virtual void logencodChanged(const float blackev, const float whiteev, const float sourceg, const float sourceab, const float targetg, const bool autocomput, const bool autocie, const float jz1) = 0;
virtual void refChanged2(float *huerefp, float *chromarefp, float *lumarefp, float *fabrefp, int selspot) = 0;
};
@ -447,7 +459,7 @@ class AutoWBListener
{
public:
virtual ~AutoWBListener() = default;
virtual void WBChanged(double temp, double green, double rw, double gw, double bw, float studgood) = 0;
virtual void WBChanged(int met, double temp, double green, double rw, double gw, double bw, float temp0, float delta, int bia, int dread, float studgood, float minchrom, int kmin, float histmin, float histmax) = 0;
};
class FrameCountListener

View File

@ -9,7 +9,7 @@
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* RawTherapee is distributed in the hope that it will be useful,
itcw *
*
* 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.
@ -61,6 +61,7 @@ public:
Glib::ustring srgb; // filename of sRGB profile (default to the bundled one)
Glib::ustring rec2020; // filename of Rec2020 profile (default to the bundled one)
Glib::ustring ACESp0; // filename of ACES P0 profile (default to the bundled one)
Glib::ustring JDCmax; // filename of JDCmax profile (default to the bundled one)
Glib::ustring ACESp1; // filename of ACES P1 profile (default to the bundled one)
Glib::ustring DCIP3; // filename of DCIP3 profile (default to the bundled one)
@ -96,6 +97,9 @@ public:
double cbdlsensi;
// bool showtooltip;
bool itcwb_enable;
double itcwb_deltaspec;
double itcwb_powponder;
//wavelet levels
double edghi;
double edglo;

View File

@ -1176,6 +1176,14 @@ private:
float Tsigma;
float Tmin;
float Tmax;
float highresi = 0.f;
float nresi = 0.f;
float highresi46 =0.f;
float nresi46 = 0.f;
float Lhighresi = 0.f;
float Lnresi = 0.f;
float Lhighresi46 = 0.f;
float Lnresi46 = 0.f;
// No Locallab mask is shown in exported picture
ipf.Lab_Local(2, sp, shbuffer, labView, labView, reservView.get(), savenormtmView.get(), savenormretiView.get(), lastorigView.get(), fw, fh, 0, 0, fw, fh, 1, locRETgainCurve, locRETtransCurve,
@ -1230,7 +1238,8 @@ private:
LHutili, HHutili, CHutili, HHutilijz, CHutilijz, LHutilijz, cclocalcurve, localcutili, rgblocalcurve, localrgbutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc,
huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax,
meantme, stdtme, meanretie, stdretie, fab
meantme, stdtme, meanretie, stdretie, fab,
highresi, nresi, highresi46, nresi46, Lhighresi, Lnresi, Lhighresi46, Lnresi46
);
if (sp + 1u < params.locallab.spots.size()) {

View File

@ -311,11 +311,11 @@ void StdImageSource::getAutoExpHistogram (LUTu & histogram, int& histcompr)
}
}
void StdImageSource::WBauto(double &tempref, double &greenref, array2D<float> &redloc, array2D<float> &greenloc, array2D<float> &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, double &tempitc, double &greenitc, float &studgood, bool &twotimes, const WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const ColorManagementParams &cmp, const RAWParams &raw, const ToneCurveParams &hrp)
void StdImageSource::WBauto(bool extra, double &tempref, double &greenref, array2D<float> &redloc, array2D<float> &greenloc, array2D<float> &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, bool &twotimes, const WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const ColorManagementParams &cmp, const RAWParams &raw, const ToneCurveParams &hrp)
{
}
void StdImageSource::getAutoWBMultipliersitc(double &tempref, double &greenref, double &tempitc, double &greenitc, float &studgood, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double &rm, double &gm, double &bm, const WBParams & wbpar, const ColorManagementParams &cmp, const RAWParams &raw, const ToneCurveParams &hrp)
void StdImageSource::getAutoWBMultipliersitc(bool extra, double &tempref, double &greenref, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double &rm, double &gm, double &bm, const WBParams & wbpar, const ColorManagementParams &cmp, const RAWParams &raw, const ToneCurveParams &hrp)
{
if (redAWBMul != -1.) {
rm = redAWBMul;
@ -324,7 +324,7 @@ void StdImageSource::getAutoWBMultipliersitc(double &tempref, double &greenref,
return;
}
img->getAutoWBMultipliersitc(tempref, greenref, tempitc, greenitc,studgood, begx, begy, yEn, xEn, cx, cy, bf_h, bf_w, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve);
img->getAutoWBMultipliersitc(extra, tempref, greenref, tempitc, greenitc, temp0, delta, bia, dread, kcam, nocam, studgood, minchrom, kmin, minhist, maxhist, begx, begy, yEn, xEn, cx, cy, bf_h, bf_w, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve);
redAWBMul = rm;
greenAWBMul = gm;

View File

@ -66,8 +66,8 @@ public:
}
void getAutoWBMultipliers (double &rm, double &gm, double &bm) override;
ColorTemp getSpotWB (std::vector<Coord2D> &red, std::vector<Coord2D> &green, std::vector<Coord2D> &blue, int tran, double equal, StandardObserver observer) override;
void WBauto(double &tempref, double &greenref, array2D<float> &redloc, array2D<float> &greenloc, array2D<float> &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, double &tempitc, double &greenitc, float &studgood, bool &twotimes, const procparams::WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) override;
void getAutoWBMultipliersitc(double &tempref, double &greenref, double &tempitc, double &greenitc, float &studgood, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double &rm, double &gm, double &bm, const procparams::WBParams & wbpar, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) override;
void WBauto(bool extra, double &tempref, double &greenref, array2D<float> &redloc, array2D<float> &greenloc, array2D<float> &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, bool &twotimes, const procparams::WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) override;
void getAutoWBMultipliersitc(bool extra, double &tempref, double &greenref, double &tempitc, double &greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double &rm, double &gm, double &bm, const procparams::WBParams & wbpar, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw, const procparams::ToneCurveParams &hrp) override;
eSensorType getSensorType() const override {return ST_NONE;}
bool isMono() const override {return false;}

View File

@ -161,6 +161,7 @@ set(NONCLISOURCEFILES
thumbimageupdater.cc
thumbnail.cc
tonecurve.cc
toneequalizer.cc
toolbar.cc
toollocationpref.cc
toolpanel.cc

View File

@ -10,6 +10,9 @@ enum {
ADDSET_SH_HIGHLIGHTS,
ADDSET_SH_SHADOWS,
ADDSET_SH_LOCALCONTRAST, // not used anymore
ADDSET_TONE_EQUALIZER_BANDS,
ADDSET_TONE_EQUALIZER_PIVOT,
ADDSET_TONE_EQUALIZER_REGULARIZATION,
ADDSET_LC_BRIGHTNESS,
ADDSET_LC_CONTRAST,
ADDSET_SHARP_AMOUNT,

View File

@ -51,6 +51,7 @@ Adjuster::Adjuster(
grid(nullptr),
label(nullptr),
imageIcon1(imgIcon1),
imageIcon2(imgIcon2),
automatic(nullptr),
adjusterListener(nullptr),
spinChange(options.adjusterMinDelay, options.adjusterMaxDelay),
@ -76,8 +77,8 @@ Adjuster::Adjuster(
setExpandAlignProperties(imageIcon1, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
}
if (imgIcon2) {
setExpandAlignProperties(imgIcon2, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
if (imageIcon2) {
setExpandAlignProperties(imageIcon2, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
}
set_column_spacing(0);
@ -120,9 +121,9 @@ Adjuster::Adjuster(
attach_next_to(*imageIcon1, *slider, Gtk::POS_LEFT, 1, 1);
}
if (imgIcon2) {
attach_next_to(*imgIcon2, *slider, Gtk::POS_RIGHT, 1, 1);
attach_next_to(*spin, *imgIcon2, Gtk::POS_RIGHT, 1, 1);
if (imageIcon2) {
attach_next_to(*imageIcon2, *slider, Gtk::POS_RIGHT, 1, 1);
attach_next_to(*spin, *imageIcon2, Gtk::POS_RIGHT, 1, 1);
} else {
attach_next_to(*spin, *slider, Gtk::POS_RIGHT, 1, 1);
}
@ -140,9 +141,9 @@ Adjuster::Adjuster(
grid->attach_next_to(*imageIcon1, *slider, Gtk::POS_LEFT, 1, 1);
}
if (imgIcon2) {
grid->attach_next_to(*imgIcon2, Gtk::POS_RIGHT, 1, 1);
grid->attach_next_to(*reset, *imgIcon2, Gtk::POS_RIGHT, 1, 1);
if (imageIcon2) {
grid->attach_next_to(*imageIcon2, Gtk::POS_RIGHT, 1, 1);
grid->attach_next_to(*reset, *imageIcon2, Gtk::POS_RIGHT, 1, 1);
} else {
grid->attach_next_to(*reset, *slider, Gtk::POS_RIGHT, 1, 1);
}
@ -683,3 +684,15 @@ void Adjuster::setDelay(unsigned int min_delay_ms, unsigned int max_delay_ms)
spinChange.setDelay(min_delay_ms, max_delay_ms);
sliderChange.setDelay(min_delay_ms, max_delay_ms);
}
void Adjuster::showIcons(bool yes)
{
if (imageIcon1) {
imageIcon1->set_visible(yes);
imageIcon1->set_no_show_all(!yes);
}
if (imageIcon2) {
imageIcon2->set_visible(yes);
imageIcon2->set_no_show_all(!yes);
}
}

View File

@ -41,6 +41,7 @@ protected:
Gtk::Grid* grid;
Gtk::Label* label;
Gtk::Image *imageIcon1;
Gtk::Image *imageIcon2;
MyHScale* slider;
MySpinButton* spin;
Gtk::Button* reset;
@ -133,4 +134,5 @@ public:
void trimValue (int &val) const;
void setLogScale(double base, double pivot, bool anchorMiddle = false);
void setDelay(unsigned int min_delay_ms, unsigned int max_delay_ms = 0);
void showIcons(bool yes);
};

View File

@ -219,6 +219,7 @@ void BatchToolPanelCoordinator::initSession ()
chmixer->setAdjusterBehavior (options.baBehav[ADDSET_CHMIXER] );
blackwhite->setAdjusterBehavior (options.baBehav[ADDSET_BLACKWHITE_HUES], options.baBehav[ADDSET_BLACKWHITE_GAMMA]);
shadowshighlights->setAdjusterBehavior (options.baBehav[ADDSET_SH_HIGHLIGHTS], options.baBehav[ADDSET_SH_SHADOWS]);
toneEqualizer->setAdjusterBehavior(options.baBehav[ADDSET_TONE_EQUALIZER_BANDS], options.baBehav[ADDSET_TONE_EQUALIZER_REGULARIZATION], options.baBehav[ADDSET_TONE_EQUALIZER_PIVOT]);
dirpyrequalizer->setAdjusterBehavior (options.baBehav[ADDSET_DIRPYREQ], options.baBehav[ADDSET_DIRPYREQ_THRESHOLD], options.baBehav[ADDSET_DIRPYREQ_SKINPROTECT]);
wavelet->setAdjusterBehavior (options.baBehav[ADDSET_WA], options.baBehav[ADDSET_WA_THRESHOLD], options.baBehav[ADDSET_WA_THRESHOLD2], options.baBehav[ADDSET_WA_THRES], options.baBehav[ADDSET_WA_CHRO], options.baBehav[ADDSET_WA_CHROMA], options.baBehav[ADDSET_WA_CONTRAST], options.baBehav[ADDSET_WA_SKINPROTECT], options.baBehav[ADDSET_WA_RESCHRO], options.baBehav[ADDSET_WA_TMRS], options.baBehav[ADDSET_WA_EDGS], options.baBehav[ADDSET_WA_SCALE], options.baBehav[ADDSET_WA_RESCON], options.baBehav[ADDSET_WA_RESCONH], options.baBehav[ADDSET_WA_THRR], options.baBehav[ADDSET_WA_THRRH], options.baBehav[ADDSET_WA_RADIUS], options.baBehav[ADDSET_WA_SKYPROTECT], options.baBehav[ADDSET_WA_EDGRAD], options.baBehav[ADDSET_WA_EDGVAL], options.baBehav[ADDSET_WA_STRENGTH], options.baBehav[ADDSET_WA_GAMMA], options.baBehav[ADDSET_WA_EDGEDETECT], options.baBehav[ADDSET_WA_EDGEDETECTTHR], options.baBehav[ADDSET_WA_EDGEDETECTTHR2]);
dirpyrdenoise->setAdjusterBehavior (options.baBehav[ADDSET_DIRPYRDN_LUMA], options.baBehav[ADDSET_DIRPYRDN_LUMDET], options.baBehav[ADDSET_DIRPYRDN_CHROMA], options.baBehav[ADDSET_DIRPYRDN_CHROMARED], options.baBehav[ADDSET_DIRPYRDN_CHROMABLUE], options.baBehav[ADDSET_DIRPYRDN_GAMMA], options.baBehav[ADDSET_DIRPYRDN_PASSES]);
@ -242,6 +243,9 @@ void BatchToolPanelCoordinator::initSession ()
if (options.baBehav[ADDSET_TC_SATURATION]) { pparams.toneCurve.saturation = 0;}
if (options.baBehav[ADDSET_SH_HIGHLIGHTS]) { pparams.sh.highlights = 0; }
if (options.baBehav[ADDSET_SH_SHADOWS]) { pparams.sh.shadows = 0; }
if (options.baBehav[ADDSET_TONE_EQUALIZER_BANDS]) { pparams.toneEqualizer.bands = {}; }
if (options.baBehav[ADDSET_TONE_EQUALIZER_PIVOT]) { pparams.toneEqualizer.pivot = 0; }
if (options.baBehav[ADDSET_TONE_EQUALIZER_REGULARIZATION]) { pparams.toneEqualizer.regularization = 0; }
if (options.baBehav[ADDSET_LC_BRIGHTNESS]) { pparams.labCurve.brightness = 0; }
if (options.baBehav[ADDSET_LC_CONTRAST]) { pparams.labCurve.contrast = 0; }
if (options.baBehav[ADDSET_LC_CHROMATICITY]) { pparams.labCurve.chromaticity = 0; }

View File

@ -403,7 +403,7 @@ void CropWindow::buttonPress (int button, int type, int bstate, int x, int y)
// Add a new Color Picker
rtengine::Coord imgPos;
screenCoordToImage(x, y, imgPos.x, imgPos.y);
LockableColorPicker *newPicker = new LockableColorPicker(this, &cropHandler.colorParams->outputProfile, &cropHandler.colorParams->workingProfile);
LockableColorPicker *newPicker = new LockableColorPicker(this, cropHandler.colorParams.get());
colorPickers.push_back(newPicker);
hoveredPicker = newPicker;
updateHoveredPicker(&imgPos);
@ -1095,10 +1095,10 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
printf("Using \"%s\" output\n", outputProfile.c_str());
if(outputProfile==options.rtSettings.srgb) printf("OK SRGB2");
*/
pmlistener->pointerMoved (false, cropHandler.colorParams->outputProfile, cropHandler.colorParams->workingProfile, mx, my, -1, -1, -1);
pmlistener->pointerMoved (false, *cropHandler.colorParams, mx, my, -1, -1, -1);
if (pmhlistener) {
pmhlistener->pointerMoved (false, cropHandler.colorParams->outputProfile, cropHandler.colorParams->workingProfile, mx, my, -1, -1, -1);
pmhlistener->pointerMoved (false, *cropHandler.colorParams, mx, my, -1, -1, -1);
}
} else {
@ -1145,11 +1145,11 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
// Updates the Navigator
// TODO: possible double color conversion if rval, gval, bval come from cropHandler.cropPixbuftrue ? see issue #4583
pmlistener->pointerMoved (true, cropHandler.colorParams->outputProfile, cropHandler.colorParams->workingProfile, mx, my, rval, gval, bval, isRaw);
pmlistener->pointerMoved (true, *cropHandler.colorParams, mx, my, rval, gval, bval, isRaw);
if (pmhlistener) {
// Updates the HistogramRGBArea
pmhlistener->pointerMoved (true, cropHandler.colorParams->outputProfile, cropHandler.colorParams->workingProfile, mx, my, rval, gval, bval);
pmhlistener->pointerMoved (true, *cropHandler.colorParams, mx, my, rval, gval, bval);
}
}
}

View File

@ -18,6 +18,8 @@
*/
#pragma once
#include <vector>
#include "editid.h"
#include "cursormanager.h"
#include "../rtengine/coord.h"

View File

@ -37,7 +37,6 @@
//extern Glib::Threads::Thread* mainThread;
bool FileBrowserEntry::iconsLoaded(false);
Glib::RefPtr<Gdk::Pixbuf> FileBrowserEntry::editedIcon;
Glib::RefPtr<Gdk::Pixbuf> FileBrowserEntry::recentlySavedIcon;
Glib::RefPtr<Gdk::Pixbuf> FileBrowserEntry::enqueuedIcon;
@ -58,15 +57,6 @@ FileBrowserEntry::FileBrowserEntry (Thumbnail* thm, const Glib::ustring& fname)
scale = 1;
if (!iconsLoaded) {
editedIcon = RTImage::createPixbufFromFile ("tick-small.png");
recentlySavedIcon = RTImage::createPixbufFromFile ("save-small.png");
enqueuedIcon = RTImage::createPixbufFromFile ("gears-small.png");
hdr = RTImage::createPixbufFromFile ("filetype-hdr.png");
ps = RTImage::createPixbufFromFile ("filetype-ps.png");
iconsLoaded = true;
}
thumbnail->addThumbnailListener (this);
}
@ -90,6 +80,15 @@ FileBrowserEntry::~FileBrowserEntry ()
}
}
void FileBrowserEntry::init ()
{
editedIcon = RTImage::createPixbufFromFile ("tick-small.png");
recentlySavedIcon = RTImage::createPixbufFromFile ("save-small.png");
enqueuedIcon = RTImage::createPixbufFromFile ("gears-small.png");
hdr = RTImage::createPixbufFromFile ("filetype-hdr.png");
ps = RTImage::createPixbufFromFile ("filetype-ps.png");
}
void FileBrowserEntry::refreshThumbnailImage ()
{

View File

@ -50,7 +50,6 @@ class FileBrowserEntry final : public ThumbBrowserEntryBase,
{
double scale;
static bool iconsLoaded;
bool wasInside;
ImageAreaToolListener* iatlistener;
int press_x, press_y, action_x, action_y;
@ -80,6 +79,7 @@ public:
FileBrowserEntry (Thumbnail* thm, const Glib::ustring& fname);
~FileBrowserEntry () override;
static void init ();
void draw (Cairo::RefPtr<Cairo::Context> cc) override;
void setImageAreaToolListener (ImageAreaToolListener* l)

View File

@ -82,59 +82,6 @@ void IdleRegister::destroy()
mutex.unlock();
}
/*
gboolean giveMeAGo(void* data) {
GThreadLock *threadMutex = static_cast<GThreadLock*>(data);
printf("A\n");
Glib::Threads::Mutex::Lock GUILock(threadMutex->GUI);
printf("B\n");
{
Glib::Threads::Mutex::Lock operationLock(threadMutex->operation);
printf("C\n");
threadMutex->operationCond.signal();
printf("D\n");
operationLock.release(); // because we're not sure that "lock" destructor happens here...
}
threadMutex->GUICond.wait(threadMutex->GUI);
printf("E\n");
GUILock.release();
return false;
}
GThreadLock::GThreadLock() : sameThread(false) {
if (Glib::Threads::Thread::self() == mainThread) {
sameThread = true;
return;
}
printf("10\n");
{
Glib::Threads::Mutex::Lock operationLock(operation);
printf("20\n");
gdk_threads_add_idle(giveMeAGo, this);
printf("30\n");
operationCond.wait(operation);
printf("40\n");
operationLock.release();
}
}
GThreadLock::~GThreadLock() {
if (!sameThread) {
printf("50\n");
Glib::Threads::Mutex::Lock lock(GUI);
printf("60\n");
GUICond.signal();
printf("Fin\n");
}
}
*/
Glib::ustring escapeHtmlChars(const Glib::ustring &src)
{

View File

@ -22,10 +22,11 @@
#include "options.h"
#include <cstring>
#include <cmath>
#include "../rtengine/array2D.h"
#include "../rtengine/LUT.h"
#include "rtimage.h"
#include "../rtengine/array2D.h"
#include "../rtengine/color.h"
#include "../rtengine/improcfun.h"
#include "../rtengine/LUT.h"
using namespace rtengine;
@ -34,12 +35,20 @@ constexpr float HistogramArea::MIN_BRIGHT;
using ScopeType = Options::ScopeType;
namespace
{
const rtengine::procparams::ColorManagementParams DEFAULT_CMP;
}
//
//
// HistogramPanel
HistogramPanel::HistogramPanel () :
pointer_moved_delayed_call(
[this](bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int r, int g, int b)
[this](bool validPos, const rtengine::procparams::ColorManagementParams *cmp, int r, int g, int b)
{
bool update_hist_area;
@ -52,9 +61,9 @@ HistogramPanel::HistogramPanel () :
} else {
// do something to show vertical bars
if (histogramRGBArea) {
histogramRGBArea->updateBackBuffer(r, g, b, profile, profileW);
histogramRGBArea->updateBackBuffer(r, g, b, cmp);
}
update_hist_area = histogramArea->updatePointer(r, g, b, profile, profileW);
update_hist_area = histogramArea->updatePointer(r, g, b, cmp);
}
if (histogramRGBArea) {
histogramRGBArea->queue_draw();
@ -623,9 +632,9 @@ void HistogramPanel::setHistRGBInvalid ()
histogramRGBArea->queue_draw ();
}
void HistogramPanel::pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool isRaw)
void HistogramPanel::pointerMoved(bool validPos, const rtengine::procparams::ColorManagementParams &cmp, int x, int y, int r, int g, int b, bool isRaw)
{
pointer_moved_delayed_call(validPos, profile, profileW, r, g, b);
pointer_moved_delayed_call(validPos, &cmp, r, g, b);
}
/*
@ -797,7 +806,7 @@ void HistogramRGBArea::setShow(bool show)
showMode = show;
}
void HistogramRGBArea::updateBackBuffer (int r, int g, int b, const Glib::ustring &profile, const Glib::ustring &profileW)
void HistogramRGBArea::updateBackBuffer(int r, int g, int b, const rtengine::procparams::ColorManagementParams *cmp)
{
if (!get_realized () || !showMode || !(
options.histogramScopeType == ScopeType::HISTOGRAM
@ -856,19 +865,25 @@ void HistogramRGBArea::updateBackBuffer (int r, int g, int b, const Glib::ustrin
|| options.histogramScopeType == ScopeType::WAVEFORM)
) {
float Lab_L, Lab_a, Lab_b;
rtengine::Color::rgb2lab01(profile, profileW, r / 255.f, g / 255.f, b / 255.f, Lab_L, Lab_a, Lab_b, options.rtSettings.HistogramWorking);
ImProcFunctions::rgb2lab(
static_cast<std::uint8_t>(r),
static_cast<std::uint8_t>(g),
static_cast<std::uint8_t>(b),
Lab_L, Lab_a, Lab_b,
cmp != nullptr ? *cmp : DEFAULT_CMP,
true);
if (needLuma) {
// Luma
cc->set_source_rgb(1.0, 1.0, 1.0);
drawBar(cc, Lab_L, 100.0, winw, winh, s);
drawBar(cc, Lab_L, 32768., winw, winh, s);
}
if (needChroma && options.histogramScopeType == ScopeType::HISTOGRAM) {
// Chroma
double chromaval = sqrt(Lab_a * Lab_a + Lab_b * Lab_b) / 1.8;
double chromaval = sqrt(Lab_a * Lab_a + Lab_b * Lab_b) / (255. * 188);
cc->set_source_rgb(0.9, 0.9, 0.0);
drawBar(cc, chromaval, 100.0, winw, winh, s);
drawBar(cc, chromaval, 1.0, winw, winh, s);
}
}
}
@ -1182,7 +1197,7 @@ void HistogramArea::update(
break;
case ScopeType::PARADE:
case ScopeType::WAVEFORM: {
MyWriterLock wave_lock(wave_mutex);
MYWRITERLOCK(wave_lock, wave_mutex)
waveform_scale = waveformScale;
rwave = waveformRed;
gwave = waveformGreen;
@ -1315,7 +1330,7 @@ void HistogramArea::updateBackBuffer ()
cr->unset_dash();
MyReaderLock wave_lock(wave_mutex);
MYREADERLOCK(wave_lock, wave_mutex)
if (valid && (scopeType == ScopeType::HISTOGRAM || scopeType == ScopeType::HISTOGRAM_RAW)) {
bool rawMode = scopeType == ScopeType::HISTOGRAM_RAW;
@ -1432,7 +1447,7 @@ void HistogramArea::updateBackBuffer ()
} else if (scopeType == ScopeType::VECTORSCOPE_HC || scopeType == ScopeType::VECTORSCOPE_HS) {
drawVectorscope(cr, w, h);
}
wave_lock.release();
MYREADERLOCK_RELEASE(wave_lock);
// Draw the frame's border
style->render_frame(cr, 0, 0, surface->get_width(), surface->get_height());
@ -1443,7 +1458,7 @@ void HistogramArea::updateBackBuffer ()
setDirty(false);
}
bool HistogramArea::updatePointer(int r, int g, int b, const Glib::ustring &profile, const Glib::ustring &profileW)
bool HistogramArea::updatePointer(int r, int g, int b, const rtengine::procparams::ColorManagementParams *cmp)
{
if (!needPointer || !(scopeType == ScopeType::VECTORSCOPE_HC || scopeType == ScopeType::VECTORSCOPE_HS)) {
return false;
@ -1456,7 +1471,16 @@ bool HistogramArea::updatePointer(int r, int g, int b, const Glib::ustring &prof
pointer_red = r;
pointer_green = g;
pointer_blue = b;
Color::rgb2lab01(profile, profileW, r / 255.f, g / 255.f, b / 255.f, L, pointer_a, pointer_b, options.rtSettings.HistogramWorking);
ImProcFunctions::rgb2lab(
static_cast<std::uint8_t>(r),
static_cast<std::uint8_t>(g),
static_cast<std::uint8_t>(b),
L, pointer_a, pointer_b,
cmp != nullptr ? *cmp : DEFAULT_CMP,
true);
L /= 327.68f;
pointer_a /= 327.68f;
pointer_b /= 327.68f;
updateBackBuffer();
return true;
}

View File

@ -99,7 +99,7 @@ public:
HistogramRGBArea();
~HistogramRGBArea() override;
void updateBackBuffer (int r, int g, int b, const Glib::ustring &profile = "", const Glib::ustring &profileW = "");
void updateBackBuffer(int r, int g, int b, const rtengine::procparams::ColorManagementParams *cmp = nullptr);
bool getShow ();
void setShow(bool show);
void setParent (Gtk::Grid* p)
@ -206,7 +206,7 @@ public:
void updateBackBuffer ();
/// Update pointer values. Returns true if widget needs redrawing.
bool updatePointer(int r, int g, int b, const Glib::ustring &profile = "", const Glib::ustring &profileW = "");
bool updatePointer(int r, int g, int b, const rtengine::procparams::ColorManagementParams *cmp = nullptr);
void update(
const LUTu& histRed,
const LUTu& histGreen,
@ -260,7 +260,7 @@ public:
class HistogramPanel final : public Gtk::Grid, public PointerMotionListener, public DrawModeListener, public rtengine::NonCopyable
{
private:
DelayedCall<bool, Glib::ustring, Glib::ustring, int, int, int> pointer_moved_delayed_call;
DelayedCall<bool, const rtengine::procparams::ColorManagementParams *, int, int, int> pointer_moved_delayed_call;
protected:
@ -343,7 +343,7 @@ public:
histogramArea->update(histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw, vectorscopeScale, vectorscopeHC, vectorscopeHS, waveformScale, waveformRed, waveformGreen, waveformBlue, waveformLuma);
}
// pointermotionlistener interface
void pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool isRaw = false) override;
void pointerMoved (bool validPos, const rtengine::procparams::ColorManagementParams &cmp, int x, int y, int r, int g, int b, bool isRaw = false) override;
// TODO should be protected
void setHistRGBInvalid ();

View File

@ -204,10 +204,13 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iu
wFrame->add(*wProfVBox);
//-----------------gamma TRC working
Gtk::Frame *trcFrame = Gtk::manage(new Gtk::Frame(M("TP_ICM_TRCFRAME")));
trcFrame->set_label_align(0.025, 0.5);
// Gtk::Frame *trcFrame = Gtk::manage(new Gtk::Frame(M("TP_ICM_TRCFRAME")));
trcExp = Gtk::manage(new MyExpander(false, M("TP_ICM_TRCFRAME")));
setExpandAlignProperties(trcExp, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
// trcFrame->set_label_align(0.025, 0.5);
Gtk::Box *trcProfVBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
trcFrame->set_tooltip_text(M("TP_ICM_TRCFRAME_TOOLTIP"));
trcExp->set_tooltip_text(M("TP_ICM_TRCFRAME_TOOLTIP"));
trcExp->signal_button_release_event().connect_notify ( sigc::bind ( sigc::mem_fun (this, &ICMPanel::foldAllButMe), trcExp) );
wTRCBox = Gtk::manage(new Gtk::Box());
@ -268,7 +271,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iu
fbw->set_active(true);
gamut = Gtk::manage(new Gtk::CheckButton((M("TP_ICM_GAMUT"))));
gamut->set_active(false);
trcProfVBox->pack_start(*wprimBox, Gtk::PACK_EXPAND_WIDGET);
trcProfVBox->pack_start(*fbw, Gtk::PACK_EXPAND_WIDGET);
trcProfVBox->pack_start(*gamut, Gtk::PACK_EXPAND_WIDGET);
@ -292,6 +295,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iu
wprim->append(M("TP_ICM_WORKING_PRIM_ACE"));
wprim->append(M("TP_ICM_WORKING_PRIM_WID"));
wprim->append(M("TP_ICM_WORKING_PRIM_AC0"));
wprim->append(M("TP_ICM_WORKING_PRIM_JDCMAX"));
wprim->append(M("TP_ICM_WORKING_PRIM_BRU"));
wprim->append(M("TP_ICM_WORKING_PRIM_BET"));
wprim->append(M("TP_ICM_WORKING_PRIM_BST"));
@ -381,11 +385,13 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iu
aRendIntent->show();
riaHBox->pack_start(*aRendIntent->buttonGroup, Gtk::PACK_EXPAND_PADDING);
trcFrame->add(*trcProfVBox);
pack_start(*wFrame, Gtk::PACK_EXPAND_WIDGET);
pack_start(*trcFrame, Gtk::PACK_EXPAND_WIDGET);
pack_start(*redFrame, Gtk::PACK_EXPAND_WIDGET);
trcProfVBox->pack_start(*redFrame, Gtk::PACK_EXPAND_WIDGET);
trcExp->add(*trcProfVBox, false);
trcExp->setLevel (2);
pack_start(*trcExp, Gtk::PACK_EXPAND_WIDGET);
trcExp->set_expanded(false);
// ---------------------------- Output profile
@ -493,6 +499,14 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, TOOL_NAME, M("TP_ICM_LABEL")), iu
show_all();
}
void ICMPanel::foldAllButMe (GdkEventButton* event, MyExpander *expander)
{
if (event->button == 3) {
trcExp->set_expanded (trcExp == expander);
}
}
void ICMPanel::neutral_pressed ()
{ //find working profile and set the same destination proile
if (wProfNames->get_active_text() == "Rec2020") {
@ -509,6 +523,8 @@ void ICMPanel::neutral_pressed ()
wprim->set_active(toUnderlying(ColorManagementParams::Primaries::WIDE_GAMUT));
} else if (wProfNames->get_active_text() == "ACESp0") {
wprim->set_active(toUnderlying(ColorManagementParams::Primaries::ACES_P0));
} else if (wProfNames->get_active_text() == "JDCmax") {
wprim->set_active(toUnderlying(ColorManagementParams::Primaries::JDC_MAX));
} else if (wProfNames->get_active_text() == "BruceRGB") {
wprim->set_active(toUnderlying(ColorManagementParams::Primaries::BRUCE_RGB));
} else if (wProfNames->get_active_text() == "Beta RGB") {
@ -788,6 +804,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
ConnectionBlocker wtrcconn_(wtrcconn);
ConnectionBlocker willconn_(willconn);
ConnectionBlocker wprimconn_(wprimconn);
trcExp->set_expanded(false);
if (pp->icm.inputProfile.substr(0, 5) != "file:") {
ipDialog->set_filename(" ");
@ -1082,6 +1099,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
case ColorManagementParams::Primaries::ACES_P1:
case ColorManagementParams::Primaries::WIDE_GAMUT:
case ColorManagementParams::Primaries::ACES_P0:
case ColorManagementParams::Primaries::JDC_MAX:
case ColorManagementParams::Primaries::BRUCE_RGB:
case ColorManagementParams::Primaries::BETA_RGB:
case ColorManagementParams::Primaries::BEST_RGB: {
@ -1475,6 +1493,7 @@ void ICMPanel::wtrcinChanged()
case ColorManagementParams::Primaries::ACES_P1:
case ColorManagementParams::Primaries::WIDE_GAMUT:
case ColorManagementParams::Primaries::ACES_P0:
case ColorManagementParams::Primaries::JDC_MAX:
case ColorManagementParams::Primaries::BRUCE_RGB:
case ColorManagementParams::Primaries::BETA_RGB:
case ColorManagementParams::Primaries::BEST_RGB: {
@ -1507,7 +1526,7 @@ void ICMPanel::wtrcinChanged()
void ICMPanel::willChanged()
{
switch (ColorManagementParams::Primaries(wprim->get_active_row_number())) {
switch (ColorManagementParams::Primaries(wprim->get_active_row_number() )) {
case ColorManagementParams::Primaries::DEFAULT:
case ColorManagementParams::Primaries::SRGB:
case ColorManagementParams::Primaries::ADOBE_RGB:
@ -1516,6 +1535,7 @@ void ICMPanel::willChanged()
case ColorManagementParams::Primaries::ACES_P1:
case ColorManagementParams::Primaries::WIDE_GAMUT:
case ColorManagementParams::Primaries::ACES_P0:
case ColorManagementParams::Primaries::JDC_MAX:
case ColorManagementParams::Primaries::BRUCE_RGB:
case ColorManagementParams::Primaries::BETA_RGB:
case ColorManagementParams::Primaries::BEST_RGB: {
@ -1630,6 +1650,17 @@ void ICMPanel::wprimChanged()
break;
}
case ColorManagementParams::Primaries::JDC_MAX: {
redx->setValue(0.734702);
redy->setValue(0.265302);
grex->setValue(0.021908);
grey->setValue(0.930288);
blux->setValue(0.120593);
bluy->setValue(0.001583);
will->set_active(toUnderlying(ColorManagementParams::Illuminant::D50));
break;
}
case ColorManagementParams::Primaries::BRUCE_RGB: {
redx->setValue(0.64);
redy->setValue(0.33);
@ -1722,6 +1753,14 @@ void ICMPanel::wprimChanged()
blux->setValue(0.0001);
bluy->setValue(-0.077);
will->set_active(toUnderlying(ColorManagementParams::Illuminant::D60));
} else if (wProfNames->get_active_text() == "JDCmax") {
redx->setValue(0.734702);
redy->setValue(0.265302);
grex->setValue(0.021908);
grey->setValue(0.930288);
blux->setValue(0.120593);
bluy->setValue(0.001583);
will->set_active(toUnderlying(ColorManagementParams::Illuminant::D50));
} else if (wProfNames->get_active_text() == "BruceRGB") {
redx->setValue(0.64);
redy->setValue(0.33);
@ -1729,7 +1768,7 @@ void ICMPanel::wprimChanged()
grey->setValue(0.65);
blux->setValue(0.15);
bluy->setValue(0.06);
will->set_active(toUnderlying(ColorManagementParams::Illuminant::D65));
will->set_active(toUnderlying(ColorManagementParams::Illuminant::D65));
} else if (wProfNames->get_active_text() == "Beta RGB") {
redx->setValue(0.6888);
redy->setValue(0.3112);

View File

@ -49,6 +49,7 @@ protected:
Gtk::Frame* dcpFrame;
Gtk::Frame* coipFrame;
Gtk::Frame* redFrame;
MyExpander* trcExp;
Adjuster* wGamma;
Adjuster* wSlope;
@ -168,6 +169,7 @@ private:
Glib::ustring camName;
void updateDCP(int dcpIlluminant, Glib::ustring dcp_name);
void updateRenderingIntent(const Glib::ustring &profile);
void foldAllButMe (GdkEventButton* event, MyExpander *expander);
float nextrx;
float nextry;

View File

@ -703,6 +703,19 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
expreti.updateMinMax(cdma, cdmin, mini, maxi, Tmean, Tsigma, Tmin, Tmax);
}
// Update Locallab Denoise tool lum/chro
if (pp->locallab.selspot < (int) denoiselc.size()) {
const double highres = denoiselc.at(pp->locallab.selspot).highres;
const double nres = denoiselc.at(pp->locallab.selspot).nres;
const double highres46 = denoiselc.at(pp->locallab.selspot).highres46;
const double nres46 = denoiselc.at(pp->locallab.selspot).nres46;
const double Lhighres = denoiselc.at(pp->locallab.selspot).Lhighres;
const double Lnres = denoiselc.at(pp->locallab.selspot).Lnres;
const double Lhighres46 = denoiselc.at(pp->locallab.selspot).Lhighres46;
const double Lnres46 = denoiselc.at(pp->locallab.selspot).Lnres46;
expblur.updatedenlc(highres, nres, highres46, nres46, Lhighres, Lnres, Lhighres46, Lnres46);
}
// Update default values according to selected spot
setDefaults(pp, pedited);
@ -1094,6 +1107,28 @@ void Locallab::minmaxChanged(const std::vector<locallabRetiMinMax> &minmax, int
}
}
void Locallab::denChanged(const std::vector<locallabDenoiseLC> &denlc, int selspot)
{
// Saving transmitted min/max data
denoiselc = denlc;
//Update Locallab Denoise tool lum chro
if (selspot < (int) denoiselc.size()) {
const double highres = denoiselc.at(selspot).highres;
const double nres = denoiselc.at(selspot).nres;
const double highres46 = denoiselc.at(selspot).highres46;
const double nres46 = denoiselc.at(selspot).nres46;
const double Lhighres = denoiselc.at(selspot).Lhighres;
const double Lnres = denoiselc.at(selspot).Lnres;
const double Lhighres46 = denoiselc.at(selspot).Lhighres46;
const double Lnres46 = denoiselc.at(selspot).Lnres46;
expblur.updatedenlc(highres, nres, highres46, nres46, Lhighres, Lnres, Lhighres46, Lnres46);
}
}
void Locallab::logencodChanged(const float blackev, const float whiteev, const float sourceg, const float sourceab, const float targetg, const bool autocomput, const bool autocie, const float jz1)
{
// Update Locallab Log Encoding and Ciecam accordingly

View File

@ -123,6 +123,9 @@ private:
// Locallab tools mask background management data
std::vector<locallabRetiMinMax> retiMinMax;
// Locallab tools mask background management data
std::vector<locallabDenoiseLC> denoiselc;
// Locallab tools mask background management data
std::vector<locallabRef> maskBackRef;
@ -145,6 +148,10 @@ public:
// Locallab Retinex tool min/man management function
void minmaxChanged(const std::vector<locallabRetiMinMax> &minmax, int selspot) override;
//Locallab denoise
// Locallab Retinex tool min/man management function
void denChanged(const std::vector<locallabDenoiseLC> &denlc, int selspot) override;
// Locallab Log Encoding autocompute function
void logencodChanged(const float blackev, const float whiteev, const float sourceg, const float sourceab, const float targetg, const bool autocomput, const bool autocie, const float jz1) override;

View File

@ -3977,6 +3977,7 @@ LocallabShadow::LocallabShadow():
}
()),
detailSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DETAILSH"), -5, 5, 1, 0))),
tePivot(Gtk::manage(new Adjuster(M("TP_LOCALLAB_TE_PIVOT"), -12, 12, 0.05, 0))),
highlights(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_HIGHLIGHTS"), 0, 100, 1, 0))),
h_tonalwidth(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_HLTONALW"), 10, 100, 1, 70))),
shadows(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_SHADOWS"), 0, 100, 1, 0))),
@ -4017,7 +4018,8 @@ LocallabShadow::LocallabShadow():
LmaskSHshape(static_cast<DiagonalCurveEditor*>(mask2SHCurveEditorG->addCurve(CT_Diagonal, "L(L)"))),
fatSHFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_FATSHFRA")))),
fatamountSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATAMOUNT"), 1., 100., 1., 1.))),
fatanchorSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATANCHOR"), 1., 100., 1., 50., Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png")))))
fatanchorSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATANCHOR"), 1., 100., 1., 50., Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))),
EvlocallabTePivot(ProcEventMapper::getInstance()->newEvent(AUTOEXP, "HISTORY_MSG_LOCALLAB_TE_PIVOT"))
{
set_orientation(Gtk::ORIENTATION_VERTICAL);
@ -4034,6 +4036,7 @@ LocallabShadow::LocallabShadow():
}
detailSH->setAdjusterListener(this);
tePivot->setAdjusterListener(this);
reparsh->setAdjusterListener(this);
highlights->setAdjusterListener(this);
@ -4144,6 +4147,7 @@ LocallabShadow::LocallabShadow():
}
pack_start(*detailSH);
pack_start(*tePivot);
pack_start(*highlights);
pack_start(*h_tonalwidth);
pack_start(*shadows);
@ -4364,6 +4368,7 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para
decays->setValue((double)spot.decays);
detailSH->setValue((double)spot.detailSH);
tePivot->setValue(spot.tePivot);
reparsh->setValue(spot.reparsh);
highlights->setValue((double)spot.highlights);
h_tonalwidth->setValue((double)spot.h_tonalwidth);
@ -4429,6 +4434,7 @@ void LocallabShadow::write(rtengine::procparams::ProcParams* pp, ParamsEdited* p
}
spot.detailSH = detailSH->getIntValue();
spot.tePivot = tePivot->getValue();
spot.reparsh = reparsh->getValue();
spot.highlights = highlights->getIntValue();
spot.h_tonalwidth = h_tonalwidth->getIntValue();
@ -4477,6 +4483,7 @@ void LocallabShadow::setDefaults(const rtengine::procparams::ProcParams* defPara
}
detailSH->setDefault((double)defSpot.detailSH);
tePivot->setDefault(defSpot.tePivot);
reparsh->setDefault(defSpot.reparsh);
highlights->setDefault((double)defSpot.highlights);
h_tonalwidth->setDefault((double)defSpot.h_tonalwidth);
@ -4528,6 +4535,13 @@ void LocallabShadow::adjusterChanged(Adjuster* a, double newval)
}
}
if (a == tePivot) {
if (listener) {
listener->panelChanged(EvlocallabTePivot,
tePivot->getTextValue() + " (" + escapeHtmlChars(getSpotName()) + ")");
}
}
if (a == reparsh) {
if (listener) {
listener->panelChanged(Evlocallabreparsh,
@ -5044,6 +5058,7 @@ void LocallabShadow::updateShadowGUI2()
gamFrame->hide();
detailSH->hide();
tePivot->hide();
highlights->show();
h_tonalwidth->show();
shadows->show();
@ -5059,6 +5074,7 @@ void LocallabShadow::updateShadowGUI2()
}
detailSH->show();
tePivot->show();
highlights->hide();
h_tonalwidth->hide();
shadows->hide();
@ -6477,8 +6493,17 @@ LocallabBlur::LocallabBlur():
activlum(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ACTIV")))),
expdenoise(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI_EXP")))),
quamethod(Gtk::manage(new MyComboBoxText())),
expdenoisenl(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_NLFRA")))),
expdenoiselum(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOIWAVLUM")))),
expdenoisech(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOIWAVCH")))),
LocalcurveEditorwavden(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVDEN"))),
wavshapeden(static_cast<FlatCurveEditor*>(LocalcurveEditorwavden->addCurve(CT_Flat, "", nullptr, false, false))),
// lCLabels(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_LCLABELS")))),
lCLabels(Gtk::manage(new Gtk::Label("-----------------"))),
lumLabels(Gtk::manage(new Gtk::Label("---"))),
lum46Labels(Gtk::manage(new Gtk::Label("---"))),
chroLabels(Gtk::manage(new Gtk::Label("---"))),
chro46Labels(Gtk::manage(new Gtk::Label("---"))),
expdenoise1(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI1_EXP")))),
maskusable(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))),
maskunusable(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))),
@ -6514,7 +6539,7 @@ LocallabBlur::LocallabBlur():
decayd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))),
invmaskd(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))),
invmask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))),
nlFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_NLFRA")))),
prevFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LCLABELS")))),
nlstr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLLUM"), 0, 100, 1, 0))),
nldet(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLDET"), 0, 100, 1, 50))),
nlpat(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLPAT"), 1, 5, 1, 2))),
@ -6640,12 +6665,23 @@ LocallabBlur::LocallabBlur():
Gtk::Label* const quaLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_DENQUA") + ":"));
quaHBox->pack_start(*quaLabel, Gtk::PACK_SHRINK, 4);
quaHBox->pack_start(*quamethod);
setExpandAlignProperties(expdenoisenl, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
setExpandAlignProperties(expdenoiselum, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
setExpandAlignProperties(expdenoisech, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
LocalcurveEditorwavden->setCurveListener(this);
wavshapeden->setIdentityValue(0.);
wavshapeden->setResetCurve(FlatCurveType(defSpot.locwavcurveden.at(0)), defSpot.locwavcurveden);
setExpandAlignProperties(lCLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START);
setExpandAlignProperties(lumLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START);
setExpandAlignProperties(lum46Labels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START);
setExpandAlignProperties(chroLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START);
setExpandAlignProperties(chro46Labels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START);
LocalcurveEditorwavden->curveListComplete();
setExpandAlignProperties(expdenoise1, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
@ -6701,7 +6737,7 @@ LocallabBlur::LocallabBlur():
decayd->setAdjusterListener(this);
bilateral->setAdjusterListener(this);
nlFrame->set_label_align(0.025, 0.5);
prevFrame->set_label_align(0.025, 0.5);
nlstr->setAdjusterListener(this);
nldet->setAdjusterListener(this);
@ -6838,15 +6874,39 @@ LocallabBlur::LocallabBlur():
Gtk::Frame* const wavFrame = Gtk::manage(new Gtk::Frame());
ToolParamBlock* const wavBox = Gtk::manage(new ToolParamBlock());
wavBox->pack_start(*quaHBox);
wavBox->pack_start(*LocalcurveEditorwavden, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor
wavBox->pack_start(*sensiden);
wavBox->pack_start(*reparden);
ToolParamBlock* const prevBox = Gtk::manage(new ToolParamBlock());
prevBox->pack_start(*lumLabels);
prevBox->pack_start(*lum46Labels);
prevBox->pack_start(*lCLabels);
prevBox->pack_start(*chroLabels);
prevBox->pack_start(*chro46Labels);
prevFrame->add(*prevBox);
wavBox->pack_start(*prevFrame);
ToolParamBlock* const nlbox = Gtk::manage(new ToolParamBlock());
nlbox->pack_start(*nlstr);
nlbox->pack_start(*nldet);
nlbox->pack_start(*nlgam);
nlbox->pack_start(*nlpat);
nlbox->pack_start(*nlrad);
expdenoisenl->add(*nlbox);
wavBox->pack_start(*expdenoisenl);
// wavBox->pack_start(*noiselumf0);
// wavBox->pack_start(*noiselumf);
// wavBox->pack_start(*noiselumf2);
// wavBox->pack_start(*noiselumc);//unused here, but used for normalize_mean_dt
wavBox->pack_start(*noiselumdetail);
wavBox->pack_start(*noiselequal);
wavBox->pack_start(*noisegam);
wavBox->pack_start(*LocalcurveEditorwavhue, Gtk::PACK_SHRINK, 4);
ToolParamBlock* const wchBox = Gtk::manage(new ToolParamBlock());
wchBox->pack_start(*LocalcurveEditorwavden, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor
wchBox->pack_start(*noiselumdetail);
wchBox->pack_start(*noiselequal);
wchBox->pack_start(*noisegam);
wchBox->pack_start(*LocalcurveEditorwavhue, Gtk::PACK_SHRINK, 4);
ToolParamBlock* const wavBox1 = Gtk::manage(new ToolParamBlock());
wavBox1->pack_start(*maskusable, Gtk::PACK_SHRINK, 0);
wavBox1->pack_start(*maskunusable, Gtk::PACK_SHRINK, 0);
@ -6854,28 +6914,24 @@ LocallabBlur::LocallabBlur():
wavBox1->pack_start(*levelthrlow, Gtk::PACK_SHRINK, 0);
wavBox1->pack_start(*levelthr, Gtk::PACK_SHRINK, 0);
expdenoise1->add(*wavBox1, false);
wavBox->pack_start(*expdenoise1);
wchBox->pack_start(*expdenoise1);
expdenoiselum->add(*wchBox);
wavBox->pack_start(*expdenoiselum);
ToolParamBlock* const chBox = Gtk::manage(new ToolParamBlock());
chBox->pack_start(*noisechrof);
chBox->pack_start(*noisechroc);
chBox->pack_start(*noisechrodetail);
chBox->pack_start(*adjblur);
expdenoisech->add(*chBox);
wavBox->pack_start(*expdenoisech);
ToolParamBlock* const detailBox = Gtk::manage(new ToolParamBlock());
detailBox->pack_start(*detailthr);
detailBox->pack_start(*usemask, Gtk::PACK_SHRINK, 0);
detailFrame->add(*detailBox);
wavBox->pack_start(*detailFrame);
denoisebox->pack_start(*sensiden);
denoisebox->pack_start(*reparden);
ToolParamBlock* const nlbox = Gtk::manage(new ToolParamBlock());
nlbox->pack_start(*nlstr);
nlbox->pack_start(*nldet);
nlbox->pack_start(*nlgam);
nlbox->pack_start(*nlpat);
nlbox->pack_start(*nlrad);
nlFrame->add(*nlbox);
wavBox->pack_start(*nlFrame);
wavBox->pack_start(*noisechrof);
wavBox->pack_start(*noisechroc);
wavBox->pack_start(*noisechrodetail);
wavBox->pack_start(*adjblur);
wavFrame->add(*wavBox);
denoisebox->pack_start(*wavFrame);
@ -6978,6 +7034,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips)
expdenoise1->set_tooltip_markup(M("TP_LOCALLAB_MASKLC_TOOLTIP"));
expdenoise2->set_tooltip_markup(M("TP_LOCALLAB_MASKGF_TOOLTIP"));
expdenoise3->set_tooltip_markup(M("TP_LOCALLAB_MASKDE_TOOLTIP"));
expdenoisenl->set_tooltip_markup(M("TP_LOCALLAB_NLFRAME_TOOLTIP"));
invmask->set_tooltip_text(M("TP_LOCALLAB_MASKDEINV_TOOLTIP"));
invmaskd->set_tooltip_text(M("TP_LOCALLAB_MASKDEINV_TOOLTIP"));
LocalcurveEditorwavden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP"));
@ -6990,7 +7047,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips)
detailthr->set_tooltip_text(M("TP_LOCALLAB_DENOITHR_TOOLTIP"));
adjblur->set_tooltip_text(M("TP_LOCALLAB_DENOIEQUALCHRO_TOOLTIP"));
bilateral->set_tooltip_text(M("TP_LOCALLAB_DENOIBILAT_TOOLTIP"));
nlFrame->set_tooltip_text(M("TP_LOCALLAB_NLFRAME_TOOLTIP"));
prevFrame->set_tooltip_text(M("TP_LOCALLAB_LCLABELS_TOOLTIP"));
nlstr->set_tooltip_text(M("TP_LOCALLAB_NLDENOISE_TOOLTIP"));
nldet->set_tooltip_text(M("TP_LOCALLAB_NLDENOISE_TOOLTIP"));
nlpat->set_tooltip_text(M("TP_LOCALLAB_NLDENOISENLPAT_TOOLTIP"));
@ -7025,6 +7082,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips)
higthresd->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP"));
higthres->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRES_TOOLTIP"));
decayd->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP"));
lCLabels->set_tooltip_text(M("TP_LOCALLAB_LCLABELS_TOOLTIP"));
} else {
expblnoise->set_tooltip_markup("");
@ -7057,7 +7115,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips)
detailthr->set_tooltip_text("");
adjblur->set_tooltip_text("");
bilateral->set_tooltip_text("");
nlFrame->set_tooltip_text("");
prevFrame->set_tooltip_text("");
nlstr->set_tooltip_text("");
nldet->set_tooltip_text("");
nlpat->set_tooltip_text("");
@ -7094,6 +7152,8 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips)
higthres->set_tooltip_text("");
// midthresd->set_tooltip_text("");
decayd->set_tooltip_text("");
lCLabels->set_tooltip_text("");
expdenoisenl->set_tooltip_markup("");
}
}
@ -7138,7 +7198,36 @@ void LocallabBlur::neutral_pressed ()
}
void LocallabBlur::updatedenlc(const double highres, const double nres, const double highres46, const double nres46, const double Lhighres, const double Lnres, const double Lhighres46, const double Lnres46)
{
idle_register.add(
[this, highres, nres, highres46, nres46, Lhighres, Lnres, Lhighres46, Lnres46]() -> bool {
GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected
lumLabels->set_text(
Glib::ustring::compose(M("TP_LOCALLAB_LUMLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(0), Lnres),
Glib::ustring::format(std::fixed, std::setprecision(0), Lhighres))
);
lum46Labels->set_text(
Glib::ustring::compose(M("TP_LOCALLAB_LUM46LABEL"),
Glib::ustring::format(std::fixed, std::setprecision(0), Lnres46 ),
Glib::ustring::format(std::fixed, std::setprecision(0), Lhighres46))
);
chroLabels->set_text(
Glib::ustring::compose(M("TP_LOCALLAB_CHROLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(0), nres),
Glib::ustring::format(std::fixed, std::setprecision(0), highres))
);
chro46Labels->set_text(
Glib::ustring::compose(M("TP_LOCALLAB_CHRO46LABEL"),
Glib::ustring::format(std::fixed, std::setprecision(0), nres46),
Glib::ustring::format(std::fixed, std::setprecision(0), highres46))
);
return false;
}
);
}
void LocallabBlur::setDefaultExpanderVisibility()
{
expblnoise->set_expanded(false);
@ -7147,6 +7236,9 @@ void LocallabBlur::setDefaultExpanderVisibility()
expdenoise2->set_expanded(false);
expdenoise3->set_expanded(false);
expmaskbl->set_expanded(false);
expdenoisenl->set_expanded(false);
expdenoiselum->set_expanded(false);
expdenoisech->set_expanded(false);
}
void LocallabBlur::disableListener()

View File

@ -451,6 +451,7 @@ private:
Adjuster* const reparsh;
const std::array<Adjuster*, 5> multipliersh;
Adjuster* const detailSH;
Adjuster* const tePivot;
Adjuster* const highlights;
Adjuster* const h_tonalwidth;
Adjuster* const shadows;
@ -492,6 +493,8 @@ private:
Adjuster* const fatamountSH;
Adjuster* const fatanchorSH;
rtengine::ProcEvent EvlocallabTePivot;
sigc::connection shMethodConn, inversshConn, showmaskSHMethodConn, showmaskSHMethodConninv, enaSHMaskConn;
public:
@ -707,8 +710,17 @@ private:
Gtk::CheckButton* const activlum;
MyExpander* const expdenoise;
MyComboBoxText* const quamethod;
MyExpander* const expdenoisenl;
MyExpander* const expdenoiselum;
MyExpander* const expdenoisech;
CurveEditorGroup* const LocalcurveEditorwavden;
FlatCurveEditor* const wavshapeden;
Gtk::Label* const lCLabels;
Gtk::Label* const lumLabels;
Gtk::Label* const lum46Labels;
Gtk::Label* const chroLabels;
Gtk::Label* const chro46Labels;
MyExpander* const expdenoise1;
Gtk::Label* const maskusable;
Gtk::Label* const maskunusable;
@ -746,7 +758,7 @@ private:
Gtk::CheckButton* const invmaskd;
Gtk::CheckButton* const invmask;
Gtk::Frame* const nlFrame;
Gtk::Frame* const prevFrame;
Adjuster* const nlstr;
Adjuster* const nldet;
Adjuster* const nlpat;
@ -788,6 +800,8 @@ private:
public:
LocallabBlur();
~LocallabBlur();
void updatedenlc(const double highres, const double nres, const double highres46, const double nres46, const double Lhighres, const double Lnres, const double Lhighres46, const double Lnres46);
bool isMaskViewActive() override;
void resetMaskView() override;

View File

@ -20,15 +20,23 @@
#include "lockablecolorpicker.h"
#include "options.h"
#include "../rtengine/color.h"
#include "../rtengine/improcfun.h"
#include "../rtengine/rt_math.h"
#include "../rtengine/utils.h"
#include "imagearea.h"
#include "multilangmgr.h"
#include "navigator.h"
LockableColorPicker::LockableColorPicker (CropWindow* cropWindow, Glib::ustring *oProfile, Glib::ustring *wProfile)
namespace
{
const rtengine::procparams::ColorManagementParams DEFAULT_CMP;
}
LockableColorPicker::LockableColorPicker (CropWindow* cropWindow, rtengine::procparams::ColorManagementParams *color_management_params)
: cropWindow(cropWindow), displayedValues(ColorPickerType::RGB), position(0, 0), size(Size::S15),
outputProfile(oProfile), workingProfile(wProfile), validity(Validity::OUTSIDE),
color_management_params(color_management_params), validity(Validity::OUTSIDE),
r(0.f), g(0.f), b(0.f), rpreview(0.f), gpreview(0.f), bpreview(0.f), hue(0.f), sat(0.f), val(0.f), L(0.f), a(0.f), bb(0.f)
{}
@ -277,7 +285,16 @@ void LockableColorPicker::setRGB (const float R, const float G, const float B, c
bpreview = previewB;
rtengine::Color::rgb2hsv01(r, g, b, hue, sat, val);
rtengine::Color::rgb2lab01(*outputProfile, *workingProfile, r, g, b, L, a, bb, options.rtSettings.HistogramWorking); // TODO: Really sure this function works?
rtengine::ImProcFunctions::rgb2lab(
static_cast<std::uint8_t>(255 * r),
static_cast<std::uint8_t>(255 * g),
static_cast<std::uint8_t>(255 * b),
L, a, bb,
color_management_params != nullptr ? *color_management_params : DEFAULT_CMP,
true);
L /= 327.68f;
a /= 327.68f;
bb /= 327.68f;
if (validity != Validity::OUTSIDE) {
setDirty(true);

View File

@ -24,6 +24,18 @@
class CropWindow;
namespace rtengine
{
namespace procparams
{
class ColorManagementParams;
}
}
class LockablePickerToolListener
{
public:
@ -60,8 +72,7 @@ private:
rtengine::Coord position; // Coordinate in image space
rtengine::Coord anchorOffset;
Size size;
Glib::ustring *outputProfile;
Glib::ustring *workingProfile;
rtengine::procparams::ColorManagementParams *color_management_params;
Validity validity;
float r, g, b; // red green blue in [0;1] range
float rpreview, gpreview, bpreview;
@ -72,7 +83,7 @@ private:
public:
LockableColorPicker (CropWindow* cropWindow, Glib::ustring *oProfile, Glib::ustring *wProfile);
LockableColorPicker (CropWindow* cropWindow, rtengine::procparams::ColorManagementParams *color_management_params);
void draw (const Cairo::RefPtr<Cairo::Context> &cr);

View File

@ -21,18 +21,26 @@
#include "previewwindow.h"
#include "toolpanel.h"
#include "../rtengine/color.h"
#include "../rtengine/improcfun.h"
#include "../rtengine/rt_math.h"
#include "options.h"
using namespace rtengine;
namespace
{
const rtengine::procparams::ColorManagementParams DEFAULT_CMP;
}
Navigator::Navigator() :
pointer_moved_delayed_call(50, 100),
currentRGBUnit(options.navRGBUnit),
currentHSVUnit(options.navHSVUnit)
{
pointer_moved_delayed_call.setFunction(
[this](bool validPos, Glib::ustring profile, Glib::ustring profileW, int x, int y, int r, int g, int b, bool isRaw)
[this](bool validPos, const rtengine::procparams::ColorManagementParams *cmp, int x, int y, int r, int g, int b, bool isRaw)
{
if (!validPos) {
setInvalid (x, y);
@ -61,7 +69,16 @@ Navigator::Navigator() :
S->set_text (s2);
V->set_text (s3);
Color::rgb2lab01(profile, profileW, r / 255.f, g / 255.f, b / 255.f, LAB_l, LAB_a, LAB_b, options.rtSettings.HistogramWorking); // TODO: Really sure this function works?
ImProcFunctions::rgb2lab(
static_cast<std::uint8_t>(r),
static_cast<std::uint8_t>(g),
static_cast<std::uint8_t>(b),
LAB_l, LAB_a, LAB_b,
cmp != nullptr ? *cmp : DEFAULT_CMP,
true);
LAB_l /= 327.68f;
LAB_a /= 327.68f;
LAB_b /= 327.68f;
getLABText (LAB_l, LAB_a, LAB_b, s1, s2, s3);
LAB_L->set_text (s1);
LAB_A->set_text (s2);
@ -328,9 +345,9 @@ void Navigator::getLABText (float l, float a, float b, Glib::ustring &sL, Glib::
}
// if !validPos then x/y contain the full image size
void Navigator::pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool isRaw)
void Navigator::pointerMoved (bool validPos, const rtengine::procparams::ColorManagementParams &cmp, int x, int y, int r, int g, int b, bool isRaw)
{
pointer_moved_delayed_call(validPos, profile, profileW, x, y, r, g, b, isRaw);
pointer_moved_delayed_call(validPos, &cmp, x, y, r, g, b, isRaw);
}
void Navigator::cycleUnitsRGB (GdkEventButton *event) {

View File

@ -34,7 +34,7 @@ class Navigator final :
typedef const double (*TMatrix)[3];
private:
DelayedCall<bool, Glib::ustring, Glib::ustring, int, int, int, int, int, bool> pointer_moved_delayed_call;
DelayedCall<bool, const rtengine::procparams::ColorManagementParams *, int, int, int, int, int, bool> pointer_moved_delayed_call;
Options::NavigatorUnit currentRGBUnit;
Options::NavigatorUnit currentHSVUnit;
@ -61,7 +61,7 @@ public:
// pointermotionlistener interface
// void pointerMoved (bool validPos, int x, int y, int r, int g, int b);
void pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool raw = false) override;
void pointerMoved(bool validPos, const rtengine::procparams::ColorManagementParams &cmp, int x, int y, int r, int g, int b, bool raw = false) override;
void setInvalid (int fullWidth = -1, int fullHeight = -1);
void getRGBText (int r, int g, int b, Glib::ustring &sR, Glib::ustring &sG, Glib::ustring &sB, bool isRaw = false) override;

View File

@ -19,7 +19,11 @@
#include "options.h"
#include <cstdio>
#include <glib/gstdio.h>
#include <glibmm/date.h>
#include <glibmm/fileutils.h>
#include <glibmm/keyfile.h>
#include <glibmm/miscutils.h>
#include <glibmm/regex.h>
#include <iostream>
#include <sstream>
#include "multilangmgr.h"
@ -627,7 +631,8 @@ void Options::setDefaults()
rtSettings.fftwsigma = true; //choice between sigma^2 or empirical formula
// end locallab
rtSettings.itcwb_enable = true;
rtSettings.itcwb_deltaspec = 0.075;
rtSettings.itcwb_powponder = 0.15;//max 0.2
//wavelet
rtSettings.edghi = 3.0;//1.1 and 5.
rtSettings.edglo = 0.5;//0.1 and 0.95
@ -1818,6 +1823,16 @@ void Options::readFromFile(Glib::ustring fname)
}
if (keyFile.has_key("Color Management", "Itcwb_deltaspec")) {
rtSettings.itcwb_deltaspec = keyFile.get_double("Color Management", "Itcwb_deltaspec");
}
if (keyFile.has_key("Color Management", "Itcwb_powponder")) {
rtSettings.itcwb_powponder = keyFile.get_double("Color Management", "Itcwb_powponder");
}
//if (keyFile.has_key ("Color Management", "Colortoningab")) rtSettings.colortoningab = keyFile.get_double("Color Management", "Colortoningab");
//if (keyFile.has_key ("Color Management", "Decaction")) rtSettings.decaction = keyFile.get_double("Color Management", "Decaction");
@ -2616,6 +2631,8 @@ void Options::saveToFile(Glib::ustring fname)
keyFile.set_double("Color Management", "CBDLlevel0", rtSettings.level0_cbdl);
keyFile.set_double("Color Management", "CBDLlevel123", rtSettings.level123_cbdl);
keyFile.set_boolean("Color Management", "Itcwb_enable", rtSettings.itcwb_enable);
keyFile.set_double("Color Management", "Itcwb_deltaspec", rtSettings.itcwb_deltaspec);
keyFile.set_double("Color Management", "Itcwb_powponder", rtSettings.itcwb_powponder);
//keyFile.set_double ("Color Management", "Colortoningab", rtSettings.colortoningab);
//keyFile.set_double ("Color Management", "Decaction", rtSettings.decaction);

View File

@ -327,7 +327,7 @@ public:
bool internalThumbIfUntouched;
bool overwriteOutputFile;
int complexity;
bool inspectorWindow; // open inspector in spearate window
bool inspectorWindow; // open inspector in separate window
bool zoomOnScroll; // translate scroll events to zoom
std::vector<double> thumbnailZoomRatios;

View File

@ -267,15 +267,11 @@ void ParamsEdited::set(bool v)
wb.equal = v;
wb.tempBias = v;
wb.observer = v;
wb.itcwb_thres = v;
wb.itcwb_precis = v;
wb.itcwb_size = v;
wb.itcwb_delta = v;
wb.itcwb_fgreen = v;
wb.itcwb_green = v;
wb.itcwb_rgreen = v;
wb.itcwb_nopurple = v;
wb.itcwb_sorted = v;
wb.itcwb_forceextra = v;
wb.itcwb_alg = v;
wb.itcwb_prim = v;
wb.itcwb_sampling = v;
//colorShift.a = v;
//colorShift.b = v;
@ -328,6 +324,11 @@ void ParamsEdited::set(bool v)
sh.stonalwidth = v;
sh.radius = v;
sh.lab = v;
toneEqualizer.enabled = v;
toneEqualizer.bands.fill(v);
toneEqualizer.regularization = v;
toneEqualizer.show_colormap = v;
toneEqualizer.pivot = v;
crop.enabled = v;
crop.x = v;
crop.y = v;
@ -980,15 +981,11 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
wb.temperature = wb.temperature && p.wb.temperature == other.wb.temperature;
wb.tempBias = wb.tempBias && p.wb.tempBias == other.wb.tempBias;
wb.observer = wb.observer && p.wb.observer == other.wb.observer;
wb.itcwb_thres = wb.itcwb_thres && p.wb.itcwb_thres == other.wb.itcwb_thres;
wb.itcwb_precis = wb.itcwb_precis && p.wb.itcwb_precis == other.wb.itcwb_precis;
wb.itcwb_size = wb.itcwb_size && p.wb.itcwb_size == other.wb.itcwb_size;
wb.itcwb_delta = wb.itcwb_delta && p.wb.itcwb_delta == other.wb.itcwb_delta;
wb.itcwb_fgreen = wb.itcwb_fgreen && p.wb.itcwb_fgreen == other.wb.itcwb_fgreen;
wb.itcwb_green = wb.itcwb_green && p.wb.itcwb_green == other.wb.itcwb_green;
wb.itcwb_rgreen = wb.itcwb_rgreen && p.wb.itcwb_rgreen == other.wb.itcwb_rgreen;
wb.itcwb_nopurple = wb.itcwb_nopurple && p.wb.itcwb_nopurple == other.wb.itcwb_nopurple;
wb.itcwb_sorted = wb.itcwb_sorted && p.wb.itcwb_sorted == other.wb.itcwb_sorted;
wb.itcwb_forceextra = wb.itcwb_forceextra && p.wb.itcwb_forceextra == other.wb.itcwb_forceextra;
wb.itcwb_alg = wb.itcwb_alg && p.wb.itcwb_alg == other.wb.itcwb_alg;
wb.itcwb_prim = wb.itcwb_prim && p.wb.itcwb_prim == other.wb.itcwb_prim;
wb.itcwb_sampling = wb.itcwb_sampling && p.wb.itcwb_sampling == other.wb.itcwb_sampling;
//colorShift.a = colorShift.a && p.colorShift.a == other.colorShift.a;
//colorShift.b = colorShift.b && p.colorShift.b == other.colorShift.b;
@ -1055,6 +1052,13 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
crop.ratio = crop.ratio && p.crop.ratio == other.crop.ratio;
crop.orientation = crop.orientation && p.crop.orientation == other.crop.orientation;
crop.guide = crop.guide && p.crop.guide == other.crop.guide;
toneEqualizer.enabled = toneEqualizer.enabled && p.toneEqualizer.enabled == other.toneEqualizer.enabled;
for (size_t i = 0; i < toneEqualizer.bands.size(); ++i) {
toneEqualizer.bands[i] = toneEqualizer.bands[i] && p.toneEqualizer.bands[i] == other.toneEqualizer.bands[i];
}
toneEqualizer.regularization = toneEqualizer.regularization && p.toneEqualizer.regularization == other.toneEqualizer.regularization;
toneEqualizer.show_colormap = toneEqualizer.show_colormap && p.toneEqualizer.show_colormap == other.toneEqualizer.show_colormap;
toneEqualizer.pivot = toneEqualizer.pivot && p.toneEqualizer.pivot == other.toneEqualizer.pivot;
coarse.rotate = coarse.rotate && p.coarse.rotate == other.coarse.rotate;
coarse.hflip = coarse.hflip && p.coarse.hflip == other.coarse.hflip;
coarse.vflip = coarse.vflip && p.coarse.vflip == other.coarse.vflip;
@ -1294,6 +1298,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
locallab.spots.at(j).slomaskSH = locallab.spots.at(j).slomaskSH && pSpot.slomaskSH == otherSpot.slomaskSH;
locallab.spots.at(j).lapmaskSH = locallab.spots.at(j).lapmaskSH && pSpot.lapmaskSH == otherSpot.lapmaskSH;
locallab.spots.at(j).detailSH = locallab.spots.at(j).detailSH && pSpot.detailSH == otherSpot.detailSH;
locallab.spots.at(j).tePivot = locallab.spots.at(j).tePivot && pSpot.tePivot == otherSpot.tePivot;
locallab.spots.at(j).reparsh = locallab.spots.at(j).reparsh && pSpot.reparsh == otherSpot.reparsh;
locallab.spots.at(j).LmaskSHcurve = locallab.spots.at(j).LmaskSHcurve && pSpot.LmaskSHcurve == otherSpot.LmaskSHcurve;
locallab.spots.at(j).fatamountSH = locallab.spots.at(j).fatamountSH && pSpot.fatamountSH == otherSpot.fatamountSH;
@ -2857,24 +2862,8 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.wb.observer = mods.wb.observer;
}
if (wb.itcwb_thres) {
toEdit.wb.itcwb_thres = mods.wb.itcwb_thres;
}
if (wb.itcwb_precis) {
toEdit.wb.itcwb_precis = mods.wb.itcwb_precis;
}
if (wb.itcwb_size) {
toEdit.wb.itcwb_size = mods.wb.itcwb_size;
}
if (wb.itcwb_delta) {
toEdit.wb.itcwb_delta = mods.wb.itcwb_delta;
}
if (wb.itcwb_fgreen) {
toEdit.wb.itcwb_fgreen = mods.wb.itcwb_fgreen;
if (wb.itcwb_green) {
toEdit.wb.itcwb_green = mods.wb.itcwb_green;
}
if (wb.itcwb_rgreen) {
@ -2885,12 +2874,12 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.wb.itcwb_nopurple = mods.wb.itcwb_nopurple;
}
if (wb.itcwb_sorted) {
toEdit.wb.itcwb_sorted = mods.wb.itcwb_sorted;
if (wb.itcwb_alg) {
toEdit.wb.itcwb_alg = mods.wb.itcwb_alg;
}
if (wb.itcwb_forceextra) {
toEdit.wb.itcwb_forceextra = mods.wb.itcwb_forceextra;
if (wb.itcwb_prim) {
toEdit.wb.itcwb_prim = mods.wb.itcwb_prim;
}
if (wb.itcwb_sampling) {
@ -3265,6 +3254,37 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.sh.lab = mods.sh.lab;
}
if (toneEqualizer.enabled) {
toEdit.toneEqualizer.enabled = mods.toneEqualizer.enabled;
}
for (size_t i = 0; i < toneEqualizer.bands.size(); ++i) {
if (toneEqualizer.bands[i]) {
toEdit.toneEqualizer.bands[i] =
dontforceSet && options.baBehav[ADDSET_TONE_EQUALIZER_BANDS]
? toEdit.toneEqualizer.bands[i] + mods.toneEqualizer.bands[i]
: mods.toneEqualizer.bands[i];
}
}
if (toneEqualizer.regularization) {
toEdit.toneEqualizer.regularization =
dontforceSet && options.baBehav[ADDSET_TONE_EQUALIZER_REGULARIZATION]
? toEdit.toneEqualizer.regularization + mods.toneEqualizer.regularization
: mods.toneEqualizer.regularization;
}
if (toneEqualizer.show_colormap) {
toEdit.toneEqualizer.show_colormap = mods.toneEqualizer.show_colormap;
}
if (toneEqualizer.pivot) {
toEdit.toneEqualizer.pivot =
dontforceSet && options.baBehav[ADDSET_TONE_EQUALIZER_PIVOT]
? toEdit.toneEqualizer.pivot + mods.toneEqualizer.pivot
: mods.toneEqualizer.pivot;
}
if (crop.enabled) {
toEdit.crop.enabled = mods.crop.enabled;
}
@ -4207,6 +4227,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).detailSH = mods.locallab.spots.at(i).detailSH;
}
if (locallab.spots.at(i).tePivot) {
toEdit.locallab.spots.at(i).tePivot = mods.locallab.spots.at(i).tePivot;
}
if (locallab.spots.at(i).reparsh) {
toEdit.locallab.spots.at(i).reparsh = mods.locallab.spots.at(i).reparsh;
}
@ -7660,6 +7684,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
slomaskSH(v),
lapmaskSH(v),
detailSH(v),
tePivot(v),
reparsh(v),
LmaskSHcurve(v),
fatamountSH(v),
@ -8355,6 +8380,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
slomaskSH = v;
lapmaskSH = v;
detailSH = v;
tePivot = v;
reparsh = v;
LmaskSHcurve = v;
fatamountSH = v;

View File

@ -18,6 +18,7 @@
*/
#pragma once
#include <array>
#include <vector>
namespace rtengine
@ -248,16 +249,12 @@ struct WBParamsEdited {
bool equal;
bool observer;
bool tempBias;
bool itcwb_thres;
bool itcwb_precis;
bool itcwb_size;
bool itcwb_delta;
bool itcwb_fgreen;
bool itcwb_rgreen;
bool itcwb_nopurple;
bool itcwb_sorted;
bool itcwb_forceextra;
bool itcwb_alg;
bool itcwb_prim;
bool itcwb_sampling;
bool itcwb_green;
};
@ -370,6 +367,14 @@ struct SHParamsEdited {
bool lab;
};
struct ToneEqualizerParamsEdited {
bool enabled;
std::array<bool, 5> bands;
bool regularization;
bool show_colormap;
bool pivot;
};
struct CropParamsEdited {
bool enabled;
bool x;
@ -591,6 +596,7 @@ public:
bool slomaskSH;
bool lapmaskSH;
bool detailSH;
bool tePivot;
bool reparsh;
bool LmaskSHcurve;
bool fatamountSH;
@ -1559,6 +1565,7 @@ struct ParamsEdited {
FattalToneMappingParamsEdited fattal;
ImpulseDenoiseParamsEdited impulseDenoise;
SHParamsEdited sh;
ToneEqualizerParamsEdited toneEqualizer;
CropParamsEdited crop;
CoarseTransformParamsEdited coarse;
CommonTransformParamsEdited commonTrans;

View File

@ -219,6 +219,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren
wb = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_WHITEBALANCE")));
exposure = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_EXPOSURE")));
sh = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_SHADOWSHIGHLIGHTS")));
toneEqualizer = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_TONE_EQUALIZER")));
epd = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_EPD")));
fattal = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_TM_FATTAL")));
pcvignette = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PCVIGNETTE")));
@ -332,6 +333,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren
vboxes[0]->pack_start (*wb, Gtk::PACK_SHRINK, 2);
vboxes[0]->pack_start (*exposure, Gtk::PACK_SHRINK, 2);
vboxes[0]->pack_start (*sh, Gtk::PACK_SHRINK, 2);
vboxes[0]->pack_start (*toneEqualizer, Gtk::PACK_SHRINK, 2);
vboxes[0]->pack_start (*epd, Gtk::PACK_SHRINK, 2);
vboxes[0]->pack_start (*fattal, Gtk::PACK_SHRINK, 2);
vboxes[0]->pack_start (*pcvignette, Gtk::PACK_SHRINK, 2);
@ -498,6 +500,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren
wbConn = wb->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
exposureConn = exposure->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
shConn = sh->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
toneEqualizerConn = toneEqualizer->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
epdConn = epd->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
fattalConn = fattal->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
pcvignetteConn = pcvignette->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true));
@ -706,6 +709,7 @@ void PartialPasteDlg::basicToggled ()
ConnectionBlocker wbBlocker(wbConn);
ConnectionBlocker exposureBlocker(exposureConn);
ConnectionBlocker shBlocker(shConn);
ConnectionBlocker toneEqualizerBlocker(toneEqualizerConn);
ConnectionBlocker epdBlocker(epdConn);
ConnectionBlocker fattalBlocker(fattalConn);
ConnectionBlocker pcvignetteBlocker(pcvignetteConn);
@ -717,6 +721,7 @@ void PartialPasteDlg::basicToggled ()
wb->set_active (basic->get_active ());
exposure->set_active (basic->get_active ());
sh->set_active (basic->get_active ());
toneEqualizer->set_active (basic->get_active ());
epd->set_active (basic->get_active ());
fattal->set_active (basic->get_active ());
pcvignette->set_active (basic->get_active ());
@ -894,6 +899,10 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param
filterPE.sh = falsePE.sh;
}
if (!toneEqualizer->get_active ()) {
filterPE.toneEqualizer = falsePE.toneEqualizer;
}
if (!epd->get_active ()) {
filterPE.epd = falsePE.epd;
}

View File

@ -133,6 +133,7 @@ public:
Gtk::CheckButton* exposure;
Gtk::CheckButton* localcontrast;
Gtk::CheckButton* sh;
Gtk::CheckButton* toneEqualizer;
Gtk::CheckButton* epd;
Gtk::CheckButton* fattal;
Gtk::CheckButton* retinex;
@ -226,6 +227,7 @@ public:
sigc::connection everythingConn, basicConn, detailConn, colorConn, lensConn, compositionConn, metaConn, rawConn, advancedConn;
sigc::connection locallabConn;
sigc::connection wbConn, exposureConn, localcontrastConn, shConn, pcvignetteConn, gradientConn, labcurveConn, colorappearanceConn;
sigc::connection toneEqualizerConn;
sigc::connection spotConn, sharpenConn, gradsharpenConn, microcontrastConn, impdenConn, dirpyrdenConn, defringeConn, epdConn, fattalConn, dirpyreqConn, waveletConn, retinexConn, dehazeConn;
sigc::connection vibranceConn, chmixerConn, hsveqConn, rgbcurvesConn, chmixerbwConn, colortoningConn, filmSimulationConn, softlightConn;
sigc::connection distortionConn, cacorrConn, vignettingConn, lcpConn;

View File

@ -18,6 +18,23 @@
*/
#pragma once
#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>
namespace rtengine
{
namespace procparams
{
class ColorManagementParams;
}
}
class PointerMotionListener
{
protected:
@ -26,7 +43,7 @@ protected:
public:
virtual ~PointerMotionListener() = default;
virtual void pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool isRaw = false) = 0;
virtual void pointerMoved(bool validPos, const rtengine::procparams::ColorManagementParams &cmp, int x, int y, int r, int g, int b, bool isRaw = false) = 0;
virtual void getRGBText (int r, int g, int b, Glib::ustring &sR, Glib::ustring &sG, Glib::ustring &sB, bool isRaw = false) { sR = "--"; sG = "--"; sB = "--"; }
virtual void getHSVText (float h, float s, float v, Glib::ustring &sH, Glib::ustring &sS, Glib::ustring &sV) { sH = "--"; sS = "--"; sV = "--"; }
virtual void getLABText (float l, float a, float b, Glib::ustring &sL, Glib::ustring &sA, Glib::ustring &sB) { sL = "--"; sA = "--"; sB = "--"; }

View File

@ -232,6 +232,12 @@ Gtk::Widget* Preferences::getBatchProcPanel()
appendBehavList(mi, M("TP_SHADOWSHLIGHTS_HIGHLIGHTS"), ADDSET_SH_HIGHLIGHTS, false);
appendBehavList(mi, M("TP_SHADOWSHLIGHTS_SHADOWS"), ADDSET_SH_SHADOWS, false);
mi = behModel->append();
mi->set_value(behavColumns.label, M("TP_TONE_EQUALIZER_LABEL"));
appendBehavList(mi, M("TP_TONE_EQUALIZER_BANDS"), ADDSET_TONE_EQUALIZER_BANDS, false);
appendBehavList(mi, M("TP_TONE_EQUALIZER_PIVOT"), ADDSET_TONE_EQUALIZER_PIVOT, false);
appendBehavList(mi, M("TP_TONE_EQUALIZER_DETAIL"), ADDSET_TONE_EQUALIZER_REGULARIZATION, false);
mi = behModel->append();
mi->set_value(behavColumns.label, M("TP_LABCURVE_LABEL"));
appendBehavList(mi, M("TP_LABCURVE_BRIGHTNESS"), ADDSET_LC_BRIGHTNESS, false);
@ -980,6 +986,23 @@ Gtk::Widget* Preferences::getColorManPanel ()
vbColorMan->pack_start (*fcie, Gtk::PACK_SHRINK);
//------------White-Balance auto temperature correlation
Gtk::Frame* fwbacorr = Gtk::manage(new Gtk::Frame(M("PREFERENCES_WBACORR")));
fwbacorr->set_tooltip_text(M("PREFERENCES_WBACORR_TOOLTIP"));
fwbacorr->set_label_align(0.025, 0.5);
Gtk::Box* wbaVB = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL) );
Gtk::Box* wbah = Gtk::manage ( new Gtk::Box () );
wbah->set_spacing (4);
mwbaena = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_WBAENA")));
setExpandAlignProperties(mwbaena, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER);
mwbaena->set_active(true);
wbah->pack_start(*mwbaena, Gtk::PACK_SHRINK, 0);
wbaVB->add(*wbah);
fwbacorr->add (*wbaVB);
vbColorMan->pack_start (*fwbacorr, Gtk::PACK_SHRINK);
//-------------
swColorMan->add(*vbColorMan);
@ -1850,6 +1873,7 @@ void Preferences::storePreferences()
moptions.rtSettings.monitorBPC = monBPC->get_active();
moptions.rtSettings.autoMonitorProfile = cbAutoMonProfile->get_active();
moptions.rtSettings.autocielab = mcie->get_active();
moptions.rtSettings.itcwb_enable = mwbaena->get_active();
#endif
@ -2012,6 +2036,7 @@ void Preferences::fillPreferences()
monBPC->set_active(moptions.rtSettings.monitorBPC);
mcie->set_active(moptions.rtSettings.autocielab);
mwbaena->set_active(moptions.rtSettings.itcwb_enable);
cbAutoMonProfile->set_active(moptions.rtSettings.autoMonitorProfile);
#endif

View File

@ -137,9 +137,11 @@ class Preferences final :
Gtk::CheckButton* cbdaubech;
Gtk::SpinButton* hlThresh;
Gtk::SpinButton* shThresh;
// Gtk::CheckButton* mwbacorr;
Gtk::CheckButton* mwbacorr;
// Gtk::CheckButton* mwbaforc;
// Gtk::CheckButton* mwbanopurp;
Gtk::CheckButton* mwbaena;
// Gtk::CheckButton* mwbaenacustom;
// Gtk::CheckButton* mwbasort;
// Gtk::SpinButton* wbacorrnb;

View File

@ -288,6 +288,12 @@ void ProfilePanel::save_clicked (GdkEventButton* event)
toSave = entry ? ProfileStore::getInstance()->getProfile(entry) : nullptr;
}
// If no entry has been selected or anything unpredictable happened, toSave
// can be nullptr.
if (toSave == nullptr) {
return;
}
// If it's a partial profile, it's more intuitive to first allow the user
// to choose which parameters to save before showing the Save As dialog
// #5491
@ -336,50 +342,70 @@ void ProfilePanel::save_clicked (GdkEventButton* event)
filter_any->add_pattern("*");
dialog.add_filter(filter_any);
bool done = true;
while (true) {
do {
if (dialog.run() == Gtk::RESPONSE_OK) {
// Run the saving dialog and let the user select a path and filename.
const auto response = dialog.run();
std::string fname = dialog.get_filename();
if (response != Gtk::RESPONSE_OK) {
// Just exit the loop, cause the user cancels the dialog.
break;
} else {
// Go on with saving the the profile.
auto fname = dialog.get_filename();
if (("." + getExtension(fname)) != paramFileExtension) {
fname += paramFileExtension;
}
if (!confirmOverwrite(dialog, fname)) {
// The user doesn't want to override the existing file. So, just restart the loop,
// so the user can select a different path or file name.
continue;
}
lastFilename = Glib::path_get_basename(fname);
if (toSave) {
int retCode;
auto retCode = -1;
if (isPartial) {
// Build partial profile
PartialProfile ppTemp(true);
partialProfileDlg->applyPaste(ppTemp.pparams, ppTemp.pedited, toSave->pparams, nullptr);
// Save partial profile
retCode = ppTemp.pparams->save(fname, "", true, ppTemp.pedited);
// Cleanup
ppTemp.deleteInstance();
} else {
// Save full profile
retCode = toSave->pparams->save(fname);
}
if (isPartial) {
// Build partial profile
PartialProfile ppTemp(true);
partialProfileDlg->applyPaste(ppTemp.pparams, ppTemp.pedited, toSave->pparams, nullptr);
// Save partial profile
retCode = ppTemp.pparams->save(fname, "", true, ppTemp.pedited);
// Cleanup
ppTemp.deleteInstance();
} else {
// Save full profile
retCode = toSave->pparams->save(fname);
}
if (!retCode) {
const auto ccPrevState = changeconn.block(true);
ProfileStore::getInstance()->parseProfiles();
changeconn.block(ccPrevState);
} else {
done = false;
writeFailed(dialog, fname);
}
if (retCode == 0) {
// Saving the profile was successfull.
const auto ccPrevState = changeconn.block(true);
ProfileStore::getInstance()->parseProfiles();
changeconn.block(ccPrevState);
// Because saving has been successfull, just leave the loop;
break;
} else {
// Saving the profile was not successfull.
writeFailed(dialog, fname);
// In case the saving process was not successfull (missing permissions, ...)
// reopen the dialog and try again.
continue;
}
}
} while (!done);
}
}
/*

View File

@ -241,6 +241,7 @@ RTWindow::RTWindow ()
RTImage::init();
WhiteBalance::init();
MyExpander::init();
FileBrowserEntry::init();
#ifndef WIN32
const std::vector<Glib::RefPtr<Gdk::Pixbuf>> appIcons = {

View File

@ -27,6 +27,8 @@
#if STRICT_MUTEX && !NDEBUG
MyMutex::MyMutex() : locked(false) {}
void MyMutex::checkLock ()
{
if (locked) {
@ -61,13 +63,18 @@ void MyMutex::checkUnlock ()
#if !TRACE_MYRWMUTEX
MyRWMutex::MyRWMutex() :
writerCount(0),
readerCount(0)
{}
void MyReaderLock::acquire ()
{
if (locked) {
return;
}
Glib::Threads::Mutex::Lock lock (mutex.mutex);
std::unique_lock<std::mutex> lock (mutex.mutex);
if (mutex.writerCount == 0) {
// There's no writer operating, we can increment the writer count which will lock writers.
@ -76,7 +83,7 @@ void MyReaderLock::acquire ()
// The writer count is non null, but a reader can be the owner of the writer lock,
// which will be the case if the reader count is not zero too.
while (mutex.writerCount != 0) {
mutex.cond.wait(mutex.mutex);
mutex.cond.wait (lock);
}
// Then, we can increment the writer count.
@ -95,7 +102,7 @@ void MyReaderLock::release ()
return;
}
Glib::Threads::Mutex::Lock lock (mutex.mutex);
std::unique_lock<std::mutex> lock (mutex.mutex);
// decrement the writer number first...
--mutex.readerCount;
@ -105,7 +112,7 @@ void MyReaderLock::release ()
--mutex.writerCount;
// ...and signal the next waiting reader/writer that it's free
mutex.cond.broadcast ();
mutex.cond.notify_all ();
}
locked = false;
@ -117,11 +124,11 @@ void MyWriterLock::acquire ()
return;
}
Glib::Threads::Mutex::Lock lock (mutex.mutex);
std::unique_lock<std::mutex> lock (mutex.mutex);
// The writer count is not zero, so we have to wait for it to be zero again...
while (mutex.writerCount != 0) {
mutex.cond.wait (mutex.mutex);
mutex.cond.wait (lock);
}
// ...then we can increment the writer count.
@ -136,12 +143,12 @@ void MyWriterLock::release ()
return;
}
Glib::Threads::Mutex::Lock lock (mutex.mutex);
std::unique_lock<std::mutex> lock (mutex.mutex);
// Decrement the writer number first...
if (--mutex.writerCount == 0) {
// ...and if the writer count is zero again, we can wake up the next writer or reader.
mutex.cond.broadcast ();
// ...and if the writer count is zero again, we wake up all of the waiting writer or reader.
mutex.cond.notify_all ();
}
locked = false;
@ -154,13 +161,20 @@ namespace
std::ostream& trace (const char* file, int line)
{
const auto currentThread = Glib::Threads::Thread::self ();
const auto currentThread = std::this_thread::get_id();
return std::cout << currentThread << ":" << file << ":" << line << ": ";
}
}
MyRWMutex::MyRWMutex() :
lastWriterFile(nullptr),
lastWriterLine(0),
writerCount(0),
readerCount(0)
{}
void MyReaderLock::acquire (const char* file, int line)
{
if (locked) {
@ -170,7 +184,7 @@ void MyReaderLock::acquire (const char* file, int line)
trace (file, line) << "Acquiring MyReaderLock..." << std::endl;
Glib::Threads::Mutex::Lock lock (mutex.mutex);
std::unique_lock<std::mutex> lock (mutex.mutex);
if (mutex.writerCount == 0) {
// There's no writer operating, we can increment the writer count which will lock writers.
@ -184,13 +198,13 @@ void MyReaderLock::acquire (const char* file, int line)
<< "\tLast writer file: " << mutex.lastWriterFile << std::endl
<< "\tLast writer line: " << mutex.lastWriterLine << std::endl;
mutex.cond.wait(mutex.mutex);
mutex.cond.wait (lock);
}
// Then, we can increment the writer count.
++mutex.writerCount;
mutex.ownerThread = Glib::Threads::Thread::self ();
mutex.ownerThread = std::this_thread::get_id ();
mutex.lastWriterFile = file;
mutex.lastWriterLine = line;
}
@ -211,7 +225,7 @@ void MyReaderLock::release (const char* file, int line)
trace (file, line) << "Releasing MyReaderLock..." << std::endl;
Glib::Threads::Mutex::Lock lock (mutex.mutex);
std::unique_lock<std::mutex> lock (mutex.mutex);
// decrement the writer number first...
--mutex.readerCount;
@ -221,9 +235,9 @@ void MyReaderLock::release (const char* file, int line)
--mutex.writerCount;
// ...and signal the next waiting reader/writer that it's free
mutex.cond.broadcast ();
mutex.cond.notify_all ();
mutex.ownerThread = nullptr;
mutex.ownerThread = std::thread::id();
mutex.lastWriterFile = "";
mutex.lastWriterLine = 0;
}
@ -241,7 +255,7 @@ void MyWriterLock::acquire (const char* file, int line)
trace (file, line) << "Acquiring MyWriterLock..." << std::endl;
Glib::Threads::Mutex::Lock lock (mutex.mutex);
std::unique_lock<std::mutex> lock (mutex.mutex);
// The writer count is not zero, so we have to wait for it to be zero again...
while (mutex.writerCount != 0) {
@ -250,13 +264,13 @@ void MyWriterLock::acquire (const char* file, int line)
<< "\tLast writer file: " << mutex.lastWriterFile << std::endl
<< "\tLast writer line: " << mutex.lastWriterLine << std::endl;
mutex.cond.wait (mutex.mutex);
mutex.cond.wait (lock);
}
// ...then we can increment the writer count.
++mutex.writerCount;
mutex.ownerThread = Glib::Threads::Thread::self ();
mutex.ownerThread = std::this_thread::get_id ();
mutex.lastWriterFile = file;
mutex.lastWriterLine = line;
@ -273,14 +287,14 @@ void MyWriterLock::release (const char* file, int line)
trace (file, line) << "Releasing MyWriterLock..." << std::endl;
Glib::Threads::Mutex::Lock lock (mutex.mutex);
std::unique_lock<std::mutex> lock (mutex.mutex);
// Decrement the writer number first...
if (--mutex.writerCount == 0) {
// ...and if the writer count is zero again, we can wake up the next writer or reader.
mutex.cond.broadcast ();
// ...and if the writer count is zero again, we wake up all of the waiting writer or reader.
mutex.cond.notify_all ();
mutex.ownerThread = nullptr;
mutex.ownerThread = std::thread::id();
mutex.lastWriterFile = "";
mutex.lastWriterLine = 0;
}

View File

@ -24,14 +24,15 @@
//#undef STRICT_MUTEX
//#define STRICT_MUTEX 1
#include <glibmm/threads.h>
#include <mutex>
#include <thread>
#include <condition_variable>
#include "../rtengine/noncopyable.h"
#if STRICT_MUTEX && NDEBUG
using MyMutexBase = Glib::Threads::Mutex;
using MyMutexBase = std::mutex;
#else
using MyMutexBase = Glib::Threads::RecMutex;
using MyMutexBase = std::recursive_mutex;
#endif
/**
@ -54,8 +55,10 @@ public:
void unlock ();
#if STRICT_MUTEX && !NDEBUG
MyMutex();
private:
bool locked = false;
bool locked;
void checkLock ();
void checkUnlock ();
#endif
@ -66,8 +69,6 @@ class MyMutex::MyLock :
{
public:
explicit MyLock (MyMutex& mutex);
MyLock (MyMutex& mutex, Glib::Threads::NotLock);
MyLock (MyMutex& mutex, Glib::Threads::TryLock);
~MyLock ();
@ -90,18 +91,20 @@ public:
friend class MyReaderLock;
friend class MyWriterLock;
MyRWMutex();
private:
Glib::Threads::Mutex mutex;
Glib::Threads::Cond cond;
std::size_t writerCount = 0;
std::size_t readerCount = 0;
#if TRACE_MYRWMUTEX
Glib::Threads::Thread* ownerThread = nullptr;
const char* lastWriterFile = "";
int lastWriterLine = 0;
std::thread::id ownerThread;
const char* lastWriterFile;
int lastWriterLine;
#endif
std::mutex mutex;
std::condition_variable cond;
std::size_t writerCount;
std::size_t readerCount;
};
/**
@ -167,7 +170,7 @@ inline void MyMutex::lock ()
inline bool MyMutex::trylock ()
{
if (MyMutexBase::trylock ()) {
if (MyMutexBase::try_lock ()) {
#if STRICT_MUTEX && !NDEBUG
checkLock ();
#endif
@ -194,18 +197,6 @@ inline MyMutex::MyLock::MyLock (MyMutex& mutex)
mutex.lock();
}
inline MyMutex::MyLock::MyLock (MyMutex& mutex, Glib::Threads::NotLock)
: mutex (mutex)
, locked (false)
{
}
inline MyMutex::MyLock::MyLock (MyMutex& mutex, Glib::Threads::TryLock)
: mutex (mutex)
, locked (mutex.trylock ())
{
}
inline MyMutex::MyLock::~MyLock ()
{
if (locked) {

View File

@ -781,6 +781,11 @@ void ThumbBrowserBase::arrangeFiles(ThumbBrowserEntryBase* entry)
for (int i = 0; ct < fd.size() && i < numOfCols; ++i, ++ct) {
for (; ct < fd.size() && fd[ct]->filtered; ++ct) {
// Thumbs that are not going be drawn should also have a minimum height and width. Cause
// the properties might be used in other parts of the code. The position is just set to be
// zero as a default.
fd[ct]->setPosition(0, 0, colWidths[i], rowHeight);
fd[ct]->drawable = false;
}

View File

@ -85,9 +85,9 @@ public:
Glib::ThreadPool* threadPool_;
// Need to be a Glib::Threads::Mutex because used in a Glib::Threads::Cond object...
// Need to be a std::mutex because used in a std::condition_variable object...
// This is the only exceptions along with GThreadMutex (guiutils.cc), MyMutex is used everywhere else
Glib::Threads::Mutex mutex_;
std::mutex mutex_;
JobList jobs_;
@ -95,7 +95,7 @@ public:
bool inactive_waiting_;
Glib::Threads::Cond inactive_;
std::condition_variable inactive_;
void
processNextJob()
@ -103,7 +103,7 @@ public:
Job j;
{
Glib::Threads::Mutex::Lock lock(mutex_);
std::lock_guard<std::mutex> lock(mutex_);
// nothing to do; could be jobs have been removed
if ( jobs_.empty() ) {
@ -166,10 +166,10 @@ public:
}
if ( --active_ == 0 ) {
Glib::Threads::Mutex::Lock lock(mutex_);
std::lock_guard<std::mutex> lock(mutex_);
if (inactive_waiting_) {
inactive_waiting_ = false;
inactive_.broadcast();
inactive_.notify_all();
}
}
}
@ -198,7 +198,7 @@ void ThumbImageUpdater::add(ThumbBrowserEntryBase* tbe, bool* priority, bool upg
return;
}
Glib::Threads::Mutex::Lock lock(impl_->mutex_);
std::lock_guard<std::mutex> lock(impl_->mutex_);
// look up if an older version is in the queue
Impl::JobList::iterator i(impl_->jobs_.begin());
@ -230,7 +230,7 @@ void ThumbImageUpdater::removeJobs(ThumbImageUpdateListener* listener)
DEBUG("removeJobs(%p)", listener);
{
Glib::Threads::Mutex::Lock lock(impl_->mutex_);
std::lock_guard<std::mutex> lock(impl_->mutex_);
for( Impl::JobList::iterator i(impl_->jobs_.begin()); i != impl_->jobs_.end(); ) {
if (i->listener_ == listener) {
@ -246,9 +246,9 @@ void ThumbImageUpdater::removeJobs(ThumbImageUpdateListener* listener)
while ( impl_->active_ != 0 ) {
DEBUG("waiting for running jobs1");
{
Glib::Threads::Mutex::Lock lock(impl_->mutex_);
std::unique_lock<std::mutex> lock(impl_->mutex_);
impl_->inactive_waiting_ = true;
impl_->inactive_.wait(impl_->mutex_);
impl_->inactive_.wait(lock);
}
}
}
@ -258,7 +258,7 @@ void ThumbImageUpdater::removeAllJobs()
DEBUG("stop");
{
Glib::Threads::Mutex::Lock lock(impl_->mutex_);
std::lock_guard<std::mutex> lock(impl_->mutex_);
impl_->jobs_.clear();
}
@ -266,9 +266,9 @@ void ThumbImageUpdater::removeAllJobs()
while ( impl_->active_ != 0 ) {
DEBUG("waiting for running jobs2");
{
Glib::Threads::Mutex::Lock lock(impl_->mutex_);
std::unique_lock<std::mutex> lock(impl_->mutex_);
impl_->inactive_waiting_ = true;
impl_->inactive_.wait(impl_->mutex_);
impl_->inactive_.wait(lock);
}
}
}

View File

@ -516,6 +516,7 @@ void Thumbnail::setProcParams (const ProcParams& pp, ParamsEdited* pe, int whoCh
|| pparams->epd != pp.epd
|| pparams->fattal != pp.fattal
|| pparams->sh != pp.sh
|| pparams->toneEqualizer != pp.toneEqualizer
|| pparams->crop != pp.crop
|| pparams->coarse != pp.coarse
|| pparams->commonTrans != pp.commonTrans

237
rtgui/toneequalizer.cc Normal file
View File

@ -0,0 +1,237 @@
/*
* Adapted from ART.
*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#include "eventmapper.h"
#include "toneequalizer.h"
#include "rtimage.h"
using namespace rtengine;
using namespace rtengine::procparams;
const Glib::ustring ToneEqualizer::TOOL_NAME = "toneequalizer";
ToneEqualizer::ToneEqualizer(): FoldableToolPanel(this, TOOL_NAME, M("TP_TONE_EQUALIZER_LABEL"), false, true)
{
auto m = ProcEventMapper::getInstance();
EvEnabled = m->newEvent(AUTOEXP, "HISTORY_MSG_TONE_EQUALIZER_ENABLED");
EvBands = m->newEvent(AUTOEXP, "HISTORY_MSG_TONE_EQUALIZER_BANDS");
EvRegularization = m->newEvent(AUTOEXP, "HISTORY_MSG_TONE_EQUALIZER_REGULARIZATION");
EvColormap = m->newEvent(AUTOEXP, "HISTORY_MSG_TONE_EQUALIZER_SHOW_COLOR_MAP");
EvPivot = m->newEvent(AUTOEXP, "HISTORY_MSG_TONE_EQUALIZER_PIVOT");
std::array<const char *, 5> images = {
"purple",
"blue",
"gray",
"yellow",
"red"
};
for (size_t i = 0; i < bands.size(); ++i) {
bands[i] = Gtk::manage(new Adjuster(M("TP_TONE_EQUALIZER_BAND_" + std::to_string(i)), -100, 100, 1, 0, Gtk::manage(new RTImage(Glib::ustring("circle-") + images[i] + "-small.png"))));
bands[i]->setAdjusterListener(this);
pack_start(*bands[i]);
bands[i]->showIcons(false);
}
pivot = Gtk::manage(new Adjuster(M("TP_TONE_EQUALIZER_PIVOT"), -12, 12, 0.05, 0));
pivot->setLogScale(64, 0, true);
pivot->setAdjusterListener(this);
pack_start(*pivot);
pack_start(*Gtk::manage(new Gtk::HSeparator()));
regularization = Gtk::manage(new Adjuster(M("TP_TONE_EQUALIZER_DETAIL"), -5, 5, 1, 0));
regularization->setAdjusterListener(this);
pack_start(*regularization);
show_colormap = Gtk::manage(new CheckBox(M("TP_TONE_EQUALIZER_SHOW_COLOR_MAP"), multiImage));
pack_start(*show_colormap);
show_colormap->setCheckBoxListener(this);
show_all_children ();
}
void ToneEqualizer::read(const ProcParams *pp, const ParamsEdited* pedited)
{
disableListener();
if (pedited) {
set_inconsistent(multiImage && !pedited->toneEqualizer.enabled);
for (size_t i = 0; i < bands.size(); ++i) {
bands[i]->setEditedState(pedited->toneEqualizer.bands[i] ? Edited : UnEdited);
}
regularization->setEditedState(pedited->toneEqualizer.regularization ? Edited : UnEdited);
pivot->setEditedState(pedited->toneEqualizer.pivot ? Edited : UnEdited);
show_colormap->setEdited(pedited->toneEqualizer.show_colormap ? Edited : UnEdited);
}
setEnabled(pp->toneEqualizer.enabled);
for (size_t i = 0; i < bands.size(); ++i) {
bands[i]->setValue(pp->toneEqualizer.bands[i]);
bands[i]->showIcons(pp->toneEqualizer.show_colormap);
}
regularization->setValue(pp->toneEqualizer.regularization);
pivot->setValue(pp->toneEqualizer.pivot);
show_colormap->setValue(pp->toneEqualizer.show_colormap);
enableListener();
}
void ToneEqualizer::write(ProcParams *pp, ParamsEdited* pedited)
{
for (size_t i = 0; i < bands.size(); ++i) {
pp->toneEqualizer.bands[i] = bands[i]->getValue();
}
pp->toneEqualizer.enabled = getEnabled();
pp->toneEqualizer.regularization = regularization->getValue();
pp->toneEqualizer.show_colormap = show_colormap->getLastActive();
pp->toneEqualizer.pivot = pivot->getValue();
if (pedited) {
auto &edited = pedited->toneEqualizer;
edited.enabled = !get_inconsistent();
for (size_t i = 0; i < bands.size(); ++i) {
edited.bands[i] = bands[i]->getEditedState();
}
edited.regularization = regularization->getEditedState();
edited.pivot = pivot->getEditedState();
edited.show_colormap = show_colormap->getEdited();
}
}
void ToneEqualizer::setDefaults(const ProcParams *defParams, const ParamsEdited* pedited)
{
for (size_t i = 0; i < bands.size(); ++i) {
bands[i]->setDefault(defParams->toneEqualizer.bands[i]);
}
regularization->setDefault(defParams->toneEqualizer.regularization);
pivot->setDefault(defParams->toneEqualizer.pivot);
inital_params = defParams->toneEqualizer;
if (pedited) {
auto &edited = pedited->toneEqualizer;
for (size_t i = 0; i < bands.size(); ++i) {
bands[i]->setDefaultEditedState(edited.bands[i] ? Edited : UnEdited);
}
regularization->setDefaultEditedState(edited.regularization ? Edited : UnEdited);
pivot->setDefaultEditedState(edited.pivot ? Edited : UnEdited);
} else {
for (auto band : bands) {
band->setDefaultEditedState(Irrelevant);
}
regularization->setDefaultEditedState(Irrelevant);
pivot->setDefaultEditedState(Irrelevant);
}
}
void ToneEqualizer::adjusterChanged(Adjuster *a, double newval)
{
if (listener && getEnabled()) {
if (a == regularization) {
listener->panelChanged(EvRegularization, Glib::ustring::format(a->getValue()));
} else if (a == pivot) {
listener->panelChanged(EvPivot, Glib::ustring::format(a->getValue()));
} else {
Glib::ustring s;
for (size_t i = 0; i < bands.size(); ++i) {
s += Glib::ustring::format((int)bands[i]->getValue()) + " ";
}
listener->panelChanged(EvBands, s);
}
}
}
void ToneEqualizer::adjusterAutoToggled(Adjuster *a)
{
}
void ToneEqualizer::enabledChanged()
{
if (listener) {
if (get_inconsistent()) {
listener->panelChanged(EvEnabled, M("GENERAL_UNCHANGED"));
} else if (getEnabled()) {
listener->panelChanged(EvEnabled, M("GENERAL_ENABLED"));
} else {
listener->panelChanged(EvEnabled, M("GENERAL_DISABLED"));
}
}
}
void ToneEqualizer::setBatchMode(bool batchMode)
{
ToolPanel::setBatchMode(batchMode);
if (batchMode) {
for (auto band : bands) {
band->showEditedCB();
}
regularization->showEditedCB();
pivot->showEditedCB();
}
}
void ToneEqualizer::setAdjusterBehavior(bool bands_add, bool regularization_add, bool pivot_add)
{
for (auto band : bands) {
band->setAddMode(bands_add);
}
regularization->setAddMode(regularization_add);
pivot->setAddMode(pivot_add);
}
void ToneEqualizer::checkBoxToggled(CheckBox *c, CheckValue newval)
{
if (c == show_colormap) {
colormapToggled();
}
}
void ToneEqualizer::colormapToggled()
{
for (size_t i = 0; i < bands.size(); ++i) {
bands[i]->showIcons(show_colormap->getLastActive());
}
if (listener && getEnabled()) {
listener->panelChanged(EvColormap, show_colormap->getLastActive() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"));
}
}
void ToneEqualizer::trimValues(rtengine::procparams::ProcParams *pp)
{
for (size_t i = 0; i < bands.size(); ++i) {
bands[i]->trimValue(pp->toneEqualizer.bands[i]);
}
regularization->trimValue(pp->toneEqualizer.regularization);
pivot->trimValue(pp->toneEqualizer.pivot);
}

62
rtgui/toneequalizer.h Normal file
View File

@ -0,0 +1,62 @@
/* -*- C++ -*-
*
* Adapted from ART.
*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <gtkmm.h>
#include "adjuster.h"
#include "checkbox.h"
#include "toolpanel.h"
class ToneEqualizer: public ToolParamBlock, public AdjusterListener, public FoldableToolPanel, public CheckBoxListener {
public:
static const Glib::ustring TOOL_NAME;
ToneEqualizer();
void read(const rtengine::procparams::ProcParams *pp, const ParamsEdited* pedited = nullptr) override;
void write(rtengine::procparams::ProcParams *pp, ParamsEdited* pedited = nullptr) override;
void setDefaults(const rtengine::procparams::ProcParams *defParams, const ParamsEdited* pedited = nullptr) override;
void adjusterChanged(Adjuster *a, double newval) override;
void adjusterAutoToggled(Adjuster *a) override;
void enabledChanged() override;
void setBatchMode(bool batchMode) override;
void setAdjusterBehavior(bool bands_add, bool regularization_add, bool pivot_add);
void checkBoxToggled(CheckBox* c, CheckValue newval) override;
void trimValues(rtengine::procparams::ProcParams *pp) override;
private:
void colormapToggled();
std::array<Adjuster *, 5> bands;
Adjuster *regularization;
Adjuster *pivot;
CheckBox *show_colormap;
rtengine::ProcEvent EvEnabled;
rtengine::ProcEvent EvBands;
rtengine::ProcEvent EvRegularization;
rtengine::ProcEvent EvColormap;
rtengine::ProcEvent EvPivot;
rtengine::procparams::ToneEqualizerParams inital_params;
};

View File

@ -70,6 +70,8 @@ Glib::ustring getToolTitleKey(Tool tool)
return "TP_EXPOSURE_LABEL";
case Tool::SHADOWS_HIGHLIGHTS:
return "TP_SHADOWSHLIGHTS_LABEL";
case Tool::TONE_EQUALIZER:
return "TP_TONE_EQUALIZER_LABEL";
case Tool::IMPULSE_DENOISE:
return "TP_IMPULSEDENOISE_LABEL";
case Tool::DEFRINGE_TOOL:

View File

@ -47,6 +47,11 @@ ToolParamBlock::ToolParamBlock() {
//GTK318
}
Gtk::SizeRequestMode ToolParamBlock::get_request_mode_vfunc () const
{
return Gtk::SIZE_REQUEST_HEIGHT_FOR_WIDTH;
}
FoldableToolPanel::FoldableToolPanel(Gtk::Box* content, Glib::ustring toolName, Glib::ustring UILabel, bool need11, bool useEnabled) : ToolPanel(toolName, need11), parentContainer(nullptr), exp(nullptr), lastEnabled(true)
{
if (!content) {

View File

@ -70,6 +70,7 @@ class ToolParamBlock :
{
public:
ToolParamBlock();
Gtk::SizeRequestMode get_request_mode_vfunc () const override;
};
class ToolPanel :

View File

@ -44,6 +44,9 @@ const std::vector<ToolTree> EXPOSURE_PANEL_TOOLS = {
{
.id = Tool::SHADOWS_HIGHLIGHTS,
},
{
.id = Tool::TONE_EQUALIZER,
},
{
.id = Tool::EPD,
},
@ -286,6 +289,7 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), favorit
coarse = Gtk::manage (new CoarsePanel ());
toneCurve = Gtk::manage (new ToneCurve ());
shadowshighlights = Gtk::manage (new ShadowsHighlights ());
toneEqualizer = Gtk::manage (new ToneEqualizer ());
impulsedenoise = Gtk::manage (new ImpulseDenoise ());
defringe = Gtk::manage (new Defringe ());
spot = Gtk::manage (new Spot ());
@ -561,6 +565,8 @@ std::string ToolPanelCoordinator::getToolName(Tool tool)
return ToneCurve::TOOL_NAME;
case Tool::SHADOWS_HIGHLIGHTS:
return ShadowsHighlights::TOOL_NAME;
case Tool::TONE_EQUALIZER:
return ToneEqualizer::TOOL_NAME;
case Tool::IMPULSE_DENOISE:
return ImpulseDenoise::TOOL_NAME;
case Tool::DEFRINGE_TOOL:
@ -1913,6 +1919,8 @@ FoldableToolPanel *ToolPanelCoordinator::getFoldableToolPanel(Tool tool) const
return toneCurve;
case Tool::SHADOWS_HIGHLIGHTS:
return shadowshighlights;
case Tool::TONE_EQUALIZER:
return toneEqualizer;
case Tool::IMPULSE_DENOISE:
return impulsedenoise;
case Tool::DEFRINGE_TOOL:

View File

@ -79,6 +79,7 @@
#include "softlight.h"
#include "spot.h"
#include "tonecurve.h"
#include "toneequalizer.h"
#include "toolbar.h"
#include "toolpanel.h"
#include "vibrance.h"
@ -134,6 +135,7 @@ protected:
Crop* crop;
ToneCurve* toneCurve;
ShadowsHighlights* shadowshighlights;
ToneEqualizer* toneEqualizer;
LocalContrast *localContrast;
Spot* spot;
Defringe* defringe;
@ -245,6 +247,7 @@ public:
enum class Tool {
TONE_CURVE,
SHADOWS_HIGHLIGHTS,
TONE_EQUALIZER,
IMPULSE_DENOISE,
DEFRINGE_TOOL,
SPOT,

View File

@ -247,6 +247,9 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC
auto m = ProcEventMapper::getInstance();
EvWBObserver10 = m->newEvent(ALLNORAW, "HISTORY_MSG_WBALANCE_OBSERVER10");
EvWBitcwbprim = m->newEvent(ALLNORAW, "HISTORY_MSG_WBITC_PRIM");
EvWBitcwbalg = m->newEvent(ALLNORAW, "HISTORY_MSG_WBITC_OBS");
EvWBitcwgreen = m->newEvent(ALLNORAW, "HISTORY_MSG_WBITC_GREEN");
//Add the model columns to the Combo (which is a kind of view),
@ -342,6 +345,10 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC
StudLabel = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER));
StudLabel->set_tooltip_text(M("TP_WBALANCE_STUDLABEL_TOOLTIP"));
PatchLabel = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER));
PatchLabel->set_tooltip_text(M("TP_WBALANCE_PATCHLABEL_TOOLTIP"));
PatchlevelLabel = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER));
PatchlevelLabel->set_tooltip_text(M("TP_WBALANCE_PATCHLEVELLABEL_TOOLTIP"));
mulLabel = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER));
mulLabel->set_tooltip_text(M("TP_WBALANCE_MULLABEL_TOOLTIP"));
@ -350,7 +357,7 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC
temp = Gtk::manage (new Adjuster (M("TP_WBALANCE_TEMPERATURE"), MINTEMP, MAXTEMP, 5, CENTERTEMP, itempL, itempR, &wbSlider2Temp, &wbTemp2Slider));
green = Gtk::manage (new Adjuster (M("TP_WBALANCE_GREEN"), MINGREEN, MAXGREEN, 0.001, 1.0, igreenL, igreenR));
equal = Gtk::manage (new Adjuster (M("TP_WBALANCE_EQBLUERED"), MINEQUAL, MAXEQUAL, 0.001, 1.0, iblueredL, iblueredR));
tempBias = Gtk::manage (new Adjuster(M("TP_WBALANCE_TEMPBIAS"), -0.5, 0.5, 0.01, 0.0, itempbiasL, itempbiasR));
tempBias = Gtk::manage (new Adjuster(M("TP_WBALANCE_TEMPBIAS"), -1.1, 1.1, 0.005, 0.0, itempbiasL, itempbiasR));
observer10 = Gtk::manage(new CheckBox(M("TP_WBALANCE_OBSERVER10"), multiImage));
cache_customTemp (0);
@ -364,6 +371,32 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC
equal->show ();
tempBias->show ();
observer10->show();
itcwbFrame = Gtk::manage(new Gtk::Frame(M("TP_WBALANCE_ITCWB_FRA")));
itcwbFrame->set_label_align(0.025, 0.5);
itcwbFrame->set_tooltip_markup (M("PREFERENCES_WBACORR_TOOLTIP"));
ToolParamBlock* const itcwbBox = Gtk::manage(new ToolParamBlock());
itcwb_green = Gtk::manage (new Adjuster (M("TP_WBALANCE_ITCWGREEN"), -0.35, 0.35, 0.005, 0.));
itcwb_green ->set_tooltip_markup (M("TP_WBALANCE_ITCWGREEN_TOOLTIP"));
itcwb_alg = Gtk::manage (new Gtk::CheckButton (M("TP_WBALANCE_ITCWB_ALG")));
itcwb_alg ->set_tooltip_markup (M("TP_WBALANCE_ITCWALG_TOOLTIP"));
itcwb_alg ->set_active (false);
itcwb_prim = Gtk::manage (new MyComboBoxText ());
itcwb_prim->append(M("TP_WBALANCE_ITCWB_PRIM_SRGB"));
itcwb_prim->append(M("TP_WBALANCE_ITCWB_PRIM_BETA"));
itcwb_prim->append(M("TP_WBALANCE_ITCWB_PRIM_XYZCAM"));
itcwb_prim->append(M("TP_WBALANCE_ITCWB_PRIM_JDCMAX"));
itcwb_prim->set_active(1);
itcwb_primconn = itcwb_prim->signal_changed().connect(sigc::mem_fun(*this, &WhiteBalance::itcwb_prim_changed));
itcwb_prim ->set_tooltip_markup (M("TP_WBALANCE_ITCWPRIM_TOOLTIP"));
/* Gtk::Box* boxgreen = Gtk::manage (new Gtk::Box ());
boxgreen->show ();
@ -373,6 +406,8 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC
boxgreen->pack_start(*igreenR);*/
pack_start(*mulLabel);
pack_start(*StudLabel);
pack_start(*PatchLabel);
pack_start(*PatchlevelLabel);
pack_start (*temp);
//pack_start (*boxgreen);
@ -382,14 +417,33 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC
pack_start(*observer10);
itcwbBox->pack_start (*itcwb_green);
itcwbBox->pack_start (*itcwb_alg);
itcwbBox->pack_start (*itcwb_prim);
itcwbFrame->add(*itcwbBox);
pack_start(*itcwbFrame);
if(options.rtSettings.itcwb_enable) {
itcwb_green->show();
itcwb_alg->show();
itcwb_prim->show();
itcwbFrame->show();
} else {
itcwb_green->show();
itcwb_alg->hide();
itcwb_prim->hide();
}
temp->setAdjusterListener (this);
green->setAdjusterListener (this);
equal->setAdjusterListener (this);
tempBias->setAdjusterListener (this);
observer10->setCheckBoxListener(this);
itcwb_green->setAdjusterListener (this);
spotbutton->signal_pressed().connect( sigc::mem_fun(*this, &WhiteBalance::spotPressed) );
methconn = method->signal_changed().connect( sigc::mem_fun(*this, &WhiteBalance::optChanged) );
itcwb_algconn = itcwb_alg->signal_toggled().connect( sigc::mem_fun(*this, &WhiteBalance::itcwb_alg_toggled) );
resetButton->signal_pressed().connect( sigc::mem_fun(*this, &WhiteBalance::resetWB) );
spotsize->signal_changed().connect( sigc::mem_fun(*this, &WhiteBalance::spotSizeChanged) );
}
@ -411,9 +465,36 @@ void WhiteBalance::enabledChanged()
}
}
}
void WhiteBalance::itcwb_prim_changed ()
{
if (listener && getEnabled()) {
listener->panelChanged(EvWBitcwbprim, M("GENERAL_ENABLED"));
}
}
void WhiteBalance::itcwb_alg_toggled ()
{
if (batchMode) {
if (itcwb_alg->get_inconsistent()) {
itcwb_alg->set_inconsistent (false);
itcwb_algconn.block (true);
itcwb_alg->set_active (false);
itcwb_algconn.block (false);
} else if (lastitcwb_alg) {
itcwb_alg->set_inconsistent (true);
}
lastitcwb_alg = itcwb_alg->get_active ();
}
if (listener && getEnabled()) {
if (itcwb_alg->get_active ()) {
listener->panelChanged (EvWBitcwbalg, M("GENERAL_ENABLED"));
} else {
listener->panelChanged (EvWBitcwbalg, M("GENERAL_DISABLED"));
}
}
}
void WhiteBalance::adjusterChanged(Adjuster* a, double newval)
{
@ -437,6 +518,7 @@ void WhiteBalance::adjusterChanged(Adjuster* a, double newval)
(
a == equal
|| a == tempBias
|| a == itcwb_green
)
&& ppMethod.second.type == WBEntry::Type::AUTO
)
@ -467,12 +549,16 @@ void WhiteBalance::adjusterChanged(Adjuster* a, double newval)
if (listener && getEnabled()) {
if (a == temp) {
listener->panelChanged (EvWBTemp, Glib::ustring::format ((int)a->getValue()));
itcwbFrame->set_sensitive(false);
} else if (a == green) {
listener->panelChanged (EvWBGreen, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), a->getValue()));
itcwbFrame->set_sensitive(false);
} else if (a == equal) {
listener->panelChanged (EvWBequal, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), a->getValue()));
} else if (a == tempBias) {
listener->panelChanged (EvWBtempBias, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(2), a->getValue()));
} else if (a == itcwb_green) {
listener->panelChanged (EvWBitcwgreen, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(2), a->getValue()));
}
}
}
@ -507,6 +593,7 @@ void WhiteBalance::checkBoxToggled(CheckBox* c, CheckValue newval)
}
}
void WhiteBalance::optChanged ()
{
Gtk::TreeModel::Row row = getActiveMethod();
@ -524,6 +611,8 @@ void WhiteBalance::optChanged ()
}
StudLabel->hide();
mulLabel->show();
PatchLabel->hide();
PatchlevelLabel->hide();
if (opt != row[methodColumns.colId]) {
@ -543,8 +632,16 @@ void WhiteBalance::optChanged ()
bool autit = (currMethod.ppLabel == "autitcgreen");
if (autit) {
StudLabel->show();
PatchLabel->show();
PatchlevelLabel->show();
equal->hide();
itcwbFrame->set_sensitive(true);
} else {
StudLabel->hide();
PatchLabel->hide();
PatchlevelLabel->hide();
equal->show();
itcwbFrame->set_sensitive(false);
}
switch (currMethod.type) {
@ -638,6 +735,8 @@ void WhiteBalance::spotPressed ()
{
StudLabel->hide();
mulLabel->show();
PatchLabel->hide();
PatchlevelLabel->hide();
if (wblistener) {
wblistener->spotWBRequested (getSize());
@ -663,6 +762,41 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited)
tempBias->setValue (pp->wb.tempBias);
tempBias->set_sensitive(true);
itcwb_algconn.block (true);
itcwb_alg->set_active (pp->wb.itcwb_alg);
itcwb_algconn.block (false);
lastitcwb_alg = pp->wb.itcwb_alg;
itcwb_green->setValue (pp->wb.itcwb_green);
itcwb_primconn.block (true);
if (pp->wb.itcwb_prim == "srgb") {
itcwb_prim->set_active(0);
} else if (pp->wb.itcwb_prim == "beta") {
itcwb_prim->set_active(1);
} else if (pp->wb.itcwb_prim == "XYZcam") {
itcwb_prim->set_active(2);
} else if (pp->wb.itcwb_prim == "jdcmax") {
itcwb_prim->set_active(3);
}
itcwb_primconn.block (false);
if(options.rtSettings.itcwb_enable) {
itcwb_green->show();
itcwb_alg->show();
itcwb_prim->show();
itcwbFrame->show();
} else {
itcwb_green->hide();
itcwb_alg->hide();
itcwb_prim->hide();
itcwbFrame->hide();
}
if (pedited) {
// By default, temperature and green are said "UnEdited", but it may change later
temp->setEditedState (UnEdited);
@ -670,6 +804,8 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited)
equal->setEditedState (pedited->wb.equal ? Edited : UnEdited);
tempBias->setEditedState (pedited->wb.tempBias ? Edited : UnEdited);
observer10->setEdited(pedited->wb.observer);
itcwb_alg->set_inconsistent (!pedited->wb.itcwb_alg);
itcwb_green->setEditedState (pedited->wb.itcwb_green ? Edited : UnEdited);
}
if (pedited && !pedited->wb.method) {
@ -780,9 +916,21 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited)
bool autit = (wbValues.ppLabel == "autitcgreen");
if (autit) {
StudLabel->show();
PatchLabel->show();
PatchlevelLabel->show();
equal->hide();
if(pp->wb.itcwb_sampling) {
tempBias->set_sensitive(false);
}
itcwbFrame->set_sensitive(!pp->wb.itcwb_sampling);
itcwb_prim_changed ();
} else {
StudLabel->hide();
PatchLabel->hide();
PatchlevelLabel->hide();
mulLabel->show();
equal->show();
itcwbFrame->set_sensitive(false);
}
}
@ -808,16 +956,32 @@ void WhiteBalance::write (ProcParams* pp, ParamsEdited* pedited)
pedited->wb.equal = equal->getEditedState ();
pedited->wb.tempBias = tempBias->getEditedState ();
pedited->wb.observer = observer10->getEdited();
pedited->wb.itcwb_alg = !itcwb_alg->get_inconsistent();
pedited->wb.method = row[methodColumns.colLabel] != M("GENERAL_UNCHANGED");
pedited->wb.enabled = !get_inconsistent();
pedited->wb.itcwb_prim = itcwb_prim->get_active_text() != M("GENERAL_UNCHANGED");
pedited->wb.itcwb_green = itcwb_green->getEditedState ();
}
pp->wb.enabled = getEnabled();
if (itcwb_prim->get_active_row_number() == 0) {
pp->wb.itcwb_prim = "srgb";
} else if (itcwb_prim->get_active_row_number() == 1){
pp->wb.itcwb_prim = "beta";
} else if (itcwb_prim->get_active_row_number() == 2){
pp->wb.itcwb_prim = "XYZcam";
} else if (itcwb_prim->get_active_row_number() == 3){
pp->wb.itcwb_prim = "jdcmax";
}
const std::pair<bool, const WBEntry&> ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI);
if (ppMethod.first) {
pp->wb.method = ppMethod.second.ppLabel;
if (pp->wb.method != "autitcgreen") {
// Prepare migration to new ITCWB algorithm.
pp->wb.itcwb_sampling = false;
}
}
pp->wb.temperature = temp->getIntValue ();
@ -829,7 +993,9 @@ void WhiteBalance::write (ProcParams* pp, ParamsEdited* pedited)
: observer10->getValue() == CheckValue::off
? rtengine::StandardObserver::TWO_DEGREES
: pp->wb.observer;
pp->wb.itcwb_alg = itcwb_alg->get_active ();
pp->wb.tempBias = tempBias->getValue ();
pp->wb.itcwb_green = itcwb_green->getValue ();
}
void WhiteBalance::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited)
@ -837,6 +1003,7 @@ void WhiteBalance::setDefaults (const ProcParams* defParams, const ParamsEdited*
equal->setDefault (defParams->wb.equal);
tempBias->setDefault (defParams->wb.tempBias);
itcwb_green->setDefault (defParams->wb.itcwb_green);
if (wbp && defParams->wb.method == "Camera") {
double ctemp;
@ -859,11 +1026,13 @@ void WhiteBalance::setDefaults (const ProcParams* defParams, const ParamsEdited*
green->setDefaultEditedState (pedited->wb.green ? Edited : UnEdited);
equal->setDefaultEditedState (pedited->wb.equal ? Edited : UnEdited);
tempBias->setDefaultEditedState (pedited->wb.tempBias ? Edited : UnEdited);
itcwb_green->setDefaultEditedState (pedited->wb.itcwb_green ? Edited : UnEdited);
} else {
temp->setDefaultEditedState (Irrelevant);
green->setDefaultEditedState (Irrelevant);
equal->setDefaultEditedState (Irrelevant);
tempBias->setDefaultEditedState (Irrelevant);
itcwb_green->setDefaultEditedState (Irrelevant);
}
}
@ -1015,24 +1184,62 @@ inline Gtk::TreeRow WhiteBalance::getActiveMethod ()
return *(method->get_active());
}
void WhiteBalance::WBChanged(double temperature, double greenVal, double rw, double gw, double bw, float studgood)
void WhiteBalance::WBChanged(int met, double temperature, double greenVal, double rw, double gw, double bw, float temp0, float delta, int bia, int dread, float studgood, float minchrom, int kmin, float histmin, float histmax)
{
idle_register.add(
[this, temperature, greenVal, rw, gw, bw, studgood]() -> bool
[this, met, temperature, greenVal, rw, gw, bw, temp0, delta, bia, dread, studgood, minchrom, kmin, histmin, histmax]() -> bool
{
disableListener();
temp->setValue(temperature);
green->setValue(greenVal);
double stud;
stud = studgood;
if(studgood < 0.0001) {
stud = 0.0001;
}
int bia2 = bia;
mulLabel->set_text(
Glib::ustring::compose(M("TP_WBALANCE_MULLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(4), rw),
Glib::ustring::format(std::fixed, std::setprecision(2), gw),
Glib::ustring::format(std::fixed, std::setprecision(4), bw))
);
StudLabel->set_text(
Glib::ustring::compose(M("TP_WBALANCE_STUDLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(4), studgood))
);
if(bia == 3) {
bia2 = bia - 1;
StudLabel->set_text(
Glib::ustring::compose(M("TP_WBALANCE_STUDLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(4), stud),
Glib::ustring::format(std::fixed, std::setprecision(0), bia2),
Glib::ustring::format(std::fixed, std::setprecision(0), temp0))
);
} else if(bia == 2) {
StudLabel->set_text(
Glib::ustring::compose(M("TP_WBALANCE_STUDLABEL1"),
Glib::ustring::format(std::fixed, std::setprecision(4), stud),
Glib::ustring::format(std::fixed, std::setprecision(0), bia),
Glib::ustring::format(std::fixed, std::setprecision(0), temp0))
);
} else {
StudLabel->set_text(
Glib::ustring::compose(M("TP_WBALANCE_STUDLABEL0"),
Glib::ustring::format(std::fixed, std::setprecision(4), stud),
Glib::ustring::format(std::fixed, std::setprecision(0), bia),
Glib::ustring::format(std::fixed, std::setprecision(0), temp0))
);
}
PatchLabel->set_text(
Glib::ustring::compose(M("TP_WBALANCE_PATCHLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(0), dread),
Glib::ustring::format(std::fixed, std::setprecision(4), minchrom),
Glib::ustring::format(std::fixed, std::setprecision(0), kmin))
);
PatchlevelLabel->set_text(
Glib::ustring::compose(M("TP_WBALANCE_PATCHLEVELLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(4), delta),
Glib::ustring::format(std::fixed, std::setprecision(0), histmin),
Glib::ustring::format(std::fixed, std::setprecision(0), histmax))
);
temp->setDefault(temperature);
green->setDefault(greenVal);
enableListener();

View File

@ -46,6 +46,8 @@ class WhiteBalance final : public ToolParamBlock, public AdjusterListener, publi
private:
Gtk::Label* StudLabel;
Gtk::Label* PatchLabel;
Gtk::Label* PatchlevelLabel;
Gtk::Label* mulLabel;
protected:
@ -64,6 +66,9 @@ protected:
};
rtengine::ProcEvent EvWBObserver10;
rtengine::ProcEvent EvWBitcwbprim;
rtengine::ProcEvent EvWBitcwbalg;
rtengine::ProcEvent EvWBitcwgreen;
static Glib::RefPtr<Gdk::Pixbuf> wbPixbufs[rtengine::toUnderlying(rtengine::procparams::WBEntry::Type::CUSTOM) + 1];
Glib::RefPtr<Gtk::TreeStore> refTreeModel;
@ -76,6 +81,12 @@ protected:
Adjuster* equal;
Adjuster* tempBias;
CheckBox* observer10;
Gtk::Frame* itcwbFrame;
Gtk::CheckButton* itcwb_alg;
MyComboBoxText* itcwb_prim;
Adjuster* itcwb_green;
bool lastitcwb_alg;
Gtk::Button* spotbutton;
int opt;
@ -83,7 +94,7 @@ protected:
double nextGreen;
WBProvider *wbp; // pointer to a ToolPanelCoordinator object, or its subclass BatchToolPanelCoordinator
SpotWBListener* wblistener;
sigc::connection methconn;
sigc::connection methconn, itcwb_algconn, itcwb_primconn;
int custom_temp;
double custom_green;
double custom_equal;
@ -131,8 +142,9 @@ public:
}
void setWB (int temp, double green);
void resetWB ();
void WBChanged (double temp, double green, double rw, double gw, double bw, float studgood) override;
void WBChanged (int met, double temp, double green, double rw, double gw, double bw, float temp0, float delta, int bia, int dread, float studgood, float minchrom, int kmin, float histmin, float histmax) override;
void itcwb_alg_toggled ();
void itcwb_prim_changed ();
void setAdjusterBehavior (bool tempadd, bool greenadd, bool equaladd, bool tempbiasadd);
void trimValues (rtengine::procparams::ProcParams* pp) override;
void enabledChanged() override;

View File

@ -73,6 +73,8 @@
<string>arw</string>
<string>CR2</string>
<string>cr2</string>
<string>CR3</string>
<string>cr3</string>
<string>CRF</string>
<string>crf</string>
<string>CRW</string>

View File

@ -225,8 +225,11 @@ ModifyInstallNames 2>&1
# Copy libpng16 to the app bundle
cp ${LOCAL_PREFIX}/lib/libpng16.16.dylib "${CONTENTS}/Frameworks/libpng16.16.dylib"
# Copy libtiff 5 into the app bundle
cp ${LOCAL_PREFIX}/lib/libtiff.5.dylib "${CONTENTS}/Frameworks/libtiff.5.dylib"
# Copy graphite to Frameworks
cp ${LOCAL_PREFIX}/lib/libgraphite2.3.dylib "${CONTENTS}/Frameworks"
# Copy libtiff 6 into the app bundle
cp ${LOCAL_PREFIX}/lib/libtiff.6.dylib "${CONTENTS}/Frameworks/libtiff.6.dylib"
# Copy libomp to Frameworks
cp ${LOCAL_PREFIX}/lib/libomp.dylib "${CONTENTS}/Frameworks"
@ -316,7 +319,7 @@ for frameworklibs in "${LIB}"/*{dylib,so,cli}; do
done
install_name_tool -delete_rpath RawTherapee.app/Contents/Frameworks "${EXECUTABLE}"-cli 2>/dev/null
install_name_tool -add_rpath /Applications/"${LIB}" "${EXECUTABLE}"-cli 2>/dev/null
ditto "${EXECUTABLE}"-cli "${APP}"/..
# ditto "${EXECUTABLE}"-cli "${APP}"/..
# Merge the app with the other architecture to create the Universal app.
if [[ -n $UNIVERSAL_URL ]]; then
@ -324,7 +327,7 @@ if [[ -n $UNIVERSAL_URL ]]; then
curl -L ${UNIVERSAL_URL} -o univ.zip
msg "Extracting app."
unzip univ.zip -d univapp
hdiutil attach -mountpoint ./RawTherapeeuniv univapp/*/*dmg
hdiutil attach -mountpoint ./RawTherapeeuniv univapp/*dmg
if [[ $arch = "arm64" ]]; then
cp -R RawTherapee.app RawTherapee-arm64.app
minimum_arm64_version=$(f=$(cat RawTherapee-arm64.app/Contents/Resources/AboutThisBuild.txt | grep mmacosx-version); echo "${f#*min=}" | cut -d ' ' -f1)
@ -344,13 +347,15 @@ if [[ -n $UNIVERSAL_URL ]]; then
hdiutil unmount ./RawTherapeeuniv
rm -r univapp
# Create the fat main RawTherapee binary and move it into the new bundle
lipo -create -output RawTherapee RawTherapee-arm64.app/Contents/MacOS/RawTherapee RawTherapee-x86_64.app/Contents/MacOS/RawTherapee
mv RawTherapee RawTherapee.app/Contents/MacOS
lipo -create -output RawTherapee RawTherapee-arm64.app/Contents/MacOS/rawtherapee RawTherapee-x86_64.app/Contents/MacOS/rawtherapee
lipo -create -output rawtherapee-cli RawTherapee-arm64.app/Contents/MacOS/rawtherapee-cli RawTherapee-x86_64.app/Contents/MacOS/rawtherapee-cli
mv rawtherapee RawTherapee.app/Contents/MacOS
# Create all the fat dependencies and move them into the bundle
for lib in RawTherapee-arm64.app/Contents/Frameworks/* ; do
lipo -create -output $(basename $lib) RawTherapee-arm64.app/Contents/Frameworks/$(basename $lib) RawTherapee-x86_64.app/Contents/Frameworks/$(basename $lib)
done
sudo mv *cli *so *dylib RawTherapee.app/Contents/Frameworks
sudo mv *so *dylib RawTherapee.app/Contents/Frameworks
sudo mv *-cli RawTherapee.app/Contents/MacOS
rm -r RawTherapee-arm64.app
rm -r RawTherapee-x86_64.app
else
@ -363,7 +368,8 @@ fi
if [[ -n $CODESIGNID ]]; then
msg "Codesigning Application."
iconv -f UTF-8 -t ASCII "${PROJECT_SOURCE_DATA_DIR}"/rt.entitlements > "${CMAKE_BUILD_TYPE}"/rt.entitlements
mv "${EXECUTABLE}"-cli "${LIB}"
# mv "${EXECUTABLE}"-cli "${LIB}"
codesign --force --deep --timestamp --strict -v -s "${CODESIGNID}" -i com.rawtherapee.RawTherapee-cli "${APP}"/Contents/MacOS/rawtherapee-cli
codesign --force --deep --timestamp --strict -v -s "${CODESIGNID}" -i com.rawtherapee.RawTherapee -o runtime --entitlements "${CMAKE_BUILD_TYPE}"/rt.entitlements "${APP}"
spctl -a -vvvv "${APP}"
fi
@ -441,7 +447,8 @@ function CreateDmg {
# Zip disk image for redistribution
msg "Zipping disk image for redistribution:"
mkdir "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}_folder"
cp {"${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}.dmg","${PROJECT_NAME}.app/Contents/Frameworks/rawtherapee-cli","${PROJECT_SOURCE_DATA_DIR}/INSTALL.readme.rtf"} "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}_folder"
cp {"${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}.dmg","${PROJECT_NAME}.app/Contents/MacOS/rawtherapee-cli","${PROJECT_SOURCE_DATA_DIR}/INSTALL.readme.rtf"} "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}_folder"
codesign -s - -i com.rawtherapee.rawtherapee-cli -f "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}_folder/rawtherapee-cli"
zip -r "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}.zip" "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}_folder/"
if [[ -n $NIGHTLY ]]; then
cp "${PROJECT_NAME}_macOS_${MINIMUM_SYSTEM_VERSION}_${arch}_${PROJECT_FULL_VERSION}.zip" "${PROJECT_NAME}_macOS_${arch}_latest.zip"