diff --git a/rtdata/languages/Catala b/rtdata/languages/Catala index ce7e9e378..235f35401 100644 --- a/rtdata/languages/Catala +++ b/rtdata/languages/Catala @@ -1358,6 +1358,7 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1442,6 +1443,8 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !MAIN_MSG_WRITEFAILED;Failed to write\n"%1"\n\nMake sure that the folder exists and that you have write permission to it. !MAIN_TAB_ADVANCED;Advanced !MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: Alt-w +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TOOLTIP_BACKCOLOR3;Background color of the preview: middle grey\nShortcut: 9 !MAIN_TOOLTIP_PREVIEWSHARPMASK;Preview the sharpening contrast mask.\nShortcut: p\n\nOnly works when sharpening is enabled and zoom >= 100%. @@ -2132,6 +2135,7 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !TP_RGBCURVES_LUMAMODE_TOOLTIP;Luminosity mode allows to vary the contribution of R, G and B channels to the luminosity of the image, without altering image color. !TP_SAVEDIALOG_OK_TIP;Shortcut: Ctrl-Enter !TP_SHADOWSHLIGHTS_SHARPMASK;Sharp mask +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_CONTRAST;Contrast threshold !TP_SOFTLIGHT_LABEL;Soft Light diff --git a/rtdata/languages/Chinese (Simplified) b/rtdata/languages/Chinese (Simplified) index f0d50ec3e..ad3104b5f 100644 --- a/rtdata/languages/Chinese (Simplified) +++ b/rtdata/languages/Chinese (Simplified) @@ -1429,6 +1429,7 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1511,6 +1512,8 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !MAIN_MSG_WRITEFAILED;Failed to write\n"%1"\n\nMake sure that the folder exists and that you have write permission to it. !MAIN_TAB_ADVANCED;Advanced !MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: Alt-w +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TOOLTIP_BACKCOLOR0;Background color of the preview: theme-based\nShortcut: 9 !MAIN_TOOLTIP_BACKCOLOR1;Background color of the preview: black\nShortcut: 9 !MAIN_TOOLTIP_BACKCOLOR2;Background color of the preview: white\nShortcut: 9 @@ -2102,6 +2105,7 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !TP_RETINEX_VIEW_TRAN;Transmission - Auto !TP_RETINEX_VIEW_TRAN2;Transmission - Fixed !TP_RETINEX_VIEW_UNSHARP;Unsharp mask +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_CONTRAST;Contrast threshold !TP_SHARPENMICRO_LABEL;Microcontrast diff --git a/rtdata/languages/Chinese (Traditional) b/rtdata/languages/Chinese (Traditional) index b6e4dedbc..8b3c23fbd 100644 --- a/rtdata/languages/Chinese (Traditional) +++ b/rtdata/languages/Chinese (Traditional) @@ -1026,6 +1026,7 @@ TP_WBALANCE_TEMPERATURE;色溫 !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1125,6 +1126,8 @@ TP_WBALANCE_TEMPERATURE;色溫 !MAIN_TAB_DETAIL_TOOLTIP;Shortcut: Alt-d !MAIN_TAB_EXPORT; Fast Export !MAIN_TAB_EXPOSURE_TOOLTIP;Shortcut: Alt-e +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TAB_METADATA_TOOLTIP;Shortcut: Alt-m !MAIN_TAB_RAW;Raw @@ -2067,6 +2070,7 @@ TP_WBALANCE_TEMPERATURE;色溫 !TP_SHARPENEDGE_LABEL;Edges !TP_SHARPENEDGE_PASSES;Iterations !TP_SHARPENEDGE_THREE;Luminance only +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_AMOUNT;Quantity !TP_SHARPENMICRO_CONTRAST;Contrast threshold diff --git a/rtdata/languages/Czech b/rtdata/languages/Czech index 56900e28b..fd61b1ab0 100644 --- a/rtdata/languages/Czech +++ b/rtdata/languages/Czech @@ -2344,3 +2344,11 @@ ZOOMPANEL_ZOOMFITSCREEN;Přizpůsobit celý obrázek obrazovce\nZkratka: Alt< ZOOMPANEL_ZOOMIN;Přiblížit\nZkratka: + ZOOMPANEL_ZOOMOUT;Oddálit\nZkratka: - +!!!!!!!!!!!!!!!!!!!!!!!!! +! Untranslated keys follow; remove the ! prefix after an entry is translated. +!!!!!!!!!!!!!!!!!!!!!!!!! + +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u +!TP_SHARPENING_BLUR;Blur radius diff --git a/rtdata/languages/Dansk b/rtdata/languages/Dansk index 72b795c29..367747256 100644 --- a/rtdata/languages/Dansk +++ b/rtdata/languages/Dansk @@ -1021,6 +1021,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1121,6 +1122,8 @@ TP_WBALANCE_TEMPERATURE;Temperatur !MAIN_TAB_DETAIL_TOOLTIP;Shortcut: Alt-d !MAIN_TAB_EXPORT; Fast Export !MAIN_TAB_EXPOSURE_TOOLTIP;Shortcut: Alt-e +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TAB_METADATA_TOOLTIP;Shortcut: Alt-m !MAIN_TAB_RAW;Raw @@ -2065,6 +2068,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !TP_SHARPENEDGE_LABEL;Edges !TP_SHARPENEDGE_PASSES;Iterations !TP_SHARPENEDGE_THREE;Luminance only +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_AMOUNT;Quantity !TP_SHARPENMICRO_CONTRAST;Contrast threshold diff --git a/rtdata/languages/Deutsch b/rtdata/languages/Deutsch index 4bf12cbed..5ec13a759 100644 --- a/rtdata/languages/Deutsch +++ b/rtdata/languages/Deutsch @@ -2408,3 +2408,11 @@ ZOOMPANEL_ZOOMFITSCREEN;An Bildschirm anpassen.\nTaste: Alt + f ZOOMPANEL_ZOOMIN;Hineinzoomen\nTaste: + ZOOMPANEL_ZOOMOUT;Herauszoomen\nTaste: - +!!!!!!!!!!!!!!!!!!!!!!!!! +! Untranslated keys follow; remove the ! prefix after an entry is translated. +!!!!!!!!!!!!!!!!!!!!!!!!! + +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u +!TP_SHARPENING_BLUR;Blur radius diff --git a/rtdata/languages/English (UK) b/rtdata/languages/English (UK) index edde8946e..db2c57068 100644 --- a/rtdata/languages/English (UK) +++ b/rtdata/languages/English (UK) @@ -865,6 +865,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light !HISTORY_MSG_SOFTLIGHT_STRENGTH;Soft light - Strength @@ -1002,6 +1003,8 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !MAIN_TAB_EXPORT; Fast Export !MAIN_TAB_EXPOSURE;Exposure !MAIN_TAB_EXPOSURE_TOOLTIP;Shortcut: Alt-e +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_FILTER; Filter !MAIN_TAB_INSPECT; Inspect !MAIN_TAB_IPTC;IPTC @@ -2044,6 +2047,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !TP_SHARPENEDGE_PASSES;Iterations !TP_SHARPENEDGE_THREE;Luminance only !TP_SHARPENING_AMOUNT;Amount +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENING_EDRADIUS;Radius !TP_SHARPENING_EDTOLERANCE;Edge tolerance diff --git a/rtdata/languages/English (US) b/rtdata/languages/English (US) index 078989905..dacd13b4f 100644 --- a/rtdata/languages/English (US) +++ b/rtdata/languages/English (US) @@ -776,6 +776,7 @@ !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -915,6 +916,8 @@ !MAIN_TAB_EXPORT; Fast Export !MAIN_TAB_EXPOSURE;Exposure !MAIN_TAB_EXPOSURE_TOOLTIP;Shortcut: Alt-e +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_FILTER; Filter !MAIN_TAB_INSPECT; Inspect !MAIN_TAB_IPTC;IPTC @@ -2034,6 +2037,7 @@ !TP_SHARPENEDGE_PASSES;Iterations !TP_SHARPENEDGE_THREE;Luminance only !TP_SHARPENING_AMOUNT;Amount +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENING_EDRADIUS;Radius !TP_SHARPENING_EDTOLERANCE;Edge tolerance diff --git a/rtdata/languages/Espanol b/rtdata/languages/Espanol index 3260d167c..9cb020dcd 100644 --- a/rtdata/languages/Espanol +++ b/rtdata/languages/Espanol @@ -2459,3 +2459,7 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nTecla de Atajo: - !!!!!!!!!!!!!!!!!!!!!!!!! !CURVEEDITOR_CATMULLROM;Flexible +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u +!TP_SHARPENING_BLUR;Blur radius diff --git a/rtdata/languages/Euskara b/rtdata/languages/Euskara index 6d947cdd9..d763c24e3 100644 --- a/rtdata/languages/Euskara +++ b/rtdata/languages/Euskara @@ -1022,6 +1022,7 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1122,6 +1123,8 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !MAIN_TAB_DETAIL_TOOLTIP;Shortcut: Alt-d !MAIN_TAB_EXPORT; Fast Export !MAIN_TAB_EXPOSURE_TOOLTIP;Shortcut: Alt-e +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TAB_METADATA_TOOLTIP;Shortcut: Alt-m !MAIN_TAB_RAW;Raw @@ -2066,6 +2069,7 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !TP_SHARPENEDGE_LABEL;Edges !TP_SHARPENEDGE_PASSES;Iterations !TP_SHARPENEDGE_THREE;Luminance only +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_AMOUNT;Quantity !TP_SHARPENMICRO_CONTRAST;Contrast threshold diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index 987774546..7f63a8796 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -2333,3 +2333,11 @@ ZOOMPANEL_ZOOMFITSCREEN;Affiche l'image entière\nRaccourci: Alt-f ZOOMPANEL_ZOOMIN;Zoom Avant\nRaccourci: + ZOOMPANEL_ZOOMOUT;Zoom Arrière\nRaccourci: - +!!!!!!!!!!!!!!!!!!!!!!!!! +! Untranslated keys follow; remove the ! prefix after an entry is translated. +!!!!!!!!!!!!!!!!!!!!!!!!! + +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u +!TP_SHARPENING_BLUR;Blur radius diff --git a/rtdata/languages/Greek b/rtdata/languages/Greek index eba373871..94dba53b7 100644 --- a/rtdata/languages/Greek +++ b/rtdata/languages/Greek @@ -1021,6 +1021,7 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1121,6 +1122,8 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !MAIN_TAB_DETAIL_TOOLTIP;Shortcut: Alt-d !MAIN_TAB_EXPORT; Fast Export !MAIN_TAB_EXPOSURE_TOOLTIP;Shortcut: Alt-e +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TAB_METADATA_TOOLTIP;Shortcut: Alt-m !MAIN_TAB_RAW;Raw @@ -2065,6 +2068,7 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !TP_SHARPENEDGE_LABEL;Edges !TP_SHARPENEDGE_PASSES;Iterations !TP_SHARPENEDGE_THREE;Luminance only +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_AMOUNT;Quantity !TP_SHARPENMICRO_CONTRAST;Contrast threshold diff --git a/rtdata/languages/Hebrew b/rtdata/languages/Hebrew index faa279860..4fd30cfc0 100644 --- a/rtdata/languages/Hebrew +++ b/rtdata/languages/Hebrew @@ -1022,6 +1022,7 @@ TP_WBALANCE_TEMPERATURE;מידת חום !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1122,6 +1123,8 @@ TP_WBALANCE_TEMPERATURE;מידת חום !MAIN_TAB_DETAIL_TOOLTIP;Shortcut: Alt-d !MAIN_TAB_EXPORT; Fast Export !MAIN_TAB_EXPOSURE_TOOLTIP;Shortcut: Alt-e +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TAB_METADATA_TOOLTIP;Shortcut: Alt-m !MAIN_TAB_RAW;Raw @@ -2066,6 +2069,7 @@ TP_WBALANCE_TEMPERATURE;מידת חום !TP_SHARPENEDGE_LABEL;Edges !TP_SHARPENEDGE_PASSES;Iterations !TP_SHARPENEDGE_THREE;Luminance only +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_AMOUNT;Quantity !TP_SHARPENMICRO_CONTRAST;Contrast threshold diff --git a/rtdata/languages/Italiano b/rtdata/languages/Italiano index 0c0f66576..0ec22370d 100644 --- a/rtdata/languages/Italiano +++ b/rtdata/languages/Italiano @@ -1605,6 +1605,7 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1681,6 +1682,8 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !MAIN_MSG_TOOMANYOPENEDITORS;Too many open editors.\nPlease close an editor to continue. !MAIN_TAB_ADVANCED;Advanced !MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: Alt-w +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TOOLTIP_BACKCOLOR3;Background color of the preview: middle grey\nShortcut: 9 !MAIN_TOOLTIP_PREVIEWSHARPMASK;Preview the sharpening contrast mask.\nShortcut: p\n\nOnly works when sharpening is enabled and zoom >= 100%. @@ -2141,6 +2144,7 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !TP_RETINEX_VIEW_TRAN;Transmission - Auto !TP_RETINEX_VIEW_TRAN2;Transmission - Fixed !TP_RETINEX_VIEW_UNSHARP;Unsharp mask +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_CONTRAST;Contrast threshold !TP_SOFTLIGHT_LABEL;Soft Light diff --git a/rtdata/languages/Japanese b/rtdata/languages/Japanese index ad8996907..302a2ee75 100644 --- a/rtdata/languages/Japanese +++ b/rtdata/languages/Japanese @@ -2337,3 +2337,11 @@ ZOOMPANEL_ZOOMFITSCREEN;画像全体を画面に合わせる\nショートカッ ZOOMPANEL_ZOOMIN;ズームイン\nショートカット: + ZOOMPANEL_ZOOMOUT;ズームアウト\nショートカット: - +!!!!!!!!!!!!!!!!!!!!!!!!! +! Untranslated keys follow; remove the ! prefix after an entry is translated. +!!!!!!!!!!!!!!!!!!!!!!!!! + +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u +!TP_SHARPENING_BLUR;Blur radius diff --git a/rtdata/languages/Latvian b/rtdata/languages/Latvian index 83fd32895..a15ec130d 100644 --- a/rtdata/languages/Latvian +++ b/rtdata/languages/Latvian @@ -1022,6 +1022,7 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1122,6 +1123,8 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !MAIN_TAB_DETAIL_TOOLTIP;Shortcut: Alt-d !MAIN_TAB_EXPORT; Fast Export !MAIN_TAB_EXPOSURE_TOOLTIP;Shortcut: Alt-e +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TAB_METADATA_TOOLTIP;Shortcut: Alt-m !MAIN_TAB_RAW;Raw @@ -2066,6 +2069,7 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !TP_SHARPENEDGE_LABEL;Edges !TP_SHARPENEDGE_PASSES;Iterations !TP_SHARPENEDGE_THREE;Luminance only +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_AMOUNT;Quantity !TP_SHARPENMICRO_CONTRAST;Contrast threshold diff --git a/rtdata/languages/Magyar b/rtdata/languages/Magyar index d13d6d5a4..19033e458 100644 --- a/rtdata/languages/Magyar +++ b/rtdata/languages/Magyar @@ -1291,6 +1291,7 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1375,6 +1376,8 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !MAIN_MSG_WRITEFAILED;Failed to write\n"%1"\n\nMake sure that the folder exists and that you have write permission to it. !MAIN_TAB_ADVANCED;Advanced !MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: Alt-w +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TOOLTIP_BACKCOLOR0;Background color of the preview: theme-based\nShortcut: 9 !MAIN_TOOLTIP_BACKCOLOR1;Background color of the preview: black\nShortcut: 9 @@ -2124,6 +2127,7 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !TP_RGBCURVES_LUMAMODE_TOOLTIP;Luminosity mode allows to vary the contribution of R, G and B channels to the luminosity of the image, without altering image color. !TP_SAVEDIALOG_OK_TIP;Shortcut: Ctrl-Enter !TP_SHADOWSHLIGHTS_SHARPMASK;Sharp mask +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_CONTRAST;Contrast threshold !TP_SOFTLIGHT_LABEL;Soft Light diff --git a/rtdata/languages/Nederlands b/rtdata/languages/Nederlands index 225b3ecf4..8c91bf3c8 100644 --- a/rtdata/languages/Nederlands +++ b/rtdata/languages/Nederlands @@ -2135,6 +2135,7 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -2185,6 +2186,8 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !MAIN_MSG_TOOMANYOPENEDITORS;Too many open editors.\nPlease close an editor to continue. !MAIN_TAB_ADVANCED;Advanced !MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: Alt-w +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TOOLTIP_BACKCOLOR3;Background color of the preview: middle grey\nShortcut: 9 !MAIN_TOOLTIP_PREVIEWSHARPMASK;Preview the sharpening contrast mask.\nShortcut: p\n\nOnly works when sharpening is enabled and zoom >= 100%. !OPTIONS_BUNDLED_MISSING;The bundled profile "%1" could not be found!\n\nYour installation could be damaged.\n\nDefault internal values will be used instead. @@ -2343,6 +2346,7 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !TP_RETINEX_GAINTRANSMISSION;Gain transmission !TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_MAP;Method +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_CONTRAST;Contrast threshold !TP_SOFTLIGHT_LABEL;Soft Light diff --git a/rtdata/languages/Norsk BM b/rtdata/languages/Norsk BM index 1fd3e18c1..245c3befc 100644 --- a/rtdata/languages/Norsk BM +++ b/rtdata/languages/Norsk BM @@ -1021,6 +1021,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1121,6 +1122,8 @@ TP_WBALANCE_TEMPERATURE;Temperatur !MAIN_TAB_DETAIL_TOOLTIP;Shortcut: Alt-d !MAIN_TAB_EXPORT; Fast Export !MAIN_TAB_EXPOSURE_TOOLTIP;Shortcut: Alt-e +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TAB_METADATA_TOOLTIP;Shortcut: Alt-m !MAIN_TAB_RAW;Raw @@ -2065,6 +2068,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !TP_SHARPENEDGE_LABEL;Edges !TP_SHARPENEDGE_PASSES;Iterations !TP_SHARPENEDGE_THREE;Luminance only +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_AMOUNT;Quantity !TP_SHARPENMICRO_CONTRAST;Contrast threshold diff --git a/rtdata/languages/Polish b/rtdata/languages/Polish index 916ea2b90..d0ac7f833 100644 --- a/rtdata/languages/Polish +++ b/rtdata/languages/Polish @@ -1687,6 +1687,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1763,6 +1764,8 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !MAIN_MSG_TOOMANYOPENEDITORS;Too many open editors.\nPlease close an editor to continue. !MAIN_TAB_ADVANCED;Advanced !MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: Alt-w +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TOOLTIP_BACKCOLOR3;Background color of the preview: middle grey\nShortcut: 9 !MAIN_TOOLTIP_PREVIEWSHARPMASK;Preview the sharpening contrast mask.\nShortcut: p\n\nOnly works when sharpening is enabled and zoom >= 100%. @@ -2147,6 +2150,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !TP_RETINEX_VIEW_TRAN;Transmission - Auto !TP_RETINEX_VIEW_TRAN2;Transmission - Fixed !TP_RETINEX_VIEW_UNSHARP;Unsharp mask +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_CONTRAST;Contrast threshold !TP_SOFTLIGHT_LABEL;Soft Light diff --git a/rtdata/languages/Polish (Latin Characters) b/rtdata/languages/Polish (Latin Characters) index 6b18c604e..b19183f5e 100644 --- a/rtdata/languages/Polish (Latin Characters) +++ b/rtdata/languages/Polish (Latin Characters) @@ -1687,6 +1687,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1763,6 +1764,8 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !MAIN_MSG_TOOMANYOPENEDITORS;Too many open editors.\nPlease close an editor to continue. !MAIN_TAB_ADVANCED;Advanced !MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: Alt-w +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TOOLTIP_BACKCOLOR3;Background color of the preview: middle grey\nShortcut: 9 !MAIN_TOOLTIP_PREVIEWSHARPMASK;Preview the sharpening contrast mask.\nShortcut: p\n\nOnly works when sharpening is enabled and zoom >= 100%. @@ -2147,6 +2150,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !TP_RETINEX_VIEW_TRAN;Transmission - Auto !TP_RETINEX_VIEW_TRAN2;Transmission - Fixed !TP_RETINEX_VIEW_UNSHARP;Unsharp mask +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_CONTRAST;Contrast threshold !TP_SOFTLIGHT_LABEL;Soft Light diff --git a/rtdata/languages/Portugues (Brasil) b/rtdata/languages/Portugues (Brasil) index 1b25b43dc..030e838ec 100644 --- a/rtdata/languages/Portugues (Brasil) +++ b/rtdata/languages/Portugues (Brasil) @@ -2248,8 +2248,11 @@ ZOOMPANEL_ZOOMOUT;Menos Zoom\nAtalho: - !HISTORY_MSG_ICM_OUTPUT_PRIMARIES;Output - Primaries !HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !ICCPROFCREATOR_DESCRIPTION_ADDPARAM;Append gamma and slope values to the description +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !PARTIALPASTE_DEHAZE;Haze removal !PARTIALPASTE_RAWCACORR_AVOIDCOLORSHIFT;CA avoid color shift !PREFERENCES_APPEARANCE;Appearance @@ -2313,5 +2316,6 @@ ZOOMPANEL_ZOOMOUT;Menos Zoom\nAtalho: - !TP_RETINEX_CONTEDIT_MAP;Equalizer !TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. !TP_RETINEX_MAP;Method +!TP_SHARPENING_BLUR;Blur radius !TP_TM_FATTAL_THRESHOLD;Detail !TP_WBALANCE_PICKER;Pick diff --git a/rtdata/languages/Russian b/rtdata/languages/Russian index b440470a3..28231e869 100644 --- a/rtdata/languages/Russian +++ b/rtdata/languages/Russian @@ -1770,6 +1770,7 @@ ZOOMPANEL_ZOOMOUT;Отдалить\nГорячая клавиша: - !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !ICCPROFCREATOR_COPYRIGHT;Copyright: @@ -1814,6 +1815,8 @@ ZOOMPANEL_ZOOMOUT;Отдалить\nГорячая клавиша: - !IPTCPANEL_TRANSREFERENCEHINT;Enter a number or identifier needed for workflow control or tracking. !MAIN_BUTTON_ICCPROFCREATOR;ICC Profile Creator !MAIN_MSG_TOOMANYOPENEDITORS;Too many open editors.\nPlease close an editor to continue. +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TOOLTIP_BACKCOLOR3;Background color of the preview: middle grey\nShortcut: 9 !MAIN_TOOLTIP_PREVIEWSHARPMASK;Preview the sharpening contrast mask.\nShortcut: p\n\nOnly works when sharpening is enabled and zoom >= 100%. !MONITOR_PROFILE_SYSTEM;System default @@ -2158,6 +2161,7 @@ ZOOMPANEL_ZOOMOUT;Отдалить\nГорячая клавиша: - !TP_RETINEX_VIEW_TRAN;Transmission - Auto !TP_RETINEX_VIEW_TRAN2;Transmission - Fixed !TP_RETINEX_VIEW_UNSHARP;Unsharp mask +!TP_SHARPENING_BLUR;Blur radius !TP_WAVELET_1;Level 1 !TP_WAVELET_2;Level 2 !TP_WAVELET_3;Level 3 diff --git a/rtdata/languages/Serbian (Cyrilic Characters) b/rtdata/languages/Serbian (Cyrilic Characters) index d6e357068..29ec6210f 100644 --- a/rtdata/languages/Serbian (Cyrilic Characters) +++ b/rtdata/languages/Serbian (Cyrilic Characters) @@ -1581,6 +1581,7 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1656,6 +1657,8 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !MAIN_MSG_TOOMANYOPENEDITORS;Too many open editors.\nPlease close an editor to continue. !MAIN_TAB_ADVANCED;Advanced !MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: Alt-w +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TOOLTIP_BACKCOLOR3;Background color of the preview: middle grey\nShortcut: 9 !MAIN_TOOLTIP_PREVIEWSHARPMASK;Preview the sharpening contrast mask.\nShortcut: p\n\nOnly works when sharpening is enabled and zoom >= 100%. @@ -2142,6 +2145,7 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !TP_RETINEX_VIEW_TRAN;Transmission - Auto !TP_RETINEX_VIEW_TRAN2;Transmission - Fixed !TP_RETINEX_VIEW_UNSHARP;Unsharp mask +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_CONTRAST;Contrast threshold !TP_SOFTLIGHT_LABEL;Soft Light diff --git a/rtdata/languages/Serbian (Latin Characters) b/rtdata/languages/Serbian (Latin Characters) index 4d833d202..35bbecbf0 100644 --- a/rtdata/languages/Serbian (Latin Characters) +++ b/rtdata/languages/Serbian (Latin Characters) @@ -1581,6 +1581,7 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1656,6 +1657,8 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !MAIN_MSG_TOOMANYOPENEDITORS;Too many open editors.\nPlease close an editor to continue. !MAIN_TAB_ADVANCED;Advanced !MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: Alt-w +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TOOLTIP_BACKCOLOR3;Background color of the preview: middle grey\nShortcut: 9 !MAIN_TOOLTIP_PREVIEWSHARPMASK;Preview the sharpening contrast mask.\nShortcut: p\n\nOnly works when sharpening is enabled and zoom >= 100%. @@ -2142,6 +2145,7 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !TP_RETINEX_VIEW_TRAN;Transmission - Auto !TP_RETINEX_VIEW_TRAN2;Transmission - Fixed !TP_RETINEX_VIEW_UNSHARP;Unsharp mask +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_CONTRAST;Contrast threshold !TP_SOFTLIGHT_LABEL;Soft Light diff --git a/rtdata/languages/Slovak b/rtdata/languages/Slovak index 0ceeab884..ff2051053 100644 --- a/rtdata/languages/Slovak +++ b/rtdata/languages/Slovak @@ -1083,6 +1083,7 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1177,6 +1178,8 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !MAIN_TAB_DETAIL_TOOLTIP;Shortcut: Alt-d !MAIN_TAB_EXPORT; Fast Export !MAIN_TAB_EXPOSURE_TOOLTIP;Shortcut: Alt-e +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TAB_METADATA_TOOLTIP;Shortcut: Alt-m !MAIN_TAB_RAW;Raw @@ -2075,6 +2078,7 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !TP_SHARPENEDGE_LABEL;Edges !TP_SHARPENEDGE_PASSES;Iterations !TP_SHARPENEDGE_THREE;Luminance only +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_AMOUNT;Quantity !TP_SHARPENMICRO_CONTRAST;Contrast threshold diff --git a/rtdata/languages/Suomi b/rtdata/languages/Suomi index 3c3cdc6c5..338107277 100644 --- a/rtdata/languages/Suomi +++ b/rtdata/languages/Suomi @@ -1023,6 +1023,7 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1123,6 +1124,8 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !MAIN_TAB_DETAIL_TOOLTIP;Shortcut: Alt-d !MAIN_TAB_EXPORT; Fast Export !MAIN_TAB_EXPOSURE_TOOLTIP;Shortcut: Alt-e +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TAB_METADATA_TOOLTIP;Shortcut: Alt-m !MAIN_TAB_RAW;Raw @@ -2066,6 +2069,7 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !TP_SHARPENEDGE_LABEL;Edges !TP_SHARPENEDGE_PASSES;Iterations !TP_SHARPENEDGE_THREE;Luminance only +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_AMOUNT;Quantity !TP_SHARPENMICRO_CONTRAST;Contrast threshold diff --git a/rtdata/languages/Swedish b/rtdata/languages/Swedish index 5032496a3..f36493695 100644 --- a/rtdata/languages/Swedish +++ b/rtdata/languages/Swedish @@ -1940,6 +1940,7 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -2015,6 +2016,8 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !MAIN_MSG_TOOMANYOPENEDITORS;Too many open editors.\nPlease close an editor to continue. !MAIN_TAB_ADVANCED;Advanced !MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: Alt-w +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TOOLTIP_BACKCOLOR3;Background color of the preview: middle grey\nShortcut: 9 !MAIN_TOOLTIP_PREVIEWSHARPMASK;Preview the sharpening contrast mask.\nShortcut: p\n\nOnly works when sharpening is enabled and zoom >= 100%. !OPTIONS_BUNDLED_MISSING;The bundled profile "%1" could not be found!\n\nYour installation could be damaged.\n\nDefault internal values will be used instead. @@ -2271,6 +2274,7 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !TP_RETINEX_TRANSMISSION_TOOLTIP;Transmission according to transmission.\nAbscissa: transmission from negative values (min), mean, and positives values (max).\nOrdinate: amplification or reduction. !TP_RETINEX_VIEW_MASK;Mask !TP_RETINEX_VIEW_METHOD_TOOLTIP;Standard - Normal display.\nMask - Displays the mask.\nUnsharp mask - Displays the image with a high radius unsharp mask.\nTransmission - Auto/Fixed - Displays the file transmission-map, before any action on contrast and brightness.\n\nAttention: the mask does not correspond to reality, but is amplified to make it more visible. +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_CONTRAST;Contrast threshold !TP_SOFTLIGHT_LABEL;Soft Light diff --git a/rtdata/languages/Turkish b/rtdata/languages/Turkish index 39302869d..e89df45f0 100644 --- a/rtdata/languages/Turkish +++ b/rtdata/languages/Turkish @@ -1022,6 +1022,7 @@ TP_WBALANCE_TEMPERATURE;Isı !HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift !HISTORY_MSG_RAW_BORDER;Raw border !HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +!HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius !HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold !HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace !HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light @@ -1122,6 +1123,8 @@ TP_WBALANCE_TEMPERATURE;Isı !MAIN_TAB_DETAIL_TOOLTIP;Shortcut: Alt-d !MAIN_TAB_EXPORT; Fast Export !MAIN_TAB_EXPOSURE_TOOLTIP;Shortcut: Alt-e +!MAIN_TAB_FAVORITES;Favorites +!MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u !MAIN_TAB_INSPECT; Inspect !MAIN_TAB_METADATA_TOOLTIP;Shortcut: Alt-m !MAIN_TAB_RAW;Raw @@ -2065,6 +2068,7 @@ TP_WBALANCE_TEMPERATURE;Isı !TP_SHARPENEDGE_LABEL;Edges !TP_SHARPENEDGE_PASSES;Iterations !TP_SHARPENEDGE_THREE;Luminance only +!TP_SHARPENING_BLUR;Blur radius !TP_SHARPENING_CONTRAST;Contrast threshold !TP_SHARPENMICRO_AMOUNT;Quantity !TP_SHARPENMICRO_CONTRAST;Contrast threshold diff --git a/rtdata/languages/default b/rtdata/languages/default index 8c74c43cb..497196c78 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -864,8 +864,14 @@ HISTORY_MSG_608;Local - Color Mask L HISTORY_MSG_609;Local - Exp Mask C HISTORY_MSG_610;Local - Exp Mask L HISTORY_MSG_611;Local - Color Mask H -HISTORY_MSG_612;Local - Use Color Mask -HISTORY_MSG_613;Local - Use Exp Mask +HISTORY_MSG_612;Local - Color Structure +HISTORY_MSG_613;Local - Exp Structure +HISTORY_MSG_614;Local - Exp Mask H +HISTORY_MSG_615;Local - Blend color +HISTORY_MSG_616;Local - Blend Exp +HISTORY_MSG_617;Local - Blur Exp +HISTORY_MSG_618;Local - Use Color Mask +HISTORY_MSG_619;Local - Use Exp Mask HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -1042,8 +1048,6 @@ MAIN_TAB_ADVANCED;Advanced MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: Alt-w MAIN_TAB_COLOR;Color MAIN_TAB_COLOR_TOOLTIP;Shortcut: Alt-c -MAIN_TAB_FAVORITES;Favorites -MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u MAIN_TAB_DETAIL;Detail MAIN_TAB_DETAIL_TOOLTIP;Shortcut: Alt-d MAIN_TAB_DEVELOP; Batch Edit @@ -1051,6 +1055,8 @@ MAIN_TAB_EXIF;Exif MAIN_TAB_EXPORT; Fast Export MAIN_TAB_EXPOSURE;Exposure MAIN_TAB_EXPOSURE_TOOLTIP;Shortcut: Alt-e +MAIN_TAB_FAVORITES;Favorites +MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: Alt-u MAIN_TAB_FILTER; Filter MAIN_TAB_INSPECT; Inspect MAIN_TAB_IPTC;IPTC @@ -1934,8 +1940,10 @@ TP_LOCALLAB_ARTIF;Reduce artifacts - Improve algoritm TP_LOCALLAB_ARTIF_TOOLTIP;Only active for Color-light, Exposure, Retinex, Vibrance, ToneMapping, CBDL. TP_LOCALLAB_AVOID;Avoid color shift TP_LOCALLAB_BILATERAL;Bilateral filter +TP_LOCALLAB_BLENDMASKCOL;Blend TP_LOCALLAB_BLMETHOD_TOOLTIP;Normal - direct blur and noise with all settings.\nInverse - Inverse blur and noise without scope and whithout enhanced algorithm.\nSymmetric - inverse blur and noise with all settings. Be careful some results may be curious TP_LOCALLAB_BLUFR;Blur & Noise +TP_LOCALLAB_BLURDE;Blur Shape detection TP_LOCALLAB_BLNORM;Normal TP_LOCALLAB_BLINV;Inverse TP_LOCALLAB_BLSYM;Symmetric @@ -2038,10 +2046,12 @@ TP_LOCALLAB_SHOWMNONE;None TP_LOCALLAB_SHOWMODIF;Show modifications whithout mask TP_LOCALLAB_SHOWMODIFMASK;Show modifications whith mask TP_LOCALLAB_SHOWMASK;Show mask +TP_LOCALLAB_SHOWSTRUC;Show structure TP_LOCALLAB_USEMASK;Use mask TP_LOCALLAB_SOFT;Soft Light TP_LOCALLAB_STRENG;Strength TP_LOCALLAB_STRENGTH;Noise +TP_LOCALLAB_STRUCCOL;Structure TP_LOCALLAB_STYPE;Shape method TP_LOCALLAB_STYPE_TOOLTIP;You can choose between:\nSymmetrical - left handle linked to right, top handle linked to bottom.\nIndependent - all handles are independent. TP_LOCALLAB_SYMSL;Symmetrical (mouse + sliders) diff --git a/rtengine/curves.cc b/rtengine/curves.cc index dbd07db70..af9c7e78a 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -1054,8 +1054,8 @@ void CurveFactory::complexCurve(double ecomp, double black, double hlcompr, doub //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void CurveFactory::complexCurvelocal(double ecomp, double black, double hlcompr, double hlcomprthresh, - double shcompr, double br, double cont, LUTu & histogram, - LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, LUTf & lightCurveloc, + double shcompr, double br, double cont, LUTu & histogram, double lumare, + LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, LUTf & lightCurveloc, float avg, int skip) { @@ -1124,19 +1124,22 @@ void CurveFactory::complexCurvelocal(double ecomp, double black, double hlcompr, if (cont > 0.00001 || cont < -0.00001) { // compute mean luminance of the image with the curve applied - int sum = 0; - float avg = 0; - - for (int i = 0; i < 32768; i++) { - avg += lightCurveloc[i] * histogram[i]; - sum += histogram[i]; - } +// int sum = 0; +// float avg = 0; +// for (int i = 0; i < 32768; i++) { +// avg += lightCurveloc[i] * histogram[i]; +// sum += histogram[i]; +// } + + int k = avg * 32768; + avg = lightCurveloc[k]; +// printf("avg=%f lumaref=%f\n", avg, lumare/100.f); std::vector contrastcurvePoints; - - if (sum) { - avg /= sum; - + bool lumm = true; + if (lumm) { +// avg /= sum; +// avg = lumare / 100.f; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% contrastcurvePoints.resize(9); contrastcurvePoints.at(0) = double (DCT_NURBS); @@ -1570,6 +1573,55 @@ void LocretigainCurverab::Set(const std::vector &curvePoints) } } +LocHHmaskexpCurve::LocHHmaskexpCurve() : sum(0.f) {}; + +void LocHHmaskexpCurve::Reset() +{ + lutLocHHmaskexpCurve.reset(); + sum = 0.f; +} + + +void LocHHmaskexpCurve::Set(const Curve &pCurve) +{ + if (pCurve.isIdentity()) { + Reset(); // raise this value if the quality suffers from this number of samples + return; + } + + lutLocHHmaskexpCurve(501); // raise this value if the quality suffers from this number of samples + sum = 0.f; + + for (int i = 0; i < 501; i++) { + lutLocHHmaskexpCurve[i] = pCurve.getVal(double (i) / 500.); + + if (lutLocHHmaskexpCurve[i] < 0.02f) { + lutLocHHmaskexpCurve[i] = 0.02f; + } + + sum += lutLocHHmaskexpCurve[i]; + } + + //lutLocHHCurve.dump("wav"); +} + + + +void LocHHmaskexpCurve::Set(const std::vector &curvePoints, bool & lhmasexputili) +{ + // if (HHutili && !curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) { + if (!curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) { + FlatCurve ttcurve(curvePoints, false, CURVES_MIN_POLY_POINTS / 2); + ttcurve.setIdentityValue(0.); + lhmasexputili = true; + Set(ttcurve); + } else { + Reset(); + } +} + + + LocLLmaskexpCurve::LocLLmaskexpCurve() : sum(0.f) {}; void LocLLmaskexpCurve::Reset() @@ -1603,12 +1655,13 @@ void LocLLmaskexpCurve::Set(const Curve &pCurve) -void LocLLmaskexpCurve::Set(const std::vector &curvePoints) +void LocLLmaskexpCurve::Set(const std::vector &curvePoints, bool & llmasexputili) { // if (HHutili && !curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) { if (!curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) { FlatCurve ttcurve(curvePoints, false, CURVES_MIN_POLY_POINTS / 2); ttcurve.setIdentityValue(0.); + llmasexputili = true; Set(ttcurve); } else { Reset(); @@ -1651,12 +1704,13 @@ void LocCCmaskexpCurve::Set(const Curve &pCurve) -void LocCCmaskexpCurve::Set(const std::vector &curvePoints) +void LocCCmaskexpCurve::Set(const std::vector &curvePoints, bool & lcmasexputili) { // if (HHutili && !curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) { if (!curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) { FlatCurve ttcurve(curvePoints, false, CURVES_MIN_POLY_POINTS / 2); ttcurve.setIdentityValue(0.); + lcmasexputili = true; Set(ttcurve); } else { Reset(); @@ -1697,12 +1751,13 @@ void LocHHmaskCurve::Set(const Curve &pCurve) -void LocHHmaskCurve::Set(const std::vector &curvePoints) +void LocHHmaskCurve::Set(const std::vector &curvePoints, bool & lhmasutili) { // if (HHutili && !curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) { if (!curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) { FlatCurve ttcurve(curvePoints, false, CURVES_MIN_POLY_POINTS / 2); ttcurve.setIdentityValue(0.); + lhmasutili = true; Set(ttcurve); } else { Reset(); @@ -1746,12 +1801,13 @@ void LocCCmaskCurve::Set(const Curve &pCurve) -void LocCCmaskCurve::Set(const std::vector &curvePoints) +void LocCCmaskCurve::Set(const std::vector &curvePoints, bool & lcmasutili) { // if (HHutili && !curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) { if (!curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) { FlatCurve ttcurve(curvePoints, false, CURVES_MIN_POLY_POINTS / 2); ttcurve.setIdentityValue(0.); + lcmasutili = true; Set(ttcurve); } else { Reset(); @@ -1791,12 +1847,13 @@ void LocLLmaskCurve::Set(const Curve &pCurve) -void LocLLmaskCurve::Set(const std::vector &curvePoints) +void LocLLmaskCurve::Set(const std::vector &curvePoints, bool & llmasutili) { // if (HHutili && !curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) { if (!curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) { FlatCurve ttcurve(curvePoints, false, CURVES_MIN_POLY_POINTS / 2); ttcurve.setIdentityValue(0.); + llmasutili = true; Set(ttcurve); } else { Reset(); diff --git a/rtengine/curves.h b/rtengine/curves.h index b078d4e68..817c34ccd 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -345,8 +345,8 @@ public: int skip = 1); - static void complexCurvelocal(double ecomp, double black, double hlcompr, double hlcomprthresh, double shcompr, double br, double cont, LUTu & histogram, - LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, LUTf & lightCurveloc, + static void complexCurvelocal(double ecomp, double black, double hlcompr, double hlcomprthresh, double shcompr, double br, double cont, LUTu & histogram, double lumare, + LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, LUTf & lightCurveloc, float avg, int skip = 1); static void curveBW(const std::vector& curvePointsbw, const std::vector& curvePointsbw2, const LUTu & histogrambw, LUTu & outBeforeCCurveHistogrambw, @@ -632,6 +632,35 @@ public: } }; +class LocHHmaskexpCurve +{ +private: + LUTf lutLocHHmaskexpCurve; // 0xffff range + void Set(const Curve &pCurve); + +public: + float sum; + + virtual ~LocHHmaskexpCurve() {}; + LocHHmaskexpCurve(); + void Reset(); + void Set(const std::vector &curvePoints, bool & lhmasexputili); + float getSum() const + { + return sum; + } + + float operator[](float index) const + { + return lutLocHHmaskexpCurve[index]; + } + operator bool (void) const + { + return lutLocHHmaskexpCurve; + } +}; + + class LocCCmaskexpCurve { private: @@ -644,7 +673,7 @@ public: virtual ~LocCCmaskexpCurve() {}; LocCCmaskexpCurve(); void Reset(); - void Set(const std::vector &curvePoints); + void Set(const std::vector &curvePoints, bool & lcmasexputili); float getSum() const { return sum; @@ -672,7 +701,7 @@ public: virtual ~LocLLmaskexpCurve() {}; LocLLmaskexpCurve(); void Reset(); - void Set(const std::vector &curvePoints); + void Set(const std::vector &curvePoints, bool & llmasexputili); float getSum() const { return sum; @@ -700,7 +729,7 @@ public: virtual ~LocHHmaskCurve() {}; LocHHmaskCurve(); void Reset(); - void Set(const std::vector &curvePoints); + void Set(const std::vector &curvePoints, bool & lhmasutili); float getSum() const { return sum; @@ -729,7 +758,7 @@ public: virtual ~LocCCmaskCurve() {}; LocCCmaskCurve(); void Reset(); - void Set(const std::vector &curvePoints); + void Set(const std::vector &curvePoints, bool & lcmasutili); float getSum() const { return sum; @@ -757,7 +786,7 @@ public: virtual ~LocLLmaskCurve() {}; LocLLmaskCurve(); void Reset(); - void Set(const std::vector &curvePoints); + void Set(const std::vector &curvePoints, bool & llmasutili); float getSum() const { return sum; diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 21d86e2b2..4b0e13f14 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -895,6 +895,14 @@ void Crop::update(int todo) LUTu lhist16loc2(32770, 0); bool LHutili = parent->LHutili; bool HHutili = parent->HHutili; + bool llmasutili = parent->llmasutili; + bool lhmasutili = parent->lhmasutili; + bool lcmasutili = parent->lcmasutili; + bool lhmasexputili = parent->lhmasexputili; + bool lcmasexputili = parent->lcmasexputili; + bool llmasexputili = parent->llmasexputili; + + float avg = parent->avg; LUTu dummy; bool needslocal = params.locallab.enabled; LocretigainCurve locRETgainCurve; @@ -905,6 +913,7 @@ void Crop::update(int todo) LocHHmaskCurve lochhmasCurve; LocCCmaskexpCurve locccmasexpCurve; LocLLmaskexpCurve locllmasexpCurve; + LocHHmaskexpCurve lochhmasexpCurve; LocretigainCurverab locRETgainCurverab; locallutili = false; @@ -918,11 +927,12 @@ void Crop::update(int todo) locRETgainCurve.Set(params.locallab.spots.at(sp).localTgaincurve); loclhCurve.Set(params.locallab.spots.at(sp).LHcurve, LHutili); lochhCurve.Set(params.locallab.spots.at(sp).HHcurve, HHutili); - locccmasCurve.Set(params.locallab.spots.at(sp).CCmaskcurve); - locllmasCurve.Set(params.locallab.spots.at(sp).LLmaskcurve); - lochhmasCurve.Set(params.locallab.spots.at(sp).HHmaskcurve); - locccmasexpCurve.Set(params.locallab.spots.at(sp).CCmaskexpcurve); - locllmasexpCurve.Set(params.locallab.spots.at(sp).LLmaskexpcurve); + locccmasCurve.Set(params.locallab.spots.at(sp).CCmaskcurve, lcmasutili); + locllmasCurve.Set(params.locallab.spots.at(sp).LLmaskcurve, llmasutili); + lochhmasCurve.Set(params.locallab.spots.at(sp).HHmaskcurve, lhmasutili); + locccmasexpCurve.Set(params.locallab.spots.at(sp).CCmaskexpcurve, lcmasexputili); + locllmasexpCurve.Set(params.locallab.spots.at(sp).LLmaskexpcurve, llmasexputili); + lochhmasexpCurve.Set(params.locallab.spots.at(sp).HHmaskexpcurve, lhmasexputili); locallutili = false; CurveFactory::curveLocal(locallutili, params.locallab.spots.at(sp).llcurve, lllocalcurve2, sca); localcutili = false; @@ -947,23 +957,32 @@ void Crop::update(int todo) chromare = parent->chromarefs[sp]; lumare = parent->lumarefs[sp]; sobelre = parent->sobelrefs[sp]; - CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lhist16loc2, - hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, + CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lhist16loc2, lumare, + hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, avg, sca); // Locallab mask are only shown for selected spot if (sp == parent->params.locallab.selspot) { - parent->ipf.Lab_Local(1, sp, parent->sobelrefs, (float**)shbuffer, labnCrop, labnCrop, reservCrop, cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, lllocalcurve2, - loclhCurve, lochhCurve, locccmasCurve, locllmasCurve, lochhmasCurve, locccmasexpCurve, locllmasexpCurve, LHutili, HHutili, cclocalcurve2, localskutili, sklocalcurve2, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, huerefblu, huere, chromare, lumare, sobelre, parent->locallColorMask, parent->locallExpMask); + parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop, cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, lllocalcurve2, + loclhCurve, lochhCurve, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, LHutili, HHutili, cclocalcurve2, localskutili, sklocalcurve2, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, huerefblu, huere, chromare, lumare, sobelre, parent->locallColorMask, parent->locallExpMask); } else { - parent->ipf.Lab_Local(1, sp, parent->sobelrefs, (float**)shbuffer, labnCrop, labnCrop, reservCrop, cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, lllocalcurve2, - loclhCurve, lochhCurve, locccmasCurve, locllmasCurve, lochhmasCurve, locccmasexpCurve, locllmasexpCurve, LHutili, HHutili, cclocalcurve2, localskutili, sklocalcurve2, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, huerefblu, huere, chromare, lumare, sobelre, 0, 0); + parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop, cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, lllocalcurve2, + loclhCurve, lochhCurve, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, LHutili, HHutili, cclocalcurve2, localskutili, sklocalcurve2, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, huerefblu, huere, chromare, lumare, sobelre, 0, 0); } lllocalcurve2.clear(); cclocalcurve2.clear(); sklocalcurve2.clear(); exlocalcurve2.clear(); + locRETgainCurve.Reset(); + loclhCurve.Reset(); + lochhCurve.Reset(); + locccmasCurve.Reset(); + locllmasCurve.Reset(); + lochhmasCurve.Reset(); + locllmasexpCurve.Reset(); + locccmasexpCurve.Reset(); + lochhmasexpCurve.Reset(); if (skip <= 2) { usleep(settings->cropsleep); //wait to avoid crash when crop 100% and move window diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 9a80c45f0..02cb3db60 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -27,6 +27,7 @@ #include #include #include +#include "jaggedarray.h" #include "iccstore.h" #include @@ -122,6 +123,7 @@ ImProcCoordinator::ImProcCoordinator() lastspotdup(false), locallColorMask(0), locallExpMask(0), + avg(0), retistrsav(nullptr) {} @@ -774,6 +776,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) float **shbuffer = nullptr; int sca = 1; double huere, chromare, lumare, huerefblu, sobelre; + JaggedArray blend(pW, pH); for (int sp = 0; sp < params.locallab.nbspot && sp < (int)params.locallab.spots.size(); sp++) { // Set local curves of current spot to LUT @@ -783,14 +786,21 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) localexutili = false; localcutili = false; localskutili = false; + llmasutili = false; + lcmasexputili = false; + lhmasexputili = false; + llmasexputili = false; + lhmasutili = false; + lcmasutili = false; locRETgainCurve.Set(params.locallab.spots.at(sp).localTgaincurve); loclhCurve.Set(params.locallab.spots.at(sp).LHcurve, LHutili); lochhCurve.Set(params.locallab.spots.at(sp).HHcurve, HHutili); - locccmasCurve.Set(params.locallab.spots.at(sp).CCmaskcurve); - locllmasCurve.Set(params.locallab.spots.at(sp).LLmaskcurve); - lochhmasCurve.Set(params.locallab.spots.at(sp).HHmaskcurve); - locllmasexpCurve.Set(params.locallab.spots.at(sp).LLmaskexpcurve); - locccmasexpCurve.Set(params.locallab.spots.at(sp).CCmaskexpcurve); + locccmasCurve.Set(params.locallab.spots.at(sp).CCmaskcurve, lcmasutili); + locllmasCurve.Set(params.locallab.spots.at(sp).LLmaskcurve, llmasutili); + lochhmasCurve.Set(params.locallab.spots.at(sp).HHmaskcurve, lhmasutili); + locllmasexpCurve.Set(params.locallab.spots.at(sp).LLmaskexpcurve, llmasexputili); + locccmasexpCurve.Set(params.locallab.spots.at(sp).CCmaskexpcurve, lcmasexputili); + lochhmasexpCurve.Set(params.locallab.spots.at(sp).HHmaskexpcurve, lhmasexputili); CurveFactory::curveLocal(locallutili, params.locallab.spots.at(sp).llcurve, lllocalcurve, sca); CurveFactory::curveCCLocal(localcutili, params.locallab.spots.at(sp).cccurve, cclocalcurve, sca); CurveFactory::curveskLocal(localskutili, params.locallab.spots.at(sp).skintonescurve, sklocalcurve, sca); @@ -804,22 +814,22 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) double cont = params.locallab.spots.at(sp).contrast; lhist16loc.clear(); - // Reference parameters computation if (params.locallab.spots.at(sp).spotMethod == "exc") { - ipf.calc_ref(sp, reserv, reserv, 0, 0, pW, pH, scale, huerefblu, huere, chromare, lumare, sobelre, lhist16loc); + ipf.calc_ref(sp, reserv, reserv, 0, 0, pW, pH, scale, huerefblu, huere, chromare, lumare, sobelre, lhist16loc, avg); } else { - ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, huere, chromare, lumare, sobelre, lhist16loc); + ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, huere, chromare, lumare, sobelre, lhist16loc, avg); } - CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lhist16loc, - hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, - sca); +// printf("improc avg=%f\n", avg); huerblu = huerefblurs[sp] = huerefblu; huer = huerefs[sp] = huere; chromar = chromarefs[sp] = chromare; lumar = lumarefs[sp] = lumare ; sobeler = sobelrefs[sp] = sobelre; + CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lhist16loc, lumar, + hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, avg, + sca); if (locallListener) { locallListener->refChanged(huer, lumar, chromar); @@ -833,13 +843,28 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) */ // Locallab mask are only shown for selected spot if (sp == params.locallab.selspot) { - ipf.Lab_Local(3, sp, sobelrefs, (float**)shbuffer, nprevl, nprevl, reserv, 0, 0, pW, pH, scale, locRETgainCurve, lllocalcurve, loclhCurve, lochhCurve, locccmasCurve, locllmasCurve, lochhmasCurve, locccmasexpCurve, locllmasexpCurve, - LHutili, HHutili, cclocalcurve, localskutili, sklocalcurve, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerblu, huer, chromar, lumar, sobeler, locallColorMask, locallExpMask); + ipf.Lab_Local(3, sp, (float**)shbuffer, nprevl, nprevl, reserv, 0, 0, pW, pH, scale, locRETgainCurve, lllocalcurve, loclhCurve, lochhCurve, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, + LHutili, HHutili, cclocalcurve, localskutili, sklocalcurve, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerblu, huer, chromar, lumar, sobeler, locallColorMask, locallExpMask); } else { - ipf.Lab_Local(3, sp, sobelrefs, (float**)shbuffer, nprevl, nprevl, reserv, 0, 0, pW, pH, scale, locRETgainCurve, lllocalcurve, loclhCurve, lochhCurve, locccmasCurve, locllmasCurve, lochhmasCurve, locccmasexpCurve, locllmasexpCurve, - LHutili, HHutili, cclocalcurve, localskutili, sklocalcurve, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerblu, huer, chromar, lumar, sobeler, 0, 0); + ipf.Lab_Local(3, sp, (float**)shbuffer, nprevl, nprevl, reserv, 0, 0, pW, pH, scale, locRETgainCurve, lllocalcurve, loclhCurve, lochhCurve, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, + LHutili, HHutili, cclocalcurve, localskutili, sklocalcurve, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerblu, huer, chromar, lumar, sobeler, 0, 0); } + lllocalcurve.clear(); + cclocalcurve.clear(); + sklocalcurve.clear(); + exlocalcurve.clear(); + locRETgainCurve.Reset(); + loclhCurve.Reset(); + lochhCurve.Reset(); + locccmasCurve.Reset(); + locllmasCurve.Reset(); + lochhmasCurve.Reset(); + locllmasexpCurve.Reset(); + locccmasexpCurve.Reset(); + lochhmasexpCurve.Reset(); + + /* if (params.locallab.spots.at(sp).spotMethod == "exc") { ipf.calc_ref(sp, reserv, reserv, 0, 0, pW, pH, scale, huerefblu, huere, chromare, lumare, sobelre, lhist16loc); } else { @@ -851,7 +876,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) cclocalcurve.clear(); sklocalcurve.clear(); exlocalcurve.clear(); + */ } + /* for (int sp = 0; sp < params.locallab.nbspot && sp < (int)params.locallab.spots.size(); sp++) { //update references after threatment if (params.locallab.spots.at(sp).spotMethod == "exc") { @@ -864,7 +891,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) chromar = chromarefs[sp] = chromare; lumar = lumarefs[sp] = lumare ; sobeler = sobelrefs[sp] = sobelre; + } + */ } //************************************************************* diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 661be70c9..205798dff 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -240,11 +240,18 @@ protected: LocHHmaskCurve lochhmasCurve; LocCCmaskexpCurve locccmasexpCurve; LocLLmaskexpCurve locllmasexpCurve; + LocHHmaskexpCurve lochhmasexpCurve; ProcParams nextParams2; bool locallutili; bool localcutili; bool localskutili; bool localexutili; + bool llmasutili; + bool lhmasutili; + bool lcmasutili; + bool lcmasexputili; + bool lhmasexputili; + bool llmasexputili; bool LHutili; bool HHutili; LUTf huerefs; @@ -256,6 +263,7 @@ protected: bool lastspotdup; int locallColorMask; int locallExpMask; + float avg; public: diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 15f47e350..552ceb7e1 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -286,10 +286,10 @@ public: //locallab void MSRLocal(int sp, float** luminance, float** templ, const float* const *originalLuminance, const int width, const int height, const LocallabParams &loc, const int skip, const LocretigainCurve &locRETgainCcurve, const int chrome, const int scall, const float krad, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax); // void calc_ref (LabImage* original, LabImage* transformed, int cx, int cy, int oW, int oH, int sk, double &huere, double &chromare, double &lumare, double &sobelref); - void calc_ref(int sp, LabImage* original, LabImage* transformed, int cx, int cy, int oW, int oH, int sk, double &huerefblur, double &huere, double &chromare, double &lumare, double &sobelref, LUTu & histogram); + void calc_ref(int sp, LabImage* original, LabImage* transformed, int cx, int cy, int oW, int oH, int sk, double &huerefblur, double &huere, double &chromare, double &lumare, double &sobelref, LUTu & histogram, float &avg); void copy_ref(LabImage* spotbuffer, LabImage* original, LabImage* transformed, int cx, int cy, int sk, const struct local_params & lp, double &huerefspot, double &chromarefspot, double &lumarefspot); void paste_ref(LabImage* spotbuffer, LabImage* transformed, int cx, int cy, int sk, const struct local_params & lp); - void Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbuffer, LabImage* original, LabImage* transformed, LabImage* reserved, int cx, int cy, int oW, int oH, int sk, const LocretigainCurve & locRETgainCcurve, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, const LocCCmaskCurve & locccmasCurve, const LocLLmaskCurve & locllmasCurve, const LocHHmaskCurve & lochhmasCurve, const LocCCmaskexpCurve & locccmasexpCurve, const LocLLmaskexpCurve & locllmasexpCurve, bool &LHutili, bool &HHutili, LUTf & cclocalcurve, bool & localskutili, LUTf & sklocalcurve, bool & localexutili, LUTf & exlocalcurve, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, LUTf & lightCurveloc, double & huerefblur, double &hueref, double &chromaref, double &lumaref, double &sobelref, int llColorMask, int llExpMask); + void Lab_Local(int call, int sp, float** shbuffer, LabImage* original, LabImage* transformed, LabImage* reserved, int cx, int cy, int oW, int oH, int sk, const LocretigainCurve & locRETgainCcurve, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, const LocCCmaskCurve & locccmasCurve, bool & lcmasutili, const LocLLmaskCurve & locllmasCurve, bool & llmasutili, const LocHHmaskCurve & lochhmasCurve, bool & lhmasutili, const LocCCmaskexpCurve & locccmasexpCurve, bool &lcmasexputili, const LocLLmaskexpCurve & locllmasexpCurve, bool &llmasexputili, const LocHHmaskexpCurve & lochhmasexpCurve, bool & lhmasexputili, bool &LHutili, bool &HHutili, LUTf & cclocalcurve, bool & localskutili, LUTf & sklocalcurve, bool & localexutili, LUTf & exlocalcurve, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, LUTf & lightCurveloc, double & huerefblur, double &hueref, double &chromaref, double &lumaref, double &sobelref, int llColorMask, int llExpMask); void addGaNoise(LabImage *lab, LabImage *dst, const float mean, const float variance, const int sk); void BlurNoise_Localold(int call, const struct local_params& lp, LabImage* original, LabImage* transformed, const LabImage* const tmp1, int cx, int cy); void InverseBlurNoise_Local(const struct local_params& lp, LabImage* original, LabImage* transformed, const LabImage* const tmp1, int cx, int cy); @@ -302,7 +302,7 @@ public: void vibrancelocal(int sp, int bfw, int bfh, LabImage* lab, LabImage* dest, bool & localskutili, LUTf & sklocalcurve); // void Expo_vibr_Local(float moddE, float powdE, int senstype, float **buflight, float **bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, const LabImage * const tmp1, int cx, int cy, int sk); - void Expo_vibr_Local(float moddE, float powdE, int senstype, LabImage * originalmask, float **buflight, float **bufchro, float **buf_a_cat, float ** buf_b_cat, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, LabImage * difLab, const LabImage * const tmp1, int cx, int cy, int sk); + void Expo_vibr_Local(int senstype, LabImage * bufexporig, LabImage * originalmask, float **buflight, float **bufchro, float **buf_a_cat, float ** buf_b_cat, const float hueref, const float chromaref, const float lumaref, float sobelref, float ** blend2, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); void exlabLocal(const local_params& lp, int bfh, int bfw, LabImage* bufexporig, LabImage* lab, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve); void Exclude_Local(float moddE, float powdE, int sen, float **deltaso, float **buflight, float **bufchro, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, LabImage * rsv, LabImage * reserv, int cx, int cy, int sk); @@ -311,7 +311,7 @@ public: void fftw_denoise(int GW, int GH, int max_numblox_W, int min_numblox_W, float **tmp1, array2D *Lin, int numThreads, const struct local_params & lp, int chrom); - void ColorLight_Local(float moddE, float powdE, int call, LabImage * bufcolorig, LabImage * originalmask, float **buflight, float **bufchro, float **bufchroslid, float ** bufhh, float ** buflightslid, bool &LHutili, bool &HHutili, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, LUTf & lightCurveloc, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy, int sk); + void ColorLight_Local(float moddE, float powdE, int call, LabImage * bufcolorig, LabImage * originalmask, float **buflight, float **bufchro, float **bufchroslid, float ** bufhh, float ** buflightslid, bool &LHutili, bool &HHutili, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, float sobelref, float ** blend2, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, LUTf & lightCurveloc, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy, int sk); void InverseColorLight_Local(const struct local_params& lp, LUTf & lightCurveloc, LabImage* original, LabImage* transformed, int cx, int cy, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, int sk); void Sharp_Local(int call, float **loctemp, int senstype, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy, int sk); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index bbb64ac4c..c6043010b 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -157,8 +157,14 @@ struct local_params { float thr; int prox; int chro, cont, sens, sensh, senscb, sensbn, senstm, sensex, sensexclu, sensden, senslc, senssf; + float struco; + float blendmacol; + float blendmaexp; + float struexp; + float blurexp; float ligh; int shamo, shdamp, shiter, senssha, sensv; + float neig; float strng; float lcamount; double shrad; @@ -361,7 +367,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall double local_dyy = locallab.spots.at(sp).iter / 8000.0; float iterati = (float) locallab.spots.at(sp).iter; // double local_dyy = locallab.proxi; - + float neigh = float (locallab.spots.at(sp).neigh); float chromaPastel = float (locallab.spots.at(sp).pastels) / 100.0f; float chromaSatur = float (locallab.spots.at(sp).saturated) / 100.0f; int local_sensiv = locallab.spots.at(sp).sensiv; @@ -445,6 +451,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall int local_sensicb = locallab.spots.at(sp).sensicb; int local_contrast = locallab.spots.at(sp).contrast; float local_lightness = (float) locallab.spots.at(sp).lightness; + float structcolor = (float) locallab.spots.at(sp).structcol; + float blendmaskcolor = ((float) locallab.spots.at(sp).blendmaskcol) / 100.f ; + float blendmaskexpo = ((float) locallab.spots.at(sp).blendmaskexp) / 100.f ; + float structexpo = (float) locallab.spots.at(sp).structexp; + float blurexpo = (float) locallab.spots.at(sp).blurexpde; int local_transit = locallab.spots.at(sp).transit; double radius = (double) locallab.spots.at(sp).radius; double sharradius = ((double) locallab.spots.at(sp).sharradius) / 100. ; @@ -479,6 +490,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lxL = w * local_xL; lp.lyT = h * local_yT; lp.chro = local_chroma; + lp.struco = structcolor; + lp.blendmacol = blendmaskcolor; + lp.blendmaexp = blendmaskexpo; + lp.struexp = structexpo; + lp.blurexp = blurexpo; lp.sens = local_sensi; lp.sensh = local_sensih; lp.dehaze = local_dehaze; @@ -487,6 +503,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.ligh = local_lightness; lp.senssf = local_sensisf; lp.strng = strlight; + lp.neig = neigh; if (lp.ligh >= -2.f && lp.ligh <= 2.f) { lp.ligh /= 5.f; @@ -723,57 +740,6 @@ static void calcTransitioninv (const float lox, const float loy, const float ach } */ -void ImProcFunctions::strcurv_data(std::string retistr, int *s_datc, int &siz) -{ - //strange function I create to manage curve !! - 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", - "&", "#", "{", "[", "]", "}", "$", "*", "?", ">", "!", ";", "<", "(", ")", "+", "-" - }; - - int s_size; - std::size_t posend = retistr.find("@"); - - std::string strend = retistr.substr(posend - 1, 1); - int longe = 0; - - for (int sl = 0; sl < 69; sl++) { - if (delim[sl] == strend) { - longe = sl + 1; - } - } - - s_size = longe; - - int s_datcu[s_size + 1]; - - std::size_t pose[s_size + 1]; - pose[0] = -1; - - for (int z = 1; z < s_size + 1; z++) { - pose[z] = retistr.find(delim[z - 1]); - } - - - for (int z = 1; z < s_size + 1; z++) { - std::string sval = retistr.substr(pose[z - 1] + 1, (pose[z] - pose[z - 1])); - s_datc[z - 1] = s_datcu[z - 1] = std::stoi(sval.c_str()); - - } - - /* - //here to verify process is good - std::string cur_str = ""; - - for(int j = 0; j < s_size; j++) { - cur_str = cur_str + std::to_string(s_datcu[j]) + delim[j]; - } - printf("calc str=%s\n", cur_str.c_str()); - */ - siz = longe; - -} - void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, LabImage* dest) { //be carefull quasi duplicate with branch cat02wb @@ -997,7 +963,7 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, LabImage* dest) Ciecam02::jch2xyz_ciecam02float(xx, yy, zz, J, C, h, xw2, yw2, zw2, - f2, c2, nc2, pow1n, nbbj, ncbj, flj, czj, dj, awj); + c2, nc2, pow1n, nbbj, ncbj, flj, czj, dj, awj); float x, y, z; x = xx * 655.35f; y = yy * 655.35f; @@ -2085,9 +2051,9 @@ void ImProcFunctions::DeNoise_Local(int call, const struct local_params& lp, in difL *= factorx * khu; difa *= factorx * khu; difb *= factorx * khu; - transformed->L[y][x] = original->L[y][x] + difL; - transformed->a[y][x] = (original->a[y][x] + difa) * factnoise1 * factnoise2; - transformed->b[y][x] = (original->b[y][x] + difb) * factnoise1 * factnoise2 ; + transformed->L[y][x] = CLIP(original->L[y][x] + difL); + transformed->a[y][x] = CLIPC((original->a[y][x] + difa) * factnoise1 * factnoise2); + transformed->b[y][x] = CLIPC((original->b[y][x] + difb) * factnoise1 * factnoise2) ; break; } @@ -2109,9 +2075,9 @@ void ImProcFunctions::DeNoise_Local(int call, const struct local_params& lp, in difa *= khu; difb *= khu; - transformed->L[y][x] = original->L[y][x] + difL; - transformed->a[y][x] = (original->a[y][x] + difa) * factnoise1 * factnoise2; - transformed->b[y][x] = (original->b[y][x] + difb) * factnoise1 * factnoise2; + transformed->L[y][x] = CLIP(original->L[y][x] + difL); + transformed->a[y][x] = CLIPC((original->a[y][x] + difa) * factnoise1 * factnoise2); + transformed->b[y][x] = CLIPC((original->b[y][x] + difb) * factnoise1 * factnoise2); } } @@ -2499,7 +2465,7 @@ void ImProcFunctions::cbdl_Local(float moddE, float powdE, float ** buflight, fl difL = loctemp[loy - begy][lox - begx] * fli * falL - original->L[y][x]; difL *= factorx; - transformed->L[y][x] = original->L[y][x] + difL * kch * fach; + transformed->L[y][x] = CLIP(original->L[y][x] + difL * kch * fach); } if (chro == 1) { @@ -2526,7 +2492,7 @@ void ImProcFunctions::cbdl_Local(float moddE, float powdE, float ** buflight, fl if (chro == 0) { difL = loctemp[loy - begy][lox - begx] * fli * falL - original->L[y][x]; - transformed->L[y][x] = original->L[y][x] + difL * kch * fach; + transformed->L[y][x] = CLIP(original->L[y][x] + difL * kch * fach); } if (chro == 1) { @@ -2896,11 +2862,11 @@ void ImProcFunctions::TM_Local(float moddE, float powdE, LabImage * tmp1, float difa *= factorx; difb *= factorx; - transformed->L[y][x] = original->L[y][x] + difL * kch * fach; + transformed->L[y][x] = CLIP(original->L[y][x] + difL * kch * fach); - transformed->a[y][x] = original->a[y][x] + difa * kch * fach * falu;//same as Luma - transformed->b[y][x] = original->b[y][x] + difb * kch * fach * falu;//same as Luma + transformed->a[y][x] = CLIPC(original->a[y][x] + difa * kch * fach * falu);//same as Luma + transformed->b[y][x] = CLIPC(original->b[y][x] + difb * kch * fach * falu);//same as Luma break; } @@ -2912,11 +2878,11 @@ void ImProcFunctions::TM_Local(float moddE, float powdE, LabImage * tmp1, float difa = tmp1->a[loy - begy][lox - begx] - original->a[y][x]; difb = tmp1->b[loy - begy][lox - begx] - original->b[y][x]; - transformed->L[y][x] = original->L[y][x] + difL * kch * fach; + transformed->L[y][x] = CLIP(original->L[y][x] + difL * kch * fach); - transformed->a[y][x] = original->a[y][x] + difa * kch * fach * falu;//same as Luma - transformed->b[y][x] = original->b[y][x] + difb * kch * fach * falu;//same as Luma + transformed->a[y][x] = CLIPC(original->a[y][x] + difa * kch * fach * falu);//same as Luma + transformed->b[y][x] = CLIPC(original->b[y][x] + difb * kch * fach * falu);//same as Luma } } @@ -3307,11 +3273,11 @@ void ImProcFunctions::BlurNoise_Local(float moddE, float powdE, int call, LabIma difL *= kch * fach; if (lp.blurmet == 0) { - transformed->L[y][x] = original->L[y][x] + difL; + transformed->L[y][x] = CLIP(original->L[y][x] + difL); } if (lp.blurmet == 2) { - transformed->L[y][x] = tmp2->L[y][x] - difL; + transformed->L[y][x] = CLIP(tmp2->L[y][x] - difL); } if (!lp.actsp) { @@ -3352,11 +3318,11 @@ void ImProcFunctions::BlurNoise_Local(float moddE, float powdE, int call, LabIma difL *= kch * fach; if (lp.blurmet == 0) { - transformed->L[y][x] = original->L[y][x] + difL; + transformed->L[y][x] = CLIP(original->L[y][x] + difL); } if (lp.blurmet == 2) { - transformed->L[y][x] = tmp2->L[y][x] - difL; + transformed->L[y][x] = CLIP(tmp2->L[y][x] - difL); } if (!lp.actsp) { @@ -3411,13 +3377,13 @@ void ImProcFunctions::InverseReti_Local(const struct local_params & lp, LabImage switch (zone) { case 0: { // outside selection and outside transition zone => full effect, no transition if (chro == 0) { - transformed->L[y][x] = tmp1->L[y][x]; + transformed->L[y][x] = CLIP(tmp1->L[y][x]); } if (chro == 1) { - transformed->a[y][x] = tmp1->a[y][x]; - transformed->b[y][x] = tmp1->b[y][x]; + transformed->a[y][x] = CLIPC(tmp1->a[y][x]); + transformed->b[y][x] = CLIPC(tmp1->b[y][x]); } break; @@ -3429,7 +3395,7 @@ void ImProcFunctions::InverseReti_Local(const struct local_params & lp, LabImage if (chro == 0) { float difL = tmp1->L[y][x] - original->L[y][x]; difL *= factorx; - transformed->L[y][x] = original->L[y][x] + difL; + transformed->L[y][x] = CLIP(original->L[y][x] + difL); } if (chro == 1) { @@ -3439,8 +3405,8 @@ void ImProcFunctions::InverseReti_Local(const struct local_params & lp, LabImage difa *= factorx; difb *= factorx; - transformed->a[y][x] = original->a[y][x] + difa; - transformed->b[y][x] = original->b[y][x] + difb; + transformed->a[y][x] = CLIPC(original->a[y][x] + difa); + transformed->b[y][x] = CLIPC(original->b[y][x] + difb); } break; @@ -3869,62 +3835,63 @@ void ImProcFunctions::Reti_Local(float moddE, float powdE, float **buflight, flo float factorx = localFactor; if (chro == 0) { - float difL; - - difL = tmp1->L[loy - begy][lox - begx] - original->L[y][x]; - difL *= factorx * (100.f + realstr * falL) / 100.f; - difL *= kch * fach; - - transformed->L[y][x] = original->L[y][x] + difL; + float lightc = tmp1->L[loy - begy][lox - begx]; + float fli = 1.f; + fli = ((100.f + realstr * falL) / 100.f); + float diflc = lightc * fli - original->L[y][x]; + diflc *= kch * fach; + diflc *= factorx; + transformed->L[y][x] = CLIP(original->L[y][x] + diflc); } if (chro == 1) { - float difa, difb; + float flia = 1.f; + float flib = 1.f; + float chra = tmp1->a[loy - begy][lox - begx]; + float chrb = tmp1->b[loy - begy][lox - begx]; - difa = tmp1->a[loy - begy][lox - begx] - original->a[y][x]; - difb = tmp1->b[loy - begy][lox - begx] - original->b[y][x]; - difa *= factorx * (100.f + realstrch * falu * falL) / 100.f; - difb *= factorx * (100.f + realstrch * falu * falL) / 100.f; + flia = ((100.f + realstrch * falu * falL) / 100.f); + flib = ((100.f + realstrch * falu * falL) / 100.f); + float difa = chra * flia - original->a[y][x]; + float difb = chrb * flib - original->b[y][x]; + difa *= factorx; + difb *= factorx; difa *= kch * fach; difb *= kch * fach; transformed->a[y][x] = CLIPC(original->a[y][x] + difa); transformed->b[y][x] = CLIPC(original->b[y][x] + difb); - } break; - } case 2: { // inside selection => full effect, no transition if (chro == 0) { - float difL; - - difL = tmp1->L[loy - begy][lox - begx] - original->L[y][x]; - difL *= (100.f + realstr * falL) / 100.f; - difL *= kch * fach; - transformed->L[y][x] = original->L[y][x] + difL; - + float lightc = tmp1->L[loy - begy][lox - begx]; + float fli = 1.f; + fli = ((100.f + realstr * falL) / 100.f); + float diflc = lightc * fli - original->L[y][x]; + diflc *= kch * fach; + transformed->L[y][x] = CLIP(original->L[y][x] + diflc); } if (chro == 1) { - float difa, difb; + float flia = 1.f; + float flib = 1.f; + float chra = tmp1->a[loy - begy][lox - begx]; + float chrb = tmp1->b[loy - begy][lox - begx]; - difa = tmp1->a[loy - begy][lox - begx] - original->a[y][x]; - difb = tmp1->b[loy - begy][lox - begx] - original->b[y][x]; - difa *= (100.f + realstrch * falu * falL) / 100.f; - difb *= (100.f + realstrch * falu * falL) / 100.f; + flia = ((100.f + realstrch * falu * falL) / 100.f); + flib = ((100.f + realstrch * falu * falL) / 100.f); + float difa = chra * flia - original->a[y][x]; + float difb = chrb * flib - original->b[y][x]; difa *= kch * fach; difb *= kch * fach; - transformed->a[y][x] = CLIPC(original->a[y][x] + difa); transformed->b[y][x] = CLIPC(original->b[y][x] + difb); - } } } - - //} } } } @@ -3959,11 +3926,11 @@ void ImProcFunctions::InverseBlurNoise_Local(const struct local_params & lp, Lab switch (zone) { case 0: { // outside selection and outside transition zone => full effect, no transition - transformed->L[y][x] = tmp1->L[y][x]; + transformed->L[y][x] = CLIP(tmp1->L[y][x]); if (!lp.actsp) { - transformed->a[y][x] = tmp1->a[y][x]; - transformed->b[y][x] = tmp1->b[y][x]; + transformed->a[y][x] = CLIPC(tmp1->a[y][x]); + transformed->b[y][x] = CLIPC(tmp1->b[y][x]); } break; @@ -3979,12 +3946,12 @@ void ImProcFunctions::InverseBlurNoise_Local(const struct local_params & lp, Lab difa *= factorx; difb *= factorx; - transformed->L[y][x] = original->L[y][x] + difL; + transformed->L[y][x] = CLIP(original->L[y][x] + difL); if (!lp.actsp) { - transformed->a[y][x] = original->a[y][x] + difa; - transformed->b[y][x] = original->b[y][x] + difb; + transformed->a[y][x] = CLIPC(original->a[y][x] + difa); + transformed->b[y][x] = CLIPC(original->b[y][x] + difb); } break; @@ -4236,7 +4203,7 @@ void ImProcFunctions::InverseSharp_Local(float **loctemp, const float hueplus, c switch (zone) { case 0: { // outside selection and outside transition zone => full effect, no transition float difL = loctemp[y][x] - original->L[y][x]; - transformed->L[y][x] = original->L[y][x] + difL * kch * fach; + transformed->L[y][x] = CLIP(original->L[y][x] + difL * kch * fach); break; } @@ -4247,7 +4214,7 @@ void ImProcFunctions::InverseSharp_Local(float **loctemp, const float hueplus, c float factorx = 1.f - localFactor; difL *= factorx; - transformed->L[y][x] = original->L[y][x] + difL * kch * fach; + transformed->L[y][x] = CLIP(original->L[y][x] + difL * kch * fach); break; } @@ -4497,7 +4464,7 @@ void ImProcFunctions::Sharp_Local(int call, float **loctemp, int senstype, cons } difL *= factorx; - transformed->L[y][x] = original->L[y][x] + difL * kch * fach; + transformed->L[y][x] = CLIP(original->L[y][x] + difL * kch * fach); break; } @@ -4511,13 +4478,13 @@ void ImProcFunctions::Sharp_Local(int call, float **loctemp, int senstype, cons difL = loctemp[y][x] - original->L[y][x]; } - transformed->L[y][x] = original->L[y][x] + difL * kch * fach; + transformed->L[y][x] = CLIP(original->L[y][x] + difL * kch * fach); } } } } } - delete origblur; + delete origblur; } @@ -4947,7 +4914,7 @@ void ImProcFunctions::Exclude_Local(float moddE, float powdE, int sen, float **d if (deltaso[loy - begy][lox - begx] == 0.f) { transformed->L[y][x] = original->L[y][x]; //orsv->L[loy - begy][lox - begx]; } else { - transformed->L[y][x] = original->L[y][x] + difL; + transformed->L[y][x] = CLIP(original->L[y][x] + difL); } float difa, difb; @@ -4982,7 +4949,7 @@ void ImProcFunctions::Exclude_Local(float moddE, float powdE, int sen, float **d // printf ("0"); transformed->L[y][x] = original->L[y][x]; //rsv->L[loy - begy][lox - begx]; } else { - transformed->L[y][x] = original->L[y][x] + difL; + transformed->L[y][x] = CLIP(original->L[y][x] + difL); } // transformed->L[y][x] = original->L[y][x] + difL; @@ -5019,7 +4986,7 @@ void ImProcFunctions::Exclude_Local(float moddE, float powdE, int sen, float **d } -void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, LabImage * originalmask, float **buflight, float **bufchro, float **buf_a_cat, float ** buf_b_cat, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, LabImage * difLab, const LabImage * const tmp1, int cx, int cy, int sk) +void ImProcFunctions::Expo_vibr_Local(int senstype, LabImage * bufexporig, LabImage * originalmask, float **buflight, float **bufchro, float **buf_a_cat, float ** buf_b_cat, const float hueref, const float chromaref, const float lumaref, float sobelref, float ** blend2, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk) { //local exposure and vibrance @@ -5042,45 +5009,22 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La varsens = lp.senssf; } - //chroma - constexpr float amplchsens = 2.5f; - constexpr float achsens = (amplchsens - 1.f) / (100.f - 20.f); //20. default locallab.sensih - constexpr float bchsens = 1.f - 20.f * achsens; - const float multchro = varsens * achsens + bchsens; + // printf("varsen=%f \n", varsens); + //sobel + sobelref /= 100.; - //luma + if (sobelref > 60.) + { + sobelref = 60.; + } - //skin - constexpr float amplchsensskin = 1.6f; - constexpr float achsensskin = (amplchsensskin - 1.f) / (100.f - 20.f); //20. default locallab.sensih - constexpr float bchsensskin = 1.f - 20.f * achsensskin; - const float multchroskin = varsens * achsensskin + bchsensskin; - - - constexpr float delhu = 0.05f; //between 0.05 and 0.2 - - const float apl = (-1.f) / delhu; - const float bpl = - apl * hueplus; - const float amo = 1.f / delhu; - const float bmo = - amo * huemoins; - - - const float pb = 4.f; - const float pa = (1.f - pb) / 40.f; - float refa = chromaref * cos(hueref); - float refb = chromaref * sin(hueref); - -// const float moddE = 2.f; - - const float ahu = 1.f / (2.8f * varsens - 280.f); - const float bhu = 1.f - ahu * 2.8f * varsens; - - const float alum = 1.f / (varsens - 100.f); - const float blum = 1.f - alum * varsens; + sobelref = log(1.f + sobelref); int GW = transformed->W; int GH = transformed->H; + float refa = chromaref * cos(hueref); + float refb = chromaref * sin(hueref); LabImage *origblur = nullptr; @@ -5088,20 +5032,24 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La origblur = new LabImage(GW, GH); LabImage *origblurmask = nullptr; - float radius = 3.f / sk; - bool usemask = (lp.showmaskexpmet >= 2 || lp.enaExpMask) && senstype == 1; - if (usemask) { - origblurmask = new LabImage(GW, GH); + float radius = (2.f + 0.2f * lp.blurexp) / sk; + + bool usemask = (lp.showmaskexpmet == 2 || lp.enaExpMask) && senstype == 1; + + if (usemask) + { + origblurmask = new LabImage(GW, GH); #ifdef _OPENMP - #pragma omp parallel + #pragma omp parallel #endif - { - gaussianBlur(originalmask->L, origblurmask->L, GW, GH, radius); - gaussianBlur(originalmask->a, origblurmask->a, GW, GH, radius); - gaussianBlur(originalmask->b, origblurmask->b, GW, GH, radius); + { + gaussianBlur(originalmask->L, origblurmask->L, GW, GH, radius); + gaussianBlur(originalmask->a, origblurmask->a, GW, GH, radius); + gaussianBlur(originalmask->b, origblurmask->b, GW, GH, radius); + } } - } + #ifdef _OPENMP #pragma omp parallel #endif @@ -5134,9 +5082,6 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La const bool isZone0 = loy > lp.yc + lp.ly || loy < lp.yc - lp.lyT; // whole line is zone 0 => we can skip a lot of processing if (isZone0) { // outside selection and outside transition zone => no effect, keep original values - for (int x = 0; x < transformed->W; x++) { - transformed->L[y][x] = original->L[y][x]; - } continue; } @@ -5174,32 +5119,36 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La if (zone == 0) { // outside selection and outside transition zone => no effect, keep original values - transformed->L[y][x] = original->L[y][x]; + // transformed->L[y][x] = original->L[y][x]; continue; } -#ifdef __SSE2__ - float rhue = atan2Buffer[x]; - float rchro = sqrtBuffer[x]; -#else - float rhue = xatan2f(origblur->b[y][x], origblur->a[y][x]); - float rchro = sqrt(SQR(origblur->b[y][x]) + SQR(origblur->a[y][x])) / 327.68f; -#endif float rL = origblur->L[y][x] / 327.68f; - float rhuemask = 0.f; - float rchromask = 0.f; - float rLmask = 0.f; + float csob = 0.f; + float rs = 0.f; + + if (senstype == 1) { + csob = (blend2[loy - begy][lox - begx]) / 100.f ; + + if (csob > 60.f) { + csob = 60.f; + } + + csob = log(1.f + csob + 0.001f); + rs = sobelref / csob; + } + float dE = 0.f; + float rsob = 0.f; + + if (lp.struexp > 0.f && rs > 0.f && senstype == 1) { + rsob = 1.1f * lp.struexp * rs; + } + if (usemask) { - rhuemask = xatan2f(origblurmask->b[y][x], origblurmask->a[y][x]); - rchromask = sqrt(SQR(origblurmask->b[y][x]) + SQR(origblurmask->a[y][x])) / 327.68f; - rLmask = origblurmask->L[y][x] / 327.68f; - dE = sqrt(SQR(refa - origblurmask->a[y][x] / 327.68f) + SQR(refb - origblurmask->b[y][x] / 327.68f) + SQR(lumaref - origblurmask->L[y][x] / 327.68f)); + dE = rsob + sqrt(SQR(refa - origblurmask->a[y][x] / 327.68f) + SQR(refb - origblurmask->b[y][x] / 327.68f) + SQR(lumaref - origblurmask->L[y][x] / 327.68f)); } else { - dE = sqrt(SQR(refa - origblur->a[y][x] / 327.68f) + SQR(refb - origblur->b[y][x] / 327.68f) + SQR(lumaref - rL)); - rhuemask = rhue; - rchromask = rchro; - rLmask = rL; + dE = rsob + sqrt(SQR(refa - origblur->a[y][x] / 327.68f) + SQR(refb - origblur->b[y][x] / 327.68f) + SQR(lumaref - rL)); } float cli = 1.f; @@ -5207,7 +5156,6 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La float cla = 1.f; float clb = 1.f; - // if (lp.curvact == true) { cli = (buflight[loy - begy][lox - begx]); clc = (bufchro[loy - begy][lox - begx]); @@ -5216,281 +5164,31 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La clb = buf_b_cat[loy - begy][lox - begx]; } - float aplus = (1.f - cli) / delhu; - float bplus = 1.f - aplus * hueplus; - float amoins = (cli - 1.f) / delhu; - float bmoins = 1.f - amoins * huemoins; + float reducdE = 0.f; + float mindE = 2.f + 0.05f * varsens;//between 2 and 7 + float maxdE = 5.f + 1.5f * varsens; // between 5 and 150, we can chnage this values - float aplusch = (1.f - clc) / delhu; - float bplusch = 1.f - aplusch * hueplus; - float amoinsch = (clc - 1.f) / delhu; - float bmoinsch = 1.f - amoinsch * huemoins; + float ar = 1.f / (mindE - maxdE); - float aplusa = (1.f - cla) / delhu; - float bplusa = 1.f - aplusa * hueplus; - float amoinsa = (cla - 1.f) / delhu; - float bmoinsa = 1.f - amoinsa * huemoins; + float br = - ar * maxdE; - float aplusb = (1.f - clb) / delhu; - float bplusb = 1.f - aplusb * hueplus; - float amoinsb = (clb - 1.f) / delhu; - float bmoinsb = 1.f - amoinsb * huemoins; - - float realstr = 1.f; - float realstrch = 1.f; - float realstra = 1.f; - float realstrb = 1.f; - - //prepare shape detection - float deltachro = fabs(rchromask - chromaref); - float deltahue = fabs(rhuemask - hueref); - - if (deltahue > rtengine::RT_PI) { - deltahue = - (deltahue - 2.f * rtengine::RT_PI); + if (dE > maxdE) { + reducdE = 0.f; } - float deltaE = 20.f * deltahue + deltachro; //between 0 and 280 - float deltaL = fabs(lumaref - rLmask); //between 0 and 100 - - float kch = 1.f; - float kchchro = 1.f; - float khu = 0.f; - float fach = 1.f; - float falu = 1.f; - - if (deltachro < 160.f * SQR(varsens / 100.f)) { - kch = kchchro = 1.f; - } else { - float ck = 160.f * SQR(varsens / 100.f); - float ak = 1.f / (ck - 160.f); - float bk = -160.f * ak; - // kch = ak * deltachro + bk; - kch = kchchro = ak * deltachro + bk; - + if (dE > mindE && dE <= maxdE) { + reducdE = ar * dE + br; } - float kkch = 1.f; - kkch = pa * varsens + pb; - float kch0 = kch; - - if (varsens < 40.f) { - kch = kchchro = pow(kch0, kkch); //increase under 40 - float dEsens = moddE * varsens; - float kdE = 1.f; - - if (dE > dEsens) { - kdE = 1.f; - } else { - kdE = SQR(SQR(dE / dEsens)); - } - - if (deltahue < 0.3f && settings->detectshape == true) { - kchchro = kch = pow(kch0, (1.f + kdE * moddE * (3.f - 10.f * deltahue)) * kkch); - } + if (dE <= mindE) { + reducdE = 1.f; } - float dEsensall = varsens; - float kD = 1.f; - if (settings->detectshape == true) { - if (dE < dEsensall) { - kD = 1.f; - } else { - kD = pow(dEsensall / dE, powdE); - } - } - - /* - if (varsens < 40.f) { - kch = pow(kch, pa * varsens + pb); //increase under 40 - } - */ - bool kzon = false; - - //transition = difficult to avoid artifact with scope on flat area (sky...) - //hue detection - if ((hueref + dhue) < rtengine::RT_PI && rhue < hueplus && rhue > huemoins) { //transition are good - if (rhue >= hueplus - delhu) { - realstr = aplus * rhue + bplus; - realstrch = aplusch * rhue + bplusch; - realstra = aplusa * rhue + bplusa; - realstrb = aplusb * rhue + bplusb; - khu = apl * rhue + bpl; - - } else if (rhue < huemoins + delhu) { - realstr = amoins * rhue + bmoins; - realstrch = amoinsch * rhue + bmoinsch; - realstra = amoinsa * rhue + bmoinsa; - realstrb = amoinsb * rhue + bmoinsb; - khu = amo * rhue + bmo; - - } else { - realstr = cli; - khu = 1.f; - realstrch = clc; - realstra = cla; - realstrb = clb; - - } - - kzon = true; - } else if ((hueref + dhue) >= rtengine::RT_PI && (rhue > huemoins || rhue < hueplus)) { - if (rhue >= hueplus - delhu && rhue < hueplus) { - realstr = aplus * rhue + bplus; - realstrch = aplusch * rhue + bplusch; - realstra = aplusa * rhue + bplusa; - realstrb = aplusb * rhue + bplusb; - khu = apl * rhue + bpl; - - } else if (rhue >= huemoins && rhue < huemoins + delhu) { - realstr = amoins * rhue + bmoins; - realstrch = amoinsch * rhue + bmoinsch; - realstra = amoinsa * rhue + bmoinsa; - realstrb = amoinsb * rhue + bmoinsb; - khu = amo * rhue + bmo; - - } else { - realstr = cli; - khu = 1.f; - realstrch = clc; - realstra = cla; - realstrb = clb; - - } - - kzon = true; - } - - if ((hueref - dhue) > -rtengine::RT_PI && rhue < hueplus && rhue > huemoins) { - if (rhue >= hueplus - delhu && rhue < hueplus) { - realstr = aplus * rhue + bplus; - realstrch = aplusch * rhue + bplusch; - realstra = aplusa * rhue + bplusa; - realstrb = aplusb * rhue + bplusb; - khu = apl * rhue + bpl; - - } else if (rhue >= huemoins && rhue < huemoins + delhu) { - realstr = amoins * rhue + bmoins; - realstrch = amoinsch * rhue + bmoinsch; - realstra = amoinsa * rhue + bmoinsa; - realstrb = amoinsb * rhue + bmoinsb; - khu = amo * rhue + bmo; - - } else { - realstr = cli; - khu = 1.f; - realstrch = clc; - realstra = cla; - realstrb = clb; - - } - - kzon = true; - } else if ((hueref - dhue) <= -rtengine::RT_PI && (rhue > huemoins || rhue < hueplus)) { - if (rhue >= hueplus - delhu && rhue < hueplus) { - realstr = aplus * rhue + bplus; - realstrch = aplusch * rhue + bplusch; - realstra = aplusa * rhue + bplusa; - realstrb = aplusb * rhue + bplusb; - khu = apl * rhue + bpl; - - } else if (rhue >= huemoins && rhue < huemoins + delhu) { - realstr = amoins * rhue + bmoins; - realstrch = amoinsch * rhue + bmoinsch; - realstra = amoinsa * rhue + bmoinsa; - realstrb = amoinsb * rhue + bmoinsb; - khu = amo * rhue + bmo; - - } else { - realstr = cli; - khu = 1.f; - realstrch = clc; - realstra = cla; - realstrb = clb; - - } - - kzon = true; - } - - realstr *= kD; - realstrch *= kD; - - if (settings->detectshape == false) { - - //shape detection for hue chroma and luma - if (varsens <= 20.f) { //to try... - - if (deltaE < 2.8f * varsens) { - fach = khu; - } else { - fach = khu * (ahu * deltaE + bhu); - } - - float kcr = 10.f; - - if (rchro < kcr) { - fach *= (1.f / (kcr * kcr)) * rchro * rchro; - } - - if (lp.qualmet >= 1) { - } else { - fach = 1.f; - } - - if (deltaL < varsens) { - falu = 1.f; - } else { - falu = alum * deltaL + blum; - } - - } - } - - // I add these functions...perhaps not good - if (kzon) { - if (varsens < 60.f) { //arbitrary value - if (hueref < -1.1f && hueref > -2.8f) { // detect blue sky - if (chromaref > 0.f && chromaref < 35.f * multchro) { // detect blue sky - if ((rhue > -2.79f && rhue < -1.11f) && (rchro < 35.f * multchro)) { - realstr *= 0.9f; - } else { - realstr = 1.f; - } - } - } else { - realstr = cli; - } - - if (varsens < 50.f) { //&& lp.chro > 0.f - if (hueref > -0.1f && hueref < 1.6f) { // detect skin - if (chromaref > 0.f && chromaref < 55.f * multchroskin) { // detect skin - if ((rhue > -0.09f && rhue < 1.59f) && (rchro < 55.f * multchroskin)) { - realstr *= 0.7f; - } else { - realstr = 1.f; - } - } - } else { - realstr = cli; - } - } - } - - } - - float kcr = 100.f * lp.thr; - float falL = 1.f; - - if (rchro < kcr && chromaref > kcr) { // reduce artifacts in grey tones near hue spot and improve algorithm - falL *= pow(rchro / kcr, lp.iterat / 10.f); - } - - if (varsens > 99.f) { - falu = 1.f; - kch = 1.f; - fach = 1.f; - } + float realstrdE = reducdE * cli; + float realstradE = reducdE * cla; + float realstrbdE = reducdE * clb; + float realstrchdE = reducdE * clc; if (rL > 0.1f) { //to avoid crash with very low gamut in rare cases ex : L=0.01 a=0.5 b=-0.9 @@ -5506,36 +5204,35 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La case 1: { // inside transition zone float factorx = localFactor; + float diflc = 0.f; - // float difL; - difLab->L[loy - begy][lox - begx] = tmp1->L[loy - begy][lox - begx] - original->L[y][x]; - difLab->L[loy - begy][lox - begx] *= factorx * (100.f + realstr * falL) / 100.f; - // difL *= kch * fach; - difLab->L[loy - begy][lox - begx] *= kch ; + transformed->L[y][x] = CLIP(original->L[y][x] + 328.f * factorx * realstrdE);//kch fach + diflc = 328.f * factorx * realstrdE; - transformed->L[y][x] = original->L[y][x] + difLab->L[loy - begy][lox - begx]; - // float difa, difb; - - difLab->a[loy - begy][lox - begx] = tmp1->a[loy - begy][lox - begx] - original->a[y][x]; - difLab->b[loy - begy][lox - begx] = tmp1->b[loy - begy][lox - begx] - original->b[y][x]; + float flia = 1.f; + float flib = 1.f; + float chra = bufexporig->a[loy - begy][lox - begx]; + float chrb = bufexporig->b[loy - begy][lox - begx]; if (senstype != 1) { - difLab->a[loy - begy][lox - begx] *= factorx * (100.f + realstrch * falu * falL) / 100.f; - difLab->b[loy - begy][lox - begx] *= factorx * (100.f + realstrch * falu * falL) / 100.f; + flia = flib = ((100.f + realstrchdE) / 100.f); } else { - difLab->a[loy - begy][lox - begx] *= factorx * (100.f + realstra * falu * falL) / 100.f; - difLab->b[loy - begy][lox - begx] *= factorx * (100.f + realstrb * falu * falL) / 100.f; + flia = (100.f + realstradE) / 100.f; + flib = (100.f + realstrbdE) / 100.f; } - difLab->a[loy - begy][lox - begx] *= kch * fach; - difLab->b[loy - begy][lox - begx] *= kch * fach; - transformed->a[y][x] = CLIPC(original->a[y][x] + difLab->a[loy - begy][lox - begx]); - transformed->b[y][x] = CLIPC(original->b[y][x] + difLab->b[loy - begy][lox - begx]); + float difa = chra * flia - original->a[y][x]; + float difb = chrb * flib - original->b[y][x]; + difa *= factorx; + difb *= factorx; - if ((lp.showmaskexpmet == 1 || lp.showmaskexpmet == 2) && senstype == 1) { - transformed->a[y][x] = difLab->a[loy - begy][lox - begx]; - transformed->b[y][x] = difLab->b[loy - begy][lox - begx]; - transformed->L[y][x] = 12000.f + difLab->L[loy - begy][lox - begx]; + transformed->a[y][x] = CLIPC(original->a[y][x] + difa); + transformed->b[y][x] = CLIPC(original->b[y][x] + difb); + + if ((lp.showmaskexpmet == 1 || lp.showmaskexpmet == 2) && senstype == 1) { + transformed->L[y][x] = CLIP(12000.f + diflc); + transformed->a[y][x] = CLIPC(difa); + transformed->b[y][x] = CLIPC(difb); } break; @@ -5543,46 +5240,41 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La } case 2: { // inside selection => full effect, no transition - // float difL; - difLab->L[loy - begy][lox - begx] = tmp1->L[loy - begy][lox - begx] - original->L[y][x]; - difLab->L[loy - begy][lox - begx] *= (100.f + realstr * falL) / 100.f; - // difL *= kch * fach; - difLab->L[loy - begy][lox - begx] *= kch; - transformed->L[y][x] = original->L[y][x] + difLab->L[loy - begy][lox - begx]; - // float difa, difb; + float diflc = 0.f; + transformed->L[y][x] = CLIP(original->L[y][x] + 328.f * realstrdE);//kch fach + diflc = 328.f * realstrdE; - difLab->a[loy - begy][lox - begx] = tmp1->a[loy - begy][lox - begx] - original->a[y][x]; - difLab->b[loy - begy][lox - begx] = tmp1->b[loy - begy][lox - begx] - original->b[y][x]; + float flia = 1.f; + float flib = 1.f; + float chra = bufexporig->a[loy - begy][lox - begx]; + float chrb = bufexporig->b[loy - begy][lox - begx]; if (senstype != 1) { - difLab->a[loy - begy][lox - begx] *= (100.f + realstrch * falu * falL) / 100.f; - difLab->b[loy - begy][lox - begx] *= (100.f + realstrch * falu * falL) / 100.f; + flia = flib = (100.f + realstrchdE) / 100.f; } else { - difLab->a[loy - begy][lox - begx] *= (100.f + realstra * falu * falL) / 100.f; - difLab->b[loy - begy][lox - begx] *= (100.f + realstrb * falu * falL) / 100.f; + flia = (100.f + realstradE) / 100.f; + flib = (100.f + realstrbdE) / 100.f; } - difLab->a[loy - begy][lox - begx] *= kch * fach; - difLab->b[loy - begy][lox - begx] *= kch * fach; + float difa = chra * flia - original->a[y][x]; + float difb = chrb * flib - original->b[y][x]; - transformed->a[y][x] = CLIPC(original->a[y][x] + difLab->a[loy - begy][lox - begx]); - transformed->b[y][x] = CLIPC(original->b[y][x] + difLab->b[loy - begy][lox - begx]); + transformed->a[y][x] = CLIPC(original->a[y][x] + difa); + transformed->b[y][x] = CLIPC(original->b[y][x] + difb); - if ((lp.showmaskexpmet == 1 || lp.showmaskexpmet == 2) && senstype == 1) { - transformed->a[y][x] = difLab->a[loy - begy][lox - begx]; - transformed->b[y][x] = difLab->b[loy - begy][lox - begx]; - transformed->L[y][x] = 12000.f + difLab->L[loy - begy][lox - begx]; + if ((lp.showmaskexpmet == 1 || lp.showmaskexpmet == 2) && senstype == 1) { + transformed->L[y][x] = CLIP(12000.f + diflc); + transformed->a[y][x] = CLIPC(difa); + transformed->b[y][x] = CLIPC(difb); } } } - //} } - - } + } bool execmedian99 = false; @@ -5618,7 +5310,9 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La } delete origblur; - if ((lp.showmaskcolmet >= 2 || lp.enaColorMask) && senstype == 1) { + + if ((lp.showmaskcolmet == 2 || lp.enaColorMask) && senstype == 1) + { delete origblurmask; } @@ -5626,10 +5320,10 @@ void ImProcFunctions::Expo_vibr_Local(float moddE, float powdE, int senstype, La } -void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabImage * bufcolorig, LabImage * originalmask, float ** buflight, float ** bufchro, float ** bufchroslid, float ** bufhh, float ** buflightslid, bool &LHutili, bool &HHutili, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, LUTf & lightCurveloc, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk) +void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabImage * bufcolorig, LabImage * originalmask, float ** buflight, float ** bufchro, float ** bufchroslid, float ** bufhh, float ** buflightslid, bool &LHutili, bool &HHutili, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, float sobelref, float ** blend2, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, LUTf & lightCurveloc, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk) { BENCHFUN -// chroma and lightness +// chroma and lightnesse const float ach = (float)lp.trans / 100.f; //chroma @@ -5679,6 +5373,13 @@ void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabIm float refb = chromaref * sin(hueref); // const float moddE = 2.f; + sobelref /= 100.; + + if (sobelref > 60.) { + sobelref = 60.; + } + + sobelref = log(1.f + sobelref); // constant and variables to prepare shape detection if (lumaref + modlum >= 100.f) { @@ -5716,18 +5417,20 @@ void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabIm float radius = 3.f / sk; - if (lp.showmaskcolmet >= 2 || lp.enaColorMask) { + + if (lp.showmaskcolmet == 2 || lp.enaColorMask) { origblurmask = new LabImage(GW, GH); - + #ifdef _OPENMP - #pragma omp parallel + #pragma omp parallel #endif - { - gaussianBlur(originalmask->L, origblurmask->L, GW, GH, radius); - gaussianBlur(originalmask->a, origblurmask->a, GW, GH, radius); - gaussianBlur(originalmask->b, origblurmask->b, GW, GH, radius); + { + gaussianBlur(originalmask->L, origblurmask->L, GW, GH, radius); + gaussianBlur(originalmask->a, origblurmask->a, GW, GH, radius); + gaussianBlur(originalmask->b, origblurmask->b, GW, GH, radius); + } } - } + #ifdef _OPENMP #pragma omp parallel #endif @@ -5819,22 +5522,40 @@ void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabIm if (fabs(origblur->b[y][x]) < 0.01f) { origblur->b[y][x] = 0.01f; } + + //Sobel + float csob = (blend2[loy - begy][lox - begx]) / 100.f ; + + if (csob > 60.f) { + csob = 60.f; + } + + csob = log(1.f + csob + 0.001f); + float rs = sobelref / csob; + float dE = 0.f; float rhuemask = 0.f; float rchromask = 0.f; float rLmask = 0.f; - if (lp.showmaskcolmet >= 2 || lp.enaColorMask) { + float rsob = 0.f; + + if (lp.struco > 0.f && rs > 0.f) { + rsob = 1.1f * lp.struco * (rs); + } + + if (lp.showmaskcolmet == 2 || lp.enaColorMask) { rhuemask = xatan2f(origblurmask->b[y][x], origblurmask->a[y][x]); rchromask = sqrt(SQR(origblurmask->b[y][x]) + SQR(origblurmask->a[y][x])) / 327.68f; rLmask = origblurmask->L[y][x] / 327.68f; - dE = sqrt(SQR(refa - origblurmask->a[y][x] / 327.68f) + SQR(refb - origblurmask->b[y][x] / 327.68f) + SQR(lumaref - origblurmask->L[y][x] / 327.68f)); + dE = rsob + sqrt(SQR(refa - origblurmask->a[y][x] / 327.68f) + SQR(refb - origblurmask->b[y][x] / 327.68f) + SQR(lumaref - origblurmask->L[y][x] / 327.68f)); } else { - dE = sqrt(SQR(refa - origblur->a[y][x] / 327.68f) + SQR(refb - origblur->b[y][x] / 327.68f) + SQR(lumaref - rL)); + dE = rsob + sqrt(SQR(refa - origblur->a[y][x] / 327.68f) + SQR(refb - origblur->b[y][x] / 327.68f) + SQR(lumaref - rL)); rhuemask = rhue; rchromask = rchro; rLmask = rL; } - //retriev data curve lightness + + //retriev data curve lightness float cli = (buflight[loy - begy][lox - begx]); //parameters for linear interpolation in function of real hue float apluscligh = (1.f - cli) / delhu; @@ -6249,6 +5970,7 @@ void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabIm sincosval.y = 1.f; sincosval.x = 0.0f; float ddhue = 0.f; +// printf("kch=%f ", kch); if (rL > th_r) { //to avoid crash with very low gamut in rare cases ex : L=0.01 a=0.5 b=-0.9 switch (zone) { @@ -6337,11 +6059,11 @@ void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabIm diflc *= kch ; diflc *= factorx; //transition lightness - transformed->L[y][x] = CLIPL((original->L[y][x] + diflc)); + transformed->L[y][x] = CLIP((original->L[y][x] + diflc)); - if (lp.showmaskcolmet == 1 || lp.showmaskcolmet == 2) { - transformed->L[y][x] = 12000.f + diflc; //CLIPL((original->L[y][x] + diflc)); - } + // if (lp.showmaskcolmet == 1 || lp.showmaskcolmet == 2) { + // transformed->L[y][x] = CLIP(12000.f + diflc); //CLIPL((original->L[y][x] + diflc)); + // } if (lochhCurve && lp.qualcurvemet >= 1 && HHutili) { float addh = 0.f; @@ -6374,8 +6096,8 @@ void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabIm transformed->b[y][x] = CLIPC(chromhr * sincosval.x * fac); if (lp.showmaskcolmet == 1 || lp.showmaskcolmet == 2) { - transformed->a[y][x] = chromhr * sincosval.y * (fac - 1.f) ; - transformed->b[y][x] = chromhr * sincosval.x * (fac - 1.f); + transformed->a[y][x] = CLIPC(chromhr * sincosval.y * (fac - 1.f)) ; + transformed->b[y][x] = CLIPC(chromhr * sincosval.x * (fac - 1.f)); } } else { @@ -6383,8 +6105,9 @@ void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabIm transformed->b[y][x] = CLIPC(original->b[y][x] * fac); if (lp.showmaskcolmet == 1 || lp.showmaskcolmet == 2) { - transformed->a[y][x] = original->a[y][x] * (fac - 1.f) ; - transformed->b[y][x] = original->b[y][x] * (fac - 1.f); + transformed->L[y][x] = CLIP(12000.f + diflc); + transformed->a[y][x] = CLIPC(original->a[y][x] * (fac - 1.f)) ; + transformed->b[y][x] = CLIPC(original->b[y][x] * (fac - 1.f)); } } @@ -6467,11 +6190,11 @@ void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabIm kdiff *= fach * kch; diflc *= kdiff ; diflc *= kch ; - transformed->L[y][x] = CLIPL((original->L[y][x] + diflc)); + transformed->L[y][x] = CLIP((original->L[y][x] + diflc)); - if (lp.showmaskcolmet == 1 || lp.showmaskcolmet == 2) { - transformed->L[y][x] = 12000.f + diflc; //CLIPL((original->L[y][x] + diflc)); - } +// if (lp.showmaskcolmet == 1 || lp.showmaskcolmet == 2) { +// transformed->L[y][x] = CLIP(12000.f + diflc); //CLIPL((original->L[y][x] + diflc)); +// } if (lochhCurve && lp.qualcurvemet >= 1 && HHutili) { @@ -6504,8 +6227,8 @@ void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabIm transformed->b[y][x] = CLIPC(chromhr * sincosval.x * fac); if (lp.showmaskcolmet == 1 || lp.showmaskcolmet == 2) { - transformed->a[y][x] = chromhr * sincosval.y * (fac - 1.f) ; - transformed->b[y][x] = chromhr * sincosval.x * (fac - 1.f); + transformed->a[y][x] = CLIPC(chromhr * sincosval.y * (fac - 1.f)) ; + transformed->b[y][x] = CLIPC(chromhr * sincosval.x * (fac - 1.f)); } } else { @@ -6513,8 +6236,9 @@ void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabIm transformed->b[y][x] = CLIPC(original->b[y][x] * fac); if (lp.showmaskcolmet == 1 || lp.showmaskcolmet == 2) { - transformed->a[y][x] = original->a[y][x] * (fac - 1.f) ; - transformed->b[y][x] = original->b[y][x] * (fac - 1.f); + transformed->L[y][x] = CLIP(12000.f + diflc); + transformed->a[y][x] = CLIPC(original->a[y][x] * (fac - 1.f)) ; + transformed->b[y][x] = CLIPC(original->b[y][x] * (fac - 1.f)); } } @@ -6533,7 +6257,8 @@ void ImProcFunctions::ColorLight_Local(float moddE, float powdE, int call, LabIm } delete origblur; - if (lp.showmaskcolmet >= 2 || lp.enaColorMask) { + + if (lp.showmaskcolmet == 2 || lp.enaColorMask) { delete origblurmask; } } @@ -6952,7 +6677,7 @@ void ImProcFunctions::InverseColorLight_Local(const struct local_params & lp, LU diflc *= kdiff ; diflc *= factorx; //transition lightness - transformed->L[y][x] = CLIPL(1.f * (original->L[y][x] + diflc)); + transformed->L[y][x] = CLIP(1.f * (original->L[y][x] + diflc)); transformed->a[y][x] = CLIPC(original->a[y][x] * fac) ; transformed->b[y][x] = CLIPC(original->b[y][x] * fac); @@ -6969,9 +6694,9 @@ void ImProcFunctions::InverseColorLight_Local(const struct local_params & lp, LU float diflc = lightcont - original->L[y][x]; diflc *= factorx; - transformed->L[y][x] = original->L[y][x] + diflc; - transformed->a[y][x] = original->a[y][x] * fac; - transformed->b[y][x] = original->b[y][x] * fac; + transformed->L[y][x] = CLIP(original->L[y][x] + diflc); + transformed->a[y][x] = CLIPC(original->a[y][x] * fac); + transformed->b[y][x] = CLIPC(original->b[y][x] * fac); } @@ -7003,7 +6728,7 @@ void ImProcFunctions::InverseColorLight_Local(const struct local_params & lp, LU kdiff *= fach * kch; diflc *= kdiff ; - transformed->L[y][x] = CLIPL(1.f * (original->L[y][x] + diflc)); + transformed->L[y][x] = CLIP(1.f * (original->L[y][x] + diflc)); transformed->a[y][x] = CLIPC(original->a[y][x] * fac) ; transformed->b[y][x] = CLIPC(original->b[y][x] * fac); @@ -7015,9 +6740,9 @@ void ImProcFunctions::InverseColorLight_Local(const struct local_params & lp, LU } float lightcont = lumnew ; - transformed->L[y][x] = lightcont; - transformed->a[y][x] = original->a[y][x] * facc; - transformed->b[y][x] = original->b[y][x] * facc; + transformed->L[y][x] = CLIP(lightcont); + transformed->a[y][x] = CLIPC(original->a[y][x] * facc); + transformed->b[y][x] = CLIPC(original->b[y][x] * facc); } } @@ -7031,7 +6756,7 @@ void ImProcFunctions::InverseColorLight_Local(const struct local_params & lp, LU } -void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transformed, int cx, int cy, int oW, int oH, int sk, double & huerefblur, double & hueref, double & chromaref, double & lumaref, double & sobelref, LUTu & histogram) +void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transformed, int cx, int cy, int oW, int oH, int sk, double & huerefblur, double & hueref, double & chromaref, double & lumaref, double & sobelref, LUTu & histogram, float &avg) { if (params->locallab.enabled) { //always calculate hueref, chromaref, lumaref before others operations use in normal mode for all modules exceprt denoise @@ -7041,6 +6766,23 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform int begx = lp.xc - lp.lxL; int yEn = lp.yc + lp.ly; int xEn = lp.xc + lp.lx; + float avg2 = 0.f; + int nc2 = 0; + + for (int y = 0; y < transformed->H ; y++) //{ + for (int x = 0; x < transformed->W; x++) { + int lox = cx + x; + int loy = cy + y; + + if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + avg2 += original->L[y][x]; + nc2++; + } + } + + avg2 /= 32768.f; + avg = avg2 / nc2; +// printf("calc avg=%f \n", avg); //claculate histogram for area selected #ifdef _OPENMP const int numThreads = min(max(transformed->W * transformed->H / (int)histogram.getSize(), 1), omp_get_max_threads()); @@ -7049,6 +6791,7 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform { LUTu lhist16thrloc(histogram.getSize()); lhist16thrloc.clear(); + histogram.clear(); #ifdef _OPENMP #pragma omp for nowait #endif @@ -7109,6 +6852,7 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform spotSise2 = (spotSi - 1) / 2; + JaggedArray blend3(spotSi, spotSi); origsob = new LabImage(spotSi, spotSi); sobelL = new LabImage(spotSi, spotSi); @@ -7163,13 +6907,14 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform aveL += original->L[y - cy][x - cx]; aveA += original->a[y - cy][x - cx]; aveB += original->b[y - cy][x - cx]; + // aveblend += 100.f * blend2[y - cy][x - cx]; aveChro += sqrtf(SQR(original->b[y - cy][x - cx]) + SQR(original->a[y - cy][x - cx])); nab++; } } //ref for sobel - bool toto = false; + bool toto = true; if (toto) { for (int y = max(cy, (int)(lp.yc - spotSise2)); y < min(transformed->H + cy, (int)(lp.yc + spotSise2 + 1)); y++) { @@ -7186,19 +6931,19 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform } const float radius = 3.f / (sk * 1.4f); //0 to 70 ==> see skip - SobelCannyLuma(sobelL->L, origsob->L, spotSi, spotSi, radius); - // SobelCannyLuma (sobelL, deltasobelL, origsob, spotSi, spotSi, radius ); + SobelCannyLuma(sobelL->L, origsob->L, spotSi, spotSi, radius); int nbs = 0; for (int y = 0; y < spotSi ; y ++) for (int x = 0; x < spotSi ; x ++) { avesobel += sobelL->L[y][x]; + // avesobel += blend3[y][x]; nbs++; } sobelref = avesobel / nbs; - // printf ("sobelref=%f \n", sobelref); + printf("sobelref=%f \n", sobelref); } delete sobelL; @@ -7233,7 +6978,8 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform chromaref = aveChro; lumaref = avL; - //printf("Calcref => sp=%i huere=%f chromare=%f lumare=%f \n", sp, hueref, chromaref, lumaref); + printf("Calcref => sp=%i huere=%f chromare=%f lumare=%f \n", sp, hueref, chromaref, lumaref); + if (isdenoise) { delete origblur; delete blurorig; @@ -7245,97 +6991,6 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform } } -void ImProcFunctions::copy_ref(LabImage * spotbuffer, LabImage * original, LabImage * transformed, int cx, int cy, int sk, const struct local_params & lp, double & huerefspot, double & chromarefspot, double & lumarefspot) -{ - if (params->locallab.enabled) { - -// double precision for large summations - double aveA = 0.; - double aveB = 0.; - double aveL = 0.; - double aveChro = 0.; -// int precision for the counters - int nab = 0; -// single precision for the result - float avA, avB, avL; - // int spotSize = 0.88623f * max (1, lp.cir / sk); //18 - int spotSize = max(1, lp.cir / sk); - - //O.88623 = sqrt(PI / 4) ==> sqare equal to circle - /* - // very small region, don't use omp here - printf ("COPYcy=%i cx=%i yc=%f xc=%f circ=%i spot=%i tH=%i tW=%i sk=%i\n", cy, cx, lp.yc, lp.xc, lp.cir, spotSize, transformed->H, transformed->W, sk); - printf ("COPYymin=%i ymax=%i\n", max (cy, (int) (lp.yc - spotSize)), min (transformed->H + cy, (int) (lp.yc + spotSize + 1)) ); - printf ("COPYxmin=%i xmax=%i\n", max (cx, (int) (lp.xc - spotSize)), min (transformed->W + cx, (int) (lp.xc + spotSize + 1)) ); - */ - for (int y = max(cy, (int)(lp.yc - spotSize)); y < min(transformed->H + cy, (int)(lp.yc + spotSize + 1)); y++) { - for (int x = max(cx, (int)(lp.xc - spotSize)); x < min(transformed->W + cx, (int)(lp.xc + spotSize + 1)); x++) { - - int yb = max(cy, (int)(lp.yc - spotSize)); - // int ye = min (transformed->H + cy, (int) (lp.yc + spotSize + 1)); - - int xb = max(cx, (int)(lp.xc - spotSize)); - // int xe = min (transformed->W + cx, (int) (lp.xc + spotSize + 1)); - - aveL += original->L[y - cy][x - cx]; - int z = y - yb; - int u = x - xb; - spotbuffer->L[z][u] = original->L[y - cy][x - cx]; -// printf("spBUFL=%f ", spotbuffer->L[z][u]); - spotbuffer->a[z][u] = original->a[y - cy][x - cx]; - spotbuffer->b[z][u] = original->b[y - cy][x - cx]; - - aveA += original->a[y - cy][x - cx]; - aveB += original->b[y - cy][x - cx]; - aveChro += sqrtf(SQR(original->b[y - cy][x - cx]) + SQR(original->a[y - cy][x - cx])); - - nab++; - } - } - - aveL = aveL / nab; - aveA = aveA / nab; - aveB = aveB / nab; - aveChro = aveChro / nab; - aveChro /= 327.68f; - avA = aveA / 327.68f; - avB = aveB / 327.68f; - avL = aveL / 327.68f; - huerefspot = xatan2f(avB, avA); //mean hue - chromarefspot = aveChro; - lumarefspot = avL; - } -} - -void ImProcFunctions::paste_ref(LabImage * spotbuffer, LabImage * transformed, int cx, int cy, int sk, const struct local_params & lp) -{ - if (params->locallab.enabled) { - - int nab = 0; - int spotSize = max(1, lp.cir / sk); - - for (int y = max(cy, (int)(lp.yc - spotSize)); y < min(transformed->H + cy, (int)(lp.yc + spotSize + 1)); y++) { - for (int x = max(cx, (int)(lp.xc - spotSize)); x < min(transformed->W + cx, (int)(lp.xc + spotSize + 1)); x++) { - int yb = max(cy, (int)(lp.yc - spotSize)); - // int ye = min (transformed->H + cy, (int) (lp.yc + spotSize + 1)); - - int xb = max(cx, (int)(lp.xc - spotSize)); - // int xe = min (transformed->W + cx, (int) (lp.xc + spotSize + 1)); - - // aveL += original->L[y - cy][x - cx]; - int z = y - yb; - int u = x - xb; - // printf("z=%i u=%i spotbufferL=%f", z, u, spotbuffer->L[z][u]); - transformed->L[y - cy][x - cx] = spotbuffer->L[z][u]; - transformed->a[y - cy][x - cx] = spotbuffer->a[z][u]; - transformed->b[y - cy][x - cx] = spotbuffer->b[z][u]; - nab++; - } - } - - } -} - void ImProcFunctions::fftw_denoise(int GW, int GH, int max_numblox_W, int min_numblox_W, float **tmp1, array2D *Lin, int numThreads, const struct local_params & lp, int chrom) { @@ -7555,10 +7210,8 @@ void ImProcFunctions::fftw_denoise(int GW, int GH, int max_numblox_W, int min_nu } - - -void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbuffer, LabImage * original, LabImage * transformed, LabImage * reserved, int cx, int cy, int oW, int oH, int sk, - const LocretigainCurve & locRETgainCcurve, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, const LocCCmaskCurve & locccmasCurve, const LocLLmaskCurve & locllmasCurve, const LocHHmaskCurve & lochhmasCurve, const LocCCmaskexpCurve & locccmasexpCurve, const LocLLmaskexpCurve & locllmasexpCurve, +void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * original, LabImage * transformed, LabImage * reserved, int cx, int cy, int oW, int oH, int sk, + const LocretigainCurve & locRETgainCcurve, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, const LocCCmaskCurve & locccmasCurve, bool & lcmasutili, const LocLLmaskCurve & locllmasCurve, bool & llmasutili, const LocHHmaskCurve & lochhmasCurve, bool &lhmasutili, const LocCCmaskexpCurve & locccmasexpCurve, bool &lcmasexputili, const LocLLmaskexpCurve & locllmasexpCurve, bool &llmasexputili, const LocHHmaskexpCurve & lochhmasexpCurve, bool & lhmasexputili, bool & LHutili, bool & HHutili, LUTf & cclocalcurve, bool & localskutili, LUTf & sklocalcurve, bool & localexutili, LUTf & exlocalcurve, LUTf & hltonecurveloc, LUTf & shtonecurveloc, LUTf & tonecurveloc, LUTf & lightCurveloc, double & huerefblur, double & hueref, double & chromaref, double & lumaref, double & sobelref, int llColorMask, int llExpMask) { //general call of others functions : important return hueref, chromaref, lumaref @@ -7731,7 +7384,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu } } - #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -7761,700 +7413,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu } - - bool titi = false; - - if (titi) { //&& call == 3 - -//actually does not work at all, I make different tests ! - - // if (lp.strucc > 0) { - //change coordonate to XX, YY XX=x, YY=-y to can use easily trigo functions and polar coordonates - // xc yc are XX=0 YY=0 - //at the end we convert inverse - // we have 4 quarter for the area bfw * bfh : TOP, LEFT, BOTTOM, RIGHT - //Cdeltae Ldeltae - deltaE Chroma and Luma in area bfw bfh - //Cdeltaesob Ldeltaesob - Sobel transformed of deltaE Chroma and Luma in area bfw bfh - - //retreive coordonate and values of references around current exclude Spot - - //retrieve datas for hueref, sobelref and centerX Y for all spot around - /* - huerefs[sp]; - sobelrefs[sp]; - centerx[sp]; - centery[sp]; - */ - /* - int currentcenterx = centerx[0]; - int currentcentery = centery[0]; - printf("cuX=%i cuY=%i sp=%i\n", currentcenterx, currentcentery, sp); - - for (int i = 1; i < maxspot; i++) { - printf("i=%i hue=%f sob=%f cex=%i cey=%i\n", i, huerefs[i], sobelrefs[i], centerx[i], centery[i]); - - } - */ - - JaggedArray Cdeltae(bfw, bfh); - JaggedArray Cdeltaesob(bfw, bfh); - JaggedArray Ldeltae(bfw, bfh); - JaggedArray Ldeltaesob(bfw, bfh); - - -#ifdef _OPENMP - #pragma omp parallel for -#endif - - for (int ir = 0; ir < bfh; ir++) //fill with 0 - for (int jr = 0; jr < bfw; jr++) { - Cdeltae[ir][jr] = 0.f; - Ldeltae[ir][jr] = 0.f; - Cdeltaesob[ir][jr] = 0.f; - Ldeltaesob[ir][jr] = 0.f; - } - -#ifdef _OPENMP - #pragma omp parallel for -#endif - - for (int ir = 0; ir < bfh; ir++) - for (int jr = 0; jr < bfw; jr++) { - float tempc = SQR(bufreserv->a[ir][jr] - bufexclu->a[ir][jr]) + SQR(bufreserv->b[ir][jr] - bufexclu->b[ir][jr]); - float templ = fabs(bufreserv->L[ir][jr] - bufexclu->L[ir][jr]); - Cdeltae[ir][jr] = sqrt(tempc); - Ldeltae[ir][jr] = templ; - } - - - SobelCannyLuma(Cdeltaesob, Cdeltae, bfw, bfh, 0);//0 or other thing eg radiussob if noise... - SobelCannyLuma(Ldeltaesob, Ldeltae, bfw, bfh, 0); - - int Xo = trunc(-lp.lxL); - int Xe = trunc(lp.lx); - int Yo = trunc(-lp.ly); - int Ye = trunc(lp.lyT); - int ar = 1;//to avoid crash due to round values - //init first quarter top - int XR = max(-Xo, Xe); - - //rr maximum radius to stock data - int rr = sqrt(SQR(XR) + SQR(Ye)) + ar; //+ ar to prevent crash due to round float - //polar coord - JaggedArray val(rr, xEn - begx + ar); - JaggedArray CdE(rr, xEn - begx + ar); - JaggedArray LdE(rr, xEn - begx + ar); - JaggedArray CdEsob(rr, xEn - begx + ar); - JaggedArray LdEsob(rr, xEn - begx + ar); - JaggedArray Soderiv(rr, xEn - begx + ar); - JaggedArray Chderiv(rr, xEn - begx + ar); - JaggedArray Luderiv(rr, xEn - begx + ar); - JaggedArray goodmax(rr, xEn - begx + ar); - JaggedArray Soderiv2(rr, xEn - begx + ar); - JaggedArray Chderiv2(rr, xEn - begx + ar); - JaggedArray Luderiv2(rr, xEn - begx + ar); - JaggedArray Totalderiv2(rr, xEn - begx + ar); - - //cDe and LdE to stock delta E chroma and luma in area top and polar coord - //cDesob and LdEsob Sobel canny of delta E chroma and luma - //Chderiv Luderiv derivative of Sobel deltae Chroma Luma - //Soderiv derivative of sobel - - //good max : find the good max value. This value perhaps is max, but perhaps it is after - on the radius - and before the end - - //keep radius On OFF action - float *rad = nullptr; - rad = new float[xEn - begx + ar]; - - float *maxsob = nullptr; - maxsob = new float[xEn - begx + ar]; - float *meanbef = nullptr; - meanbef = new float[xEn - begx + ar]; - float *meanaft = nullptr; - meanaft = new float[xEn - begx + ar]; - - //radlim maximum radius - float *radlim = nullptr; - radlim = new float[xEn - begx + ar]; - - //init second quarter left - int YL = max(-Yo, Ye); - int rrL = sqrt(SQR(YL) + SQR(Xo)) + ar; - - JaggedArray valL(rrL, yEn - begy + ar); - JaggedArray CdEL(rrL, yEn - begy + ar); - JaggedArray LdEL(rrL, yEn - begy + ar); - JaggedArray CdEsobL(rrL, yEn - begy + ar); - JaggedArray LdEsobL(rrL, yEn - begy + ar); - JaggedArray SoderivL(rrL, yEn - begy + ar); - JaggedArray ChderivL(rrL, yEn - begy + ar); - JaggedArray LuderivL(rrL, yEn - begy + ar); - - float *radL = nullptr; - radL = new float[yEn - begy + ar]; - float *radlimL = nullptr; - radlimL = new float[yEn - begy + ar]; - - - //init third quarter bottom - XR = max(-Xo, Xe); - int rrB = sqrt(SQR(XR) + SQR(Yo)) + ar; - - JaggedArray valB(rrB, xEn - begx + ar); - JaggedArray CdEB(rrB, xEn - begx + ar); - JaggedArray LdEB(rrB, xEn - begx + ar); - JaggedArray CdEsobB(rrB, xEn - begx + ar); - JaggedArray LdEsobB(rrB, xEn - begx + ar); - JaggedArray SoderivB(rrB, xEn - begx + ar); - JaggedArray ChderivB(rrB, xEn - begx + ar); - JaggedArray LuderivB(rrB, xEn - begx + ar); - - float *radB = nullptr; - radB = new float[xEn - begx + ar]; - float *radlimB = nullptr; - radlimB = new float[xEn - begx + ar]; - - - //init fourth quarter right - YL = max(-Yo, Ye); - int rrR = sqrt(SQR(YL) + SQR(Xe)) + ar; - JaggedArray valR(rrR, yEn - begy + ar); - JaggedArray CdER(rrR, yEn - begy + ar); - JaggedArray LdER(rrR, yEn - begy + ar); - JaggedArray CdEsobR(rrR, yEn - begy + ar); - JaggedArray LdEsobR(rrR, yEn - begy + ar); - JaggedArray SoderivR(rrR, yEn - begy + ar); - JaggedArray ChderivR(rrR, yEn - begy + ar); - JaggedArray LuderivR(rrR, yEn - begy + ar); - - float *radR = nullptr; - radR = new float[yEn - begy + ar]; - float *radlimR = nullptr; - radlimR = new float[yEn - begy + ar]; - - //printf("huar=%f sob=%f cx=%i\n", huerefs[2], sobelrefs[2], centerx[1]); - - - for (int w = 0; w < (xEn - begx); w++) { - rad[w] = 0.f; - radlim[w] = 0.f; - radB[w] = 0.f; - radlimB[w] = 0.f; - } - - for (int w = 0; w < (xEn - begx); w++) { - for (int z = 0; z < rr; z++) { - val[w][z] = 0.f; - Soderiv[w][z] = 0.f; - Chderiv[w][z] = 0.f; - Luderiv[w][z] = 0.f; - Soderiv2[w][z] = 0.f; - Chderiv2[w][z] = 0.f; - Luderiv2[w][z] = 0.f; - Totalderiv2[w][z] = 0.f; - CdE[w][z] = 0.f; - LdE[w][z] = 0.f; - CdEsob[w][z] = 0.f; - LdEsob[w][z] = 0.f; - goodmax[w][z] = 0.f; - - } - } - - for (int w = 0; w < (xEn - begx); w++) { - for (int z = 0; z < rrB; z++) { - valB[w][z] = 0.f; - SoderivB[w][z] = 0.f; - ChderivB[w][z] = 0.f; - LuderivB[w][z] = 0.f; - CdEB[w][z] = 0.f; - LdEB[w][z] = 0.f; - CdEsobB[w][z] = 0.f; - LdEsobB[w][z] = 0.f; - } - } - - for (int w = 0; w < (yEn - begy); w++) { - for (int z = 0; z < rrL; z++) { - valL[w][z] = 0.f; - SoderivL[w][z] = 0.f; - ChderivL[w][z] = 0.f; - LuderivL[w][z] = 0.f; - CdEL[w][z] = 0.f; - LdEL[w][z] = 0.f; - CdEsobL[w][z] = 0.f; - LdEsobL[w][z] = 0.f; - } - } - - for (int w = 0; w < (yEn - begy); w++) { - for (int z = 0; z < rrR; z++) { - valR[w][z] = 0.f; - SoderivR[w][z] = 0.f; - ChderivR[w][z] = 0.f; - LuderivR[w][z] = 0.f; - CdER[w][z] = 0.f; - LdER[w][z] = 0.f; - CdEsobR[w][z] = 0.f; - LdEsobR[w][z] = 0.f; - } - } - - for (int w = 0; w < (yEn - begy); w++) { - radL[w] = 0.f; - radlimL[w] = 0.f; - radR[w] = 0.f; - radlimR[w] = 0.f; - } - - float sobelponder = 2.f * sobelref; - float2 sincosval; - - if (sobelponder > 25000.f) { - sobelponder = 25000.f; - } - - //first step : fill val[m][r] with Sobel-Canny datas - //Canny with very smal denoise to keep good datas :radiussob # 1 2 3 - float valm = 0.f; - - for (int XX = Xo; XX < Xe; XX++) { //first quarter superior - int m = trunc(XX - Xo); - - if (m < 0) { - m = 0; - } - - radlim[m] = sqrt(SQR(XX) + SQR(Ye)); - - float tetacur = xatan2f(Ye, XX);//we can probably supprres xatan2f and repace by XX / Ye but I keep it in case of - float valedge = 0.f; - // float maxval = -10000.f; - // float minval = 100000.f; - - for (int r = 1; r < radlim[m] - (ar + 2); r++) { - sincosval = xsincosf(tetacur); - float xcur = r * sincosval.y; - float ycur = r * sincosval.x; - - int xxcur = trunc(lp.xc) + trunc(xcur) - begx; - xxcur = LIM (xxcur, 0, bfw - 1); - - int yycur = trunc(lp.yc) - trunc(ycur) - begy; // - before ceil(ycur) to convert YY ==> y - yycur = LIM (yycur, 0, bfh - 1); - valm = tmpsob->L[yycur][xxcur]; - CdEsob[m][r] = Cdeltaesob[yycur][xxcur]; - LdEsob[m][r] = Ldeltaesob[yycur][xxcur]; - LdE[m][r] = Ldeltae[yycur][xxcur]; - CdE[m][r] = Cdeltae[yycur][xxcur]; - - if (valm > valedge) { - // if(m > maxm) maxm = m; - val[m][r] = valm; - - if (XX == 2) { - // printf("XX=%i m=%i r=%i val=%i CdE=%i LdE=%i\n", XX, m, r, (int) val[m][r], (int)CdE[m][r], (int)LdE[m][r]); - } - } - - } - - - } - - valm = 0.f; - - for (int YY = Yo; YY < Ye; YY++) { //second quarter left - int m = ceil(YY - Yo); - - if (m < 0) { - m = 0; - } - - radlimL[m] = sqrt(SQR(YY) + SQR(Xo)); - - float tetacur = xatan2f(YY, Xo); - float valedge = 00.f; - - for (int r = 0; r < radlimL[m] - (ar + 2); r++) { - sincosval = xsincosf(tetacur); - float xcur = r * sincosval.y; - float ycur = r * sincosval.x; - - int xxcur = ceil(lp.xc) + ceil(xcur) - begx; - xxcur = LIM (xxcur, 0, bfw - 1); - - int yycur = ceil(lp.yc) - ceil(ycur) - begy; - yycur = LIM (yycur, 0, bfh - 1); - valm = tmpsob->L[yycur][xxcur]; - CdEsobL[m][r] = Cdeltaesob[yycur][xxcur]; - LdEsobL[m][r] = Ldeltaesob[yycur][xxcur]; - LdEL[m][r] = Ldeltae[yycur][xxcur]; - CdEL[m][r] = Cdeltae[yycur][xxcur]; - - if (valm > valedge) { - valL[m][r] = valm; - - if (YY == 0) { - // printf ("YYL=%i m=%i r=%i val=%i \n", YY, m, r, (int) valL[m][r]); - } - } - } - } - - valm = 0.f; - - for (int XX = Xo; XX < Xe; XX++) { //third quarter bottom - int m = ceil(XX - Xo); - - if (m < 0) { - m = 0; - } - - radlimB[m] = sqrt(SQR(XX) + SQR(Yo)); - - float tetacur = xatan2f(Yo, XX); - float valedge = 0.f; - - for (int r = 0; r < radlimB[m] - (ar + 2); r++) { - sincosval = xsincosf(tetacur); - float xcur = r * sincosval.y; - float ycur = r * sincosval.x; - - int xxcur = ceil(lp.xc) + ceil(xcur) - begx; - xxcur = LIM (xxcur, 0, bfw - 1); - - int yycur = ceil(lp.yc) - ceil(ycur) - begy; // - before ceil(ycur) to convert YY ==> y - yycur = LIM (yycur, 0, bfh - 1); - valm = tmpsob->L[yycur][xxcur]; - CdEsobB[m][r] = Cdeltaesob[yycur][xxcur]; - LdEsobB[m][r] = Ldeltaesob[yycur][xxcur]; - LdEB[m][r] = Ldeltae[yycur][xxcur]; - CdEB[m][r] = Cdeltae[yycur][xxcur]; - - if (valm > valedge) { - // if(m > maxm) maxm = m; - valB[m][r] = valm; - - if (XX == 0) { - // printf ("XXB=%i m=%i r=%i val=%i \n", XX, m, r, (int) valB[m][r]); - } - } - } - } - - valm = 0.f; - - for (int YY = Yo; YY < Ye; YY++) { //fourth quarter right - int m = ceil(YY - Yo); - - if (m < 0) { - m = 0; - } - - radlimR[m] = sqrt(SQR(YY) + SQR(Xe)); - - float tetacur = xatan2f(YY, Xe); - float valedge = 00.f; - - for (int r = 0; r < radlimR[m] - (ar + 2); r++) { - sincosval = xsincosf(tetacur); - float xcur = r * sincosval.y; - float ycur = r * sincosval.x; - - int xxcur = ceil(lp.xc) + ceil(xcur) - begx; - xxcur = LIM (xxcur, 0, bfw - 1); - - int yycur = ceil(lp.yc) - ceil(ycur) - begy; - yycur = LIM (yycur, 0, bfh - 1); - valm = tmpsob->L[yycur][xxcur]; - CdEsobR[m][r] = Cdeltaesob[yycur][xxcur]; - LdEsobR[m][r] = Ldeltaesob[yycur][xxcur]; - LdER[m][r] = Ldeltae[yycur][xxcur]; - CdER[m][r] = Cdeltae[yycur][xxcur]; - - if (valm > valedge) { - valR[m][r] = valm; - - if (YY == 0) { - // printf ("YYR=%i m=%i r=%i val=%i \n", YY, m, r, (int) valR[m][r]); - } - } - } - } - - - - //second step : moving average to forgot isolate datas - // it seems that most of edge are among 3 or 4 pixels - // average convolution on 3 datas (only 'r' !) - // derivative function - for (int XX = Xo; XX < Xe; XX++) { //first quarter superior - int m = trunc(XX - Xo); - - if (m < 0) { - m = 0; - } - - float maxval = -10000.f; - int rmax = 0; - float maxso = -10000.f; - // int rmaxso = 0; - float maxch = -10000.f; - // int rmaxch = 0; - int rma = 0; - - //average convolution and first max - for (int r = 1; r < radlim[m] - (ar + 3); r++) { - val[m][r] = 0.333f * (val[m][r - 1] + val[m][r] + val[m][r + 1]); - CdE[m][r] = 0.333f * (CdE[m][r - 1] + CdE[m][r] + CdE[m][r + 1]); - LdE[m][r] = 0.333f * (LdE[m][r - 1] + LdE[m][r] + LdE[m][r + 1]); - CdEsob[m][r] = 0.333f * (CdEsob[m][r - 1] + CdEsob[m][r] + CdEsob[m][r + 1]); - LdEsob[m][r] = 0.333f * (LdEsob[m][r - 1] + LdEsob[m][r] + LdEsob[m][r + 1]); - - if (val[m][r] > maxval) { - maxval = val[m][r]; - rmax = r; - } - } - - maxsob[m] = maxval; - - float meanbe = 0.f; - float meanaf = 0.f; - int nbbef = 0; - int nbaft = 0; - - for (int r = 2; r < radlim[m] - (ar + 4); r++) { - if (r < rmax - 1) { - meanbe += val[m][r]; - nbbef ++; - } - - if (r > rmax + 1) { - meanaf += val[m][r]; - nbaft ++; - } - - if (val[m][r] < 0.4f * sobelrefs[1]) { // TODO Locallab Correct ? - rma = r; - break; - } - } - - rad[m] = rma; - - meanbe /= nbbef; - meanaf /= nbaft; - meanbef[m] = meanbe; - meanaft[m] = meanaf; - - if (XX == 0) { - - printf(" maxsob=%i ram=%i meanbef=%i meanaft=%i\n", (int) maxsob[m], rmax, (int) meanbef[m], (int) meanaft[m]); - } - - //derivative function on 2 values - for (int r = 2; r < radlim[m] - (ar + 6); r++) { - Soderiv[m][r] = (val[m][r] - val[m][r + 2]); - Chderiv[m][r] = (CdEsob[m][r] - CdEsob[m][r + 2]); - Luderiv[m][r] = (LdEsob[m][r] - LdEsob[m][r + 2]); - - if (XX == 0) { - - // printf("X=%i m=%i r=%i So=%i Chd=%i Ld=%i Sdri=%i Csodri=%i Lsodri=%i\n", XX, m, r, (int) val[m][r], (int)CdE[m][r], (int)LdE[m][r], (int) Soderiv[m][r], (int) Chderiv[m][r], (int) Luderiv[m][r]); - } - - // if(val[m][r] < 1.5f* sobelrefs[1]) rad[m] = r; - } - - //pseudo second derivative - //find maxi of derivative and also change sign - for (int r = 2; r < radlim[m] - (ar + 6); r++) { - if (r + 4 < radlim[m] - (ar + 6)) { - if (signbit(Chderiv[m][r]) + signbit(Chderiv[m][r + 4]) == 1) { //one is positive and one is negative - Chderiv2[m][r] = fabs(Chderiv[m][r] - Chderiv[m][r + 4]); - } - - if (signbit(Soderiv[m][r]) + signbit(Soderiv[m][r + 4]) == 1) { //one is positive and one is negative - Soderiv2[m][r] = fabs(Soderiv[m][r] - Soderiv[m][r + 4]); - } - - if (signbit(Luderiv[m][r]) + signbit(Luderiv[m][r + 4]) == 1) { //one is positive and one is negative - Luderiv2[m][r] = fabs(Luderiv[m][r] - Luderiv[m][r + 4]); - } - - Totalderiv2[m][r] = Luderiv2[m][r] + Chderiv2[m][r] + Soderiv2[m][r]; - - if (Chderiv2[m][r] > maxch) { - maxch = Chderiv2[m][r]; - // rmaxch = r; - } - - - if (Soderiv2[m][r] > maxso) { - maxso = Soderiv2[m][r]; - // rmaxso = r; - } - - } - - if (XX == 0) { - - // printf("X=%i m=%i r=%i So=%i Chd=%i Ld=%i Sdri2=%i Cdri2=%i Ldri2=%i To=%i\n", XX, m, r, (int) val[m][r], (int)CdE[m][r], (int)LdE[m][r], (int) Soderiv2[m][r], (int) Chderiv2[m][r], (int) Luderiv2[m][r], (int) Totalderiv2[m][r]); - } - - - } - - //we must now calculate rad[m] in function of others criterail - // rad[m] = rmaxch; - // if(val[m][r] < 1.5f* sobelrefs[1]) rad[m] = r; - - - } - - for (int YY = Yo; YY < Ye; YY++) { //second quarter left - int m = ceil(YY - Yo); - - if (m < 0) { - m = 0; - } - - //average convolution and first max - for (int r = 1; r < radlimL[m] - (ar + 3); r++) { - valL[m][r] = 0.333f * (valL[m][r - 1] + valL[m][r] + valL[m][r + 1]); - CdEL[m][r] = 0.333f * (CdEL[m][r - 1] + CdEL[m][r] + CdEL[m][r + 1]); - LdEL[m][r] = 0.333f * (LdEL[m][r - 1] + LdEL[m][r] + LdEL[m][r + 1]); - CdEsobL[m][r] = 0.333f * (CdEsobL[m][r - 1] + CdEsobL[m][r] + CdEsobL[m][r + 1]); - LdEsobL[m][r] = 0.333f * (LdEsobL[m][r - 1] + LdEsobL[m][r] + LdEsobL[m][r + 1]); - } - - //derivative function on 2 values - for (int r = 2; r < radlimL[m] - (ar + 6); r++) { - SoderivL[m][r] = (valL[m][r] - valL[m][r + 2]); - ChderivL[m][r] = (CdEsobL[m][r] - CdEsobL[m][r + 2]); - LuderivL[m][r] = (LdEsobL[m][r] - LdEsobL[m][r + 2]); - - if (YY == 0) { - - // printf("Y=%i m=%i r=%i So=%i Chd=%i Ld=%i Sdri=%i Csodri=%i Lsodri=%i\n", YY, m, r, (int) valL[m][r], (int)CdEL[m][r], (int)LdEL[m][r], (int) SoderivL[m][r], (int) ChderivL[m][r], (int) LuderivL[m][r]); - } - } - } - - - for (int XX = Xo; XX < Xe; XX++) { //third quarter inf - int m = trunc(XX - Xo); - - if (m < 0) { - m = 0; - } - - //average convolution and first max - for (int r = 1; r < radlimB[m] - (ar + 3); r++) { - valB[m][r] = 0.333f * (valB[m][r - 1] + valB[m][r] + valB[m][r + 1]); - CdEB[m][r] = 0.333f * (CdEB[m][r - 1] + CdEB[m][r] + CdEB[m][r + 1]); - LdEB[m][r] = 0.333f * (LdEB[m][r - 1] + LdEB[m][r] + LdEB[m][r + 1]); - CdEsobB[m][r] = 0.333f * (CdEsobB[m][r - 1] + CdEsobB[m][r] + CdEsobB[m][r + 1]); - LdEsobB[m][r] = 0.333f * (LdEsobB[m][r - 1] + LdEsobB[m][r] + LdEsobB[m][r + 1]); - } - - //derivative function on 2 values - for (int r = 2; r < radlimB[m] - (ar + 6); r++) { - SoderivB[m][r] = (valB[m][r] - valB[m][r + 2]); - ChderivB[m][r] = (CdEsobB[m][r] - CdEsobB[m][r + 2]); - LuderivB[m][r] = (LdEsobB[m][r] - LdEsobB[m][r + 2]); - - if (XX == Xe / 2) { - - // printf("X=%i m=%i r=%i So=%i Chd=%i Ld=%i Sdri=%i Csodri=%i Lsodri=%i\n", XX, m, r, (int) valB[m][r], (int)CdEB[m][r], (int)LdEB[m][r], (int) SoderivB[m][r], (int) ChderivB[m][r], (int) LuderivB[m][r]); - } - } - } - - for (int YY = Yo; YY < Ye; YY++) { //second quarter left - int m = ceil(YY - Yo); - - if (m < 0) { - m = 0; - } - - //average convolution and first max - for (int r = 1; r < radlimR[m] - (ar + 3); r++) { - valR[m][r] = 0.333f * (valR[m][r - 1] + valR[m][r] + valR[m][r + 1]); - CdER[m][r] = 0.333f * (CdER[m][r - 1] + CdER[m][r] + CdER[m][r + 1]); - LdER[m][r] = 0.333f * (LdER[m][r - 1] + LdER[m][r] + LdER[m][r + 1]); - CdEsobR[m][r] = 0.333f * (CdEsobR[m][r - 1] + CdEsobR[m][r] + CdEsobR[m][r + 1]); - LdEsobR[m][r] = 0.333f * (LdEsobR[m][r - 1] + LdEsobR[m][r] + LdEsobR[m][r + 1]); - } - - //derivative function on 2 values - for (int r = 2; r < radlimR[m] - (ar + 6); r++) { - SoderivR[m][r] = (valR[m][r] - valR[m][r + 2]); - ChderivR[m][r] = (CdEsobR[m][r] - CdEsobR[m][r + 2]); - LuderivR[m][r] = (LdEsobR[m][r] - LdEsobR[m][r + 2]); - - if (YY == 0) { - - //printf("Y=%i m=%i r=%i So=%i Chd=%i Ld=%i Sdri=%i Csodri=%i Lsodri=%i\n", YY, m, r, (int) valR[m][r], (int)CdER[m][r], (int)LdER[m][r], (int) SoderivR[m][r], (int) ChderivR[m][r], (int) LuderivR[m][r]); - } - } - } - - //real algo to find good radius - - - // put good values in delatasobelL - for (int XX = Xo; XX < Xe; XX++) { //first quarter superior - int m = trunc(XX - Xo); - - if (m < 0) { - m = 0; - } - - radlim[m] = sqrt(SQR(XX) + SQR(Ye)); - - float tetacur = xatan2f(Ye, XX); - // float valedge = 0.f; - - for (int r = 0; r < radlim[m] - (ar + 2); r++) { - sincosval = xsincosf(tetacur); - float xcur = r * sincosval.y; - float ycur = r * sincosval.x; - - int xxcur = trunc(lp.xc) + trunc(xcur) - begx; - xxcur = LIM (xxcur, 0, bfw - 1); - - int yycur = trunc(lp.yc) - trunc(ycur) - begy; // - before ceil(ycur) to convert YY ==> y - yycur = LIM (yycur, 0, bfh - 1); - - if (r > rad[m]) { - deltasobelL->L[yycur][xxcur] = 0.f; - } - - } - } - - delete[] radlimR; - delete[] radR; - - delete[] radlimB; - delete[] radB; - - delete[] radlimL; - delete[] radL; - - delete[] radlim; - delete[] rad; - delete[] maxsob; - delete[] meanaft; - delete[] meanbef; - - - - } - //then restore non modified area //TODO then use instead of others modifications Color and Light, Blur, etc. @@ -9056,7 +8014,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu noiseccb = 0.0001f; } - if (!adecomp.memoryAllocationFailed && !bdecomp.memoryAllocationFailed) { if (levred == 7) { @@ -9880,7 +8837,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu LabImage *bufexporig = nullptr; LabImage *bufexpfin = nullptr; - LabImage *difLab = nullptr; int bfh = int (lp.ly + lp.lyT) + del; //bfw bfh real size of square zone int bfw = int (lp.lx + lp.lxL) + del; @@ -9894,7 +8850,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu bufexporig = new LabImage(bfw, bfh); //buffer for data in zone limit bufexpfin = new LabImage(bfw, bfh); //buffer for data in zone limit - difLab = new LabImage(bfw, bfh); //buffer for data in zone limit #ifdef _OPENMP @@ -9968,7 +8923,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu } } - Expo_vibr_Local(moddE, powdE, 2, nullptr, buflight, bufl_ab, nullptr, nullptr, hueplus, huemoins, hueref, dhuev, chromaref, lumaref, lp, original, transformed, difLab, bufexpfin, cx, cy, sk); + Expo_vibr_Local(2, bufexporig, nullptr, buflight, bufl_ab, nullptr, nullptr, hueref, chromaref, lumaref, sobelref, nullptr, lp, original, transformed, cx, cy, sk); //call Expo_vibr_Local with first parameter = 2 for vibrance } @@ -9977,7 +8932,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu delete bufexporig; delete bufexpfin; - delete difLab; } @@ -10255,7 +9209,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu LabImage *bufexporig = nullptr; LabImage *bufexpfin = nullptr; - LabImage *difLab = nullptr; int bfh = int (lp.ly + lp.lyT) + del; //bfw bfh real size of square zone int bfw = int (lp.lx + lp.lxL) + del; @@ -10269,7 +9222,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu bufexporig = new LabImage(bfw, bfh); //buffer for data in zone limit bufexpfin = new LabImage(bfw, bfh); //buffer for data in zone limit - difLab = new LabImage(bfw, bfh); //buffer for data in zone limit #ifdef _OPENMP @@ -10341,7 +9293,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu } } - Expo_vibr_Local(moddE, powdE, 3, nullptr, buflight, bufl_ab, nullptr, nullptr, hueplus, huemoins, hueref, dhuesf, chromaref, lumaref, lp, original, transformed, difLab, bufexpfin, cx, cy, sk); + Expo_vibr_Local(3, bufexporig, nullptr, buflight, bufl_ab, nullptr, nullptr, hueref, chromaref, lumaref, sobelref, nullptr, lp, original, transformed, cx, cy, sk); } @@ -10349,7 +9301,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu delete bufexporig; delete bufexpfin; - delete difLab; } @@ -10357,7 +9308,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu } - //local contrast if (lp.lcamount > 0.f && call < 3 && lp.lcena) { //interior ellipse for sharpening, call = 1 and 2 only with Dcrop and simpleprocess int bfh = call == 2 ? int (lp.ly + lp.lyT) + del : original->H; //bfw bfh real size of square zone @@ -10646,7 +9596,8 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu if (!lp.invret) { - Reti_Local(moddE, powdE, buflight, bufchro, hueplus, huemoins, hueref, dhueret, chromaref, lumaref, lp, original, transformed, tmpl, cx, cy, 0, sk); + // Reti_Local(moddE, powdE, buflight, bufchro, hueplus, huemoins, hueref, dhueret, chromaref, lumaref, lp, original, transformed, tmpl, cx, cy, 0, sk); + Reti_Local(moddE, powdE, buflight, bufchro, hueplus, huemoins, hueref, dhueret, chromaref, lumaref, lp, original, transformed, bufreti, cx, cy, 0, sk); } else { InverseReti_Local(lp, original, transformed, tmpl, cx, cy, 0); } @@ -10749,9 +9700,500 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu } } + + if (lp.exposena && (lp.expcomp != 0.f || lp.war != 0 || lp.showmaskexpmet == 2 || lp.enaExpMask || lp.showmaskexpmet == 3 || lp.showmaskexpmet == 4 || (exlocalcurve && localexutili))) { //interior ellipse renforced lightness and chroma //locallutili + float hueplus = hueref + dhueex; + float huemoins = hueref - dhueex; + + + if (hueplus > rtengine::RT_PI) { + hueplus = hueref + dhueex - 2.f * rtengine::RT_PI; + } + + if (huemoins < -rtengine::RT_PI) { + huemoins = hueref - dhueex + 2.f * rtengine::RT_PI; + } + + LabImage *bufexporig = nullptr; + LabImage *bufexpfin = nullptr; + LabImage *bufexptemp = nullptr; + LabImage *bufcat02fin = nullptr; + LabImage *bufmaskorigexp = nullptr; + LabImage *bufmaskblurexp = nullptr; + LabImage *originalmaskexp = nullptr; + + int bfh = 0.f, bfw = 0.f; + bfh = int (lp.ly + lp.lyT) + del; //bfw bfh real size of square zone + bfw = int (lp.lx + lp.lxL) + del; + JaggedArray buflight(bfw, bfh); + JaggedArray bufl_ab(bfw, bfh); + JaggedArray buflightcurv(bfw, bfh); + JaggedArray buf_a_cat(bfw, bfh, true); + JaggedArray buf_b_cat(bfw, bfh, true); + JaggedArray blend2(bfw, bfh); + + + if (call <= 3) { //simpleprocess, dcrop, improccoordinator + + + bufexporig = new LabImage(bfw, bfh); + bufexpfin = new LabImage(bfw, bfh); + bufexptemp = new LabImage(bfw, bfh); + bufcat02fin = new LabImage(bfw, bfh); + + if (lp.showmaskexpmet == 2 || lp.enaExpMask || lp.showmaskexpmet == 3) { + int GWm = transformed->W; + int GHm = transformed->H; + bufmaskorigexp = new LabImage(bfw, bfh); + bufmaskblurexp = new LabImage(bfw, bfh); + originalmaskexp = new LabImage(GWm, GHm); + } + + +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int ir = 0; ir < bfh; ir++) //fill with 0 + for (int jr = 0; jr < bfw; jr++) { + bufexporig->L[ir][jr] = 0.f; + bufexporig->a[ir][jr] = 0.f; + bufexporig->b[ir][jr] = 0.f; + + if (lp.showmaskexpmet == 2 || lp.enaExpMask || lp.showmaskexpmet == 3) { + bufmaskorigexp->L[ir][jr] = 0.f; + bufmaskorigexp->a[ir][jr] = 0.f; + bufmaskorigexp->b[ir][jr] = 0.f; + bufmaskblurexp->L[ir][jr] = 0.f; + bufmaskblurexp->a[ir][jr] = 0.f; + bufmaskblurexp->b[ir][jr] = 0.f; + } + + bufexptemp->L[ir][jr] = 0.f; + bufexptemp->a[ir][jr] = 0.f; + bufexptemp->b[ir][jr] = 0.f; + bufexpfin->L[ir][jr] = 0.f; + bufexpfin->a[ir][jr] = 0.f; + bufexpfin->b[ir][jr] = 0.f; + bufcat02fin->L[ir][jr] = 0.f; + bufcat02fin->a[ir][jr] = 0.f; + bufcat02fin->b[ir][jr] = 0.f; + buflight[ir][jr] = 0.f; + bufl_ab[ir][jr] = 0.f; + buflightcurv[ir][jr] = 0.f; + buf_a_cat[ir][jr] = 0.f; + buf_b_cat[ir][jr] = 0.f; + } + + int begy = lp.yc - lp.lyT; + int begx = lp.xc - lp.lxL; + int yEn = lp.yc + lp.ly; + int xEn = lp.xc + lp.lx; + +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < transformed->H ; y++) //{ + for (int x = 0; x < transformed->W; x++) { + int lox = cx + x; + int loy = cy + y; + + if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + bufexporig->L[loy - begy][lox - begx] = original->L[y][x]; + } + } + + const float radius = 3.f / (sk * 1.4f); + int spotSi = 1 + 2 * max(1, lp.cir / sk); + + if (spotSi < 5) { + spotSi = 5; + } + + if (bfw > 2 * spotSi && bfh > 2 * spotSi && lp.struexp > 0.f) { + SobelCannyLuma(blend2, bufexporig->L, bfw, bfh, radius); + array2D ble(bfw, bfh); + array2D guid(bfw, bfh); +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + ble[ir][jr] = blend2[ir][jr] / 32768.f; + guid[ir][jr] = bufexporig->L[ir][jr] / 32768.f; + } + + float blur = 25 / sk * (10.f + 1.2f * lp.struexp); + + rtengine::guidedFilter(guid, ble, ble, blur, 0.001, multiThread); + +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + blend2[ir][jr] = ble[ir][jr] * 32768.f; + } + + bool execmedian = true; + int passes = 1; + + if (execmedian) { + float** tmL; + int wid = bfw; + int hei = bfh; + tmL = new float*[hei]; + + for (int i = 0; i < hei; ++i) { + tmL[i] = new float[wid]; + } + + Median medianTypeL = Median::TYPE_3X3_STRONG; + Median_Denoise(blend2, blend2, wid, hei, medianTypeL, passes, multiThread, tmL); + + for (int i = 0; i < hei; ++i) { + delete[] tmL[i]; + } + + delete[] tmL; + } + + if (lp.showmaskexpmet == 4) { +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < transformed->H ; y++) + for (int x = 0; x < transformed->W; x++) { + int lox = cx + x; + int loy = cy + y; + int zone = 0; + float localFactor = 1.f; + const float achm = (float)lp.trans / 100.f; + + if (lp.shapmet == 0) { + calcTransition(lox, loy, achm, lp, zone, localFactor); + } else if (lp.shapmet == 1) { + calcTransitionrect(lox, loy, achm, lp, zone, localFactor); + } + + if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + if (zone > 0) { + transformed->L[y][x] = blend2[loy - begy][lox - begx]; + transformed->a[y][x] = 0.f; + transformed->b[y][x] = 0.f; + } + } + } + + return; + } + + + } + + +#ifdef _OPENMP + // #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < transformed->H ; y++) //{ + for (int x = 0; x < transformed->W; x++) { + int lox = cx + x; + int loy = cy + y; + + if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + if (lp.showmaskexpmet == 2 || lp.enaExpMask || lp.showmaskexpmet == 3) { + bufmaskorigexp->L[loy - begy][lox - begx] = original->L[y][x]; + bufmaskorigexp->a[loy - begy][lox - begx] = original->a[y][x]; + bufmaskorigexp->b[loy - begy][lox - begx] = original->b[y][x]; + bufmaskblurexp->L[loy - begy][lox - begx] = original->L[y][x]; + bufmaskblurexp->a[loy - begy][lox - begx] = original->a[y][x]; + bufmaskblurexp->b[loy - begy][lox - begx] = original->b[y][x]; + } + + bufexporig->L[loy - begy][lox - begx] = original->L[y][x]; + bufexporig->a[loy - begy][lox - begx] = original->a[y][x]; + bufexporig->b[loy - begy][lox - begx] = original->b[y][x]; + + float valLLexp = 0.f; + float valCC = 0.f; + float valHH = 0.f; + float kmaskLexp = 0; + float kmaskCa = 0; + float kmaskCb = 0; + + float kmaskHL = 0; + float kmaskHa = 0; + float kmaskHb = 0; + + + if (lp.showmaskexpmet == 2 || lp.enaExpMask || lp.showmaskexpmet == 3) { + + if (locllmasexpCurve && llmasexputili) { + float ligh = (bufexporig->L[loy - begy][lox - begx]) / 32768.f; + valLLexp = (float)(locllmasexpCurve[500.f * ligh]); + valLLexp = 1.f - valLLexp; + kmaskLexp = 32768.f * valLLexp; + } + + if (locccmasexpCurve && lcmasexputili) { + float chromask = 0.0001f + (sqrt(SQR(bufexporig->a[loy - begy][lox - begx]) + SQR(bufexporig->b[loy - begy][lox - begx]))); + float chromaskr = chromask / 45000.f; + valCC = float (locccmasexpCurve[500.f * chromaskr]); + valCC = 1.f - valCC; + kmaskCa = valCC; + kmaskCb = valCC; + } + + + if (lochhmasexpCurve && lhmasexputili) { + float huema = xatan2f(bufexporig->b[loy - begy][lox - begx], bufexporig->a[loy - begy][lox - begx]); + float h = Color::huelab_to_huehsv2(huema); + h += 1.f / 6.f; + + if (h > 1.f) { + h -= 1.f; + } + + valHH = float (lochhmasexpCurve[500.f * h]); + valHH = 1.f - valHH; + kmaskHa = valHH; + kmaskHb = valHH; + kmaskHL = 32768.f * valHH; + } + + bufmaskblurexp->L[loy - begy][lox - begx] = CLIPLOC(kmaskLexp + kmaskHL); + bufmaskblurexp->a[loy - begy][lox - begx] = CLIPC(kmaskCa + kmaskHa); + bufmaskblurexp->b[loy - begy][lox - begx] = CLIPC(kmaskCb + kmaskHb); + + + } + + } + } + + float radiusb = 3.f / sk; + + if (lp.showmaskexpmet == 2 || lp.enaExpMask || lp.showmaskexpmet == 3) { + +#ifdef _OPENMP + #pragma omp parallel +#endif + { + gaussianBlur(bufmaskblurexp->L, bufmaskorigexp->L, bfw, bfh, radiusb); + gaussianBlur(bufmaskblurexp->a, bufmaskorigexp->a, bfw, bfh, radiusb); + gaussianBlur(bufmaskblurexp->b, bufmaskorigexp->b, bfw, bfh, radiusb); + } + + delete bufmaskblurexp; + + + if (lp.showmaskexpmet != 3 || lp.enaExpMask) { + +#ifdef _OPENMP +// #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < transformed->H ; y++) //{ + for (int x = 0; x < transformed->W; x++) { + int lox = cx + x; + int loy = cy + y; + int zone = 0; + + float localFactor = 1.f; + const float achm = (float)lp.trans / 100.f; + + if (lp.shapmet == 0) { + calcTransition(lox, loy, achm, lp, zone, localFactor); + } else if (lp.shapmet == 1) { + calcTransitionrect(lox, loy, achm, lp, zone, localFactor); + } + + if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + if (zone > 0) { + bufexporig->L[loy - begy][lox - begx] = bufexporig->L[loy - begy][lox - begx] + (lp.blendmaexp * bufmaskorigexp->L[loy - begy][lox - begx]); + bufexporig->a[loy - begy][lox - begx] = bufexporig->a[loy - begy][lox - begx] * (1.f + lp.blendmaexp * bufmaskorigexp->a[loy - begy][lox - begx]); + bufexporig->b[loy - begy][lox - begx] = bufexporig->b[loy - begy][lox - begx] * (1.f + lp.blendmaexp * bufmaskorigexp->b[loy - begy][lox - begx]); + + bufexporig->L[loy - begy][lox - begx] = CLIP(bufexporig->L[loy - begy][lox - begx]); + bufexporig->a[loy - begy][lox - begx] = CLIPC(bufexporig->a[loy - begy][lox - begx]); + bufexporig->b[loy - begy][lox - begx] = CLIPC(bufexporig->b[loy - begy][lox - begx]); + + originalmaskexp->L[y][x] = CLIP(bufexporig->L[loy - begy][lox - begx] - bufmaskorigexp->L[loy - begy][lox - begx]); + originalmaskexp->a[y][x] = CLIPC(bufexporig->a[loy - begy][lox - begx] * (1.f - bufmaskorigexp->a[loy - begy][lox - begx])); + originalmaskexp->b[y][x] = CLIPC(bufexporig->b[loy - begy][lox - begx] * (1.f - bufmaskorigexp->b[loy - begy][lox - begx])); + } + } + } + + delete bufmaskorigexp; + + } else if (lp.showmaskexpmet == 3) { +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < transformed->H ; y++) //{ + for (int x = 0; x < transformed->W; x++) { + int lox = cx + x; + int loy = cy + y; + int zone = 0; + float localFactor = 1.f; + const float achm = (float)lp.trans / 100.f; + + if (lp.shapmet == 0) { + calcTransition(lox, loy, achm, lp, zone, localFactor); + } else if (lp.shapmet == 1) { + calcTransitionrect(lox, loy, achm, lp, zone, localFactor); + } + + if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + if (zone > 0) { + transformed->L[y][x] = CLIPLOC(bufmaskorigexp->L[loy - begy][lox - begx]); + transformed->a[y][x] = bufexporig->a[loy - begy][lox - begx] * (bufmaskorigexp->a[loy - begy][lox - begx]); + transformed->b[y][x] = bufexporig->b[loy - begy][lox - begx] * (bufmaskorigexp->b[loy - begy][lox - begx]); + } + } + } + + delete bufmaskorigexp; + delete bufexporig; + + return; + } + } + + + if (lp.showmaskexpmet == 0 || lp.showmaskexpmet == 1 || lp.showmaskexpmet == 2 || lp.enaExpMask) { + +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < transformed->H ; y++) //{ + for (int x = 0; x < transformed->W; x++) { + int lox = cx + x; + int loy = cy + y; + + if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + + bufexptemp->L[loy - begy][lox - begx] = original->L[y][x]; + bufexptemp->a[loy - begy][lox - begx] = original->a[y][x]; + bufexptemp->b[loy - begy][lox - begx] = original->b[y][x]; + bufexpfin->L[loy - begy][lox - begx] = original->L[y][x]; + bufexpfin->a[loy - begy][lox - begx] = original->a[y][x]; + bufexpfin->b[loy - begy][lox - begx] = original->b[y][x]; + } + } + +//to do Modulate bufexporig and bufexptemp with blend L, H, C and masks + + + if (exlocalcurve && localexutili) {// L=f(L) curve enhanced +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < transformed->H ; y++) //{ + for (int x = 0; x < transformed->W; x++) { + int lox = cx + x; + int loy = cy + y; + + if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + + float lighn = bufexporig->L[loy - begy][lox - begx]; + + float lh; + lh = 0.5f * exlocalcurve[2.f * lighn]; // / ((lighn) / 1.9f) / 3.61f; //lh between 0 and 0 50 or more + bufexptemp->L[loy - begy][lox - begx] = lh; + } + } + + if (lp.expcomp == 0.f) { + lp.expcomp = 0.1f; // to enabled + } + + ImProcFunctions::exlabLocal(lp, bfh, bfw, bufexptemp, bufexpfin, hltonecurveloc, shtonecurveloc, tonecurveloc); + + + } else { + + ImProcFunctions::exlabLocal(lp, bfh, bfw, bufexporig, bufexpfin, hltonecurveloc, shtonecurveloc, tonecurveloc); + } + + //cat02 + if (params->locallab.spots.at(sp).warm != 0) { + ImProcFunctions::ciecamloc_02float(sp, bufexpfin, bufcat02fin); + } else { +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + bufcat02fin->L[ir][jr] = bufexpfin->L[ir][jr]; + bufcat02fin->a[ir][jr] = bufexpfin->a[ir][jr]; + bufcat02fin->b[ir][jr] = bufexpfin->b[ir][jr]; + } + } + + + +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < transformed->H ; y++) //{ + for (int x = 0; x < transformed->W; x++) { + int lox = cx + x; + int loy = cy + y; + + if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + + float rL; + rL = CLIPRET((bufcat02fin->L[loy - begy][lox - begx] - bufexporig->L[loy - begy][lox - begx]) / 328.f); + + buflight[loy - begy][lox - begx] = rL; + float rA; + rA = CLIPRET((bufcat02fin->a[loy - begy][lox - begx] - bufexporig->a[loy - begy][lox - begx]) / 328.f); + buf_a_cat[loy - begy][lox - begx] = rA; + + + float rB; + rB = CLIPRET((bufcat02fin->b[loy - begy][lox - begx] - bufexporig->b[loy - begy][lox - begx]) / 328.f); + buf_b_cat[loy - begy][lox - begx] = rB; + + + } + } + } + + Expo_vibr_Local(1, bufexporig, originalmaskexp, buflight, bufl_ab, buf_a_cat, buf_b_cat, hueref, chromaref, lumaref, sobelref, blend2, lp, original, transformed, cx, cy, sk); + //view mask + } + + if (call <= 3) { + + delete bufexporig; + delete bufexpfin; + delete bufexptemp; + delete bufcat02fin; + + if (lp.showmaskexpmet == 2 || lp.enaExpMask || lp.showmaskexpmet == 3) { + delete originalmaskexp; + } + } + + } + + //local color and light - if (!lp.inv && (lp.chro != 0 || lp.ligh != 0.f || lp.cont != 0 || lp.qualcurvemet != 0 || lp.showmaskcolmet >= 2 || lp.enaColorMask) && lp.colorena) { // || lllocalcurve)) { //interior ellipse renforced lightness and chroma //locallutili + if (!lp.inv && (lp.chro != 0 || lp.ligh != 0.f || lp.cont != 0 || lp.qualcurvemet != 0 || lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3 || lp.showmaskcolmet == 4) && lp.colorena) { // || lllocalcurve)) { //interior ellipse renforced lightness and chroma //locallutili float hueplus = hueref + dhue; float huemoins = hueref - dhue; @@ -10763,12 +10205,13 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu huemoins = hueref - dhue + 2.f * rtengine::RT_PI; } - +//provisory fixe for contrast slider does not work at all + // lp.cont = 0; LabImage *bufcolorig = nullptr; - LabImage *bufmaskorig = nullptr; - LabImage *bufmaskblur = nullptr; - LabImage *originalmask = nullptr; + LabImage *bufmaskorigcol = nullptr; + LabImage *bufmaskblurcol = nullptr; + LabImage *originalmaskcol = nullptr; float chpro = 1.f; float cligh = 1.f; @@ -10782,9 +10225,12 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu JaggedArray buflightslid(bfw, bfh); JaggedArray bufchroslid(bfw, bfh); JaggedArray bufhh(bfw, bfh); + JaggedArray blend2(bfw, bfh); + JaggedArray buforigchro(bfw, bfh); float adjustr = 1.0f; + //adapt chroma to working profile if (params->icm.workingProfile == "ProPhoto") { adjustr = 1.2f; // 1.2 instead 1.0 because it's very rare to have C>170.. @@ -10804,8 +10250,14 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu if (call <= 3) { //simpleprocess, dcrop, improccoordinator bufcolorig = new LabImage(bfw, bfh); - bufmaskorig = new LabImage(bfw, bfh); - bufmaskblur = new LabImage(bfw, bfh); + + if (lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3) { + bufmaskorigcol = new LabImage(bfw, bfh); + bufmaskblurcol = new LabImage(bfw, bfh); + int GWm = transformed->W; + int GHm = transformed->H; + originalmaskcol = new LabImage(GWm, GHm); + } #ifdef _OPENMP #pragma omp parallel for @@ -10816,9 +10268,16 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu bufcolorig->L[ir][jr] = 0.f; bufcolorig->a[ir][jr] = 0.f; bufcolorig->b[ir][jr] = 0.f; - bufmaskorig->L[ir][jr] = 0.f; - bufmaskorig->a[ir][jr] = 0.f; - bufmaskorig->b[ir][jr] = 0.f; + + if (lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3) { + bufmaskorigcol->L[ir][jr] = 0.f; + bufmaskorigcol->a[ir][jr] = 0.f; + bufmaskorigcol->b[ir][jr] = 0.f; + bufmaskblurcol->L[ir][jr] = 0.f; + bufmaskblurcol->a[ir][jr] = 0.f; + bufmaskblurcol->b[ir][jr] = 0.f; + } + bufchro[ir][jr] = 0.f; bufchroslid[ir][jr] = 0.f; buflightslid[ir][jr] = 0.f; @@ -10830,7 +10289,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu int begx = lp.xc - lp.lxL; int yEn = lp.yc + lp.ly; int xEn = lp.xc + lp.lx; - #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -10841,66 +10299,177 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu int loy = cy + y; if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { - bufmaskorig->L[loy - begy][lox - begx] = original->L[y][x]; - bufmaskorig->a[loy - begy][lox - begx] = original->a[y][x]; - bufmaskorig->b[loy - begy][lox - begx] = original->b[y][x]; + bufcolorig->L[loy - begy][lox - begx] = original->L[y][x]; + // buforigchro[loy - begy][lox - begx] = sqrt(SQR(original->a[y][x]) + SQR(original->b[y][x])); + } + } + + const float radius = 3.f / (sk * 1.4f); + int spotSi = 1 + 2 * max(1, lp.cir / sk); + + if (spotSi < 5) { + spotSi = 5; + } + + if (bfw > 2 * spotSi && bfh > 2 * spotSi && lp.struco > 0.f) { + SobelCannyLuma(blend2, bufcolorig->L, bfw, bfh, radius); + array2D ble(bfw, bfh); + array2D blec(bfw, bfh); + array2D guid(bfw, bfh); +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + ble[ir][jr] = blend2[ir][jr] / 32768.f; + guid[ir][jr] = bufcolorig->L[ir][jr] / 32768.f; + } + + float blur = 25 / sk * (10.f + 1.2f * lp.struco); + printf("Blur=%f \n", blur); + + rtengine::guidedFilter(guid, ble, ble, blur, 0.001, multiThread); + // rtengine::guidedFilter(guid, blec, blec, blur, 0.001, multiThread); + +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + blend2[ir][jr] = ble[ir][jr] * 32768.f; + } + + bool execmedian = true; + int passes = 1; + + if (execmedian) { + float** tmL; + int wid = bfw; + int hei = bfh; + tmL = new float*[hei]; + + for (int i = 0; i < hei; ++i) { + tmL[i] = new float[wid]; + } + + Median medianTypeL = Median::TYPE_3X3_STRONG; + Median_Denoise(blend2, blend2, wid, hei, medianTypeL, passes, multiThread, tmL); + + for (int i = 0; i < hei; ++i) { + delete[] tmL[i]; + } + + delete[] tmL; + } + + if (lp.showmaskcolmet == 4) { +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < transformed->H ; y++) //{ + for (int x = 0; x < transformed->W; x++) { + int lox = cx + x; + int loy = cy + y; + int zone = 0; + float localFactor = 1.f; + const float achm = (float)lp.trans / 100.f; + + if (lp.shapmet == 0) { + calcTransition(lox, loy, achm, lp, zone, localFactor); + } else if (lp.shapmet == 1) { + calcTransitionrect(lox, loy, achm, lp, zone, localFactor); + } + + if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + if (zone > 0) { + transformed->L[y][x] = blend2[loy - begy][lox - begx]; + transformed->a[y][x] = 0.f; + transformed->b[y][x] = 0.f; + } + } + } + + return; + } + + + } + +#ifdef _OPENMP + // #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < transformed->H ; y++) //{ + for (int x = 0; x < transformed->W; x++) { + int lox = cx + x; + int loy = cy + y; + + if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + if (lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3) { + bufmaskorigcol->L[loy - begy][lox - begx] = original->L[y][x]; + bufmaskorigcol->a[loy - begy][lox - begx] = original->a[y][x]; + bufmaskorigcol->b[loy - begy][lox - begx] = original->b[y][x]; + bufmaskblurcol->L[loy - begy][lox - begx] = original->L[y][x]; + bufmaskblurcol->a[loy - begy][lox - begx] = original->a[y][x]; + bufmaskblurcol->b[loy - begy][lox - begx] = original->b[y][x]; + } + bufcolorig->L[loy - begy][lox - begx] = original->L[y][x]; bufcolorig->a[loy - begy][lox - begx] = original->a[y][x]; bufcolorig->b[loy - begy][lox - begx] = original->b[y][x]; - bufmaskblur->L[loy - begy][lox - begx] = original->L[y][x]; - bufmaskblur->a[loy - begy][lox - begx] = original->a[y][x]; - bufmaskblur->b[loy - begy][lox - begx] = original->b[y][x]; float valLL = 0.f; float valCC = 0.f; float valHH = 0.f; - float2 sincosval; float kmaskL = 0; float kmaskCa = 0; float kmaskCb = 0; - + float kmaskHL = 0; float kmaskHa = 0; float kmaskHb = 0; - if (lp.showmaskcolmet >= 2 || lp.enaColorMask) { - if (locllmasCurve) { - valLL = (float)(locllmasCurve[500.f * (bufcolorig->L[loy - begy][lox - begx]) / 32768.f]); + if (lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3) { + + if (locllmasCurve && llmasutili) { + float ligh = (bufcolorig->L[loy - begy][lox - begx]) / 32768.f; + valLL = (float)(locllmasCurve[500.f * ligh]); valLL = 1.f - valLL; kmaskL = 32768.f * valLL; } - if (locccmasCurve) { - float chromask = (sqrt(SQR(bufcolorig->a[loy - begy][lox - begx]) + SQR(bufcolorig->b[loy - begy][lox - begx]))); + if (locccmasCurve && lcmasutili) { + float chromask = 0.0001f + (sqrt(SQR(bufcolorig->a[loy - begy][lox - begx]) + SQR(bufcolorig->b[loy - begy][lox - begx]))); float chromaskr = chromask / 45000.f; valCC = float (locccmasCurve[500.f * chromaskr]); valCC = 1.f - valCC; - sincosval.y = (bufcolorig->a[loy - begy][lox - begx]) / chromask; - sincosval.x = (bufcolorig->b[loy - begy][lox - begx]) / chromask; - kmaskCa = 45000.f * valCC * sincosval.y; - kmaskCb = 45000.f * valCC * sincosval.x; + kmaskCa = valCC; + kmaskCb = valCC; } - if (lochhmasCurve) { - float huema= xatan2f(bufcolorig->b[loy - begy][lox - begx], bufcolorig->a[loy - begy][lox - begx]); + if (lochhmasCurve && lhmasutili) { + float huema = xatan2f(bufcolorig->b[loy - begy][lox - begx], bufcolorig->a[loy - begy][lox - begx]); float h = Color::huelab_to_huehsv2(huema); - h += 1.f/6.f; + h += 1.f / 6.f; + if (h > 1.f) { h -= 1.f; } - float chromask = (sqrt(SQR(bufcolorig->a[loy - begy][lox - begx]) + SQR(bufcolorig->b[loy - begy][lox - begx]))); + valHH = float (lochhmasCurve[500.f * h]); valHH = 1.f - valHH; - sincosval.y = (bufcolorig->a[loy - begy][lox - begx]) / chromask; - sincosval.x = (bufcolorig->b[loy - begy][lox - begx]) / chromask; - kmaskHa = 45000.f * valHH * sincosval.y; - kmaskHb = 45000.f * valHH * sincosval.x; + kmaskHa = valHH; + kmaskHb = valHH; kmaskHL = 32768.f * valHH; } - bufmaskblur->L[loy - begy][lox - begx] = kmaskL + kmaskHL; - bufmaskblur->a[loy - begy][lox - begx] = kmaskCa + kmaskHa; - bufmaskblur->b[loy - begy][lox - begx] = kmaskCb + kmaskHb; + bufmaskblurcol->L[loy - begy][lox - begx] = CLIPLOC(kmaskL + kmaskHL); + bufmaskblurcol->a[loy - begy][lox - begx] = CLIPC(kmaskCa + kmaskHa); + bufmaskblurcol->b[loy - begy][lox - begx] = CLIPC(kmaskCb + kmaskHb); + } } @@ -10908,26 +10477,21 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu float radiusb = 3.f / sk; - if (lp.showmaskcolmet >= 2 || lp.enaColorMask) { - + if (lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3) { #ifdef _OPENMP #pragma omp parallel #endif { - gaussianBlur(bufmaskblur->L, bufmaskorig->L, bfw, bfh, radiusb); - gaussianBlur(bufmaskblur->a, bufmaskorig->a, bfw, bfh, radiusb); - gaussianBlur(bufmaskblur->b, bufmaskorig->b, bfw, bfh, radiusb); + gaussianBlur(bufmaskblurcol->L, bufmaskorigcol->L, bfw, bfh, radiusb); + gaussianBlur(bufmaskblurcol->a, bufmaskorigcol->a, bfw, bfh, radiusb); + gaussianBlur(bufmaskblurcol->b, bufmaskorigcol->b, bfw, bfh, radiusb); } - int GWm = transformed->W; - int GHm = transformed->H; + delete bufmaskblurcol; - - originalmask = new LabImage(GWm, GHm); - - if (lp.showmaskcolmet == 2 || lp.enaColorMask) { + if (lp.showmaskcolmet != 3 || lp.enaColorMask) { #ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) +// #pragma omp parallel for schedule(dynamic,16) #endif for (int y = 0; y < transformed->H ; y++) //{ @@ -10946,16 +10510,27 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu } if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { - if(zone > 0) { - bufcolorig->L[loy - begy][lox - begx] -= bufmaskorig->L[loy - begy][lox - begx]; - bufcolorig->a[loy - begy][lox - begx] -= bufmaskorig->a[loy - begy][lox - begx]; - bufcolorig->b[loy - begy][lox - begx] -= bufmaskorig->b[loy - begy][lox - begx]; - originalmask->L[y][x] = bufcolorig->L[loy - begy][lox - begx]; - originalmask->a[y][x] = bufcolorig->a[loy - begy][lox - begx]; - originalmask->b[y][x] = bufcolorig->L[loy - begy][lox - begx]; + if (zone > 0) { + + bufcolorig->L[loy - begy][lox - begx] = bufcolorig->L[loy - begy][lox - begx] + (lp.blendmacol * bufmaskorigcol->L[loy - begy][lox - begx]); + bufcolorig->a[loy - begy][lox - begx] = bufcolorig->a[loy - begy][lox - begx] * (1.f + lp.blendmacol * bufmaskorigcol->a[loy - begy][lox - begx]); + bufcolorig->b[loy - begy][lox - begx] = bufcolorig->b[loy - begy][lox - begx] * (1.f + lp.blendmacol * bufmaskorigcol->b[loy - begy][lox - begx]); + + bufcolorig->L[loy - begy][lox - begx] = CLIP(bufcolorig->L[loy - begy][lox - begx]); + bufcolorig->a[loy - begy][lox - begx] = CLIPC(bufcolorig->a[loy - begy][lox - begx]); + bufcolorig->b[loy - begy][lox - begx] = CLIPC(bufcolorig->b[loy - begy][lox - begx]); + + originalmaskcol->L[y][x] = CLIP(bufcolorig->L[loy - begy][lox - begx] - bufmaskorigcol->L[loy - begy][lox - begx]); + originalmaskcol->a[y][x] = CLIPC(bufcolorig->a[loy - begy][lox - begx] * (1.f - bufmaskorigcol->a[loy - begy][lox - begx])); + originalmaskcol->b[y][x] = CLIPC(bufcolorig->b[loy - begy][lox - begx] * (1.f - bufmaskorigcol->b[loy - begy][lox - begx])); + } + } } + + delete bufmaskorigcol; + } else if (lp.showmaskcolmet == 3) { #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) @@ -10976,20 +10551,22 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu } if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { - if(zone > 0) { - transformed->L[y][x] = bufmaskorig->L[loy - begy][lox - begx]; - transformed->a[y][x] = bufmaskorig->a[loy - begy][lox - begx]; - transformed->b[y][x] = bufmaskorig->b[loy - begy][lox - begx]; + if (zone > 0) { + transformed->L[y][x] = CLIPLOC(bufmaskorigcol->L[loy - begy][lox - begx]); + transformed->a[y][x] = bufcolorig->a[loy - begy][lox - begx] * (bufmaskorigcol->a[loy - begy][lox - begx]); + transformed->b[y][x] = bufcolorig->b[loy - begy][lox - begx] * (bufmaskorigcol->b[loy - begy][lox - begx]); } } } + delete bufmaskorigcol; + delete bufcolorig; + return; + } } - - - if (lp.showmaskcolmet != 3 || lp.enaColorMask) { + if (lp.showmaskcolmet == 0 || lp.showmaskcolmet == 1 || lp.showmaskcolmet == 2 || lp.enaColorMask) { #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -11000,9 +10577,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu int loy = cy + y; if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { - // bufcolorig->L[loy - begy][lox - begx] = original->L[y][x];//fill square buffer with datas - // bufcolorig->a[loy - begy][lox - begx] = original->a[y][x];//fill square buffer with datas - // bufcolorig->b[loy - begy][lox - begx] = original->b[y][x];//fill square buffer with datas chpro = 0.f; //Chroma curve @@ -11097,14 +10671,15 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu } } - ColorLight_Local(moddE, powdE, call, bufcolorig, originalmask, buflight, bufchro, bufchroslid, bufhh, buflightslid, LHutili, HHutili, hueplus, huemoins, hueref, dhue, chromaref, lumaref, lllocalcurve, loclhCurve, lochhCurve, lightCurveloc, lp, original, transformed, cx, cy, sk); + ColorLight_Local(moddE, powdE, call, bufcolorig, originalmaskcol, buflight, bufchro, bufchroslid, bufhh, buflightslid, LHutili, HHutili, hueplus, huemoins, hueref, dhue, chromaref, lumaref, sobelref, blend2, lllocalcurve, loclhCurve, lochhCurve, lightCurveloc, lp, original, transformed, cx, cy, sk); if (call <= 3) { delete bufcolorig; - delete bufmaskorig; - delete bufmaskblur; - delete originalmask; + + if (lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3) { + delete originalmaskcol; + } } } @@ -11113,9 +10688,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu else if (lp.inv && (lp.chro != 0 || lp.ligh != 0) && lp.colorena) { float hueplus = hueref + dhue; float huemoins = hueref - dhue; - // float ddhue = 0.f; - //printf("hueplus=%f huemoins=%f dhu=%f\n", hueplus, huemoins, dhue); if (hueplus > rtengine::RT_PI) { hueplus = hueref + dhue - 2.f * rtengine::RT_PI; } @@ -11127,340 +10700,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, LUTf & sobelrefs, float** shbu InverseColorLight_Local(lp, lightCurveloc, original, transformed, cx, cy, hueplus, huemoins, hueref, dhue, chromaref, lumaref, sk); } - - - if (lp.exposena && (lp.expcomp != 0.f || lp.war != 0 || lp.showmaskexpmet >= 2 || lp.enaExpMask || (exlocalcurve && localexutili))) { //interior ellipse renforced lightness and chroma //locallutili - float hueplus = hueref + dhuev; - float huemoins = hueref - dhuev; - - - if (hueplus > rtengine::RT_PI) { - hueplus = hueref + dhuev - 2.f * rtengine::RT_PI; - } - - if (huemoins < -rtengine::RT_PI) { - huemoins = hueref - dhuev + 2.f * rtengine::RT_PI; - } - - LabImage *bufexporig = nullptr; - LabImage *bufexpfin = nullptr; - LabImage *bufexptemp = nullptr; - LabImage *difLab = nullptr; - LabImage *bufcat02fin = nullptr; - LabImage *bufmaskorig = nullptr; - LabImage *bufmaskblur = nullptr; - LabImage *originalmask = nullptr; - - int bfh = 0.f, bfw = 0.f; - bfh = int (lp.ly + lp.lyT) + del; //bfw bfh real size of square zone - bfw = int (lp.lx + lp.lxL) + del; - JaggedArray buflight(bfw, bfh); - JaggedArray bufl_ab(bfw, bfh); - JaggedArray buflightcurv(bfw, bfh); - JaggedArray buf_a_cat(bfw, bfh, true); - JaggedArray buf_b_cat(bfw, bfh, true); - - - if (call <= 3) { //simpleprocess, dcrop, improccoordinator - - - bufexporig = new LabImage(bfw, bfh); //buffer for data in zone limit - bufexpfin = new LabImage(bfw, bfh); //buffer for data in zone limit - bufexptemp = new LabImage(bfw, bfh); //buffer for data in zone limit - difLab = new LabImage(bfw, bfh); //buffer for data in zone limit - bufcat02fin = new LabImage(bfw, bfh); //buffer for data in zone limit - bufmaskorig = new LabImage(bfw, bfh); - bufmaskblur = new LabImage(bfw, bfh); - - -#ifdef _OPENMP - #pragma omp parallel for -#endif - - for (int ir = 0; ir < bfh; ir++) //fill with 0 - for (int jr = 0; jr < bfw; jr++) { - bufexporig->L[ir][jr] = 0.f; - bufexporig->a[ir][jr] = 0.f; - bufexporig->b[ir][jr] = 0.f; - bufmaskorig->L[ir][jr] = 0.f; - bufmaskorig->a[ir][jr] = 0.f; - bufmaskorig->b[ir][jr] = 0.f; - bufexptemp->L[ir][jr] = 0.f; - bufexptemp->a[ir][jr] = 0.f; - bufexptemp->b[ir][jr] = 0.f; - bufexpfin->L[ir][jr] = 0.f; - bufexpfin->a[ir][jr] = 0.f; - bufexpfin->b[ir][jr] = 0.f; - bufcat02fin->L[ir][jr] = 0.f; - bufcat02fin->a[ir][jr] = 0.f; - bufcat02fin->b[ir][jr] = 0.f; - buflight[ir][jr] = 0.f; - bufl_ab[ir][jr] = 0.f; - buflightcurv[ir][jr] = 0.f; - buf_a_cat[ir][jr] = 0.f; - buf_b_cat[ir][jr] = 0.f; - } - - int begy = lp.yc - lp.lyT; - int begx = lp.xc - lp.lxL; - int yEn = lp.yc + lp.ly; - int xEn = lp.xc + lp.lx; - - - -#ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) -#endif - - for (int y = 0; y < transformed->H ; y++) //{ - for (int x = 0; x < transformed->W; x++) { - int lox = cx + x; - int loy = cy + y; - - if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { - bufmaskorig->L[loy - begy][lox - begx] = original->L[y][x]; - bufmaskorig->a[loy - begy][lox - begx] = original->a[y][x]; - bufmaskorig->b[loy - begy][lox - begx] = original->b[y][x]; - bufexporig->L[loy - begy][lox - begx] = original->L[y][x]; - bufexporig->a[loy - begy][lox - begx] = original->a[y][x]; - bufexporig->b[loy - begy][lox - begx] = original->b[y][x]; - bufmaskblur->L[loy - begy][lox - begx] = original->L[y][x]; - bufmaskblur->a[loy - begy][lox - begx] = original->a[y][x]; - bufmaskblur->b[loy - begy][lox - begx] = original->b[y][x]; - - float valLL = 0.f; - float valCC = 0.f; - float2 sincosval; - - if (lp.showmaskexpmet >= 2 || lp.enaExpMask) { - if (locllmasexpCurve) { - valLL = (float)(locllmasexpCurve[500.f * (bufexporig->L[loy - begy][lox - begx]) / 32768.f]); - valLL = 1.f - valLL; - bufmaskblur->L[loy - begy][lox - begx] = 32768.f * valLL; - } - - if (locccmasexpCurve) { - float chromask = (sqrt(SQR(bufexporig->a[loy - begy][lox - begx]) + SQR(bufexporig->b[loy - begy][lox - begx]))); - float chromaskr = chromask / 45000.f; - valCC = float (locccmasexpCurve[500.f * chromaskr]); - valCC = 1.f - valCC; - sincosval.y = (bufexporig->a[loy - begy][lox - begx]) / chromask; - sincosval.x = (bufexporig->b[loy - begy][lox - begx]) / chromask; - bufmaskblur->a[loy - begy][lox - begx] = 45000.f * valCC * sincosval.y; - bufmaskblur->b[loy - begy][lox - begx] = 45000.f * valCC * sincosval.x; - } - } - } - } - - float radiusb = 3.f / sk; - - if (lp.showmaskexpmet >= 2 || lp.enaExpMask) { - -#ifdef _OPENMP - #pragma omp parallel -#endif - { - gaussianBlur(bufmaskblur->L, bufmaskorig->L, bfw, bfh, radiusb); - gaussianBlur(bufmaskblur->a, bufmaskorig->a, bfw, bfh, radiusb); - gaussianBlur(bufmaskblur->b, bufmaskorig->b, bfw, bfh, radiusb); - } - int GWm = transformed->W; - int GHm = transformed->H; - - - originalmask = new LabImage(GWm, GHm); - - if (lp.showmaskexpmet == 2 || lp.enaExpMask) { - -#ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) -#endif - - for (int y = 0; y < transformed->H ; y++) //{ - for (int x = 0; x < transformed->W; x++) { - int lox = cx + x; - int loy = cy + y; - int zone = 0; - - float localFactor = 1.f; - const float achm = (float)lp.trans / 100.f; - - if (lp.shapmet == 0) { - calcTransition(lox, loy, achm, lp, zone, localFactor); - } else if (lp.shapmet == 1) { - calcTransitionrect(lox, loy, achm, lp, zone, localFactor); - } - - if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { - if(zone > 0) { - bufexporig->L[loy - begy][lox - begx] -= bufmaskorig->L[loy - begy][lox - begx]; - bufexporig->a[loy - begy][lox - begx] -= bufmaskorig->a[loy - begy][lox - begx]; - bufexporig->b[loy - begy][lox - begx] -= bufmaskorig->b[loy - begy][lox - begx]; - originalmask->L[y][x] = bufexporig->L[loy - begy][lox - begx]; - originalmask->a[y][x] = bufexporig->a[loy - begy][lox - begx]; - originalmask->b[y][x] = bufexporig->L[loy - begy][lox - begx]; - } - } - } - } else if (lp.showmaskexpmet == 3) { -#ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) -#endif - - for (int y = 0; y < transformed->H ; y++) //{ - for (int x = 0; x < transformed->W; x++) { - int lox = cx + x; - int loy = cy + y; - int zone = 0; - float localFactor = 1.f; - const float achm = (float)lp.trans / 100.f; - - if (lp.shapmet == 0) { - calcTransition(lox, loy, achm, lp, zone, localFactor); - } else if (lp.shapmet == 1) { - calcTransitionrect(lox, loy, achm, lp, zone, localFactor); - } - - if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { - if(zone > 0) { - transformed->L[y][x] = bufmaskorig->L[loy - begy][lox - begx]; - transformed->a[y][x] = bufmaskorig->a[loy - begy][lox - begx]; - transformed->b[y][x] = bufmaskorig->b[loy - begy][lox - begx]; - } - } - } - - } - } - - - if (lp.showmaskexpmet != 3 || lp.enaExpMask) { - -#ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) -#endif - - for (int y = 0; y < transformed->H ; y++) //{ - for (int x = 0; x < transformed->W; x++) { - int lox = cx + x; - int loy = cy + y; - - if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { - - // bufexporig->L[loy - begy][lox - begx] = original->L[y][x];//fill square buffer with datas - // bufexporig->a[loy - begy][lox - begx] = original->a[y][x];//fill square buffer with datas - // bufexporig->b[loy - begy][lox - begx] = original->b[y][x];//fill square buffer with datas - bufexptemp->L[loy - begy][lox - begx] = original->L[y][x];//fill square buffer with datas - bufexptemp->a[loy - begy][lox - begx] = original->a[y][x];//fill square buffer with datas - bufexptemp->b[loy - begy][lox - begx] = original->b[y][x];//fill square buffer with datas - bufexpfin->L[loy - begy][lox - begx] = original->L[y][x];//fill square buffer with datas - bufexpfin->a[loy - begy][lox - begx] = original->a[y][x];//fill square buffer with datas - bufexpfin->b[loy - begy][lox - begx] = original->b[y][x];//fill square buffer with datas - } - } - -//to do Modulate bufexporig and bufexptemp with blend L, H, C and masks - - - if (exlocalcurve && localexutili) {// L=f(L) curve enhanced -#ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) -#endif - - for (int y = 0; y < transformed->H ; y++) //{ - for (int x = 0; x < transformed->W; x++) { - int lox = cx + x; - int loy = cy + y; - - if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { - - float lighn = bufexporig->L[loy - begy][lox - begx]; - - float lh; - lh = 0.5f * exlocalcurve[2.f * lighn]; // / ((lighn) / 1.9f) / 3.61f; //lh between 0 and 0 50 or more - bufexptemp->L[loy - begy][lox - begx] = lh; - } - } - - if (lp.expcomp == 0.f) { - lp.expcomp = 0.1f; // to enabled - } - - ImProcFunctions::exlabLocal(lp, bfh, bfw, bufexptemp, bufexpfin, hltonecurveloc, shtonecurveloc, tonecurveloc); - - - } else { - - ImProcFunctions::exlabLocal(lp, bfh, bfw, bufexporig, bufexpfin, hltonecurveloc, shtonecurveloc, tonecurveloc); - } - - //cat02 - if (params->locallab.spots.at(sp).warm != 0) { - ImProcFunctions::ciecamloc_02float(sp, bufexpfin, bufcat02fin); - } else { -#ifdef _OPENMP - #pragma omp parallel for -#endif - - for (int ir = 0; ir < bfh; ir++) - for (int jr = 0; jr < bfw; jr++) { - bufcat02fin->L[ir][jr] = bufexpfin->L[ir][jr]; - bufcat02fin->a[ir][jr] = bufexpfin->a[ir][jr]; - bufcat02fin->b[ir][jr] = bufexpfin->b[ir][jr]; - } - } - - - -#ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) -#endif - - for (int y = 0; y < transformed->H ; y++) //{ - for (int x = 0; x < transformed->W; x++) { - int lox = cx + x; - int loy = cy + y; - - if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { - - float rL; - rL = CLIPRET((bufcat02fin->L[loy - begy][lox - begx] - bufexporig->L[loy - begy][lox - begx]) / 328.f); - - buflight[loy - begy][lox - begx] = rL; - float rA; - rA = CLIPRET((bufcat02fin->a[loy - begy][lox - begx] - bufexporig->a[loy - begy][lox - begx]) / 328.f); - buf_a_cat[loy - begy][lox - begx] = rA; - - - float rB; - rB = CLIPRET((bufcat02fin->b[loy - begy][lox - begx] - bufexporig->b[loy - begy][lox - begx]) / 328.f); - buf_b_cat[loy - begy][lox - begx] = rB; - - - } - } - } - Expo_vibr_Local(moddE, powdE, 1, originalmask, buflight, bufl_ab, buf_a_cat, buf_b_cat, hueplus, huemoins, hueref, dhueex, chromaref, lumaref, lp, original, transformed, difLab, bufcat02fin, cx, cy, sk); - //view mask - } - - if (call <= 3) { - - delete bufexporig; - delete bufexpfin; - delete bufexptemp; - delete difLab; - delete bufcat02fin; - delete bufmaskorig; - delete bufmaskblur; - delete originalmask; - } - - } - - - // Gamut and Munsell control - very important do not desactivated to avoid crash if (params->locallab.spots.at(sp).avoid) { TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.workingProfile); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 519c49eac..a1f7c193f 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -638,8 +638,14 @@ enum ProcEventCode { EvlocallabCCmaskexpshape = 608, EvlocallabLLmaskexpshape = 609, EvlocallabHHmaskshape = 610, - EvLocallabEnaColorMask = 611, - EvLocallabEnaExpMask = 612, + Evlocallabstructcol = 611, + Evlocallabstructexp = 612, + EvlocallabHHmaskexpshape = 613, + Evlocallabblendmaskcol = 614, + Evlocallabblendmaskexp = 615, + Evlocallabblurexpde = 616, + EvLocallabEnaColorMask = 617, + EvLocallabEnaExpMask = 618, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 33ba6085f..f56118f62 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2362,6 +2362,8 @@ LocallabParams::LocallabSpot::LocallabSpot() : contrast(0), chroma(0), sensi(19), + structcol(0), + blendmaskcol(0), qualitycurveMethod("none"), llcurve{(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}, cccurve{(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}, @@ -2369,22 +2371,26 @@ LocallabParams::LocallabSpot::LocallabSpot() : HHcurve{(double)FCT_MinMaxCPoints, 0.0, 0.50, 0.35, 0.35, 0.166, 0.50, 0.35, 0.35, 0.333, 0.50, 0.35, 0.35, 0.50, 0.50, 0.35, 0.35, 0.666, 0.50, 0.35, 0.35, 0.833, 0.50, 0.35, 0.35}, invers(false), enaColorMask(false), - CCmaskcurve{(double)FCT_MinMaxCPoints, 0., 1., 0.35, 0.35, 1., 1., 0.35, 0.35}, - LLmaskcurve{(double)FCT_MinMaxCPoints, 0., 1., 0.35, 0.35, 1., 1., 0.35, 0.35}, - HHmaskcurve{(double)FCT_MinMaxCPoints, 0., 1., 0.35, 0.35, 1., 1., 0.35, 0.35}, + CCmaskcurve{(double)FCT_MinMaxCPoints, 0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.00, 1.0, 0.35, 0.35 }, + LLmaskcurve{(double)FCT_MinMaxCPoints, 0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.00, 1.0, 0.35, 0.35 }, + HHmaskcurve{(double)FCT_MinMaxCPoints, 0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.00, 1.0, 0.35, 0.35 }, // Exposure expexpose(false), expcomp(0), - hlcompr(20), + hlcompr(60), hlcomprthresh(33), black(0), shcompr(50), warm(0), - sensiex(19), + sensiex(15), + structexp(0), + blurexpde(5), excurve{(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}, enaExpMask(false), - CCmaskexpcurve{(double)FCT_MinMaxCPoints, 0., 1., 0.35, 0.35, 1., 1., 0.35, 0.35}, - LLmaskexpcurve{(double)FCT_MinMaxCPoints, 0., 1., 0.35, 0.35, 1., 1., 0.35, 0.35}, + CCmaskexpcurve{(double)FCT_MinMaxCPoints,0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.0, 1.0, 0.35, 0.35 }, + LLmaskexpcurve{(double)FCT_MinMaxCPoints, 0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.0, 1.0, 0.35, 0.35}, + HHmaskexpcurve{(double)FCT_MinMaxCPoints, 0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.0, 1.0, 0.35, 0.35}, + blendmaskexp(0), // Vibrance expvibrance(false), saturated(0), @@ -2497,6 +2503,8 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && contrast == other.contrast && chroma == other.chroma && sensi == other.sensi + && structcol == other.structcol + && blendmaskcol == other.blendmaskcol && qualitycurveMethod == other.qualitycurveMethod && llcurve == other.llcurve && cccurve == other.cccurve @@ -2516,10 +2524,14 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && shcompr == other.shcompr && warm == other.warm && sensiex == other.sensiex + && structexp == other.structexp + && blurexpde == other.blurexpde && excurve == other.excurve && enaExpMask == other.enaExpMask && CCmaskexpcurve == other.CCmaskexpcurve && LLmaskexpcurve == other.LLmaskexpcurve + && HHmaskexpcurve == other.HHmaskexpcurve + && blendmaskexp == other.blendmaskexp // Vibrance && expvibrance == other.expvibrance && saturated == other.saturated @@ -3585,6 +3597,8 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).contrast, "Locallab", "Contrast_" + std::to_string(i), spot.contrast, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).chroma, "Locallab", "Chroma_" + std::to_string(i), spot.chroma, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensi, "Locallab", "Sensi_" + std::to_string(i), spot.sensi, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).structcol, "Locallab", "Structcol_" + std::to_string(i), spot.structcol, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blendmaskcol, "Locallab", "Blendmaskcol_" + std::to_string(i), spot.blendmaskcol, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).qualitycurveMethod, "Locallab", "QualityCurveMethod_" + std::to_string(i), spot.qualitycurveMethod, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).llcurve, "Locallab", "LLCurve_" + std::to_string(i), spot.llcurve, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).cccurve, "Locallab", "CCCurve_" + std::to_string(i), spot.cccurve, keyFile); @@ -3604,10 +3618,14 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).shcompr, "Locallab", "Shcompr_" + std::to_string(i), spot.shcompr, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).warm, "Locallab", "Warm_" + std::to_string(i), spot.warm, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensiex, "Locallab", "Sensiex_" + std::to_string(i), spot.sensiex, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).structexp, "Locallab", "Structexp_" + std::to_string(i), spot.structexp, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blurexpde, "Locallab", "Blurexpde_" + std::to_string(i), spot.blurexpde, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).excurve, "Locallab", "ExCurve_" + std::to_string(i), spot.excurve, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).enaExpMask, "Locallab", "EnaExpMask_" + std::to_string(i), spot.enaExpMask, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).CCmaskexpcurve, "Locallab", "CCmaskexpCurve_" + std::to_string(i), spot.CCmaskexpcurve, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).LLmaskexpcurve, "Locallab", "LLmaskexpCurve_" + std::to_string(i), spot.LLmaskexpcurve, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).HHmaskexpcurve, "Locallab", "HHmaskexpCurve_" + std::to_string(i), spot.HHmaskexpcurve, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blendmaskexp, "Locallab", "Blendmaskexp_" + std::to_string(i), spot.blendmaskexp, keyFile); // Vibrance saveToKeyfile(!pedited || pedited->locallab.spots.at(i).expvibrance, "Locallab", "Expvibrance_" + std::to_string(i), spot.expvibrance, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).saturated, "Locallab", "Saturated_" + std::to_string(i), spot.saturated, keyFile); @@ -4800,6 +4818,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Contrast_" + std::to_string(i), pedited, spot.contrast, spotEdited.contrast); assignFromKeyfile(keyFile, "Locallab", "Chroma_" + std::to_string(i), pedited, spot.chroma, spotEdited.chroma); assignFromKeyfile(keyFile, "Locallab", "Sensi_" + std::to_string(i), pedited, spot.sensi, spotEdited.sensi); + assignFromKeyfile(keyFile, "Locallab", "Structcol_" + std::to_string(i), pedited, spot.structcol, spotEdited.structcol); + assignFromKeyfile(keyFile, "Locallab", "Blendmaskcol_" + std::to_string(i), pedited, spot.blendmaskcol, spotEdited.blendmaskcol); assignFromKeyfile(keyFile, "Locallab", "QualityCurveMethod_" + std::to_string(i), pedited, spot.qualitycurveMethod, spotEdited.qualitycurveMethod); assignFromKeyfile(keyFile, "Locallab", "LLCurve_" + std::to_string(i), pedited, spot.llcurve, spotEdited.llcurve); assignFromKeyfile(keyFile, "Locallab", "CCCurve_" + std::to_string(i), pedited, spot.cccurve, spotEdited.cccurve); @@ -4819,10 +4839,14 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Shcompr_" + std::to_string(i), pedited, spot.shcompr, spotEdited.shcompr); assignFromKeyfile(keyFile, "Locallab", "Warm_" + std::to_string(i), pedited, spot.warm, spotEdited.warm); assignFromKeyfile(keyFile, "Locallab", "Sensiex_" + std::to_string(i), pedited, spot.sensiex, spotEdited.sensiex); + assignFromKeyfile(keyFile, "Locallab", "Structexp_" + std::to_string(i), pedited, spot.structexp, spotEdited.structexp); + assignFromKeyfile(keyFile, "Locallab", "Blurexpde_" + std::to_string(i), pedited, spot.blurexpde, spotEdited.blurexpde); assignFromKeyfile(keyFile, "Locallab", "ExCurve_" + std::to_string(i), pedited, spot.excurve, spotEdited.excurve); assignFromKeyfile(keyFile, "Locallab", "EnaExpMask_" + std::to_string(i), pedited, spot.enaExpMask, spotEdited.enaExpMask); assignFromKeyfile(keyFile, "Locallab", "CCmaskexpCurve_" + std::to_string(i), pedited, spot.CCmaskexpcurve, spotEdited.CCmaskexpcurve); assignFromKeyfile(keyFile, "Locallab", "LLmaskexpCurve_" + std::to_string(i), pedited, spot.LLmaskexpcurve, spotEdited.LLmaskexpcurve); + assignFromKeyfile(keyFile, "Locallab", "HHmaskexpCurve_" + std::to_string(i), pedited, spot.HHmaskexpcurve, spotEdited.HHmaskexpcurve); + assignFromKeyfile(keyFile, "Locallab", "Blendmaskexp_" + std::to_string(i), pedited, spot.blendmaskexp, spotEdited.blendmaskexp); // Vibrance assignFromKeyfile(keyFile, "Locallab", "Expvibrance_" + std::to_string(i), pedited, spot.expvibrance, spotEdited.expvibrance); assignFromKeyfile(keyFile, "Locallab", "Saturated_" + std::to_string(i), pedited, spot.saturated, spotEdited.saturated); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 8ad43c472..a02a61a61 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -50,6 +50,9 @@ class LocHHCurve; class LocLLmaskCurve; class LocCCmaskCurve; class LocHHmaskCurve; +class LocLLmaskexpCurve; +class LocCCmaskexpCurve; +class LocHHmaskexpCurve; enum RenderingIntent { RI_PERCEPTUAL = INTENT_PERCEPTUAL, @@ -959,6 +962,8 @@ struct LocallabParams { int contrast; int chroma; int sensi; + int structcol; + int blendmaskcol; Glib::ustring qualitycurveMethod; std::vector llcurve; std::vector cccurve; @@ -978,10 +983,14 @@ struct LocallabParams { int shcompr; int warm; int sensiex; + int structexp; + int blurexpde; std::vector excurve; bool enaExpMask; std::vector CCmaskexpcurve; std::vector LLmaskexpcurve; + std::vector HHmaskexpcurve; + int blendmaskexp; // Vibrance bool expvibrance; int saturated; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index e0616c645..c35ecc73e 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -638,6 +638,12 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // EvlocallabCCmaskexpshape LUMINANCECURVE, // EvlocallabLLmaskexpshape LUMINANCECURVE, // EvlocallabHHmaskshape + LUMINANCECURVE, // Evlocallabstructcol + LUMINANCECURVE, // Evlocallabstructexp + LUMINANCECURVE, // EvlocallabHHmaskexpshape + LUMINANCECURVE, // Evlocallabblendmaskcol + LUMINANCECURVE, // Evlocallabblendmaskexp + LUMINANCECURVE, // Evlocallabblurexpde LUMINANCECURVE, // EvLocallabEnaColorMask LUMINANCECURVE // EvLocallabEnaExpMask }; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 377ce28c1..40e6d9982 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -32,6 +32,7 @@ #include #include #include +#include "jaggedarray.h" #undef THREAD_PRIORITY_NORMAL @@ -1079,6 +1080,7 @@ private: LocHHmaskCurve lochhmasCurve; LocCCmaskexpCurve locccmasexpCurve; LocLLmaskexpCurve locllmasexpCurve; + LocHHmaskexpCurve lochhmasexpCurve; LUTf lllocalcurve(65536, 0); LUTf cclocalcurve(65536, 0); LUTf sklocalcurve(65536, 0); @@ -1086,11 +1088,12 @@ private: LUTf shtonecurveloc(65536, 0); LUTf tonecurveloc(65536, 0); LUTf lightCurveloc(32770, 0); - LUTu lhist16loc(32768, 0); + LUTu lhist16loc(32770, 0); LUTf exlocalcurve(65536, 0); // int maxspot = 1; float** shbuffer = nullptr; + JaggedArray blend(fw, fh); for (int sp = 0; sp < params.locallab.nbspot && sp < (int)params.locallab.spots.size(); sp++) { if (params.locallab.spots.at(sp).inverssha) { @@ -1108,14 +1111,21 @@ private: bool localcutili = false; bool localskutili = false; bool localexutili = false; + bool llmasutili = false; + bool lcmasexputili = false; + bool lhmasexputili = false; + bool llmasexputili = false; + bool lcmasutili = false; + bool lhmasutili = false; locRETgainCurve.Set(params.locallab.spots.at(sp).localTgaincurve); loclhCurve.Set(params.locallab.spots.at(sp).LHcurve, LHutili); lochhCurve.Set(params.locallab.spots.at(sp).HHcurve, HHutili); - locccmasCurve.Set(params.locallab.spots.at(sp).CCmaskcurve); - locllmasCurve.Set(params.locallab.spots.at(sp).LLmaskcurve); - lochhmasCurve.Set(params.locallab.spots.at(sp).HHmaskcurve); - locccmasexpCurve.Set(params.locallab.spots.at(sp).CCmaskexpcurve); - locllmasexpCurve.Set(params.locallab.spots.at(sp).LLmaskexpcurve); + locccmasCurve.Set(params.locallab.spots.at(sp).CCmaskcurve, lcmasutili); + locllmasCurve.Set(params.locallab.spots.at(sp).LLmaskcurve, llmasutili); + lochhmasCurve.Set(params.locallab.spots.at(sp).HHmaskcurve, lhmasutili); + locccmasexpCurve.Set(params.locallab.spots.at(sp).CCmaskexpcurve, lcmasexputili); + locllmasexpCurve.Set(params.locallab.spots.at(sp).LLmaskexpcurve, llmasexputili); + lochhmasexpCurve.Set(params.locallab.spots.at(sp).HHmaskexpcurve, lhmasexputili); CurveFactory::curveLocal(locallutili, params.locallab.spots.at(sp).llcurve, lllocalcurve, 1); CurveFactory::curveCCLocal(localcutili, params.locallab.spots.at(sp).cccurve, cclocalcurve, 1); CurveFactory::curveskLocal(localskutili, params.locallab.spots.at(sp).skintonescurve, sklocalcurve, 1); @@ -1131,18 +1141,18 @@ private: // Reference parameters computation double huere, chromare, lumare, huerefblu, sobelre; - + float avg = 0.f; if (params.locallab.spots.at(sp).spotMethod == "exc") { - ipf.calc_ref(sp, reservView, reservView, 0, 0, fw, fh, 1, huerefblu, huere, chromare, lumare, sobelre, lhist16loc); + ipf.calc_ref(sp, reservView, reservView, 0, 0, fw, fh, 1, huerefblu, huere, chromare, lumare, sobelre, lhist16loc, avg); } else { - ipf.calc_ref(sp, labView, labView, 0, 0, fw, fh, 1, huerefblu, huere, chromare, lumare, sobelre, lhist16loc); + ipf.calc_ref(sp, labView, labView, 0, 0, fw, fh, 1, huerefblu, huere, chromare, lumare, sobelre, lhist16loc, avg); } - CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lhist16loc, - hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, + CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lhist16loc, lumare, + hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, avg, 1); // No Locallab mask is shown in exported picture - ipf.Lab_Local(2, sp, sobelrefs, (float**)shbuffer, labView, labView, reservView, 0, 0, fw, fh, 1, locRETgainCurve, lllocalcurve, loclhCurve, lochhCurve, locccmasCurve, locllmasCurve, lochhmasCurve, locccmasexpCurve, locllmasexpCurve, + ipf.Lab_Local(2, sp, (float**)shbuffer, labView, labView, reservView, 0, 0, fw, fh, 1, locRETgainCurve, lllocalcurve, loclhCurve, lochhCurve, locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, LHutili, HHutili, cclocalcurve, localskutili, sklocalcurve, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, huerefblu, huere, chromare, lumare, sobelre, 0, 0); // Clear local curves diff --git a/rtengine/sleefsseavx.c b/rtengine/sleefsseavx.c index 83d937bd1..3000c1c10 100644 --- a/rtengine/sleefsseavx.c +++ b/rtengine/sleefsseavx.c @@ -1427,5 +1427,21 @@ static INLINE void vconvertrgbrgbrgbrgb2rrrrggggbbbb (const float * src, vfloat bv = _mm_setr_ps(src[2],src[5],src[8],src[11]); } +#if defined( __SSE4_1__ ) && defined( __x86_64__ ) +static INLINE vfloat vceilf(vfloat x) { + return _mm_round_ps(x, _MM_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC); +} + +#else + +static INLINE vfloat vceilf(vfloat x) { + __m128i zerov = _mm_setzero_si128(); + zerov = _mm_cmpeq_epi32(zerov, zerov); + const vfloat onev = (vfloat)_mm_slli_epi32(_mm_srli_epi32(zerov, 25), 23); //create vector 1.0f + const vfloat xi = _mm_cvtepi32_ps(_mm_cvttps_epi32(x)); + return xi + _mm_and_ps(_mm_cmplt_ps(xi, x), onev); +} +#endif + #endif // __SSE2__ #endif // SLEEFSSEAVX diff --git a/rtengine/xtrans_demosaic.cc b/rtengine/xtrans_demosaic.cc index ed253749b..26cd9071b 100644 --- a/rtengine/xtrans_demosaic.cc +++ b/rtengine/xtrans_demosaic.cc @@ -960,59 +960,62 @@ void RawImageSource::xtrans_interpolate (const int passes, const bool useCieLab) #undef CLIP void RawImageSource::fast_xtrans_interpolate (const array2D &rawData, array2D &red, array2D &green, array2D &blue) { -// if (settings->verbose) { -// printf("fast X-Trans interpolation...\n"); -// } - double progress = 0.0; - const bool plistenerActive = plistener; - - if (plistenerActive) { - plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), "fast Xtrans")); - plistener->setProgress (progress); + if (plistener) { + plistener->setProgressStr(Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), "fast Xtrans")); + plistener->setProgress(0.0); } - const int height = H, width = W; - - xtransborder_interpolate (1, red, green, blue); + xtransborder_interpolate(1, red, green, blue); int xtrans[6][6]; ri->getXtransMatrix(xtrans); - #pragma omp parallel for + const float weight[3][3] = { + {0.25f, 0.5f, 0.25f}, + {0.5f, 0.f, 0.5f}, + {0.25f, 0.5f, 0.25f} + }; +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic, 16) +#endif + for (int row = 1; row < H - 1; ++row) { + for (int col = 1; col < W - 1; ++col) { + float sum[3] = {}; - for(int row = 1; row < height - 1; row++) { - for(int col = 1; col < width - 1; col++) { - float sum[3] = {0.f}; - - for(int v = -1; v <= 1; v++) { - for(int h = -1; h <= 1; h++) { - sum[fcol(row + v, col + h)] += rawData[row + v][(col + h)]; + for (int v = -1; v <= 1; v++) { + for (int h = -1; h <= 1; h++) { + sum[fcol(row + v, col + h)] += rawData[row + v][(col + h)] * weight[v + 1][h + 1]; } } switch(fcol(row, col)) { - case 0: + case 0: // red pixel red[row][col] = rawData[row][col]; - green[row][col] = sum[1] * 0.2f; - blue[row][col] = sum[2] * 0.33333333f; + green[row][col] = sum[1] * 0.5f; + blue[row][col] = sum[2]; break; - case 1: - red[row][col] = sum[0] * 0.5f; + case 1: // green pixel green[row][col] = rawData[row][col]; - blue[row][col] = sum[2] * 0.5f; + if (fcol(row, col - 1) == fcol(row, col + 1)) { // Solitary green pixel always has exactly two direct red and blue neighbors in 3x3 grid + red[row][col] = sum[0]; + blue[row][col] = sum[2]; + } else { // Non solitary green pixel always has one direct and one diagonal red and blue neighbor in 3x3 grid + red[row][col] = sum[0] * 1.3333333f; + blue[row][col] = sum[2] * 1.3333333f; + } break; - case 2: - red[row][col] = sum[0] * 0.33333333f; - green[row][col] = sum[1] * 0.2f; + case 2: // blue pixel + red[row][col] = sum[0]; + green[row][col] = sum[1] * 0.5f; blue[row][col] = rawData[row][col]; break; } } } - if (plistenerActive) { + if (plistener) { plistener->setProgress (1.0); } } diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 12ff5299d..c9fe1c7a1 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1083,6 +1083,10 @@ void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc) history->resetSnapShotNumber(); navigator->setInvalid(ipc->getFullWidth(),ipc->getFullHeight()); + + // When passing a photo as an argument to the RawTherapee executable, the user wants + // this auto-loaded photo's thumbnail to be selected and visible in the Filmstrip. + EditorPanel::syncFileBrowser(); } void EditorPanel::close () diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 89b7c78f7..b30ac9f9c 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -76,14 +76,19 @@ Locallab::Locallab(): contrast(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTRAST"), -100, 100, 1, 0))), chroma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMA"), -100, 150, 1, 0))), sensi(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 19))), + structcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))), + blendmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 150, 1, 0))), // Exposure - expcomp(Gtk::manage(new Adjuster(M("TP_EXPOSURE_EXPCOMP"), -200, 200, 5, 0))), + expcomp(Gtk::manage(new Adjuster(M("TP_EXPOSURE_EXPCOMP"), -200, 400, 5, 0))), hlcompr(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 60))), hlcomprthresh(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 33))), black(Gtk::manage(new Adjuster(M("TP_EXPOSURE_BLACKLEVEL"), -16384, 32768, 50, 0))), shcompr(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRSHADOWS"), 0, 100, 1, 50))), warm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_WARM"), -100., 100., 1., 0., Gtk::manage(new RTImage("circle-blue-small.png")), Gtk::manage(new RTImage("circle-orange-small.png"))))), - sensiex(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 19))), + sensiex(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), + structexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))), + blurexpde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))), + blendmaskexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 150, 1, 0))), // Vibrance saturated(Gtk::manage(new Adjuster(M("TP_VIBRANCE_SATURATED"), -100., 100., 1., 0.))), pastels(Gtk::manage(new Adjuster(M("TP_VIBRANCE_PASTELS"), -100., 100., 1., 0.))), @@ -105,7 +110,7 @@ Locallab::Locallab(): // Retinex str(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STR"), 0, 100, 1, 0))), chrrt(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHRRT"), 0, 100, 1, 0))), - neigh(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NEIGH"), 14, 150, 1, 50))), + neigh(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NEIGH"), -100, 150, 1, 100))),//14, 150, 1, 50))), vart(Gtk::manage(new Adjuster(M("TP_LOCALLAB_VART"), 50, 500, 1, 200))), dehaz(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DEHAZ"), 0, 100, 1, 0))), sensih(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIH"), 0, 100, 1, 19))), @@ -221,6 +226,10 @@ Locallab::Locallab(): sensi->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); sensi->setAdjusterListener(this); + structcol->setAdjusterListener(this); + + blendmaskcol->setAdjusterListener(this); + qualitycurveMethod->append(M("TP_LOCALLAB_CURVNONE")); qualitycurveMethod->append(M("TP_LOCALLAB_CURVCURR")); qualitycurveMethod->append(M("TP_LOCALLAB_CURVENH")); @@ -293,6 +302,7 @@ Locallab::Locallab(): showmaskcolMethod->append(M("TP_LOCALLAB_SHOWMODIF")); showmaskcolMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); showmaskcolMethod->append(M("TP_LOCALLAB_SHOWMASK")); + showmaskcolMethod->append(M("TP_LOCALLAB_SHOWSTRUC")); showmaskcolMethod->set_active(0); showmaskcolMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); @@ -317,7 +327,7 @@ Locallab::Locallab(): HHmaskshape = static_cast(maskCurveEditorG->addCurve(CT_Flat, "LC(H)", nullptr, false, true)); HHmaskshape->setIdentityValue(0.); - HHmaskshape->setResetCurve(FlatCurveType(defSpot.LLmaskcurve.at(0)), defSpot.LLmaskcurve); + HHmaskshape->setResetCurve(FlatCurveType(defSpot.HHmaskcurve.at(0)), defSpot.HHmaskcurve); HHmaskshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); HHmaskshape->setCurveColorProvider(this, 6); HHmaskshape->setBottomBarColorProvider(this, 6); @@ -335,6 +345,7 @@ Locallab::Locallab(): superFrame->add(*superBox); colorBox->pack_start(*superFrame); colorBox->pack_start(*sensi); + colorBox->pack_start(*structcol); Gtk::HBox* const qualcurvbox = Gtk::manage(new Gtk::HBox()); qualcurvbox->pack_start(*labqualcurv, Gtk::PACK_SHRINK, 4); qualcurvbox->pack_start(*qualitycurveMethod); @@ -347,6 +358,7 @@ Locallab::Locallab(): maskcolBox->pack_start(*showmaskcolMethod, Gtk::PACK_SHRINK, 0); maskcolBox->pack_start(*enaColorMask, Gtk::PACK_SHRINK, 0); maskcolBox->pack_start(*maskCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + maskcolBox->pack_start(*blendmaskcol, Gtk::PACK_SHRINK, 0); maskcolFrame->add(*maskcolBox); colorBox->pack_start(*maskcolFrame); @@ -375,6 +387,12 @@ Locallab::Locallab(): sensiex->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); sensiex->setAdjusterListener(this); + structexp->setAdjusterListener(this); + + blurexpde->setAdjusterListener(this); + + blendmaskexp->setAdjusterListener(this); + curveEditorG->setCurveListener(this); shapeexpos = static_cast(curveEditorG->addCurve(CT_Diagonal, "")); @@ -394,6 +412,7 @@ Locallab::Locallab(): showmaskexpMethod->append(M("TP_LOCALLAB_SHOWMODIF")); showmaskexpMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); showmaskexpMethod->append(M("TP_LOCALLAB_SHOWMASK")); + showmaskexpMethod->append(M("TP_LOCALLAB_SHOWSTRUC")); showmaskexpMethod->set_active(0); showmaskexpMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); @@ -413,6 +432,13 @@ Locallab::Locallab(): LLmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); LLmaskexpshape->setBottomBarBgGradient(mllshape); + HHmaskexpshape = static_cast(maskexpCurveEditorG->addCurve(CT_Flat, "LC(H)", nullptr, false, true)); + HHmaskexpshape->setIdentityValue(0.); + HHmaskexpshape->setResetCurve(FlatCurveType(defSpot.HHmaskexpcurve.at(0)), defSpot.HHmaskexpcurve); + HHmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); + HHmaskexpshape->setCurveColorProvider(this, 6); + HHmaskexpshape->setBottomBarColorProvider(this, 6); + maskexpCurveEditorG->curveListComplete(); ToolParamBlock* const exposeBox = Gtk::manage(new ToolParamBlock()); @@ -423,14 +449,17 @@ Locallab::Locallab(): exposeBox->pack_start(*shcompr); exposeBox->pack_start(*warm); exposeBox->pack_start(*sensiex); + exposeBox->pack_start(*structexp); + exposeBox->pack_start(*blurexpde); exposeBox->pack_start(*curveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor Gtk::Frame* const maskexpFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHOW"))); maskexpFrame->set_label_align(0.025, 0.5); ToolParamBlock* const maskexpBox = Gtk::manage(new ToolParamBlock()); maskexpBox->pack_start(*transLabels2, Gtk::PACK_SHRINK, 4); - maskexpBox->pack_start(*enaExpMask, Gtk::PACK_SHRINK, 0); maskexpBox->pack_start(*showmaskexpMethod, Gtk::PACK_SHRINK, 0); + maskexpBox->pack_start(*enaExpMask, Gtk::PACK_SHRINK, 0); maskexpBox->pack_start(*maskexpCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + maskexpBox->pack_start(*blendmaskexp, Gtk::PACK_SHRINK, 0); maskexpFrame->add(*maskexpBox); exposeBox->pack_start(*maskexpFrame); @@ -1480,6 +1509,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).contrast = contrast->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).chroma = chroma->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).sensi = sensi->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).structcol = structcol->getIntValue(); if (qualitycurveMethod->get_active_row_number() == 0) { pp->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = "none"; @@ -1498,6 +1528,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).CCmaskcurve = CCmaskshape->getCurve(); pp->locallab.spots.at(pp->locallab.selspot).LLmaskcurve = LLmaskshape->getCurve(); pp->locallab.spots.at(pp->locallab.selspot).HHmaskcurve = HHmaskshape->getCurve(); + pp->locallab.spots.at(pp->locallab.selspot).blendmaskcol = blendmaskcol->getIntValue(); // Exposure pp->locallab.spots.at(pp->locallab.selspot).expexpose = expexpose->getEnabled(); pp->locallab.spots.at(pp->locallab.selspot).expcomp = expcomp->getIntValue(); @@ -1507,10 +1538,14 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).shcompr = shcompr->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).warm = warm->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).sensiex = sensiex->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).structexp = structexp->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).blurexpde = blurexpde->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).excurve = shapeexpos->getCurve(); pp->locallab.spots.at(pp->locallab.selspot).enaExpMask = enaExpMask->get_active(); pp->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve = LLmaskexpshape->getCurve(); pp->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve = CCmaskexpshape->getCurve(); + pp->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve = HHmaskexpshape->getCurve(); + pp->locallab.spots.at(pp->locallab.selspot).blendmaskexp = blendmaskexp->getIntValue(); // Vibrance pp->locallab.spots.at(pp->locallab.selspot).expvibrance = expvibrance->getEnabled(); pp->locallab.spots.at(pp->locallab.selspot).saturated = saturated->getIntValue(); @@ -1641,6 +1676,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pe->locallab.spots.at(pp->locallab.selspot).contrast = pe->locallab.spots.at(pp->locallab.selspot).contrast || contrast->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).chroma = pe->locallab.spots.at(pp->locallab.selspot).chroma || chroma->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).sensi = pe->locallab.spots.at(pp->locallab.selspot).sensi || sensi->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).structcol = pe->locallab.spots.at(pp->locallab.selspot).structcol || structcol->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = pe->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod || qualitycurveMethod->get_active_text() != M("GENERAL_UNCHANGED"); pe->locallab.spots.at(pp->locallab.selspot).llcurve = pe->locallab.spots.at(pp->locallab.selspot).llcurve || !llshape->isUnChanged(); pe->locallab.spots.at(pp->locallab.selspot).cccurve = pe->locallab.spots.at(pp->locallab.selspot).cccurve || !ccshape->isUnChanged(); @@ -1651,6 +1687,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pe->locallab.spots.at(pp->locallab.selspot).CCmaskcurve = pe->locallab.spots.at(pp->locallab.selspot).CCmaskcurve || !CCmaskshape->isUnChanged(); pe->locallab.spots.at(pp->locallab.selspot).LLmaskcurve = pe->locallab.spots.at(pp->locallab.selspot).LLmaskcurve || !LLmaskshape->isUnChanged(); pe->locallab.spots.at(pp->locallab.selspot).HHmaskcurve = pe->locallab.spots.at(pp->locallab.selspot).HHmaskcurve || !HHmaskshape->isUnChanged(); + pe->locallab.spots.at(pp->locallab.selspot).blendmaskcol = pe->locallab.spots.at(pp->locallab.selspot).blendmaskcol || blendmaskcol->getEditedState(); // Exposure pe->locallab.spots.at(pp->locallab.selspot).expexpose = pe->locallab.spots.at(pp->locallab.selspot).expexpose || !expexpose->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).expcomp = pe->locallab.spots.at(pp->locallab.selspot).expcomp || expcomp->getEditedState(); @@ -1660,10 +1697,14 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pe->locallab.spots.at(pp->locallab.selspot).shcompr = pe->locallab.spots.at(pp->locallab.selspot).shcompr || shcompr->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).warm = pe->locallab.spots.at(pp->locallab.selspot).warm || warm->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).sensiex = pe->locallab.spots.at(pp->locallab.selspot).sensiex || sensiex->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).structexp = pe->locallab.spots.at(pp->locallab.selspot).structexp || structexp->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).blurexpde = pe->locallab.spots.at(pp->locallab.selspot).blurexpde || blurexpde->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).excurve = pe->locallab.spots.at(pp->locallab.selspot).excurve || !shapeexpos->isUnChanged(); pe->locallab.spots.at(pp->locallab.selspot).enaExpMask = pe->locallab.spots.at(pp->locallab.selspot).enaExpMask || !enaExpMask->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve = pe->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve || !CCmaskexpshape->isUnChanged(); pe->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve = pe->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve || !LLmaskexpshape->isUnChanged(); + pe->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve = pe->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve || !HHmaskexpshape->isUnChanged(); + pe->locallab.spots.at(pp->locallab.selspot).blendmaskexp = pe->locallab.spots.at(pp->locallab.selspot).blendmaskexp || blendmaskexp->getEditedState(); // Vibrance pe->locallab.spots.at(pp->locallab.selspot).expvibrance = pe->locallab.spots.at(pp->locallab.selspot).expvibrance || !expvibrance->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).saturated = pe->locallab.spots.at(pp->locallab.selspot).saturated || saturated->getEditedState(); @@ -1781,6 +1822,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pedited->locallab.spots.at(pp->locallab.selspot).contrast = pedited->locallab.spots.at(pp->locallab.selspot).contrast || contrast->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).chroma = pedited->locallab.spots.at(pp->locallab.selspot).chroma || chroma->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).sensi = pedited->locallab.spots.at(pp->locallab.selspot).sensi || sensi->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).structcol = pedited->locallab.spots.at(pp->locallab.selspot).structcol || structcol->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = pedited->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod || qualitycurveMethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->locallab.spots.at(pp->locallab.selspot).llcurve = pedited->locallab.spots.at(pp->locallab.selspot).llcurve || !llshape->isUnChanged(); pedited->locallab.spots.at(pp->locallab.selspot).cccurve = pedited->locallab.spots.at(pp->locallab.selspot).cccurve || !ccshape->isUnChanged(); @@ -1791,6 +1833,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pedited->locallab.spots.at(pp->locallab.selspot).CCmaskcurve = pedited->locallab.spots.at(pp->locallab.selspot).CCmaskcurve || !CCmaskshape->isUnChanged(); pedited->locallab.spots.at(pp->locallab.selspot).LLmaskcurve = pedited->locallab.spots.at(pp->locallab.selspot).LLmaskcurve || !LLmaskshape->isUnChanged(); pedited->locallab.spots.at(pp->locallab.selspot).HHmaskcurve = pedited->locallab.spots.at(pp->locallab.selspot).HHmaskcurve || !HHmaskshape->isUnChanged(); + pedited->locallab.spots.at(pp->locallab.selspot).blendmaskcol = pedited->locallab.spots.at(pp->locallab.selspot).blendmaskcol || blendmaskcol->getEditedState(); // Exposure pedited->locallab.spots.at(pp->locallab.selspot).expexpose = pedited->locallab.spots.at(pp->locallab.selspot).expexpose || !expexpose->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).expcomp = pedited->locallab.spots.at(pp->locallab.selspot).expcomp || expcomp->getEditedState(); @@ -1800,10 +1843,14 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pedited->locallab.spots.at(pp->locallab.selspot).shcompr = pedited->locallab.spots.at(pp->locallab.selspot).shcompr || shcompr->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).warm = pedited->locallab.spots.at(pp->locallab.selspot).warm || warm->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).sensiex = pedited->locallab.spots.at(pp->locallab.selspot).sensiex || sensiex->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).structexp = pedited->locallab.spots.at(pp->locallab.selspot).structexp || structexp->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).blurexpde = pedited->locallab.spots.at(pp->locallab.selspot).blurexpde || blurexpde->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).excurve = pedited->locallab.spots.at(pp->locallab.selspot).excurve || !shapeexpos->isUnChanged(); pedited->locallab.spots.at(pp->locallab.selspot).enaExpMask = pedited->locallab.spots.at(pp->locallab.selspot).enaExpMask || !enaExpMask->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve = pedited->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve || !CCmaskexpshape->isUnChanged(); pedited->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve = pedited->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve || !LLmaskexpshape->isUnChanged(); + pedited->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve = pedited->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve || !HHmaskexpshape->isUnChanged(); + pedited->locallab.spots.at(pp->locallab.selspot).blendmaskexp = pedited->locallab.spots.at(pp->locallab.selspot).blendmaskexp || blendmaskexp->getEditedState(); // Vibrance pedited->locallab.spots.at(pp->locallab.selspot).expvibrance = pedited->locallab.spots.at(pp->locallab.selspot).expvibrance || !expvibrance->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).saturated = pedited->locallab.spots.at(pp->locallab.selspot).saturated || saturated->getEditedState(); @@ -2053,7 +2100,12 @@ void Locallab::curveChanged(CurveEditor* ce) listener->panelChanged(EvlocallabLLmaskexpshape, M("HISTORY_CUSTOMCURVE")); } } - + + if (ce == HHmaskexpshape) { + if (listener) { + listener->panelChanged(EvlocallabHHmaskexpshape, M("HISTORY_CUSTOMCURVE")); + } + } } // Vibrance @@ -2463,6 +2515,8 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe contrast->setDefault((double)defSpot->contrast); chroma->setDefault((double)defSpot->chroma); sensi->setDefault((double)defSpot->sensi); + structcol->setDefault((double)defSpot->structcol); + blendmaskcol->setDefault((double)defSpot->blendmaskcol); // Exposure expcomp->setDefault((double)defSpot->expcomp); hlcompr->setDefault((double)defSpot->hlcompr); @@ -2471,6 +2525,9 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe shcompr->setDefault((double)defSpot->shcompr); warm->setDefault((double)defSpot->warm); sensiex->setDefault((double)defSpot->sensiex); + structexp->setDefault((double)defSpot->structexp); + blurexpde->setDefault((double)defSpot->blurexpde); + blendmaskexp->setDefault((double)defSpot->blendmaskexp); // Vibrance saturated->setDefault((double)defSpot->saturated); pastels->setDefault((double)defSpot->pastels); @@ -2537,6 +2594,8 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe contrast->setDefaultEditedState(Irrelevant); chroma->setDefaultEditedState(Irrelevant); sensi->setDefaultEditedState(Irrelevant); + structcol->setDefaultEditedState(Irrelevant); + blendmaskcol->setDefaultEditedState(Irrelevant); // Exposure expcomp->setDefaultEditedState(Irrelevant); hlcompr->setDefaultEditedState(Irrelevant); @@ -2545,6 +2604,9 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe shcompr->setDefaultEditedState(Irrelevant); warm->setDefaultEditedState(Irrelevant); sensiex->setDefaultEditedState(Irrelevant); + structexp->setDefaultEditedState(Irrelevant); + blurexpde->setDefaultEditedState(Irrelevant); + blendmaskexp->setDefaultEditedState(Irrelevant); // Vibrance saturated->setDefaultEditedState(Irrelevant); pastels->setDefaultEditedState(Irrelevant); @@ -2615,6 +2677,8 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe contrast->setDefaultEditedState(defSpotState->contrast ? Edited : UnEdited); chroma->setDefaultEditedState(defSpotState->chroma ? Edited : UnEdited); sensi->setDefaultEditedState(defSpotState->sensi ? Edited : UnEdited); + structcol->setDefaultEditedState(defSpotState->structcol ? Edited : UnEdited); + blendmaskcol->setDefaultEditedState(defSpotState->blendmaskcol ? Edited : UnEdited); // Exposure expcomp->setDefaultEditedState(defSpotState->expcomp ? Edited : UnEdited); hlcompr->setDefaultEditedState(defSpotState->hlcompr ? Edited : UnEdited); @@ -2623,6 +2687,9 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe shcompr->setDefaultEditedState(defSpotState->shcompr ? Edited : UnEdited); warm->setDefaultEditedState(defSpotState->warm ? Edited : UnEdited); sensiex->setDefaultEditedState(defSpotState->sensiex ? Edited : UnEdited); + structexp->setDefaultEditedState(defSpotState->structexp ? Edited : UnEdited); + blurexpde->setDefaultEditedState(defSpotState->blurexpde ? Edited : UnEdited); + blendmaskexp->setDefaultEditedState(defSpotState->blendmaskexp ? Edited : UnEdited); // Vibrance saturated->setDefaultEditedState(defSpotState->saturated ? Edited : UnEdited); pastels->setDefaultEditedState(defSpotState->pastels ? Edited : UnEdited); @@ -2748,6 +2815,19 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) listener->panelChanged(Evlocallabsensi, sensi->getTextValue()); } } + + if (a == structcol) { + if (listener) { + listener->panelChanged(Evlocallabstructcol, structcol->getTextValue()); + } + } + + if (a == blendmaskcol) { + if (listener) { + listener->panelChanged(Evlocallabblendmaskcol, blendmaskcol->getTextValue()); + } + } + } // Exposure @@ -2802,6 +2882,25 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) listener->panelChanged(Evlocallabsensiex, sensiex->getTextValue()); } } + + if (a == structexp) { + if (listener) { + listener->panelChanged(Evlocallabstructexp, structexp->getTextValue()); + } + } + + if (a == blurexpde) { + if (listener) { + listener->panelChanged(Evlocallabblurexpde, blurexpde->getTextValue()); + } + } + + if (a == blendmaskexp) { + if (listener) { + listener->panelChanged(Evlocallabblendmaskexp, blendmaskexp->getTextValue()); + } + } + } // Vibrance @@ -3187,6 +3286,8 @@ void Locallab::setBatchMode(bool batchMode) contrast->showEditedCB(); chroma->showEditedCB(); sensi->showEditedCB(); + structcol->showEditedCB(); + blendmaskcol->showEditedCB(); // Exposure expcomp->showEditedCB(); hlcompr->showEditedCB(); @@ -3195,6 +3296,9 @@ void Locallab::setBatchMode(bool batchMode) shcompr->showEditedCB(); warm->showEditedCB(); sensiex->showEditedCB(); + structexp->showEditedCB(); + blurexpde->showEditedCB(); + blendmaskexp->showEditedCB(); // Vibrance saturated->showEditedCB(); pastels->showEditedCB(); @@ -3400,12 +3504,12 @@ void Locallab::enableListener() curvactivConn.block(false); qualitycurveMethodConn.block(false); inversConn.block(false); - enaColorMaskConn.block(false); showmaskcolMethodConn.block(false); + enaColorMaskConn.block(false); // Exposure enableexposeConn.block(false); - enaExpMaskConn.block(false); showmaskexpMethodConn.block(false); + enaExpMaskConn.block(false); // Vibrance enablevibranceConn.block(false); pskinsconn.block(false); @@ -3447,12 +3551,12 @@ void Locallab::disableListener() curvactivConn.block(true); qualitycurveMethodConn.block(true); inversConn.block(true); - enaColorMaskConn.block(true); showmaskcolMethodConn.block(true); + enaColorMaskConn.block(true); // Exposure enableexposeConn.block(true); - enaExpMaskConn.block(true); showmaskexpMethodConn.block(true); + enaExpMaskConn.block(true); // Vibrance enablevibranceConn.block(true); pskinsconn.block(true); @@ -3497,6 +3601,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con contrast->setValue(pp->locallab.spots.at(index).contrast); chroma->setValue(pp->locallab.spots.at(index).chroma); sensi->setValue(pp->locallab.spots.at(index).sensi); + structcol->setValue(pp->locallab.spots.at(index).structcol); if (pp->locallab.spots.at(index).qualitycurveMethod == "none") { qualitycurveMethod->set_active(0); @@ -3521,6 +3626,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con CCmaskshape->setCurve(pp->locallab.spots.at(index).CCmaskcurve); LLmaskshape->setCurve(pp->locallab.spots.at(index).LLmaskcurve); HHmaskshape->setCurve(pp->locallab.spots.at(index).HHmaskcurve); + blendmaskcol->setValue(pp->locallab.spots.at(index).blendmaskcol); // Exposure expexpose->setEnabled(pp->locallab.spots.at(index).expexpose); @@ -3531,10 +3637,14 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con shcompr->setValue(pp->locallab.spots.at(index).shcompr); warm->setValue(pp->locallab.spots.at(index).warm); sensiex->setValue(pp->locallab.spots.at(index).sensiex); + structexp->setValue(pp->locallab.spots.at(index).structexp); + blurexpde->setValue(pp->locallab.spots.at(index).blurexpde); shapeexpos->setCurve(pp->locallab.spots.at(index).excurve); enaExpMask->set_active(pp->locallab.spots.at(index).enaExpMask); CCmaskexpshape->setCurve(pp->locallab.spots.at(index).CCmaskexpcurve); LLmaskexpshape->setCurve(pp->locallab.spots.at(index).LLmaskexpcurve); + HHmaskexpshape->setCurve(pp->locallab.spots.at(index).HHmaskexpcurve); + blendmaskexp->setValue(pp->locallab.spots.at(index).blendmaskexp); // Vibrance expvibrance->setEnabled(pp->locallab.spots.at(index).expvibrance); @@ -3687,6 +3797,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con contrast->setEditedState(spotState->contrast ? Edited : UnEdited); chroma->setEditedState(spotState->chroma ? Edited : UnEdited); sensi->setEditedState(spotState->sensi ? Edited : UnEdited); + structcol->setEditedState(spotState->structcol ? Edited : UnEdited); if (!spotState->qualitycurveMethod) { qualitycurveMethod->set_active_text(M("GENERAL_UNCHANGED")); @@ -3701,7 +3812,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con CCmaskshape->setUnChanged(!spotState->CCmaskcurve); LLmaskshape->setUnChanged(!spotState->LLmaskcurve); HHmaskshape->setUnChanged(!spotState->HHmaskcurve); - + blendmaskcol->setEditedState(spotState->blendmaskcol ? Edited : UnEdited); // Exposure expexpose->set_inconsistent(!spotState->expexpose); @@ -3712,10 +3823,14 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con warm->setEditedState(spotState->warm ? Edited : UnEdited); shcompr->setEditedState(spotState->shcompr ? Edited : UnEdited); sensiex->setEditedState(spotState->sensiex ? Edited : UnEdited); + structexp->setEditedState(spotState->structexp ? Edited : UnEdited); + blurexpde->setEditedState(spotState->blurexpde ? Edited : UnEdited); shapeexpos->setUnChanged(!spotState->excurve); enaExpMask->set_inconsistent(multiImage && !spotState->enaExpMask); CCmaskexpshape->setUnChanged(!spotState->CCmaskexpcurve); LLmaskexpshape->setUnChanged(!spotState->LLmaskexpcurve); + HHmaskexpshape->setUnChanged(!spotState->HHmaskexpcurve); + blendmaskexp->setEditedState(spotState->blendmaskexp ? Edited : UnEdited); // Vibrance expvibrance->set_inconsistent(!spotState->expvibrance); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index f9fdd0b02..ea987a7e5 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -78,6 +78,7 @@ private: DiagonalCurveEditor* shapeexpos; FlatCurveEditor* CCmaskexpshape; FlatCurveEditor* LLmaskexpshape; + FlatCurveEditor* HHmaskexpshape; // Vibrance CurveEditorGroup* const curveEditorGG; DiagonalCurveEditor* skinTonesCurve; @@ -91,6 +92,8 @@ private: Adjuster* const contrast; Adjuster* const chroma; Adjuster* const sensi; + Adjuster* const structcol; + Adjuster* const blendmaskcol; // Exposure Adjuster* const expcomp; Adjuster* const hlcompr; @@ -99,6 +102,9 @@ private: Adjuster* const shcompr; Adjuster* const warm; Adjuster* const sensiex; + Adjuster* const structexp; + Adjuster* const blurexpde; + Adjuster* const blendmaskexp; // Vibrance Adjuster* const saturated; Adjuster* const pastels; diff --git a/rtgui/multilangmgr.cc b/rtgui/multilangmgr.cc index a439c0602..8d2985436 100644 --- a/rtgui/multilangmgr.cc +++ b/rtgui/multilangmgr.cc @@ -209,6 +209,27 @@ Glib::ustring MultiLangMgr::getOSUserLanguage () { Glib::ustring langName ("default"); +#if defined (WIN32) + + const LCID localeID = GetUserDefaultLCID (); + TCHAR localeName[18]; + + const int langLen = GetLocaleInfo (localeID, LOCALE_SISO639LANGNAME, localeName, 9); + if (langLen <= 0) { + return langName; + } + + localeName[langLen - 1] = '-'; + + const int countryLen = GetLocaleInfo (localeID, LOCALE_SISO3166CTRYNAME, &localeName[langLen], 9); + if (countryLen <= 0) { + return langName; + } + + langName = localeToLang (localeName); + +#elif defined (__linux__) || defined (__APPLE__) + // Query the current locale and force decimal point to dot. const char *locale = getenv("LANG"); if (locale || (locale = setlocale (LC_CTYPE, ""))) { @@ -217,5 +238,7 @@ Glib::ustring MultiLangMgr::getOSUserLanguage () setlocale (LC_NUMERIC, "C"); +#endif + return langName; } diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index b9aebdee0..3ed6f1970 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -948,6 +948,8 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).contrast = locallab.spots.at(j).contrast && pSpot.contrast == otherSpot.contrast; locallab.spots.at(j).chroma = locallab.spots.at(j).chroma && pSpot.chroma == otherSpot.chroma; locallab.spots.at(j).sensi = locallab.spots.at(j).sensi && pSpot.sensi == otherSpot.sensi; + locallab.spots.at(j).structcol = locallab.spots.at(j).structcol && pSpot.structcol == otherSpot.structcol; + locallab.spots.at(j).blendmaskcol = locallab.spots.at(j).blendmaskcol && pSpot.blendmaskcol == otherSpot.blendmaskcol; locallab.spots.at(j).qualitycurveMethod = locallab.spots.at(j).qualitycurveMethod && pSpot.qualitycurveMethod == otherSpot.qualitycurveMethod; locallab.spots.at(j).llcurve = locallab.spots.at(j).llcurve && pSpot.llcurve == otherSpot.llcurve; locallab.spots.at(j).cccurve = locallab.spots.at(j).cccurve && pSpot.cccurve == otherSpot.cccurve; @@ -967,10 +969,14 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).shcompr = locallab.spots.at(j).shcompr && pSpot.shcompr == otherSpot.shcompr; locallab.spots.at(j).warm = locallab.spots.at(j).warm && pSpot.warm == otherSpot.warm; locallab.spots.at(j).sensiex = locallab.spots.at(j).sensiex && pSpot.sensiex == otherSpot.sensiex; + locallab.spots.at(j).structexp = locallab.spots.at(j).structexp && pSpot.structexp == otherSpot.structexp; + locallab.spots.at(j).blurexpde = locallab.spots.at(j).blurexpde && pSpot.blurexpde == otherSpot.blurexpde; locallab.spots.at(j).excurve = locallab.spots.at(j).excurve && pSpot.excurve == otherSpot.excurve; locallab.spots.at(j).enaExpMask = locallab.spots.at(j).enaExpMask && pSpot.enaExpMask == otherSpot.enaExpMask; locallab.spots.at(j).CCmaskexpcurve = locallab.spots.at(j).CCmaskexpcurve && pSpot.CCmaskexpcurve == otherSpot.CCmaskexpcurve; locallab.spots.at(j).LLmaskexpcurve = locallab.spots.at(j).LLmaskexpcurve && pSpot.LLmaskexpcurve == otherSpot.LLmaskexpcurve; + locallab.spots.at(j).HHmaskexpcurve = locallab.spots.at(j).HHmaskexpcurve && pSpot.HHmaskexpcurve == otherSpot.HHmaskexpcurve; + locallab.spots.at(j).blendmaskexp = locallab.spots.at(j).blendmaskexp && pSpot.blendmaskexp == otherSpot.blendmaskexp; // Vibrance locallab.spots.at(j).expvibrance = locallab.spots.at(j).expvibrance && pSpot.expvibrance == otherSpot.expvibrance; locallab.spots.at(j).saturated = locallab.spots.at(j).saturated && pSpot.saturated == otherSpot.saturated; @@ -2575,6 +2581,14 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).sensi = mods.locallab.spots.at(i).sensi; } + if (locallab.spots.at(i).structcol) { + toEdit.locallab.spots.at(i).structcol = mods.locallab.spots.at(i).structcol; + } + + if (locallab.spots.at(i).blendmaskcol) { + toEdit.locallab.spots.at(i).blendmaskcol = mods.locallab.spots.at(i).blendmaskcol; + } + if (locallab.spots.at(i).qualitycurveMethod) { toEdit.locallab.spots.at(i).qualitycurveMethod = mods.locallab.spots.at(i).qualitycurveMethod; } @@ -2648,6 +2662,14 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).sensiex = mods.locallab.spots.at(i).sensiex; } + if (locallab.spots.at(i).structexp) { + toEdit.locallab.spots.at(i).structexp = mods.locallab.spots.at(i).structexp; + } + + if (locallab.spots.at(i).blurexpde) { + toEdit.locallab.spots.at(i).blurexpde = mods.locallab.spots.at(i).blurexpde; + } + if (locallab.spots.at(i).excurve) { toEdit.locallab.spots.at(i).excurve = mods.locallab.spots.at(i).excurve; } @@ -2664,6 +2686,14 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).LLmaskexpcurve = mods.locallab.spots.at(i).LLmaskexpcurve; } + if (locallab.spots.at(i).HHmaskexpcurve) { + toEdit.locallab.spots.at(i).HHmaskexpcurve = mods.locallab.spots.at(i).HHmaskexpcurve; + } + + if (locallab.spots.at(i).blendmaskexp) { + toEdit.locallab.spots.at(i).blendmaskexp = mods.locallab.spots.at(i).blendmaskexp; + } + // Vibrance if (locallab.spots.at(i).expvibrance) { toEdit.locallab.spots.at(i).expvibrance = mods.locallab.spots.at(i).expvibrance; @@ -3915,6 +3945,8 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : contrast(v), chroma(v), sensi(v), + structcol(v), + blendmaskcol(v), qualitycurveMethod(v), llcurve(v), cccurve(v), @@ -3934,10 +3966,14 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : shcompr(v), warm(v), sensiex(v), + structexp(v), + blurexpde(v), excurve(v), enaExpMask(v), CCmaskexpcurve(v), LLmaskexpcurve(v), + HHmaskexpcurve(v), + blendmaskexp(v), // Vibrance expvibrance(v), saturated(v), @@ -4047,6 +4083,8 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) contrast = v; chroma = v; sensi = v; + structcol = v; + blendmaskcol = v; qualitycurveMethod = v; llcurve = v; cccurve = v; @@ -4066,10 +4104,14 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) shcompr = v; warm = v; sensiex = v; + structexp = v; + blurexpde = v; excurve = v; enaExpMask = v; CCmaskexpcurve = v; LLmaskexpcurve = v; + HHmaskexpcurve = v; + blendmaskexp = v; // Vibrance expvibrance = v; saturated = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 01abca089..b040e6266 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -487,6 +487,8 @@ public: bool contrast; bool chroma; bool sensi; + bool structcol; + bool blendmaskcol; bool qualitycurveMethod; bool llcurve; bool cccurve; @@ -506,10 +508,14 @@ public: bool shcompr; bool warm; bool sensiex; + bool structexp; + bool blurexpde; bool excurve; bool enaExpMask; bool CCmaskexpcurve; bool LLmaskexpcurve; + bool HHmaskexpcurve; + bool blendmaskexp; // Vibrance bool expvibrance; bool saturated;