diff --git a/CMakeLists.txt b/CMakeLists.txt index 31a04b569..a7e29e03a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -296,7 +296,7 @@ endif (WITH_PROF) if (OPTION_OMP) find_package(OpenMP) if (OPENMP_FOUND) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -Werror=unknown-pragmas") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -Werror=unknown-pragmas -Wall -Wno-unused-result -Wno-deprecated-declarations") endif (OPENMP_FOUND) endif (OPTION_OMP) diff --git a/rtdata/languages/Catala b/rtdata/languages/Catala index e311b3a40..d2c610e9e 100644 --- a/rtdata/languages/Catala +++ b/rtdata/languages/Catala @@ -983,8 +983,13 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !DYNPROFILEEDITOR_PROFILE;Processing Profile !EDIT_OBJECT_TOOLTIP;Displays a widget on the preview window which lets you adjust this tool. !EDIT_PIPETTE_TOOLTIP;To add an adjustment point to the curve, hold the Ctrl key while left-clicking the desired spot in the image preview.\nTo adjust the point, hold the Ctrl key while left-clicking the corresponding area in the preview, then let go of Ctrl (unless you desire fine control) and while still holding the left mouse button move the mouse up or down to move that point up or down in the curve. +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_EQUALIZER;Bypass Wavelet Levels !EXPORT_BYPASS_RAW_LMMSE_ITERATIONS;Bypass [raw] LMMSE Enhancement Steps +!EXPORT_PIPELINE;Processing pipeline +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !FILEBROWSER_COLORLABEL_TOOLTIP;Color label.\n\nUse dropdown menu or shortcuts:\nShift-Ctrl-0 No Color\nShift-Ctrl-1 Red\nShift-Ctrl-2 Yellow\nShift-Ctrl-3 Green\nShift-Ctrl-4 Blue\nShift-Ctrl-5 Purple !FILEBROWSER_POPUPCOLORLABEL0;Label: None !FILEBROWSER_POPUPCOLORLABEL1;Label: Red @@ -1003,6 +1008,7 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !FILEBROWSER_RANK3_TOOLTIP;Rank 3 *\nShortcut: Shift-3 !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SHOWNOTTRASHHINT;Show only non-deleted images. !FILEBROWSER_SHOWORIGINALHINT;Show only original images.\n\nWhen several images exist with the same filename but different extensions, the one considered original is the one whose extension is nearest the top of the parsed extensions list in Preferences > File Browser > Parsed Extensions. !FILEBROWSER_UNRANK_TOOLTIP;Unrank.\nShortcut: Shift-0 @@ -1379,8 +1385,11 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !PARTIALPASTE_PREPROCESS_DEADPIXFILT;Dead pixel filter !PARTIALPASTE_PREPROCESS_HOTPIXFILT;Hot pixel filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_WAVELETGROUP;Wavelet Levels !PREFERENCES_AUTLISLOW;Low @@ -1417,6 +1426,8 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !PREFERENCES_DAUB_LABEL;Use Daubechies D6 wavelets instead of D4 !PREFERENCES_DAUB_TOOLTIP;The Noise Reduction and Wavelet Levels tools use a Debauchies mother wavelet. If you choose D6 instead of D4 you increase the number of orthogonal Daubechies coefficients and probably increase quality of small-scale levels. There is no memory or processing time difference between the two. !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FLUOF2;Fluorescent F2 !PREFERENCES_FLUOF7;Fluorescent F7 @@ -1817,28 +1828,28 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !TP_RAWEXPOS_BLACK_GREEN;Green !TP_RAWEXPOS_BLACK_RED;Red !TP_RAWEXPOS_RGB;Red, Green, Blue -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1887,7 +1898,7 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* !TP_RETINEX_CONTEDIT_LH;Hue equalizer diff --git a/rtdata/languages/Chinese (Simplified) b/rtdata/languages/Chinese (Simplified) index b5a74f58d..0955d7ea8 100644 --- a/rtdata/languages/Chinese (Simplified) +++ b/rtdata/languages/Chinese (Simplified) @@ -815,6 +815,7 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !EDIT_PIPETTE_TOOLTIP;To add an adjustment point to the curve, hold the Ctrl key while left-clicking the desired spot in the image preview.\nTo adjust the point, hold the Ctrl key while left-clicking the corresponding area in the preview, then let go of Ctrl (unless you desire fine control) and while still holding the left mouse button move the mouse up or down to move that point up or down in the curve. !EXIFFILTER_EXPOSURECOMPENSATION;Exposure compensation (EV) !EXIFFILTER_METADATAFILTER;Enable metadata filters +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_DEFRINGE;Bypass Defringe !EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction !EXPORT_BYPASS_DIRPYREQUALIZER;Bypass Contrast by Detail Levels @@ -831,7 +832,11 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !EXPORT_BYPASS_SHARPENMICRO;Bypass Microcontrast !EXPORT_BYPASS_SH_HQ;Bypass Sharp Mask Shadows/Highlights !EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. +!EXPORT_PIPELINE;Processing pipeline !EXPORT_RAW_DMETHOD;Demosaic method +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_2;queue-processed !FILEBROWSER_ADDDELTEMPLATE;Add/Del templates... !FILEBROWSER_APPLYPROFILE_PARTIAL;Apply - partial @@ -854,6 +859,7 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !FILEBROWSER_POPUPRANK;Rank !FILEBROWSER_POPUPRANK0;Unrank !FILEBROWSER_QUERYHINT;Type filenames to search for. Supports partial filenames. Separate the search terms using commas, e.g.\n1001,1004,1199\n\nExclude search terms by prefixing them with !=\ne.g.\n!=1001,1004,1199\n\nShortcuts:\nCtrl-f - focus the Find box,\nEnter - search,\nEsc - clear the Find box,\nShift-Esc - defocus the Find box. +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 !FILEBROWSER_SHOWCOLORLABEL2HINT;Show images labeled Yellow.\nShortcut: Alt-2 !FILEBROWSER_SHOWCOLORLABEL3HINT;Show images labeled Green.\nShortcut: Alt-3 @@ -1302,6 +1308,8 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !PARTIALPASTE_PREPROCESS_DEADPIXFILT;Dead pixel filter !PARTIALPASTE_PREPROCESS_HOTPIXFILT;Hot pixel filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAWEXPOS_BLACK;Black levels !PARTIALPASTE_RAWEXPOS_LINEAR;White point correction !PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -1311,6 +1319,7 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !PARTIALPASTE_RAW_FALSECOLOR;False color suppression !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_WAVELETGROUP;Wavelet Levels !PREFERENCES_AUTLISLOW;Low @@ -1351,6 +1360,8 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !PREFERENCES_DIRDARKFRAMES;Dark-frames directory !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FLATFIELDSDIR;Flat-fields directory @@ -1781,33 +1792,33 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !TP_RAWEXPOS_PRESER;Highlight preservation !TP_RAWEXPOS_RGB;Red, Green, Blue !TP_RAWEXPOS_TWOGREEN;Link greens -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DCBENHANCE;DCB enhancement !TP_RAW_DCBITERATIONS;Number of DCB iterations !TP_RAW_DMETHOD;Method !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD !TP_RAW_FALSECOLOR;False color suppression steps -!TP_RAW_FAST;fast +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. !TP_RAW_LABEL;Demosaicing -!TP_RAW_LMMSE;lmmse +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1856,7 +1867,7 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RESIZE_APPLIESTO;Applies to: !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* diff --git a/rtdata/languages/Chinese (Traditional) b/rtdata/languages/Chinese (Traditional) index 0c94d8f3b..4501bcd86 100644 --- a/rtdata/languages/Chinese (Traditional) +++ b/rtdata/languages/Chinese (Traditional) @@ -473,6 +473,7 @@ TP_WBALANCE_TEMPERATURE;色溫 !EXIFFILTER_EXPOSURECOMPENSATION;Exposure compensation (EV) !EXIFFILTER_FILETYPE;File type !EXIFFILTER_METADATAFILTER;Enable metadata filters +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_ALL;Select / Unselect All !EXPORT_BYPASS_DEFRINGE;Bypass Defringe !EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction @@ -495,8 +496,12 @@ TP_WBALANCE_TEMPERATURE;色溫 !EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. !EXPORT_MAXHEIGHT;Maximum height: !EXPORT_MAXWIDTH;Maximum width: +!EXPORT_PIPELINE;Processing pipeline !EXPORT_PUTTOQUEUEFAST; Put to queue for fast export !EXPORT_RAW_DMETHOD;Demosaic method +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_1;raw !EXTPROGTARGET_2;queue-processed !FILEBROWSER_ADDDELTEMPLATE;Add/Del templates... @@ -512,7 +517,6 @@ TP_WBALANCE_TEMPERATURE;色溫 !FILEBROWSER_CURRENT_NAME;Current name: !FILEBROWSER_DARKFRAME;Dark-frame !FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected %1 files including a queue-processed version? -!FILEBROWSER_EXEC_CPB;Custom Profile Builder !FILEBROWSER_EXTPROGMENU;Open with !FILEBROWSER_FLATFIELD;Flat-Field !FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory @@ -547,6 +551,7 @@ TP_WBALANCE_TEMPERATURE;色溫 !FILEBROWSER_RANK3_TOOLTIP;Rank 3 *\nShortcut: Shift-3 !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SELECTDARKFRAME;Select dark-frame... !FILEBROWSER_SELECTFLATFIELD;Select flat-field... !FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 @@ -1091,8 +1096,8 @@ TP_WBALANCE_TEMPERATURE;色溫 !PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening !PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction -!PARTIALPASTE_RAWCACORR_CABLUE;CA blue -!PARTIALPASTE_RAWCACORR_CARED;CA red +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAWEXPOS_BLACK;Black levels !PARTIALPASTE_RAWEXPOS_LINEAR;White point correction !PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -1103,6 +1108,7 @@ TP_WBALANCE_TEMPERATURE;色溫 !PARTIALPASTE_RAW_FALSECOLOR;False color suppression !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_RGBCURVES;RGB curves !PARTIALPASTE_SHARPENEDGE;Edges @@ -1157,6 +1163,8 @@ TP_WBALANCE_TEMPERATURE;色溫 !PREFERENCES_DIRDARKFRAMES;Dark-frames directory !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FLATFIELD;Flat-Field @@ -1739,33 +1747,33 @@ TP_WBALANCE_TEMPERATURE;色溫 !TP_RAWEXPOS_PRESER;Highlight preservation !TP_RAWEXPOS_RGB;Red, Green, Blue !TP_RAWEXPOS_TWOGREEN;Link greens -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DCBENHANCE;DCB enhancement !TP_RAW_DCBITERATIONS;Number of DCB iterations !TP_RAW_DMETHOD;Method !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD !TP_RAW_FALSECOLOR;False color suppression steps -!TP_RAW_FAST;fast +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. !TP_RAW_LABEL;Demosaicing -!TP_RAW_LMMSE;lmmse +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1814,7 +1822,7 @@ TP_WBALANCE_TEMPERATURE;色溫 !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RESIZE_APPLIESTO;Applies to: !TP_RESIZE_CROPPEDAREA;Cropped Area !TP_RESIZE_FITBOX;Bounding Box diff --git a/rtdata/languages/Czech b/rtdata/languages/Czech index 7e2d5889c..0ba7bbcc8 100644 --- a/rtdata/languages/Czech +++ b/rtdata/languages/Czech @@ -2083,6 +2083,12 @@ ZOOMPANEL_ZOOMOUT;Oddálit\nZkratka: - !DYNPROFILEEDITOR_NEW;New !DYNPROFILEEDITOR_NEW_RULE;New Dynamic Profile Rule !DYNPROFILEEDITOR_PROFILE;Processing Profile +!EXPORT_BYPASS;Processing steps to bypass +!EXPORT_PIPELINE;Processing pipeline +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !HISTORY_MSG_444;WB - Temp bias !HISTORY_MSG_445;Raw Sub-Image !HISTORY_MSG_446;EvPixelShiftMotion @@ -2114,24 +2120,29 @@ ZOOMPANEL_ZOOMOUT;Oddálit\nZkratka: - !HISTORY_MSG_472;PS Smooth transitions !HISTORY_MSG_473;PS Use lmmse !HISTORY_MSG_474;PS Equalize +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAW_IMAGENUM;Sub-image +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules !PROFILEPANEL_PDYNAMIC;Dynamic -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_DCB;DCB +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. +!TP_RAW_LMMSE;LMMSE +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -2177,6 +2188,6 @@ ZOOMPANEL_ZOOMOUT;Oddálit\nZkratka: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !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". diff --git a/rtdata/languages/Dansk b/rtdata/languages/Dansk index 9c72632d2..61002e376 100644 --- a/rtdata/languages/Dansk +++ b/rtdata/languages/Dansk @@ -465,6 +465,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !EXIFFILTER_EXPOSURECOMPENSATION;Exposure compensation (EV) !EXIFFILTER_FILETYPE;File type !EXIFFILTER_METADATAFILTER;Enable metadata filters +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_ALL;Select / Unselect All !EXPORT_BYPASS_DEFRINGE;Bypass Defringe !EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction @@ -487,8 +488,12 @@ TP_WBALANCE_TEMPERATURE;Temperatur !EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. !EXPORT_MAXHEIGHT;Maximum height: !EXPORT_MAXWIDTH;Maximum width: +!EXPORT_PIPELINE;Processing pipeline !EXPORT_PUTTOQUEUEFAST; Put to queue for fast export !EXPORT_RAW_DMETHOD;Demosaic method +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_1;raw !EXTPROGTARGET_2;queue-processed !FILEBROWSER_ADDDELTEMPLATE;Add/Del templates... @@ -504,7 +509,6 @@ TP_WBALANCE_TEMPERATURE;Temperatur !FILEBROWSER_CURRENT_NAME;Current name: !FILEBROWSER_DARKFRAME;Dark-frame !FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected %1 files including a queue-processed version? -!FILEBROWSER_EXEC_CPB;Custom Profile Builder !FILEBROWSER_EXTPROGMENU;Open with !FILEBROWSER_FLATFIELD;Flat-Field !FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory @@ -539,6 +543,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !FILEBROWSER_RANK3_TOOLTIP;Rank 3 *\nShortcut: Shift-3 !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SELECTDARKFRAME;Select dark-frame... !FILEBROWSER_SELECTFLATFIELD;Select flat-field... !FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 @@ -1089,8 +1094,8 @@ TP_WBALANCE_TEMPERATURE;Temperatur !PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening !PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction -!PARTIALPASTE_RAWCACORR_CABLUE;CA blue -!PARTIALPASTE_RAWCACORR_CARED;CA red +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAWEXPOS_BLACK;Black levels !PARTIALPASTE_RAWEXPOS_LINEAR;White point correction !PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -1101,6 +1106,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !PARTIALPASTE_RAW_FALSECOLOR;False color suppression !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_RGBCURVES;RGB curves !PARTIALPASTE_SHARPENEDGE;Edges @@ -1155,6 +1161,8 @@ TP_WBALANCE_TEMPERATURE;Temperatur !PREFERENCES_DIRDARKFRAMES;Dark-frames directory !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FLATFIELD;Flat-Field @@ -1737,31 +1745,31 @@ TP_WBALANCE_TEMPERATURE;Temperatur !TP_RAWEXPOS_PRESER;Highlight preservation !TP_RAWEXPOS_RGB;Red, Green, Blue !TP_RAWEXPOS_TWOGREEN;Link greens -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DCBENHANCE;DCB enhancement !TP_RAW_DCBITERATIONS;Number of DCB iterations !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. !TP_RAW_LABEL;Demosaicing -!TP_RAW_LMMSE;lmmse +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1810,7 +1818,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RESIZE_APPLIESTO;Applies to: !TP_RESIZE_CROPPEDAREA;Cropped Area !TP_RESIZE_FITBOX;Bounding Box diff --git a/rtdata/languages/Deutsch b/rtdata/languages/Deutsch index ebc0297c8..5d2a9ad88 100644 --- a/rtdata/languages/Deutsch +++ b/rtdata/languages/Deutsch @@ -35,7 +35,9 @@ #34 2017-01-07 IPTC (TooWaBoo) RT4.2.1492 #35 2017-02-18 AWB bias (TooWaBoo) RT 5.0 r1 #36 2017-02-23 Korrekturen (TooWaBoo) RT 5.0 r1 -#37 2017-03-06 Dynamisches Profil (TooWaBoo) +#37 2017-03-06 Dynamisches Profil (TooWaBoo) RT 5.0 r1 +#38 2017-03-26 Pixel Shift (TooWaBoo) RT 5.0 r1 +#39 06.04.2017 Fast Export (TooWaBoo) RT 5.0 r1 ABOUT_TAB_BUILD;Version ABOUT_TAB_CREDITS;Danksagungen @@ -106,13 +108,14 @@ EXIFPANEL_RESETALL;Alle zurücksetzen EXIFPANEL_RESETALLHINT;Alle Attribute auf die ursprünglichen Werte zurücksetzen EXIFPANEL_RESETHINT;Gewählte Attribute auf die ursprünglichen Werte zurücksetzen EXIFPANEL_SUBDIRECTORY;Unterverzeichnis +EXPORT_BYPASS;Verarbeitungsschritte überspringen EXPORT_BYPASS_ALL;Alle/Keine auswählen EXPORT_BYPASS_DEFRINGE;Farbsaum entfernen überspringen EXPORT_BYPASS_DIRPYRDENOISE;Rauschreduzierung überspringen EXPORT_BYPASS_DIRPYREQUALIZER;Detailebenenkontrast überspringen EXPORT_BYPASS_EQUALIZER;Waveletebenen überspringen EXPORT_BYPASS_RAW_CA;CA-Korrektur überspringen [RAW] -EXPORT_BYPASS_RAW_CCSTEPS;Falschfarbenunterdrückung überspringen\n[RAW] +EXPORT_BYPASS_RAW_CCSTEPS;Falschfarbenreduzierung überspringen\n[RAW] EXPORT_BYPASS_RAW_DCB_ENHANCE;DCB-Verbesserungsstufen überspringen\n[RAW] EXPORT_BYPASS_RAW_DCB_ITERATIONS;DCB-Interationen überspringen [RAW] EXPORT_BYPASS_RAW_DF;Dunkelbild überspringen [RAW] @@ -128,8 +131,12 @@ EXPORT_FASTEXPORTOPTIONS;Schnell-Export - Einstellungen EXPORT_INSTRUCTIONS;Die Einstellungen zum schnellen Export\nerlauben es, zeit- und ressourcenintensive\nEntwicklungsschritte zu überspringen und dafür\ndie Warteschlangenverarbeitung mit\nschnellen Export-Einstellungen auszuführen.\nDieses Vorgehen wird zur schnelleren\nGenerierung von gering aufgelösten Bildern\nempfohlen, falls es auf die Geschwindigkeit\nankommt oder für ein oder mehrere Bilder\nandere Ausgabegrößen gewünscht werden,\nohne Änderungen an deren gespeicherten\nParameter vornehmen zu müssen. EXPORT_MAXHEIGHT;Maximale Höhe: EXPORT_MAXWIDTH;Maximale Breite: +EXPORT_PIPELINE;Verarbeitungspipeline EXPORT_PUTTOQUEUEFAST; Zur Warteschlange “Schneller Export“ hinzufügen EXPORT_RAW_DMETHOD;Demosaikmethode +EXPORT_USE_FAST_PIPELINE;Priorität Geschwindigkeit +EXPORT_USE_FAST_PIPELINE_TIP;Wendet alle Bearbeitungsschritte, im Gegensatz\nzu „Standard“ , auf das bereits skalierte Bild an.\nDadurch steigt die Verarbeitungsgeschwindigkeit\nauf Kosten der Qualität. +EXPORT_USE_NORMAL_PIPELINE;Standard EXTPROGTARGET_1;RAW EXTPROGTARGET_2;Stapelverarbeitung beendet FILEBROWSER_ADDDELTEMPLATE;Vorlagen hinzufügen/entfernen... @@ -202,6 +209,7 @@ FILEBROWSER_RANK3_TOOLTIP;Bewertung 3 ***\nTaste: Umschalt + 3 FILEBROWSER_RANK4_TOOLTIP;Bewertung 4 ****\nTaste: Umschalt + 4 FILEBROWSER_RANK5_TOOLTIP;Bewertung 5 *****\nTaste: Umschalt + 5 FILEBROWSER_RENAMEDLGLABEL;Datei umbenennen +FILEBROWSER_RESETDEFAULTPROFILE;Profil auf Vorgabe zurücksetzen FILEBROWSER_SELECTDARKFRAME;Dunkelbild wählen... FILEBROWSER_SELECTFLATFIELD;Weißbild wählen... FILEBROWSER_SHOWCOLORLABEL1HINT;Nur rot markierte Bilder anzeigen\nTaste: Alt + 1 @@ -390,14 +398,14 @@ HISTORY_MSG_110;(Skalieren) - Anwenden auf: HISTORY_MSG_111;(L*a*b*) - Farbverschiebung\nvermeiden HISTORY_MSG_112;--unused-- HISTORY_MSG_113;(L*a*b*) - Hautfarbtöne\nschützen -HISTORY_MSG_114;(Sensor Bayer-Matrix)\nFarbinterpolation\nDCB-Iterationen -HISTORY_MSG_115;(Sensor-Matrix)\nFarbinterpolation\nFalschfarbenunterdrückung -HISTORY_MSG_116;(Sensor Bayer-Matrix)\nFarbinterpolation\nDCB-Verbesserung -HISTORY_MSG_117;(Sensor Bayer-Matrix)\nChromatische Aberration\nRot -HISTORY_MSG_118;(Sensor Bayer-Matrix)\nChromatische Aberration\nBlau -HISTORY_MSG_119;(Sensor Bayer-Matrix)\nVorverarbeitung\nZeilenrauschfilter -HISTORY_MSG_120;(Sensor Bayer-Matrix)\nVorverarbeitung\nGrün-Ausgleich -HISTORY_MSG_121;(Sensor Bayer-Matrix)\nChromatische Aberration\nAutomatische Korrektur +HISTORY_MSG_114;(Sensor-Matrix)\nFarbinterpolation\nDCB-Iterationen +HISTORY_MSG_115;(Sensor-Matrix)\nFarbinterpolation\nFalschfarbenreduzierung +HISTORY_MSG_116;(Sensor-Matrix)\nFarbinterpolation\nDCB-Verbesserung +HISTORY_MSG_117;(Sensor-Matrix)\nChromatische Aberration\nRot +HISTORY_MSG_118;(Sensor-Matrix)\nChromatische Aberration\nBlau +HISTORY_MSG_119;(Sensor-Matrix)\nVorverarbeitung\nZeilenrauschfilter +HISTORY_MSG_120;(Sensor-Matrix)\nVorverarbeitung\nGrün-Ausgleich +HISTORY_MSG_121;(Sensor-Matrix)\nChromatische Aberration\nAutomatische Korrektur HISTORY_MSG_122;(Dunkelbild)\nAutomatische Auswahl HISTORY_MSG_123;(Dunkelbild) - Datei HISTORY_MSG_124;(Weißpunkt)\nKorrekturfaktor @@ -413,11 +421,11 @@ HISTORY_MSG_133;(Farbmanagement)\nAusgabeprofil\nAusgabe-Gamma HISTORY_MSG_134;(Farbmanagement)\nAusgabeprofil\nGamma HISTORY_MSG_135;(Farbmanagement)\nAusgabeprofil\nFreies Gamma HISTORY_MSG_136;(Farbmanagement)\nAusgabeprofil\nGradient (linear) -HISTORY_MSG_137;(Sensor Bayer-Matrix)\nSchwarzpunkt - Grün 1 -HISTORY_MSG_138;(Sensor Bayer-Matrix)\nSchwarzpunkt - Rot -HISTORY_MSG_139;(Sensor Bayer-Matrix)\nSchwarzpunkt - Blau -HISTORY_MSG_140;(Sensor Bayer-Matrix)\nSchwarzpunkt - Grün 2 -HISTORY_MSG_141;(Sensor Bayer-Matrix)\nSchwarzpunkt\nGrün-Werte angleichen +HISTORY_MSG_137;(Sensor-Matrix)\nSchwarzpunkt - Grün 1 +HISTORY_MSG_138;(Sensor-Matrix)\nSchwarzpunkt - Rot +HISTORY_MSG_139;(Sensor-Matrix)\nSchwarzpunkt - Blau +HISTORY_MSG_140;(Sensor-Matrix)\nSchwarzpunkt - Grün 2 +HISTORY_MSG_141;(Sensor-Matrix)\nSchwarzpunkt\nGrün-Werte angleichen HISTORY_MSG_142;(Kantenschärfung)\nIterationen HISTORY_MSG_143;(Kantenschärfung)\nIntensität HISTORY_MSG_144;(Mikrokontrast)\nIntensität @@ -480,7 +488,7 @@ HISTORY_MSG_200;(CIECAM02)\nDynamikkompression HISTORY_MSG_201;(Rauschreduzierung)\nDelta-Chrominanz\nRot / Grün HISTORY_MSG_202;(Rauschreduzierung)\nDelta-Chrominanz\nBlau / Gelb HISTORY_MSG_203;(Rauschreduzierung)\nMethode -HISTORY_MSG_204;(Sensor Bayer-Matrix)\nFarbinterpolation\nLMMSE-Verbesserung +HISTORY_MSG_204;(Sensor-Matrix)\nFarbinterpolation\nLMMSE-Verbesserung HISTORY_MSG_205;(CIECAM02)\nBetrachtungsbed.\nHot / Bad-Pixelfilter HISTORY_MSG_206;(CIECAM02) - Szene\nAuto-Leuchtstärke HISTORY_MSG_207;(Farbsaum entfernen)\nFarbtonkurve @@ -565,9 +573,9 @@ HISTORY_MSG_286;(Rauschreduzierung)\nMediantyp HISTORY_MSG_287;(Rauschreduzierung)\nMedianiterationen HISTORY_MSG_288;(Weißbild)\nKontrolle zu heller Bereiche HISTORY_MSG_289;(Weißbild)\nAuto-Kontrolle zu\nheller Bereiche -HISTORY_MSG_290;(Sensor X-Trans-Matrix)\nSchwarzpunkt - Rot -HISTORY_MSG_291;(Sensor X-Trans-Matrix)\nSchwarzpunkt - Grün -HISTORY_MSG_292;(Sensor X-Trans-Matrix)\nSchwarzpunkt - Blau +HISTORY_MSG_290;(Sensor-Matrix)\nSchwarzpunkt - Rot +HISTORY_MSG_291;(Sensor-Matrix)\nSchwarzpunkt - Grün +HISTORY_MSG_292;(Sensor-Matrix)\nSchwarzpunkt - Blau HISTORY_MSG_293;(Filmsimulation) HISTORY_MSG_294;(Filmsimulation)\nIntensität HISTORY_MSG_295;(Filmsimulation) - Film @@ -720,6 +728,36 @@ HISTORY_MSG_441;(Retinex) - Einstellungen\nVerstärkung und Ausgleich\nTransmiss HISTORY_MSG_442;(Retinex) - Einstellungen\nTransmission - Skalierung HISTORY_MSG_443;(Farbmanagement)\nAusgabeprofil\nSchwarzpunkt-Kompensation HISTORY_MSG_444;(Weißabgleich)\nAWB-Temperatur-Korrektur +HISTORY_MSG_445;(Sensor-Matrix)\nFarbinterpolation\nUnterbild +HISTORY_MSG_446;EvPixelShiftMotion +HISTORY_MSG_447;EvPixelShiftMotionCorrection +HISTORY_MSG_448;EvPixelShiftStddevFactorGreen +HISTORY_MSG_449;(Sensor-Matrix)\nFarbinterpolation\nISO-Anpassung +HISTORY_MSG_450;EvPixelShiftNreadIso +HISTORY_MSG_451;EvPixelShiftPrnu +HISTORY_MSG_452;(Sensor-Matrix)\nFarbinterpolation\nBewegungsmaske\nanzeigen +HISTORY_MSG_453;(Sensor-Matrix)\nFarbinterpolation\nNur Maske anzeigen +HISTORY_MSG_454;EvPixelShiftAutomatic +HISTORY_MSG_455;EvPixelShiftNonGreenHorizontal +HISTORY_MSG_456;EvPixelShiftNonGreenVertical +HISTORY_MSG_457;(Sensor-Matrix)\nFarbinterpolation\nBewegung im Rot/Blau-\nKanal erkennen +HISTORY_MSG_458;EvPixelShiftStddevFactorRed +HISTORY_MSG_459;EvPixelShiftStddevFactorBlue +HISTORY_MSG_460;EvPixelShiftGreenAmaze +HISTORY_MSG_461;EvPixelShiftNonGreenAmaze +HISTORY_MSG_462;(Sensor-Matrix)\nFarbinterpolation\nBewegung im Grün-\nKanal erkennen +HISTORY_MSG_463;EvPixelShiftRedBlueWeight +HISTORY_MSG_464;(Sensor-Matrix)\nFarbinterpolation\nUnschärfebewegungsmaske +HISTORY_MSG_465;(Sensor-Matrix)\nFarbinterpolation\nUnschärferadius +HISTORY_MSG_466;EvPixelShiftSum +HISTORY_MSG_467;EvPixelShiftExp0 +HISTORY_MSG_468;(Sensor-Matrix)\nFarbinterpolation\nLücken in der Bewegungs-\nmaske erkennen +HISTORY_MSG_469;(Sensor-Matrix)\nFarbinterpolation\nMedian +HISTORY_MSG_470;EvPixelShiftMedian3 +HISTORY_MSG_471;(Sensor-Matrix)\nFarbinterpolation\nBewegungskorrektur +HISTORY_MSG_472;(Sensor-Matrix)\nFarbinterpolation\nWeicher Übergang +HISTORY_MSG_473;(Sensor-Matrix)\nFarbinterpolation\nLMMSE für Bewegungs-\nteile verwenden +HISTORY_MSG_474;(Sensor-Matrix)\nFarbinterpolation\nFrame-Helligkeit angleichen HISTORY_NEWSNAPSHOT;Hinzufügen HISTORY_NEWSNAPSHOT_TOOLTIP;Taste: Alt + s HISTORY_SNAPSHOT;Schnappschuss @@ -900,8 +938,10 @@ PARTIALPASTE_PREPROCESS_HOTPIXFILT;Vorverarbeitung: Hot-Pixel-Filter PARTIALPASTE_PREPROCESS_LINEDENOISE;Vorverarbeitung: Zeilenrauschfilter PARTIALPASTE_PRSHARPENING;Schärfung nach Größenänderung PARTIALPASTE_RAWCACORR_AUTO;Chromatische Aberration: Automatische Korrektur +PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength PARTIALPASTE_RAWCACORR_CABLUE;Chromatische Aberration: Blau PARTIALPASTE_RAWCACORR_CARED;Chromatische Aberration: Rot +PARTIALPASTE_RAWCACORR_CAREDBLUE;Chromatische Aberration: Rot & Blau PARTIALPASTE_RAWEXPOS_BLACK;Weißpunkt: Schwarzpegel PARTIALPASTE_RAWEXPOS_LINEAR;Weißpunkt: Korrekturfaktor PARTIALPASTE_RAWEXPOS_PRESER;Weißpunkt: Lichter schützen (EV) @@ -909,8 +949,10 @@ PARTIALPASTE_RAWGROUP;RAW PARTIALPASTE_RAW_DCBENHANCE;Farbinterpolation: DCB-Verbesserung PARTIALPASTE_RAW_DCBITERATIONS;Farbinterpolation: Anzahl der DCB-Iterationen PARTIALPASTE_RAW_DMETHOD;Farbinterpolation: Methode -PARTIALPASTE_RAW_FALSECOLOR;Farbinterpolation: Falschfarbenunterdrückung +PARTIALPASTE_RAW_FALSECOLOR;Farbinterpolation: Falschfarbenreduzierung +PARTIALPASTE_RAW_IMAGENUM;Farbinterpolation: Unterbild PARTIALPASTE_RAW_LMMSEITERATIONS;Farbinterpolation: LMMSE-Verbesserungsstufen +PARTIALPASTE_RAW_PIXELSHIFT;Farbinterpolation: Pixel Shift PARTIALPASTE_RESIZE;Skalieren PARTIALPASTE_RETINEX;Retinex (Bildschleier entfernen) PARTIALPASTE_RGBCURVES;RGB-Kurven @@ -989,6 +1031,8 @@ PREFERENCES_DIRSOFTWARE;Installationsverzeichnis PREFERENCES_EDITORCMDLINE;Befehlszeile PREFERENCES_EDITORLAYOUT;Editor-Layout PREFERENCES_EXPAUT;Experte +PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. PREFERENCES_EXTERNALEDITOR;Externer Editor PREFERENCES_FBROWSEROPTS;Bildinformationen und Miniaturbilder PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Einzeilige Toolbar\n(Bei geringer Bildschirmauflösung deaktivieren) @@ -1173,7 +1217,7 @@ PROGRESSBAR_SNAPSHOT_ADDED;Schnappschuss hinzugefügt PROGRESSDLG_PROFILECHANGEDINBROWSER;Profil wurde in der Dateiverwaltung geändert QINFO_ISO;ISO QINFO_NOEXIF;Keine Exif-Daten vorhanden. -SAVEDLG_AUTOSUFFIX;Suffix anfügen, falls unter dem Namen bereits eine Datei existiert +SAVEDLG_AUTOSUFFIX;Suffix anfügen, wenn die Datei bereits existiert SAVEDLG_FILEFORMAT;Dateiformat SAVEDLG_FORCEFORMATOPTS;Erzwinge Speicheroptionen SAVEDLG_JPEGQUAL;JPEG-Qualität @@ -1690,21 +1734,82 @@ TP_RAWEXPOS_LINEAR;Korrekturfaktor TP_RAWEXPOS_PRESER;Weißpunkt: Lichter schützen TP_RAWEXPOS_RGB;Rot, Grün, Blau TP_RAWEXPOS_TWOGREEN;Grün-Werte automatisch angleichen +TP_RAW_1PASSMEDIUM;1-Pass (Medium) +TP_RAW_3PASSBEST;3-Pass (Beste) +TP_RAW_AHD;AHD +TP_RAW_AMAZE;AMaZE +TP_RAW_DCB;DCB TP_RAW_DCBENHANCE;DCB-Verbesserung TP_RAW_DCBITERATIONS;Anzahl der DCB-Iterationen TP_RAW_DMETHOD;Methode TP_RAW_DMETHOD_PROGRESSBAR;%1 verarbeitet TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaikoptimierung -TP_RAW_DMETHOD_TOOLTIP;Hinweis: IGV und LMMSE ist speziell für Bilder\nmit hohen ISO-Werten reserviert und verbessert\ndie Rauschreduzierung. -TP_RAW_FALSECOLOR;Falschfarbenunterdrückung +TP_RAW_DMETHOD_TOOLTIP;IGV und LMMSE sind speziel für High-ISO-Aufnahmen um die\nRauschreduzierung zu unterstützen ohne zu Maze-Mustern,\nPosterisierung oder einem ausgewaschenen Look zu führen.\n\nPixel Shift ist für “Pentax Pixel Shift“-Dateien. Für "Nicht-Pixel-\nShift"-Dateien wird automatisch AMaZE verwendet. +TP_RAW_EAHD;EAHD +TP_RAW_FALSECOLOR;Falschfarbenreduzierung +TP_RAW_FAST;Schnell TP_RAW_HD;Schwelle TP_RAW_HD_TOOLTIP;Je niedriger der Wert, umso empfindlicher reagiert\ndie “Hot / Dead-Pixel-Erkennung“.\nIst die Empfindlichkeit zu hoch, können Artefakte\nentstehen. Erhöhen Sie in diesem Fall die Schwelle,\nbis die Artefakte verschwinden. +TP_RAW_HPHD;HPHD +TP_RAW_IGV;IGV +TP_RAW_IMAGENUM;Unterbild +TP_RAW_IMAGENUM_TOOLTIP;Einige RAW-Formate beinhalten möglicherweise mehrere\nUnterbilder (HDR, Pixel-Shift, Dual Pixel, Dual Sensitivity).\nWählen Sie das passende Unterbild aus.\n\nIst die Bildnummer größer als die Anzahl\nder Unterbilder wird das letzte Unterbild benutzt. TP_RAW_LABEL;Farbinterpolation +TP_RAW_LMMSE;LMMSE TP_RAW_LMMSEITERATIONS;LMMSE-Verbesserungsstufen TP_RAW_LMMSE_TOOLTIP;Fügt Gamma (Stufe 1), Median (Stufe 2-4)\nund Optimierung (Stufe 5-6) zur Minimierung\nvon Artefakten hinzu und verbessert das\nSignalrauschverhältnis. +TP_RAW_MONO;Mono +TP_RAW_NONE;Keine +TP_RAW_PIXELSHIFT;Pixel Shift +TP_RAW_PIXELSHIFTADAPTIVE;Adaptive Erkennung +TP_RAW_PIXELSHIFTBLUR;Unschärfebewegungsmaske +TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Unschärfebewegungsmaske +TP_RAW_PIXELSHIFTEPERISO;ISO-Anpassung +TP_RAW_PIXELSHIFTEPERISO_TOOLTIP;Der Standardwert (0.0) empfiehlt sich für die Basis-ISO.\nErhöhen Sie den Wert, um die Bewegungserkennung für höhere ISO-Werte zu verbessern.\nErhöhen Sie den Wert nur in kleinen Schritten und achten Sie dabei auf die Bewegungsmaske. +TP_RAW_PIXELSHIFTEQUALBRIGHT;Frame-Helligkeit angleichen +TP_RAW_PIXELSHIFTEQUALBRIGHT_TOOLTIP;Gleicht die Helligkeit der Frames an den aktuellen Frame an.\n\nSind überbelichtete Bereiche vorhanden wählen Sie den hellsten Frame aus um\nMagenta-Farbstiche zu vermeiden oder aktivieren Sie die Bewegungskorrektur. +TP_RAW_PIXELSHIFTEXP0;Experimentell +TP_RAW_PIXELSHIFTGREEN;Bewegung im Grün-Kanal erkennen +TP_RAW_PIXELSHIFTHOLEFILL;Lücken in der Bewegungsmaske erkennen +TP_RAW_PIXELSHIFTHOLEFILL_TOOLTIP;Lücken in der Bewegungsmaske erkennen +TP_RAW_PIXELSHIFTLMMSE;LMMSE für Bewegungsbereiche verwenden +TP_RAW_PIXELSHIFTLMMSE_TOOLTIP;LMMSE anstatt AMaZE für bewegte Bildbereiche verwenden.\nSinnvoll bei High-ISO-Aufnahmen. +TP_RAW_PIXELSHIFTMASKTHRESHOLD;3x3 new threshold +TP_RAW_PIXELSHIFTMEDIAN;Median +TP_RAW_PIXELSHIFTMEDIAN3;Aktuellen Frame vom Median ausschließen. +TP_RAW_PIXELSHIFTMEDIAN3_TOOLTIP;Schließt den aktuellen Frame vom Median aus.\nNützlich, wenn sich bewegte Objekte im Frame 2\nund 3 überlappen. +TP_RAW_PIXELSHIFTMEDIAN_TOOLTIP;Verwenden Sie den Median aller Frames anstelle des\nausgewählten Frames für Regionen mit Bewegung.\nEntfernt Objekte, die an verschiedenen Stellen in allen\nFrames vorkommen. Erzeugt einen Bewegungseffekt\nauf langsame (überlappende) Objekte. +TP_RAW_PIXELSHIFTMM_AUTO;Automatisch +TP_RAW_PIXELSHIFTMM_CUSTOM;Benutzerdefiniert +TP_RAW_PIXELSHIFTMM_OFF;Aus +TP_RAW_PIXELSHIFTMOTION;Motion detection level (deprecated) +TP_RAW_PIXELSHIFTMOTIONCORRECTION;Green motion correction size +TP_RAW_PIXELSHIFTMOTIONCORRECTION_TOOLTIP;1 = 2 Pixel\n3 = 3x3 Raster\n5 = 5x5 Raster +TP_RAW_PIXELSHIFTMOTIONMETHOD;Bewegungskorrektur +TP_RAW_PIXELSHIFTMOTION_TOOLTIP;0 = Keine Bewegungserkennung\n1 - 99 = Bewegung wird entsprechend dem Wert erkannt.\nHöhere Werte erhöhen die Trefferquote\n100 = Der mit AMaZE interpolierte Frame wird verwendet. +TP_RAW_PIXELSHIFTNONGREENAMAZE;Check red/blue amaze +TP_RAW_PIXELSHIFTNONGREENCROSS;Bewegung im Rot/Blau-Kanal erkennen +TP_RAW_PIXELSHIFTNONGREENCROSS2;Check green amaze +TP_RAW_PIXELSHIFTNONGREENHORIZONTAL;Check red/blue horizontal +TP_RAW_PIXELSHIFTNONGREENVERTICAL;Check red/blue vertical +TP_RAW_PIXELSHIFTNREADISO;nRead +TP_RAW_PIXELSHIFTPRNU;PRNU (%) +TP_RAW_PIXELSHIFTREDBLUEWEIGHT;Red&Blue weight +TP_RAW_PIXELSHIFTSHOWMOTION;Bewegungsmaske anzeigen +TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY;Nur Maske anzeigen +TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY_TOOLTIP;Zeigt die Bewegungsmaske ohne Bild. +TP_RAW_PIXELSHIFTSHOWMOTION_TOOLTIP;Überlagert das Bild mit einer Maske um die\nBereiche mit Bewegung hervorzuheben. +TP_RAW_PIXELSHIFTSIGMA;Unschärferadius +TP_RAW_PIXELSHIFTSIGMA_TOOLTIP;Der Standard-Radius von 1,0 passt in der Regel für die Basis-ISO.\nErhöhen Sie den Wert für High-ISO-Aufnahmen, 5,0 ist ein guter\nAusgangspunkt für High-ISO-Aufnahmen. Achten Sie auf die\nBewegungsmaske, während Sie den Wert ändern. +TP_RAW_PIXELSHIFTSMOOTH;Weicher Übergang +TP_RAW_PIXELSHIFTSMOOTH_TOOLTIP;Weicher Übergang zwischen Bereichen mit und ohne Bewegung.\n0 = Aus\n1 = AMaZE/LMMSE oder Median +TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue +TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green +TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red TP_RAW_SENSOR_BAYER_LABEL;Sensor mit Bayer-Matrix -TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;Mit “3-pass“ erzielt man die besten Ergebnisse\n(empfohlen bei Bildern mit niedrigen ISO-Werten).\n\nBei hohen ISO-Werten unterscheidet sich “1-pass“\nkaum gegenüber “3-pass“, ist aber deutlich schneller. +TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;Mit “3-Pass“ erzielt man die besten Ergebnisse\n(empfohlen bei Bildern mit niedrigen ISO-Werten).\n\nBei hohen ISO-Werten unterscheidet sich “1-Pass“\nkaum gegenüber “3-Pass“, ist aber deutlich schneller. TP_RAW_SENSOR_XTRANS_LABEL;Sensor mit X-Trans-Matrix +TP_RAW_VNG4;VNG4 TP_RESIZE_APPLIESTO;Anwenden auf: TP_RESIZE_CROPPEDAREA;Ausschnitt TP_RESIZE_FITBOX;Begrenzungsrahmen @@ -2084,99 +2189,3 @@ ZOOMPANEL_ZOOMFITSCREEN;An Bildschirm anpassen\nTaste: f ZOOMPANEL_ZOOMIN;Hineinzoomen\nTaste: + ZOOMPANEL_ZOOMOUT;Herauszoomen\nTaste: - -!!!!!!!!!!!!!!!!!!!!!!!!! -! Untranslated keys follow; remove the ! prefix after an entry is translated. -!!!!!!!!!!!!!!!!!!!!!!!!! - -!HISTORY_MSG_445;Raw Sub-Image -!HISTORY_MSG_446;EvPixelShiftMotion -!HISTORY_MSG_447;EvPixelShiftMotionCorrection -!HISTORY_MSG_448;EvPixelShiftStddevFactorGreen -!HISTORY_MSG_449;PS ISO adaption -!HISTORY_MSG_450;EvPixelShiftNreadIso -!HISTORY_MSG_451;EvPixelShiftPrnu -!HISTORY_MSG_452;PS Show motion -!HISTORY_MSG_453;PS Show mask only -!HISTORY_MSG_454;EvPixelShiftAutomatic -!HISTORY_MSG_455;EvPixelShiftNonGreenHorizontal -!HISTORY_MSG_456;EvPixelShiftNonGreenVertical -!HISTORY_MSG_457;PS Check red/blue -!HISTORY_MSG_458;EvPixelShiftStddevFactorRed -!HISTORY_MSG_459;EvPixelShiftStddevFactorBlue -!HISTORY_MSG_460;EvPixelShiftGreenAmaze -!HISTORY_MSG_461;EvPixelShiftNonGreenAmaze -!HISTORY_MSG_462;PS Check green -!HISTORY_MSG_463;EvPixelShiftRedBlueWeight -!HISTORY_MSG_464;PS Blur motion mask -!HISTORY_MSG_465;PS Blur radius -!HISTORY_MSG_466;EvPixelShiftSum -!HISTORY_MSG_467;EvPixelShiftExp0 -!HISTORY_MSG_468;PS Fill holes -!HISTORY_MSG_469;PS Median -!HISTORY_MSG_470;EvPixelShiftMedian3 -!HISTORY_MSG_471;PS Motion correction -!HISTORY_MSG_472;PS Smooth transitions -!HISTORY_MSG_473;PS Use lmmse -!HISTORY_MSG_474;PS Equalize -!PARTIALPASTE_RAW_IMAGENUM;Sub-image -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd -!TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv -!TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) -!TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection -!TP_RAW_PIXELSHIFTBLUR;Blur motion mask -!TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask -!TP_RAW_PIXELSHIFTEPERISO;ISO adaption -!TP_RAW_PIXELSHIFTEPERISO_TOOLTIP;The default value (0.0) should work fine for base ISO.\nIncrease the value to improve motion detection for higher ISO.\nIncrease in small steps and watch the motion mask while increasing. -!TP_RAW_PIXELSHIFTEQUALBRIGHT;Equalize brightness of frames -!TP_RAW_PIXELSHIFTEQUALBRIGHT_TOOLTIP;Equalize the brightness of the frames to the brightness of the selected frame.\nIf there are overexposed areas in the frames select the brightest frame to avoid magenta colour cast in overexposed areas or enable motion correction. -!TP_RAW_PIXELSHIFTEXP0;Experimental -!TP_RAW_PIXELSHIFTGREEN;Check green channel for motion -!TP_RAW_PIXELSHIFTHOLEFILL;Fill holes in motion mask -!TP_RAW_PIXELSHIFTHOLEFILL_TOOLTIP;Fill holes in motion mask -!TP_RAW_PIXELSHIFTLMMSE;Use lmmse for motion parts -!TP_RAW_PIXELSHIFTLMMSE_TOOLTIP;Use lmmse instead of amaze for motion areas.\nUseful for High ISO images. -!TP_RAW_PIXELSHIFTMASKTHRESHOLD;3x3 new threshold -!TP_RAW_PIXELSHIFTMEDIAN;Median -!TP_RAW_PIXELSHIFTMEDIAN3;Exclude selected frame from median -!TP_RAW_PIXELSHIFTMEDIAN3_TOOLTIP;Excludes selected frame from median.\nUseful if moving objects overlap in frame 2 and 3 -!TP_RAW_PIXELSHIFTMEDIAN_TOOLTIP;Use median of all frames instead of selected frame for regions with motion.\nRemoves objects which are at different places in all frames.\nGives motion effect on slow moving (overlapping) objects. -!TP_RAW_PIXELSHIFTMM_AUTO;Automatic -!TP_RAW_PIXELSHIFTMM_CUSTOM;Custom -!TP_RAW_PIXELSHIFTMM_OFF;Off -!TP_RAW_PIXELSHIFTMOTION;Motion detection level (deprecated) -!TP_RAW_PIXELSHIFTMOTIONCORRECTION;Green motion correction size -!TP_RAW_PIXELSHIFTMOTIONCORRECTION_TOOLTIP;1 = 2 pixels\n3 = 3x3 grid\n5 = 5x5 grid -!TP_RAW_PIXELSHIFTMOTIONMETHOD;Motion Correction -!TP_RAW_PIXELSHIFTMOTION_TOOLTIP;0 means no motion detection\n1 - 99 means motion will be detected according to this value. Increase value to increase detection rate\n100 means the Amaze demosaiced frame will be used -!TP_RAW_PIXELSHIFTNONGREENAMAZE;Check red/blue amaze -!TP_RAW_PIXELSHIFTNONGREENCROSS;Check red/blue channels for motion -!TP_RAW_PIXELSHIFTNONGREENCROSS2;Check green amaze -!TP_RAW_PIXELSHIFTNONGREENHORIZONTAL;Check red/blue horizontal -!TP_RAW_PIXELSHIFTNONGREENVERTICAL;Check red/blue vertical -!TP_RAW_PIXELSHIFTNREADISO;nRead -!TP_RAW_PIXELSHIFTPRNU;PRNU (%) -!TP_RAW_PIXELSHIFTREDBLUEWEIGHT;Red&Blue weight -!TP_RAW_PIXELSHIFTSHOWMOTION;Show motion -!TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY;Show mask only -!TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY_TOOLTIP;Shows the motion mask without the image -!TP_RAW_PIXELSHIFTSHOWMOTION_TOOLTIP;Overlays the image with a mask showing the regions with motion -!TP_RAW_PIXELSHIFTSIGMA;Blur radius -!TP_RAW_PIXELSHIFTSIGMA_TOOLTIP;Default radius of 1.0 usually fits good for base ISO. Increase value for high ISO shots,\n5.0 is a good starting point for high ISO shots.\nWatch motion mask while changing the value. -!TP_RAW_PIXELSHIFTSMOOTH;Smooth transitions -!TP_RAW_PIXELSHIFTSMOOTH_TOOLTIP;Smooth transitions between areas with and without motion.\nSet to 0 to disable smooth transitions\nSet to 1 to get Amaze/lmmse or Median -!TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue -!TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green -!TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red -!TP_RAW_VNG4;vng4 diff --git a/rtdata/languages/English (UK) b/rtdata/languages/English (UK) index a74829fa5..ff0781eb1 100644 --- a/rtdata/languages/English (UK) +++ b/rtdata/languages/English (UK) @@ -177,6 +177,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !EXIFPANEL_RESETALLHINT;Reset all tags to their original values. !EXIFPANEL_RESETHINT;Reset the selected tags to their original values. !EXIFPANEL_SUBDIRECTORY;Subdirectory +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_ALL;Select / Unselect All !EXPORT_BYPASS_DEFRINGE;Bypass Defringe !EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction @@ -198,8 +199,12 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. !EXPORT_MAXHEIGHT;Maximum height: !EXPORT_MAXWIDTH;Maximum width: +!EXPORT_PIPELINE;Processing pipeline !EXPORT_PUTTOQUEUEFAST; Put to queue for fast export !EXPORT_RAW_DMETHOD;Demosaic method +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_1;raw !EXTPROGTARGET_2;queue-processed !FILEBROWSER_ADDDELTEMPLATE;Add/Del templates... @@ -221,7 +226,6 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected %1 files including a queue-processed version? !FILEBROWSER_EMPTYTRASH;Empty trash !FILEBROWSER_EMPTYTRASHHINT;Permanently delete the files from trash. -!FILEBROWSER_EXEC_CPB;Custom Profile Builder !FILEBROWSER_EXTPROGMENU;Open with !FILEBROWSER_FLATFIELD;Flat-Field !FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory @@ -270,6 +274,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 !FILEBROWSER_RENAMEDLGLABEL;Rename file +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SELECTDARKFRAME;Select dark-frame... !FILEBROWSER_SELECTFLATFIELD;Select flat-field... !FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 @@ -971,8 +976,8 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening !PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction -!PARTIALPASTE_RAWCACORR_CABLUE;CA blue -!PARTIALPASTE_RAWCACORR_CARED;CA red +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAWEXPOS_BLACK;Black levels !PARTIALPASTE_RAWEXPOS_LINEAR;White point correction !PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -982,6 +987,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !PARTIALPASTE_RAW_DMETHOD;Demosaic method !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RESIZE;Resize !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_RGBCURVES;RGB curves @@ -1057,6 +1063,8 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !PREFERENCES_EDITORCMDLINE;Other command line !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_EXTERNALEDITOR;External Editor !PREFERENCES_FBROWSEROPTS;File Browser / Thumbnail Options !PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) @@ -1698,32 +1706,32 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !TP_RAWEXPOS_PRESER;Highlight preservation !TP_RAWEXPOS_RGB;Red, Green, Blue !TP_RAWEXPOS_TWOGREEN;Link greens -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DCBENHANCE;DCB enhancement !TP_RAW_DCBITERATIONS;Number of DCB iterations !TP_RAW_DMETHOD;Method !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. !TP_RAW_LABEL;Demosaicing -!TP_RAW_LMMSE;lmmse +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1772,7 +1780,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RESIZE_APPLIESTO;Applies to: !TP_RESIZE_CROPPEDAREA;Cropped Area !TP_RESIZE_FITBOX;Bounding Box diff --git a/rtdata/languages/English (US) b/rtdata/languages/English (US) index 56a13fe7c..1284d8395 100644 --- a/rtdata/languages/English (US) +++ b/rtdata/languages/English (US) @@ -72,6 +72,7 @@ !EXIFPANEL_RESETALLHINT;Reset all tags to their original values. !EXIFPANEL_RESETHINT;Reset the selected tags to their original values. !EXIFPANEL_SUBDIRECTORY;Subdirectory +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_ALL;Select / Unselect All !EXPORT_BYPASS_DEFRINGE;Bypass Defringe !EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction @@ -94,8 +95,12 @@ !EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. !EXPORT_MAXHEIGHT;Maximum height: !EXPORT_MAXWIDTH;Maximum width: +!EXPORT_PIPELINE;Processing pipeline !EXPORT_PUTTOQUEUEFAST; Put to queue for fast export !EXPORT_RAW_DMETHOD;Demosaic method +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_1;raw !EXTPROGTARGET_2;queue-processed !FILEBROWSER_ADDDELTEMPLATE;Add/Del templates... @@ -118,7 +123,6 @@ !FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected %1 files including a queue-processed version? !FILEBROWSER_EMPTYTRASH;Empty trash !FILEBROWSER_EMPTYTRASHHINT;Permanently delete the files from trash. -!FILEBROWSER_EXEC_CPB;Custom Profile Builder !FILEBROWSER_EXTPROGMENU;Open with !FILEBROWSER_FLATFIELD;Flat-Field !FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory @@ -168,6 +172,7 @@ !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 !FILEBROWSER_RENAMEDLGLABEL;Rename file +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SELECTDARKFRAME;Select dark-frame... !FILEBROWSER_SELECTFLATFIELD;Select flat-field... !FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 @@ -896,8 +901,8 @@ !PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening !PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction -!PARTIALPASTE_RAWCACORR_CABLUE;CA blue -!PARTIALPASTE_RAWCACORR_CARED;CA red +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAWEXPOS_BLACK;Black levels !PARTIALPASTE_RAWEXPOS_LINEAR;White point correction !PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -908,6 +913,7 @@ !PARTIALPASTE_RAW_FALSECOLOR;False color suppression !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RESIZE;Resize !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_RGBCURVES;RGB curves @@ -986,6 +992,8 @@ !PREFERENCES_EDITORCMDLINE;Other command line !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_EXTERNALEDITOR;External Editor !PREFERENCES_FBROWSEROPTS;File Browser / Thumbnail Options !PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) @@ -1687,33 +1695,33 @@ !TP_RAWEXPOS_PRESER;Highlight preservation !TP_RAWEXPOS_RGB;Red, Green, Blue !TP_RAWEXPOS_TWOGREEN;Link greens -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DCBENHANCE;DCB enhancement !TP_RAW_DCBITERATIONS;Number of DCB iterations !TP_RAW_DMETHOD;Method !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD !TP_RAW_FALSECOLOR;False color suppression steps -!TP_RAW_FAST;fast +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. !TP_RAW_LABEL;Demosaicing -!TP_RAW_LMMSE;lmmse +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1762,7 +1770,7 @@ !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RESIZE_APPLIESTO;Applies to: !TP_RESIZE_CROPPEDAREA;Cropped Area !TP_RESIZE_FITBOX;Bounding Box diff --git a/rtdata/languages/Espanol b/rtdata/languages/Espanol index 077d6a64e..38691cf95 100644 --- a/rtdata/languages/Espanol +++ b/rtdata/languages/Espanol @@ -1523,8 +1523,14 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !DYNPROFILEEDITOR_NEW;New !DYNPROFILEEDITOR_NEW_RULE;New Dynamic Profile Rule !DYNPROFILEEDITOR_PROFILE;Processing Profile +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_EQUALIZER;Bypass Wavelet Levels +!EXPORT_PIPELINE;Processing pipeline +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !FILEBROWSER_POPUPCOLORLABEL0;Label: None +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SHOWNOTTRASHHINT;Show only non-deleted images. !FILEBROWSER_SHOWORIGINALHINT;Show only original images.\n\nWhen several images exist with the same filename but different extensions, the one considered original is the one whose extension is nearest the top of the parsed extensions list in Preferences > File Browser > Parsed Extensions. !FILECHOOSER_FILTER_ANY;All files @@ -1755,7 +1761,10 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !PARTIALPASTE_EQUALIZER;Wavelet levels !PARTIALPASTE_GRADIENT;Graduated filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAW_IMAGENUM;Sub-image +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_WAVELETGROUP;Wavelet Levels !PREFERENCES_AUTLISLOW;Low @@ -1776,6 +1785,8 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !PREFERENCES_DAUB_LABEL;Use Daubechies D6 wavelets instead of D4 !PREFERENCES_DAUB_TOOLTIP;The Noise Reduction and Wavelet Levels tools use a Debauchies mother wavelet. If you choose D6 instead of D4 you increase the number of orthogonal Daubechies coefficients and probably increase quality of small-scale levels. There is no memory or processing time difference between the two. !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT;Same thumbnail height between the Filmstrip and the File Browser !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT_HINT;Having separate thumbnail size will require more processing time each time you'll switch between the single Editor tab and the File Browser. !PREFERENCES_GREYSC;Scene Yb luminance (%) @@ -1898,23 +1909,23 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. !TP_RAWCACORR_CASTR;Strength -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DCB;DCB +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. +!TP_RAW_LMMSE;LMMSE +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1960,7 +1971,7 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* !TP_RETINEX_CONTEDIT_LH;Hue equalizer diff --git a/rtdata/languages/Euskara b/rtdata/languages/Euskara index e8f9deeae..7022450b9 100644 --- a/rtdata/languages/Euskara +++ b/rtdata/languages/Euskara @@ -465,6 +465,7 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !EXIFFILTER_EXPOSURECOMPENSATION;Exposure compensation (EV) !EXIFFILTER_FILETYPE;File type !EXIFFILTER_METADATAFILTER;Enable metadata filters +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_ALL;Select / Unselect All !EXPORT_BYPASS_DEFRINGE;Bypass Defringe !EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction @@ -487,8 +488,12 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. !EXPORT_MAXHEIGHT;Maximum height: !EXPORT_MAXWIDTH;Maximum width: +!EXPORT_PIPELINE;Processing pipeline !EXPORT_PUTTOQUEUEFAST; Put to queue for fast export !EXPORT_RAW_DMETHOD;Demosaic method +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_1;raw !EXTPROGTARGET_2;queue-processed !FILEBROWSER_ADDDELTEMPLATE;Add/Del templates... @@ -504,7 +509,6 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !FILEBROWSER_CURRENT_NAME;Current name: !FILEBROWSER_DARKFRAME;Dark-frame !FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected %1 files including a queue-processed version? -!FILEBROWSER_EXEC_CPB;Custom Profile Builder !FILEBROWSER_EXTPROGMENU;Open with !FILEBROWSER_FLATFIELD;Flat-Field !FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory @@ -539,6 +543,7 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !FILEBROWSER_RANK3_TOOLTIP;Rank 3 *\nShortcut: Shift-3 !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SELECTDARKFRAME;Select dark-frame... !FILEBROWSER_SELECTFLATFIELD;Select flat-field... !FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 @@ -1089,8 +1094,8 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening !PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction -!PARTIALPASTE_RAWCACORR_CABLUE;CA blue -!PARTIALPASTE_RAWCACORR_CARED;CA red +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAWEXPOS_BLACK;Black levels !PARTIALPASTE_RAWEXPOS_LINEAR;White point correction !PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -1101,6 +1106,7 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !PARTIALPASTE_RAW_FALSECOLOR;False color suppression !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_RGBCURVES;RGB curves !PARTIALPASTE_SHARPENEDGE;Edges @@ -1155,6 +1161,8 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !PREFERENCES_DIRDARKFRAMES;Dark-frames directory !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FLATFIELD;Flat-Field @@ -1737,31 +1745,31 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !TP_RAWEXPOS_PRESER;Highlight preservation !TP_RAWEXPOS_RGB;Red, Green, Blue !TP_RAWEXPOS_TWOGREEN;Link greens -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DCBENHANCE;DCB enhancement !TP_RAW_DCBITERATIONS;Number of DCB iterations !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. !TP_RAW_LABEL;Demosaicing -!TP_RAW_LMMSE;lmmse +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1810,7 +1818,7 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RESIZE_APPLIESTO;Applies to: !TP_RESIZE_CROPPEDAREA;Cropped Area !TP_RESIZE_FITBOX;Bounding Box diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index c8f1c8891..22deca58a 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -853,8 +853,8 @@ PARTIALPASTE_PREPROCESS_HOTPIXFILT;Filtrage des pixels chauds PARTIALPASTE_PREPROCESS_LINEDENOISE;Filtre de bruit de ligne PARTIALPASTE_PRSHARPENING;Netteté post-redim. PARTIALPASTE_RAWCACORR_AUTO;Corr. auto. de l'aberr. chromatique -PARTIALPASTE_RAWCACORR_CABLUE;Aberr. chromatique bleu -PARTIALPASTE_RAWCACORR_CARED;Aberr. chromatique rouge +PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;Force aberr. chromatique auto +PARTIALPASTE_RAWCACORR_CAREDBLUE;Aberr. chromatique rouge et bleu PARTIALPASTE_RAWEXPOS_BLACK;Niveaux de noir PARTIALPASTE_RAWEXPOS_LINEAR;Correction du point blanc PARTIALPASTE_RAWEXPOS_PRESER;Préservation des hautes humières @@ -864,6 +864,7 @@ PARTIALPASTE_RAW_DCBITERATIONS;Nombre d'itération de DCB PARTIALPASTE_RAW_DMETHOD;Algorithme de dématriçage PARTIALPASTE_RAW_FALSECOLOR;Nbr d'itération des fausses couleurs PARTIALPASTE_RAW_LMMSEITERATIONS;Niveau d'amélioration LMMSE +PARTIALPASTE_RAW_PIXELSHIFT;PixelShift PARTIALPASTE_RESIZE;Redimentionnement PARTIALPASTE_RETINEX;Retinex PARTIALPASTE_RGBCURVES;Courbes RVB @@ -1629,7 +1630,7 @@ TP_PRSHARPENING_TOOLTIP;Augmente la netteté de l'image après le redimentionnem TP_RAWCACORR_AUTO;Correction automatique TP_RAWCACORR_CABLUE;Bleu TP_RAWCACORR_CARED;Rouge -TP_RAWCACORR_CASTR;force +TP_RAWCACORR_CASTR;Force TP_RAWEXPOS_BLACKS;Niveaux de noir TP_RAWEXPOS_BLACK_0;Vert 1 (maître) TP_RAWEXPOS_BLACK_1;Rouge @@ -2048,6 +2049,12 @@ ZOOMPANEL_ZOOMOUT;Zoom Arrière\nRaccourci: - !DYNPROFILEEDITOR_NEW;New !DYNPROFILEEDITOR_NEW_RULE;New Dynamic Profile Rule !DYNPROFILEEDITOR_PROFILE;Processing Profile +!EXPORT_BYPASS;Processing steps to bypass +!EXPORT_PIPELINE;Processing pipeline +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !HISTORY_MSG_444;WB - Temp bias !HISTORY_MSG_445;Raw Sub-Image !HISTORY_MSG_446;EvPixelShiftMotion @@ -2080,23 +2087,25 @@ ZOOMPANEL_ZOOMOUT;Zoom Arrière\nRaccourci: - !HISTORY_MSG_473;PS Use lmmse !HISTORY_MSG_474;PS Equalize !PARTIALPASTE_RAW_IMAGENUM;Sub-image +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_TAB_DYNAMICPROFILE;Dynamic Profile Rules !PROFILEPANEL_PDYNAMIC;Dynamic -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_DCB;DCB +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. +!TP_RAW_LMMSE;LMMSE +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -2142,6 +2151,6 @@ ZOOMPANEL_ZOOMOUT;Zoom Arrière\nRaccourci: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !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". diff --git a/rtdata/languages/Greek b/rtdata/languages/Greek index 0771b0252..67ef64f46 100644 --- a/rtdata/languages/Greek +++ b/rtdata/languages/Greek @@ -464,6 +464,7 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !EXIFFILTER_EXPOSURECOMPENSATION;Exposure compensation (EV) !EXIFFILTER_FILETYPE;File type !EXIFFILTER_METADATAFILTER;Enable metadata filters +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_ALL;Select / Unselect All !EXPORT_BYPASS_DEFRINGE;Bypass Defringe !EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction @@ -486,8 +487,12 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. !EXPORT_MAXHEIGHT;Maximum height: !EXPORT_MAXWIDTH;Maximum width: +!EXPORT_PIPELINE;Processing pipeline !EXPORT_PUTTOQUEUEFAST; Put to queue for fast export !EXPORT_RAW_DMETHOD;Demosaic method +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_1;raw !EXTPROGTARGET_2;queue-processed !FILEBROWSER_ADDDELTEMPLATE;Add/Del templates... @@ -503,7 +508,6 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !FILEBROWSER_CURRENT_NAME;Current name: !FILEBROWSER_DARKFRAME;Dark-frame !FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected %1 files including a queue-processed version? -!FILEBROWSER_EXEC_CPB;Custom Profile Builder !FILEBROWSER_EXTPROGMENU;Open with !FILEBROWSER_FLATFIELD;Flat-Field !FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory @@ -538,6 +542,7 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !FILEBROWSER_RANK3_TOOLTIP;Rank 3 *\nShortcut: Shift-3 !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SELECTDARKFRAME;Select dark-frame... !FILEBROWSER_SELECTFLATFIELD;Select flat-field... !FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 @@ -1088,8 +1093,8 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening !PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction -!PARTIALPASTE_RAWCACORR_CABLUE;CA blue -!PARTIALPASTE_RAWCACORR_CARED;CA red +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAWEXPOS_BLACK;Black levels !PARTIALPASTE_RAWEXPOS_LINEAR;White point correction !PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -1100,6 +1105,7 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !PARTIALPASTE_RAW_FALSECOLOR;False color suppression !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_RGBCURVES;RGB curves !PARTIALPASTE_SHARPENEDGE;Edges @@ -1154,6 +1160,8 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !PREFERENCES_DIRDARKFRAMES;Dark-frames directory !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FLATFIELD;Flat-Field @@ -1736,31 +1744,31 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !TP_RAWEXPOS_PRESER;Highlight preservation !TP_RAWEXPOS_RGB;Red, Green, Blue !TP_RAWEXPOS_TWOGREEN;Link greens -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DCBENHANCE;DCB enhancement !TP_RAW_DCBITERATIONS;Number of DCB iterations !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. !TP_RAW_LABEL;Demosaicing -!TP_RAW_LMMSE;lmmse +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1809,7 +1817,7 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RESIZE_APPLIESTO;Applies to: !TP_RESIZE_CROPPEDAREA;Cropped Area !TP_RESIZE_FITBOX;Bounding Box diff --git a/rtdata/languages/Hebrew b/rtdata/languages/Hebrew index 71fe69f20..5d51653e3 100644 --- a/rtdata/languages/Hebrew +++ b/rtdata/languages/Hebrew @@ -465,6 +465,7 @@ TP_WBALANCE_TEMPERATURE;מידת חום !EXIFFILTER_EXPOSURECOMPENSATION;Exposure compensation (EV) !EXIFFILTER_FILETYPE;File type !EXIFFILTER_METADATAFILTER;Enable metadata filters +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_ALL;Select / Unselect All !EXPORT_BYPASS_DEFRINGE;Bypass Defringe !EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction @@ -487,8 +488,12 @@ TP_WBALANCE_TEMPERATURE;מידת חום !EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. !EXPORT_MAXHEIGHT;Maximum height: !EXPORT_MAXWIDTH;Maximum width: +!EXPORT_PIPELINE;Processing pipeline !EXPORT_PUTTOQUEUEFAST; Put to queue for fast export !EXPORT_RAW_DMETHOD;Demosaic method +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_1;raw !EXTPROGTARGET_2;queue-processed !FILEBROWSER_ADDDELTEMPLATE;Add/Del templates... @@ -504,7 +509,6 @@ TP_WBALANCE_TEMPERATURE;מידת חום !FILEBROWSER_CURRENT_NAME;Current name: !FILEBROWSER_DARKFRAME;Dark-frame !FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected %1 files including a queue-processed version? -!FILEBROWSER_EXEC_CPB;Custom Profile Builder !FILEBROWSER_EXTPROGMENU;Open with !FILEBROWSER_FLATFIELD;Flat-Field !FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory @@ -539,6 +543,7 @@ TP_WBALANCE_TEMPERATURE;מידת חום !FILEBROWSER_RANK3_TOOLTIP;Rank 3 *\nShortcut: Shift-3 !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SELECTDARKFRAME;Select dark-frame... !FILEBROWSER_SELECTFLATFIELD;Select flat-field... !FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 @@ -1089,8 +1094,8 @@ TP_WBALANCE_TEMPERATURE;מידת חום !PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening !PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction -!PARTIALPASTE_RAWCACORR_CABLUE;CA blue -!PARTIALPASTE_RAWCACORR_CARED;CA red +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAWEXPOS_BLACK;Black levels !PARTIALPASTE_RAWEXPOS_LINEAR;White point correction !PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -1101,6 +1106,7 @@ TP_WBALANCE_TEMPERATURE;מידת חום !PARTIALPASTE_RAW_FALSECOLOR;False color suppression !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_RGBCURVES;RGB curves !PARTIALPASTE_SHARPENEDGE;Edges @@ -1155,6 +1161,8 @@ TP_WBALANCE_TEMPERATURE;מידת חום !PREFERENCES_DIRDARKFRAMES;Dark-frames directory !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FLATFIELD;Flat-Field @@ -1737,31 +1745,31 @@ TP_WBALANCE_TEMPERATURE;מידת חום !TP_RAWEXPOS_PRESER;Highlight preservation !TP_RAWEXPOS_RGB;Red, Green, Blue !TP_RAWEXPOS_TWOGREEN;Link greens -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DCBENHANCE;DCB enhancement !TP_RAW_DCBITERATIONS;Number of DCB iterations !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. !TP_RAW_LABEL;Demosaicing -!TP_RAW_LMMSE;lmmse +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1810,7 +1818,7 @@ TP_WBALANCE_TEMPERATURE;מידת חום !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RESIZE_APPLIESTO;Applies to: !TP_RESIZE_CROPPEDAREA;Cropped Area !TP_RESIZE_FITBOX;Bounding Box diff --git a/rtdata/languages/Italiano b/rtdata/languages/Italiano index 207deb019..d4482acfc 100644 --- a/rtdata/languages/Italiano +++ b/rtdata/languages/Italiano @@ -1354,7 +1354,13 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !DYNPROFILEEDITOR_NEW;New !DYNPROFILEEDITOR_NEW_RULE;New Dynamic Profile Rule !DYNPROFILEEDITOR_PROFILE;Processing Profile +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_EQUALIZER;Bypass Wavelet Levels +!EXPORT_PIPELINE;Processing pipeline +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SHOWNOTTRASHHINT;Show only non-deleted images. !FILEBROWSER_SHOWORIGINALHINT;Show only original images.\n\nWhen several images exist with the same filename but different extensions, the one considered original is the one whose extension is nearest the top of the parsed extensions list in Preferences > File Browser > Parsed Extensions. !FILECHOOSER_FILTER_ANY;All files @@ -1624,7 +1630,10 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !PARTIALPASTE_PREPROCESS_DEADPIXFILT;Dead pixel filter !PARTIALPASTE_PREPROCESS_HOTPIXFILT;Hot pixel filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAW_IMAGENUM;Sub-image +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_WAVELETGROUP;Wavelet Levels !PREFERENCES_AUTLISLOW;Low @@ -1646,6 +1655,8 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !PREFERENCES_DAUB_LABEL;Use Daubechies D6 wavelets instead of D4 !PREFERENCES_DAUB_TOOLTIP;The Noise Reduction and Wavelet Levels tools use a Debauchies mother wavelet. If you choose D6 instead of D4 you increase the number of orthogonal Daubechies coefficients and probably increase quality of small-scale levels. There is no memory or processing time difference between the two. !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT;Same thumbnail height between the Filmstrip and the File Browser !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT_HINT;Having separate thumbnail size will require more processing time each time you'll switch between the single Editor tab and the File Browser. @@ -1836,23 +1847,23 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !TP_RAWEXPOS_BLACK_GREEN;Green !TP_RAWEXPOS_BLACK_RED;Red !TP_RAWEXPOS_RGB;Red, Green, Blue -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DCB;DCB +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. +!TP_RAW_LMMSE;LMMSE +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1901,7 +1912,7 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* !TP_RETINEX_CONTEDIT_LH;Hue equalizer diff --git a/rtdata/languages/Japanese b/rtdata/languages/Japanese index a49b54cd3..c882fcca6 100644 --- a/rtdata/languages/Japanese +++ b/rtdata/languages/Japanese @@ -1893,6 +1893,12 @@ ZOOMPANEL_ZOOMOUT;ズームアウト\nショートカット: - !DYNPROFILEEDITOR_NEW;New !DYNPROFILEEDITOR_NEW_RULE;New Dynamic Profile Rule !DYNPROFILEEDITOR_PROFILE;Processing Profile +!EXPORT_BYPASS;Processing steps to bypass +!EXPORT_PIPELINE;Processing pipeline +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SHOWORIGINALHINT;Show only original images.\n\nWhen several images exist with the same filename but different extensions, the one considered original is the one whose extension is nearest the top of the parsed extensions list in Preferences > File Browser > Parsed Extensions. !GENERAL_APPLY;Apply !GENERAL_OPEN;Open @@ -1993,9 +1999,14 @@ ZOOMPANEL_ZOOMOUT;ズームアウト\nショートカット: - !MAIN_BUTTON_SENDTOEDITOR;Edit image in external editor !MONITOR_PROFILE_SYSTEM;System default !PARTIALPASTE_PRSHARPENING;Post-resize sharpening +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAW_IMAGENUM;Sub-image +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PREFERENCES_CMMBPC;Black point compensation +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_MONINTENT;Default rendering intent !PREFERENCES_MONITOR;Monitor !PREFERENCES_MONPROFILE;Default color profile @@ -2034,21 +2045,21 @@ ZOOMPANEL_ZOOMOUT;ズームアウト\nショートカット: - !TP_ICM_SAVEREFERENCE;Save Reference Image !TP_NEUTRAL;Reset !TP_RAWCACORR_CASTR;Strength -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_DCB;DCB +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. +!TP_RAW_LMMSE;LMMSE +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -2094,7 +2105,7 @@ ZOOMPANEL_ZOOMOUT;ズームアウト\nショートカット: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* !TP_RETINEX_CONTEDIT_LH;Hue equalizer diff --git a/rtdata/languages/Latvian b/rtdata/languages/Latvian index d4661ecaf..1eee14523 100644 --- a/rtdata/languages/Latvian +++ b/rtdata/languages/Latvian @@ -465,6 +465,7 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !EXIFFILTER_EXPOSURECOMPENSATION;Exposure compensation (EV) !EXIFFILTER_FILETYPE;File type !EXIFFILTER_METADATAFILTER;Enable metadata filters +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_ALL;Select / Unselect All !EXPORT_BYPASS_DEFRINGE;Bypass Defringe !EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction @@ -487,8 +488,12 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. !EXPORT_MAXHEIGHT;Maximum height: !EXPORT_MAXWIDTH;Maximum width: +!EXPORT_PIPELINE;Processing pipeline !EXPORT_PUTTOQUEUEFAST; Put to queue for fast export !EXPORT_RAW_DMETHOD;Demosaic method +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_1;raw !EXTPROGTARGET_2;queue-processed !FILEBROWSER_ADDDELTEMPLATE;Add/Del templates... @@ -504,7 +509,6 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !FILEBROWSER_CURRENT_NAME;Current name: !FILEBROWSER_DARKFRAME;Dark-frame !FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected %1 files including a queue-processed version? -!FILEBROWSER_EXEC_CPB;Custom Profile Builder !FILEBROWSER_EXTPROGMENU;Open with !FILEBROWSER_FLATFIELD;Flat-Field !FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory @@ -539,6 +543,7 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !FILEBROWSER_RANK3_TOOLTIP;Rank 3 *\nShortcut: Shift-3 !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SELECTDARKFRAME;Select dark-frame... !FILEBROWSER_SELECTFLATFIELD;Select flat-field... !FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 @@ -1089,8 +1094,8 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening !PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction -!PARTIALPASTE_RAWCACORR_CABLUE;CA blue -!PARTIALPASTE_RAWCACORR_CARED;CA red +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAWEXPOS_BLACK;Black levels !PARTIALPASTE_RAWEXPOS_LINEAR;White point correction !PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -1101,6 +1106,7 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !PARTIALPASTE_RAW_FALSECOLOR;False color suppression !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_RGBCURVES;RGB curves !PARTIALPASTE_SHARPENEDGE;Edges @@ -1155,6 +1161,8 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !PREFERENCES_DIRDARKFRAMES;Dark-frames directory !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FLATFIELD;Flat-Field @@ -1737,31 +1745,31 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !TP_RAWEXPOS_PRESER;Highlight preservation !TP_RAWEXPOS_RGB;Red, Green, Blue !TP_RAWEXPOS_TWOGREEN;Link greens -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DCBENHANCE;DCB enhancement !TP_RAW_DCBITERATIONS;Number of DCB iterations !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. !TP_RAW_LABEL;Demosaicing -!TP_RAW_LMMSE;lmmse +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1810,7 +1818,7 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RESIZE_APPLIESTO;Applies to: !TP_RESIZE_CROPPEDAREA;Cropped Area !TP_RESIZE_FITBOX;Bounding Box diff --git a/rtdata/languages/Magyar b/rtdata/languages/Magyar index 174ccc202..39475006e 100644 --- a/rtdata/languages/Magyar +++ b/rtdata/languages/Magyar @@ -898,8 +898,13 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !DYNPROFILEEDITOR_PROFILE;Processing Profile !EDIT_OBJECT_TOOLTIP;Displays a widget on the preview window which lets you adjust this tool. !EDIT_PIPETTE_TOOLTIP;To add an adjustment point to the curve, hold the Ctrl key while left-clicking the desired spot in the image preview.\nTo adjust the point, hold the Ctrl key while left-clicking the corresponding area in the preview, then let go of Ctrl (unless you desire fine control) and while still holding the left mouse button move the mouse up or down to move that point up or down in the curve. +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_EQUALIZER;Bypass Wavelet Levels !EXPORT_BYPASS_RAW_LMMSE_ITERATIONS;Bypass [raw] LMMSE Enhancement Steps +!EXPORT_PIPELINE;Processing pipeline +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_1;raw !EXTPROGTARGET_2;queue-processed !FILEBROWSER_COLORLABEL_TOOLTIP;Color label.\n\nUse dropdown menu or shortcuts:\nShift-Ctrl-0 No Color\nShift-Ctrl-1 Red\nShift-Ctrl-2 Yellow\nShift-Ctrl-3 Green\nShift-Ctrl-4 Blue\nShift-Ctrl-5 Purple @@ -923,6 +928,7 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !FILEBROWSER_RANK3_TOOLTIP;Rank 3 *\nShortcut: Shift-3 !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SHOWNOTTRASHHINT;Show only non-deleted images. !FILEBROWSER_SHOWORIGINALHINT;Show only original images.\n\nWhen several images exist with the same filename but different extensions, the one considered original is the one whose extension is nearest the top of the parsed extensions list in Preferences > File Browser > Parsed Extensions. !FILEBROWSER_UNRANK_TOOLTIP;Unrank.\nShortcut: Shift-0 @@ -1315,8 +1321,11 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !PARTIALPASTE_PREPROCESS_DEADPIXFILT;Dead pixel filter !PARTIALPASTE_PREPROCESS_HOTPIXFILT;Hot pixel filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_WAVELETGROUP;Wavelet Levels !PREFERENCES_AUTLISLOW;Low @@ -1353,6 +1362,8 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !PREFERENCES_DAUB_LABEL;Use Daubechies D6 wavelets instead of D4 !PREFERENCES_DAUB_TOOLTIP;The Noise Reduction and Wavelet Levels tools use a Debauchies mother wavelet. If you choose D6 instead of D4 you increase the number of orthogonal Daubechies coefficients and probably increase quality of small-scale levels. There is no memory or processing time difference between the two. !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FLUOF2;Fluorescent F2 !PREFERENCES_FLUOF7;Fluorescent F7 @@ -1810,28 +1821,28 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !TP_RAWEXPOS_BLACK_GREEN;Green !TP_RAWEXPOS_BLACK_RED;Red !TP_RAWEXPOS_RGB;Red, Green, Blue -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1880,7 +1891,7 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* !TP_RETINEX_CONTEDIT_LH;Hue equalizer diff --git a/rtdata/languages/Nederlands b/rtdata/languages/Nederlands index 2d5e6a717..4d96c2290 100644 --- a/rtdata/languages/Nederlands +++ b/rtdata/languages/Nederlands @@ -2007,6 +2007,12 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !DYNPROFILEEDITOR_NEW;New !DYNPROFILEEDITOR_NEW_RULE;New Dynamic Profile Rule !DYNPROFILEEDITOR_PROFILE;Processing Profile +!EXPORT_BYPASS;Processing steps to bypass +!EXPORT_PIPELINE;Processing pipeline +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !GENERAL_APPLY;Apply !GENERAL_OPEN;Open !HISTORY_MSG_439;Retinex - Process @@ -2069,8 +2075,13 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !IPTCPANEL_TITLEHINT;Enter a short verbal and human readable name for the image, this may be the file name. !IPTCPANEL_TRANSREFERENCE;Job ID !IPTCPANEL_TRANSREFERENCEHINT;Enter a number or identifier needed for workflow control or tracking. +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAW_IMAGENUM;Sub-image +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PREFERENCES_CMMBPC;Black point compensation +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_MONITOR;Monitor !PREFERENCES_MONPROFILE;Default color profile !PREFERENCES_MONPROFILE_WARNOSX;Due to MacOS limitations, only sRGB is supported. @@ -2096,21 +2107,21 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !TP_ICM_BPC;Black Point Compensation !TP_ICM_BPC_TOOLTIP;Enable this to fit the Luminosity channel to the output color space with a fix White Point !TP_ICM_SAVEREFERENCE;Save Reference Image -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_DCB;DCB +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. +!TP_RAW_LMMSE;LMMSE +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -2156,7 +2167,7 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission !TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. diff --git a/rtdata/languages/Norsk BM b/rtdata/languages/Norsk BM index ed85637b3..19c0c2b92 100644 --- a/rtdata/languages/Norsk BM +++ b/rtdata/languages/Norsk BM @@ -464,6 +464,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !EXIFFILTER_EXPOSURECOMPENSATION;Exposure compensation (EV) !EXIFFILTER_FILETYPE;File type !EXIFFILTER_METADATAFILTER;Enable metadata filters +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_ALL;Select / Unselect All !EXPORT_BYPASS_DEFRINGE;Bypass Defringe !EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction @@ -486,8 +487,12 @@ TP_WBALANCE_TEMPERATURE;Temperatur !EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. !EXPORT_MAXHEIGHT;Maximum height: !EXPORT_MAXWIDTH;Maximum width: +!EXPORT_PIPELINE;Processing pipeline !EXPORT_PUTTOQUEUEFAST; Put to queue for fast export !EXPORT_RAW_DMETHOD;Demosaic method +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_1;raw !EXTPROGTARGET_2;queue-processed !FILEBROWSER_ADDDELTEMPLATE;Add/Del templates... @@ -503,7 +508,6 @@ TP_WBALANCE_TEMPERATURE;Temperatur !FILEBROWSER_CURRENT_NAME;Current name: !FILEBROWSER_DARKFRAME;Dark-frame !FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected %1 files including a queue-processed version? -!FILEBROWSER_EXEC_CPB;Custom Profile Builder !FILEBROWSER_EXTPROGMENU;Open with !FILEBROWSER_FLATFIELD;Flat-Field !FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory @@ -538,6 +542,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !FILEBROWSER_RANK3_TOOLTIP;Rank 3 *\nShortcut: Shift-3 !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SELECTDARKFRAME;Select dark-frame... !FILEBROWSER_SELECTFLATFIELD;Select flat-field... !FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 @@ -1088,8 +1093,8 @@ TP_WBALANCE_TEMPERATURE;Temperatur !PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening !PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction -!PARTIALPASTE_RAWCACORR_CABLUE;CA blue -!PARTIALPASTE_RAWCACORR_CARED;CA red +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAWEXPOS_BLACK;Black levels !PARTIALPASTE_RAWEXPOS_LINEAR;White point correction !PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -1100,6 +1105,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !PARTIALPASTE_RAW_FALSECOLOR;False color suppression !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_RGBCURVES;RGB curves !PARTIALPASTE_SHARPENEDGE;Edges @@ -1154,6 +1160,8 @@ TP_WBALANCE_TEMPERATURE;Temperatur !PREFERENCES_DIRDARKFRAMES;Dark-frames directory !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FLATFIELD;Flat-Field @@ -1736,31 +1744,31 @@ TP_WBALANCE_TEMPERATURE;Temperatur !TP_RAWEXPOS_PRESER;Highlight preservation !TP_RAWEXPOS_RGB;Red, Green, Blue !TP_RAWEXPOS_TWOGREEN;Link greens -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DCBENHANCE;DCB enhancement !TP_RAW_DCBITERATIONS;Number of DCB iterations !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. !TP_RAW_LABEL;Demosaicing -!TP_RAW_LMMSE;lmmse +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1809,7 +1817,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RESIZE_APPLIESTO;Applies to: !TP_RESIZE_CROPPEDAREA;Cropped Area !TP_RESIZE_FITBOX;Bounding Box diff --git a/rtdata/languages/Polish b/rtdata/languages/Polish index 42692fccd..a83c2ce48 100644 --- a/rtdata/languages/Polish +++ b/rtdata/languages/Polish @@ -1481,7 +1481,13 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !DYNPROFILEEDITOR_NEW;New !DYNPROFILEEDITOR_NEW_RULE;New Dynamic Profile Rule !DYNPROFILEEDITOR_PROFILE;Processing Profile +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_EQUALIZER;Bypass Wavelet Levels +!EXPORT_PIPELINE;Processing pipeline +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SHOWNOTTRASHHINT;Show only non-deleted images. !FILEBROWSER_SHOWORIGINALHINT;Show only original images.\n\nWhen several images exist with the same filename but different extensions, the one considered original is the one whose extension is nearest the top of the parsed extensions list in Preferences > File Browser > Parsed Extensions. !FILECHOOSER_FILTER_ANY;All files @@ -1703,7 +1709,10 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !MONITOR_PROFILE_SYSTEM;System default !PARTIALPASTE_EQUALIZER;Wavelet levels !PARTIALPASTE_PRSHARPENING;Post-resize sharpening +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAW_IMAGENUM;Sub-image +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_WAVELETGROUP;Wavelet Levels !PREFERENCES_AUTLISLOW;Low @@ -1724,6 +1733,8 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !PREFERENCES_DAUB_LABEL;Use Daubechies D6 wavelets instead of D4 !PREFERENCES_DAUB_TOOLTIP;The Noise Reduction and Wavelet Levels tools use a Debauchies mother wavelet. If you choose D6 instead of D4 you increase the number of orthogonal Daubechies coefficients and probably increase quality of small-scale levels. There is no memory or processing time difference between the two. !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT;Same thumbnail height between the Filmstrip and the File Browser !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT_HINT;Having separate thumbnail size will require more processing time each time you'll switch between the single Editor tab and the File Browser. !PREFERENCES_GREYSC;Scene Yb luminance (%) @@ -1845,23 +1856,23 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. !TP_RAWCACORR_CASTR;Strength -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DCB;DCB +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. +!TP_RAW_LMMSE;LMMSE +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1907,7 +1918,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* !TP_RETINEX_CONTEDIT_LH;Hue equalizer diff --git a/rtdata/languages/Polish (Latin Characters) b/rtdata/languages/Polish (Latin Characters) index b961fa959..12ba19e83 100644 --- a/rtdata/languages/Polish (Latin Characters) +++ b/rtdata/languages/Polish (Latin Characters) @@ -1481,7 +1481,13 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !DYNPROFILEEDITOR_NEW;New !DYNPROFILEEDITOR_NEW_RULE;New Dynamic Profile Rule !DYNPROFILEEDITOR_PROFILE;Processing Profile +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_EQUALIZER;Bypass Wavelet Levels +!EXPORT_PIPELINE;Processing pipeline +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SHOWNOTTRASHHINT;Show only non-deleted images. !FILEBROWSER_SHOWORIGINALHINT;Show only original images.\n\nWhen several images exist with the same filename but different extensions, the one considered original is the one whose extension is nearest the top of the parsed extensions list in Preferences > File Browser > Parsed Extensions. !FILECHOOSER_FILTER_ANY;All files @@ -1703,7 +1709,10 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !MONITOR_PROFILE_SYSTEM;System default !PARTIALPASTE_EQUALIZER;Wavelet levels !PARTIALPASTE_PRSHARPENING;Post-resize sharpening +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAW_IMAGENUM;Sub-image +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_WAVELETGROUP;Wavelet Levels !PREFERENCES_AUTLISLOW;Low @@ -1724,6 +1733,8 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !PREFERENCES_DAUB_LABEL;Use Daubechies D6 wavelets instead of D4 !PREFERENCES_DAUB_TOOLTIP;The Noise Reduction and Wavelet Levels tools use a Debauchies mother wavelet. If you choose D6 instead of D4 you increase the number of orthogonal Daubechies coefficients and probably increase quality of small-scale levels. There is no memory or processing time difference between the two. !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT;Same thumbnail height between the Filmstrip and the File Browser !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT_HINT;Having separate thumbnail size will require more processing time each time you'll switch between the single Editor tab and the File Browser. !PREFERENCES_GREYSC;Scene Yb luminance (%) @@ -1845,23 +1856,23 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !TP_PRSHARPENING_LABEL;Post-Resize Sharpening !TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. !TP_RAWCACORR_CASTR;Strength -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DCB;DCB +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. +!TP_RAW_LMMSE;LMMSE +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1907,7 +1918,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* !TP_RETINEX_CONTEDIT_LH;Hue equalizer diff --git a/rtdata/languages/Portugues (Brasil) b/rtdata/languages/Portugues (Brasil) index cf85697a8..b325ef4bd 100644 --- a/rtdata/languages/Portugues (Brasil) +++ b/rtdata/languages/Portugues (Brasil) @@ -465,6 +465,7 @@ TP_WBALANCE_TEMPERATURE;Temperatura !EXIFFILTER_EXPOSURECOMPENSATION;Exposure compensation (EV) !EXIFFILTER_FILETYPE;File type !EXIFFILTER_METADATAFILTER;Enable metadata filters +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_ALL;Select / Unselect All !EXPORT_BYPASS_DEFRINGE;Bypass Defringe !EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction @@ -487,8 +488,12 @@ TP_WBALANCE_TEMPERATURE;Temperatura !EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. !EXPORT_MAXHEIGHT;Maximum height: !EXPORT_MAXWIDTH;Maximum width: +!EXPORT_PIPELINE;Processing pipeline !EXPORT_PUTTOQUEUEFAST; Put to queue for fast export !EXPORT_RAW_DMETHOD;Demosaic method +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_1;raw !EXTPROGTARGET_2;queue-processed !FILEBROWSER_ADDDELTEMPLATE;Add/Del templates... @@ -504,7 +509,6 @@ TP_WBALANCE_TEMPERATURE;Temperatura !FILEBROWSER_CURRENT_NAME;Current name: !FILEBROWSER_DARKFRAME;Dark-frame !FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected %1 files including a queue-processed version? -!FILEBROWSER_EXEC_CPB;Custom Profile Builder !FILEBROWSER_EXTPROGMENU;Open with !FILEBROWSER_FLATFIELD;Flat-Field !FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory @@ -539,6 +543,7 @@ TP_WBALANCE_TEMPERATURE;Temperatura !FILEBROWSER_RANK3_TOOLTIP;Rank 3 *\nShortcut: Shift-3 !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SELECTDARKFRAME;Select dark-frame... !FILEBROWSER_SELECTFLATFIELD;Select flat-field... !FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 @@ -1089,8 +1094,8 @@ TP_WBALANCE_TEMPERATURE;Temperatura !PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening !PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction -!PARTIALPASTE_RAWCACORR_CABLUE;CA blue -!PARTIALPASTE_RAWCACORR_CARED;CA red +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAWEXPOS_BLACK;Black levels !PARTIALPASTE_RAWEXPOS_LINEAR;White point correction !PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -1101,6 +1106,7 @@ TP_WBALANCE_TEMPERATURE;Temperatura !PARTIALPASTE_RAW_FALSECOLOR;False color suppression !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_RGBCURVES;RGB curves !PARTIALPASTE_SHARPENEDGE;Edges @@ -1155,6 +1161,8 @@ TP_WBALANCE_TEMPERATURE;Temperatura !PREFERENCES_DIRDARKFRAMES;Dark-frames directory !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FLATFIELD;Flat-Field @@ -1737,31 +1745,31 @@ TP_WBALANCE_TEMPERATURE;Temperatura !TP_RAWEXPOS_PRESER;Highlight preservation !TP_RAWEXPOS_RGB;Red, Green, Blue !TP_RAWEXPOS_TWOGREEN;Link greens -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DCBENHANCE;DCB enhancement !TP_RAW_DCBITERATIONS;Number of DCB iterations !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. !TP_RAW_LABEL;Demosaicing -!TP_RAW_LMMSE;lmmse +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1810,7 +1818,7 @@ TP_WBALANCE_TEMPERATURE;Temperatura !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RESIZE_APPLIESTO;Applies to: !TP_RESIZE_CROPPEDAREA;Cropped Area !TP_RESIZE_FITBOX;Bounding Box diff --git a/rtdata/languages/Russian b/rtdata/languages/Russian index 343526a17..b3ce61cfa 100644 --- a/rtdata/languages/Russian +++ b/rtdata/languages/Russian @@ -1292,8 +1292,14 @@ ZOOMPANEL_ZOOMOUT;Удалить - !DYNPROFILEEDITOR_PROFILE;Processing Profile !EDIT_OBJECT_TOOLTIP;Displays a widget on the preview window which lets you adjust this tool. !EDIT_PIPETTE_TOOLTIP;To add an adjustment point to the curve, hold the Ctrl key while left-clicking the desired spot in the image preview.\nTo adjust the point, hold the Ctrl key while left-clicking the corresponding area in the preview, then let go of Ctrl (unless you desire fine control) and while still holding the left mouse button move the mouse up or down to move that point up or down in the curve. +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_EQUALIZER;Bypass Wavelet Levels +!EXPORT_PIPELINE;Processing pipeline +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !FILEBROWSER_POPUPRANK0;Unrank +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SHOWNOTTRASHHINT;Show only non-deleted images. !FILEBROWSER_SHOWORIGINALHINT;Show only original images.\n\nWhen several images exist with the same filename but different extensions, the one considered original is the one whose extension is nearest the top of the parsed extensions list in Preferences > File Browser > Parsed Extensions. !FILECHOOSER_FILTER_ANY;All files @@ -1578,7 +1584,10 @@ ZOOMPANEL_ZOOMOUT;Удалить - !PARTIALPASTE_PREPROCESS_DEADPIXFILT;Dead pixel filter !PARTIALPASTE_PREPROCESS_HOTPIXFILT;Hot pixel filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAW_IMAGENUM;Sub-image +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_WAVELETGROUP;Wavelet Levels !PREFERENCES_AUTLISLOW;Low @@ -1600,6 +1609,8 @@ ZOOMPANEL_ZOOMOUT;Удалить - !PREFERENCES_DAUB_LABEL;Use Daubechies D6 wavelets instead of D4 !PREFERENCES_DAUB_TOOLTIP;The Noise Reduction and Wavelet Levels tools use a Debauchies mother wavelet. If you choose D6 instead of D4 you increase the number of orthogonal Daubechies coefficients and probably increase quality of small-scale levels. There is no memory or processing time difference between the two. !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT;Same thumbnail height between the Filmstrip and the File Browser !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT_HINT;Having separate thumbnail size will require more processing time each time you'll switch between the single Editor tab and the File Browser. @@ -1838,23 +1849,23 @@ ZOOMPANEL_ZOOMOUT;Удалить - !TP_RAWEXPOS_BLACK_GREEN;Green !TP_RAWEXPOS_BLACK_RED;Red !TP_RAWEXPOS_RGB;Red, Green, Blue -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DCB;DCB +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. +!TP_RAW_LMMSE;LMMSE +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1903,7 +1914,7 @@ ZOOMPANEL_ZOOMOUT;Удалить - !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* !TP_RETINEX_CONTEDIT_LH;Hue equalizer diff --git a/rtdata/languages/Serbian (Cyrilic Characters) b/rtdata/languages/Serbian (Cyrilic Characters) index a8742d98b..3a29d9cdb 100644 --- a/rtdata/languages/Serbian (Cyrilic Characters) +++ b/rtdata/languages/Serbian (Cyrilic Characters) @@ -1448,7 +1448,12 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !DYNPROFILEEDITOR_PROFILE;Processing Profile !EDIT_OBJECT_TOOLTIP;Displays a widget on the preview window which lets you adjust this tool. !EDIT_PIPETTE_TOOLTIP;To add an adjustment point to the curve, hold the Ctrl key while left-clicking the desired spot in the image preview.\nTo adjust the point, hold the Ctrl key while left-clicking the corresponding area in the preview, then let go of Ctrl (unless you desire fine control) and while still holding the left mouse button move the mouse up or down to move that point up or down in the curve. +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_EQUALIZER;Bypass Wavelet Levels +!EXPORT_PIPELINE;Processing pipeline +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !FILEBROWSER_POPUPCOLORLABEL0;Label: None !FILEBROWSER_POPUPCOLORLABEL1;Label: Red !FILEBROWSER_POPUPCOLORLABEL2;Label: Yellow @@ -1462,6 +1467,7 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !FILEBROWSER_POPUPRANK3;Rank 3 *** !FILEBROWSER_POPUPRANK4;Rank 4 **** !FILEBROWSER_POPUPRANK5;Rank 5 ***** +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SHOWNOTTRASHHINT;Show only non-deleted images. !FILEBROWSER_SHOWORIGINALHINT;Show only original images.\n\nWhen several images exist with the same filename but different extensions, the one considered original is the one whose extension is nearest the top of the parsed extensions list in Preferences > File Browser > Parsed Extensions. !FILECHOOSER_FILTER_ANY;All files @@ -1744,7 +1750,10 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !PARTIALPASTE_PREPROCESS_DEADPIXFILT;Dead pixel filter !PARTIALPASTE_PREPROCESS_HOTPIXFILT;Hot pixel filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAW_IMAGENUM;Sub-image +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_WAVELETGROUP;Wavelet Levels !PREFERENCES_AUTLISLOW;Low @@ -1766,6 +1775,8 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !PREFERENCES_DAUB_LABEL;Use Daubechies D6 wavelets instead of D4 !PREFERENCES_DAUB_TOOLTIP;The Noise Reduction and Wavelet Levels tools use a Debauchies mother wavelet. If you choose D6 instead of D4 you increase the number of orthogonal Daubechies coefficients and probably increase quality of small-scale levels. There is no memory or processing time difference between the two. !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT;Same thumbnail height between the Filmstrip and the File Browser !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT_HINT;Having separate thumbnail size will require more processing time each time you'll switch between the single Editor tab and the File Browser. @@ -1971,23 +1982,23 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !TP_RAWEXPOS_BLACK_GREEN;Green !TP_RAWEXPOS_BLACK_RED;Red !TP_RAWEXPOS_RGB;Red, Green, Blue -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DCB;DCB +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. +!TP_RAW_LMMSE;LMMSE +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -2036,7 +2047,7 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* !TP_RETINEX_CONTEDIT_LH;Hue equalizer diff --git a/rtdata/languages/Serbian (Latin Characters) b/rtdata/languages/Serbian (Latin Characters) index 2a57b01eb..269c941d4 100644 --- a/rtdata/languages/Serbian (Latin Characters) +++ b/rtdata/languages/Serbian (Latin Characters) @@ -1448,7 +1448,12 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !DYNPROFILEEDITOR_PROFILE;Processing Profile !EDIT_OBJECT_TOOLTIP;Displays a widget on the preview window which lets you adjust this tool. !EDIT_PIPETTE_TOOLTIP;To add an adjustment point to the curve, hold the Ctrl key while left-clicking the desired spot in the image preview.\nTo adjust the point, hold the Ctrl key while left-clicking the corresponding area in the preview, then let go of Ctrl (unless you desire fine control) and while still holding the left mouse button move the mouse up or down to move that point up or down in the curve. +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_EQUALIZER;Bypass Wavelet Levels +!EXPORT_PIPELINE;Processing pipeline +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !FILEBROWSER_POPUPCOLORLABEL0;Label: None !FILEBROWSER_POPUPCOLORLABEL1;Label: Red !FILEBROWSER_POPUPCOLORLABEL2;Label: Yellow @@ -1462,6 +1467,7 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !FILEBROWSER_POPUPRANK3;Rank 3 *** !FILEBROWSER_POPUPRANK4;Rank 4 **** !FILEBROWSER_POPUPRANK5;Rank 5 ***** +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SHOWNOTTRASHHINT;Show only non-deleted images. !FILEBROWSER_SHOWORIGINALHINT;Show only original images.\n\nWhen several images exist with the same filename but different extensions, the one considered original is the one whose extension is nearest the top of the parsed extensions list in Preferences > File Browser > Parsed Extensions. !FILECHOOSER_FILTER_ANY;All files @@ -1744,7 +1750,10 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !PARTIALPASTE_PREPROCESS_DEADPIXFILT;Dead pixel filter !PARTIALPASTE_PREPROCESS_HOTPIXFILT;Hot pixel filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAW_IMAGENUM;Sub-image +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_WAVELETGROUP;Wavelet Levels !PREFERENCES_AUTLISLOW;Low @@ -1766,6 +1775,8 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !PREFERENCES_DAUB_LABEL;Use Daubechies D6 wavelets instead of D4 !PREFERENCES_DAUB_TOOLTIP;The Noise Reduction and Wavelet Levels tools use a Debauchies mother wavelet. If you choose D6 instead of D4 you increase the number of orthogonal Daubechies coefficients and probably increase quality of small-scale levels. There is no memory or processing time difference between the two. !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT;Same thumbnail height between the Filmstrip and the File Browser !PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT_HINT;Having separate thumbnail size will require more processing time each time you'll switch between the single Editor tab and the File Browser. @@ -1971,23 +1982,23 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !TP_RAWEXPOS_BLACK_GREEN;Green !TP_RAWEXPOS_BLACK_RED;Red !TP_RAWEXPOS_RGB;Red, Green, Blue -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DCB;DCB +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. +!TP_RAW_LMMSE;LMMSE +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -2036,7 +2047,7 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* !TP_RETINEX_CONTEDIT_LH;Hue equalizer diff --git a/rtdata/languages/Slovak b/rtdata/languages/Slovak index 68b277f00..2ebc31ab7 100644 --- a/rtdata/languages/Slovak +++ b/rtdata/languages/Slovak @@ -546,6 +546,7 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !EDIT_PIPETTE_TOOLTIP;To add an adjustment point to the curve, hold the Ctrl key while left-clicking the desired spot in the image preview.\nTo adjust the point, hold the Ctrl key while left-clicking the corresponding area in the preview, then let go of Ctrl (unless you desire fine control) and while still holding the left mouse button move the mouse up or down to move that point up or down in the curve. !EXIFFILTER_EXPOSURECOMPENSATION;Exposure compensation (EV) !EXIFFILTER_FILETYPE;File type +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_ALL;Select / Unselect All !EXPORT_BYPASS_DEFRINGE;Bypass Defringe !EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction @@ -568,8 +569,12 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. !EXPORT_MAXHEIGHT;Maximum height: !EXPORT_MAXWIDTH;Maximum width: +!EXPORT_PIPELINE;Processing pipeline !EXPORT_PUTTOQUEUEFAST; Put to queue for fast export !EXPORT_RAW_DMETHOD;Demosaic method +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_1;raw !EXTPROGTARGET_2;queue-processed !FILEBROWSER_APPLYPROFILE_PARTIAL;Apply - partial @@ -583,7 +588,6 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !FILEBROWSER_COLORLABEL_TOOLTIP;Color label.\n\nUse dropdown menu or shortcuts:\nShift-Ctrl-0 No Color\nShift-Ctrl-1 Red\nShift-Ctrl-2 Yellow\nShift-Ctrl-3 Green\nShift-Ctrl-4 Blue\nShift-Ctrl-5 Purple !FILEBROWSER_DARKFRAME;Dark-frame !FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected %1 files including a queue-processed version? -!FILEBROWSER_EXEC_CPB;Custom Profile Builder !FILEBROWSER_EXTPROGMENU;Open with !FILEBROWSER_FLATFIELD;Flat-Field !FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory @@ -617,6 +621,7 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !FILEBROWSER_RANK3_TOOLTIP;Rank 3 *\nShortcut: Shift-3 !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SELECTDARKFRAME;Select dark-frame... !FILEBROWSER_SELECTFLATFIELD;Select flat-field... !FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 @@ -1143,8 +1148,8 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening !PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction -!PARTIALPASTE_RAWCACORR_CABLUE;CA blue -!PARTIALPASTE_RAWCACORR_CARED;CA red +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAWEXPOS_BLACK;Black levels !PARTIALPASTE_RAWEXPOS_LINEAR;White point correction !PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -1155,6 +1160,7 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !PARTIALPASTE_RAW_FALSECOLOR;False color suppression !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_RGBCURVES;RGB curves !PARTIALPASTE_SHARPENEDGE;Edges @@ -1205,6 +1211,8 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !PREFERENCES_DAUB_TOOLTIP;The Noise Reduction and Wavelet Levels tools use a Debauchies mother wavelet. If you choose D6 instead of D4 you increase the number of orthogonal Daubechies coefficients and probably increase quality of small-scale levels. There is no memory or processing time difference between the two. !PREFERENCES_DIRDARKFRAMES;Dark-frames directory !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FLATFIELD;Flat-Field @@ -1750,29 +1758,29 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !TP_RAWEXPOS_PRESER;Highlight preservation !TP_RAWEXPOS_RGB;Red, Green, Blue !TP_RAWEXPOS_TWOGREEN;Link greens -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. !TP_RAW_LABEL;Demosaicing -!TP_RAW_LMMSE;lmmse +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1821,7 +1829,7 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RESIZE_APPLIESTO;Applies to: !TP_RESIZE_CROPPEDAREA;Cropped Area !TP_RESIZE_FITBOX;Bounding Box diff --git a/rtdata/languages/Suomi b/rtdata/languages/Suomi index 925727ba7..b6556bbb0 100644 --- a/rtdata/languages/Suomi +++ b/rtdata/languages/Suomi @@ -466,6 +466,7 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !EXIFFILTER_EXPOSURECOMPENSATION;Exposure compensation (EV) !EXIFFILTER_FILETYPE;File type !EXIFFILTER_METADATAFILTER;Enable metadata filters +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_ALL;Select / Unselect All !EXPORT_BYPASS_DEFRINGE;Bypass Defringe !EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction @@ -488,8 +489,12 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. !EXPORT_MAXHEIGHT;Maximum height: !EXPORT_MAXWIDTH;Maximum width: +!EXPORT_PIPELINE;Processing pipeline !EXPORT_PUTTOQUEUEFAST; Put to queue for fast export !EXPORT_RAW_DMETHOD;Demosaic method +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_1;raw !EXTPROGTARGET_2;queue-processed !FILEBROWSER_ADDDELTEMPLATE;Add/Del templates... @@ -505,7 +510,6 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !FILEBROWSER_CURRENT_NAME;Current name: !FILEBROWSER_DARKFRAME;Dark-frame !FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected %1 files including a queue-processed version? -!FILEBROWSER_EXEC_CPB;Custom Profile Builder !FILEBROWSER_EXTPROGMENU;Open with !FILEBROWSER_FLATFIELD;Flat-Field !FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory @@ -540,6 +544,7 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !FILEBROWSER_RANK3_TOOLTIP;Rank 3 *\nShortcut: Shift-3 !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SELECTDARKFRAME;Select dark-frame... !FILEBROWSER_SELECTFLATFIELD;Select flat-field... !FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 @@ -1090,8 +1095,8 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening !PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction -!PARTIALPASTE_RAWCACORR_CABLUE;CA blue -!PARTIALPASTE_RAWCACORR_CARED;CA red +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAWEXPOS_BLACK;Black levels !PARTIALPASTE_RAWEXPOS_LINEAR;White point correction !PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -1102,6 +1107,7 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !PARTIALPASTE_RAW_FALSECOLOR;False color suppression !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_RGBCURVES;RGB curves !PARTIALPASTE_SHARPENEDGE;Edges @@ -1156,6 +1162,8 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !PREFERENCES_DIRDARKFRAMES;Dark-frames directory !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FLATFIELD;Flat-Field @@ -1737,31 +1745,31 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !TP_RAWEXPOS_PRESER;Highlight preservation !TP_RAWEXPOS_RGB;Red, Green, Blue !TP_RAWEXPOS_TWOGREEN;Link greens -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DCBENHANCE;DCB enhancement !TP_RAW_DCBITERATIONS;Number of DCB iterations !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. !TP_RAW_LABEL;Demosaicing -!TP_RAW_LMMSE;lmmse +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1810,7 +1818,7 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RESIZE_APPLIESTO;Applies to: !TP_RESIZE_CROPPEDAREA;Cropped Area !TP_RESIZE_FITBOX;Bounding Box diff --git a/rtdata/languages/Swedish b/rtdata/languages/Swedish index 722ec8f53..1fffdb51f 100644 --- a/rtdata/languages/Swedish +++ b/rtdata/languages/Swedish @@ -1904,6 +1904,12 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !DYNPROFILEEDITOR_NEW;New !DYNPROFILEEDITOR_NEW_RULE;New Dynamic Profile Rule !DYNPROFILEEDITOR_PROFILE;Processing Profile +!EXPORT_BYPASS;Processing steps to bypass +!EXPORT_PIPELINE;Processing pipeline +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !HISTORY_MSG_257;Color Toning !HISTORY_MSG_288;Flat Field - Clip control !HISTORY_MSG_289;Flat Field - Clip control - Auto @@ -1985,8 +1991,13 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !IPTCPANEL_TRANSREFERENCEHINT;Enter a number or identifier needed for workflow control or tracking. !PARTIALPASTE_COLORTONING;Color toning !PARTIALPASTE_FLATFIELDCLIPCONTROL;Flat-field clip control +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAW_IMAGENUM;Sub-image +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PREFERENCES_CMMBPC;Black point compensation +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_INSPECT_MAXBUFFERS_TOOLTIP;Set the maximum number of images stored in cache when hovering over them in the File Browser; systems with little RAM (2GB) should keep this value set to 1 or 2. !PREFERENCES_LISS;Auto multi-zone smoothing !PREFERENCES_MONINTENT;Default rendering intent @@ -2025,21 +2036,21 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !TP_ICM_BPC_TOOLTIP;Enable this to fit the Luminosity channel to the output color space with a fix White Point !TP_ICM_PROFILEINTENT;Rendering Intent !TP_ICM_SAVEREFERENCE;Save Reference Image -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_DCB;DCB +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. -!TP_RAW_LMMSE;lmmse -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. +!TP_RAW_LMMSE;LMMSE +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -2085,7 +2096,7 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_MAP;Mask equalizer !TP_RETINEX_CURVEEDITOR_CD_TOOLTIP;Luminance according to luminance L=f(L)\nCorrect raw data to reduce halos and artifacts. !TP_RETINEX_CURVEEDITOR_MAP_TOOLTIP;This curve can be applied alone or with a Gaussian mask or wavelet mask.\nBeware of artifacts! diff --git a/rtdata/languages/Turkish b/rtdata/languages/Turkish index e22ccd1b9..b84ef05a8 100644 --- a/rtdata/languages/Turkish +++ b/rtdata/languages/Turkish @@ -465,6 +465,7 @@ TP_WBALANCE_TEMPERATURE;Isı !EXIFFILTER_EXPOSURECOMPENSATION;Exposure compensation (EV) !EXIFFILTER_FILETYPE;File type !EXIFFILTER_METADATAFILTER;Enable metadata filters +!EXPORT_BYPASS;Processing steps to bypass !EXPORT_BYPASS_ALL;Select / Unselect All !EXPORT_BYPASS_DEFRINGE;Bypass Defringe !EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction @@ -487,8 +488,12 @@ TP_WBALANCE_TEMPERATURE;Isı !EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. !EXPORT_MAXHEIGHT;Maximum height: !EXPORT_MAXWIDTH;Maximum width: +!EXPORT_PIPELINE;Processing pipeline !EXPORT_PUTTOQUEUEFAST; Put to queue for fast export !EXPORT_RAW_DMETHOD;Demosaic method +!EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +!EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +!EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) !EXTPROGTARGET_1;raw !EXTPROGTARGET_2;queue-processed !FILEBROWSER_ADDDELTEMPLATE;Add/Del templates... @@ -504,7 +509,6 @@ TP_WBALANCE_TEMPERATURE;Isı !FILEBROWSER_CURRENT_NAME;Current name: !FILEBROWSER_DARKFRAME;Dark-frame !FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected %1 files including a queue-processed version? -!FILEBROWSER_EXEC_CPB;Custom Profile Builder !FILEBROWSER_EXTPROGMENU;Open with !FILEBROWSER_FLATFIELD;Flat-Field !FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory @@ -539,6 +543,7 @@ TP_WBALANCE_TEMPERATURE;Isı !FILEBROWSER_RANK3_TOOLTIP;Rank 3 *\nShortcut: Shift-3 !FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 !FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 +!FILEBROWSER_RESETDEFAULTPROFILE;Reset to default !FILEBROWSER_SELECTDARKFRAME;Select dark-frame... !FILEBROWSER_SELECTFLATFIELD;Select flat-field... !FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 @@ -1089,8 +1094,8 @@ TP_WBALANCE_TEMPERATURE;Isı !PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter !PARTIALPASTE_PRSHARPENING;Post-resize sharpening !PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction -!PARTIALPASTE_RAWCACORR_CABLUE;CA blue -!PARTIALPASTE_RAWCACORR_CARED;CA red +!PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +!PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue !PARTIALPASTE_RAWEXPOS_BLACK;Black levels !PARTIALPASTE_RAWEXPOS_LINEAR;White point correction !PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -1101,6 +1106,7 @@ TP_WBALANCE_TEMPERATURE;Isı !PARTIALPASTE_RAW_FALSECOLOR;False color suppression !PARTIALPASTE_RAW_IMAGENUM;Sub-image !PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +!PARTIALPASTE_RAW_PIXELSHIFT;PixelShift !PARTIALPASTE_RETINEX;Retinex !PARTIALPASTE_RGBCURVES;RGB curves !PARTIALPASTE_SHARPENEDGE;Edges @@ -1155,6 +1161,8 @@ TP_WBALANCE_TEMPERATURE;Isı !PREFERENCES_DIRDARKFRAMES;Dark-frames directory !PREFERENCES_EDITORLAYOUT;Editor Layout !PREFERENCES_EXPAUT;Expert +!PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +!PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. !PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) !PREFERENCES_FILMSIMULATION;Film Simulation !PREFERENCES_FLATFIELD;Flat-Field @@ -1736,31 +1744,31 @@ TP_WBALANCE_TEMPERATURE;Isı !TP_RAWEXPOS_PRESER;Highlight preservation !TP_RAWEXPOS_RGB;Red, Green, Blue !TP_RAWEXPOS_TWOGREEN;Link greens -!TP_RAW_1-PASS (MEDIUM);1-pass (medium) -!TP_RAW_3-PASS (BEST);3-pass (best) -!TP_RAW_AHD;ahd +!TP_RAW_1PASSMEDIUM;1-Pass (Medium) +!TP_RAW_3PASSBEST;3-Pass (Best) +!TP_RAW_AHD;AHD !TP_RAW_AMAZE;AMaZE -!TP_RAW_DCB;dcb +!TP_RAW_DCB;DCB !TP_RAW_DCBENHANCE;DCB enhancement !TP_RAW_DCBITERATIONS;Number of DCB iterations !TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing... !TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement... -!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixelshift is for Pentax pixelshift files. It falls back to Amaze for non pixelshift files. -!TP_RAW_EAHD;eahd -!TP_RAW_FAST;fast +!TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files. +!TP_RAW_EAHD;EAHD +!TP_RAW_FAST;Fast !TP_RAW_HD;Threshold !TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, but false positives may lead to artifacts. If you notice any artifacts appearing when enabling the Hot/Dead Pixel Filters, gradually increase the threshold value until they disappear. -!TP_RAW_HPHD;hphd -!TP_RAW_IGV;igv +!TP_RAW_HPHD;HPHD +!TP_RAW_IGV;IGV !TP_RAW_IMAGENUM;Sub-image -!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel-Shift, Dual Sensitivity). Use this button to select the sub-image.\n\nThe last sub-image will be used if you select a value beyond the real sub-image count. +!TP_RAW_IMAGENUM_TOOLTIP;Some raw files might embed several sub-images (HDR, Pixel Shift, Dual Pixel, Dual Sensitivity). Use this button to select the sub-image. !TP_RAW_LABEL;Demosaicing -!TP_RAW_LMMSE;lmmse +!TP_RAW_LMMSE;LMMSE !TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps !TP_RAW_LMMSE_TOOLTIP;Adds gamma (step 1), median (steps 2-4) and refinement (steps 5-6) to reduce artifacts and improve the signal-to-noise ratio. -!TP_RAW_MONO;mono -!TP_RAW_NONE;none (show sensor pattern) -!TP_RAW_PIXELSHIFT;Pixel Shift (Pentax) +!TP_RAW_MONO;Mono +!TP_RAW_NONE;None (Shows sensor pattern) +!TP_RAW_PIXELSHIFT;Pixel Shift !TP_RAW_PIXELSHIFTADAPTIVE;Adaptive detection !TP_RAW_PIXELSHIFTBLUR;Blur motion mask !TP_RAW_PIXELSHIFTBLUR_TOOLTIP;Blur motion mask @@ -1809,7 +1817,7 @@ TP_WBALANCE_TEMPERATURE;Isı !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix -!TP_RAW_VNG4;vng4 +!TP_RAW_VNG4;VNG4 !TP_RESIZE_APPLIESTO;Applies to: !TP_RESIZE_CROPPEDAREA;Cropped Area !TP_RESIZE_FITBOX;Bounding Box diff --git a/rtdata/languages/default b/rtdata/languages/default index 5f400baea..fdb1ebfe9 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -71,6 +71,7 @@ EXIFPANEL_RESETALL;Reset All EXIFPANEL_RESETALLHINT;Reset all tags to their original values. EXIFPANEL_RESETHINT;Reset the selected tags to their original values. EXIFPANEL_SUBDIRECTORY;Subdirectory +EXPORT_BYPASS;Processing steps to bypass EXPORT_BYPASS_ALL;Select / Unselect All EXPORT_BYPASS_DEFRINGE;Bypass Defringe EXPORT_BYPASS_DIRPYRDENOISE;Bypass Noise Reduction @@ -93,8 +94,12 @@ EXPORT_FASTEXPORTOPTIONS;Fast Export Options EXPORT_INSTRUCTIONS;Fast Export options provide overrides to bypass time and resource consuming development settings and to run queue processing using the fast export settings instead. This method is recommended for quicker generation of lower resolution images when speed is a priority or when resized output is desired for one or many images without making modifications to their saved development parameters. EXPORT_MAXHEIGHT;Maximum height: EXPORT_MAXWIDTH;Maximum width: +EXPORT_PIPELINE;Processing pipeline EXPORT_PUTTOQUEUEFAST; Put to queue for fast export EXPORT_RAW_DMETHOD;Demosaic method +EXPORT_USE_FAST_PIPELINE;Dedicated (full processing on resized image) +EXPORT_USE_FAST_PIPELINE_TIP;Use a dedicated processing pipeline for images in Fast Export mode, that trades speed for quality. Resizing of the image is done as early as possible, instead of doing it at the end like in the normal pipeline. The speedup can be significant, but be prepared to see artifacts and a general degradation of output quality. +EXPORT_USE_NORMAL_PIPELINE;Standard (bypass some steps, resize at the end) EXTPROGTARGET_1;raw EXTPROGTARGET_2;queue-processed FILEBROWSER_ADDDELTEMPLATE;Add/Del templates... @@ -117,7 +122,6 @@ FILEBROWSER_DELETEDLGMSG;Are you sure you want to delete the selected %1 FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected %1 files including a queue-processed version? FILEBROWSER_EMPTYTRASH;Empty trash FILEBROWSER_EMPTYTRASHHINT;Permanently delete the files from trash. -FILEBROWSER_EXEC_CPB;Custom Profile Builder FILEBROWSER_EXTPROGMENU;Open with FILEBROWSER_FLATFIELD;Flat-Field FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory @@ -167,6 +171,7 @@ FILEBROWSER_RANK3_TOOLTIP;Rank 3 *\nShortcut: Shift-3 FILEBROWSER_RANK4_TOOLTIP;Rank 4 *\nShortcut: Shift-4 FILEBROWSER_RANK5_TOOLTIP;Rank 5 *\nShortcut: Shift-5 FILEBROWSER_RENAMEDLGLABEL;Rename file +FILEBROWSER_RESETDEFAULTPROFILE;Reset to default FILEBROWSER_SELECTDARKFRAME;Select dark-frame... FILEBROWSER_SELECTFLATFIELD;Select flat-field... FILEBROWSER_SHOWCOLORLABEL1HINT;Show images labeled Red.\nShortcut: Alt-1 @@ -965,8 +970,8 @@ PARTIALPASTE_PREPROCESS_HOTPIXFILT;Hot pixel filter PARTIALPASTE_PREPROCESS_LINEDENOISE;Line noise filter PARTIALPASTE_PRSHARPENING;Post-resize sharpening PARTIALPASTE_RAWCACORR_AUTO;CA auto-correction -PARTIALPASTE_RAWCACORR_CABLUE;CA blue -PARTIALPASTE_RAWCACORR_CARED;CA red +PARTIALPASTE_RAWCACORR_CAAUTOSTRENGTH;CA auto-correction strength +PARTIALPASTE_RAWCACORR_CAREDBLUE;CA red & blue PARTIALPASTE_RAWEXPOS_BLACK;Black levels PARTIALPASTE_RAWEXPOS_LINEAR;White point correction PARTIALPASTE_RAWEXPOS_PRESER;Highlight preservation @@ -977,6 +982,7 @@ PARTIALPASTE_RAW_DMETHOD;Demosaic method PARTIALPASTE_RAW_FALSECOLOR;False color suppression PARTIALPASTE_RAW_IMAGENUM;Sub-image PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE enhancement steps +PARTIALPASTE_RAW_PIXELSHIFT;PixelShift PARTIALPASTE_RESIZE;Resize PARTIALPASTE_RETINEX;Retinex PARTIALPASTE_RGBCURVES;RGB curves @@ -1056,6 +1062,8 @@ PREFERENCES_DIRSOFTWARE;Installation directory PREFERENCES_EDITORCMDLINE;Other command line PREFERENCES_EDITORLAYOUT;Editor Layout PREFERENCES_EXPAUT;Expert +PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming +PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. PREFERENCES_EXTERNALEDITOR;External Editor PREFERENCES_FBROWSEROPTS;File Browser / Thumbnail Options PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;Single row file browser toolbar\n(de-select for low resolution display) @@ -1164,8 +1172,6 @@ PREFERENCES_PRTPROFILE;Color profile PREFERENCES_PSPATH;Adobe Photoshop installation directory PREFERENCES_REMEMBERZOOMPAN;Remember zoom % and pan offset PREFERENCES_REMEMBERZOOMPAN_TOOLTIP;Remember the zoom % and pan offset of the current image when opening a new image.\n\nThis option only works in "Single Editor Tab Mode" and when "Demosaicing method used for the preview at <100% zoom" is set to "As in PP3". -PREFERENCES_EXTENDEDZOOMLEVELS;Use finer-grained zoom levels for "fit to screen" zooming -PREFERENCES_EXTENDEDZOOMLEVELS_TOOLTIP;This allows to better fill the editor window when using one of the "fit to screen" zoom modes. However, the preview quality might be slightly degraded, depending on the actual zoom factor computed. PREFERENCES_RGBDTL_LABEL;Max number of threads for Noise Reduction and Wavelet Levels PREFERENCES_RGBDTL_TOOLTIP;Leave the setting at "0" to automatically use as many threads as possible. The more threads run in parallel, the faster the computation. Refer to RawPedia for memory requirements. PREFERENCES_SELECTFONT;Select main font diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index fc9967619..8471a1393 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -241,7 +241,6 @@ void RawImageSource::CA_correct_RT(const bool autoCA, const double cared, const for (int row = rr + top, cc = ccmin; cc < ccmax; cc++) { int col = cc + left; int c = FC(rr, cc); - int indx = row * width + col; int indx1 = rr * ts + cc; rgb[c][indx1] = (rawData[row][col]) / 65535.0f; } @@ -966,10 +965,9 @@ void RawImageSource::CA_correct_RT(const bool autoCA, const double cared, const // copy CA corrected results to temporary image matrix for (int rr = border; rr < rr1 - border; rr++) { - int c = FC(rr + top, left + border + FC(rr + top, 2) & 1); + int c = FC(rr + top, left + border + (FC(rr + top, 2) & 1)); for (int row = rr + top, cc = border + (FC(rr, 2) & 1), indx = (row * width + cc + left) >> 1; cc < cc1 - border; cc += 2, indx++) { - int col = cc + left; RawDataTmp[indx] = 65535.0f * rgb[c][(rr) * ts + cc] + 0.5f; } } diff --git a/rtengine/EdgePreservingDecomposition.cc b/rtengine/EdgePreservingDecomposition.cc index 7bc292c3f..43a68f024 100644 --- a/rtengine/EdgePreservingDecomposition.cc +++ b/rtengine/EdgePreservingDecomposition.cc @@ -21,7 +21,7 @@ Takes less memory with OkToModify_b = true, and Preconditioner = nullptr. */ float *SparseConjugateGradient(void Ax(float *Product, float *x, void *Pass), float *b, int n, bool OkToModify_b, float *x, float RMSResidual, void *Pass, int MaximumIterates, void Preconditioner(float *Product, float *x, void *Pass)) { - int iterate, i; + int iterate; float* buffer = (float*)malloc(2 * n * sizeof(float) + 128); float *r = (buffer + 16); @@ -411,7 +411,7 @@ bool MultiDiagonalSymmetricMatrix::CreateIncompleteCholeskyFactorization(int Max //How many diagonals in the decomposition? MaxFillAbove++; //Conceptually, now "fill" includes an existing diagonal. Simpler in the math that follows. - int i, j, mic, fp; + int j, mic, fp; mic = 1; fp = 1; @@ -441,8 +441,8 @@ bool MultiDiagonalSymmetricMatrix::CreateIncompleteCholeskyFactorization(int Max } //It's all initialized? Uhkay. Do the actual math then. - int sss, ss; - int MaxStartRow = StartRows[m - 1]; //Handy number. + int sss; + // int MaxStartRow = StartRows[m - 1]; //Handy number. float **l = ic->Diagonals; float *d = ic->Diagonals[0]; //Describes D in LDLt. int icm = ic->m; diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index 1d5897cc6..285562d17 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -125,7 +125,7 @@ void ImProcFunctions::Median_Denoise(float **src, float **dst, const int width, medBuffer[1] = dst; } - float ** medianIn, ** medianOut; + float ** medianIn, ** medianOut = nullptr; int BufferIndex = 0; for (int iteration = 1; iteration <= iterations; ++iteration) { @@ -454,10 +454,10 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef const bool useNoiseLCurve = (noiseLCurve && noiseLCurve.getSum() >= 7.f); const bool autoch = (settings->leveldnautsimpl == 1 && (dnparams.Cmethod == "AUT" || dnparams.Cmethod == "PRE")) || (settings->leveldnautsimpl == 0 && (dnparams.C2method == "AUTO" || dnparams.C2method == "PREV")); - float** lumcalc; - float* lumcalcBuffer; - float** ccalc; - float* ccalcBuffer; + float** lumcalc = nullptr; + float* lumcalcBuffer = nullptr; + float** ccalc = nullptr; + float* ccalcBuffer = nullptr; bool ponder = false; float ponderCC = 1.f; @@ -518,7 +518,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef ccalc[i] = ccalcBuffer + (i * wid); } - float cn100Precalc; + float cn100Precalc = 0.f; if (useNoiseCCurve) { cn100Precalc = SQR(1.f + ponderCC * (4.f * noiseCCurve[100.f / 60.f])); diff --git a/rtengine/LUT.h b/rtengine/LUT.h index d83a431ca..df95dde7f 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -579,7 +579,7 @@ public: numVals = std::min(numVals, passThrough.getSize()); float mult = dest.size - 1; - for (int i = 0; i < numVals; i++) { + for (unsigned int i = 0; i < numVals; i++) { int hi = (int)(mult * passThrough[i]); dest[hi] += this->data[i] ; } @@ -599,7 +599,7 @@ public: vint sumv = (vint)ZEROV; vfloat avgv = ZEROV; - for(; i < size - 3; i += 4) { + for(; i < static_cast(size) - 3; i += 4) { vint datav = _mm_loadu_si128((__m128i*)&data[i]); sumv += datav; avgv += iv * _mm_cvtepi32_ps(datav); @@ -611,7 +611,7 @@ public: avg = vhadd(avgv); #endif - for (; i < size; i++) { + for (; i < static_cast(size); i++) { T val = data[i]; sum += val; avg += i * val; diff --git a/rtengine/array2D.h b/rtengine/array2D.h index 8a77bfc3c..c05c739dc 100644 --- a/rtengine/array2D.h +++ b/rtengine/array2D.h @@ -113,7 +113,7 @@ public: // use as empty declaration, resize before use! // very useful as a member object array2D() : - x(0), y(0), owner(0), ptr(nullptr), data(nullptr), lock(0), flags(0) + x(0), y(0), owner(0), flags(0), ptr(nullptr), data(nullptr), lock(0) { //printf("got empty array2D init\n"); } diff --git a/rtengine/clutstore.cc b/rtengine/clutstore.cc index 7a5f6fd19..ba117a2fd 100644 --- a/rtengine/clutstore.cc +++ b/rtengine/clutstore.cc @@ -32,7 +32,7 @@ bool loadFile( bool res = false; if (fw == fh) { - unsigned int level = 1; + int level = 1; while (level * level * level < fw) { ++level; diff --git a/rtengine/color.cc b/rtengine/color.cc index 5cf1d45b1..acb50eae5 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -1530,18 +1530,8 @@ void Color::interpolateRGBColor (float realL, float iplow, float iphigh, int alg int toDo, const double xyz_rgb[3][3], const double rgb_xyz[3][3], float &ro, float &go, float &bo) { float X1, Y1, Z1, X2, Y2, Z2, X, Y, Z, XL, YL, ZL; - float L1, L2, LL, a_1, b_1, a_2, b_2, a, b, a_L, b_L; - float c1, c2, h1, h2, cL, hL; - float RR, GG, BB; - float Lr; - float slc = 0.f; - float hh = 0.f; - float ll = 0.f; - float sh = 0.f; - bool LCH = false; + float L1 = 0.f, L2, LL, a_1 = 0.f, b_1 = 0.f, a_2, b_2, a_L, b_L; - float ha, hb, hc, ba; - float c_1, h_1; // converting color 1 to Lab (image) Color::rgbxyz(r1, g1, b1, X1, Y1, Z1, xyz_rgb); @@ -1566,19 +1556,16 @@ void Color::interpolateRGBColor (float realL, float iplow, float iphigh, int alg X2 = x2; Y2 = y2; Z2 = z2; - float c_2, h_2; if(algm == 1 ) { Color::XYZ2Lab(X2, Y2, Z2, L2, a_2, b_2); //Color::Lab2Lch(a_2, b_2, c_2, h_2) ; } - float bal, balH, cal, calH, calm; - bal = balH = balance; + float cal, calH, calm; cal = calH = calm = 1.f - chromat; float med = 1.f; float medH = 0.f; - float medL = (iphigh + iplow) / 2.f; float calan; calan = chromat; @@ -1589,19 +1576,6 @@ void Color::interpolateRGBColor (float realL, float iplow, float iphigh, int alg if(twoc == 0) { // 2 colours calan = chromat; - //calculate new balance in function of (arbitrary) "med".. I hope no error !! - if (realL > iplow && realL <= med) { - bal = realL * balance / (iplow - med) - med * balance / (iplow - med); - } else if (realL <= iplow) { - bal = realL * balance / iplow; - } - - if (realL > medH && realL <= iphigh) { - balH = realL * balance / (iphigh - medH) - medH * balance / (iphigh - medH); - } else if (realL > iphigh) { - balH = realL * balance * (iphigh - 1.f) - balance * (iphigh - 1.f); - } - //calculate new balance chroma if (realL > iplow && realL <= med) { cal = realL * calan / (iplow - med) - med * calan / (iplow - med); @@ -1616,8 +1590,7 @@ void Color::interpolateRGBColor (float realL, float iplow, float iphigh, int alg } } - float hX = 0.f; - float hLL, hH, ccL, ccH, llH, aaH, bbH; + float aaH, bbH; if(algm <= 1) { if(twoc == 0 && metchrom == 3) { // 2 colours only with special "ab" @@ -1639,8 +1612,6 @@ void Color::interpolateRGBColor (float realL, float iplow, float iphigh, int alg b_1 = b_1 + (b_2 - b_1) * calby * balance; } } - } else { - h1 = hX; } Color::Lab2XYZ(L1, a_1, b_1, X, Y, Z); diff --git a/rtengine/curves.cc b/rtengine/curves.cc index a4c35b90e..60f8b14d2 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -44,8 +44,7 @@ using namespace std; namespace rtengine { - -Curve::Curve () : N (0), ppn (0), x (nullptr), y (nullptr), mc (0.0), mfc (0.0), msc (0.0), mhc (0.0), ypp (nullptr), x1 (0.0), y1 (0.0), x2 (0.0), y2 (0.0), x3 (0.0), y3 (0.0), firstPointIncluded (false), increment (0.0), nbr_points (0), hashSize (1000 /* has to be initialized to the maximum value */) {} +Curve::Curve () : N (0), ppn (0), x (nullptr), y (nullptr), mc (0.0), mfc (0.0), msc (0.0), mhc (0.0), hashSize (1000 /* has to be initialized to the maximum value */), ypp (nullptr), x1 (0.0), y1 (0.0), x2 (0.0), y2 (0.0), x3 (0.0), y3 (0.0), firstPointIncluded (false), increment (0.0), nbr_points (0) {} void Curve::AddPolygons () { @@ -104,7 +103,7 @@ void Curve::fillHash() milestone = 0.; polyIter = 0; - for (unsigned int i = 0; i < (hashSize + 1);) { + for (unsigned int i = 0; i < hashSize + 1u;) { while (poly_x[polyIter] < (milestone + increment)) { ++polyIter; } @@ -1732,7 +1731,7 @@ void ColorGradientCurve::SetXYZ (const Curve *pCurve, const double xyz_rgb[3][3] } float r, g, b, xx, yy, zz; - float lr1, lr2; + float lr1, lr2 = 0.f; int upperBound = lut1.getUpperBound(); if (pCurve->isIdentity()) { @@ -2121,7 +2120,7 @@ float PerceptualToneCurve::get_curve_val (float x, float range[2], float lut[], int idx = (int)xm; - if (idx >= lut_size - 1) { + if (idx >= static_cast (lut_size) - 1) { return lut[lut_size - 1]; } @@ -2146,7 +2145,7 @@ float PerceptualToneCurve::calculateToneCurveContrastValue() const const float xd = 0.07; const float tx[] = { 0.30, 0.35, 0.40, 0.45 }; // we only look in the midtone range - for (int i = 0; i < sizeof (tx) / sizeof (tx[0]); i++) { + for (size_t i = 0; i < sizeof (tx) / sizeof (tx[0]); i++) { float x0 = tx[i] - xd; float y0 = CurveFactory::gamma2 (lutToneCurve[CurveFactory::igamma2 (x0) * 65535.f] / 65535.f) - k * x0; float x1 = tx[i] + xd; @@ -2163,7 +2162,7 @@ float PerceptualToneCurve::calculateToneCurveContrastValue() const { const float tx[] = { 0.20, 0.25, 0.50, 0.55 }; // we only look in the midtone range - for (int i = 0; i < sizeof (tx) / sizeof (tx[0]); i++) { + for (size_t i = 0; i < sizeof (tx) / sizeof (tx[0]); i++) { float x0 = tx[i] - xd; float y0 = CurveFactory::gamma2 (lutToneCurve[CurveFactory::igamma2 (x0) * 65535.f] / 65535.f) - k * x0; float x1 = tx[i] + xd; @@ -2496,8 +2495,8 @@ void PerceptualToneCurve::initApplyState (PerceptualToneCurveState & state, Glib state.isProphoto = true; } else { state.isProphoto = false; - TMatrix Work = ICCStore::getInstance()->workingSpaceMatrix(workingSpace); - memset(state.Working2Prophoto, 0, sizeof(state.Working2Prophoto)); + TMatrix Work = ICCStore::getInstance()->workingSpaceMatrix (workingSpace); + memset (state.Working2Prophoto, 0, sizeof (state.Working2Prophoto)); for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) @@ -2506,7 +2505,7 @@ void PerceptualToneCurve::initApplyState (PerceptualToneCurveState & state, Glib } Work = ICCStore::getInstance()->workingSpaceInverseMatrix (workingSpace); - memset(state.Prophoto2Working, 0, sizeof(state.Prophoto2Working)); + memset (state.Prophoto2Working, 0, sizeof (state.Prophoto2Working)); for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index 57e25691f..ad0621ce0 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -309,8 +309,6 @@ double xyCoordToTemperature(const std::array& white_xy) { 600, 0.33724, 0.36051, -116.45 } }; - constexpr double tint_scale = -3000.0; - double res = 0; // Convert to uv space. @@ -847,7 +845,7 @@ DCPProfile::DCPProfile(const Glib::ustring& filename) : // Saturation maps. Need to be unwinded. tag = tagDir->getTag(toUnderlying(TagKey::PROFILE_HUE_SAT_MAP_DATA_2)); - for (int i = 0; i < delta_info.array_count; ++i) { + for (unsigned int i = 0; i < delta_info.array_count; ++i) { deltas_2[i].hue_shift = tag->toDouble((i * 3) * tiff_float_size); deltas_2[i].sat_scale = tag->toDouble((i * 3 + 1) * tiff_float_size); deltas_2[i].val_scale = tag->toDouble((i * 3 + 2) * tiff_float_size); diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index c1d2e670a..eca373337 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -1,3 +1,14 @@ +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" +#pragma GCC diagnostic ignored "-Wsign-compare" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wparentheses" +#if (__GNUC__ == 6) +#pragma GCC diagnostic ignored "-Wmisleading-indentation" +#endif +#endif + /*RT*/#include /*RT*/#include /*RT*/#undef MAX @@ -251,7 +262,11 @@ void CLASS derror() if (feof(ifp)) fprintf (stderr,_("Unexpected end of file\n")); else +#ifdef WIN32 + fprintf (stderr,_("Corrupt data near 0x%I64x\n"), (INT64) ftello(ifp)); +#else fprintf (stderr,_("Corrupt data near 0x%llx\n"), (INT64) ftello(ifp)); +#endif } data_error++; /*RT Issue 2467 longjmp (failure, 1);*/ @@ -1840,8 +1855,8 @@ void CLASS parse_hasselblad_gain() not be seen as clipped). */ - ushort raw_h, count, ch_count, u16; - int i, offset; + ushort raw_h; + int offset; off_t base; base = ftell(ifp); @@ -4511,6 +4526,7 @@ void CLASS colorcheck() // free (fimg); //} +/* void CLASS scale_colors() { unsigned bottom, right, size, row, col, ur, uc, i, x, y, c, sum[8]; @@ -4626,6 +4642,7 @@ skip_block: ; } } +*/ void CLASS pre_interpolate() { ushort (*img)[4]; @@ -5897,7 +5914,7 @@ int CLASS parse_tiff_ifd (int base) break; case 33422: /* CFAPattern */ if (filters == 9) { - FORC(36) ((char *)xtrans)[c] = fgetc(ifp) & 3; + FORC(36) ((int *)xtrans)[c] = fgetc(ifp) & 3; break; } case 64777: /* Kodak P-series */ @@ -9020,7 +9037,7 @@ canon_a5: } if (fuji_layout) raw_width *= is_raw; if (filters == 9) - FORC(36) ((char *)xtrans)[c] = + FORC(36) ((int *)xtrans)[c] = xtrans_abs[(c/6+top_margin) % 6][(c+left_margin) % 6]; } else if (!strcmp(model,"KD-400Z")) { height = 1712; @@ -9492,7 +9509,7 @@ dng_skip: adobe_coeff (make, model); if(!strncmp(make, "Samsung", 7) && !strncmp(model, "NX1",3)) adobe_coeff (make, model); - if(!strncmp(make, "Pentax", 6) && (!strncmp(model, "K10D",4) || !strncmp(model, "K-70",4) || !strncmp(model, "K-1",3))) + if((!strncmp(make, "Pentax", 6) && (!strncmp(model, "K10D",4) || !strncmp(model, "K-70",4) || !strncmp(model, "K-1",3))) && filters != 0) adobe_coeff (make, model); if(!strncmp(make, "Leica", 5) && !strncmp(model, "Q",1)) adobe_coeff (make, model); @@ -9881,3 +9898,6 @@ struct tiff_hdr { /*RT*/#undef LIM /*RT*/#undef ULIM /*RT*/#undef CLIP +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif \ No newline at end of file diff --git a/rtengine/dcraw.h b/rtengine/dcraw.h index 3c5719db8..6a1a83391 100644 --- a/rtengine/dcraw.h +++ b/rtengine/dcraw.h @@ -76,7 +76,8 @@ protected: FILE *ofp; short order; const char *ifname; - char *meta_data, xtrans[6][6],xtrans_abs[6][6]; + char *meta_data; + int xtrans[6][6],xtrans_abs[6][6]; char cdesc[5], desc[512], make[64], model[64], model2[64], model3[64], artist[64]; float flash_used, canon_ev, iso_speed, shutter, aperture, focal_len; time_t timestamp; @@ -409,23 +410,10 @@ void foveon_make_curves(short **curvep, float dq[3], float div[3], float filt); int foveon_apply_curve (short *curve, int i); void foveon_interpolate(); -//void xtrans_interpolate (int passes); -//void cielab (ushort rgb[3], short lab[3]); - -//void remove_zeroes(); -//void bad_pixels (const char *cfname); -//void subtract (const char *fname); void gamma_curve (double pwr, double ts, int mode, int imax); void pseudoinverse (double (*in)[3], double (*out)[3], int size); void cam_xyz_coeff (float rgb_cam[3][4], double cam_xyz[4][3]); -//void hat_transform (float *temp, float *base, int st, int size, int sc); -//void wavelet_denoise(); -void scale_colors(); void pre_interpolate(); -//void border_interpolate (int border); -//void median_filter(); -//void blend_highlights(); -//void recover_highlights(); void crop_masked_pixels(); void tiff_get (unsigned base, unsigned *tag, unsigned *type, unsigned *len, unsigned *save); diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index e8c8e7ba5..db68396fb 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -1568,10 +1568,15 @@ void Crop::freeAll () } -namespace { - -bool check_need_larger_crop_for_lcp_distortion(const ProcParams ¶ms) +namespace { + +bool check_need_larger_crop_for_lcp_distortion (int fw, int fh, int x, int y, int w, int h, const ProcParams ¶ms) +{ + if (x == 0 && y == 0 && w == fw && h == fh) { + return false; + } + return (params.lensProf.lcpFile.length() > 0 && params.lensProf.useDist); } @@ -1625,35 +1630,39 @@ bool Crop::setCropSizes (int rcx, int rcy, int rcw, int rch, int skip, bool inte // determine which part of the source image is required to compute the crop rectangle int orx, ory, orw, orh; + orx = bx1; + ory = by1; + orw = bw; + orh = bh; ProcParams& params = parent->params; + parent->ipf.transCoord (parent->fw, parent->fh, bx1, by1, bw, bh, orx, ory, orw, orh); + if (check_need_larger_crop_for_lcp_distortion (parent->fw, parent->fh, orx, ory, orw, orh, parent->params)) { + double dW = double (parent->fw) * 0.15 / skip; // TODO - this is hardcoded ATM! + double dH = double (parent->fh) * 0.15 / skip; // this is an estimate of the max + // distortion relative to the image + // size. BUT IS 15% REALLY ENOUGH? + // In fact, is there a better way?? + orx = max (int (orx - dW / 2.0), 0); + ory = max (int (ory - dH / 2.0), 0); + orw = min (int (orw + dW), parent->fw - orx); + orh = min (int (orh + dH), parent->fh - ory); + } + + PreviewProps cp (orx, ory, orw, orh, skip); int orW, orH; parent->imgsrc->getSize (cp, orW, orH); - if (check_need_larger_crop_for_lcp_distortion(parent->params)) { - int fW, fH; - parent->imgsrc->getFullSize(fW, fH); - double dW = double(fW) * 0.15; // TODO - this is hardcoded ATM! - double dH = double(fH) * 0.15; // this is an estimate of the max - // distortion relative to the image - // size. BUT IS 15% REALLY ENOUGH? - // In fact, is there a better way?? - orW = min(int(orW + dW), fW); - orH = min(int(orH + dH), fH); - trafx = max(int(orx - dW/2.0), 0); - trafy = max(int(ory - dH/2.0), 0); - } else { - trafx = orx; - trafy = ory; - } + trafx = orx; + trafy = ory; - int cw = skips(bw, skip); - int ch = skips(bh, skip); + int cw = skips (bw, skip); + int ch = skips (bh, skip); - leftBorder = skips(rqx1 - bx1, skip); - upperBorder = skips(rqy1 - by1, skip); + leftBorder = skips (rqx1 - bx1, skip); + upperBorder = skips (rqy1 - by1, skip); if (settings->verbose) { printf ("setsizes starts (%d, %d, %d, %d, %d, %d)\n", orW, orH, trafw, trafh, cw, ch); diff --git a/rtengine/demosaic_algos.cc b/rtengine/demosaic_algos.cc index 877df35a4..847af784f 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -1,4 +1,3 @@ -/* /* * This file is part of RawTherapee. * @@ -602,7 +601,7 @@ void RawImageSource::vng4_demosaic () const unsigned prefilters = ri->prefilters; const int width = W, height = H; - const int colors = 4; + constexpr unsigned int colors = 4; float (*image)[4]; image = (float (*)[4]) calloc (height * width, sizeof * image); @@ -648,7 +647,7 @@ void RawImageSource::vng4_demosaic () int colcount = 0; - for (int c = 0; c < colors; c++) + for (unsigned int c = 0; c < colors; c++) if (c != fc(row, col)) { *ip++ = c; csum[row][col][colcount] = sum[c]; @@ -671,7 +670,7 @@ void RawImageSource::vng4_demosaic () sum[ip[1]] += pix[ip[0]] * mul[row & 15][col & 15][i]; } - for (int i = 0; i < colors - 1; i++, ip++) { + for (unsigned int i = 0; i < colors - 1; i++, ip++) { pix[ip[0]] = sum[ip[0]] / csum[row & 15][col & 15][i]; } } @@ -694,7 +693,7 @@ void RawImageSource::vng4_demosaic () int x2 = *cp++; int weight = *cp++; int grads = *cp++; - int color = fc(row + y1, col + x1); + unsigned int color = fc(row + y1, col + x1); if (fc(row + y2, col + x2) != color) { continue; @@ -724,7 +723,7 @@ void RawImageSource::vng4_demosaic () int y = *cp++; int x = *cp++; *ip++ = (y * width + x) * 4; - int color = fc(row, col); + unsigned int color = fc(row, col); if (fc(row + y, col + x) != color && fc(row + y * 2, col + x * 2) == color) { *ip++ = (y * width + x) * 8 + color; @@ -878,7 +877,7 @@ void RawImageSource::vng4_demosaic () #define fc(row,col) \ (ri->get_filters() >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3) -#define FORCC for (int c=0; c < colors; c++) +#define FORCC for (unsigned int c=0; c < colors; c++) /* Patterned Pixel Grouping Interpolation by Alain Desbiolles @@ -887,7 +886,7 @@ void RawImageSource::ppg_demosaic() { int width = W, height = H; int dir[5] = { 1, width, -1, -width, 1 }; - int row, col, diff[2], guess[2], c, d, i; + int row, col, diff[2] = {}, guess[2], c, d, i; float (*pix)[4]; float (*image)[4]; @@ -998,7 +997,7 @@ void RawImageSource::ppg_demosaic() void RawImageSource::border_interpolate(unsigned int border, float (*image)[4], unsigned int start, unsigned int end) { - unsigned row, col, y, x, f, c, sum[8]; + unsigned row, col, y, x, f, sum[8]; unsigned int width = W, height = H; unsigned int colors = 3; @@ -1338,8 +1337,8 @@ SSEFUNCTION void RawImageSource::lmmse_interpolate_omp(int winw, int winh, array h2 /= hs; h3 /= hs; h4 /= hs; - int passref; - int iter; + int passref = 0; + int iter = 0; if(iterations <= 4) { iter = iterations - 1; @@ -2631,7 +2630,7 @@ void RawImageSource::ahd_demosaic(int winx, int winy, int winw, int winh) int width = W, height = H; float (*image)[4]; - int colors = 3; + unsigned int colors = 3; const double xyz_rgb[3][3] = { /* XYZ from RGB */ { 0.412453, 0.357580, 0.180423 }, @@ -2661,7 +2660,7 @@ void RawImageSource::ahd_demosaic(int winx, int winy, int winw, int winh) } for (i = 0; i < 3; i++) - for (j = 0; j < colors; j++) + for (unsigned int j = 0; j < colors; j++) for (xyz_cam[i][j] = k = 0; k < 3; k++) { xyz_cam[i][j] += xyz_rgb[i][k] * imatrices.rgb_cam[k][j] / d65_white[i]; } @@ -3293,12 +3292,12 @@ void RawImageSource::fill_raw( float (*cache )[3], int x0, int y0, float** rawDa void RawImageSource::fill_border( float (*cache )[3], int border, int x0, int y0) { - unsigned row, col, y, x, f, c; + unsigned f; float sum[8]; - const unsigned int colors = 3; // used in FORCC + constexpr unsigned int colors = 3; // used in FORCC - for (row = y0; row < y0 + TILESIZE + TILEBORDER && row < H; row++) { - for (col = x0; col < x0 + TILESIZE + TILEBORDER && col < W; col++) { + for (int row = y0; row < y0 + TILESIZE + TILEBORDER && row < H; row++) { + for (int col = x0; col < x0 + TILESIZE + TILEBORDER && col < W; col++) { if (col >= border && col < W - border && row >= border && row < H - border) { col = W - border; @@ -3309,8 +3308,8 @@ void RawImageSource::fill_border( float (*cache )[3], int border, int x0, int y0 memset(sum, 0, sizeof sum); - for (y = row - 1; y != row + 2; y++) - for (x = col - 1; x != col + 2; x++) + for (int y = row - 1; y != row + 2; y++) + for (int x = col - 1; x != col + 2; x++) if (y < H && y < y0 + TILESIZE + TILEBORDER && x < W && x < x0 + TILESIZE + TILEBORDER) { f = fc(y, x); sum[f] += cache[(y - y0 + TILEBORDER) * CACHESIZE + TILEBORDER + x - x0][f]; @@ -3361,13 +3360,13 @@ void RawImageSource::restore_from_buffer(float (*image)[3], float (*buffer)[2]) void RawImageSource::dcb_hid(float (*image)[3], int x0, int y0) { const int u = CACHESIZE; - int rowMin, colMin, rowMax, colMax, c; + int rowMin, colMin, rowMax, colMax; dcb_initTileLimits(colMin, rowMin, colMax, rowMax, x0, y0, 2); // simple green bilinear in R and B pixels for (int row = rowMin; row < rowMax; row++) - for (int col = colMin + (FC(y0 - TILEBORDER + row, x0 - TILEBORDER + colMin) & 1), indx = row * CACHESIZE + col, c = FC(y0 - TILEBORDER + row, x0 - TILEBORDER + col); col < colMax; col += 2, indx += 2) { - assert(indx - u - 1 >= 0 && indx + u + 1 < u * u && c >= 0 && c < 3); + for (int col = colMin + (FC(y0 - TILEBORDER + row, x0 - TILEBORDER + colMin) & 1), indx = row * CACHESIZE + col; col < colMax; col += 2, indx += 2) { + assert(indx - u - 1 >= 0 && indx + u + 1 < u * u); image[indx][1] = 0.25*(image[indx-1][1]+image[indx+1][1]+image[indx-u][1]+image[indx+u][1]); } @@ -3418,13 +3417,13 @@ void RawImageSource::dcb_color(float (*image)[3], int x0, int y0) // green correction void RawImageSource::dcb_hid2(float (*image)[3], int x0, int y0) { - const int u = CACHESIZE, v = 2 * CACHESIZE; + const int v = 2 * CACHESIZE; int rowMin, colMin, rowMax, colMax; dcb_initTileLimits(colMin, rowMin, colMax, rowMax, x0, y0, 2); for (int row = rowMin; row < rowMax; row++) { for (int col = colMin + (FC(y0 - TILEBORDER + row, x0 - TILEBORDER + colMin) & 1), indx = row * CACHESIZE + col, c = FC(y0 - TILEBORDER + row, x0 - TILEBORDER + col); col < colMax; col += 2, indx += 2) { - assert(indx - v >= 0 && indx + v < u * u); + assert(indx - v >= 0 && indx + v < CACHESIZE * CACHESIZE); //Jacek comment: one multiplication less image[indx][1] = image[indx][c] + @@ -3592,11 +3591,11 @@ void RawImageSource::dcb_correction2(float (*image)[3], uint8_t *map, int x0, in // image refinement void RawImageSource::dcb_refinement(float (*image)[3], uint8_t *map, int x0, int y0) { - const int u = CACHESIZE, v = 2 * CACHESIZE, w = 3 * CACHESIZE; + const int u = CACHESIZE, v = 2 * CACHESIZE; int rowMin, colMin, rowMax, colMax; dcb_initTileLimits(colMin, rowMin, colMax, rowMax, x0, y0, 4); - float f0, f1, f2, g1, h0, h1, h2, g2, current; + float f0, f1, f2, g1, h0, h1, h2, g2; for (int row = rowMin; row < rowMax; row++) for (int col = colMin + (FC(y0 - TILEBORDER + row, x0 - TILEBORDER + colMin) & 1), indx = row * CACHESIZE + col, c = FC(y0 - TILEBORDER + row, x0 - TILEBORDER + col); col < colMax; col += 2, indx += 2) { @@ -3937,7 +3936,7 @@ void RawImageSource::xtransborder_interpolate (int border) { const int height = H, width = W; - char xtrans[6][6]; + int xtrans[6][6]; ri->getXtransMatrix(xtrans); for (int row = 0; row < height; row++) @@ -4001,7 +4000,7 @@ void RawImageSource::xtrans_interpolate (const int passes, const bool useCieLab) plistener->setProgress (progress); } - char xtrans[6][6]; + int xtrans[6][6]; ri->getXtransMatrix(xtrans); constexpr short orth[12] = { 1, 0, 0, 1, -1, 0, 0, -1, 1, 0, 0, 1 }, @@ -4012,7 +4011,7 @@ void RawImageSource::xtrans_interpolate (const int passes, const bool useCieLab) // sgrow/sgcol is the offset in the sensor matrix of the solitary // green pixels - ushort sgrow, sgcol; + ushort sgrow = 0, sgcol = 0; const int height = H, width = W; @@ -4721,17 +4720,16 @@ void RawImageSource::xtrans_interpolate (const int passes, const bool useCieLab) /* Average the most homogeneous pixels for the final result: */ - uint8_t hm[8]; + uint8_t hm[8] = {}; for (int row = MIN(top, 8); row < mrow - 8; row++) for (int col = MIN(left, 8); col < mcol - 8; col++) { - int d = 0; - for (; d < 4; d++) { + for (int d = 0; d < 4; d++) { hm[d] = homosum[d][row][col]; } - for (; d < ndir; d++) { + for (int d = 4; d < ndir; d++) { hm[d] = homosum[d][row][col]; if (hm[d - 4] < hm[d]) { @@ -4745,7 +4743,7 @@ void RawImageSource::xtrans_interpolate (const int passes, const bool useCieLab) uint8_t maxval = homosummax[row][col]; - for (d = 0; d < ndir; d++) + for (int d = 0; d < ndir; d++) if (hm[d] >= maxval) { FORC3 avg[c] += rgb[d][row][col][c]; avg[3]++; @@ -4792,7 +4790,7 @@ void RawImageSource::fast_xtrans_interpolate () const int height = H, width = W; xtransborder_interpolate (1); - char xtrans[6][6]; + int xtrans[6][6]; ri->getXtransMatrix(xtrans); #pragma omp parallel for diff --git a/rtengine/diagonalcurves.cc b/rtengine/diagonalcurves.cc index 2178e3dac..9ab17a0f4 100644 --- a/rtengine/diagonalcurves.cc +++ b/rtengine/diagonalcurves.cc @@ -241,8 +241,8 @@ void DiagonalCurve::NURBS_set () nbr_points = (int)(((double)(ppn + N - 2) * sc_length[i / 3] ) / total_length); if (nbr_points < 0) { - for(size_t it = 0; it < sc_x.size(); it += 3) { - printf("sc_length[%zu/3]=%f \n", it, sc_length[it / 3]); + for(unsigned int it = 0; it < sc_x.size(); it += 3) { // used unsigned int instead of size_t to avoid %zu in printf + printf("sc_length[%u/3]=%f \n", it, sc_length[it / 3]); } printf("NURBS diagonal curve: error detected!\n i=%u nbr_points=%d ppn=%d N=%d sc_length[i/3]=%f total_length=%f", i, nbr_points, ppn, N, sc_length[i / 3], total_length); diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index e5aced0fc..1ebc0b5e5 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -55,40 +55,40 @@ extern const Settings* settings; //sequence of scales -SSEFUNCTION void ImProcFunctions :: dirpyr_equalizer(float ** src, float ** dst, int srcwidth, int srcheight, float ** l_a, float ** l_b, float ** dest_a, float ** dest_b, const double * mult, const double dirpyrThreshold, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scaleprev) +SSEFUNCTION void ImProcFunctions :: dirpyr_equalizer (float ** src, float ** dst, int srcwidth, int srcheight, float ** l_a, float ** l_b, float ** dest_a, float ** dest_b, const double * mult, const double dirpyrThreshold, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scaleprev) { int lastlevel = maxlevel; - if(settings->verbose) { - printf("Dirpyr scaleprev=%i\n", scaleprev); + if (settings->verbose) { + printf ("Dirpyr scaleprev=%i\n", scaleprev); } float atten123 = (float) settings->level123_cbdl; - if(atten123 > 50.f) { + if (atten123 > 50.f) { atten123 = 50.f; } - if(atten123 < 0.f) { + if (atten123 < 0.f) { atten123 = 0.f; } float atten0 = (float) settings->level0_cbdl; - if(atten0 > 40.f) { + if (atten0 > 40.f) { atten123 = 40.f; } - if(atten0 < 0.f) { + if (atten0 < 0.f) { atten0 = 0.f; } - if((t_r - t_l) < 0.55f) { + if ((t_r - t_l) < 0.55f) { t_l = t_r + 0.55f; //avoid too small range } - while (lastlevel > 0 && fabs(mult[lastlevel - 1] - 1) < 0.001) { + while (lastlevel > 0 && fabs (mult[lastlevel - 1] - 1) < 0.001) { lastlevel--; //printf("last level to process %d \n",lastlevel); } @@ -101,17 +101,17 @@ SSEFUNCTION void ImProcFunctions :: dirpyr_equalizer(float ** src, float ** dst, float multi[6] = {1.f, 1.f, 1.f, 1.f, 1.f, 1.f}; float scalefl[6]; - for(int lv = 0; lv < 6; lv++) { + for (int lv = 0; lv < 6; lv++) { scalefl[lv] = ((float) scales[lv]) / (float) scaleprev; - if(lv >= 1) { - if(scalefl[lv] < 1.f) { + if (lv >= 1) { + if (scalefl[lv] < 1.f) { multi[lv] = (atten123 * ((float) mult[lv] - 1.f) / 100.f) + 1.f; //modulate action if zoom < 100% } else { multi[lv] = (float) mult[lv]; } } else { - if(scalefl[lv] < 1.f) { + if (scalefl[lv] < 1.f) { multi[lv] = (atten0 * ((float) mult[lv] - 1.f) / 100.f) + 1.f; //modulate action if zoom < 100% } else { multi[lv] = (float) mult[lv]; @@ -120,8 +120,8 @@ SSEFUNCTION void ImProcFunctions :: dirpyr_equalizer(float ** src, float ** dst, } - if(settings->verbose) { - printf("CbDL mult0=%f 1=%f 2=%f 3=%f 4=%f 5=%f\n", multi[0], multi[1], multi[2], multi[3], multi[4], multi[5]); + if (settings->verbose) { + printf ("CbDL mult0=%f 1=%f 2=%f 3=%f 4=%f 5=%f\n", multi[0], multi[1], multi[2], multi[3], multi[4], multi[5]); } multi_array2D dirpyrlo (srcwidth, srcheight); @@ -129,33 +129,33 @@ SSEFUNCTION void ImProcFunctions :: dirpyr_equalizer(float ** src, float ** dst, level = 0; //int thresh = 100 * mult[5]; - int scale = (int)(scales[level]) / scaleprev; + int scale = (int) (scales[level]) / scaleprev; - if(scale < 1) { + if (scale < 1) { scale = 1; } - dirpyr_channel(src, dirpyrlo[0], srcwidth, srcheight, 0, scale); + dirpyr_channel (src, dirpyrlo[0], srcwidth, srcheight, 0, scale); level = 1; - while(level < lastlevel) { + while (level < lastlevel) { - scale = (int)(scales[level]) / scaleprev; + scale = (int) (scales[level]) / scaleprev; - if(scale < 1) { + if (scale < 1) { scale = 1; } - dirpyr_channel(dirpyrlo[level - 1], dirpyrlo[level], srcwidth, srcheight, level, scale); + dirpyr_channel (dirpyrlo[level - 1], dirpyrlo[level], srcwidth, srcheight, level, scale); level ++; } - float **tmpHue, **tmpChr; + float **tmpHue = nullptr, **tmpChr = nullptr; - if(skinprot != 0.f) { + if (skinprot != 0.f) { // precalculate hue and chroma, use SSE, if available // by precalculating these values we can greatly reduce the number of calculations in idirpyr_eq_channel() // but we need two additional buffers for this preprocessing @@ -168,24 +168,24 @@ SSEFUNCTION void ImProcFunctions :: dirpyr_equalizer(float ** src, float ** dst, #ifdef __SSE2__ #pragma omp parallel for - for(int i = 0; i < srcheight; i++) { + for (int i = 0; i < srcheight; i++) { int j; - for(j = 0; j < srcwidth - 3; j += 4) { - _mm_storeu_ps(&tmpHue[i][j], xatan2f(LVFU(l_b[i][j]), LVFU(l_a[i][j]))); + for (j = 0; j < srcwidth - 3; j += 4) { + _mm_storeu_ps (&tmpHue[i][j], xatan2f (LVFU (l_b[i][j]), LVFU (l_a[i][j]))); } - for(; j < srcwidth; j++) { - tmpHue[i][j] = xatan2f(l_b[i][j], l_a[i][j]); + for (; j < srcwidth; j++) { + tmpHue[i][j] = xatan2f (l_b[i][j], l_a[i][j]); } } #else #pragma omp parallel for - for(int i = 0; i < srcheight; i++) { - for(int j = 0; j < srcwidth; j++) { - tmpHue[i][j] = xatan2f(l_b[i][j], l_a[i][j]); + for (int i = 0; i < srcheight; i++) { + for (int j = 0; j < srcwidth; j++) { + tmpHue[i][j] = xatan2f (l_b[i][j], l_a[i][j]); } } @@ -199,27 +199,27 @@ SSEFUNCTION void ImProcFunctions :: dirpyr_equalizer(float ** src, float ** dst, #ifdef __SSE2__ #pragma omp parallel { - __m128 div = _mm_set1_ps(327.68f); + __m128 div = _mm_set1_ps (327.68f); #pragma omp for - for(int i = 0; i < srcheight; i++) { + for (int i = 0; i < srcheight; i++) { int j; - for(j = 0; j < srcwidth - 3; j += 4) { - _mm_storeu_ps(&tmpChr[i][j], _mm_sqrt_ps(SQRV(LVFU(l_b[i][j])) + SQRV(LVFU(l_a[i][j]))) / div); + for (j = 0; j < srcwidth - 3; j += 4) { + _mm_storeu_ps (&tmpChr[i][j], _mm_sqrt_ps (SQRV (LVFU (l_b[i][j])) + SQRV (LVFU (l_a[i][j]))) / div); } - for(; j < srcwidth; j++) { - tmpChr[i][j] = sqrtf(SQR((l_b[i][j])) + SQR((l_a[i][j]))) / 327.68f; + for (; j < srcwidth; j++) { + tmpChr[i][j] = sqrtf (SQR ((l_b[i][j])) + SQR ((l_a[i][j]))) / 327.68f; } } } #else #pragma omp parallel for - for(int i = 0; i < srcheight; i++) { - for(int j = 0; j < srcwidth; j++) { - tmpChr[i][j] = sqrtf(SQR((l_b[i][j])) + SQR((l_a[i][j]))) / 327.68f; + for (int i = 0; i < srcheight; i++) { + for (int j = 0; j < srcwidth; j++) { + tmpChr[i][j] = sqrtf (SQR ((l_b[i][j])) + SQR ((l_a[i][j]))) / 327.68f; } } @@ -229,15 +229,15 @@ SSEFUNCTION void ImProcFunctions :: dirpyr_equalizer(float ** src, float ** dst, // with the current implementation of idirpyr_eq_channel we can safely use the buffer from last level as buffer, saves some memory float ** buffer = dirpyrlo[lastlevel - 1]; - for(int level = lastlevel - 1; level > 0; level--) { - idirpyr_eq_channel(dirpyrlo[level], dirpyrlo[level - 1], buffer, srcwidth, srcheight, level, multi, dirpyrThreshold, tmpHue, tmpChr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice ); + for (int level = lastlevel - 1; level > 0; level--) { + idirpyr_eq_channel (dirpyrlo[level], dirpyrlo[level - 1], buffer, srcwidth, srcheight, level, multi, dirpyrThreshold, tmpHue, tmpChr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice ); } scale = scales[0]; - idirpyr_eq_channel(dirpyrlo[0], dst, buffer, srcwidth, srcheight, 0, multi, dirpyrThreshold, tmpHue, tmpChr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice ); + idirpyr_eq_channel (dirpyrlo[0], dst, buffer, srcwidth, srcheight, 0, multi, dirpyrThreshold, tmpHue, tmpChr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice ); - if(skinprot != 0.f) { + if (skinprot != 0.f) { for (int i = 0; i < srcheight; i++) { delete [] tmpChr[i]; } @@ -256,44 +256,44 @@ SSEFUNCTION void ImProcFunctions :: dirpyr_equalizer(float ** src, float ** dst, for (int i = 0; i < srcheight; i++) for (int j = 0; j < srcwidth; j++) { - dst[i][j] = CLIP(buffer[i][j]); // TODO: Really a clip necessary? + dst[i][j] = CLIP (buffer[i][j]); // TODO: Really a clip necessary? } } -SSEFUNCTION void ImProcFunctions :: cbdl_local_temp(float ** src, float ** dst, float ** loctemp, int srcwidth, int srcheight, const float * mult, const double dirpyrThreshold, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scaleprev) +SSEFUNCTION void ImProcFunctions :: cbdl_local_temp (float ** src, float ** dst, float ** loctemp, int srcwidth, int srcheight, const float * mult, const double dirpyrThreshold, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scaleprev) { int lastlevel = maxlevelloc; - if(settings->verbose) { - printf("Dirpyr scaleprev=%i\n", scaleprev); + if (settings->verbose) { + printf ("Dirpyr scaleprev=%i\n", scaleprev); } float atten123 = (float) settings->level123_cbdl; - if(atten123 > 50.f) { + if (atten123 > 50.f) { atten123 = 50.f; } - if(atten123 < 0.f) { + if (atten123 < 0.f) { atten123 = 0.f; } float atten0 = (float) settings->level0_cbdl; - if(atten0 > 40.f) { + if (atten0 > 40.f) { atten123 = 40.f; } - if(atten0 < 0.f) { + if (atten0 < 0.f) { atten0 = 0.f; } - if((t_r - t_l) < 0.55f) { + if ((t_r - t_l) < 0.55f) { t_l = t_r + 0.55f; //avoid too small range } - while (lastlevel > 0 && fabs(mult[lastlevel - 1] - 1) < 0.001) { + while (lastlevel > 0 && fabs (mult[lastlevel - 1] - 1) < 0.001) { lastlevel--; //printf("last level to process %d \n",lastlevel); @@ -307,17 +307,17 @@ SSEFUNCTION void ImProcFunctions :: cbdl_local_temp(float ** src, float ** dst, float multi[5] = {1.f, 1.f, 1.f, 1.f, 1.f}; float scalefl[5]; - for(int lv = 0; lv < 5; lv++) { + for (int lv = 0; lv < 5; lv++) { scalefl[lv] = ((float) scalesloc[lv]) / (float) scaleprev; - if(lv >= 1) { - if(scalefl[lv] < 1.f) { + if (lv >= 1) { + if (scalefl[lv] < 1.f) { multi[lv] = (atten123 * ((float) mult[lv] - 1.f) / 100.f) + 1.f; //modulate action if zoom < 100% } else { multi[lv] = (float) mult[lv]; } } else { - if(scalefl[lv] < 1.f) { + if (scalefl[lv] < 1.f) { multi[lv] = (atten0 * ((float) mult[lv] - 1.f) / 100.f) + 1.f; //modulate action if zoom < 100% } else { multi[lv] = (float) mult[lv]; @@ -326,8 +326,8 @@ SSEFUNCTION void ImProcFunctions :: cbdl_local_temp(float ** src, float ** dst, } - if(settings->verbose) { - printf("CbDL local mult0=%f 1=%f 2=%f 3=%f 4=%f\n", multi[0], multi[1], multi[2], multi[3], multi[4]); + if (settings->verbose) { + printf ("CbDL local mult0=%f 1=%f 2=%f 3=%f 4=%f\n", multi[0], multi[1], multi[2], multi[3], multi[4]); } multi_array2D dirpyrlo (srcwidth, srcheight); @@ -335,26 +335,26 @@ SSEFUNCTION void ImProcFunctions :: cbdl_local_temp(float ** src, float ** dst, level = 0; //int thresh = 100 * mult[5]; - int scale = (int)(scalesloc[level]) / scaleprev; + int scale = (int) (scalesloc[level]) / scaleprev; - if(scale < 1) { + if (scale < 1) { scale = 1; } - dirpyr_channel(src, dirpyrlo[0], srcwidth, srcheight, 0, scale); + dirpyr_channel (src, dirpyrlo[0], srcwidth, srcheight, 0, scale); level = 1; - while(level < lastlevel) { + while (level < lastlevel) { - scale = (int)(scalesloc[level]) / scaleprev; + scale = (int) (scalesloc[level]) / scaleprev; - if(scale < 1) { + if (scale < 1) { scale = 1; } - dirpyr_channel(dirpyrlo[level - 1], dirpyrlo[level], srcwidth, srcheight, level, scale); + dirpyr_channel (dirpyrlo[level - 1], dirpyrlo[level], srcwidth, srcheight, level, scale); level ++; } @@ -363,20 +363,20 @@ SSEFUNCTION void ImProcFunctions :: cbdl_local_temp(float ** src, float ** dst, // with the current implementation of idirpyr_eq_channel we can safely use the buffer from last level as buffer, saves some memory float ** buffer = dirpyrlo[lastlevel - 1]; - for(int level = lastlevel - 1; level > 0; level--) { - idirpyr_eq_channel_loc(dirpyrlo[level], dirpyrlo[level - 1], loctemp, buffer, srcwidth, srcheight, level, multi, dirpyrThreshold, tmpHue, tmpChr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice ); + for (int level = lastlevel - 1; level > 0; level--) { + idirpyr_eq_channel_loc (dirpyrlo[level], dirpyrlo[level - 1], loctemp, buffer, srcwidth, srcheight, level, multi, dirpyrThreshold, tmpHue, tmpChr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice ); } scale = scalesloc[0]; - idirpyr_eq_channel_loc(dirpyrlo[0], dst, loctemp, buffer, srcwidth, srcheight, 0, multi, dirpyrThreshold, tmpHue, tmpChr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice ); + idirpyr_eq_channel_loc (dirpyrlo[0], dst, loctemp, buffer, srcwidth, srcheight, 0, multi, dirpyrThreshold, tmpHue, tmpChr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice ); //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #pragma omp parallel for for (int i = 0; i < srcheight; i++) for (int j = 0; j < srcwidth; j++) { dst[i][j] = src[i][j]; - loctemp[i][j] = CLIP(buffer[i][j]); // TODO: Really a clip necessary? + loctemp[i][j] = CLIP (buffer[i][j]); // TODO: Really a clip necessary? } } @@ -386,36 +386,36 @@ void ImProcFunctions :: dirpyr_equalizercam (CieImage *ncie, float ** src, float { int lastlevel = maxlevel; - if(settings->verbose) { - printf("CAM dirpyr scaleprev=%i\n", scaleprev); + if (settings->verbose) { + printf ("CAM dirpyr scaleprev=%i\n", scaleprev); } float atten123 = (float) settings->level123_cbdl; - if(atten123 > 50.f) { + if (atten123 > 50.f) { atten123 = 50.f; } - if(atten123 < 0.f) { + if (atten123 < 0.f) { atten123 = 0.f; } // printf("atten=%f\n",atten); float atten0 = (float) settings->level0_cbdl; - if(atten0 > 40.f) { + if (atten0 > 40.f) { atten123 = 40.f; } - if(atten0 < 0.f) { + if (atten0 < 0.f) { atten0 = 0.f; } - if((t_r - t_l) < 0.55f) { + if ((t_r - t_l) < 0.55f) { t_l = t_r + 0.55f; //avoid too small range } - while (fabs(mult[lastlevel - 1] - 1) < 0.001 && lastlevel > 0) { + while (fabs (mult[lastlevel - 1] - 1) < 0.001 && lastlevel > 0) { lastlevel--; //printf("last level to process %d \n",lastlevel); } @@ -429,18 +429,18 @@ void ImProcFunctions :: dirpyr_equalizercam (CieImage *ncie, float ** src, float float multi[6] = {1.f, 1.f, 1.f, 1.f, 1.f, 1.f}; float scalefl[6]; - for(int lv = 0; lv < 6; lv++) { + for (int lv = 0; lv < 6; lv++) { scalefl[lv] = ((float) scales[lv]) / (float) scaleprev; // if(scalefl[lv] < 1.f) multi[lv] = 1.f; else multi[lv]=(float) mult[lv]; if (lv >= 1) { - if(scalefl[lv] < 1.f) { + if (scalefl[lv] < 1.f) { multi[lv] = (atten123 * ((float) mult[lv] - 1.f) / 100.f) + 1.f; } else { multi[lv] = (float) mult[lv]; } } else { - if(scalefl[lv] < 1.f) { + if (scalefl[lv] < 1.f) { multi[lv] = (atten0 * ((float) mult[lv] - 1.f) / 100.f) + 1.f; } else { multi[lv] = (float) mult[lv]; @@ -450,8 +450,8 @@ void ImProcFunctions :: dirpyr_equalizercam (CieImage *ncie, float ** src, float } - if(settings->verbose) { - printf("CAM CbDL mult0=%f 1=%f 2=%f 3=%f 4=%f 5=%f\n", multi[0], multi[1], multi[2], multi[3], multi[4], multi[5]); + if (settings->verbose) { + printf ("CAM CbDL mult0=%f 1=%f 2=%f 3=%f 4=%f 5=%f\n", multi[0], multi[1], multi[2], multi[3], multi[4], multi[5]); } @@ -461,24 +461,24 @@ void ImProcFunctions :: dirpyr_equalizercam (CieImage *ncie, float ** src, float level = 0; - int scale = (int)(scales[level]) / scaleprev; + int scale = (int) (scales[level]) / scaleprev; - if(scale < 1) { + if (scale < 1) { scale = 1; } - dirpyr_channel(src, dirpyrlo[0], srcwidth, srcheight, 0, scale); + dirpyr_channel (src, dirpyrlo[0], srcwidth, srcheight, 0, scale); level = 1; - while(level < lastlevel) { - scale = (int)(scales[level]) / scaleprev; + while (level < lastlevel) { + scale = (int) (scales[level]) / scaleprev; - if(scale < 1) { + if (scale < 1) { scale = 1; } - dirpyr_channel(dirpyrlo[level - 1], dirpyrlo[level], srcwidth, srcheight, level, scale); + dirpyr_channel (dirpyrlo[level - 1], dirpyrlo[level], srcwidth, srcheight, level, scale); level ++; } @@ -487,26 +487,26 @@ void ImProcFunctions :: dirpyr_equalizercam (CieImage *ncie, float ** src, float // with the current implementation of idirpyr_eq_channel we can safely use the buffer from last level as buffer, saves some memory float ** buffer = dirpyrlo[lastlevel - 1]; - for(int level = lastlevel - 1; level > 0; level--) { - idirpyr_eq_channelcam(dirpyrlo[level], dirpyrlo[level - 1], buffer, srcwidth, srcheight, level, multi, dirpyrThreshold , h_p, C_p, skinprot, b_l, t_l, t_r); + for (int level = lastlevel - 1; level > 0; level--) { + idirpyr_eq_channelcam (dirpyrlo[level], dirpyrlo[level - 1], buffer, srcwidth, srcheight, level, multi, dirpyrThreshold , h_p, C_p, skinprot, b_l, t_l, t_r); } scale = scales[0]; - idirpyr_eq_channelcam(dirpyrlo[0], dst, buffer, srcwidth, srcheight, 0, multi, dirpyrThreshold, h_p, C_p, skinprot, b_l, t_l, t_r); + idirpyr_eq_channelcam (dirpyrlo[0], dst, buffer, srcwidth, srcheight, 0, multi, dirpyrThreshold, h_p, C_p, skinprot, b_l, t_l, t_r); //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - if(execdir) { + if (execdir) { #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif for (int i = 0; i < srcheight; i++) for (int j = 0; j < srcwidth; j++) { - if(ncie->J_p[i][j] > 8.f && ncie->J_p[i][j] < 92.f) { - dst[i][j] = CLIP( buffer[i][j] ); // TODO: Really a clip necessary? + if (ncie->J_p[i][j] > 8.f && ncie->J_p[i][j] < 92.f) { + dst[i][j] = CLIP ( buffer[i][j] ); // TODO: Really a clip necessary? } else { dst[i][j] = src[i][j]; } @@ -514,20 +514,20 @@ void ImProcFunctions :: dirpyr_equalizercam (CieImage *ncie, float ** src, float } else for (int i = 0; i < srcheight; i++) for (int j = 0; j < srcwidth; j++) { - dst[i][j] = CLIP( buffer[i][j] ); // TODO: Really a clip necessary? + dst[i][j] = CLIP ( buffer[i][j] ); // TODO: Really a clip necessary? } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% } -SSEFUNCTION void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** data_coarse, int width, int height, int level, int scale) +SSEFUNCTION void ImProcFunctions::dirpyr_channel (float ** data_fine, float ** data_coarse, int width, int height, int level, int scale) { //scale is spacing of directional averaging weights //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // calculate weights, compute directionally weighted average - if(level > 1) { + if (level > 1) { //generate domain kernel int domker[5][5] = {{1, 1, 1, 1, 1}, {1, 2, 2, 2, 1}, {1, 2, 2, 2, 1}, {1, 2, 2, 2, 1}, {1, 1, 1, 1, 1}}; // int domker[5][5] = {{1,1,1,1,1},{1,1,1,1,1},{1,1,1,1,1},{1,1,1,1,1},{1,1,1,1,1}}; @@ -538,7 +538,7 @@ SSEFUNCTION void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** da #endif { #ifdef __SSE2__ - __m128 thousandv = _mm_set1_ps( 1000.0f ); + __m128 thousandv = _mm_set1_ps ( 1000.0f ); __m128 dirwtv, valv, normv, dftemp1v, dftemp2v; // multiplied each value of domkerv by 1000 to avoid multiplication by 1000 inside the loop float domkerv[5][5][4] ALIGNED16 = {{{1000, 1000, 1000, 1000}, {1000, 1000, 1000, 1000}, {1000, 1000, 1000, 1000}, {1000, 1000, 1000, 1000}, {1000, 1000, 1000, 1000}}, {{1000, 1000, 1000, 1000}, {2000, 2000, 2000, 2000}, {2000, 2000, 2000, 2000}, {2000, 2000, 2000, 2000}, {1000, 1000, 1000, 1000}}, {{1000, 1000, 1000, 1000}, {2000, 2000, 2000, 2000}, {2000, 2000, 2000, 2000}, {2000, 2000, 2000, 2000}, {1000, 1000, 1000, 1000}}, {{1000, 1000, 1000, 1000}, {2000, 2000, 2000, 2000}, {2000, 2000, 2000, 2000}, {2000, 2000, 2000, 2000}, {1000, 1000, 1000, 1000}}, {{1000, 1000, 1000, 1000}, {1000, 1000, 1000, 1000}, {1000, 1000, 1000, 1000}, {1000, 1000, 1000, 1000}, {1000, 1000, 1000, 1000}}}; @@ -549,18 +549,18 @@ SSEFUNCTION void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** da #pragma omp for //schedule (dynamic,8) #endif - for(int i = 0; i < height; i++) { + for (int i = 0; i < height; i++) { float dirwt; - for(j = 0; j < scalewin; j++) { + for (j = 0; j < scalewin; j++) { float val = 0.f; float norm = 0.f; - for(int inbr = max(0, i - scalewin); inbr <= min(height - 1, i + scalewin); inbr += scale) { - for (int jnbr = max(0, j - scalewin); jnbr <= j + scalewin; jnbr += scale) { + for (int inbr = max (0, i - scalewin); inbr <= min (height - 1, i + scalewin); inbr += scale) { + for (int jnbr = max (0, j - scalewin); jnbr <= j + scalewin; jnbr += scale) { //printf("i=%d ",(inbr-i)/scale+halfwin); - dirwt = DIRWT(inbr, jnbr, i, j); + dirwt = DIRWT (inbr, jnbr, i, j); val += dirwt * data_fine[inbr][jnbr]; norm += dirwt; } @@ -571,32 +571,32 @@ SSEFUNCTION void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** da #ifdef __SSE2__ - for(; j < width - scalewin - 3; j += 4) { + for (; j < width - scalewin - 3; j += 4) { valv = _mm_setzero_ps(); normv = _mm_setzero_ps(); - dftemp1v = LVFU(data_fine[i][j]); + dftemp1v = LVFU (data_fine[i][j]); - for(int inbr = MAX(0, i - scalewin); inbr <= MIN(height - 1, i + scalewin); inbr += scale) { + for (int inbr = MAX (0, i - scalewin); inbr <= MIN (height - 1, i + scalewin); inbr += scale) { int indexihlp = (inbr - i) / scale + halfwin; for (int jnbr = j - scalewin, indexjhlp = 0; jnbr <= j + scalewin; jnbr += scale, indexjhlp++) { - dftemp2v = LVFU(data_fine[inbr][jnbr]); - dirwtv = LVF(domkerv[indexihlp][indexjhlp]) / (vabsf(dftemp1v - dftemp2v) + thousandv); + dftemp2v = LVFU (data_fine[inbr][jnbr]); + dirwtv = LVF (domkerv[indexihlp][indexjhlp]) / (vabsf (dftemp1v - dftemp2v) + thousandv); valv += dirwtv * dftemp2v; normv += dirwtv; } } - _mm_storeu_ps( &data_coarse[i][j], valv / normv); //low pass filter + _mm_storeu_ps ( &data_coarse[i][j], valv / normv); //low pass filter } - for(; j < width - scalewin; j++) { + for (; j < width - scalewin; j++) { float val = 0.f; float norm = 0.f; - for(int inbr = max(0, i - scalewin); inbr <= min(height - 1, i + scalewin); inbr += scale) { + for (int inbr = max (0, i - scalewin); inbr <= min (height - 1, i + scalewin); inbr += scale) { for (int jnbr = j - scalewin; jnbr <= j + scalewin; jnbr += scale) { - dirwt = DIRWT(inbr, jnbr, i, j); + dirwt = DIRWT (inbr, jnbr, i, j); val += dirwt * data_fine[inbr][jnbr]; norm += dirwt; } @@ -607,13 +607,13 @@ SSEFUNCTION void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** da #else - for(; j < width - scalewin; j++) { + for (; j < width - scalewin; j++) { float val = 0.f; float norm = 0.f; - for(int inbr = max(0, i - scalewin); inbr <= min(height - 1, i + scalewin); inbr += scale) { + for (int inbr = max (0, i - scalewin); inbr <= min (height - 1, i + scalewin); inbr += scale) { for (int jnbr = j - scalewin; jnbr <= j + scalewin; jnbr += scale) { - dirwt = DIRWT(inbr, jnbr, i, j); + dirwt = DIRWT (inbr, jnbr, i, j); val += dirwt * data_fine[inbr][jnbr]; norm += dirwt; } @@ -624,13 +624,13 @@ SSEFUNCTION void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** da #endif - for(; j < width; j++) { + for (; j < width; j++) { float val = 0.f; float norm = 0.f; - for(int inbr = max(0, i - scalewin); inbr <= min(height - 1, i + scalewin); inbr += scale) { - for (int jnbr = j - scalewin; jnbr <= min(width - 1, j + scalewin); jnbr += scale) { - dirwt = DIRWT(inbr, jnbr, i, j); + for (int inbr = max (0, i - scalewin); inbr <= min (height - 1, i + scalewin); inbr += scale) { + for (int jnbr = j - scalewin; jnbr <= min (width - 1, j + scalewin); jnbr += scale) { + dirwt = DIRWT (inbr, jnbr, i, j); val += dirwt * data_fine[inbr][jnbr]; norm += dirwt; } @@ -647,7 +647,7 @@ SSEFUNCTION void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** da #endif { #ifdef __SSE2__ - __m128 thousandv = _mm_set1_ps( 1000.0f ); + __m128 thousandv = _mm_set1_ps ( 1000.0f ); __m128 dirwtv, valv, normv, dftemp1v, dftemp2v; #endif // __SSE2__ int j; @@ -655,17 +655,17 @@ SSEFUNCTION void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** da #pragma omp for schedule(dynamic,16) #endif - for(int i = 0; i < height; i++) + for (int i = 0; i < height; i++) { float dirwt; - for(j = 0; j < scale; j++) { + for (j = 0; j < scale; j++) { float val = 0.f; float norm = 0.f; - for(int inbr = max(0, i - scale); inbr <= min(height - 1, i + scale); inbr += scale) { - for (int jnbr = max(0, j - scale); jnbr <= j + scale; jnbr += scale) { - dirwt = RANGEFN(fabsf(data_fine[inbr][jnbr] - data_fine[i][j])); + for (int inbr = max (0, i - scale); inbr <= min (height - 1, i + scale); inbr += scale) { + for (int jnbr = max (0, j - scale); jnbr <= j + scale; jnbr += scale) { + dirwt = RANGEFN (fabsf (data_fine[inbr][jnbr] - data_fine[i][j])); val += dirwt * data_fine[inbr][jnbr]; norm += dirwt; } @@ -676,30 +676,30 @@ SSEFUNCTION void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** da #ifdef __SSE2__ - for(; j < width - scale - 3; j += 4) { + for (; j < width - scale - 3; j += 4) { valv = _mm_setzero_ps(); normv = _mm_setzero_ps(); - dftemp1v = LVFU(data_fine[i][j]); + dftemp1v = LVFU (data_fine[i][j]); - for(int inbr = MAX(0, i - scale); inbr <= MIN(height - 1, i + scale); inbr += scale) { + for (int inbr = MAX (0, i - scale); inbr <= MIN (height - 1, i + scale); inbr += scale) { for (int jnbr = j - scale; jnbr <= j + scale; jnbr += scale) { - dftemp2v = LVFU(data_fine[inbr][jnbr]); - dirwtv = thousandv / (vabsf(dftemp2v - dftemp1v) + thousandv); + dftemp2v = LVFU (data_fine[inbr][jnbr]); + dirwtv = thousandv / (vabsf (dftemp2v - dftemp1v) + thousandv); valv += dirwtv * dftemp2v; normv += dirwtv; } } - _mm_storeu_ps( &data_coarse[i][j], valv / normv); //low pass filter + _mm_storeu_ps ( &data_coarse[i][j], valv / normv); //low pass filter } - for(; j < width - scale; j++) { + for (; j < width - scale; j++) { float val = 0.f; float norm = 0.f; - for(int inbr = max(0, i - scale); inbr <= min(height - 1, i + scale); inbr += scale) { + for (int inbr = max (0, i - scale); inbr <= min (height - 1, i + scale); inbr += scale) { for (int jnbr = j - scale; jnbr <= j + scale; jnbr += scale) { - dirwt = RANGEFN(fabsf(data_fine[inbr][jnbr] - data_fine[i][j])); + dirwt = RANGEFN (fabsf (data_fine[inbr][jnbr] - data_fine[i][j])); val += dirwt * data_fine[inbr][jnbr]; norm += dirwt; } @@ -710,13 +710,13 @@ SSEFUNCTION void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** da #else - for(; j < width - scale; j++) { + for (; j < width - scale; j++) { float val = 0.f; float norm = 0.f; - for(int inbr = max(0, i - scale); inbr <= min(height - 1, i + scale); inbr += scale) { + for (int inbr = max (0, i - scale); inbr <= min (height - 1, i + scale); inbr += scale) { for (int jnbr = j - scale; jnbr <= j + scale; jnbr += scale) { - dirwt = RANGEFN(fabsf(data_fine[inbr][jnbr] - data_fine[i][j])); + dirwt = RANGEFN (fabsf (data_fine[inbr][jnbr] - data_fine[i][j])); val += dirwt * data_fine[inbr][jnbr]; norm += dirwt; } @@ -727,13 +727,13 @@ SSEFUNCTION void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** da #endif - for(; j < width; j++) { + for (; j < width; j++) { float val = 0.f; float norm = 0.f; - for(int inbr = max(0, i - scale); inbr <= min(height - 1, i + scale); inbr += scale) { - for (int jnbr = j - scale; jnbr <= min(width - 1, j + scale); jnbr += scale) { - dirwt = RANGEFN(fabsf(data_fine[inbr][jnbr] - data_fine[i][j])); + for (int inbr = max (0, i - scale); inbr <= min (height - 1, i + scale); inbr += scale) { + for (int jnbr = j - scale; jnbr <= min (width - 1, j + scale); jnbr += scale) { + dirwt = RANGEFN (fabsf (data_fine[inbr][jnbr] - data_fine[i][j])); val += dirwt * data_fine[inbr][jnbr]; norm += dirwt; } @@ -747,14 +747,14 @@ SSEFUNCTION void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** da } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void ImProcFunctions::idirpyr_eq_channel_loc(float ** data_coarse, float ** data_fine, float ** loctemp, float ** buffer, int width, int height, int level, float mult[5], const double dirpyrThreshold, float ** hue, float ** chrom, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r , int choice) +void ImProcFunctions::idirpyr_eq_channel_loc (float ** data_coarse, float ** data_fine, float ** loctemp, float ** buffer, int width, int height, int level, float mult[5], const double dirpyrThreshold, float ** hue, float ** chrom, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r , int choice) { - const float skinprotneg = -skinprot; - const float factorHard = (1.f - skinprotneg / 100.f); +// const float skinprotneg = -skinprot; +// const float factorHard = (1.f - skinprotneg / 100.f); float offs; - if(skinprot == 0.f) { + if (skinprot == 0.f) { offs = 0.f; } else { offs = -1.f; @@ -764,7 +764,7 @@ void ImProcFunctions::idirpyr_eq_channel_loc(float ** data_coarse, float ** data multbis[level] = mult[level]; //multbis to reduce artifacts for high values mult - if(level == 4 && mult[level] > 1.f) { + if (level == 4 && mult[level] > 1.f) { multbis[level] = 1.f + 0.65f * (mult[level] - 1.f); } @@ -774,28 +774,28 @@ void ImProcFunctions::idirpyr_eq_channel_loc(float ** data_coarse, float ** data LUTf irangefn (0x20000); { - const float noisehi = 1.33f * noise * dirpyrThreshold / expf(level * log(3.0)), noiselo = 0.66f * noise * dirpyrThreshold / expf(level * log(3.0)); + const float noisehi = 1.33f * noise * dirpyrThreshold / expf (level * log (3.0)), noiselo = 0.66f * noise * dirpyrThreshold / expf (level * log (3.0)); //printf("level=%i multlev=%f noisehi=%f noiselo=%f skinprot=%f\n",level,mult[level], noisehi, noiselo, skinprot); for (int i = 0; i < 0x20000; i++) { - if (abs(i - 0x10000) > noisehi || multbis[level] < 1.0) { + if (abs (i - 0x10000) > noisehi || multbis[level] < 1.0) { irangefn[i] = multbis[level] + offs; } else { - if (abs(i - 0x10000) < noiselo) { + if (abs (i - 0x10000) < noiselo) { irangefn[i] = 1.f + offs ; } else { - irangefn[i] = 1.f + offs + (multbis[level] - 1.f) * (noisehi - abs(i - 0x10000)) / (noisehi - noiselo + 0.01f) ; + irangefn[i] = 1.f + offs + (multbis[level] - 1.f) * (noisehi - abs (i - 0x10000)) / (noisehi - noiselo + 0.01f) ; } } } } - if(skinprot == 0.f) + if (skinprot == 0.f) #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif - for(int i = 0; i < height; i++) { - for(int j = 0; j < width; j++) { + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { float hipass = (data_fine[i][j] - data_coarse[i][j]); buffer[i][j] += irangefn[hipass + 0x10000] * hipass; } @@ -844,14 +844,14 @@ void ImProcFunctions::idirpyr_eq_channel_loc(float ** data_coarse, float ** data -void ImProcFunctions::idirpyr_eq_channel(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float mult[5], const double dirpyrThreshold, float ** hue, float ** chrom, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r , int choice) +void ImProcFunctions::idirpyr_eq_channel (float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float mult[5], const double dirpyrThreshold, float ** hue, float ** chrom, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r , int choice) { const float skinprotneg = -skinprot; const float factorHard = (1.f - skinprotneg / 100.f); float offs; - if(skinprot == 0.f) { + if (skinprot == 0.f) { offs = 0.f; } else { offs = -1.f; @@ -861,48 +861,48 @@ void ImProcFunctions::idirpyr_eq_channel(float ** data_coarse, float ** data_fin multbis[level] = mult[level]; //multbis to reduce artifacts for high values mult - if(level == 4 && mult[level] > 1.f) { + if (level == 4 && mult[level] > 1.f) { multbis[level] = 1.f + 0.65f * (mult[level] - 1.f); } - if(level == 5 && mult[level] > 1.f) { + if (level == 5 && mult[level] > 1.f) { multbis[level] = 1.f + 0.45f * (mult[level] - 1.f); } LUTf irangefn (0x20000); { - const float noisehi = 1.33f * noise * dirpyrThreshold / expf(level * log(3.0)), noiselo = 0.66f * noise * dirpyrThreshold / expf(level * log(3.0)); + const float noisehi = 1.33f * noise * dirpyrThreshold / expf (level * log (3.0)), noiselo = 0.66f * noise * dirpyrThreshold / expf (level * log (3.0)); //printf("level=%i multlev=%f noisehi=%f noiselo=%f skinprot=%f\n",level,mult[level], noisehi, noiselo, skinprot); for (int i = 0; i < 0x20000; i++) { - if (abs(i - 0x10000) > noisehi || multbis[level] < 1.0) { + if (abs (i - 0x10000) > noisehi || multbis[level] < 1.0) { irangefn[i] = multbis[level] + offs; } else { - if (abs(i - 0x10000) < noiselo) { + if (abs (i - 0x10000) < noiselo) { irangefn[i] = 1.f + offs ; } else { - irangefn[i] = 1.f + offs + (multbis[level] - 1.f) * (noisehi - abs(i - 0x10000)) / (noisehi - noiselo + 0.01f) ; + irangefn[i] = 1.f + offs + (multbis[level] - 1.f) * (noisehi - abs (i - 0x10000)) / (noisehi - noiselo + 0.01f) ; } } } } - if(skinprot == 0.f) + if (skinprot == 0.f) #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif - for(int i = 0; i < height; i++) { - for(int j = 0; j < width; j++) { + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { float hipass = (data_fine[i][j] - data_coarse[i][j]); buffer[i][j] += irangefn[hipass + 0x10000] * hipass; } } - else if(skinprot > 0.f) + else if (skinprot > 0.f) #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif - for(int i = 0; i < height; i++) { - for(int j = 0; j < width; j++) { + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { float scale = 1.f; float hipass = (data_fine[i][j] - data_coarse[i][j]); // These values are precalculated now @@ -916,8 +916,8 @@ void ImProcFunctions::idirpyr_eq_channel(float ** data_coarse, float ** data_fin #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif - for(int i = 0; i < height; i++) { - for(int j = 0; j < width; j++) { + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { float scale = 1.f; float hipass = (data_fine[i][j] - data_coarse[i][j]); // These values are precalculated now @@ -936,7 +936,7 @@ void ImProcFunctions::idirpyr_eq_channel(float ** data_coarse, float ** data_fin } -void ImProcFunctions::idirpyr_eq_channelcam(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float mult[5], const double dirpyrThreshold, float ** l_a_h, float ** l_b_c, const double skinprot, float b_l, float t_l, float t_r) +void ImProcFunctions::idirpyr_eq_channelcam (float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float mult[5], const double dirpyrThreshold, float ** l_a_h, float ** l_b_c, const double skinprot, float b_l, float t_l, float t_r) { const float skinprotneg = -skinprot; @@ -944,7 +944,7 @@ void ImProcFunctions::idirpyr_eq_channelcam(float ** data_coarse, float ** data_ float offs; - if(skinprot == 0.f) { + if (skinprot == 0.f) { offs = 0.f; } else { offs = -1.f; @@ -954,48 +954,48 @@ void ImProcFunctions::idirpyr_eq_channelcam(float ** data_coarse, float ** data_ multbis[level] = mult[level]; //multbis to reduce artifacts for high values mult - if(level == 4 && mult[level] > 1.f) { + if (level == 4 && mult[level] > 1.f) { multbis[level] = 1.f + 0.65f * (mult[level] - 1.f); } - if(level == 5 && mult[level] > 1.f) { + if (level == 5 && mult[level] > 1.f) { multbis[level] = 1.f + 0.45f * (mult[level] - 1.f); } LUTf irangefn (0x20000); { - const float noisehi = 1.33f * noise * dirpyrThreshold / expf(level * log(3.0)), noiselo = 0.66f * noise * dirpyrThreshold / expf(level * log(3.0)); + const float noisehi = 1.33f * noise * dirpyrThreshold / expf (level * log (3.0)), noiselo = 0.66f * noise * dirpyrThreshold / expf (level * log (3.0)); //printf("level=%i multlev=%f noisehi=%f noiselo=%f skinprot=%f\n",level,mult[level], noisehi, noiselo, skinprot); for (int i = 0; i < 0x20000; i++) { - if (abs(i - 0x10000) > noisehi || multbis[level] < 1.0) { + if (abs (i - 0x10000) > noisehi || multbis[level] < 1.0) { irangefn[i] = multbis[level] + offs; } else { - if (abs(i - 0x10000) < noiselo) { + if (abs (i - 0x10000) < noiselo) { irangefn[i] = 1.f + offs ; } else { - irangefn[i] = 1.f + offs + (multbis[level] - 1.f) * (noisehi - abs(i - 0x10000)) / (noisehi - noiselo + 0.01f) ; + irangefn[i] = 1.f + offs + (multbis[level] - 1.f) * (noisehi - abs (i - 0x10000)) / (noisehi - noiselo + 0.01f) ; } } } } - if(skinprot == 0.f) + if (skinprot == 0.f) #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif - for(int i = 0; i < height; i++) { - for(int j = 0; j < width; j++) { + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { float hipass = (data_fine[i][j] - data_coarse[i][j]); buffer[i][j] += irangefn[hipass + 0x10000] * hipass ; } } - else if(skinprot > 0.f) + else if (skinprot > 0.f) #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif - for(int i = 0; i < height; i++) { - for(int j = 0; j < width; j++) { + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { float hipass = (data_fine[i][j] - data_coarse[i][j]); float scale = 1.f; Color::SkinSatCbdlCam ((data_fine[i][j]) / 327.68f, l_a_h[i][j] , l_b_c[i][j], skinprot, scale, true, b_l, t_l, t_r); @@ -1006,8 +1006,8 @@ void ImProcFunctions::idirpyr_eq_channelcam(float ** data_coarse, float ** data_ #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif - for(int i = 0; i < height; i++) { - for(int j = 0; j < width; j++) { + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { float hipass = (data_fine[i][j] - data_coarse[i][j]); float scale = 1.f; float correct; diff --git a/rtengine/fast_demo.cc b/rtengine/fast_demo.cc index d5bca20b9..12286d9f1 100644 --- a/rtengine/fast_demo.cc +++ b/rtengine/fast_demo.cc @@ -277,7 +277,6 @@ SSEFUNCTION void RawImageSource::fast_demosaic(int winx, int winy, int winw, int int j, cc; __m128 wtuv, wtdv, wtlv, wtrv; __m128 greenv, tempv, absv, abs2v; - __m128 onev = _mm_set1_ps( 1.0f ); __m128 c16v = _mm_set1_ps( 16.0f ); __m128 fourv = _mm_set1_ps( 4.0f ); vmask selmask; diff --git a/rtengine/fujicompressed.cc b/rtengine/fujicompressed.cc index 2e0b83485..75ca46c04 100644 --- a/rtengine/fujicompressed.cc +++ b/rtengine/fujicompressed.cc @@ -20,7 +20,7 @@ it under the terms of the one of three licenses as you choose: void CLASS init_fuji_compr (struct fuji_compressed_params* info) { - int cur_val, i; + int cur_val; char *qt; if ((fuji_block_width % 3 && fuji_raw_type == 16) || (fuji_block_width & 1 && fuji_raw_type == 0)) { @@ -171,7 +171,7 @@ void CLASS copy_line_to_xtrans (struct fuji_compressed_block* info, int cur_line while (row_count < 6) { pixel_count = 0; - while (pixel_count < cur_block_width) { + while (static_cast(pixel_count) < cur_block_width) { switch (xtrans_abs[row_count][ (pixel_count % 6)]) { case 0: // red line_buf = lineBufR[row_count >> 1]; @@ -182,11 +182,12 @@ void CLASS copy_line_to_xtrans (struct fuji_compressed_block* info, int cur_line break; case 2: // blue + default: line_buf = lineBufB[row_count >> 1]; break; } - index = (((pixel_count * 2 / 3) & 0x7FFFFFFE) | (pixel_count % 3) & 1) + ((pixel_count % 3) >> 1); + index = (((pixel_count * 2 / 3) & 0x7FFFFFFE) | ((pixel_count % 3) & 1)) + ((pixel_count % 3) >> 1); raw_block_data[pixel_count] = line_buf[index]; ++pixel_count; @@ -228,7 +229,7 @@ void CLASS copy_line_to_bayer (struct fuji_compressed_block *info, int cur_line, while (row_count < 6) { pixel_count = 0; - while (pixel_count < cur_block_width) { + while (static_cast(pixel_count) < cur_block_width) { switch (fuji_bayer[row_count & 1][pixel_count & 1]) { case 0: // red line_buf = lineBufR[row_count >> 1]; @@ -897,12 +898,11 @@ void CLASS fuji_compressed_load_raw() { struct fuji_compressed_params common_info; int cur_block; - unsigned line_size, *block_sizes; + unsigned *block_sizes; INT64 raw_offset, *raw_block_offsets; //struct fuji_compressed_block info; init_fuji_compr (&common_info); - line_size = sizeof (ushort) * (common_info.line_width + 2); // read block sizes block_sizes = (unsigned*) malloc (sizeof (unsigned) * fuji_total_blocks); diff --git a/rtengine/gauss.cc b/rtengine/gauss.cc index 22339d27c..741b2e3da 100644 --- a/rtengine/gauss.cc +++ b/rtengine/gauss.cc @@ -231,8 +231,8 @@ template void gaussHorizontal3 (T** src, T** dst, int W, int H, const f #ifdef __SSE2__ template SSEFUNCTION void gaussVertical3 (T** src, T** dst, int W, int H, const float c0, const float c1) { - vfloat Tv, Tm1v, Tp1v; - vfloat Tv1, Tm1v1, Tp1v1; + vfloat Tv = F2V(0.f), Tm1v, Tp1v; + vfloat Tv1 = F2V(0.f), Tm1v1, Tp1v1; vfloat c0v, c1v; c0v = F2V(c0); c1v = F2V(c1); @@ -921,7 +921,7 @@ template void gaussVertical (T** src, T** dst, const int W, const int H #pragma omp for nowait #endif - for (int i = 0; i < W - numcols + 1; i += numcols) { + for (unsigned int i = 0; i < static_cast(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]; diff --git a/rtengine/hilite_recon.cc b/rtengine/hilite_recon.cc index 9f618ace5..b0b211e3d 100644 --- a/rtengine/hilite_recon.cc +++ b/rtengine/hilite_recon.cc @@ -398,23 +398,20 @@ void RawImageSource :: HLRecovery_inpaint (float** red, float** green, float** b int height = H; int width = W; - static const int range = 2; - static const int pitch = 4; + constexpr int range = 2; + constexpr int pitch = 4; - static const int numdirs = 4; - - static const float threshpct = 0.25f; - static const float fixthreshpct = 0.7f; - static const float maxpct = 0.95f; - static const float epsilon = 0.00001f; + constexpr float threshpct = 0.25f; + constexpr float maxpct = 0.95f; + constexpr float epsilon = 0.00001f; //%%%%%%%%%%%%%%%%%%%% //for blend algorithm: - static const float blendthresh = 1.0; - static const int ColorCount = 3; + constexpr float blendthresh = 1.0; + constexpr int ColorCount = 3; // Transform matrixes rgb>lab and back - static const float trans[ColorCount][ColorCount] = + constexpr float trans[ColorCount][ColorCount] = { { 1.f, 1.f, 1.f }, { 1.7320508f, -1.7320508f, 0.f }, { -1.f, -1.f, 2.f } }; - static const float itrans[ColorCount][ColorCount] = + constexpr float itrans[ColorCount][ColorCount] = { { 1.f, 0.8660254f, -0.5f }, { 1.f, -0.8660254f, -0.5f }, { 1.f, 0.f, 1.f } }; if(settings->verbose) diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index fa3651571..de5988d9b 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -331,7 +331,7 @@ void ImageData::extractInfo () if (mnote->getTag ("LensData")) { std::string ldata = mnote->getTag ("LensData")->valueToString (); - int pos; + size_t pos; if (ldata.size() > 10 && (pos = ldata.find ("Lens = ")) != Glib::ustring::npos) { lens = ldata.substr (pos + 7); @@ -339,7 +339,7 @@ void ImageData::extractInfo () if (lens.compare (0, 7, "Unknown")) { lensOk = true; } else { - int pos = lens.find("$FL$"); // is there a placeholder for focallength? + size_t pos = lens.find("$FL$"); // is there a placeholder for focallength? if(pos != Glib::ustring::npos) { // then fill in focallength lens = lens.replace(pos, 4, exif->getTag ("FocalLength")->valueToString ()); diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index f24842b65..197055858 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -216,9 +216,8 @@ int ImageIO::getPNGSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, //reading PNG header unsigned char header[8]; - fread (header, 1, 8, file); - if (png_sig_cmp (header, 0, 8)) { + if (fread (header, 1, 8, file) != 8 || png_sig_cmp (header, 0, 8)) { fclose(file); return IMIO_HEADERERROR; } @@ -295,9 +294,8 @@ int ImageIO::loadPNG (Glib::ustring fname) //reading PNG header unsigned char header[8]; - fread (header, 1, 8, file); - if (png_sig_cmp (header, 0, 8)) { + if (fread (header, 1, 8, file) != 8 || png_sig_cmp (header, 0, 8)) { fclose(file); return IMIO_HEADERERROR; } @@ -1245,7 +1243,7 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed) // The maximum lenght is strangely not the same than for the JPEG file... // Which maximum length is the good one ? - if (size > 0 && size <= bufferSize) { + if (size > 0 && size <= static_cast(bufferSize)) { fwrite (buffer, size, 1, file); } diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 82fe5eada..f4aacd283 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -43,8 +43,8 @@ ImProcCoordinator::ImProcCoordinator () ncie (nullptr), imgsrc (nullptr), shmap (nullptr), lastAwbEqual (0.), lastAwbTempBias (0.0), ipf (¶ms, true), monitorIntent (RI_RELATIVE), softProof (false), gamutCheck (false), scale (10), highDetailPreprocessComputed (false), highDetailRawComputed (false), allocated (false), bwAutoR (-9000.f), bwAutoG (-9000.f), bwAutoB (-9000.f), CAMMean (NAN), coordX (0), coordY (0), localX (0), localY (0), - dataspot (nullptr), retistr (nullptr), retistrsav (nullptr), llstr (nullptr), lhstr (nullptr), ccstr (nullptr), - ctColorCurve(), + dataspot (nullptr), retistr (nullptr), llstr (nullptr), lhstr (nullptr), ccstr (nullptr), retistrsav (nullptr), +// ctColorCurve(), // localcurve(65536, 0), hltonecurve (65536), shtonecurve (65536), @@ -55,6 +55,7 @@ ImProcCoordinator::ImProcCoordinator () satcurve (65536, 0), lhskcurve (65536, 0), clcurve (65536, 0), + conversionBuffer (1, 1), wavclCurve (65536, 0), clToningcurve (65536, 0), lllocalcurve (65536, 0), @@ -164,15 +165,17 @@ ImProcCoordinator::ImProcCoordinator () rCurve(), gCurve(), bCurve(), - rcurvehist(256), rcurvehistCropped(256), rbeforehist(256), - gcurvehist(256), gcurvehistCropped(256), gbeforehist(256), - bcurvehist(256), bcurvehistCropped(256), bbeforehist(256), - fw(0), fh(0), tr(0), - fullw(1), fullh(1), - pW(-1), pH(-1), - plistener(nullptr), imageListener(nullptr), aeListener(nullptr), acListener(nullptr), abwListener(nullptr), awbListener(nullptr), aloListener(nullptr), actListener(nullptr), adnListener(nullptr), awavListener(nullptr), dehaListener(nullptr), frameCountListener(nullptr), imageTypeListener(nullptr), hListener(nullptr), - resultValid(false), lastOutputProfile("BADFOOD"), lastOutputIntent(RI__COUNT), lastOutputBPC(false), thread(nullptr), changeSinceLast(0), updaterRunning(false), destroying(false), utili(false), autili(false), wavcontlutili(false), - butili(false), ccutili(false), cclutili(false), clcutili(false), opautili(false), conversionBuffer(1, 1), colourToningSatLimit(0.f), colourToningSatLimitOpacity(0.f) + ctColorCurve(), + rcurvehist (256), rcurvehistCropped (256), rbeforehist (256), + gcurvehist (256), gcurvehistCropped (256), gbeforehist (256), + bcurvehist (256), bcurvehistCropped (256), bbeforehist (256), + fw (0), fh (0), tr (0), + fullw (1), fullh (1), + pW (-1), pH (-1), + //conversionBuffer(1, 1), + plistener (nullptr), imageListener (nullptr), aeListener (nullptr), acListener (nullptr), abwListener (nullptr), awbListener (nullptr), aloListener (nullptr), actListener (nullptr), adnListener (nullptr), awavListener (nullptr), dehaListener (nullptr), frameCountListener (nullptr), imageTypeListener (nullptr), hListener (nullptr), + resultValid (false), lastOutputProfile ("BADFOOD"), lastOutputIntent (RI__COUNT), lastOutputBPC (false), thread (nullptr), changeSinceLast (0), updaterRunning (false), destroying (false), utili (false), autili (false), wavcontlutili (false), + butili (false), ccutili (false), cclutili (false), clcutili (false), opautili (false), colourToningSatLimit (0.f), colourToningSatLimitOpacity (0.f) {} void ImProcCoordinator::assign (ImageSource* imgsrc) @@ -266,16 +269,16 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) progress ("Applying white balance, color correction & sRGB conversion...", 100 * readyphase / numofphases); - if(frameCountListener) { - frameCountListener->FrameCountChanged(imgsrc->getFrameCount(), params.raw.bayersensor.imageNum); + if (frameCountListener) { + frameCountListener->FrameCountChanged (imgsrc->getFrameCount(), params.raw.bayersensor.imageNum); } // raw auto CA is bypassed if no high detail is needed, so we have to compute it when high detail is needed if ( (todo & M_PREPROC) || (!highDetailPreprocessComputed && highDetailNeeded)) { - imgsrc->setCurrentFrame(params.raw.bayersensor.imageNum); + imgsrc->setCurrentFrame (params.raw.bayersensor.imageNum); - imgsrc->preprocess( rp, params.lensProf, params.coarse ); - imgsrc->getRAWHistogram( histRedRaw, histGreenRaw, histBlueRaw ); + imgsrc->preprocess ( rp, params.lensProf, params.coarse ); + imgsrc->getRAWHistogram ( histRedRaw, histGreenRaw, histBlueRaw ); if (highDetailNeeded) { highDetailPreprocessComputed = true; @@ -296,8 +299,8 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) */ // If high detail (=100%) is newly selected, do a demosaic update, since the last was just with FAST - if(imageTypeListener) { - imageTypeListener->imageTypeChanged(imgsrc->isRAW(), imgsrc->getSensorType() == ST_BAYER, imgsrc->getSensorType() == ST_FUJI_XTRANS); + if (imageTypeListener) { + imageTypeListener->imageTypeChanged (imgsrc->isRAW(), imgsrc->getSensorType() == ST_BAYER, imgsrc->getSensorType() == ST_FUJI_XTRANS); } if ( (todo & M_RAW) @@ -307,7 +310,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) if (settings->verbose) { if (imgsrc->getSensorType() == ST_BAYER) { - printf("Demosaic Bayer image n.%d using method: %s\n", rp.bayersensor.imageNum + 1, rp.bayersensor.method.c_str()); + printf ("Demosaic Bayer image n.%d using method: %s\n", rp.bayersensor.imageNum + 1, rp.bayersensor.method.c_str()); } else if (imgsrc->getSensorType() == ST_FUJI_XTRANS) { printf ("Demosaic X-Trans image with using method: %s\n", rp.xtranssensor.method.c_str()); } @@ -553,7 +556,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) opautili = false; - if(params.colorToning.enabled) { + if (params.colorToning.enabled) { TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.working); double wp[3][3] = { {wprof[0][0], wprof[0][1], wprof[0][2]}, @@ -787,7 +790,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) printf ("mip files in=%s\n", datal.c_str()); // if(! fic0.fail()) { - float **shbuffer; + float **shbuffer = nullptr; versionmip = 0; int maxdat; int sca = 1; @@ -1261,7 +1264,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) //end save - int ns; + int ns = 0; int realsp = params.locallab.nbspot; bool excurvret = true; bool excurvll = true; @@ -1640,7 +1643,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) std::string line2; std::string spotline2; int cont2 = 0; - int ns2; + int ns2 = 0; int maxin = 58; int sizecu2; int sizell2; @@ -1770,7 +1773,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) for (int sp = 1; sp < maxspot; sp++) { //spots default params.locallab.hueref = dataspot[58][sp] / 100.; params.locallab.chromaref = dataspot[59][sp]; - bool locutili = locutili; + bool locutili = false; params.locallab.lumaref = dataspot[60][sp]; params.locallab.circrad = circrads[sp] = dataspot[2][sp]; params.locallab.locX = locx[sp] = dataspot[3][sp]; diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 472663002..71e9aecb1 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -91,8 +91,9 @@ protected: // Precomputed values used by DetailedCrop ---------------------------------------------- float bwAutoR, bwAutoG, bwAutoB; - int coordX, coordY, localX, localY; float CAMMean; + int coordX, coordY, localX, localY; + LUTf hltonecurve; LUTf shtonecurve; LUTf tonecurve; diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index c6a18bd50..271e14637 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -91,7 +91,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile, MyMutex::MyLock lcmsLock (*lcmsMutex); cmsUInt32Number flags; - cmsHPROFILE iprof = cmsCreateLab4Profile(nullptr); + cmsHPROFILE iprof = cmsCreateLab4Profile (nullptr); bool softProofCreated = false; @@ -99,7 +99,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile, cmsHPROFILE oprof = nullptr; if (!settings->printerProfile.empty()) { - oprof = ICCStore::getInstance()->getProfile(settings->printerProfile); + oprof = ICCStore::getInstance()->getProfile (settings->printerProfile); } if (oprof) { @@ -114,7 +114,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile, flags |= cmsFLAGS_GAMUTCHECK; } - monitorTransform = cmsCreateProofingTransform( + monitorTransform = cmsCreateProofingTransform ( iprof, TYPE_Lab_FLT, monitor, TYPE_RGB_8, oprof, @@ -138,7 +138,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile, monitorTransform = cmsCreateTransform (iprof, TYPE_Lab_FLT, monitor, TYPE_RGB_8, monitorIntent, flags); } - cmsCloseProfile(iprof); + cmsCloseProfile (iprof); } } @@ -153,19 +153,19 @@ void ImProcFunctions::firstAnalysis (const Imagefloat* const original, const Pro int W = original->getWidth(); int H = original->getHeight(); - float lumimulf[3] = {static_cast(lumimul[0]), static_cast(lumimul[1]), static_cast(lumimul[2])}; + float lumimulf[3] = {static_cast (lumimul[0]), static_cast (lumimul[1]), static_cast (lumimul[2])}; // calculate histogram of the y channel needed for contrast curve calculation in exposure adjustments histogram.clear(); - if(multiThread) { + if (multiThread) { #ifdef _OPENMP - const int numThreads = min(max(W * H / (int)histogram.getSize(), 1), omp_get_max_threads()); + const int numThreads = min (max (W * H / (int)histogram.getSize(), 1), omp_get_max_threads()); #pragma omp parallel num_threads(numThreads) if(numThreads>1) #endif { - LUTu hist(histogram.getSize()); + LUTu hist (histogram.getSize()); hist.clear(); #ifdef _OPENMP #pragma omp for nowait @@ -174,9 +174,9 @@ void ImProcFunctions::firstAnalysis (const Imagefloat* const original, const Pro for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { - float r = original->r(i, j); - float g = original->g(i, j); - float b = original->b(i, j); + float r = original->r (i, j); + float g = original->g (i, j); + float b = original->b (i, j); int y = (lumimulf[0] * r + lumimulf[1] * g + lumimulf[2] * b); hist[y]++; @@ -193,9 +193,9 @@ void ImProcFunctions::firstAnalysis (const Imagefloat* const original, const Pro for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { - float r = original->r(i, j); - float g = original->g(i, j); - float b = original->b(i, j); + float r = original->r (i, j); + float g = original->g (i, j); + float b = original->b (i, j); int y = (lumimulf[0] * r + lumimulf[1] * g + lumimulf[2] * b); histogram[y]++; @@ -210,7 +210,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve2, const ColorAppearance & customColCurve3, LUTu & histLCAM, LUTu & histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, double &d, int scalecd, int rtt) { - if(params->colorappearance.enabled) { + if (params->colorappearance.enabled) { //int lastskip; //if(rtt==1) {lastskip=scalecd;} //not for Rtthumbnail @@ -224,15 +224,15 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh float val; //preparate for histograms CIECAM - if(pW != 1) { //only with improccoordinator - dLcurve(65536, 0); + if (pW != 1) { //only with improccoordinator + dLcurve (65536, 0); dLcurve.clear(); - hist16JCAM(65536, 0); + hist16JCAM (65536, 0); hist16JCAM.clear(); for (int i = 0; i < 32768; i++) { //# 32768*1.414 approximation maxi for chroma val = (double)i / 32767.0; - dLcurve[i] = CLIPD(val); + dLcurve[i] = CLIPD (val); } } @@ -241,23 +241,21 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh bool chropC = false; float valc; - if(pW != 1) { //only with improccoordinator - dCcurve(65536, 0); - hist16_CCAM(65536); + if (pW != 1) { //only with improccoordinator + dCcurve (65536, 0); + hist16_CCAM (65536); hist16_CCAM.clear(); for (int i = 0; i < 48000; i++) { //# 32768*1.414 approximation maxi for chroma valc = (double)i / 47999.0; - dCcurve[i] = CLIPD(valc); + dCcurve[i] = CLIPD (valc); } } //end preparate histogram int width = lab->W, height = lab->H; float minQ = 10000.f; - float minM = 10000.f; float maxQ = -1000.f; - float maxM = -1000.f; float w_h; float a_w; float c_; @@ -265,9 +263,9 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh double Yw; Yw = 1.0; double Xw, Zw; - double f, c, nc, yb, la, xw, yw, zw, f2, c2, nc2, yb2, la2; + double f, c, nc, yb = 0., la, xw, yw, zw, f2 = 0., c2 = 0., nc2 = 0., yb2 = 0., la2; double fl, n, nbb, ncb, aw; - double xwd, ywd, zwd; + double xwd = 0., ywd, zwd = 0.; int alg = 0; bool algepd = false; float sum = 0.f; @@ -277,22 +275,22 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh ColorTemp::temp2mulxyz (params->wb.temperature, params->wb.green, params->wb.method, Xw, Zw); //compute white Xw Yw Zw : white current WB //viewing condition for surround - if(params->colorappearance.surround == "Average") { + if (params->colorappearance.surround == "Average") { f = 1.00; c = 0.69; nc = 1.00; f2 = 1.0, c2 = 0.69, nc2 = 1.0; - } else if(params->colorappearance.surround == "Dim") { + } else if (params->colorappearance.surround == "Dim") { f2 = 0.9; c2 = 0.59; nc2 = 0.9; f = 1.0, c = 0.69, nc = 1.0; - } else if(params->colorappearance.surround == "Dark") { + } else if (params->colorappearance.surround == "Dark") { f2 = 0.8; c2 = 0.525; nc2 = 0.8; f = 1.0, c = 0.69, nc = 1.0; - } else if(params->colorappearance.surround == "ExtremelyDark") { + } else if (params->colorappearance.surround == "ExtremelyDark") { f2 = 0.8; c2 = 0.41; nc2 = 0.8; @@ -300,7 +298,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh } //scene condition for surround - if(params->colorappearance.surrsource) { + if (params->colorappearance.surrsource) { f = 0.85; // if user => source image has surround very dark c = 0.55; nc = 0.85; @@ -309,12 +307,12 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh //with which algorithme if (params->colorappearance.algo == "JC") { alg = 0; - } else if(params->colorappearance.algo == "JS") { + } else if (params->colorappearance.algo == "JS") { alg = 1; - } else if(params->colorappearance.algo == "QM") { + } else if (params->colorappearance.algo == "QM") { alg = 2; algepd = true; - } else if(params->colorappearance.algo == "ALL") { + } else if (params->colorappearance.algo == "ALL") { alg = 3; algepd = true; } @@ -323,35 +321,35 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh bool needQ = (alg == 2 || alg == 3); //settings white point of output device - or illuminant viewing - if(settings->viewingdevice == 0) { + if (settings->viewingdevice == 0) { xwd = 96.42; //5000K ywd = 100.0; zwd = 82.52; - } else if(settings->viewingdevice == 1) { + } else if (settings->viewingdevice == 1) { xwd = 95.68; //5500 ywd = 100.0; zwd = 92.15; - } else if(settings->viewingdevice == 2) { + } else if (settings->viewingdevice == 2) { xwd = 95.24; //6000 ywd = 100.0; zwd = 100.81; - } else if(settings->viewingdevice == 3) { + } else if (settings->viewingdevice == 3) { xwd = 95.04; //6500 ywd = 100.0; zwd = 108.88; - } else if(settings->viewingdevice == 4) { + } else if (settings->viewingdevice == 4) { xwd = 109.85; //tungsten ywd = 100.0; zwd = 35.58; - } else if(settings->viewingdevice == 5) { + } else if (settings->viewingdevice == 5) { xwd = 99.18; //fluo F2 ywd = 100.0; zwd = 67.39; - } else if(settings->viewingdevice == 6) { + } else if (settings->viewingdevice == 6) { xwd = 95.04; //fluo F7 ywd = 100.0; zwd = 108.75; - } else if(settings->viewingdevice == 7) { + } else if (settings->viewingdevice == 7) { xwd = 100.96; //fluo F11 ywd = 100.0; zwd = 64.35; @@ -359,32 +357,32 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh //settings mean Luminance Y of output device or viewing - if(settings->viewingdevicegrey == 0) { + if (settings->viewingdevicegrey == 0) { yb2 = 5.0; - } else if(settings->viewingdevicegrey == 1) { + } else if (settings->viewingdevicegrey == 1) { yb2 = 10.0; - } else if(settings->viewingdevicegrey == 2) { + } else if (settings->viewingdevicegrey == 2) { yb2 = 15.0; - } else if(settings->viewingdevicegrey == 3) { + } else if (settings->viewingdevicegrey == 3) { yb2 = 18.0; - } else if(settings->viewingdevicegrey == 4) { + } else if (settings->viewingdevicegrey == 4) { yb2 = 23.0; - } else if(settings->viewingdevicegrey == 5) { + } else if (settings->viewingdevicegrey == 5) { yb2 = 30.0; - } else if(settings->viewingdevicegrey == 6) { + } else if (settings->viewingdevicegrey == 6) { yb2 = 40.0; } //La and la2 = ambiant luminosity scene and viewing - la = double(params->colorappearance.adapscen); + la = double (params->colorappearance.adapscen); - if(pwb == 2) { - if(params->colorappearance.autoadapscen) { + if (pwb == 2) { + if (params->colorappearance.autoadapscen) { la = adap; } } - la2 = double(params->colorappearance.adaplum); + la2 = double (params->colorappearance.adaplum); // level of adaptation double deg = (params->colorappearance.degree) / 100.0; @@ -401,20 +399,20 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh float hue = params->colorappearance.colorh; double rstprotection = 100. - params->colorappearance.rstprotection; - if(schr > 0.0) { + if (schr > 0.0) { schr = schr / 2.0f; //divide sensibility for saturation } // extracting datas from 'params' to avoid cache flush (to be confirmed) ColorAppearanceParams::eTCModeId curveMode = params->colorappearance.curveMode; ColorAppearanceParams::eTCModeId curveMode2 = params->colorappearance.curveMode2; - bool hasColCurve1 = bool(customColCurve1); - bool hasColCurve2 = bool(customColCurve2); + bool hasColCurve1 = bool (customColCurve1); + bool hasColCurve2 = bool (customColCurve2); ColorAppearanceParams::eCTCModeId curveMode3 = params->colorappearance.curveMode3; - bool hasColCurve3 = bool(customColCurve3); + bool hasColCurve3 = bool (customColCurve3); - if(CAMBrightCurveJ.dirty || CAMBrightCurveQ.dirty) { + if (CAMBrightCurveJ.dirty || CAMBrightCurveQ.dirty) { LUTu hist16J; LUTu hist16Q; @@ -438,34 +436,34 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh if (currL > 95.) { koef = 1.f; - } else if(currL > 85.) { + } else if (currL > 85.) { koef = 0.97f; - } else if(currL > 80.) { + } else if (currL > 80.) { koef = 0.93f; - } else if(currL > 70.) { + } else if (currL > 70.) { koef = 0.87f; - } else if(currL > 60.) { + } else if (currL > 60.) { koef = 0.85f; - } else if(currL > 50.) { + } else if (currL > 50.) { koef = 0.8f; - } else if(currL > 40.) { + } else if (currL > 40.) { koef = 0.75f; - } else if(currL > 30.) { + } else if (currL > 30.) { koef = 0.7f; - } else if(currL > 20.) { + } else if (currL > 20.) { koef = 0.7f; - } else if(currL > 10.) { + } else if (currL > 10.) { koef = 0.9f; - } else if(currL > 0.) { + } else if (currL > 0.) { koef = 1.0f; } if (needJ) { - hist16J[CLIP((int)((koef * lab->L[i][j])))]++; //evaluate histogram luminance L # J + hist16J[CLIP ((int) ((koef * lab->L[i][j])))]++; //evaluate histogram luminance L # J } if (needQ) { - hist16Q[CLIP((int) (32768.f * sqrt((koef * (lab->L[i][j])) / 32768.f)))]++; //for brightness Q : approximation for Q=wh*sqrt(J/100) J not equal L + hist16Q[CLIP ((int) (32768.f * sqrt ((koef * (lab->L[i][j])) / 32768.f)))]++; //for brightness Q : approximation for Q=wh*sqrt(J/100) J not equal L } sum += koef * lab->L[i][j]; //evaluate mean J to calcualte Yb @@ -477,7 +475,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh //evaluate lightness, contrast if (needJ) { if (!CAMBrightCurveJ) { - CAMBrightCurveJ(65536, 0); + CAMBrightCurveJ (65536, 0); CAMBrightCurveJ.dirty = false; } @@ -486,7 +484,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh if (needQ) { if (!CAMBrightCurveQ) { - CAMBrightCurveQ(65536, 0); + CAMBrightCurveQ (65536, 0); CAMBrightCurveQ.dirty = false; } @@ -494,40 +492,40 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh } } - if(settings->viewinggreySc == 0) { //auto + if (settings->viewinggreySc == 0) { //auto if (mean < 15.f) { yb = 3.0; - } else if(mean < 30.f) { + } else if (mean < 30.f) { yb = 5.0; - } else if(mean < 40.f) { + } else if (mean < 40.f) { yb = 10.0; - } else if(mean < 45.f) { + } else if (mean < 45.f) { yb = 15.0; - } else if(mean < 50.f) { + } else if (mean < 50.f) { yb = 18.0; - } else if(mean < 55.f) { + } else if (mean < 55.f) { yb = 23.0; - } else if(mean < 60.f) { + } else if (mean < 60.f) { yb = 30.0; - } else if(mean < 70.f) { + } else if (mean < 70.f) { yb = 40.0; - } else if(mean < 80.f) { + } else if (mean < 80.f) { yb = 60.0; - } else if(mean < 90.f) { + } else if (mean < 90.f) { yb = 80.0; } else { yb = 90.0; } } - if(settings->viewinggreySc == 1) { + if (settings->viewinggreySc == 1) { yb = 18.0; } int gamu = 0; bool highlight = params->toneCurve.hrenabled; //Get the value if "highlight reconstruction" is activated - if(params->colorappearance.gamut) { + if (params->colorappearance.gamut) { gamu = 1; //enabled gamut control } @@ -537,7 +535,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh double xw1, yw1, zw1, xw2, yw2, zw2; // settings of WB: scene and viewing - if(params->colorappearance.wbmodel == "RawT") { + if (params->colorappearance.wbmodel == "RawT") { xw1 = 96.46; //use RT WB; CAT 02 is used for output device (see prefreneces) yw1 = 100.0; zw1 = 82.445; @@ -554,9 +552,9 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh } double cz, wh, pfl; - Ciecam02::initcam1(gamu, yb, pilot, f, la, xw, yw, zw, n, d, nbb, ncb, cz, aw, wh, pfl, fl, c); + Ciecam02::initcam1 (gamu, yb, pilot, f, la, xw, yw, zw, n, d, nbb, ncb, cz, aw, wh, pfl, fl, c); double nj, dj, nbbj, ncbj, czj, awj, flj; - Ciecam02::initcam2(gamu, yb2, f2, la2, xw2, yw2, zw2, nj, dj, nbbj, ncbj, czj, awj, flj); + Ciecam02::initcam2 (gamu, yb2, f2, la2, xw2, yw2, zw2, nj, dj, nbbj, ncbj, czj, awj, flj); @@ -589,7 +587,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh double x, y, z; double epsil = 0.0001; //convert Lab => XYZ - Color::Lab2XYZ(L, a, b, x1, y1, z1); + Color::Lab2XYZ (L, a, b, x1, y1, z1); // double J, C, h, Q, M, s, aw, fl, wh; double J, C, h, Q, M, s; @@ -604,12 +602,12 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh y = (double)y1 / 655.35; z = (double)z1 / 655.35; //process source==> normal - Ciecam02::xyz2jchqms_ciecam02( J, C, h, - Q, M, s, aw, fl, wh, - x, y, z, - xw1, yw1, zw1, - yb, la, - f, c, nc, pilot, gamu , n, nbb, ncb, pfl, cz, d ); + Ciecam02::xyz2jchqms_ciecam02 ( J, C, h, + Q, M, s, aw, fl, wh, + x, y, z, + xw1, yw1, zw1, + yb, la, + f, c, nc, pilot, gamu , n, nbb, ncb, pfl, cz, d ); Jpro = J; Cpro = C; hpro = h; @@ -622,60 +620,60 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh f_l = fl; // we cannot have all algoritms with all chroma curves - if(alg == 1) { + if (alg == 1) { // Lightness saturation - if(Jpro > 99.9f) { + if (Jpro > 99.9f) { Jpro = 99.9f; } - Jpro = (CAMBrightCurveJ[(float)(Jpro * 327.68)]) / 327.68; //ligthness CIECAM02 + contrast + Jpro = (CAMBrightCurveJ[ (float) (Jpro * 327.68)]) / 327.68; //ligthness CIECAM02 + contrast double sres; double Sp = spro / 100.0; double parsat = 1.5; //parsat=1.5 =>saturation ; 1.8 => chroma ; 2.5 => colorfullness (personal evaluation) - if(schr == -100.0) { + if (schr == -100.0) { schr = -99.8; } - Ciecam02::curvecolor(schr, Sp , sres, parsat); - double coe = pow(fl, 0.25); + Ciecam02::curvecolor (schr, Sp , sres, parsat); + double coe = pow (fl, 0.25); float dred = 100.f; // in C mode float protect_red = 80.0f; // in C mode - dred = 100.0 * sqrt((dred * coe) / Qpro); - protect_red = 100.0 * sqrt((protect_red * coe) / Qpro); + dred = 100.0 * sqrt ((dred * coe) / Qpro); + protect_red = 100.0 * sqrt ((protect_red * coe) / Qpro); int sk = 0; float ko = 100.f; - Color::skinred(Jpro, hpro, sres, Sp, dred, protect_red, sk, rstprotection, ko, spro); - Qpro = ( 4.0 / c ) * sqrt( Jpro / 100.0 ) * ( aw + 4.0 ) ; + Color::skinred (Jpro, hpro, sres, Sp, dred, protect_red, sk, rstprotection, ko, spro); + Qpro = ( 4.0 / c ) * sqrt ( Jpro / 100.0 ) * ( aw + 4.0 ) ; Cpro = (spro * spro * Qpro) / (10000.0); - } else if(alg == 3 || alg == 0 || alg == 2) { + } else if (alg == 3 || alg == 0 || alg == 2) { double coef = 32760. / wh; - if(alg == 3 || alg == 2) { - if(Qpro * coef > 32767.0f) { - Qpro = (CAMBrightCurveQ[(float)32767.0f]) / coef; //brightness and contrast + if (alg == 3 || alg == 2) { + if (Qpro * coef > 32767.0f) { + Qpro = (CAMBrightCurveQ[ (float)32767.0f]) / coef; //brightness and contrast } else { - Qpro = (CAMBrightCurveQ[(float)(Qpro * coef)]) / coef; //brightness and contrast + Qpro = (CAMBrightCurveQ[ (float) (Qpro * coef)]) / coef; //brightness and contrast } } double Mp, sres; - double coe = pow(fl, 0.25); + double coe = pow (fl, 0.25); Mp = Mpro / 100.0; double parsat = 2.5; - if(mchr == -100.0) { + if (mchr == -100.0) { mchr = -99.8 ; } - if(mchr == 100.0) { + if (mchr == 100.0) { mchr = 99.9; } - if(alg == 3 || alg == 2) { - Ciecam02::curvecolor(mchr, Mp , sres, parsat); + if (alg == 3 || alg == 2) { + Ciecam02::curvecolor (mchr, Mp , sres, parsat); } else { - Ciecam02::curvecolor(0.0, Mp , sres, parsat); //colorfullness + Ciecam02::curvecolor (0.0, Mp , sres, parsat); //colorfullness } float dred = 100.f; //in C mode @@ -684,77 +682,77 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh protect_red *= coe; //M mode int sk = 0; float ko = 100.f; - Color::skinred(Jpro, hpro, sres, Mp, dred, protect_red, sk, rstprotection, ko, Mpro); + Color::skinred (Jpro, hpro, sres, Mp, dred, protect_red, sk, rstprotection, ko, Mpro); Jpro = (100.0 * Qpro * Qpro) / (wh * wh); Cpro = Mpro / coe; - spro = 100.0 * sqrt( Mpro / Qpro ); + spro = 100.0 * sqrt ( Mpro / Qpro ); - if(alg != 2) { - if(Jpro > 99.9f) { + if (alg != 2) { + if (Jpro > 99.9f) { Jpro = 99.9f; } - Jpro = (CAMBrightCurveJ[(float)(Jpro * 327.68f)]) / 327.68f; //ligthness CIECAM02 + contrast + Jpro = (CAMBrightCurveJ[ (float) (Jpro * 327.68f)]) / 327.68f; //ligthness CIECAM02 + contrast } double Cp; double Sp = spro / 100.0; parsat = 1.5; - if(schr == -100.0) { + if (schr == -100.0) { schr = -99.; } - if(schr == 100.0) { + if (schr == 100.0) { schr = 98.; } - if(alg == 3) { - Ciecam02::curvecolor(schr, Sp , sres, parsat); + if (alg == 3) { + Ciecam02::curvecolor (schr, Sp , sres, parsat); } else { - Ciecam02::curvecolor(0.0, Sp , sres, parsat); //saturation + Ciecam02::curvecolor (0.0, Sp , sres, parsat); //saturation } dred = 100.f; // in C mode protect_red = 80.0f; // in C mode - dred = 100.0 * sqrt((dred * coe) / Q); - protect_red = 100.0 * sqrt((protect_red * coe) / Q); + dred = 100.0 * sqrt ((dred * coe) / Q); + protect_red = 100.0 * sqrt ((protect_red * coe) / Q); sk = 0; - Color::skinred(Jpro, hpro, sres, Sp, dred, protect_red, sk, rstprotection, ko, spro); + Color::skinred (Jpro, hpro, sres, Sp, dred, protect_red, sk, rstprotection, ko, spro); //double Q1; - Qpro = ( 4.0 / c ) * sqrt( Jpro / 100.0 ) * ( aw + 4.0 ) ; + Qpro = ( 4.0 / c ) * sqrt ( Jpro / 100.0 ) * ( aw + 4.0 ) ; Cpro = (spro * spro * Qpro) / (10000.0); Cp = Cpro / 100.0; parsat = 1.8; //parsat=1.5 =>saturation ; 1.8 => chroma ; 2.5 => colorfullness (personal evaluation : for not) - if(chr == -100.0) { + if (chr == -100.0) { chr = -99.8; } - if(alg != 2) { - Ciecam02::curvecolor(chr, Cp , sres, parsat); + if (alg != 2) { + Ciecam02::curvecolor (chr, Cp , sres, parsat); } else { - Ciecam02::curvecolor(0.0, Cp , sres, parsat); //chroma + Ciecam02::curvecolor (0.0, Cp , sres, parsat); //chroma } dred = 55.f; protect_red = 30.0f; sk = 1; - Color::skinred(Jpro, hpro, sres, Cp, dred, protect_red, sk, rstprotection, ko, Cpro); + Color::skinred (Jpro, hpro, sres, Cp, dred, protect_red, sk, rstprotection, ko, Cpro); - if(Jpro < 1. && Cpro > 12.) { + if (Jpro < 1. && Cpro > 12.) { Cpro = 12.; //reduce artifacts by "pseudo gamut control CIECAM" - } else if(Jpro < 2. && Cpro > 15.) { + } else if (Jpro < 2. && Cpro > 15.) { Cpro = 15.; - } else if(Jpro < 4. && Cpro > 30.) { + } else if (Jpro < 4. && Cpro > 30.) { Cpro = 30.; - } else if(Jpro < 7. && Cpro > 50.) { + } else if (Jpro < 7. && Cpro > 50.) { Cpro = 50.; } hpro = hpro + hue; - if( hpro < 0.0 ) { + if ( hpro < 0.0 ) { hpro += 360.0; //hue } } @@ -772,28 +770,28 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh float Jold100 = (float) Jpro; float redu = 25.f; float reduc = 1.f; - const Lightcurve& userColCurveJ1 = static_cast(customColCurve1); - userColCurveJ1.Apply(Jj); + const Lightcurve& userColCurveJ1 = static_cast (customColCurve1); + userColCurveJ1.Apply (Jj); - if(Jj > Jold) { - if(Jj < 65535.f) { - if(Jold < 327.68f * redu) { + if (Jj > Jold) { + if (Jj < 65535.f) { + if (Jold < 327.68f * redu) { Jj = 0.3f * (Jj - Jold) + Jold; //divide sensibility } else { - reduc = LIM((100.f - Jold100) / (100.f - redu), 0.f, 1.f); + reduc = LIM ((100.f - Jold100) / (100.f - redu), 0.f, 1.f); Jj = 0.3f * reduc * (Jj - Jold) + Jold; //reduct sensibility in highlights } } - } else if(Jj > 10.f) { + } else if (Jj > 10.f) { Jj = 0.8f * (Jj - Jold) + Jold; } else if (Jj >= 0.f) { Jj = 0.90f * (Jj - Jold) + Jold; // not zero ==>artifacts } - Jpro = (double)(Jj / 327.68f); + Jpro = (double) (Jj / 327.68f); - if(Jpro < 1.) { + if (Jpro < 1.) { Jpro = 1.; } @@ -808,29 +806,29 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh float redu = 20.f; float reduc = 1.f; - const Brightcurve& userColCurveB1 = static_cast(customColCurve1); - userColCurveB1.Apply(Qq); + const Brightcurve& userColCurveB1 = static_cast (customColCurve1); + userColCurveB1.Apply (Qq); - if(Qq > Qold) { - if(Qq < 65535.f) { - if(Qold < 327.68f * redu) { + if (Qq > Qold) { + if (Qq < 65535.f) { + if (Qold < 327.68f * redu) { Qq = 0.25f * (Qq - Qold) + Qold; //divide sensibility } else { - reduc = LIM((100.f - Qold100) / (100.f - redu), 0.f, 1.f); + reduc = LIM ((100.f - Qold100) / (100.f - redu), 0.f, 1.f); Qq = 0.25f * reduc * (Qq - Qold) + Qold; //reduct sensibility in highlights } } - } else if(Qq > 10.f) { + } else if (Qq > 10.f) { Qq = 0.5f * (Qq - Qold) + Qold; } else if (Qq >= 0.f) { Qq = 0.7f * (Qq - Qold) + Qold; // not zero ==>artifacts } - Qpro = (double)(Qq * (coef) / 327.68f); - Jpro = 100.*(Qpro * Qpro) / ((4.0 / c) * (4.0 / c) * (aw + 4.0) * (aw + 4.0)); + Qpro = (double) (Qq * (coef) / 327.68f); + Jpro = 100.* (Qpro * Qpro) / ((4.0 / c) * (4.0 / c) * (aw + 4.0) * (aw + 4.0)); t1B = true; - if(Jpro < 1.) { + if (Jpro < 1.) { Jpro = 1.; } @@ -849,35 +847,35 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh float Jold100 = (float) Jpro; float redu = 25.f; float reduc = 1.f; - const Lightcurve& userColCurveJ2 = static_cast(customColCurve2); - userColCurveJ2.Apply(Jj); + const Lightcurve& userColCurveJ2 = static_cast (customColCurve2); + userColCurveJ2.Apply (Jj); - if(Jj > Jold) { - if(Jj < 65535.f) { - if(Jold < 327.68f * redu) { + if (Jj > Jold) { + if (Jj < 65535.f) { + if (Jold < 327.68f * redu) { Jj = 0.3f * (Jj - Jold) + Jold; //divide sensibility } else { - reduc = LIM((100.f - Jold100) / (100.f - redu), 0.f, 1.f); + reduc = LIM ((100.f - Jold100) / (100.f - redu), 0.f, 1.f); Jj = 0.3f * reduc * (Jj - Jold) + Jold; //reduct sensibility in highlights } } - } else if(Jj > 10.f) { - if(!t1L) { + } else if (Jj > 10.f) { + if (!t1L) { Jj = 0.8f * (Jj - Jold) + Jold; } else { Jj = 0.4f * (Jj - Jold) + Jold; } } else if (Jj >= 0.f) { - if(!t1L) { + if (!t1L) { Jj = 0.90f * (Jj - Jold) + Jold; // not zero ==>artifacts } else { Jj = 0.5f * (Jj - Jold) + Jold; } } - Jpro = (double)(Jj / 327.68f); + Jpro = (double) (Jj / 327.68f); - if(Jpro < 1.) { + if (Jpro < 1.) { Jpro = 1.; } @@ -890,40 +888,40 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh float redu = 20.f; float reduc = 1.f; - const Brightcurve& userColCurveB2 = static_cast(customColCurve2); - userColCurveB2.Apply(Qq); + const Brightcurve& userColCurveB2 = static_cast (customColCurve2); + userColCurveB2.Apply (Qq); - if(Qq > Qold) { - if(Qq < 65535.f) { - if(Qold < 327.68f * redu) { + if (Qq > Qold) { + if (Qq < 65535.f) { + if (Qold < 327.68f * redu) { Qq = 0.25f * (Qq - Qold) + Qold; //divide sensibility } else { - reduc = LIM((100.f - Qold100) / (100.f - redu), 0.f, 1.f); + reduc = LIM ((100.f - Qold100) / (100.f - redu), 0.f, 1.f); Qq = 0.25f * reduc * (Qq - Qold) + Qold; //reduct sensibility in highlights } } - } else if(Qq > 10.f) { + } else if (Qq > 10.f) { Qq = 0.5f * (Qq - Qold) + Qold; } else if (Qq >= 0.f) { Qq = 0.7f * (Qq - Qold) + Qold; // not zero ==>artifacts } - Qpro = (double)(Qq * (coef) / 327.68f); - Jpro = 100.*(Qpro * Qpro) / ((4.0 / c) * (4.0 / c) * (aw + 4.0) * (aw + 4.0)); + Qpro = (double) (Qq * (coef) / 327.68f); + Jpro = 100.* (Qpro * Qpro) / ((4.0 / c) * (4.0 / c) * (aw + 4.0) * (aw + 4.0)); t2B = true; - if(t1L) { //to workaround the problem if we modify curve1-lightnees after curve2 brightness(the cat that bites its own tail!) in fact it's another type of curve only for this case + if (t1L) { //to workaround the problem if we modify curve1-lightnees after curve2 brightness(the cat that bites its own tail!) in fact it's another type of curve only for this case coef = 2.f; //adapt Q to J approximation Qq = (float) Qpro * coef; Qold = Qq; - const Lightcurve& userColCurveJ1 = static_cast(customColCurve1); - userColCurveJ1.Apply(Qq); + const Lightcurve& userColCurveJ1 = static_cast (customColCurve1); + userColCurveJ1.Apply (Qq); Qq = 0.1f * (Qq - Qold) + Qold; //approximative adaptation - Qpro = (double)(Qq / coef); - Jpro = 100.*(Qpro * Qpro) / ((4.0 / c) * (4.0 / c) * (aw + 4.0) * (aw + 4.0)); + Qpro = (double) (Qq / coef); + Jpro = 100.* (Qpro * Qpro) / ((4.0 / c) * (4.0 / c) * (aw + 4.0) * (aw + 4.0)); } - if(Jpro < 1.) { + if (Jpro < 1.) { Jpro = 1.; } } @@ -935,21 +933,21 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh double coef = 327.68 / parsat; float Cc = (float) Cpro * coef; float Ccold = Cc; - const Chromacurve& userColCurve = static_cast(customColCurve3); - userColCurve.Apply(Cc); + const Chromacurve& userColCurve = static_cast (customColCurve3); + userColCurve.Apply (Cc); float dred = 55.f; float protect_red = 30.0f; float sk = 1; float ko = 1.f / coef; - Color::skinred(Jpro, hpro, Cc, Ccold, dred, protect_red, sk, rstprotection, ko, Cpro); + Color::skinred (Jpro, hpro, Cc, Ccold, dred, protect_red, sk, rstprotection, ko, Cpro); - if(Jpro < 1. && Cpro > 12.) { + if (Jpro < 1. && Cpro > 12.) { Cpro = 12.; //reduce artifacts by "pseudo gamut control CIECAM" - } else if(Jpro < 2. && Cpro > 15.) { + } else if (Jpro < 2. && Cpro > 15.) { Cpro = 15.; - } else if(Jpro < 4. && Cpro > 30.) { + } else if (Jpro < 4. && Cpro > 30.) { Cpro = 30.; - } else if(Jpro < 7. && Cpro > 50.) { + } else if (Jpro < 7. && Cpro > 50.) { Cpro = 50.; } @@ -959,18 +957,18 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh double coef = 327.68 / parsat; float Ss = (float) spro * coef; float Sold = Ss; - const Saturcurve& userColCurve = static_cast(customColCurve3); - userColCurve.Apply(Ss); + const Saturcurve& userColCurve = static_cast (customColCurve3); + userColCurve.Apply (Ss); Ss = 0.6f * (Ss - Sold) + Sold; //divide sensibility saturation - double coe = pow(fl, 0.25); + double coe = pow (fl, 0.25); float dred = 100.f; // in C mode float protect_red = 80.0f; // in C mode - dred = 100.0 * sqrt((dred * coe) / Qpro); - protect_red = 100.0 * sqrt((protect_red * coe) / Qpro); + dred = 100.0 * sqrt ((dred * coe) / Qpro); + protect_red = 100.0 * sqrt ((protect_red * coe) / Qpro); int sk = 0; float ko = 1.f / coef; - Color::skinred(Jpro, hpro, Ss, Sold, dred, protect_red, sk, rstprotection, ko, spro); - Qpro = ( 4.0 / c ) * sqrt( Jpro / 100.0 ) * ( aw + 4.0 ) ; + Color::skinred (Jpro, hpro, Ss, Sold, dred, protect_red, sk, rstprotection, ko, spro); + Qpro = ( 4.0 / c ) * sqrt ( Jpro / 100.0 ) * ( aw + 4.0 ) ; Cpro = (spro * spro * Qpro) / (10000.0); c1s = 1; @@ -979,25 +977,25 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh double coef = 327.68 / parsat; float Mm = (float) Mpro * coef; float Mold = Mm; - const Colorfcurve& userColCurve = static_cast(customColCurve3); - userColCurve.Apply(Mm); - double coe = pow(fl, 0.25); + const Colorfcurve& userColCurve = static_cast (customColCurve3); + userColCurve.Apply (Mm); + double coe = pow (fl, 0.25); float dred = 100.f; //in C mode float protect_red = 80.0f; // in C mode dred *= coe; //in M mode protect_red *= coe; int sk = 0; float ko = 1.f / coef; - Color::skinred(Jpro, hpro, Mm, Mold, dred, protect_red, sk, rstprotection, ko, Mpro); + Color::skinred (Jpro, hpro, Mm, Mold, dred, protect_red, sk, rstprotection, ko, Mpro); Cpro = Mpro / coe; - if(Jpro < 1. && Mpro > 12.*coe) { + if (Jpro < 1. && Mpro > 12.*coe) { Mpro = 12.*coe; //reduce artifacts by "pseudo gamut control CIECAM" - } else if(Jpro < 2. && Mpro > 15.*coe) { + } else if (Jpro < 2. && Mpro > 15.*coe) { Mpro = 15.*coe; - } else if(Jpro < 4. && Mpro > 30.*coe) { + } else if (Jpro < 4. && Mpro > 30.*coe) { Mpro = 30.*coe; - } else if(Jpro < 7. && Mpro > 50.*coe) { + } else if (Jpro < 7. && Mpro > 50.*coe) { Mpro = 50.*coe; } @@ -1007,17 +1005,17 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh } //to retrieve the correct values of variables - if(t2B && t1B) { + if (t2B && t1B) { Jpro = (100.0 * Qpro * Qpro) / (wh * wh); // for brightness curve } - if(c1s == 1) { - Qpro = ( 4.0 / c ) * sqrt( Jpro / 100.0 ) * ( aw + 4.0 ) ; //for saturation curve + if (c1s == 1) { + Qpro = ( 4.0 / c ) * sqrt ( Jpro / 100.0 ) * ( aw + 4.0 ) ; //for saturation curve Cpro = (spro * spro * Qpro) / (10000.0); } - if(c1co == 1) { - double coe = pow(fl, 0.25); // for colorfullness curve + if (c1co == 1) { + double coe = pow (fl, 0.25); // for colorfullness curve Cpro = Mpro / coe; } @@ -1029,7 +1027,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh h = hpro; s = spro; - if(params->colorappearance.tonecie || settings->autocielab) { //use pointer for tonemapping with CIECAM and also sharpening , defringe, contrast detail + if (params->colorappearance.tonecie || settings->autocielab) { //use pointer for tonemapping with CIECAM and also sharpening , defringe, contrast detail // if(params->colorappearance.tonecie || params->colorappearance.sharpcie){//use pointer for tonemapping with CIECAM and also sharpening , defringe, contrast detail float Qred = ( 4.0 / c) * ( aw + 4.0 ); //estimate Q max if J=100.0 ncie->Q_p[i][j] = (float)Q + epsil; //epsil to avoid Q=0 @@ -1038,19 +1036,19 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh ncie->h_p[i][j] = (float)h; ncie->C_p[i][j] = (float)C + epsil; // ncie->s_p[i][j]=(float)s; - ncie->sh_p[i][j] = (float) 32768.*(( 4.0 / c ) * sqrt( J / 100.0 ) * ( aw + 4.0 )) / Qred ; + ncie->sh_p[i][j] = (float) 32768.* (( 4.0 / c ) * sqrt ( J / 100.0 ) * ( aw + 4.0 )) / Qred ; // ncie->ch_p[i][j]=(float) 327.68*C; - if(ncie->Q_p[i][j] < minQ) { + if (ncie->Q_p[i][j] < minQ) { minQ = ncie->Q_p[i][j]; //minima } - if(ncie->Q_p[i][j] > maxQ) { + if (ncie->Q_p[i][j] > maxQ) { maxQ = ncie->Q_p[i][j]; //maxima } } - if(!params->colorappearance.tonecie || !settings->autocielab || !params->epd.enabled ) { + if (!params->colorappearance.tonecie || !settings->autocielab || !params->epd.enabled ) { // if(!params->epd.enabled || !params->colorappearance.tonecie || !settings->autocielab){ // if(!params->epd.enabled || !params->colorappearance.tonecie || !params->colorappearance.sharpcie){ @@ -1059,10 +1057,10 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh int libr = 0; int colch = 0; - if(curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { brli = 70.0; libr = 1; - } else if(curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { + } else if (curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { brli = 327.; libr = 0; } @@ -1070,26 +1068,26 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { chsacol = 327.; colch = 0; - } else if(curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { + } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { chsacol = 450.0; colch = 1; - } else if(curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { + } else if (curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { chsacol = 327.0; colch = 2; } - if(ciedata) { + if (ciedata) { // Data for J Q M s and C histograms //update histogram jp = true; - if(pW != 1) { //only with improccoordinator + if (pW != 1) { //only with improccoordinator int posl; - if(libr == 1) { - posl = CLIP((int)(Q * brli)); //40.0 to 100.0 approximative factor for Q - 327 for J + if (libr == 1) { + posl = CLIP ((int) (Q * brli)); //40.0 to 100.0 approximative factor for Q - 327 for J } else { /*if(libr == 0)*/ - posl = CLIP((int)(J * brli)); //327 for J + posl = CLIP ((int) (J * brli)); //327 for J } hist16JCAM[posl]++; @@ -1097,15 +1095,15 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh chropC = true; - if(pW != 1) { //only with improccoordinator + if (pW != 1) { //only with improccoordinator int posc; - if(colch == 0) { - posc = CLIP((int)(C * chsacol)); //450.0 approximative factor for s 320 for M - } else if(colch == 1) { - posc = CLIP((int)(s * chsacol)); + if (colch == 0) { + posc = CLIP ((int) (C * chsacol)); //450.0 approximative factor for s 320 for M + } else if (colch == 1) { + posc = CLIP ((int) (s * chsacol)); } else { /*if(colch == 2)*/ - posc = CLIP((int)(M * chsacol)); + posc = CLIP ((int) (M * chsacol)); } hist16_CCAM[posc]++; @@ -1115,42 +1113,42 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh double xx, yy, zz; //double nj, nbbj, ncbj, flj, czj, dj, awj; //process normal==> viewing - Ciecam02::jch2xyz_ciecam02( xx, yy, zz, - J, C, h, - xw2, yw2, zw2, - yb2, la2, - f2, c2, nc2, gamu, nj, nbbj, ncbj, flj, czj, dj, awj); + Ciecam02::jch2xyz_ciecam02 ( xx, yy, zz, + J, C, h, + xw2, yw2, zw2, + yb2, la2, + f2, c2, nc2, gamu, nj, nbbj, ncbj, flj, czj, dj, awj); x = (float)xx * 655.35; y = (float)yy * 655.35; z = (float)zz * 655.35; float Ll, aa, bb; //convert xyz=>lab - Color::XYZ2Lab(x, y, z, Ll, aa, bb); + Color::XYZ2Lab (x, y, z, Ll, aa, bb); lab->L[i][j] = Ll; lab->a[i][j] = aa; lab->b[i][j] = bb; // gamut control in Lab mode; I must study how to do with cIECAM only - if(gamu == 1) { + if (gamu == 1) { float R, G, B; float HH, Lprov1, Chprov1; Lprov1 = lab->L[i][j] / 327.68f; - Chprov1 = sqrt(SQR(lab->a[i][j] / 327.68f) + SQR(lab->b[i][j] / 327.68f)); - HH = atan2(lab->b[i][j], lab->a[i][j]); + Chprov1 = sqrt (SQR (lab->a[i][j] / 327.68f) + SQR (lab->b[i][j] / 327.68f)); + HH = atan2 (lab->b[i][j], lab->a[i][j]); #ifdef _DEBUG bool neg = false; bool more_rgb = false; //gamut control : Lab values are in gamut - Color::gamutLchonly(HH, Lprov1, Chprov1, R, G, B, wip, highlight, 0.15f, 0.96f, neg, more_rgb); + Color::gamutLchonly (HH, Lprov1, Chprov1, R, G, B, wip, highlight, 0.15f, 0.96f, neg, more_rgb); #else //gamut control : Lab values are in gamut - Color::gamutLchonly(HH, Lprov1, Chprov1, R, G, B, wip, highlight, 0.15f, 0.96f); + Color::gamutLchonly (HH, Lprov1, Chprov1, R, G, B, wip, highlight, 0.15f, 0.96f); #endif lab->L[i][j] = Lprov1 * 327.68f; - lab->a[i][j] = 327.68f * Chprov1 * cos(HH); - lab->b[i][j] = 327.68f * Chprov1 * sin(HH); + lab->a[i][j] = 327.68f * Chprov1 * cos (HH); + lab->b[i][j] = 327.68f * Chprov1 * sin (HH); } } @@ -1158,26 +1156,26 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh } // End of parallelization - if(!params->epd.enabled || !params->colorappearance.tonecie || !settings->autocielab) { //normal + if (!params->epd.enabled || !params->colorappearance.tonecie || !settings->autocielab) { //normal //if(!params->epd.enabled || !params->colorappearance.tonecie || !params->colorappearance.sharpcie){//normal - if(ciedata) { + if (ciedata) { //update histogram J - if(pW != 1) { //only with improccoordinator + if (pW != 1) { //only with improccoordinator for (int i = 0; i < 32768; i++) { // if (jp) { float hval = dLcurve[i]; - int hi = (int)(255.0 * CLIPD(hval)); // + int hi = (int) (255.0 * CLIPD (hval)); // histLCAM[hi] += hist16JCAM[i] ; } } } - if(pW != 1) { //only with improccoordinator + if (pW != 1) { //only with improccoordinator for (int i = 0; i < 48000; i++) { // if (chropC) { float hvalc = dCcurve[i]; - int hic = (int)(255.0 * CLIPD(hvalc)); // + int hic = (int) (255.0 * CLIPD (hvalc)); // histCCAM[hic] += hist16_CCAM[i] ; } } @@ -1189,37 +1187,35 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh if (settings->verbose) { t2e.set(); - printf("CIECAM02 performed in %d usec:\n", t2e.etime(t1e)); + printf ("CIECAM02 performed in %d usec:\n", t2e.etime (t1e)); // printf("minc=%f maxc=%f minj=%f maxj=%f\n",minc,maxc,minj,maxj); } #endif - if(settings->autocielab) { + if (settings->autocielab) { //if(params->colorappearance.sharpcie) { //all this treatments reduce artifacts, but can lead to slightly different results - if(params->defringe.enabled) if(execsharp) { + if (params->defringe.enabled) if (execsharp) { ImProcFunctions::defringecam (ncie); // } //if(params->dirpyrequalizer.enabled) if(execsharp) { - if(params->dirpyrequalizer.enabled) { - if(params->dirpyrequalizer.gamutlab /*&& execsharp*/) { - float b_l = static_cast(params->dirpyrequalizer.hueskin.value[0]) / 100.0f; - float t_l = static_cast(params->dirpyrequalizer.hueskin.value[1]) / 100.0f; - float b_r = static_cast(params->dirpyrequalizer.hueskin.value[2]) / 100.0f; - float t_r = static_cast(params->dirpyrequalizer.hueskin.value[3]) / 100.0f; - int choice = 0; + if (params->dirpyrequalizer.enabled) { + if (params->dirpyrequalizer.gamutlab /*&& execsharp*/) { + float b_l = static_cast (params->dirpyrequalizer.hueskin.value[0]) / 100.0f; + float t_l = static_cast (params->dirpyrequalizer.hueskin.value[1]) / 100.0f; + float b_r = static_cast (params->dirpyrequalizer.hueskin.value[2]) / 100.0f; + float t_r = static_cast (params->dirpyrequalizer.hueskin.value[3]) / 100.0f; - bool alread = false; float artifact = (float) settings->artifact_cbdl; - if(artifact > 6.f) { + if (artifact > 6.f) { artifact = 6.f; } - if(artifact < 0.f) { + if (artifact < 0.f) { artifact = 1.f; } @@ -1227,43 +1223,42 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh float chrom = 50.f; { ImProcFunctions::badpixcam (ncie, artifact, 5, 2 , b_l, t_l, t_r, b_r, params->dirpyrequalizer.skinprotect , chrom, hotbad); //enabled remove artifacts for cbDL - alread = true; } } } - if(params->colorappearance.badpixsl > 0) if(execsharp) { + if (params->colorappearance.badpixsl > 0) if (execsharp) { int mode = params->colorappearance.badpixsl; ImProcFunctions::badpixcam (ncie, 3.4, 5, mode, 0, 0, 0, 0, 0, 0, 1);//for bad pixels CIECAM } - if (params->sharpenMicro.enabled)if(execsharp) { - ImProcFunctions::MLmicrocontrastcam(ncie); + if (params->sharpenMicro.enabled)if (execsharp) { + ImProcFunctions::MLmicrocontrastcam (ncie); } - if(params->sharpening.enabled) - if(execsharp) { + if (params->sharpening.enabled) + if (execsharp) { float **buffer = lab->L; // We can use the L-buffer from lab as buffer to save some memory ImProcFunctions::sharpeningcam (ncie, buffer); // sharpening adapted to CIECAM } //if(params->dirpyrequalizer.enabled) if(execsharp) { - if(params->dirpyrequalizer.enabled /*&& (execsharp)*/) { - float b_l = static_cast(params->dirpyrequalizer.hueskin.value[0]) / 100.0f; - float t_l = static_cast(params->dirpyrequalizer.hueskin.value[1]) / 100.0f; - float b_r = static_cast(params->dirpyrequalizer.hueskin.value[2]) / 100.0f; - float t_r = static_cast(params->dirpyrequalizer.hueskin.value[3]) / 100.0f; + if (params->dirpyrequalizer.enabled /*&& (execsharp)*/) { + float b_l = static_cast (params->dirpyrequalizer.hueskin.value[0]) / 100.0f; + float t_l = static_cast (params->dirpyrequalizer.hueskin.value[1]) / 100.0f; + float b_r = static_cast (params->dirpyrequalizer.hueskin.value[2]) / 100.0f; + float t_r = static_cast (params->dirpyrequalizer.hueskin.value[3]) / 100.0f; int choice = 0; //not disabled in case of ! always 0 // if (params->dirpyrequalizer.algo=="FI") choice=0; // else if(params->dirpyrequalizer.algo=="LA") choice=1; - if(rtt == 1) { - dirpyr_equalizercam(ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, ncie->h_p, ncie->C_p, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, true, params->dirpyrequalizer.gamutlab, b_l, t_l, t_r, b_r, choice, scalecd); //contrast by detail adapted to CIECAM + if (rtt == 1) { + dirpyr_equalizercam (ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, ncie->h_p, ncie->C_p, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, true, params->dirpyrequalizer.gamutlab, b_l, t_l, t_r, b_r, choice, scalecd); //contrast by detail adapted to CIECAM } } float Qredi = ( 4.0 / c_) * ( a_w + 4.0 ); - float co_e = (pow(f_l, 0.25f)); + float co_e = (pow (f_l, 0.25f)); #ifndef _DEBUG #pragma omp parallel default(shared) firstprivate(height,width, Qredi,a_w,c_) @@ -1277,18 +1272,18 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh for (int j = 0; j < width; j++) { float interm = Qredi * ncie->sh_p[i][j] / (32768.f); ncie->J_p[i][j] = 100.0 * interm * interm / ((a_w + 4.) * (a_w + 4.) * (4. / c_) * (4. / c_)); - ncie->Q_p[i][j] = ( 4.0 / c_) * ( a_w + 4.0 ) * sqrt(ncie->J_p[i][j] / 100.f); + ncie->Q_p[i][j] = ( 4.0 / c_) * ( a_w + 4.0 ) * sqrt (ncie->J_p[i][j] / 100.f); ncie->M_p[i][j] = ncie->C_p[i][j] * co_e; } } } - if((params->colorappearance.tonecie || (params->colorappearance.tonecie && params->epd.enabled)) || (params->sharpening.enabled && settings->autocielab) + if ((params->colorappearance.tonecie || (params->colorappearance.tonecie && params->epd.enabled)) || (params->sharpening.enabled && settings->autocielab) || (params->dirpyrequalizer.enabled && settings->autocielab) || (params->defringe.enabled && settings->autocielab) || (params->sharpenMicro.enabled && settings->autocielab) || (params->colorappearance.badpixsl > 0 && settings->autocielab)) { - if(params->epd.enabled && params->colorappearance.tonecie && algepd) { - ImProcFunctions::EPDToneMapCIE(ncie, a_w, c_, w_h, width, height, begh, endh, minQ, maxQ, Iterates, scale ); + if (params->epd.enabled && params->colorappearance.tonecie && algepd) { + ImProcFunctions::EPDToneMapCIE (ncie, a_w, c_, w_h, width, height, begh, endh, minQ, maxQ, Iterates, scale ); } //EPDToneMapCIE adapted to CIECAM @@ -1317,11 +1312,11 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh double xx, yy, zz; float x, y, z; const float eps = 0.0001; - float co_e = (pow(f_l, 0.25f)) + eps; + float co_e = (pow (f_l, 0.25f)) + eps; // if(params->epd.enabled) ncie->J_p[i][j]=(100.0* ncie->Q_p[i][j]*ncie->Q_p[i][j])/(w_h*w_h); - if(params->epd.enabled) { - ncie->J_p[i][j] = (100.0 * ncie->Q_p[i][j] * ncie->Q_p[i][j]) / SQR((4. / c) * (aw + 4.)); + if (params->epd.enabled) { + ncie->J_p[i][j] = (100.0 * ncie->Q_p[i][j] * ncie->Q_p[i][j]) / SQR ((4. / c) * (aw + 4.)); } ncie->C_p[i][j] = (ncie->M_p[i][j]) / co_e; @@ -1332,10 +1327,10 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh int colch = 0; float sa_t; - if(curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { brli = 70.0; libr = 1; - } else if(curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { + } else if (curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { brli = 327.; libr = 0; } @@ -1343,26 +1338,26 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { chsacol = 327.; colch = 0; - } else if(curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { + } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { chsacol = 450.0; colch = 1; - } else if(curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { + } else if (curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { chsacol = 327.0; colch = 2; } - if(ciedata) { + if (ciedata) { // Data for J Q M s and C histograms //update histogram jp = true; - if(pW != 1) { //only with improccoordinator + if (pW != 1) { //only with improccoordinator int posl; - if(libr == 1) { - posl = CLIP((int)(ncie->Q_p[i][j] * brli)); //40.0 to 100.0 approximative factor for Q - 327 for J + if (libr == 1) { + posl = CLIP ((int) (ncie->Q_p[i][j] * brli)); //40.0 to 100.0 approximative factor for Q - 327 for J } else { /*if(libr == 0)*/ - posl = CLIP((int)(ncie->J_p[i][j] * brli)); //327 for J + posl = CLIP ((int) (ncie->J_p[i][j] * brli)); //327 for J } hist16JCAM[posl]++; @@ -1370,16 +1365,16 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh chropC = true; - if(pW != 1) { //only with improccoordinator + if (pW != 1) { //only with improccoordinator int posc; - if(colch == 0) { - posc = CLIP((int)(ncie->C_p[i][j] * chsacol)); //450.0 approximative factor for s 320 for M - } else if(colch == 1) { - sa_t = 100.f * sqrt(ncie->C_p[i][j] / ncie->Q_p[i][j]); //Q_p always > 0 - posc = CLIP((int)(sa_t * chsacol)); + if (colch == 0) { + posc = CLIP ((int) (ncie->C_p[i][j] * chsacol)); //450.0 approximative factor for s 320 for M + } else if (colch == 1) { + sa_t = 100.f * sqrt (ncie->C_p[i][j] / ncie->Q_p[i][j]); //Q_p always > 0 + posc = CLIP ((int) (sa_t * chsacol)); } else { /*if(colch == 2)*/ - posc = CLIP((int)(ncie->M_p[i][j] * chsacol)); + posc = CLIP ((int) (ncie->M_p[i][j] * chsacol)); } hist16_CCAM[posc]++; @@ -1388,41 +1383,41 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh //end histograms // double nd, nbbd, ncbd, fld, czd, dd, awd; - Ciecam02::jch2xyz_ciecam02( xx, yy, zz, - ncie->J_p[i][j], ncie->C_p[i][j], ncie->h_p[i][j], - xw2, yw2, zw2, - yb2, la2, - f2, c2, nc2, gamu, nj, nbbj, ncbj, flj, czj, dj, awj); + Ciecam02::jch2xyz_ciecam02 ( xx, yy, zz, + ncie->J_p[i][j], ncie->C_p[i][j], ncie->h_p[i][j], + xw2, yw2, zw2, + yb2, la2, + f2, c2, nc2, gamu, nj, nbbj, ncbj, flj, czj, dj, awj); x = (float)xx * 655.35; y = (float)yy * 655.35; z = (float)zz * 655.35; float Ll, aa, bb; //convert xyz=>lab - Color::XYZ2Lab(x, y, z, Ll, aa, bb); + Color::XYZ2Lab (x, y, z, Ll, aa, bb); lab->L[i][j] = Ll; lab->a[i][j] = aa; lab->b[i][j] = bb; - if(gamu == 1) { + if (gamu == 1) { float R, G, B; float HH, Lprov1, Chprov1; Lprov1 = lab->L[i][j] / 327.68f; - Chprov1 = sqrt(SQR(lab->a[i][j] / 327.68f) + SQR(lab->b[i][j] / 327.68f)); - HH = atan2(lab->b[i][j], lab->a[i][j]); + Chprov1 = sqrt (SQR (lab->a[i][j] / 327.68f) + SQR (lab->b[i][j] / 327.68f)); + HH = atan2 (lab->b[i][j], lab->a[i][j]); #ifdef _DEBUG bool neg = false; bool more_rgb = false; //gamut control : Lab values are in gamut - Color::gamutLchonly(HH, Lprov1, Chprov1, R, G, B, wipa, highlight, 0.15f, 0.96f, neg, more_rgb); + Color::gamutLchonly (HH, Lprov1, Chprov1, R, G, B, wipa, highlight, 0.15f, 0.96f, neg, more_rgb); #else //gamut control : Lab values are in gamut - Color::gamutLchonly(HH, Lprov1, Chprov1, R, G, B, wipa, highlight, 0.15f, 0.96f); + Color::gamutLchonly (HH, Lprov1, Chprov1, R, G, B, wipa, highlight, 0.15f, 0.96f); #endif lab->L[i][j] = Lprov1 * 327.68f; - lab->a[i][j] = 327.68f * Chprov1 * cos(HH); - lab->b[i][j] = 327.68f * Chprov1 * sin(HH); + lab->a[i][j] = 327.68f * Chprov1 * cos (HH); + lab->b[i][j] = 327.68f * Chprov1 * sin (HH); } } @@ -1431,24 +1426,24 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh //end parallelization //show CIECAM histograms - if(ciedata) { + if (ciedata) { //update histogram J and Q - if(pW != 1) { //only with improccoordinator + if (pW != 1) { //only with improccoordinator for (int i = 0; i < 32768; i++) { // if (jp) { float hval = dLcurve[i]; - int hi = (int)(255.0 * CLIPD(hval)); // + int hi = (int) (255.0 * CLIPD (hval)); // histLCAM[hi] += hist16JCAM[i] ; } } } //update color histogram M,s,C - if(pW != 1) { //only with improccoordinator + if (pW != 1) { //only with improccoordinator for (int i = 0; i < 48000; i++) { // if (chropC) { float hvalc = dCcurve[i]; - int hic = (int)(255.0 * CLIPD(hvalc)); // + int hic = (int) (255.0 * CLIPD (hvalc)); // histCCAM[hic] += hist16_CCAM[i] ; } } @@ -1467,7 +1462,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve2, const ColorAppearance & customColCurve3, LUTu & histLCAM, LUTu & histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, float &d, int scalecd, int rtt) { - if(params->colorappearance.enabled) { + if (params->colorappearance.enabled) { #ifdef _DEBUG MyTime t1e, t2e; @@ -1478,10 +1473,10 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int LUTu hist16JCAM; LUTu hist16_CCAM; - if(pW != 1 && params->colorappearance.datacie) { //only with improccoordinator - hist16JCAM(32768); + if (pW != 1 && params->colorappearance.datacie) { //only with improccoordinator + hist16JCAM (32768); hist16JCAM.clear(); - hist16_CCAM(48000); + hist16_CCAM (48000); hist16_CCAM.clear(); } @@ -1492,36 +1487,36 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float Yw; Yw = 1.0; double Xw, Zw; - float f, nc, yb, la, c, xw, yw, zw, f2, c2, nc2, yb2; + float f, nc, yb = 0.f, la, c, xw, yw, zw, f2 = 1.f, c2 = 1.f, nc2 = 1.f, yb2; float fl, n, nbb, ncb, aw; //d float xwd, ywd, zwd; int alg = 0; bool algepd = false; const bool epdEnabled = params->epd.enabled; - bool ciedata = (params->colorappearance.datacie && pW != 1) && !((params->colorappearance.tonecie && (epdEnabled)) || (params->sharpening.enabled && settings->autocielab && execsharp) + bool ciedata = (params->colorappearance.datacie && pW != 1) && ! ((params->colorappearance.tonecie && (epdEnabled)) || (params->sharpening.enabled && settings->autocielab && execsharp) || (params->dirpyrequalizer.enabled && settings->autocielab) || (params->defringe.enabled && settings->autocielab) || (params->sharpenMicro.enabled && settings->autocielab) || (params->impulseDenoise.enabled && settings->autocielab) || (params->colorappearance.badpixsl > 0 && settings->autocielab)); ColorTemp::temp2mulxyz (params->wb.temperature, params->wb.green, params->wb.method, Xw, Zw); //compute white Xw Yw Zw : white current WB //viewing condition for surround - if(params->colorappearance.surround == "Average") { + if (params->colorappearance.surround == "Average") { f = 1.00f; c = 0.69f; nc = 1.00f; f2 = 1.0f, c2 = 0.69f, nc2 = 1.0f; - } else if(params->colorappearance.surround == "Dim") { + } else if (params->colorappearance.surround == "Dim") { f2 = 0.9f; c2 = 0.59f; nc2 = 0.9f; f = 1.0f, c = 0.69f, nc = 1.0f; - } else if(params->colorappearance.surround == "Dark") { + } else if (params->colorappearance.surround == "Dark") { f2 = 0.8f; c2 = 0.525f; nc2 = 0.8f; f = 1.0f, c = 0.69f, nc = 1.0f; - } else if(params->colorappearance.surround == "ExtremelyDark") { + } else if (params->colorappearance.surround == "ExtremelyDark") { f2 = 0.8f; c2 = 0.41f; nc2 = 0.8f; @@ -1529,7 +1524,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int } //scene condition for surround - if(params->colorappearance.surrsource) { + if (params->colorappearance.surrsource) { f = 0.85f; // if user => source image has surround very dark c = 0.55f; nc = 0.85f; @@ -1538,9 +1533,9 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int //with which algorithm if (params->colorappearance.algo == "JC") { alg = 0; - } else if(params->colorappearance.algo == "JS") { + } else if (params->colorappearance.algo == "JS") { alg = 1; - } else if(params->colorappearance.algo == "QM") { + } else if (params->colorappearance.algo == "QM") { alg = 2; algepd = true; } else { /*if(params->colorappearance.algo == "ALL")*/ @@ -1549,31 +1544,31 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int } //settings white point of output device - or illuminant viewing - if(settings->viewingdevice == 0) { + if (settings->viewingdevice == 0) { xwd = 96.42f; //5000K ywd = 100.0f; zwd = 82.52f; - } else if(settings->viewingdevice == 1) { + } else if (settings->viewingdevice == 1) { xwd = 95.68f; //5500 ywd = 100.0f; zwd = 92.15f; - } else if(settings->viewingdevice == 2) { + } else if (settings->viewingdevice == 2) { xwd = 95.24f; //6000 ywd = 100.0f; zwd = 100.81f; - } else if(settings->viewingdevice == 3) { + } else if (settings->viewingdevice == 3) { xwd = 95.04f; //6500 ywd = 100.0f; zwd = 108.88f; - } else if(settings->viewingdevice == 4) { + } else if (settings->viewingdevice == 4) { xwd = 109.85f; //tungsten ywd = 100.0f; zwd = 35.58f; - } else if(settings->viewingdevice == 5) { + } else if (settings->viewingdevice == 5) { xwd = 99.18f; //fluo F2 ywd = 100.0f; zwd = 67.39f; - } else if(settings->viewingdevice == 6) { + } else if (settings->viewingdevice == 6) { xwd = 95.04f; //fluo F7 ywd = 100.0f; zwd = 108.75f; @@ -1585,32 +1580,32 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int //settings mean Luminance Y of output device or viewing - if(settings->viewingdevicegrey == 0) { + if (settings->viewingdevicegrey == 0) { yb2 = 5.0f; - } else if(settings->viewingdevicegrey == 1) { + } else if (settings->viewingdevicegrey == 1) { yb2 = 10.0f; - } else if(settings->viewingdevicegrey == 2) { + } else if (settings->viewingdevicegrey == 2) { yb2 = 15.0f; - } else if(settings->viewingdevicegrey == 3) { + } else if (settings->viewingdevicegrey == 3) { yb2 = 18.0f; - } else if(settings->viewingdevicegrey == 4) { + } else if (settings->viewingdevicegrey == 4) { yb2 = 23.0f; - } else if(settings->viewingdevicegrey == 5) { + } else if (settings->viewingdevicegrey == 5) { yb2 = 30.0f; } else { /* if(settings->viewingdevicegrey == 6)*/ yb2 = 40.0f; } //La and la2 = ambiant luminosity scene and viewing - la = float(params->colorappearance.adapscen); + la = float (params->colorappearance.adapscen); - if(pwb == 2) { - if(params->colorappearance.autoadapscen) { + if (pwb == 2) { + if (params->colorappearance.autoadapscen) { la = adap; } } - const float la2 = float(params->colorappearance.adaplum); + const float la2 = float (params->colorappearance.adaplum); // level of adaptation const float deg = (params->colorappearance.degree) / 100.0f; @@ -1619,33 +1614,33 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int //algoritm's params float chr = 0.f; - if(alg == 0 || alg == 3) { + if (alg == 0 || alg == 3) { chr = params->colorappearance.chroma; - if(chr == -100.0f) { + if (chr == -100.0f) { chr = -99.8f; } } float schr = 0.f; - if(alg == 3 || alg == 1) { + if (alg == 3 || alg == 1) { schr = params->colorappearance.schroma; - if(schr > 0.0) { + if (schr > 0.0) { schr = schr / 2.0f; //divide sensibility for saturation } - if(alg == 3) { - if(schr == -100.0f) { + if (alg == 3) { + if (schr == -100.0f) { schr = -99.f; } - if(schr == 100.0f) { + if (schr == 100.0f) { schr = 98.f; } } else { - if(schr == -100.0f) { + if (schr == -100.0f) { schr = -99.8f; } } @@ -1653,14 +1648,14 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float mchr = 0.f; - if(alg == 3 || alg == 2) { + if (alg == 3 || alg == 2) { mchr = params->colorappearance.mchroma; - if(mchr == -100.0f) { + if (mchr == -100.0f) { mchr = -99.8f ; } - if(mchr == 100.0f) { + if (mchr == 100.0f) { mchr = 99.9f; } } @@ -1670,35 +1665,21 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int // extracting datas from 'params' to avoid cache flush (to be confirmed) const ColorAppearanceParams::eTCModeId curveMode = params->colorappearance.curveMode; - const bool hasColCurve1 = bool(customColCurve1); - bool t1L = false; - bool t1B = false; - - if (hasColCurve1 && curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { - t1L = true; - } - - if(hasColCurve1 && curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { - t1B = true; - } + const bool hasColCurve1 = bool (customColCurve1); + const bool t1L = hasColCurve1 && curveMode == ColorAppearanceParams::TC_MODE_LIGHT; const ColorAppearanceParams::eTCModeId curveMode2 = params->colorappearance.curveMode2; - const bool hasColCurve2 = bool(customColCurve2); - bool t2B = false; - - if(hasColCurve2 && curveMode2 == ColorAppearanceParams::TC_MODE_BRIGHT) { - t2B = true; - } + const bool hasColCurve2 = bool (customColCurve2); const ColorAppearanceParams::eCTCModeId curveMode3 = params->colorappearance.curveMode3; - const bool hasColCurve3 = bool(customColCurve3); + const bool hasColCurve3 = bool (customColCurve3); bool needJ = (alg == 0 || alg == 1 || alg == 3); bool needQ = (alg == 2 || alg == 3); LUTu hist16J; LUTu hist16Q; - if((needJ && CAMBrightCurveJ.dirty) || (needQ && CAMBrightCurveQ.dirty) || (std::isnan(mean) && settings->viewinggreySc != 0)) { + if ((needJ && CAMBrightCurveJ.dirty) || (needQ && CAMBrightCurveQ.dirty) || (std::isnan (mean) && settings->viewinggreySc != 0)) { if (needJ) { hist16J (32768); @@ -1713,7 +1694,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float sum = 0.f; #ifdef _OPENMP - const int numThreads = min(max(width * height / 65536, 1), omp_get_max_threads()); + const int numThreads = min (max (width * height / 65536, 1), omp_get_max_threads()); #pragma omp parallel num_threads(numThreads) if(numThreads>1) #endif { @@ -1721,12 +1702,12 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int LUTu hist16Qthr; if (needJ) { - hist16Jthr(hist16J.getSize()); + hist16Jthr (hist16J.getSize()); hist16Jthr.clear(); } if (needQ) { - hist16Qthr(hist16Q.getSize()); + hist16Qthr (hist16Q.getSize()); hist16Qthr.clear(); } @@ -1737,10 +1718,10 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float currL = lab->L[i][j] / 327.68f; float koef; //rough correspondence between L and J - if(currL > 50.f) { - if(currL > 70.f) { - if(currL > 80.f) { - if(currL > 85.f) { + if (currL > 50.f) { + if (currL > 70.f) { + if (currL > 80.f) { + if (currL > 85.f) { koef = 0.97f; } else { koef = 0.93f; @@ -1756,9 +1737,9 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int } } } else { - if(currL > 10.f) { - if(currL > 20.f) { - if(currL > 40.f) { + if (currL > 10.f) { + if (currL > 20.f) { + if (currL > 40.f) { koef = 0.75f; } else { koef = 0.7f; @@ -1772,11 +1753,11 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int } if (needJ) { - hist16Jthr[(int)((koef * lab->L[i][j]))]++; //evaluate histogram luminance L # J + hist16Jthr[ (int) ((koef * lab->L[i][j]))]++; //evaluate histogram luminance L # J } if (needQ) { - hist16Qthr[(int) (sqrtf((koef * (lab->L[i][j])) * 32768.f))]++; //for brightness Q : approximation for Q=wh*sqrt(J/100) J not equal L + hist16Qthr[ (int) (sqrtf ((koef * (lab->L[i][j])) * 32768.f))]++; //for brightness Q : approximation for Q=wh*sqrt(J/100) J not equal L } sum += koef * lab->L[i][j]; //evaluate mean J to calculate Yb @@ -1784,17 +1765,17 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int #pragma omp critical { - if(needJ) { + if (needJ) { hist16J += hist16Jthr; } - if(needQ) { + if (needQ) { hist16Q += hist16Qthr; } } - if(std::isnan(mean)) { + if (std::isnan (mean)) { mean = (sum / ((height) * width)) / 327.68f; //for Yb for all image...if one day "pipette" we can adapt Yb for each zone } } @@ -1804,31 +1785,31 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int //evaluate lightness, contrast } - if(settings->viewinggreySc == 0) { //auto + if (settings->viewinggreySc == 0) { //auto if (mean < 15.f) { yb = 3.0f; - } else if(mean < 30.f) { + } else if (mean < 30.f) { yb = 5.0f; - } else if(mean < 40.f) { + } else if (mean < 40.f) { yb = 10.0f; - } else if(mean < 45.f) { + } else if (mean < 45.f) { yb = 15.0f; - } else if(mean < 50.f) { + } else if (mean < 50.f) { yb = 18.0f; - } else if(mean < 55.f) { + } else if (mean < 55.f) { yb = 23.0f; - } else if(mean < 60.f) { + } else if (mean < 60.f) { yb = 30.0f; - } else if(mean < 70.f) { + } else if (mean < 70.f) { yb = 40.0f; - } else if(mean < 80.f) { + } else if (mean < 80.f) { yb = 60.0f; - } else if(mean < 90.f) { + } else if (mean < 90.f) { yb = 80.0f; } else { yb = 90.0f; } - } else if(settings->viewinggreySc == 1) { + } else if (settings->viewinggreySc == 1) { yb = 18.0f; //fixed } @@ -1841,7 +1822,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float xw1, yw1, zw1, xw2, yw2, zw2; // settings of WB: scene and viewing - if(params->colorappearance.wbmodel == "RawT") { + if (params->colorappearance.wbmodel == "RawT") { xw1 = 96.46f; //use RT WB; CAT 02 is used for output device (see prefreneces) yw1 = 100.0f; zw1 = 82.445f; @@ -1858,12 +1839,12 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int } float cz, wh, pfl; - Ciecam02::initcam1float(gamu, yb, pilot, f, la, xw, yw, zw, n, d, nbb, ncb, cz, aw, wh, pfl, fl, c); - const float pow1 = pow_F( 1.64f - pow_F( 0.29f, n ), 0.73f ); + Ciecam02::initcam1float (gamu, yb, pilot, f, la, xw, yw, zw, n, d, nbb, ncb, cz, aw, wh, pfl, fl, c); + const float pow1 = pow_F ( 1.64f - pow_F ( 0.29f, n ), 0.73f ); float nj, dj, nbbj, ncbj, czj, awj, flj; - Ciecam02::initcam2float(gamu, yb2, f2, la2, xw2, yw2, zw2, nj, dj, nbbj, ncbj, czj, awj, flj); + Ciecam02::initcam2float (gamu, yb2, f2, la2, xw2, yw2, zw2, nj, dj, nbbj, ncbj, czj, awj, flj); const float reccmcz = 1.f / (c2 * czj); - const float pow1n = pow_F( 1.64f - pow_F( 0.29f, nj ), 0.73f ); + const float pow1n = pow_F ( 1.64f - pow_F ( 0.29f, nj ), 0.73f ); const float epsil = 0.0001f; const float w_h = wh + epsil; @@ -1871,19 +1852,19 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int const float a_w = aw; const float c_ = c; const float f_l = fl; - const float coe = pow_F(fl, 0.25f); + const float coe = pow_F (fl, 0.25f); const float QproFactor = ( 0.4f / c ) * ( aw + 4.0f ) ; - const bool LabPassOne = !((params->colorappearance.tonecie && (epdEnabled)) || (params->sharpening.enabled && settings->autocielab && execsharp) - || (params->dirpyrequalizer.enabled && settings->autocielab) || (params->defringe.enabled && settings->autocielab) || (params->sharpenMicro.enabled && settings->autocielab) - || (params->impulseDenoise.enabled && settings->autocielab) || (params->colorappearance.badpixsl > 0 && settings->autocielab)); + const bool LabPassOne = ! ((params->colorappearance.tonecie && (epdEnabled)) || (params->sharpening.enabled && settings->autocielab && execsharp) + || (params->dirpyrequalizer.enabled && settings->autocielab) || (params->defringe.enabled && settings->autocielab) || (params->sharpenMicro.enabled && settings->autocielab) + || (params->impulseDenoise.enabled && settings->autocielab) || (params->colorappearance.badpixsl > 0 && settings->autocielab)); if (needJ) { if (!CAMBrightCurveJ) { - CAMBrightCurveJ(32768, LUT_CLIP_ABOVE); + CAMBrightCurveJ (32768, LUT_CLIP_ABOVE); } - if(CAMBrightCurveJ.dirty) { + if (CAMBrightCurveJ.dirty) { Ciecam02::curveJfloat (params->colorappearance.jlight, params->colorappearance.contrast, hist16J, CAMBrightCurveJ);//lightness and contrast J CAMBrightCurveJ /= 327.68f; CAMBrightCurveJ.dirty = false; @@ -1892,10 +1873,10 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int if (needQ) { if (!CAMBrightCurveQ) { - CAMBrightCurveQ(32768, LUT_CLIP_ABOVE); + CAMBrightCurveQ (32768, LUT_CLIP_ABOVE); } - if(CAMBrightCurveQ.dirty) { + if (CAMBrightCurveQ.dirty) { Ciecam02::curveJfloat (params->colorappearance.qbright, params->colorappearance.qcontrast, hist16Q, CAMBrightCurveQ);//brightness and contrast Q CAMBrightCurveQ /= coefQ; CAMBrightCurveQ.dirty = false; @@ -1906,9 +1887,9 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int //matrix for current working space TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.working); const float wip[3][3] = { - {(float)wiprof[0][0], (float)wiprof[0][1], (float)wiprof[0][2]}, - {(float)wiprof[1][0], (float)wiprof[1][1], (float)wiprof[1][2]}, - {(float)wiprof[2][0], (float)wiprof[2][1], (float)wiprof[2][2]} + { (float)wiprof[0][0], (float)wiprof[0][1], (float)wiprof[0][2]}, + { (float)wiprof[1][0], (float)wiprof[1][1], (float)wiprof[1][2]}, + { (float)wiprof[2][0], (float)wiprof[2][1], (float)wiprof[2][2]} }; #ifdef __SSE2__ @@ -1940,42 +1921,42 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int vfloat x, y, z; vfloat J, C, h, Q, M, s; - vfloat c655d35 = F2V(655.35f); + vfloat c655d35 = F2V (655.35f); - for(k = 0; k < width - 3; k += 4) { - Color::Lab2XYZ(LVFU(lab->L[i][k]), LVFU(lab->a[i][k]), LVFU(lab->b[i][k]), x, y, z); + for (k = 0; k < width - 3; k += 4) { + Color::Lab2XYZ (LVFU (lab->L[i][k]), LVFU (lab->a[i][k]), LVFU (lab->b[i][k]), x, y, z); x = x / c655d35; y = y / c655d35; z = z / c655d35; - Ciecam02::xyz2jchqms_ciecam02float( J, C, h, - Q, M, s, F2V(aw), F2V(fl), F2V(wh), - x, y, z, - F2V(xw1), F2V(yw1), F2V(zw1), - F2V(c), F2V(nc), F2V(pow1), F2V(nbb), F2V(ncb), F2V(pfl), F2V(cz), F2V(d)); - STVF(Jbuffer[k], J); - STVF(Cbuffer[k], C); - STVF(hbuffer[k], h); - STVF(Qbuffer[k], Q); - STVF(Mbuffer[k], M); - STVF(sbuffer[k], s); + Ciecam02::xyz2jchqms_ciecam02float ( J, C, h, + Q, M, s, F2V (aw), F2V (fl), F2V (wh), + x, y, z, + F2V (xw1), F2V (yw1), F2V (zw1), + F2V (c), F2V (nc), F2V (pow1), F2V (nbb), F2V (ncb), F2V (pfl), F2V (cz), F2V (d)); + STVF (Jbuffer[k], J); + STVF (Cbuffer[k], C); + STVF (hbuffer[k], h); + STVF (Qbuffer[k], Q); + STVF (Mbuffer[k], M); + STVF (sbuffer[k], s); } - for(; k < width; k++) { + for (; k < width; k++) { float L = lab->L[i][k]; float a = lab->a[i][k]; float b = lab->b[i][k]; float x, y, z; //convert Lab => XYZ - Color::Lab2XYZ(L, a, b, x, y, z); + Color::Lab2XYZ (L, a, b, x, y, z); x = x / 655.35f; y = y / 655.35f; z = z / 655.35f; float J, C, h, Q, M, s; - Ciecam02::xyz2jchqms_ciecam02float( J, C, h, - Q, M, s, aw, fl, wh, - x, y, z, - xw1, yw1, zw1, - c, nc, gamu, pow1, nbb, ncb, pfl, cz, d); + Ciecam02::xyz2jchqms_ciecam02float ( J, C, h, + Q, M, s, aw, fl, wh, + x, y, z, + xw1, yw1, zw1, + c, nc, gamu, pow1, nbb, ncb, pfl, cz, d); Jbuffer[k] = J; Cbuffer[k] = C; hbuffer[k] = h; @@ -2004,16 +1985,16 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float b = lab->b[i][j]; float x1, y1, z1; //convert Lab => XYZ - Color::Lab2XYZ(L, a, b, x1, y1, z1); + Color::Lab2XYZ (L, a, b, x1, y1, z1); x = (float)x1 / 655.35f; y = (float)y1 / 655.35f; z = (float)z1 / 655.35f; //process source==> normal - Ciecam02::xyz2jchqms_ciecam02float( J, C, h, - Q, M, s, aw, fl, wh, - x, y, z, - xw1, yw1, zw1, - c, nc, gamu, pow1, nbb, ncb, pfl, cz, d); + Ciecam02::xyz2jchqms_ciecam02float ( J, C, h, + Q, M, s, aw, fl, wh, + x, y, z, + xw1, yw1, zw1, + c, nc, gamu, pow1, nbb, ncb, pfl, cz, d); #endif float Jpro, Cpro, hpro, Qpro, Mpro, spro; Jpro = J; @@ -2024,75 +2005,75 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int spro = s; // we cannot have all algorithms with all chroma curves - if(alg == 0) { + if (alg == 0) { Jpro = CAMBrightCurveJ[Jpro * 327.68f]; //lightness CIECAM02 + contrast - Qpro = QproFactor * sqrtf(Jpro); + Qpro = QproFactor * sqrtf (Jpro); float Cp = (spro * spro * Qpro) / (1000000.f); Cpro = Cp * 100.f; float sres; - Ciecam02::curvecolorfloat(chr, Cp , sres, 1.8f); - Color::skinredfloat(Jpro, hpro, sres, Cp, 55.f, 30.f, 1, rstprotection, 100.f, Cpro); - } else if(alg == 1) { + Ciecam02::curvecolorfloat (chr, Cp , sres, 1.8f); + Color::skinredfloat (Jpro, hpro, sres, Cp, 55.f, 30.f, 1, rstprotection, 100.f, Cpro); + } else if (alg == 1) { // Lightness saturation Jpro = CAMBrightCurveJ[Jpro * 327.68f]; //lightness CIECAM02 + contrast float sres; float Sp = spro / 100.0f; float parsat = 1.5f; //parsat=1.5 =>saturation ; 1.8 => chroma ; 2.5 => colorfullness (personal evaluation) - Ciecam02::curvecolorfloat(schr, Sp , sres, parsat); + Ciecam02::curvecolorfloat (schr, Sp , sres, parsat); float dred = 100.f; // in C mode float protect_red = 80.0f; // in C mode - dred = 100.0f * sqrtf((dred * coe) / Qpro); - protect_red = 100.0f * sqrtf((protect_red * coe) / Qpro); - Color::skinredfloat(Jpro, hpro, sres, Sp, dred, protect_red, 0, rstprotection, 100.f, spro); - Qpro = QproFactor * sqrtf(Jpro); + dred = 100.0f * sqrtf ((dred * coe) / Qpro); + protect_red = 100.0f * sqrtf ((protect_red * coe) / Qpro); + Color::skinredfloat (Jpro, hpro, sres, Sp, dred, protect_red, 0, rstprotection, 100.f, spro); + Qpro = QproFactor * sqrtf (Jpro); Cpro = (spro * spro * Qpro) / (10000.0f); - } else if(alg == 2) { - Qpro = CAMBrightCurveQ[(float)(Qpro * coefQ)]; //brightness and contrast + } else if (alg == 2) { + Qpro = CAMBrightCurveQ[ (float) (Qpro * coefQ)]; //brightness and contrast float Mp, sres; Mp = Mpro / 100.0f; - Ciecam02::curvecolorfloat(mchr, Mp , sres, 2.5f); + Ciecam02::curvecolorfloat (mchr, Mp , sres, 2.5f); float dred = 100.f; //in C mode float protect_red = 80.0f; // in C mode dred *= coe; //in M mode protect_red *= coe; //M mode - Color::skinredfloat(Jpro, hpro, sres, Mp, dred, protect_red, 0, rstprotection, 100.f, Mpro); - Jpro = SQR((10.f * Qpro) / wh); + Color::skinredfloat (Jpro, hpro, sres, Mp, dred, protect_red, 0, rstprotection, 100.f, Mpro); + Jpro = SQR ((10.f * Qpro) / wh); Cpro = Mpro / coe; Qpro = (Qpro == 0.f ? epsil : Qpro); // avoid division by zero - spro = 100.0f * sqrtf( Mpro / Qpro ); + spro = 100.0f * sqrtf ( Mpro / Qpro ); } else { /*if(alg == 3) */ - Qpro = CAMBrightCurveQ[(float)(Qpro * coefQ)]; //brightness and contrast + Qpro = CAMBrightCurveQ[ (float) (Qpro * coefQ)]; //brightness and contrast float Mp, sres; Mp = Mpro / 100.0f; - Ciecam02::curvecolorfloat(mchr, Mp , sres, 2.5f); + Ciecam02::curvecolorfloat (mchr, Mp , sres, 2.5f); float dred = 100.f; //in C mode float protect_red = 80.0f; // in C mode dred *= coe; //in M mode protect_red *= coe; //M mode - Color::skinredfloat(Jpro, hpro, sres, Mp, dred, protect_red, 0, rstprotection, 100.f, Mpro); - Jpro = SQR((10.f * Qpro) / wh); + Color::skinredfloat (Jpro, hpro, sres, Mp, dred, protect_red, 0, rstprotection, 100.f, Mpro); + Jpro = SQR ((10.f * Qpro) / wh); Cpro = Mpro / coe; Qpro = (Qpro == 0.f ? epsil : Qpro); // avoid division by zero - spro = 100.0f * sqrtf( Mpro / Qpro ); + spro = 100.0f * sqrtf ( Mpro / Qpro ); - if(Jpro > 99.9f) { + if (Jpro > 99.9f) { Jpro = 99.9f; } - Jpro = CAMBrightCurveJ[(float)(Jpro * 327.68f)]; //lightness CIECAM02 + contrast + Jpro = CAMBrightCurveJ[ (float) (Jpro * 327.68f)]; //lightness CIECAM02 + contrast float Sp = spro / 100.0f; - Ciecam02::curvecolorfloat(schr, Sp , sres, 1.5f); + Ciecam02::curvecolorfloat (schr, Sp , sres, 1.5f); dred = 100.f; // in C mode protect_red = 80.0f; // in C mode - dred = 100.0f * sqrtf((dred * coe) / Q); - protect_red = 100.0f * sqrtf((protect_red * coe) / Q); - Color::skinredfloat(Jpro, hpro, sres, Sp, dred, protect_red, 0, rstprotection, 100.f, spro); - Qpro = QproFactor * sqrtf(Jpro); + dred = 100.0f * sqrtf ((dred * coe) / Q); + protect_red = 100.0f * sqrtf ((protect_red * coe) / Q); + Color::skinredfloat (Jpro, hpro, sres, Sp, dred, protect_red, 0, rstprotection, 100.f, spro); + Qpro = QproFactor * sqrtf (Jpro); float Cp = (spro * spro * Qpro) / (1000000.f); Cpro = Cp * 100.f; - Ciecam02::curvecolorfloat(chr, Cp , sres, 1.8f); - Color::skinredfloat(Jpro, hpro, sres, Cp, 55.f, 30.f, 1, rstprotection, 100.f, Cpro); + Ciecam02::curvecolorfloat (chr, Cp , sres, 1.8f); + Color::skinredfloat (Jpro, hpro, sres, Cp, 55.f, 30.f, 1, rstprotection, 100.f, Cpro); // disabled this code, Issue 2690 // if(Jpro < 1.f && Cpro > 12.f) Cpro=12.f;//reduce artifacts by "pseudo gamut control CIECAM" // else if(Jpro < 2.f && Cpro > 15.f) Cpro=15.f; @@ -2100,7 +2081,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int // else if(Jpro < 7.f && Cpro > 50.f) Cpro=50.f; hpro = hpro + hue; - if( hpro < 0.0f ) { + if ( hpro < 0.0f ) { hpro += 360.0f; //hue } } @@ -2112,27 +2093,27 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float Jold100 = (float) Jpro; float redu = 25.f; float reduc = 1.f; - const Lightcurve& userColCurveJ1 = static_cast(customColCurve1); - userColCurveJ1.Apply(Jj); + const Lightcurve& userColCurveJ1 = static_cast (customColCurve1); + userColCurveJ1.Apply (Jj); - if(Jj > Jold) { - if(Jj < 65535.f) { - if(Jold < 327.68f * redu) { + if (Jj > Jold) { + if (Jj < 65535.f) { + if (Jold < 327.68f * redu) { Jj = 0.3f * (Jj - Jold) + Jold; //divide sensibility } else { - reduc = LIM((100.f - Jold100) / (100.f - redu), 0.f, 1.f); + reduc = LIM ((100.f - Jold100) / (100.f - redu), 0.f, 1.f); Jj = 0.3f * reduc * (Jj - Jold) + Jold; //reduct sensibility in highlights } } - } else if(Jj > 10.f) { + } else if (Jj > 10.f) { Jj = 0.8f * (Jj - Jold) + Jold; } else if (Jj >= 0.f) { Jj = 0.90f * (Jj - Jold) + Jold; // not zero ==>artifacts } - Jpro = (float)(Jj / 327.68f); + Jpro = (float) (Jj / 327.68f); - if(Jpro < 1.f) { + if (Jpro < 1.f) { Jpro = 1.f; } } else if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { @@ -2145,28 +2126,28 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float redu = 20.f; float reduc = 1.f; - const Brightcurve& userColCurveB1 = static_cast(customColCurve1); - userColCurveB1.Apply(Qq); + const Brightcurve& userColCurveB1 = static_cast (customColCurve1); + userColCurveB1.Apply (Qq); - if(Qq > Qold) { - if(Qq < 65535.f) { - if(Qold < 327.68f * redu) { + if (Qq > Qold) { + if (Qq < 65535.f) { + if (Qold < 327.68f * redu) { Qq = 0.25f * (Qq - Qold) + Qold; //divide sensibility } else { - reduc = LIM((100.f - Qold100) / (100.f - redu), 0.f, 1.f); + reduc = LIM ((100.f - Qold100) / (100.f - redu), 0.f, 1.f); Qq = 0.25f * reduc * (Qq - Qold) + Qold; //reduct sensibility in highlights } } - } else if(Qq > 10.f) { + } else if (Qq > 10.f) { Qq = 0.5f * (Qq - Qold) + Qold; } else if (Qq >= 0.f) { Qq = 0.7f * (Qq - Qold) + Qold; // not zero ==>artifacts } - Qpro = (float)(Qq * (coef) / 327.68f); + Qpro = (float) (Qq * (coef) / 327.68f); Jpro = 100.f * (Qpro * Qpro) / ((4.0f / c) * (4.0f / c) * (aw + 4.0f) * (aw + 4.0f)); - if(Jpro < 1.f) { + if (Jpro < 1.f) { Jpro = 1.f; } } @@ -2179,35 +2160,35 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float Jold100 = (float) Jpro; float redu = 25.f; float reduc = 1.f; - const Lightcurve& userColCurveJ2 = static_cast(customColCurve2); - userColCurveJ2.Apply(Jj); + const Lightcurve& userColCurveJ2 = static_cast (customColCurve2); + userColCurveJ2.Apply (Jj); - if(Jj > Jold) { - if(Jj < 65535.f) { - if(Jold < 327.68f * redu) { + if (Jj > Jold) { + if (Jj < 65535.f) { + if (Jold < 327.68f * redu) { Jj = 0.3f * (Jj - Jold) + Jold; //divide sensibility } else { - reduc = LIM((100.f - Jold100) / (100.f - redu), 0.f, 1.f); + reduc = LIM ((100.f - Jold100) / (100.f - redu), 0.f, 1.f); Jj = 0.3f * reduc * (Jj - Jold) + Jold; //reduct sensibility in highlights } } - } else if(Jj > 10.f) { - if(!t1L) { + } else if (Jj > 10.f) { + if (!t1L) { Jj = 0.8f * (Jj - Jold) + Jold; } else { Jj = 0.4f * (Jj - Jold) + Jold; } } else if (Jj >= 0.f) { - if(!t1L) { + if (!t1L) { Jj = 0.90f * (Jj - Jold) + Jold; // not zero ==>artifacts } else { Jj = 0.5f * (Jj - Jold) + Jold; } } - Jpro = (float)(Jj / 327.68f); + Jpro = (float) (Jj / 327.68f); - if(Jpro < 1.f) { + if (Jpro < 1.f) { Jpro = 1.f; } @@ -2220,39 +2201,39 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float redu = 20.f; float reduc = 1.f; - const Brightcurve& userColCurveB2 = static_cast(customColCurve2); - userColCurveB2.Apply(Qq); + const Brightcurve& userColCurveB2 = static_cast (customColCurve2); + userColCurveB2.Apply (Qq); - if(Qq > Qold) { - if(Qq < 65535.f) { - if(Qold < 327.68f * redu) { + if (Qq > Qold) { + if (Qq < 65535.f) { + if (Qold < 327.68f * redu) { Qq = 0.25f * (Qq - Qold) + Qold; //divide sensibility } else { - reduc = LIM((100.f - Qold100) / (100.f - redu), 0.f, 1.f); + reduc = LIM ((100.f - Qold100) / (100.f - redu), 0.f, 1.f); Qq = 0.25f * reduc * (Qq - Qold) + Qold; //reduct sensibility in highlights } } - } else if(Qq > 10.f) { + } else if (Qq > 10.f) { Qq = 0.5f * (Qq - Qold) + Qold; } else if (Qq >= 0.f) { Qq = 0.7f * (Qq - Qold) + Qold; // not zero ==>artifacts } - Qpro = (float)(Qq * (coef) / 327.68f); + Qpro = (float) (Qq * (coef) / 327.68f); Jpro = 100.f * (Qpro * Qpro) / ((4.0f / c) * (4.0f / c) * (aw + 4.0f) * (aw + 4.0f)); - if(t1L) { //to workaround the problem if we modify curve1-lightnees after curve2 brightness(the cat that bites its own tail!) in fact it's another type of curve only for this case + if (t1L) { //to workaround the problem if we modify curve1-lightnees after curve2 brightness(the cat that bites its own tail!) in fact it's another type of curve only for this case coef = 2.f; //adapt Q to J approximation Qq = (float) Qpro * coef; Qold = Qq; - const Lightcurve& userColCurveJ1 = static_cast(customColCurve1); - userColCurveJ1.Apply(Qq); + const Lightcurve& userColCurveJ1 = static_cast (customColCurve1); + userColCurveJ1.Apply (Qq); Qq = 0.05f * (Qq - Qold) + Qold; //approximative adaptation - Qpro = (float)(Qq / coef); + Qpro = (float) (Qq / coef); Jpro = 100.f * (Qpro * Qpro) / ((4.0f / c) * (4.0f / c) * (aw + 4.0f) * (aw + 4.0f)); } - if(Jpro < 1.f) { + if (Jpro < 1.f) { Jpro = 1.f; } } @@ -2264,13 +2245,13 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float coef = 327.68f / parsat; float Cc = (float) Cpro * coef; float Ccold = Cc; - const Chromacurve& userColCurve = static_cast(customColCurve3); - userColCurve.Apply(Cc); + const Chromacurve& userColCurve = static_cast (customColCurve3); + userColCurve.Apply (Cc); float dred = 55.f; float protect_red = 30.0f; int sk = 1; float ko = 1.f / coef; - Color::skinredfloat(Jpro, hpro, Cc, Ccold, dred, protect_red, sk, rstprotection, ko, Cpro); + Color::skinredfloat (Jpro, hpro, Cc, Ccold, dred, protect_red, sk, rstprotection, ko, Cpro); /* if(Jpro < 1.f && Cpro > 12.f) { Cpro = 12.f; //reduce artifacts by "pseudo gamut control CIECAM" @@ -2287,32 +2268,32 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float coef = 327.68f / parsat; float Ss = (float) spro * coef; float Sold = Ss; - const Saturcurve& userColCurve = static_cast(customColCurve3); - userColCurve.Apply(Ss); + const Saturcurve& userColCurve = static_cast (customColCurve3); + userColCurve.Apply (Ss); Ss = 0.6f * (Ss - Sold) + Sold; //divide sensibility saturation float dred = 100.f; // in C mode float protect_red = 80.0f; // in C mode - dred = 100.0f * sqrtf((dred * coe) / Qpro); - protect_red = 100.0f * sqrtf((protect_red * coe) / Qpro); + dred = 100.0f * sqrtf ((dred * coe) / Qpro); + protect_red = 100.0f * sqrtf ((protect_red * coe) / Qpro); int sk = 0; float ko = 1.f / coef; - Color::skinredfloat(Jpro, hpro, Ss, Sold, dred, protect_red, sk, rstprotection, ko, spro); - Qpro = ( 4.0f / c ) * sqrtf( Jpro / 100.0f ) * ( aw + 4.0f ) ; + Color::skinredfloat (Jpro, hpro, Ss, Sold, dred, protect_red, sk, rstprotection, ko, spro); + Qpro = ( 4.0f / c ) * sqrtf ( Jpro / 100.0f ) * ( aw + 4.0f ) ; Cpro = (spro * spro * Qpro) / (10000.0f); } else if (curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { // float parsat = 0.8f; //0.68; float coef = 327.68f / parsat; float Mm = (float) Mpro * coef; float Mold = Mm; - const Colorfcurve& userColCurve = static_cast(customColCurve3); - userColCurve.Apply(Mm); + const Colorfcurve& userColCurve = static_cast (customColCurve3); + userColCurve.Apply (Mm); float dred = 100.f; //in C mode float protect_red = 80.0f; // in C mode dred *= coe; //in M mode protect_red *= coe; int sk = 0; float ko = 1.f / coef; - Color::skinredfloat(Jpro, hpro, Mm, Mold, dred, protect_red, sk, rstprotection, ko, Mpro); + Color::skinredfloat (Jpro, hpro, Mm, Mold, dred, protect_red, sk, rstprotection, ko, Mpro); /* if(Jpro < 1.f && Mpro > 12.f * coe) { Mpro = 12.f * coe; //reduce artifacts by "pseudo gamut control CIECAM" @@ -2339,28 +2320,28 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int h = hpro; s = spro; - if(params->colorappearance.tonecie || settings->autocielab) { //use pointer for tonemapping with CIECAM and also sharpening , defringe, contrast detail + if (params->colorappearance.tonecie || settings->autocielab) { //use pointer for tonemapping with CIECAM and also sharpening , defringe, contrast detail ncie->Q_p[i][j] = (float)Q + epsil; //epsil to avoid Q=0 ncie->M_p[i][j] = (float)M + epsil; ncie->J_p[i][j] = (float)J + epsil; ncie->h_p[i][j] = (float)h; ncie->C_p[i][j] = (float)C + epsil; - ncie->sh_p[i][j] = (float) 3276.8f * (sqrtf( J ) ) ; + ncie->sh_p[i][j] = (float) 3276.8f * (sqrtf ( J ) ) ; - if(epdEnabled) { - if(ncie->Q_p[i][j] < minQThr) { + if (epdEnabled) { + if (ncie->Q_p[i][j] < minQThr) { minQThr = ncie->Q_p[i][j]; //minima } - if(ncie->Q_p[i][j] > maxQThr) { + if (ncie->Q_p[i][j] > maxQThr) { maxQThr = ncie->Q_p[i][j]; //maxima } } } - if(!params->colorappearance.tonecie || !settings->autocielab || !epdEnabled) { + if (!params->colorappearance.tonecie || !settings->autocielab || !epdEnabled) { - if(ciedata) { //only with improccoordinator + if (ciedata) { //only with improccoordinator // Data for J Q M s and C histograms int posl, posc; float brli = 327.f; @@ -2369,7 +2350,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float colch; //update histogram - if(curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { brli = 70.0f; libr = Q; //40.0 to 100.0 approximative factor for Q - 327 for J } else { /*if(curveMode == ColorAppearanceParams::TC_MODE_LIGHT)*/ @@ -2377,13 +2358,13 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int libr = J; //327 for J } - posl = (int)(libr * brli); + posl = (int) (libr * brli); hist16JCAM[posl]++; if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { chsacol = 327.f; colch = C; //450.0 approximative factor for s 320 for M - } else if(curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { + } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { chsacol = 450.0f; colch = s; } else { /*if(curveMode3 == ColorAppearanceParams::TC_MODE_COLORF)*/ @@ -2391,12 +2372,12 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int colch = M; } - posc = (int)(colch * chsacol); + posc = (int) (colch * chsacol); hist16_CCAM[posc]++; } - if(LabPassOne) { + if (LabPassOne) { #ifdef __SSE2__ // write to line buffers Jbuffer[j] = J; @@ -2406,27 +2387,27 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float xx, yy, zz; //process normal==> viewing - Ciecam02::jch2xyz_ciecam02float( xx, yy, zz, - J, C, h, - xw2, yw2, zw2, - f2, c2, nc2, gamu, pow1n, nbbj, ncbj, flj, czj, dj, awj); + Ciecam02::jch2xyz_ciecam02float ( xx, yy, zz, + J, C, h, + xw2, yw2, zw2, + f2, c2, nc2, gamu, pow1n, nbbj, ncbj, flj, czj, dj, awj); float x, y, z; x = xx * 655.35f; y = yy * 655.35f; z = zz * 655.35f; float Ll, aa, bb; //convert xyz=>lab - Color::XYZ2Lab(x, y, z, Ll, aa, bb); + Color::XYZ2Lab (x, y, z, Ll, aa, bb); // gamut control in Lab mode; I must study how to do with cIECAM only - if(gamu == 1) { + if (gamu == 1) { float HH, Lprov1, Chprov1; Lprov1 = Ll / 327.68f; - Chprov1 = sqrtf(SQR(aa) + SQR(bb)) / 327.68f; - HH = xatan2f(bb, aa); + Chprov1 = sqrtf (SQR (aa) + SQR (bb)) / 327.68f; + HH = xatan2f (bb, aa); float2 sincosval; - if(Chprov1 == 0.0f) { + if (Chprov1 == 0.0f) { sincosval.y = 1.f; sincosval.x = 0.0f; } else { @@ -2439,10 +2420,10 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int bool neg = false; bool more_rgb = false; //gamut control : Lab values are in gamut - Color::gamutLchonly(sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f, neg, more_rgb); + Color::gamutLchonly (sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f, neg, more_rgb); #else //gamut control : Lab values are in gamut - Color::gamutLchonly(sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f); + Color::gamutLchonly (sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f); #endif lab->L[i][j] = Lprov1 * 327.68f; @@ -2466,32 +2447,31 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float *ybuffer = Mbuffer; float *zbuffer = sbuffer; - for(k = 0; k < bufferLength; k += 4) { - Ciecam02::jch2xyz_ciecam02float( x, y, z, - LVF(Jbuffer[k]), LVF(Cbuffer[k]), LVF(hbuffer[k]), - F2V(xw2), F2V(yw2), F2V(zw2), - F2V(f2), F2V(nc2), F2V(pow1n), F2V(nbbj), F2V(ncbj), F2V(flj), F2V(dj), F2V(awj), F2V(reccmcz)); - STVF(xbuffer[k], x * c655d35); - STVF(ybuffer[k], y * c655d35); - STVF(zbuffer[k], z * c655d35); + for (k = 0; k < bufferLength; k += 4) { + Ciecam02::jch2xyz_ciecam02float ( x, y, z, + LVF (Jbuffer[k]), LVF (Cbuffer[k]), LVF (hbuffer[k]), + F2V (xw2), F2V (yw2), F2V (zw2), + F2V (f2), F2V (nc2), F2V (pow1n), F2V (nbbj), F2V (ncbj), F2V (flj), F2V (dj), F2V (awj), F2V (reccmcz)); + STVF (xbuffer[k], x * c655d35); + STVF (ybuffer[k], y * c655d35); + STVF (zbuffer[k], z * c655d35); } // XYZ2Lab uses a lookup table. The function behind that lut is a cube root. // SSE can't beat the speed of that lut, so it doesn't make sense to use SSE - for(int j = 0; j < width; j++) { + for (int j = 0; j < width; j++) { float Ll, aa, bb; //convert xyz=>lab - Color::XYZ2Lab(xbuffer[j], ybuffer[j], zbuffer[j], Ll, aa, bb); + Color::XYZ2Lab (xbuffer[j], ybuffer[j], zbuffer[j], Ll, aa, bb); // gamut control in Lab mode; I must study how to do with cIECAM only - if(gamu == 1) { - float HH, Lprov1, Chprov1; + if (gamu == 1) { + float Lprov1, Chprov1; Lprov1 = Ll / 327.68f; - Chprov1 = sqrtf(SQR(aa) + SQR(bb)) / 327.68f; - HH = xatan2f(bb, aa); + Chprov1 = sqrtf (SQR (aa) + SQR (bb)) / 327.68f; float2 sincosval; - if(Chprov1 == 0.0f) { + if (Chprov1 == 0.0f) { sincosval.y = 1.f; sincosval.x = 0.0f; } else { @@ -2503,10 +2483,10 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int bool neg = false; bool more_rgb = false; //gamut control : Lab values are in gamut - Color::gamutLchonly(sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f, neg, more_rgb); + Color::gamutLchonly (sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f, neg, more_rgb); #else //gamut control : Lab values are in gamut - Color::gamutLchonly(sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f); + Color::gamutLchonly (sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f); #endif lab->L[i][j] = Lprov1 * 327.68f; lab->a[i][j] = 327.68f * Chprov1 * sincosval.y; @@ -2523,24 +2503,24 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int #pragma omp critical { - if(minQThr < minQ) { + if (minQThr < minQ) { minQ = minQThr; } - if(maxQThr > maxQ) { + if (maxQThr > maxQ) { maxQ = maxQThr; } } } // End of parallelization - if(!params->colorappearance.tonecie || !settings->autocielab) { //normal + if (!params->colorappearance.tonecie || !settings->autocielab) { //normal - if(ciedata) { + if (ciedata) { //update histogram J - hist16JCAM.compressTo(histLCAM); + hist16JCAM.compressTo (histLCAM); //update histogram C - hist16_CCAM.compressTo(histCCAM); + hist16_CCAM.compressTo (histCCAM); } } @@ -2548,14 +2528,14 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int if (settings->verbose) { t2e.set(); - printf("CIECAM02 performed in %d usec:\n", t2e.etime(t1e)); + printf ("CIECAM02 performed in %d usec:\n", t2e.etime (t1e)); // printf("minc=%f maxc=%f minj=%f maxj=%f\n",minc,maxc,minj,maxj); } #endif - if(settings->autocielab) { - if((params->colorappearance.tonecie && (epdEnabled)) || (params->sharpening.enabled && settings->autocielab && execsharp) + if (settings->autocielab) { + if ((params->colorappearance.tonecie && (epdEnabled)) || (params->sharpening.enabled && settings->autocielab && execsharp) || (params->dirpyrequalizer.enabled && settings->autocielab) || (params->defringe.enabled && settings->autocielab) || (params->sharpenMicro.enabled && settings->autocielab) || (params->impulseDenoise.enabled && settings->autocielab) || (params->colorappearance.badpixsl > 0 && settings->autocielab)) { @@ -2563,27 +2543,27 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int //all this treatments reduce artefacts, but can leed to slighty different results - if(params->defringe.enabled) - if(execsharp) { + if (params->defringe.enabled) + if (execsharp) { lab->deleteLab(); ImProcFunctions::defringecam (ncie);//defringe adapted to CIECAM lab->reallocLab(); } //if(params->dirpyrequalizer.enabled) if(execsharp) { - if(params->dirpyrequalizer.enabled) { - if(params->dirpyrequalizer.gamutlab /*&& execsharp*/) {//remove artifacts by gaussian blur - skin control - float b_l = static_cast(params->dirpyrequalizer.hueskin.value[0]) / 100.0f; - float t_l = static_cast(params->dirpyrequalizer.hueskin.value[1]) / 100.0f; - float b_r = static_cast(params->dirpyrequalizer.hueskin.value[2]) / 100.0f; - float t_r = static_cast(params->dirpyrequalizer.hueskin.value[3]) / 100.0f; + if (params->dirpyrequalizer.enabled) { + if (params->dirpyrequalizer.gamutlab /*&& execsharp*/) { //remove artifacts by gaussian blur - skin control + float b_l = static_cast (params->dirpyrequalizer.hueskin.value[0]) / 100.0f; + float t_l = static_cast (params->dirpyrequalizer.hueskin.value[1]) / 100.0f; + float b_r = static_cast (params->dirpyrequalizer.hueskin.value[2]) / 100.0f; + float t_r = static_cast (params->dirpyrequalizer.hueskin.value[3]) / 100.0f; float artifact = (float) settings->artifact_cbdl; - if(artifact > 6.f) { + if (artifact > 6.f) { artifact = 6.f; } - if(artifact < 0.f) { + if (artifact < 0.f) { artifact = 1.f; } @@ -2596,14 +2576,14 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int } //if(params->colorappearance.badpixsl > 0) { int mode=params->colorappearance.badpixsl; - if(params->colorappearance.badpixsl > 0) if(execsharp) { + if (params->colorappearance.badpixsl > 0) if (execsharp) { int mode = params->colorappearance.badpixsl; lab->deleteLab(); ImProcFunctions::badpixcam (ncie, 3.0, 10, mode, 0, 0, 0, 0, 0, 0, 1);//for bad pixels CIECAM lab->reallocLab(); } - if(params->impulseDenoise.enabled) if(execsharp) { + if (params->impulseDenoise.enabled) if (execsharp) { float **buffers[3]; buffers[0] = lab->L; buffers[1] = lab->a; @@ -2611,29 +2591,29 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int ImProcFunctions::impulsedenoisecam (ncie, buffers); //impulse adapted to CIECAM } - if (params->sharpenMicro.enabled)if(execsharp) { - ImProcFunctions::MLmicrocontrastcam(ncie); + if (params->sharpenMicro.enabled)if (execsharp) { + ImProcFunctions::MLmicrocontrastcam (ncie); } - if(params->sharpening.enabled) - if(execsharp) { + if (params->sharpening.enabled) + if (execsharp) { float **buffer = lab->L; // We can use the L-buffer from lab as buffer to save some memory ImProcFunctions::sharpeningcam (ncie, buffer); // sharpening adapted to CIECAM } //if(params->dirpyrequalizer.enabled) if(execsharp) { - if(params->dirpyrequalizer.enabled /*&& execsharp*/) { - float b_l = static_cast(params->dirpyrequalizer.hueskin.value[0]) / 100.0f; - float t_l = static_cast(params->dirpyrequalizer.hueskin.value[1]) / 100.0f; - float b_r = static_cast(params->dirpyrequalizer.hueskin.value[2]) / 100.0f; - float t_r = static_cast(params->dirpyrequalizer.hueskin.value[3]) / 100.0f; + if (params->dirpyrequalizer.enabled /*&& execsharp*/) { + float b_l = static_cast (params->dirpyrequalizer.hueskin.value[0]) / 100.0f; + float t_l = static_cast (params->dirpyrequalizer.hueskin.value[1]) / 100.0f; + float b_r = static_cast (params->dirpyrequalizer.hueskin.value[2]) / 100.0f; + float t_r = static_cast (params->dirpyrequalizer.hueskin.value[3]) / 100.0f; int choice = 0; // I have not suppress this statement in case of !! always to 0 // if(params->dirpyrequalizer.algo=="FI") choice=0; // else if(params->dirpyrequalizer.algo=="LA") choice=1; - if(rtt == 1) { + if (rtt == 1) { lab->deleteLab(); - dirpyr_equalizercam(ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, ncie->h_p, ncie->C_p, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, true, params->dirpyrequalizer.gamutlab, b_l, t_l, t_r, b_r, choice, scalecd); //contrast by detail adapted to CIECAM + dirpyr_equalizercam (ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, ncie->h_p, ncie->C_p, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, true, params->dirpyrequalizer.gamutlab, b_l, t_l, t_r, b_r, choice, scalecd); //contrast by detail adapted to CIECAM lab->reallocLab(); } @@ -2646,7 +2626,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int } const float Qredi = ( 4.0f / c_) * ( a_w + 4.0f ); - const float co_e = (pow_F(f_l, 0.25f)); + const float co_e = (pow_F (f_l, 0.25f)); #ifndef _DEBUG @@ -2659,8 +2639,8 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int for (int i = 0; i < height; i++) // update CieImages with new values after sharpening, defringe, contrast by detail level for (int j = 0; j < width; j++) { - float interm = fabsf(ncie->sh_p[i][j] / (32768.f)); - ncie->J_p[i][j] = 100.0f * SQR(interm); + float interm = fabsf (ncie->sh_p[i][j] / (32768.f)); + ncie->J_p[i][j] = 100.0f * SQR (interm); ncie->Q_p[i][j] = interm * Qredi; ncie->M_p[i][j] = ncie->C_p[i][j] * co_e; } @@ -2668,15 +2648,15 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int } } - if((params->colorappearance.tonecie && (epdEnabled)) || (params->sharpening.enabled && settings->autocielab && execsharp) + if ((params->colorappearance.tonecie && (epdEnabled)) || (params->sharpening.enabled && settings->autocielab && execsharp) || (params->dirpyrequalizer.enabled && settings->autocielab) || (params->defringe.enabled && settings->autocielab) || (params->sharpenMicro.enabled && settings->autocielab) || (params->impulseDenoise.enabled && settings->autocielab) || (params->colorappearance.badpixsl > 0 && settings->autocielab)) { ciedata = (params->colorappearance.datacie && pW != 1); - if(epdEnabled && params->colorappearance.tonecie && algepd) { + if (epdEnabled && params->colorappearance.tonecie && algepd) { lab->deleteLab(); - ImProcFunctions::EPDToneMapCIE(ncie, a_w, c_, w_h, width, height, begh, endh, minQ, maxQ, Iterates, scale ); + ImProcFunctions::EPDToneMapCIE (ncie, a_w, c_, w_h, width, height, begh, endh, minQ, maxQ, Iterates, scale ); lab->reallocLab(); } @@ -2684,7 +2664,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int constexpr float eps = 0.0001f; - const float co_e = (pow_F(f_l, 0.25f)) + eps; + const float co_e = (pow_F (f_l, 0.25f)) + eps; #ifndef _DEBUG #pragma omp parallel @@ -2708,14 +2688,14 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int for (int j = 0; j < width; j++) { // if(epdEnabled) ncie->J_p[i][j]=(100.0f* ncie->Q_p[i][j]*ncie->Q_p[i][j])/(w_h*w_h); - if(epdEnabled) { - ncie->J_p[i][j] = (100.0f * ncie->Q_p[i][j] * ncie->Q_p[i][j]) / SQR((4.f / c) * (aw + 4.f)); + if (epdEnabled) { + ncie->J_p[i][j] = (100.0f * ncie->Q_p[i][j] * ncie->Q_p[i][j]) / SQR ((4.f / c) * (aw + 4.f)); } const float ncie_C_p = (ncie->M_p[i][j]) / co_e; //show histogram in CIECAM mode (Q,J, M,s,C) - if(ciedata) { + if (ciedata) { // Data for J Q M s and C histograms int posl, posc; float brli = 327.f; @@ -2723,7 +2703,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float libr; float colch; - if(curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { brli = 70.0f; libr = ncie->Q_p[i][j]; //40.0 to 100.0 approximative factor for Q - 327 for J } else { /*if(curveMode == ColorAppearanceParams::TC_MODE_LIGHT)*/ @@ -2731,21 +2711,21 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int libr = ncie->J_p[i][j]; //327 for J } - posl = (int)(libr * brli); + posl = (int) (libr * brli); hist16JCAM[posl]++; if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { chsacol = 327.f; colch = ncie_C_p; - } else if(curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { + } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { chsacol = 450.0f; - colch = 100.f * sqrtf(ncie_C_p / ncie->Q_p[i][j]); + colch = 100.f * sqrtf (ncie_C_p / ncie->Q_p[i][j]); } else { /*if(curveMode3 == ColorAppearanceParams::TC_MODE_COLORF)*/ chsacol = 327.0f; colch = ncie->M_p[i][j]; } - posc = (int)(colch * chsacol); + posc = (int) (colch * chsacol); hist16_CCAM[posc]++; } @@ -2757,24 +2737,24 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int hbuffer[j] = ncie->h_p[i][j]; #else float xx, yy, zz; - Ciecam02::jch2xyz_ciecam02float( xx, yy, zz, - ncie->J_p[i][j], ncie_C_p, ncie->h_p[i][j], - xw2, yw2, zw2, - f2, c2, nc2, gamu, pow1n, nbbj, ncbj, flj, czj, dj, awj); + Ciecam02::jch2xyz_ciecam02float ( xx, yy, zz, + ncie->J_p[i][j], ncie_C_p, ncie->h_p[i][j], + xw2, yw2, zw2, + f2, c2, nc2, gamu, pow1n, nbbj, ncbj, flj, czj, dj, awj); float x = (float)xx * 655.35f; float y = (float)yy * 655.35f; float z = (float)zz * 655.35f; float Ll, aa, bb; //convert xyz=>lab - Color::XYZ2Lab(x, y, z, Ll, aa, bb); + Color::XYZ2Lab (x, y, z, Ll, aa, bb); - if(gamu == 1) { + if (gamu == 1) { float Lprov1, Chprov1; Lprov1 = Ll / 327.68f; - Chprov1 = sqrtf(SQR(aa) + SQR(bb)) / 327.68f; + Chprov1 = sqrtf (SQR (aa) + SQR (bb)) / 327.68f; float2 sincosval; - if(Chprov1 == 0.0f) { + if (Chprov1 == 0.0f) { sincosval.y = 1.f; sincosval.x = 0.0f; } else { @@ -2787,10 +2767,10 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int bool neg = false; bool more_rgb = false; //gamut control : Lab values are in gamut - Color::gamutLchonly(sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f, neg, more_rgb); + Color::gamutLchonly (sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f, neg, more_rgb); #else //gamut control : Lab values are in gamut - Color::gamutLchonly(sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f); + Color::gamutLchonly (sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f); #endif lab->L[i][j] = Lprov1 * 327.68f; @@ -2809,35 +2789,35 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int // process line buffers int k; vfloat x, y, z; - vfloat c655d35 = F2V(655.35f); + vfloat c655d35 = F2V (655.35f); - for(k = 0; k < bufferLength; k += 4) { - Ciecam02::jch2xyz_ciecam02float( x, y, z, - LVF(Jbuffer[k]), LVF(Cbuffer[k]), LVF(hbuffer[k]), - F2V(xw2), F2V(yw2), F2V(zw2), - F2V(f2), F2V(nc2), F2V(pow1n), F2V(nbbj), F2V(ncbj), F2V(flj), F2V(dj), F2V(awj), F2V(reccmcz)); + for (k = 0; k < bufferLength; k += 4) { + Ciecam02::jch2xyz_ciecam02float ( x, y, z, + LVF (Jbuffer[k]), LVF (Cbuffer[k]), LVF (hbuffer[k]), + F2V (xw2), F2V (yw2), F2V (zw2), + F2V (f2), F2V (nc2), F2V (pow1n), F2V (nbbj), F2V (ncbj), F2V (flj), F2V (dj), F2V (awj), F2V (reccmcz)); x *= c655d35; y *= c655d35; z *= c655d35; - STVF(xbuffer[k], x); - STVF(ybuffer[k], y); - STVF(zbuffer[k], z); + STVF (xbuffer[k], x); + STVF (ybuffer[k], y); + STVF (zbuffer[k], z); } // XYZ2Lab uses a lookup table. The function behind that lut is a cube root. // SSE can't beat the speed of that lut, so it doesn't make sense to use SSE - for(int j = 0; j < width; j++) { + for (int j = 0; j < width; j++) { float Ll, aa, bb; //convert xyz=>lab - Color::XYZ2Lab(xbuffer[j], ybuffer[j], zbuffer[j], Ll, aa, bb); + Color::XYZ2Lab (xbuffer[j], ybuffer[j], zbuffer[j], Ll, aa, bb); - if(gamu == 1) { + if (gamu == 1) { float Lprov1, Chprov1; Lprov1 = Ll / 327.68f; - Chprov1 = sqrtf(SQR(aa) + SQR(bb)) / 327.68f; + Chprov1 = sqrtf (SQR (aa) + SQR (bb)) / 327.68f; float2 sincosval; - if(Chprov1 == 0.0f) { + if (Chprov1 == 0.0f) { sincosval.y = 1.f; sincosval.x = 0.0f; } else { @@ -2849,10 +2829,10 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int bool neg = false; bool more_rgb = false; //gamut control : Lab values are in gamut - Color::gamutLchonly(sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f, neg, more_rgb); + Color::gamutLchonly (sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f, neg, more_rgb); #else //gamut control : Lab values are in gamut - Color::gamutLchonly(sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f); + Color::gamutLchonly (sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f); #endif lab->L[i][j] = Lprov1 * 327.68f; lab->a[i][j] = 327.68f * Chprov1 * sincosval.y; @@ -2871,13 +2851,13 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int } //end parallelization //show CIECAM histograms - if(ciedata) { + if (ciedata) { //update histogram J and Q //update histogram J - hist16JCAM.compressTo(histLCAM); + hist16JCAM.compressTo (histLCAM); //update color histogram M,s,C - hist16_CCAM.compressTo(histCCAM); + hist16_CCAM.compressTo (histCCAM); } } } @@ -2899,20 +2879,20 @@ void ImProcFunctions::moyeqt (Imagefloat* working, float &moyS, float &eqty) for (int i = 0; i < tHh; i++) { for (int j = 0; j < tWw; j++) { - float s = Color::rgb2s(CLIP(working->r(i, j)), CLIP(working->g(i, j)), CLIP(working->b(i, j))); + float s = Color::rgb2s (CLIP (working->r (i, j)), CLIP (working->g (i, j)), CLIP (working->b (i, j))); moy += s; - sqrs += SQR(s); + sqrs += SQR (s); } } moy /= (tHh * tWw); sqrs /= (tHh * tWw); - eqty = sqrt(sqrs - SQR(moy)); + eqty = sqrt (sqrs - SQR (moy)); moyS = moy; } static inline void -filmlike_clip_rgb_tone(float *r, float *g, float *b, const float L) +filmlike_clip_rgb_tone (float *r, float *g, float *b, const float L) { float r_ = *r > L ? L : *r; float b_ = *b > L ? L : *b; @@ -2923,18 +2903,18 @@ filmlike_clip_rgb_tone(float *r, float *g, float *b, const float L) } static void -filmlike_clip(float *r, float *g, float *b) +filmlike_clip (float *r, float *g, float *b) { // This is Adobe's hue-stable film-like curve with a diagonal, ie only used for clipping. Can probably be further optimized. const float L = 65535.0; if (*r >= *g) { if (*g > *b) { // Case 1: r >= g > b - filmlike_clip_rgb_tone(r, g, b, L); + filmlike_clip_rgb_tone (r, g, b, L); } else if (*b > *r) { // Case 2: b > r >= g - filmlike_clip_rgb_tone(b, r, g, L); + filmlike_clip_rgb_tone (b, r, g, L); } else if (*b > *g) { // Case 3: r >= b > g - filmlike_clip_rgb_tone(r, b, g, L); + filmlike_clip_rgb_tone (r, b, g, L); } else { // Case 4: r >= g == b *r = *r > L ? L : *r; *g = *g > L ? L : *g; @@ -2942,11 +2922,11 @@ filmlike_clip(float *r, float *g, float *b) } } else { if (*r >= *b) { // Case 5: g > r >= b - filmlike_clip_rgb_tone(g, r, b, L); + filmlike_clip_rgb_tone (g, r, b, L); } else if (*b > *g) { // Case 6: b > g > r - filmlike_clip_rgb_tone(b, g, r, L); + filmlike_clip_rgb_tone (b, g, r, L); } else { // Case 7: g >= b > r - filmlike_clip_rgb_tone(g, b, r, L); + filmlike_clip_rgb_tone (g, b, r, L); } } } @@ -2966,9 +2946,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer BENCHFUN Imagefloat *tmpImage = nullptr; - // NOTE: We're getting all 3 pointers here, but this function may not need them all, so one could optimize this Imagefloat* editImgFloat = nullptr; - LabImage* editLab = nullptr; PlanarWhateverData* editWhatever = nullptr; EditUniqueID editID = pipetteBuffer ? pipetteBuffer->getEditID() : EUID_None; @@ -2979,7 +2957,6 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer break; case (BT_LABIMAGE): - editLab = pipetteBuffer->getLabBuffer(); break; case (BT_SINGLEPLANE_FLOAT): @@ -2988,7 +2965,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } } - int h_th, s_th; + int h_th = 0, s_th = 0; if (shmap) { h_th = shmap->max_f - params->sh.htonalwidth * (shmap->max_f - shmap->avg) / 100; @@ -3004,20 +2981,20 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float toxyz[3][3] = { { - static_cast( wprof[0][0] / Color::D50x), - static_cast( wprof[0][1] / Color::D50x), - static_cast( wprof[0][2] / Color::D50x) + static_cast ( wprof[0][0] / Color::D50x), + static_cast ( wprof[0][1] / Color::D50x), + static_cast ( wprof[0][2] / Color::D50x) }, { - static_cast( wprof[1][0]), - static_cast( wprof[1][1]), - static_cast( wprof[1][2]) + static_cast ( wprof[1][0]), + static_cast ( wprof[1][1]), + static_cast ( wprof[1][2]) }, { - static_cast( wprof[2][0] / Color::D50z), - static_cast( wprof[2][1] / Color::D50z), - static_cast( wprof[2][2] / Color::D50z) + static_cast ( wprof[2][0] / Color::D50z), + static_cast ( wprof[2][1] / Color::D50z), + static_cast ( wprof[2][2] / Color::D50z) } }; - float maxFactorToxyz = max(toxyz[1][0], toxyz[1][1], toxyz[1][2]); + float maxFactorToxyz = max (toxyz[1][0], toxyz[1][1], toxyz[1][2]); float equalR = maxFactorToxyz / toxyz[1][0]; float equalG = maxFactorToxyz / toxyz[1][1]; float equalB = maxFactorToxyz / toxyz[1][2]; @@ -3036,22 +3013,22 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer }; // For tonecurve histogram - float lumimulf[3] = {static_cast(lumimul[0]), static_cast(lumimul[1]), static_cast(lumimul[2])}; + float lumimulf[3] = {static_cast (lumimul[0]), static_cast (lumimul[1]), static_cast (lumimul[2])}; bool mixchannels = (params->chmixer.red[0] != 100 || params->chmixer.red[1] != 0 || params->chmixer.red[2] != 0 || params->chmixer.green[0] != 0 || params->chmixer.green[1] != 100 || params->chmixer.green[2] != 0 || params->chmixer.blue[0] != 0 || params->chmixer.blue[1] != 0 || params->chmixer.blue[2] != 100); - FlatCurve* hCurve; - FlatCurve* sCurve; - FlatCurve* vCurve; - FlatCurve* bwlCurve; + FlatCurve* hCurve = nullptr; + FlatCurve* sCurve = nullptr; + FlatCurve* vCurve = nullptr; + FlatCurve* bwlCurve = nullptr; - FlatCurveType hCurveType = (FlatCurveType)params->hsvequalizer.hcurve.at(0); - FlatCurveType sCurveType = (FlatCurveType)params->hsvequalizer.scurve.at(0); - FlatCurveType vCurveType = (FlatCurveType)params->hsvequalizer.vcurve.at(0); - FlatCurveType bwlCurveType = (FlatCurveType)params->blackwhite.luminanceCurve.at(0); + FlatCurveType hCurveType = (FlatCurveType)params->hsvequalizer.hcurve.at (0); + FlatCurveType sCurveType = (FlatCurveType)params->hsvequalizer.scurve.at (0); + FlatCurveType vCurveType = (FlatCurveType)params->hsvequalizer.vcurve.at (0); + FlatCurveType bwlCurveType = (FlatCurveType)params->blackwhite.luminanceCurve.at (0); bool hCurveEnabled = hCurveType > FCT_Linear; bool sCurveEnabled = sCurveType > FCT_Linear; bool vCurveEnabled = vCurveType > FCT_Linear; @@ -3059,7 +3036,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer // TODO: We should create a 'skip' value like for CurveFactory::complexsgnCurve (rtengine/curves.cc) if (hCurveEnabled) { - hCurve = new FlatCurve(params->hsvequalizer.hcurve); + hCurve = new FlatCurve (params->hsvequalizer.hcurve); if (hCurve->isIdentity()) { delete hCurve; @@ -3069,7 +3046,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } if (sCurveEnabled) { - sCurve = new FlatCurve(params->hsvequalizer.scurve); + sCurve = new FlatCurve (params->hsvequalizer.scurve); if (sCurve->isIdentity()) { delete sCurve; @@ -3079,7 +3056,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } if (vCurveEnabled) { - vCurve = new FlatCurve(params->hsvequalizer.vcurve); + vCurve = new FlatCurve (params->hsvequalizer.vcurve); if (vCurve->isIdentity()) { delete vCurve; @@ -3089,7 +3066,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } if (bwlCurveEnabled) { - bwlCurve = new FlatCurve(params->blackwhite.luminanceCurve); + bwlCurve = new FlatCurve (params->blackwhite.luminanceCurve); if (bwlCurve->isIdentity()) { delete bwlCurve; @@ -3100,7 +3077,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer std::shared_ptr hald_clut; bool clutAndWorkingProfilesAreSame = false; - TMatrix xyz2clut, clut2xyz; + TMatrix xyz2clut = {}, clut2xyz = {}; #ifdef __SSE2__ vfloat v_work2xyz[3][3] ALIGNED16; vfloat v_xyz2clut[3][3] ALIGNED16; @@ -3109,23 +3086,23 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer #endif if ( params->filmSimulation.enabled && !params->filmSimulation.clutFilename.empty() ) { - hald_clut = CLUTStore::getInstance().getClut( params->filmSimulation.clutFilename ); + hald_clut = CLUTStore::getInstance().getClut ( params->filmSimulation.clutFilename ); if ( hald_clut ) { clutAndWorkingProfilesAreSame = hald_clut->getProfile() == params->icm.working; if ( !clutAndWorkingProfilesAreSame ) { - xyz2clut = ICCStore::getInstance()->workingSpaceInverseMatrix( hald_clut->getProfile() ); - clut2xyz = ICCStore::getInstance()->workingSpaceMatrix( hald_clut->getProfile() ); + xyz2clut = ICCStore::getInstance()->workingSpaceInverseMatrix ( hald_clut->getProfile() ); + clut2xyz = ICCStore::getInstance()->workingSpaceMatrix ( hald_clut->getProfile() ); #ifdef __SSE2__ for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { - v_work2xyz[i][j] = F2V(wprof[i][j]); - v_xyz2clut[i][j] = F2V(xyz2clut[i][j]); - v_xyz2work[i][j] = F2V(wiprof[i][j]); - v_clut2xyz[i][j] = F2V(clut2xyz[i][j]); + v_work2xyz[i][j] = F2V (wprof[i][j]); + v_xyz2clut[i][j] = F2V (xyz2clut[i][j]); + v_xyz2work[i][j] = F2V (wiprof[i][j]); + v_clut2xyz[i][j] = F2V (clut2xyz[i][j]); } } @@ -3135,41 +3112,41 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } } - const float film_simulation_strength = static_cast(params->filmSimulation.strength) / 100.0f; + const float film_simulation_strength = static_cast (params->filmSimulation.strength) / 100.0f; const float exp_scale = pow (2.0, expcomp); - const float comp = (max(0.0, expcomp) + 1.0) * hlcompr / 100.0; - const float shoulder = ((65536.0 / max(1.0f, exp_scale)) * (hlcomprthresh / 200.0)) + 0.1; + const float comp = (max (0.0, expcomp) + 1.0) * hlcompr / 100.0; + const float shoulder = ((65536.0 / max (1.0f, exp_scale)) * (hlcomprthresh / 200.0)) + 0.1; const float hlrange = 65536.0 - shoulder; const bool isProPhoto = (params->icm.working == "ProPhoto"); // extracting datas from 'params' to avoid cache flush (to be confirmed) ToneCurveParams::eTCModeId curveMode = params->toneCurve.curveMode; ToneCurveParams::eTCModeId curveMode2 = params->toneCurve.curveMode2; bool highlight = params->toneCurve.hrenabled;//Get the value if "highlight reconstruction" is activated - bool hasToneCurve1 = bool(customToneCurve1); - bool hasToneCurve2 = bool(customToneCurve2); + bool hasToneCurve1 = bool (customToneCurve1); + bool hasToneCurve2 = bool (customToneCurve2); BlackWhiteParams::eTCModeId beforeCurveMode = params->blackwhite.beforeCurveMode; BlackWhiteParams::eTCModeId afterCurveMode = params->blackwhite.afterCurveMode; - bool hasToneCurvebw1 = bool(customToneCurvebw1); - bool hasToneCurvebw2 = bool(customToneCurvebw2); + bool hasToneCurvebw1 = bool (customToneCurvebw1); + bool hasToneCurvebw2 = bool (customToneCurvebw2); PerceptualToneCurveState ptc1ApplyState, ptc2ApplyState; if (hasToneCurve1 && curveMode == ToneCurveParams::TC_MODE_PERCEPTUAL) { - const PerceptualToneCurve& userToneCurve = static_cast(customToneCurve1); - userToneCurve.initApplyState(ptc1ApplyState, params->icm.working); + const PerceptualToneCurve& userToneCurve = static_cast (customToneCurve1); + userToneCurve.initApplyState (ptc1ApplyState, params->icm.working); } if (hasToneCurve2 && curveMode2 == ToneCurveParams::TC_MODE_PERCEPTUAL) { - const PerceptualToneCurve& userToneCurve = static_cast(customToneCurve2); - userToneCurve.initApplyState(ptc2ApplyState, params->icm.working); + const PerceptualToneCurve& userToneCurve = static_cast (customToneCurve2); + userToneCurve.initApplyState (ptc2ApplyState, params->icm.working); } - bool hasColorToning = params->colorToning.enabled && bool(ctOpacityCurve) && bool(ctColorCurve); + bool hasColorToning = params->colorToning.enabled && bool (ctOpacityCurve) && bool (ctColorCurve); // float satLimit = float(params->colorToning.satProtectionThreshold)/100.f*0.7f+0.3f; // float satLimitOpacity = 1.f-(float(params->colorToning.saturatedOpacity)/100.f); - float strProtect = (float(params->colorToning.strength) / 100.f); + float strProtect = (float (params->colorToning.strength) / 100.f); /* // Debug output - Color LUTf points @@ -3201,52 +3178,52 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } */ - float RedLow = (100.f + float(params->colorToning.redlow)) / 100.f; //printf("Rel=%f\n",RedLow); - float GreenLow = (100.f + float(params->colorToning.greenlow)) / 100.f; //printf("Gre=%f\n",GreenLow); - float BlueLow = (100.f + float(params->colorToning.bluelow)) / 100.f; //printf("Blu=%f\n",BlueLow); - float RedMed = (100.f + float(params->colorToning.redmed)) / 100.f; - float GreenMed = (100.f + float(params->colorToning.greenmed)) / 100.f; - float BlueMed = (100.f + float(params->colorToning.bluemed)) / 100.f; - float RedHigh = (100.f + float(params->colorToning.redhigh)) / 100.f; //printf("RedH=%f\n",RedHigh); - float GreenHigh = (100.f + float(params->colorToning.greenhigh)) / 100.f; - float BlueHigh = (100.f + float(params->colorToning.bluehigh)) / 100.f; - float SatLow = float(params->colorToning.shadowsColSat.value[0]) / 100.f; - float SatHigh = float(params->colorToning.hlColSat.value[0]) / 100.f; + float RedLow = (100.f + float (params->colorToning.redlow)) / 100.f; //printf("Rel=%f\n",RedLow); + float GreenLow = (100.f + float (params->colorToning.greenlow)) / 100.f; //printf("Gre=%f\n",GreenLow); + float BlueLow = (100.f + float (params->colorToning.bluelow)) / 100.f; //printf("Blu=%f\n",BlueLow); + float RedMed = (100.f + float (params->colorToning.redmed)) / 100.f; + float GreenMed = (100.f + float (params->colorToning.greenmed)) / 100.f; + float BlueMed = (100.f + float (params->colorToning.bluemed)) / 100.f; + float RedHigh = (100.f + float (params->colorToning.redhigh)) / 100.f; //printf("RedH=%f\n",RedHigh); + float GreenHigh = (100.f + float (params->colorToning.greenhigh)) / 100.f; + float BlueHigh = (100.f + float (params->colorToning.bluehigh)) / 100.f; + float SatLow = float (params->colorToning.shadowsColSat.value[0]) / 100.f; + float SatHigh = float (params->colorToning.hlColSat.value[0]) / 100.f; - float Balan = float(params->colorToning.balance); + float Balan = float (params->colorToning.balance); - float chMixRR = float(params->chmixer.red[0]); - float chMixRG = float(params->chmixer.red[1]); - float chMixRB = float(params->chmixer.red[2]); - float chMixGR = float(params->chmixer.green[0]); - float chMixGG = float(params->chmixer.green[1]); - float chMixGB = float(params->chmixer.green[2]); - float chMixBR = float(params->chmixer.blue[0]); - float chMixBG = float(params->chmixer.blue[1]); - float chMixBB = float(params->chmixer.blue[2]); + float chMixRR = float (params->chmixer.red[0]); + float chMixRG = float (params->chmixer.red[1]); + float chMixRB = float (params->chmixer.red[2]); + float chMixGR = float (params->chmixer.green[0]); + float chMixGG = float (params->chmixer.green[1]); + float chMixGB = float (params->chmixer.green[2]); + float chMixBR = float (params->chmixer.blue[0]); + float chMixBG = float (params->chmixer.blue[1]); + float chMixBB = float (params->chmixer.blue[2]); int shHighlights = params->sh.highlights; int shShadows = params->sh.shadows; bool blackwhite = params->blackwhite.enabled; bool complem = params->blackwhite.enabledcc; - float bwr = float(params->blackwhite.mixerRed); - float bwg = float(params->blackwhite.mixerGreen); - float bwb = float(params->blackwhite.mixerBlue); - float bwrgam = float(params->blackwhite.gammaRed); - float bwggam = float(params->blackwhite.gammaGreen); - float bwbgam = float(params->blackwhite.gammaBlue); - float mixerOrange = float(params->blackwhite.mixerOrange); - float mixerYellow = float(params->blackwhite.mixerYellow); - float mixerCyan = float(params->blackwhite.mixerCyan); - float mixerMagenta = float(params->blackwhite.mixerMagenta); - float mixerPurple = float(params->blackwhite.mixerPurple); + float bwr = float (params->blackwhite.mixerRed); + float bwg = float (params->blackwhite.mixerGreen); + float bwb = float (params->blackwhite.mixerBlue); + float bwrgam = float (params->blackwhite.gammaRed); + float bwggam = float (params->blackwhite.gammaGreen); + float bwbgam = float (params->blackwhite.gammaBlue); + float mixerOrange = float (params->blackwhite.mixerOrange); + float mixerYellow = float (params->blackwhite.mixerYellow); + float mixerCyan = float (params->blackwhite.mixerCyan); + float mixerMagenta = float (params->blackwhite.mixerMagenta); + float mixerPurple = float (params->blackwhite.mixerPurple); int algm = 0; if (params->blackwhite.method == "Desaturation") { algm = 0; - } else if(params->blackwhite.method == "LumEqualizer") { + } else if (params->blackwhite.method == "LumEqualizer") { algm = 1; - } else if(params->blackwhite.method == "ChannelMixer") { + } else if (params->blackwhite.method == "ChannelMixer") { algm = 2; } @@ -3260,15 +3237,15 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer double nb = 0; bool computeMixerAuto = params->blackwhite.autoc && (autor < -5000.f); - if(bwrgam < 0) { + if (bwrgam < 0) { gamvalr = 100.f; } - if(bwggam < 0) { + if (bwggam < 0) { gamvalg = 100.f; } - if(bwbgam < 0) { + if (bwbgam < 0) { gamvalb = 100.f; } @@ -3284,19 +3261,16 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer bool hasgammabw = gammabwr != 1.f || gammabwg != 1.f || gammabwb != 1.f; if (hasColorToning || blackwhite || (params->dirpyrequalizer.cbdlMethod == "bef" && params->dirpyrequalizer.enabled)) { - tmpImage = new Imagefloat(working->getWidth(), working->getHeight()); + tmpImage = new Imagefloat (working->getWidth(), working->getHeight()); } - int W = working->getWidth(); - int H = working->getHeight(); - // For tonecurve histogram int toneCurveHistSize = histToneCurve ? histToneCurve.getSize() : 0; - int histToneCurveCompression; + int histToneCurveCompression = 0; - if(toneCurveHistSize > 0) { + if (toneCurveHistSize > 0) { histToneCurve.clear(); - histToneCurveCompression = log2(65536 / toneCurveHistSize); + histToneCurveCompression = log2 (65536 / toneCurveHistSize); } @@ -3310,43 +3284,43 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer char *editIFloatBuffer = nullptr; char *editWhateverBuffer = nullptr; - buffer = (char *) malloc(3 * sizeof(float) * TS * TS + 20 * 64 + 63); + buffer = (char *) malloc (3 * sizeof (float) * TS * TS + 20 * 64 + 63); char *data; - data = (char*)( ( uintptr_t(buffer) + uintptr_t(63)) / 64 * 64); + data = (char*) ( ( uintptr_t (buffer) + uintptr_t (63)) / 64 * 64); - float *rtemp = (float(*))data; - float *gtemp = (float (*)) ((char*)rtemp + sizeof(float) * TS * TS + 4 * 64); - float *btemp = (float (*)) ((char*)gtemp + sizeof(float) * TS * TS + 8 * 64); + float *rtemp = (float (*))data; + float *gtemp = (float (*)) ((char*)rtemp + sizeof (float) * TS * TS + 4 * 64); + float *btemp = (float (*)) ((char*)gtemp + sizeof (float) * TS * TS + 8 * 64); int istart; int jstart; int tW; int tH; // Allocating buffer for the PipetteBuffer - float *editIFloatTmpR, *editIFloatTmpG, *editIFloatTmpB, *editWhateverTmp; + float *editIFloatTmpR = nullptr, *editIFloatTmpG = nullptr, *editIFloatTmpB = nullptr, *editWhateverTmp = nullptr; if (editImgFloat) { - editIFloatBuffer = (char *) malloc(3 * sizeof(float) * TS * TS + 20 * 64 + 63); - data = (char*)( ( uintptr_t(editIFloatBuffer) + uintptr_t(63)) / 64 * 64); + editIFloatBuffer = (char *) malloc (3 * sizeof (float) * TS * TS + 20 * 64 + 63); + data = (char*) ( ( uintptr_t (editIFloatBuffer) + uintptr_t (63)) / 64 * 64); - editIFloatTmpR = (float(*))data; - editIFloatTmpG = (float (*)) ((char*)editIFloatTmpR + sizeof(float) * TS * TS + 4 * 64); - editIFloatTmpB = (float (*)) ((char*)editIFloatTmpG + sizeof(float) * TS * TS + 8 * 64); + editIFloatTmpR = (float (*))data; + editIFloatTmpG = (float (*)) ((char*)editIFloatTmpR + sizeof (float) * TS * TS + 4 * 64); + editIFloatTmpB = (float (*)) ((char*)editIFloatTmpG + sizeof (float) * TS * TS + 8 * 64); } if (editWhatever) { - editWhateverBuffer = (char *) malloc(sizeof(float) * TS * TS + 20 * 64 + 63); - data = (char*)( ( uintptr_t(editWhateverBuffer) + uintptr_t(63)) / 64 * 64); + editWhateverBuffer = (char *) malloc (sizeof (float) * TS * TS + 20 * 64 + 63); + data = (char*) ( ( uintptr_t (editWhateverBuffer) + uintptr_t (63)) / 64 * 64); - editWhateverTmp = (float(*))data; + editWhateverTmp = (float (*))data; } float out_rgbx[4 * TS] ALIGNED16; // Line buffer for CLUT LUTu histToneCurveThr; - if(toneCurveHistSize > 0) { - histToneCurveThr(toneCurveHistSize); + if (toneCurveHistSize > 0) { + histToneCurveThr (toneCurveHistSize); histToneCurveThr.clear(); } @@ -3354,19 +3328,19 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer #pragma omp for schedule(dynamic) collapse(2) #endif - for(int ii = 0; ii < working->getHeight(); ii += TS) - for(int jj = 0; jj < working->getWidth(); jj += TS) { + for (int ii = 0; ii < working->getHeight(); ii += TS) + for (int jj = 0; jj < working->getWidth(); jj += TS) { istart = ii; jstart = jj; - tH = min(ii + TS, working->getHeight()); - tW = min(jj + TS, working->getWidth()); + tH = min (ii + TS, working->getHeight()); + tW = min (jj + TS, working->getWidth()); for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - rtemp[ti * TS + tj] = working->r(i, j); - gtemp[ti * TS + tj] = working->g(i, j); - btemp[ti * TS + tj] = working->b(i, j); + rtemp[ti * TS + tj] = working->r (i, j); + gtemp[ti * TS + tj] = working->g (i, j); + btemp[ti * TS + tj] = working->b (i, j); } } @@ -3459,7 +3433,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } if (dcpProf) { - dcpProf->step2ApplyTile(rtemp, gtemp, btemp, tW - jstart, tH - istart, TS, asIn); + dcpProf->step2ApplyTile (rtemp, gtemp, btemp, tW - jstart, tH - istart, TS, asIn); } for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -3482,7 +3456,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } if (r > 65535 || g > 65535 || b > 65535) { - filmlike_clip(&r, &g, &b); + filmlike_clip (&r, &g, &b); } rtemp[ti * TS + tj] = r; @@ -3499,8 +3473,8 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer gtemp[ti * TS + tj] = tonecurve[ gtemp[ti * TS + tj] ]; btemp[ti * TS + tj] = tonecurve[ btemp[ti * TS + tj] ]; - if(histToneCurveThr) { - int y = CLIP(lumimulf[0] * Color::gamma2curve[rtemp[ti * TS + tj]] + lumimulf[1] * Color::gamma2curve[gtemp[ti * TS + tj]] + lumimulf[2] * Color::gamma2curve[btemp[ti * TS + tj]]); + if (histToneCurveThr) { + int y = CLIP (lumimulf[0] * Color::gamma2curve[rtemp[ti * TS + tj]] + lumimulf[1] * Color::gamma2curve[gtemp[ti * TS + tj]] + lumimulf[2] * Color::gamma2curve[btemp[ti * TS + tj]]); histToneCurveThr[y >> histToneCurveCompression]++; } } @@ -3520,58 +3494,58 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer if (curveMode == ToneCurveParams::TC_MODE_STD) { // Standard for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - const StandardToneCurve& userToneCurve = static_cast(customToneCurve1); - userToneCurve.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + const StandardToneCurve& userToneCurve = static_cast (customToneCurve1); + userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } else if (curveMode == ToneCurveParams::TC_MODE_FILMLIKE) { // Adobe like for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - const AdobeToneCurve& userToneCurve = static_cast(customToneCurve1); - userToneCurve.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + const AdobeToneCurve& userToneCurve = static_cast (customToneCurve1); + userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } else if (curveMode == ToneCurveParams::TC_MODE_SATANDVALBLENDING) { // apply the curve on the saturation and value channels for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - const SatAndValueBlendingToneCurve& userToneCurve = static_cast(customToneCurve1); - rtemp[ti * TS + tj] = CLIP(rtemp[ti * TS + tj]); - gtemp[ti * TS + tj] = CLIP(gtemp[ti * TS + tj]); - btemp[ti * TS + tj] = CLIP(btemp[ti * TS + tj]); - userToneCurve.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + const SatAndValueBlendingToneCurve& userToneCurve = static_cast (customToneCurve1); + rtemp[ti * TS + tj] = CLIP (rtemp[ti * TS + tj]); + gtemp[ti * TS + tj] = CLIP (gtemp[ti * TS + tj]); + btemp[ti * TS + tj] = CLIP (btemp[ti * TS + tj]); + userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } else if (curveMode == ToneCurveParams::TC_MODE_WEIGHTEDSTD) { // apply the curve to the rgb channels, weighted - const WeightedStdToneCurve& userToneCurve = static_cast(customToneCurve1); + const WeightedStdToneCurve& userToneCurve = static_cast (customToneCurve1); for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - rtemp[ti * TS + tj] = CLIP(rtemp[ti * TS + tj]); - gtemp[ti * TS + tj] = CLIP(gtemp[ti * TS + tj]); - btemp[ti * TS + tj] = CLIP(btemp[ti * TS + tj]); - userToneCurve.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + rtemp[ti * TS + tj] = CLIP (rtemp[ti * TS + tj]); + gtemp[ti * TS + tj] = CLIP (gtemp[ti * TS + tj]); + btemp[ti * TS + tj] = CLIP (btemp[ti * TS + tj]); + userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } else if (curveMode == ToneCurveParams::TC_MODE_LUMINANCE) { // apply the curve to the luminance channel - const LuminanceToneCurve& userToneCurve = static_cast(customToneCurve1); + const LuminanceToneCurve& userToneCurve = static_cast (customToneCurve1); for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - rtemp[ti * TS + tj] = CLIP(rtemp[ti * TS + tj]); - gtemp[ti * TS + tj] = CLIP(gtemp[ti * TS + tj]); - btemp[ti * TS + tj] = CLIP(btemp[ti * TS + tj]); - userToneCurve.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + rtemp[ti * TS + tj] = CLIP (rtemp[ti * TS + tj]); + gtemp[ti * TS + tj] = CLIP (gtemp[ti * TS + tj]); + btemp[ti * TS + tj] = CLIP (btemp[ti * TS + tj]); + userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } else if (curveMode == ToneCurveParams::TC_MODE_PERCEPTUAL) { // apply curve while keeping color appearance constant - const PerceptualToneCurve& userToneCurve = static_cast(customToneCurve1); + const PerceptualToneCurve& userToneCurve = static_cast (customToneCurve1); for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - rtemp[ti * TS + tj] = CLIP(rtemp[ti * TS + tj]); - gtemp[ti * TS + tj] = CLIP(gtemp[ti * TS + tj]); - btemp[ti * TS + tj] = CLIP(btemp[ti * TS + tj]); - userToneCurve.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], ptc1ApplyState); + rtemp[ti * TS + tj] = CLIP (rtemp[ti * TS + tj]); + gtemp[ti * TS + tj] = CLIP (gtemp[ti * TS + tj]); + btemp[ti * TS + tj] = CLIP (btemp[ti * TS + tj]); + userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], ptc1ApplyState); } } } @@ -3591,46 +3565,46 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer if (curveMode2 == ToneCurveParams::TC_MODE_STD) { // Standard for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - const StandardToneCurve& userToneCurve = static_cast(customToneCurve2); - userToneCurve.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + const StandardToneCurve& userToneCurve = static_cast (customToneCurve2); + userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } else if (curveMode2 == ToneCurveParams::TC_MODE_FILMLIKE) { // Adobe like for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - const AdobeToneCurve& userToneCurve = static_cast(customToneCurve2); - userToneCurve.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + const AdobeToneCurve& userToneCurve = static_cast (customToneCurve2); + userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } else if (curveMode2 == ToneCurveParams::TC_MODE_SATANDVALBLENDING) { // apply the curve on the saturation and value channels for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - const SatAndValueBlendingToneCurve& userToneCurve = static_cast(customToneCurve2); - userToneCurve.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + const SatAndValueBlendingToneCurve& userToneCurve = static_cast (customToneCurve2); + userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } else if (curveMode2 == ToneCurveParams::TC_MODE_WEIGHTEDSTD) { // apply the curve to the rgb channels, weighted - const WeightedStdToneCurve& userToneCurve = static_cast(customToneCurve2); + const WeightedStdToneCurve& userToneCurve = static_cast (customToneCurve2); for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - userToneCurve.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } else if (curveMode2 == ToneCurveParams::TC_MODE_LUMINANCE) { // apply the curve to the luminance channel - const LuminanceToneCurve& userToneCurve = static_cast(customToneCurve2); + const LuminanceToneCurve& userToneCurve = static_cast (customToneCurve2); for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - userToneCurve.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } else if (curveMode2 == ToneCurveParams::TC_MODE_PERCEPTUAL) { // apply curve while keeping color appearance constant - const PerceptualToneCurve& userToneCurve = static_cast(customToneCurve2); + const PerceptualToneCurve& userToneCurve = static_cast (customToneCurve2); for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - userToneCurve.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], ptc2ApplyState); + userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], ptc2ApplyState); } } } @@ -3691,9 +3665,9 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float y = toxyz[1][0] * r + toxyz[1][1] * g + toxyz[1][2] * b; float z = toxyz[2][0] * r + toxyz[2][1] * g + toxyz[2][2] * b; - float fx = x < MAXVALF ? Color::cachef[x] : 327.68f * std::cbrt(x / MAXVALF); - float fy = y < MAXVALF ? Color::cachef[y] : 327.68f * std::cbrt(y / MAXVALF); - float fz = z < MAXVALF ? Color::cachef[z] : 327.68f * std::cbrt(z / MAXVALF); + float fx = x < MAXVALF ? Color::cachef[x] : 327.68f * std::cbrt (x / MAXVALF); + float fy = y < MAXVALF ? Color::cachef[y] : 327.68f * std::cbrt (y / MAXVALF); + float fz = z < MAXVALF ? Color::cachef[z] : 327.68f * std::cbrt (z / MAXVALF); float a_1 = 500.0f * (fx - fy); float b_1 = 200.0f * (fy - fz); @@ -3717,19 +3691,19 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer // Luminosity after // only Luminance in Lab float newy = toxyz[1][0] * r + toxyz[1][1] * g + toxyz[1][2] * b; - float newfy = newy < MAXVALF ? Color::cachef[newy] : 327.68f * std::cbrt(newy / MAXVALF); + float newfy = newy < MAXVALF ? Color::cachef[newy] : 327.68f * std::cbrt (newy / MAXVALF); float L_2 = 116.0f * newfy - 5242.88f; //gamut control - if(settings->rgbcurveslumamode_gamut) { + if (settings->rgbcurveslumamode_gamut) { float Lpro = L_2 / 327.68f; - float Chpro = sqrtf(SQR(a_1) + SQR(b_1)) / 327.68f; + float Chpro = sqrtf (SQR (a_1) + SQR (b_1)) / 327.68f; float HH = NAN; // we set HH to NAN, because then it will be calculated in Color::gamutLchonly only if needed // float HH = xatan2f(b_1, a_1); // According to mathematical laws we can get the sin and cos of HH by simple operations even if we don't calculate HH float2 sincosval; - if(Chpro == 0.0f) { + if (Chpro == 0.0f) { sincosval.y = 1.0f; sincosval.x = 0.0f; } else { @@ -3741,17 +3715,17 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer bool neg = false; bool more_rgb = false; //gamut control : Lab values are in gamut - Color::gamutLchonly(HH, sincosval, Lpro, Chpro, rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], wip, highlight, 0.15f, 0.96f, neg, more_rgb); + Color::gamutLchonly (HH, sincosval, Lpro, Chpro, rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], wip, highlight, 0.15f, 0.96f, neg, more_rgb); #else //gamut control : Lab values are in gamut - Color::gamutLchonly(HH, sincosval, Lpro, Chpro, rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], wip, highlight, 0.15f, 0.96f); + Color::gamutLchonly (HH, sincosval, Lpro, Chpro, rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], wip, highlight, 0.15f, 0.96f); #endif //end of gamut control } else { float x_, y_, z_; //calculate RGB with L_2 and old value of a and b - Color::Lab2XYZ(L_2, a_1, b_1, x_, y_, z_) ; - Color::xyz2rgb(x_, y_, z_, rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], wip); + Color::Lab2XYZ (L_2, a_1, b_1, x_, y_, z_) ; + Color::xyz2rgb (x_, y_, z_, rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], wip); } } } @@ -3762,7 +3736,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { float h, s, v; - Color::rgb2hsv(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], h, s, v); + Color::rgb2hsv (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], h, s, v); editWhateverTmp[ti * TS + tj] = h; } } @@ -3777,10 +3751,10 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float g = gtemp[ti * TS + tj]; float b = btemp[ti * TS + tj]; float h, s, v; - Color::rgb2hsv(r, g, b, h, s, v); + Color::rgb2hsv (r, g, b, h, s, v); if (sat > 0) { - s = (1.f - satby100) * s + satby100 * (1.f - SQR(SQR(1.f - min(s, 1.0f)))); + s = (1.f - satby100) * s + satby100 * (1.f - SQR (SQR (1.f - min (s, 1.0f)))); if (s < 0.f) { s = 0.f; @@ -3791,7 +3765,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer //HSV equalizer if (hCurveEnabled) { - h = (hCurve->getVal(double(h)) - 0.5) * 2.f + h; + h = (hCurve->getVal (double (h)) - 0.5) * 2.f + h; if (h > 1.0f) { h -= 1.0f; @@ -3802,10 +3776,10 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer if (sCurveEnabled) { //shift saturation - float satparam = (sCurve->getVal(double(h)) - 0.5) * 2; + float satparam = (sCurve->getVal (double (h)) - 0.5) * 2; if (satparam > 0.00001f) { - s = (1.f - satparam) * s + satparam * (1.f - SQR(1.f - min(s, 1.0f))); + s = (1.f - satparam) * s + satparam * (1.f - SQR (1.f - min (s, 1.0f))); if (s < 0.f) { s = 0.f; @@ -3822,11 +3796,11 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } //shift value - float valparam = vCurve->getVal((double)h) - 0.5f; - valparam *= (1.f - SQR(SQR(1.f - min(s, 1.0f)))); + float valparam = vCurve->getVal ((double)h) - 0.5f; + valparam *= (1.f - SQR (SQR (1.f - min (s, 1.0f)))); if (valparam > 0.00001f) { - v = (1.f - valparam) * v + valparam * (1.f - SQR(1.f - min(v, 1.0f))); // SQR (SQR to increase action and avoid artefacts + v = (1.f - valparam) * v + valparam * (1.f - SQR (1.f - min (v, 1.0f))); // SQR (SQR to increase action and avoid artefacts if (v < 0) { v = 0; @@ -3839,7 +3813,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } - Color::hsv2rgb(h, s, v, rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + Color::hsv2rgb (h, s, v, rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } @@ -3850,12 +3824,12 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float r = rtemp[ti * TS + tj]; float g = gtemp[ti * TS + tj]; - if(r == 0.0f || g == 0.0f) { + if (r == 0.0f || g == 0.0f) { float b = btemp[ti * TS + tj]; float h, s, v; - Color::rgb2hsv(r, g, b, h, s, v); + Color::rgb2hsv (r, g, b, h, s, v); s *= 0.99f; - Color::hsv2rgb(h, s, v, rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + Color::hsv2rgb (h, s, v, rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } @@ -3867,7 +3841,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float reducac = 0.4f; int preser = 0; - if(params->colorToning.lumamode) { + if (params->colorToning.lumamode) { preser = 1; } @@ -3881,14 +3855,14 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer iplow = (float)ctColorCurve.low; iphigh = (float)ctColorCurve.high; //2 colours - ctColorCurve.getVal(iphigh, xh, yh, zh); - ctColorCurve.getVal(iplow, xl, yl, zl); + ctColorCurve.getVal (iphigh, xh, yh, zh); + ctColorCurve.getVal (iplow, xl, yl, zl); - Color::xyz2rgb(xh, yh, zh, rh, gh, bh, wip); - Color::xyz2rgb(xl, yl, zl, rl, gl, bl, wip); + Color::xyz2rgb (xh, yh, zh, rh, gh, bh, wip); + Color::xyz2rgb (xl, yl, zl, rl, gl, bl, wip); //reteave rgb value with s and l =1 - retreavergb(rl, gl, bl); - retreavergb(rh, gh, bh); + retreavergb (rl, gl, bl); + retreavergb (rh, gh, bh); //printf("rl=%f gl=%f bl=%f\n",rl,gl,bl); for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -3928,7 +3902,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer int preser = 0; //bool execbal = params->colorToning.method=="Splitbal"; - if(params->colorToning.lumamode) { + if (params->colorToning.lumamode) { preser = 1; } @@ -3944,16 +3918,16 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float lumafter = 0.299f * ro + 0.587f * go + 0.114f * bo; float preserv = 1.f; - if(preser == 1) { + if (preser == 1) { preserv = lumbefore / lumafter; } ro *= preserv; go *= preserv; bo *= preserv; - ro = CLIP(ro); - go = CLIP(go); - bo = CLIP(bo); + ro = CLIP (ro); + go = CLIP (go); + bo = CLIP (bo); rtemp[ti * TS + tj] = ro; gtemp[ti * TS + tj] = go; btemp[ti * TS + tj] = bo; @@ -3967,7 +3941,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer else if (params->colorToning.method == "Lab" && opautili) { int algm = 0; bool twocol = true;//true=500 color false=2 color - int metchrom; + int metchrom = 0; if (params->colorToning.twocolor == "Std" ) { metchrom = 0; @@ -3979,13 +3953,13 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer metchrom = 3; } - if(metchrom == 3) { + if (metchrom == 3) { twocol = false; } - float iplow, iphigh; + float iplow = 0.f, iphigh = 0.f; - if(!twocol) { + if (!twocol) { iplow = (float)ctColorCurve.low; iphigh = (float)ctColorCurve.high; } @@ -4012,13 +3986,13 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float b = btemp[ti * TS + tj]; float ro, go, bo; labtoning (r, g, b, ro, go, bo, algm, metchrom, twoc, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, clToningcurve, cl2Toningcurve, iplow, iphigh, wp, wip); - rtemp[ti * TS + tj] = CLIP(ro); //I used CLIP because there is a little bug in gamutLchonly that return 65536.ii intead of 65535 ==> crash - gtemp[ti * TS + tj] = CLIP(go); - btemp[ti * TS + tj] = CLIP(bo); + rtemp[ti * TS + tj] = CLIP (ro); //I used CLIP because there is a little bug in gamutLchonly that return 65536.ii intead of 65535 ==> crash + gtemp[ti * TS + tj] = CLIP (go); + btemp[ti * TS + tj] = CLIP (bo); } } } - } else if (params->colorToning.method.substr(0, 3) == "RGB" && opautili) { + } else if (params->colorToning.method.substr (0, 3) == "RGB" && opautili) { // color toning for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { @@ -4029,28 +4003,28 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer // Luminance = (0.299f*r + 0.587f*g + 0.114f*b) float h, s, l; - Color::rgb2hsl(r, g, b, h, s, l); + Color::rgb2hsl (r, g, b, h, s, l); - float l_ = Color::gamma_srgb(l * 65535.f) / 65535.f; + float l_ = Color::gamma_srgb (l * 65535.f) / 65535.f; // get the opacity and tweak it to preserve saturated colors float opacity; - if(ctOpacityCurve) { - opacity = (1.f - min(s / satLimit, 1.f) * (1.f - satLimitOpacity)) * ctOpacityCurve.lutOpacityCurve[l_ * 500.f]; + if (ctOpacityCurve) { + opacity = (1.f - min (s / satLimit, 1.f) * (1.f - satLimitOpacity)) * ctOpacityCurve.lutOpacityCurve[l_ * 500.f]; } - if(!ctOpacityCurve) { + if (!ctOpacityCurve) { opacity = 0.f; } float r2, g2, b2; - ctColorCurve.getVal(l_, r2, g2, b2); // get the color from the color curve + ctColorCurve.getVal (l_, r2, g2, b2); // get the color from the color curve float h2, s2, l2; - Color::rgb2hsl(r2, g2, b2, h2, s2, l2); // transform this new color to hsl + Color::rgb2hsl (r2, g2, b2, h2, s2, l2); // transform this new color to hsl - Color::hsl2rgb(h2, s + ((1.f - s) * (1.f - l) * 0.7f), l, r2, g2, b2); + Color::hsl2rgb (h2, s + ((1.f - s) * (1.f - l) * 0.7f), l, r2, g2, b2); rtemp[ti * TS + tj] = r + (r2 - r) * opacity; // merge the color to the old color, depending on the opacity gtemp[ti * TS + tj] = g + (g2 - g) * opacity; @@ -4074,53 +4048,53 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer for (int j = jstart, tj = 0; j < tW; j++, tj++) { float X, Y, Z, L, aa, bb; //rgb=>lab - Color::rgbxyz(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], X, Y, Z, wp); + Color::rgbxyz (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], X, Y, Z, wp); //convert Lab - Color::XYZ2Lab(X, Y, Z, L, aa, bb); + Color::XYZ2Lab (X, Y, Z, L, aa, bb); //end rgb=>lab - float HH = xatan2f(bb, aa); // HH hue in -3.141 +3.141 + float HH = xatan2f (bb, aa); // HH hue in -3.141 +3.141 - editWhateverTmp[ti * TS + tj] = float(Color::huelab_to_huehsv2(HH)); + editWhateverTmp[ti * TS + tj] = float (Color::huelab_to_huehsv2 (HH)); } } } //black and white - if(blackwhite) { + if (blackwhite) { if (hasToneCurvebw1) { if (beforeCurveMode == BlackWhiteParams::TC_MODE_STD_BW) { // Standard for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - const StandardToneCurvebw& userToneCurvebw = static_cast(customToneCurvebw1); - userToneCurvebw.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + const StandardToneCurvebw& userToneCurvebw = static_cast (customToneCurvebw1); + userToneCurvebw.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } else if (beforeCurveMode == BlackWhiteParams::TC_MODE_FILMLIKE_BW) { // Adobe like for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - const AdobeToneCurvebw& userToneCurvebw = static_cast(customToneCurvebw1); - userToneCurvebw.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + const AdobeToneCurvebw& userToneCurvebw = static_cast (customToneCurvebw1); + userToneCurvebw.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } else if (beforeCurveMode == BlackWhiteParams::TC_MODE_SATANDVALBLENDING_BW) { // apply the curve on the saturation and value channels for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - const SatAndValueBlendingToneCurvebw& userToneCurvebw = static_cast(customToneCurvebw1); - rtemp[ti * TS + tj] = CLIP(rtemp[ti * TS + tj]); - gtemp[ti * TS + tj] = CLIP(gtemp[ti * TS + tj]); - btemp[ti * TS + tj] = CLIP(btemp[ti * TS + tj]); - userToneCurvebw.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + const SatAndValueBlendingToneCurvebw& userToneCurvebw = static_cast (customToneCurvebw1); + rtemp[ti * TS + tj] = CLIP (rtemp[ti * TS + tj]); + gtemp[ti * TS + tj] = CLIP (gtemp[ti * TS + tj]); + btemp[ti * TS + tj] = CLIP (btemp[ti * TS + tj]); + userToneCurvebw.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } else if (beforeCurveMode == BlackWhiteParams::TC_MODE_WEIGHTEDSTD_BW) { // apply the curve to the rgb channels, weighted for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { - const WeightedStdToneCurvebw& userToneCurvebw = static_cast(customToneCurvebw1); - rtemp[ti * TS + tj] = CLIP(rtemp[ti * TS + tj]); - gtemp[ti * TS + tj] = CLIP(gtemp[ti * TS + tj]); - btemp[ti * TS + tj] = CLIP(btemp[ti * TS + tj]); + const WeightedStdToneCurvebw& userToneCurvebw = static_cast (customToneCurvebw1); + rtemp[ti * TS + tj] = CLIP (rtemp[ti * TS + tj]); + gtemp[ti * TS + tj] = CLIP (gtemp[ti * TS + tj]); + btemp[ti * TS + tj] = CLIP (btemp[ti * TS + tj]); - userToneCurvebw.Apply(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); + userToneCurvebw.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } } @@ -4176,15 +4150,15 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer for (int j = jstart, tj = 0; j < tW; j++, tj++) { //rgb => xyz float X, Y, Z; - Color::rgbxyz(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], X, Y, Z, wp); + Color::rgbxyz (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], X, Y, Z, wp); //xyz => Lab float L, aa, bb; - Color::XYZ2Lab(X, Y, Z, L, aa, bb); - float CC = sqrtf(SQR(aa) + SQR(bb)) / 327.68f; //CC chromaticity in 0..180 or more - float HH = xatan2f(bb, aa); // HH hue in -3.141 +3.141 + Color::XYZ2Lab (X, Y, Z, L, aa, bb); + float CC = sqrtf (SQR (aa) + SQR (bb)) / 327.68f; //CC chromaticity in 0..180 or more + float HH = xatan2f (bb, aa); // HH hue in -3.141 +3.141 float2 sincosval; - if(CC == 0.0f) { + if (CC == 0.0f) { sincosval.y = 1.f; sincosval.x = 0.0f; } else { @@ -4194,14 +4168,14 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer if (bwlCurveEnabled) { L /= 32768.f; - double hr = Color::huelab_to_huehsv2(HH); - float valparam = float((bwlCurve->getVal(hr) - 0.5f) * 2.0f); //get l_r=f(H) + double hr = Color::huelab_to_huehsv2 (HH); + float valparam = float ((bwlCurve->getVal (hr) - 0.5f) * 2.0f); //get l_r=f(H) float kcc = (CC / 70.f); //take Chroma into account...70 "middle" of chromaticity (arbitrary and simple), one can imagine other algorithme //reduct action for low chroma and increase action for high chroma valparam *= kcc; - if(valparam > 0.f) { - L = (1.f - valparam) * L + valparam * (1.f - SQR(SQR(SQR(SQR(1.f - min(L, 1.0f)))))); // SQR (SQR((SQR) to increase action in low light + if (valparam > 0.f) { + L = (1.f - valparam) * L + valparam * (1.f - SQR (SQR (SQR (SQR (1.f - min (L, 1.0f)))))); // SQR (SQR((SQR) to increase action in low light } else { L *= (1.f + valparam); //for negative } @@ -4215,16 +4189,16 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer bool neg = false; bool more_rgb = false; //gamut control : Lab values are in gamut - Color::gamutLchonly(HH, sincosval, L, CC, RR, GG, BB, wip, highlight, 0.15f, 0.96f, neg, more_rgb); + Color::gamutLchonly (HH, sincosval, L, CC, RR, GG, BB, wip, highlight, 0.15f, 0.96f, neg, more_rgb); #else //gamut control : Lab values are in gamut - Color::gamutLchonly(HH, sincosval, L, CC, RR, GG, BB, wip, highlight, 0.15f, 0.96f); + Color::gamutLchonly (HH, sincosval, L, CC, RR, GG, BB, wip, highlight, 0.15f, 0.96f); #endif L *= 327.68f; //convert l => rgb - Color::L2XYZ(L, X, Y, Z); + Color::L2XYZ (L, X, Y, Z); float newRed; // We use the red channel for bw - Color::xyz2r(X, Y, Z, newRed, wip); + Color::xyz2r (X, Y, Z, newRed, wip); rtemp[ti * TS + tj] = gtemp[ti * TS + tj] = btemp[ti * TS + tj] = newRed; #ifndef __SSE2__ @@ -4261,19 +4235,19 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer #ifdef __SSE2__ for (; j < tW - 3; j += 4, tj += 4) { - vfloat sourceR = LVF(rtemp[ti * TS + tj]); - vfloat sourceG = LVF(gtemp[ti * TS + tj]); - vfloat sourceB = LVF(btemp[ti * TS + tj]); + vfloat sourceR = LVF (rtemp[ti * TS + tj]); + vfloat sourceG = LVF (gtemp[ti * TS + tj]); + vfloat sourceB = LVF (btemp[ti * TS + tj]); vfloat x; vfloat y; vfloat z; - Color::rgbxyz(sourceR, sourceG, sourceB, x, y, z, v_work2xyz); - Color::xyz2rgb(x, y, z, sourceR, sourceG, sourceB, v_xyz2clut); + Color::rgbxyz (sourceR, sourceG, sourceB, x, y, z, v_work2xyz); + Color::xyz2rgb (x, y, z, sourceR, sourceG, sourceB, v_xyz2clut); - STVF(rtemp[ti * TS + tj], sourceR); - STVF(gtemp[ti * TS + tj], sourceG); - STVF(btemp[ti * TS + tj], sourceB); + STVF (rtemp[ti * TS + tj], sourceR); + STVF (gtemp[ti * TS + tj], sourceG); + STVF (btemp[ti * TS + tj], sourceB); } #endif @@ -4284,8 +4258,8 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float &sourceB = btemp[ti * TS + tj]; float x, y, z; - Color::rgbxyz( sourceR, sourceG, sourceB, x, y, z, wprof ); - Color::xyz2rgb(x, y, z, sourceR, sourceG, sourceB, xyz2clut); + Color::rgbxyz ( sourceR, sourceG, sourceB, x, y, z, wprof ); + Color::xyz2rgb (x, y, z, sourceR, sourceG, sourceB, xyz2clut); } } @@ -4295,15 +4269,15 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float &sourceB = btemp[ti * TS + tj]; // Apply gamma sRGB (default RT) - sourceR = Color::gamma_srgbclipped(sourceR); - sourceG = Color::gamma_srgbclipped(sourceG); - sourceB = Color::gamma_srgbclipped(sourceB); + sourceR = Color::gamma_srgbclipped (sourceR); + sourceG = Color::gamma_srgbclipped (sourceG); + sourceB = Color::gamma_srgbclipped (sourceB); } const std::size_t line_offset = ti * TS; - hald_clut->getRGB( + hald_clut->getRGB ( film_simulation_strength, - std::min(TS, tW - jstart), + std::min (TS, tW - jstart), rtemp + line_offset, gtemp + line_offset, btemp + line_offset, @@ -4316,9 +4290,9 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float &sourceB = btemp[ti * TS + tj]; // Apply inverse gamma sRGB - sourceR = Color::igamma_srgb(out_rgbx[tj * 4 + 0]); - sourceG = Color::igamma_srgb(out_rgbx[tj * 4 + 1]); - sourceB = Color::igamma_srgb(out_rgbx[tj * 4 + 2]); + sourceR = Color::igamma_srgb (out_rgbx[tj * 4 + 0]); + sourceG = Color::igamma_srgb (out_rgbx[tj * 4 + 1]); + sourceB = Color::igamma_srgb (out_rgbx[tj * 4 + 2]); } if (!clutAndWorkingProfilesAreSame) { @@ -4329,19 +4303,19 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer #ifdef __SSE2__ for (; j < tW - 3; j += 4, tj += 4) { - vfloat sourceR = LVF(rtemp[ti * TS + tj]); - vfloat sourceG = LVF(gtemp[ti * TS + tj]); - vfloat sourceB = LVF(btemp[ti * TS + tj]); + vfloat sourceR = LVF (rtemp[ti * TS + tj]); + vfloat sourceG = LVF (gtemp[ti * TS + tj]); + vfloat sourceB = LVF (btemp[ti * TS + tj]); vfloat x; vfloat y; vfloat z; - Color::rgbxyz(sourceR, sourceG, sourceB, x, y, z, v_clut2xyz); - Color::xyz2rgb(x, y, z, sourceR, sourceG, sourceB, v_xyz2work); + Color::rgbxyz (sourceR, sourceG, sourceB, x, y, z, v_clut2xyz); + Color::xyz2rgb (x, y, z, sourceR, sourceG, sourceB, v_xyz2work); - STVF(rtemp[ti * TS + tj], sourceR); - STVF(gtemp[ti * TS + tj], sourceG); - STVF(btemp[ti * TS + tj], sourceB); + STVF (rtemp[ti * TS + tj], sourceR); + STVF (gtemp[ti * TS + tj], sourceG); + STVF (btemp[ti * TS + tj], sourceB); } #endif @@ -4352,8 +4326,8 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float &sourceB = btemp[ti * TS + tj]; float x, y, z; - Color::rgbxyz(sourceR, sourceG, sourceB, x, y, z, clut2xyz); - Color::xyz2rgb( x, y, z, sourceR, sourceG, sourceB, wiprof ); + Color::rgbxyz (sourceR, sourceG, sourceB, x, y, z, clut2xyz); + Color::xyz2rgb ( x, y, z, sourceR, sourceG, sourceB, wiprof ); } } } @@ -4367,11 +4341,11 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer // filling the pipette buffer by the content of the temp pipette buffers if (editImgFloat) { - editImgFloat->r(i, j) = editIFloatTmpR[ti * TS + tj]; - editImgFloat->g(i, j) = editIFloatTmpG[ti * TS + tj]; - editImgFloat->b(i, j) = editIFloatTmpB[ti * TS + tj]; + editImgFloat->r (i, j) = editIFloatTmpR[ti * TS + tj]; + editImgFloat->g (i, j) = editIFloatTmpG[ti * TS + tj]; + editImgFloat->b (i, j) = editIFloatTmpB[ti * TS + tj]; } else if (editWhatever) { - editWhatever->v(i, j) = editWhateverTmp[ti * TS + tj]; + editWhatever->v (i, j) = editWhateverTmp[ti * TS + tj]; } float r = rtemp[ti * TS + tj]; @@ -4384,9 +4358,9 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float fx, fy, fz; - fx = (x < 65535.0f ? Color::cachef[x] : 327.68f * std::cbrt(x / MAXVALF)); - fy = (y < 65535.0f ? Color::cachef[y] : 327.68f * std::cbrt(y / MAXVALF)); - fz = (z < 65535.0f ? Color::cachef[z] : 327.68f * std::cbrt(z / MAXVALF)); + fx = (x < 65535.0f ? Color::cachef[x] : 327.68f * std::cbrt (x / MAXVALF)); + fy = (y < 65535.0f ? Color::cachef[y] : 327.68f * std::cbrt (y / MAXVALF)); + fz = (z < 65535.0f ? Color::cachef[z] : 327.68f * std::cbrt (z / MAXVALF)); lab->L[i][j] = (116.0f * fy - 5242.88f); //5242.88=16.0*327.68; lab->a[i][j] = (500.0f * (fx - fy) ); @@ -4415,22 +4389,22 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer for (int j = jstart, tj = 0; j < tW; j++, tj++) { // filling the pipette buffer by the content of the temp pipette buffers if (editImgFloat) { - editImgFloat->r(i, j) = editIFloatTmpR[ti * TS + tj]; - editImgFloat->g(i, j) = editIFloatTmpG[ti * TS + tj]; - editImgFloat->b(i, j) = editIFloatTmpB[ti * TS + tj]; + editImgFloat->r (i, j) = editIFloatTmpR[ti * TS + tj]; + editImgFloat->g (i, j) = editIFloatTmpG[ti * TS + tj]; + editImgFloat->b (i, j) = editIFloatTmpB[ti * TS + tj]; } else if (editWhatever) { - editWhatever->v(i, j) = editWhateverTmp[ti * TS + tj]; + editWhatever->v (i, j) = editWhateverTmp[ti * TS + tj]; } - tmpImage->r(i, j) = rtemp[ti * TS + tj]; - tmpImage->g(i, j) = gtemp[ti * TS + tj]; - tmpImage->b(i, j) = btemp[ti * TS + tj]; + tmpImage->r (i, j) = rtemp[ti * TS + tj]; + tmpImage->g (i, j) = gtemp[ti * TS + tj]; + tmpImage->b (i, j) = btemp[ti * TS + tj]; } } } } - free(buffer); + free (buffer); if (editIFloatBuffer) { free (editIFloatBuffer); @@ -4443,7 +4417,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer #ifdef _OPENMP #pragma omp critical { - if(toneCurveHistSize > 0) { + if (toneCurveHistSize > 0) { histToneCurve += histToneCurveThr; } } @@ -4465,9 +4439,9 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer for (int i = 0; i < tH; i++) { for (int j = 0; j < tW; j++) { - nr += tmpImage->r(i, j); - ng += tmpImage->g(i, j); - nb += tmpImage->b(i, j); + nr += tmpImage->r (i, j); + ng += tmpImage->g (i, j); + nb += tmpImage->b (i, j); } } @@ -4476,9 +4450,9 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer double kng = srgb / ng; double knb = srgb / nb; double sk = knr + kng + knb; - autor = (float)(100.0 * knr / sk); - autog = (float)(100.0 * kng / sk); - autob = (float)(100.0 * knb / sk); + autor = (float) (100.0 * knr / sk); + autog = (float) (100.0 * kng / sk); + autob = (float) (100.0 * knb / sk); } @@ -4495,9 +4469,9 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } float filcor; - Color::computeBWMixerConstants(params->blackwhite.setting, params->blackwhite.filter, params->blackwhite.algo, filcor, - bwr, bwg, bwb, mixerOrange, mixerYellow, mixerCyan, mixerPurple, mixerMagenta, - params->blackwhite.autoc, complem, kcorec, rrm, ggm, bbm); + Color::computeBWMixerConstants (params->blackwhite.setting, params->blackwhite.filter, params->blackwhite.algo, filcor, + bwr, bwg, bwb, mixerOrange, mixerYellow, mixerCyan, mixerPurple, mixerMagenta, + params->blackwhite.autoc, complem, kcorec, rrm, ggm, bbm); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic, 16) @@ -4507,13 +4481,13 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer for (int j = 0; j < tW; j++) { //mix channel - tmpImage->r(i, j) = tmpImage->g(i, j) = tmpImage->b(i, j) = CLIP((bwr * tmpImage->r(i, j) + bwg * tmpImage->g(i, j) + bwb * tmpImage->b(i, j)) * kcorec); + tmpImage->r (i, j) = tmpImage->g (i, j) = tmpImage->b (i, j) = CLIP ((bwr * tmpImage->r (i, j) + bwg * tmpImage->g (i, j) + bwb * tmpImage->b (i, j)) * kcorec); #ifndef __SSE2__ //gamma correction: pseudo TRC curve if (hasgammabw) { - Color::trcGammaBW (tmpImage->r(i, j), tmpImage->g(i, j), tmpImage->b(i, j), gammabwr, gammabwg, gammabwb); + Color::trcGammaBW (tmpImage->r (i, j), tmpImage->g (i, j), tmpImage->b (i, j), gammabwr, gammabwg, gammabwb); } #endif @@ -4523,7 +4497,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer if (hasgammabw) { //gamma correction: pseudo TRC curve - Color::trcGammaBWRow (tmpImage->r(i), tmpImage->g(i), tmpImage->b(i), tW, gammabwr, gammabwg, gammabwb); + Color::trcGammaBWRow (tmpImage->r (i), tmpImage->g (i), tmpImage->b (i), tW, gammabwr, gammabwg, gammabwb); } #endif @@ -4537,7 +4511,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer for (int i = 0; i < tH; i++) { for (int j = 0; j < tW; j++) { - editWhatever->v(i, j) = Color::gamma2curve[tmpImage->r(i, j)] / 65535.f; // assuming that r=g=b + editWhatever->v (i, j) = Color::gamma2curve[tmpImage->r (i, j)] / 65535.f; // assuming that r=g=b } } } @@ -4551,8 +4525,8 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer for (int i = 0; i < tH; i++) { for (int j = 0; j < tW; j++) { - const StandardToneCurvebw& userToneCurve = static_cast(customToneCurvebw2); - userToneCurve.Apply(tmpImage->r(i, j), tmpImage->g(i, j), tmpImage->b(i, j)); + const StandardToneCurvebw& userToneCurve = static_cast (customToneCurvebw2); + userToneCurve.Apply (tmpImage->r (i, j), tmpImage->g (i, j), tmpImage->b (i, j)); } } } else if (afterCurveMode == BlackWhiteParams::TC_MODE_WEIGHTEDSTD_BW) { // apply the curve to the rgb channels, weighted @@ -4562,13 +4536,13 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer for (int i = 0; i < tH; i++) { //for ulterior usage if bw data modified for (int j = 0; j < tW; j++) { - const WeightedStdToneCurvebw& userToneCurve = static_cast(customToneCurvebw2); + const WeightedStdToneCurvebw& userToneCurve = static_cast (customToneCurvebw2); - tmpImage->r(i, j) = CLIP(tmpImage->r(i, j)); - tmpImage->g(i, j) = CLIP(tmpImage->g(i, j)); - tmpImage->b(i, j) = CLIP(tmpImage->b(i, j)); + tmpImage->r (i, j) = CLIP (tmpImage->r (i, j)); + tmpImage->g (i, j) = CLIP (tmpImage->g (i, j)); + tmpImage->b (i, j) = CLIP (tmpImage->b (i, j)); - userToneCurve.Apply(tmpImage->r(i, j), tmpImage->g(i, j), tmpImage->b(i, j)); + userToneCurve.Apply (tmpImage->r (i, j), tmpImage->g (i, j), tmpImage->b (i, j)); } } } @@ -4576,7 +4550,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer //colortoning with black and white if (hasColorToning) { - if(params->colorToning.method == "Splitco") { + if (params->colorToning.method == "Splitco") { /* #if 1 for (int i=istart,ti=0; icolorToning.lumamode) { + if (params->colorToning.lumamode) { preser = 1; } @@ -4606,32 +4580,32 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer for (int i = 0; i < tH; i++) { for (int j = 0; j < tW; j++) { - float r = tmpImage->r(i, j); - float g = tmpImage->g(i, j); - float b = tmpImage->b(i, j); + float r = tmpImage->r (i, j); + float g = tmpImage->g (i, j); + float b = tmpImage->b (i, j); float lumbefore = 0.299f * r + 0.587f * g + 0.114f * b; - if(lumbefore < 65000.f && lumbefore > 500.f) { //reduct artifacts for highlights an extrem shadows + if (lumbefore < 65000.f && lumbefore > 500.f) { //reduct artifacts for highlights an extrem shadows float ro, go, bo; int mode = 1; toningsmh (r, g, b, ro, go, bo, RedLow, GreenLow, BlueLow, RedMed, GreenMed, BlueMed, RedHigh, GreenHigh, BlueHigh, reducac, mode, preser, strProtect); float lumafter = 0.299f * ro + 0.587f * go + 0.114f * bo; float preserv = 1.f; - if(preser == 1) { + if (preser == 1) { preserv = lumbefore / lumafter; } ro *= preserv; go *= preserv; bo *= preserv; - ro = CLIP(ro); - go = CLIP(go); - bo = CLIP(bo); - tmpImage->r(i, j) = ro; - tmpImage->g(i, j) = go; - tmpImage->b(i, j) = bo; + ro = CLIP (ro); + go = CLIP (go); + bo = CLIP (bo); + tmpImage->r (i, j) = ro; + tmpImage->g (i, j) = go; + tmpImage->b (i, j) = bo; } } } @@ -4644,7 +4618,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float reducac = 0.4f; int preser = 0; - if(params->colorToning.lumamode) { + if (params->colorToning.lumamode) { preser = 1; } @@ -4659,31 +4633,31 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer iphigh = (float)ctColorCurve.high; //2 colours - ctColorCurve.getVal(iphigh, xh, yh, zh); - ctColorCurve.getVal(iplow, xl, yl, zl); + ctColorCurve.getVal (iphigh, xh, yh, zh); + ctColorCurve.getVal (iplow, xl, yl, zl); - Color::xyz2rgb(xh, yh, zh, rh, gh, bh, wip); - Color::xyz2rgb(xl, yl, zl, rl, gl, bl, wip); + Color::xyz2rgb (xh, yh, zh, rh, gh, bh, wip); + Color::xyz2rgb (xl, yl, zl, rl, gl, bl, wip); //retrieve rgb value with s and l =1 - retreavergb(rl, gl, bl); - retreavergb(rh, gh, bh); + retreavergb (rl, gl, bl); + retreavergb (rh, gh, bh); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic, 5) #endif for (int i = 0; i < tH; i++) { for (int j = 0; j < tW; j++) { - float r = tmpImage->r(i, j); - float g = tmpImage->g(i, j); - float b = tmpImage->b(i, j); + float r = tmpImage->r (i, j); + float g = tmpImage->g (i, j); + float b = tmpImage->b (i, j); float ro, go, bo; int mode = 1; toning2col (r, g, b, ro, go, bo, iplow, iphigh, rl, gl, bl, rh, gh, bh, SatLow, SatHigh, balanS, balanH, reducac, mode, preser, strProtect); - tmpImage->r(i, j) = ro; - tmpImage->g(i, j) = go; - tmpImage->b(i, j) = bo; + tmpImage->r (i, j) = ro; + tmpImage->g (i, j) = go; + tmpImage->b (i, j) = bo; } } } @@ -4692,7 +4666,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer else if (params->colorToning.method == "Lab" && opautili) { int algm = 0; bool twocol = true; - int metchrom; + int metchrom = 0; if (params->colorToning.twocolor == "Std" ) { metchrom = 0; @@ -4704,13 +4678,13 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer metchrom = 3; } - if(metchrom == 3) { + if (metchrom == 3) { twocol = false; } - float iplow, iphigh; + float iplow = 0.f, iphigh = 0.f; - if(!twocol) { + if (!twocol) { iplow = (float)ctColorCurve.low; iphigh = (float)ctColorCurve.high; @@ -4718,7 +4692,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer int twoc = 0; //integer instead of bool to let more possible choice...other than 2 and 500. - if(!twocol) { + if (!twocol) { twoc = 0; // 2 colours } else { twoc = 1; // 500 colours @@ -4726,32 +4700,32 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer if (params->colorToning.method == "Lab") { algm = 1; - } else if(params->colorToning.method == "Lch") { + } else if (params->colorToning.method == "Lch") { algm = 2; //in case of } - if(algm <= 2) { + if (algm <= 2) { #ifdef _OPENMP #pragma omp parallel for schedule(dynamic, 5) #endif for (int i = 0; i < tH; i++) { for (int j = 0; j < tW; j++) { - float r = tmpImage->r(i, j); - float g = tmpImage->g(i, j); - float b = tmpImage->b(i, j); + float r = tmpImage->r (i, j); + float g = tmpImage->g (i, j); + float b = tmpImage->b (i, j); float ro, bo, go; labtoning (r, g, b, ro, go, bo, algm, metchrom, twoc, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, clToningcurve, cl2Toningcurve, iplow, iphigh, wp, wip); - tmpImage->r(i, j) = CLIP(ro); - tmpImage->g(i, j) = CLIP(go); - tmpImage->b(i, j) = CLIP(bo); + tmpImage->r (i, j) = CLIP (ro); + tmpImage->g (i, j) = CLIP (go); + tmpImage->b (i, j) = CLIP (bo); } } } } - else if (params->colorToning.method.substr(0, 3) == "RGB" && opautili) { + else if (params->colorToning.method.substr (0, 3) == "RGB" && opautili) { // color toning #ifdef _OPENMP #pragma omp parallel for schedule(dynamic, 5) @@ -4759,31 +4733,31 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer for (int i = 0; i < tH; i++) { for (int j = 0; j < tW; j++) { - float r = tmpImage->r(i, j); - float g = tmpImage->g(i, j); - float b = tmpImage->b(i, j); + float r = tmpImage->r (i, j); + float g = tmpImage->g (i, j); + float b = tmpImage->b (i, j); // Luminance = (0.299f*r + 0.587f*g + 0.114f*b) float h, s, l; - Color::rgb2hsl(r, g, b, h, s, l); + Color::rgb2hsl (r, g, b, h, s, l); - float l_ = Color::gamma_srgb(l * 65535.f) / 65535.f; + float l_ = Color::gamma_srgb (l * 65535.f) / 65535.f; // get the opacity and tweak it to preserve saturated colors float opacity = ctOpacityCurve.lutOpacityCurve[l_ * 500.f] / 4.f; float r2, g2, b2; - ctColorCurve.getVal(l_, r2, g2, b2); // get the color from the color curve + ctColorCurve.getVal (l_, r2, g2, b2); // get the color from the color curve float h2, s2, l2; - Color::rgb2hsl(r2, g2, b2, h2, s2, l2); // transform this new color to hsl + Color::rgb2hsl (r2, g2, b2, h2, s2, l2); // transform this new color to hsl - Color::hsl2rgb(h2, s2, l, r2, g2, b2); + Color::hsl2rgb (h2, s2, l, r2, g2, b2); - tmpImage->r(i, j) = r + (r2 - r) * opacity; - tmpImage->g(i, j) = g + (g2 - g) * opacity; - tmpImage->b(i, j) = b + (b2 - b) * opacity; + tmpImage->r (i, j) = r + (r2 - r) * opacity; + tmpImage->g (i, j) = g + (g2 - g) * opacity; + tmpImage->b (i, j) = b + (b2 - b) * opacity; } } } @@ -4818,9 +4792,9 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer for (int i = 0; i < tH; i++) { for (int j = 0; j < tW; j++) { - float r = tmpImage->r(i, j); - float g = tmpImage->g(i, j); - float b = tmpImage->b(i, j); + float r = tmpImage->r (i, j); + float g = tmpImage->g (i, j); + float b = tmpImage->b (i, j); float x = toxyz[0][0] * r + toxyz[0][1] * g + toxyz[0][2] * b; float y = toxyz[1][0] * r + toxyz[1][1] * g + toxyz[1][2] * b; @@ -4828,9 +4802,9 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float fx, fy, fz; - fx = (x < MAXVALF ? Color::cachef[x] : 327.68f * std::cbrt(x / MAXVALF)); - fy = (y < MAXVALF ? Color::cachef[y] : 327.68f * std::cbrt(y / MAXVALF)); - fz = (z < MAXVALF ? Color::cachef[z] : 327.68f * std::cbrt(z / MAXVALF)); + fx = (x < MAXVALF ? Color::cachef[x] : 327.68f * std::cbrt (x / MAXVALF)); + fy = (y < MAXVALF ? Color::cachef[y] : 327.68f * std::cbrt (y / MAXVALF)); + fz = (z < MAXVALF ? Color::cachef[z] : 327.68f * std::cbrt (z / MAXVALF)); lab->L[i][j] = 116.0f * fy - 5242.88f; //5242.88=16.0*327.68; lab->a[i][j] = 500.0f * (fx - fy); @@ -4866,31 +4840,31 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer **/ void ImProcFunctions::retreavergb (float &r, float &g, float &b) { - float mini = min(r, g, b); - float maxi = max(r, g, b); + float mini = min (r, g, b); + float maxi = max (r, g, b); float kkm = 65535.f / maxi; - if(b == mini && r == maxi) { + if (b == mini && r == maxi) { r = 65535.f; g = kkm * (g - b); b = 0.f; - } else if(b == mini && g == maxi) { + } else if (b == mini && g == maxi) { g = 65535.f; r = kkm * (r - b); b = 0.f; - } else if(g == mini && r == maxi) { + } else if (g == mini && r == maxi) { r = 65535.f; b = kkm * (b - g); g = 0.f; - } else if(g == mini && b == maxi) { + } else if (g == mini && b == maxi) { b = 65535.f; r = kkm * (r - g); g = 0.f; - } else if(r == mini && b == maxi) { + } else if (r == mini && b == maxi) { b = 65535.f; g = kkm * (g - r); r = 0.f; - } else if(r == mini && g == maxi) { + } else if (r == mini && g == maxi) { g = 65535.f; b = kkm * (b - r); r = 0.f; @@ -4915,7 +4889,7 @@ void ImProcFunctions::secondeg_end (float reducac, float vinf, float &aa, float float a3 = 1.f - v0 * v0; float a4 = me * me - v0 * v0; aa = (1.f + (zrd - 1.f) * (1 - v0) / a2) / (a4 * (1.f - v0) / a2 - a3); - bb = -(1.f + a3 * aa) / (1.f - v0); + bb = - (1.f + a3 * aa) / (1.f - v0); cc = - (aa + bb); } @@ -4964,7 +4938,7 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go float GreenL = 1.f + (GreenLow - 1.f) * 0.4f; float BlueL = 1.f + (BlueLow - 1.f) * bmu; float h, s, v; - Color::rgb2hsv(r, g, b, h, s, v); + Color::rgb2hsv (r, g, b, h, s, v); float ksat = 1.f; float ksatlow = 1.f; // float s_0=0.55f; @@ -4981,10 +4955,10 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go float rlh = 2.2f; //1.1 float rlob = bmu; //for BW old mode - if(mode == 0) { //color - rlo *= pow_F(strProtect, 0.4f); //0.5 ==> 0.75 - rlh *= pow_F(strProtect, 0.4f); - rlm *= pow_F(strProtect, 0.4f); + if (mode == 0) { //color + rlo *= pow_F (strProtect, 0.4f); //0.5 ==> 0.75 + rlh *= pow_F (strProtect, 0.4f); + rlm *= pow_F (strProtect, 0.4f); } else { //bw coefficient to preserve same results as before for satlimtopacity = 0.5 (default) rlo = strProtect * 0.8f; //0.4 rlob = strProtect; //0.5 @@ -4992,7 +4966,7 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go rlh = strProtect * 2.4f; //1.2 } - if(mode == 0) { + if (mode == 0) { rlob = rlo; } @@ -5002,10 +4976,10 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go //fixed value of reducac=0.3 //secondeg_end (reducac, v0, aa, bb, cc); - if(mode == 1) { + if (mode == 1) { reducac = 0.5f; //black and white mode - if(v > 0.15f) { + if (v > 0.15f) { kl = (-1.f / 0.85f) * v + (1.f) / 0.85f; //Low light ==> decrease action after v=0.15 } } else { //color @@ -5013,56 +4987,56 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go float aab, bbb; secondeg_begin (0.7f, v0, aab, bbb); - if(v > v0) { + if (v > v0) { kl = aa * v * v + bb * v + cc; //verified ==> exact } else if (mode == 0) { kl = aab * v * v + bbb * v; //ksatlow=ksat; } } - if(RedLow != 1.f) { + if (RedLow != 1.f) { RedL = 1.f + (RedLow - 1.f) * kl * ksat * rlo; //0.4 - if(RedLow >= 1.f) { + if (RedLow >= 1.f) { g -= 20000.f * (RedL - 1.f) * ksatlow; b -= 20000.f * (RedL - 1.f) * ksatlow; } else { r += 20000.f * (RedL - 1.f) * ksatlow; } - r = CLIP(r); - g = CLIP(g); - b = CLIP(b); + r = CLIP (r); + g = CLIP (g); + b = CLIP (b); } - if(GreenLow != 1.f) { + if (GreenLow != 1.f) { GreenL = 1.f + (GreenLow - 1.f) * kl * ksat * rlo; //0.4 - if(GreenLow >= 1.f) { + if (GreenLow >= 1.f) { r -= 20000.f * (GreenL - 1.f) * ksatlow; b -= 20000.f * (GreenL - 1.f) * ksatlow; } else { g += 20000.f * (GreenL - 1.f) * ksatlow; } - r = CLIP(r); - b = CLIP(b); - g = CLIP(g); + r = CLIP (r); + b = CLIP (b); + g = CLIP (g); } - if(BlueLow != 1.f) { + if (BlueLow != 1.f) { BlueL = 1.f + (BlueLow - 1.f) * kl * ksat * rlob; - if(BlueLow >= 1.f) { + if (BlueLow >= 1.f) { r -= 20000.f * (BlueL - 1.f) * ksatlow; g -= 20000.f * (BlueL - 1.f) * ksatlow; } else { b += 20000.f * (BlueL - 1.f) * ksatlow; } - r = CLIP(r); - g = CLIP(g); - b = CLIP(b); + r = CLIP (r); + g = CLIP (g); + b = CLIP (b); } // mid tones @@ -5070,7 +5044,7 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go float v0m = 0.5f; //max action float v0mm = 0.5f; //max - if(v < v0m) { + if (v < v0m) { float aam, bbm; float vend = v0m; secondeg_begin (reducac, vend, aam, bbm); @@ -5083,67 +5057,67 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go float RedM = 1.f + (RedMed - 1.f) * rlm; - if(RedMed != 1.f) { + if (RedMed != 1.f) { RedM = 1.f + (RedMed - 1.f) * km * rlm; - if(RedMed >= 1.f) { + if (RedMed >= 1.f) { r += 20000.f * (RedM - 1.f); g -= 10000.f * (RedM - 1.f); b -= 10000.f * (RedM - 1.f); - r = CLIP(r); - g = CLIP(g); - b = CLIP(b); + r = CLIP (r); + g = CLIP (g); + b = CLIP (b); } else { r += 10000.f * (RedM - 1.f); g -= 20000.f * (RedM - 1.f); b -= 20000.f * (RedM - 1.f); - r = CLIP(r); - g = CLIP(g); - b = CLIP(b); + r = CLIP (r); + g = CLIP (g); + b = CLIP (b); } } float GreenM = 1.f + (GreenMed - 1.f) * rlm; - if(GreenMed != 1.f) { + if (GreenMed != 1.f) { GreenM = 1.f + (GreenMed - 1.f) * km * rlm; - if(GreenMed >= 1.f) { + if (GreenMed >= 1.f) { r -= 10000.f * (GreenM - 1.f); g += 20000.f * (GreenM - 1.f); b -= 10000.f * (GreenM - 1.f); - r = CLIP(r); - g = CLIP(g); - b = CLIP(b); + r = CLIP (r); + g = CLIP (g); + b = CLIP (b); } else { r -= 20000.f * (GreenM - 1.f); g += 10000.f * (GreenM - 1.f); b -= 20000.f * (GreenM - 1.f); - r = CLIP(r); - g = CLIP(g); - b = CLIP(b); + r = CLIP (r); + g = CLIP (g); + b = CLIP (b); } } float BlueM = 1.f + (BlueMed - 1.f) * rlm; - if(BlueMed != 1.f) { + if (BlueMed != 1.f) { BlueM = 1.f + (BlueMed - 1.f) * km * rlm; - if(BlueMed >= 1.f) { + if (BlueMed >= 1.f) { r -= 10000.f * (BlueM - 1.f); g -= 10000.f * (BlueM - 1.f); b += 20000.f * (BlueM - 1.f); - r = CLIP(r); - g = CLIP(g); - b = CLIP(b); + r = CLIP (r); + g = CLIP (g); + b = CLIP (b); } else { r -= 20000.f * (BlueM - 1.f); g -= 20000.f * (BlueM - 1.f); b += 10000.f * (BlueM - 1.f); - r = CLIP(r); - g = CLIP(g); - b = CLIP(b); + r = CLIP (r); + g = CLIP (g); + b = CLIP (b); } } @@ -5156,7 +5130,7 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go // float hmu=1.5f; // if(mode==1) hmu=1.2f;//for BW old mode - if(v > v00) { + if (v > v00) { kh = (-1.f / (1.f - v00)) * v + (1.f) / (1.f - v00); //High tones } else { kh = aa0 * v * v + bb0 * v; //verification = good @@ -5166,49 +5140,49 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go float GreenH = 1.f + (GreenHigh - 1.f) * rlh; float BlueH = 1.f + (BlueHigh - 1.f) * rlh; //1.2 - if(RedHigh != 1.f) { + if (RedHigh != 1.f) { RedH = 1.f + (RedHigh - 1.f) * kh * rlh; //1.2 - if(RedHigh >= 1.f) { + if (RedHigh >= 1.f) { r += 20000.f * (RedH - 1.f); - r = CLIP(r); + r = CLIP (r); } else { g -= 20000.f * (RedH - 1.f); b -= 20000.f * (RedH - 1.f); } - g = CLIP(g); - b = CLIP(b); + g = CLIP (g); + b = CLIP (b); } - if(GreenHigh != 1.f) { + if (GreenHigh != 1.f) { GreenH = 1.f + (GreenHigh - 1.f) * kh * rlh; //1.2 - if(GreenHigh >= 1.f) { + if (GreenHigh >= 1.f) { g += 20000.f * (GreenH - 1.f); - g = CLIP(g); + g = CLIP (g); } else { r -= 20000.f * (GreenH - 1.f); b -= 20000.f * (GreenH - 1.f); } - r = CLIP(r); - b = CLIP(b); + r = CLIP (r); + b = CLIP (b); } - if(BlueHigh != 1.f) { + if (BlueHigh != 1.f) { BlueH = 1.f + (BlueHigh - 1.f) * kh * rlh; //1.2 - if(BlueHigh >= 1.f) { + if (BlueHigh >= 1.f) { b += 20000.f * (BlueH - 1.f); - b = CLIP(b); + b = CLIP (b); } else { r -= 20000.f * (BlueH - 1.f); g -= 20000.f * (BlueH - 1.f); } - r = CLIP(r); - g = CLIP(g); + r = CLIP (r); + g = CLIP (g); } ro = r; @@ -5232,13 +5206,11 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g { float lumbefore = 0.299f * r + 0.587f * g + 0.114f * b; float h, s, l; - Color::rgb2hsl(r, g, b, h, s, l); + Color::rgb2hsl (r, g, b, h, s, l); float v; - Color::rgb2hsv(r, g, b, h, s, v); + Color::rgb2hsv (r, g, b, h, s, v); float ksat = 1.f; float ksatlow = 1.f; - float s_0 = 0.55f; - float s_1 = 0.85f; /* if(mode==0) {//color if(s < s_0) ksat=SQR((1.f/s_0)*s); @@ -5248,18 +5220,18 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g float kl = 1.f; float rlo = 1.f; float rlh = 2.2f; - rlo *= pow_F(strProtect, 0.4f); //0.5 ==> 0.75 transfered value for more action - rlh *= pow_F(strProtect, 0.4f); + rlo *= pow_F (strProtect, 0.4f); //0.5 ==> 0.75 transfered value for more action + rlh *= pow_F (strProtect, 0.4f); //low tones //second degree float aa, bb, cc; //fixed value of reducac =0.4; secondeg_end (reducac, iplow, aa, bb, cc); - float aab, bbb, ccb; + float aab, bbb; secondeg_begin (0.7f, iplow, aab, bbb); - if(v > iplow) { + if (v > iplow) { kl = aa * v * v + bb * v + cc; } else if (mode == 0) { kl = aab * v * v + bbb * v; @@ -5271,43 +5243,43 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g float kgl = gl / (rl + gl + bl); float kbl = bl / (rl + gl + bl); - if(SatLow > 0.f) { + if (SatLow > 0.f) { float kmgb; - if(g < 20000.f || b < 20000.f || r < 20000.f) { - kmgb = min(r, g, b); //I have tested ...0.85 compromise... - kl *= pow((kmgb / 20000.f), 0.85f); + if (g < 20000.f || b < 20000.f || r < 20000.f) { + kmgb = min (r, g, b); //I have tested ...0.85 compromise... + kl *= pow ((kmgb / 20000.f), 0.85f); } RedL = 1.f + (SatLow * krl) * kl * ksat * rlo * balanS; //0.4 - if(krl > 0.f) { + if (krl > 0.f) { g -= 20000.f * (RedL - 1.f) * ksatlow; b -= 20000.f * (RedL - 1.f) * ksatlow; } - g = CLIP(g); - b = CLIP(b); + g = CLIP (g); + b = CLIP (b); GreenL = 1.f + (SatLow * kgl) * kl * ksat * rlo * balanS; //0.4 - if(kgl > 0.f) { + if (kgl > 0.f) { r -= 20000.f * (GreenL - 1.f) * ksatlow; b -= 20000.f * (GreenL - 1.f) * ksatlow; } - r = CLIP(r); - b = CLIP(b); + r = CLIP (r); + b = CLIP (b); BlueL = 1.f + (SatLow * kbl) * kl * ksat * rlo * balanS; //0.4 - if(kbl > 0.f) { + if (kbl > 0.f) { r -= 20000.f * (BlueL - 1.f) * ksatlow; g -= 20000.f * (BlueL - 1.f) * ksatlow; } - r = CLIP(r); - g = CLIP(g); + r = CLIP (r); + g = CLIP (g); } //high tones @@ -5316,7 +5288,7 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g //fixed value of reducac ==0.4; secondeg_begin (reducac, iphigh, aa0, bb0); - if(v > iphigh) { + if (v > iphigh) { kh = (-1.f / (1.f - iphigh)) * v + (1.f) / (1.f - iphigh); //Low light ==> decrease action after iplow } else { kh = aa0 * v * v + bb0 * v; @@ -5324,8 +5296,8 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g float kmgb; - if(g > 45535.f || b > 45535.f || r > 45535.f) { - kmgb = max(r, g, b); + if (g > 45535.f || b > 45535.f || r > 45535.f) { + kmgb = max (r, g, b); float cora = 1.f / (45535.f - 65535.f); float corb = 1.f - cora * 45535.f; float cor = kmgb * cora + corb; @@ -5342,41 +5314,41 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g float kgh = gh / (rh + gh + bh); float kbh = bh / (rh + gh + bh); - if(SatHigh > 0.f) { + if (SatHigh > 0.f) { RedH = 1.f + (SatHigh * krh) * kh * rlh * balanH; //1.2 - if(krh > 0.f) { + if (krh > 0.f) { r += 20000.f * (RedH - 1.f); - r = CLIP(r); + r = CLIP (r); } - g = CLIP(g); - b = CLIP(b); + g = CLIP (g); + b = CLIP (b); GreenH = 1.f + (SatHigh * kgh) * kh * rlh * balanH; //1.2 - if(kgh > 0.f) { + if (kgh > 0.f) { g += 20000.f * (GreenH - 1.f); - g = CLIP(g); + g = CLIP (g); } - r = CLIP(r); - b = CLIP(b); + r = CLIP (r); + b = CLIP (b); BlueH = 1.f + (SatHigh * kbh) * kh * rlh * balanH; //1.2 - if(kbh > 0.f) { + if (kbh > 0.f) { b += 20000.f * (BlueH - 1.f); - b = CLIP(b); + b = CLIP (b); } - r = CLIP(r); - g = CLIP(g); + r = CLIP (r); + g = CLIP (g); } float lumafter = 0.299f * r + 0.587f * g + 0.114f * b; float preserv = 1.f; - if(preser == 1) { + if (preser == 1) { preserv = lumbefore / lumafter; } @@ -5387,9 +5359,9 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g ro *= preserv; go *= preserv; bo *= preserv; - ro = CLIP(ro); - go = CLIP(go); - bo = CLIP(bo); + ro = CLIP (ro); + go = CLIP (go); + bo = CLIP (bo); } /** @@ -5408,21 +5380,21 @@ void ImProcFunctions::labtoning (float r, float g, float b, float &ro, float &go { float realL; float h, s, l; - Color::rgb2hsl(r, g, b, h, s, l); + Color::rgb2hsl (r, g, b, h, s, l); float x2, y2, z2; float xl, yl, zl; - if(twoc != 1) { + if (twoc != 1) { l = (Color::gammatab_13_2[ l * 65535.f]) / 65535.f; //to compensate L from Lab iphigh = (Color::gammatab_13_2[iphigh * 65535.f]) / 65535.f; iplow = (Color::gammatab_13_2[ iplow * 65535.f]) / 65535.f; } - if(twoc == 1) { - ctColorCurve.getVal(l, x2, y2, z2); + if (twoc == 1) { + ctColorCurve.getVal (l, x2, y2, z2); } else { - ctColorCurve.getVal(iphigh, x2, y2, z2); - ctColorCurve.getVal(iplow, xl, yl, zl); + ctColorCurve.getVal (iphigh, x2, y2, z2); + ctColorCurve.getVal (iplow, xl, yl, zl); } realL = l; @@ -5434,8 +5406,8 @@ void ImProcFunctions::labtoning (float r, float g, float b, float &ro, float &go // get the opacity and tweak it to preserve saturated colors //float l_ = Color::gamma_srgb(l*65535.f)/65535.f; float opacity; - opacity = (1.f - min(s / satLimit, 1.f) * (1.f - satLimitOpacity)) * ctOpacityCurve.lutOpacityCurve[l * 500.f]; - float opacity2 = (1.f - min(s / satLimit, 1.f) * (1.f - satLimitOpacity)); + opacity = (1.f - min (s / satLimit, 1.f) * (1.f - satLimitOpacity)) * ctOpacityCurve.lutOpacityCurve[l * 500.f]; + float opacity2 = (1.f - min (s / satLimit, 1.f) * (1.f - satLimitOpacity)); //float ro, go, bo; bool chr = true; @@ -5444,23 +5416,23 @@ void ImProcFunctions::labtoning (float r, float g, float b, float &ro, float &go float chromat, luma; if (clToningcurve[lm * 65535.f] / (lm * 65535.f) < 1.f) { - chromat = (clToningcurve[(lm) * 65535.f] / (lm * 65535.f)) - 1.f; //special effect + chromat = (clToningcurve[ (lm) * 65535.f] / (lm * 65535.f)) - 1.f; //special effect } else { - chromat = 1.f - SQR(SQR((lm * 65535.f) / clToningcurve[(lm) * 65535.f])); //apply C=f(L) acts on 'a' and 'b' + chromat = 1.f - SQR (SQR ((lm * 65535.f) / clToningcurve[ (lm) * 65535.f])); //apply C=f(L) acts on 'a' and 'b' } if (cl2Toningcurve[lm * 65535.f] / (lm * 65535.f) < 1.f) { - luma = (cl2Toningcurve[(lm) * 65535.f] / (lm * 65535.f)) - 1.f; //special effect + luma = (cl2Toningcurve[ (lm) * 65535.f] / (lm * 65535.f)) - 1.f; //special effect } else { - luma = 1.f - SQR(SQR((lm * 65535.f) / (cl2Toningcurve[(lm) * 65535.f]))); //apply C2=f(L) acts only on 'b' + luma = 1.f - SQR (SQR ((lm * 65535.f) / (cl2Toningcurve[ (lm) * 65535.f]))); //apply C2=f(L) acts only on 'b' } int todo = 1; if (algm == 1) { - Color::interpolateRGBColor(realL, iplow, iphigh, algm, opacity, twoc, metchrom, chr, lum, chromat, luma, r, g, b, xl, yl, zl, x2, y2, z2, todo, wp, wip, ro, go, bo); + Color::interpolateRGBColor (realL, iplow, iphigh, algm, opacity, twoc, metchrom, chr, lum, chromat, luma, r, g, b, xl, yl, zl, x2, y2, z2, todo, wp, wip, ro, go, bo); } else { - Color::interpolateRGBColor(realL, iplow, iphigh, algm, opacity2, twoc, metchrom, chr, lum, chromat, luma, r, g, b, xl, yl, zl, x2, y2, z2, todo, wp, wip, ro, go, bo); + Color::interpolateRGBColor (realL, iplow, iphigh, algm, opacity2, twoc, metchrom, chr, lum, chromat, luma, r, g, b, xl, yl, zl, x2, y2, z2, todo, wp, wip, ro, go, bo); } } @@ -5490,9 +5462,6 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu // lhskcurve.dump("lh_curve"); //init Flatcurve for C=f(H) - // NOTE: We're getting all 3 pointers here, but this function may not need them all, so one could optimize this - Imagefloat* editImgFloat = nullptr; - LabImage* editLab = nullptr; PlanarWhateverData* editWhatever = nullptr; EditUniqueID editID = EUID_None; bool editPipette = false; @@ -5505,11 +5474,9 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu switch (pipetteBuffer->getDataProvider()->getCurrSubscriber()->getPipetteBufferType()) { case (BT_IMAGEFLOAT): - editImgFloat = pipetteBuffer->getImgFloatBuffer(); break; case (BT_LABIMAGE): - editLab = pipetteBuffer->getLabBuffer(); break; case (BT_SINGLEPLANE_FLOAT): @@ -5523,7 +5490,7 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu bool chutili = false; if (params->labCurve.chromaticity > -100) { - chCurve = new FlatCurve(params->labCurve.chcurve); + chCurve = new FlatCurve (params->labCurve.chcurve); if (!chCurve || chCurve->isIdentity()) { if (chCurve) { @@ -5540,7 +5507,7 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu bool lhutili = false; if (params->labCurve.chromaticity > -100) { - lhCurve = new FlatCurve(params->labCurve.lhcurve); + lhCurve = new FlatCurve (params->labCurve.lhcurve); if (!lhCurve || lhCurve->isIdentity()) { if (lhCurve) { @@ -5557,7 +5524,7 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu bool hhutili = false; if (params->labCurve.chromaticity > -100) { - hhCurve = new FlatCurve(params->labCurve.hhcurve); + hhCurve = new FlatCurve (params->labCurve.hhcurve); if (!hhCurve || hhCurve->isIdentity()) { if (hhCurve) { @@ -5575,10 +5542,10 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu LUTu hist16Llad; //preparate for histograms CIECAM - if(pW != 1) { //only with improccoordinator - hist16Clad(65536); + if (pW != 1) { //only with improccoordinator + hist16Clad (65536); hist16Clad.clear(); - hist16Llad(65536); + hist16Llad (65536); hist16Llad.clear(); } @@ -5632,38 +5599,38 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu float protect_red, protect_redh; protect_red = protectRed;//default=60 chroma: one can put more or less if necessary...in 'option' 40...160 - if(protect_red < 20.0f) { + if (protect_red < 20.0f) { protect_red = 20.0; // avoid too low value } - if(protect_red > 180.0f) { + if (protect_red > 180.0f) { protect_red = 180.0; // avoid too high value } - protect_redh = float(protectRedH); //default=0.4 rad : one can put more or less if necessary...in 'option' 0.2 ..1.0 + protect_redh = float (protectRedH); //default=0.4 rad : one can put more or less if necessary...in 'option' 0.2 ..1.0 - if(protect_redh < 0.1f) { + if (protect_redh < 0.1f) { protect_redh = 0.1f; //avoid divide by 0 and negatives values } - if(protect_redh > 1.0f) { + if (protect_redh > 1.0f) { protect_redh = 1.0f; //avoid too big values } float protect_redhcur = protectRedH;//default=0.4 rad : one can put more or less if necessary...in 'option' 0.2 ..1 - if(protect_redhcur < 0.1f) { + if (protect_redhcur < 0.1f) { protect_redhcur = 0.1f; //avoid divide by 0 and negatives values:minimal protection for transition } - if(protect_redhcur > 3.5f) { + if (protect_redhcur > 3.5f) { protect_redhcur = 3.5f; //avoid too big values } //increase saturation after denoise : ...approximation float factnoise = 1.f; - if(params->dirpyrDenoise.enabled) { + if (params->dirpyrDenoise.enabled) { factnoise = (1.f + params->dirpyrDenoise.chroma / 500.f); //levels=5 // if(yyyy) factnoise=(1.f+params->dirpyrDenoise.chroma/100.f);//levels=7 } @@ -5704,28 +5671,28 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu if (avoidColorShift) // only if user activate Lab adjustments - if(autili || butili || ccutili || cclutili || chutili || lhutili || hhutili || clcutili || utili || chromaticity) { - Color::LabGamutMunsell(lold->L[i], lold->a[i], lold->b[i], W, /*corMunsell*/true, /*lumaMuns*/false, params->toneCurve.hrenabled, /*gamut*/true, wip, multiThread); + if (autili || butili || ccutili || cclutili || chutili || lhutili || hhutili || clcutili || utili || chromaticity) { + Color::LabGamutMunsell (lold->L[i], lold->a[i], lold->b[i], W, /*corMunsell*/true, /*lumaMuns*/false, params->toneCurve.hrenabled, /*gamut*/true, wip, multiThread); } #ifdef __SSE2__ // precalculate some values using SSE - if(bwToning || (!autili && !butili)) { - __m128 c327d68v = _mm_set1_ps(327.68f); + if (bwToning || (!autili && !butili)) { + __m128 c327d68v = _mm_set1_ps (327.68f); __m128 av, bv; int k; for (k = 0; k < W - 3; k += 4) { - av = LVFU(lold->a[i][k]); - bv = LVFU(lold->b[i][k]); - STVF(HHBuffer[k], xatan2f(bv, av)); - STVF(CCBuffer[k], _mm_sqrt_ps(SQRV(av) + SQRV(bv)) / c327d68v); + av = LVFU (lold->a[i][k]); + bv = LVFU (lold->b[i][k]); + STVF (HHBuffer[k], xatan2f (bv, av)); + STVF (CCBuffer[k], _mm_sqrt_ps (SQRV (av) + SQRV (bv)) / c327d68v); } - for(; k < W; k++) { - HHBuffer[k] = xatan2f(lold->b[i][k], lold->a[i][k]); - CCBuffer[k] = sqrt(SQR(lold->a[i][k]) + SQR(lold->b[i][k])) / 327.68f; + for (; k < W; k++) { + HHBuffer[k] = xatan2f (lold->b[i][k], lold->a[i][k]); + CCBuffer[k] = sqrt (SQR (lold->a[i][k]) + SQR (lold->b[i][k])) / 327.68f; } } @@ -5741,18 +5708,18 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu float memChprov; float2 sincosval; - if(bwToning) { // this values will be also set when bwToning is false some lines down + if (bwToning) { // this values will be also set when bwToning is false some lines down #ifdef __SSE2__ // use precalculated values from above HH = HHBuffer[j]; CC = CCBuffer[j]; #else - HH = xatan2f(lold->b[i][j], lold->a[i][j]); - CC = sqrt(SQR(lold->a[i][j]) + SQR(lold->b[i][j])) / 327.68f; + HH = xatan2f (lold->b[i][j], lold->a[i][j]); + CC = sqrt (SQR (lold->a[i][j]) + SQR (lold->b[i][j])) / 327.68f; #endif // According to mathematical laws we can get the sin and cos of HH by simple operations - if(CC == 0.0f) { + if (CC == 0.0f) { sincosval.y = 1.0f; sincosval.x = 0.0f; } else { @@ -5766,20 +5733,20 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu } if (editPipette && editID == EUID_Lab_LCurve) { - editWhatever->v(i, j) = LIM01(Lin / 32768.0f); // Lab L pipette + editWhatever->v (i, j) = LIM01 (Lin / 32768.0f); // Lab L pipette } lnew->L[i][j] = curve[Lin]; float Lprov1 = (lnew->L[i][j]) / 327.68f; - if(editPipette) { + 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((chromapipa) / (65536.f * 1.28f)); + editWhatever->v (i, j) = LIM01 ((chromapipa) / (65536.f * 1.28f)); } else if (editID == EUID_Lab_bCurve) { //Lab b pipette float chromapipb = lold->b[i][j] + (32768.f * 1.28f); - editWhatever->v(i, j) = LIM01((chromapipb) / (65536.f * 1.28f)); + editWhatever->v (i, j) = LIM01 ((chromapipb) / (65536.f * 1.28f)); } } @@ -5787,35 +5754,35 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu atmp = lold->a[i][j]; - if(autili) { + if (autili) { atmp = acurve[atmp + 32768.0f] - 32768.0f; // curves Lab a } btmp = lold->b[i][j]; - if(butili) { + if (butili) { btmp = bcurve[btmp + 32768.0f] - 32768.0f; // curves Lab b } - if(!bwToning) { //take into account modification of 'a' and 'b' + if (!bwToning) { //take into account modification of 'a' and 'b' #ifdef __SSE2__ - if(!autili && !butili) { + if (!autili && !butili) { // use precalculated values from above HH = HHBuffer[j]; CC = CCBuffer[j]; } else { - CC = sqrt(SQR(atmp) + SQR(btmp)) / 327.68f; - HH = xatan2f(btmp, atmp); + CC = sqrt (SQR (atmp) + SQR (btmp)) / 327.68f; + HH = xatan2f (btmp, atmp); } #else - CC = sqrt(SQR(atmp) + SQR(btmp)) / 327.68f; - HH = xatan2f(btmp, atmp); + CC = sqrt (SQR (atmp) + SQR (btmp)) / 327.68f; + HH = xatan2f (btmp, atmp); #endif // According to mathematical laws we can get the sin and cos of HH by simple operations //float2 sincosval; - if(CC == 0.f) { + if (CC == 0.f) { sincosval.y = 1.f; sincosval.x = 0.f; } else { @@ -5828,10 +5795,10 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu memChprov = Chprov; } // now new values of lold with 'a' and 'b' - if(editPipette) + if (editPipette) if (editID == EUID_Lab_LHCurve || editID == EUID_Lab_CHCurve || editID == EUID_Lab_HHCurve) {//H pipette - float valpar = Color::huelab_to_huehsv2(HH); - editWhatever->v(i, j) = valpar; + float valpar = Color::huelab_to_huehsv2 (HH); + editWhatever->v (i, j) = valpar; } if (lhutili) { // L=f(H) @@ -5840,7 +5807,7 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu l_r = Lprov1 / 100.f; { float khue = 1.9f; //in reserve in case of! - float valparam = float((lhCurve->getVal(Color::huelab_to_huehsv2(HH)) - 0.5f)); //get l_r=f(H) + float valparam = float ((lhCurve->getVal (Color::huelab_to_huehsv2 (HH)) - 0.5f)); //get l_r=f(H) float valparamneg; valparamneg = valparam; float kcc = (CC / amountchroma); //take Chroma into account...40 "middle low" of chromaticity (arbitrary and simple), one can imagine other algorithme @@ -5848,8 +5815,8 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu valparam *= 2.f * kcc; valparamneg *= kcc; //slightly different for negative - if(valparam > 0.f) { - l_r = (1.f - valparam) * l_r + valparam * (1.f - SQR(((SQR(1.f - min(l_r, 1.0f)))))); + if (valparam > 0.f) { + l_r = (1.f - valparam) * l_r + valparam * (1.f - SQR (((SQR (1.f - min (l_r, 1.0f)))))); } else //for negative { @@ -5859,7 +5826,7 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu Lprov1 = l_r * 100.f; - float Chprov2 = sqrt(SQR(atmp) + SQR(btmp)) / 327.68f; + float Chprov2 = sqrt (SQR (atmp) + SQR (btmp)) / 327.68f; //Gamut control especialy fot negative values slightly different of gamutlchonly bool inRGB; @@ -5872,14 +5839,14 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu float fx = (0.002f * aprov1) + fy; float fz = fy - (0.005f * bprov1); - float x_ = 65535.0f * Color::f2xyz(fx) * Color::D50x; - float z_ = 65535.0f * Color::f2xyz(fz) * Color::D50z; + float x_ = 65535.0f * Color::f2xyz (fx) * Color::D50x; + float z_ = 65535.0f * Color::f2xyz (fz) * Color::D50z; float y_ = (Lprov1 > Color::epskap) ? 65535.0 * fy * fy * fy : 65535.0 * Lprov1 / Color::kappa; float R, G, B; - Color::xyz2rgb(x_, y_, z_, R, G, B, wip); + Color::xyz2rgb (x_, y_, z_, R, G, B, wip); if (R < 0.0f || G < 0.0f || B < 0.0f) { - if(Lprov1 < 0.1f) { + if (Lprov1 < 0.1f) { Lprov1 = 0.1f; } @@ -5901,8 +5868,8 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu // calculate C=f(H) if (chutili) { - double hr = Color::huelab_to_huehsv2(HH); - float chparam = float((chCurve->getVal(hr) - 0.5f) * 2.0f); //get C=f(H) + double hr = Color::huelab_to_huehsv2 (HH); + float chparam = float ((chCurve->getVal (hr) - 0.5f) * 2.0f); //get C=f(H) float chromaChfactor = 1.0f + chparam; atmp *= chromaChfactor;//apply C=f(H) btmp *= chromaChfactor; @@ -5910,15 +5877,15 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu if (hhutili) { // H=f(H) //hue Lab in -PI +PI - float valparam = float((hhCurve->getVal(Color::huelab_to_huehsv2(HH)) - 0.5f) * 1.7f) + HH; //get H=f(H) 1.7 optimisation ! + float valparam = float ((hhCurve->getVal (Color::huelab_to_huehsv2 (HH)) - 0.5f) * 1.7f) + HH; //get H=f(H) 1.7 optimisation ! HH = valparam; - sincosval = xsincosf(HH); + sincosval = xsincosf (HH); } - if(!bwToning) { + if (!bwToning) { float factorskin, factorsat, factorskinext; - if(chromapro > 1.f) { + if (chromapro > 1.f) { float scale = scaleConst;//reduction in normal zone float scaleext = 1.f;//reduction in transition zone Color::scalered ( rstprotection, chromapro, 0.0, HH, protect_redh, scale, scaleext);//1.0 @@ -5937,11 +5904,11 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu if (Lprov1 < 25.f) { dred = 40.f; - } else if(Lprov1 < 30.f) { + } else if (Lprov1 < 30.f) { dred = 3.f * Lprov1 - 35.f; - } else if(Lprov1 < 70.f) { + } else if (Lprov1 < 70.f) { dred = 55.f; - } else if(Lprov1 < 75.f) { + } else if (Lprov1 < 75.f) { dred = -3.f * Lprov1 + 265.f; } else { dred = 40.f; @@ -5955,7 +5922,7 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu btmp *= factorsat; if (editPipette && editID == EUID_Lab_CLCurve) { - editWhatever->v(i, j) = LIM01(LL / 100.f); // Lab C=f(L) pipette + editWhatever->v (i, j) = LIM01 (LL / 100.f); // Lab C=f(L) pipette } if (clut) { // begin C=f(L) @@ -5968,31 +5935,31 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu float deltaHH;//HH value transition for C curve protect_redcur = curf * protectRed; //default=60 chroma: one can put more or less if necessary...in 'option' 40...160==> curf =because curve is more progressive - if(protect_redcur < 20.0f) { + if (protect_redcur < 20.0f) { protect_redcur = 20.0; // avoid too low value } - if(protect_redcur > 180.0f) { + if (protect_redcur > 180.0f) { protect_redcur = 180.0; // avoid too high value } - protect_redhcur = curf * float(protectRedH); //default=0.4 rad : one can put more or less if necessary...in 'option' 0.2 ..1.0 ==> curf =because curve is more progressive + protect_redhcur = curf * float (protectRedH); //default=0.4 rad : one can put more or less if necessary...in 'option' 0.2 ..1.0 ==> curf =because curve is more progressive - if(protect_redhcur < 0.1f) { + if (protect_redhcur < 0.1f) { protect_redhcur = 0.1f; //avoid divide by 0 and negatives values } - if(protect_redhcur > 1.0f) { + if (protect_redhcur > 1.0f) { protect_redhcur = 1.0f; //avoid too big values } deltaHH = protect_redhcur; //transition hue - if(chromaCfactor > 0.0) { + if (chromaCfactor > 0.0) { Color::scalered ( rstprotection, chromaCfactor, 0.0, HH, deltaHH, scale, scaleext); //1.0 } - if(chromaCfactor > 1.0) { + if (chromaCfactor > 1.0) { interm = (chromaCfactor - 1.0f) * 100.0f; factorskin = 1.0f + (interm * scale) / 100.0f; factorskinext = 1.0f + (interm * scaleext) / 100.0f; @@ -6014,13 +5981,13 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu // 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((chromapip) / (48000.f)); + float chromapip = sqrt (SQR (atmp) + SQR (btmp) + 0.001f); + editWhatever->v (i, j) = LIM01 ((chromapip) / (48000.f)); }//Lab C=f(C) pipette if (ccut) { float factorskin, factorsat, factor, factorskinext, interm; - float chroma = sqrt(SQR(atmp) + SQR(btmp) + 0.001f); + float chroma = sqrt (SQR (atmp) + SQR (btmp) + 0.001f); float chromaCfactor = (satcurve[chroma * adjustr]) / (chroma * adjustr); //apply C=f(C) float curf = 0.7f; //empirical coeff because curve is more progressive float scale = 100.0f / 100.1f; //reduction in normal zone for curve CC @@ -6029,31 +5996,31 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu float deltaHH;//HH value transition for CC curve protect_redcur = curf * protectRed; //default=60 chroma: one can put more or less if necessary...in 'option' 40...160==> curf =because curve is more progressive - if(protect_redcur < 20.0f) { + if (protect_redcur < 20.0f) { protect_redcur = 20.0; // avoid too low value } - if(protect_redcur > 180.0f) { + if (protect_redcur > 180.0f) { protect_redcur = 180.0; // avoid too high value } - protect_redhcur = curf * float(protectRedH); //default=0.4 rad : one can put more or less if necessary...in 'option' 0.2 ..1.0 ==> curf =because curve is more progressive + protect_redhcur = curf * float (protectRedH); //default=0.4 rad : one can put more or less if necessary...in 'option' 0.2 ..1.0 ==> curf =because curve is more progressive - if(protect_redhcur < 0.1f) { + if (protect_redhcur < 0.1f) { protect_redhcur = 0.1f; //avoid divide by 0 and negatives values } - if(protect_redhcur > 1.0f) { + if (protect_redhcur > 1.0f) { protect_redhcur = 1.0f; //avoid too big values } deltaHH = protect_redhcur; //transition hue - if(chromaCfactor > 0.0) { + if (chromaCfactor > 0.0) { Color::scalered ( rstprotection, chromaCfactor, 0.0, HH, deltaHH, scale, scaleext); //1.0 } - if(chromaCfactor > 1.0) { + if (chromaCfactor > 1.0) { interm = (chromaCfactor - 1.0f) * 100.0f; factorskin = 1.0f + (interm * scale) / 100.0f; factorskinext = 1.0f + (interm * scaleext) / 100.0f; @@ -6076,14 +6043,14 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu // end chroma C=f(C) //update histogram C - if(pW != 1) { //only with improccoordinator - int posp = (int)sqrt(atmp * atmp + btmp * btmp); + if (pW != 1) { //only with improccoordinator + int posp = (int)sqrt (atmp * atmp + btmp * btmp); hist16Clad[posp]++; } if (editPipette && editID == EUID_Lab_LCCurve) { - float chromapiplc = sqrt(SQR(atmp) + SQR(btmp) + 0.001f); - editWhatever->v(i, j) = LIM01((chromapiplc) / (48000.f)); + float chromapiplc = sqrt (SQR (atmp) + SQR (btmp) + 0.001f); + editWhatever->v (i, j) = LIM01 ((chromapiplc) / (48000.f)); }//Lab L=f(C) pipette @@ -6101,43 +6068,43 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu float zz = 0.0f; float yy = 0.0f; - if(Chprov1 < chrmin) { - yy = SQR(Chprov1 / chrmin) * xx; + if (Chprov1 < chrmin) { + yy = SQR (Chprov1 / chrmin) * xx; } else { yy = xx; //avoid artifact for low C } - if(!LCredsk) { + if (!LCredsk) { skbeg = -3.1415; skend = 3.14159; skdeltaHH = 0.001f; } - if(HH > skbeg && HH < skend ) { + if (HH > skbeg && HH < skend ) { zz = yy; - } else if(HH > skbeg - skdeltaHH && HH <= skbeg) { //transition + } else if (HH > skbeg - skdeltaHH && HH <= skbeg) { //transition aa = yy / skdeltaHH; bb = -aa * (skbeg - skdeltaHH); zz = aa * HH + bb; - } else if(HH >= skend && HH < skend + skdeltaHH) { //transition + } else if (HH >= skend && HH < skend + skdeltaHH) { //transition aa = -yy / skdeltaHH; bb = -aa * (skend + skdeltaHH); zz = aa * HH + bb; } - float chroma = sqrt(SQR(atmp) + SQR(btmp) + 0.001f); + float chroma = sqrt (SQR (atmp) + SQR (btmp) + 0.001f); float Lc = (lhskcurve[chroma * adjustr]) / (chroma * adjustr); //apply L=f(C) Lc = (Lc - 1.0f) * zz + 1.0f; //reduct action Lprov1 *= Lc; //adjust luminance } //update histo LC - if(pW != 1) { //only with improccoordinator + if (pW != 1) { //only with improccoordinator int posl = Lprov1 * 327.68f; hist16Llad[posl]++; } - Chprov1 = sqrt(SQR(atmp) + SQR(btmp)) / 327.68f; + Chprov1 = sqrt (SQR (atmp) + SQR (btmp)) / 327.68f; // labCurve.bwtoning option allows to decouple modulation of a & b curves by saturation // with bwtoning enabled the net effect of a & b curves is visible @@ -6148,17 +6115,17 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu if (avoidColorShift) { //gamutmap Lch ==> preserve Hue,but a little slower than gamutbdy for high values...and little faster for low values - if(gamutLch) { + if (gamutLch) { float R, G, B; #ifdef _DEBUG bool neg = false; bool more_rgb = false; //gamut control : Lab values are in gamut - Color::gamutLchonly(HH, sincosval, Lprov1, Chprov1, R, G, B, wip, highlight, 0.15f, 0.96f, neg, more_rgb); + Color::gamutLchonly (HH, sincosval, Lprov1, Chprov1, R, G, B, wip, highlight, 0.15f, 0.96f, neg, more_rgb); #else //gamut control : Lab values are in gamut - Color::gamutLchonly(HH, sincosval, Lprov1, Chprov1, R, G, B, wip, highlight, 0.15f, 0.96f); + Color::gamutLchonly (HH, sincosval, Lprov1, Chprov1, R, G, B, wip, highlight, 0.15f, 0.96f); #endif lnew->L[i][j] = Lprov1 * 327.68f; // float2 sincosval = xsincosf(HH); @@ -6168,9 +6135,9 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu //use gamutbdy //Luv limiter float Y, u, v; - Color::Lab2Yuv(lnew->L[i][j], atmp, btmp, Y, u, v); + Color::Lab2Yuv (lnew->L[i][j], atmp, btmp, Y, u, v); //Yuv2Lab includes gamut restriction map - Color::Yuv2Lab(Y, u, v, lnew->L[i][j], lnew->a[i][j], lnew->b[i][j], wp); + Color::Yuv2Lab (Y, u, v, lnew->L[i][j], lnew->a[i][j], lnew->b[i][j], wp); } if (utili || autili || butili || ccut || clut || cclutili || chutili || lhutili || hhutili || clcutili || chromaticity) { @@ -6178,16 +6145,16 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu float correctlum = 0.f; Lprov1 = lnew->L[i][j] / 327.68f; - Chprov = sqrt(SQR(lnew->a[i][j]) + SQR(lnew->b[i][j])) / 327.68f; + Chprov = sqrt (SQR (lnew->a[i][j]) + SQR (lnew->b[i][j])) / 327.68f; #ifdef _DEBUG - Color::AllMunsellLch(/*lumaMuns*/true, Lprov1, LL, HH, Chprov, memChprov, correctionHue, correctlum, MunsDebugInfo); + Color::AllMunsellLch (/*lumaMuns*/true, Lprov1, LL, HH, Chprov, memChprov, correctionHue, correctlum, MunsDebugInfo); #else - Color::AllMunsellLch(/*lumaMuns*/true, Lprov1, LL, HH, Chprov, memChprov, correctionHue, correctlum); + Color::AllMunsellLch (/*lumaMuns*/true, Lprov1, LL, HH, Chprov, memChprov, correctionHue, correctlum); #endif - if(correctionHue != 0.f || correctlum != 0.f) { - if(fabs(correctionHue) < 0.015f) { + if (correctionHue != 0.f || correctlum != 0.f) { + if (fabs (correctionHue) < 0.015f) { HH += correctlum; // correct only if correct Munsell chroma very little. } @@ -6197,7 +6164,7 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu else if(fabs(correctionHue) < 0.1f) HH+=0.35f*correctlum; else if(fabs(correctionHue) < 0.015f) HH+=correctlum; // correct only if correct Munsell chroma very little. */ - sincosval = xsincosf(HH + correctionHue); + sincosval = xsincosf (HH + correctionHue); } lnew->a[i][j] = 327.68f * Chprov * sincosval.y; // apply Munsell @@ -6206,7 +6173,7 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu } else { // if(Lprov1 > maxlp) maxlp=Lprov1; // if(Lprov1 < minlp) minlp=Lprov1; - if(!bwToning) { + if (!bwToning) { lnew->L[i][j] = Lprov1 * 327.68f; // float2 sincosval = xsincosf(HH); lnew->a[i][j] = 327.68f * Chprov1 * sincosval.y; @@ -6221,20 +6188,20 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu } } // end of parallelization - if(pW != 1) { //only with improccoordinator + if (pW != 1) { //only with improccoordinator //update histogram C with data chromaticity and not with CC curve - hist16Clad.compressTo(histCCurve); + hist16Clad.compressTo (histCCurve); //update histogram L with data luminance - hist16Llad.compressTo(histLCurve); + hist16Llad.compressTo (histLCurve); } #ifdef _DEBUG if (settings->verbose) { t2e.set(); - printf("Color::AllMunsellLch (correction performed in %d usec):\n", t2e.etime(t1e)); - printf(" Munsell chrominance: MaxBP=%1.2frad MaxRY=%1.2frad MaxGY=%1.2frad MaxRP=%1.2frad dep=%u\n", MunsDebugInfo->maxdhue[0], MunsDebugInfo->maxdhue[1], MunsDebugInfo->maxdhue[2], MunsDebugInfo->maxdhue[3], MunsDebugInfo->depass); - printf(" Munsell luminance : MaxBP=%1.2frad MaxRY=%1.2frad MaxGY=%1.2frad MaxRP=%1.2frad dep=%u\n", MunsDebugInfo->maxdhuelum[0], MunsDebugInfo->maxdhuelum[1], MunsDebugInfo->maxdhuelum[2], MunsDebugInfo->maxdhuelum[3], MunsDebugInfo->depassLum); + printf ("Color::AllMunsellLch (correction performed in %d usec):\n", t2e.etime (t1e)); + printf (" Munsell chrominance: MaxBP=%1.2frad MaxRY=%1.2frad MaxGY=%1.2frad MaxRP=%1.2frad dep=%u\n", MunsDebugInfo->maxdhue[0], MunsDebugInfo->maxdhue[1], MunsDebugInfo->maxdhue[2], MunsDebugInfo->maxdhue[3], MunsDebugInfo->depass); + printf (" Munsell luminance : MaxBP=%1.2frad MaxRY=%1.2frad MaxGY=%1.2frad MaxRP=%1.2frad dep=%u\n", MunsDebugInfo->maxdhuelum[0], MunsDebugInfo->maxdhuelum[1], MunsDebugInfo->maxdhuelum[2], MunsDebugInfo->maxdhuelum[3], MunsDebugInfo->depassLum); } delete MunsDebugInfo; @@ -6365,69 +6332,69 @@ void ImProcFunctions::defringe (LabImage* lab) if (params->defringe.enabled && lab->W >= 8 && lab->H >= 8) { - PF_correct_RT(lab, lab, params->defringe.radius, params->defringe.threshold); + PF_correct_RT (lab, lab, params->defringe.radius, params->defringe.threshold); } } void ImProcFunctions::defringecam (CieImage* ncie) { if (params->defringe.enabled && ncie->W >= 8 && ncie->H >= 8) { - PF_correct_RTcam(ncie, ncie, params->defringe.radius, params->defringe.threshold); + PF_correct_RTcam (ncie, ncie, params->defringe.radius, params->defringe.threshold); } } -void ImProcFunctions::badpixcam(CieImage* ncie, double rad, int thr, int mode, float b_l, float t_l, float t_r, float b_r, float skinprot, float chrom, int hotbad) +void ImProcFunctions::badpixcam (CieImage* ncie, double rad, int thr, int mode, float b_l, float t_l, float t_r, float b_r, float skinprot, float chrom, int hotbad) { - if(ncie->W >= 8 && ncie->H >= 8) { - Badpixelscam(ncie, ncie, rad, thr, mode, b_l, t_l, t_r, b_r, skinprot, chrom, hotbad); + if (ncie->W >= 8 && ncie->H >= 8) { + Badpixelscam (ncie, ncie, rad, thr, mode, b_l, t_l, t_r, b_r, skinprot, chrom, hotbad); } } -void ImProcFunctions::badpixlab(LabImage* lab, double rad, int thr, int mode, float b_l, float t_l, float t_r, float b_r, float skinprot, float chrom) +void ImProcFunctions::badpixlab (LabImage* lab, double rad, int thr, int mode, float b_l, float t_l, float t_r, float b_r, float skinprot, float chrom) { - if(lab->W >= 8 && lab->H >= 8) { - BadpixelsLab(lab, lab, rad, thr, mode, b_l, t_l, t_r, b_r, skinprot, chrom); + if (lab->W >= 8 && lab->H >= 8) { + BadpixelsLab (lab, lab, rad, thr, mode, b_l, t_l, t_r, b_r, skinprot, chrom); } } void ImProcFunctions::dirpyrequalizer (LabImage* lab, int scale) { if (params->dirpyrequalizer.enabled && lab->W >= 8 && lab->H >= 8) { - float b_l = static_cast(params->dirpyrequalizer.hueskin.value[0]) / 100.0f; - float t_l = static_cast(params->dirpyrequalizer.hueskin.value[1]) / 100.0f; - float b_r = static_cast(params->dirpyrequalizer.hueskin.value[2]) / 100.0f; - float t_r = static_cast(params->dirpyrequalizer.hueskin.value[3]) / 100.0f; + float b_l = static_cast (params->dirpyrequalizer.hueskin.value[0]) / 100.0f; + float t_l = static_cast (params->dirpyrequalizer.hueskin.value[1]) / 100.0f; + float b_r = static_cast (params->dirpyrequalizer.hueskin.value[2]) / 100.0f; + float t_r = static_cast (params->dirpyrequalizer.hueskin.value[3]) / 100.0f; int choice = 0; //I have not disabled this statement in case of ! always 0 // if (params->dirpyrequalizer.algo=="FI") choice=0; // else if(params->dirpyrequalizer.algo=="LA") choice=1; float artifact = (float) settings->artifact_cbdl; - if(artifact > 6.f) { + if (artifact > 6.f) { artifact = 6.f; } - if(artifact < 0.f) { + if (artifact < 0.f) { artifact = 1.f; } float chrom = 50.f; - if(params->dirpyrequalizer.gamutlab) { + if (params->dirpyrequalizer.gamutlab) { ImProcFunctions::badpixlab (lab, artifact, 5, 3, b_l, t_l, t_r, b_r, params->dirpyrequalizer.skinprotect, chrom); //for artifacts } //dirpyrLab_equalizer(lab, lab, params->dirpyrequalizer.mult); - dirpyr_equalizer(lab->L, lab->L, lab->W, lab->H, lab->a, lab->b, lab->a, lab->b, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, params->dirpyrequalizer.gamutlab, b_l, t_l, t_r, b_r, choice, scale); + dirpyr_equalizer (lab->L, lab->L, lab->W, lab->H, lab->a, lab->b, lab->a, lab->b, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, params->dirpyrequalizer.gamutlab, b_l, t_l, t_r, b_r, choice, scale); } } -void ImProcFunctions::EPDToneMapCIE(CieImage *ncie, float a_w, float c_, float w_h, int Wid, int Hei, int begh, int endh, float minQ, float maxQ, unsigned int Iterates, int skip) +void ImProcFunctions::EPDToneMapCIE (CieImage *ncie, float a_w, float c_, float w_h, int Wid, int Hei, int begh, int endh, float minQ, float maxQ, unsigned int Iterates, int skip) { - if(!params->epd.enabled) { + if (!params->epd.enabled) { return; } - if(params->wavelet.enabled && params->wavelet.tmrs != 0) { + if (params->wavelet.enabled && params->wavelet.tmrs != 0) { return; } @@ -6436,19 +6403,18 @@ void ImProcFunctions::EPDToneMapCIE(CieImage *ncie, float a_w, float c_, float w float sca = params->epd.scale; float gamm = params->epd.gamma; float rew = params->epd.reweightingIterates; - unsigned int i, N = Wid * Hei; float Qpro = ( 4.0 / c_) * ( a_w + 4.0 ) ; //estimate Q max if J=100.0 float *Qpr = ncie->Q_p[0]; if (settings->verbose) { - printf("minQ=%f maxQ=%f Qpro=%f\n", minQ, maxQ, Qpro); + printf ("minQ=%f maxQ=%f Qpro=%f\n", minQ, maxQ, Qpro); } - if(maxQ > Qpro) { + if (maxQ > Qpro) { Qpro = maxQ; } - EdgePreservingDecomposition epd(Wid, Hei); + EdgePreservingDecomposition epd (Wid, Hei); #pragma omp parallel for @@ -6457,24 +6423,24 @@ void ImProcFunctions::EPDToneMapCIE(CieImage *ncie, float a_w, float c_, float w ncie->Q_p[i][j] = gamm * ncie->Q_p[i][j] / (Qpro); } - float Compression = expf(-stren); //This modification turns numbers symmetric around 0 into exponents. + float Compression = expf (-stren); //This modification turns numbers symmetric around 0 into exponents. float DetailBoost = stren; - if(stren < 0.0f) { + if (stren < 0.0f) { DetailBoost = 0.0f; //Go with effect of exponent only if uncompressing. } //Auto select number of iterates. Note that p->EdgeStopping = 0 makes a Gaussian blur. - if(Iterates == 0) { - Iterates = (unsigned int)(edgest * 15.0); + if (Iterates == 0) { + Iterates = (unsigned int) (edgest * 15.0); } //Jacques Desmis : always Iterates=5 for compatibility images between preview and output - epd.CompressDynamicRange(Qpr, (float)sca / skip, (float)edgest, Compression, DetailBoost, Iterates, rew, Qpr); + epd.CompressDynamicRange (Qpr, (float)sca / skip, (float)edgest, Compression, DetailBoost, Iterates, rew, Qpr); //Restore past range, also desaturate a bit per Mantiuk's Color correction for tone mapping. - float s = (1.0f + 38.7889f) * powf(Compression, 1.5856f) / (1.0f + 38.7889f * powf(Compression, 1.5856f)); + float s = (1.0f + 38.7889f) * powf (Compression, 1.5856f) / (1.0f + 38.7889f * powf (Compression, 1.5856f)); #ifndef _DEBUG #pragma omp parallel for schedule(dynamic,10) #endif @@ -6524,7 +6490,7 @@ void ImProcFunctions::EPDToneMapCIE(CieImage *ncie, float a_w, float c_, float w */ } -void ImProcFunctions::EPDToneMaplocal(LabImage *lab, LabImage *tmp1, unsigned int Iterates, int skip) +void ImProcFunctions::EPDToneMaplocal (LabImage *lab, LabImage *tmp1, unsigned int Iterates, int skip) { float stren = ((float)params->locallab.stren) / 100.f; @@ -6538,8 +6504,8 @@ void ImProcFunctions::EPDToneMaplocal(LabImage *lab, LabImage *tmp1, unsigned in float *b = lab->b[0]; unsigned int i, N = lab->W * lab->H; int WW = lab->W ; - int HH = lab->H ; - EdgePreservingDecomposition epd(lab->W, lab->H); +// int HH = lab->H ; + EdgePreservingDecomposition epd (lab->W, lab->H); //Due to the taking of logarithms, L must be nonnegative. Further, scale to 0 to 1 using nominal range of L, 0 to 15 bit. float minL = FLT_MAX; @@ -6550,35 +6516,35 @@ void ImProcFunctions::EPDToneMaplocal(LabImage *lab, LabImage *tmp1, unsigned in float lmaxL = 0.f; #pragma omp for - for(i = 0; i < N; i++) { - if(L[i] < lminL) { + for (i = 0; i < N; i++) { + if (L[i] < lminL) { lminL = L[i]; } - if(L[i] > lmaxL) { + if (L[i] > lmaxL) { lmaxL = L[i]; } } #pragma omp critical - if(lminL < minL) { + if (lminL < minL) { minL = lminL; } - if(lmaxL > maxL) { + if (lmaxL > maxL) { maxL = lmaxL; } } - if(minL > 0.0f) { + if (minL > 0.0f) { minL = 0.0f; //Disable the shift if there are no negative numbers. I wish there were just no negative numbers to begin with. } #pragma omp parallel for - for(i = 0; i < N; i++) + for (i = 0; i < N; i++) //{L[i] = (L[i] - minL)/32767.0f; { L[i] = (L[i] - minL) / maxL; @@ -6586,16 +6552,16 @@ void ImProcFunctions::EPDToneMaplocal(LabImage *lab, LabImage *tmp1, unsigned in } //Some interpretations. - float Compression = expf(-stren); //This modification turns numbers symmetric around 0 into exponents. + float Compression = expf (-stren); //This modification turns numbers symmetric around 0 into exponents. float DetailBoost = stren; - if(stren < 0.0f) { + if (stren < 0.0f) { DetailBoost = 0.0f; //Go with effect of exponent only if uncompressing. } //Auto select number of iterates. Note that p->EdgeStopping = 0 makes a Gaussian blur. - if(Iterates == 0) { - Iterates = (unsigned int)(edgest * 15.0f); + if (Iterates == 0) { + Iterates = (unsigned int) (edgest * 15.0f); } /* Debuggery. Saves L for toying with outside of RT. @@ -6605,15 +6571,15 @@ void ImProcFunctions::EPDToneMaplocal(LabImage *lab, LabImage *tmp1, unsigned in fwrite(L, N, sizeof(float), f); fclose(f);*/ - epd.CompressDynamicRange(L, sca / float(skip), edgest, Compression, DetailBoost, Iterates, rew, L); + epd.CompressDynamicRange (L, sca / float (skip), edgest, Compression, DetailBoost, Iterates, rew, L); //Restore past range, also desaturate a bit per Mantiuk's Color correction for tone mapping. - float s = (1.0f + 38.7889f) * powf(Compression, 1.5856f) / (1.0f + 38.7889f * powf(Compression, 1.5856f)); + float s = (1.0f + 38.7889f) * powf (Compression, 1.5856f) / (1.0f + 38.7889f * powf (Compression, 1.5856f)); #ifdef _OPENMP #pragma omp parallel for // removed schedule(dynamic,10) #endif - for(int i = 0; i < N; i++) { + for (unsigned int i = 0; i < N; i++) { int x = i / WW; int y = i - x * WW; @@ -6630,18 +6596,18 @@ void ImProcFunctions::EPDToneMaplocal(LabImage *lab, LabImage *tmp1, unsigned in //Map tones by way of edge preserving decomposition. Is this the right way to include source? //#include "EdgePreservingDecomposition.cc" -void ImProcFunctions::EPDToneMap(LabImage *lab, unsigned int Iterates, int skip) +void ImProcFunctions::EPDToneMap (LabImage *lab, unsigned int Iterates, int skip) { //Hasten access to the parameters. // EPDParams *p = (EPDParams *)(¶ms->epd); //Enabled? Leave now if not. // if(!p->enabled) return; - if(!params->epd.enabled) { + if (!params->epd.enabled) { return; } - if(params->wavelet.enabled && params->wavelet.tmrs != 0) { + if (params->wavelet.enabled && params->wavelet.tmrs != 0) { return; } @@ -6654,8 +6620,8 @@ void ImProcFunctions::EPDToneMap(LabImage *lab, unsigned int Iterates, int skip) float *L = lab->L[0]; float *a = lab->a[0]; float *b = lab->b[0]; - unsigned int i, N = lab->W * lab->H; - EdgePreservingDecomposition epd(lab->W, lab->H); + size_t N = lab->W * lab->H; + EdgePreservingDecomposition epd (lab->W, lab->H); //Due to the taking of logarithms, L must be nonnegative. Further, scale to 0 to 1 using nominal range of L, 0 to 15 bit. float minL = FLT_MAX; @@ -6666,35 +6632,35 @@ void ImProcFunctions::EPDToneMap(LabImage *lab, unsigned int Iterates, int skip) float lmaxL = 0.f; #pragma omp for - for(i = 0; i < N; i++) { - if(L[i] < lminL) { + for (size_t i = 0; i < N; i++) { + if (L[i] < lminL) { lminL = L[i]; } - if(L[i] > lmaxL) { + if (L[i] > lmaxL) { lmaxL = L[i]; } } #pragma omp critical + { + if (lminL < minL) { + minL = lminL; + } - if(lminL < minL) { - minL = lminL; + if (lmaxL > maxL) { + maxL = lmaxL; + } } - - if(lmaxL > maxL) { - maxL = lmaxL; - } - } - if(minL > 0.0f) { + if (minL > 0.0f) { minL = 0.0f; //Disable the shift if there are no negative numbers. I wish there were just no negative numbers to begin with. } #pragma omp parallel for - for(i = 0; i < N; i++) + for (size_t i = 0; i < N; ++i) //{L[i] = (L[i] - minL)/32767.0f; { L[i] = (L[i] - minL) / maxL; @@ -6702,16 +6668,16 @@ void ImProcFunctions::EPDToneMap(LabImage *lab, unsigned int Iterates, int skip) } //Some interpretations. - float Compression = expf(-stren); //This modification turns numbers symmetric around 0 into exponents. + float Compression = expf (-stren); //This modification turns numbers symmetric around 0 into exponents. float DetailBoost = stren; - if(stren < 0.0f) { + if (stren < 0.0f) { DetailBoost = 0.0f; //Go with effect of exponent only if uncompressing. } //Auto select number of iterates. Note that p->EdgeStopping = 0 makes a Gaussian blur. - if(Iterates == 0) { - Iterates = (unsigned int)(edgest * 15.0f); + if (Iterates == 0) { + Iterates = (unsigned int) (edgest * 15.0f); } /* Debuggery. Saves L for toying with outside of RT. @@ -6721,15 +6687,15 @@ void ImProcFunctions::EPDToneMap(LabImage *lab, unsigned int Iterates, int skip) fwrite(L, N, sizeof(float), f); fclose(f);*/ - epd.CompressDynamicRange(L, sca / float(skip), edgest, Compression, DetailBoost, Iterates, rew, L); + epd.CompressDynamicRange (L, sca / float (skip), edgest, Compression, DetailBoost, Iterates, rew, L); //Restore past range, also desaturate a bit per Mantiuk's Color correction for tone mapping. - float s = (1.0f + 38.7889f) * powf(Compression, 1.5856f) / (1.0f + 38.7889f * powf(Compression, 1.5856f)); + float s = (1.0f + 38.7889f) * powf (Compression, 1.5856f) / (1.0f + 38.7889f * powf (Compression, 1.5856f)); #ifdef _OPENMP #pragma omp parallel for // removed schedule(dynamic,10) #endif - for(int ii = 0; ii < N; ii++) { + for (size_t ii = 0; ii < N; ++ii) { a[ii] *= s; b[ii] *= s; L[ii] = L[ii] * maxL * (1.f / gamm) + minL; @@ -6756,7 +6722,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double float ave = 0.f, hidev = 0.f, lodev = 0.f; //find average luminance - histogram.getSumAndAverage(sum, ave); + histogram.getSumAndAverage (sum, ave); //find median of luminance int median = 0, count = histogram[0]; @@ -6783,18 +6749,18 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double int i = 0; - for (; i < min((int)ave, imax); i++) { + for (; i < min ((int)ave, imax); i++) { if (count < 8) { octile[count] += histogram[i]; if (octile[count] > sum / 8.f || (count == 7 && octile[count] > sum / 16.f)) { - octile[count] = xlog(1. + (float)i) / log(2.f); + octile[count] = xlog (1. + (float)i) / log (2.f); count++;// = min(count+1,7); } } //lodev += SQR(ave-i)*histogram[i]; - lodev += (xlog(ave + 1.f) - xlog((float)i + 1.)) * histogram[i]; + lodev += (xlog (ave + 1.f) - xlog ((float)i + 1.)) * histogram[i]; losum += histogram[i]; } @@ -6803,13 +6769,13 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double octile[count] += histogram[i]; if (octile[count] > sum / 8.f || (count == 7 && octile[count] > sum / 16.f)) { - octile[count] = xlog(1. + (float)i) / log(2.f); + octile[count] = xlog (1. + (float)i) / log (2.f); count++;// = min(count+1,7); } } //hidev += SQR(i-ave)*histogram[i]; - hidev += (xlog((float)i + 1.) - xlog(ave + 1.f)) * histogram[i]; + hidev += (xlog ((float)i + 1.) - xlog (ave + 1.f)) * histogram[i]; hisum += histogram[i]; } @@ -6824,15 +6790,15 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double return; } - lodev = (lodev / (log(2.f) * losum)); - hidev = (hidev / (log(2.f) * hisum)); + lodev = (lodev / (log (2.f) * losum)); + hidev = (hidev / (log (2.f) * hisum)); - if (octile[6] > log((float)imax + 1.f) / log2(2.f)) { //if very overxposed image + if (octile[6] > log ((float)imax + 1.f) / log2 (2.f)) { //if very overxposed image octile[6] = 1.5f * octile[5] - 0.5f * octile[4]; overex = 2; } - if (octile[7] > log((float)imax + 1.f) / log2(2.f)) { //if overexposed + if (octile[7] > log ((float)imax + 1.f) / log2 (2.f)) { //if overexposed octile[7] = 1.5f * octile[6] - 0.5f * octile[5]; overex = 1; } @@ -6845,7 +6811,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double oct7 = octile[7]; - for(int i = 1; i < 8; i++) { + for (int i = 1; i < 8; i++) { if (octile[i] == 0.0f) { octile[i] = octile[i - 1]; } @@ -6854,7 +6820,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double // compute weighted average separation of octiles // for future use in contrast setting for (int i = 1; i < 6; i++) { - ospread += (octile[i + 1] - octile[i]) / max(0.5f, (i > 2 ? (octile[i + 1] - octile[3]) : (octile[3] - octile[i]))); + ospread += (octile[i + 1] - octile[i]) / max (0.5f, (i > 2 ? (octile[i + 1] - octile[3]) : (octile[3] - octile[i]))); } ospread /= 5.f; @@ -6871,7 +6837,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double // compute clipping points based on the original histograms (linear, without exp comp.) - int clipped = 0; + unsigned int clipped = 0; int rawmax = (imax) - 1; while (histogram[rawmax] + clipped <= 0 && rawmax > 1) { @@ -6880,17 +6846,15 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double } //compute clipped white point - int clippable = (int)(sum * clip / 100.f ); - int somm = sum; + unsigned int clippable = (int) (sum * clip / 100.f ); clipped = 0; int whiteclip = (imax) - 1; - while (whiteclip > 1 && histogram[whiteclip] + clipped <= clippable) { + while (whiteclip > 1 && (histogram[whiteclip] + clipped) <= clippable) { clipped += histogram[whiteclip]; whiteclip--; } - int clipwh = clipped; //compute clipped black point clipped = 0; int shc = 0; @@ -6900,8 +6864,6 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double shc++; } - int clipbl = clipped; - //rescale to 65535 max rawmax <<= histcompr; whiteclip <<= histcompr; @@ -6917,26 +6879,25 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double //compute exposure compensation as geometric mean of the amount that //sets the mean or median at middle gray, and the amount that sets the estimated top //of the histogram at or near clipping. - float expo = log(midgray * scale / (ave - shc + midgray * shc)); //float expcomp1 = (log(/*(median/ave)*//*(hidev/lodev)*/midgray*scale/(ave-shc+midgray*shc))+log((hidev/lodev)))/log(2.f); - float expcomp1 = (log(/*(median/ave)*//*(hidev/lodev)*/midgray * scale / (ave - shc + midgray * shc))) / log(2.f); + float expcomp1 = (log (/*(median/ave)*//*(hidev/lodev)*/midgray * scale / (ave - shc + midgray * shc))) / log (2.f); float expcomp2; - if(overex == 0) { // image is not overexposed - expcomp2 = 0.5f * ( (15.5f - histcompr - (2.f * oct7 - oct6)) + log(scale / rawmax) / log(2.f) ); + if (overex == 0) { // image is not overexposed + expcomp2 = 0.5f * ( (15.5f - histcompr - (2.f * oct7 - oct6)) + log (scale / rawmax) / log (2.f) ); } else { - expcomp2 = 0.5f * ( (15.5f - histcompr - (2.f * octile[7] - octile[6])) + log(scale / rawmax) / log(2.f) ); + expcomp2 = 0.5f * ( (15.5f - histcompr - (2.f * octile[7] - octile[6])) + log (scale / rawmax) / log (2.f) ); } - if(fabs(expcomp1) - fabs(expcomp2) > 1.f) { //for great expcomp - expcomp = (expcomp1 * fabs(expcomp2) + expcomp2 * fabs(expcomp1)) / (fabs(expcomp1) + fabs(expcomp2)); + if (fabs (expcomp1) - fabs (expcomp2) > 1.f) { //for great expcomp + expcomp = (expcomp1 * fabs (expcomp2) + expcomp2 * fabs (expcomp1)) / (fabs (expcomp1) + fabs (expcomp2)); } else { expcomp = 0.5 * (double)expcomp1 + 0.5 * (double) expcomp2; //for small expcomp } - float gain = exp((float)expcomp * log(2.f)); + float gain = exp ((float)expcomp * log (2.f)); - float corr = sqrt(gain * scale / rawmax); + float corr = sqrt (gain * scale / rawmax); black = (int) shc * corr; @@ -6945,12 +6906,12 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double //this is a series approximation of the actual formula for comp, //which is a transcendental equation float comp = (gain * ((float)whiteclip) / scale - 1.f) * 2.3f; // 2.3 instead of 2 to increase slightly comp - hlcompr = (int)(100.*comp / (max(0.0, expcomp) + 1.0)); - hlcompr = max(0, min(100, hlcompr)); + hlcompr = (int) (100.*comp / (max (0.0, expcomp) + 1.0)); + hlcompr = max (0, min (100, hlcompr)); //now find brightness if gain didn't bring ave to midgray using //the envelope of the actual 'control cage' brightness curve for simplicity - float midtmp = gain * sqrt(median * ave) / scale; + float midtmp = gain * sqrt (median * ave) / scale; if (midtmp < 0.1f) { bright = (midgray - midtmp) * 15.0 / (midtmp); @@ -6958,13 +6919,13 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double bright = (midgray - midtmp) * 15.0 / (0.10833 - 0.0833 * midtmp); } - bright = 0.25 */*(median/ave)*(hidev/lodev)*/max(0, bright); + bright = 0.25 */*(median/ave)*(hidev/lodev)*/max (0, bright); //compute contrast that spreads the average spacing of octiles contr = (int) 50.0f * (1.1f - ospread); - contr = max(0, min(100, contr)); + contr = max (0, min (100, contr)); //take gamma into account - double whiteclipg = (int)(CurveFactory::gamma2 (whiteclip * corr / 65536.0) * 65536.0); + double whiteclipg = (int) (CurveFactory::gamma2 (whiteclip * corr / 65536.0) * 65536.0); float gavg = 0.; @@ -6986,10 +6947,10 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double } } - whiteclipg = CurveFactory::igamma2 ((float)(whiteclipg / 65535.0)) * 65535.0; //need to inverse gamma transform to get correct exposure compensation parameter + whiteclipg = CurveFactory::igamma2 ((float) (whiteclipg / 65535.0)) * 65535.0; //need to inverse gamma transform to get correct exposure compensation parameter //corection with gamma - black = (int)((65535 * black) / whiteclipg); + black = (int) ((65535 * black) / whiteclipg); //expcomp = log(65535.0 / (whiteclipg)) / log(2.0); //diagnostics @@ -7045,7 +7006,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double expcomp = 12.0; } - bright = max(-100, min(bright, 100)); + bright = max (-100, min (bright, 100)); } @@ -7108,7 +7069,7 @@ double ImProcFunctions::getAutoDistor (const Glib::ustring &fname, int thumb_si double dist_amount; int dist_result = calcDistortion (thumbGray, rawGray, width, h_thumb, 1, dist_amount); - if(dist_result == -1) { // not enough features found, try increasing max. number of features by factor 4 + if (dist_result == -1) { // not enough features found, try increasing max. number of features by factor 4 dist_result = calcDistortion (thumbGray, rawGray, width, h_thumb, 4, dist_amount); } @@ -7122,13 +7083,13 @@ double ImProcFunctions::getAutoDistor (const Glib::ustring &fname, int thumb_si } } -void ImProcFunctions::rgb2lab(const Imagefloat &src, LabImage &dst, const Glib::ustring &workingSpace) +void ImProcFunctions::rgb2lab (const Imagefloat &src, LabImage &dst, const Glib::ustring &workingSpace) { - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix( workingSpace ); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix ( workingSpace ); const float wp[3][3] = { - {static_cast(wprof[0][0]), static_cast(wprof[0][1]), static_cast(wprof[0][2])}, - {static_cast(wprof[1][0]), static_cast(wprof[1][1]), static_cast(wprof[1][2])}, - {static_cast(wprof[2][0]), static_cast(wprof[2][1]), static_cast(wprof[2][2])} + {static_cast (wprof[0][0]), static_cast (wprof[0][1]), static_cast (wprof[0][2])}, + {static_cast (wprof[1][0]), static_cast (wprof[1][1]), static_cast (wprof[1][2])}, + {static_cast (wprof[2][0]), static_cast (wprof[2][1]), static_cast (wprof[2][2])} }; const int W = src.getWidth(); @@ -7138,23 +7099,23 @@ void ImProcFunctions::rgb2lab(const Imagefloat &src, LabImage &dst, const Glib:: #pragma omp parallel for schedule(dynamic,16) #endif - for(int i = 0; i < H; i++) { - for(int j = 0; j < W; j++) { + for (int i = 0; i < H; i++) { + for (int j = 0; j < W; j++) { float X, Y, Z; - Color::rgbxyz(src.r(i, j), src.g(i, j), src.b(i, j), X, Y, Z, wp); + Color::rgbxyz (src.r (i, j), src.g (i, j), src.b (i, j), X, Y, Z, wp); //convert Lab - Color::XYZ2Lab(X, Y, Z, dst.L[i][j], dst.a[i][j], dst.b[i][j]); + Color::XYZ2Lab (X, Y, Z, dst.L[i][j], dst.a[i][j], dst.b[i][j]); } } } -SSEFUNCTION void ImProcFunctions::lab2rgb(const LabImage &src, Imagefloat &dst, const Glib::ustring &workingSpace) +SSEFUNCTION void ImProcFunctions::lab2rgb (const LabImage &src, Imagefloat &dst, const Glib::ustring &workingSpace) { - TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix( workingSpace ); + TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix ( workingSpace ); const float wip[3][3] = { - {static_cast(wiprof[0][0]), static_cast(wiprof[0][1]), static_cast(wiprof[0][2])}, - {static_cast(wiprof[1][0]), static_cast(wiprof[1][1]), static_cast(wiprof[1][2])}, - {static_cast(wiprof[2][0]), static_cast(wiprof[2][1]), static_cast(wiprof[2][2])} + {static_cast (wiprof[0][0]), static_cast (wiprof[0][1]), static_cast (wiprof[0][2])}, + {static_cast (wiprof[1][0]), static_cast (wiprof[1][1]), static_cast (wiprof[1][2])}, + {static_cast (wiprof[2][0]), static_cast (wiprof[2][1]), static_cast (wiprof[2][2])} }; const int W = dst.getWidth(); @@ -7162,9 +7123,9 @@ SSEFUNCTION void ImProcFunctions::lab2rgb(const LabImage &src, Imagefloat &dst, #ifdef __SSE2__ vfloat wipv[3][3]; - for(int i = 0; i < 3; i++) { - for(int j = 0; j < 3; j++) { - wipv[i][j] = F2V(wiprof[i][j]); + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { + wipv[i][j] = F2V (wiprof[i][j]); } } @@ -7174,26 +7135,26 @@ SSEFUNCTION void ImProcFunctions::lab2rgb(const LabImage &src, Imagefloat &dst, #pragma omp parallel for schedule(dynamic,16) #endif - for(int i = 0; i < H; i++) { + for (int i = 0; i < H; i++) { int j = 0; #ifdef __SSE2__ - for(; j < W - 3; j += 4) { + for (; j < W - 3; j += 4) { vfloat X, Y, Z; vfloat R, G, B; - Color::Lab2XYZ(LVFU(src.L[i][j]), LVFU(src.a[i][j]), LVFU(src.b[i][j]), X, Y, Z); - Color::xyz2rgb(X, Y, Z, R, G, B, wipv); - STVFU(dst.r(i, j), R); - STVFU(dst.g(i, j), G); - STVFU(dst.b(i, j), B); + Color::Lab2XYZ (LVFU (src.L[i][j]), LVFU (src.a[i][j]), LVFU (src.b[i][j]), X, Y, Z); + Color::xyz2rgb (X, Y, Z, R, G, B, wipv); + STVFU (dst.r (i, j), R); + STVFU (dst.g (i, j), G); + STVFU (dst.b (i, j), B); } #endif - for(; j < W; j++) { + for (; j < W; j++) { float X, Y, Z; - Color::Lab2XYZ(src.L[i][j], src.a[i][j], src.b[i][j], X, Y, Z); - Color::xyz2rgb(X, Y, Z, dst.r(i, j), dst.g(i, j), dst.b(i, j), wip); + Color::Lab2XYZ (src.L[i][j], src.a[i][j], src.b[i][j], X, Y, Z); + Color::xyz2rgb (X, Y, Z, dst.r (i, j), dst.g (i, j), dst.b (i, j), wip); } } } diff --git a/rtengine/impulse_denoise.h b/rtengine/impulse_denoise.h index 9d3b73b79..a40577f39 100644 --- a/rtengine/impulse_denoise.h +++ b/rtengine/impulse_denoise.h @@ -82,7 +82,6 @@ SSEFUNCTION void ImProcFunctions::impulse_nr (LabImage* lab, double thresh) #ifdef __SSE2__ vfloat hfnbravev, hpfabsv; vfloat impthrDiv24v = F2V( impthrDiv24 ); - vfloat onev = F2V( 1.0f ); #endif #ifdef _OPENMP #pragma omp for diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 971eded5d..7ac960a6d 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -457,6 +457,7 @@ void ImProcFunctions::DeNoise_Local (int call, const struct local_params& lp, La transformed->a[y][x] = original->a[y][x]; transformed->b[y][x] = original->b[y][x]; } + continue; } @@ -3553,8 +3554,8 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * //Blur and noise if (((radius >= 1.5 * GAUSS_SKIP && lp.rad > 1.) || lp.stren > 0.1) && lp.blurena) { // radius < GAUSS_SKIP means no gauss, just copy of original image - LabImage *tmp1; - LabImage *bufgb; + LabImage *tmp1 = nullptr; + LabImage *bufgb = nullptr; int GW = transformed->W; int GH = transformed->H; // printf ("rad=%f gaus=%f call=%i skip=%i\n", radius, GAUSS_SKIP, call, sk); @@ -3679,8 +3680,9 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * const int numThreads = 1; #endif + if (call == 1) { - LabImage tmp1(transformed->W, transformed->H); + LabImage tmp1 (transformed->W, transformed->H); int GW = transformed->W; int GH = transformed->H; @@ -3696,15 +3698,16 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * int levwavL = levred; int skip = 1; - wavelet_decomposition Ldecomp(tmp1.L[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, DaubLen); - wavelet_decomposition adecomp(tmp1.a[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, DaubLen); - wavelet_decomposition bdecomp(tmp1.b[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, DaubLen); + wavelet_decomposition Ldecomp (tmp1.L[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, DaubLen); + wavelet_decomposition adecomp (tmp1.a[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, DaubLen); + wavelet_decomposition bdecomp (tmp1.b[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, DaubLen); float madL[8][3]; int edge = 2; if (!Ldecomp.memoryAllocationFailed) { #pragma omp parallel for collapse(2) schedule(dynamic,1) + for (int lvl = 0; lvl < levred; lvl++) { for (int dir = 1; dir < 4; dir++) { int Wlvl_L = Ldecomp.level_W (lvl); @@ -3831,8 +3834,8 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * int bfh = int (lp.ly + lp.lyT) + del; //bfw bfh real size of square zone int bfw = int (lp.lx + lp.lxL) + del; - LabImage bufwv(bfw, bfh); - bufwv.clear(true); + LabImage bufwv (bfw, bfh); + bufwv.clear (true); int yStart = lp.yc - lp.lyT - cy; int yEnd = lp.yc + lp.ly - cy; @@ -3848,9 +3851,9 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * int loy = cy + y; for (int x = xStart, lox = cx + x; x < xEnd; x++, lox++) { - bufwv.L[loy - begy][lox - begx] = original->L[y][x];//fill square buffer with datas - bufwv.a[loy - begy][lox - begx] = original->a[y][x];//fill square buffer with datas - bufwv.b[loy - begy][lox - begx] = original->b[y][x];//fill square buffer with datas + bufwv.L[loy - begy][lox - begx] = original->L[y][x];//fill square buffer with datas + bufwv.a[loy - begy][lox - begx] = original->a[y][x];//fill square buffer with datas + bufwv.b[loy - begy][lox - begx] = original->b[y][x];//fill square buffer with datas } } @@ -3858,15 +3861,16 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * int levwavL = levred; int skip = 1; - wavelet_decomposition Ldecomp(bufwv.L[0], bufwv.W, bufwv.H, levwavL, 1, skip, numThreads, DaubLen); - wavelet_decomposition adecomp(bufwv.a[0], bufwv.W, bufwv.H, levwavL, 1, skip, numThreads, DaubLen); - wavelet_decomposition bdecomp(bufwv.b[0], bufwv.W, bufwv.H, levwavL, 1, skip, numThreads, DaubLen); + wavelet_decomposition Ldecomp (bufwv.L[0], bufwv.W, bufwv.H, levwavL, 1, skip, numThreads, DaubLen); + wavelet_decomposition adecomp (bufwv.a[0], bufwv.W, bufwv.H, levwavL, 1, skip, numThreads, DaubLen); + wavelet_decomposition bdecomp (bufwv.b[0], bufwv.W, bufwv.H, levwavL, 1, skip, numThreads, DaubLen); float madL[8][3]; int edge = 2; if (!Ldecomp.memoryAllocationFailed) { #pragma omp parallel for collapse(2) schedule(dynamic,1) + for (int lvl = 0; lvl < levred; lvl++) { for (int dir = 1; dir < 4; dir++) { int Wlvl_L = Ldecomp.level_W (lvl); @@ -4010,15 +4014,15 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * huemoins = hueref - dhue + 2.f * rtengine::RT_PI; } - LabImage *bufcolorig; + LabImage *bufcolorig = nullptr; float chprov = 1.f; float chpro = 1.f; float cligh = 1.f; float clighL = 1.f; float clighmax ; - float **buflight; - float **bufchro; - float **buflightslid; + float **buflight = nullptr; + float **bufchro = nullptr; + float **buflightslid = nullptr; int bfh, bfw; @@ -4214,8 +4218,8 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * huemoins = hueref - dhue + 2.f * rtengine::RT_PI; } - LabImage *bufcontorig; - float **buflightc; + LabImage *bufcontorig = nullptr; + float **buflightc = nullptr; int bfh, bfw; float clighc = 0.f; const float localtype = lumaref; @@ -4387,10 +4391,10 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * //&& lp.tonemapena if (lp.strengt != 0.f && lp.tonemapena) { - LabImage *tmp1; - float **buflight; + LabImage *tmp1 = nullptr; + float **buflight = nullptr; - LabImage *bufgb; + LabImage *bufgb = nullptr; int bfh = int (lp.ly + lp.lyT) + del; //bfw bfh real size of square zone int bfw = int (lp.lx + lp.lxL) + del; @@ -4505,8 +4509,8 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * //begin cbdl if ((lp.mulloc[0] != 1.f || lp.mulloc[1] != 1.f || lp.mulloc[2] != 1.f || lp.mulloc[3] != 1.f || lp.mulloc[4] != 1.f) && lp.cbdlena) { - float **bufsh;//buffer por square zone - float **loctemp; + float **bufsh = nullptr;//buffer por square zone + float **loctemp = nullptr; int bfh = int (lp.ly + lp.lyT) + del; //bfw bfh real size of square zone int bfw = int (lp.lx + lp.lxL) + del; float b_l = -5.f; @@ -4515,7 +4519,7 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * float b_r = 170.f; double skinprot = 0.; int choice = 0; - float **buflight; + float **buflight = nullptr; if (call <= 3) { //call from simpleprocess dcrop improcc @@ -4738,9 +4742,9 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * int GW = transformed->W; int GH = transformed->H; - LabImage *bufreti; - float **buflight; - float **bufchro; + LabImage *bufreti = nullptr; + float **buflight = nullptr; + float **bufchro = nullptr; int bfh = int (lp.ly + lp.lyT) + del; //bfw bfh real size of square zone int bfw = int (lp.lx + lp.lxL) + del; @@ -4826,7 +4830,7 @@ void ImProcFunctions::Lab_Local (int call, int sp, float** shbuffer, LabImage * } - LabImage *tmpl; + LabImage *tmpl = nullptr; if (!lp.invret && call <= 3) { diff --git a/rtengine/ipresize.cc b/rtengine/ipresize.cc index d3845ed8b..dde43fe6c 100644 --- a/rtengine/ipresize.cc +++ b/rtengine/ipresize.cc @@ -27,28 +27,29 @@ # include #endif + namespace rtengine { -static inline float Lanc(float x, float a) +static inline float Lanc (float x, float a) { if (x * x < 1e-6f) { return 1.0f; } else if (x * x > a * a) { return 0.0f; } else { - x = static_cast(rtengine::RT_PI) * x; - return a * xsinf(x) * xsinf(x / a) / (x * x); + x = static_cast (rtengine::RT_PI) * x; + return a * xsinf (x) * xsinf (x / a) / (x * x); } } -void ImProcFunctions::Lanczos(const Image16* src, Image16* dst, float scale) +void ImProcFunctions::Lanczos (const Image16* src, Image16* dst, float scale) { const float delta = 1.0f / scale; const float a = 3.0f; - const float sc = min(scale, 1.0f); - const int support = static_cast(2.0f * a / sc) + 1; + const float sc = min (scale, 1.0f); + const int support = static_cast (2.0f * a / sc) + 1; #pragma omp parallel { @@ -67,7 +68,7 @@ void ImProcFunctions::Lanczos(const Image16* src, Image16* dst, float scale) for (int j = 0; j < dst->getWidth(); j++) { // x coord of the center of pixel on src image - float x0 = (static_cast(j) + 0.5f) * delta - 0.5f; + float x0 = (static_cast (j) + 0.5f) * delta - 0.5f; // weights for interpolation in horisontal direction float * w = wwh + j * support; @@ -75,14 +76,14 @@ void ImProcFunctions::Lanczos(const Image16* src, Image16* dst, float scale) // sum of weights used for normalization float ws = 0.0f; - jj0[j] = max(0, static_cast(floorf(x0 - a / sc)) + 1); - jj1[j] = min(src->getWidth(), static_cast(floorf(x0 + a / sc)) + 1); + jj0[j] = max (0, static_cast (floorf (x0 - a / sc)) + 1); + jj1[j] = min (src->getWidth(), static_cast (floorf (x0 + a / sc)) + 1); // calculate weights for (int jj = jj0[j]; jj < jj1[j]; jj++) { int k = jj - jj0[j]; - float z = sc * (x0 - static_cast(jj)); - w[k] = Lanc(z, a); + float z = sc * (x0 - static_cast (jj)); + w[k] = Lanc (z, a); ws += w[k]; } @@ -98,7 +99,7 @@ void ImProcFunctions::Lanczos(const Image16* src, Image16* dst, float scale) for (int i = 0; i < dst->getHeight(); i++) { // y coord of the center of pixel on src image - float y0 = (static_cast(i) + 0.5f) * delta - 0.5f; + float y0 = (static_cast (i) + 0.5f) * delta - 0.5f; // weights for interpolation in y direction float w[support]; @@ -106,14 +107,14 @@ void ImProcFunctions::Lanczos(const Image16* src, Image16* dst, float scale) // sum of weights used for normalization float ws = 0.0f; - int ii0 = max(0, static_cast(floorf(y0 - a / sc)) + 1); - int ii1 = min(src->getHeight(), static_cast(floorf(y0 + a / sc)) + 1); + int ii0 = max (0, static_cast (floorf (y0 - a / sc)) + 1); + int ii1 = min (src->getHeight(), static_cast (floorf (y0 + a / sc)) + 1); // calculate weights for vertical interpolation for (int ii = ii0; ii < ii1; ii++) { int k = ii - ii0; - float z = sc * (y0 - static_cast(ii)); - w[k] = Lanc(z, a); + float z = sc * (y0 - static_cast (ii)); + w[k] = Lanc (z, a); ws += w[k]; } @@ -130,9 +131,9 @@ void ImProcFunctions::Lanczos(const Image16* src, Image16* dst, float scale) for (int ii = ii0; ii < ii1; ii++) { int k = ii - ii0; - r += w[k] * src->r(ii, j); - g += w[k] * src->g(ii, j); - b += w[k] * src->b(ii, j); + r += w[k] * src->r (ii, j); + g += w[k] * src->g (ii, j); + b += w[k] * src->b (ii, j); } lr[j] = r; @@ -141,7 +142,7 @@ void ImProcFunctions::Lanczos(const Image16* src, Image16* dst, float scale) } // Do horizontal interpolation - for(int j = 0; j < dst->getWidth(); j++) { + for (int j = 0; j < dst->getWidth(); j++) { float * wh = wwh + support * j; @@ -155,9 +156,9 @@ void ImProcFunctions::Lanczos(const Image16* src, Image16* dst, float scale) b += wh[k] * lb[jj]; } - dst->r(i, j) = CLIP(static_cast(r)); - dst->g(i, j) = CLIP(static_cast(g)); - dst->b(i, j) = CLIP(static_cast(b)); + dst->r (i, j) = CLIP (static_cast (r)); + dst->g (i, j) = CLIP (static_cast (g)); + dst->b (i, j) = CLIP (static_cast (b)); } } @@ -171,12 +172,12 @@ void ImProcFunctions::Lanczos(const Image16* src, Image16* dst, float scale) } -SSEFUNCTION void ImProcFunctions::Lanczos(const LabImage* src, LabImage* dst, float scale) +SSEFUNCTION void ImProcFunctions::Lanczos (const LabImage* src, LabImage* dst, float scale) { const float delta = 1.0f / scale; const float a = 3.0f; - const float sc = min(scale, 1.0f); - const int support = static_cast(2.0f * a / sc) + 1; + const float sc = min (scale, 1.0f); + const int support = static_cast (2.0f * a / sc) + 1; // storage for precomputed parameters for horizontal interpolation float * wwh = new float[support * dst->W]; @@ -187,7 +188,7 @@ SSEFUNCTION void ImProcFunctions::Lanczos(const LabImage* src, LabImage* dst, fl for (int j = 0; j < dst->W; j++) { // x coord of the center of pixel on src image - float x0 = (static_cast(j) + 0.5f) * delta - 0.5f; + float x0 = (static_cast (j) + 0.5f) * delta - 0.5f; // weights for interpolation in horizontal direction float * w = wwh + j * support; @@ -195,14 +196,14 @@ SSEFUNCTION void ImProcFunctions::Lanczos(const LabImage* src, LabImage* dst, fl // sum of weights used for normalization float ws = 0.0f; - jj0[j] = max(0, static_cast(floorf(x0 - a / sc)) + 1); - jj1[j] = min(src->W, static_cast(floorf(x0 + a / sc)) + 1); + jj0[j] = max (0, static_cast (floorf (x0 - a / sc)) + 1); + jj1[j] = min (src->W, static_cast (floorf (x0 + a / sc)) + 1); // calculate weights for (int jj = jj0[j]; jj < jj1[j]; jj++) { int k = jj - jj0[j]; - float z = sc * (x0 - static_cast(jj)); - w[k] = Lanc(z, a); + float z = sc * (x0 - static_cast (jj)); + w[k] = Lanc (z, a); ws += w[k]; } @@ -230,19 +231,19 @@ SSEFUNCTION void ImProcFunctions::Lanczos(const LabImage* src, LabImage* dst, fl for (int i = 0; i < dst->H; i++) { // y coord of the center of pixel on src image - float y0 = (static_cast(i) + 0.5f) * delta - 0.5f; + float y0 = (static_cast (i) + 0.5f) * delta - 0.5f; // sum of weights used for normalization float ws = 0.0f; - int ii0 = max(0, static_cast(floorf(y0 - a / sc)) + 1); - int ii1 = min(src->H, static_cast(floorf(y0 + a / sc)) + 1); + int ii0 = max (0, static_cast (floorf (y0 - a / sc)) + 1); + int ii1 = min (src->H, static_cast (floorf (y0 + a / sc)) + 1); // calculate weights for vertical interpolation for (int ii = ii0; ii < ii1; ii++) { int k = ii - ii0; - float z = sc * (y0 - static_cast(ii)); - w[k] = Lanc(z, a); + float z = sc * (y0 - static_cast (ii)); + w[k] = Lanc (z, a); ws += w[k]; } @@ -263,15 +264,15 @@ SSEFUNCTION void ImProcFunctions::Lanczos(const LabImage* src, LabImage* dst, fl for (int ii = ii0; ii < ii1; ii++) { int k = ii - ii0; - wkv = _mm_set1_ps(w[k]); - Lv += wkv * LVFU(src->L[ii][j]); - av += wkv * LVFU(src->a[ii][j]); - bv += wkv * LVFU(src->b[ii][j]); + wkv = _mm_set1_ps (w[k]); + Lv += wkv * LVFU (src->L[ii][j]); + av += wkv * LVFU (src->a[ii][j]); + bv += wkv * LVFU (src->b[ii][j]); } - STVF(lL[j], Lv); - STVF(la[j], av); - STVF(lb[j], bv); + STVF (lL[j], Lv); + STVF (la[j], av); + STVF (lb[j], bv); } #else @@ -295,7 +296,7 @@ SSEFUNCTION void ImProcFunctions::Lanczos(const LabImage* src, LabImage* dst, fl } // Do horizontal interpolation - for(int j = 0; j < dst->W; j++) { + for (int j = 0; j < dst->W; j++) { float * wh = wwh + support * j; @@ -348,35 +349,35 @@ float ImProcFunctions::resizeScale (const ProcParams* params, int fw, int fh, in refh = fh; } - switch(params->resize.dataspec) { - case (1): - // Width - dScale = (double)params->resize.width / (double)refw; - break; - - case (2): - // Height - dScale = (double)params->resize.height / (double)refh; - break; - - case (3): - - // FitBox - if ((double)refw / (double)refh > (double)params->resize.width / (double)params->resize.height) { + switch (params->resize.dataspec) { + case (1): + // Width dScale = (double)params->resize.width / (double)refw; - } else { + break; + + case (2): + // Height dScale = (double)params->resize.height / (double)refh; - } + break; - break; + case (3): - default: - // Scale - dScale = params->resize.scale; - break; + // FitBox + if ((double)refw / (double)refh > (double)params->resize.width / (double)params->resize.height) { + dScale = (double)params->resize.width / (double)refw; + } else { + dScale = (double)params->resize.height / (double)refh; + } + + break; + + default: + // Scale + dScale = params->resize.scale; + break; } - if (fabs(dScale - 1.0) <= 1e-5) { + if (fabs (dScale - 1.0) <= 1e-5) { return 1.0; } @@ -388,8 +389,8 @@ float ImProcFunctions::resizeScale (const ProcParams* params, int fw, int fh, in imh = refh; } - imw = (int)( (double)imw * dScale + 0.5 ); - imh = (int)( (double)imh * dScale + 0.5 ); + imw = (int) ( (double)imw * dScale + 0.5 ); + imh = (int) ( (double)imh * dScale + 0.5 ); return (float)dScale; } @@ -399,8 +400,8 @@ void ImProcFunctions::resize (Image16* src, Image16* dst, float dScale) time_t t1 = clock(); #endif - if(params->resize.method != "Nearest" ) { - Lanczos(src, dst, dScale); + if (params->resize.method != "Nearest" ) { + Lanczos (src, dst, dScale); } else { // Nearest neighbour algorithm #ifdef _OPENMP @@ -409,14 +410,14 @@ void ImProcFunctions::resize (Image16* src, Image16* dst, float dScale) for (int i = 0; i < dst->getHeight(); i++) { int sy = i / dScale; - sy = LIM(sy, 0, src->getHeight() - 1); + sy = LIM (sy, 0, src->getHeight() - 1); for (int j = 0; j < dst->getWidth(); j++) { int sx = j / dScale; - sx = LIM(sx, 0, src->getWidth() - 1); - dst->r(i, j) = src->r(sy, sx); - dst->g(i, j) = src->g(sy, sx); - dst->b(i, j) = src->b(sy, sx); + sx = LIM (sx, 0, src->getWidth() - 1); + dst->r (i, j) = src->r (sy, sx); + dst->g (i, j) = src->g (sy, sx); + dst->b (i, j) = src->b (sy, sx); } } } @@ -424,7 +425,7 @@ void ImProcFunctions::resize (Image16* src, Image16* dst, float dScale) #ifdef PROFILE time_t t2 = clock(); std::cout << "Resize: " << params->resize.method << ": " - << (float)(t2 - t1) / CLOCKS_PER_SEC << std::endl; + << (float) (t2 - t1) / CLOCKS_PER_SEC << std::endl; #endif } diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index 5ae650c54..3a4538c3e 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -273,7 +273,7 @@ void RawImageSource::MSR (float** luminance, float** originalLuminance, float ** } } - float varx; + float varx = 0.f; float limdx, ilimdx; if (gradvart != 0) { @@ -345,7 +345,7 @@ void RawImageSource::MSR (float** luminance, float** originalLuminance, float ** src[i] = &srcBuffer[i * W_L]; } - int h_th, s_th; + int h_th = 0, s_th = 0; int shHighlights = deh.highlights; int shShadows = deh.shadows; @@ -824,7 +824,7 @@ void ImProcFunctions::MSRLocal (float** luminance, float** templ, const float* c float mean, stddv, maxtr, mintr; float delta; constexpr float eps = 2.f; - constexpr bool useHsl = false; //never used + // constexpr bool useHsl = false; //never used constexpr bool useHslLin = false;//never used const float offse = 0.f; //loc.offs; const float chrT = (float) (loc.chrrt) / 100.f; @@ -847,7 +847,7 @@ void ImProcFunctions::MSRLocal (float** luminance, float** templ, const float* c nei = (int) (0.3f * nei + 2.f); } - int moderetinex; + int moderetinex = 0; if (loc.retinexMethod == "uni") { moderetinex = 0; @@ -1060,26 +1060,26 @@ void ImProcFunctions::MSRLocal (float** luminance, float** templ, const float* c bmax *= 500.f; amin *= 500.f; bmin *= 500.f; + /* + #ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) + #endif -#ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) -#endif + for (int i = 0; i < H_L; i++ ) + for (int j = 0; j < W_L; j++) { //for mintr to maxtr evalate absciss in function of original transmission + float absciss; - for (int i = 0; i < H_L; i++ ) - for (int j = 0; j < W_L; j++) { //for mintr to maxtr evalate absciss in function of original transmission - float absciss; - - if (LIKELY (fabsf (luminance[i][j] - mean) < stddv)) { - absciss = asig * luminance[i][j] + bsig; - } else if (luminance[i][j] >= mean) { - absciss = amax * luminance[i][j] + bmax; - } else { - absciss = amin * luminance[i][j] + bmin; - } - - // luminance[i][j] *= (-1.f + 4.f * wavRETCcurve[absciss]); //new transmission - } + if (LIKELY (fabsf (luminance[i][j] - mean) < stddv)) { + absciss = asig * luminance[i][j] + bsig; + } else if (luminance[i][j] >= mean) { + absciss = amax * luminance[i][j] + bmax; + } else { + absciss = amin * luminance[i][j] + bmin; + } + // luminance[i][j] *= (-1.f + 4.f * wavRETCcurve[absciss]); //new transmission + } + */ // median filter on transmission ==> reduce artifacts bool ty = false; @@ -1099,7 +1099,7 @@ void ImProcFunctions::MSRLocal (float** luminance, float** templ, const float* c #endif for (int i = borderL; i < hei - borderL; i++) { - float pp[9], temp; + // float pp[9], temp; for (int j = borderL; j < wid - borderL; j++) { tmL[i][j] = median (luminance[i][j], luminance[i - 1][j], luminance[i + 1][j], luminance[i][j + 1], luminance[i][j - 1], luminance[i - 1][j - 1], luminance[i - 1][j + 1], luminance[i + 1][j - 1], luminance[i + 1][j + 1]); //3x3 @@ -1167,7 +1167,7 @@ void ImProcFunctions::MSRLocal (float** luminance, float** templ, const float* c // I call mean_stddv2 instead of mean_stddv ==> logBetaGain mean_stddv2 ( luminance, mean, stddv, W_L, H_L, maxtr, mintr); - float asig, bsig, amax, bmax, amin, bmin; + float asig = 0.f, bsig = 0.f, amax = 0.f, bmax = 0.f, amin = 0.f, bmin = 0.f; // bool gaincurve = false; //wavRETgainCcurve const bool hasWavRetGainCurve = locRETgainCcurve && mean != 0.f && stddv != 0.f; diff --git a/rtengine/ipsharpen.cc b/rtengine/ipsharpen.cc index 56905ae70..f94ff6e7f 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -1008,7 +1008,7 @@ void ImProcFunctions::sharpeningcam (CieImage* ncie, float** b2) // Rest is UNSHARP MASK int W = ncie->W, H = ncie->H; - float** b3; + float** b3 = nullptr; if (params->sharpening.edgesonly) { b3 = new float*[H]; diff --git a/rtengine/iptransform.cc b/rtengine/iptransform.cc index abbb5d77d..04ba4966d 100644 --- a/rtengine/iptransform.cc +++ b/rtengine/iptransform.cc @@ -25,22 +25,23 @@ #include "rt_math.h" #include "sleef.c" + using namespace std; namespace { -float pow3(float x) +float pow3 (float x) { return x * x * x; } -float pow4(float x) +float pow4 (float x) { return (x * x) * (x * x); } -float pown(float x, int n) +float pown (float x, int n) { switch (n) { @@ -51,47 +52,47 @@ float pown(float x, int n) return x * x; case 4: - return pow4(x); + return pow4 (x); case 6: - return (x * x) * pow4(x); + return (x * x) * pow4 (x); case 8: - return pow4(x) * pow4(x); + return pow4 (x) * pow4 (x); default: - return pow_F(x, n); + return pow_F (x, n); } } -float normn(float a, float b, int n) +float normn (float a, float b, int n) { switch (n) { case 2: - return sqrtf(a * a + b * b); + return sqrtf (a * a + b * b); case 4: - return sqrtf(sqrtf(pow4(a) + pow4(b))); + return sqrtf (sqrtf (pow4 (a) + pow4 (b))); case 6: - return sqrtf(xcbrtf(pow3(a) * pow3(a) + pow3(b) * pow3(b))); + return sqrtf (xcbrtf (pow3 (a) * pow3 (a) + pow3 (b) * pow3 (b))); case 8: - return sqrtf(sqrtf(sqrtf(pow4(a) * pow4(a) + pow4(b) * pow4(b)))); + return sqrtf (sqrtf (sqrtf (pow4 (a) * pow4 (a) + pow4 (b) * pow4 (b)))); default: - return pow_F(pown(a, n) + pown(b, n), 1.f / n); + return pow_F (pown (a, n) + pown (b, n), 1.f / n); } } -void correct_distortion(const rtengine::LCPMapper *lcp, double &x, double &y, - int cx, int cy) +void correct_distortion (const rtengine::LCPMapper *lcp, double &x, double &y, + int cx, int cy) { - assert(lcp); - + assert (lcp); + x += cx; y += cy; - lcp->correctDistortion(x, y); + lcp->correctDistortion (x, y); x -= cx; y -= cy; } @@ -127,26 +128,26 @@ bool ImProcFunctions::transCoord (int W, int H, const std::vector &src, double oW = W, oH = H; double w2 = (double) oW / 2.0 - 0.5; double h2 = (double) oH / 2.0 - 0.5; - double maxRadius = sqrt( (double)( oW * oW + oH * oH ) ) / 2; + double maxRadius = sqrt ( (double) ( oW * oW + oH * oH ) ) / 2; // auxiliary variables for distortion correction bool needsDist = needsDistortion(); // for performance double distAmount = params->distortion.amount; // auxiliary variables for rotation - double cost = cos(params->rotate.degree * rtengine::RT_PI / 180.0); - double sint = sin(params->rotate.degree * rtengine::RT_PI / 180.0); + double cost = cos (params->rotate.degree * rtengine::RT_PI / 180.0); + double sint = sin (params->rotate.degree * rtengine::RT_PI / 180.0); // auxiliary variables for vertical perspective correction double vpdeg = params->perspective.vertical / 100.0 * 45.0; double vpalpha = (90.0 - vpdeg) / 180.0 * rtengine::RT_PI; - double vpteta = fabs(vpalpha - rtengine::RT_PI / 2) < 3e-4 ? 0.0 : acos ((vpdeg > 0 ? 1.0 : -1.0) * sqrt((-oW * oW * tan(vpalpha) * tan(vpalpha) + (vpdeg > 0 ? 1.0 : -1.0) * oW * tan(vpalpha) * sqrt(16 * maxRadius * maxRadius + oW * oW * tan(vpalpha) * tan(vpalpha))) / (maxRadius * maxRadius * 8))); + double vpteta = fabs (vpalpha - rtengine::RT_PI / 2) < 3e-4 ? 0.0 : acos ((vpdeg > 0 ? 1.0 : -1.0) * sqrt ((-oW * oW * tan (vpalpha) * tan (vpalpha) + (vpdeg > 0 ? 1.0 : -1.0) * oW * tan (vpalpha) * sqrt (16 * maxRadius * maxRadius + oW * oW * tan (vpalpha) * tan (vpalpha))) / (maxRadius * maxRadius * 8))); double vpcospt = (vpdeg >= 0 ? 1.0 : -1.0) * cos (vpteta), vptanpt = tan (vpteta); // auxiliary variables for horizontal perspective correction double hpdeg = params->perspective.horizontal / 100.0 * 45.0; double hpalpha = (90.0 - hpdeg) / 180.0 * rtengine::RT_PI; - double hpteta = fabs(hpalpha - rtengine::RT_PI / 2) < 3e-4 ? 0.0 : acos ((hpdeg > 0 ? 1.0 : -1.0) * sqrt((-oH * oH * tan(hpalpha) * tan(hpalpha) + (hpdeg > 0 ? 1.0 : -1.0) * oH * tan(hpalpha) * sqrt(16 * maxRadius * maxRadius + oH * oH * tan(hpalpha) * tan(hpalpha))) / (maxRadius * maxRadius * 8))); + double hpteta = fabs (hpalpha - rtengine::RT_PI / 2) < 3e-4 ? 0.0 : acos ((hpdeg > 0 ? 1.0 : -1.0) * sqrt ((-oH * oH * tan (hpalpha) * tan (hpalpha) + (hpdeg > 0 ? 1.0 : -1.0) * oH * tan (hpalpha) * sqrt (16 * maxRadius * maxRadius + oH * oH * tan (hpalpha) * tan (hpalpha))) / (maxRadius * maxRadius * 8))); double hpcospt = (hpdeg >= 0 ? 1.0 : -1.0) * cos (hpteta), hptanpt = tan (hpteta); double ascale = ascaleDef > 0 ? ascaleDef : (params->commonTrans.autofill ? getTransformAutoFill (oW, oH, pLCPMap) : 1.0); @@ -155,7 +156,7 @@ bool ImProcFunctions::transCoord (int W, int H, const std::vector &src, double x_d = src[i].x, y_d = src[i].y; if (pLCPMap && params->lensProf.useDist) { - correct_distortion(pLCPMap, x_d, y_d, 0, 0); + correct_distortion (pLCPMap, x_d, y_d, 0, 0); } y_d = ascale * (y_d - h2); @@ -179,25 +180,25 @@ bool ImProcFunctions::transCoord (int W, int H, const std::vector &src, double s = 1; if (needsDist) { - double r = sqrt(Dx * Dx + Dy * Dy) / maxRadius; // sqrt is slow + double r = sqrt (Dx * Dx + Dy * Dy) / maxRadius; // sqrt is slow s = 1.0 - distAmount + distAmount * r ; } // LCP CA is not reflected in preview (and very small), so don't add it here - red.push_back (Coord2D(Dx * (s + params->cacorrection.red) + w2, Dy * (s + params->cacorrection.red) + h2)); - green.push_back (Coord2D(Dx * s + w2, Dy * s + h2)); - blue.push_back (Coord2D(Dx * (s + params->cacorrection.blue) + w2, Dy * (s + params->cacorrection.blue) + h2)); + red.push_back (Coord2D (Dx * (s + params->cacorrection.red) + w2, Dy * (s + params->cacorrection.red) + h2)); + green.push_back (Coord2D (Dx * s + w2, Dy * s + h2)); + blue.push_back (Coord2D (Dx * (s + params->cacorrection.blue) + w2, Dy * (s + params->cacorrection.blue) + h2)); } // Clip all points and track if they were any corrections for (size_t i = 0; i < src.size(); i++) { - red[i].x = CLIPTOC(red[i].x, 0, W - 1, clipped); - red[i].y = CLIPTOC(red[i].y, 0, H - 1, clipped); - green[i].x = CLIPTOC(green[i].x, 0, W - 1, clipped); - green[i].y = CLIPTOC(green[i].y, 0, H - 1, clipped); - blue[i].x = CLIPTOC(blue[i].x, 0, W - 1, clipped); - blue[i].y = CLIPTOC(blue[i].y, 0, H - 1, clipped); + red[i].x = CLIPTOC (red[i].x, 0, W - 1, clipped); + red[i].y = CLIPTOC (red[i].y, 0, H - 1, clipped); + green[i].x = CLIPTOC (green[i].x, 0, W - 1, clipped); + green[i].y = CLIPTOC (green[i].y, 0, H - 1, clipped); + blue[i].x = CLIPTOC (blue[i].x, 0, W - 1, clipped); + blue[i].y = CLIPTOC (blue[i].y, 0, H - 1, clipped); } return clipped; @@ -264,7 +265,7 @@ bool ImProcFunctions::transCoord (int W, int H, int x, int y, int w, int h, int& x1d = transCorners[i].x; } - int x1v = (int)(x1d); + int x1v = (int) (x1d); double y1d = transCorners[0].y; @@ -273,7 +274,7 @@ bool ImProcFunctions::transCoord (int W, int H, int x, int y, int w, int h, int& y1d = transCorners[i].y; } - int y1v = (int)(y1d); + int y1v = (int) (y1d); double x2d = transCorners[0].x; @@ -282,7 +283,7 @@ bool ImProcFunctions::transCoord (int W, int H, int x, int y, int w, int h, int& x2d = transCorners[i].x; } - int x2v = (int)ceil(x2d); + int x2v = (int)ceil (x2d); double y2d = transCorners[0].y; @@ -291,7 +292,7 @@ bool ImProcFunctions::transCoord (int W, int H, int x, int y, int w, int h, int& y2d = transCorners[i].y; } - int y2v = (int)ceil(y2d); + int y2v = (int)ceil (y2d); xv = x1v; yv = y1v; @@ -308,17 +309,17 @@ void ImProcFunctions::transform (Imagefloat* original, Imagefloat* transformed, LCPMapper *pLCPMap = nullptr; if (needsLCP()) { // don't check focal length to allow distortion correction for lenses without chip - LCPProfile *pLCPProf = lcpStore->getProfile(params->lensProf.lcpFile); + LCPProfile *pLCPProf = lcpStore->getProfile (params->lensProf.lcpFile); if (pLCPProf) { - pLCPMap = new LCPMapper(pLCPProf, focalLen, focalLen35mm, - focusDist, 0, false, - params->lensProf.useDist, - oW, oH, params->coarse, rawRotationDeg); + pLCPMap = new LCPMapper (pLCPProf, focalLen, focalLen35mm, + focusDist, 0, false, + params->lensProf.useDist, + oW, oH, params->coarse, rawRotationDeg); } } - if (!(needsCA() || needsDistortion() || needsRotation() || needsPerspective() || needsLCP()) && (needsVignetting() || needsPCVignetting() || needsGradient())) { + if (! (needsCA() || needsDistortion() || needsRotation() || needsPerspective() || needsLCP()) && (needsVignetting() || needsPCVignetting() || needsGradient())) { transformLuminanceOnly (original, transformed, cx, cy, oW, oH, fW, fH); } else if (!needsCA() && scale != 1) { transformPreview (original, transformed, cx, cy, sx, sy, oW, oH, fW, fH, pLCPMap); @@ -332,7 +333,7 @@ void ImProcFunctions::transform (Imagefloat* original, Imagefloat* transformed, } // helper function -void ImProcFunctions::calcVignettingParams(int oW, int oH, const VignettingParams& vignetting, double &w2, double &h2, double& maxRadius, double &v, double &b, double &mul) +void ImProcFunctions::calcVignettingParams (int oW, int oH, const VignettingParams& vignetting, double &w2, double &h2, double& maxRadius, double &v, double &b, double &mul) { // vignette center is a point with coordinates between -1 and +1 double x = vignetting.centerX / 100.0; @@ -343,12 +344,12 @@ void ImProcFunctions::calcVignettingParams(int oW, int oH, const VignettingParam h2 = (double) oH / 2.0 - 0.5 + y * oH; // max vignette radius in pixels - maxRadius = sqrt( (double)( oW * oW + oH * oH ) ) / 2.; + maxRadius = sqrt ( (double) ( oW * oW + oH * oH ) ) / 2.; // vignette variables with applied strength - v = 1.0 + vignetting.strength * fabs(vignetting.amount) * 3.0 / 400.0; + v = 1.0 + vignetting.strength * fabs (vignetting.amount) * 3.0 / 400.0; b = 1.0 + vignetting.radius * 7.0 / 100.0; - mul = (1.0 - v) / tanh(b); + mul = (1.0 - v) / tanh (b); } struct grad_params { @@ -359,7 +360,7 @@ struct grad_params { float top_edge_0; int h; }; -static void calcGradientParams(int oW, int oH, const GradientParams& gradient, struct grad_params& gp) +static void calcGradientParams (int oW, int oH, const GradientParams& gradient, struct grad_params& gp) { int w = oW; int h = oH; @@ -371,7 +372,7 @@ static void calcGradientParams(int oW, int oH, const GradientParams& gradient, s //fprintf(stderr, "%f %f %f %f %f %d %d\n", gradient_stops, gradient_span, gradient_center_x, gradient_center_y, gradient_angle, w, h); // make 0.0 <= gradient_angle < 2 * rtengine::RT_PI - gradient_angle = fmod(gradient_angle, 2 * rtengine::RT_PI); + gradient_angle = fmod (gradient_angle, 2 * rtengine::RT_PI); if (gradient_angle < 0.0) { gradient_angle += 2.0 * rtengine::RT_PI; @@ -381,21 +382,21 @@ static void calcGradientParams(int oW, int oH, const GradientParams& gradient, s gp.transpose = false; gp.angle_is_zero = false; gp.h = h; - double cosgrad = cos(gradient_angle); + double cosgrad = cos (gradient_angle); - if (fabs(cosgrad) < 0.707) { + if (fabs (cosgrad) < 0.707) { // we transpose to avoid division by zero at 90 degrees // (actually we could transpose only for 90 degrees, but this way we avoid // division with extremely small numbers gp.transpose = true; gradient_angle += 0.5 * rtengine::RT_PI; - cosgrad = cos(gradient_angle); + cosgrad = cos (gradient_angle); double gxc = gradient_center_x; gradient_center_x = 1.0 - gradient_center_y; gradient_center_y = gxc; } - gradient_angle = fmod(gradient_angle, 2 * rtengine::RT_PI); + gradient_angle = fmod (gradient_angle, 2 * rtengine::RT_PI); if (gradient_angle > 0.5 * rtengine::RT_PI && gradient_angle < rtengine::RT_PI) { gradient_angle += rtengine::RT_PI; @@ -405,7 +406,7 @@ static void calcGradientParams(int oW, int oH, const GradientParams& gradient, s gp.bright_top = true; } - if (fabs(gradient_angle) < 0.001 || fabs(gradient_angle - 2 * rtengine::RT_PI) < 0.001) { + if (fabs (gradient_angle) < 0.001 || fabs (gradient_angle - 2 * rtengine::RT_PI) < 0.001) { gradient_angle = 0; gp.angle_is_zero = true; } @@ -420,7 +421,7 @@ static void calcGradientParams(int oW, int oH, const GradientParams& gradient, s h = tmp; } - gp.scale = 1.0 / pow(2, gradient_stops); + gp.scale = 1.0 / pow (2, gradient_stops); if (gp.bright_top) { gp.topmul = 1.0; @@ -430,10 +431,10 @@ static void calcGradientParams(int oW, int oH, const GradientParams& gradient, s gp.botmul = 1.0; } - gp.ta = tan(gradient_angle); + gp.ta = tan (gradient_angle); gp.xc = w * gradient_center_x; gp.yc = h * gradient_center_y; - gp.ys = sqrt((float)h * h + (float)w * w) * (gradient_span / cos(gradient_angle)); + gp.ys = sqrt ((float)h * h + (float)w * w) * (gradient_span / cos (gradient_angle)); gp.ys_inv = 1.0 / gp.ys; gp.top_edge_0 = gp.yc - gp.ys / 2.0; @@ -443,18 +444,17 @@ static void calcGradientParams(int oW, int oH, const GradientParams& gradient, s } } -static float calcGradientFactor(const struct grad_params& gp, int x, int y) +static float calcGradientFactor (const struct grad_params& gp, int x, int y) { if (gp.angle_is_zero) { int gy = gp.transpose ? x : y; - int gx = gp.transpose ? y : x; if (gy < gp.top_edge_0) { return gp.topmul; } else if (gy >= gp.top_edge_0 + gp.ys) { return gp.botmul; } else { - float val = ((float)(gy - gp.top_edge_0) * gp.ys_inv); + float val = ((float) (gy - gp.top_edge_0) * gp.ys_inv); if (gp.bright_top) { val = 1.f - val; @@ -463,9 +463,9 @@ static float calcGradientFactor(const struct grad_params& gp, int x, int y) val *= rtengine::RT_PI_F_2; if (gp.scale < 1.f) { - val = pow3(xsinf(val)); + val = pow3 (xsinf (val)); } else { - val = 1.f - pow3(xcosf(val)); + val = 1.f - pow3 (xcosf (val)); } return gp.scale + val * (1.0 - gp.scale); @@ -480,16 +480,16 @@ static float calcGradientFactor(const struct grad_params& gp, int x, int y) } else if (gy >= top_edge + gp.ys) { return gp.botmul; } else { - float val = ((float)(gy - top_edge) * gp.ys_inv); + float val = ((float) (gy - top_edge) * gp.ys_inv); val = gp.bright_top ? 1.f - val : val; val *= rtengine::RT_PI_F_2; if (gp.scale < 1.f) { - val = pow3(xsinf(val)); + val = pow3 (xsinf (val)); } else { - val = 1.f - pow3(xcosf(val)); + val = 1.f - pow3 (xcosf (val)); } return gp.scale + val * (1.0 - gp.scale); @@ -507,7 +507,7 @@ struct pcv_params { float scale; float fadeout_mul; }; -static void calcPCVignetteParams(int fW, int fH, int oW, int oH, const PCVignetteParams& pcvignette, const CropParams &crop, struct pcv_params& pcv) +static void calcPCVignetteParams (int fW, int fH, int oW, int oH, const PCVignetteParams& pcvignette, const CropParams &crop, struct pcv_params& pcv) { // ellipse formula: (x/a)^2 + (y/b)^2 = 1 @@ -528,49 +528,49 @@ static void calcPCVignetteParams(int fW, int fH, int oW, int oH, const PCVignett pcv.h = oH; } - pcv.fadeout_mul = 1.0 / (0.05 * sqrtf(oW * oW + oH * oH)); + pcv.fadeout_mul = 1.0 / (0.05 * sqrtf (oW * oW + oH * oH)); float short_side = (pcv.w < pcv.h) ? pcv.w : pcv.h; float long_side = (pcv.w > pcv.h) ? pcv.w : pcv.h; pcv.sep = 2; pcv.sepmix = 0; - pcv.oe_a = sqrt(2.0) * long_side * 0.5; + pcv.oe_a = sqrt (2.0) * long_side * 0.5; pcv.oe_b = pcv.oe_a * short_side / long_side; - pcv.ie_mul = (1.0 / sqrt(2.0)) * (1.0 - pcv.feather); + pcv.ie_mul = (1.0 / sqrt (2.0)) * (1.0 - pcv.feather); pcv.is_super_ellipse_mode = false; pcv.is_portrait = (pcv.w < pcv.h); if (roundness < 0.5) { // make super-ellipse of higher and higher degree pcv.is_super_ellipse_mode = true; - float sepf = 2 + 4 * powf(1.0 - 2 * roundness, 1.3); // gamma 1.3 used to balance the effect in the 0.0...0.5 roundness range + float sepf = 2 + 4 * powf (1.0 - 2 * roundness, 1.3); // gamma 1.3 used to balance the effect in the 0.0...0.5 roundness range pcv.sep = ((int)sepf) & ~0x1; pcv.sepmix = (sepf - pcv.sep) * 0.5; // 0.0 to 1.0 - pcv.oe1_a = powf(2.0, 1.0 / pcv.sep) * long_side * 0.5; + pcv.oe1_a = powf (2.0, 1.0 / pcv.sep) * long_side * 0.5; pcv.oe1_b = pcv.oe1_a * short_side / long_side; - pcv.ie1_mul = (1.0 / powf(2.0, 1.0 / pcv.sep)) * (1.0 - pcv.feather); - pcv.oe2_a = powf(2.0, 1.0 / (pcv.sep + 2)) * long_side * 0.5; + pcv.ie1_mul = (1.0 / powf (2.0, 1.0 / pcv.sep)) * (1.0 - pcv.feather); + pcv.oe2_a = powf (2.0, 1.0 / (pcv.sep + 2)) * long_side * 0.5; pcv.oe2_b = pcv.oe2_a * short_side / long_side; - pcv.ie2_mul = (1.0 / powf(2.0, 1.0 / (pcv.sep + 2))) * (1.0 - pcv.feather); + pcv.ie2_mul = (1.0 / powf (2.0, 1.0 / (pcv.sep + 2))) * (1.0 - pcv.feather); } if (roundness > 0.5) { // scale from fitted ellipse towards circle - float rad = sqrtf(pcv.w * pcv.w + pcv.h * pcv.h) / 2.0; + float rad = sqrtf (pcv.w * pcv.w + pcv.h * pcv.h) / 2.0; float diff_a = rad - pcv.oe_a; float diff_b = rad - pcv.oe_b; pcv.oe_a = pcv.oe_a + diff_a * 2 * (roundness - 0.5); pcv.oe_b = pcv.oe_b + diff_b * 2 * (roundness - 0.5); } - pcv.scale = powf(2, -pcvignette.strength); + pcv.scale = powf (2, -pcvignette.strength); if (pcvignette.strength >= 6.0) { pcv.scale = 0.0; } } -static float calcPCVignetteFactor(const struct pcv_params& pcv, int x, int y) +static float calcPCVignetteFactor (const struct pcv_params& pcv, int x, int y) { float fo = 1.f; @@ -592,25 +592,25 @@ static float calcPCVignetteFactor(const struct pcv_params& pcv, int x, int y) dist_y = 0; } - fo = sqrtf(dist_x * dist_x + dist_y * dist_y) * pcv.fadeout_mul; + fo = sqrtf (dist_x * dist_x + dist_y * dist_y) * pcv.fadeout_mul; if (fo >= 1.f) { return 1.f; } } - float a = fabs((x - pcv.x1) - pcv.w * 0.5f); - float b = fabs((y - pcv.y1) - pcv.h * 0.5f); + float a = fabs ((x - pcv.x1) - pcv.w * 0.5f); + float b = fabs ((y - pcv.y1) - pcv.h * 0.5f); - if(pcv.is_portrait) { - std::swap(a, b); + if (pcv.is_portrait) { + std::swap (a, b); } - float dist = normn(a, b, 2); + float dist = normn (a, b, 2); float dist_oe, dist_ie; float2 sincosval; - if(dist == 0.0f) { + if (dist == 0.0f) { sincosval.y = 1.0f; // cos sincosval.x = 0.0f; // sin } else { @@ -619,14 +619,14 @@ static float calcPCVignetteFactor(const struct pcv_params& pcv, int x, int y) } if (pcv.is_super_ellipse_mode) { - float dist_oe1 = pcv.oe1_a * pcv.oe1_b / normn(pcv.oe1_b * sincosval.y, pcv.oe1_a * sincosval.x, pcv.sep); - float dist_oe2 = pcv.oe2_a * pcv.oe2_b / normn(pcv.oe2_b * sincosval.y, pcv.oe2_a * sincosval.x, pcv.sep + 2); + float dist_oe1 = pcv.oe1_a * pcv.oe1_b / normn (pcv.oe1_b * sincosval.y, pcv.oe1_a * sincosval.x, pcv.sep); + float dist_oe2 = pcv.oe2_a * pcv.oe2_b / normn (pcv.oe2_b * sincosval.y, pcv.oe2_a * sincosval.x, pcv.sep + 2); float dist_ie1 = pcv.ie1_mul * dist_oe1; float dist_ie2 = pcv.ie2_mul * dist_oe2; dist_oe = dist_oe1 * (1.f - pcv.sepmix) + dist_oe2 * pcv.sepmix; dist_ie = dist_ie1 * (1.f - pcv.sepmix) + dist_ie2 * pcv.sepmix; } else { - dist_oe = pcv.oe_a * pcv.oe_b / sqrtf(SQR(pcv.oe_b * sincosval.y) + SQR(pcv.oe_a * sincosval.x)); + dist_oe = pcv.oe_a * pcv.oe_b / sqrtf (SQR (pcv.oe_b * sincosval.y) + SQR (pcv.oe_a * sincosval.x)); dist_ie = pcv.ie_mul * dist_oe; } @@ -642,9 +642,9 @@ static float calcPCVignetteFactor(const struct pcv_params& pcv, int x, int y) val = rtengine::RT_PI_F_2 * (dist - dist_ie) / (dist_oe - dist_ie); if (pcv.scale < 1.f) { - val = pow4(xcosf(val)); + val = pow4 (xcosf (val)); } else { - val = 1 - pow4(xsinf(val)); + val = 1 - pow4 (xsinf (val)); } val = pcv.scale + val * (1.f - pcv.scale); @@ -667,20 +667,20 @@ void ImProcFunctions::transformLuminanceOnly (Imagefloat* original, Imagefloat* double vig_w2, vig_h2, maxRadius, v, b, mul; if (applyVignetting) { - calcVignettingParams(oW, oH, params->vignetting, vig_w2, vig_h2, maxRadius, v, b, mul); + calcVignettingParams (oW, oH, params->vignetting, vig_w2, vig_h2, maxRadius, v, b, mul); } struct grad_params gp; if (applyGradient) { - calcGradientParams(oW, oH, params->gradient, gp); + calcGradientParams (oW, oH, params->gradient, gp); } struct pcv_params pcv; if (applyPCVignetting) { //fprintf(stderr, "%d %d | %d %d | %d %d | %d %d [%d %d]\n", fW, fH, oW, oH, transformed->getWidth(), transformed->getHeight(), cx, cy, params->crop.w, params->crop.h); - calcPCVignetteParams(fW, fH, oW, oH, params->pcvignette, params->crop, pcv); + calcPCVignetteParams (fW, fH, oW, oH, params->pcvignette, params->crop, pcv); } bool darkening = (params->vignetting.amount <= 0.0); @@ -694,26 +694,26 @@ void ImProcFunctions::transformLuminanceOnly (Imagefloat* original, Imagefloat* if (applyVignetting) { double vig_x_d = (double) (x + cx) - vig_w2 ; - double r = sqrt(vig_x_d * vig_x_d + vig_y_d * vig_y_d); + double r = sqrt (vig_x_d * vig_x_d + vig_y_d * vig_y_d); - if(darkening) { - factor /= std::max(v + mul * tanh (b * (maxRadius - r) / maxRadius), 0.001); + if (darkening) { + factor /= std::max (v + mul * tanh (b * (maxRadius - r) / maxRadius), 0.001); } else { factor = v + mul * tanh (b * (maxRadius - r) / maxRadius); } } if (applyGradient) { - factor *= calcGradientFactor(gp, cx + x, cy + y); + factor *= calcGradientFactor (gp, cx + x, cy + y); } if (applyPCVignetting) { - factor *= calcPCVignetteFactor(pcv, cx + x, cy + y); + factor *= calcPCVignetteFactor (pcv, cx + x, cy + y); } - transformed->r(y, x) = original->r(y, x) * factor; - transformed->g(y, x) = original->g(y, x) * factor; - transformed->b(y, x) = original->b(y, x) * factor; + transformed->r (y, x) = original->r (y, x) * factor; + transformed->g (y, x) = original->g (y, x) * factor; + transformed->b (y, x) = original->b (y, x) * factor; } } } @@ -726,18 +726,18 @@ void ImProcFunctions::transformHighQuality (Imagefloat* original, Imagefloat* tr double h2 = (double) oH / 2.0 - 0.5; double vig_w2, vig_h2, maxRadius, v, b, mul; - calcVignettingParams(oW, oH, params->vignetting, vig_w2, vig_h2, maxRadius, v, b, mul); + calcVignettingParams (oW, oH, params->vignetting, vig_w2, vig_h2, maxRadius, v, b, mul); struct grad_params gp; if (needsGradient()) { - calcGradientParams(oW, oH, params->gradient, gp); + calcGradientParams (oW, oH, params->gradient, gp); } struct pcv_params pcv; if (needsPCVignetting()) { - calcPCVignetteParams(fW, fH, oW, oH, params->pcvignette, params->crop, pcv); + calcPCVignetteParams (fW, fH, oW, oH, params->pcvignette, params->crop, pcv); } float** chOrig[3]; @@ -761,21 +761,21 @@ void ImProcFunctions::transformHighQuality (Imagefloat* original, Imagefloat* tr double distAmount = params->distortion.amount; // auxiliary variables for rotation - double cost = cos(params->rotate.degree * rtengine::RT_PI / 180.0); - double sint = sin(params->rotate.degree * rtengine::RT_PI / 180.0); + double cost = cos (params->rotate.degree * rtengine::RT_PI / 180.0); + double sint = sin (params->rotate.degree * rtengine::RT_PI / 180.0); // auxiliary variables for vertical perspective correction double vpdeg = params->perspective.vertical / 100.0 * 45.0; double vpalpha = (90.0 - vpdeg) / 180.0 * rtengine::RT_PI; - double vpteta = fabs(vpalpha - rtengine::RT_PI / 2) < 3e-4 ? 0.0 : acos ((vpdeg > 0 ? 1.0 : -1.0) * sqrt((-SQR(oW * tan(vpalpha)) + (vpdeg > 0 ? 1.0 : -1.0) * - oW * tan(vpalpha) * sqrt(SQR(4 * maxRadius) + SQR(oW * tan(vpalpha)))) / (SQR(maxRadius) * 8))); + double vpteta = fabs (vpalpha - rtengine::RT_PI / 2) < 3e-4 ? 0.0 : acos ((vpdeg > 0 ? 1.0 : -1.0) * sqrt ((-SQR (oW * tan (vpalpha)) + (vpdeg > 0 ? 1.0 : -1.0) * + oW * tan (vpalpha) * sqrt (SQR (4 * maxRadius) + SQR (oW * tan (vpalpha)))) / (SQR (maxRadius) * 8))); double vpcospt = (vpdeg >= 0 ? 1.0 : -1.0) * cos (vpteta), vptanpt = tan (vpteta); // auxiliary variables for horizontal perspective correction double hpdeg = params->perspective.horizontal / 100.0 * 45.0; double hpalpha = (90.0 - hpdeg) / 180.0 * rtengine::RT_PI; - double hpteta = fabs(hpalpha - rtengine::RT_PI / 2) < 3e-4 ? 0.0 : acos ((hpdeg > 0 ? 1.0 : -1.0) * sqrt((-SQR(oH * tan(hpalpha)) + (hpdeg > 0 ? 1.0 : -1.0) * - oH * tan(hpalpha) * sqrt(SQR(4 * maxRadius) + SQR(oH * tan(hpalpha)))) / (SQR(maxRadius) * 8))); + double hpteta = fabs (hpalpha - rtengine::RT_PI / 2) < 3e-4 ? 0.0 : acos ((hpdeg > 0 ? 1.0 : -1.0) * sqrt ((-SQR (oH * tan (hpalpha)) + (hpdeg > 0 ? 1.0 : -1.0) * + oH * tan (hpalpha) * sqrt (SQR (4 * maxRadius) + SQR (oH * tan (hpalpha)))) / (SQR (maxRadius) * 8))); double hpcospt = (hpdeg >= 0 ? 1.0 : -1.0) * cos (hpteta), hptanpt = tan (hpteta); double ascale = params->commonTrans.autofill ? getTransformAutoFill (oW, oH, true /*fullImage*/ ? pLCPMap : nullptr) : 1.0; @@ -799,13 +799,13 @@ void ImProcFunctions::transformHighQuality (Imagefloat* original, Imagefloat* tr double x_d = x, y_d = y; if (enableLCPDist) { - correct_distortion(pLCPMap, x_d, y_d, cx, cy); // must be first transform + correct_distortion (pLCPMap, x_d, y_d, cx, cy); // must be first transform } x_d = ascale * (x_d + cx - w2); // centering x coord & scale y_d = ascale * (y_d + cy - h2); // centering y coord & scale - double vig_x_d, vig_y_d; + double vig_x_d = 0., vig_y_d = 0.; if (needsVignetting()) { vig_x_d = ascale * (x + cx - vig_w2); // centering x coord & scale @@ -830,16 +830,16 @@ void ImProcFunctions::transformHighQuality (Imagefloat* original, Imagefloat* tr double s = 1; if (needsDist) { - double r = sqrt(Dxc * Dxc + Dyc * Dyc) / maxRadius; // sqrt is slow + double r = sqrt (Dxc * Dxc + Dyc * Dyc) / maxRadius; // sqrt is slow s = 1.0 - distAmount + distAmount * r ; } - double r2; + double r2 = 0.; if (needsVignetting()) { double vig_Dx = vig_x_d * cost - vig_y_d * sint; double vig_Dy = vig_x_d * sint + vig_y_d * cost; - r2 = sqrt(vig_Dx * vig_Dx + vig_Dy * vig_Dy); + r2 = sqrt (vig_Dx * vig_Dx + vig_Dy * vig_Dy); } for (int c = 0; c < (enableCA ? 3 : 1); c++) { @@ -852,7 +852,7 @@ void ImProcFunctions::transformHighQuality (Imagefloat* original, Imagefloat* tr // LCP CA if (enableLCPCA) { - pLCPMap->correctCA(Dx, Dy, c); + pLCPMap->correctCA (Dx, Dy, c); } // Extract integer and fractions of source screen coordinates @@ -870,41 +870,41 @@ void ImProcFunctions::transformHighQuality (Imagefloat* original, Imagefloat* tr double vignmul = 1.0; if (needsVignetting()) { - if(darkening) { - vignmul /= std::max(v + mul * tanh (b * (maxRadius - s * r2) / maxRadius), 0.001); + if (darkening) { + vignmul /= std::max (v + mul * tanh (b * (maxRadius - s * r2) / maxRadius), 0.001); } else { vignmul *= (v + mul * tanh (b * (maxRadius - s * r2) / maxRadius)); } } if (needsGradient()) { - vignmul *= calcGradientFactor(gp, cx + x, cy + y); + vignmul *= calcGradientFactor (gp, cx + x, cy + y); } if (needsPCVignetting()) { - vignmul *= calcPCVignetteFactor(pcv, cx + x, cy + y); + vignmul *= calcPCVignetteFactor (pcv, cx + x, cy + y); } if (yc > 0 && yc < original->getHeight() - 2 && xc > 0 && xc < original->getWidth() - 2) { // all interpolation pixels inside image if (enableCA) { - interpolateTransformChannelsCubic (chOrig[c], xc - 1, yc - 1, Dx, Dy, &(chTrans[c][y][x]), vignmul); + interpolateTransformChannelsCubic (chOrig[c], xc - 1, yc - 1, Dx, Dy, & (chTrans[c][y][x]), vignmul); } else { - interpolateTransformCubic (original, xc - 1, yc - 1, Dx, Dy, &(transformed->r(y, x)), &(transformed->g(y, x)), &(transformed->b(y, x)), vignmul); + interpolateTransformCubic (original, xc - 1, yc - 1, Dx, Dy, & (transformed->r (y, x)), & (transformed->g (y, x)), & (transformed->b (y, x)), vignmul); } } else { // edge pixels - int y1 = LIM(yc, 0, original->getHeight() - 1); - int y2 = LIM(yc + 1, 0, original->getHeight() - 1); - int x1 = LIM(xc, 0, original->getWidth() - 1); - int x2 = LIM(xc + 1, 0, original->getWidth() - 1); + int y1 = LIM (yc, 0, original->getHeight() - 1); + int y2 = LIM (yc + 1, 0, original->getHeight() - 1); + int x1 = LIM (xc, 0, original->getWidth() - 1); + int x2 = LIM (xc + 1, 0, original->getWidth() - 1); if (enableCA) { chTrans[c][y][x] = vignmul * (chOrig[c][y1][x1] * (1.0 - Dx) * (1.0 - Dy) + chOrig[c][y1][x2] * Dx * (1.0 - Dy) + chOrig[c][y2][x1] * (1.0 - Dx) * Dy + chOrig[c][y2][x2] * Dx * Dy); } else { - transformed->r(y, x) = vignmul * (original->r(y1, x1) * (1.0 - Dx) * (1.0 - Dy) + original->r(y1, x2) * Dx * (1.0 - Dy) + original->r(y2, x1) * (1.0 - Dx) * Dy + original->r(y2, x2) * Dx * Dy); - transformed->g(y, x) = vignmul * (original->g(y1, x1) * (1.0 - Dx) * (1.0 - Dy) + original->g(y1, x2) * Dx * (1.0 - Dy) + original->g(y2, x1) * (1.0 - Dx) * Dy + original->g(y2, x2) * Dx * Dy); - transformed->b(y, x) = vignmul * (original->b(y1, x1) * (1.0 - Dx) * (1.0 - Dy) + original->b(y1, x2) * Dx * (1.0 - Dy) + original->b(y2, x1) * (1.0 - Dx) * Dy + original->b(y2, x2) * Dx * Dy); + transformed->r (y, x) = vignmul * (original->r (y1, x1) * (1.0 - Dx) * (1.0 - Dy) + original->r (y1, x2) * Dx * (1.0 - Dy) + original->r (y2, x1) * (1.0 - Dx) * Dy + original->r (y2, x2) * Dx * Dy); + transformed->g (y, x) = vignmul * (original->g (y1, x1) * (1.0 - Dx) * (1.0 - Dy) + original->g (y1, x2) * Dx * (1.0 - Dy) + original->g (y2, x1) * (1.0 - Dx) * Dy + original->g (y2, x2) * Dx * Dy); + transformed->b (y, x) = vignmul * (original->b (y1, x1) * (1.0 - Dx) * (1.0 - Dy) + original->b (y1, x2) * Dx * (1.0 - Dy) + original->b (y2, x1) * (1.0 - Dx) * Dy + original->b (y2, x2) * Dx * Dy); } } } else { @@ -912,9 +912,9 @@ void ImProcFunctions::transformHighQuality (Imagefloat* original, Imagefloat* tr // not valid (source pixel x,y not inside source image, etc.) chTrans[c][y][x] = 0; } else { - transformed->r(y, x) = 0; - transformed->g(y, x) = 0; - transformed->b(y, x) = 0; + transformed->r (y, x) = 0; + transformed->g (y, x) = 0; + transformed->b (y, x) = 0; } } } @@ -930,18 +930,18 @@ void ImProcFunctions::transformPreview (Imagefloat* original, Imagefloat* transf double h2 = (double) oH / 2.0 - 0.5; double vig_w2, vig_h2, maxRadius, v, b, mul; - calcVignettingParams(oW, oH, params->vignetting, vig_w2, vig_h2, maxRadius, v, b, mul); + calcVignettingParams (oW, oH, params->vignetting, vig_w2, vig_h2, maxRadius, v, b, mul); struct grad_params gp; if (needsGradient()) { - calcGradientParams(oW, oH, params->gradient, gp); + calcGradientParams (oW, oH, params->gradient, gp); } struct pcv_params pcv; if (needsPCVignetting()) { - calcPCVignetteParams(fW, fH, oW, oH, params->pcvignette, params->crop, pcv); + calcPCVignetteParams (fW, fH, oW, oH, params->pcvignette, params->crop, pcv); } // auxiliary variables for distortion correction @@ -949,19 +949,19 @@ void ImProcFunctions::transformPreview (Imagefloat* original, Imagefloat* transf double distAmount = params->distortion.amount; // auxiliary variables for rotation - double cost = cos(params->rotate.degree * rtengine::RT_PI / 180.0); - double sint = sin(params->rotate.degree * rtengine::RT_PI / 180.0); + double cost = cos (params->rotate.degree * rtengine::RT_PI / 180.0); + double sint = sin (params->rotate.degree * rtengine::RT_PI / 180.0); // auxiliary variables for vertical perspective correction double vpdeg = params->perspective.vertical / 100.0 * 45.0; double vpalpha = (90 - vpdeg) / 180.0 * rtengine::RT_PI; - double vpteta = fabs(vpalpha - rtengine::RT_PI / 2) < 3e-4 ? 0.0 : acos ((vpdeg > 0 ? 1.0 : -1.0) * sqrt((-oW * oW * tan(vpalpha) * tan(vpalpha) + (vpdeg > 0 ? 1.0 : -1.0) * oW * tan(vpalpha) * sqrt(16 * maxRadius * maxRadius + oW * oW * tan(vpalpha) * tan(vpalpha))) / (maxRadius * maxRadius * 8))); + double vpteta = fabs (vpalpha - rtengine::RT_PI / 2) < 3e-4 ? 0.0 : acos ((vpdeg > 0 ? 1.0 : -1.0) * sqrt ((-oW * oW * tan (vpalpha) * tan (vpalpha) + (vpdeg > 0 ? 1.0 : -1.0) * oW * tan (vpalpha) * sqrt (16 * maxRadius * maxRadius + oW * oW * tan (vpalpha) * tan (vpalpha))) / (maxRadius * maxRadius * 8))); double vpcospt = (vpdeg >= 0 ? 1.0 : -1.0) * cos (vpteta), vptanpt = tan (vpteta); // auxiliary variables for horizontal perspective correction double hpdeg = params->perspective.horizontal / 100.0 * 45.0; double hpalpha = (90 - hpdeg) / 180.0 * rtengine::RT_PI; - double hpteta = fabs(hpalpha - rtengine::RT_PI / 2) < 3e-4 ? 0.0 : acos ((hpdeg > 0 ? 1.0 : -1.0) * sqrt((-oH * oH * tan(hpalpha) * tan(hpalpha) + (hpdeg > 0 ? 1.0 : -1.0) * oH * tan(hpalpha) * sqrt(16 * maxRadius * maxRadius + oH * oH * tan(hpalpha) * tan(hpalpha))) / (maxRadius * maxRadius * 8))); + double hpteta = fabs (hpalpha - rtengine::RT_PI / 2) < 3e-4 ? 0.0 : acos ((hpdeg > 0 ? 1.0 : -1.0) * sqrt ((-oH * oH * tan (hpalpha) * tan (hpalpha) + (hpdeg > 0 ? 1.0 : -1.0) * oH * tan (hpalpha) * sqrt (16 * maxRadius * maxRadius + oH * oH * tan (hpalpha) * tan (hpalpha))) / (maxRadius * maxRadius * 8))); double hpcospt = (hpdeg >= 0 ? 1.0 : -1.0) * cos (hpteta), hptanpt = tan (hpteta); double ascale = params->commonTrans.autofill ? getTransformAutoFill (oW, oH, pLCPMap) : 1.0; @@ -976,13 +976,13 @@ void ImProcFunctions::transformPreview (Imagefloat* original, Imagefloat* transf double x_d = x, y_d = y; if (pLCPMap && params->lensProf.useDist) { - correct_distortion(pLCPMap, x_d, y_d, cx, cy); // must be first transform + correct_distortion (pLCPMap, x_d, y_d, cx, cy); // must be first transform } y_d = ascale * (y_d + cy - h2); // centering y coord & scale x_d = ascale * (x_d + cx - w2); // centering x coord & scale - double vig_x_d, vig_y_d; + double vig_x_d = 0., vig_y_d = 0.; if (needsVignetting()) { vig_x_d = ascale * (x + cx - vig_w2); // centering x coord & scale @@ -1007,18 +1007,18 @@ void ImProcFunctions::transformPreview (Imagefloat* original, Imagefloat* transf double s = 1; if (needsDist) { - double r = sqrt(Dx * Dx + Dy * Dy) / maxRadius; // sqrt is slow + double r = sqrt (Dx * Dx + Dy * Dy) / maxRadius; // sqrt is slow s = 1.0 - distAmount + distAmount * r ; Dx *= s; Dy *= s; } - double r2; + double r2 = 0.; if (needsVignetting()) { double vig_Dx = vig_x_d * cost - vig_y_d * sint; double vig_Dy = vig_x_d * sint + vig_y_d * cost; - r2 = sqrt(vig_Dx * vig_Dx + vig_Dy * vig_Dy); + r2 = sqrt (vig_Dx * vig_Dx + vig_Dy * vig_Dy); } // de-center @@ -1040,41 +1040,41 @@ void ImProcFunctions::transformPreview (Imagefloat* original, Imagefloat* transf double vignmul = 1.0; if (needsVignetting()) { - if(darkening) { - vignmul /= std::max(v + mul * tanh (b * (maxRadius - s * r2) / maxRadius), 0.001); + if (darkening) { + vignmul /= std::max (v + mul * tanh (b * (maxRadius - s * r2) / maxRadius), 0.001); } else { vignmul = v + mul * tanh (b * (maxRadius - s * r2) / maxRadius); } } if (needsGradient()) { - vignmul *= calcGradientFactor(gp, cx + x, cy + y); + vignmul *= calcGradientFactor (gp, cx + x, cy + y); } if (needsPCVignetting()) { - vignmul *= calcPCVignetteFactor(pcv, cx + x, cy + y); + vignmul *= calcPCVignetteFactor (pcv, cx + x, cy + y); } if (yc < original->getHeight() - 1 && xc < original->getWidth() - 1) { // all interpolation pixels inside image - transformed->r(y, x) = vignmul * (original->r(yc, xc) * (1.0 - Dx) * (1.0 - Dy) + original->r(yc, xc + 1) * Dx * (1.0 - Dy) + original->r(yc + 1, xc) * (1.0 - Dx) * Dy + original->r(yc + 1, xc + 1) * Dx * Dy); - transformed->g(y, x) = vignmul * (original->g(yc, xc) * (1.0 - Dx) * (1.0 - Dy) + original->g(yc, xc + 1) * Dx * (1.0 - Dy) + original->g(yc + 1, xc) * (1.0 - Dx) * Dy + original->g(yc + 1, xc + 1) * Dx * Dy); - transformed->b(y, x) = vignmul * (original->b(yc, xc) * (1.0 - Dx) * (1.0 - Dy) + original->b(yc, xc + 1) * Dx * (1.0 - Dy) + original->b(yc + 1, xc) * (1.0 - Dx) * Dy + original->b(yc + 1, xc + 1) * Dx * Dy); + transformed->r (y, x) = vignmul * (original->r (yc, xc) * (1.0 - Dx) * (1.0 - Dy) + original->r (yc, xc + 1) * Dx * (1.0 - Dy) + original->r (yc + 1, xc) * (1.0 - Dx) * Dy + original->r (yc + 1, xc + 1) * Dx * Dy); + transformed->g (y, x) = vignmul * (original->g (yc, xc) * (1.0 - Dx) * (1.0 - Dy) + original->g (yc, xc + 1) * Dx * (1.0 - Dy) + original->g (yc + 1, xc) * (1.0 - Dx) * Dy + original->g (yc + 1, xc + 1) * Dx * Dy); + transformed->b (y, x) = vignmul * (original->b (yc, xc) * (1.0 - Dx) * (1.0 - Dy) + original->b (yc, xc + 1) * Dx * (1.0 - Dy) + original->b (yc + 1, xc) * (1.0 - Dx) * Dy + original->b (yc + 1, xc + 1) * Dx * Dy); } else { // edge pixels - int y1 = LIM(yc, 0, original->getHeight() - 1); - int y2 = LIM(yc + 1, 0, original->getHeight() - 1); - int x1 = LIM(xc, 0, original->getWidth() - 1); - int x2 = LIM(xc + 1, 0, original->getWidth() - 1); - transformed->r(y, x) = vignmul * (original->r(y1, x1) * (1.0 - Dx) * (1.0 - Dy) + original->r(y1, x2) * Dx * (1.0 - Dy) + original->r(y2, x1) * (1.0 - Dx) * Dy + original->r(y2, x2) * Dx * Dy); - transformed->g(y, x) = vignmul * (original->g(y1, x1) * (1.0 - Dx) * (1.0 - Dy) + original->g(y1, x2) * Dx * (1.0 - Dy) + original->g(y2, x1) * (1.0 - Dx) * Dy + original->g(y2, x2) * Dx * Dy); - transformed->b(y, x) = vignmul * (original->b(y1, x1) * (1.0 - Dx) * (1.0 - Dy) + original->b(y1, x2) * Dx * (1.0 - Dy) + original->b(y2, x1) * (1.0 - Dx) * Dy + original->b(y2, x2) * Dx * Dy); + int y1 = LIM (yc, 0, original->getHeight() - 1); + int y2 = LIM (yc + 1, 0, original->getHeight() - 1); + int x1 = LIM (xc, 0, original->getWidth() - 1); + int x2 = LIM (xc + 1, 0, original->getWidth() - 1); + transformed->r (y, x) = vignmul * (original->r (y1, x1) * (1.0 - Dx) * (1.0 - Dy) + original->r (y1, x2) * Dx * (1.0 - Dy) + original->r (y2, x1) * (1.0 - Dx) * Dy + original->r (y2, x2) * Dx * Dy); + transformed->g (y, x) = vignmul * (original->g (y1, x1) * (1.0 - Dx) * (1.0 - Dy) + original->g (y1, x2) * Dx * (1.0 - Dy) + original->g (y2, x1) * (1.0 - Dx) * Dy + original->g (y2, x2) * Dx * Dy); + transformed->b (y, x) = vignmul * (original->b (y1, x1) * (1.0 - Dx) * (1.0 - Dy) + original->b (y1, x2) * Dx * (1.0 - Dy) + original->b (y2, x1) * (1.0 - Dx) * Dy + original->b (y2, x2) * Dx * Dy); } } else { // not valid (source pixel x,y not inside source image, etc.) - transformed->r(y, x) = 0; - transformed->g(y, x) = 0; - transformed->b(y, x) = 0; + transformed->r (y, x) = 0; + transformed->g (y, x) = 0; + transformed->b (y, x) = 0; } } } @@ -1126,12 +1126,12 @@ bool ImProcFunctions::needsPerspective () bool ImProcFunctions::needsGradient () { - return params->gradient.enabled && fabs(params->gradient.strength) > 1e-15; + return params->gradient.enabled && fabs (params->gradient.strength) > 1e-15; } bool ImProcFunctions::needsPCVignetting () { - return params->pcvignette.enabled && fabs(params->pcvignette.strength) > 1e-15; + return params->pcvignette.enabled && fabs (params->pcvignette.strength) > 1e-15; } bool ImProcFunctions::needsVignetting () diff --git a/rtengine/ipvibrance.cc b/rtengine/ipvibrance.cc index 8eb565434..49f956602 100644 --- a/rtengine/ipvibrance.cc +++ b/rtengine/ipvibrance.cc @@ -33,6 +33,7 @@ #include #endif + using namespace std; namespace rtengine @@ -44,7 +45,7 @@ using namespace procparams; extern const Settings* settings; -void fillCurveArrayVib(DiagonalCurve* diagCurve, LUTf &outCurve) +void fillCurveArrayVib (DiagonalCurve* diagCurve, LUTf &outCurve) { if (diagCurve) { @@ -56,7 +57,7 @@ void fillCurveArrayVib(DiagonalCurve* diagCurve, LUTf &outCurve) // change to [0,1] range // apply custom/parametric/NURBS curve, if any // and store result in a temporary array - outCurve[i] = 65535.f * diagCurve->getVal( double(i) / 65535.0 ); + outCurve[i] = 65535.f * diagCurve->getVal ( double (i) / 65535.0 ); } } else { outCurve.makeIdentity(); @@ -111,8 +112,8 @@ void ImProcFunctions::vibrance (LabImage* lab) // I use diagonal because I think it's better LUTf skin_curve (65536, 0); - if(skinCurveIsSet) { - fillCurveArrayVib(dcurve, skin_curve); + if (skinCurveIsSet) { + fillCurveArrayVib (dcurve, skin_curve); } if (dcurve) { @@ -123,10 +124,10 @@ void ImProcFunctions::vibrance (LabImage* lab) // skin_curve.dump("skin_curve"); - const float chromaPastel = float(params->vibrance.pastels) / 100.0f; - const float chromaSatur = float(params->vibrance.saturated) / 100.0f; + const float chromaPastel = float (params->vibrance.pastels) / 100.0f; + const float chromaSatur = float (params->vibrance.saturated) / 100.0f; const float p00 = 0.07f; - const float limitpastelsatur = (static_cast(params->vibrance.psthreshold.value[ThresholdSelector::TS_TOPLEFT]) / 100.0f) * (1.0f - p00) + p00; + const float limitpastelsatur = (static_cast (params->vibrance.psthreshold.value[ThresholdSelector::TS_TOPLEFT]) / 100.0f) * (1.0f - p00) + p00; const float maxdp = (limitpastelsatur - p00) / 4.0f; const float maxds = (1.0 - limitpastelsatur) / 4.0f; const float p0 = p00 + maxdp; @@ -135,10 +136,10 @@ void ImProcFunctions::vibrance (LabImage* lab) const float s0 = limitpastelsatur + maxds; const float s1 = limitpastelsatur + 2.0f * maxds; const float s2 = limitpastelsatur + 3.0f * maxds; - const float transitionweighting = static_cast(params->vibrance.psthreshold.value[ThresholdSelector::TS_BOTTOMLEFT]) / 100.0f; + const float transitionweighting = static_cast (params->vibrance.psthreshold.value[ThresholdSelector::TS_BOTTOMLEFT]) / 100.0f; float chromamean = 0.0f; - if(chromaPastel != chromaSatur) { + if (chromaPastel != chromaSatur) { //if sliders pastels and saturated are different: transition with a double linear interpolation: between p2 and limitpastelsatur, and between limitpastelsatur and s0 //modify the "mean" point in function of double threshold => differential transition chromamean = maxdp * (chromaSatur - chromaPastel) / (s0 - p2) + chromaPastel; @@ -208,8 +209,8 @@ void ImProcFunctions::vibrance (LabImage* lab) if (settings->verbose) { #endif - printf("vibrance: p0=%1.2f p1=%1.2f p2=%1.2f s0=%1.2f s1=%1.2f s2=%1.2f\n", p0, p1, p2, s0, s1, s2); - printf(" pastel=%f satur=%f limit= %1.2f chromamean=%0.5f\n", 1.0f + chromaPastel, 1.0f + chromaSatur, limitpastelsatur, chromamean); + printf ("vibrance: p0=%1.2f p1=%1.2f p2=%1.2f s0=%1.2f s1=%1.2f s2=%1.2f\n", p0, p1, p2, s0, s1, s2); + printf (" pastel=%f satur=%f limit= %1.2f chromamean=%0.5f\n", 1.0f + chromaPastel, 1.0f + chromaSatur, limitpastelsatur, chromamean); } #pragma omp for schedule(dynamic, 16) @@ -217,12 +218,12 @@ void ImProcFunctions::vibrance (LabImage* lab) for (int i = 0; i < height; i++) for (int j = 0; j < width; j++) { float LL = lab->L[i][j] / 327.68f; - float CC = sqrt(SQR(lab->a[i][j]) + SQR(lab->b[i][j])) / 327.68f; - float HH = xatan2f(lab->b[i][j], lab->a[i][j]); + float CC = sqrt (SQR (lab->a[i][j]) + SQR (lab->b[i][j])) / 327.68f; + float HH = xatan2f (lab->b[i][j], lab->a[i][j]); float satredu = 1.0f; //reduct sat in function of skin - if(protectskins) { + if (protectskins) { Color::SkinSat (LL, HH, CC, satredu);// for skin colors } @@ -234,7 +235,7 @@ void ImProcFunctions::vibrance (LabImage* lab) float R, G, B; float2 sincosval; - if(CC == 0.0f) { + if (CC == 0.0f) { sincosval.y = 1.f; sincosval.x = 0.0f; } else { @@ -246,26 +247,26 @@ void ImProcFunctions::vibrance (LabImage* lab) bool neg = false; bool more_rgb = false; //gamut control : Lab values are in gamut - Color::gamutLchonly(HH, sincosval, Lprov, Chprov, R, G, B, wip, highlight, 0.15f, 0.98f, neg, more_rgb); + Color::gamutLchonly (HH, sincosval, Lprov, Chprov, R, G, B, wip, highlight, 0.15f, 0.98f, neg, more_rgb); - if(neg) { + if (neg) { negat++; } - if(more_rgb) { + if (more_rgb) { moreRGB++; } #else //gamut control : Lab values are in gamut - Color::gamutLchonly(HH, sincosval, Lprov, Chprov, R, G, B, wip, highlight, 0.15f, 0.98f); + Color::gamutLchonly (HH, sincosval, Lprov, Chprov, R, G, B, wip, highlight, 0.15f, 0.98f); #endif - if(Chprov > 6.0f) { - const float saturation = SAT(R, G, B); + if (Chprov > 6.0f) { + const float saturation = SAT (R, G, B); - if(saturation > 0.0f) { - if(satredu != 1.0f) { + if (saturation > 0.0f) { + if (satredu != 1.0f) { // for skin, no differentiation sathue [0] = sathue [1] = sathue [2] = sathue [3] = sathue[4] = 1.0f; sathue2[0] = sathue2[1] = sathue2[2] = sathue2[3] = 1.0f; @@ -274,7 +275,7 @@ void ImProcFunctions::vibrance (LabImage* lab) //I try to take into account: Munsell response (human vision) and Gamut..(less response for red): preferably using Prophoto or WideGamut //blue: -1.80 -3.14 green = 2.1 3.14 green-yellow=1.4 2.1 red:0 1.4 blue-purple:-0.7 -1.4 purple: 0 -0.7 //these values allow a better and differential response - if(LL < 20.0f) {//more for blue-purple, blue and red modulate + if (LL < 20.0f) { //more for blue-purple, blue and red modulate if (/*HH> -3.1415f &&*/ HH < -1.5f ) { sathue[0] = 1.3f; //blue sathue[1] = 1.2f; @@ -285,7 +286,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[1] = 1.1f ; sathue2[2] = 1.05f; sathue2[3] = 1.0f; - } else if(/*HH>=-1.5f &&*/ HH < -0.7f ) { + } else if (/*HH>=-1.5f &&*/ HH < -0.7f ) { sathue[0] = 1.6f; //blue purple 1.2 1.1 sathue[1] = 1.4f; sathue[2] = 1.3f; @@ -295,7 +296,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[1] = 1.15f; sathue2[2] = 1.1f ; sathue2[3] = 1.0f; - } else if(/*HH>=-0.7f &&*/ HH < 0.0f ) { + } else if (/*HH>=-0.7f &&*/ HH < 0.0f ) { sathue[0] = 1.2f; //purple sathue[1] = 1.0f; sathue[2] = 1.0f; @@ -307,7 +308,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[3] = 1.0f; } // else if( HH>= 0.0f && HH<= 1.4f ) {sathue[0]=1.1f;sathue[1]=1.1f;sathue[2]=1.1f;sathue[3]=1.0f ;sathue[4]=0.4f;sathue2[0]=1.0f ;sathue2[1]=1.0f ;sathue2[2]=1.0f ;sathue2[3]=1.0f;}//red 0.8 0.7 - else if(/*HH>= 0.0f &&*/ HH <= 1.4f ) { + else if (/*HH>= 0.0f &&*/ HH <= 1.4f ) { sathue[0] = 1.3f; //red 0.8 0.7 sathue[1] = 1.2f; sathue[2] = 1.1f; @@ -317,7 +318,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[1] = 1.0f ; sathue2[2] = 1.0f ; sathue2[3] = 1.0f; - } else if(/*HH> 1.4f &&*/ HH <= 2.1f ) { + } else if (/*HH> 1.4f &&*/ HH <= 2.1f ) { sathue[0] = 1.0f; //green yellow 1.2 1.1 sathue[1] = 1.0f; sathue[2] = 1.0f; @@ -349,7 +350,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[1] = 1.1f ; sathue2[2] = 1.05f; sathue2[3] = 1.0f; - } else if(/*HH>=-1.5f &&*/ HH < -0.7f ) { + } else if (/*HH>=-1.5f &&*/ HH < -0.7f ) { sathue[0] = 1.3f; //blue purple 1.2 1.1 sathue[1] = 1.2f; sathue[2] = 1.1f; @@ -359,7 +360,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[1] = 1.05f; sathue2[2] = 1.0f ; sathue2[3] = 1.0f; - } else if(/*HH>=-0.7f &&*/ HH < 0.0f ) { + } else if (/*HH>=-0.7f &&*/ HH < 0.0f ) { sathue[0] = 1.2f; //purple sathue[1] = 1.0f; sathue[2] = 1.0f; @@ -371,7 +372,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[3] = 1.0f; } // else if( HH>= 0.0f && HH<= 1.4f ) {sathue[0]=0.8f;sathue[1]=0.8f;sathue[2]=0.8f;sathue[3]=0.8f ;sathue[4]=0.4f;sathue2[0]=0.8f ;sathue2[1]=0.8f ;sathue2[2]=0.8f ;sathue2[3]=0.8f;}//red 0.8 0.7 - else if(/*HH>= 0.0f &&*/ HH <= 1.4f ) { + else if (/*HH>= 0.0f &&*/ HH <= 1.4f ) { sathue[0] = 1.1f; //red 0.8 0.7 sathue[1] = 1.0f; sathue[2] = 0.9f; @@ -381,7 +382,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[1] = 0.8f ; sathue2[2] = 0.8f ; sathue2[3] = 0.8f; - } else if(/*HH> 1.4f &&*/ HH <= 2.1f ) { + } else if (/*HH> 1.4f &&*/ HH <= 2.1f ) { sathue[0] = 1.1f; //green yellow 1.2 1.1 sathue[1] = 1.1f; sathue[2] = 1.1f; @@ -414,7 +415,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[1] = 1.1f ; sathue2[2] = 1.05f; sathue2[3] = 1.0f; - } else if(/*HH>=-1.5f &&*/ HH < -0.7f ) { + } else if (/*HH>=-1.5f &&*/ HH < -0.7f ) { sathue[0] = 1.3f; //blue purple 1.2 1.1 sathue[1] = 1.2f; sathue[2] = 1.15f; @@ -424,7 +425,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[1] = 1.05f; sathue2[2] = 1.0f ; sathue2[3] = 1.0f; - } else if(/*HH>=-0.7f &&*/ HH < 0.0f ) { + } else if (/*HH>=-0.7f &&*/ HH < 0.0f ) { sathue[0] = 1.2f; //purple sathue[1] = 1.0f; sathue[2] = 1.0f ; @@ -436,7 +437,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[3] = 1.0f; } // else if( HH>= 0.0f && HH<= 1.4f ) {sathue[0]=0.8f;sathue[1]=0.8f;sathue[2]=0.8f ;sathue[3]=0.8f ;sathue[4]=0.3f;sathue2[0]=0.8f ;sathue2[1]=0.8f ;sathue2[2]=0.8f ;sathue2[3]=0.8f;}//red 0.8 0.7 - else if(/*HH>= 0.0f &&*/ HH <= 1.4f ) { + else if (/*HH>= 0.0f &&*/ HH <= 1.4f ) { sathue[0] = 1.1f; //red 0.8 0.7 sathue[1] = 1.0f; sathue[2] = 0.9f ; @@ -446,7 +447,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[1] = 0.8f ; sathue2[2] = 0.8f ; sathue2[3] = 0.8f; - } else if(/*HH> 1.4f &&*/ HH <= 2.1f ) { + } else if (/*HH> 1.4f &&*/ HH <= 2.1f ) { sathue[0] = 1.3f; //green yellow 1.2 1.1 sathue[1] = 1.2f; sathue[2] = 1.1f ; @@ -478,7 +479,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[1] = 0.8f ; sathue2[2] = 0.8f ; sathue2[3] = 0.8f; - } else if(/*HH>=-1.5f &&*/ HH < -0.7f ) { + } else if (/*HH>=-1.5f &&*/ HH < -0.7f ) { sathue[0] = 1.0f; //blue purple 1.2 1.1 sathue[1] = 1.0f; sathue[2] = 0.9f; @@ -488,7 +489,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[1] = 0.8f ; sathue2[2] = 0.8f ; sathue2[3] = 0.8f; - } else if(/*HH>=-0.7f &&*/ HH < 0.0f ) { + } else if (/*HH>=-0.7f &&*/ HH < 0.0f ) { sathue[0] = 1.2f; //purple sathue[1] = 1.0f; sathue[2] = 1.0f; @@ -500,7 +501,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[3] = 0.8f; } // else if( HH>= 0.0f && HH<= 1.4f ) {sathue[0]=0.8f;sathue[1]=0.8f;sathue[2]=0.8f;sathue[3]=0.8f;sathue[4]=0.2f;sathue2[0]=0.8f;sathue2[1]=0.8f ;sathue2[2]=0.8f ;sathue2[3]=0.8f;}//red 0.8 0.7 - else if(/*HH>= 0.0f &&*/ HH <= 1.4f ) { + else if (/*HH>= 0.0f &&*/ HH <= 1.4f ) { sathue[0] = 1.1f; //red 0.8 0.7 sathue[1] = 1.0f; sathue[2] = 0.9f; @@ -510,7 +511,7 @@ void ImProcFunctions::vibrance (LabImage* lab) sathue2[1] = 0.8f ; sathue2[2] = 0.8f ; sathue2[3] = 0.8f; - } else if(/*HH> 1.4f &&*/ HH <= 2.1f ) { + } else if (/*HH> 1.4f &&*/ HH <= 2.1f ) { sathue[0] = 1.6f; //green yellow 1.2 1.1 sathue[1] = 1.5f; sathue[2] = 1.4f; @@ -534,7 +535,7 @@ void ImProcFunctions::vibrance (LabImage* lab) } } - float chmodpastel, chmodsat; + float chmodpastel = 0.f, chmodsat = 0.f; // variables to improve transitions float pa, pb;// transition = pa*saturation + pb float chl00 = chromaPastel * satredu * sathue[4]; @@ -585,16 +586,16 @@ void ImProcFunctions::vibrance (LabImage* lab) chmodsat = pa * saturation + pb; } - if(chromaPastel != chromaSatur) { + if (chromaPastel != chromaSatur) { // Pastels - if(saturation > p2 && saturation < limitpastelsatur) { + if (saturation > p2 && saturation < limitpastelsatur) { float newchromaPastel = chromaPastel_a * saturation + chromaPastel_b; chmodpastel = newchromaPastel * satredu * sathue[3]; } // Saturated - if(saturation < s0 && saturation >= limitpastelsatur) { + if (saturation < s0 && saturation >= limitpastelsatur) { float newchromaSatur = chromaSatur_a * saturation + chromaSatur_b; chmodsat = newchromaSatur * satredu * sathue2[0]; } @@ -603,25 +604,25 @@ void ImProcFunctions::vibrance (LabImage* lab) if (saturation <= limitpastelsatur) { if (chmodpastel > 2.0f ) { chmodpastel = 2.0f; //avoid too big values - } else if(chmodpastel < -0.93f) { + } else if (chmodpastel < -0.93f) { chmodpastel = -0.93f; //avoid negative values } Chprov *= (1.0f + chmodpastel); - if(Chprov < 6.0f) { + if (Chprov < 6.0f) { Chprov = 6.0f; } } else { //if (saturation > limitpastelsatur) if (chmodsat > 1.8f ) { chmodsat = 1.8f; //saturated - } else if(chmodsat < -0.93f) { + } else if (chmodsat < -0.93f) { chmodsat = -0.93f; } Chprov *= 1.0f + chmodsat; - if(Chprov < 6.0f) { + if (Chprov < 6.0f) { Chprov = 6.0f; } } @@ -631,15 +632,15 @@ void ImProcFunctions::vibrance (LabImage* lab) bool hhModified = false; // Vibrance's Skin curve - if(skinCurveIsSet) { + if (skinCurveIsSet) { if (HH > skbeg && HH < skend) { - if(Chprov < 60.0f) {//skin hue : todo ==> transition + if (Chprov < 60.0f) { //skin hue : todo ==> transition float HHsk = ask * HH + bsk; float Hn = (skin_curve[HHsk] - bsk) / ask; float Hc = (Hn * xx + HH * (1.0f - xx)); HH = Hc; hhModified = true; - } else if(Chprov < (60.0f + dchr)) { //transition chroma + } else if (Chprov < (60.0f + dchr)) { //transition chroma float HHsk = ask * HH + bsk; float Hn = (skin_curve[HHsk] - bsk) / ask; float Hc = (Hn * xx + HH * (1.0f - xx)); @@ -650,7 +651,7 @@ void ImProcFunctions::vibrance (LabImage* lab) } } //transition hue - else if(HH > (skbeg - dhue) && HH <= skbeg && Chprov < (60.0f + dchr * 0.5f)) { + else if (HH > (skbeg - dhue) && HH <= skbeg && Chprov < (60.0f + dchr * 0.5f)) { float HHsk = ask * skbeg + bsk; float Hn = (skin_curve[HHsk] - bsk) / ask; float Hcc = (Hn * xx + skbeg * (1.0f - xx)); @@ -658,7 +659,7 @@ void ImProcFunctions::vibrance (LabImage* lab) float bdh = Hcc - adh * skbeg; HH = adh * HH + bdh; hhModified = true; - } else if(HH >= skend && HH < (skend + dhue) && Chprov < (60.0f + dchr * 0.5f)) { + } else if (HH >= skend && HH < (skend + dhue) && Chprov < (60.0f + dchr * 0.5f)) { float HHsk = ask * skend + bsk; float Hn = (skin_curve[HHsk] - bsk) / ask; float Hcc = (Hn * xx + skend * (1.0f - xx)); @@ -671,8 +672,8 @@ void ImProcFunctions::vibrance (LabImage* lab) //Munsell correction // float2 sincosval; - if(!avoidcolorshift && hhModified) { - sincosval = xsincosf(HH); + if (!avoidcolorshift && hhModified) { + sincosval = xsincosf (HH); } float aprovn, bprovn; @@ -681,18 +682,18 @@ void ImProcFunctions::vibrance (LabImage* lab) do { inGamut = true; - if(avoidcolorshift) { + if (avoidcolorshift) { float correctionHue = 0.0f; float correctlum = 0.0f; #ifdef _DEBUG - Color::AllMunsellLch(/*lumaMuns*/false, Lprov, Lprov, HH, Chprov, CC, correctionHue, correctlum, MunsDebugInfo); + Color::AllMunsellLch (/*lumaMuns*/false, Lprov, Lprov, HH, Chprov, CC, correctionHue, correctlum, MunsDebugInfo); #else - Color::AllMunsellLch(/*lumaMuns*/false, Lprov, Lprov, HH, Chprov, CC, correctionHue, correctlum); + Color::AllMunsellLch (/*lumaMuns*/false, Lprov, Lprov, HH, Chprov, CC, correctionHue, correctlum); #endif - if(correctionHue != 0.f || hhModified) { - sincosval = xsincosf(HH + correctionHue); + if (correctionHue != 0.f || hhModified) { + sincosval = xsincosf (HH + correctionHue); hhModified = false; } } @@ -703,14 +704,14 @@ void ImProcFunctions::vibrance (LabImage* lab) float fyy = (0.00862069f * Lprov ) + 0.137932f; float fxx = (0.002f * aprovn) + fyy; float fzz = fyy - (0.005f * bprovn); - float xx_ = 65535.f * Color::f2xyz(fxx) * Color::D50x; + float xx_ = 65535.f * Color::f2xyz (fxx) * Color::D50x; // float yy_ = 65535.0f * Color::f2xyz(fyy); - float zz_ = 65535.f * Color::f2xyz(fzz) * Color::D50z; + float zz_ = 65535.f * Color::f2xyz (fzz) * Color::D50z; float yy_ = 65535.f * ((Lprov > Color::epskap) ? fyy * fyy*fyy : Lprov / Color::kappa); - Color::xyz2rgb(xx_, yy_, zz_, R, G, B, wip); + Color::xyz2rgb (xx_, yy_, zz_, R, G, B, wip); - if(R < 0.0f || G < 0.0f || B < 0.0f) { + if (R < 0.0f || G < 0.0f || B < 0.0f) { #ifdef _DEBUG negsat++; #endif @@ -719,7 +720,7 @@ void ImProcFunctions::vibrance (LabImage* lab) } // if "highlight reconstruction" enabled don't control Gamut for highlights - if((!highlight) && (R > 65535.0f || G > 65535.0f || B > 65535.0f)) { + if ((!highlight) && (R > 65535.0f || G > 65535.0f || B > 65535.0f)) { #ifdef _DEBUG moresat++; #endif @@ -740,11 +741,11 @@ void ImProcFunctions::vibrance (LabImage* lab) t2e.set(); if (settings->verbose) { - printf("Vibrance (performed in %d usec):\n", t2e.etime(t1e)); - printf(" Gamut: G1negat=%iiter G165535=%iiter G2negsat=%iiter G265535=%iiter\n", negat, moreRGB, negsat, moresat); + printf ("Vibrance (performed in %d usec):\n", t2e.etime (t1e)); + printf (" Gamut: G1negat=%iiter G165535=%iiter G2negsat=%iiter G265535=%iiter\n", negat, moreRGB, negsat, moresat); if (MunsDebugInfo) { - printf(" Munsell chrominance: MaxBP=%1.2frad MaxRY=%1.2frad MaxGY=%1.2frad MaxRP=%1.2frad depass=%u\n", MunsDebugInfo->maxdhue[0], MunsDebugInfo->maxdhue[1], MunsDebugInfo->maxdhue[2], MunsDebugInfo->maxdhue[3], MunsDebugInfo->depass); + printf (" Munsell chrominance: MaxBP=%1.2frad MaxRY=%1.2frad MaxGY=%1.2frad MaxRP=%1.2frad depass=%u\n", MunsDebugInfo->maxdhue[0], MunsDebugInfo->maxdhue[1], MunsDebugInfo->maxdhue[2], MunsDebugInfo->maxdhue[3], MunsDebugInfo->depass); } } diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index ae9980020..3494c0874 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -250,7 +250,7 @@ SSEFUNCTION void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int cp.edgampl = (float) params->wavelet.edgeampli; } - int N = imheight * imwidth; + //int N = imheight * imwidth; int maxmul = params->wavelet.thres; cp.maxilev = maxmul; static const float scales[10] = {1.f, 2.f, 4.f, 8.f, 16.f, 32.f, 64.f, 128.f, 256.f, 512.f}; @@ -699,7 +699,7 @@ SSEFUNCTION void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int int width = tileright - tileleft; int height = tilebottom - tiletop; LabImage * labco; - float **Lold; + float **Lold = nullptr; float *LoldBuffer = nullptr; if(numtiles == 1) { // untiled processing => we can use output buffer for labco @@ -2597,7 +2597,7 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit float bedstr = 1.f - 10.f * aedstr; if(cp.val > 0 && cp.edgeena) { - float * koe; + float * koe = nullptr; float maxkoe = 0.f; if(!lipschitz) { @@ -2766,7 +2766,7 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit float asig = 0.166f / sigma[level]; float bsig = 0.5f - asig * mean[level]; float amean = 0.5f / mean[level]; - float absciss; + float absciss = 0.f; float kinterm; float kmul; int borderL = 1; diff --git a/rtengine/klt/trackFeatures.cc b/rtengine/klt/trackFeatures.cc index 5930e2fcb..474d0f5f5 100644 --- a/rtengine/klt/trackFeatures.cc +++ b/rtengine/klt/trackFeatures.cc @@ -640,31 +640,31 @@ static void _am_getGradientWinAffine( } -/********************************************************************* - * _computeAffineMappedImage - * used only for DEBUG output - * -*/ - -static void _am_computeAffineMappedImage( - _KLT_FloatImage img, /* images */ - float x, float y, /* center of window */ - float Axx, float Ayx , float Axy, float Ayy, /* affine mapping */ - int width, int height, /* size of window */ - _FloatWindow imgdiff) /* output */ -{ - int hw = width/2, hh = height/2; - int i, j; - float mi, mj; - - /* Compute values */ - for (j = -hh ; j <= hh ; j++) - for (i = -hw ; i <= hw ; i++) { - mi = Axx * i + Axy * j; - mj = Ayx * i + Ayy * j; - *imgdiff++ = _interpolate(x+mi, y+mj, img); - } -} +///********************************************************************* +// * _computeAffineMappedImage +// * used only for DEBUG output +// * +//*/ +// +//static void _am_computeAffineMappedImage( +// _KLT_FloatImage img, /* images */ +// float x, float y, /* center of window */ +// float Axx, float Ayx , float Axy, float Ayy, /* affine mapping */ +// int width, int height, /* size of window */ +// _FloatWindow imgdiff) /* output */ +//{ +// int hw = width/2, hh = height/2; +// int i, j; +// float mi, mj; +// +// /* Compute values */ +// for (j = -hh ; j <= hh ; j++) +// for (i = -hw ; i <= hw ; i++) { +// mi = Axx * i + Axy * j; +// mj = Ayx * i + Ayy * j; +// *imgdiff++ = _interpolate(x+mi, y+mj, img); +// } +//} /********************************************************************* @@ -986,7 +986,7 @@ static int _am_trackFeatureAffine( _FloatWindow imgdiff, gradx, grady; - float gxx, gxy, gyy, ex, ey, dx, dy; + float gxx, gxy, gyy, ex, ey, dx = 0.f, dy = 0.f; int iteration = 0; int status = 0; int hw = width/2; @@ -1253,7 +1253,7 @@ void KLTTrackFeatures( pyramid2, pyramid2_gradx, pyramid2_grady; float subsampling = (float) tc->subsampling; float xloc, yloc, xlocout, ylocout; - int val; + int val = 0; int indx, r; KLT_BOOL floatimg1_created = FALSE; int i; diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index 310361a72..fdf46270f 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -678,7 +678,9 @@ void XMLCALL LCPProfile::XmlStartHandler(void *pLCPProfile, const char *el, cons } strcpy(pProf->lastTag, nameStart); - XmlTextHandler(pLCPProfile, attr[i + 1], strlen(attr[i + 1])); + + pProf->handle_text(attr[i+1]); + //XmlTextHandler(pLCPProfile, attr[i + 1], strlen(attr[i + 1])); } } } @@ -690,24 +692,33 @@ void XMLCALL LCPProfile::XmlTextHandler(void *pLCPProfile, const XML_Char *s, in if (!pProf->inCamProfiles || pProf->inAlternateLensID || pProf->inAlternateLensNames || *pProf->inInvalidTag) { return; } + + for (int i = 0; i < len; ++i) { + pProf->textbuf << s[i]; + } +} + +void LCPProfile::handle_text(std::string text) +{ + const char *raw = text.c_str(); + // Check if it contains non-whitespaces (there are several calls to this for one tag unfortunately) bool onlyWhiteSpace = true; - int i = 0; - - while (i < len && onlyWhiteSpace) { - onlyWhiteSpace = isspace(s[i]); - i++; + for (size_t i = 0; i < text.size(); ++i) { + if (!isspace(text[i])) { + onlyWhiteSpace = false; + break; + } } if (onlyWhiteSpace) { return; } + LCPProfile *pProf = this; + // convert to null terminated - char raw[len + 1]; - memcpy(raw, s, len); - raw[len] = 0; char* tag = pProf->lastTag; // Common data section @@ -732,15 +743,12 @@ void XMLCALL LCPProfile::XmlTextHandler(void *pLCPProfile, const XML_Char *s, in // WARNING: called by different threads, that may run on different local settings, // so don't use system params if (atof("1,2345") == 1.2345) { - char* p = raw; - - while (*p) { - if (*p == '.') { - *p = ','; + for (size_t i = 0; i < text.size(); ++i) { + if (text[i] == '.') { + text[i] = ','; } - - p++; } + raw = text.c_str(); } if (!pProf->firstLIDone) { @@ -789,6 +797,9 @@ void XMLCALL LCPProfile::XmlEndHandler(void *pLCPProfile, const char *el) { LCPProfile *pProf = static_cast(pLCPProfile); + pProf->handle_text(pProf->textbuf.str()); + pProf->textbuf.str(""); + // We ignore everything in dirty tag till it's gone if (*pProf->inInvalidTag) { if (strstr(el, pProf->inInvalidTag)) { @@ -866,7 +877,6 @@ Glib::ustring LCPStore::getDefaultCommonDirectory() const #ifdef WIN32 WCHAR pathW[MAX_PATH] = {0}; - char pathA[MAX_PATH]; if (SHGetSpecialFolderPathW(NULL, pathW, CSIDL_COMMON_APPDATA, false)) { char pathA[MAX_PATH]; diff --git a/rtengine/lcp.h b/rtengine/lcp.h index fa8cf226d..e108e61b7 100644 --- a/rtengine/lcp.h +++ b/rtengine/lcp.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -94,6 +95,9 @@ class LCPProfile int filterBadFrames(double maxAvgDevFac, int minFramesLeft); + void handle_text(std::string text); + std::ostringstream textbuf; + public: // Common data Glib::ustring profileName, lensPrettyName, cameraPrettyName, lens, camera; // lens/camera(=model) can be auto-matched with DNG diff --git a/rtengine/myfile.cc b/rtengine/myfile.cc index 11a5b495b..09d9cd48f 100644 --- a/rtengine/myfile.cc +++ b/rtengine/myfile.cc @@ -364,7 +364,7 @@ int fscanf (IMFILE* f, const char* s ...) char buf[50], *endptr = nullptr; int copy_sz = f->size - f->pos; - if (copy_sz > sizeof(buf)) { + if (copy_sz > static_cast(sizeof(buf))) { copy_sz = sizeof(buf) - 1; } diff --git a/rtengine/myfile.h b/rtengine/myfile.h index 771dd7b84..e4609c697 100644 --- a/rtengine/myfile.h +++ b/rtengine/myfile.h @@ -68,7 +68,10 @@ inline void fseek (IMFILE* f, int p, int how) } else if (how == SEEK_CUR) { f->pos += p; } else if (how == SEEK_END) { - f->pos = f->size + p; + if(p <= 0 && -p <= f->size) { + f->pos = f->size + p; + } + return; } if (f->pos < 0 || f->pos > f->size) { diff --git a/rtengine/pixelshift.cc b/rtengine/pixelshift.cc index 0986844f5..744950ba8 100644 --- a/rtengine/pixelshift.cc +++ b/rtengine/pixelshift.cc @@ -332,7 +332,7 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA } else if(bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::Off) { bayerParams.pixelShiftMotion = 0; bayerParams.pixelShiftAutomatic = false; - bayerParams.pixelshiftShowMotion = false; + bayerParams.pixelShiftShowMotion = false; } if((bayerParams.pixelShiftMotion > 0 || bayerParams.pixelShiftAutomatic)) { @@ -454,11 +454,11 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA } const int motion = bayerParams.pixelShiftMotion; - const bool showMotion = bayerParams.pixelshiftShowMotion; - const bool showOnlyMask = bayerParams.pixelshiftShowMotionMaskOnly && showMotion; - const RAWParams::BayerSensor::ePSMotionCorrection gridSize_ = bayerParams.pixelShiftMotionCorrection; + const bool showMotion = bayerParams.pixelShiftShowMotion; + const bool showOnlyMask = bayerParams.pixelShiftShowMotionMaskOnly && showMotion; const bool adaptive = bayerParams.pixelShiftAutomatic; #ifdef PIXELSHIFTDEV + const RAWParams::BayerSensor::ePSMotionCorrection gridSize_ = bayerParams.pixelShiftMotionCorrection; const bool detectMotion = bayerParams.pixelShiftMotion > 0; float stddevFactorGreen = bayerParams.pixelShiftStddevFactorGreen; float stddevFactorRed = bayerParams.pixelShiftStddevFactorRed; @@ -475,25 +475,25 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA const float redBlueWeight = 0.7f + 1.f; #endif float eperIso = bayerParams.pixelShiftEperIso; - const bool checkNonGreenHorizontal = bayerParams.pixelShiftNonGreenHorizontal; - const bool checkNonGreenVertical = bayerParams.pixelShiftNonGreenVertical; const bool checkNonGreenCross = bayerParams.pixelShiftNonGreenCross; - const bool checkNonGreenAmaze = bayerParams.pixelShiftNonGreenAmaze; - const bool checkNonGreenCross2 = bayerParams.pixelShiftNonGreenCross2; const bool checkGreen = bayerParams.pixelShiftGreen; const float greenWeight = 2.f; const bool blurMap = bayerParams.pixelShiftBlur; const float sigma = bayerParams.pixelShiftSigma; #ifdef PIXELSHIFTDEV + const bool checkNonGreenHorizontal = bayerParams.pixelShiftNonGreenHorizontal; + const bool checkNonGreenVertical = bayerParams.pixelShiftNonGreenVertical; + const bool checkNonGreenAmaze = bayerParams.pixelShiftNonGreenAmaze; + const bool checkNonGreenCross2 = bayerParams.pixelShiftNonGreenCross2; const float threshold = bayerParams.pixelShiftSum + 9.f; + const bool experimental0 = bayerParams.pixelShiftExp0; + const bool automatic = bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::Automatic; #else constexpr float threshold = 3.f + 9.f; #endif - const bool experimental0 = bayerParams.pixelShiftExp0; const bool holeFill = bayerParams.pixelShiftHoleFill; const bool equalBrightness = bayerParams.pixelShiftEqualBright; const bool smoothTransitions = blurMap && bayerParams.pixelShiftSmoothFactor > 0. && !showOnlyMask; - const bool automatic = bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::Automatic; const float smoothFactor = 1.0 - bayerParams.pixelShiftSmoothFactor; static const float nReadK3II[] = { 3.4f, // ISO 100 @@ -606,8 +606,10 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA } +#ifdef PIXELSHIFTDEV const bool skip = (gridSize_ == RAWParams::BayerSensor::ePSMotionCorrection::Grid1x2); int gridSize = 1; + bool nOf3x3 = false; switch (gridSize_) { @@ -632,6 +634,9 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA gridSize = 1; nOf3x3 = true; } +#else + const bool nOf3x3 = true; +#endif if(adaptive && blurMap && nOf3x3 && smoothFactor == 0.f && !showMotion) { if(plistener) { @@ -707,9 +712,10 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA // If the values of two corresponding green pixels differ my more then motionThreshold %, the pixel will be treated as a badGreen pixel const float motionThreshold = 1.f - (motion / 100.f); // For shades of green motion indicators +#ifdef PIXELSHIFTDEV const float blendFactor = ((adaptive || motion == 0.f) ? 1.f : 1.f / (1.f - motionThreshold)); - - unsigned int offsX = 0, offsY = 0; +#endif + int offsX = 0, offsY = 0; if(!bayerParams.pixelShiftMedian || !adaptive) { // We have to adjust the offsets for the selected subframe we use for areas with motion @@ -860,9 +866,11 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA #endif for(int i = winy + border - offsY; i < winh - (border + offsY); ++i) { +#ifdef PIXELSHIFTDEV float *greenDest = green[i + offsY]; float *redDest = red[i + offsY]; float *blueDest = blue[i + offsY]; +#endif int j = winx + border - offsX; #ifdef PIXELSHIFTDEV diff --git a/rtengine/previewimage.cc b/rtengine/previewimage.cc index 891186d8a..1bf11dc17 100644 --- a/rtengine/previewimage.cc +++ b/rtengine/previewimage.cc @@ -71,9 +71,7 @@ PreviewImage::PreviewImage (const Glib::ustring &fname, const Glib::ustring &ext int w, h; double scale = 1.; - if (tpp) { - tpp->getDimensions(w, h, scale); - } + tpp->getDimensions(w, h, scale); previewImage = Cairo::ImageSurface::create(Cairo::FORMAT_RGB24, w, h); previewImage->flush(); @@ -141,7 +139,7 @@ PreviewImage::PreviewImage (const Glib::ustring &fname, const Glib::ustring &ext if (data) { int w, h; - double scale = 1.; + // double scale = 1.; w = output->getWidth(); h = output->getHeight(); previewImage = Cairo::ImageSurface::create(Cairo::FORMAT_RGB24, w, h); diff --git a/rtengine/processingjob.cc b/rtengine/processingjob.cc index 612edc2a2..a377e3963 100644 --- a/rtengine/processingjob.cc +++ b/rtengine/processingjob.cc @@ -21,16 +21,16 @@ namespace rtengine { -ProcessingJob* ProcessingJob::create (const Glib::ustring& fname, bool isRaw, const procparams::ProcParams& pparams) +ProcessingJob* ProcessingJob::create (const Glib::ustring& fname, bool isRaw, const procparams::ProcParams& pparams, bool fast) { - return new ProcessingJobImpl (fname, isRaw, pparams); + return new ProcessingJobImpl (fname, isRaw, pparams, fast); } -ProcessingJob* ProcessingJob::create (InitialImage* initialImage, const procparams::ProcParams& pparams) +ProcessingJob* ProcessingJob::create (InitialImage* initialImage, const procparams::ProcParams& pparams, bool fast) { - return new ProcessingJobImpl (initialImage, pparams); + return new ProcessingJobImpl (initialImage, pparams, fast); } void ProcessingJob::destroy (ProcessingJob* job) diff --git a/rtengine/processingjob.h b/rtengine/processingjob.h index 2de426a31..c7f49192e 100644 --- a/rtengine/processingjob.h +++ b/rtengine/processingjob.h @@ -32,12 +32,13 @@ public: bool isRaw; InitialImage* initialImage; procparams::ProcParams pparams; + bool fast; - ProcessingJobImpl (const Glib::ustring& fn, bool iR, const procparams::ProcParams& pp) - : fname(fn), isRaw(iR), initialImage(nullptr), pparams(pp) {} + ProcessingJobImpl (const Glib::ustring& fn, bool iR, const procparams::ProcParams& pp, bool ff) + : fname(fn), isRaw(iR), initialImage(nullptr), pparams(pp), fast(ff) {} - ProcessingJobImpl (InitialImage* iImage, const procparams::ProcParams& pp) - : fname(""), isRaw(true), initialImage(iImage), pparams(pp) + ProcessingJobImpl (InitialImage* iImage, const procparams::ProcParams& pp, bool ff) + : fname(""), isRaw(true), initialImage(iImage), pparams(pp), fast(ff) { iImage->increaseRef(); } @@ -48,6 +49,8 @@ public: initialImage->decreaseRef(); } } + + bool fastPipeline() const { return fast; } }; } diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index cfed23d27..b9969ba8d 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -1130,8 +1130,8 @@ void RAWParams::setDefaults() deadPixelFilter = false; hotdeadpix_thresh = 100; bayersensor.setPixelShiftDefaults(); - bayersensor.pixelshiftShowMotion = false; - bayersensor.pixelshiftShowMotionMaskOnly = false; + bayersensor.pixelShiftShowMotion = false; + bayersensor.pixelShiftShowMotionMaskOnly = false; } @@ -1353,8 +1353,8 @@ void ProcParams::setDefaults () epd.enabled = false; epd.strength = 0.5; epd.gamma = 1.0; - epd.edgeStopping = 1.4; - epd.scale = 0.3; + epd.edgeStopping = 0.5; + epd.scale = 0.1; epd.reweightingIterates = 0; sh.enabled = false; @@ -3933,12 +3933,12 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b keyFile.set_double ("RAW Bayer", "PixelShiftRedBlueWeight", raw.bayersensor.pixelShiftRedBlueWeight ); } - if (!pedited || pedited->raw.bayersensor.pixelshiftShowMotion) { - keyFile.set_boolean ("RAW Bayer", "PixelShiftShowMotion", raw.bayersensor.pixelshiftShowMotion ); + if (!pedited || pedited->raw.bayersensor.pixelShiftShowMotion) { + keyFile.set_boolean ("RAW Bayer", "PixelShiftShowMotion", raw.bayersensor.pixelShiftShowMotion ); } - if (!pedited || pedited->raw.bayersensor.pixelshiftShowMotionMaskOnly) { - keyFile.set_boolean ("RAW Bayer", "PixelShiftShowMotionMaskOnly", raw.bayersensor.pixelshiftShowMotionMaskOnly ); + if (!pedited || pedited->raw.bayersensor.pixelShiftShowMotionMaskOnly) { + keyFile.set_boolean ("RAW Bayer", "PixelShiftShowMotionMaskOnly", raw.bayersensor.pixelShiftShowMotionMaskOnly ); } if (!pedited || pedited->raw.bayersensor.pixelShiftAutomatic) { @@ -8750,18 +8750,18 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } if (keyFile.has_key ("RAW Bayer", "PixelShiftShowMotion")) { - raw.bayersensor.pixelshiftShowMotion = keyFile.get_boolean("RAW Bayer", "PixelShiftShowMotion"); + raw.bayersensor.pixelShiftShowMotion = keyFile.get_boolean("RAW Bayer", "PixelShiftShowMotion"); if (pedited) { - pedited->raw.bayersensor.pixelshiftShowMotion = true; + pedited->raw.bayersensor.pixelShiftShowMotion = true; } } if (keyFile.has_key ("RAW Bayer", "PixelShiftShowMotionMaskOnly")) { - raw.bayersensor.pixelshiftShowMotionMaskOnly = keyFile.get_boolean("RAW Bayer", "PixelShiftShowMotionMaskOnly"); + raw.bayersensor.pixelShiftShowMotionMaskOnly = keyFile.get_boolean("RAW Bayer", "PixelShiftShowMotionMaskOnly"); if (pedited) { - pedited->raw.bayersensor.pixelshiftShowMotionMaskOnly = true; + pedited->raw.bayersensor.pixelShiftShowMotionMaskOnly = true; } } @@ -9421,8 +9421,8 @@ bool ProcParams::operator== (const ProcParams& other) && raw.bayersensor.pixelShiftSigma == other.raw.bayersensor.pixelShiftSigma && raw.bayersensor.pixelShiftSum == other.raw.bayersensor.pixelShiftSum && raw.bayersensor.pixelShiftRedBlueWeight == other.raw.bayersensor.pixelShiftRedBlueWeight - && raw.bayersensor.pixelshiftShowMotion == other.raw.bayersensor.pixelshiftShowMotion - && raw.bayersensor.pixelshiftShowMotionMaskOnly == other.raw.bayersensor.pixelshiftShowMotionMaskOnly + && raw.bayersensor.pixelShiftShowMotion == other.raw.bayersensor.pixelShiftShowMotion + && raw.bayersensor.pixelShiftShowMotionMaskOnly == other.raw.bayersensor.pixelShiftShowMotionMaskOnly && raw.bayersensor.pixelShiftAutomatic == other.raw.bayersensor.pixelShiftAutomatic && raw.bayersensor.pixelShiftNonGreenHorizontal == other.raw.bayersensor.pixelShiftNonGreenHorizontal && raw.bayersensor.pixelShiftNonGreenVertical == other.raw.bayersensor.pixelShiftNonGreenVertical diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 9e52ce9d9..8b341269e 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1323,8 +1323,8 @@ public: double pixelShiftSigma; double pixelShiftSum; double pixelShiftRedBlueWeight; - bool pixelshiftShowMotion; - bool pixelshiftShowMotionMaskOnly; + bool pixelShiftShowMotion; + bool pixelShiftShowMotionMaskOnly; bool pixelShiftAutomatic; bool pixelShiftNonGreenHorizontal; bool pixelShiftNonGreenVertical; diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index 2cd1abf5f..c0fd1f576 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -25,9 +25,9 @@ RawImage::RawImage( const Glib::ustring &name ) : data(nullptr) , prefilters(0) , filename(name) + , rotate_deg(0) , profile_data(nullptr) , allocation(nullptr) - , rotate_deg(0) { memset(maximum_c4, 0, sizeof(maximum_c4)); RT_matrix_from_constant = 0; @@ -84,9 +84,9 @@ eSensorType RawImage::getSensorType() */ void RawImage::get_colorsCoeff( float *pre_mul_, float *scale_mul_, float *cblack_, bool forceAutoWB) { - unsigned row, col, x, y, c, sum[8]; - unsigned W = this->get_width(); - unsigned H = this->get_height(); + unsigned sum[8], c; + unsigned W = this->get_width(); + unsigned H = this->get_height(); float val; double dsum[8], dmin, dmax; @@ -97,6 +97,9 @@ void RawImage::get_colorsCoeff( float *pre_mul_, float *scale_mul_, float *cblac pre_mul_[c] = this->get_pre_mul(c); } } else if ((this->get_cblack(4) + 1) / 2 == 1 && (this->get_cblack(5) + 1) / 2 == 1) { + for (int c = 0; c < 4; c++) { + cblack_[c] = this->get_cblack(c); + } for (int c = 0; c < 4; c++) { cblack_[FC(c / 2, c % 2)] = this->get_cblack(6 + c / 2 % this->get_cblack(4) * this->get_cblack(5) + c % 2 % this->get_cblack(5)); pre_mul_[c] = this->get_pre_mul(c); @@ -118,7 +121,7 @@ void RawImage::get_colorsCoeff( float *pre_mul_, float *scale_mul_, float *cblac dsum[FC(1, 0) + 4] += (int)(((W + 1) / 2) * (H / 2)); dsum[FC(1, 1) + 4] += (int)((W / 2) * (H / 2)); - #pragma omp parallel private(val,row,col,x,y) + #pragma omp parallel private(val) { double dsumthr[8]; memset(dsumthr, 0, sizeof dsumthr); @@ -135,15 +138,15 @@ void RawImage::get_colorsCoeff( float *pre_mul_, float *scale_mul_, float *cblac float *tempdata = data[0]; #pragma omp for nowait - for (row = 0; row < H; row += 8) { - int ymax = row + 8 < H ? row + 8 : H; + for (size_t row = 0; row < H; row += 8) { + size_t ymax = row + 8 < H ? row + 8 : H; - for (col = 0; col < W ; col += 8) { - int xmax = col + 8 < W ? col + 8 : W; + for (size_t col = 0; col < W ; col += 8) { + size_t xmax = col + 8 < W ? col + 8 : W; memset(sum, 0, sizeof sum); - for (y = row; y < ymax; y++) - for (x = col; x < xmax; x++) { + for (size_t y = row; y < ymax; y++) + for (size_t x = col; x < xmax; x++) { int c = FC(y, x); val = tempdata[y * W + x]; @@ -204,13 +207,13 @@ skip_block2: #pragma omp for nowait - for (int row = 0; row < H; row += 8) - for (int col = 0; col < W ; col += 8) + for (size_t row = 0; row < H; row += 8) + for (size_t col = 0; col < W ; col += 8) { memset(sum, 0, sizeof sum); - for (int y = row; y < row + 8 && y < H; y++) - for (int x = col; x < col + 8 && x < W; x++) { + for (size_t y = row; y < row + 8 && y < H; y++) + for (size_t x = col; x < col + 8 && x < W; x++) { int c = XTRANSFC(y, x); float val = data[y][x]; @@ -248,12 +251,12 @@ skip_block3: pre_mul_[c] = 1; } } else { - for (row = 0; row < H; row += 8) - for (col = 0; col < W ; col += 8) { + for (size_t row = 0; row < H; row += 8) + for (size_t col = 0; col < W ; col += 8) { memset(sum, 0, sizeof sum); - for (y = row; y < row + 8 && y < H; y++) - for (x = col; x < col + 8 && x < W; x++) + for (size_t y = row; y < row + 8 && y < H; y++) + for (size_t x = col; x < col + 8 && x < W; x++) for (int c = 0; c < 3; c++) { if (this->isBayer()) { c = FC(y, x); @@ -294,8 +297,8 @@ skip_block: } else { memset(sum, 0, sizeof sum); - for (row = 0; row < 8; row++) - for (col = 0; col < 8; col++) { + for (size_t row = 0; row < 8; row++) + for (size_t col = 0; col < 8; col++) { int c = FC(row, col); if ((val = white[row][col] - cblack_[c]) > 0) { @@ -442,7 +445,7 @@ int RawImage::loadRaw (bool loadData, unsigned int imageNum, bool closeFile, Pro return 2; } - if(!strcmp(make,"Fujifilm") && raw_height * raw_width * 2 != raw_size) { + if(!strcmp(make,"Fujifilm") && raw_height * raw_width * 2u != raw_size) { parse_fuji_compressed_header(); } @@ -604,7 +607,7 @@ int RawImage::loadRaw (bool loadData, unsigned int imageNum, bool closeFile, Pro if(tiff_bps > 0 && maximum_c4[i] > 0 && !isFoveon()) { unsigned compare = ((uint64_t)1 << tiff_bps) - 1; // use uint64_t to avoid overflow if tiff_bps == 32 - while(maximum_c4[i] > compare) { + while(static_cast(maximum_c4[i]) > compare) { maximum_c4[i] >>= 1; } } @@ -632,7 +635,7 @@ int RawImage::loadRaw (bool loadData, unsigned int imageNum, bool closeFile, Pro } for (int c = 0; c < 4; c++) { - if (cblack[c] < black_c4[c]) { + if (static_cast(cblack[c]) < black_c4[c]) { cblack[c] = black_c4[c]; } } @@ -779,7 +782,7 @@ RawImage::is_ppmThumb() const !thumb_load_raw ); } -void RawImage::getXtransMatrix( char XtransMatrix[6][6]) +void RawImage::getXtransMatrix( int XtransMatrix[6][6]) { for(int row = 0; row < 6; row++) for(int col = 0; col < 6; col++) { @@ -1074,7 +1077,7 @@ DCraw::dcraw_coeff_overrides(const char make[], const char model[], const int is char name[strlen(make) + strlen(model) + 32]; sprintf(name, "%s %s", make, model); - for (int i = 0; i < sizeof table / sizeof(table[0]); i++) { + for (size_t i = 0; i < sizeof table / sizeof(table[0]); i++) { if (strcasecmp(name, table[i].prefix) == 0) { *black_level = table[i].black_level; *white_level = table[i].white_level; diff --git a/rtengine/rawimage.h b/rtengine/rawimage.h index 3f4307054..62752b59c 100644 --- a/rtengine/rawimage.h +++ b/rtengine/rawimage.h @@ -129,14 +129,6 @@ protected: char* profile_data; // Embedded ICC color profile float* allocation; // pointer to allocated memory int maximum_c4[4]; - bool isBayer() const - { - return (filters != 0 && filters != 9); - } - bool isXtrans() const - { - return filters == 9; - } bool isFoveon() const { return is_foveon; @@ -180,13 +172,7 @@ public: eSensorType getSensorType(); void getRgbCam (float rgbcam[3][4]); - void getXtransMatrix ( char xtransMatrix[6][6]); - void clearXtransCblack( ) - { - for(int c = 0; c < 4; c++) { - cblack[c] = 0; - } - } + void getXtransMatrix ( int xtransMatrix[6][6]); unsigned get_filters() const { return filters; @@ -308,16 +294,18 @@ public: return zero_is_bad == 1; } + bool isBayer() const + { + return (filters != 0 && filters != 9); + } + + bool isXtrans() const + { + return filters == 9; + } + public: // dcraw functions - void scale_colors() - { - if(isXtrans()) { - clearXtransCblack( ); - } - - DCraw::scale_colors(); - } void pre_interpolate() { DCraw::pre_interpolate(); diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index f3c9b50f1..551701c73 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -102,9 +102,9 @@ void transLineFuji (const float* const red, const float* const green, const floa int x = fw - i + j; if (x >= 0 && y < image->getHeight() && y >= 0 && x < image->getWidth()) { - image->r(image->getHeight() - 1 - y, image->getWidth() - 1 - x) = red[j]; - image->g(image->getHeight() - 1 - y, image->getWidth() - 1 - x) = green[j]; - image->b(image->getHeight() - 1 - y, image->getWidth() - 1 - x) = blue[j]; + image->r (image->getHeight() - 1 - y, image->getWidth() - 1 - x) = red[j]; + image->g (image->getHeight() - 1 - y, image->getWidth() - 1 - x) = green[j]; + image->b (image->getHeight() - 1 - y, image->getWidth() - 1 - x) = blue[j]; } } @@ -116,9 +116,9 @@ void transLineFuji (const float* const red, const float* const green, const floa int x = fw - i + j; if (x >= 0 && x < image->getHeight() && y >= 0 && y < image->getWidth()) { - image->r(image->getHeight() - 1 - x, y) = red[j]; - image->g(image->getHeight() - 1 - x, y) = green[j]; - image->b(image->getHeight() - 1 - x, y) = blue[j]; + image->r (image->getHeight() - 1 - x, y) = red[j]; + image->g (image->getHeight() - 1 - x, y) = green[j]; + image->b (image->getHeight() - 1 - x, y) = blue[j]; } } @@ -130,9 +130,9 @@ void transLineFuji (const float* const red, const float* const green, const floa int x = fw - i + j; if (x >= 0 && y < image->getWidth() && y >= 0 && x < image->getHeight()) { - image->r(x, image->getWidth() - 1 - y) = red[j]; - image->g(x, image->getWidth() - 1 - y) = green[j]; - image->b(x, image->getWidth() - 1 - y) = blue[j]; + image->r (x, image->getWidth() - 1 - y) = red[j]; + image->g (x, image->getWidth() - 1 - y) = green[j]; + image->b (x, image->getWidth() - 1 - y) = blue[j]; } } @@ -145,9 +145,9 @@ void transLineFuji (const float* const red, const float* const green, const floa int x = fw - i + j; if (x >= 0 && y < image->getHeight() && y >= 0 && x < image->getWidth()) { - image->r(y, x) = red[j]; - image->g(y, x) = green[j]; - image->b(y, x) = blue[j]; + image->r (y, x) = red[j]; + image->g (y, x) = green[j]; + image->b (y, x) = blue[j]; } } } @@ -425,25 +425,6 @@ RawImageSource::RawImageSource () : ImageSource() , W (0), H (0) , plistener (nullptr) - , border (4) - , ri (nullptr) - , cache (nullptr) - , rawData (0, 0) - , green (0, 0) - , red (0, 0) - , blue (0, 0) - , lc00 (0.0) - , lc01 (0.0) - , lc02 (0.0) - , lc10 (0.0) - , lc11 (0.0) - , lc12 (0.0) - , lc20 (0.0) - , lc21 (0.0) - , lc22 (0.0) - , hlmax{} - , clmax{} - , chmax{} , scale_mul{} , c_black{} , c_white{} @@ -458,10 +439,29 @@ RawImageSource::RawImageSource () , cam_xyz{} , fuji (false) , d1x (false) + , border (4) + , chmax{} + , hlmax{} + , clmax{} , initialGain (0.0) , camInitialGain (0.0) , defGain (0.0) + , ri (nullptr) + , lc00 (0.0) + , lc01 (0.0) + , lc02 (0.0) + , lc10 (0.0) + , lc11 (0.0) + , lc12 (0.0) + , lc20 (0.0) + , lc21 (0.0) + , lc22 (0.0) + , cache (nullptr) , threshold (0) + , rawData (0, 0) + , green (0, 0) + , red (0, 0) + , blue (0, 0) { camProfile = nullptr; embProfile = nullptr; @@ -475,11 +475,11 @@ RawImageSource::~RawImageSource () delete idata; - for(size_t i = 0; i < numFrames; ++i) { + for (size_t i = 0; i < numFrames; ++i) { delete riFrames[i]; } - for(size_t i = 0; i < numFrames - 1; ++i) { + for (size_t i = 0; i < numFrames - 1; ++i) { delete rawDataBuffer[i]; } @@ -532,44 +532,44 @@ void RawImageSource::transformRect (PreviewProps pp, int tran, int &ssx1, int &s sh = w; } - if( pp_width > sw - 2 * border) { + if ( pp_width > sw - 2 * border) { pp_width = sw - 2 * border; } - if( pp_height > sh - 2 * border) { + if ( pp_height > sh - 2 * border) { pp_height = sh - 2 * border; } int ppx = pp_x, ppy = pp_y; if (tran & TR_HFLIP) { - ppx = sw - pp_x - pp_width; + ppx = max (sw - pp_x - pp_width, 0); } if (tran & TR_VFLIP) { - ppy = sh - pp_y - pp_height; + ppy = max (sh - pp_y - pp_height, 0); } int sx1 = ppx; // assuming it's >=0 int sy1 = ppy; // assuming it's >=0 - int sx2 = max(ppx + pp_width, w - 1); - int sy2 = max(ppy + pp_height, h - 1); + int sx2 = min (ppx + pp_width, w - 1); + int sy2 = min (ppy + pp_height, h - 1); if ((tran & TR_ROT) == TR_R180) { - sx1 = max(w - ppx - pp_width, 0); - sy1 = max(h - ppy - pp_height, 0); - sx2 = min(sx1 + pp_width, w - 1); - sy2 = min(sy1 + pp_height, h - 1); + sx1 = max (w - ppx - pp_width, 0); + sy1 = max (h - ppy - pp_height, 0); + sx2 = min (sx1 + pp_width, w - 1); + sy2 = min (sy1 + pp_height, h - 1); } else if ((tran & TR_ROT) == TR_R90) { sx1 = ppy; - sy1 = max(h - ppx - pp_width, 0); - sx2 = min(sx1 + pp_height, w - 1); - sy2 = min(sy1 + pp_width, h - 1); + sy1 = max (h - ppx - pp_width, 0); + sx2 = min (sx1 + pp_height, w - 1); + sy2 = min (sy1 + pp_width, h - 1); } else if ((tran & TR_ROT) == TR_R270) { - sx1 = max(w - ppy - pp_height, 0); + sx1 = max (w - ppy - pp_height, 0); sy1 = ppx; - sx2 = min(sx1 + pp_height, w - 1); - sy2 = min(sy1 + pp_width, h - 1); + sx2 = min (sx1 + pp_height, w - 1); + sy2 = min (sy1 + pp_width, h - 1); } if (fuji) { @@ -672,7 +672,7 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima defGain = 0.0; // compute image area to render in order to provide the requested part of the image - int sx1, sy1, imwidth, imheight, fw, d1xHeightOdd; + int sx1, sy1, imwidth, imheight, fw, d1xHeightOdd = 0; transformRect (pp, tran, sx1, sy1, imwidth, imheight, fw); // check possible overflows @@ -707,7 +707,7 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima if (fuji) { // zero image to avoid access to uninitialized values in further processing because fuji super-ccd processing is not clean... for (int i = 0; i < image->getHeight(); ++i) { for (int j = 0; j < image->getWidth(); ++j) { - image->r(i, j) = image->g(i, j) = image->b(i, j) = 0; + image->r (i, j) = image->g (i, j) = image->b (i, j) = 0; } } } @@ -748,7 +748,7 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima if (ri->getSensorType() == ST_BAYER || ri->getSensorType() == ST_FUJI_XTRANS || ri->get_colors() == 1) { for (int j = 0, jx = sx1; j < imwidth; j++, jx += skip) { - jx = jx >= (maxx - skip) ? jx = maxx - skip - 1 : jx; // avoid trouble + jx = std::min (jx, maxx - skip - 1); // avoid trouble float rtot = 0.f, gtot = 0.f, btot = 0.f; @@ -835,9 +835,9 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima // first row for (int j = 1 + a; j < image->getWidth() - 1; j += 2) { - image->r(0, j) = (image->r(1, j) + image->r(0, j + 1) + image->r(0, j - 1)) / 3; - image->g(0, j) = (image->g(1, j) + image->g(0, j + 1) + image->g(0, j - 1)) / 3; - image->b(0, j) = (image->b(1, j) + image->b(0, j + 1) + image->b(0, j - 1)) / 3; + image->r (0, j) = (image->r (1, j) + image->r (0, j + 1) + image->r (0, j - 1)) / 3; + image->g (0, j) = (image->g (1, j) + image->g (0, j + 1) + image->g (0, j - 1)) / 3; + image->b (0, j) = (image->b (1, j) + image->b (0, j + 1) + image->b (0, j - 1)) / 3; } // other rows @@ -862,9 +862,9 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima // last pixel if (2 - (a + i + image->getWidth()) % 2 == 2) { - image->r(i, image->getWidth() - 1) = (image->r(i + 1, image->getWidth() - 1) + image->r(i - 1, image->getWidth() - 1) + image->r(i, image->getWidth() - 2)) / 3; - image->g(i, image->getWidth() - 1) = (image->g(i + 1, image->getWidth() - 1) + image->g(i - 1, image->getWidth() - 1) + image->g(i, image->getWidth() - 2)) / 3; - image->b(i, image->getWidth() - 1) = (image->b(i + 1, image->getWidth() - 1) + image->b(i - 1, image->getWidth() - 1) + image->b(i, image->getWidth() - 2)) / 3; + image->r (i, image->getWidth() - 1) = (image->r (i + 1, image->getWidth() - 1) + image->r (i - 1, image->getWidth() - 1) + image->r (i, image->getWidth() - 2)) / 3; + image->g (i, image->getWidth() - 1) = (image->g (i + 1, image->getWidth() - 1) + image->g (i - 1, image->getWidth() - 1) + image->g (i, image->getWidth() - 2)) / 3; + image->b (i, image->getWidth() - 1) = (image->b (i + 1, image->getWidth() - 1) + image->b (i - 1, image->getWidth() - 1) + image->b (i, image->getWidth() - 2)) / 3; } } @@ -872,9 +872,9 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima int b = (a == 1 && image->getHeight() % 2) || (a == 0 && image->getHeight() % 2 == 0); for (int j = 1 + b; j < image->getWidth() - 1; j += 2) { - image->r(image->getHeight() - 1, j) = (image->r(image->getHeight() - 2, j) + image->r(image->getHeight() - 1, j + 1) + image->r(image->getHeight() - 1, j - 1)) / 3; - image->g(image->getHeight() - 1, j) = (image->g(image->getHeight() - 2, j) + image->g(image->getHeight() - 1, j + 1) + image->g(image->getHeight() - 1, j - 1)) / 3; - image->b(image->getHeight() - 1, j) = (image->b(image->getHeight() - 2, j) + image->b(image->getHeight() - 1, j + 1) + image->b(image->getHeight() - 1, j - 1)) / 3; + image->r (image->getHeight() - 1, j) = (image->r (image->getHeight() - 2, j) + image->r (image->getHeight() - 1, j + 1) + image->r (image->getHeight() - 1, j - 1)) / 3; + image->g (image->getHeight() - 1, j) = (image->g (image->getHeight() - 2, j) + image->g (image->getHeight() - 1, j + 1) + image->g (image->getHeight() - 1, j - 1)) / 3; + image->b (image->getHeight() - 1, j) = (image->b (image->getHeight() - 2, j) + image->b (image->getHeight() - 1, j + 1) + image->b (image->getHeight() - 1, j - 1)) / 3; } } @@ -888,14 +888,19 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima } // Colour correction (only when running on full resolution) - if(pp.getSkip() == 1) { - switch(ri->getSensorType()) { + if (pp.getSkip() == 1) { + switch (ri->getSensorType()) { case ST_BAYER: processFalseColorCorrection (image, raw.bayersensor.ccSteps); break; case ST_FUJI_XTRANS: processFalseColorCorrection (image, raw.xtranssensor.ccSteps); + break; + + case ST_FOVEON: + case ST_NONE: + break; } } } @@ -908,8 +913,9 @@ DCPProfile *RawImageSource::getDCP (const ColorManagementParams &cmp, ColorTemp if (dcpProf == nullptr) { if (settings->verbose) { - printf("Can't load DCP profile '%s'!\n", cmp.input.c_str()); + printf ("Can't load DCP profile '%s'!\n", cmp.input.c_str()); } + return nullptr; } @@ -928,7 +934,7 @@ void RawImageSource::convertColorSpace (Imagefloat* image, const ColorManagement /* interpolateBadPixelsBayer: correct raw pixels looking at the bitmap * takes into consideration if there are multiple bad pixels in the neighbourhood */ -int RawImageSource::interpolateBadPixelsBayer( PixelsMap &bitmapBads, array2D &rawData ) +int RawImageSource::interpolateBadPixelsBayer ( PixelsMap &bitmapBads, array2D &rawData ) { static const float eps = 1.f; int counter = 0; @@ -1169,8 +1175,7 @@ int RawImageSource::interpolateBadPixelsXtrans ( PixelsMap &bitmapBads ) } float wtdsum = 0.f, norm = 0.f; - int pixelColor = ri->XTRANSFC (row, col); - float oldval = rawData[row][col]; + unsigned int pixelColor = ri->XTRANSFC (row, col); if (pixelColor == 1) { // green channel. A green pixel can either be a solitary green pixel or a member of a 2x2 square of green pixels @@ -1520,17 +1525,19 @@ int RawImageSource::load (const Glib::ustring &fname, int imageNum, bool batch) plistener->setProgressStr ("Decoding..."); plistener->setProgress (0.0); } - ri = new RawImage(fname); + + ri = new RawImage (fname); int errCode = ri->loadRaw (false, 0, false); if (errCode) { return errCode; } + numFrames = ri->getFrameCount(); errCode = 0; - if(numFrames > 1) { + if (numFrames > 1) { #ifdef _OPENMP #pragma omp parallel #endif @@ -1539,15 +1546,18 @@ int RawImageSource::load (const Glib::ustring &fname, int imageNum, bool batch) #ifdef _OPENMP #pragma omp for nowait #endif - for(unsigned int i = 0; i < numFrames; ++i) { - if(i == 0) { + + for (unsigned int i = 0; i < numFrames; ++i) + { + if (i == 0) { riFrames[i] = ri; errCodeThr = riFrames[i]->loadRaw (true, i, true, plistener, 0.8); } else { - riFrames[i] = new RawImage(fname); + riFrames[i] = new RawImage (fname); errCodeThr = riFrames[i]->loadRaw (true, i); } } + #ifdef _OPENMP #pragma omp critical #endif @@ -1560,16 +1570,16 @@ int RawImageSource::load (const Glib::ustring &fname, int imageNum, bool batch) errCode = riFrames[0]->loadRaw (true, 0, true, plistener, 0.8); } - if(!errCode) { - for(unsigned int i = 0; i < numFrames; ++i) { - riFrames[i]->compress_image(i); + if (!errCode) { + for (unsigned int i = 0; i < numFrames; ++i) { + riFrames[i]->compress_image (i); } } else { return errCode; } - if(numFrames > 1 ) { // this disables multi frame support for Fuji S5 until I found a solution to handle different dimensions - if(riFrames[0]->get_width() != riFrames[1]->get_width() || riFrames[0]->get_height() != riFrames[1]->get_height()) { + if (numFrames > 1 ) { // this disables multi frame support for Fuji S5 until I found a solution to handle different dimensions + if (riFrames[0]->get_width() != riFrames[1]->get_width() || riFrames[0]->get_height() != riFrames[1]->get_height()) { numFrames = 1; } } @@ -1685,7 +1695,7 @@ int RawImageSource::load (const Glib::ustring &fname, int imageNum, bool batch) initialGain = 1.0 / min(pre_mul[0], pre_mul[1], pre_mul[2]); }*/ - for(unsigned int i = 0;i < numFrames; ++i) { + for (unsigned int i = 0; i < numFrames; ++i) { riFrames[i]->set_prefilters(); } @@ -1779,24 +1789,27 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le printf ( "Flat Field Correction:%s\n", rif->get_filename().c_str()); } - if(numFrames == 4) { + if (numFrames == 4) { int bufferNumber = 0; - for(int i=0; i<4; ++i) { - if(i==currFrame) { - copyOriginalPixels(raw, ri, rid, rif, rawData); + + for (unsigned int i = 0; i < 4; ++i) { + if (i == currFrame) { + copyOriginalPixels (raw, ri, rid, rif, rawData); rawDataFrames[i] = &rawData; } else { - if(!rawDataBuffer[bufferNumber]) { + if (!rawDataBuffer[bufferNumber]) { rawDataBuffer[bufferNumber] = new array2D; } + rawDataFrames[i] = rawDataBuffer[bufferNumber]; ++bufferNumber; - copyOriginalPixels(raw, riFrames[i], rid, rif, *rawDataFrames[i]); + copyOriginalPixels (raw, riFrames[i], rid, rif, *rawDataFrames[i]); } } } else { - copyOriginalPixels(raw, ri, rid, rif, rawData); + copyOriginalPixels (raw, ri, rid, rif, rawData); } + //FLATFIELD end @@ -1836,12 +1849,12 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le } } - if(numFrames == 4) { - for(int i=0; i<4; ++i) { - scaleColors( 0, 0, W, H, raw, *rawDataFrames[i]); + if (numFrames == 4) { + for (int i = 0; i < 4; ++i) { + scaleColors ( 0, 0, W, H, raw, *rawDataFrames[i]); } } else { - scaleColors( 0, 0, W, H, raw, rawData); //+ + raw parameters for black level(raw.blackxx) + scaleColors ( 0, 0, W, H, raw, rawData); //+ + raw parameters for black level(raw.blackxx) } // Correct vignetting of lens profile @@ -1852,14 +1865,14 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le LCPMapper map (pLCPProf, max (idata->getFocalLen(), 1.0), idata->getFocalLen35mm(), idata->getFocusDist(), idata->getFNumber(), true, false, W, H, coarse, -1); if (ri->getSensorType() == ST_BAYER || ri->getSensorType() == ST_FUJI_XTRANS || ri->get_colors() == 1) { - if(numFrames == 4) { - for(int i = 0; i < 4; ++i) { + if (numFrames == 4) { + for (int i = 0; i < 4; ++i) { #ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) + #pragma omp parallel for schedule(dynamic,16) #endif for (int y = 0; y < H; y++) { - map.processVignetteLine(W, y, (*rawDataFrames[i])[y]); + map.processVignetteLine (W, y, (*rawDataFrames[i])[y]); } } } else { @@ -1869,16 +1882,16 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le #endif for (int y = 0; y < H; y++) { - map.processVignetteLine(W, y, rawData[y]); + map.processVignetteLine (W, y, rawData[y]); } } - } else if(ri->get_colors() == 3) { + } else if (ri->get_colors() == 3) { #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif for (int y = 0; y < H; y++) { - map.processVignetteLine3Channels(W, y, rawData[y]); + map.processVignetteLine3Channels (W, y, rawData[y]); } } } @@ -1948,24 +1961,24 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le plistener->setProgress (0.0); } - if(numFrames == 4) { - for(int i = 0; i < 4; ++i) { - green_equilibrate(0.01 * (raw.bayersensor.greenthresh), *rawDataFrames[i]); + if (numFrames == 4) { + for (int i = 0; i < 4; ++i) { + green_equilibrate (0.01 * (raw.bayersensor.greenthresh), *rawDataFrames[i]); } } else { - green_equilibrate(0.01 * (raw.bayersensor.greenthresh), rawData); + green_equilibrate (0.01 * (raw.bayersensor.greenthresh), rawData); } } if ( totBP ) { if ( ri->getSensorType() == ST_BAYER ) { - if(numFrames == 4) { - for(int i = 0; i < 4; ++i) { - interpolateBadPixelsBayer( *bitmapBads, *rawDataFrames[i] ); + if (numFrames == 4) { + for (int i = 0; i < 4; ++i) { + interpolateBadPixelsBayer ( *bitmapBads, *rawDataFrames[i] ); } } else { - interpolateBadPixelsBayer( *bitmapBads, rawData ); + interpolateBadPixelsBayer ( *bitmapBads, rawData ); } } else if ( ri->getSensorType() == ST_FUJI_XTRANS ) { interpolateBadPixelsXtrans ( *bitmapBads ); @@ -1988,22 +2001,23 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le plistener->setProgressStr ("CA Auto Correction..."); plistener->setProgress (0.0); } - if(numFrames == 4) { - for(int i=0; i<4; ++i) { - CA_correct_RT(raw.ca_autocorrect, raw.cared, raw.cablue, 10.0 - raw.caautostrength, *rawDataFrames[i]); + + if (numFrames == 4) { + for (int i = 0; i < 4; ++i) { + CA_correct_RT (raw.ca_autocorrect, raw.cared, raw.cablue, 10.0 - raw.caautostrength, *rawDataFrames[i]); } } else { - CA_correct_RT(raw.ca_autocorrect, raw.cared, raw.cablue, 10.0 - raw.caautostrength, rawData); + CA_correct_RT (raw.ca_autocorrect, raw.cared, raw.cablue, 10.0 - raw.caautostrength, rawData); } } if ( raw.expos != 1 ) { - if(numFrames == 4) { - for(int i = 0; i < 4; ++i) { - processRawWhitepoint(raw.expos, raw.preser, *rawDataFrames[i]); + if (numFrames == 4) { + for (int i = 0; i < 4; ++i) { + processRawWhitepoint (raw.expos, raw.preser, *rawDataFrames[i]); } } else { - processRawWhitepoint(raw.expos, raw.preser, rawData); + processRawWhitepoint (raw.expos, raw.preser, rawData); } } @@ -2045,7 +2059,7 @@ void RawImageSource::demosaic (const RAWParams &raw) } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::amaze] ) { amaze_demosaic_RT (0, 0, W, H, rawData, red, green, blue); } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::pixelshift] ) { - pixelshift(0, 0, W, H, raw.bayersensor, currFrame, ri->get_model(), raw.expos); + pixelshift (0, 0, W, H, raw.bayersensor, currFrame, ri->get_model(), raw.expos); } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::dcb] ) { dcb_demosaic (raw.bayersensor.dcb_iterations, raw.bayersensor.dcb_enhance); } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::eahd]) { @@ -2053,7 +2067,7 @@ void RawImageSource::demosaic (const RAWParams &raw) } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::igv]) { igv_interpolate (W, H); } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::lmmse]) { - lmmse_interpolate_omp(W, H, rawData, red, green, blue, raw.bayersensor.lmmse_iterations); + lmmse_interpolate_omp (W, H, rawData, red, green, blue, raw.bayersensor.lmmse_iterations); } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::fast] ) { fast_demosaic (0, 0, W, H); } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::mono] ) { @@ -2106,7 +2120,7 @@ void RawImageSource::retinexPrepareBuffers (ColorManagementParams cmp, RetinexPa conversionBuffer[2] (W - 2 * border, H - 2 * border); conversionBuffer[3] (W - 2 * border, H - 2 * border); - LUTf *retinexgamtab;//gamma before and after Retinex to restore tones + LUTf *retinexgamtab = nullptr;//gamma before and after Retinex to restore tones LUTf lutTonereti; if (retinexParams.gammaretinex == "low") { @@ -2379,7 +2393,7 @@ void RawImageSource::retinex (ColorManagementParams cmp, RetinexParams deh, Tone LUTf lutToneireti; lutToneireti (65536); - LUTf *retinexigamtab;//gamma before and after Retinex to restore tones + LUTf *retinexigamtab = nullptr;//gamma before and after Retinex to restore tones if (deh.gammaretinex == "low") { retinexigamtab = & (Color::igammatab_115_2); @@ -2839,7 +2853,7 @@ void RawImageSource::processFlatField (const RAWParams &raw, RawImage *riFlatFil float limitFactor = 1.f; if (raw.ff_AutoClipControl) { - int clipControlGui = 0; +// int clipControlGui = 0; for (int m = 0; m < 2; m++) for (int n = 0; n < 2; n++) { @@ -2884,7 +2898,7 @@ void RawImageSource::processFlatField (const RAWParams &raw, RawImage *riFlatFil } } - clipControlGui = (1.f - limitFactor) * 100.f; // this value can be used to set the clip control slider in gui +// clipControlGui = (1.f - limitFactor) * 100.f; // this value can be used to set the clip control slider in gui } else { limitFactor = max ((float) (100 - raw.ff_clipControl) / 100.f, 0.01f); } @@ -3092,7 +3106,7 @@ void RawImageSource::processFlatField (const RAWParams &raw, RawImage *riFlatFil /* Copy original pixel data and * subtract dark frame (if present) from current image and apply flat field correction (if present) */ -void RawImageSource::copyOriginalPixels(const RAWParams &raw, RawImage *src, RawImage *riDark, RawImage *riFlatFile, array2D &rawData ) +void RawImageSource::copyOriginalPixels (const RAWParams &raw, RawImage *src, RawImage *riDark, RawImage *riFlatFile, array2D &rawData ) { // TODO: Change type of black[] to float to avoid conversions unsigned short black[4] = { @@ -3423,7 +3437,7 @@ SSEFUNCTION void RawImageSource::cfaboxblur (RawImage *riFlatFile, float* cfablu // Scale original pixels into the range 0 65535 using black offsets and multipliers -void RawImageSource::scaleColors(int winx, int winy, int winw, int winh, const RAWParams &raw, array2D &rawData) +void RawImageSource::scaleColors (int winx, int winy, int winw, int winh, const RAWParams &raw, array2D &rawData) { chmax[0] = chmax[1] = chmax[2] = chmax[3] = 0; //channel maxima float black_lev[4] = {0.f};//black level @@ -4017,7 +4031,7 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, ColorManagementParam // Initialize transform cmsHTRANSFORM hTransform; - cmsHPROFILE prophoto = ICCStore::getInstance()->workingSpace("ProPhoto"); // We always use Prophoto to apply the ICC profile to minimize problems with clipping in LUT conversion. + cmsHPROFILE prophoto = ICCStore::getInstance()->workingSpace ("ProPhoto"); // We always use Prophoto to apply the ICC profile to minimize problems with clipping in LUT conversion. bool transform_via_pcs_lab = false; bool separate_pcs_lab_highlights = false; lcmsMutex->lock (); @@ -4071,21 +4085,21 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, ColorManagementParam #pragma omp parallel #endif { - AlignedBuffer buffer(im->getWidth() * 3); - AlignedBuffer hl_buffer(im->getWidth() * 3); - AlignedBuffer hl_scale(im->getWidth()); + AlignedBuffer buffer (im->getWidth() * 3); + AlignedBuffer hl_buffer (im->getWidth() * 3); + AlignedBuffer hl_scale (im->getWidth()); #ifdef _OPENMP #pragma omp for schedule(static) #endif for ( int h = 0; h < im->getHeight(); ++h ) { - float *p = buffer.data, *pR = im->r(h), *pG = im->g(h), *pB = im->b(h); + float *p = buffer.data, *pR = im->r (h), *pG = im->g (h), *pB = im->b (h); // Apply pre-processing for ( int w = 0; w < im->getWidth(); ++w ) { - float r = *(pR++); - float g = *(pG++); - float b = *(pB++); + float r = * (pR++); + float g = * (pG++); + float b = * (pB++); // convert to 0-1 range as LCMS expects that r /= 65535.0f; @@ -4277,7 +4291,7 @@ bool RawImageSource::findInputProfile (Glib::ustring inProfile, cmsHPROFILE embe *dcpProf = DCPStore::getInstance()->getStdProfile (camName); if (*dcpProf == nullptr) { - in = ICCStore::getInstance()->getStdProfile(camName); + in = ICCStore::getInstance()->getStdProfile (camName); } } else if (inProfile != "(camera)" && inProfile != "") { Glib::ustring normalName = inProfile; @@ -5017,7 +5031,7 @@ ColorTemp RawImageSource::getSpotWB (std::vector &red, std::vectorgetSensorType() != ST_BAYER) { if (ri->getSensorType() == ST_FUJI_XTRANS) { @@ -5208,7 +5222,7 @@ ColorTemp RawImageSource::getSpotWB (std::vector &red, std::vector cInversePoints; cInversePoints.push_back (double (DCT_Spline)); // The first value is the curve type - for (int i = 0; i < sizeof (phase_one_forward) / sizeof (phase_one_forward[0]); i += 2) { + for (unsigned int i = 0; i < sizeof (phase_one_forward) / sizeof (phase_one_forward[0]); i += 2) { cForwardPoints.push_back (phase_one_forward[i + 0]); cForwardPoints.push_back (phase_one_forward[i + 1]); cInversePoints.push_back (phase_one_forward[i + 1]); @@ -5353,33 +5367,41 @@ void RawImageSource::init () } } -void RawImageSource::getRawValues(int x, int y, int rotate, int &R, int &G, int &B) +void RawImageSource::getRawValues (int x, int y, int rotate, int &R, int &G, int &B) { int xnew = x + border; int ynew = y + border; rotate += ri->get_rotateDegree(); rotate %= 360; + if (rotate == 90) { - std::swap(xnew,ynew); + std::swap (xnew, ynew); ynew = H - 1 - ynew; } else if (rotate == 180) { xnew = W - 1 - xnew; ynew = H - 1 - ynew; } else if (rotate == 270) { - std::swap(xnew,ynew); + std::swap (xnew, ynew); ynew = H - 1 - ynew; xnew = W - 1 - xnew; ynew = H - 1 - ynew; } - int c = ri->getSensorType() == ST_FUJI_XTRANS ? ri->XTRANSFC(ynew,xnew) : ri->FC(ynew,xnew); - int val = round(rawData[ynew][xnew] / scale_mul[c]); - if(c == 0) { - R = val; G = 0; B = 0; - } else if(c == 2) { - R = 0; G = 0; B = val; + int c = ri->getSensorType() == ST_FUJI_XTRANS ? ri->XTRANSFC (ynew, xnew) : ri->FC (ynew, xnew); + int val = round (rawData[ynew][xnew] / scale_mul[c]); + + if (c == 0) { + R = val; + G = 0; + B = 0; + } else if (c == 2) { + R = 0; + G = 0; + B = val; } else { - R = 0; G = val; B = 0; + R = 0; + G = val; + B = 0; } } diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index 212b2e4ac..0874ea482 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -483,6 +483,7 @@ class ProcessingJob { public: + virtual ~ProcessingJob() {} /** Creates a processing job from a file name. This function always succeeds. It only stores the data into the ProcessingJob class, it does not load * the image thus it returns immediately. @@ -490,7 +491,7 @@ public: * @param isRaw shall be true if it is a raw file * @param pparams is a struct containing the processing parameters * @return an object containing the data above. It can be passed to the functions that do the actual image processing. */ - static ProcessingJob* create (const Glib::ustring& fname, bool isRaw, const procparams::ProcParams& pparams); + static ProcessingJob* create (const Glib::ustring& fname, bool isRaw, const procparams::ProcParams& pparams, bool fast=false); /** Creates a processing job from a file name. This function always succeeds. It only stores the data into the ProcessingJob class, it does not load * the image thus it returns immediately. This function increases the reference count of the initialImage. If you decide not the process the image you @@ -499,12 +500,14 @@ public: * @param initialImage is a loaded and pre-processed initial image * @param pparams is a struct containing the processing parameters * @return an object containing the data above. It can be passed to the functions that do the actual image processing. */ - static ProcessingJob* create (InitialImage* initialImage, const procparams::ProcParams& pparams); + static ProcessingJob* create (InitialImage* initialImage, const procparams::ProcParams& pparams, bool fast=false); /** Cancels and destroys a processing job. The reference count of the corresponding initialImage (if any) is decreased. After the call of this function the ProcessingJob instance * gets invalid, you must not use it any more. Dont call this function while the job is being processed. * @param job is the job to destroy */ static void destroy (ProcessingJob* job); + + virtual bool fastPipeline() const = 0; }; /** This function performs all the image processinf steps corresponding to the given ProcessingJob. It returns when it is ready, so it can be slow. diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 2519df3f3..f7f899bd6 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -37,8 +37,6 @@ #include "../rtgui/ppversion.h" #include "improccoordinator.h" #include -//#define BENCHMARK -#include "StopWatch.h" namespace @@ -50,7 +48,7 @@ namespace return false; } - const std::size_t length = + const ssize_t length = fdata(raw_image.get_thumbOffset(), raw_image.get_file())[1] != 0xD8 && raw_image.is_ppmThumb() ? raw_image.get_thumbWidth() * raw_image.get_thumbHeight() * (raw_image.get_thumbBPS() / 8) * 3 : raw_image.get_thumbLength(); @@ -58,6 +56,74 @@ namespace return raw_image.get_thumbOffset() + length <= raw_image.get_file()->size; } + +void scale_colors(rtengine::RawImage *ri, float scale_mul[4], float cblack[4]) +{ + DCraw::dcrawImage_t image = ri->get_image(); + if(ri->isBayer()) { + const int height = ri->get_iheight(); + const int width = ri->get_iwidth(); + for(int row = 0; row < height; ++row) { + unsigned c0 = ri->FC(row,0); + unsigned c1 = ri->FC(row,1); + int col = 0; + for(; col < width - 1; col += 2) { + float val0 = image[row * width + col][c0]; + float val1 = image[row * width + col + 1][c1]; + val0 -= cblack[c0]; + val1 -= cblack[c1]; + val0 *= scale_mul[c0]; + val1 *= scale_mul[c1]; + image[row * width + col][c0] = rtengine::CLIP(val0); + image[row * width + col + 1][c1] = rtengine::CLIP(val1); + } + if(col < width) { // in case width is odd + float val0 = image[row * width + col][c0]; + val0 -= cblack[c0]; + val0 *= scale_mul[c0]; + image[row * width + col][c0] = rtengine::CLIP(val0); + } + } + } else if(ri->isXtrans()) { + const int height = ri->get_iheight(); + const int width = ri->get_iwidth(); + unsigned c[6]; + for(int row = 0; row < height; ++row) { + for(int i = 0; i < 6; ++i) { + c[i] = ri->XTRANSFC(row,i); + } + + int col = 0; + for(; col < width - 5; col += 6) { + for(int i = 0; i < 6; ++i) { + const unsigned ccol = c[i]; + float val = image[row * width + col + i][ccol]; + val -= cblack[ccol]; + val *= scale_mul[ccol]; + image[row * width + col + i][ccol] = rtengine::CLIP(val); + } + } + for(; col < width; ++col) { // remaining columns + const unsigned ccol = ri->XTRANSFC(row,col); + float val = image[row * width + col][ccol]; + val -= cblack[ccol]; + val *= scale_mul[ccol]; + image[row * width + col][ccol] = rtengine::CLIP(val); + } + } + } else { + const int size = ri->get_iheight() * ri->get_iwidth(); + for (int i = 0; i < size; ++i) { + for (int j = 0; j < 4; ++j) { + float val = image[i][j]; + val -= cblack[j]; + val *= scale_mul[j]; + image[i][j] = rtengine::CLIP(val); + } + } + } +} + } extern Options options; @@ -254,7 +320,7 @@ Thumbnail* Thumbnail::loadQuickFromRaw (const Glib::ustring& fname, RawMetaDataL std::string fname = ri->get_filename(); std::string suffix = fname.length() > 4 ? fname.substr(fname.length() - 3) : ""; - for (int i = 0; i < suffix.length(); i++) { + for (unsigned int i = 0; i < suffix.length(); i++) { suffix[i] = std::tolower(suffix[i]); } @@ -333,17 +399,23 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati tpp->greenMultiplier = ri->get_pre_mul(1); tpp->blueMultiplier = ri->get_pre_mul(2); - ri->scale_colors(); + //ri->scale_colors(); + float pre_mul[4], scale_mul[4], cblack[4]; + ri->get_colorsCoeff(pre_mul, scale_mul, cblack, false); + scale_colors(ri, scale_mul, cblack); + ri->pre_interpolate(); rml.exifBase = ri->get_exifBase(); rml.ciffBase = ri->get_ciffBase(); rml.ciffLength = ri->get_ciffLen(); - tpp->camwbRed = tpp->redMultiplier / ri->get_pre_mul(0); - tpp->camwbGreen = tpp->greenMultiplier / ri->get_pre_mul(1); - tpp->camwbBlue = tpp->blueMultiplier / ri->get_pre_mul(2); - tpp->defGain = 1.0 / min(ri->get_pre_mul(0), ri->get_pre_mul(1), ri->get_pre_mul(2)); + tpp->camwbRed = tpp->redMultiplier / pre_mul[0]; //ri->get_pre_mul(0); + tpp->camwbGreen = tpp->greenMultiplier / pre_mul[1]; //ri->get_pre_mul(1); + tpp->camwbBlue = tpp->blueMultiplier / pre_mul[2]; //ri->get_pre_mul(2); + //tpp->defGain = 1.0 / min(ri->get_pre_mul(0), ri->get_pre_mul(1), ri->get_pre_mul(2)); + tpp->defGain = max(scale_mul[0], scale_mul[1], scale_mul[2], scale_mul[3]) / min(scale_mul[0], scale_mul[1], scale_mul[2], scale_mul[3]); + tpp->gammaCorrected = true; unsigned filter = ri->get_filters(); @@ -500,8 +572,8 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati for (int row = 0; row < high; row++) for (int col = 0; col < wide; col++) { - unsigned ur = r = fw + (row - col) * step; - unsigned uc = c = (row + col) * step; + int ur = r = fw + (row - col) * step; + int uc = c = (row + col) * step; if (ur > tmph - 2 || uc > tmpw - 2) { continue; @@ -779,17 +851,33 @@ void Thumbnail::init () } Thumbnail::Thumbnail () : - iColorMatrix{}, cam2xyz{}, scale(1.0), colorMatrix{}, isRaw(true), - camProfile(nullptr), thumbImg(nullptr), - camwbRed(1.0), camwbGreen(1.0), camwbBlue(1.0), - redAWBMul(-1.0), greenAWBMul(-1.0), blueAWBMul(-1.0), - autoWBTemp(2700), autoWBGreen(1.0), wbEqual(-1.0), wbTempBias(0.0), - embProfileLength(0), embProfileData(nullptr), embProfile(nullptr), - redMultiplier(1.0), greenMultiplier(1.0), blueMultiplier(1.0), + camProfile(nullptr), + iColorMatrix{}, + cam2xyz{}, + thumbImg(nullptr), + camwbRed(1.0), + camwbGreen(1.0), + camwbBlue(1.0), + redAWBMul(-1.0), + greenAWBMul(-1.0), + blueAWBMul(-1.0), + autoWBTemp(2700), + autoWBGreen(1.0), + wbEqual(-1.0), + wbTempBias(0.0), + aeHistCompression(3), + embProfileLength(0), + embProfileData(nullptr), + embProfile(nullptr), + redMultiplier(1.0), + greenMultiplier(1.0), + blueMultiplier(1.0), + scale(1.0), defGain(1.0), scaleForSave(8192), gammaCorrected(false), - aeHistCompression(3) + colorMatrix{}, + isRaw(true) { } @@ -843,8 +931,6 @@ IImage8* Thumbnail::quickProcessImage (const procparams::ProcParams& params, int IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rheight, TypeInterpolation interp, std::string camName, double focalLen, double focalLen35mm, float focusDist, float shutter, float fnumber, float iso, std::string expcomp_, double& myscale) { - BENCHFUN - // check if the WB's equalizer value has changed if (wbEqual < (params.wb.equal - 5e-4) || wbEqual > (params.wb.equal + 5e-4) || wbTempBias < (params.wb.tempBias - 5e-4) || wbTempBias > (params.wb.tempBias + 5e-4)) { wbEqual = params.wb.equal; @@ -959,7 +1045,6 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei LUTu hist16 (65536); - double gamma = isRaw ? Color::sRGBGamma : 0; // usually in ImageSource, but we don't have that here ipf.firstAnalysis (baseImg, params, hist16); // perform transform @@ -967,7 +1052,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei Imagefloat* trImg = new Imagefloat (fw, fh); int origFW; int origFH; - double tscale; + double tscale = 0.0; getDimensions(origFW, origFH, tscale); ipf.transform (baseImg, trImg, 0, 0, 0, 0, fw, fh, origFW * tscale + 0.5, origFH * tscale + 0.5, focalLen, focalLen35mm, focusDist, 0, true); // Raw rotate degree not detectable here delete baseImg; @@ -1194,7 +1279,6 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei LUTf CAMBrightCurveQ; float CAMMean; int sk; - int scale; sk = 16; int rtt = 0; CieImage* cieView = new CieImage (fw, fh); diff --git a/rtengine/shmap.cc b/rtengine/shmap.cc index a92264117..26674c906 100644 --- a/rtengine/shmap.cc +++ b/rtengine/shmap.cc @@ -376,7 +376,7 @@ SSEFUNCTION void SHMap::dirpyr_shmap(float ** data_fine, float ** data_coarse, i #endif { #if defined( __SSE2__ ) && defined( __x86_64__ ) - __m128 dirwtv, valv, normv, dftemp1v, dftemp2v, fg; + vfloat dirwtv, valv, normv, dftemp1v, dftemp2v; #endif // __SSE2__ int j; #ifdef _OPENMP @@ -483,7 +483,7 @@ SSEFUNCTION void SHMap::dirpyr_shmap(float ** data_fine, float ** data_coarse, i #endif { #if defined( __SSE2__ ) && defined( __x86_64__ ) - __m128 dirwtv, valv, normv, dftemp1v, dftemp2v, fgg; + vfloat dirwtv, valv, normv, dftemp1v, dftemp2v; float domkerv[5][5][4] ALIGNED16 = {{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}, {{1, 1, 1, 1}, {2, 2, 2, 2}, {2, 2, 2, 2}, {2, 2, 2, 2}, {1, 1, 1, 1}}, {{1, 1, 1, 1}, {2, 2, 2, 2}, {2, 2, 2, 2}, {2, 2, 2, 2}, {1, 1, 1, 1}}, {{1, 1, 1, 1}, {2, 2, 2, 2}, {2, 2, 2, 2}, {2, 2, 2, 2}, {1, 1, 1, 1}}, {{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}; #endif // __SSE2__ diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 12ebd53dc..9c08e9760 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -35,648 +35,723 @@ #include "../rtgui/cachemanager.h" #include "../rtgui/cacheimagedata.h" + #undef THREAD_PRIORITY_NORMAL namespace rtengine { extern const Settings* settings; -IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* pl, bool tunnelMetaData, bool flush) +namespace { - errorCode = 0; +template +void adjust_radius (const T &default_param, double scale_factor, T ¶m) +{ + const double delta = (param - default_param) * scale_factor; + param = default_param + delta; +} - ProcessingJobImpl* job = static_cast (pjob); - if (pl) { - pl->setProgressStr ("PROGRESSBAR_PROCESSING"); - pl->setProgress (0.0); +class ImageProcessor +{ +public: + ImageProcessor (ProcessingJob* pjob, int& errorCode, + ProgressListener* pl, bool tunnelMetaData, bool flush): + job (static_cast (pjob)), + errorCode (errorCode), + pl (pl), + tunnelMetaData (tunnelMetaData), + flush (flush), + // internal state + ipf_p (nullptr), + ii (nullptr), + imgsrc (nullptr), + fw (-1), + fh (-1), + pp (0, 0, 0, 0, 0) + { } - InitialImage* ii = job->initialImage; + Image16 *operator()() + { + if (!job->fast) { + return normal_pipeline(); + } else { + return fast_pipeline(); + } + } - if (!ii) { - ii = InitialImage::load (job->fname, job->isRaw, &errorCode); - - if (errorCode) { - delete job; +private: + Image16 *normal_pipeline() + { + if (!stage_init()) { return nullptr; } + + stage_denoise(); + stage_transform(); + return stage_finish(); } - procparams::ProcParams& params = job->pparams; + Image16 *fast_pipeline() + { + if (!job->pparams.resize.enabled) { + return normal_pipeline(); + } - // acquire image from imagesource - ImageSource* imgsrc = ii->getImageSource (); + pl = nullptr; - int tr = getCoarseBitMask (params.coarse); - int fw, fh; - imgsrc->getFullSize (fw, fh, tr); + if (!stage_init()) { + return nullptr; + } - // check the crop params - if (params.crop.x > fw || params.crop.y > fh) { - // the crop is completely out of the image, so we disable the crop - params.crop.enabled = false; - // and we set the values to the defaults - params.crop.x = 0; - params.crop.y = 0; - params.crop.w = fw; - params.crop.h = fh; - } else { - if (params.crop.x < 0) { + stage_transform(); + stage_early_resize(); + stage_denoise(); + return stage_finish(); + } + + bool stage_init() + { + errorCode = 0; + + if (pl) { + pl->setProgressStr ("PROGRESSBAR_PROCESSING"); + pl->setProgress (0.0); + } + + ii = job->initialImage; + + if (!ii) { + ii = InitialImage::load (job->fname, job->isRaw, &errorCode); + + if (errorCode) { + delete job; + return false; //return nullptr; + } + } + + procparams::ProcParams& params = job->pparams; + + // acquire image from imagesource + imgsrc = ii->getImageSource (); + + tr = getCoarseBitMask (params.coarse); + imgsrc->getFullSize (fw, fh, tr); + + // check the crop params + if (params.crop.x > fw || params.crop.y > fh) { + // the crop is completely out of the image, so we disable the crop + params.crop.enabled = false; + // and we set the values to the defaults params.crop.x = 0; - } - - if (params.crop.y < 0) { params.crop.y = 0; - } + params.crop.w = fw; + params.crop.h = fh; + } else { + if (params.crop.x < 0) { + params.crop.x = 0; + } - if ((params.crop.x + params.crop.w) > fw) { - // crop overflow in the width dimension ; we trim it - params.crop.w = fw - params.crop.x; - } + if (params.crop.y < 0) { + params.crop.y = 0; + } - if ((params.crop.y + params.crop.h) > fh) { - // crop overflow in the height dimension ; we trim it - params.crop.h = fh - params.crop.y; + if ((params.crop.x + params.crop.w) > fw) { + // crop overflow in the width dimension ; we trim it + params.crop.w = fw - params.crop.x; + } + + if ((params.crop.y + params.crop.h) > fh) { + // crop overflow in the height dimension ; we trim it + params.crop.h = fh - params.crop.y; + } } - } // MyTime t1,t2; // t1.set(); - ImProcFunctions ipf (¶ms, true); + ipf_p.reset (new ImProcFunctions (¶ms, true)); + ImProcFunctions &ipf = * (ipf_p.get()); - PreviewProps pp (0, 0, fw, fh, 1); - imgsrc->setCurrentFrame(params.raw.bayersensor.imageNum); - imgsrc->preprocess( params.raw, params.lensProf, params.coarse, params.dirpyrDenoise.enabled); + pp = PreviewProps (0, 0, fw, fh, 1); + imgsrc->setCurrentFrame (params.raw.bayersensor.imageNum); + imgsrc->preprocess ( params.raw, params.lensProf, params.coarse, params.dirpyrDenoise.enabled); - if (params.toneCurve.autoexp) {// this enabled HLRecovery - LUTu histRedRaw (256), histGreenRaw (256), histBlueRaw (256); - imgsrc->getRAWHistogram (histRedRaw, histGreenRaw, histBlueRaw); + if (params.toneCurve.autoexp) {// this enabled HLRecovery + LUTu histRedRaw (256), histGreenRaw (256), histBlueRaw (256); + imgsrc->getRAWHistogram (histRedRaw, histGreenRaw, histBlueRaw); - if (ToneCurveParams::HLReconstructionNecessary (histRedRaw, histGreenRaw, histBlueRaw) && !params.toneCurve.hrenabled) { - params.toneCurve.hrenabled = true; - // WARNING: Highlight Reconstruction is being forced 'on', should we force a method here too? + if (ToneCurveParams::HLReconstructionNecessary (histRedRaw, histGreenRaw, histBlueRaw) && !params.toneCurve.hrenabled) { + params.toneCurve.hrenabled = true; + // WARNING: Highlight Reconstruction is being forced 'on', should we force a method here too? + } } - } - if (pl) { - pl->setProgress (0.20); - } + if (pl) { + pl->setProgress (0.20); + } - imgsrc->demosaic ( params.raw); + imgsrc->demosaic ( params.raw); - if (pl) { - pl->setProgress (0.30); - } + if (pl) { + pl->setProgress (0.30); + } - if (params.retinex.enabled) { //enabled Retinex - LUTf cdcurve (65536, 0); - LUTf mapcurve (65536, 0); - LUTu dummy; - RetinextransmissionCurve dehatransmissionCurve; - RetinexgaintransmissionCurve dehagaintransmissionCurve; - bool dehacontlutili = false; - bool mapcontlutili = false; - bool useHsl = false; + if (params.retinex.enabled) { //enabled Retinex + LUTf cdcurve (65536, 0); + LUTf mapcurve (65536, 0); + LUTu dummy; + RetinextransmissionCurve dehatransmissionCurve; + RetinexgaintransmissionCurve dehagaintransmissionCurve; + bool dehacontlutili = false; + bool mapcontlutili = false; + bool useHsl = false; // multi_array2D conversionBuffer(1, 1); - multi_array2D conversionBuffer (1, 1); - imgsrc->retinexPrepareBuffers (params.icm, params.retinex, conversionBuffer, dummy); - imgsrc->retinexPrepareCurves (params.retinex, cdcurve, mapcurve, dehatransmissionCurve, dehagaintransmissionCurve, dehacontlutili, mapcontlutili, useHsl, dummy, dummy ); - float minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax; - imgsrc->retinex ( params.icm, params.retinex, params.toneCurve, cdcurve, mapcurve, dehatransmissionCurve, dehagaintransmissionCurve, conversionBuffer, dehacontlutili, mapcontlutili, useHsl, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, dummy); - } + multi_array2D conversionBuffer (1, 1); + imgsrc->retinexPrepareBuffers (params.icm, params.retinex, conversionBuffer, dummy); + imgsrc->retinexPrepareCurves (params.retinex, cdcurve, mapcurve, dehatransmissionCurve, dehagaintransmissionCurve, dehacontlutili, mapcontlutili, useHsl, dummy, dummy ); - if (pl) { - pl->setProgress (0.40); - } + float minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax; + imgsrc->retinex ( params.icm, params.retinex, params.toneCurve, cdcurve, mapcurve, dehatransmissionCurve, dehagaintransmissionCurve, conversionBuffer, dehacontlutili, mapcontlutili, useHsl, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, dummy); - imgsrc->HLRecovery_Global ( params.toneCurve ); - - - if (pl) { - pl->setProgress (0.45); - } - - // set the color temperature - ColorTemp currWB = ColorTemp (params.wb.temperature, params.wb.green, params.wb.equal, params.wb.method); - - if (params.wb.method == "Camera") { - currWB = imgsrc->getWB (); - } else if (params.wb.method == "Auto") { - double rm, gm, bm; - imgsrc->getAutoWBMultipliers (rm, gm, bm); - currWB.update (rm, gm, bm, params.wb.equal, params.wb.tempBias); - } - - NoiseCurve noiseLCurve; - NoiseCurve noiseCCurve; - Imagefloat *calclum = nullptr ; - params.dirpyrDenoise.getCurves (noiseLCurve, noiseCCurve); - float autoNR = (float) settings->nrauto;// - float autoNRmax = (float) settings->nrautomax;// - int tilesize; - int overlap; - - if (settings->leveldnti == 0) { - tilesize = 1024; - overlap = 128; - } - - if (settings->leveldnti == 1) { - tilesize = 768; - overlap = 96; - } - - // const int tilesize = 768; - // const int overlap = 96; - int numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip; - ipf.Tile_calc (tilesize, overlap, 2, fw, fh, numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip); - int nbtl = numtiles_W * numtiles_H; - - if ((settings->leveldnautsimpl == 1 && params.dirpyrDenoise.Cmethod == "AUT") || (settings->leveldnautsimpl == 0 && params.dirpyrDenoise.C2method == "AUTO")) { - nbtl = 9; - } - - float *ch_M = new float [nbtl];//allocate memory - float *max_r = new float [nbtl]; - float *max_b = new float [nbtl]; - float *min_b = new float [9]; - float *min_r = new float [9]; - float *lumL = new float [nbtl]; - float *chromC = new float [nbtl]; - float *ry = new float [nbtl]; - float *sk = new float [nbtl]; - float *pcsk = new float [nbtl]; - - // printf("expert=%d\n",settings->leveldnautsimpl); - if (settings->leveldnautsimpl == 1 && params.dirpyrDenoise.Cmethod == "PON") { - MyTime t1pone, t2pone; - t1pone.set(); - int crW, crH; - - if (settings->leveldnv == 0) { - crW = 100; - crH = 100; } - if (settings->leveldnv == 1) { - crW = 250; - crH = 250; + if (pl) { + pl->setProgress (0.40); } - if (settings->leveldnv == 2) { - crW = int (tileWskip / 2); - crH = int (tileHskip / 2); + imgsrc->HLRecovery_Global ( params.toneCurve ); + + + if (pl) { + pl->setProgress (0.45); } - // if(settings->leveldnv ==2) {crW=int(tileWskip/2);crH=int(1.15f*(tileWskip/2));}//adapted to scale of preview - if (settings->leveldnv == 3) { - crW = tileWskip - 10; - crH = tileHskip - 10; + // set the color temperature + currWB = ColorTemp (params.wb.temperature, params.wb.green, params.wb.equal, params.wb.method); + + if (params.wb.method == "Camera") { + currWB = imgsrc->getWB (); + } else if (params.wb.method == "Auto") { + double rm, gm, bm; + imgsrc->getAutoWBMultipliers (rm, gm, bm); + currWB.update (rm, gm, bm, params.wb.equal, params.wb.tempBias); } - float lowdenoise = 1.f; - int levaut = settings->leveldnaut; + calclum = nullptr ; + params.dirpyrDenoise.getCurves (noiseLCurve, noiseCCurve); + autoNR = (float) settings->nrauto;// + autoNRmax = (float) settings->nrautomax;// - if (levaut == 1) { //Standard - lowdenoise = 0.7f; + if (settings->leveldnti == 0) { + tilesize = 1024; + overlap = 128; } - // int crW=tileWskip-10;//crop noise width - // int crH=tileHskip-10;//crop noise height + if (settings->leveldnti == 1) { + tilesize = 768; + overlap = 96; + } + + // const int tilesize = 768; + // const int overlap = 96; + int numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip; + ipf.Tile_calc (tilesize, overlap, 2, fw, fh, numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip); + int nbtl = numtiles_W * numtiles_H; + + if ((settings->leveldnautsimpl == 1 && params.dirpyrDenoise.Cmethod == "AUT") || (settings->leveldnautsimpl == 0 && params.dirpyrDenoise.C2method == "AUTO")) { + nbtl = 9; + } + + ch_M = new float [nbtl];//allocate memory + max_r = new float [nbtl]; + max_b = new float [nbtl]; + min_b = new float [9]; + min_r = new float [9]; + lumL = new float [nbtl]; + chromC = new float [nbtl]; + ry = new float [nbtl]; + sk = new float [nbtl]; + pcsk = new float [nbtl]; + + // printf("expert=%d\n",settings->leveldnautsimpl); + if (settings->leveldnautsimpl == 1 && params.dirpyrDenoise.Cmethod == "PON") { + MyTime t1pone, t2pone; + t1pone.set(); + int crW, crH; + + if (settings->leveldnv == 0) { + crW = 100; + crH = 100; + } + + if (settings->leveldnv == 1) { + crW = 250; + crH = 250; + } + + if (settings->leveldnv == 2) { + crW = int (tileWskip / 2); + crH = int (tileHskip / 2); + } + + // if(settings->leveldnv ==2) {crW=int(tileWskip/2);crH=int(1.15f*(tileWskip/2));}//adapted to scale of preview + if (settings->leveldnv == 3) { + crW = tileWskip - 10; + crH = tileHskip - 10; + } + + float lowdenoise = 1.f; + int levaut = settings->leveldnaut; + + if (levaut == 1) { //Standard + lowdenoise = 0.7f; + } + + // int crW=tileWskip-10;//crop noise width + // int crH=tileHskip-10;//crop noise height // Imagefloat *origCropPart;//init auto noise // origCropPart = new Imagefloat (crW, crH);//allocate memory - if (params.dirpyrDenoise.enabled) {//evaluate Noise - LUTf gamcurve (65536, 0); - float gam, gamthresh, gamslope; - ipf.RGB_denoise_infoGamCurve (params.dirpyrDenoise, imgsrc->isRAW(), gamcurve, gam, gamthresh, gamslope); - #pragma omp parallel - { - Imagefloat *origCropPart;//init auto noise - origCropPart = new Imagefloat (crW, crH);//allocate memory - Imagefloat *provicalc = new Imagefloat ((crW + 1) / 2, (crH + 1) / 2); //for denoise curves - int skipP = 1; - #pragma omp for schedule(dynamic) collapse(2) nowait + if (params.dirpyrDenoise.enabled) {//evaluate Noise + LUTf gamcurve (65536, 0); + float gam, gamthresh, gamslope; + ipf.RGB_denoise_infoGamCurve (params.dirpyrDenoise, imgsrc->isRAW(), gamcurve, gam, gamthresh, gamslope); + #pragma omp parallel + { + Imagefloat *origCropPart;//init auto noise + origCropPart = new Imagefloat (crW, crH);//allocate memory + Imagefloat *provicalc = new Imagefloat ((crW + 1) / 2, (crH + 1) / 2); //for denoise curves + int skipP = 1; + #pragma omp for schedule(dynamic) collapse(2) nowait - for (int wcr = 0; wcr < numtiles_W; wcr++) { - for (int hcr = 0; hcr < numtiles_H; hcr++) { - int beg_tileW = wcr * tileWskip + tileWskip / 2.f - crW / 2.f; - int beg_tileH = hcr * tileHskip + tileHskip / 2.f - crH / 2.f; - PreviewProps ppP (beg_tileW , beg_tileH, crW, crH, skipP); - imgsrc->getImage (currWB, tr, origCropPart, ppP, params.toneCurve, params.icm, params.raw ); + for (int wcr = 0; wcr < numtiles_W; wcr++) { + for (int hcr = 0; hcr < numtiles_H; hcr++) { + int beg_tileW = wcr * tileWskip + tileWskip / 2.f - crW / 2.f; + int beg_tileH = hcr * tileHskip + tileHskip / 2.f - crH / 2.f; + PreviewProps ppP (beg_tileW , beg_tileH, crW, crH, skipP); + imgsrc->getImage (currWB, tr, origCropPart, ppP, params.toneCurve, params.icm, params.raw ); + //baseImg->getStdImage(currWB, tr, origCropPart, ppP, true, params.toneCurve); - // we only need image reduced to 1/4 here - for (int ii = 0; ii < crH; ii += 2) { - for (int jj = 0; jj < crW; jj += 2) { - provicalc->r (ii >> 1, jj >> 1) = origCropPart->r (ii, jj); - provicalc->g (ii >> 1, jj >> 1) = origCropPart->g (ii, jj); - provicalc->b (ii >> 1, jj >> 1) = origCropPart->b (ii, jj); + // we only need image reduced to 1/4 here + for (int ii = 0; ii < crH; ii += 2) { + for (int jj = 0; jj < crW; jj += 2) { + provicalc->r (ii >> 1, jj >> 1) = origCropPart->r (ii, jj); + provicalc->g (ii >> 1, jj >> 1) = origCropPart->g (ii, jj); + provicalc->b (ii >> 1, jj >> 1) = origCropPart->b (ii, jj); + } } - } - imgsrc->convertColorSpace (provicalc, params.icm, currWB); //for denoise luminance curve - float maxr = 0.f; - float maxb = 0.f; - float pondcorrec = 1.0f; - float chaut, redaut, blueaut, maxredaut, maxblueaut, minredaut, minblueaut, chromina, sigma, lumema, sigma_L, redyel, skinc, nsknc; - int Nb; - chaut = 0.f; - redaut = 0.f; - blueaut = 0.f; - maxredaut = 0.f; - maxblueaut = 0.f; - chromina = 0.f; - sigma = 0.f; - ipf.RGB_denoise_info (origCropPart, provicalc, imgsrc->isRAW(), gamcurve, gam, gamthresh, gamslope, params.dirpyrDenoise, imgsrc->getDirPyrDenoiseExpComp(), chaut, Nb, redaut, blueaut, maxredaut, maxblueaut, minredaut, minblueaut, chromina, sigma, lumema, sigma_L, redyel, skinc, nsknc); - float multip = 1.f; - float adjustr = 1.f; + imgsrc->convertColorSpace (provicalc, params.icm, currWB); //for denoise luminance curve + float maxr = 0.f; + float maxb = 0.f; + float pondcorrec = 1.0f; + float chaut, redaut, blueaut, maxredaut, maxblueaut, minredaut, minblueaut, chromina, sigma, lumema, sigma_L, redyel, skinc, nsknc; + int Nb; + chaut = 0.f; + redaut = 0.f; + blueaut = 0.f; + maxredaut = 0.f; + maxblueaut = 0.f; + chromina = 0.f; + sigma = 0.f; + ipf.RGB_denoise_info (origCropPart, provicalc, imgsrc->isRAW(), gamcurve, gam, gamthresh, gamslope, params.dirpyrDenoise, imgsrc->getDirPyrDenoiseExpComp(), chaut, Nb, redaut, blueaut, maxredaut, maxblueaut, minredaut, minblueaut, chromina, sigma, lumema, sigma_L, redyel, skinc, nsknc); + float multip = 1.f; + float adjustr = 1.f; - if (params.icm.working == "ProPhoto") { - adjustr = 1.f; // - } else if (params.icm.working == "Adobe RGB") { - adjustr = 1.f / 1.3f; - } else if (params.icm.working == "sRGB") { - adjustr = 1.f / 1.3f; - } else if (params.icm.working == "WideGamut") { - adjustr = 1.f / 1.1f; - } else if (params.icm.working == "Rec2020") { - adjustr = 1.f / 1.1f; - } else if (params.icm.working == "Beta RGB") { - adjustr = 1.f / 1.2f; - } else if (params.icm.working == "BestRGB") { - adjustr = 1.f / 1.2f; - } else if (params.icm.working == "BruceRGB") { - adjustr = 1.f / 1.2f; - } - - if (!imgsrc->isRAW()) { - multip = 2.f; //take into account gamma for TIF / JPG approximate value...not good fot gamma=1 - } - - float maxmax = max (maxredaut, maxblueaut); - float delta; - int mode = 2; - int lissage = settings->leveldnliss; - ipf.calcautodn_info (chaut, delta, Nb, levaut, maxmax, lumema, chromina, mode, lissage, redyel, skinc, nsknc); - - // printf("PROCESS cha=%f red=%f bl=%f redM=%f bluM=%f chrom=%f sigm=%f lum=%f sigL=%f\n",chaut,redaut,blueaut, maxredaut, maxblueaut, chromina, sigma, lumema, sigma_L); - if (maxredaut > maxblueaut) { - maxr = (delta) / ((autoNRmax * multip * adjustr * lowdenoise) / 2.f); - - if (minblueaut <= minredaut && minblueaut < chaut) { - maxb = (-chaut + minblueaut) / (autoNRmax * multip * adjustr * lowdenoise); + if (params.icm.working == "ProPhoto") { + adjustr = 1.f; // + } else if (params.icm.working == "Adobe RGB") { + adjustr = 1.f / 1.3f; + } else if (params.icm.working == "sRGB") { + adjustr = 1.f / 1.3f; + } else if (params.icm.working == "WideGamut") { + adjustr = 1.f / 1.1f; + } else if (params.icm.working == "Rec2020") { + adjustr = 1.f / 1.1f; + } else if (params.icm.working == "Beta RGB") { + adjustr = 1.f / 1.2f; + } else if (params.icm.working == "BestRGB") { + adjustr = 1.f / 1.2f; + } else if (params.icm.working == "BruceRGB") { + adjustr = 1.f / 1.2f; } + + if (!imgsrc->isRAW()) { + multip = 2.f; //take into account gamma for TIF / JPG approximate value...not good fot gamma=1 + } + + float maxmax = max (maxredaut, maxblueaut); + float delta; + int mode = 2; + int lissage = settings->leveldnliss; + ipf.calcautodn_info (chaut, delta, Nb, levaut, maxmax, lumema, chromina, mode, lissage, redyel, skinc, nsknc); + + // printf("PROCESS cha=%f red=%f bl=%f redM=%f bluM=%f chrom=%f sigm=%f lum=%f sigL=%f\n",chaut,redaut,blueaut, maxredaut, maxblueaut, chromina, sigma, lumema, sigma_L); + if (maxredaut > maxblueaut) { + maxr = (delta) / ((autoNRmax * multip * adjustr * lowdenoise) / 2.f); + + if (minblueaut <= minredaut && minblueaut < chaut) { + maxb = (-chaut + minblueaut) / (autoNRmax * multip * adjustr * lowdenoise); + } + } else { + maxb = (delta) / ((autoNRmax * multip * adjustr * lowdenoise) / 2.f); + + if (minredaut <= minblueaut && minredaut < chaut) { + maxr = (-chaut + minredaut) / (autoNRmax * multip * adjustr * lowdenoise); + } + }//maxb mxr - empirical evaluation red / blue + + ch_M[hcr * numtiles_W + wcr] = pondcorrec * chaut / (autoNR * multip * adjustr * lowdenoise); + max_r[hcr * numtiles_W + wcr] = pondcorrec * maxr; + max_b[hcr * numtiles_W + wcr] = pondcorrec * maxb; + lumL[hcr * numtiles_W + wcr] = lumema; + chromC[hcr * numtiles_W + wcr] = chromina; + ry[hcr * numtiles_W + wcr] = redyel; + sk[hcr * numtiles_W + wcr] = skinc; + pcsk[hcr * numtiles_W + wcr] = nsknc; + + } + } + + delete provicalc; + delete origCropPart; + } + + int liss = settings->leveldnliss; //smooth result around mean + + if (liss == 2 || liss == 3) { + // I smooth only mean and not delta (max) + float nchm = 0.f; + float koef = 0.4f; //between 0.1 to 0.9 + + if (liss == 3) { + koef = 0.0f; //quasi auto for mean Ch + } + + for (int wcr = 0; wcr < numtiles_W; wcr++) { + for (int hcr = 0; hcr < numtiles_H; hcr++) { + nchm += ch_M[hcr * numtiles_W + wcr]; + } + } + + nchm /= (numtiles_H * numtiles_W); + + for (int wcr = 0; wcr < numtiles_W; wcr++) { + for (int hcr = 0; hcr < numtiles_H; hcr++) { + ch_M[hcr * numtiles_W + wcr] = nchm + (ch_M[hcr * numtiles_W + wcr] - nchm) * koef; + } + } + } + + if (liss == 3) { //same as auto but with much cells + float MaxR = 0.f; + float MaxB = 0.f; + float MaxRMoy = 0.f; + float MaxBMoy = 0.f; + + for (int k = 0; k < nbtl; k++) { + MaxBMoy += max_b[k]; + MaxRMoy += max_r[k]; + + if (max_r[k] > MaxR) { + MaxR = max_r[k]; + } + + if (max_b[k] > MaxB) { + MaxB = max_b[k]; + } + + } + + MaxBMoy /= nbtl; + MaxRMoy /= nbtl; + + for (int k = 0; k < nbtl; k++) { + if (MaxR > MaxB) { + max_r[k] = MaxRMoy + (MaxR - MaxRMoy) * 0.66f; //#std Dev + //max_b[k]=MinB; + max_b[k] = MaxBMoy + (MaxB - MaxBMoy) * 0.66f; + } else { - maxb = (delta) / ((autoNRmax * multip * adjustr * lowdenoise) / 2.f); + max_b[k] = MaxBMoy + (MaxB - MaxBMoy) * 0.66f; + //max_r[k]=MinR; + max_r[k] = MaxRMoy + (MaxR - MaxRMoy) * 0.66f; - if (minredaut <= minblueaut && minredaut < chaut) { - maxr = (-chaut + minredaut) / (autoNRmax * multip * adjustr * lowdenoise); + } + } + } + + if (settings->verbose) { + t2pone.set(); + printf ("Info denoise ponderated performed in %d usec:\n", t2pone.etime (t1pone)); + } + + } + } + + + if ((settings->leveldnautsimpl == 1 && params.dirpyrDenoise.Cmethod == "AUT") || (settings->leveldnautsimpl == 0 && params.dirpyrDenoise.C2method == "AUTO")) { + MyTime t1aue, t2aue; + t1aue.set(); + int crW, crH; + + if (settings->leveldnv == 0) { + crW = 100; + crH = 100; + } + + if (settings->leveldnv == 1) { + crW = 250; + crH = 250; + } + + if (settings->leveldnv == 2) { + crW = int (tileWskip / 2); + crH = int (tileHskip / 2); + } + + // if(settings->leveldnv ==2) {crW=int(tileWskip/2);crH=int(1.15f*(tileWskip/2));}//adapted to scale of preview + if (settings->leveldnv == 3) { + crW = tileWskip - 10; + crH = tileHskip - 10; + } + + float lowdenoise = 1.f; + int levaut = settings->leveldnaut; + + if (levaut == 1) { //Standard + lowdenoise = 0.7f; + } + + if (params.dirpyrDenoise.enabled) {//evaluate Noise + LUTf gamcurve (65536, 0); + float gam, gamthresh, gamslope; + ipf.RGB_denoise_infoGamCurve (params.dirpyrDenoise, imgsrc->isRAW(), gamcurve, gam, gamthresh, gamslope); + int Nb[9]; + int coordW[3];//coordonate of part of image to mesure noise + int coordH[3]; + int begW = 50; + int begH = 50; + coordW[0] = begW; + coordW[1] = fw / 2 - crW / 2; + coordW[2] = fw - crW - begW; + coordH[0] = begH; + coordH[1] = fh / 2 - crH / 2; + coordH[2] = fh - crH - begH; + #pragma omp parallel + { + Imagefloat *origCropPart;//init auto noise + origCropPart = new Imagefloat (crW, crH);//allocate memory + Imagefloat *provicalc = new Imagefloat ((crW + 1) / 2, (crH + 1) / 2); //for denoise curves + + #pragma omp for schedule(dynamic) collapse(2) nowait + + for (int wcr = 0; wcr <= 2; wcr++) { + for (int hcr = 0; hcr <= 2; hcr++) { + PreviewProps ppP (coordW[wcr] , coordH[hcr], crW, crH, 1); + imgsrc->getImage (currWB, tr, origCropPart, ppP, params.toneCurve, params.icm, params.raw); + //baseImg->getStdImage(currWB, tr, origCropPart, ppP, true, params.toneCurve); + + + // we only need image reduced to 1/4 here + for (int ii = 0; ii < crH; ii += 2) { + for (int jj = 0; jj < crW; jj += 2) { + provicalc->r (ii >> 1, jj >> 1) = origCropPart->r (ii, jj); + provicalc->g (ii >> 1, jj >> 1) = origCropPart->g (ii, jj); + provicalc->b (ii >> 1, jj >> 1) = origCropPart->b (ii, jj); + } } - }//maxb mxr - empirical evaluation red / blue - - ch_M[hcr * numtiles_W + wcr] = pondcorrec * chaut / (autoNR * multip * adjustr * lowdenoise); - max_r[hcr * numtiles_W + wcr] = pondcorrec * maxr; - max_b[hcr * numtiles_W + wcr] = pondcorrec * maxb; - lumL[hcr * numtiles_W + wcr] = lumema; - chromC[hcr * numtiles_W + wcr] = chromina; - ry[hcr * numtiles_W + wcr] = redyel; - sk[hcr * numtiles_W + wcr] = skinc; - pcsk[hcr * numtiles_W + wcr] = nsknc; + imgsrc->convertColorSpace (provicalc, params.icm, currWB); //for denoise luminance curve + int nb = 0; + float chaut = 0.f, redaut = 0.f, blueaut = 0.f, maxredaut = 0.f, maxblueaut = 0.f, minredaut = 0.f, minblueaut = 0.f, chromina = 0.f, sigma = 0.f, lumema = 0.f, sigma_L = 0.f, redyel = 0.f, skinc = 0.f, nsknc = 0.f; + ipf.RGB_denoise_info (origCropPart, provicalc, imgsrc->isRAW(), gamcurve, gam, gamthresh, gamslope, params.dirpyrDenoise, imgsrc->getDirPyrDenoiseExpComp(), chaut, nb, redaut, blueaut, maxredaut, maxblueaut, minredaut, minblueaut, chromina, sigma, lumema, sigma_L, redyel, skinc, nsknc); + Nb[hcr * 3 + wcr] = nb; + ch_M[hcr * 3 + wcr] = chaut; + max_r[hcr * 3 + wcr] = maxredaut; + max_b[hcr * 3 + wcr] = maxblueaut; + min_r[hcr * 3 + wcr] = minredaut; + min_b[hcr * 3 + wcr] = minblueaut; + lumL[hcr * 3 + wcr] = lumema; + chromC[hcr * 3 + wcr] = chromina; + ry[hcr * 3 + wcr] = redyel; + sk[hcr * 3 + wcr] = skinc; + pcsk[hcr * 3 + wcr] = nsknc; + } } + + delete provicalc; + delete origCropPart; } - - delete provicalc; - delete origCropPart; - } - - int liss = settings->leveldnliss; //smooth result around mean - - if (liss == 2 || liss == 3) { - // I smooth only mean and not delta (max) - float nchm = 0.f; - float koef = 0.4f; //between 0.1 to 0.9 - - if (liss == 3) { - koef = 0.0f; //quasi auto for mean Ch - } - - for (int wcr = 0; wcr < numtiles_W; wcr++) { - for (int hcr = 0; hcr < numtiles_H; hcr++) { - nchm += ch_M[hcr * numtiles_W + wcr]; - } - } - - nchm /= (numtiles_H * numtiles_W); - - for (int wcr = 0; wcr < numtiles_W; wcr++) { - for (int hcr = 0; hcr < numtiles_H; hcr++) { - ch_M[hcr * numtiles_W + wcr] = nchm + (ch_M[hcr * numtiles_W + wcr] - nchm) * koef; - } - } - } - - if (liss == 3) { //same as auto but with much cells + float chM = 0.f; float MaxR = 0.f; float MaxB = 0.f; + float MinR = 100000000.f; + float MinB = 100000000.f; + float maxr = 0.f; + float maxb = 0.f; + float multip = 1.f; + float adjustr = 1.f; + float Max_R[9] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; + float Max_B[9] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; + float Min_R[9]; + float Min_B[9]; float MaxRMoy = 0.f; float MaxBMoy = 0.f; + float MinRMoy = 0.f; + float MinBMoy = 0.f; - for (int k = 0; k < nbtl; k++) { - MaxBMoy += max_b[k]; - MaxRMoy += max_r[k]; - - if (max_r[k] > MaxR) { - MaxR = max_r[k]; - } - - if (max_b[k] > MaxB) { - MaxB = max_b[k]; - } - + if (params.icm.working == "ProPhoto") { + adjustr = 1.f; + } else if (params.icm.working == "Adobe RGB") { + adjustr = 1.f / 1.3f; + } else if (params.icm.working == "sRGB") { + adjustr = 1.f / 1.3f; + } else if (params.icm.working == "WideGamut") { + adjustr = 1.f / 1.1f; + } else if (params.icm.working == "Rec2020") { + adjustr = 1.f / 1.1f; + } else if (params.icm.working == "Beta RGB") { + adjustr = 1.f / 1.2f; + } else if (params.icm.working == "BestRGB") { + adjustr = 1.f / 1.2f; + } else if (params.icm.working == "BruceRGB") { + adjustr = 1.f / 1.2f; } - MaxBMoy /= nbtl; - MaxRMoy /= nbtl; + if (!imgsrc->isRAW()) { + multip = 2.f; //take into account gamma for TIF / JPG approximate value...not good fot gamma=1 + } - for (int k = 0; k < nbtl; k++) { - if (MaxR > MaxB) { - max_r[k] = MaxRMoy + (MaxR - MaxRMoy) * 0.66f; //#std Dev - //max_b[k]=MinB; - max_b[k] = MaxBMoy + (MaxB - MaxBMoy) * 0.66f; + float delta[9]; + int mode = 1; + int lissage = settings->leveldnliss; + for (int k = 0; k < 9; k++) { + float maxmax = max (max_r[k], max_b[k]); + ipf.calcautodn_info (ch_M[k], delta[k], Nb[k], levaut, maxmax, lumL[k], chromC[k], mode, lissage, ry[k], sk[k], pcsk[k] ); + // printf("ch_M=%f delta=%f\n",ch_M[k], delta[k]); + } + + for (int k = 0; k < 9; k++) { + if (max_r[k] > max_b[k]) { + //printf("R delta=%f koef=%f\n",delta[k],autoNRmax*multip*adjustr*lowdenoise); + Max_R[k] = (delta[k]) / ((autoNRmax * multip * adjustr * lowdenoise) / 2.f); + Min_B[k] = - (ch_M[k] - min_b[k]) / (autoNRmax * multip * adjustr * lowdenoise); + Max_B[k] = 0.f; + Min_R[k] = 0.f; } else { - max_b[k] = MaxBMoy + (MaxB - MaxBMoy) * 0.66f; - //max_r[k]=MinR; - max_r[k] = MaxRMoy + (MaxR - MaxRMoy) * 0.66f; - - } - } - } - - if (settings->verbose) { - t2pone.set(); - printf ("Info denoise ponderated performed in %d usec:\n", t2pone.etime (t1pone)); - } - - } - } - - - if ((settings->leveldnautsimpl == 1 && params.dirpyrDenoise.Cmethod == "AUT") || (settings->leveldnautsimpl == 0 && params.dirpyrDenoise.C2method == "AUTO")) { - MyTime t1aue, t2aue; - t1aue.set(); - int crW, crH; - - if (settings->leveldnv == 0) { - crW = 100; - crH = 100; - } - - if (settings->leveldnv == 1) { - crW = 250; - crH = 250; - } - - if (settings->leveldnv == 2) { - crW = int (tileWskip / 2); - crH = int (tileHskip / 2); - } - - // if(settings->leveldnv ==2) {crW=int(tileWskip/2);crH=int(1.15f*(tileWskip/2));}//adapted to scale of preview - if (settings->leveldnv == 3) { - crW = tileWskip - 10; - crH = tileHskip - 10; - } - - float lowdenoise = 1.f; - int levaut = settings->leveldnaut; - - if (levaut == 1) { //Standard - lowdenoise = 0.7f; - } - - if (params.dirpyrDenoise.enabled) {//evaluate Noise - LUTf gamcurve (65536, 0); - float gam, gamthresh, gamslope; - ipf.RGB_denoise_infoGamCurve (params.dirpyrDenoise, imgsrc->isRAW(), gamcurve, gam, gamthresh, gamslope); - int Nb[9]; - int coordW[3];//coordonate of part of image to mesure noise - int coordH[3]; - int begW = 50; - int begH = 50; - coordW[0] = begW; - coordW[1] = fw / 2 - crW / 2; - coordW[2] = fw - crW - begW; - coordH[0] = begH; - coordH[1] = fh / 2 - crH / 2; - coordH[2] = fh - crH - begH; - #pragma omp parallel - { - Imagefloat *origCropPart;//init auto noise - origCropPart = new Imagefloat (crW, crH);//allocate memory - Imagefloat *provicalc = new Imagefloat ((crW + 1) / 2, (crH + 1) / 2); //for denoise curves - - #pragma omp for schedule(dynamic) collapse(2) nowait - - for (int wcr = 0; wcr <= 2; wcr++) { - for (int hcr = 0; hcr <= 2; hcr++) { - PreviewProps ppP (coordW[wcr] , coordH[hcr], crW, crH, 1); - imgsrc->getImage (currWB, tr, origCropPart, ppP, params.toneCurve, params.icm, params.raw); - - // we only need image reduced to 1/4 here - for (int ii = 0; ii < crH; ii += 2) { - for (int jj = 0; jj < crW; jj += 2) { - provicalc->r (ii >> 1, jj >> 1) = origCropPart->r (ii, jj); - provicalc->g (ii >> 1, jj >> 1) = origCropPart->g (ii, jj); - provicalc->b (ii >> 1, jj >> 1) = origCropPart->b (ii, jj); - } - } - - imgsrc->convertColorSpace (provicalc, params.icm, currWB); //for denoise luminance curve - int nb = 0; - float chaut = 0.f, redaut = 0.f, blueaut = 0.f, maxredaut = 0.f, maxblueaut = 0.f, minredaut = 0.f, minblueaut = 0.f, chromina = 0.f, sigma = 0.f, lumema = 0.f, sigma_L = 0.f, redyel = 0.f, skinc = 0.f, nsknc = 0.f; - ipf.RGB_denoise_info (origCropPart, provicalc, imgsrc->isRAW(), gamcurve, gam, gamthresh, gamslope, params.dirpyrDenoise, imgsrc->getDirPyrDenoiseExpComp(), chaut, nb, redaut, blueaut, maxredaut, maxblueaut, minredaut, minblueaut, chromina, sigma, lumema, sigma_L, redyel, skinc, nsknc); - Nb[hcr * 3 + wcr] = nb; - ch_M[hcr * 3 + wcr] = chaut; - max_r[hcr * 3 + wcr] = maxredaut; - max_b[hcr * 3 + wcr] = maxblueaut; - min_r[hcr * 3 + wcr] = minredaut; - min_b[hcr * 3 + wcr] = minblueaut; - lumL[hcr * 3 + wcr] = lumema; - chromC[hcr * 3 + wcr] = chromina; - ry[hcr * 3 + wcr] = redyel; - sk[hcr * 3 + wcr] = skinc; - pcsk[hcr * 3 + wcr] = nsknc; + //printf("B delta=%f koef=%f\n",delta[k],autoNRmax*multip*adjustr*lowdenoise); + Max_B[k] = (delta[k]) / ((autoNRmax * multip * adjustr * lowdenoise) / 2.f); + Min_R[k] = - (ch_M[k] - min_r[k]) / (autoNRmax * multip * adjustr * lowdenoise); + Min_B[k] = 0.f; + Max_R[k] = 0.f; } } - delete provicalc; - delete origCropPart; - } - float chM = 0.f; - float MaxR = 0.f; - float MaxB = 0.f; - float MinR = 100000000.f; - float MinB = 100000000.f; - float maxr = 0.f; - float maxb = 0.f; - float multip = 1.f; - float adjustr = 1.f; - float Max_R[9] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; - float Max_B[9] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; - float Min_R[9]; - float Min_B[9]; - float MaxRMoy = 0.f; - float MaxBMoy = 0.f; - float MinRMoy = 0.f; - float MinBMoy = 0.f; + for (int k = 0; k < 9; k++) { + // printf("ch_M= %f Max_R=%f Max_B=%f min_r=%f min_b=%f\n",ch_M[k],Max_R[k], Max_B[k],Min_R[k], Min_B[k]); + chM += ch_M[k]; + MaxBMoy += Max_B[k]; + MaxRMoy += Max_R[k]; + MinRMoy += Min_R[k]; + MinBMoy += Min_B[k]; - if (params.icm.working == "ProPhoto") { - adjustr = 1.f; - } else if (params.icm.working == "Adobe RGB") { - adjustr = 1.f / 1.3f; - } else if (params.icm.working == "sRGB") { - adjustr = 1.f / 1.3f; - } else if (params.icm.working == "WideGamut") { - adjustr = 1.f / 1.1f; - } else if (params.icm.working == "Rec2020") { - adjustr = 1.f / 1.1f; - } else if (params.icm.working == "Beta RGB") { - adjustr = 1.f / 1.2f; - } else if (params.icm.working == "BestRGB") { - adjustr = 1.f / 1.2f; - } else if (params.icm.working == "BruceRGB") { - adjustr = 1.f / 1.2f; - } + if (Max_R[k] > MaxR) { + MaxR = Max_R[k]; + } - if (!imgsrc->isRAW()) { - multip = 2.f; //take into account gamma for TIF / JPG approximate value...not good fot gamma=1 - } + if (Max_B[k] > MaxB) { + MaxB = Max_B[k]; + } - float delta[9]; - int mode = 1; - int lissage = settings->leveldnliss; + if (Min_R[k] < MinR) { + MinR = Min_R[k]; + } - for (int k = 0; k < 9; k++) { - float maxmax = max (max_r[k], max_b[k]); - ipf.calcautodn_info (ch_M[k], delta[k], Nb[k], levaut, maxmax, lumL[k], chromC[k], mode, lissage, ry[k], sk[k], pcsk[k] ); - // printf("ch_M=%f delta=%f\n",ch_M[k], delta[k]); - } + if (Min_B[k] < MinB) { + MinB = Min_B[k]; + } + + } + + chM /= 9; + MaxBMoy /= 9; + MaxRMoy /= 9; + MinBMoy /= 9; + MinRMoy /= 9; + + if (MaxR > MaxB) { + maxr = MaxRMoy + (MaxR - MaxRMoy) * 0.66f; //#std Dev + // maxb=MinB; + maxb = MinBMoy + (MinB - MinBMoy) * 0.66f; - for (int k = 0; k < 9; k++) { - if (max_r[k] > max_b[k]) { - //printf("R delta=%f koef=%f\n",delta[k],autoNRmax*multip*adjustr*lowdenoise); - Max_R[k] = (delta[k]) / ((autoNRmax * multip * adjustr * lowdenoise) / 2.f); - Min_B[k] = - (ch_M[k] - min_b[k]) / (autoNRmax * multip * adjustr * lowdenoise); - Max_B[k] = 0.f; - Min_R[k] = 0.f; } else { - //printf("B delta=%f koef=%f\n",delta[k],autoNRmax*multip*adjustr*lowdenoise); - Max_B[k] = (delta[k]) / ((autoNRmax * multip * adjustr * lowdenoise) / 2.f); - Min_R[k] = - (ch_M[k] - min_r[k]) / (autoNRmax * multip * adjustr * lowdenoise); - Min_B[k] = 0.f; - Max_R[k] = 0.f; + maxb = MaxBMoy + (MaxB - MaxBMoy) * 0.66f; + // maxr=MinR; + maxr = MinRMoy + (MinR - MinRMoy) * 0.66f; + } - } - - for (int k = 0; k < 9; k++) { - // printf("ch_M= %f Max_R=%f Max_B=%f min_r=%f min_b=%f\n",ch_M[k],Max_R[k], Max_B[k],Min_R[k], Min_B[k]); - chM += ch_M[k]; - MaxBMoy += Max_B[k]; - MaxRMoy += Max_R[k]; - MinRMoy += Min_R[k]; - MinBMoy += Min_B[k]; - - if (Max_R[k] > MaxR) { - MaxR = Max_R[k]; - } - - if (Max_B[k] > MaxB) { - MaxB = Max_B[k]; - } - - if (Min_R[k] < MinR) { - MinR = Min_R[k]; - } - - if (Min_B[k] < MinB) { - MinB = Min_B[k]; - } - - } - - chM /= 9; - MaxBMoy /= 9; - MaxRMoy /= 9; - MinBMoy /= 9; - MinRMoy /= 9; - - if (MaxR > MaxB) { - maxr = MaxRMoy + (MaxR - MaxRMoy) * 0.66f; //#std Dev - // maxb=MinB; - maxb = MinBMoy + (MinB - MinBMoy) * 0.66f; - - } else { - maxb = MaxBMoy + (MaxB - MaxBMoy) * 0.66f; - // maxr=MinR; - maxr = MinRMoy + (MinR - MinRMoy) * 0.66f; - - } // printf("SIMPL cha=%f red=%f bl=%f \n",chM,maxr,maxb); - params.dirpyrDenoise.chroma = chM / (autoNR * multip * adjustr); - params.dirpyrDenoise.redchro = maxr; - params.dirpyrDenoise.bluechro = maxb; + params.dirpyrDenoise.chroma = chM / (autoNR * multip * adjustr); + params.dirpyrDenoise.redchro = maxr; + params.dirpyrDenoise.bluechro = maxb; + } + + if (settings->verbose) { + t2aue.set(); + printf ("Info denoise auto performed in %d usec:\n", t2aue.etime (t1aue)); + } + + //end evaluate noise } - if (settings->verbose) { - t2aue.set(); - printf ("Info denoise auto performed in %d usec:\n", t2aue.etime (t1aue)); + baseImg = new Imagefloat (fw, fh); + imgsrc->getImage (currWB, tr, baseImg, pp, params.toneCurve, params.icm, params.raw); + + if (pl) { + pl->setProgress (0.50); } - //end evaluate noise - } - - - - - - Imagefloat* baseImg = new Imagefloat (fw, fh); - imgsrc->getImage (currWB, tr, baseImg, pp, params.toneCurve, params.icm, params.raw); - - if (pl) { - pl->setProgress (0.50); - } - // LUTf Noisecurve (65536,0); //!!!// auto exposure!!! - double expcomp = params.toneCurve.expcomp; - int bright = params.toneCurve.brightness; - int contr = params.toneCurve.contrast; - int black = params.toneCurve.black; - int hlcompr = params.toneCurve.hlcompr; - int hlcomprthresh = params.toneCurve.hlcomprthresh; + expcomp = params.toneCurve.expcomp; + bright = params.toneCurve.brightness; + contr = params.toneCurve.contrast; + black = params.toneCurve.black; + hlcompr = params.toneCurve.hlcompr; + hlcomprthresh = params.toneCurve.hlcomprthresh; - if (params.toneCurve.autoexp) { - LUTu aehist; - int aehistcompr; - imgsrc->getAutoExpHistogram (aehist, aehistcompr); - ipf.getAutoExp (aehist, aehistcompr, imgsrc->getDefGain(), params.toneCurve.clip, expcomp, bright, contr, black, hlcompr, hlcomprthresh); + + if (params.toneCurve.autoexp) { + LUTu aehist; + int aehistcompr; + imgsrc->getAutoExpHistogram (aehist, aehistcompr); + ipf.getAutoExp (aehist, aehistcompr, imgsrc->getDefGain(), params.toneCurve.clip, expcomp, bright, contr, black, hlcompr, hlcomprthresh); + } + + // at this stage, we can flush the raw data to free up quite an important amount of memory + // commented out because it makes the application crash when batch processing... + // TODO: find a better place to flush rawData and rawRGB + if (flush) { + imgsrc->flushRawData(); + imgsrc->flushRGB(); + } + + return true; } - // at this stage, we can flush the raw data to free up quite an important amount of memory - // commented out because it makes the application crash when batch processing... - // TODO: find a better place to flush rawData and rawRGB - if (flush) { - imgsrc->flushRawData(); - imgsrc->flushRGB(); - } + void stage_denoise() + { + procparams::ProcParams& params = job->pparams; + //ImProcFunctions ipf (¶ms, true); + ImProcFunctions &ipf = * (ipf_p.get()); - // perform luma/chroma denoise + // perform luma/chroma denoise // CieImage *cieView; // NoisCurve noiseLCurve; // bool lldenoiseutili=false; @@ -684,109 +759,1472 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p // params.dirpyrDenoise.getCurves(noiseLCurve, lldenoiseutili); // if (params.dirpyrDenoise.enabled && lldenoiseutili) { - DirPyrDenoiseParams denoiseParams = params.dirpyrDenoise; // make a copy because we cheat here + DirPyrDenoiseParams denoiseParams = params.dirpyrDenoise; // make a copy because we cheat here - if (denoiseParams.Lmethod == "CUR") { - if (noiseLCurve) { - denoiseParams.luma = 0.5f; - } else { - denoiseParams.luma = 0.0f; + if (denoiseParams.Lmethod == "CUR") { + if (noiseLCurve) { + denoiseParams.luma = 0.5f; + } else { + denoiseParams.luma = 0.0f; + } + } else if (denoiseParams.Lmethod == "SLI") { + noiseLCurve.Reset(); } - } else if (denoiseParams.Lmethod == "SLI") { - noiseLCurve.Reset(); + + if (denoiseParams.enabled && (noiseLCurve || noiseCCurve )) { + // we only need image reduced to 1/4 here + calclum = new Imagefloat ((fw + 1) / 2, (fh + 1) / 2); //for luminance denoise curve + #pragma omp parallel for + + for (int ii = 0; ii < fh; ii += 2) { + for (int jj = 0; jj < fw; jj += 2) { + calclum->r (ii >> 1, jj >> 1) = baseImg->r (ii, jj); + calclum->g (ii >> 1, jj >> 1) = baseImg->g (ii, jj); + calclum->b (ii >> 1, jj >> 1) = baseImg->b (ii, jj); + } + } + + imgsrc->convertColorSpace (calclum, params.icm, currWB); + } + + if (denoiseParams.enabled) { + // CurveFactory::denoiseLL(lldenoiseutili, denoiseParams.lcurve, Noisecurve,1); + //denoiseParams.getCurves(noiseLCurve); +// ipf.RGB_denoise(baseImg, baseImg, calclum, imgsrc->isRAW(), denoiseParams, params.defringe, imgsrc->getDirPyrDenoiseExpComp(), noiseLCurve, lldenoiseutili); + float chaut, redaut, blueaut, maxredaut, maxblueaut, nresi, highresi; + int kall = 2; + ipf.RGB_denoise (kall, baseImg, baseImg, calclum, ch_M, max_r, max_b, imgsrc->isRAW(), denoiseParams, imgsrc->getDirPyrDenoiseExpComp(), noiseLCurve, noiseCCurve, chaut, redaut, blueaut, maxredaut, maxblueaut, nresi, highresi); + + } + +// delete calclum; + delete [] ch_M; + delete [] max_r; + delete [] max_b; + delete [] min_r; + delete [] min_b; + delete [] lumL; + delete [] chromC; + delete [] ry; + delete [] sk; + delete [] pcsk; } - if (denoiseParams.enabled && (noiseLCurve || noiseCCurve )) { - // we only need image reduced to 1/4 here - calclum = new Imagefloat ((fw + 1) / 2, (fh + 1) / 2); //for luminance denoise curve - #pragma omp parallel for + void stage_transform() + { + procparams::ProcParams& params = job->pparams; + //ImProcFunctions ipf (¶ms, true); + ImProcFunctions &ipf = * (ipf_p.get()); - for (int ii = 0; ii < fh; ii += 2) { - for (int jj = 0; jj < fw; jj += 2) { - calclum->r (ii >> 1, jj >> 1) = baseImg->r (ii, jj); - calclum->g (ii >> 1, jj >> 1) = baseImg->g (ii, jj); - calclum->b (ii >> 1, jj >> 1) = baseImg->b (ii, jj); + imgsrc->convertColorSpace (baseImg, params.icm, currWB); + + // perform first analysis + hist16 (65536); + + ipf.firstAnalysis (baseImg, params, hist16); + + // perform transform (excepted resizing) + if (ipf.needsTransform()) { + Imagefloat* trImg = new Imagefloat (fw, fh); + ipf.transform (baseImg, trImg, 0, 0, 0, 0, fw, fh, fw, fh, imgsrc->getMetaData()->getFocalLen(), imgsrc->getMetaData()->getFocalLen35mm(), + imgsrc->getMetaData()->getFocusDist(), imgsrc->getRotateDegree(), true); + delete baseImg; + baseImg = trImg; + } + } + + Image16 *stage_finish() + { + procparams::ProcParams& params = job->pparams; + //ImProcFunctions ipf (¶ms, true); + ImProcFunctions &ipf = * (ipf_p.get()); + + if (params.dirpyrequalizer.cbdlMethod == "bef" && params.dirpyrequalizer.enabled && !params.colorappearance.enabled) { + const int W = baseImg->getWidth(); + const int H = baseImg->getHeight(); + LabImage labcbdl (W, H); + ipf.rgb2lab (*baseImg, labcbdl, params.icm.working); + ipf.dirpyrequalizer (&labcbdl, 1); + ipf.lab2rgb (labcbdl, *baseImg, params.icm.working); + } + + // update blurmap + SHMap* shmap = nullptr; + + if (params.sh.enabled) { + shmap = new SHMap (fw, fh, true); + double radius = sqrt (double (fw * fw + fh * fh)) / 2.0; + double shradius = params.sh.radius; + + if (!params.sh.hq) { + shradius *= radius / 1800.0; + } + + shmap->update (baseImg, shradius, ipf.lumimul, params.sh.hq, 1); + } + + // RGB processing + + curve1 (65536); + curve2 (65536); + curve (65536, 0); + satcurve (65536, 0); + lhskcurve (65536, 0); + lumacurve (32770, 0); // lumacurve[32768] and lumacurve[32769] will be set to 32768 and 32769 later to allow linear interpolation + clcurve (65536, 0); + wavclCurve (65536, 0); + + //if(params.blackwhite.enabled) params.toneCurve.hrenabled=false; + + CurveFactory::complexCurve (expcomp, black / 65535.0, hlcompr, hlcomprthresh, params.toneCurve.shcompr, bright, contr, + params.toneCurve.curveMode, params.toneCurve.curve, params.toneCurve.curveMode2, params.toneCurve.curve2, + hist16, curve1, curve2, curve, dummy, customToneCurve1, customToneCurve2 ); + + CurveFactory::RGBCurve (params.rgbCurves.rcurve, rCurve, 1); + CurveFactory::RGBCurve (params.rgbCurves.gcurve, gCurve, 1); + CurveFactory::RGBCurve (params.rgbCurves.bcurve, bCurve, 1); + + bool opautili = false; + + if (params.colorToning.enabled) { + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.working); + double wp[3][3] = { + {wprof[0][0], wprof[0][1], wprof[0][2]}, + {wprof[1][0], wprof[1][1], wprof[1][2]}, + {wprof[2][0], wprof[2][1], wprof[2][2]} + }; + TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params.icm.working); + double wip[3][3] = { + {wiprof[0][0], wiprof[0][1], wiprof[0][2]}, + {wiprof[1][0], wiprof[1][1], wiprof[1][2]}, + {wiprof[2][0], wiprof[2][1], wiprof[2][2]} + }; + params.colorToning.getCurves (ctColorCurve, ctOpacityCurve, wp, wip, opautili); + clToningcurve (65536, 0); + CurveFactory::curveToning (params.colorToning.clcurve, clToningcurve, 1); + cl2Toningcurve (65536, 0); + CurveFactory::curveToning (params.colorToning.cl2curve, cl2Toningcurve, 1); + } + + labView = new LabImage (fw, fh); + + if (params.blackwhite.enabled) { + CurveFactory::curveBW (params.blackwhite.beforeCurve, params.blackwhite.afterCurve, hist16, dummy, customToneCurvebw1, customToneCurvebw2, 1); + } + + double rrm, ggm, bbm; + float autor, autog, autob; + float satLimit = float (params.colorToning.satProtectionThreshold) / 100.f * 0.7f + 0.3f; + float satLimitOpacity = 1.f - (float (params.colorToning.saturatedOpacity) / 100.f); + + if (params.colorToning.enabled && params.colorToning.autosat) { //for colortoning evaluation of saturation settings + float moyS = 0.f; + float eqty = 0.f; + ipf.moyeqt (baseImg, moyS, eqty);//return image : mean saturation and standard dev of saturation + float satp = ((moyS + 1.5f * eqty) - 0.3f) / 0.7f; //1.5 sigma ==> 93% pixels with high saturation -0.3 / 0.7 convert to Hombre scale + + if (satp >= 0.92f) { + satp = 0.92f; //avoid values too high (out of gamut) + } + + if (satp <= 0.15f) { + satp = 0.15f; //avoid too low values + } + + satLimit = 100.f * satp; + + satLimitOpacity = 100.f * (moyS - 0.85f * eqty); //-0.85 sigma==>20% pixels with low saturation + } + + autor = -9000.f; // This will ask to compute the "auto" values for the B&W tool (have to be inferior to -5000) + DCPProfile::ApplyState as; + DCPProfile *dcpProf = imgsrc->getDCP (params.icm, currWB, as); + + LUTu histToneCurve; + + ipf.rgbProc (baseImg, labView, nullptr, curve1, curve2, curve, shmap, params.toneCurve.saturation, rCurve, gCurve, bCurve, satLimit , satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob, expcomp, hlcompr, hlcomprthresh, dcpProf, as, histToneCurve); + + if (settings->verbose) { + printf ("Output image / Auto B&W coefs: R=%.2f G=%.2f B=%.2f\n", autor, autog, autob); + } + + // if clut was used and size of clut cache == 1 we free the memory used by the clutstore (default clut cache size = 1 for 32 bit OS) + if ( params.filmSimulation.enabled && !params.filmSimulation.clutFilename.empty() && options.clutCacheSize == 1) { + CLUTStore::getInstance().clearCache(); + } + + // freeing up some memory + customToneCurve1.Reset(); + customToneCurve2.Reset(); + ctColorCurve.Reset(); + ctOpacityCurve.Reset(); + noiseLCurve.Reset(); + noiseCCurve.Reset(); + customToneCurvebw1.Reset(); + customToneCurvebw2.Reset(); + + // Freeing baseImg because not used anymore + delete baseImg; + baseImg = nullptr; + + if (shmap) { + delete shmap; + } + + shmap = nullptr; + + if (pl) { + pl->setProgress (0.55); + } + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + // start tile processing...??? + + + if (params.labCurve.contrast != 0) { //only use hist16 for contrast + hist16.clear(); + +#ifdef _OPENMP + #pragma omp parallel +#endif + { + LUTu hist16thr (hist16.getSize()); // one temporary lookup table per thread + hist16thr.clear(); +#ifdef _OPENMP + #pragma omp for schedule(static) nowait +#endif + + for (int i = 0; i < fh; i++) + for (int j = 0; j < fw; j++) { + hist16thr[ (int) ((labView->L[i][j]))]++; + } + + #pragma omp critical + { + hist16 += hist16thr; + } } } - imgsrc->convertColorSpace (calclum, params.icm, currWB); - } + bool utili; + CurveFactory::complexLCurve (params.labCurve.brightness, params.labCurve.contrast, params.labCurve.lcurve, hist16, lumacurve, dummy, 1, utili); - if (denoiseParams.enabled) { - // CurveFactory::denoiseLL(lldenoiseutili, denoiseParams.lcurve, Noisecurve,1); - //denoiseParams.getCurves(noiseLCurve); -// ipf.RGB_denoise(baseImg, baseImg, calclum, imgsrc->isRAW(), denoiseParams, params.defringe, imgsrc->getDirPyrDenoiseExpComp(), noiseLCurve, lldenoiseutili); - float chaut, redaut, blueaut, maxredaut, maxblueaut, nresi, highresi; - int kall = 2; - ipf.RGB_denoise (kall, baseImg, baseImg, calclum, ch_M, max_r, max_b, imgsrc->isRAW(), denoiseParams, imgsrc->getDirPyrDenoiseExpComp(), noiseLCurve, noiseCCurve, chaut, redaut, blueaut, maxredaut, maxblueaut, nresi, highresi); + bool clcutili; + CurveFactory::curveCL (clcutili, params.labCurve.clcurve, clcurve, 1); - } - -// delete calclum; - delete [] ch_M; - delete [] max_r; - delete [] max_b; - delete [] min_r; - delete [] min_b; - delete [] lumL; - delete [] chromC; - delete [] ry; - delete [] sk; - delete [] pcsk; - - imgsrc->convertColorSpace (baseImg, params.icm, currWB); - - // perform first analysis - LUTu hist16 (65536); - - ipf.firstAnalysis (baseImg, params, hist16); - - // perform transform (excepted resizing) - if (ipf.needsTransform()) { - Imagefloat* trImg = new Imagefloat (fw, fh); - ipf.transform (baseImg, trImg, 0, 0, 0, 0, fw, fh, fw, fh, imgsrc->getMetaData()->getFocalLen(), imgsrc->getMetaData()->getFocalLen35mm(), - imgsrc->getMetaData()->getFocusDist(), imgsrc->getRotateDegree(), true); - delete baseImg; - baseImg = trImg; - } + bool ccutili, cclutili; + CurveFactory::complexsgnCurve (autili, butili, ccutili, cclutili, params.labCurve.acurve, params.labCurve.bcurve, params.labCurve.cccurve, + params.labCurve.lccurve, curve1, curve2, satcurve, lhskcurve, 1); - if (params.dirpyrequalizer.cbdlMethod == "bef" && params.dirpyrequalizer.enabled && !params.colorappearance.enabled) { - const int W = baseImg->getWidth(); - const int H = baseImg->getHeight(); - LabImage labcbdl (W, H); - ipf.rgb2lab (*baseImg, labcbdl, params.icm.working); - ipf.dirpyrequalizer (&labcbdl, 1); - ipf.lab2rgb (labcbdl, *baseImg, params.icm.working); - } + bool locutili = false; + bool locallutili = false; + bool localcutili = false; - // update blurmap - SHMap* shmap = nullptr; + if (params.locallab.enabled) { + MyTime t1, t2; + t1.set(); + CacheManager* cachemgr; - if (params.sh.enabled) { - shmap = new SHMap (fw, fh, true); - double radius = sqrt (double (fw * fw + fh * fh)) / 2.0; - double shradius = params.sh.radius; + CacheImageData cfs; + cfs.md5 = cachemgr->getMD5 (imgsrc->getFileName()); + std::string mdfive = cfs.md5; + + Glib::ustring pop = options.cacheBaseDir + "/mip/"; + + Glib::ustring datalab; + + if (options.mip == MI_opt) { + datalab = pop + Glib::path_get_basename (imgsrc->getFileName () + "." + mdfive + ".mip"); + } + + if (options.mip == MI_prev) { + datalab = imgsrc->getFileName() + ".mip"; + } + + + LocretigainCurve locRETgainCurve; + LocLHCurve loclhCurve; + + LocretigainCurverab locRETgainCurverab; + LUTf lllocalcurve (65536, 0); + LUTf cclocalcurve (65536, 0); + + int realspot = params.locallab.nbspot; + int maxspot = settings->nspot + 1; + ifstream fic0 (datalab, ios::in); + float** shbuffer; + int versionmip = 0; + std::string delim[69] = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", + "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", + "&", "#", "{", "[", "]", "}", "$", "*", "?", ">", "!", ";", "<"",(", ")", "+", "-" + }; + + if (params.locallab.inverssha) { + shbuffer = new float*[fh]; + + for (int i = 0; i < fh; i++) { + shbuffer[i] = new float[fw]; + } + } + + if (fic0) {//normally we don't use here but ?? + //find the version mip + string line; + string spotline; + int cont = 0; + + while (getline (fic0, line)) { + spotline = line; + std::size_t pos = spotline.find ("="); + std::size_t posend = spotline.find ("@"); //in case of for futur use + + if (spotline.substr (0, pos) == "Mipversion") { + string strversion = spotline.substr (pos + 1, (posend - pos)); + versionmip = std::stoi (strversion.c_str()); + } + + if (spotline.substr (0, pos) == "Spot") { + cont = 0; + } + + + } + + fic0.close(); + } + + ifstream fich (datalab, ios::in); + + if (fich && versionmip != 0) { + std::string inser; + + int **dataspots; + dataspots = new int*[61]; + + for (int i = 0; i < 61; i++) { + dataspots[i] = new int[maxspot]; + } + + + std::string *retistrs; + retistrs = new std::string[maxspot]; + std::string *llstrs; + + llstrs = new std::string[maxspot]; + + std::string *lhstrs; + lhstrs = new std::string[maxspot]; + + std::string *ccstrs; + ccstrs = new std::string[maxspot]; + + { + dataspots[2][0] = params.locallab.circrad; + dataspots[3][0] = params.locallab.locX; + dataspots[4][0] = params.locallab.locY; + dataspots[5][0] = params.locallab.locYT; + dataspots[6][0] = params.locallab.locXL; + dataspots[7][0] = params.locallab.centerX; + dataspots[8][0] = params.locallab.centerY; + dataspots[9][0] = params.locallab.lightness; + dataspots[10][0] = params.locallab.contrast; + dataspots[11][0] = params.locallab.chroma; + dataspots[12][0] = params.locallab.sensi; + dataspots[13][0] = params.locallab.transit; + + if (!params.locallab.invers) { + dataspots[14][0] = 0; + } else { + dataspots[14][0] = 1; + } + + if (params.locallab.Smethod == "IND") { + dataspots[15][0] = 0; + } else if (params.locallab.Smethod == "SYM") { + dataspots[15][0] = 1; + } else if (params.locallab.Smethod == "INDSL") { + dataspots[15][0] = 2; + } else if (params.locallab.Smethod == "SYMSL") { + dataspots[15][0] = 3; + } + + dataspots[17][0] = params.locallab.radius; + dataspots[18][0] = params.locallab.strength; + dataspots[19][0] = params.locallab.sensibn; + + if (!params.locallab.inversrad) { + dataspots[20][0] = 0; + } else { + dataspots[20][0] = 1; + } + + dataspots[21][0] = params.locallab.str; + dataspots[22][0] = params.locallab.chrrt; + dataspots[23][0] = params.locallab.neigh; + dataspots[24][0] = params.locallab.vart; + dataspots[25][0] = params.locallab.sensih; + + if (!params.locallab.inversret) { + dataspots[26][0] = 0; + } else { + dataspots[26][0] = 1; + } + + if (params.locallab.retinexMethod == "low") { + dataspots[27][0] = 0; + } else if (params.locallab.retinexMethod == "uni") { + dataspots[27][0] = 1; + } else if (params.locallab.retinexMethod == "high") { + dataspots[27][0] = 2; + } + + + dataspots[28][0] = params.locallab.sharradius; + dataspots[29][0] = params.locallab.sharamount; + dataspots[30][0] = params.locallab.shardamping; + dataspots[31][0] = params.locallab.shariter; + dataspots[32][0] = params.locallab.sensisha; + + if (!params.locallab.inverssha) { + dataspots[33][0] = 0; + } else { + dataspots[33][0] = 1; + } + + if (params.locallab.qualityMethod == "std") { + dataspots[34][0] = 0; + } else if (params.locallab.qualityMethod == "enh") { + dataspots[34][0] = 1; + } else if (params.locallab.qualityMethod == "enhden") { + dataspots[34][0] = 2; + } + + dataspots[35][0] = params.locallab.thres; + dataspots[36][0] = params.locallab.proxi; + + dataspots[37][0] = params.locallab.noiselumf; + dataspots[38][0] = params.locallab.noiselumc; + dataspots[39][0] = params.locallab.noisechrof; + dataspots[40][0] = params.locallab.noisechroc; + + dataspots[41][0] = params.locallab.mult[0]; + dataspots[42][0] = params.locallab.mult[1]; + dataspots[43][0] = params.locallab.mult[2]; + dataspots[44][0] = params.locallab.mult[3]; + dataspots[45][0] = params.locallab.mult[4]; + dataspots[46][0] = params.locallab.threshold; + dataspots[47][0] = params.locallab.sensicb; + + if (!params.locallab.activlum) { + dataspots[48][0] = 0; + } else { + dataspots[48][0] = 1; + } + + dataspots[49][0] = params.locallab.stren; + dataspots[50][0] = params.locallab.gamma; + dataspots[51][0] = params.locallab.estop; + dataspots[52][0] = params.locallab.scaltm; + dataspots[53][0] = params.locallab.rewei; + dataspots[54][0] = params.locallab.sensitm; + dataspots[55][0] = params.locallab.retrab; + + if (!params.locallab.curvactiv) { + dataspots[56][0] = 0; + } else { + dataspots[56][0] = 1; + } + + if (params.locallab.qualitycurveMethod == "none") { + dataspots[57][0] = 0; + } else if (params.locallab.qualitycurveMethod == "std") { + dataspots[57][0] = 1; + } else if (params.locallab.qualitycurveMethod == "enh") { + dataspots[57][0] = 2; + } + + dataspots[58][0] = 100.f * params.locallab.hueref; + dataspots[59][0] = params.locallab.chromaref; + dataspots[60][0] = params.locallab.lumaref; + + //curve Reti local + int siz = params.locallab.localTgaincurve.size(); + + if (siz > 69) { + siz = 69;//avoid crash + } + + int s_cur[siz + 1]; + int s_datcur[siz + 1]; + + for (int j = 0; j < siz; j++) { + s_datcur[j] = (int) (1000. * params.locallab.localTgaincurve[j]); + } + + std::string cur_str = ""; + + for (int j = 0; j < siz; j++) { + cur_str = cur_str + std::to_string (s_datcur[j]) + delim[j]; + } + + inser = retistrs[0] = cur_str + "@"; + + int sizl = params.locallab.llcurve.size(); + + if (sizl > 69) { + sizl = 69; + } + + int s_curl[sizl + 1]; + int s_datcurl[sizl + 1]; + + for (int j = 0; j < sizl; j++) { + s_datcurl[j] = (int) (1000. * params.locallab.llcurve[j]); + } + + std::string ll_str = ""; + + for (int j = 0; j < sizl; j++) { + ll_str = ll_str + std::to_string (s_datcurl[j]) + delim[j]; + } + + llstrs[0] = ll_str + "@"; + + + int sizc = params.locallab.cccurve.size(); + + if (sizc > 69) { + sizc = 69; + } + + int s_curc[sizc + 1]; + int s_datcurc[sizc + 1]; + + for (int j = 0; j < sizc; j++) { + s_datcurc[j] = (int) (1000. * params.locallab.cccurve[j]); + } + + std::string cc_str = ""; + + for (int j = 0; j < sizc; j++) { + cc_str = cc_str + std::to_string (s_datcurc[j]) + delim[j]; + } + + ccstrs[0] = cc_str + "@"; + + // + + int sizh = params.locallab.LHcurve.size(); + + if (sizh > 69) { + sizh = 69; + } + + int s_curh[sizh + 1]; + int s_datcurh[sizh + 1]; + + for (int j = 0; j < sizh; j++) { + s_datcurh[j] = (int) (1000. * params.locallab.LHcurve[j]); + } + + std::string lh_str = ""; + + for (int j = 0; j < sizl; j++) { + lh_str = lh_str + std::to_string (s_datcurh[j]) + delim[j]; + } + + lhstrs[0] = lh_str + "@"; + + + } + locallutili = false; + + + int ns; + int realsp = params.locallab.nbspot; + + if (fich) { + + std::string line; + std::string spotline; + int cont = 0; + int sizecu; + int sizell; + int sizelh; + int sizecc; + + while (getline (fich, line)) { + spotline = line; + std::size_t pos = spotline.find ("="); + std::size_t posend = spotline.find ("@"); //in case of for futur use + + if (spotline.substr (0, pos) == "Mipversion") { + std::string strversion = spotline.substr (pos + 1, (posend - pos)); + versionmip = std::stoi (strversion.c_str()); + } + + if (spotline.substr (0, pos) == "Spot") { + cont = 0; + } + + cont++; + std::string str3 = spotline.substr (pos + 1, (posend - pos)); + + if (cont == 1) { + ns = std::stoi (str3.c_str()); + } + + if (cont >= 2 && cont < 16) { + dataspots[cont][ns] = std::stoi (str3.c_str()); + + } + + if (spotline.substr (0, pos) == "Currentspot") { + dataspots[16][0] = std::stoi (str3.c_str()); + } + + if (cont > 16 && cont < 61) { + dataspots[cont][ns] = std::stoi (str3.c_str()); + + } + + if (spotline.substr (0, pos) == "curveReti") { + std::string curstr; + int longecur; + std::string strend = spotline.substr (posend - 1, 1); + std::size_t posz = spotline.find (strend); + int longe; + + for (int sl = 0; sl < 69; sl++) { + if (delim[sl] == strend) { + longe = sl + 1; + } + } + + retistrs[ns] = str3; + sizecu = longe; + } + + if (spotline.substr (0, pos) == "curveLL") { + std::string curstrl; + int longecurl; + std::string strendl = spotline.substr (posend - 1, 1); + std::size_t poszl = spotline.find (strendl); + int longel; + + for (int sl = 0; sl < 69; sl++) { + if (delim[sl] == strendl) { + longel = sl + 1; + } + } + + llstrs[ns] = str3; + sizell = longel; + + } + + if (spotline.substr (0, pos) == "curveLH") { + std::string curstrh; + int longecurh; + std::string strendh = spotline.substr (posend - 1, 1); + std::size_t poszh = spotline.find (strendh); + int longeh; + + for (int sh = 0; sh < 69; sh++) { + if (delim[sh] == strendh) { + longeh = sh + 1; + } + } + + lhstrs[ns] = str3; + sizelh = longeh; + } + + if (spotline.substr (0, pos) == "curveCC") { + std::string curstrc; + int longecurc; + std::string strendc = spotline.substr (posend - 1, 1); + std::size_t poszc = spotline.find (strendc); + int longec; + + for (int sh = 0; sh < 69; sh++) { + if (delim[sh] == strendc) { + longec = sh + 1; + } + } + + ccstrs[ns] = str3; + sizecc = longec; + } + + } + + fich.close(); + } + + + for (int sp = 1; sp < maxspot; sp++) { //spots default + params.locallab.hueref = INFINITY; + params.locallab.chromaref = INFINITY; + params.locallab.lumaref = INFINITY; + + params.locallab.circrad = dataspots[2][sp]; + params.locallab.locX = dataspots[3][sp]; + params.locallab.locY = dataspots[4][sp]; + params.locallab.locYT = dataspots[5][sp]; + params.locallab.locXL = dataspots[6][sp]; + params.locallab.centerX = dataspots[7][sp]; + params.locallab.centerY = dataspots[8][sp]; + params.locallab.lightness = dataspots[9][sp]; + params.locallab.contrast = dataspots[10][sp]; + params.locallab.chroma = dataspots[11][sp]; + params.locallab.sensi = dataspots[12][sp]; + params.locallab.transit = dataspots[13][sp]; + + if (dataspots[14][sp] == 0) { + params.locallab.invers = false; + } else { + params.locallab.invers = true; + } + + if (dataspots[15][sp] == 0) { + params.locallab.Smethod = "IND" ; + } else if (dataspots[15][sp] == 1) { + params.locallab.Smethod = "SYM" ; + } else if (dataspots[15][sp] == 2) { + params.locallab.Smethod = "INDSL"; + } else if (dataspots[15][sp] == 3) { + params.locallab.Smethod = "SYMSL"; + } + + params.locallab.radius = dataspots[17][sp]; + params.locallab.strength = dataspots[18][sp]; + params.locallab.sensibn = dataspots[19][sp]; + + if (dataspots[20][sp] == 0) { + params.locallab.inversrad = false; + } else { + params.locallab.inversrad = true; + } + + params.locallab.str = dataspots[21][sp]; + params.locallab.chrrt = dataspots[22][sp]; + params.locallab.neigh = dataspots[23][sp]; + params.locallab.vart = dataspots[24][sp]; + params.locallab.sensih = dataspots[25][sp]; + + if (dataspots[26][sp] == 0) { + params.locallab.inversret = false; + } else { + params.locallab.inversret = true; + } + + if (dataspots[27][sp] == 0) { + params.locallab.retinexMethod = "low" ; + } else if (dataspots[27][sp] == 1) { + params.locallab.retinexMethod = "uni" ; + } else if (dataspots[27][sp] == 2) { + params.locallab.retinexMethod = "high"; + } + + params.locallab.sharradius = dataspots[28][sp]; + params.locallab.sharamount = dataspots[29][sp]; + params.locallab.shardamping = dataspots[30][sp]; + params.locallab.shariter = dataspots[31][sp]; + params.locallab.sensisha = dataspots[32][sp]; + + if (dataspots[33][sp] == 0) { + params.locallab.inverssha = false; + } else { + params.locallab.inverssha = true; + } + + if (dataspots[34][sp] == 0) { + params.locallab.qualityMethod = "std" ; + } else if (dataspots[34][sp] == 1) { + params.locallab.qualityMethod = "enh" ; + } else if (dataspots[34][sp] == 2) { + params.locallab.qualityMethod = "enhden" ; + } + + params.locallab.thres = dataspots[35][sp]; + params.locallab.proxi = dataspots[36][sp]; + + params.locallab.noiselumf = dataspots[37][sp]; + params.locallab.noiselumc = dataspots[38][sp]; + params.locallab.noisechrof = dataspots[39][sp]; + params.locallab.noisechroc = dataspots[40][sp]; + + params.locallab.mult[0] = dataspots[41][sp]; + params.locallab.mult[1] = dataspots[42][sp]; + params.locallab.mult[2] = dataspots[43][sp]; + params.locallab.mult[3] = dataspots[44][sp]; + params.locallab.mult[4] = dataspots[45][sp]; + params.locallab.threshold = dataspots[46][sp]; + params.locallab.sensicb = dataspots[47][sp]; + + if (dataspots[48][sp] == 0) { + params.locallab.activlum = false; + } else { + params.locallab.activlum = true; + } + + params.locallab.stren = dataspots[49][sp]; + params.locallab.gamma = dataspots[50][sp]; + params.locallab.estop = dataspots[51][sp]; + params.locallab.scaltm = dataspots[52][sp]; + params.locallab.rewei = dataspots[53][sp]; + params.locallab.sensitm = dataspots[54][sp]; + params.locallab.retrab = dataspots[55][sp]; + + if (dataspots[56][sp] == 0) { + params.locallab.curvactiv = false; + } else { + params.locallab.curvactiv = true; + } + + if (dataspots[57][sp] == 0) { + params.locallab.qualitycurveMethod = "none" ; + } else if (dataspots[57][sp] == 1) { + params.locallab.qualitycurveMethod = "std" ; + } else if (dataspots[57][sp] == 2) { + params.locallab.qualitycurveMethod = "enh" ; + } + + params.locallab.hueref = ((float) dataspots[58][sp]) / 100.f; + params.locallab.chromaref = dataspots[59][sp]; + params.locallab.lumaref = dataspots[60][sp]; + + + int *s_datc; + s_datc = new int[70]; + int siz; + + ipf.strcurv_data (retistrs[sp], s_datc, siz); + std::vector cretiend; + + for (int j = 0; j < siz; j++) { + cretiend.push_back ((double) (s_datc[j]) / 1000.); + } + + delete [] s_datc; + + int *s_datcl; + s_datcl = new int[70]; + int sizl; + + ipf.strcurv_data (llstrs[sp], s_datcl, sizl); + + + std::vector cllend; + + for (int j = 0; j < sizl; j++) { + cllend.push_back ((double) (s_datcl[j]) / 1000.); + } + + delete [] s_datcl; + + int *s_datcc; + s_datcc = new int[70]; + int sizc; + + ipf.strcurv_data (ccstrs[sp], s_datcc, sizc); + + + std::vector cccend; + + for (int j = 0; j < sizc; j++) { + cccend.push_back ((double) (s_datcc[j]) / 1000.); + } + + delete [] s_datcc; + + int *s_datch; + s_datch = new int[70]; + int sizh; + + ipf.strcurv_data (lhstrs[sp], s_datch, sizh); + + + std::vector clhend; + + for (int j = 0; j < sizh; j++) { + clhend.push_back ((double) (s_datch[j]) / 1000.); + } + + + params.locallab.localTgaincurve.clear(); + params.locallab.llcurve.clear(); + params.locallab.LHcurve.clear(); + params.locallab.cccurve.clear(); + + params.locallab.localTgaincurve = cretiend; + params.locallab.llcurve = cllend; + params.locallab.LHcurve = clhend; + params.locallab.cccurve = cccend; + + + + params.locallab.getCurves (locRETgainCurve, locRETgainCurverab, loclhCurve); + bool locallutili = false; + bool localcutili = false; + + CurveFactory::curveLocal (locallutili, params.locallab.llcurve, lllocalcurve, 1); + CurveFactory::curveCCLocal (localcutili, params.locallab.cccurve, cclocalcurve, 1); + double huere, chromare, lumare; + + ipf.calc_ref (2, sp, (float**)shbuffer, labView, labView, 0, 0, 0, 0, fw, fh, fw, fh, locutili, 1, locRETgainCurve, locallutili, lllocalcurve, loclhCurve, cclocalcurve, huere, chromare, lumare); + params.locallab.hueref = huere; + params.locallab.chromaref = chromare; + params.locallab.lumaref = lumare; + + ipf.Lab_Local (2, sp, (float**)shbuffer, labView, labView, 0, 0, 0, 0, fw, fh, fw, fh, locutili, 1, locRETgainCurve, locallutili, lllocalcurve, loclhCurve, cclocalcurve, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref); + lllocalcurve.clear(); + cclocalcurve.clear(); + + } + + + + for (int i = 0; i < 61; i++) { + delete [] dataspots[i]; + } + + delete [] dataspots; + + + + + delete [] retistrs; + delete [] llstrs; + delete [] lhstrs; + delete [] ccstrs; + + if (params.locallab.inverssha) { + + for (int i = 0; i < fh; i++) { + delete [] shbuffer[i]; + } + + delete [] shbuffer; + } + + + } + + t2.set(); + + if ( settings->verbose ) { + printf ("Total local:- %d usec\n", t2.etime (t1)); + } - if (!params.sh.hq) { - shradius *= radius / 1800.0; } - shmap->update (baseImg, shradius, ipf.lumimul, params.sh.hq, 1); + ipf.chromiLuminanceCurve (nullptr, 1, labView, labView, curve1, curve2, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, dummy, dummy); + + if ((params.colorappearance.enabled && !params.colorappearance.tonecie) || (!params.colorappearance.enabled)) { + ipf.EPDToneMap (labView, 5, 1); + } + + + ipf.vibrance (labView); + + if ((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) { + ipf.impulsedenoise (labView); + } + + // for all treatments Defringe, Sharpening, Contrast detail ,Microcontrast they are activated if "CIECAM" function are disabled + + if ((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) { + ipf.defringe (labView); + } + + if (params.sharpenEdge.enabled) { + ipf.MLsharpen (labView); + } + + if (params.sharpenMicro.enabled) { + if ((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) { + ipf.MLmicrocontrast (labView); //!params.colorappearance.sharpcie + } + } + + if (((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) && params.sharpening.enabled) { + + float **buffer = new float*[fh]; + + for (int i = 0; i < fh; i++) { + buffer[i] = new float[fw]; + } + + ipf.sharpening (labView, (float**)buffer, params.sharpening); + + for (int i = 0; i < fh; i++) { + delete [] buffer[i]; + } + + delete [] buffer; + } + + WaveletParams WaveParams = params.wavelet; + WavCurve wavCLVCurve; + WavOpacityCurveRG waOpacityCurveRG; + WavOpacityCurveBY waOpacityCurveBY; + WavOpacityCurveW waOpacityCurveW; + WavOpacityCurveWL waOpacityCurveWL; + + params.wavelet.getCurves (wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL ); + + + // directional pyramid wavelet + if (params.dirpyrequalizer.cbdlMethod == "aft") { + if ((params.colorappearance.enabled && !settings->autocielab) || !params.colorappearance.enabled) { + ipf.dirpyrequalizer (labView, 1); //TODO: this is the luminance tonecurve, not the RGB one + } + } + + bool wavcontlutili = false; + + CurveFactory::curveWavContL (wavcontlutili, params.wavelet.wavclCurve, wavclCurve,/* hist16C, dummy,*/ 1); + + if (params.wavelet.enabled) { + ipf.ip_wavelet (labView, labView, 2, WaveParams, wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL, wavclCurve, wavcontlutili, 1); + } + + wavCLVCurve.Reset(); + + //Colorappearance and tone-mapping associated + + int f_w = 1, f_h = 1; + int begh = 0, endh = fh; + + if (params.colorappearance.tonecie || params.colorappearance.enabled) { + f_w = fw; + f_h = fh; + } + + CieImage *cieView = new CieImage (f_w, (f_h)); + begh = 0; + endh = fh; + CurveFactory::curveLightBrightColor ( + params.colorappearance.curve, + params.colorappearance.curve2, + params.colorappearance.curve3, + hist16, dummy, + dummy, dummy, + customColCurve1, + customColCurve2, + customColCurve3, + 1); + + if (params.colorappearance.enabled) { + double adap; + float fnum = imgsrc->getMetaData()->getFNumber ();// F number + float fiso = imgsrc->getMetaData()->getISOSpeed () ;// ISO + float fspeed = imgsrc->getMetaData()->getShutterSpeed () ;//speed + float fcomp = imgsrc->getMetaData()->getExpComp ();//compensation + - + + if (fnum < 0.3f || fiso < 5.f || fspeed < 0.00001f) { + adap = 2000.; + }//if no exif data or wrong + else { + float E_V = fcomp + log2 ((fnum * fnum) / fspeed / (fiso / 100.f)); + E_V += params.toneCurve.expcomp;// exposure compensation in tonecurve ==> direct EV + E_V += log2 (params.raw.expos); // exposure raw white point ; log2 ==> linear to EV + adap = powf (2.f, E_V - 3.f); //cd / m2 + } + + LUTf CAMBrightCurveJ; + LUTf CAMBrightCurveQ; + float CAMMean = NAN; + + if (params.sharpening.enabled) { + if (settings->ciecamfloat) { + float d; + ipf.ciecam_02float (cieView, float (adap), begh, endh, 1, 2, labView, ¶ms, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, d, 1, 1); + } else { + double dd; + ipf.ciecam_02 (cieView, adap, begh, endh, 1, 2, labView, ¶ms, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, dd, 1, 1); + } + } else { + if (settings->ciecamfloat) { + float d; + ipf.ciecam_02float (cieView, float (adap), begh, endh, 1, 2, labView, ¶ms, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, d, 1, 1); + } else { + double dd; + ipf.ciecam_02 (cieView, adap, begh, endh, 1, 2, labView, ¶ms, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, dd, 1, 1); + } + } + } + + delete cieView; + cieView = nullptr; + + + + + // end tile processing...??? + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if (pl) { + pl->setProgress (0.60); + } + + int imw, imh; + double tmpScale = ipf.resizeScale (¶ms, fw, fh, imw, imh); + bool labResize = params.resize.enabled && params.resize.method != "Nearest" && tmpScale != 1.0; + LabImage *tmplab; + + // crop and convert to rgb16 + int cx = 0, cy = 0, cw = labView->W, ch = labView->H; + + if (params.crop.enabled) { + cx = params.crop.x; + cy = params.crop.y; + cw = params.crop.w; + ch = params.crop.h; + + if (labResize) { // crop lab data + tmplab = new LabImage (cw, ch); + + for (int row = 0; row < ch; row++) { + for (int col = 0; col < cw; col++) { + tmplab->L[row][col] = labView->L[row + cy][col + cx]; + tmplab->a[row][col] = labView->a[row + cy][col + cx]; + tmplab->b[row][col] = labView->b[row + cy][col + cx]; + } + } + + delete labView; + labView = tmplab; + cx = 0; + cy = 0; + } + } + + if (labResize) { // resize lab data + // resize image + tmplab = new LabImage (imw, imh); + ipf.Lanczos (labView, tmplab, tmpScale); + delete labView; + labView = tmplab; + cw = labView->W; + ch = labView->H; + + if (params.prsharpening.enabled) { + for (int i = 0; i < ch; i++) + for (int j = 0; j < cw; j++) { + labView->L[i][j] = labView->L[i][j] < 0.f ? 0.f : labView->L[i][j]; + } + + float **buffer = new float*[ch]; + + for (int i = 0; i < ch; i++) { + buffer[i] = new float[cw]; + } + + ipf.sharpening (labView, (float**)buffer, params.prsharpening); + + for (int i = 0; i < ch; i++) { + delete [] buffer[i]; + } + + delete [] buffer; + } + } + + Image16* readyImg = nullptr; + cmsHPROFILE jprof = nullptr; + bool customGamma = false; + bool useLCMS = false; + bool bwonly = params.blackwhite.enabled && !params.colorToning.enabled && !autili && !butili ; + + if (params.icm.gamma != "default" || params.icm.freegamma) { // if select gamma output between BT709, sRGB, linear, low, high, 2.2 , 1.8 + + GammaValues ga; + // if(params.blackwhite.enabled) params.toneCurve.hrenabled=false; + readyImg = ipf.lab2rgb16 (labView, cx, cy, cw, ch, params.icm, bwonly, &ga); + customGamma = true; + + //or selected Free gamma + useLCMS = false; + + if ((jprof = ICCStore::getInstance()->createCustomGammaOutputProfile (params.icm, ga)) == nullptr) { + useLCMS = true; + } + + } else { + // if Default gamma mode: we use the profile selected in the "Output profile" combobox; + // gamma come from the selected profile, otherwise it comes from "Free gamma" tool + + readyImg = ipf.lab2rgb16 (labView, cx, cy, cw, ch, params.icm, bwonly); + + if (settings->verbose) { + printf ("Output profile_: \"%s\"\n", params.icm.output.c_str()); + } + } + + delete labView; + labView = nullptr; + + + + if (bwonly) { //force BW r=g=b + if (settings->verbose) { + printf ("Force BW\n"); + } + + for (int ccw = 0; ccw < cw; ccw++) { + for (int cch = 0; cch < ch; cch++) { + readyImg->r (cch, ccw) = readyImg->g (cch, ccw); + readyImg->b (cch, ccw) = readyImg->g (cch, ccw); + } + } + } + + if (pl) { + pl->setProgress (0.70); + } + + if (tmpScale != 1.0 && params.resize.method == "Nearest") { // resize rgb data (gamma applied) + Image16* tempImage = new Image16 (imw, imh); + ipf.resize (readyImg, tempImage, tmpScale); + delete readyImg; + readyImg = tempImage; + } + + if (tunnelMetaData) { + readyImg->setMetadata (ii->getMetaData()->getExifData ()); + } else { + readyImg->setMetadata (ii->getMetaData()->getExifData (), params.exif, params.iptc); + } + + + // Setting the output curve to readyImg + if (customGamma) { + if (!useLCMS) { + // use corrected sRGB profile in order to apply a good TRC if present, otherwise use LCMS2 profile generated by lab2rgb16 w/ gamma + ProfileContent pc (jprof); + readyImg->setOutputProfile (pc.getData().c_str(), pc.getData().size()); + } + } else { + // use the selected output profile if present, otherwise use LCMS2 profile generate by lab2rgb16 w/ gamma + + if (params.icm.output != "" && params.icm.output != ColorManagementParams::NoICMString) { + + // if ICCStore::getInstance()->getProfile send back an object, then ICCStore::getInstance()->getContent will do too + cmsHPROFILE jprof = ICCStore::getInstance()->getProfile (params.icm.output); //get outProfile + + if (jprof == nullptr) { + if (settings->verbose) { + printf ("\"%s\" ICC output profile not found!\n - use LCMS2 substitution\n", params.icm.output.c_str()); + } + } else { + if (settings->verbose) { + printf ("Using \"%s\" output profile\n", params.icm.output.c_str()); + } + + ProfileContent pc = ICCStore::getInstance()->getContent (params.icm.output); + readyImg->setOutputProfile (pc.getData().c_str(), pc.getData().size()); + } + } else { + // No ICM + readyImg->setOutputProfile (nullptr, 0); + } + } + +// t2.set(); +// if( settings->verbose ) +// printf("Total:- %d usec\n", t2.etime(t1)); + + if (!job->initialImage) { + ii->decreaseRef (); + } + + delete job; + + if (pl) { + pl->setProgress (0.75); + } + + /* curve1.reset();curve2.reset(); + curve.reset(); + satcurve.reset(); + lhskcurve.reset(); + + rCurve.reset(); + gCurve.reset(); + bCurve.reset(); + hist16.reset(); + hist16C.reset(); + */ + return readyImg; } - // RGB processing + void stage_early_resize() + { + procparams::ProcParams& params = job->pparams; + //ImProcFunctions ipf (¶ms, true); + ImProcFunctions &ipf = * (ipf_p.get()); - LUTf curve1 (65536); - LUTf curve2 (65536); - LUTf curve (65536, 0); - LUTf satcurve (65536, 0); - LUTf lhskcurve (65536, 0); - LUTf lumacurve (32770, 0); // lumacurve[32768] and lumacurve[32769] will be set to 32768 and 32769 later to allow linear interpolation - LUTf clcurve (65536, 0); + int imw, imh; + double scale_factor = ipf.resizeScale (¶ms, fw, fh, imw, imh); + + std::unique_ptr tmplab (new LabImage (fw, fh)); + ipf.rgb2lab (*baseImg, *tmplab, params.icm.working); + + if (params.crop.enabled) { + int cx = params.crop.x; + int cy = params.crop.y; + int cw = params.crop.w; + int ch = params.crop.h; + + std::unique_ptr cropped (new LabImage (cw, ch)); + + for (int row = 0; row < ch; row++) { + for (int col = 0; col < cw; col++) { + cropped->L[row][col] = tmplab->L[row + cy][col + cx]; + cropped->a[row][col] = tmplab->a[row + cy][col + cx]; + cropped->b[row][col] = tmplab->b[row + cy][col + cx]; + } + } + + tmplab = std::move (cropped); + } + + assert (params.resize.enabled); + + // resize image + { + std::unique_ptr resized (new LabImage (imw, imh)); + ipf.Lanczos (tmplab.get(), resized.get(), scale_factor); + tmplab = std::move (resized); + } + + adjust_procparams (scale_factor); + + fw = imw; + fh = imh; + + delete baseImg; + baseImg = new Imagefloat (fw, fh); + ipf.lab2rgb (*tmplab, *baseImg, params.icm.working); + } + + void adjust_procparams (double scale_factor) + { + procparams::ProcParams ¶ms = job->pparams; + procparams::ProcParams defaultparams; + + params.resize.enabled = false; + params.crop.enabled = false; + + if (params.prsharpening.enabled) { + params.sharpening = params.prsharpening; + } else { + adjust_radius (defaultparams.sharpening.radius, scale_factor, + params.sharpening.radius); + } + + params.impulseDenoise.thresh *= scale_factor; + + if (scale_factor < 0.5) { + params.impulseDenoise.enabled = false; + } + + params.wavelet.strength *= scale_factor; + params.dirpyrDenoise.luma *= scale_factor; + + //params.dirpyrDenoise.smethod = "shal"; + for (auto &p : params.dirpyrDenoise.lcurve) { + p *= scale_factor; + } + + params.epd.scale *= scale_factor; + //params.epd.edgeStopping *= scale_factor; + + const double dirpyreq_scale = min (scale_factor * 1.5, 1.0); + + for (int i = 0; i < 6; ++i) { + adjust_radius (defaultparams.dirpyrequalizer.mult[i], dirpyreq_scale, + params.dirpyrequalizer.mult[i]); + } + + adjust_radius (defaultparams.defringe.radius, scale_factor, + params.defringe.radius); + adjust_radius (defaultparams.sh.radius, scale_factor, params.sh.radius); + + if (params.raw.xtranssensor.method == + procparams::RAWParams::XTransSensor::methodstring[ + procparams::RAWParams::XTransSensor::threePass]) { + params.raw.xtranssensor.method = + procparams::RAWParams::XTransSensor::methodstring[ + procparams::RAWParams::XTransSensor::onePass]; + } + } + +private: + ProcessingJobImpl* job; + int& errorCode; + ProgressListener* pl; + bool tunnelMetaData; + bool flush; + + // internal state + std::unique_ptr ipf_p; + InitialImage *ii; + ImageSource *imgsrc; + int fw; + int fh; + + int tr; + PreviewProps pp; + + NoiseCurve noiseLCurve; + NoiseCurve noiseCCurve; + Imagefloat *calclum; + float autoNR; + float autoNRmax; + int tilesize; + int overlap; + + float *ch_M; + float *max_r; + float *max_b; + float *min_b; + float *min_r; + float *lumL; + float *chromC; + float *ry; + float *sk; + float *pcsk; + + double expcomp; + int bright; + int contr; + int black; + int hlcompr; + int hlcomprthresh; + + ColorTemp currWB; + Imagefloat *baseImg; + LabImage* labView; + + LUTu hist16; + + LUTf curve1; + LUTf curve2; + LUTf curve; + LUTf satcurve; + LUTf lhskcurve; + LUTf lumacurve; + LUTf clcurve; LUTf clToningcurve; LUTf cl2Toningcurve; - LUTf wavclCurve (65536, 0); + LUTf wavclCurve; LUTf rCurve; LUTf gCurve; @@ -799,1194 +2237,17 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p ColorAppearance customColCurve1, customColCurve2, customColCurve3 ; ToneCurve customToneCurvebw1; ToneCurve customToneCurvebw2; - //if(params.blackwhite.enabled) params.toneCurve.hrenabled=false; - CurveFactory::complexCurve (expcomp, black / 65535.0, hlcompr, hlcomprthresh, params.toneCurve.shcompr, bright, contr, - params.toneCurve.curveMode, params.toneCurve.curve, params.toneCurve.curveMode2, params.toneCurve.curve2, - hist16, curve1, curve2, curve, dummy, customToneCurve1, customToneCurve2 ); + bool autili, butili; +}; - CurveFactory::RGBCurve (params.rgbCurves.rcurve, rCurve, 1); - CurveFactory::RGBCurve (params.rgbCurves.gcurve, gCurve, 1); - CurveFactory::RGBCurve (params.rgbCurves.bcurve, bCurve, 1); +} // namespace - bool opautili = false; - if(params.colorToning.enabled) { - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.working); - double wp[3][3] = { - {wprof[0][0], wprof[0][1], wprof[0][2]}, - {wprof[1][0], wprof[1][1], wprof[1][2]}, - {wprof[2][0], wprof[2][1], wprof[2][2]} - }; - TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params.icm.working); - double wip[3][3] = { - {wiprof[0][0], wiprof[0][1], wiprof[0][2]}, - {wiprof[1][0], wiprof[1][1], wiprof[1][2]}, - {wiprof[2][0], wiprof[2][1], wiprof[2][2]} - }; - params.colorToning.getCurves (ctColorCurve, ctOpacityCurve, wp, wip, opautili); - clToningcurve (65536, 0); - CurveFactory::curveToning (params.colorToning.clcurve, clToningcurve, 1); - cl2Toningcurve (65536, 0); - CurveFactory::curveToning (params.colorToning.cl2curve, cl2Toningcurve, 1); - } - - LabImage* labView = new LabImage (fw, fh); - - if (params.blackwhite.enabled) { - CurveFactory::curveBW (params.blackwhite.beforeCurve, params.blackwhite.afterCurve, hist16, dummy, customToneCurvebw1, customToneCurvebw2, 1); - } - - double rrm, ggm, bbm; - float autor, autog, autob; - float satLimit = float (params.colorToning.satProtectionThreshold) / 100.f * 0.7f + 0.3f; - float satLimitOpacity = 1.f - (float (params.colorToning.saturatedOpacity) / 100.f); - - if (params.colorToning.enabled && params.colorToning.autosat) { //for colortoning evaluation of saturation settings - float moyS = 0.f; - float eqty = 0.f; - ipf.moyeqt (baseImg, moyS, eqty);//return image : mean saturation and standard dev of saturation - float satp = ((moyS + 1.5f * eqty) - 0.3f) / 0.7f; //1.5 sigma ==> 93% pixels with high saturation -0.3 / 0.7 convert to Hombre scale - - if (satp >= 0.92f) { - satp = 0.92f; //avoid values too high (out of gamut) - } - - if (satp <= 0.15f) { - satp = 0.15f; //avoid too low values - } - - satLimit = 100.f * satp; - - satLimitOpacity = 100.f * (moyS - 0.85f * eqty); //-0.85 sigma==>20% pixels with low saturation - } - - autor = -9000.f; // This will ask to compute the "auto" values for the B&W tool (have to be inferior to -5000) - DCPProfile::ApplyState as; - DCPProfile *dcpProf = imgsrc->getDCP (params.icm, currWB, as); - - LUTu histToneCurve; - - ipf.rgbProc (baseImg, labView, nullptr, curve1, curve2, curve, shmap, params.toneCurve.saturation, rCurve, gCurve, bCurve, satLimit , satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob, expcomp, hlcompr, hlcomprthresh, dcpProf, as, histToneCurve); - - if (settings->verbose) { - printf ("Output image / Auto B&W coefs: R=%.2f G=%.2f B=%.2f\n", autor, autog, autob); - } - - // if clut was used and size of clut cache == 1 we free the memory used by the clutstore (default clut cache size = 1 for 32 bit OS) - if ( params.filmSimulation.enabled && !params.filmSimulation.clutFilename.empty() && options.clutCacheSize == 1) { - CLUTStore::getInstance().clearCache(); - } - - // freeing up some memory - customToneCurve1.Reset(); - customToneCurve2.Reset(); - ctColorCurve.Reset(); - ctOpacityCurve.Reset(); - noiseLCurve.Reset(); - noiseCCurve.Reset(); - customToneCurvebw1.Reset(); - customToneCurvebw2.Reset(); - - // Freeing baseImg because not used anymore - delete baseImg; - baseImg = nullptr; - - if (shmap) { - delete shmap; - } - - shmap = nullptr; - - if (pl) { - pl->setProgress (0.55); - } - - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - // start tile processing...??? - - - if (params.labCurve.contrast != 0) { //only use hist16 for contrast - hist16.clear(); - -#ifdef _OPENMP - #pragma omp parallel -#endif - { - LUTu hist16thr (hist16.getSize()); // one temporary lookup table per thread - hist16thr.clear(); -#ifdef _OPENMP - #pragma omp for schedule(static) nowait -#endif - - for (int i = 0; i < fh; i++) - for (int j = 0; j < fw; j++) { - hist16thr[ (int) ((labView->L[i][j]))]++; - } - - #pragma omp critical - { - hist16 += hist16thr; - } - } - } - - bool utili; - CurveFactory::complexLCurve (params.labCurve.brightness, params.labCurve.contrast, params.labCurve.lcurve, hist16, lumacurve, dummy, 1, utili); - - bool clcutili; - CurveFactory::curveCL (clcutili, params.labCurve.clcurve, clcurve, 1); - - bool autili, butili, ccutili, cclutili; - CurveFactory::complexsgnCurve (autili, butili, ccutili, cclutili, params.labCurve.acurve, params.labCurve.bcurve, params.labCurve.cccurve, - params.labCurve.lccurve, curve1, curve2, satcurve, lhskcurve, 1); - - bool locutili = false; - bool locallutili = false; - bool localcutili = false; - - if (params.locallab.enabled) { - MyTime t1, t2; - t1.set(); - CacheManager* cachemgr; - - CacheImageData cfs; - cfs.md5 = cachemgr->getMD5 (imgsrc->getFileName()); - std::string mdfive = cfs.md5; - - Glib::ustring pop = options.cacheBaseDir + "/mip/"; - - Glib::ustring datalab; - - if (options.mip == MI_opt) { - datalab = pop + Glib::path_get_basename (imgsrc->getFileName () + "." + mdfive + ".mip"); - } - - if (options.mip == MI_prev) { - datalab = imgsrc->getFileName() + ".mip"; - } - - - LocretigainCurve locRETgainCurve; - LocLHCurve loclhCurve; - - LocretigainCurverab locRETgainCurverab; - LUTf lllocalcurve (65536, 0); - LUTf cclocalcurve (65536, 0); - - int realspot = params.locallab.nbspot; - int maxspot = settings->nspot + 1; - ifstream fic0 (datalab, ios::in); - float** shbuffer; - int versionmip = 0; - std::string delim[69] = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", - "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", - "&", "#", "{", "[", "]", "}", "$", "*", "?", ">", "!", ";", "<"",(", ")", "+", "-" - }; - - if (params.locallab.inverssha) { - shbuffer = new float*[fh]; - - for (int i = 0; i < fh; i++) { - shbuffer[i] = new float[fw]; - } - } - - if (fic0) {//normally we don't use here but ?? - //find the version mip - string line; - string spotline; - int cont = 0; - - while (getline (fic0, line)) { - spotline = line; - std::size_t pos = spotline.find ("="); - std::size_t posend = spotline.find ("@"); //in case of for futur use - - if (spotline.substr (0, pos) == "Mipversion") { - string strversion = spotline.substr (pos + 1, (posend - pos)); - versionmip = std::stoi (strversion.c_str()); - } - - if (spotline.substr (0, pos) == "Spot") { - cont = 0; - } - - - } - - fic0.close(); - } - - ifstream fich (datalab, ios::in); - - if (fich && versionmip != 0) { - std::string inser; - - int **dataspots; - dataspots = new int*[61]; - - for (int i = 0; i < 61; i++) { - dataspots[i] = new int[maxspot]; - } - - - std::string *retistrs; - retistrs = new std::string[maxspot]; - std::string *llstrs; - - llstrs = new std::string[maxspot]; - - std::string *lhstrs; - lhstrs = new std::string[maxspot]; - - std::string *ccstrs; - ccstrs = new std::string[maxspot]; - - { - dataspots[2][0] = params.locallab.circrad; - dataspots[3][0] = params.locallab.locX; - dataspots[4][0] = params.locallab.locY; - dataspots[5][0] = params.locallab.locYT; - dataspots[6][0] = params.locallab.locXL; - dataspots[7][0] = params.locallab.centerX; - dataspots[8][0] = params.locallab.centerY; - dataspots[9][0] = params.locallab.lightness; - dataspots[10][0] = params.locallab.contrast; - dataspots[11][0] = params.locallab.chroma; - dataspots[12][0] = params.locallab.sensi; - dataspots[13][0] = params.locallab.transit; - - if (!params.locallab.invers) { - dataspots[14][0] = 0; - } else { - dataspots[14][0] = 1; - } - - if (params.locallab.Smethod == "IND") { - dataspots[15][0] = 0; - } else if (params.locallab.Smethod == "SYM") { - dataspots[15][0] = 1; - } else if (params.locallab.Smethod == "INDSL") { - dataspots[15][0] = 2; - } else if (params.locallab.Smethod == "SYMSL") { - dataspots[15][0] = 3; - } - - dataspots[17][0] = params.locallab.radius; - dataspots[18][0] = params.locallab.strength; - dataspots[19][0] = params.locallab.sensibn; - - if (!params.locallab.inversrad) { - dataspots[20][0] = 0; - } else { - dataspots[20][0] = 1; - } - - dataspots[21][0] = params.locallab.str; - dataspots[22][0] = params.locallab.chrrt; - dataspots[23][0] = params.locallab.neigh; - dataspots[24][0] = params.locallab.vart; - dataspots[25][0] = params.locallab.sensih; - - if (!params.locallab.inversret) { - dataspots[26][0] = 0; - } else { - dataspots[26][0] = 1; - } - - if (params.locallab.retinexMethod == "low") { - dataspots[27][0] = 0; - } else if (params.locallab.retinexMethod == "uni") { - dataspots[27][0] = 1; - } else if (params.locallab.retinexMethod == "high") { - dataspots[27][0] = 2; - } - - - dataspots[28][0] = params.locallab.sharradius; - dataspots[29][0] = params.locallab.sharamount; - dataspots[30][0] = params.locallab.shardamping; - dataspots[31][0] = params.locallab.shariter; - dataspots[32][0] = params.locallab.sensisha; - - if (!params.locallab.inverssha) { - dataspots[33][0] = 0; - } else { - dataspots[33][0] = 1; - } - - if (params.locallab.qualityMethod == "std") { - dataspots[34][0] = 0; - } else if (params.locallab.qualityMethod == "enh") { - dataspots[34][0] = 1; - } else if (params.locallab.qualityMethod == "enhden") { - dataspots[34][0] = 2; - } - - dataspots[35][0] = params.locallab.thres; - dataspots[36][0] = params.locallab.proxi; - - dataspots[37][0] = params.locallab.noiselumf; - dataspots[38][0] = params.locallab.noiselumc; - dataspots[39][0] = params.locallab.noisechrof; - dataspots[40][0] = params.locallab.noisechroc; - - dataspots[41][0] = params.locallab.mult[0]; - dataspots[42][0] = params.locallab.mult[1]; - dataspots[43][0] = params.locallab.mult[2]; - dataspots[44][0] = params.locallab.mult[3]; - dataspots[45][0] = params.locallab.mult[4]; - dataspots[46][0] = params.locallab.threshold; - dataspots[47][0] = params.locallab.sensicb; - - if (!params.locallab.activlum) { - dataspots[48][0] = 0; - } else { - dataspots[48][0] = 1; - } - - dataspots[49][0] = params.locallab.stren; - dataspots[50][0] = params.locallab.gamma; - dataspots[51][0] = params.locallab.estop; - dataspots[52][0] = params.locallab.scaltm; - dataspots[53][0] = params.locallab.rewei; - dataspots[54][0] = params.locallab.sensitm; - dataspots[55][0] = params.locallab.retrab; - - if (!params.locallab.curvactiv) { - dataspots[56][0] = 0; - } else { - dataspots[56][0] = 1; - } - - if (params.locallab.qualitycurveMethod == "none") { - dataspots[57][0] = 0; - } else if (params.locallab.qualitycurveMethod == "std") { - dataspots[57][0] = 1; - } else if (params.locallab.qualitycurveMethod == "enh") { - dataspots[57][0] = 2; - } - - dataspots[58][0] = 100.f * params.locallab.hueref; - dataspots[59][0] = params.locallab.chromaref; - dataspots[60][0] = params.locallab.lumaref; - - //curve Reti local - int siz = params.locallab.localTgaincurve.size(); - - if (siz > 69) { - siz = 69;//avoid crash - } - - int s_cur[siz + 1]; - int s_datcur[siz + 1]; - - for (int j = 0; j < siz; j++) { - s_datcur[j] = (int) (1000. * params.locallab.localTgaincurve[j]); - } - - std::string cur_str = ""; - - for (int j = 0; j < siz; j++) { - cur_str = cur_str + std::to_string (s_datcur[j]) + delim[j]; - } - - inser = retistrs[0] = cur_str + "@"; - - int sizl = params.locallab.llcurve.size(); - - if (sizl > 69) { - sizl = 69; - } - - int s_curl[sizl + 1]; - int s_datcurl[sizl + 1]; - - for (int j = 0; j < sizl; j++) { - s_datcurl[j] = (int) (1000. * params.locallab.llcurve[j]); - } - - std::string ll_str = ""; - - for (int j = 0; j < sizl; j++) { - ll_str = ll_str + std::to_string (s_datcurl[j]) + delim[j]; - } - - llstrs[0] = ll_str + "@"; - - - int sizc = params.locallab.cccurve.size(); - - if (sizc > 69) { - sizc = 69; - } - - int s_curc[sizc + 1]; - int s_datcurc[sizc + 1]; - - for (int j = 0; j < sizc; j++) { - s_datcurc[j] = (int) (1000. * params.locallab.cccurve[j]); - } - - std::string cc_str = ""; - - for (int j = 0; j < sizc; j++) { - cc_str = cc_str + std::to_string (s_datcurc[j]) + delim[j]; - } - - ccstrs[0] = cc_str + "@"; - - // - - int sizh = params.locallab.LHcurve.size(); - - if (sizh > 69) { - sizh = 69; - } - - int s_curh[sizh + 1]; - int s_datcurh[sizh + 1]; - - for (int j = 0; j < sizh; j++) { - s_datcurh[j] = (int) (1000. * params.locallab.LHcurve[j]); - } - - std::string lh_str = ""; - - for (int j = 0; j < sizl; j++) { - lh_str = lh_str + std::to_string (s_datcurh[j]) + delim[j]; - } - - lhstrs[0] = lh_str + "@"; - - - } - locallutili = false; - - - int ns; - int realsp = params.locallab.nbspot; - - if (fich) { - - std::string line; - std::string spotline; - int cont = 0; - int sizecu; - int sizell; - int sizelh; - int sizecc; - - while (getline (fich, line)) { - spotline = line; - std::size_t pos = spotline.find ("="); - std::size_t posend = spotline.find ("@"); //in case of for futur use - - if (spotline.substr (0, pos) == "Mipversion") { - std::string strversion = spotline.substr (pos + 1, (posend - pos)); - versionmip = std::stoi (strversion.c_str()); - } - - if (spotline.substr (0, pos) == "Spot") { - cont = 0; - } - - cont++; - std::string str3 = spotline.substr (pos + 1, (posend - pos)); - - if (cont == 1) { - ns = std::stoi (str3.c_str()); - } - - if (cont >= 2 && cont < 16) { - dataspots[cont][ns] = std::stoi (str3.c_str()); - - } - - if (spotline.substr (0, pos) == "Currentspot") { - dataspots[16][0] = std::stoi (str3.c_str()); - } - - if (cont > 16 && cont < 61) { - dataspots[cont][ns] = std::stoi (str3.c_str()); - - } - - if (spotline.substr (0, pos) == "curveReti") { - std::string curstr; - int longecur; - std::string strend = spotline.substr (posend - 1, 1); - std::size_t posz = spotline.find (strend); - int longe; - - for (int sl = 0; sl < 69; sl++) { - if (delim[sl] == strend) { - longe = sl + 1; - } - } - - retistrs[ns] = str3; - sizecu = longe; - } - - if (spotline.substr (0, pos) == "curveLL") { - std::string curstrl; - int longecurl; - std::string strendl = spotline.substr (posend - 1, 1); - std::size_t poszl = spotline.find (strendl); - int longel; - - for (int sl = 0; sl < 69; sl++) { - if (delim[sl] == strendl) { - longel = sl + 1; - } - } - - llstrs[ns] = str3; - sizell = longel; - - } - - if (spotline.substr (0, pos) == "curveLH") { - std::string curstrh; - int longecurh; - std::string strendh = spotline.substr (posend - 1, 1); - std::size_t poszh = spotline.find (strendh); - int longeh; - - for (int sh = 0; sh < 69; sh++) { - if (delim[sh] == strendh) { - longeh = sh + 1; - } - } - - lhstrs[ns] = str3; - sizelh = longeh; - } - - if (spotline.substr (0, pos) == "curveCC") { - std::string curstrc; - int longecurc; - std::string strendc = spotline.substr (posend - 1, 1); - std::size_t poszc = spotline.find (strendc); - int longec; - - for (int sh = 0; sh < 69; sh++) { - if (delim[sh] == strendc) { - longec = sh + 1; - } - } - - ccstrs[ns] = str3; - sizecc = longec; - } - - } - - fich.close(); - } - - - for (int sp = 1; sp < maxspot; sp++) { //spots default - params.locallab.hueref = INFINITY; - params.locallab.chromaref = INFINITY; - params.locallab.lumaref = INFINITY; - - params.locallab.circrad = dataspots[2][sp]; - params.locallab.locX = dataspots[3][sp]; - params.locallab.locY = dataspots[4][sp]; - params.locallab.locYT = dataspots[5][sp]; - params.locallab.locXL = dataspots[6][sp]; - params.locallab.centerX = dataspots[7][sp]; - params.locallab.centerY = dataspots[8][sp]; - params.locallab.lightness = dataspots[9][sp]; - params.locallab.contrast = dataspots[10][sp]; - params.locallab.chroma = dataspots[11][sp]; - params.locallab.sensi = dataspots[12][sp]; - params.locallab.transit = dataspots[13][sp]; - - if (dataspots[14][sp] == 0) { - params.locallab.invers = false; - } else { - params.locallab.invers = true; - } - - if (dataspots[15][sp] == 0) { - params.locallab.Smethod = "IND" ; - } else if (dataspots[15][sp] == 1) { - params.locallab.Smethod = "SYM" ; - } else if (dataspots[15][sp] == 2) { - params.locallab.Smethod = "INDSL"; - } else if (dataspots[15][sp] == 3) { - params.locallab.Smethod = "SYMSL"; - } - - params.locallab.radius = dataspots[17][sp]; - params.locallab.strength = dataspots[18][sp]; - params.locallab.sensibn = dataspots[19][sp]; - - if (dataspots[20][sp] == 0) { - params.locallab.inversrad = false; - } else { - params.locallab.inversrad = true; - } - - params.locallab.str = dataspots[21][sp]; - params.locallab.chrrt = dataspots[22][sp]; - params.locallab.neigh = dataspots[23][sp]; - params.locallab.vart = dataspots[24][sp]; - params.locallab.sensih = dataspots[25][sp]; - - if (dataspots[26][sp] == 0) { - params.locallab.inversret = false; - } else { - params.locallab.inversret = true; - } - - if (dataspots[27][sp] == 0) { - params.locallab.retinexMethod = "low" ; - } else if (dataspots[27][sp] == 1) { - params.locallab.retinexMethod = "uni" ; - } else if (dataspots[27][sp] == 2) { - params.locallab.retinexMethod = "high"; - } - - params.locallab.sharradius = dataspots[28][sp]; - params.locallab.sharamount = dataspots[29][sp]; - params.locallab.shardamping = dataspots[30][sp]; - params.locallab.shariter = dataspots[31][sp]; - params.locallab.sensisha = dataspots[32][sp]; - - if (dataspots[33][sp] == 0) { - params.locallab.inverssha = false; - } else { - params.locallab.inverssha = true; - } - - if (dataspots[34][sp] == 0) { - params.locallab.qualityMethod = "std" ; - } else if (dataspots[34][sp] == 1) { - params.locallab.qualityMethod = "enh" ; - } else if (dataspots[34][sp] == 2) { - params.locallab.qualityMethod = "enhden" ; - } - - params.locallab.thres = dataspots[35][sp]; - params.locallab.proxi = dataspots[36][sp]; - - params.locallab.noiselumf = dataspots[37][sp]; - params.locallab.noiselumc = dataspots[38][sp]; - params.locallab.noisechrof = dataspots[39][sp]; - params.locallab.noisechroc = dataspots[40][sp]; - - params.locallab.mult[0] = dataspots[41][sp]; - params.locallab.mult[1] = dataspots[42][sp]; - params.locallab.mult[2] = dataspots[43][sp]; - params.locallab.mult[3] = dataspots[44][sp]; - params.locallab.mult[4] = dataspots[45][sp]; - params.locallab.threshold = dataspots[46][sp]; - params.locallab.sensicb = dataspots[47][sp]; - - if (dataspots[48][sp] == 0) { - params.locallab.activlum = false; - } else { - params.locallab.activlum = true; - } - - params.locallab.stren = dataspots[49][sp]; - params.locallab.gamma = dataspots[50][sp]; - params.locallab.estop = dataspots[51][sp]; - params.locallab.scaltm = dataspots[52][sp]; - params.locallab.rewei = dataspots[53][sp]; - params.locallab.sensitm = dataspots[54][sp]; - params.locallab.retrab = dataspots[55][sp]; - - if (dataspots[56][sp] == 0) { - params.locallab.curvactiv = false; - } else { - params.locallab.curvactiv = true; - } - - if (dataspots[57][sp] == 0) { - params.locallab.qualitycurveMethod = "none" ; - } else if (dataspots[57][sp] == 1) { - params.locallab.qualitycurveMethod = "std" ; - } else if (dataspots[57][sp] == 2) { - params.locallab.qualitycurveMethod = "enh" ; - } - - params.locallab.hueref = ((float) dataspots[58][sp]) / 100.f; - params.locallab.chromaref = dataspots[59][sp]; - params.locallab.lumaref = dataspots[60][sp]; - - - int *s_datc; - s_datc = new int[70]; - int siz; - - ipf.strcurv_data (retistrs[sp], s_datc, siz); - std::vector cretiend; - - for (int j = 0; j < siz; j++) { - cretiend.push_back ((double) (s_datc[j]) / 1000.); - } - - delete [] s_datc; - - int *s_datcl; - s_datcl = new int[70]; - int sizl; - - ipf.strcurv_data (llstrs[sp], s_datcl, sizl); - - - std::vector cllend; - - for (int j = 0; j < sizl; j++) { - cllend.push_back ((double) (s_datcl[j]) / 1000.); - } - - delete [] s_datcl; - - int *s_datcc; - s_datcc = new int[70]; - int sizc; - - ipf.strcurv_data (ccstrs[sp], s_datcc, sizc); - - - std::vector cccend; - - for (int j = 0; j < sizc; j++) { - cccend.push_back ((double) (s_datcc[j]) / 1000.); - } - - delete [] s_datcc; - - int *s_datch; - s_datch = new int[70]; - int sizh; - - ipf.strcurv_data (lhstrs[sp], s_datch, sizh); - - - std::vector clhend; - - for (int j = 0; j < sizh; j++) { - clhend.push_back ((double) (s_datch[j]) / 1000.); - } - - - params.locallab.localTgaincurve.clear(); - params.locallab.llcurve.clear(); - params.locallab.LHcurve.clear(); - params.locallab.cccurve.clear(); - - params.locallab.localTgaincurve = cretiend; - params.locallab.llcurve = cllend; - params.locallab.LHcurve = clhend; - params.locallab.cccurve = cccend; - - - - params.locallab.getCurves (locRETgainCurve, locRETgainCurverab, loclhCurve); - bool locallutili = false; - bool localcutili = false; - - CurveFactory::curveLocal (locallutili, params.locallab.llcurve, lllocalcurve, 1); - CurveFactory::curveCCLocal (localcutili, params.locallab.cccurve, cclocalcurve, 1); - double huere, chromare, lumare; - - ipf.calc_ref (2, sp, (float**)shbuffer, labView, labView, 0, 0, 0, 0, fw, fh, fw, fh, locutili, 1, locRETgainCurve, locallutili, lllocalcurve, loclhCurve, cclocalcurve, huere, chromare, lumare); - params.locallab.hueref = huere; - params.locallab.chromaref = chromare; - params.locallab.lumaref = lumare; - - ipf.Lab_Local (2, sp, (float**)shbuffer, labView, labView, 0, 0, 0, 0, fw, fh, fw, fh, locutili, 1, locRETgainCurve, locallutili, lllocalcurve, loclhCurve, cclocalcurve, params.locallab.hueref, params.locallab.chromaref, params.locallab.lumaref); - lllocalcurve.clear(); - cclocalcurve.clear(); - - } - - - - for (int i = 0; i < 61; i++) { - delete [] dataspots[i]; - } - - delete [] dataspots; - - - - - delete [] retistrs; - delete [] llstrs; - delete [] lhstrs; - delete [] ccstrs; - - if (params.locallab.inverssha) { - - for (int i = 0; i < fh; i++) { - delete [] shbuffer[i]; - } - - delete [] shbuffer; - } - - - } - - t2.set(); - - if ( settings->verbose ) { - printf ("Total local:- %d usec\n", t2.etime (t1)); - } - - } - - ipf.chromiLuminanceCurve (nullptr, 1, labView, labView, curve1, curve2, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, dummy, dummy); - - - if ((params.colorappearance.enabled && !params.colorappearance.tonecie) || (!params.colorappearance.enabled)) { - ipf.EPDToneMap (labView, 5, 1); - } - - - ipf.vibrance (labView); - - if ((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) { - ipf.impulsedenoise (labView); - } - - // for all treatments Defringe, Sharpening, Contrast detail ,Microcontrast they are activated if "CIECAM" function are disabled - - if ((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) { - ipf.defringe (labView); - } - - if (params.sharpenEdge.enabled) { - ipf.MLsharpen (labView); - } - - if (params.sharpenMicro.enabled) { - if ((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) { - ipf.MLmicrocontrast (labView); //!params.colorappearance.sharpcie - } - } - - if (((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) && params.sharpening.enabled) { - - float **buffer = new float*[fh]; - - for (int i = 0; i < fh; i++) { - buffer[i] = new float[fw]; - } - - ipf.sharpening (labView, (float**)buffer, params.sharpening); - - for (int i = 0; i < fh; i++) { - delete [] buffer[i]; - } - - delete [] buffer; - } - - WaveletParams WaveParams = params.wavelet; - WavCurve wavCLVCurve; - WavOpacityCurveRG waOpacityCurveRG; - WavOpacityCurveBY waOpacityCurveBY; - WavOpacityCurveW waOpacityCurveW; - WavOpacityCurveWL waOpacityCurveWL; - - params.wavelet.getCurves (wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL ); - - - // directional pyramid wavelet - if (params.dirpyrequalizer.cbdlMethod == "aft") { - if ((params.colorappearance.enabled && !settings->autocielab) || !params.colorappearance.enabled) { - ipf.dirpyrequalizer (labView, 1); //TODO: this is the luminance tonecurve, not the RGB one - } - } - - bool wavcontlutili = false; - - CurveFactory::curveWavContL (wavcontlutili, params.wavelet.wavclCurve, wavclCurve,/* hist16C, dummy,*/ 1); - - if (params.wavelet.enabled) { - ipf.ip_wavelet (labView, labView, 2, WaveParams, wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL, wavclCurve, wavcontlutili, 1); - } - - wavCLVCurve.Reset(); - - //Colorappearance and tone-mapping associated - - int f_w = 1, f_h = 1; - int begh = 0, endh = fh; - - if (params.colorappearance.tonecie || params.colorappearance.enabled) { - f_w = fw; - f_h = fh; - } - - CieImage *cieView = new CieImage (f_w, (f_h)); - begh = 0; - endh = fh; - CurveFactory::curveLightBrightColor ( - params.colorappearance.curve, - params.colorappearance.curve2, - params.colorappearance.curve3, - hist16, dummy, - dummy, dummy, - customColCurve1, - customColCurve2, - customColCurve3, - 1); - - if (params.colorappearance.enabled) { - double adap; - float fnum = imgsrc->getMetaData()->getFNumber ();// F number - float fiso = imgsrc->getMetaData()->getISOSpeed () ;// ISO - float fspeed = imgsrc->getMetaData()->getShutterSpeed () ;//speed - float fcomp = imgsrc->getMetaData()->getExpComp ();//compensation + - - - if (fnum < 0.3f || fiso < 5.f || fspeed < 0.00001f) { - adap = 2000.; - }//if no exif data or wrong - else { - float E_V = fcomp + log2 ((fnum * fnum) / fspeed / (fiso / 100.f)); - E_V += params.toneCurve.expcomp;// exposure compensation in tonecurve ==> direct EV - E_V += log2 (params.raw.expos); // exposure raw white point ; log2 ==> linear to EV - adap = powf (2.f, E_V - 3.f); //cd / m2 - } - - LUTf CAMBrightCurveJ; - LUTf CAMBrightCurveQ; - float CAMMean = NAN; - - if (params.sharpening.enabled) { - if (settings->ciecamfloat) { - float d; - ipf.ciecam_02float (cieView, float (adap), begh, endh, 1, 2, labView, ¶ms, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, d, 1, 1); - } else { - double dd; - ipf.ciecam_02 (cieView, adap, begh, endh, 1, 2, labView, ¶ms, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, dd, 1, 1); - } - } else { - if (settings->ciecamfloat) { - float d; - ipf.ciecam_02float (cieView, float (adap), begh, endh, 1, 2, labView, ¶ms, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, d, 1, 1); - } else { - double dd; - ipf.ciecam_02 (cieView, adap, begh, endh, 1, 2, labView, ¶ms, customColCurve1, customColCurve2, customColCurve3, dummy, dummy, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, 1, true, dd, 1, 1); - } - } - } - - delete cieView; - cieView = nullptr; - - - - - // end tile processing...??? - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - if (pl) { - pl->setProgress (0.60); - } - - int imw, imh; - double tmpScale = ipf.resizeScale (¶ms, fw, fh, imw, imh); - bool labResize = params.resize.enabled && params.resize.method != "Nearest" && tmpScale != 1.0; - LabImage *tmplab; - - // crop and convert to rgb16 - int cx = 0, cy = 0, cw = labView->W, ch = labView->H; - - if (params.crop.enabled) { - cx = params.crop.x; - cy = params.crop.y; - cw = params.crop.w; - ch = params.crop.h; - - if (labResize) { // crop lab data - tmplab = new LabImage (cw, ch); - - for (int row = 0; row < ch; row++) { - for (int col = 0; col < cw; col++) { - tmplab->L[row][col] = labView->L[row + cy][col + cx]; - tmplab->a[row][col] = labView->a[row + cy][col + cx]; - tmplab->b[row][col] = labView->b[row + cy][col + cx]; - } - } - - delete labView; - labView = tmplab; - cx = 0; - cy = 0; - } - } - - if (labResize) { // resize lab data - // resize image - tmplab = new LabImage (imw, imh); - ipf.Lanczos (labView, tmplab, tmpScale); - delete labView; - labView = tmplab; - cw = labView->W; - ch = labView->H; - - if (params.prsharpening.enabled) { - for (int i = 0; i < ch; i++) - for (int j = 0; j < cw; j++) { - labView->L[i][j] = labView->L[i][j] < 0.f ? 0.f : labView->L[i][j]; - } - - float **buffer = new float*[ch]; - - for (int i = 0; i < ch; i++) { - buffer[i] = new float[cw]; - } - - ipf.sharpening (labView, (float**)buffer, params.prsharpening); - - for (int i = 0; i < ch; i++) { - delete [] buffer[i]; - } - - delete [] buffer; - } - } - - Image16* readyImg = nullptr; - cmsHPROFILE jprof = nullptr; - bool customGamma = false; - bool useLCMS = false; - bool bwonly = params.blackwhite.enabled && !params.colorToning.enabled && !autili && !butili ; - - if (params.icm.gamma != "default" || params.icm.freegamma) { // if select gamma output between BT709, sRGB, linear, low, high, 2.2 , 1.8 - - GammaValues ga; - // if(params.blackwhite.enabled) params.toneCurve.hrenabled=false; - readyImg = ipf.lab2rgb16 (labView, cx, cy, cw, ch, params.icm, bwonly, &ga); - customGamma = true; - - //or selected Free gamma - useLCMS = false; - - if ((jprof = ICCStore::getInstance()->createCustomGammaOutputProfile (params.icm, ga)) == nullptr) { - useLCMS = true; - } - - } else { - // if Default gamma mode: we use the profile selected in the "Output profile" combobox; - // gamma come from the selected profile, otherwise it comes from "Free gamma" tool - - readyImg = ipf.lab2rgb16 (labView, cx, cy, cw, ch, params.icm, bwonly); - - if (settings->verbose) { - printf ("Output profile_: \"%s\"\n", params.icm.output.c_str()); - } - } - - delete labView; - labView = nullptr; - - - - if (bwonly) { //force BW r=g=b - if (settings->verbose) { - printf ("Force BW\n"); - } - - for (int ccw = 0; ccw < cw; ccw++) { - for (int cch = 0; cch < ch; cch++) { - readyImg->r (cch, ccw) = readyImg->g (cch, ccw); - readyImg->b (cch, ccw) = readyImg->g (cch, ccw); - } - } - } - - if (pl) { - pl->setProgress (0.70); - } - - if (tmpScale != 1.0 && params.resize.method == "Nearest") { // resize rgb data (gamma applied) - Image16* tempImage = new Image16 (imw, imh); - ipf.resize (readyImg, tempImage, tmpScale); - delete readyImg; - readyImg = tempImage; - } - - if (tunnelMetaData) { - readyImg->setMetadata (ii->getMetaData()->getExifData ()); - } else { - readyImg->setMetadata (ii->getMetaData()->getExifData (), params.exif, params.iptc); - } - - - // Setting the output curve to readyImg - if (customGamma) { - if (!useLCMS) { - // use corrected sRGB profile in order to apply a good TRC if present, otherwise use LCMS2 profile generated by lab2rgb16 w/ gamma - ProfileContent pc(jprof); - readyImg->setOutputProfile(pc.getData().c_str(), pc.getData().size()); - } - } else { - // use the selected output profile if present, otherwise use LCMS2 profile generate by lab2rgb16 w/ gamma - - if (params.icm.output != "" && params.icm.output != ColorManagementParams::NoICMString) { - - // if ICCStore::getInstance()->getProfile send back an object, then ICCStore::getInstance()->getContent will do too - cmsHPROFILE jprof = ICCStore::getInstance()->getProfile(params.icm.output); //get outProfile - - if (jprof == nullptr) { - if (settings->verbose) { - printf ("\"%s\" ICC output profile not found!\n - use LCMS2 substitution\n", params.icm.output.c_str()); - } - } else { - if (settings->verbose) { - printf ("Using \"%s\" output profile\n", params.icm.output.c_str()); - } - - ProfileContent pc = ICCStore::getInstance()->getContent (params.icm.output); - readyImg->setOutputProfile(pc.getData().c_str(), pc.getData().size()); - } - } else { - // No ICM - readyImg->setOutputProfile (nullptr, 0); - } - } - -// t2.set(); -// if( settings->verbose ) -// printf("Total:- %d usec\n", t2.etime(t1)); - - if (!job->initialImage) { - ii->decreaseRef (); - } - - delete job; - - if (pl) { - pl->setProgress (0.75); - } - - /* curve1.reset();curve2.reset(); - curve.reset(); - satcurve.reset(); - lhskcurve.reset(); - - rCurve.reset(); - gCurve.reset(); - bCurve.reset(); - hist16.reset(); - hist16C.reset(); - */ - return readyImg; +IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* pl, bool tunnelMetaData, bool flush) +{ + ImageProcessor proc (pjob, errorCode, pl, tunnelMetaData, flush); + return proc(); } void batchProcessingThread (ProcessingJob* job, BatchProcessingListener* bpl, bool tunnelMetaData) diff --git a/rtexif/kodakattribs.cc b/rtexif/kodakattribs.cc index c92be3a84..f2d6e84dd 100644 --- a/rtexif/kodakattribs.cc +++ b/rtexif/kodakattribs.cc @@ -20,7 +20,6 @@ void parseKodakIfdTextualInfo(Tag *textualInfo, Tag* exif_) TagDirectory *exif = exif_->getDirectory(); char *value = (char *)textualInfo->getValue(); - int valuesize = textualInfo->getValueSize(); char *p = value; char *pc, *plf; diff --git a/rtexif/sonyminoltaattribs.cc b/rtexif/sonyminoltaattribs.cc index a559969bf..d838934fc 100644 --- a/rtexif/sonyminoltaattribs.cc +++ b/rtexif/sonyminoltaattribs.cc @@ -1023,6 +1023,7 @@ public: {65535, "Sony FE PZ 28-135mm f/4 G OSS"}, {65535, "Sony FE 24-70mm f/2.8 GM"}, {65535, "Sony FE 85mm f/1.4 GM"}, + {65535, "Sony FE 85mm f/1.8"}, {65535, "Sony FE 50mm f/1.8"}, {65535, "Sony FE 21mm f/2.8 (SEL28F20 + SEL075UWC)"}, {65535, "Sony FE 16mm f/3.5 Fisheye (SEL28F20 + SEL057FEC)"}, @@ -1112,6 +1113,7 @@ public: choices.insert(p_t(32793, "Sony E PZ 16-50mm f/3.5-5.6 OSS")); choices.insert(p_t(32794, "Sony FE 35mm f/2.8 ZA")); choices.insert(p_t(32795, "Sony FE 24-70mm f/4 ZA OSS")); + choices.insert(p_t(32796, "Sony FE 85mm f/1.8")); choices.insert(p_t(32797, "Sony E 18-200mm f/3.5-6.3 OSS LE")); choices.insert(p_t(32798, "Sony E 20mm f/2.8")); choices.insert(p_t(32799, "Sony E 35mm f/1.8 OSS")); diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index 7bd53c444..fae7bdf6b 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -34,6 +34,7 @@ #include "guiutils.h" #include "rtimage.h" #include + using namespace std; using namespace rtengine; @@ -227,7 +228,7 @@ bool BatchQueue::saveBatchQueue () // The column's header is mandatory (the first line will be skipped when loaded) file << "input image full path|param file full path|output image full path|file format|jpeg quality|jpeg subsampling|" - << "png bit depth|png compression|tiff bit depth|uncompressed tiff|save output params|force format options|" + << "png bit depth|png compression|tiff bit depth|uncompressed tiff|save output params|force format options|fast export|" << std::endl; // method is already running with entryLock, so no need to lock again @@ -242,6 +243,7 @@ bool BatchQueue::saveBatchQueue () << saveFormat.pngBits << '|' << saveFormat.pngCompression << '|' << saveFormat.tiffBits << '|' << saveFormat.tiffUncompressed << '|' << saveFormat.saveParams << '|' << entry->forceFormatOpts << '|' + << entry->job->fastPipeline() << '|' << std::endl; } } @@ -308,6 +310,7 @@ bool BatchQueue::loadBatchQueue () const auto tiffUncompressed = nextIntOr (options.saveFormat.tiffUncompressed); const auto saveParams = nextIntOr (options.saveFormat.saveParams); const auto forceFormatOpts = nextIntOr (options.forceFormatOpts); + const auto fast = nextIntOr(false); rtengine::procparams::ProcParams pparams; @@ -319,7 +322,7 @@ bool BatchQueue::loadBatchQueue () if (!thumb) continue; - auto job = rtengine::ProcessingJob::create (source, thumb->getType () == FT_Raw, pparams); + auto job = rtengine::ProcessingJob::create (source, thumb->getType () == FT_Raw, pparams, fast); auto prevh = getMaxThumbnailHeight (); auto prevw = prevh; @@ -778,7 +781,7 @@ Glib::ustring BatchQueue::calcAutoFileNameBase (const Glib::ustring& origFileNam if (options.savePathTemplate[ix] == 'p') { ix++; - int i = options.savePathTemplate[ix] - '0'; + unsigned int i = options.savePathTemplate[ix] - '0'; if (i < pa.size()) { path = path + pa[pa.size() - i - 1] + '/'; @@ -787,7 +790,7 @@ Glib::ustring BatchQueue::calcAutoFileNameBase (const Glib::ustring& origFileNam ix++; } else if (options.savePathTemplate[ix] == 'd') { ix++; - int i = options.savePathTemplate[ix] - '0'; + unsigned i = options.savePathTemplate[ix] - '0'; if (i < da.size()) { path = path + da[da.size() - i - 1]; diff --git a/rtgui/batchqueueentry.cc b/rtgui/batchqueueentry.cc index 09397f2a3..8386a8ee6 100644 --- a/rtgui/batchqueueentry.cc +++ b/rtgui/batchqueueentry.cc @@ -32,7 +32,7 @@ Glib::RefPtr BatchQueueEntry::savedAsIcon; BatchQueueEntry::BatchQueueEntry (rtengine::ProcessingJob* pjob, const rtengine::procparams::ProcParams& pparams, Glib::ustring fname, int prevw, int prevh, Thumbnail* thm) : ThumbBrowserEntryBase(fname), opreview(nullptr), origpw(prevw), origph(prevh), opreviewDone(false), - job(pjob), progress(0), outFileName(""), sequence(0), forceFormatOpts(false), params(pparams) + job(pjob), params(pparams), progress(0), outFileName(""), sequence(0), forceFormatOpts(false) { thumbnail = thm; diff --git a/rtgui/bayerprocess.cc b/rtgui/bayerprocess.cc index ba7cfa8e8..bc2809971 100644 --- a/rtgui/bayerprocess.cc +++ b/rtgui/bayerprocess.cc @@ -357,11 +357,11 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params dcbIterations->setValue (pp->raw.bayersensor.dcb_iterations); dcbEnhance->setValue (pp->raw.bayersensor.dcb_enhance); - pixelShiftShowMotion->setValue (pp->raw.bayersensor.pixelshiftShowMotion); + pixelShiftShowMotion->setValue (pp->raw.bayersensor.pixelShiftShowMotion); if (!batchMode) { - pixelShiftShowMotionMaskOnly->set_sensitive (pp->raw.bayersensor.pixelshiftShowMotion); + pixelShiftShowMotionMaskOnly->set_sensitive (pp->raw.bayersensor.pixelShiftShowMotion); } - pixelShiftShowMotionMaskOnly->setValue (pp->raw.bayersensor.pixelshiftShowMotionMaskOnly); + pixelShiftShowMotionMaskOnly->setValue (pp->raw.bayersensor.pixelShiftShowMotionMaskOnly); pixelShiftHoleFill->setValue (pp->raw.bayersensor.pixelShiftHoleFill); pixelShiftMedian->setValue (pp->raw.bayersensor.pixelShiftMedian); pixelShiftGreen->setValue (pp->raw.bayersensor.pixelShiftGreen); @@ -412,8 +412,8 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params ccSteps->setEditedState (pedited->raw.bayersensor.ccSteps ? Edited : UnEdited); dcbIterations->setEditedState ( pedited->raw.bayersensor.dcbIterations ? Edited : UnEdited); dcbEnhance->setEdited (pedited->raw.bayersensor.dcbEnhance); - pixelShiftShowMotion->setEdited (pedited->raw.bayersensor.pixelshiftShowMotion); - pixelShiftShowMotionMaskOnly->setEdited (pedited->raw.bayersensor.pixelshiftShowMotionMaskOnly); + pixelShiftShowMotion->setEdited (pedited->raw.bayersensor.pixelShiftShowMotion); + pixelShiftShowMotionMaskOnly->setEdited (pedited->raw.bayersensor.pixelShiftShowMotionMaskOnly); pixelShiftHoleFill->setEdited (pedited->raw.bayersensor.pixelShiftHoleFill); pixelShiftMedian->setEdited(pedited->raw.bayersensor.pixelShiftMedian); pixelShiftGreen->setEdited (pedited->raw.bayersensor.pixelShiftGreen); @@ -515,8 +515,8 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe pp->raw.bayersensor.pixelShiftMotionCorrectionMethod = (RAWParams::BayerSensor::ePSMotionCorrectionMethod)pixelShiftMotionMethod->get_active_row_number(); pp->raw.bayersensor.pixelShiftEperIso = pixelShiftEperIso->getValue(); pp->raw.bayersensor.pixelShiftSigma = pixelShiftSigma->getValue(); - pp->raw.bayersensor.pixelshiftShowMotion = pixelShiftShowMotion->getLastActive (); - pp->raw.bayersensor.pixelshiftShowMotionMaskOnly = pixelShiftShowMotionMaskOnly->getLastActive (); + pp->raw.bayersensor.pixelShiftShowMotion = pixelShiftShowMotion->getLastActive (); + pp->raw.bayersensor.pixelShiftShowMotionMaskOnly = pixelShiftShowMotionMaskOnly->getLastActive (); pp->raw.bayersensor.pixelShiftHoleFill = pixelShiftHoleFill->getLastActive (); pp->raw.bayersensor.pixelShiftMedian = pixelShiftMedian->getLastActive (); pp->raw.bayersensor.pixelShiftGreen = pixelShiftGreen->getLastActive (); @@ -566,8 +566,8 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe pedited->raw.bayersensor.pixelShiftMotionCorrectionMethod = pixelShiftMotionMethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->raw.bayersensor.pixelShiftEperIso = pixelShiftEperIso->getEditedState (); pedited->raw.bayersensor.pixelShiftSigma = pixelShiftSigma->getEditedState (); - pedited->raw.bayersensor.pixelshiftShowMotion = !pixelShiftShowMotion->get_inconsistent(); - pedited->raw.bayersensor.pixelshiftShowMotionMaskOnly = !pixelShiftShowMotionMaskOnly->get_inconsistent(); + pedited->raw.bayersensor.pixelShiftShowMotion = !pixelShiftShowMotion->get_inconsistent(); + pedited->raw.bayersensor.pixelShiftShowMotionMaskOnly = !pixelShiftShowMotionMaskOnly->get_inconsistent(); pedited->raw.bayersensor.pixelShiftHoleFill = !pixelShiftHoleFill->get_inconsistent(); pedited->raw.bayersensor.pixelShiftMedian = !pixelShiftMedian->get_inconsistent(); pedited->raw.bayersensor.pixelShiftGreen = !pixelShiftGreen->get_inconsistent(); diff --git a/rtgui/browserfilter.cc b/rtgui/browserfilter.cc index 3d43400ba..ab4c843a4 100644 --- a/rtgui/browserfilter.cc +++ b/rtgui/browserfilter.cc @@ -18,11 +18,12 @@ */ #include "browserfilter.h" -BrowserFilter::BrowserFilter () : exifFilterEnabled (false), +BrowserFilter::BrowserFilter () : showTrash (true), showNotTrash (true), showOriginal (false), - multiselect (false) + multiselect (false), + exifFilterEnabled (false) { for (int i = 0; i < 6; i++) { showRanked[i] = true; diff --git a/rtgui/checkbox.cc b/rtgui/checkbox.cc index 716802f0f..1e3c2b61e 100644 --- a/rtgui/checkbox.cc +++ b/rtgui/checkbox.cc @@ -27,7 +27,6 @@ CheckBox::CheckBox (Glib::ustring label, bool const& multiImageVal) : Gtk::CheckButton (label) , listener (nullptr) , lastActive (false) - , inBatchMode (false) , multiImage (multiImageVal) { conn = signal_toggled().connect( sigc::mem_fun(*this, &CheckBox::buttonToggled) ); @@ -36,7 +35,7 @@ CheckBox::CheckBox (Glib::ustring label, bool const& multiImageVal) void CheckBox::buttonToggled () { - CheckValue newValue; + CheckValue newValue = CheckValue::unchanged; if (multiImage) { if (get_inconsistent()) { diff --git a/rtgui/checkbox.h b/rtgui/checkbox.h index 8745de6d3..5b3088704 100644 --- a/rtgui/checkbox.h +++ b/rtgui/checkbox.h @@ -48,7 +48,6 @@ class CheckBox : public Gtk::CheckButton // Should ideally be private, but in t CheckBoxListener *listener; bool lastActive; - bool inBatchMode; bool const& multiImage; sigc::connection conn; void buttonToggled (); diff --git a/rtgui/clipboard.cc b/rtgui/clipboard.cc index a1b94a615..dfd78cdd1 100644 --- a/rtgui/clipboard.cc +++ b/rtgui/clipboard.cc @@ -20,7 +20,7 @@ Clipboard clipboard; -Clipboard::Clipboard () : partProfile (false), _hasIPTC(false), hasDiagonalCurveDataType(DCT_Empty), hasFlatCurveDataType(FCT_Empty) {} +Clipboard::Clipboard () : _hasIPTC(false), partProfile (false), hasDiagonalCurveDataType(DCT_Empty), hasFlatCurveDataType(FCT_Empty) {} Clipboard::~Clipboard () { diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index a198dd1f5..cdcfb10f2 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -1055,7 +1055,7 @@ bool ColorAppearance::adapCamComputed_ () void ColorAppearance::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller) { - float R, G, B; + float R = 0.f, G = 0.f, B = 0.f; if (elemType == ColorCaller::CCET_VERTICAL_BAR) { valY = 0.5; diff --git a/rtgui/colortoning.cc b/rtgui/colortoning.cc index d471ef787..786030a73 100644 --- a/rtgui/colortoning.cc +++ b/rtgui/colortoning.cc @@ -952,7 +952,7 @@ void ColorToning::autoOpenCurve () void ColorToning::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller) { - float R, G, B; + float R = 0.f, G = 0.f, B = 0.f; if (callerId == 1) { // ch - main curve Color::hsv2rgb01(float(valY), 1.0f, 0.5f, R, G, B); diff --git a/rtgui/colortoning.h b/rtgui/colortoning.h index 7f1290bf6..347cfd126 100644 --- a/rtgui/colortoning.h +++ b/rtgui/colortoning.h @@ -50,7 +50,7 @@ public: void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller); private: - Gtk::HSeparator* satLimiterSep; + //Gtk::HSeparator* satLimiterSep; Gtk::HSeparator* colorSep; CurveEditorGroup* colorCurveEditorG; CurveEditorGroup* opacityCurveEditorG; @@ -83,20 +83,16 @@ private: Adjuster* satProtectionThreshold; Adjuster* saturatedOpacity; Adjuster* strength; - Gtk::Image* itot; Gtk::Image* iby; Gtk::Image* irg; Gtk::Button* neutral; Gtk::HBox* neutrHBox; - Gtk::HBox* chromaHbox; - Gtk::Label* chroLabel; int nextbw; int nextsatth; int nextsatpr; Glib::ustring nextbalcolor; Glib::ustring balcolor; - bool lasttwocolor; sigc::connection neutralconn, twocconn; //, neutralcurvesconn; bool lastautosat; sigc::connection autosatConn; diff --git a/rtgui/crophandler.cc b/rtgui/crophandler.cc index 8ff95b01b..6d6e9c42f 100644 --- a/rtgui/crophandler.cc +++ b/rtgui/crophandler.cc @@ -30,7 +30,7 @@ using namespace rtengine; CropHandler::CropHandler () - : zoom(100), ww(0), wh(0), imx(-1), imy(-1), imw(0), imh(0), cax(-1), cay(-1), + : zoom(100), ww(0), wh(0), cax(-1), cay(-1), cx(0), cy(0), cw(0), ch(0), cropX(0), cropY(0), cropW(0), cropH(0), enabled(false), cropimg(nullptr), cropimgtrue(nullptr), cropimg_width(0), cropimg_height(0), cix(0), ciy(0), ciw(0), cih(0), cis(1), diff --git a/rtgui/crophandler.h b/rtgui/crophandler.h index 0492aea2a..1e7a9202b 100644 --- a/rtgui/crophandler.h +++ b/rtgui/crophandler.h @@ -108,7 +108,6 @@ private: int zoom; // scale factor (e.g. 5 if 1:5 scale) ; if 1:1 scale and bigger, factor is multiplied by 1000 (i.e. 1000 for 1:1 scale, 2000 for 2:1, etc...) int ww, wh; // size of the crop's canvas on the screen ; might be bigger than the displayed image, but not smaller - int imx, imy, imw, imh; // this is a copy of the cropwindow's parameters int cax, cay; // clamped crop anchor's coordinate, i.e. point of the image that coincide to the center of the display area, expressed in image coordinates; cannot be outside the image's bounds; but if cax==cay==-1, designate the center of the image int cx, cy, cw, ch; // position and size of the requested crop ; position expressed in image coordinates, so cx and cy might be negative and cw and ch higher than the image's 1:1 size int cropX, cropY, cropW, cropH; // cropPixbuf's displayed area (position and size), i.e. coordinates in 1:1 scale, i.e. cx, cy, cw & ch trimmed to the image's bounds diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index 6d0391232..4af132cea 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -36,7 +36,7 @@ using namespace rtengine; CropWindow::CropWindow (ImageArea* parent, bool isLowUpdatePriority_, bool isDetailWindow) : ObjectMOBuffer(parent), state(SNormal), press_x(0), press_y(0), action_x(0), action_y(0), pickedObject(-1), pickModifierKey(0), rot_deg(0), onResizeArea(false), deleted(false), - fitZoomEnabled(true), fitZoom(false), isLowUpdatePriority(isLowUpdatePriority_), hoveredPicker(nullptr), cropLabel(Glib::ustring("100%")), + fitZoomEnabled(true), fitZoom(false), /*isLowUpdatePriority(isLowUpdatePriority_),*/ hoveredPicker(nullptr), cropLabel(Glib::ustring("100%")), backColor(options.bgcolor), decorated(true), isFlawnOver(false), titleHeight(30), sideBorderWidth(3), lowerBorderWidth(3), upperBorderWidth(1), sepWidth(2), xpos(30), ypos(30), width(0), height(0), imgAreaX(0), imgAreaY(0), imgAreaW(0), imgAreaH(0), imgX(-1), imgY(-1), imgW(1), imgH(1), iarea(parent), cropZoom(0), zoomVersion(0), exposeVersion(0), cropgl(nullptr), @@ -1627,7 +1627,7 @@ void CropWindow::expose (Cairo::RefPtr cr) int delta = 0; // for efficiency, pre-calculate currWS_L as it may be needed in both // if (showch) and if (showcs) branches - int currWS_L; + int currWS_L = 0; if (showL && (showch || showcs)) { currWS_L = (int)(0.299f * currWS[0] + 0.587f * currWS[1] + 0.114f * currWS[2]); diff --git a/rtgui/cropwindow.h b/rtgui/cropwindow.h index 66b6405c5..3f80a75c4 100644 --- a/rtgui/cropwindow.h +++ b/rtgui/cropwindow.h @@ -58,7 +58,7 @@ class CropWindow : public LWButtonListener, public CropDisplayHandler, public Ed bool deleted; bool fitZoomEnabled; bool fitZoom; - bool isLowUpdatePriority; + //bool isLowUpdatePriority; CursorShape cursor_type; // color pickers diff --git a/rtgui/defringe.cc b/rtgui/defringe.cc index 0ba3dec9f..5f70925e7 100644 --- a/rtgui/defringe.cc +++ b/rtgui/defringe.cc @@ -68,7 +68,7 @@ Defringe::~Defringe () void Defringe::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller) { - float R, G, B; + float R = 0.f, G = 0.f, B = 0.f; if (elemType == ColorCaller::CCET_VERTICAL_BAR) { valY = 0.5; diff --git a/rtgui/diagonalcurveeditorsubgroup.cc b/rtgui/diagonalcurveeditorsubgroup.cc index 8f81333d7..d12cdf023 100644 --- a/rtgui/diagonalcurveeditorsubgroup.cc +++ b/rtgui/diagonalcurveeditorsubgroup.cc @@ -40,7 +40,6 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, Gtk::PositionType sideStart = options.curvebboxpos == 0 || options.curvebboxpos == 2 ? Gtk::POS_LEFT : Gtk::POS_TOP; Gtk::PositionType sideEnd = options.curvebboxpos == 0 || options.curvebboxpos == 2 ? Gtk::POS_RIGHT : Gtk::POS_BOTTOM; - bool vExpand = options.curvebboxpos == 0 || options.curvebboxpos == 2; valLinear = (int)DCT_Linear; valUnchanged = (int)DCT_Unchanged; diff --git a/rtgui/dirbrowser.cc b/rtgui/dirbrowser.cc index 7b5adade2..572e779a6 100644 --- a/rtgui/dirbrowser.cc +++ b/rtgui/dirbrowser.cc @@ -21,7 +21,8 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32_WINNT +#undef _WIN32_WINNT #define _WIN32_WINNT 0x0600 #include #endif @@ -348,7 +349,7 @@ void DirBrowser::updateDir (const Gtk::TreeModel::iterator& iter) auto dir = Gio::File::create_for_path (iter->get_value (dtColumns.dirname)); auto subDirs = listSubDirs (dir, options.fbShowHidden); - for (int i = 0; i < subDirs.size(); i++) { + for (size_t i = 0; i < subDirs.size(); i++) { bool found = false; for (Gtk::TreeModel::iterator it = iter->children().begin(); it != iter->children().end() && !found ; ++it) { diff --git a/rtgui/dirpyrdenoise.cc b/rtgui/dirpyrdenoise.cc index bd673e5c3..61b9bf55a 100644 --- a/rtgui/dirpyrdenoise.cc +++ b/rtgui/dirpyrdenoise.cc @@ -26,7 +26,7 @@ using namespace rtengine; using namespace rtengine::procparams; extern Options options; -DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP_DIRPYRDENOISE_LABEL"), true, true), lastenhance(false) +DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP_DIRPYRDENOISE_LABEL"), true, true), lastenhance(false), lastmedian(false), lastautochroma(false) { std::vector milestones; CurveListener::setMulti(true); @@ -1247,7 +1247,7 @@ void DirPyrDenoise::setAdjusterBehavior (bool lumaadd, bool lumdetadd, bool chro void DirPyrDenoise::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller) { - float R, G, B; + float R = 0.f, G = 0.f, B = 0.f; if (elemType == ColorCaller::CCET_VERTICAL_BAR) { valY = 0.5; diff --git a/rtgui/dynamicprofilepanel.cc b/rtgui/dynamicprofilepanel.cc index e5f9ae1cc..172c06f47 100644 --- a/rtgui/dynamicprofilepanel.cc +++ b/rtgui/dynamicprofilepanel.cc @@ -505,7 +505,6 @@ void DynamicProfilePanel::on_button_edit() } EditDialog d(M("DYNPROFILEEDITOR_EDIT_RULE"), static_cast(*get_toplevel())); - auto it = s->get_selected(); Gtk::TreeModel::Row row = *(s->get_selected()); d.set_rule(to_rule(row)); int status = d.run(); diff --git a/rtgui/edit.cc b/rtgui/edit.cc index 2cc84cb36..b2a735597 100644 --- a/rtgui/edit.cc +++ b/rtgui/edit.cc @@ -312,7 +312,7 @@ void Arcellipse::drawOuterGeometry (Cairo::RefPtr &cr, ObjectMOB rtengine::Coord center_ = center; double radius_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius)) : double (radius); - double radius2_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius2)) : double (radius2); +// double radius2_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius2)) : double (radius2); double scalx_ = scalx; //radius2_ / radius_; double scaly_ = scaly; @@ -363,7 +363,7 @@ void Arcellipse::drawInnerGeometry (Cairo::RefPtr &cr, ObjectMOB rtengine::Coord center_ = center; double radius_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius)) : double (radius); - double radius2_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius2)) : double (radius2); +// double radius2_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius2)) : double (radius2); double scalx_ = scalx; //radius2_ / radius_; @@ -437,7 +437,7 @@ void Arcellipse::drawToMOChannel (Cairo::RefPtr &cr, unsigned sh cr->set_line_width ( getMouseOverLineWidth() ); rtengine::Coord center_ = center; double radius_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius)) : double (radius); - double radius2_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius2)) : double (radius2); +// double radius2_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius2)) : double (radius2); double scalx_ = scalx ; //radius2_ / radius_; double scaly_ = scaly; @@ -1165,23 +1165,23 @@ OPIcon::OPIcon (Glib::ustring normalImage, Glib::ustring activeImage, Glib::ustr Glib::ustring draggedImage, Glib::ustring insensitiveImage, DrivenPoint drivenPoint) : drivenPoint (drivenPoint) { if (!normalImage.empty()) { - normalImg = Cairo::ImageSurface::create_from_png( rtengine::findIconAbsolutePath(normalImage) ); + normalImg = Cairo::ImageSurface::create_from_png ( rtengine::findIconAbsolutePath (normalImage) ); } if (!prelightImage.empty()) { - prelightImg = Cairo::ImageSurface::create_from_png( rtengine::findIconAbsolutePath(prelightImage) ); + prelightImg = Cairo::ImageSurface::create_from_png ( rtengine::findIconAbsolutePath (prelightImage) ); } if (!activeImage.empty()) { - activeImg = Cairo::ImageSurface::create_from_png( rtengine::findIconAbsolutePath(activeImage) ); + activeImg = Cairo::ImageSurface::create_from_png ( rtengine::findIconAbsolutePath (activeImage) ); } if (!draggedImage.empty()) { - draggedImg = Cairo::ImageSurface::create_from_png( rtengine::findIconAbsolutePath(draggedImage) ); + draggedImg = Cairo::ImageSurface::create_from_png ( rtengine::findIconAbsolutePath (draggedImage) ); } if (!insensitiveImage.empty()) { - insensitiveImg = Cairo::ImageSurface::create_from_png( rtengine::findIconAbsolutePath(insensitiveImage) ); + insensitiveImg = Cairo::ImageSurface::create_from_png ( rtengine::findIconAbsolutePath (insensitiveImage) ); } } diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 7bc1631d3..5160f695f 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -374,7 +374,7 @@ public: }; EditorPanel::EditorPanel (FilePanel* filePanel) - : realized(false), iHistoryShow(nullptr), iHistoryHide(nullptr), iTopPanel_1_Show(nullptr), iTopPanel_1_Hide(nullptr), iRightPanel_1_Show(nullptr), iRightPanel_1_Hide(nullptr), iBeforeLockON(nullptr), iBeforeLockOFF(nullptr), beforePreviewHandler(nullptr), beforeIarea(nullptr), beforeBox(nullptr), afterBox(nullptr), afterHeaderBox(nullptr), parent(nullptr), openThm(nullptr), ipc(nullptr), beforeIpc(nullptr), isProcessing(false), catalogPane(nullptr) + : catalogPane(nullptr), realized(false), iHistoryShow(nullptr), iHistoryHide(nullptr), iTopPanel_1_Show(nullptr), iTopPanel_1_Hide(nullptr), iRightPanel_1_Show(nullptr), iRightPanel_1_Hide(nullptr), iBeforeLockON(nullptr), iBeforeLockOFF(nullptr), beforePreviewHandler(nullptr), beforeIarea(nullptr), beforeBox(nullptr), afterBox(nullptr), afterHeaderBox(nullptr), parent(nullptr), openThm(nullptr), ipc(nullptr), beforeIpc(nullptr), isProcessing(false) { epih = new EditorPanelIdleHelper; diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 609df5236..4434a660e 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -193,7 +193,6 @@ private: ToolPanelCoordinator* tpc; RTWindow* parent; //SaveAsDialog* saveAsDialog; - BatchToolPanelCoordinator* btpCoordinator; FilePanel* fPanel; bool firstProcessingDone; diff --git a/rtgui/epd.cc b/rtgui/epd.cc index 15f15f607..d7848aee0 100644 --- a/rtgui/epd.cc +++ b/rtgui/epd.cc @@ -30,8 +30,8 @@ EdgePreservingDecompositionUI::EdgePreservingDecompositionUI () : FoldableToolPa strength = Gtk::manage(new Adjuster (M("TP_EPD_STRENGTH"), -1.0, 2.0, 0.01, 0.5)); gamma = Gtk::manage(new Adjuster (M("TP_EPD_GAMMA"), 0.8, 1.5, 0.01, 1.)); - edgeStopping = Gtk::manage(new Adjuster (M("TP_EPD_EDGESTOPPING"), 0.1, 4.0, 0.01, 1.4)); - scale = Gtk::manage(new Adjuster (M("TP_EPD_SCALE"), 0.1, 10.0, 0.01, 0.3)); + edgeStopping = Gtk::manage(new Adjuster (M("TP_EPD_EDGESTOPPING"), 0.1, 4.0, 0.01, 0.5)); + scale = Gtk::manage(new Adjuster (M("TP_EPD_SCALE"), 0.1, 10.0, 0.01, 0.1)); reweightingIterates = Gtk::manage(new Adjuster (M("TP_EPD_REWEIGHTINGITERATES"), 0, 9, 1, 0)); strength->setAdjusterListener(this); diff --git a/rtgui/exiffiltersettings.h b/rtgui/exiffiltersettings.h index f462ddc30..d692eb510 100644 --- a/rtgui/exiffiltersettings.h +++ b/rtgui/exiffiltersettings.h @@ -36,8 +36,8 @@ public: double shutterTo; double focalFrom; double focalTo; - int isoFrom; - int isoTo; + unsigned isoFrom; + unsigned isoTo; bool filterFNumber; bool filterShutter; diff --git a/rtgui/exifpanel.h b/rtgui/exifpanel.h index fd797ff56..6244c1a4f 100644 --- a/rtgui/exifpanel.h +++ b/rtgui/exifpanel.h @@ -27,8 +27,6 @@ class ExifPanel : public Gtk::VBox, public ToolPanel private: const rtengine::ImageMetaData* idata; - int fullw, fullh, cx, cy, cw, ch; - bool crenabled; rtengine::procparams::ExifPairs changeList; rtengine::procparams::ExifPairs defChangeList; bool recursiveOp; diff --git a/rtgui/exportpanel.cc b/rtgui/exportpanel.cc index 3f7be7ab4..72cf30fdd 100644 --- a/rtgui/exportpanel.cc +++ b/rtgui/exportpanel.cc @@ -38,7 +38,12 @@ ExportPanel::ExportPanel () : listener (nullptr) labExportTitle->set_alignment(Gtk::ALIGN_START); pack_start(*labExportTitle, Gtk::PACK_SHRINK, 4); + Gtk::RadioButton::Group pipeline_group; + use_fast_pipeline = Gtk::manage ( new Gtk::RadioButton (pipeline_group, M("EXPORT_USE_FAST_PIPELINE"))); + use_normal_pipeline = Gtk::manage ( new Gtk::RadioButton (pipeline_group, M("EXPORT_USE_NORMAL_PIPELINE"))); + bypass_box = Gtk::manage(new Gtk::VBox()); bypass_ALL = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_ALL"))); + use_fast_pipeline->set_tooltip_text(M("EXPORT_USE_FAST_PIPELINE_TIP")); bypass_sharpening = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_SHARPENING"))); bypass_sharpenEdge = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_SHARPENEDGE"))); bypass_sharpenMicro = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_SHARPENMICRO"))); @@ -96,18 +101,28 @@ ExportPanel::ExportPanel () : listener (nullptr) // ---------------------------------------------------------------- // start global packing - pack_start(*bypass_ALL , Gtk::PACK_SHRINK, 4); - pack_start(*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 4); - pack_start(*bypass_sharpening , Gtk::PACK_SHRINK, 4); - pack_start(*bypass_sharpenEdge , Gtk::PACK_SHRINK, 4); - pack_start(*bypass_sharpenMicro , Gtk::PACK_SHRINK, 4); + Gtk::HBox* lblbox = Gtk::manage (new Gtk::HBox ()); + lblbox->pack_start (*Gtk::manage (new Gtk::Label (M("EXPORT_PIPELINE"))), Gtk::PACK_SHRINK, 4); + pack_start (*lblbox, Gtk::PACK_SHRINK, 4); + pack_start(*use_fast_pipeline , Gtk::PACK_SHRINK, 4); + pack_start(*use_normal_pipeline , Gtk::PACK_SHRINK, 4); + + bypass_box->pack_start(*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 4); + lblbox = Gtk::manage (new Gtk::HBox ()); + lblbox->pack_start (*Gtk::manage (new Gtk::Label (M("EXPORT_BYPASS"))), Gtk::PACK_SHRINK, 4); + bypass_box->pack_start (*lblbox, Gtk::PACK_SHRINK, 4); + bypass_box->pack_start(*bypass_ALL , Gtk::PACK_SHRINK, 4); + // bypass_box->pack_start(*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 4); + bypass_box->pack_start(*bypass_sharpening , Gtk::PACK_SHRINK, 4); + bypass_box->pack_start(*bypass_sharpenEdge , Gtk::PACK_SHRINK, 4); + bypass_box->pack_start(*bypass_sharpenMicro , Gtk::PACK_SHRINK, 4); //pack_start(*bypass_lumaDenoise , Gtk::PACK_SHRINK, 4); //pack_start(*bypass_colorDenoise , Gtk::PACK_SHRINK, 4); - pack_start(*bypass_defringe , Gtk::PACK_SHRINK, 4); - pack_start(*bypass_dirpyrDenoise, Gtk::PACK_SHRINK, 4); - pack_start(*bypass_sh_hq , Gtk::PACK_SHRINK, 4); - pack_start(*bypass_dirpyrequalizer , Gtk::PACK_SHRINK, 4); - pack_start(*bypass_wavelet , Gtk::PACK_SHRINK, 4); + bypass_box->pack_start(*bypass_defringe , Gtk::PACK_SHRINK, 4); + bypass_box->pack_start(*bypass_dirpyrDenoise, Gtk::PACK_SHRINK, 4); + bypass_box->pack_start(*bypass_sh_hq , Gtk::PACK_SHRINK, 4); + bypass_box->pack_start(*bypass_dirpyrequalizer , Gtk::PACK_SHRINK, 4); + bypass_box->pack_start(*bypass_wavelet , Gtk::PACK_SHRINK, 4); bayerFrameVBox->pack_start(*hb_raw_bayer_method, Gtk::PACK_SHRINK, 4); //bayerFrameVBox->pack_start(*bypass_raw_all_enhance , Gtk::PACK_SHRINK, 4); @@ -121,12 +136,14 @@ ExportPanel::ExportPanel () : listener (nullptr) xtransFrameVBox->pack_start(*hb_raw_xtrans_method, Gtk::PACK_SHRINK, 4); xtransFrame->add(*xtransFrameVBox); - pack_start(*bypass_raw_ccSteps , Gtk::PACK_SHRINK, 4); - pack_start(*bypass_raw_ca , Gtk::PACK_SHRINK, 4); + bypass_box->pack_start(*bypass_raw_ccSteps , Gtk::PACK_SHRINK, 4); + bypass_box->pack_start(*bypass_raw_ca , Gtk::PACK_SHRINK, 4); - pack_start(*bypass_raw_df , Gtk::PACK_SHRINK, 4); - pack_start(*bypass_raw_ff , Gtk::PACK_SHRINK, 4); + bypass_box->pack_start(*bypass_raw_df , Gtk::PACK_SHRINK, 4); + bypass_box->pack_start(*bypass_raw_ff , Gtk::PACK_SHRINK, 4); + pack_start(*bypass_box, Gtk::PACK_SHRINK); + pack_start (*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 2); // Resize options @@ -176,6 +193,7 @@ ExportPanel::ExportPanel () : listener (nullptr) pack_start(*vboxpe, Gtk::PACK_SHRINK, 0); + use_fast_pipeline->signal_toggled().connect(sigc::mem_fun(*this, &ExportPanel::use_fast_pipeline_toggled)); btnFastExport->signal_clicked().connect( sigc::mem_fun(*this, &ExportPanel::FastExportPressed) ); //btnExportLoadSettings->signal_clicked().connect( sigc::mem_fun(*this, &ExportPanel::LoadSettings) ); //btnExportSaveSettings->signal_clicked().connect( sigc::mem_fun(*this, &ExportPanel::SaveSettings) ); @@ -224,40 +242,48 @@ void ExportPanel::FastExportPressed () void ExportPanel::SaveSettingsAsDefault() { + bool changed = false; +#define FE_OPT_STORE_(n, v) \ + do { \ + if (n != v) { \ + n = v; \ + changed = true; \ + } \ + } while (false) // Save fast export settings to options - options.fastexport_bypass_sharpening = bypass_sharpening->get_active (); - options.fastexport_bypass_sharpenEdge = bypass_sharpenEdge->get_active (); - options.fastexport_bypass_sharpenMicro = bypass_sharpenMicro->get_active (); + FE_OPT_STORE_(options.fastexport_bypass_sharpening, bypass_sharpening->get_active ()); + FE_OPT_STORE_(options.fastexport_bypass_sharpenEdge, bypass_sharpenEdge->get_active ()); + FE_OPT_STORE_(options.fastexport_bypass_sharpenMicro, bypass_sharpenMicro->get_active ()); //options.fastexport_bypass_lumaDenoise = bypass_lumaDenoise->get_active (); //options.fastexport_bypass_colorDenoise = bypass_colorDenoise->get_active (); - options.fastexport_bypass_defringe = bypass_defringe->get_active (); - options.fastexport_bypass_dirpyrDenoise = bypass_dirpyrDenoise->get_active (); - options.fastexport_bypass_sh_hq = bypass_sh_hq->get_active (); - options.fastexport_bypass_dirpyrequalizer = bypass_dirpyrequalizer->get_active (); - options.fastexport_bypass_wavelet = bypass_wavelet->get_active (); + FE_OPT_STORE_(options.fastexport_bypass_defringe, bypass_defringe->get_active ()); + FE_OPT_STORE_(options.fastexport_bypass_dirpyrDenoise, bypass_dirpyrDenoise->get_active ()); + FE_OPT_STORE_(options.fastexport_bypass_sh_hq, bypass_sh_hq->get_active ()); + FE_OPT_STORE_(options.fastexport_bypass_dirpyrequalizer, bypass_dirpyrequalizer->get_active ()); + FE_OPT_STORE_(options.fastexport_bypass_wavelet, bypass_wavelet->get_active ()); //options.fastexport_bypass_raw_bayer_all_enhance = bypass_raw_all_enhance->get_active (); - options.fastexport_bypass_raw_bayer_dcb_iterations = bypass_raw_bayer_dcb_iterations->get_active (); - options.fastexport_bypass_raw_bayer_dcb_enhance = bypass_raw_bayer_dcb_enhance->get_active (); - options.fastexport_bypass_raw_bayer_lmmse_iterations = bypass_raw_bayer_lmmse_iterations->get_active(); - options.fastexport_bypass_raw_bayer_linenoise = bypass_raw_bayer_linenoise->get_active (); - options.fastexport_bypass_raw_bayer_greenthresh = bypass_raw_bayer_greenthresh->get_active (); - options.fastexport_bypass_raw_ccSteps = bypass_raw_ccSteps->get_active (); - options.fastexport_bypass_raw_ca = bypass_raw_ca->get_active (); - options.fastexport_bypass_raw_df = bypass_raw_df->get_active (); - options.fastexport_bypass_raw_ff = bypass_raw_ff->get_active (); + FE_OPT_STORE_(options.fastexport_bypass_raw_bayer_dcb_iterations, bypass_raw_bayer_dcb_iterations->get_active ()); + FE_OPT_STORE_(options.fastexport_bypass_raw_bayer_dcb_enhance, bypass_raw_bayer_dcb_enhance->get_active ()); + FE_OPT_STORE_(options.fastexport_bypass_raw_bayer_lmmse_iterations, bypass_raw_bayer_lmmse_iterations->get_active()); + FE_OPT_STORE_(options.fastexport_bypass_raw_bayer_linenoise, bypass_raw_bayer_linenoise->get_active ()); + FE_OPT_STORE_(options.fastexport_bypass_raw_bayer_greenthresh, bypass_raw_bayer_greenthresh->get_active ()); + FE_OPT_STORE_(options.fastexport_bypass_raw_ccSteps, bypass_raw_ccSteps->get_active ()); + FE_OPT_STORE_(options.fastexport_bypass_raw_ca, bypass_raw_ca->get_active ()); + FE_OPT_STORE_(options.fastexport_bypass_raw_df, bypass_raw_df->get_active ()); + FE_OPT_STORE_(options.fastexport_bypass_raw_ff, bypass_raw_ff->get_active ()); //saving Bayer demosaic_method int currentRow = raw_bayer_method->get_active_row_number(); if( currentRow >= 0 && currentRow < procparams::RAWParams::BayerSensor::numMethods) { - options.fastexport_raw_bayer_method = procparams::RAWParams::BayerSensor::methodstring[currentRow]; + FE_OPT_STORE_(options.fastexport_raw_bayer_method, procparams::RAWParams::BayerSensor::methodstring[currentRow]); } //saving X-Trans demosaic_method currentRow = raw_xtrans_method->get_active_row_number(); if( currentRow >= 0 && currentRow < procparams::RAWParams::XTransSensor::numMethods) { - options.fastexport_raw_xtrans_method = procparams::RAWParams::XTransSensor::methodstring[currentRow]; + FE_OPT_STORE_(options.fastexport_raw_xtrans_method, procparams::RAWParams::XTransSensor::methodstring[currentRow]); } // options.fastexport_icm_input = icm_input ; @@ -269,9 +295,16 @@ void ExportPanel::SaveSettingsAsDefault() // options.fastexport_resize_appliesTo = resize_appliesTo; // options.fastexport_resize_dataspec = resize_dataspec ; - options.fastexport_resize_method = "Lanczos"; - options.fastexport_resize_width = MaxWidth->get_value_as_int (); - options.fastexport_resize_height = MaxHeight->get_value_as_int (); + FE_OPT_STORE_(options.fastexport_resize_method, "Lanczos"); + FE_OPT_STORE_(options.fastexport_resize_width, MaxWidth->get_value_as_int ()); + FE_OPT_STORE_(options.fastexport_resize_height, MaxHeight->get_value_as_int ()); + + FE_OPT_STORE_(options.fastexport_use_fast_pipeline, use_fast_pipeline->get_active()); +#undef FE_OPT_STORE_ + + if (changed) { + Options::save(); + } } void ExportPanel::LoadDefaultSettings() @@ -327,6 +360,13 @@ void ExportPanel::LoadDefaultSettings() MaxWidth->set_value(options.fastexport_resize_width); MaxHeight->set_value(options.fastexport_resize_height); + + if (options.fastexport_use_fast_pipeline) { + use_fast_pipeline->set_active(true); + bypass_box->set_sensitive(false); + } else { + use_normal_pipeline->set_active(true); + } } void ExportPanel::LoadSettings() @@ -408,6 +448,11 @@ void ExportPanel::bypassALL_Toggled() bypass_raw_ffConn.block (false); } +void ExportPanel::use_fast_pipeline_toggled() +{ + bypass_box->set_sensitive(!use_fast_pipeline->get_active()); +} + /* fastexport_bypass_sharpening fastexport_bypass_sharpenEdge diff --git a/rtgui/exportpanel.h b/rtgui/exportpanel.h index 840a4638d..db4431ca5 100644 --- a/rtgui/exportpanel.h +++ b/rtgui/exportpanel.h @@ -36,7 +36,10 @@ class ExportPanel : public Gtk::VBox protected: + Gtk::VBox *bypass_box; //Gtk::CheckButton* enabled; + Gtk::RadioButton* use_fast_pipeline; + Gtk::RadioButton* use_normal_pipeline; Gtk::CheckButton* bypass_ALL; Gtk::CheckButton* bypass_sharpenEdge; Gtk::CheckButton* bypass_sharpenMicro; @@ -105,6 +108,7 @@ protected: ExportPanelListener* listener; void bypassALL_Toggled(); + void use_fast_pipeline_toggled(); void SaveSettingsAsDefault(); void LoadDefaultSettings(); void LoadSettings(); diff --git a/rtgui/extprog.cc b/rtgui/extprog.cc index 30e33b6b9..bdbbb85b4 100644 --- a/rtgui/extprog.cc +++ b/rtgui/extprog.cc @@ -325,9 +325,7 @@ bool ExtProgStore::openInCustomEditor (const Glib::ustring& fileName) const auto cmdLine = Glib::ustring("\"") + options.customEditorProg + Glib::ustring("\""); auto success = ShellExecute( NULL, "open", cmdLine.c_str(), fileName.c_str(), NULL, SW_SHOWNORMAL ); - if ((uintptr_t)success > 32) { - return true; - } + return (uintptr_t)success > 32; #elif defined __APPLE__ diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 5cbb5255b..2979b556f 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -340,7 +340,7 @@ FileBrowser::FileBrowser () p++; submenuProfileOperations->attach (*Gtk::manage(applypartprof = new Gtk::MenuItem (M("FILEBROWSER_APPLYPROFILE_PARTIAL"))), 0, 1, p, p + 1); p++; - submenuProfileOperations->attach (*Gtk::manage(execcustprof = new Gtk::MenuItem (M("FILEBROWSER_EXEC_CPB"))), 0, 1, p, p + 1); + submenuProfileOperations->attach (*Gtk::manage(resetdefaultprof = new Gtk::MenuItem (M("FILEBROWSER_RESETDEFAULTPROFILE"))), 0, 1, p, p + 1); p++; submenuProfileOperations->attach (*Gtk::manage(clearprof = new Gtk::MenuItem (M("FILEBROWSER_CLEARPROFILE"))), 0, 1, p, p + 1); p++; @@ -358,7 +358,7 @@ FileBrowser::FileBrowser () p++; pmenu->attach (*Gtk::manage(applypartprof = new Gtk::MenuItem (M("FILEBROWSER_APPLYPROFILE_PARTIAL"))), 0, 1, p, p + 1); p++; - pmenu->attach (*Gtk::manage(execcustprof = new Gtk::MenuItem (M("FILEBROWSER_EXEC_CPB"))), 0, 1, p, p + 1); + pmenu->attach (*Gtk::manage(resetdefaultprof = new Gtk::MenuItem (M("FILEBROWSER_RESETDEFAULTPROFILE"))), 0, 1, p, p + 1); p++; pmenu->attach (*Gtk::manage(clearprof = new Gtk::MenuItem (M("FILEBROWSER_CLEARPROFILE"))), 0, 1, p, p + 1); p++; @@ -389,6 +389,7 @@ FileBrowser::FileBrowser () untrash->add_accelerator ("activate", pmenu->get_accel_group(), GDK_KEY_Delete, Gdk::SHIFT_MASK, Gtk::ACCEL_VISIBLE); open->add_accelerator ("activate", pmenu->get_accel_group(), GDK_KEY_Return, (Gdk::ModifierType)0, Gtk::ACCEL_VISIBLE); develop->add_accelerator ("activate", pmenu->get_accel_group(), GDK_KEY_B, Gdk::CONTROL_MASK, Gtk::ACCEL_VISIBLE); + developfast->add_accelerator ("activate", pmenu->get_accel_group(), GDK_KEY_B, Gdk::CONTROL_MASK | Gdk::SHIFT_MASK, Gtk::ACCEL_VISIBLE); copyprof->add_accelerator ("activate", pmenu->get_accel_group(), GDK_KEY_C, Gdk::CONTROL_MASK, Gtk::ACCEL_VISIBLE); pasteprof->add_accelerator ("activate", pmenu->get_accel_group(), GDK_KEY_V, Gdk::CONTROL_MASK, Gtk::ACCEL_VISIBLE); partpasteprof->add_accelerator ("activate", pmenu->get_accel_group(), GDK_KEY_V, Gdk::CONTROL_MASK | Gdk::SHIFT_MASK, Gtk::ACCEL_VISIBLE); @@ -404,7 +405,7 @@ FileBrowser::FileBrowser () colorlabel[i]->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), colorlabel[i])); } - for (int i = 0; i < mMenuExtProgs.size(); i++) { + for (size_t i = 0; i < mMenuExtProgs.size(); i++) { amiExtProg[i]->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), amiExtProg[i])); } @@ -427,7 +428,7 @@ FileBrowser::FileBrowser () partpasteprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), partpasteprof)); applyprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), applyprof)); applypartprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), applypartprof)); - execcustprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), execcustprof)); + resetdefaultprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), resetdefaultprof)); clearprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), clearprof)); cachemenu->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), cachemenu)); @@ -729,14 +730,14 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m) return; } - for (int j = 0; j < mMenuExtProgs.size(); j++) { + for (size_t j = 0; j < mMenuExtProgs.size(); j++) { if (m == amiExtProg[j]) { const auto pAct = mMenuExtProgs[m->get_label()]; // Build vector of all file names std::vector selFileNames; - for (int i = 0; i < mselected.size(); i++) { + for (size_t i = 0; i < mselected.size(); i++) { Glib::ustring fn = mselected[i]->thumbnail->getFileName(); // Maybe batch processed version @@ -767,6 +768,12 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m) else if (m == develop) { tbl->developRequested (mselected, false); } else if (m == developfast) { + if (exportPanel) { + // force saving export panel settings + exportPanel->setExportPanelListener(nullptr); + exportPanel->FastExportPressed(); + exportPanel->setExportPanelListener(this); + } tbl->developRequested (mselected, true); } @@ -960,7 +967,7 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m) } queue_draw (); - } else if (m == execcustprof) { + } else if (m == resetdefaultprof) { if (!mselected.empty() && bppcl) { bppcl->beginBatchPParamsChange(mselected.size()); } @@ -1139,9 +1146,12 @@ bool FileBrowser::keyPressed (GdkEventKey* event) } else if (event->keyval == GDK_KEY_Delete && shift) { menuItemActivated (untrash); return true; - } else if ((event->keyval == GDK_KEY_B || event->keyval == GDK_KEY_b) && ctrl) { + } else if ((event->keyval == GDK_KEY_B || event->keyval == GDK_KEY_b) && ctrl && !shift) { menuItemActivated (develop); return true; + } else if ((event->keyval == GDK_KEY_B || event->keyval == GDK_KEY_b) && ctrl && shift) { + menuItemActivated (developfast); + return true; } else if ((event->keyval == GDK_KEY_A || event->keyval == GDK_KEY_a) && ctrl) { menuItemActivated (selall); return true; @@ -1495,11 +1505,11 @@ bool FileBrowser::checkFilter (ThumbBrowserEntryBase* entryb) // true -> entry int iFilenameMatch = 0; std::vector vFilterStrings = Glib::Regex::split_simple(",", decodedQueryFileName.uppercase()); - for(int i = 0; i < vFilterStrings.size(); i++) { + for(size_t i = 0; i < vFilterStrings.size(); i++) { // ignore empty vFilterStrings. Otherwise filter will always return true if // e.g. filter.queryFileName ends on "," and will stop being a filter if (!vFilterStrings.at(i).empty()) { - if (FileName.find(vFilterStrings.at(i)) != -1) { + if (FileName.find(vFilterStrings.at(i)) != Glib::ustring::npos) { iFilenameMatch++; } } diff --git a/rtgui/filebrowser.h b/rtgui/filebrowser.h index fdb08ba24..a7474d989 100644 --- a/rtgui/filebrowser.h +++ b/rtgui/filebrowser.h @@ -110,7 +110,7 @@ protected: Gtk::MenuItem* partpasteprof; Gtk::MenuItem* applyprof; Gtk::MenuItem* applypartprof; - Gtk::MenuItem* execcustprof; + Gtk::MenuItem* resetdefaultprof; Gtk::MenuItem* clearprof; Gtk::MenuItem* cachemenu; Gtk::MenuItem* clearFromCache; diff --git a/rtgui/filebrowserentry.cc b/rtgui/filebrowserentry.cc index d452b88cd..96861544b 100644 --- a/rtgui/filebrowserentry.cc +++ b/rtgui/filebrowserentry.cc @@ -635,6 +635,7 @@ bool FileBrowserEntry::onArea (CursorArea a, int x, int y) y1 < cropParams.y + cropParams.h - 1 && x1 > cropParams.x && x1 < cropParams.x + cropParams.w - 1; + default: /* do nothing */ ; } return false; diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index a876dd54e..3dfb37971 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -748,12 +748,12 @@ void FileCatalog::previewReady (int dir_id, FileBrowserEntry* fdn) dirEFS.shutterTo = cfs->shutter; } - if (cfs->iso > 0 && (int)cfs->iso < dirEFS.isoFrom) { - dirEFS.isoFrom = (int)cfs->iso; + if (cfs->iso > 0 && cfs->iso < dirEFS.isoFrom) { + dirEFS.isoFrom = cfs->iso; } - if (cfs->iso > 0 && (int)cfs->iso > dirEFS.isoTo) { - dirEFS.isoTo = (int)cfs->iso; + if (cfs->iso > 0 && cfs->iso > dirEFS.isoTo) { + dirEFS.isoTo = cfs->iso; } if (cfs->focalLen < dirEFS.focalFrom) { @@ -1095,99 +1095,108 @@ void FileCatalog::developRequested (std::vector tbe, bool fas // and also those which effect is not pronounced after reducing the image size // TODO!!! could expose selections below via preferences if (fastmode) { - if (options.fastexport_bypass_sharpening ) { - params.sharpening.enabled = false; + if (!options.fastexport_use_fast_pipeline) { + if (options.fastexport_bypass_sharpening) { + params.sharpening.enabled = false; + } + + if (options.fastexport_bypass_sharpenEdge) { + params.sharpenEdge.enabled = false; + } + + if (options.fastexport_bypass_sharpenMicro) { + params.sharpenMicro.enabled = false; + } + + //if (options.fastexport_bypass_lumaDenoise) params.lumaDenoise.enabled = false; + //if (options.fastexport_bypass_colorDenoise) params.colorDenoise.enabled = false; + if (options.fastexport_bypass_defringe) { + params.defringe.enabled = false; + } + + if (options.fastexport_bypass_dirpyrDenoise) { + params.dirpyrDenoise.enabled = false; + } + + if (options.fastexport_bypass_sh_hq) { + params.sh.hq = false; + } + + if (options.fastexport_bypass_dirpyrequalizer) { + params.dirpyrequalizer.enabled = false; + } + + if (options.fastexport_bypass_wavelet) { + params.wavelet.enabled = false; + } + + //if (options.fastexport_bypass_raw_bayer_all_enhance) params.raw.bayersensor.all_enhance = false; + if (options.fastexport_bypass_raw_bayer_dcb_iterations) { + params.raw.bayersensor.dcb_iterations = 0; + } + + if (options.fastexport_bypass_raw_bayer_dcb_enhance) { + params.raw.bayersensor.dcb_enhance = false; + } + + if (options.fastexport_bypass_raw_bayer_lmmse_iterations) { + params.raw.bayersensor.lmmse_iterations = 0; + } + + if (options.fastexport_bypass_raw_bayer_linenoise) { + params.raw.bayersensor.linenoise = 0; + } + + if (options.fastexport_bypass_raw_bayer_greenthresh) { + params.raw.bayersensor.greenthresh = 0; + } + + if (options.fastexport_bypass_raw_ccSteps) { + params.raw.bayersensor.ccSteps = params.raw.xtranssensor.ccSteps = 0; + } + + if (options.fastexport_bypass_raw_ca) { + params.raw.ca_autocorrect = false; + params.raw.cared = 0; + params.raw.cablue = 0; + } + + if (options.fastexport_bypass_raw_df) { + params.raw.df_autoselect = false; + params.raw.dark_frame = ""; + } + + if (options.fastexport_bypass_raw_ff) { + params.raw.ff_AutoSelect = false; + params.raw.ff_file = ""; + } + + params.raw.bayersensor.method = options.fastexport_raw_bayer_method; + params.raw.xtranssensor.method = options.fastexport_raw_xtrans_method; + params.icm.input = options.fastexport_icm_input; + params.icm.working = options.fastexport_icm_working; + params.icm.output = options.fastexport_icm_output; + params.icm.outputIntent = options.fastexport_icm_outputIntent; + params.icm.outputBPC = options.fastexport_icm_outputBPC; + params.icm.gamma = options.fastexport_icm_gamma; } - if (options.fastexport_bypass_sharpenEdge ) { - params.sharpenEdge.enabled = false; + if (params.resize.enabled) { + params.resize.width = rtengine::min(params.resize.width, options.fastexport_resize_width); + params.resize.height = rtengine::min(params.resize.height, options.fastexport_resize_height); + } else { + params.resize.width = options.fastexport_resize_width; + params.resize.height = options.fastexport_resize_height; } - - if (options.fastexport_bypass_sharpenMicro ) { - params.sharpenMicro.enabled = false; - } - - //if (options.fastexport_bypass_lumaDenoise ) params.lumaDenoise.enabled = false; - //if (options.fastexport_bypass_colorDenoise ) params.colorDenoise.enabled = false; - if (options.fastexport_bypass_defringe ) { - params.defringe.enabled = false; - } - - if (options.fastexport_bypass_dirpyrDenoise ) { - params.dirpyrDenoise.enabled = false; - } - - if (options.fastexport_bypass_sh_hq ) { - params.sh.hq = false; - } - - if (options.fastexport_bypass_dirpyrequalizer ) { - params.dirpyrequalizer.enabled = false; - } - - if (options.fastexport_bypass_wavelet ) { - params.wavelet.enabled = false; - } - - //if (options.fastexport_bypass_raw_bayer_all_enhance ) params.raw.bayersensor.all_enhance = false; - if (options.fastexport_bypass_raw_bayer_dcb_iterations ) { - params.raw.bayersensor.dcb_iterations = 0; - } - - if (options.fastexport_bypass_raw_bayer_dcb_enhance ) { - params.raw.bayersensor.dcb_enhance = false; - } - - if (options.fastexport_bypass_raw_bayer_lmmse_iterations) { - params.raw.bayersensor.lmmse_iterations = 0; - } - - if (options.fastexport_bypass_raw_bayer_linenoise ) { - params.raw.bayersensor.linenoise = 0; - } - - if (options.fastexport_bypass_raw_bayer_greenthresh ) { - params.raw.bayersensor.greenthresh = 0; - } - - if (options.fastexport_bypass_raw_ccSteps ) { - params.raw.bayersensor.ccSteps = params.raw.xtranssensor.ccSteps = 0; - } - - if (options.fastexport_bypass_raw_ca ) { - params.raw.ca_autocorrect = false; - params.raw.cared = 0; - params.raw.cablue = 0; - } - - if (options.fastexport_bypass_raw_df ) { - params.raw.df_autoselect = false; - params.raw.dark_frame = ""; - } - - if (options.fastexport_bypass_raw_ff ) { - params.raw.ff_AutoSelect = false; - params.raw.ff_file = ""; - } - - params.raw.bayersensor.method = options.fastexport_raw_bayer_method ; - params.raw.xtranssensor.method = options.fastexport_raw_xtrans_method; - params.icm.input = options.fastexport_icm_input ; - params.icm.working = options.fastexport_icm_working ; - params.icm.output = options.fastexport_icm_output ; - params.icm.outputIntent = options.fastexport_icm_outputIntent ; - params.icm.outputBPC = options.fastexport_icm_outputBPC ; - params.icm.gamma = options.fastexport_icm_gamma ; - params.resize.enabled = options.fastexport_resize_enabled ; - params.resize.scale = options.fastexport_resize_scale ; - params.resize.appliesTo = options.fastexport_resize_appliesTo ; - params.resize.method = options.fastexport_resize_method ; - params.resize.dataspec = options.fastexport_resize_dataspec ; - params.resize.width = options.fastexport_resize_width ; - params.resize.height = options.fastexport_resize_height ; + + params.resize.enabled = options.fastexport_resize_enabled; + params.resize.scale = options.fastexport_resize_scale; + params.resize.appliesTo = options.fastexport_resize_appliesTo; + params.resize.method = options.fastexport_resize_method; + params.resize.dataspec = options.fastexport_resize_dataspec; } - rtengine::ProcessingJob* pjob = rtengine::ProcessingJob::create (fbe->filename, th->getType() == FT_Raw, params); + rtengine::ProcessingJob* pjob = rtengine::ProcessingJob::create (fbe->filename, th->getType() == FT_Raw, params, fastmode && options.fastexport_use_fast_pipeline); int pw; int ph = BatchQueue::calcMaxThumbnailHeight(); diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 451af4e38..9da116e11 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -1478,7 +1478,7 @@ void BackBuffer::copyRGBCharData(const unsigned char *srcData, int srcX, int src return; } - for (unsigned int i = 0; i < (unsigned int)(srcH); ++i) { + for (int i = 0; i < srcH; ++i) { if (dstY + i >= surfH) { break; } @@ -1486,7 +1486,7 @@ void BackBuffer::copyRGBCharData(const unsigned char *srcData, int srcX, int src src = srcData + i * srcRowStride; dst = dstData + ((dstY + i) * surfW + dstX) * 4; - for (unsigned int j = 0; j < (unsigned int)(srcW); ++j) { + for (int j = 0; j < srcW; ++j) { if (dstX + j >= surfW) { break; } @@ -1620,8 +1620,8 @@ void BackBuffer::copySurface(Cairo::RefPtr crDest, Gdk::Rectangl int offsetY = rtengine::LIM(offset.y, 0, surface->get_height()); // now copy the off-screen Surface to the destination Surface - int srcSurfW = surface->get_width(); - int srcSurfH = surface->get_height(); + // int srcSurfW = surface->get_width(); + // int srcSurfH = surface->get_height(); //printf("srcSurf: w: %d, h: %d\n", srcSurfW, srcSurfH); crDest->set_line_width(0.); diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index 3f88adf0c..ed342f5af 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -114,7 +114,7 @@ public: class ConnectionBlocker { public: - explicit ConnectionBlocker (Gtk::Widget *associatedWidget, sigc::connection& connection) : connection (associatedWidget ? &connection : nullptr) + explicit ConnectionBlocker (Gtk::Widget *associatedWidget, sigc::connection& connection) : connection (associatedWidget ? &connection : nullptr), wasBlocked(false) { if (this->connection) { wasBlocked = connection.block(); diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 94fa2f24d..30519eb16 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -1007,7 +1007,7 @@ SSEFUNCTION void HistogramArea::updateBackBuffer () // does not take into account 0 and 255 values // them are handled separately - int fullhistheight = 0; + unsigned int fullhistheight = 0; for (int i = 1; i < 255; i++) { if (needLuma && lhisttemp[i] > fullhistheight) { @@ -1042,7 +1042,7 @@ SSEFUNCTION void HistogramArea::updateBackBuffer () vint iv = (vint)ZEROV; #endif - for (int i = 0; i < fullhistheight; i++) { + for (unsigned i = 0; i < fullhistheight; i++) { #ifdef __SSE2__ vint areatempv = (vint)ZEROV; diff --git a/rtgui/icmpanel.h b/rtgui/icmpanel.h index 84171ae87..846129105 100644 --- a/rtgui/icmpanel.h +++ b/rtgui/icmpanel.h @@ -88,8 +88,6 @@ private: sigc::connection onamesconn; PopUpButton* ointent; sigc::connection ointentconn; - Gtk::RadioButton* ofromdir; - Gtk::RadioButton* ofromfile; Gtk::RadioButton* iunchanged; MyFileChooserButton* ipDialog; Gtk::RadioButton::Group opts; @@ -99,7 +97,6 @@ private: ICMPanelListener* icmplistener; double dcpTemperatures[2]; - bool enableLastICCWorkDirChange; Glib::ustring lastRefFilename; Glib::ustring camName; void updateDCP(int dcpIlluminant, Glib::ustring dcp_name); diff --git a/rtgui/labcurve.cc b/rtgui/labcurve.cc index a173b47ec..dc9e404fb 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -559,7 +559,7 @@ void LCurve::adjusterChanged (Adjuster* a, double newval) void LCurve::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller) { - float R, G, B; + float R = 0.f, G = 0.f, B = 0.f; if (elemType == ColorCaller::CCET_VERTICAL_BAR) { valY = 0.5; diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index 71c54e2b5..2f4526cad 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -26,7 +26,7 @@ using namespace rtengine; using namespace rtengine::procparams; -LensProfilePanel::LensProfilePanel () : FoldableToolPanel(this, "lensprof", M("TP_LENSPROFILE_LABEL")) +LensProfilePanel::LensProfilePanel () : FoldableToolPanel(this, "lensprof", M("TP_LENSPROFILE_LABEL")), isRaw(true) { hbLCPFile = Gtk::manage(new Gtk::HBox()); diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index ce3d0247a..7fa07da3a 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -49,9 +49,9 @@ Locallab::Locallab (): expdenoi (new MyExpander (true, M ("TP_LOCALLAB_DENOIS"))), expsettings (new MyExpander (false, M ("TP_LOCALLAB_SETTINGS"))), - llCurveEditorG (new CurveEditorGroup (options.lastlocalCurvesDir, M ("TP_LOCALLAB_LUM"))), LocalcurveEditorgainT (new CurveEditorGroup (options.lastlocalCurvesDir, M ("TP_LOCALLAB_TRANSMISSIONGAIN"))), LocalcurveEditorgainTrab (new CurveEditorGroup (options.lastlocalCurvesDir, M ("TP_LOCALLAB_TRANSMISSIONGAINRAB"))), + llCurveEditorG (new CurveEditorGroup (options.lastlocalCurvesDir, M ("TP_LOCALLAB_LUM"))), anbspot (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_ANBSPOT"), 0, 1, 1, 0))), @@ -101,12 +101,12 @@ Locallab::Locallab (): lumaref (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_LUMAMAREF"), 0, 100, 0.01, 0))), Smethod (Gtk::manage (new MyComboBoxText ())), - qualityMethod (Gtk::manage (new MyComboBoxText ())), retinexMethod (Gtk::manage (new MyComboBoxText ())), + qualityMethod (Gtk::manage (new MyComboBoxText ())), qualitycurveMethod (Gtk::manage (new MyComboBoxText ())), - shapeFrame (Gtk::manage (new Gtk::Frame (M ("TP_LOCALLAB_SHFR")))), artifFrame (Gtk::manage (new Gtk::Frame (M ("TP_LOCALLAB_ARTIF")))), + shapeFrame (Gtk::manage (new Gtk::Frame (M ("TP_LOCALLAB_SHFR")))), superFrame (Gtk::manage (new Gtk::Frame ())), // artifVBox (Gtk::manage (new Gtk::VBox ())), diff --git a/rtgui/locallab.h b/rtgui/locallab.h index b03719db3..af8523839 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -33,57 +33,6 @@ private: void enableToggled (MyExpander *expander); //protected: - Gtk::HBox *editHBox; - Gtk::ToggleButton* edit; - - Adjuster* nbspot; - Adjuster* multiplier[5]; - - Adjuster* const degree; - Adjuster* const locX; - Adjuster* const locY; - Adjuster* const locXL; - Adjuster* const locYT; - Adjuster* const centerX; - Adjuster* const centerY; - Adjuster* const circrad; - Adjuster* const lightness; - Adjuster* const contrast; - Adjuster* const chroma; - Adjuster* const sensi; - Adjuster* const sensih; - Adjuster* const radius; - Adjuster* const strength; - Adjuster* const transit; - Adjuster* const str; - Adjuster* const neigh; - Adjuster* const vart; - Adjuster* const chrrt; - Adjuster* const anbspot; - Adjuster* const sharradius; - Adjuster* const sharamount; - Adjuster* const shardamping; - Adjuster* const shariter; - Adjuster* const sensisha; - Adjuster* const thres; - Adjuster* const proxi; - Adjuster* const noiselumf; - Adjuster* const noiselumc; - Adjuster* const noisechrof; - Adjuster* const noisechroc; - Adjuster* const threshold; - Adjuster* const sensicb; - Adjuster* const sensibn; - Adjuster* const stren; - Adjuster* const gamma; - Adjuster* const estop; - Adjuster* const scaltm; - Adjuster* const rewei; - Adjuster* const sensitm; - Adjuster* const retrab; - Adjuster* const hueref; - Adjuster* const chromaref; - Adjuster* const lumaref; MyExpander* const expcolor; MyExpander* const expblur; @@ -94,22 +43,83 @@ private: MyExpander* const expdenoi; MyExpander* const expsettings; + CurveEditorGroup* const LocalcurveEditorgainT; + CurveEditorGroup* const LocalcurveEditorgainTrab; + CurveEditorGroup* const llCurveEditorG; - sigc::connection lumaneutralPressedConn; - sigc::connection lumacontrastPlusPressedConn; - sigc::connection lumacontrastMinusPressedConn; - sigc::connection enablecolorConn, enableblurConn, enabletonemapConn; - sigc::connection enableretiConn, enablesharpConn, enablecbdlConn; - sigc::connection enabledenoiConn; - sigc::connection editConn, avoidConn, inversConn, curvactivConn, activlumConn, inversradConn, inversretConn, inversshaConn, neutralconn, neutralconn1; - Gtk::HBox* const ctboxS; - Gtk::HBox* const qualbox; - Gtk::HBox* const qualcurvbox; + Gtk::HBox *editHBox; + Gtk::ToggleButton* edit; + + Adjuster* nbspot; + Adjuster* multiplier[5]; + + Adjuster* const anbspot; + Adjuster* const locX; + Adjuster* const locXL; + Adjuster* const degree; + Adjuster* const locY; + Adjuster* const locYT; + Adjuster* const centerX; + Adjuster* const centerY; + Adjuster* const circrad; + Adjuster* const thres; + Adjuster* const proxi; + Adjuster* const lightness; + Adjuster* const contrast; + Adjuster* const chroma; + Adjuster* const sensi; + Adjuster* const radius; + Adjuster* const strength; + Adjuster* const sensibn; + Adjuster* const transit; + Adjuster* const stren; + Adjuster* const gamma; + Adjuster* const estop; + Adjuster* const scaltm; + Adjuster* const rewei; + Adjuster* const sensitm; + Adjuster* const str; + Adjuster* const neigh; + Adjuster* const vart; + Adjuster* const chrrt; + Adjuster* const sensih; + Adjuster* const retrab; + Adjuster* const threshold; + Adjuster* const sensicb; + Adjuster* const sharradius; + Adjuster* const sharamount; + Adjuster* const shardamping; + Adjuster* const shariter; + Adjuster* const sensisha; + Adjuster* const noiselumf; + Adjuster* const noiselumc; + Adjuster* const noisechrof; + Adjuster* const noisechroc; + Adjuster* const hueref; + Adjuster* const chromaref; + Adjuster* const lumaref; + + MyComboBoxText* const Smethod; + MyComboBoxText* const retinexMethod; + MyComboBoxText* const qualityMethod; + MyComboBoxText* const qualitycurveMethod; + Gtk::Frame* const artifFrame; Gtk::Frame* const shapeFrame; Gtk::Frame* const superFrame; + + Gtk::Label* const labmdh; + Gtk::Label* const labqual; + Gtk::Label* const labqualcurv; + Gtk::Label* const labmS; + + Gtk::HBox* const ctboxS; + Gtk::HBox* const dhbox; + Gtk::HBox* const qualbox; + Gtk::HBox* const qualcurvbox; + /* Gtk::VBox* const artifVBox; Gtk::VBox* const shapeVBox; @@ -123,11 +133,11 @@ private: Gtk::VBox* const superVBox; */ Gtk::CheckButton* const avoid; + Gtk::CheckButton* const activlum; Gtk::CheckButton* const invers; Gtk::CheckButton* const curvactiv; Gtk::CheckButton* const inversrad; Gtk::CheckButton* const inversret; - Gtk::CheckButton* const activlum; Gtk::CheckButton* const inverssha; Gtk::Button* neutral; @@ -135,28 +145,8 @@ private: Gtk::Button* neutral1; Gtk::HBox* neutrHBox1; - MyComboBoxText* const Smethod; - sigc::connection Smethodconn; - MyComboBoxText* const retinexMethod; - sigc::connection retinexMethodConn; - MyComboBoxText* const qualityMethod; - sigc::connection qualityMethodConn; - MyComboBoxText* const qualitycurveMethod; - sigc::connection qualitycurveMethodConn; - - - Gtk::Label* const labmdh; - Gtk::Label* const labqual; - Gtk::Label* const labqualcurv; - Gtk::Label* const labmS; - - Gtk::HBox* const dhbox; - - CurveEditorGroup* const LocalcurveEditorgainT; FlatCurveEditor* cTgainshape; - CurveEditorGroup* const LocalcurveEditorgainTrab; FlatCurveEditor* cTgainshaperab; - CurveEditorGroup* const llCurveEditorG; DiagonalCurveEditor* llshape; DiagonalCurveEditor* ccshape; Gtk::Image* irg; @@ -164,6 +154,21 @@ private: + + sigc::connection lumaneutralPressedConn; + sigc::connection lumacontrastPlusPressedConn; + sigc::connection lumacontrastMinusPressedConn; + sigc::connection enablecolorConn, enableblurConn, enabletonemapConn; + sigc::connection enableretiConn, enablesharpConn, enablecbdlConn; + sigc::connection enabledenoiConn; + sigc::connection editConn, avoidConn, inversConn, curvactivConn, activlumConn, inversradConn, inversretConn, inversshaConn, neutralconn, neutralconn1; + sigc::connection Smethodconn; + sigc::connection retinexMethodConn; + sigc::connection qualityMethodConn; + sigc::connection qualitycurveMethodConn; + + + int nextdatasp[61]; int nextlength; std::string nextstr; diff --git a/rtgui/lwbuttonset.cc b/rtgui/lwbuttonset.cc index 9fc1bc443..6265c1039 100644 --- a/rtgui/lwbuttonset.cc +++ b/rtgui/lwbuttonset.cc @@ -72,7 +72,7 @@ void LWButtonSet::arrangeButtons (int x, int y, int w, int h) for (size_t i = 0; i < buttons.size(); i++) { LWButton::Alignment halign, valign; - int bx, by, bw, bh; + int bx = 0, by = 0, bw = 0, bh = 0; buttons[i]->getSize (bw, bh); buttons[i]->getAlignment (halign, valign); diff --git a/rtgui/main-cli.cc b/rtgui/main-cli.cc index d9a481e7e..3a601e18e 100644 --- a/rtgui/main-cli.cc +++ b/rtgui/main-cli.cc @@ -81,6 +81,8 @@ Glib::ustring fname_to_utf8 (const char* fname) #endif } +bool fast_export = false; + } /* Process line command options @@ -407,6 +409,10 @@ int processLineParams( int argc, char **argv ) compression = -1; break; + case 'f': + fast_export = true; + break; + case 'c': // MUST be last option while (iArg + 1 < argc) { iArg++; @@ -491,7 +497,7 @@ int processLineParams( int argc, char **argv ) std::cout << std::endl; #endif std::cout << "Options:" << std::endl; - std::cout << " " << Glib::path_get_basename(argv[0]) << " [-o |-O ] [-s|-S] [-p [-p ...] ] [-d] [ -j[1-100] [-js<1-3>] | [-b<8|16>] [-t[z] | [-n]] ] [-Y] -c " << std::endl; + std::cout << " " << Glib::path_get_basename(argv[0]) << " [-o |-O ] [-s|-S] [-p [-p ...] ] [-d] [ -j[1-100] [-js<1-3>] | [-b<8|16>] [-t[z] | [-n]] ] [-Y] [-f] -c " << std::endl; std::cout << std::endl; std::cout << " -q Quick Start mode : do not load cached files to speedup start time." << std::endl; std::cout << " -c Specify one or more input files." << std::endl; @@ -525,6 +531,7 @@ int processLineParams( int argc, char **argv ) std::cout << " -n Specify output to be compressed PNG." << std::endl; std::cout << " Compression is hard-coded to 6." << std::endl; std::cout << " -Y Overwrite output if present." << std::endl; + std::cout << " -f Use the custom fast-export processing pipeline." << std::endl; std::cout << std::endl; std::cout << "Your " << pparamsExt << " files can be incomplete, RawTherapee will build the final values as follows:" << std::endl; std::cout << " 1- A new processing profile is created using neutral values," << std::endl; @@ -714,7 +721,7 @@ int processLineParams( int argc, char **argv ) continue; } - job = rtengine::ProcessingJob::create (ii, currentParams); + job = rtengine::ProcessingJob::create (ii, currentParams, fast_export); if( !job ) { errors++; diff --git a/rtgui/mycurve.cc b/rtgui/mycurve.cc index c36ec1cc7..c1bec868a 100644 --- a/rtgui/mycurve.cc +++ b/rtgui/mycurve.cc @@ -175,7 +175,7 @@ bool MyCurve::snapCoordinateY(double testedVal, double realVal) float MyCurve::getVal(LUTf &curve, int x) { - if ((graphW - 2) == curve.getSize()) { + if (size_t(graphW - 2) == curve.getSize()) { return curve[x]; } else { return curve.getVal01(float(x) / (graphW - 3)); diff --git a/rtgui/mydiagonalcurve.cc b/rtgui/mydiagonalcurve.cc index 8bdb7fa0d..7d7d66a15 100644 --- a/rtgui/mydiagonalcurve.cc +++ b/rtgui/mydiagonalcurve.cc @@ -398,7 +398,7 @@ void MyDiagonalCurve::draw (int handle) double y2 = double(graphY) - 1.5 - double(graphH - 3) * points[pos + 1]; // project (curve.y.at(i), 0, 1, graphH); // set the color of the line when the point is snapped to the cage - if (curve.x.size() == nbPoints && snapToElmt >= 1000 && ((i == (snapToElmt - 1000)) || (i == (snapToElmt - 999)))) { + if (curve.x.size() == nbPoints && snapToElmt >= 1000 && ((int(i) == (snapToElmt - 1000)) || (int(i) == (snapToElmt - 999)))) { cr->set_source_rgb (1.0, 0.0, 0.0); } else { cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue()); @@ -606,7 +606,7 @@ bool MyDiagonalCurve::handleEvents (GdkEvent* event) edited_point = lit_point; std::vector newBoundaries(2); - unsigned int size = curve.x.size(); + int size = curve.x.size(); if (edited_point == 0) { newBoundaries.at(0).minVal = 0.; @@ -655,7 +655,7 @@ bool MyDiagonalCurve::handleEvents (GdkEvent* event) draw (lit_point); std::vector newBoundaries; newBoundaries.resize(2); - unsigned int size = curve.x.size(); + int size = curve.x.size(); if (edited_point == 0) { newBoundaries.at(0).minVal = 0.; @@ -888,7 +888,7 @@ bool MyDiagonalCurve::handleEvents (GdkEvent* event) } else { // snapping point to specific values if (snapTo && curve.x.at(grab_point) != -1.) { - if (grab_point > 0 && grab_point < (curve.y.size() - 1)) { + if (grab_point > 0 && unsigned(grab_point) < (curve.y.size() - 1)) { double prevX = curve.x.at(grab_point - 1); double prevY = curve.y.at(grab_point - 1); double nextX = curve.x.at(grab_point + 1); @@ -910,7 +910,7 @@ bool MyDiagonalCurve::handleEvents (GdkEvent* event) } } - if (grab_point < (curve.y.size() - 1)) { + if (grab_point < int(curve.y.size() - 1)) { int nextP = grab_point + 1; if (snapCoordinateY(curve.y.at(nextP), ugpY)) { @@ -1208,7 +1208,7 @@ void MyDiagonalCurve::pipetteDrag(EditDataProvider *provider, int modifierKey) // snapping point to specific values if (snapTo && curve.x.at(grab_point) != -1.) { - if (grab_point > 0 && grab_point < (curve.y.size() - 1)) { + if (grab_point > 0 && unsigned(grab_point) < (curve.y.size() - 1)) { double prevX = curve.x.at(grab_point - 1); double prevY = curve.y.at(grab_point - 1); double nextX = curve.x.at(grab_point + 1); @@ -1230,7 +1230,7 @@ void MyDiagonalCurve::pipetteDrag(EditDataProvider *provider, int modifierKey) } } - if (grab_point < (curve.y.size() - 1)) { + if (grab_point < int(curve.y.size() - 1)) { int nextP = grab_point + 1; if (snapCoordinateY(curve.y.at(nextP), ugpY)) { diff --git a/rtgui/myflatcurve.cc b/rtgui/myflatcurve.cc index 532557a3b..c98268683 100644 --- a/rtgui/myflatcurve.cc +++ b/rtgui/myflatcurve.cc @@ -711,7 +711,7 @@ bool MyFlatCurve::handleEvents (GdkEvent* event) setDirty(true); draw (); std::vector newBoundaries(4); - unsigned int size = curve.x.size(); + int size = curve.x.size(); if (edited_point == 0) { newBoundaries.at(0).minVal = 0.; @@ -761,7 +761,7 @@ bool MyFlatCurve::handleEvents (GdkEvent* event) setDirty(true); draw (); std::vector newBoundaries(4); - unsigned int size = curve.x.size(); + int size = curve.x.size(); if (edited_point == 0) { newBoundaries.at(0).minVal = 0.; @@ -1544,7 +1544,7 @@ void MyFlatCurve::movePoint(bool moveX, bool moveY, bool pipetteDrag) } if (curve.y.size() > 2) { - if (lit_point == (curve.y.size() - 1)) { + if (lit_point == int(curve.y.size()) - 1) { if (snapCoordinateY(curve.y.at(0), ugpY)) { snapToElmt = 0; } diff --git a/rtgui/options.cc b/rtgui/options.cc index b543fbb0b..f6848a093 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -487,6 +487,7 @@ void Options::setDefaults () fastexport_resize_dataspec = 3; fastexport_resize_width = 900; fastexport_resize_height = 900; + fastexport_use_fast_pipeline = true; clutsDir = "./cluts"; @@ -1829,6 +1830,9 @@ int Options::readFromFile (Glib::ustring fname) if (keyFile.has_key ("Fast Export", "fastexport_resize_height" )) { fastexport_resize_height = keyFile.get_integer ("Fast Export", "fastexport_resize_height" ); } + if (keyFile.has_key ("Fast Export", "fastexport_use_fast_pipeline" )) { + fastexport_use_fast_pipeline = keyFile.get_integer ("Fast Export", "fastexport_use_fast_pipeline" ); + } } if (keyFile.has_group ("Dialogs")) { @@ -2197,6 +2201,7 @@ int Options::saveToFile (Glib::ustring fname) keyFile.set_integer ("Fast Export", "fastexport_resize_dataspec", fastexport_resize_dataspec ); keyFile.set_integer ("Fast Export", "fastexport_resize_width", fastexport_resize_width ); keyFile.set_integer ("Fast Export", "fastexport_resize_height", fastexport_resize_height ); + keyFile.set_integer ("Fast Export", "fastexport_use_fast_pipeline", fastexport_use_fast_pipeline ); keyFile.set_string ("Dialogs", "LastIccDir", lastIccDir); keyFile.set_string ("Dialogs", "LastDarkframeDir", lastDarkframeDir); diff --git a/rtgui/options.h b/rtgui/options.h index 78cd61c0a..a3d03cd74 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -290,6 +290,7 @@ public: int fastexport_resize_dataspec; int fastexport_resize_width; int fastexport_resize_height; + bool fastexport_use_fast_pipeline; // Dialog settings Glib::ustring lastIccDir; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 847f38d7b..35c1b83de 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -459,8 +459,8 @@ void ParamsEdited::set (bool v) raw.bayersensor.pixelShiftSigma = v; raw.bayersensor.pixelShiftSum = v; raw.bayersensor.pixelShiftRedBlueWeight = v; - raw.bayersensor.pixelshiftShowMotion = v; - raw.bayersensor.pixelshiftShowMotionMaskOnly = v; + raw.bayersensor.pixelShiftShowMotion = v; + raw.bayersensor.pixelShiftShowMotionMaskOnly = v; raw.bayersensor.pixelShiftAutomatic = v; raw.bayersensor.pixelShiftNonGreenHorizontal = v; raw.bayersensor.pixelShiftNonGreenVertical = v; @@ -1060,8 +1060,8 @@ void ParamsEdited::initFrom (const std::vector raw.bayersensor.pixelShiftSigma = raw.bayersensor.pixelShiftSigma && p.raw.bayersensor.pixelShiftSigma == other.raw.bayersensor.pixelShiftSigma; raw.bayersensor.pixelShiftSum = raw.bayersensor.pixelShiftSum && p.raw.bayersensor.pixelShiftSum == other.raw.bayersensor.pixelShiftSum; raw.bayersensor.pixelShiftRedBlueWeight = raw.bayersensor.pixelShiftRedBlueWeight && p.raw.bayersensor.pixelShiftRedBlueWeight == other.raw.bayersensor.pixelShiftRedBlueWeight; - raw.bayersensor.pixelshiftShowMotion = raw.bayersensor.pixelshiftShowMotion && p.raw.bayersensor.pixelshiftShowMotion == other.raw.bayersensor.pixelshiftShowMotion; - raw.bayersensor.pixelshiftShowMotionMaskOnly = raw.bayersensor.pixelshiftShowMotionMaskOnly && p.raw.bayersensor.pixelshiftShowMotionMaskOnly == other.raw.bayersensor.pixelshiftShowMotionMaskOnly; + raw.bayersensor.pixelShiftShowMotion = raw.bayersensor.pixelShiftShowMotion && p.raw.bayersensor.pixelShiftShowMotion == other.raw.bayersensor.pixelShiftShowMotion; + raw.bayersensor.pixelShiftShowMotionMaskOnly = raw.bayersensor.pixelShiftShowMotionMaskOnly && p.raw.bayersensor.pixelShiftShowMotionMaskOnly == other.raw.bayersensor.pixelShiftShowMotionMaskOnly; raw.bayersensor.pixelShiftAutomatic = raw.bayersensor.pixelShiftAutomatic && p.raw.bayersensor.pixelShiftAutomatic == other.raw.bayersensor.pixelShiftAutomatic; raw.bayersensor.pixelShiftNonGreenHorizontal = raw.bayersensor.pixelShiftNonGreenHorizontal && p.raw.bayersensor.pixelShiftNonGreenHorizontal == other.raw.bayersensor.pixelShiftNonGreenHorizontal; raw.bayersensor.pixelShiftNonGreenVertical = raw.bayersensor.pixelShiftNonGreenVertical && p.raw.bayersensor.pixelShiftNonGreenVertical == other.raw.bayersensor.pixelShiftNonGreenVertical; @@ -2828,12 +2828,12 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten toEdit.raw.bayersensor.pixelShiftRedBlueWeight = mods.raw.bayersensor.pixelShiftRedBlueWeight; } - if (raw.bayersensor.pixelshiftShowMotion) { - toEdit.raw.bayersensor.pixelshiftShowMotion = mods.raw.bayersensor.pixelshiftShowMotion; + if (raw.bayersensor.pixelShiftShowMotion) { + toEdit.raw.bayersensor.pixelShiftShowMotion = mods.raw.bayersensor.pixelShiftShowMotion; } - if (raw.bayersensor.pixelshiftShowMotionMaskOnly) { - toEdit.raw.bayersensor.pixelshiftShowMotionMaskOnly = mods.raw.bayersensor.pixelshiftShowMotionMaskOnly; + if (raw.bayersensor.pixelShiftShowMotionMaskOnly) { + toEdit.raw.bayersensor.pixelShiftShowMotionMaskOnly = mods.raw.bayersensor.pixelShiftShowMotionMaskOnly; } if (raw.bayersensor.pixelShiftAutomatic) { @@ -3407,7 +3407,7 @@ bool RAWParamsEdited::BayerSensor::isUnchanged() const { return method && imageNum && dcbIterations && dcbEnhance && lmmseIterations/*&& allEnhance*/ && greenEq && pixelShiftMotion && pixelShiftMotionCorrection && pixelShiftMotionCorrectionMethod && pixelShiftStddevFactorGreen && pixelShiftStddevFactorRed && pixelShiftStddevFactorBlue && pixelShiftEperIso - && pixelShiftNreadIso && pixelShiftPrnu && pixelShiftSigma && pixelShiftSum && pixelShiftRedBlueWeight && pixelshiftShowMotion && pixelshiftShowMotionMaskOnly + && pixelShiftNreadIso && pixelShiftPrnu && pixelShiftSigma && pixelShiftSum && pixelShiftRedBlueWeight && pixelShiftShowMotion && pixelShiftShowMotionMaskOnly && pixelShiftAutomatic && pixelShiftNonGreenHorizontal && pixelShiftNonGreenVertical && pixelShiftHoleFill && pixelShiftMedian && pixelShiftMedian3 && pixelShiftNonGreenCross && pixelShiftNonGreenCross2 && pixelShiftNonGreenAmaze && pixelShiftGreen && pixelShiftBlur && pixelShiftSmooth && pixelShiftExp0 && pixelShiftLmmse && pixelShiftEqualBright && linenoise && exBlack0 && exBlack1 && exBlack2 && exBlack3 && exTwoGreen; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 61d3e0fd4..f3d6fd37c 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -781,8 +781,8 @@ public: bool pixelShiftSigma; bool pixelShiftSum; bool pixelShiftRedBlueWeight; - bool pixelshiftShowMotion; - bool pixelshiftShowMotionMaskOnly; + bool pixelShiftShowMotion; + bool pixelShiftShowMotionMaskOnly; bool pixelShiftAutomatic; bool pixelShiftNonGreenHorizontal; bool pixelShiftNonGreenVertical; diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index 94b22a75e..d20615795 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -101,21 +101,21 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren iptc = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_IPTCINFO"))); // options in raw: - raw_expos = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWEXPOS_LINEAR"))); - raw_preser = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWEXPOS_PRESER"))); - raw_black = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWEXPOS_BLACK"))); - raw_ca_autocorrect = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWCACORR_AUTO"))); - raw_cared = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWCACORR_CARED"))); - raw_cablue = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWCACORR_CABLUE"))); - raw_hotpix_filt = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PREPROCESS_HOTPIXFILT"))); - raw_deadpix_filt = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PREPROCESS_DEADPIXFILT"))); - raw_linenoise = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PREPROCESS_LINEDENOISE"))); - raw_greenthresh = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PREPROCESS_GREENEQUIL"))); - raw_method = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAW_DMETHOD"))); - raw_imagenum = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAW_IMAGENUM"))); - raw_ccSteps = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAW_FALSECOLOR"))); - raw_dcb_iterations = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAW_DCBITERATIONS"))); - raw_dcb_enhance = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAW_DCBENHANCE"))); + raw_expos = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_RAWEXPOS_LINEAR"))); + raw_preser = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_RAWEXPOS_PRESER"))); + raw_black = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_RAWEXPOS_BLACK"))); + raw_ca_autocorrect = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_RAWCACORR_AUTO"))); + raw_caredblue = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_RAWCACORR_CAREDBLUE"))); + raw_hotpix_filt = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_PREPROCESS_HOTPIXFILT"))); + raw_deadpix_filt = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_PREPROCESS_DEADPIXFILT"))); + raw_linenoise = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_PREPROCESS_LINEDENOISE"))); + raw_greenthresh = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_PREPROCESS_GREENEQUIL"))); + raw_method = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_RAW_DMETHOD"))); + raw_imagenum = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_RAW_IMAGENUM"))); + raw_pixelshift = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_RAW_PIXELSHIFT"))); + raw_ccSteps = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_RAW_FALSECOLOR"))); + raw_dcb_iterations = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_RAW_DCBITERATIONS"))); + raw_dcb_enhance = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_RAW_DCBENHANCE"))); //raw_all_enhance = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAW_ALLENHANCE"))); raw_lmmse_iterations = Gtk::manage (new Gtk::CheckButton (M ("PARTIALPASTE_RAW_LMMSEITERATIONS"))); @@ -204,6 +204,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren vboxes[6]->pack_start (*hseps[6], Gtk::PACK_SHRINK, 2); vboxes[6]->pack_start (*raw_method, Gtk::PACK_SHRINK, 2); vboxes[6]->pack_start (*raw_imagenum, Gtk::PACK_SHRINK, 2); + vboxes[6]->pack_start (*raw_pixelshift, Gtk::PACK_SHRINK, 2); vboxes[6]->pack_start (*raw_ccSteps, Gtk::PACK_SHRINK, 2); vboxes[6]->pack_start (*raw_dcb_iterations, Gtk::PACK_SHRINK, 2); vboxes[6]->pack_start (*raw_dcb_enhance, Gtk::PACK_SHRINK, 2); @@ -229,8 +230,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren vboxes[6]->pack_start (*ff_ClipControl, Gtk::PACK_SHRINK, 2); vboxes[6]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0); vboxes[6]->pack_start (*raw_ca_autocorrect, Gtk::PACK_SHRINK, 2); - vboxes[6]->pack_start (*raw_cared, Gtk::PACK_SHRINK, 2); - vboxes[6]->pack_start (*raw_cablue, Gtk::PACK_SHRINK, 2); + vboxes[6]->pack_start (*raw_caredblue, Gtk::PACK_SHRINK, 2); //META vboxes[7]->pack_start (*meta, Gtk::PACK_SHRINK, 2); @@ -319,44 +319,44 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren icmConn = icm->signal_toggled().connect (sigc::bind (sigc::mem_fun (*color, &Gtk::CheckButton::set_inconsistent), true)); //gamcsconn = gam->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); - vibranceConn = vibrance->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); - chmixerConn = chmixer->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); - chmixerbwConn = blackwhite->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); - hsveqConn = hsveq->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); - filmSimulationConn = filmSimulation->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); - rgbcurvesConn = rgbcurves->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); - colortoningConn = colortoning->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); + vibranceConn = vibrance->signal_toggled().connect (sigc::bind (sigc::mem_fun (*color, &Gtk::CheckButton::set_inconsistent), true)); + chmixerConn = chmixer->signal_toggled().connect (sigc::bind (sigc::mem_fun (*color, &Gtk::CheckButton::set_inconsistent), true)); + chmixerbwConn = blackwhite->signal_toggled().connect (sigc::bind (sigc::mem_fun (*color, &Gtk::CheckButton::set_inconsistent), true)); + hsveqConn = hsveq->signal_toggled().connect (sigc::bind (sigc::mem_fun (*color, &Gtk::CheckButton::set_inconsistent), true)); + filmSimulationConn = filmSimulation->signal_toggled().connect (sigc::bind (sigc::mem_fun (*color, &Gtk::CheckButton::set_inconsistent), true)); + rgbcurvesConn = rgbcurves->signal_toggled().connect (sigc::bind (sigc::mem_fun (*color, &Gtk::CheckButton::set_inconsistent), true)); + colortoningConn = colortoning->signal_toggled().connect (sigc::bind (sigc::mem_fun (*color, &Gtk::CheckButton::set_inconsistent), true)); - distortionConn = distortion->signal_toggled().connect (sigc::bind (sigc::mem_fun(*lens, &Gtk::CheckButton::set_inconsistent), true)); - cacorrConn = cacorr->signal_toggled().connect (sigc::bind (sigc::mem_fun(*lens, &Gtk::CheckButton::set_inconsistent), true)); - vignettingConn = vignetting->signal_toggled().connect (sigc::bind (sigc::mem_fun(*lens, &Gtk::CheckButton::set_inconsistent), true)); - lcpConn = lcp->signal_toggled().connect (sigc::bind (sigc::mem_fun(*lens, &Gtk::CheckButton::set_inconsistent), true)); + distortionConn = distortion->signal_toggled().connect (sigc::bind (sigc::mem_fun (*lens, &Gtk::CheckButton::set_inconsistent), true)); + cacorrConn = cacorr->signal_toggled().connect (sigc::bind (sigc::mem_fun (*lens, &Gtk::CheckButton::set_inconsistent), true)); + vignettingConn = vignetting->signal_toggled().connect (sigc::bind (sigc::mem_fun (*lens, &Gtk::CheckButton::set_inconsistent), true)); + lcpConn = lcp->signal_toggled().connect (sigc::bind (sigc::mem_fun (*lens, &Gtk::CheckButton::set_inconsistent), true)); - coarserotConn = coarserot->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); - finerotConn = finerot->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); - cropConn = crop->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); - resizeConn = resize->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); - prsharpeningConn = prsharpening->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); - perspectiveConn = perspective->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); - commonTransConn = commonTrans->signal_toggled().connect (sigc::bind (sigc::mem_fun(*composition, &Gtk::CheckButton::set_inconsistent), true)); + coarserotConn = coarserot->signal_toggled().connect (sigc::bind (sigc::mem_fun (*composition, &Gtk::CheckButton::set_inconsistent), true)); + finerotConn = finerot->signal_toggled().connect (sigc::bind (sigc::mem_fun (*composition, &Gtk::CheckButton::set_inconsistent), true)); + cropConn = crop->signal_toggled().connect (sigc::bind (sigc::mem_fun (*composition, &Gtk::CheckButton::set_inconsistent), true)); + resizeConn = resize->signal_toggled().connect (sigc::bind (sigc::mem_fun (*composition, &Gtk::CheckButton::set_inconsistent), true)); + prsharpeningConn = prsharpening->signal_toggled().connect (sigc::bind (sigc::mem_fun (*composition, &Gtk::CheckButton::set_inconsistent), true)); + perspectiveConn = perspective->signal_toggled().connect (sigc::bind (sigc::mem_fun (*composition, &Gtk::CheckButton::set_inconsistent), true)); + commonTransConn = commonTrans->signal_toggled().connect (sigc::bind (sigc::mem_fun (*composition, &Gtk::CheckButton::set_inconsistent), true)); - exifchConn = exifch->signal_toggled().connect (sigc::bind (sigc::mem_fun(*meta, &Gtk::CheckButton::set_inconsistent), true)); - iptcConn = iptc->signal_toggled().connect (sigc::bind (sigc::mem_fun(*meta, &Gtk::CheckButton::set_inconsistent), true)); + exifchConn = exifch->signal_toggled().connect (sigc::bind (sigc::mem_fun (*meta, &Gtk::CheckButton::set_inconsistent), true)); + iptcConn = iptc->signal_toggled().connect (sigc::bind (sigc::mem_fun (*meta, &Gtk::CheckButton::set_inconsistent), true)); - raw_methodConn = raw_method->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true)); - raw_imagenumConn = raw_imagenum->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true)); - raw_ccStepsConn = raw_ccSteps->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true)); - raw_dcb_iterationsConn = raw_dcb_iterations->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true)); - raw_dcb_enhanceConn = raw_dcb_enhance->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true)); + raw_methodConn = raw_method->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); + raw_imagenumConn = raw_imagenum->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); + raw_ccStepsConn = raw_ccSteps->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); + raw_dcb_iterationsConn = raw_dcb_iterations->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); + raw_dcb_enhanceConn = raw_dcb_enhance->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); //raw_all_enhanceConn = raw_all_enhance->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true)); raw_lmmse_iterationsConn = raw_lmmse_iterations->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); + raw_pixelshiftConn = raw_pixelshift->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); raw_exposConn = raw_expos->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); raw_preserConn = raw_preser->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); raw_blackConn = raw_black->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); raw_ca_autocorrectConn = raw_ca_autocorrect->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); - raw_caredConn = raw_cared->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); - raw_cablueConn = raw_cablue->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); + raw_caredblueConn = raw_caredblue->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); raw_hotpix_filtConn = raw_hotpix_filt->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); raw_deadpix_filtConn = raw_deadpix_filt->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); raw_linenoiseConn = raw_linenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun (*raw, &Gtk::CheckButton::set_inconsistent), true)); @@ -430,12 +430,12 @@ void PartialPasteDlg::rawToggled () raw_dcb_enhanceConn.block (true); //raw_all_enhanceConn.block (true); raw_lmmse_iterationsConn.block (true); + raw_pixelshiftConn.block (true); raw_exposConn.block (true); raw_preserConn.block (true); raw_blackConn.block (true); raw_ca_autocorrectConn.block (true); - raw_caredConn.block (true); - raw_cablueConn.block (true); + raw_caredblueConn.block (true); raw_hotpix_filtConn.block (true); raw_deadpix_filtConn.block (true); raw_linenoiseConn.block (true); @@ -456,13 +456,13 @@ void PartialPasteDlg::rawToggled () raw_dcb_iterations->set_active (raw->get_active ()); raw_dcb_enhance->set_active (raw->get_active ()); raw_lmmse_iterations->set_active (raw->get_active ()); + raw_pixelshift->set_active (raw->get_active ()); //raw_all_enhance->set_active (raw->get_active ()); raw_expos->set_active (raw->get_active ()); raw_preser->set_active (raw->get_active ()); raw_black->set_active (raw->get_active ()); raw_ca_autocorrect->set_active (raw->get_active ()); - raw_cared->set_active (raw->get_active ()); - raw_cablue->set_active (raw->get_active ()); + raw_caredblue->set_active (raw->get_active ()); raw_hotpix_filt->set_active (raw->get_active ()); raw_deadpix_filt->set_active (raw->get_active ()); raw_linenoise->set_active (raw->get_active ()); @@ -481,13 +481,13 @@ void PartialPasteDlg::rawToggled () raw_dcb_iterationsConn.block (false); raw_dcb_enhanceConn.block (false); //raw_all_enhanceConn.block (false); + raw_pixelshiftConn.block (false); raw_lmmse_iterationsConn.block (false); raw_exposConn.block (false); raw_preserConn.block (false); raw_blackConn.block (false); raw_ca_autocorrectConn.block (false); - raw_caredConn.block (false); - raw_cablueConn.block (false); + raw_caredblueConn.block (false); raw_hotpix_filtConn.block (false); raw_deadpix_filtConn.block (false); raw_linenoiseConn.block (false); @@ -897,6 +897,38 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param filterPE.raw.xtranssensor.exBlackBlue = falsePE.raw.xtranssensor.exBlackBlue; } + if (!raw_pixelshift->get_active ()) { + filterPE.raw.bayersensor.pixelShiftAutomatic = falsePE.raw.bayersensor.pixelShiftAutomatic; + filterPE.raw.bayersensor.pixelShiftBlur = falsePE.raw.bayersensor.pixelShiftBlur; + filterPE.raw.bayersensor.pixelShiftEperIso = falsePE.raw.bayersensor.pixelShiftEperIso; + filterPE.raw.bayersensor.pixelShiftEqualBright = falsePE.raw.bayersensor.pixelShiftEqualBright; + filterPE.raw.bayersensor.pixelShiftExp0 = falsePE.raw.bayersensor.pixelShiftExp0; + filterPE.raw.bayersensor.pixelShiftGreen = falsePE.raw.bayersensor.pixelShiftGreen; + filterPE.raw.bayersensor.pixelShiftHoleFill = falsePE.raw.bayersensor.pixelShiftHoleFill; + filterPE.raw.bayersensor.pixelShiftLmmse = falsePE.raw.bayersensor.pixelShiftLmmse; + filterPE.raw.bayersensor.pixelShiftMedian = falsePE.raw.bayersensor.pixelShiftMedian; + filterPE.raw.bayersensor.pixelShiftMedian3 = falsePE.raw.bayersensor.pixelShiftMedian3; + filterPE.raw.bayersensor.pixelShiftMotion = falsePE.raw.bayersensor.pixelShiftMotion; + filterPE.raw.bayersensor.pixelShiftMotionCorrection = falsePE.raw.bayersensor.pixelShiftMotionCorrection; + filterPE.raw.bayersensor.pixelShiftMotionCorrectionMethod = falsePE.raw.bayersensor.pixelShiftMotionCorrectionMethod; + filterPE.raw.bayersensor.pixelShiftNonGreenAmaze = falsePE.raw.bayersensor.pixelShiftNonGreenAmaze; + filterPE.raw.bayersensor.pixelShiftNonGreenCross = falsePE.raw.bayersensor.pixelShiftNonGreenCross; + filterPE.raw.bayersensor.pixelShiftNonGreenCross2 = falsePE.raw.bayersensor.pixelShiftNonGreenCross2; + filterPE.raw.bayersensor.pixelShiftNonGreenHorizontal = falsePE.raw.bayersensor.pixelShiftNonGreenHorizontal; + filterPE.raw.bayersensor.pixelShiftNonGreenVertical = falsePE.raw.bayersensor.pixelShiftNonGreenVertical; + filterPE.raw.bayersensor.pixelShiftNreadIso = falsePE.raw.bayersensor.pixelShiftNreadIso; + filterPE.raw.bayersensor.pixelShiftPrnu = falsePE.raw.bayersensor.pixelShiftPrnu; + filterPE.raw.bayersensor.pixelShiftRedBlueWeight = falsePE.raw.bayersensor.pixelShiftRedBlueWeight; + filterPE.raw.bayersensor.pixelShiftSigma = falsePE.raw.bayersensor.pixelShiftSigma; + filterPE.raw.bayersensor.pixelShiftSmooth = falsePE.raw.bayersensor.pixelShiftSmooth; + filterPE.raw.bayersensor.pixelShiftStddevFactorBlue = falsePE.raw.bayersensor.pixelShiftStddevFactorBlue; + filterPE.raw.bayersensor.pixelShiftStddevFactorGreen = falsePE.raw.bayersensor.pixelShiftStddevFactorGreen; + filterPE.raw.bayersensor.pixelShiftStddevFactorRed = falsePE.raw.bayersensor.pixelShiftStddevFactorRed; + filterPE.raw.bayersensor.pixelShiftSum = falsePE.raw.bayersensor.pixelShiftSum; + filterPE.raw.bayersensor.pixelShiftShowMotion = falsePE.raw.bayersensor.pixelShiftShowMotion; + filterPE.raw.bayersensor.pixelShiftShowMotionMaskOnly = falsePE.raw.bayersensor.pixelShiftShowMotionMaskOnly; + } + if (!raw_linenoise->get_active ()) { filterPE.raw.bayersensor.linenoise = falsePE.raw.bayersensor.linenoise; } @@ -917,11 +949,8 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param filterPE.raw.caCorrection = falsePE.raw.caCorrection; } - if (!raw_cared->get_active ()) { + if (!raw_caredblue->get_active ()) { filterPE.raw.caRed = falsePE.raw.caRed; - } - - if (!raw_cablue->get_active ()) { filterPE.raw.caBlue = falsePE.raw.caBlue; } diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index 11a33cb7d..31fd5591a 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -101,8 +101,9 @@ public: Gtk::CheckButton* raw_preser; Gtk::CheckButton* raw_black; Gtk::CheckButton* raw_ca_autocorrect; - Gtk::CheckButton* raw_cared; + Gtk::CheckButton* raw_caredblue; Gtk::CheckButton* raw_cablue; + Gtk::CheckButton* raw_caautostrength; Gtk::CheckButton* raw_hotpix_filt; Gtk::CheckButton* raw_deadpix_filt; Gtk::CheckButton* raw_linenoise; @@ -113,6 +114,7 @@ public: Gtk::CheckButton* raw_dcb_iterations; Gtk::CheckButton* raw_dcb_enhance; Gtk::CheckButton* raw_lmmse_iterations; + Gtk::CheckButton* raw_pixelshift; Gtk::CheckButton* df_file; Gtk::CheckButton* df_AutoSelect; @@ -131,7 +133,7 @@ public: sigc::connection coarserotConn, finerotConn, cropConn, resizeConn, prsharpeningConn, perspectiveConn, commonTransConn; sigc::connection exifchConn, iptcConn, icmConn; sigc::connection df_fileConn, df_AutoSelectConn, ff_fileConn, ff_AutoSelectConn, ff_BlurRadiusConn, ff_BlurTypeConn, ff_ClipControlConn; - sigc::connection raw_caredConn, raw_cablueConn, raw_ca_autocorrectConn, raw_hotpix_filtConn, raw_deadpix_filtConn, raw_linenoiseConn, raw_greenthreshConn, raw_ccStepsConn, raw_methodConn, raw_imagenumConn, raw_dcb_iterationsConn, raw_lmmse_iterationsConn, raw_dcb_enhanceConn, raw_exposConn, raw_preserConn, raw_blackConn; + sigc::connection raw_caredblueConn, raw_caautostrengthConn, raw_ca_autocorrectConn, raw_hotpix_filtConn, raw_deadpix_filtConn, raw_linenoiseConn, raw_greenthreshConn, raw_ccStepsConn, raw_methodConn, raw_imagenumConn, raw_dcb_iterationsConn, raw_lmmse_iterationsConn, raw_pixelshiftConn, raw_dcb_enhanceConn, raw_exposConn, raw_preserConn, raw_blackConn; public: PartialPasteDlg (const Glib::ustring &title, Gtk::Window* parent); diff --git a/rtgui/popupcommon.cc b/rtgui/popupcommon.cc index 09feb1c3a..47d9efe66 100644 --- a/rtgui/popupcommon.cc +++ b/rtgui/popupcommon.cc @@ -26,9 +26,9 @@ #include "guiutils.h" PopUpCommon::PopUpCommon (Gtk::Button* thisButton, const Glib::ustring& label) - : selected (-1) // -1 means that the button is invalid + : buttonImage (nullptr) , menu (nullptr) - , buttonImage (nullptr) + , selected (-1) // -1 means that the button is invalid { button = thisButton; hasMenu = false; @@ -107,8 +107,8 @@ void PopUpCommon::entrySelected (int i) void PopUpCommon::setItemSensitivity (int index, bool isSensitive) { const auto items = menu->get_children (); - if (index < items.size ()) { - items[index]->set_sensitive (isSensitive); + if (size_t(index) < items.size ()) { + items[size_t(index)]->set_sensitive (isSensitive); } } diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index 2b7dcc3aa..1e71c23e0 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -295,6 +295,8 @@ void ProfilePanel::save_clicked (GdkEventButton* event) do { if (dialog.run() == Gtk::RESPONSE_OK) { + dialog.hide(); + std::string fname = dialog.get_filename(); Glib::ustring ext = getExtension (fname); diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index b81e8f579..26e4ac565 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -8,7 +8,7 @@ using namespace rtengine; using namespace rtengine::procparams; -Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"), false, true) +Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"), false, true), lastmedianmap(false) { CurveListener::setMulti(true); std::vector defaultCurve; @@ -1513,7 +1513,7 @@ void Retinex::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histL void Retinex::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller) { - float R, G, B; + float R = 0.f, G = 0.f, B = 0.f; if (elemType == ColorCaller::CCET_VERTICAL_BAR) { valY = 0.5; diff --git a/rtgui/shcselector.cc b/rtgui/shcselector.cc index cc22814e6..e8e7f46fa 100644 --- a/rtgui/shcselector.cc +++ b/rtgui/shcselector.cc @@ -204,7 +204,7 @@ void SHCSelector::updateBackBuffer() cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue()); cr->stroke (); } - /* + / * else if (i==litCursor) { // prelight Gdk::RGBA c = style->get_background_color(Gtk::STATE_FLAG_PRELIGHT); diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index b06abe467..deb423569 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -25,7 +25,7 @@ using namespace std; ThumbBrowserBase::ThumbBrowserBase () - : lastClicked(nullptr), previewHeight(options.thumbSize), numOfCols(1), inspector(nullptr), isInspectorActive(false), location(THLOC_FILEBROWSER) + : location(THLOC_FILEBROWSER), inspector(nullptr), isInspectorActive(false), lastClicked(nullptr), previewHeight(options.thumbSize), numOfCols(1) { inW = -1; inH = -1; diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index 1be475d59..2e8a904c1 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -64,7 +64,7 @@ Thumbnail::Thumbnail (CacheManager* cm, const Glib::ustring& fname, CacheImageDa Thumbnail::Thumbnail (CacheManager* cm, const Glib::ustring& fname, const std::string& md5) : fname(fname), cachemgr(cm), ref(1), enqueueNumber(0), tpp(nullptr), pparamsValid(false), - pparamsSet(false), needsReProcessing(true), imageLoading(false), lastImg(nullptr), + needsReProcessing(true), imageLoading(false), lastImg(nullptr), lastW(0), lastH(0), lastScale(0.0), initial_(true) { @@ -198,14 +198,13 @@ const ProcParams& Thumbnail::getProcParamsU () * The loaded profile may be partial, but it return a complete ProcParams (i.e. without ParamsEdited) * * @param returnParams Ask to return a pointer to a ProcParams object if true - * @param forceCPB True if the Custom Profile Builder has to be invoked, False if the CPB has to be invoked if the profile doesn't - * exist yet. It depends on other conditions too + * @param force True if the profile has to be re-generated even if it already exists * @param flaggingMode True if the ProcParams will be created because the file browser is being flagging an image * (rang, to trash, color labels). This parameter is passed to the CPB. * * @return Return a pointer to a ProcPamas structure to be updated if returnParams is true and if everything went fine, NULL otherwise. */ -rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool returnParams, bool forceCPB, bool flaggingMode) +rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool returnParams, bool force, bool flaggingMode) { static int index = 0; // Will act as unique identifier during the session @@ -217,7 +216,7 @@ rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool retu const CacheImageData* cfs = getCacheImageData(); Glib::ustring defaultPparamsPath = options.findProfilePath(defProf); - const bool create = (!hasProcParams() || forceCPB); + const bool create = (!hasProcParams() || force); const Glib::ustring outFName = (options.paramsLoadLocation == PLL_Input) ? @@ -239,6 +238,11 @@ rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool retu if (!err) { loadProcParams(); } + } else if (create && defProf != DEFPROFILE_DYNAMIC) { + const PartialProfile *p = profileStore.getProfile(defProf); + if (p && !p->pparams->save(outFName)) { + loadProcParams(); + } } if (!options.CPBPath.empty() && !defaultPparamsPath.empty() && create && cfs && cfs->exifValid) { diff --git a/rtgui/thumbnail.h b/rtgui/thumbnail.h index 8c7691ed2..eb9e38f7f 100644 --- a/rtgui/thumbnail.h +++ b/rtgui/thumbnail.h @@ -49,7 +49,6 @@ class Thumbnail rtengine::procparams::ProcParams pparams; bool pparamsValid; - bool pparamsSet; bool needsReProcessing; bool imageLoading; @@ -87,7 +86,7 @@ public: const rtengine::procparams::ProcParams& getProcParamsU (); // Unprotected version // Use this to create params on demand for update ; if flaggingMode=true, the procparams is created for a file being flagged (inTrash, rank, colorLabel) - rtengine::procparams::ProcParams* createProcParamsForUpdate (bool returnParams, bool forceCPB, bool flaggingMode = false); + rtengine::procparams::ProcParams* createProcParamsForUpdate (bool returnParams, bool force, bool flaggingMode = false); void setProcParams (const rtengine::procparams::ProcParams& pp, ParamsEdited* pe = nullptr, int whoChangedIt = -1, bool updateCacheNow = true); void clearProcParams (int whoClearedIt = -1); diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 444ba83a5..2d0780e8f 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -325,15 +325,25 @@ ToolPanelCoordinator::~ToolPanelCoordinator () void ToolPanelCoordinator::imageTypeChanged(bool isRaw, bool isBayer, bool isXtrans) { + GThreadLock lock; if(isRaw) { rawPanelSW->set_sensitive(true); if (isBayer) { sensorxtrans->FoldableToolPanel::hide(); sensorbayer->FoldableToolPanel::show(); + preprocess->FoldableToolPanel::show(); + flatfield->FoldableToolPanel::show(); } else if (isXtrans) { sensorxtrans->FoldableToolPanel::show(); sensorbayer->FoldableToolPanel::hide(); + preprocess->FoldableToolPanel::show(); + flatfield->FoldableToolPanel::show(); + } else { + sensorbayer->FoldableToolPanel::hide(); + sensorxtrans->FoldableToolPanel::hide(); + preprocess->FoldableToolPanel::hide(); + flatfield->FoldableToolPanel::hide(); } } else { rawPanelSW->set_sensitive(false); diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index e1d0fc425..ef8c2c5e3 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -2863,7 +2863,7 @@ void Wavelet::tmrToggled () void Wavelet::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller) { - float R, G, B; + float R = 0.f, G = 0.f, B = 0.f; if (elemType == ColorCaller::CCET_VERTICAL_BAR) { valY = 0.5; diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index 362d03a8d..135d30655 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -355,7 +355,6 @@ void WhiteBalance::adjusterChanged (Adjuster* a, double newval) int tVal = (int)temp->getValue(); double gVal = green->getValue(); double eVal = equal->getValue(); - double tempBiasVal = tempBias->getValue(); Gtk::TreeModel::Row row = getActiveMethod(); if (row == refTreeModel->children().end()) {