Merge branch 'dev' into eos-7d-markii-raw-crop
This commit is contained in:
commit
4faea6df7b
2
.github/workflows/appimage.yml
vendored
2
.github/workflows/appimage.yml
vendored
@ -11,7 +11,7 @@ on:
|
||||
- dev
|
||||
workflow_dispatch:
|
||||
env:
|
||||
publish_pre_dev_labels: '["Beep6581:ladenoise_improv"]'
|
||||
publish_pre_dev_labels: '[]'
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
|
69
.github/workflows/windows.yml
vendored
69
.github/workflows/windows.yml
vendored
@ -11,7 +11,7 @@ on:
|
||||
- dev
|
||||
workflow_dispatch:
|
||||
env:
|
||||
publish_pre_dev_labels: '["Beep6581:ladenoise_improv"]'
|
||||
publish_pre_dev_labels: '[]'
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-2022
|
||||
@ -98,6 +98,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'."
|
||||
@ -110,68 +114,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" \
|
||||
"libdatrie-1.dll" \
|
||||
"libdeflate.dll" \
|
||||
"libepoxy-0.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" \
|
||||
"libintl-8.dll" \
|
||||
"libjbig-0.dll" \
|
||||
"libjpeg-8.dll" \
|
||||
"liblcms2-2.dll" \
|
||||
"liblensfun.dll" \
|
||||
"libLerc.dll" \
|
||||
"liblzma-5.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" \
|
||||
"librsvg-2-2.dll" \
|
||||
"libsharpyuv-0.dll" \
|
||||
"libsigc-2.0-0.dll" \
|
||||
"libstdc++-6.dll" \
|
||||
"libsystre-0.dll" \
|
||||
"libthai-0.dll" \
|
||||
"libtiff-6.dll" \
|
||||
"libtre-5.dll" \
|
||||
"libwebp-7.dll" \
|
||||
"libwinpthread-1.dll" \
|
||||
"libxml2-2.dll" \
|
||||
"libzstd.dll" \
|
||||
"zlib1.dll" \
|
||||
${DLLS[*]} \
|
||||
"$BUILD_DIR"
|
||||
cd -
|
||||
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -6,6 +6,8 @@
|
||||
.settings
|
||||
.directory
|
||||
.vscode
|
||||
.DS_Store
|
||||
.idea
|
||||
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
@ -43,4 +45,3 @@ clean
|
||||
*.tar
|
||||
*.xz
|
||||
*.zip
|
||||
|
||||
|
@ -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
|
||||
|
@ -1535,6 +1535,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
|
||||
@ -1841,6 +1857,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
|
||||
@ -2616,6 +2643,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
|
||||
@ -4077,7 +4105,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
|
||||
@ -4104,6 +4132,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
|
||||
@ -4115,6 +4184,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:
|
||||
@ -4123,10 +4196,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
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -1231,7 +1231,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" : [
|
||||
@ -1242,7 +1242,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
|
||||
@ -1260,10 +1260,10 @@ Camera constants:
|
||||
},
|
||||
|
||||
{ // Quality C
|
||||
"make_model": "Canon EOS R6m2",
|
||||
"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, 6028, 4024]},
|
||||
{"frame": [6188, 4120], "crop": [154, 96, 6024, 4024]},
|
||||
{"frame": [3936, 2612], "crop": [156, 96, 3780, 2516]}
|
||||
],
|
||||
"masked_areas": [
|
||||
@ -1756,7 +1756,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
|
||||
@ -2204,8 +2204,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 }
|
||||
},
|
||||
|
@ -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
@ -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 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 const double JDC468_greyc14_66_spect[97];
|
||||
static const double JDC468_greym13_325_spect[97];
|
||||
static const double JDC468_greyf26_156_spect[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);
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -1765,6 +1765,11 @@ void Crop::freeAll()
|
||||
shbuffer = nullptr;
|
||||
}
|
||||
|
||||
if (shbuf_real) {
|
||||
delete [] shbuf_real;
|
||||
shbuf_real = nullptr;
|
||||
}
|
||||
|
||||
PipetteBuffer::flush();
|
||||
}
|
||||
|
||||
|
@ -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)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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},
|
||||
|
@ -196,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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -305,9 +305,11 @@ void ImProcCoordinator::backupParams()
|
||||
if (!params) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!paramsBackup) {
|
||||
paramsBackup.reset(new ProcParams());
|
||||
}
|
||||
|
||||
*paramsBackup = *params;
|
||||
}
|
||||
|
||||
@ -316,6 +318,7 @@ void ImProcCoordinator::restoreParams()
|
||||
if (!paramsBackup || !params) {
|
||||
return;
|
||||
}
|
||||
|
||||
*params = *paramsBackup;
|
||||
}
|
||||
|
||||
@ -330,7 +333,6 @@ DetailedCrop* ImProcCoordinator::createCrop(::EditDataProvider *editDataProvider
|
||||
void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
{
|
||||
// TODO Locallab printf
|
||||
|
||||
MyMutex::MyLock processingLock(mProcessing);
|
||||
|
||||
bool highDetailNeeded = options.prevdemo == PD_Sidecar ? true : (todo & M_HIGHQUAL);
|
||||
@ -410,7 +412,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
if (imageTypeListener) {
|
||||
imageTypeListener->imageTypeChanged(imgsrc->isRAW(), imgsrc->getSensorType() == ST_BAYER, imgsrc->getSensorType() == ST_FUJI_XTRANS, imgsrc->isMono(), imgsrc->isGainMapSupported());
|
||||
}
|
||||
|
||||
bool iscolor = (params->toneCurve.method == "Color");// || params->toneCurve.method == "Coloropp");
|
||||
|
||||
if ((todo & M_RAW)
|
||||
|| (!highDetailRawComputed && highDetailNeeded)
|
||||
// || (params->toneCurve.hrenabled && params->toneCurve.method != "Color" && imgsrc->isRGBSourceModified())
|
||||
@ -510,12 +514,14 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
}
|
||||
|
||||
const bool autowb = (params->wb.method == "autold" || params->wb.method == "autitcgreen");
|
||||
|
||||
if (settings->verbose) {
|
||||
printf("automethod=%s \n", params->wb.method.c_str());
|
||||
}
|
||||
|
||||
if (todo & (M_INIT | M_LINDENOISE | M_HDR)) {
|
||||
MyMutex::MyLock initLock(minit); // Also used in crop window
|
||||
// imgsrc->HLRecovery_Global(params->toneCurve); // this handles Color HLRecovery
|
||||
//imgsrc->HLRecovery_Global(params->toneCurve); // this handles Color HLRecovery
|
||||
|
||||
|
||||
if (settings->verbose) {
|
||||
@ -523,7 +529,22 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
}
|
||||
|
||||
currWB = ColorTemp(params->wb.temperature, params->wb.green, params->wb.equal, params->wb.method, params->wb.observer);
|
||||
|
||||
int dread = 0;
|
||||
int bia = 1;
|
||||
float studgood = 1000.f;
|
||||
int nocam = 0;
|
||||
int kcam = 0;
|
||||
float minchrom = 1000.f;
|
||||
float delta = 0.f;
|
||||
int kmin = 20;
|
||||
float minhist = 1000000000.f;
|
||||
float maxhist = -1000.f;
|
||||
double tempitc = 5000.f;
|
||||
double greenitc = 1.;
|
||||
float temp0 = 5000.f;
|
||||
bool extra = false;
|
||||
bool forcewbgrey = false;
|
||||
|
||||
if (!params->wb.enabled) {
|
||||
currWB = ColorTemp();
|
||||
@ -531,29 +552,223 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
currWB = imgsrc->getWB();
|
||||
lastAwbauto = ""; //reinitialize auto
|
||||
} else if (autowb) {
|
||||
if (params->wb.method == "autitcgreen" || lastAwbEqual != params->wb.equal || lastAwbObserver != params->wb.observer || lastAwbTempBias != params->wb.tempBias || lastAwbauto != params->wb.method) {
|
||||
double rm, gm, bm;
|
||||
double tempitc = 5000.f;
|
||||
double greenitc = 1.;
|
||||
float tem = 5000.f;
|
||||
float gre = 1.f;
|
||||
double tempref0bias = 5000.;
|
||||
tempitc = 5000.f;
|
||||
bool autowb1 = true;
|
||||
double green_thres = 0.8;
|
||||
|
||||
if (params->wb.method == "autitcgreen") {
|
||||
|
||||
currWBitc = imgsrc->getWB();
|
||||
double tempref = currWBitc.getTemp() * (1. + params->wb.tempBias);
|
||||
|
||||
double greenref = currWBitc.getGreen();
|
||||
if (settings->verbose && params->wb.method == "autitcgreen") {
|
||||
printf("tempref=%f greref=%f\n", tempref, greenref);
|
||||
double tempref0bias0 = currWBitc.getTemp();
|
||||
|
||||
if (greenref > green_thres && params->wb.itcwb_prim == "srgb") {
|
||||
forcewbgrey = true;
|
||||
}
|
||||
|
||||
imgsrc->getAutoWBMultipliersitc(tempref, greenref, tempitc, greenitc, studgood, 0, 0, fh, fw, 0, 0, fh, fw, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve);
|
||||
if (!forcewbgrey && (tempref0bias0 < 3300.f) && (greenref < 1.13f && greenref > 0.88f)) { //seems good with temp and green...To fixe...limits 1.13 and 0.88
|
||||
if (settings->verbose) {
|
||||
printf("Keep camera settings temp=%f green=%f\n", tempref0bias0, greenref);
|
||||
}
|
||||
|
||||
autowb1 = true;
|
||||
kcam = 1;
|
||||
}
|
||||
|
||||
if (autowb1) {
|
||||
//alternative to camera if camera settings out, using autowb grey to find new ref, then mixed with camera
|
||||
// kcam = 0;
|
||||
params->wb.method = "autold";
|
||||
double rm, gm, bm;
|
||||
tempitc = 5000.f;
|
||||
greenitc = 1.;
|
||||
currWBitc = imgsrc->getWB();
|
||||
tempref0bias = currWBitc.getTemp();
|
||||
double greenref = currWBitc.getGreen();
|
||||
bool pargref = true;
|
||||
bool pargre = true;
|
||||
|
||||
if ((greenref > 1.5f || tempref0bias < 3300.f || tempref0bias > 7700.f || forcewbgrey) && kcam != 1 && !params->wb.itcwb_sampling) { //probably camera out to adjust...
|
||||
imgsrc->getAutoWBMultipliersitc(extra, tempref0bias, greenref, tempitc, greenitc, temp0, delta, bia, dread, kcam, nocam, studgood, minchrom, kmin, minhist, maxhist, 0, 0, fh, fw, 0, 0, fh, fw, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve);
|
||||
imgsrc->wbMul2Camera(rm, gm, bm);
|
||||
imgsrc->wbCamera2Mul(rm, gm, bm);
|
||||
ColorTemp ct(rm, gm, bm, 1.0, currWB.getObserver());
|
||||
tem = ct.getTemp();
|
||||
gre = ct.getGreen();
|
||||
|
||||
if (gre > 1.3f) {
|
||||
pargre = false;
|
||||
}
|
||||
|
||||
if (greenref > 1.3f) {
|
||||
pargref = false;
|
||||
}
|
||||
|
||||
double deltemp = tem - tempref0bias;
|
||||
|
||||
if (gre > 1.5f && !forcewbgrey) { //probable wrong value
|
||||
tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value
|
||||
gre = 0.5f + 0.5f * LIM(gre, 0.9f, 1.1f);//empirical formula in case system out
|
||||
} else {
|
||||
if (!forcewbgrey) {
|
||||
gre = 0.2f + 0.8f * LIM(gre, 0.85f, 1.15f);
|
||||
tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value
|
||||
nocam = 0;
|
||||
} else {//set temp and green to init itcwb algorithm
|
||||
double grepro = LIM(greenref, green_thres, 1.15);
|
||||
gre = 0.5f * grepro + 0.5f * LIM(gre, 0.9f, 1.1f);//empirical green between green camera and autowb grey
|
||||
|
||||
if (abs(deltemp) < 400.) { //arbitraries thresholds to refine
|
||||
tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
|
||||
if (deltemp > 0.) {
|
||||
nocam = 1;
|
||||
} else {
|
||||
nocam = 2;
|
||||
}
|
||||
} else if (abs(deltemp) < 900.) { //other arbitrary threshold
|
||||
tem = 0.4 * tem + 0.6 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
|
||||
if (deltemp > 0.) {
|
||||
nocam = 3;
|
||||
} else {
|
||||
nocam = 4;
|
||||
}
|
||||
} else if (abs(deltemp) < 1500. && tempref0bias < 4500.f) {
|
||||
if ((pargre && pargref) || (!pargre && !pargref)) {
|
||||
tem = 0.45 * tem + 0.55 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
}
|
||||
|
||||
if (pargre && !pargref) {
|
||||
tem = 0.7 * tem + 0.3 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
}
|
||||
|
||||
if (!pargre && pargref) {
|
||||
tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
}
|
||||
|
||||
nocam = 5;
|
||||
} else if (abs(deltemp) < 1500. && tempref0bias >= 4500.f) {
|
||||
if ((pargre && pargref) || (!pargre && !pargref)) {
|
||||
tem = 0.45 * tem + 0.55 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
}
|
||||
|
||||
if (pargre && !pargref) {
|
||||
tem = 0.7 * tem + 0.3 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
}
|
||||
|
||||
if (!pargre && pargref) {
|
||||
tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
}
|
||||
|
||||
nocam = 6;
|
||||
} else if (abs(deltemp) >= 1500. && tempref0bias < 5500.f) {
|
||||
if (tem >= 4500.f) {
|
||||
if ((pargre && pargref) || (!pargre && !pargref)) {
|
||||
tem = 0.7 * tem + 0.3 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
}
|
||||
|
||||
if (pargre && !pargref) {
|
||||
tem = 0.8 * tem + 0.2 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
}
|
||||
|
||||
if (!pargre && pargref) {
|
||||
tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
}
|
||||
|
||||
nocam = 7;
|
||||
} else {
|
||||
tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
nocam = 8;
|
||||
}
|
||||
} else if (abs(deltemp) >= 1500. && tempref0bias >= 5500.f) {
|
||||
if (tem >= 10000.f) {
|
||||
tem = 0.99 * tem + 0.01 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
nocam = 9;
|
||||
} else {
|
||||
if ((pargre && pargref) || (!pargre && !pargref)) {
|
||||
tem = 0.45 * tem + 0.55 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
}
|
||||
|
||||
if (pargre && !pargref) {
|
||||
tem = 0.7 * tem + 0.3 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
}
|
||||
|
||||
if (!pargre && pargref) {
|
||||
tem = 0.3 * tem + 0.7 * tempref0bias;//find a mixed value between camera and auto grey
|
||||
}
|
||||
|
||||
nocam = 10;
|
||||
}
|
||||
} else {
|
||||
tem = 0.4 * tem + 0.6 * tempref0bias;
|
||||
nocam = 11;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tempitc = tem ;
|
||||
|
||||
extra = true;
|
||||
|
||||
if (settings->verbose) {
|
||||
printf("Using new references AWB grey or mixed Enable Extra - temgrey=%f gregrey=%f tempitc=%f nocam=%i\n", (double) tem, (double) gre, (double) tempitc, nocam);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
params->wb.method = "autitcgreen";
|
||||
|
||||
}
|
||||
float greenitc_low = 1.f;
|
||||
float tempitc_low = 5000.f;
|
||||
if (params->wb.method == "autitcgreen" || lastAwbEqual != params->wb.equal || lastAwbObserver != params->wb.observer || lastAwbTempBias != params->wb.tempBias || lastAwbauto != params->wb.method) {
|
||||
double rm, gm, bm;
|
||||
greenitc = 1.;
|
||||
currWBitc = imgsrc->getWB();
|
||||
currWBitc = currWBitc.convertObserver(params->wb.observer);//change the temp/green couple with the same multipliers
|
||||
|
||||
double tempref = currWBitc.getTemp() * (1. + params->wb.tempBias);
|
||||
double greenref = currWBitc.getGreen();
|
||||
greenitc = greenref;
|
||||
|
||||
if ((greenref > 1.5f || tempref0bias < 3300.f || tempref0bias > 7700.f || forcewbgrey) && autowb1 && kcam != 1 && !params->wb.itcwb_sampling) { //probably camera out to adjust = greenref ? tempref0bias ?
|
||||
tempref = tem * (1. + params->wb.tempBias);
|
||||
greenref = gre;
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if(params->wb.itcwb_sampling) {
|
||||
greenitc_low = greenref;
|
||||
tempitc_low = tempref;
|
||||
}
|
||||
|
||||
if (settings->verbose && params->wb.method == "autitcgreen") {
|
||||
printf("tempref=%f greref=%f tempitc=%f greenitc=%f\n", tempref, greenref, tempitc, greenitc);
|
||||
}
|
||||
|
||||
imgsrc->getAutoWBMultipliersitc(extra, tempref, greenref, tempitc, greenitc, temp0, delta, bia, dread, kcam, nocam, studgood, minchrom, kmin, minhist, maxhist, 0, 0, fh, fw, 0, 0, fh, fw, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve);
|
||||
|
||||
if (params->wb.method == "autitcgreen") {
|
||||
params->wb.temperature = tempitc;
|
||||
params->wb.green = greenitc;
|
||||
currWB = ColorTemp(params->wb.temperature, params->wb.green, 1., params->wb.method, params->wb.observer);
|
||||
//printf("tempitc=%f greitc=%f\n", tempitc, greenitc);
|
||||
if(params->wb.itcwb_sampling) {
|
||||
params->wb.temperature = tempitc_low;
|
||||
params->wb.green = greenitc_low;
|
||||
}
|
||||
|
||||
currWB = ColorTemp(params->wb.temperature, params->wb.green, 1., params->wb.method, params->wb.observer);
|
||||
currWB.getMultipliers(rm, gm, bm);
|
||||
autoWB.update(rm, gm, bm, params->wb.equal, params->wb.observer, params->wb.tempBias);
|
||||
}
|
||||
|
||||
if (rm != -1.) {
|
||||
|
||||
double bias = params->wb.tempBias;
|
||||
|
||||
if (params->wb.method == "autitcgreen") {
|
||||
@ -572,30 +787,54 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
lastAwbauto = "";
|
||||
autoWB.useDefaults(params->wb.equal, params->wb.observer);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
currWB = autoWB;
|
||||
}
|
||||
|
||||
double rw = 1.;
|
||||
double gw = 1.;
|
||||
double bw = 1.;
|
||||
|
||||
if (params->wb.enabled) {
|
||||
currWB = currWB.convertObserver(params->wb.observer);
|
||||
params->wb.temperature = static_cast<int>(currWB.getTemp());
|
||||
params->wb.green = currWB.getGreen();
|
||||
|
||||
currWB.getMultipliers(rw, gw, bw);
|
||||
imgsrc->wbMul2Camera(rw, gw, bw);
|
||||
// printf("ra=%f ga=%f ba=%f\n", rw, gw, bw);
|
||||
// params->wb.itcwb_sampling = false;
|
||||
/*
|
||||
printf("ra=%f ga=%f ba=%f\n", rw, gw, bw);
|
||||
//recalculate temp and green with wb multipliers.
|
||||
imgsrc->wbCamera2Mul(rw, gw, bw);
|
||||
ColorTemp ct(rw, gw, bw, 1.0, currWB.getObserver());
|
||||
//allows to calculate temp and green with multipliers in case of we want in GUI
|
||||
float tem = ct.getTemp();
|
||||
float gre = ct.getGreen();
|
||||
printf("tem=%f gre=%f \n", (double) tem, (double) gre);
|
||||
*/
|
||||
}
|
||||
|
||||
int met = 0;
|
||||
|
||||
if (awbListener) {
|
||||
if (params->wb.method == "autitcgreen") {
|
||||
awbListener->WBChanged(params->wb.temperature, params->wb.green, rw, gw, bw, studgood);
|
||||
if (params->wb.itcwb_sampling) {
|
||||
dread = 1;
|
||||
studgood = 1.f;
|
||||
awbListener->WBChanged(met, params->wb.temperature, params->wb.green, rw, gw, bw, 0, 1, 0, dread, studgood, 0, 0, 0, 0);
|
||||
|
||||
} else {
|
||||
awbListener->WBChanged(params->wb.temperature, params->wb.green, rw, gw, bw, -1.f);
|
||||
minchrom = LIM(minchrom, 0.f, 0.9f);
|
||||
delta = LIM(delta, 0.f, 0.9f);
|
||||
minhist = std::max(minhist, 100.f);
|
||||
maxhist = std::max(maxhist, 1000.f);
|
||||
kmin = std::max(kmin, 18);
|
||||
dread = LIM(dread, 10, 239);
|
||||
awbListener->WBChanged(met, params->wb.temperature, params->wb.green, rw, gw, bw, temp0, delta, bia, dread, studgood, minchrom, kmin, minhist, maxhist);
|
||||
}
|
||||
} else {
|
||||
awbListener->WBChanged(met, params->wb.temperature, params->wb.green, rw, gw, bw, -1.f, -1.f, 1, 1, -1.f, -1.f, 1, -1.f, -1.f);
|
||||
}
|
||||
}
|
||||
|
||||
@ -725,6 +964,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (spotprev) {
|
||||
spotprev->copyData(orig_prev);
|
||||
}
|
||||
@ -762,8 +1002,8 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
}
|
||||
|
||||
for (int sp = 0; sp < (int)params->locallab.spots.size(); sp++) {
|
||||
if(params->locallab.spots.at(sp).expsharp && params->dirpyrequalizer.cbdlMethod == "bef") {
|
||||
if(params->locallab.spots.at(sp).shardamping < 1) {
|
||||
if (params->locallab.spots.at(sp).expsharp && params->dirpyrequalizer.cbdlMethod == "bef") {
|
||||
if (params->locallab.spots.at(sp).shardamping < 1) {
|
||||
params->locallab.spots.at(sp).shardamping = 1;
|
||||
}
|
||||
}
|
||||
@ -910,6 +1150,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
params->locallab.spots.at(sp).sourceGraycie = sourceg[sp];
|
||||
params->locallab.spots.at(sp).sourceabscie = sourceab[sp];
|
||||
float jz1 = defSpot.jz100;
|
||||
|
||||
if (locallListener) {
|
||||
locallListener->logencodChanged(blackev[sp], whiteev[sp], sourceg[sp], sourceab[sp], targetg[sp], autocomput[sp], autocie[sp], jz1);
|
||||
}
|
||||
@ -1010,6 +1251,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
if (params->locallab.spots.at(sp).equilret && params->locallab.spots.at(sp).expreti) {
|
||||
savenormreti.reset(new LabImage(*oprevl, true));
|
||||
}
|
||||
|
||||
// Set local curves of current spot to LUT
|
||||
locRETgainCurve.Set(params->locallab.spots.at(sp).localTgaincurve);
|
||||
locRETtransCurve.Set(params->locallab.spots.at(sp).localTtranscurve);
|
||||
@ -1130,10 +1372,11 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
float yend = 1.f;
|
||||
float xsta = 0.f;
|
||||
float xend = 1.f;
|
||||
|
||||
if (istm || isreti) {
|
||||
locx = params->locallab.spots.at(sp).loc.at(0) / 2000.0;
|
||||
locy = params->locallab.spots.at(sp).loc.at(2) / 2000.0;
|
||||
locxl= params->locallab.spots.at(sp).loc.at(1) / 2000.0;
|
||||
locxl = params->locallab.spots.at(sp).loc.at(1) / 2000.0;
|
||||
locyt = params->locallab.spots.at(sp).loc.at(3) / 2000.0;
|
||||
centx = params->locallab.spots.at(sp).centerX / 2000.0 + 0.5;
|
||||
centy = params->locallab.spots.at(sp).centerY / 2000.0 + 0.5;
|
||||
@ -1143,6 +1386,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
xend = std::min(static_cast<float>(centx + locx), 1.f);
|
||||
// printf("xsta=%f xend=%f ysta=%f yend=%f \n", xsta, xend, ysta, yend);
|
||||
}
|
||||
|
||||
int ww = nprevl->W;
|
||||
int hh = nprevl->H;
|
||||
int xxs = xsta * ww;
|
||||
@ -1151,10 +1395,11 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
int yye = yend * hh;
|
||||
|
||||
if (istm) { //calculate mean and sigma on full image for RT-spot use by normalize_mean_dt
|
||||
ipf.mean_sig (nprevl->L, meantme, stdtme, xxs, xxe, yys, yye);
|
||||
ipf.mean_sig(nprevl->L, meantme, stdtme, xxs, xxe, yys, yye);
|
||||
}
|
||||
|
||||
if (isreti) { //calculate mean and sigma on full image for RT-spot use by normalize_mean_dt
|
||||
ipf.mean_sig (nprevl->L, meanretie, stdretie,xxs, xxe, yys, yye) ;
|
||||
ipf.mean_sig(nprevl->L, meanretie, stdretie, xxs, xxe, yys, yye) ;
|
||||
}
|
||||
|
||||
double huerblu = huerefblurs[sp] = huerefblu;
|
||||
@ -1204,7 +1449,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
|
||||
float highresi = 0.f;
|
||||
float nresi = 0.f;
|
||||
float highresi46 =0.f;
|
||||
float highresi46 = 0.f;
|
||||
float nresi46 = 0.f;
|
||||
float Lhighresi = 0.f;
|
||||
float Lnresi = 0.f;
|
||||
@ -1269,10 +1514,11 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
|
||||
|
||||
fabrefp[sp] = fab;
|
||||
|
||||
if (istm) { //calculate mean and sigma on full image for use by normalize_mean_dt
|
||||
float meanf = 0.f;
|
||||
float stdf = 0.f;
|
||||
ipf.mean_sig (savenormtm->L, meanf, stdf, xxs, xxe, yys, yye);
|
||||
ipf.mean_sig(savenormtm->L, meanf, stdf, xxs, xxe, yys, yye);
|
||||
|
||||
//using 2 unused variables noiselumc and softradiustm
|
||||
params->locallab.spots.at(sp).noiselumc = (int) meanf;
|
||||
@ -1282,7 +1528,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
if (isreti) { //calculate mean and sigma on full image for use by normalize_mean_dt
|
||||
float meanf = 0.f;
|
||||
float stdf = 0.f;
|
||||
ipf.mean_sig (savenormreti->L, meanf, stdf,xxs, xxe, yys, yye );
|
||||
ipf.mean_sig(savenormreti->L, meanf, stdf, xxs, xxe, yys, yye);
|
||||
//using 2 unused variables sensihs and sensiv
|
||||
params->locallab.spots.at(sp).sensihs = (int) meanf;
|
||||
params->locallab.spots.at(sp).sensiv = (int) stdf;
|
||||
@ -1305,12 +1551,14 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
retiMinMax.Tmin = Tmin;
|
||||
retiMinMax.Tmax = Tmax;
|
||||
locallretiminmax.push_back(retiMinMax);
|
||||
|
||||
// Recalculate references after
|
||||
if (params->locallab.spots.at(sp).spotMethod == "exc") {
|
||||
ipf.calc_ref(sp, reserv.get(), reserv.get(), 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huer, chromar, lumar, sobeler, avg, locwavCurveden, locwavdenutili);
|
||||
} else {
|
||||
ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huer, chromar, lumar, sobeler, avg, locwavCurveden, locwavdenutili);
|
||||
}
|
||||
|
||||
// Update Locallab reference values according to recurs parameter
|
||||
if (params->locallab.spots.at(sp).recurs) {
|
||||
/*
|
||||
@ -1329,6 +1577,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
fabrefp[sp] = fab;
|
||||
|
||||
}
|
||||
|
||||
// spotref.fab = fab;
|
||||
// locallref.at(sp).fab = fab;
|
||||
|
||||
@ -1340,6 +1589,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
delete [] huerefp;
|
||||
delete [] chromarefp;
|
||||
delete [] lumarefp;
|
||||
@ -1522,16 +1772,18 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
nprevl->CopyFrom(oprevl);
|
||||
histCCurve.clear();
|
||||
histLCurve.clear();
|
||||
|
||||
if (params->colorToning.enabled && params->colorToning.method == "LabGrid") {
|
||||
ipf.colorToningLabGrid(nprevl, 0, nprevl->W, 0, nprevl->H, false);
|
||||
}
|
||||
|
||||
ipf.shadowsHighlights(nprevl, params->sh.enabled, params->sh.lab,params->sh.highlights ,params->sh.shadows, params->sh.radius, scale, params->sh.htonalwidth, params->sh.stonalwidth);
|
||||
ipf.shadowsHighlights(nprevl, params->sh.enabled, params->sh.lab, params->sh.highlights, params->sh.shadows, params->sh.radius, scale, params->sh.htonalwidth, params->sh.stonalwidth);
|
||||
|
||||
if (params->localContrast.enabled) {
|
||||
// Alberto's local contrast
|
||||
ipf.localContrast(nprevl, nprevl->L, params->localContrast, false, scale);
|
||||
}
|
||||
|
||||
ipf.chromiLuminanceCurve(nullptr, pW, nprevl, nprevl, chroma_acurve, chroma_bcurve, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, histCCurve, histLCurve);
|
||||
ipf.vibrance(nprevl, params->vibrance, params->toneCurve.hrenabled, params->icm.workingProfile);
|
||||
ipf.labColorCorrectionRegions(nprevl);
|
||||
@ -1686,15 +1938,17 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
background = 0.f;
|
||||
show = 0;
|
||||
}
|
||||
|
||||
float indic = 1.f;
|
||||
|
||||
if (WaveParams.showmask){
|
||||
if (WaveParams.showmask) {
|
||||
mL0 = mC0 = -1.f;
|
||||
indic = -1.f;
|
||||
mL = fabs(mL);
|
||||
mC = fabs(mC);
|
||||
show = 1;
|
||||
}
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif
|
||||
@ -1710,13 +1964,13 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
unshar = NULL;
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
if (WaveParams.softrad > 0.f) {
|
||||
array2D<float> ble(pW, pH);
|
||||
array2D<float> guid(pW, pH);
|
||||
#ifdef _OPENMP
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif
|
||||
#endif
|
||||
|
||||
for (int ir = 0; ir < pH; ir++)
|
||||
for (int jr = 0; jr < pW; jr++) {
|
||||
@ -1735,16 +1989,16 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
|
||||
|
||||
|
||||
#ifdef _OPENMP
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif
|
||||
#endif
|
||||
|
||||
for (int ir = 0; ir < pH; ir++)
|
||||
for (int jr = 0; jr < pW; jr++) {
|
||||
nprevl->L[ir][jr] = provradius->L[ir][jr] + 32768.f * ble[ir][jr];
|
||||
}
|
||||
}
|
||||
*/
|
||||
*/
|
||||
if (WaveParams.softrad > 0.f) {
|
||||
|
||||
delete provradius;
|
||||
@ -1764,6 +2018,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
const int GH = nprevl->H;
|
||||
std::unique_ptr<LabImage> provis;
|
||||
const float pres = 0.01f * params->icm.preser;
|
||||
|
||||
if (pres > 0.f && params->icm.wprim != ColorManagementParams::Primaries::DEFAULT) {
|
||||
provis.reset(new LabImage(GW, GH));
|
||||
provis->CopyFrom(nprevl);
|
||||
@ -1786,14 +2041,17 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
ipf.workingtrc(tmpImage1.get(), tmpImage1.get(), GW, GH, 5, prof, gamtone, slotone, illum, prim, dummy, false, true, true);
|
||||
|
||||
ipf.rgb2lab(*tmpImage1, *nprevl, params->icm.workingProfile);
|
||||
|
||||
//nprevl and provis
|
||||
if (provis) {
|
||||
ipf.preserv(nprevl, provis.get(), GW, GH);
|
||||
}
|
||||
|
||||
if (params->icm.fbw) {
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif
|
||||
|
||||
for (int x = 0; x < GH; x++)
|
||||
for (int y = 0; y < GW; y++) {
|
||||
nprevl->a[x][y] = 0.f;
|
||||
@ -1803,7 +2061,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
|
||||
tmpImage1.reset();
|
||||
|
||||
if (prim == 12) {//pass red gre blue xy in function of area dats Ciexy
|
||||
if (prim == 13) {//pass red gre blue xy in function of area dats Ciexy
|
||||
float redgraphx = params->icm.labgridcieALow;
|
||||
float redgraphy = params->icm.labgridcieBLow;
|
||||
float blugraphx = params->icm.labgridcieAHigh;
|
||||
@ -1825,7 +2083,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
greyy = rtengine::LIM(greyy, 0.5f, 1.f);
|
||||
|
||||
if (primListener) {
|
||||
primListener->primChanged (redxx, redyy, bluxx, bluyy, grexx, greyy);
|
||||
primListener->primChanged(redxx, redyy, bluxx, bluyy, grexx, greyy);
|
||||
}
|
||||
} else {//all other cases - pass Cie xy to update graph Ciexy
|
||||
float r_x = params->icm.redx;
|
||||
@ -1843,38 +2101,47 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
wx = 0.37798f;
|
||||
wy = 0.38123f;
|
||||
break;
|
||||
|
||||
case 2://D50
|
||||
wx = 0.3457f;
|
||||
wy = 0.3585f;
|
||||
break;
|
||||
|
||||
case 3://D55
|
||||
wx = 0.3324f;
|
||||
wy = 0.3474f;
|
||||
break;
|
||||
|
||||
case 4://D60
|
||||
wx = 0.3217f;
|
||||
wy = 0.3377f;
|
||||
break;
|
||||
|
||||
case 5://D65
|
||||
wx = 0.3127f;
|
||||
wy = 0.3290f;
|
||||
break;
|
||||
|
||||
case 6://D80
|
||||
wx = 0.2937f;
|
||||
wy = 0.3092f;
|
||||
break;
|
||||
|
||||
case 7://D120
|
||||
wx = 0.2697f;
|
||||
wy = 0.2808f;
|
||||
break;
|
||||
|
||||
case 8://stdA
|
||||
wx = 0.4476f;
|
||||
wy = 0.4074f;
|
||||
break;
|
||||
|
||||
case 9://2000K
|
||||
wx = 0.5266f;
|
||||
wy = 0.4133f;
|
||||
break;
|
||||
|
||||
case 10://1500K
|
||||
wx = 0.5857f;
|
||||
wy = 0.3932f;
|
||||
@ -1882,14 +2149,14 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
}
|
||||
|
||||
if (primListener) {
|
||||
primListener->iprimChanged (r_x, r_y, b_x, b_y, g_x, g_y, wx, wy);
|
||||
primListener->iprimChanged(r_x, r_y, b_x, b_y, g_x, g_y, wx, wy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (params->colorappearance.enabled) {
|
||||
// L histo and Chroma histo for ciecam
|
||||
// histogram well be for Lab (Lch) values, because very difficult to do with J,Q, M, s, C
|
||||
// histogram will be for Lab (Lch) values, because very difficult to do with J,Q, M, s, C
|
||||
int x1, y1, x2, y2;
|
||||
params->crop.mapToResized(pW, pH, scale, x1, x2, y1, y2);
|
||||
lhist16CAM.clear();
|
||||
@ -1936,9 +2203,11 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
adap = pow(2.0, E_V - 3.0); // cd / m2
|
||||
// end calculation adaptation scene luminosity
|
||||
}
|
||||
if(params->colorappearance.catmethod == "symg") {//force abolute luminance scenescene to 400 in symmetric
|
||||
|
||||
if (params->colorappearance.catmethod == "symg") { //force abolute luminance scenescene to 400 in symmetric
|
||||
adap = 400.;
|
||||
}
|
||||
|
||||
float d, dj, yb;
|
||||
bool execsharp = false;
|
||||
|
||||
@ -1960,12 +2229,14 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
CAMBrightCurveQ.dirty = true;
|
||||
|
||||
ipf.ciecam_02float(ncie, float (adap), pW, 2, nprevl, params.get(), customColCurve1, customColCurve2, customColCurve3, histLCAM, histCCAM, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 0, scale, execsharp, d, dj, yb, 1);
|
||||
|
||||
//call listener
|
||||
if ((params->colorappearance.autodegree || params->colorappearance.autodegreeout) && acListener && params->colorappearance.enabled) {
|
||||
if(params->colorappearance.catmethod == "symg") {//force chromatic adaptation to 90 in symmetric
|
||||
if (params->colorappearance.catmethod == "symg") { //force chromatic adaptation to 90 in symmetric
|
||||
d = 0.9;
|
||||
dj = 0.9;
|
||||
}
|
||||
|
||||
acListener->autoCamChanged(100.* (double)d, 100.* (double)dj);
|
||||
}
|
||||
|
||||
@ -1974,14 +2245,16 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
}
|
||||
|
||||
if (params->colorappearance.autoybscen && acListener && params->colorappearance.enabled) {
|
||||
if(params->colorappearance.catmethod == "symg") {//force yb scene to 18 in symmetric
|
||||
if (params->colorappearance.catmethod == "symg") { //force yb scene to 18 in symmetric
|
||||
yb = 18;
|
||||
}
|
||||
|
||||
acListener->ybCamChanged((int) yb); //real value Yb scene
|
||||
}
|
||||
|
||||
double tempsym = 5003.;
|
||||
int wmodel = 0;//wmodel allows - arbitrary - choice of illuminant and temp with choice
|
||||
|
||||
if (params->colorappearance.wbmodel == "RawT") {
|
||||
wmodel = 0;
|
||||
} else if (params->colorappearance.wbmodel == "RawTCAT02") {
|
||||
@ -1990,7 +2263,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
wmodel = 2;//force white balance in symmetric
|
||||
}
|
||||
|
||||
if(params->colorappearance.catmethod == "symg" && wmodel == 2) {
|
||||
if (params->colorappearance.catmethod == "symg" && wmodel == 2) {
|
||||
tempsym = params->wb.temperature;//force white balance in symmetric
|
||||
} else {
|
||||
if (params->colorappearance.illum == "iA") {//otherwise force illuminant source
|
||||
@ -2011,6 +2284,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
tempsym = params->wb.temperature;//force white balance in symmetric
|
||||
}
|
||||
}
|
||||
|
||||
if (params->colorappearance.enabled && params->colorappearance.autotempout) {
|
||||
acListener->wbCamChanged(tempsym, 1.f); //real temp and tint = 1.
|
||||
}
|
||||
@ -2083,19 +2357,24 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
}
|
||||
|
||||
hist_lrgb_dirty = vectorscope_hc_dirty = vectorscope_hs_dirty = waveform_dirty = true;
|
||||
|
||||
if (hListener) {
|
||||
if (hListener->updateHistogram()) {
|
||||
updateLRGBHistograms();
|
||||
}
|
||||
|
||||
if (hListener->updateVectorscopeHC()) {
|
||||
updateVectorscopeHC();
|
||||
}
|
||||
|
||||
if (hListener->updateVectorscopeHS()) {
|
||||
updateVectorscopeHS();
|
||||
}
|
||||
|
||||
if (hListener->updateWaveform()) {
|
||||
updateWaveforms();
|
||||
}
|
||||
|
||||
notifyHistogramChanged();
|
||||
}
|
||||
}
|
||||
@ -2106,14 +2385,14 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
}
|
||||
}
|
||||
|
||||
void ImProcCoordinator::setTweakOperator (TweakOperator *tOperator)
|
||||
void ImProcCoordinator::setTweakOperator(TweakOperator *tOperator)
|
||||
{
|
||||
if (tOperator) {
|
||||
tweakOperator = tOperator;
|
||||
}
|
||||
}
|
||||
|
||||
void ImProcCoordinator::unsetTweakOperator (TweakOperator *tOperator)
|
||||
void ImProcCoordinator::unsetTweakOperator(TweakOperator *tOperator)
|
||||
{
|
||||
if (tOperator && tOperator == tweakOperator) {
|
||||
tweakOperator = nullptr;
|
||||
@ -2127,6 +2406,7 @@ void ImProcCoordinator::freeAll()
|
||||
if (spotprev && spotprev != oprevi) {
|
||||
delete spotprev;
|
||||
}
|
||||
|
||||
spotprev = nullptr;
|
||||
|
||||
if (orig_prev != oprevi) {
|
||||
@ -2161,7 +2441,7 @@ void ImProcCoordinator::freeAll()
|
||||
allocated = false;
|
||||
}
|
||||
|
||||
void ImProcCoordinator::allocCache (Imagefloat* &imgfloat)
|
||||
void ImProcCoordinator::allocCache(Imagefloat* &imgfloat)
|
||||
{
|
||||
if (imgfloat == nullptr) {
|
||||
imgfloat = new Imagefloat(pW, pH);
|
||||
@ -2188,8 +2468,8 @@ void ImProcCoordinator::setScale(int prevscale)
|
||||
|
||||
do {
|
||||
prevscale--;
|
||||
PreviewProps pp (0, 0, fw, fh, prevscale);
|
||||
imgsrc->getSize (pp, nW, nH);
|
||||
PreviewProps pp(0, 0, fw, fh, prevscale);
|
||||
imgsrc->getSize(pp, nW, nH);
|
||||
} while (nH < 400 && prevscale > 1 && (nW * nH < 1000000)); // actually hardcoded values, perhaps a better choice is possible
|
||||
|
||||
if (nW != pW || nH != pH) {
|
||||
@ -2348,15 +2628,18 @@ bool ImProcCoordinator::updateVectorscopeHC()
|
||||
#ifdef _OPENMP
|
||||
#pragma omp for nowait
|
||||
#endif
|
||||
|
||||
for (int i = y1; i < y2; ++i) {
|
||||
for (int j = x1, ofs_lab = (i - y1) * (x2 - x1); j < x2; ++j, ++ofs_lab) {
|
||||
const int col = norm_factor * a[ofs_lab] + size / 2 + 0.5f;
|
||||
const int row = norm_factor * b[ofs_lab] + size / 2 + 0.5f;
|
||||
|
||||
if (col >= 0 && col < size && row >= 0 && row < size) {
|
||||
vectorscopeThr[row][col]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp critical
|
||||
#endif
|
||||
@ -2391,8 +2674,10 @@ bool ImProcCoordinator::updateVectorscopeHS()
|
||||
#ifdef _OPENMP
|
||||
#pragma omp for nowait
|
||||
#endif
|
||||
|
||||
for (int i = y1; i < y2; ++i) {
|
||||
int ofs = (i * pW + x1) * 3;
|
||||
|
||||
for (int j = x1; j < x2; ++j) {
|
||||
const float red = 257.f * workimg->data[ofs++];
|
||||
const float green = 257.f * workimg->data[ofs++];
|
||||
@ -2402,11 +2687,13 @@ bool ImProcCoordinator::updateVectorscopeHS()
|
||||
const auto sincosval = xsincosf(2.f * RT_PI_F * h);
|
||||
const int col = s * sincosval.y * (size / 2) + size / 2;
|
||||
const int row = s * sincosval.x * (size / 2) + size / 2;
|
||||
|
||||
if (col >= 0 && col < size && row >= 0 && row < size) {
|
||||
vectorscopeThr[row][col]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp critical
|
||||
#endif
|
||||
@ -2454,6 +2741,7 @@ bool ImProcCoordinator::updateWaveforms()
|
||||
waveformLuma.fill(0);
|
||||
|
||||
constexpr float luma_factor = 255.f / 32768.f;
|
||||
|
||||
for (int i = y1; i < y2; i++) {
|
||||
int ofs = (i * pW + x1) * 3;
|
||||
float* L_row = nprevl->L[i] + x1;
|
||||
@ -2483,9 +2771,20 @@ bool ImProcCoordinator::getAutoWB(double& temp, double& green, double equal, Sta
|
||||
// imgsrc->getAutoWBMultipliers(rm, gm, bm);
|
||||
double tempitc = 5000.;
|
||||
double greenitc = 1.;
|
||||
int dread = 0;
|
||||
int bia = 0;
|
||||
float temp0 = 5000.f;
|
||||
float studgood = 1000.f;
|
||||
int nocam = 0;
|
||||
int kcam = 0;
|
||||
float minchrom = 1000.f;
|
||||
float delta = 0.f;
|
||||
int kmin = 20;
|
||||
float minhist = 10000000.f;
|
||||
float maxhist = -1000.f;
|
||||
double tempref, greenref;
|
||||
imgsrc->getAutoWBMultipliersitc(tempref, greenref, tempitc, greenitc, studgood, 0, 0, fh, fw, 0, 0, fh, fw, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve);
|
||||
bool extra = false;
|
||||
imgsrc->getAutoWBMultipliersitc(extra, tempref, greenref, tempitc, greenitc, temp0, delta, bia, dread, kcam, nocam, studgood, minchrom, kmin, minhist, maxhist, 0, 0, fh, fw, 0, 0, fh, fw, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve);
|
||||
|
||||
if (rm != -1) {
|
||||
autoWB.update(rm, gm, bm, equal, observer, tempBias);
|
||||
@ -2804,6 +3103,7 @@ void ImProcCoordinator::process()
|
||||
|| params->rgbCurves != nextParams->rgbCurves
|
||||
|| params->colorToning != nextParams->colorToning
|
||||
|| params->vibrance != nextParams->vibrance
|
||||
// || params->wb != nextParams->wb //isPanningRelatedChange(nextParams->wb)
|
||||
|| params->wb.isPanningRelatedChange(nextParams->wb)
|
||||
|| params->colorappearance != nextParams->colorappearance
|
||||
|| params->epd != nextParams->epd
|
||||
@ -2919,7 +3219,9 @@ void ImProcCoordinator::requestUpdateWaveform()
|
||||
if (!hListener) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool updated = updateWaveforms();
|
||||
|
||||
if (updated) {
|
||||
notifyHistogramChanged();
|
||||
}
|
||||
@ -2930,7 +3232,9 @@ void ImProcCoordinator::requestUpdateHistogram()
|
||||
if (!hListener) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool updated = updateLRGBHistograms();
|
||||
|
||||
if (updated) {
|
||||
notifyHistogramChanged();
|
||||
}
|
||||
@ -2941,6 +3245,7 @@ void ImProcCoordinator::requestUpdateHistogramRaw()
|
||||
if (!hListener) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't need to actually update histogram because it is always
|
||||
// up-to-date.
|
||||
if (hist_raw_dirty) {
|
||||
@ -2954,7 +3259,9 @@ void ImProcCoordinator::requestUpdateVectorscopeHC()
|
||||
if (!hListener) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool updated = updateVectorscopeHC();
|
||||
|
||||
if (updated) {
|
||||
notifyHistogramChanged();
|
||||
}
|
||||
@ -2965,7 +3272,9 @@ void ImProcCoordinator::requestUpdateVectorscopeHS()
|
||||
if (!hListener) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool updated = updateVectorscopeHS();
|
||||
|
||||
if (updated) {
|
||||
notifyHistogramChanged();
|
||||
}
|
||||
|
@ -74,6 +74,7 @@ protected:
|
||||
ImageSource* imgsrc;
|
||||
|
||||
ColorTemp currWB;
|
||||
ColorTemp currWBcust;
|
||||
ColorTemp autoWB;
|
||||
ColorTemp currWBloc;
|
||||
ColorTemp autoWBloc;
|
||||
|
@ -1985,7 +1985,7 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
|
||||
|
||||
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()) {
|
||||
@ -4232,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 ){
|
||||
@ -4256,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;
|
||||
@ -4415,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));
|
||||
}
|
||||
}
|
||||
|
||||
@ -4658,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) {
|
||||
@ -4725,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
|
||||
|
||||
|
||||
@ -5723,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();
|
||||
@ -5835,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);
|
||||
|
@ -117,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);
|
||||
@ -439,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);
|
||||
@ -501,6 +502,7 @@ enum class BlurType {
|
||||
|
||||
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;
|
||||
|
@ -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;
|
||||
|
@ -18245,9 +18245,9 @@ void ImProcFunctions::Lab_Local(
|
||||
#endif
|
||||
for (int y = 0; y < bfh ; y++) {
|
||||
for (int x = 0; x < bfw; x++) {
|
||||
tmpImageorig->r(y, x) = intp(lp.opacol, screen(tmpImageorig->r(y, x), tmpImagereserv->r(y, x), maxR), tmpImageorig->r(y, x));
|
||||
tmpImageorig->g(y, x) = intp(lp.opacol, screen(tmpImageorig->g(y, x), tmpImagereserv->g(y, x), maxG), tmpImageorig->g(y, x));
|
||||
tmpImageorig->b(y, x) = intp(lp.opacol, screen(tmpImageorig->b(y, x), tmpImagereserv->b(y, x), maxB), tmpImageorig->b(y, x));
|
||||
tmpImageorig->r(y, x) = intp(lp.opacol, screen(tmpImageorig->r(y, x), tmpImagereserv->r(y, x), 1.f), tmpImageorig->r(y, x));
|
||||
tmpImageorig->g(y, x) = intp(lp.opacol, screen(tmpImageorig->g(y, x), tmpImagereserv->g(y, x), 1.f), tmpImageorig->g(y, x));
|
||||
tmpImageorig->b(y, x) = intp(lp.opacol, screen(tmpImageorig->b(y, x), tmpImagereserv->b(y, x), 1.f), tmpImageorig->b(y, x));
|
||||
}
|
||||
}
|
||||
} else if (lp.mergecolMethod == 12) { //darken only
|
||||
|
@ -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)
|
||||
|
@ -1387,16 +1387,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
|
||||
|
||||
{
|
||||
}
|
||||
@ -1418,6 +1414,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
|
||||
|
||||
)
|
||||
)
|
||||
);
|
||||
@ -1433,15 +1433,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;
|
||||
|
||||
}
|
||||
@ -6216,15 +6212,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
|
||||
@ -7293,6 +7285,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"},
|
||||
@ -8194,15 +8187,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) {
|
||||
@ -9630,6 +9619,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},
|
||||
|
@ -643,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();
|
||||
@ -1940,6 +1936,7 @@ struct ColorManagementParams {
|
||||
ACES_P1,
|
||||
WIDE_GAMUT,
|
||||
ACES_P0,
|
||||
JDC_MAX,
|
||||
BRUCE_RGB,
|
||||
BETA_RGB,
|
||||
BEST_RGB,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||
|
@ -484,7 +484,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
|
||||
|
@ -8,7 +8,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.
|
||||
@ -60,6 +60,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)
|
||||
|
||||
@ -95,6 +96,9 @@ public:
|
||||
double cbdlsensi;
|
||||
// bool showtooltip;
|
||||
bool itcwb_enable;
|
||||
double itcwb_deltaspec;
|
||||
double itcwb_powponder;
|
||||
|
||||
//wavelet levels
|
||||
double edghi;
|
||||
double edglo;
|
||||
|
@ -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;
|
||||
|
@ -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;}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -904,6 +904,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel)
|
||||
|
||||
send_to_external = Gtk::manage(new PopUpButton("", false));
|
||||
send_to_external->set_tooltip_text(M("MAIN_BUTTON_SENDTOEDITOR_TOOLTIP"));
|
||||
send_to_external->setEmptyImage("palette-brush.png");
|
||||
setExpandAlignProperties(send_to_external->buttonGroup, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
|
||||
updateExternalEditorWidget(
|
||||
options.externalEditorIndex >= 0 ? options.externalEditorIndex : options.externalEditors.size(),
|
||||
@ -2030,7 +2031,7 @@ bool EditorPanel::idle_saveImage (ProgressConnector<rtengine::IImagefloat*> *pc,
|
||||
msgd.run ();
|
||||
|
||||
saveimgas->set_sensitive (true);
|
||||
send_to_external->set_sensitive(true);
|
||||
send_to_external->set_sensitive(send_to_external->getEntryCount());
|
||||
isProcessing = false;
|
||||
|
||||
}
|
||||
@ -2058,7 +2059,7 @@ bool EditorPanel::idle_imageSaved (ProgressConnector<int> *pc, rtengine::IImagef
|
||||
}
|
||||
|
||||
saveimgas->set_sensitive (true);
|
||||
send_to_external->set_sensitive(true);
|
||||
send_to_external->set_sensitive(send_to_external->getEntryCount());
|
||||
|
||||
parent->setProgressStr ("");
|
||||
parent->setProgress (0.);
|
||||
@ -2249,8 +2250,10 @@ void EditorPanel::sendToExternalPressed()
|
||||
dialog->show();
|
||||
} else {
|
||||
struct ExternalEditor editor = options.externalEditors.at(options.externalEditorIndex);
|
||||
external_editor_info = Gio::AppInfo::create_from_commandline(editor.command, editor.name, Gio::APP_INFO_CREATE_NONE);
|
||||
external_editor_native_command = editor.native_command;
|
||||
external_editor_info = {
|
||||
editor.name,
|
||||
editor.command,
|
||||
editor.native_command};
|
||||
sendToExternal();
|
||||
}
|
||||
}
|
||||
@ -2388,7 +2391,7 @@ bool EditorPanel::idle_sendToGimp ( ProgressConnector<rtengine::IImagefloat*> *p
|
||||
Gtk::MessageDialog msgd (*parent, msg_, true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
|
||||
msgd.run ();
|
||||
saveimgas->set_sensitive (true);
|
||||
send_to_external->set_sensitive(true);
|
||||
send_to_external->set_sensitive(send_to_external->getEntryCount());
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -2409,14 +2412,14 @@ bool EditorPanel::idle_sentToGimp (ProgressConnector<int> *pc, rtengine::IImagef
|
||||
|
||||
if ((!img && Glib::file_test(filename, Glib::FILE_TEST_IS_REGULAR)) || (img && !errore)) {
|
||||
saveimgas->set_sensitive (true);
|
||||
send_to_external->set_sensitive(true);
|
||||
send_to_external->set_sensitive(send_to_external->getEntryCount());
|
||||
parent->setProgressStr ("");
|
||||
parent->setProgress (0.);
|
||||
bool success = false;
|
||||
|
||||
setUserOnlyPermission(Gio::File::create_for_path(filename), false);
|
||||
|
||||
success = ExtProgStore::openInExternalEditor(filename, external_editor_info, external_editor_native_command);
|
||||
success = ExtProgStore::openInExternalEditor(filename, external_editor_info);
|
||||
|
||||
if (!success) {
|
||||
Gtk::MessageDialog msgd (*parent, M ("MAIN_MSG_CANNOTSTARTEDITOR"), false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
|
||||
@ -2445,12 +2448,16 @@ RTAppChooserDialog *EditorPanel::getAppChooserDialog()
|
||||
void EditorPanel::onAppChooserDialogResponse(int responseId)
|
||||
{
|
||||
switch (responseId) {
|
||||
case Gtk::RESPONSE_OK:
|
||||
case Gtk::RESPONSE_OK: {
|
||||
getAppChooserDialog()->close();
|
||||
external_editor_info = getAppChooserDialog()->get_app_info();
|
||||
external_editor_native_command = false;
|
||||
const auto app_info = getAppChooserDialog()->get_app_info();
|
||||
external_editor_info = {
|
||||
app_info->get_name(),
|
||||
app_info->get_commandline(),
|
||||
false};
|
||||
sendToExternal();
|
||||
break;
|
||||
}
|
||||
case Gtk::RESPONSE_CANCEL:
|
||||
case Gtk::RESPONSE_CLOSE:
|
||||
getAppChooserDialog()->close();
|
||||
@ -2781,7 +2788,10 @@ void EditorPanel::updateExternalEditorWidget(int selectedIndex, const std::vecto
|
||||
send_to_external->insertEntry(i, "palette-brush.png", name, &send_to_external_radio_group);
|
||||
}
|
||||
}
|
||||
#ifndef __APPLE__
|
||||
send_to_external->addEntry("palette-brush.png", M("GENERAL_OTHER"), &send_to_external_radio_group);
|
||||
#endif
|
||||
send_to_external->set_sensitive(send_to_external->getEntryCount());
|
||||
send_to_external->setSelected(selectedIndex);
|
||||
send_to_external->show();
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include "extprog.h"
|
||||
#include "histogrampanel.h"
|
||||
#include "history.h"
|
||||
#include "imageareapanel.h"
|
||||
@ -252,8 +253,7 @@ private:
|
||||
Gtk::Button* navSync;
|
||||
Gtk::Button* navNext;
|
||||
Gtk::Button* navPrev;
|
||||
Glib::RefPtr<Gio::AppInfo> external_editor_info;
|
||||
bool external_editor_native_command;
|
||||
EditorInfo external_editor_info;
|
||||
std::unique_ptr<RTAppChooserDialog> app_chooser_dialog;
|
||||
ExternalEditorChangedSignal *externalEditorChangedSignal;
|
||||
sigc::connection externalEditorChangedSignalConnection;
|
||||
|
@ -37,7 +37,9 @@ ExternalEditorPreferences::ExternalEditorPreferences():
|
||||
list_view = Gtk::manage(new Gtk::TreeView());
|
||||
list_view->set_model(list_model);
|
||||
list_view->append_column(*Gtk::manage(makeAppColumn()));
|
||||
#ifndef __APPLE__
|
||||
list_view->append_column(*Gtk::manage(makeNativeCommandColumn()));
|
||||
#endif
|
||||
list_view->append_column(*Gtk::manage(makeCommandColumn()));
|
||||
|
||||
for (auto &&column : list_view->get_columns()) {
|
||||
@ -59,11 +61,18 @@ ExternalEditorPreferences::ExternalEditorPreferences():
|
||||
button_remove = Gtk::manage(new Gtk::Button());
|
||||
button_add->set_image(*add_image);
|
||||
button_remove->set_image(*remove_image);
|
||||
button_app_chooser = Gtk::manage(new Gtk::Button(M("PREFERENCES_EXTERNALEDITOR_CHANGE")));
|
||||
button_app_chooser =
|
||||
#ifdef __APPLE__
|
||||
nullptr;
|
||||
#else
|
||||
Gtk::manage(new Gtk::Button(M("PREFERENCES_EXTERNALEDITOR_CHANGE")));
|
||||
#endif
|
||||
button_file_chooser = Gtk::manage(new Gtk::Button(M("PREFERENCES_EXTERNALEDITOR_CHANGE_FILE")));
|
||||
|
||||
if (button_app_chooser) {
|
||||
button_app_chooser->signal_pressed().connect(sigc::mem_fun(
|
||||
*this, &ExternalEditorPreferences::openAppChooserDialog));
|
||||
}
|
||||
button_add->signal_pressed().connect(sigc::mem_fun(
|
||||
*this, &ExternalEditorPreferences::addEditor));
|
||||
button_file_chooser->signal_pressed().connect(sigc::mem_fun(
|
||||
@ -77,7 +86,9 @@ ExternalEditorPreferences::ExternalEditorPreferences():
|
||||
|
||||
// Toolbar.
|
||||
toolbar.set_halign(Gtk::Align::ALIGN_END);
|
||||
if (button_app_chooser) {
|
||||
toolbar.add(*button_app_chooser);
|
||||
}
|
||||
toolbar.add(*button_file_chooser);
|
||||
toolbar.add(*button_add);
|
||||
toolbar.add(*button_remove);
|
||||
@ -156,6 +167,9 @@ void ExternalEditorPreferences::addEditor()
|
||||
}
|
||||
|
||||
row[model_columns.name] = "-";
|
||||
#ifdef __APPLE__
|
||||
row[model_columns.native_command] = true;
|
||||
#endif
|
||||
list_view->get_selection()->select(row);
|
||||
}
|
||||
|
||||
@ -244,7 +258,12 @@ void ExternalEditorPreferences::onFileChooserDialogResponse(
|
||||
for (const auto &selected : selection) {
|
||||
auto row = *list_model->get_iter(selected);
|
||||
row[model_columns.icon] = Glib::RefPtr<Gio::Icon>(nullptr);
|
||||
row[model_columns.native_command] = false;
|
||||
row[model_columns.native_command] =
|
||||
#ifdef __APPLE__
|
||||
true;
|
||||
#else
|
||||
false;
|
||||
#endif
|
||||
row[model_columns.command] =
|
||||
#ifdef WIN32
|
||||
'"' + dialog->get_filename() + '"';
|
||||
@ -360,7 +379,9 @@ void ExternalEditorPreferences::setAppName(
|
||||
void ExternalEditorPreferences::updateToolbarSensitivity()
|
||||
{
|
||||
bool selected = list_view->get_selection()->count_selected_rows();
|
||||
if (button_app_chooser) {
|
||||
button_app_chooser->set_sensitive(selected);
|
||||
}
|
||||
button_file_chooser->set_sensitive(selected);
|
||||
button_remove->set_sensitive(selected);
|
||||
}
|
||||
|
@ -344,13 +344,13 @@ bool ExtProgStore::openInCustomEditor (const Glib::ustring& fileName, const Glib
|
||||
|
||||
}
|
||||
|
||||
bool ExtProgStore::openInExternalEditor(const Glib::ustring &fileName, const Glib::RefPtr<Gio::AppInfo> &editorInfo, bool nativeCommand)
|
||||
bool ExtProgStore::openInExternalEditor(const Glib::ustring &fileName, const EditorInfo &editorInfo)
|
||||
{
|
||||
if (nativeCommand) {
|
||||
if (editorInfo.isNativeCommand) {
|
||||
if (rtengine::settings->verbose) {
|
||||
std::cout << "Launching external editor as native command." << std::endl;
|
||||
}
|
||||
const Glib::ustring command = editorInfo->get_commandline();
|
||||
const Glib::ustring command = editorInfo.commandline;
|
||||
return openInCustomEditor(fileName, &command);
|
||||
}
|
||||
|
||||
@ -361,7 +361,10 @@ bool ExtProgStore::openInExternalEditor(const Glib::ustring &fileName, const Gli
|
||||
bool success = false;
|
||||
|
||||
try {
|
||||
success = editorInfo->launch(Gio::File::create_for_path(fileName));
|
||||
Glib::RefPtr<Gio::AppInfo> appInfo =
|
||||
Gio::AppInfo::create_from_commandline(
|
||||
editorInfo.commandline, editorInfo.name, Gio::APP_INFO_CREATE_NONE);
|
||||
success = appInfo->launch(Gio::File::create_for_path(fileName));
|
||||
} catch (const Glib::Error &e) {
|
||||
std::cerr
|
||||
<< "Error launching external editor.\n"
|
||||
@ -377,7 +380,7 @@ bool ExtProgStore::openInExternalEditor(const Glib::ustring &fileName, const Gli
|
||||
if (rtengine::settings->verbose) {
|
||||
std::cout << "Unable to launch external editor with Gio. Trying custom launcher." << std::endl;
|
||||
}
|
||||
Glib::ustring command = editorInfo->get_commandline();
|
||||
Glib::ustring command = editorInfo.commandline;
|
||||
#if defined WIN32
|
||||
if (command.length() > 2 && command[0] == '"' && command[command.length() - 1] == '"') {
|
||||
command = command.substr(1, command.length() - 2);
|
||||
|
@ -42,6 +42,13 @@ struct ExtProgAction
|
||||
bool execute (const std::vector<Glib::ustring>& fileNames) const;
|
||||
};
|
||||
|
||||
struct EditorInfo
|
||||
{
|
||||
Glib::ustring name;
|
||||
Glib::ustring commandline;
|
||||
bool isNativeCommand;
|
||||
};
|
||||
|
||||
// Stores all external programs that could be called by the user
|
||||
class ExtProgStore
|
||||
{
|
||||
@ -70,7 +77,7 @@ public:
|
||||
static bool openInGimp (const Glib::ustring& fileName);
|
||||
static bool openInPhotoshop (const Glib::ustring& fileName);
|
||||
static bool openInCustomEditor (const Glib::ustring& fileName, const Glib::ustring* command = nullptr);
|
||||
static bool openInExternalEditor(const Glib::ustring &fileName, const Glib::RefPtr<Gio::AppInfo> &editorInfo, bool nativeCommand);
|
||||
static bool openInExternalEditor(const Glib::ustring &fileName, const EditorInfo &editorInfo);
|
||||
};
|
||||
|
||||
#define extProgStore ExtProgStore::getInstance()
|
||||
|
@ -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 ()
|
||||
{
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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 ();
|
||||
|
@ -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());
|
||||
|
||||
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -631,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
|
||||
@ -1819,6 +1820,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");
|
||||
|
||||
@ -2596,6 +2607,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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
@ -984,15 +980,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;
|
||||
@ -2868,24 +2860,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) {
|
||||
@ -2896,12 +2872,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) {
|
||||
|
@ -249,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;
|
||||
|
||||
};
|
||||
|
||||
|
@ -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 = "--"; }
|
||||
|
@ -136,6 +136,21 @@ bool PopUpCommon::insertEntryImpl(int position, const Glib::ustring& fileName, c
|
||||
return true;
|
||||
}
|
||||
|
||||
void PopUpCommon::setEmptyImage(const Glib::ustring &fileName)
|
||||
{
|
||||
emptyImageFilename = fileName;
|
||||
|
||||
if (getEntryCount()) {
|
||||
return;
|
||||
}
|
||||
if (fileName.empty()) {
|
||||
buttonImage->hide();
|
||||
} else {
|
||||
changeImage(emptyImageFilename, Glib::RefPtr<const Gio::Icon>());
|
||||
buttonImage->show();
|
||||
}
|
||||
}
|
||||
|
||||
void PopUpCommon::removeEntry(int position)
|
||||
{
|
||||
if (position < 0 || position >= getEntryCount()) {
|
||||
@ -147,8 +162,13 @@ void PopUpCommon::removeEntry(int position)
|
||||
button->get_style_context()->remove_class("Left");
|
||||
arrowButton->hide();
|
||||
hasMenu = false;
|
||||
if (emptyImageFilename.empty()) {
|
||||
// Remove the button image.
|
||||
buttonImage->hide();
|
||||
} else {
|
||||
// Show the empty icon.
|
||||
changeImage(emptyImageFilename, Glib::RefPtr<const Gio::Icon>());
|
||||
}
|
||||
selected = -1;
|
||||
}
|
||||
else if (position < selected) {
|
||||
|
@ -64,6 +64,8 @@ public:
|
||||
bool addEntry (const Glib::ustring& fileName, const Glib::ustring& label, Gtk::RadioButtonGroup* radioGroup = nullptr);
|
||||
bool insertEntry(int position, const Glib::ustring& fileName, const Glib::ustring& label, Gtk::RadioButtonGroup* radioGroup = nullptr);
|
||||
bool insertEntry(int position, const Glib::RefPtr<const Gio::Icon>& gIcon, const Glib::ustring& label, Gtk::RadioButtonGroup* radioGroup = nullptr);
|
||||
/// Sets the button image to show when there are no entries.
|
||||
void setEmptyImage(const Glib::ustring &fileName);
|
||||
int getEntryCount () const;
|
||||
bool setSelected (int entryNum);
|
||||
int getSelected () const;
|
||||
@ -77,6 +79,7 @@ private:
|
||||
type_signal_changed messageChanged;
|
||||
type_signal_item_selected messageItemSelected;
|
||||
|
||||
Glib::ustring emptyImageFilename;
|
||||
std::vector<Glib::RefPtr<const Gio::Icon>> imageIcons;
|
||||
std::vector<Glib::ustring> imageFilenames;
|
||||
std::vector<const RTImage*> images;
|
||||
|
@ -959,6 +959,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);
|
||||
@ -1755,7 +1772,12 @@ void Preferences::storePreferences()
|
||||
|
||||
const std::vector<ExternalEditorPreferences::EditorInfo> &editors = externalEditors->getEditors();
|
||||
moptions.externalEditors.resize(editors.size());
|
||||
moptions.externalEditorIndex = -1;
|
||||
moptions.externalEditorIndex =
|
||||
#ifdef __APPLE__
|
||||
editors.empty() ? -1 : 0;
|
||||
#else
|
||||
-1;
|
||||
#endif
|
||||
for (unsigned i = 0; i < editors.size(); i++) {
|
||||
moptions.externalEditors[i] = (ExternalEditor(
|
||||
editors[i].name, editors[i].command, editors[i].native_command, editors[i].icon_serialized));
|
||||
@ -1829,6 +1851,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
|
||||
|
||||
@ -1988,6 +2011,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
|
||||
|
@ -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;
|
||||
|
@ -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,32 +342,43 @@ 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 {
|
||||
@ -369,17 +386,26 @@ void ProfilePanel::save_clicked (GdkEventButton* event)
|
||||
retCode = toSave->pparams->save(fname);
|
||||
}
|
||||
|
||||
if (!retCode) {
|
||||
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 {
|
||||
done = false;
|
||||
// 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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -241,6 +241,7 @@ RTWindow::RTWindow ()
|
||||
RTImage::init();
|
||||
WhiteBalance::init();
|
||||
MyExpander::init();
|
||||
FileBrowserEntry::init();
|
||||
|
||||
#ifndef WIN32
|
||||
const std::vector<Glib::RefPtr<Gdk::Pixbuf>> appIcons = {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -70,6 +70,7 @@ class ToolParamBlock :
|
||||
{
|
||||
public:
|
||||
ToolParamBlock();
|
||||
Gtk::SizeRequestMode get_request_mode_vfunc () const override;
|
||||
};
|
||||
|
||||
class ToolPanel :
|
||||
|
@ -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))
|
||||
);
|
||||
if(bia == 3) {
|
||||
bia2 = bia - 1;
|
||||
StudLabel->set_text(
|
||||
Glib::ustring::compose(M("TP_WBALANCE_STUDLABEL"),
|
||||
Glib::ustring::format(std::fixed, std::setprecision(4), studgood))
|
||||
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();
|
||||
|
@ -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;
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user