diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5cdfd8d5b..257eb9708 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,6 +14,7 @@ The most useful feedback is based on the latest development code, and in the cas ## Contributing as a Programmer - Announce and discuss your plans in GitHub before starting work. +- Work in a new branch. Fork if necessary. - Keep branches small so that completed and working features can be merged into the "dev" branch often, and so that they can be abandoned if they head in the wrong direction. - Use C++11 -- Code must be run through astyle version 3 or newer before being merged. +- Code may be run through astyle version 3 or newer. If using astyle, it is important that the astyle changes go into their own commit, so that style changes are not mixed with actual code changes. Command: `astyle --options=rawtherapee.astylerc code.cc` diff --git a/rawtherapee.astylerc b/rawtherapee.astylerc index bcea16b96..3d49d821f 100644 --- a/rawtherapee.astylerc +++ b/rawtherapee.astylerc @@ -4,5 +4,5 @@ indent-switches break-blocks pad-oper convert-tabs -pad-first-paren-out pad-header +unpad-paren diff --git a/rtdata/images/Dark/actions/gamut-hist.png b/rtdata/images/Dark/actions/gamut-hist.png new file mode 100644 index 000000000..8a60118dd Binary files /dev/null and b/rtdata/images/Dark/actions/gamut-hist.png differ diff --git a/rtdata/images/Light/actions/gamut-hist.png b/rtdata/images/Light/actions/gamut-hist.png new file mode 100644 index 000000000..8c81e0213 Binary files /dev/null and b/rtdata/images/Light/actions/gamut-hist.png differ diff --git a/rtdata/languages/Catala b/rtdata/languages/Catala index eda2ad2ad..756df1be3 100644 --- a/rtdata/languages/Catala +++ b/rtdata/languages/Catala @@ -1319,6 +1319,8 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. @@ -1661,14 +1663,14 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1915,6 +1917,7 @@ ZOOMPANEL_ZOOMOUT;Allunya\nDrecera: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Chinese (Simplified) b/rtdata/languages/Chinese (Simplified) index 51aed581d..fccf5f847 100644 --- a/rtdata/languages/Chinese (Simplified) +++ b/rtdata/languages/Chinese (Simplified) @@ -1427,6 +1427,8 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. !IPTCPANEL_COPYRIGHT;Copyright notice @@ -1607,14 +1609,14 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !TP_COLORAPP_TCMODE_LABEL1;Curve mode 1 !TP_COLORAPP_TCMODE_LABEL2;Curve mode 2 !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1886,6 +1888,7 @@ ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Chinese (Traditional) b/rtdata/languages/Chinese (Traditional) index 2476aeb41..09439c2e4 100644 --- a/rtdata/languages/Chinese (Traditional) +++ b/rtdata/languages/Chinese (Traditional) @@ -979,6 +979,8 @@ TP_WBALANCE_TEMPERATURE;色溫 !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. @@ -1462,14 +1464,14 @@ TP_WBALANCE_TEMPERATURE;色溫 !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1842,6 +1844,7 @@ TP_WBALANCE_TEMPERATURE;色溫 !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Czech b/rtdata/languages/Czech index 29cf45b3d..67c2cf0e3 100644 --- a/rtdata/languages/Czech +++ b/rtdata/languages/Czech @@ -38,7 +38,7 @@ #37 2017-01-10 updated by mkyral #38 2017-04-26 updated by mkyral #39 2017-07-21 updated by mkyral - +#40 2017-12-13 updated by mkyral ABOUT_TAB_BUILD;Verze ABOUT_TAB_CREDITS;Zásluhy ABOUT_TAB_LICENSE;Licence @@ -73,6 +73,7 @@ CURVEEDITOR_TOOLTIPPASTE;Vložit křivku ze schránky. CURVEEDITOR_TOOLTIPSAVE;Uložit současnou křivku. CURVEEDITOR_TYPE;Typ DIRBROWSER_FOLDERS;Složky +DONT_SHOW_AGAIN;Zprávu znova nezobrazovat. DYNPROFILEEDITOR_DELETE;Smazat DYNPROFILEEDITOR_EDIT;Upravit DYNPROFILEEDITOR_EDIT_RULE;Upravit pravidlo dynamického profilu @@ -107,6 +108,7 @@ EXIFPANEL_RESET;Obnovit EXIFPANEL_RESETALL;Obnovit vše EXIFPANEL_RESETALLHINT;Obnoví původní hodnoty u všech štítků. EXIFPANEL_RESETHINT;Obnoví původní hodnoty u vybraných štítků. +EXIFPANEL_SHOWALL;Zobrazit vše EXIFPANEL_SUBDIRECTORY;Podadresář EXPORT_BYPASS;Kroky zpracování pro přeskočení EXPORT_BYPASS_ALL;Vybrat / Zrušit výběr všeho @@ -271,6 +273,7 @@ GENERAL_PORTRAIT;Na výšku GENERAL_SAVE;Uložit GENERAL_UNCHANGED;(Beze změny) GENERAL_WARNING;Varování +GIMP_PLUGIN_INFO;Vítejte v RawTherapee doplňku pro GIMP!\nPo dokončení úprav prostě zavřete hlavní okno RawTherapee a obrázek bude automaticky načten GIMPem. HISTOGRAM_TOOLTIP_B;Skrýt/Zobrazit histogram modré. HISTOGRAM_TOOLTIP_BAR;Skrýt/Zobrazit řádek RGB indikátoru\nKlikněte pravým tlačítkem myši na náhled pro zmrazení/uvolnění. HISTOGRAM_TOOLTIP_CHRO;Skrýt/Zobrazit histogram barevnosti. @@ -316,9 +319,9 @@ HISTORY_MSG_30;RLD - Poloměr HISTORY_MSG_31;RLD - Míra HISTORY_MSG_32;RLD - Útlum HISTORY_MSG_33;RLD - Průchody -HISTORY_MSG_34;LCP korekce zkreslení -HISTORY_MSG_35;LCP korekce vinětace -HISTORY_MSG_36;LCP korekce CA +HISTORY_MSG_34;Korekce objektivu - Zkreslení +HISTORY_MSG_35;Korekce objektivu - Vinětace +HISTORY_MSG_36;Korekce objektivu - ChA HISTORY_MSG_37;Expozice - Automatické úrovně HISTORY_MSG_38;Vyvážení bílé - Metoda HISTORY_MSG_39;VB - Teplota @@ -367,7 +370,7 @@ HISTORY_MSG_81;Změna velikosti HISTORY_MSG_82;Profil změněn HISTORY_MSG_83;S/S - Maska ostrosti HISTORY_MSG_84;Korekce perspektivy -HISTORY_MSG_85;LCP +HISTORY_MSG_85;Korekce objektivu - LCP soubor HISTORY_MSG_86;RGB křivky - Režim svítivost HISTORY_MSG_87;Redukce impulzního šumu HISTORY_MSG_88;Redukce impulzního šumu - práh @@ -741,6 +744,23 @@ HISTORY_MSG_472;PS - plynulé přechody HISTORY_MSG_473;PS - Použít LMMSE HISTORY_MSG_474;PS - korekce HISTORY_MSG_475;PS - korekce kanálu +HISTORY_MSG_476;CAM02 - Teplota (výstup) +HISTORY_MSG_477;CAM02 - Zelená (výstup) +HISTORY_MSG_478;CAM02 - Yb (výstup) +HISTORY_MSG_479;CAM02 - CAT02 přizpůsobení (výstup) +HISTORY_MSG_480;CAM02 - Automatická CAT02 (výstup) +HISTORY_MSG_481;CAM02 - Teplota scény +HISTORY_MSG_482;CAM02 - Zelená scény +HISTORY_MSG_483;CAM02 - Yb scény +HISTORY_MSG_484;CAT02 - Automatická Yb scény +HISTORY_MSG_485;Korekce objektivu +HISTORY_MSG_486;Korekce objektivu - Fotoaparát +HISTORY_MSG_487;Korekce objektivu - Objektiv +HISTORY_MSG_488;HDR Mapování tónů +HISTORY_MSG_489;HDR TM - Práh +HISTORY_MSG_490;HDR TM - Míra +HISTORY_MSG_491;Vyvážení bílé +HISTORY_MSG_492;RGB křivky HISTORY_NEWSNAPSHOT;Přidat HISTORY_NEWSNAPSHOT_TOOLTIP;Zkratka: Alt-s HISTORY_SNAPSHOT;Snímek @@ -787,6 +807,10 @@ IPTCPANEL_TITLE;Titulek IPTCPANEL_TITLEHINT;Vložte krátké, popisné a lidsky čitelné jméno obrázku. Například název souboru. IPTCPANEL_TRANSREFERENCE;Číslo úlohy IPTCPANEL_TRANSREFERENCEHINT;Zadejte číslo nebo identifikátor potřebný v pracovním postupu nebo pro sledování. +LENSPROFILE_CORRECTION_AUTOMATCH;Automatický dohledané korekční parametry +LENSPROFILE_CORRECTION_LCPFILE;LCP Soubor +LENSPROFILE_CORRECTION_MANUAL;Ruční korekční parametry +LENSPROFILE_LENS_WARNING;Varování: crop factor použitý pro profilování objektivu je větší než crop factor fotoaparátu. Výsledek může být nesprávný. MAIN_BUTTON_FULLSCREEN;Celá obrazovka MAIN_BUTTON_NAVNEXT_TOOLTIP;Přejít k dalšímu obrázku relativnímu k obrázku otevřenému v editoru.\nZkratka: Shift-F4\n\nPřejít k dalšímu obrázku relativnímu k vybranému náhledu v prohlížeči souborů nebo na filmovém pásu:\nZkratka: F4 MAIN_BUTTON_NAVPREV_TOOLTIP;Přejít k předchozímu obrázku relativnímu k obrázku otevřenému v editoru.\nZkratka: Shift-F3\n\nPřejít k předchozímu obrázku relativnímu k vybranému náhledu v prohlížeči souborů nebo na filmovém pásu:\nZkratka: F3 @@ -845,6 +869,7 @@ MAIN_TAB_WAVELET_TOOLTIP;Zkratka: Alt-w MAIN_TOOLTIP_BACKCOLOR0;Barva pozadí náhledu: Dle motivu\nZkratka: 9 MAIN_TOOLTIP_BACKCOLOR1;Barva pozadí náhledu: Černá\nZkratka: 9 MAIN_TOOLTIP_BACKCOLOR2;Barva pozadí náhledu: Bílá\nZkratka: 9 +MAIN_TOOLTIP_BACKCOLOR3;Barva pozadí náhledu: Středně šedá\nZkratka: 9 MAIN_TOOLTIP_BEFOREAFTERLOCK;Zamknout / Odemknout pohled Před\n\nZamknout: ponechá pohled Před nezměněn.\nUžitečné pro posouzení výsledného efektu po použití více nástrojů.\nNavíc může být porovnání provedeno proti kterémukoli stavu v historii.\n\nOdemknout: pohled Před bude následovat pohled Poté, vždy jen o jeden krok zpět, představí vliv právě použitého nástroje. MAIN_TOOLTIP_HIDEHP;Zobrazit či schovat levý panel (obsahující historii).\nZkratka: l MAIN_TOOLTIP_INDCLIPPEDH;Zvýraznit oříznutá světla.\nZkratka: < @@ -912,7 +937,7 @@ PARTIALPASTE_IMPULSEDENOISE;Redukce impulzního šumu PARTIALPASTE_IPTCINFO;IPTC PARTIALPASTE_LABCURVE;L*a*b* úpravy PARTIALPASTE_LENSGROUP;Nastavení související s objektivy -PARTIALPASTE_LENSPROFILE;Korekční profil objektivu +PARTIALPASTE_LENSPROFILE;Korekční profily objektivů PARTIALPASTE_METAGROUP;Metadata PARTIALPASTE_PCVIGNETTE;Viněta PARTIALPASTE_PERSPECTIVE;Perspektiva @@ -933,7 +958,7 @@ PARTIALPASTE_RAW_DMETHOD;Metoda demozajkování PARTIALPASTE_RAW_FALSECOLOR;Potlačení chybných barev PARTIALPASTE_RAW_IMAGENUM;Dílčí snímek PARTIALPASTE_RAW_LMMSEITERATIONS;Kroky rozšíření LMMSE -PARTIALPASTE_RAW_PIXELSHIFT;PixelShift +PARTIALPASTE_RAW_PIXELSHIFT;Pixel Shift PARTIALPASTE_RESIZE;Změna velikosti PARTIALPASTE_RETINEX;Retinex PARTIALPASTE_RGBCURVES;RGB křivky @@ -942,6 +967,7 @@ PARTIALPASTE_SHADOWSHIGHLIGHTS;Stíny/Světla PARTIALPASTE_SHARPENEDGE;Hrany PARTIALPASTE_SHARPENING;Doostření (USM/RL) PARTIALPASTE_SHARPENMICRO;Mikrokontrast +PARTIALPASTE_TM_FATTAL;HDR mapování tónů PARTIALPASTE_VIBRANCE;Živost PARTIALPASTE_VIGNETTING;Korekce vinětace PARTIALPASTE_WAVELETGROUP;Úrovně vlnky @@ -954,6 +980,7 @@ PREFERENCES_AUTLISSTD;Vysoké PREFERENCES_AUTLISVLOW;Ne PREFERENCES_AUTLOW;Nízká PREFERENCES_AUTOMONPROFILE;Použít barevný profil hlavního monitoru z operačního systému +PREFERENCES_AUTOSAVE_TP_OPEN;Před ukončením automaticky uložit\nstav sbalení/rozbalení nástrojů. PREFERENCES_AUTSTD;Běžná PREFERENCES_BATCH_PROCESSING;Dávkové zpracování PREFERENCES_BEHADDALL;Vše do 'Přidat' @@ -989,18 +1016,20 @@ PREFERENCES_CUSTPROFBUILDKEYFORMAT_NAME;Jméno PREFERENCES_CUSTPROFBUILDKEYFORMAT_TID;TagID PREFERENCES_CUSTPROFBUILDPATH;Cesta k programu PREFERENCES_CUTOVERLAYBRUSH;Barva masky ořezu/průhlednosti -PREFERENCES_D50;5000K +PREFERENCES_D50;Nastavení v hlavní nabídce +PREFERENCES_D50_OLD;5000K PREFERENCES_D55;5500K PREFERENCES_D60;6000K PREFERENCES_D65;6500K PREFERENCES_DARKFRAMEFOUND;Nalezeno PREFERENCES_DARKFRAMESHOTS;snímků -PREFERENCES_DARKFRAMETEMPLATES;šablon +PREFERENCES_DARKFRAMETEMPLATES;šablony PREFERENCES_DATEFORMAT;Formát data PREFERENCES_DATEFORMATHINT;Lze použít následující formátovací řetězce:\n%y\t- rok (year)\n%m\t- měsíc (month)\n%d\t- den (day)\n\nNapříklad český formát data:\n%d. %m. %y PREFERENCES_DAUB_LABEL;Použít D6 Daubechiesové vlnky namísto D4 PREFERENCES_DAUB_TOOLTIP;Nástroje Redukce šumu a Úrovně vlnky používají Daubechiesové mateřskou vlnku. Pokud místo D4 vyberete D6 zvýší se počet ortogonálních Daubechiesové koeficientů a pravděpodobně zvýší kvalitu úrovní malého měřítka. Není zde rozdíl ve spotřebě paměti nebo délce zpracování. PREFERENCES_DIRDARKFRAMES;Složka tmavých snímků +PREFERENCES_DIRECTORIES;Složky PREFERENCES_DIRHOME;Domovská složka PREFERENCES_DIRLAST;Poslední navštívená složka PREFERENCES_DIROTHER;Jiná @@ -1016,7 +1045,7 @@ PREFERENCES_FILEFORMAT;Formát souboru PREFERENCES_FLATFIELDFOUND;Nalezeno PREFERENCES_FLATFIELDSDIR;Složka Flat Field souborů PREFERENCES_FLATFIELDSHOTS;snímků -PREFERENCES_FLATFIELDTEMPLATES;šablon +PREFERENCES_FLATFIELDTEMPLATES;šablony PREFERENCES_FLUOF2;Fluorescenční F2 PREFERENCES_FLUOF7;Fluorescenční F7 PREFERENCES_FLUOF11;Fluorescenční F11 @@ -1029,7 +1058,8 @@ PREFERENCES_GREY;Yb svítivost výstupního zařízení (%) PREFERENCES_GREY05;Yb=05 CIE L#30 PREFERENCES_GREY10;Yb=10 CIE L#40 PREFERENCES_GREY15;Yb=15 CIE L#45 -PREFERENCES_GREY18;Yb=18 CIE L#50 +PREFERENCES_GREY18;Nastavení v hlavní nabídce +PREFERENCES_GREY18_OLD;Yb=18 CIE L#50 PREFERENCES_GREY23;Yb=23 CIE L#55 PREFERENCES_GREY30;Yb=30 CIE L#60 PREFERENCES_GREY40;Yb=40 CIE L#70 @@ -1051,6 +1081,7 @@ PREFERENCES_INTENT_PERCEPTUAL;Vnímání PREFERENCES_INTENT_RELATIVE;Relativní kolorimetrie PREFERENCES_INTENT_SATURATION;Nasycení PREFERENCES_INTERNALTHUMBIFUNTOUCHED;Ukázat vložené JPEG náhledy u needitovaných snímků +PREFERENCES_LANG;Jazyk PREFERENCES_LANGAUTODETECT;Použít systémový jazyk PREFERENCES_LEVAUTDN;Úroveň odšumění PREFERENCES_LEVDN;Velikost buňky @@ -1112,6 +1143,7 @@ PREFERENCES_REMEMBERZOOMPAN;Zapamatovat si procento přiblížení a posun obrá PREFERENCES_REMEMBERZOOMPAN_TOOLTIP;Zapamatovat si procento přiblížení a posun aktuálního obrázku a použít tyto hodnoty při otevírání nového obrázku.\n\nTato volba funguje pouze v režimu "Mód jedné karty editoru" a volba "Metoda demozajkování pro náhled při přiblížení menším než 100%" je nastavena na "Stejně jako v PP3". PREFERENCES_RGBDTL_LABEL;Maximální počet vláken pro redukci šumu a úrovně vlnky PREFERENCES_RGBDTL_TOOLTIP;Pro automatické nastavení maximálního možného počtu vláken ponechte nastaveno na "0". Čím více vláken běží paralelně, tím rychlejší je výpočet. Paměťové nároky najdete na RawPedii. +PREFERENCES_SAVE_TP_OPEN_NOW;Uložit stav sbalení/rozbalení nástrojů hned PREFERENCES_SELECTFONT;Vyberte hlavní písmo PREFERENCES_SELECTFONT_COLPICKER;Vybrat písmo pro Průzkumníka barev PREFERENCES_SELECTLANG;Volba jazyka @@ -1142,6 +1174,7 @@ PREFERENCES_TAB_GENERAL;Obecné PREFERENCES_TAB_IMPROC;Zpracování obrázku PREFERENCES_TAB_PERFORMANCE;Výkon a kvalita PREFERENCES_TAB_SOUND;Zvuky +PREFERENCES_THEME;Vzhled PREFERENCES_TIMAX;Vysoký PREFERENCES_TINB;Počet dlaždic PREFERENCES_TISTD;Běžný @@ -1165,7 +1198,7 @@ PROFILEPANEL_MODE_TIP;Režim uplatnění profilu zpracování.\n\nTlačítko je PROFILEPANEL_MYPROFILES;Mé profily PROFILEPANEL_PASTEPPASTE;Parametry pro vložení PROFILEPANEL_PCUSTOM;Vlastní -PROFILEPANEL_PDYNAMIC;Dynamiký +PROFILEPANEL_PDYNAMIC;Dynamický PROFILEPANEL_PFILE;Ze souboru PROFILEPANEL_PINTERNAL;Neutrální PROFILEPANEL_PLASTSAVED;Poslední uschovaný @@ -1189,13 +1222,21 @@ PROGRESSBAR_SAVEPNG;Ukládání PNG souboru... PROGRESSBAR_SAVETIFF;Ukládání TIFF souboru... PROGRESSBAR_SNAPSHOT_ADDED;Snímek přidán PROGRESSDLG_PROFILECHANGEDINBROWSER;Profil upracování změněn v prohlížeči +QINFO_FRAMECOUNT;%2 snímků +QINFO_HDR;HDR / %2 snímků QINFO_ISO;ISO QINFO_NOEXIF;Exif údaje nejsou k dispozici. +QINFO_PIXELSHIFT;Pixel Shift / %2 snímků +SAMPLEFORMAT_0;Neznámý datový formát +SAMPLEFORMAT_1;Neznaménkový, 8 bitů +SAMPLEFORMAT_2;Neznaménkový, 16 bitů +SAMPLEFORMAT_4;LogLuv, 24 bitů +SAMPLEFORMAT_8;LogLuv, 32 bitů +SAMPLEFORMAT_16;S pohyblivou čárkou, 32 bitů SAVEDLG_AUTOSUFFIX;Automaticky přidat příponu pokud soubor již existuje SAVEDLG_FILEFORMAT;Formát souboru SAVEDLG_FORCEFORMATOPTS;Vynutit volby uložení SAVEDLG_JPEGQUAL;Kvalita JPEG -SAVEDLG_PNGCOMPR;PNG Komprese SAVEDLG_PUTTOQUEUE;Vložit soubor do fronty SAVEDLG_PUTTOQUEUEHEAD;Vložit na začátek fronty SAVEDLG_PUTTOQUEUETAIL;Vložit na konec fronty @@ -1209,8 +1250,8 @@ SAVEDLG_SUBSAMP_TOOLTIP;Nejlepší komprese:\nJ:a:b 4:2:0\nh/v 2/2\nO polovinu s SAVEDLG_TIFFUNCOMPRESSED;Nekomprimovaný TIFF SAVEDLG_WARNFILENAME;Soubor bude pojmenován SHCSELECTOR_TOOLTIP;Klikněte pravým tlačítkem myši pro obnovení výchozí pozice těchto tří posuvníků. -SOFTPROOF_GAMUTCHECK_TOOLTIP;Pokud je aktivní, budou pixely mimo barevnou paletu výstupního profilu označeny šedou barvou. -SOFTPROOF_TOOLTIP;Jemně korekční\nPokud je aktivní, umožní vám simulovat vykreslení dle výstupního profilu ICM. Nejužitečnější pro simulaci tiskového výstupu. +SOFTPROOF_GAMUTCHECK_TOOLTIP;Pokud je aktivní, budou pixely mimo barevnou paletu profilu tiskárnyoznačeny šedou barvou. +SOFTPROOF_TOOLTIP;Jemně korekční\nPokud je aktivní, umožní vám simulovat výstup tiskárny pomocí profilu tiskárny nastaveného v Volby > Správa barev. THRESHOLDSELECTOR_B;Dole THRESHOLDSELECTOR_BL;Dole vlevo THRESHOLDSELECTOR_BR;Dole vpravo @@ -1299,11 +1340,11 @@ TP_COARSETRAF_TOOLTIP_HFLIP;Překlopit horizontálně. TP_COARSETRAF_TOOLTIP_ROTLEFT;Otočit doleva.\n\nZkratky:\n[ - režim více karet editoru,\nAlt-[- režim jedné karty editoru. TP_COARSETRAF_TOOLTIP_ROTRIGHT;Otočit doprava.\n\nZkratky:\n] - režim více karet editoru,\nAlt-]- režim jedné karty editoru. TP_COARSETRAF_TOOLTIP_VFLIP;Překlopit vertikálně. -TP_COLORAPP_ADAPTSCENE;Svítivost scény -TP_COLORAPP_ADAPTSCENE_TOOLTIP;Absolutní jas scény prostředí(cd/m²).\n 1) Vypočítáno z Exifu:\nRychlost závěrky - citlivost - clona - expoziční korekce fotoaparátu.\n 2) Vypočítáno z hodnoty raw bílého bodu a expoziční kompenzace Rawtherapee. -TP_COLORAPP_ADAPTVIEWING;Svítivost prohlížení (cd/m²) +TP_COLORAPP_ADAPTSCENE;Absolutní jas scény +TP_COLORAPP_ADAPTSCENE_TOOLTIP;Absolutní jas scény prostředí (cd/m²).\n 1) Vypočítáno z Exifu:\nRychlost závěrky - citlivost - clona - expoziční korekce fotoaparátu.\n 2) Vypočítáno z hodnoty raw bílého bodu a expoziční kompenzace Rawtherapee. +TP_COLORAPP_ADAPTVIEWING;Absolutní jas prohlížení (cd/m²) TP_COLORAPP_ADAPTVIEWING_TOOLTIP;Absolutní jas prostředí prohlížení\n(obvykle 16cd/m²). -TP_COLORAPP_ADAP_AUTO_TOOLTIP;Pokud je povoleno (doporučeno), RT vypočítá optimální hodnotu z Exif dat.\nPokud si přejete zadat hodnotu ručně, nejprve zrušte zatržení tohoto pole. +TP_COLORAPP_ADAP_AUTO_TOOLTIP;Pokud je povoleno (doporučeno), RawTherapee vypočítá optimální hodnotu z Exif dat.\nPokud si přejete zadat hodnotu ručně, nejprve zrušte zatržení tohoto pole. TP_COLORAPP_ALGO;Algoritmus TP_COLORAPP_ALGO_ALL;Vše TP_COLORAPP_ALGO_JC;Světlost + Barevnost (JC) @@ -1323,8 +1364,8 @@ TP_COLORAPP_CHROMA_TOOLTIP;Barevnost se v CIECAM02 liší od barevnosti L*a*b* a TP_COLORAPP_CIECAT_DEGREE;CAT02 přizpůsobení TP_COLORAPP_CONTRAST;Kontrast (I) TP_COLORAPP_CONTRAST_Q;Kontrast (O) -TP_COLORAPP_CONTRAST_Q_TOOLTIP;Kontrast pro posuvník Q se v CIECAM02 liší od kontrastu L*a*b* a RGB. -TP_COLORAPP_CONTRAST_TOOLTIP;Kontrast pro posuvník J se v CIECAM02 liší od kontrastu L*a*b* a RGB. +TP_COLORAPP_CONTRAST_Q_TOOLTIP;Liší se od kontrastu L*a*b* a RGB. +TP_COLORAPP_CONTRAST_TOOLTIP;Liší se od kontrastu L*a*b* a RGB. TP_COLORAPP_CURVEEDITOR1;Tónová křivka 1 TP_COLORAPP_CURVEEDITOR1_TOOLTIP;Zobrazuje histogram L* (L*a*b*) křivky před CIECAM02.\nPokud je volba "Zobrazit CIECAM02 histogramy výstupu v křivkách" povolena, zobrazí histogram J nebo Q po CIECAM02 .\n\nJ a Q histogramy nejsou na hlavním panelu zobrazeny.\n\nHistogram konečného výsledku je zobrazen na hlavním panelu. TP_COLORAPP_CURVEEDITOR2;Tónová křivka 2 @@ -1335,6 +1376,7 @@ TP_COLORAPP_DATACIE;CIECAM02 histogramy výstupu v křivkách TP_COLORAPP_DATACIE_TOOLTIP;Pokud je povoleno, zobrazuje histogram v CIECAM02 křivkách přibližné hodnoty/rozsahy po CIECAM02 úpravách J nebo Q, a C, S nebo M.\nVýběr neovlivňuje histogram na hlavním panelu.\n\nPokud je zakázáno, zobrazuje histogram v CIECAM02 křivkách L*a*b* hodnoty před CIECAM02 úpravami. TP_COLORAPP_DEGREE_AUTO_TOOLTIP;Pokud je povoleno (doporučeno), RawTherapee vypočítá optimální hodnotu, jenž následně používá jak CAT02 tak i celý CIECAM02.\nZakažte, pokud si přejete zadat hodnotu ručně (doporučeny jsou hodnoty nad 65). TP_COLORAPP_DEGREE_TOOLTIP;Míra CIE Chromatic Adaptation Transform 2002. +TP_COLORAPP_FREE;Volná teplota + zelená + CAT02 + [výstup] TP_COLORAPP_GAMUT;Kontrola palety (L*a*b*) TP_COLORAPP_GAMUT_TOOLTIP;Povolí kontrolu palety v L*a*b* režimu. TP_COLORAPP_HUE;Odstín (h) @@ -1346,7 +1388,9 @@ TP_COLORAPP_LABEL_VIEWING;Podmínky zobrazení TP_COLORAPP_LIGHT;Světlost (I) TP_COLORAPP_LIGHT_TOOLTIP;Světlost v CIECAM02 se liší od světlosti v L*a*b* a RGB. TP_COLORAPP_MODEL;VB - Model -TP_COLORAPP_MODEL_TOOLTIP;Model bílého bodu.\n\nWB [RT] + [výstup]: Pro scénu je použito vyvážení bílé RT , CIECAM02 je nastaven na D50 a vyvážení bílé výstupního zařízení je nastaveno ve Volby > Správa barev.\n\nWB [RT+CAT02] + [výstup]: CAT02 používá RT nastavení vyvážení bílé a vyvážení bílé výstupního zařízení je nastaveno ve Volby > Správa barev. +TP_COLORAPP_MODEL_TOOLTIP;Model bílého bodu.\n\nWB [RT] + [výstup]: Pro scénu je použito vyvážení bílé RawTherapee , CIECAM02 je nastaven na D50 a vyvážení bílé výstupního zařízení je nastaveno v Podmínkách prohlížení.\n\nWB [RT+CAT02] + [výstup]: CAT02 používá RawTherapee nastavení vyvážení bílé a vyvážení bílé výstupního zařízení je nastaveno v Podmínkách prohlížení.\n\nVolná teplota+zelená + CAT02 + [výstup]: teplota a zelená je vybrána uživatelem, vyvážení bílé výstupního zařízení je nastaveno v Podmínkách prohlížení. +TP_COLORAPP_NEUTRAL;Obnovit +TP_COLORAPP_NEUTRAL_TIP;Obnoví původní hodnoty u všech posuvníků a křivek. TP_COLORAPP_RSTPRO;Ochrana červených a pleťových tónů TP_COLORAPP_RSTPRO_TOOLTIP;Ochrana červených a pleťových tónů ovlivňuje posuvníky i křivky. TP_COLORAPP_SHARPCIE;--nepoužito-- @@ -1367,10 +1411,14 @@ TP_COLORAPP_TCMODE_LABEL2;Mód křivky 2 TP_COLORAPP_TCMODE_LABEL3;Mód barevné křivky TP_COLORAPP_TCMODE_LIGHTNESS;Světlost TP_COLORAPP_TCMODE_SATUR;Nasycení +TP_COLORAPP_TEMP_TOOLTIP;Pro výběr osvětlení vždy nastavte Tint=1.\n\nA barva=2856\nD50 barva=5003\nD55 barva=5503\nD65 barva=6504\nD75 barva=7504 TP_COLORAPP_TONECIE;Mapování tónů pomocí CIECAM02 TP_COLORAPP_TONECIE_TOOLTIP;Pokud je volba zakázána, probíhá mapování tónů v prostoru L*a*b*.\nPokud je volba povolena. probíhá mapování tónů pomocí CIECAM02.\nAby měla tato volba efekt, musí být povolen nástroj Mapování tónů. TP_COLORAPP_WBCAM;WB [RT+CAT02] + [výstup] TP_COLORAPP_WBRT;WB [RT] + [výstup] +TP_COLORAPP_YB;Yb% (střední jas) +TP_COLORAPP_YBSCENE;Yb% (střední jas) +TP_COLORAPP_YBSCENE_TOOLTIP;Pokud je povolena automatika, Yb je vypočteno ze střední hodnoty jasu aktuálního obrázku TP_COLORTONING_AB;o C/L TP_COLORTONING_AUTOSAT;Automaticky TP_COLORTONING_BALANCE;Vyvážené @@ -1587,7 +1635,7 @@ TP_HSVEQUALIZER_LABEL;HSV korekce TP_HSVEQUALIZER_SAT;S TP_HSVEQUALIZER_VAL;V TP_ICM_APPLYBASELINEEXPOSUREOFFSET;Základní expozice -TP_ICM_APPLYBASELINEEXPOSUREOFFSET_TOOLTIP;Použije vložený DCP základní posun expozice. Toto nastavení je dostupné pouze ji pokud DCP obsahuje. +TP_ICM_APPLYBASELINEEXPOSUREOFFSET_TOOLTIP;Použije vložený DCP základní posun expozice. Toto nastavení je dostupné pouze pokud ji vybrané DCP obsahuje. TP_ICM_APPLYHUESATMAP;Základní tabulka TP_ICM_APPLYHUESATMAP_TOOLTIP;Použije vloženou DCP základní tabulku (HueSatMap). Toto nastavení je dostupné pouze pokud ji vybrané DCP obsahuje. TP_ICM_APPLYLOOKTABLE;Tabulka vzhledu @@ -1597,7 +1645,7 @@ TP_ICM_BLENDCMSMATRIX_TOOLTIP;Povolit obnovení vypálených jasů při použit TP_ICM_BPC;Kompenzace černého bodu TP_ICM_DCPILLUMINANT;Osvětlení TP_ICM_DCPILLUMINANT_INTERPOLATED;Interpolované -TP_ICM_DCPILLUMINANT_TOOLTIP;Vyberte které vložené DCP osvětlení se má použít. Ve výchozím stavu se použije "interpolované", což je mix mezi dvěma osvětleními založenými na vyvážení bílé. Nastavené je dostupné pouze v případě, že je povoleno dvojité DCP osvětlení s podporou interpolace. +TP_ICM_DCPILLUMINANT_TOOLTIP;Vyberte které vložené DCP osvětlení se má použít. Ve výchozím stavu se použije "interpolované", což je mix mezi dvěma osvětleními založenými na vyvážení bílé. Nastavené je povoleno pouze v případě, že je vybráno\t dvojité DCP osvětlení s podporou interpolace. TP_ICM_INPUTCAMERA;Standard fotoaparátu TP_ICM_INPUTCAMERAICC;Automatický dohledaný profil fotoaparátu TP_ICM_INPUTCAMERAICC_TOOLTIP;Použít RawTherapee specifický DCP nebo ICC vstupní barevný profil fotoaparátu jenž je mnohem přesnější než zjednodušená matice. Není dostupné pro všechny fotoaparáty. Profily jsou uloženy ve složkách /iccprofiles/input a /dcpprofiles a jsou automaticky vybrány dle jména souboru shodného s fotoaparátem. @@ -1619,7 +1667,7 @@ TP_ICM_SAVEREFERENCE_APPLYWB;Aplikovat vyvážení bílé TP_ICM_SAVEREFERENCE_APPLYWB_TOOLTIP;Obecně se vyvážení bílé aplikuje při ukládání obrázku pro vytvoření ICC profilů a neaplikuje při vytváření DCP profilů. TP_ICM_SAVEREFERENCE_TOOLTIP;Uloží lineární TIFF obrázek před aplikováním vstupního profilu. Výsledek může být použit pro kalibraci a generování profilu fotoaparátu. TP_ICM_TONECURVE;Tónová křivka -TP_ICM_TONECURVE_TOOLTIP;Použije vloženou DCP tónovou křivku. Nastavení je dostupné pouze v případě, že DCP obsahuje tónovou křivku. +TP_ICM_TONECURVE_TOOLTIP;Použije vloženou DCP tónovou křivku. Nastavení je dostupné pouze v případě, že vybrané DCP obsahuje tónovou křivku. TP_ICM_WORKINGPROFILE;Pracovní barevný prostor TP_IMPULSEDENOISE_LABEL;Redukce impulzního šumu TP_IMPULSEDENOISE_THRESH;Práh @@ -1663,7 +1711,7 @@ TP_LABCURVE_RSTPRO_TOOLTIP;Pracuje s posuvníkem barevnosti a CC křivkou. TP_LENSGEOM_AUTOCROP;Automatický ořez TP_LENSGEOM_FILL;Automatické vyplnění TP_LENSGEOM_LABEL;Objektiv / Geometrie -TP_LENSPROFILE_LABEL;Korekční profil objektivu +TP_LENSPROFILE_LABEL;Korekční profily objektivů TP_LENSPROFILE_USECA;Korekce chromatické aberace TP_LENSPROFILE_USEDIST;Korekce zkreslení TP_LENSPROFILE_USEVIGN;Korekce vinětace @@ -1779,6 +1827,7 @@ TP_RAW_PIXELSHIFTSMOOTH_TOOLTIP;Vyhlazení přechodů mezi oblastmi s pohybem a TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev faktor modrý TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev faktor zelený TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev faktor červený +TP_RAW_RCD;RCD TP_RAW_SENSOR_BAYER_LABEL;Snímač s Bayerovou maskou TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;Tří průchodová dává lepší výsledky (doporučeno pro fotky s nízkým ISO).\nJednoprůchodová je téměř k nerozeznání od tří průchodové pro vysoké ISO a je rychlejší. TP_RAW_SENSOR_XTRANS_LABEL;Senzory s X-Trans maticí @@ -1919,6 +1968,9 @@ TP_SHARPENMICRO_AMOUNT;Kvantita TP_SHARPENMICRO_LABEL;Mikrokontrast TP_SHARPENMICRO_MATRIX;Matice 3×3 namísto 5×5 TP_SHARPENMICRO_UNIFORMITY;Jednolitost +TP_TM_FATTAL_AMOUNT;Míra +TP_TM_FATTAL_LABEL;HDR Mapování tónů +TP_TM_FATTAL_THRESHOLD;Práh TP_VIBRANCE_AVOIDCOLORSHIFT;Zabránit posunu barev TP_VIBRANCE_CURVEEDITOR_SKINTONES;HH TP_VIBRANCE_CURVEEDITOR_SKINTONES_LABEL;Tóny pleti @@ -2112,7 +2164,7 @@ TP_WBALANCE_CLOUDY;Zataženo TP_WBALANCE_CUSTOM;Vlastní TP_WBALANCE_DAYLIGHT;Denní světlo (slunečno) TP_WBALANCE_EQBLUERED;Korekce modrá/červená -TP_WBALANCE_EQBLUERED_TOOLTIP;Umožňuje odchýlení se od normálního chování "vyvážení bílé" pomocí změny vyvážení modré a červené.\nToto může být užitečné v těchto případech:\na) podmínky jsou velmi odlišné od standardních (například pod vodou),\nb) podmínky se velmi liší od podmínek za kterých probíhala kalibrace,\nc) nevhodné snímače nebo ICC profily. +TP_WBALANCE_EQBLUERED_TOOLTIP;Umožňuje odchýlení se od normálního chování "vyvážení bílé" pomocí změny vyvážení modré a červené.\nToto může být užitečné v těchto případech:\na) podmínky jsou velmi odlišné od běžného osvětlení (například pod vodou),\nb) podmínky se velmi liší od podmínek za kterých probíhala kalibrace,\nc) nevhodné snímače nebo ICC profily. TP_WBALANCE_FLASH55;Leica TP_WBALANCE_FLASH60;Standard, Canon, Pentax, Olympus TP_WBALANCE_FLASH65;Nikon, Panasonic, Sony, Minolta @@ -2161,58 +2213,3 @@ ZOOMPANEL_ZOOMFITCROPSCREEN;Přizpůsobit obrazovce\nZkratka: Alt-ff ZOOMPANEL_ZOOMIN;Přiblížit\nZkratka: + ZOOMPANEL_ZOOMOUT;Oddálit\nZkratka: - - -!!!!!!!!!!!!!!!!!!!!!!!!! -! Untranslated keys follow; remove the ! prefix after an entry is translated. -!!!!!!!!!!!!!!!!!!!!!!!!! - -!DONT_SHOW_AGAIN;Don't show this message again. -!EXIFPANEL_SHOWALL;Show all -!GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. -!HISTORY_MSG_476;CAM02 - Temp out -!HISTORY_MSG_477;CAM02 - Green out -!HISTORY_MSG_478;CAM02 - Yb out -!HISTORY_MSG_479;CAM02 - CAT02 adaptation out -!HISTORY_MSG_480;CAM02 - Automatic CAT02 out -!HISTORY_MSG_481;CAM02 - Temp scene -!HISTORY_MSG_482;CAM02 - Green scene -!HISTORY_MSG_483;CAM02 - Yb scene -!HISTORY_MSG_484;CAM02 - Auto Yb scene -!HISTORY_MSG_485;Lens Correction -!HISTORY_MSG_486;Lens Correction - Camera -!HISTORY_MSG_487;Lens Correction - Lens -!HISTORY_MSG_488;HDR Tone Mapping -!HISTORY_MSG_489;HDR TM - Threshold -!HISTORY_MSG_490;HDR TM - Amount -!LENSPROFILE_CORRECTION_AUTOMATCH;Auto-matched correction parameters -!LENSPROFILE_CORRECTION_LCPFILE;LCP File -!LENSPROFILE_CORRECTION_MANUAL;Manual correction parameters -!LENSPROFILE_LENS_WARNING;Warning: the crop factor used for lens profiling is larger than the crop factor of the camera, the results might be wrong. -!MAIN_TOOLTIP_BACKCOLOR3;Background color of the preview: Middle grey\nShortcut: 9 -!PARTIALPASTE_TM_FATTAL;HDR Tone mapping -!PREFERENCES_AUTOSAVE_TP_OPEN;Automatically save tools collapsed/expanded\nstate before exiting -!PREFERENCES_D50_OLD;5000K -!PREFERENCES_DIRECTORIES;Directories -!PREFERENCES_GREY18_OLD;Yb=18 CIE L#50 -!PREFERENCES_LANG;Language -!PREFERENCES_SAVE_TP_OPEN_NOW;Save tools collapsed/expanded state now -!PREFERENCES_THEME;Theme -!QINFO_FRAMECOUNT;%2 frames -!QINFO_HDR;HDR / %2 frame(s) -!QINFO_PIXELSHIFT;Pixel Shift / %2 frame(s) -!SAMPLEFORMAT_0;Unknown data format -!SAMPLEFORMAT_1;Unsigned 8 bits -!SAMPLEFORMAT_2;Unsigned 16 bits -!SAMPLEFORMAT_4;LogLuv 24 bits -!SAMPLEFORMAT_8;LogLuv 32 bits -!SAMPLEFORMAT_16;32 bits floating point -!TP_COLORAPP_FREE;Free temp+green + CAT02 + [output] -!TP_COLORAPP_NEUTRAL;Reset -!TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 -!TP_COLORAPP_YB;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance -!TP_TM_FATTAL_AMOUNT;Amount -!TP_TM_FATTAL_LABEL;HDR Tone Mapping -!TP_TM_FATTAL_THRESHOLD;Threshold diff --git a/rtdata/languages/Dansk b/rtdata/languages/Dansk index 0b619b706..079d4d6d8 100644 --- a/rtdata/languages/Dansk +++ b/rtdata/languages/Dansk @@ -975,6 +975,8 @@ TP_WBALANCE_TEMPERATURE;Temperatur !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. @@ -1460,14 +1462,14 @@ TP_WBALANCE_TEMPERATURE;Temperatur !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1838,6 +1840,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Deutsch b/rtdata/languages/Deutsch index cda1faa42..f011096b8 100644 --- a/rtdata/languages/Deutsch +++ b/rtdata/languages/Deutsch @@ -45,6 +45,8 @@ #44 21.09.2017 Erweiterung (TooWaBoo) RT 5.2 #45 15.10.2017 Erweiterung (TooWaBoo) RT 5.3 #46 18.10.2017 Erweiterung (TooWaBoo) RT 5.3 +#47 19.11.2017 HDR-Dynamikkompression (TooWaBoo) RT 5.3 +#48 13.12.2017 Erweiterung (TooWaBoo) RT 5.3 ABOUT_TAB_BUILD;Version ABOUT_TAB_CREDITS;Danksagungen @@ -763,6 +765,9 @@ HISTORY_MSG_484;(CIECAM02) - Szene\nAuto Yb% HISTORY_MSG_485;(Objektivkorrektur)\nProfil HISTORY_MSG_486;(Objektivkorrektur)\nProfil - Kamera HISTORY_MSG_487;(Objektivkorrektur)\nProfil - Objektiv +HISTORY_MSG_488;(HDR-Dynamikkompression) +HISTORY_MSG_489;(HDR-Dynamikkompression)\nSchwelle +HISTORY_MSG_490;(HDR-Dynamikkompression)\nIntensität HISTORY_NEWSNAPSHOT;Hinzufügen HISTORY_NEWSNAPSHOT_TOOLTIP;Taste: Alt + s HISTORY_SNAPSHOT;Schnappschuss @@ -969,6 +974,7 @@ PARTIALPASTE_SHADOWSHIGHLIGHTS;Schatten/Lichter PARTIALPASTE_SHARPENEDGE;Kantenschärfung PARTIALPASTE_SHARPENING;Schärfung PARTIALPASTE_SHARPENMICRO;Mikrokontrast +PARTIALPASTE_TM_FATTAL;HDR-Dynamikkompression PARTIALPASTE_VIBRANCE;Dynamik PARTIALPASTE_VIGNETTING;Vignettierungskorrektur PARTIALPASTE_WAVELETGROUP;Wavelet @@ -1969,6 +1975,9 @@ TP_SHARPENMICRO_AMOUNT;Intensität TP_SHARPENMICRO_LABEL;Mikrokontrast TP_SHARPENMICRO_MATRIX;3×3-Matrix statt 5×5-Matrix TP_SHARPENMICRO_UNIFORMITY;Gleichmäßigkeit +TP_TM_FATTAL_AMOUNT;Intensität +TP_TM_FATTAL_LABEL;HDR-Dynamikkompression +TP_TM_FATTAL_THRESHOLD;Schwelle TP_VIBRANCE_AVOIDCOLORSHIFT;Farbverschiebungen vermeiden TP_VIBRANCE_CURVEEDITOR_SKINTONES;HH TP_VIBRANCE_CURVEEDITOR_SKINTONES_LABEL;Hautfarbtöne @@ -2216,10 +2225,6 @@ ZOOMPANEL_ZOOMOUT;Herauszoomen\nTaste: - ! Untranslated keys follow; remove the ! prefix after an entry is translated. !!!!!!!!!!!!!!!!!!!!!!!!! -!HISTORY_MSG_488;HDR Tone Mapping -!HISTORY_MSG_489;HDR TM - Threshold -!HISTORY_MSG_490;HDR TM - Amount -!PARTIALPASTE_TM_FATTAL;HDR Tone mapping -!TP_TM_FATTAL_AMOUNT;Amount -!TP_TM_FATTAL_LABEL;HDR Tone Mapping -!TP_TM_FATTAL_THRESHOLD;Threshold +HISTORY_MSG_491;(Weißabgleich) +HISTORY_MSG_492;(RGB-Kurven) +TP_RAW_RCD;RCD diff --git a/rtdata/languages/English (UK) b/rtdata/languages/English (UK) index e4bbcacd8..ac956b114 100644 --- a/rtdata/languages/English (UK) +++ b/rtdata/languages/English (UK) @@ -805,6 +805,8 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT;Add !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !HISTORY_SNAPSHOT;Snapshot @@ -1414,14 +1416,14 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1799,6 +1801,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/English (US) b/rtdata/languages/English (US) index 31093bc2b..f251950ee 100644 --- a/rtdata/languages/English (US) +++ b/rtdata/languages/English (US) @@ -723,6 +723,8 @@ !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT;Add !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !HISTORY_SNAPSHOT;Snapshot @@ -1373,14 +1375,14 @@ !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1789,6 +1791,7 @@ !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Espanol b/rtdata/languages/Espanol index ec6dcfb37..f27d211db 100644 --- a/rtdata/languages/Espanol +++ b/rtdata/languages/Espanol @@ -1711,6 +1711,8 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. !IPTCPANEL_COPYRIGHT;Copyright notice @@ -1864,10 +1866,10 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !TP_COLORAPP_FREE;Free temp+green + CAT02 + [output] !TP_COLORAPP_NEUTRAL;Reset !TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_CROP_GTHARMMEANS;Harmonic Means !TP_CROP_GTTRIANGLE1;Golden Triangles 1 !TP_CROP_GTTRIANGLE2;Golden Triangles 2 @@ -1990,6 +1992,7 @@ ZOOMPANEL_ZOOMOUT;Reducir Zoom\nAtajo: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* diff --git a/rtdata/languages/Euskara b/rtdata/languages/Euskara index 8718554f5..57cdc631a 100644 --- a/rtdata/languages/Euskara +++ b/rtdata/languages/Euskara @@ -975,6 +975,8 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. @@ -1460,14 +1462,14 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1838,6 +1840,7 @@ TP_WBALANCE_TEMPERATURE;Tenperatura !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index f67b6bf3f..293ddd6be 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -34,6 +34,7 @@ CURVEEDITOR_TOOLTIPPASTE;Colle la courbe du presse-papier CURVEEDITOR_TOOLTIPSAVE;Enregistrer la courbe actuelle CURVEEDITOR_TYPE;Type: DIRBROWSER_FOLDERS;Répertoires +DONT_SHOW_AGAIN;Ne plus montrer ce message. DYNPROFILEEDITOR_DELETE;Supprimer DYNPROFILEEDITOR_EDIT;Modifier DYNPROFILEEDITOR_EDIT_RULE;Modifier une règle de Profil Dynamique @@ -233,6 +234,7 @@ GENERAL_PORTRAIT;Portrait GENERAL_SAVE;Enregistrer GENERAL_UNCHANGED;(Inchangé) GENERAL_WARNING;Attention +GIMP_PLUGIN_INFO;Bienvenue dans le plugin RawTherapee de GIMP!\nUne fois l'édition terminée, fermez simplement la fenêtre principale de RawTherapee et l'image sera importée automatiquement dans GIMP. HISTOGRAM_TOOLTIP_B;Montrer/cacher l'histogramme BLEU HISTOGRAM_TOOLTIP_BAR;Montrer/Cacher l'indicateur RVB du pixel pointé\nCliquer le bouton droit de la souris sur l'image de prévisualisation pour geler/dégeler HISTOGRAM_TOOLTIP_CHRO;Montrer/Cacher l'histogramme de Chromaticité @@ -703,6 +705,18 @@ HISTORY_MSG_472;PS - Adoucir les transitions HISTORY_MSG_473;PS - Utiliser LMMSE HISTORY_MSG_474;PS - Égaliser HISTORY_MSG_475;PS - Égaliser par canal +HISTORY_MSG_476;CAM02 - Temp sortie +HISTORY_MSG_477;CAM02 - Vert sortie +HISTORY_MSG_478;CAM02 - Yb sortie +HISTORY_MSG_479;CAM02 - adaptation CAT02 sortie +HISTORY_MSG_480;CAM02 - CAT02 auto sortie +HISTORY_MSG_481;CAM02 - Temp scène +HISTORY_MSG_482;CAM02 - Green scène +HISTORY_MSG_483;CAM02 - Yb scène +HISTORY_MSG_484;CAM02 - Yb auto scène +HISTORY_MSG_485;Correction d'Objectif +HISTORY_MSG_486;Corr. d'Obj. - Appareil +HISTORY_MSG_487;Corr. d'Obj. - Objectif HISTORY_MSG_488;Compression tonale HDR HISTORY_MSG_489;CT HDR - Seuil HISTORY_MSG_490;CT HDR - Quantité @@ -752,6 +766,10 @@ IPTCPANEL_TITLE;Titre IPTCPANEL_TITLEHINT;Enterez un nom court et humainement lisible pour l'image, cela peut être le nom du fichier. IPTCPANEL_TRANSREFERENCE;ID du travail IPTCPANEL_TRANSREFERENCEHINT;Enterez un nombre ou identifiant servant au contrôle du flux de travail ou au suivi. +LENSPROFILE_CORRECTION_AUTOMATCH;Paramètres de correction trouvés automatiquement +LENSPROFILE_CORRECTION_LCPFILE;Fichier LCP +LENSPROFILE_CORRECTION_MANUAL;Paramètres de correction manuel +LENSPROFILE_LENS_WARNING;Attention: la taille du capteur utilisé pour le profilage de l'objectif est plus grand que celui de l'appareil sélectionné, le résultat peut être faux. MAIN_BUTTON_FULLSCREEN;Plein écran MAIN_BUTTON_NAVNEXT_TOOLTIP;Navigue à l'image Suivante relativement à l'image ouverte dans l'Éditeur\nRaccourci: Shift-F4\n\nPour naviguer à l'image Suivante relativement à la vignette sélectionnée dans le Navigateur de fichiers\nRaccourci: F4 MAIN_BUTTON_NAVPREV_TOOLTIP;Navigue à l'image Précédente relativement à l'image ouverte dans l'Éditeur\nRaccourci: Shift-F3\n\nPour naviguer à l'image Précédente relativement à la vignette sélectionnée dans le Navigateur de fichiers\nRaccourci: F3 @@ -810,6 +828,7 @@ MAIN_TAB_WAVELET_TOOLTIP;Raccourci: Alt-w MAIN_TOOLTIP_BACKCOLOR0;Couleur de fond de l'aperçu: Selon le thème\nRaccourci : 9 MAIN_TOOLTIP_BACKCOLOR1;Couleur de fond de l'aperçu: Noir\nRaccourci : 9 MAIN_TOOLTIP_BACKCOLOR2;Couleur de fond de l'aperçu: Blanc\nRaccourci: 9 +MAIN_TOOLTIP_BACKCOLOR3;Couleur de fond de l'aperçu: Gris moyen\nRaccourci : 9 MAIN_TOOLTIP_BEFOREAFTERLOCK;Vérouille / déverouille la vue Avant\n\nVérouille: garde la vue Avant inchangée - \nutile pour évaluer l'effet cumulatif de plusieurs outils.\nDe plus, une comparaison peut être faite à partir de n'importe quelle étape de l'historique\n\nDéverouille: la vue Avant représentera l'étape précédant la vue Après, montrant l'effet qui vient d'être modifié MAIN_TOOLTIP_HIDEHP;Montrer/cacher le panneau gauche (incluant l'historique)\nRaccourci: l MAIN_TOOLTIP_INDCLIPPEDH;Indication hautes lumières hors domaine\nRaccourci: < @@ -907,7 +926,7 @@ PARTIALPASTE_SHADOWSHIGHLIGHTS;Ombres/Hautes lumières PARTIALPASTE_SHARPENEDGE;Bords PARTIALPASTE_SHARPENING;Netteté PARTIALPASTE_SHARPENMICRO;Microcontraste -PARTIALPASTE_TM_FATTAL;Compression tonale HDR (Fattal02) +PARTIALPASTE_TM_FATTAL;Compression tonale HDR PARTIALPASTE_VIBRANCE;Vibrance PARTIALPASTE_VIGNETTING;Correction du vignettage PARTIALPASTE_WAVELETGROUP;Niveaux d'ondelette @@ -920,6 +939,7 @@ PREFERENCES_AUTLISSTD;Haut PREFERENCES_AUTLISVLOW;Aucun PREFERENCES_AUTLOW;Bas PREFERENCES_AUTOMONPROFILE;Utiliser automatiquement le profil de l'écran principal +PREFERENCES_AUTOSAVE_TP_OPEN;Sauver automatiquement l'état ouvert/fermé\n des outils avant de fermer PREFERENCES_AUTSTD;Standard PREFERENCES_BATCH_PROCESSING;Traitement par lot PREFERENCES_BEHADDALL;Tout à 'Ajoute' @@ -956,6 +976,7 @@ PREFERENCES_CUSTPROFBUILDKEYFORMAT_TID;TagID PREFERENCES_CUSTPROFBUILDPATH;Chemin de l'exécutable PREFERENCES_CUTOVERLAYBRUSH;Masque de recadrage PREFERENCES_D50;5000K +PREFERENCES_D50_OLD;5000K PREFERENCES_D55;5500K PREFERENCES_D60;6000K PREFERENCES_D65;6500K @@ -997,6 +1018,7 @@ PREFERENCES_GREY05;Yb=05 CIE L#30 PREFERENCES_GREY10;Yb=10 CIE L#40 PREFERENCES_GREY15;Yb=15 CIE L#45 PREFERENCES_GREY18;Yb=18 CIE L#50 +PREFERENCES_GREY18_OLD;Yb=18 CIE L#50 PREFERENCES_GREY23;Yb=23 CIE L#55 PREFERENCES_GREY30;Yb=30 CIE L#60 PREFERENCES_GREY40;Yb=40 CIE L#70 @@ -1018,6 +1040,7 @@ PREFERENCES_INTENT_PERCEPTUAL;Perceptuel PREFERENCES_INTENT_RELATIVE;Colorimétrie relative PREFERENCES_INTENT_SATURATION;Saturation PREFERENCES_INTERNALTHUMBIFUNTOUCHED;Afficher vignette incluse dans fichier RAW si non édité +PREFERENCES_LANG;Langage PREFERENCES_LANGAUTODETECT;Utiliser les paramètres linguistiques de l'OS PREFERENCES_LEVAUTDN;Niveau de débruitage PREFERENCES_LEVDN;Taille de la cellule @@ -1046,7 +1069,7 @@ PREFERENCES_OUTDIR;Dossier de sortie PREFERENCES_OUTDIRFOLDER;Dossier de sauvegarde PREFERENCES_OUTDIRFOLDERHINT;Place les images traitées dans le dossier selectionné PREFERENCES_OUTDIRTEMPLATE;Utiliser le modèle -PREFERENCES_OUTDIRTEMPLATEHINT;Vous pouvez utiliser les paramètres de chaîne formatées suivants:\n%f, %d1, %d2, ..., %p1, %p2, ..., %r, %s1, %s2, ...\n\nCes chaînes de formattage se réfèrent aux différentes parties du chemin de la photo, certains de ses attributs ou un numéro de séquence arbitraire dans le traitement par lot.\n\nPar exemple, si la photo en cours de traitement a le chemin suivant:\n/home/tom/image/02-09-2006/dsc0012.nef\nla signification des chaînes de formattage est:\n%d4 = home\n%d3 = tom\n%d2 = photos\n%d1 = 2010-10-31\n%f = dsc0042\n%p1 = /home/tom/photos/2010-10-31/\n%p2 = /home/tom/photos/\n%p3 = /home/tom/\n%p4 = /home/\n\n%r sera remplacé par le rang de la photo. Si la photo n'a pas de rang, %r sera remplacé par '0'. Si la photo est dans la corbeille de RawTherapee, %r sera remplacé par 'x'.\n\n%s1, %s2, etc. sera remplacé par un index de séquence constitué de 1 à 9 chiffre. L'index de la séquence commencera à 1 à chaque fois que le file de traitement est démarrée, et est incrémenté de 1 pour chaque image traitée.\n\nSi vous voulez enregistrer l'image de sortie là où se trouve l'originale, écrivez:\n%p1/%f\n\nSi vous voulez enregistrer l'image de sortie dans un dossier nommé "convertis" situé dans le dossier de l'originale, écrivez:\n%p1/convertis/%f\n\nSi vous voulez enregistrer l'image de sortie dans un dossier nommé "/home/tom/photos/convertis/2010-10-31", écrivez:\n%p2/convertis/%d1/%f +PREFERENCES_OUTDIRTEMPLATEHINT;Vous pouvez utiliser les paramètres de chaîne formatées suivants:\n%f, %d1, %d2, ..., %p1, %p2, ..., %r, %s1, %s2, ...\n\nCes chaînes de formattage se réfèrent aux différentes parties du chemin de la photo, certains de ses attributs ou un numéro de séquence arbitraire dans le traitement par lot.\n\nPar exemple, si la photo en cours de traitement a le chemin suivant:\n/home/tom/photos/2010-10-31/dsc0042.nef\nla signification des chaînes de formattage est:\n%d4 = home\n%d3 = tom\n%d2 = photos\n%d1 = 2010-10-31\n%f = dsc0042\n%p1 = /home/tom/photos/2010-10-31/\n%p2 = /home/tom/photos/\n%p3 = /home/tom/\n%p4 = /home/\n\n%r sera remplacé par le rang de la photo. Si la photo n'a pas de rang, %r sera remplacé par '0'. Si la photo est dans la corbeille de RawTherapee, %r sera remplacé par 'x'.\n\n%s1, %s2, etc. sera remplacé par un index de séquence constitué de 1 à 9 chiffres. L'index de la séquence commencera à 1 à chaque fois que le file de traitement est démarrée, et est incrémenté de 1 pour chaque image traitée.\n\nSi vous voulez enregistrer l'image de sortie là où se trouve l'originale, écrivez:\n%p1/%f\n\nSi vous voulez enregistrer l'image de sortie dans un dossier nommé "convertis" situé dans le dossier de l'originale, écrivez:\n%p1/convertis/%f\n\nSi vous voulez enregistrer l'image de sortie dans un dossier nommé "/home/tom/photos/convertis/2010-10-31", écrivez:\n%p2/convertis/%d1/%f PREFERENCES_OVERLAY_FILENAMES;Superposer les noms de fichier sur les vignettes dans le navigateur de fichier PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP;Superposer les noms de fichier sur les vignettes dans le panneau d'édition PREFERENCES_OVERWRITEOUTPUTFILE;Écraser le fichier s'il existe déjà @@ -1079,6 +1102,7 @@ PREFERENCES_REMEMBERZOOMPAN;Se souvenir de niveau de zoom et de la position de l PREFERENCES_REMEMBERZOOMPAN_TOOLTIP;Retient le niveau de zoom et la position de l'image courante lors de l'ouverture d'une nouvelle image.\n\nCette option ne fonctionne que dans le mode "Éditeur unique" et quand "Méthode de dématriçage utilisé pour l'aperçu à un zoom <100%" is set to "Idem PP3". PREFERENCES_RGBDTL_LABEL;Nombre maximum d'unités de calcul pour la Réduction du bruit PREFERENCES_RGBDTL_TOOLTIP;La réduction du bruit nécessite un minimum d'à peu près 128Mo de RAM pour une image de 10MPix ou 512Mo pour une image de 40MPix, ainsi que 128Mo de RAM supplémentaire par unité de calcul. Plus il y aura d'unités de calcul travaillant en parallèle, plus ce sera rapide. Laissez la valeur à "0" pour utiliser automatiquement autant d'unités de calcul que possible. +PREFERENCES_SAVE_TP_OPEN_NOW;Sauver l'état ouvert/fermé maintenant PREFERENCES_SELECTFONT;Police principale PREFERENCES_SELECTFONT_COLPICKER;Police des pipette à couleur PREFERENCES_SELECTLANG;Choix de la langue @@ -1109,6 +1133,7 @@ PREFERENCES_TAB_GENERAL;Général PREFERENCES_TAB_IMPROC;Traitement de l'image PREFERENCES_TAB_PERFORMANCE;Performance PREFERENCES_TAB_SOUND;Sons +PREFERENCES_THEME;Thème PREFERENCES_TIMAX;Haut PREFERENCES_TINB;Nombre de tuiles PREFERENCES_TISTD;Standard @@ -1311,6 +1336,7 @@ TP_COLORAPP_DATACIE;Histogrammes post CIECAM dans les courbes TP_COLORAPP_DATACIE_TOOLTIP;Quand activé, les histogrammes de fond des courbes CIECAM02 montrent des valeurs/amplitudes approximatives de J/Q, ou de C:s/M après les ajustements CIECAM.\nCette sélection n'a pas d'incidence sur l'histogramme général.\n\nQuand désactivé, les histogrammes de fond des courbes CIECAM affichent les valeurs Lab avant les ajustements CIECAM TP_COLORAPP_DEGREE_AUTO_TOOLTIP;Si la case est cochée (recommandé), RT calcule une valeur optimale, qui est utilisée par CAT02, mais aussi pour l'ensemble de CIECAM02.\nVous pouvez décocher la case et changer la valeur du curseur; (les valeurs supérieures à 65 sont recommandées) TP_COLORAPP_DEGREE_TOOLTIP;Niveau d'adaptation chromatique CIE CAT 2002 +TP_COLORAPP_FREE;Temp libre+vert + CAT02 + [sortie] TP_COLORAPP_GAMUT;Contrôle du gamut (Lab) TP_COLORAPP_GAMUT_TOOLTIP;Permet le controle du gamut en mode Lab TP_COLORAPP_HUE;Teinte (h) @@ -1323,6 +1349,8 @@ TP_COLORAPP_LIGHT;Luminosité (J) TP_COLORAPP_LIGHT_TOOLTIP;Luminosité dans CIECAM02 est différent de celui de Lab et RVB TP_COLORAPP_MODEL;Modèle de Point Blanc TP_COLORAPP_MODEL_TOOLTIP;Modèle de Point Blanc\n\nBB [RT] + [sortie]:\nLa BB de RT est utilisée pour la scène, CIECAM est réglé sur D50, le blanc du périphérique de sortie utilise la valeur réglée dans Préférences\n\nBB [RT+CAT02] + [sortie]:\nLes réglages de BB de RT sont utilisés par CAT02 et le blanc du périphérique de sortie utilise la valeur réglée dans Préférences +TP_COLORAPP_NEUTRAL;Résinitialiser +TP_COLORAPP_NEUTRAL_TIP;Réinitialiser tous les curseurs, cases à cocher et courbes à leurs valeur par défaut TP_COLORAPP_RSTPRO;Protection des tons chairs et rouges TP_COLORAPP_RSTPRO_TOOLTIP;Protection des tons chairs et rouges (curseurs et courbes) TP_COLORAPP_SHARPCIE;Netteté, Contraste par niveau de détails, Microcontraste & Aberration chromatique avec Q/C @@ -1343,10 +1371,14 @@ TP_COLORAPP_TCMODE_LABEL2;Courbe mode 2 TP_COLORAPP_TCMODE_LABEL3;Courbe chroma mode TP_COLORAPP_TCMODE_LIGHTNESS;Luminosité TP_COLORAPP_TCMODE_SATUR;Saturation +TP_COLORAPP_TEMP_TOOLTIP;Pour sélectionner un illuminant, toujours régler Teinte=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 TP_COLORAPP_TONECIE;Compression Tonale utilisant CIECAM02 TP_COLORAPP_TONECIE_TOOLTIP;Si cette option est désactivée, la compression tonale est faite dans l'espace Lab.\nSi cette options est activée, la compression tonale est faite en utilisant CIECAM02.\nL'outil Compression Tonale doit être activé pour que ce réglage prenne effet TP_COLORAPP_WBCAM;BB [RT+CAT02] + [sortie] TP_COLORAPP_WBRT;BB [RT] + [sortie] +TP_COLORAPP_YB;Yb% (luminance moyenne) +TP_COLORAPP_YBSCENE;Yb% (luminance moyenne) +TP_COLORAPP_YBSCENE_TOOLTIP;si auto activé, Yb est calculé suivant la valeur de luminance moyenne de l'image actuelle TP_COLORTONING_AB;o C/L TP_COLORTONING_AUTOSAT;Automatique TP_COLORTONING_BALANCE;Balance @@ -1897,7 +1929,7 @@ TP_SHARPENMICRO_LABEL;Microcontraste TP_SHARPENMICRO_MATRIX;Matrice 3×3 au lieu de 5×5 TP_SHARPENMICRO_UNIFORMITY;Uniformité TP_TM_FATTAL_AMOUNT;Quantité -TP_TM_FATTAL_LABEL;Compression Tonale HDR (Fattal02) +TP_TM_FATTAL_LABEL;Compression Tonale HDR TP_TM_FATTAL_THRESHOLD;Seuil TP_VIBRANCE_AVOIDCOLORSHIFT;Éviter les dérives de teinte TP_VIBRANCE_CURVEEDITOR_SKINTONES;TT @@ -2146,35 +2178,6 @@ ZOOMPANEL_ZOOMOUT;Zoom Arrière\nRaccourci: - ! Untranslated keys follow; remove the ! prefix after an entry is translated. !!!!!!!!!!!!!!!!!!!!!!!!! -!DONT_SHOW_AGAIN;Don't show this message again. -!GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. -!HISTORY_MSG_476;CAM02 - Temp out -!HISTORY_MSG_477;CAM02 - Green out -!HISTORY_MSG_478;CAM02 - Yb out -!HISTORY_MSG_479;CAM02 - CAT02 adaptation out -!HISTORY_MSG_480;CAM02 - Automatic CAT02 out -!HISTORY_MSG_481;CAM02 - Temp scene -!HISTORY_MSG_482;CAM02 - Green scene -!HISTORY_MSG_483;CAM02 - Yb scene -!HISTORY_MSG_484;CAM02 - Auto Yb scene -!HISTORY_MSG_485;Lens Correction -!HISTORY_MSG_486;Lens Correction - Camera -!HISTORY_MSG_487;Lens Correction - Lens -!LENSPROFILE_CORRECTION_AUTOMATCH;Auto-matched correction parameters -!LENSPROFILE_CORRECTION_LCPFILE;LCP File -!LENSPROFILE_CORRECTION_MANUAL;Manual correction parameters -!LENSPROFILE_LENS_WARNING;Warning: the crop factor used for lens profiling is larger than the crop factor of the camera, the results might be wrong. -!MAIN_TOOLTIP_BACKCOLOR3;Background color of the preview: Middle grey\nShortcut: 9 -!PREFERENCES_AUTOSAVE_TP_OPEN;Automatically save tools collapsed/expanded\nstate before exiting -!PREFERENCES_D50_OLD;5000K -!PREFERENCES_GREY18_OLD;Yb=18 CIE L#50 -!PREFERENCES_LANG;Language -!PREFERENCES_SAVE_TP_OPEN_NOW;Save tools collapsed/expanded state now -!PREFERENCES_THEME;Theme -!TP_COLORAPP_FREE;Free temp+green + CAT02 + [output] -!TP_COLORAPP_NEUTRAL;Reset -!TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 -!TP_COLORAPP_YB;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves +!TP_RAW_RCD;RCD diff --git a/rtdata/languages/Greek b/rtdata/languages/Greek index 4ffc14338..57cd9d0b3 100644 --- a/rtdata/languages/Greek +++ b/rtdata/languages/Greek @@ -974,6 +974,8 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. @@ -1459,14 +1461,14 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1837,6 +1839,7 @@ TP_WBALANCE_TEMPERATURE;Θερμοκρασία !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Hebrew b/rtdata/languages/Hebrew index ef8717fa3..ed89ba392 100644 --- a/rtdata/languages/Hebrew +++ b/rtdata/languages/Hebrew @@ -975,6 +975,8 @@ TP_WBALANCE_TEMPERATURE;מידת חום !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. @@ -1460,14 +1462,14 @@ TP_WBALANCE_TEMPERATURE;מידת חום !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1838,6 +1840,7 @@ TP_WBALANCE_TEMPERATURE;מידת חום !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Italiano b/rtdata/languages/Italiano index 034d16928..f532f3270 100644 --- a/rtdata/languages/Italiano +++ b/rtdata/languages/Italiano @@ -1585,6 +1585,8 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. !IPTCPANEL_COPYRIGHT;Copyright notice @@ -1735,10 +1737,10 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !TP_COLORAPP_FREE;Free temp+green + CAT02 + [output] !TP_COLORAPP_NEUTRAL;Reset !TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1928,6 +1930,7 @@ ZOOMPANEL_ZOOMOUT;Rimpicciolisci.\nScorciatoia: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Japanese b/rtdata/languages/Japanese index ae9ff5b7f..33b81ce8f 100644 --- a/rtdata/languages/Japanese +++ b/rtdata/languages/Japanese @@ -1962,6 +1962,8 @@ ZOOMPANEL_ZOOMOUT;ズームアウト\nショートカット: - !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. !IPTCPANEL_COPYRIGHT;Copyright notice @@ -2045,10 +2047,10 @@ ZOOMPANEL_ZOOMOUT;ズームアウト\nショートカット: - !TP_COLORAPP_FREE;Free temp+green + CAT02 + [output] !TP_COLORAPP_NEUTRAL;Reset !TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_DIRPYRDENOISE_3X3;3×3 !TP_DIRPYRDENOISE_3X3_SOFT;3×3 soft !TP_DIRPYRDENOISE_5X5;5×5 @@ -2124,6 +2126,7 @@ ZOOMPANEL_ZOOMOUT;ズームアウト\nショートカット: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* diff --git a/rtdata/languages/Latvian b/rtdata/languages/Latvian index 56e1fabb7..cbfa1d6ae 100644 --- a/rtdata/languages/Latvian +++ b/rtdata/languages/Latvian @@ -975,6 +975,8 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. @@ -1460,14 +1462,14 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1838,6 +1840,7 @@ TP_WBALANCE_TEMPERATURE;Temperatūra !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Magyar b/rtdata/languages/Magyar index abddd957a..da38b0c4c 100644 --- a/rtdata/languages/Magyar +++ b/rtdata/languages/Magyar @@ -1248,6 +1248,8 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. @@ -1612,14 +1614,14 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1908,6 +1910,7 @@ ZOOMPANEL_ZOOMOUT;Kicsinyítés - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Nederlands b/rtdata/languages/Nederlands index 0ea147eb8..6aaa8ce28 100644 --- a/rtdata/languages/Nederlands +++ b/rtdata/languages/Nederlands @@ -2156,6 +2156,8 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !LENSPROFILE_CORRECTION_AUTOMATCH;Auto-matched correction parameters !LENSPROFILE_CORRECTION_LCPFILE;LCP File !LENSPROFILE_CORRECTION_MANUAL;Manual correction parameters @@ -2184,13 +2186,14 @@ ZOOMPANEL_ZOOMOUT;Zoom uit\nSneltoets: - !TP_COLORAPP_FREE;Free temp+green + CAT02 + [output] !TP_COLORAPP_NEUTRAL;Reset !TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_RAW_IMAGENUM_TOOLTIP;Some raw files consist of several sub-images (Pentax Pixel Shift, Pentax 3-in-1 HDR, Canon Dual Pixel).\n\nWhen using any demosaicing method other than Pixel Shift, this selects which sub-image is used.\n\nWhen using the Pixel Shift demosaicing method on a Pixel Shift raw, all sub-images are used, and this selects which sub-image should be used for moving parts. !TP_RAW_PIXELSHIFTEQUALBRIGHTCHANNEL;Equalize per channel !TP_RAW_PIXELSHIFTEQUALBRIGHTCHANNEL_TOOLTIP;Enabled: Equalize the RGB channels individually.\nDisabled: Use same equalization factor for all channels. +!TP_RAW_RCD;RCD !TP_RETINEX_GAINOFFS;Gain and Offset (brightness) !TP_RETINEX_GAINTRANSMISSION;Gain transmission !TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce transmission map to achieve luminance.\nAbscissa: transmission -min from 0, mean, and values (max).\nOrdinate: gain. diff --git a/rtdata/languages/Norsk BM b/rtdata/languages/Norsk BM index 7e68880b8..6a483966c 100644 --- a/rtdata/languages/Norsk BM +++ b/rtdata/languages/Norsk BM @@ -974,6 +974,8 @@ TP_WBALANCE_TEMPERATURE;Temperatur !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. @@ -1459,14 +1461,14 @@ TP_WBALANCE_TEMPERATURE;Temperatur !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1837,6 +1839,7 @@ TP_WBALANCE_TEMPERATURE;Temperatur !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Polish b/rtdata/languages/Polish index 3c54cc184..7af8c1404 100644 --- a/rtdata/languages/Polish +++ b/rtdata/languages/Polish @@ -1668,6 +1668,8 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. !IPTCPANEL_COPYRIGHT;Copyright notice @@ -1812,10 +1814,10 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !TP_COLORAPP_FREE;Free temp+green + CAT02 + [output] !TP_COLORAPP_NEUTRAL;Reset !TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_CROP_GTHARMMEANS;Harmonic Means !TP_CROP_GTTRIANGLE1;Golden Triangles 1 !TP_CROP_GTTRIANGLE2;Golden Triangles 2 @@ -1937,6 +1939,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrót: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* diff --git a/rtdata/languages/Polish (Latin Characters) b/rtdata/languages/Polish (Latin Characters) index 85b9e3f0b..4064a96a2 100644 --- a/rtdata/languages/Polish (Latin Characters) +++ b/rtdata/languages/Polish (Latin Characters) @@ -1668,6 +1668,8 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. !IPTCPANEL_COPYRIGHT;Copyright notice @@ -1812,10 +1814,10 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !TP_COLORAPP_FREE;Free temp+green + CAT02 + [output] !TP_COLORAPP_NEUTRAL;Reset !TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_CROP_GTHARMMEANS;Harmonic Means !TP_CROP_GTTRIANGLE1;Golden Triangles 1 !TP_CROP_GTTRIANGLE2;Golden Triangles 2 @@ -1937,6 +1939,7 @@ ZOOMPANEL_ZOOMOUT;Oddal\nSkrot: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_HSL;Histogram equalizer HSL !TP_RETINEX_CONTEDIT_LAB;Histogram equalizer L*a*b* diff --git a/rtdata/languages/Portugues (Brasil) b/rtdata/languages/Portugues (Brasil) index 661f24483..894e5405e 100644 --- a/rtdata/languages/Portugues (Brasil) +++ b/rtdata/languages/Portugues (Brasil) @@ -975,6 +975,8 @@ TP_WBALANCE_TEMPERATURE;Temperatura !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. @@ -1460,14 +1462,14 @@ TP_WBALANCE_TEMPERATURE;Temperatura !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1838,6 +1840,7 @@ TP_WBALANCE_TEMPERATURE;Temperatura !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Russian b/rtdata/languages/Russian index a67674975..150ca91e3 100644 --- a/rtdata/languages/Russian +++ b/rtdata/languages/Russian @@ -1528,6 +1528,8 @@ ZOOMPANEL_ZOOMOUT;Удалить - !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. !IPTCPANEL_COPYRIGHT;Copyright notice @@ -1725,14 +1727,14 @@ ZOOMPANEL_ZOOMOUT;Удалить - !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1930,6 +1932,7 @@ ZOOMPANEL_ZOOMOUT;Удалить - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Serbian (Cyrilic Characters) b/rtdata/languages/Serbian (Cyrilic Characters) index b6f614cce..bdc693b54 100644 --- a/rtdata/languages/Serbian (Cyrilic Characters) +++ b/rtdata/languages/Serbian (Cyrilic Characters) @@ -1561,6 +1561,8 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. !IPTCPANEL_COPYRIGHT;Copyright notice @@ -1727,10 +1729,10 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !TP_COLORAPP_FREE;Free temp+green + CAT02 + [output] !TP_COLORAPP_NEUTRAL;Reset !TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1929,6 +1931,7 @@ ZOOMPANEL_ZOOMOUT;Умањује приказ слике - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Serbian (Latin Characters) b/rtdata/languages/Serbian (Latin Characters) index 6feba1bf3..58bcc871d 100644 --- a/rtdata/languages/Serbian (Latin Characters) +++ b/rtdata/languages/Serbian (Latin Characters) @@ -1561,6 +1561,8 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. !IPTCPANEL_COPYRIGHT;Copyright notice @@ -1727,10 +1729,10 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !TP_COLORAPP_FREE;Free temp+green + CAT02 + [output] !TP_COLORAPP_NEUTRAL;Reset !TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1929,6 +1931,7 @@ ZOOMPANEL_ZOOMOUT;Umanjuje prikaz slike - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Slovak b/rtdata/languages/Slovak index f589c3ee1..c42c22637 100644 --- a/rtdata/languages/Slovak +++ b/rtdata/languages/Slovak @@ -1037,6 +1037,8 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. @@ -1499,14 +1501,14 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1849,6 +1851,7 @@ ZOOMPANEL_ZOOMOUT;Oddialiť - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Suomi b/rtdata/languages/Suomi index ecdcfff8a..1f14fad7c 100644 --- a/rtdata/languages/Suomi +++ b/rtdata/languages/Suomi @@ -976,6 +976,8 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. @@ -1460,14 +1462,14 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1838,6 +1840,7 @@ TP_WBALANCE_TEMPERATURE;Lämpötila [K] !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/Swedish b/rtdata/languages/Swedish index 0f3ddaafd..989207c05 100644 --- a/rtdata/languages/Swedish +++ b/rtdata/languages/Swedish @@ -1955,6 +1955,8 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. !IPTCPANEL_COPYRIGHT;Copyright notice @@ -2027,10 +2029,10 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !TP_COLORAPP_FREE;Free temp+green + CAT02 + [output] !TP_COLORAPP_NEUTRAL;Reset !TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_CURVEEDITOR_CL_TOOLTIP;Chroma opacity as a function of luminance oC=f(L) !TP_COLORTONING_LABEL;Color Toning !TP_COLORTONING_METHOD_TOOLTIP;"L*a*b* blending", "RGB sliders" and "RGB curves" use interpolated color blending.\n"Color balance (Shadows/Midtones/Highlights)" and "Saturation 2 colors" use direct colors.\n\nThe Black-and-White tool can be enabled when using any color toning method, which allows for color toning. @@ -2115,6 +2117,7 @@ ZOOMPANEL_ZOOMOUT;Förminska.\nKortkommando: - !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_VNG4;VNG4 !TP_RETINEX_CONTEDIT_MAP;Mask equalizer !TP_RETINEX_CURVEEDITOR_CD_TOOLTIP;Luminance according to luminance L=f(L)\nCorrect raw data to reduce halos and artifacts. diff --git a/rtdata/languages/Turkish b/rtdata/languages/Turkish index 937e0dabb..ac3fa70a0 100644 --- a/rtdata/languages/Turkish +++ b/rtdata/languages/Turkish @@ -975,6 +975,8 @@ TP_WBALANCE_TEMPERATURE;Isı !HISTORY_MSG_488;HDR Tone Mapping !HISTORY_MSG_489;HDR TM - Threshold !HISTORY_MSG_490;HDR TM - Amount +!HISTORY_MSG_491;White Balance +!HISTORY_MSG_492;RGB Curves !HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s !IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. !IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. @@ -1459,14 +1461,14 @@ TP_WBALANCE_TEMPERATURE;Isı !TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode !TP_COLORAPP_TCMODE_LIGHTNESS;Lightness !TP_COLORAPP_TCMODE_SATUR;Saturation -!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 !TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 !TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. !TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] !TP_COLORAPP_WBRT;WB [RT] + [output] !TP_COLORAPP_YB;Yb% (mean luminance) !TP_COLORAPP_YBSCENE;Yb% (mean luminance) -!TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +!TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance !TP_COLORTONING_AB;o C/L !TP_COLORTONING_AUTOSAT;Automatic !TP_COLORTONING_BALANCE;Balance @@ -1837,6 +1839,7 @@ TP_WBALANCE_TEMPERATURE;Isı !TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue !TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green !TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +!TP_RAW_RCD;RCD !TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix !TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. !TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtdata/languages/default b/rtdata/languages/default index f428aca47..fda54dd4d 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -722,6 +722,9 @@ HISTORY_MSG_487;Lens Correction - Lens HISTORY_MSG_488;HDR Tone Mapping HISTORY_MSG_489;HDR TM - Threshold HISTORY_MSG_490;HDR TM - Amount +HISTORY_MSG_491;White Balance +HISTORY_MSG_492;RGB Curves +HISTORY_MSG_493;L*a*b* Adjustments HISTORY_NEWSNAPSHOT;Add HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s HISTORY_SNAPSHOT;Snapshot @@ -1372,14 +1375,14 @@ TP_COLORAPP_TCMODE_LABEL2;Curve mode 2 TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode TP_COLORAPP_TCMODE_LIGHTNESS;Lightness TP_COLORAPP_TCMODE_SATUR;Saturation -TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] TP_COLORAPP_WBRT;WB [RT] + [output] TP_COLORAPP_YB;Yb% (mean luminance) TP_COLORAPP_YBSCENE;Yb% (mean luminance) -TP_COLORAPP_YBSCENE_TOOLTIP;if auto enable, Yb is calculated from the mean value of actual image luminance +TP_COLORAPP_YBSCENE_TOOLTIP;if auto is enabled, Yb is calculated from the mean value of the actual image's luminance TP_COLORTONING_AB;o C/L TP_COLORTONING_AUTOSAT;Automatic TP_COLORTONING_BALANCE;Balance @@ -1788,6 +1791,7 @@ TP_RAW_PIXELSHIFTSMOOTH_TOOLTIP;Smooth transitions between areas with motion and TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;StdDev factor Blue TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;StdDev factor Green TP_RAW_PIXELSHIFTSTDDEVFACTORRED;StdDev factor Red +TP_RAW_RCD;RCD TP_RAW_SENSOR_BAYER_LABEL;Sensor with Bayer Matrix TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster. TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 59fd804f1..bfd56cc0a 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -218,18 +218,18 @@ void RawImageSource::CA_correct_RT(const bool autoCA, const double cared, const // Main algorithm: Tile loop calculating correction parameters per tile #pragma omp for collapse(2) schedule(dynamic) nowait for (int top = -border ; top < height; top += ts - border2) - for (int left = -border; left < width; left += ts - border2) { + for (int left = -border; left < width - (W & 1); left += ts - border2) { memset(buffer, 0, buffersize); const int vblock = ((top + border) / (ts - border2)) + 1; const int hblock = ((left + border) / (ts - border2)) + 1; const int bottom = min(top + ts, height + border); - const int right = min(left + ts, width + border); + const int right = min(left + ts, width - (W & 1) + border); const int rr1 = bottom - top; const int cc1 = right - left; const int rrmin = top < 0 ? border : 0; const int rrmax = bottom > height ? height - top : rr1; const int ccmin = left < 0 ? border : 0; - const int ccmax = right > width ? width - left : cc1; + const int ccmax = (right > width - (W & 1)) ? width - (W & 1) - left : cc1; // rgb from input CFA data // rgb values should be floating point numbers between 0 and 1 @@ -755,20 +755,20 @@ void RawImageSource::CA_correct_RT(const bool autoCA, const double cared, const #pragma omp for schedule(dynamic) collapse(2) nowait for (int top = -border; top < height; top += ts - border2) - for (int left = -border; left < width; left += ts - border2) { + for (int left = -border; left < width - (W & 1); left += ts - border2) { memset(buffer, 0, buffersize); float lblockshifts[2][2]; const int vblock = ((top + border) / (ts - border2)) + 1; const int hblock = ((left + border) / (ts - border2)) + 1; const int bottom = min(top + ts, height + border); - const int right = min(left + ts, width + border); + const int right = min(left + ts, width - (W & 1) + border); const int rr1 = bottom - top; const int cc1 = right - left; const int rrmin = top < 0 ? border : 0; const int rrmax = bottom > height ? height - top : rr1; const int ccmin = left < 0 ? border : 0; - const int ccmax = right > width ? width - left : cc1; + const int ccmax = (right > width - (W & 1)) ? width - (W & 1) - left : cc1; // rgb from input CFA data // rgb values should be floating point number between 0 and 1 @@ -1145,7 +1145,7 @@ void RawImageSource::CA_correct_RT(const bool autoCA, const double cared, const STC2VFU(rawData[row][col], LVFU(RawDataTmp[indx])); } #endif - for(; col < width; col += 2, indx++) { + for(; col < width - (W & 1); col += 2, indx++) { rawData[row][col] = RawDataTmp[indx]; } } diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index 53b374388..70416af62 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -106,6 +106,7 @@ set(RTENGINESOURCEFILES rawimage.cc rawimagesource.cc refreshmap.cc + rt_algo.cc rtthumbnail.cc shmap.cc simpleprocess.cc diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index 0634deedd..334f97f05 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -74,13 +74,14 @@ extern const Settings* settings; extern MyMutex *fftwMutex; -namespace { +namespace +{ template void do_median_denoise(float **src, float **dst, float upperBound, const int width, const int height, const ImProcFunctions::Median medianType, const int iterations, const int numThreads, float **buffer) { typedef ImProcFunctions::Median Median; - + int border = 1; switch (medianType) { @@ -227,6 +228,7 @@ void do_median_denoise(float **src, float **dst, float upperBound, const int wid case Median::TYPE_5X5_STRONG: { #ifdef __SSE2__ + for (; !useUpperBound && j < width - border - 3; j += 4) { STVFU( medianOut[i][j], @@ -261,6 +263,7 @@ void do_median_denoise(float **src, float **dst, float upperBound, const int wid } #endif + for (; j < width - border; ++j) { if (!useUpperBound || medianIn[i][j] <= upperBound) { medianOut[i][j] = median( @@ -315,7 +318,7 @@ void do_median_denoise(float **src, float **dst, float upperBound, const int wid #endif std::array pp; - + for (; j < width - border; ++j) { if (!useUpperBound || medianIn[i][j] <= upperBound) { for (int kk = 0, ii = -border; ii <= border; ++ii) { @@ -323,7 +326,7 @@ void do_median_denoise(float **src, float **dst, float upperBound, const int wid pp[kk] = medianIn[i + ii][j + jj]; } } - + medianOut[i][j] = median(pp); } else { medianOut[i][j] = medianIn[i][j]; @@ -350,7 +353,7 @@ void do_median_denoise(float **src, float **dst, float upperBound, const int wid #endif std::array pp; - + for (; j < width - border; ++j) { if (!useUpperBound || medianIn[i][j] <= upperBound) { for (int kk = 0, ii = -border; ii <= border; ++ii) { @@ -358,7 +361,7 @@ void do_median_denoise(float **src, float **dst, float upperBound, const int wid pp[kk] = medianIn[i + ii][j + jj]; } } - + medianOut[i][j] = median(pp); } else { medianOut[i][j] = medianIn[i][j]; @@ -393,6 +396,7 @@ void do_median_denoise(float **src, float **dst, float upperBound, const int wid #ifdef _OPENMP #pragma omp parallel for num_threads(numThreads) if (numThreads>1) #endif + for (int i = 0; i < height; ++i) { for (int j = 0; j < width; ++j) { dst[i][j] = medianOut[i][j]; @@ -491,7 +495,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef MyMutex::MyLock lock(*fftwMutex); const nrquality nrQuality = (dnparams.smethod == "shal") ? QUALITY_STANDARD : QUALITY_HIGH;//shrink method - const float qhighFactor = (nrQuality == QUALITY_HIGH) ? 1.f / static_cast( settings->nrhigh) : 1.0f; + const float qhighFactor = (nrQuality == QUALITY_HIGH) ? 1.f / static_cast(settings->nrhigh) : 1.0f; const bool useNoiseCCurve = (noiseCCurve && noiseCCurve.getSum() > 5.f); const bool useNoiseLCurve = (noiseLCurve && noiseLCurve.getSum() >= 7.f); const bool autoch = (settings->leveldnautsimpl == 1 && (dnparams.Cmethod == "AUT" || dnparams.Cmethod == "PRE")) || (settings->leveldnautsimpl == 0 && (dnparams.C2method == "AUTO" || dnparams.C2method == "PREV")); @@ -531,15 +535,15 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef const bool denoiseMethodRgb = (dnparams.dmethod == "RGB"); // init luma noisevarL - const float noiseluma = static_cast( dnparams.luma); - const float noisevarL = (useNoiseLCurve && (denoiseMethodRgb || !isRAW)) ? static_cast (SQR(((noiseluma + 1.0) / 125.0) * (10. + (noiseluma + 1.0) / 25.0))) : static_cast (SQR((noiseluma / 125.0) * (1.0 + noiseluma / 25.0))); + const float noiseluma = static_cast(dnparams.luma); + const float noisevarL = (useNoiseLCurve && (denoiseMethodRgb || !isRAW)) ? static_cast(SQR(((noiseluma + 1.0) / 125.0) * (10. + (noiseluma + 1.0) / 25.0))) : static_cast(SQR((noiseluma / 125.0) * (1.0 + noiseluma / 25.0))); const bool denoiseLuminance = (noisevarL > 0.00001f); //printf("NL=%f \n",noisevarL); if (useNoiseLCurve || useNoiseCCurve) { int hei = calclum->getHeight(); int wid = calclum->getWidth(); - TMatrix wprofi = ICCStore::getInstance()->workingSpaceMatrix (params->icm.working); + TMatrix wprofi = ICCStore::getInstance()->workingSpaceMatrix(params->icm.working); const float wpi[3][3] = { {static_cast(wprofi[0][0]), static_cast(wprofi[0][1]), static_cast(wprofi[0][2])}, @@ -653,8 +657,9 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef Color::gammanf2lut(igamcurve, igam, 32768.f, 65535.f); } - const float gain = pow (2.0f, float(expcomp)); - float noisevar_Ldetail = SQR(static_cast(SQR(100. - dnparams.Ldetail) + 50.*(100. - dnparams.Ldetail)) * TS * 0.5f); + const float gain = pow(2.0f, float(expcomp)); + float params_Ldetail = min(float(dnparams.Ldetail), 99.9f); // max out to avoid div by zero when using noisevar_Ldetail as divisor + float noisevar_Ldetail = SQR(static_cast(SQR(100. - params_Ldetail) + 50.*(100. - params_Ldetail)) * TS * 0.5f); array2D tilemask_in(TS, TS); array2D tilemask_out(TS, TS); @@ -706,7 +711,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef int numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip; - Tile_calc (tilesize, overlap, (options.rgbDenoiseThreadLimit == 0 && !ponder) ? (numTries == 1 ? 0 : 2) : 2, imwidth, imheight, numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip); + Tile_calc(tilesize, overlap, (options.rgbDenoiseThreadLimit == 0 && !ponder) ? (numTries == 1 ? 0 : 2) : 2, imwidth, imheight, numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip); memoryAllocationFailed = false; const int numtiles = numtiles_W * numtiles_H; @@ -746,8 +751,8 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef fftwf_plan plan_backward_blox[2]; if (denoiseLuminance) { - float *Lbloxtmp = reinterpret_cast( fftwf_malloc(max_numblox_W * TS * TS * sizeof (float))); - float *fLbloxtmp = reinterpret_cast( fftwf_malloc(max_numblox_W * TS * TS * sizeof (float))); + float *Lbloxtmp = reinterpret_cast(fftwf_malloc(max_numblox_W * TS * TS * sizeof(float))); + float *fLbloxtmp = reinterpret_cast(fftwf_malloc(max_numblox_W * TS * TS * sizeof(float))); int nfwd[2] = {TS, TS}; @@ -756,12 +761,12 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef fftw_r2r_kind bwdkind[2] = {FFTW_REDFT01, FFTW_REDFT01}; // Creating the plans with FFTW_MEASURE instead of FFTW_ESTIMATE speeds up the execute a bit - plan_forward_blox[0] = fftwf_plan_many_r2r(2, nfwd, max_numblox_W, Lbloxtmp, nullptr, 1, TS * TS, fLbloxtmp, nullptr, 1, TS * TS, fwdkind, FFTW_MEASURE || FFTW_DESTROY_INPUT ); - plan_backward_blox[0] = fftwf_plan_many_r2r(2, nfwd, max_numblox_W, fLbloxtmp, nullptr, 1, TS * TS, Lbloxtmp, nullptr, 1, TS * TS, bwdkind, FFTW_MEASURE || FFTW_DESTROY_INPUT ); - plan_forward_blox[1] = fftwf_plan_many_r2r(2, nfwd, min_numblox_W, Lbloxtmp, nullptr, 1, TS * TS, fLbloxtmp, nullptr, 1, TS * TS, fwdkind, FFTW_MEASURE || FFTW_DESTROY_INPUT ); - plan_backward_blox[1] = fftwf_plan_many_r2r(2, nfwd, min_numblox_W, fLbloxtmp, nullptr, 1, TS * TS, Lbloxtmp, nullptr, 1, TS * TS, bwdkind, FFTW_MEASURE || FFTW_DESTROY_INPUT ); - fftwf_free (Lbloxtmp); - fftwf_free (fLbloxtmp); + plan_forward_blox[0] = fftwf_plan_many_r2r(2, nfwd, max_numblox_W, Lbloxtmp, nullptr, 1, TS * TS, fLbloxtmp, nullptr, 1, TS * TS, fwdkind, FFTW_MEASURE || FFTW_DESTROY_INPUT); + plan_backward_blox[0] = fftwf_plan_many_r2r(2, nfwd, max_numblox_W, fLbloxtmp, nullptr, 1, TS * TS, Lbloxtmp, nullptr, 1, TS * TS, bwdkind, FFTW_MEASURE || FFTW_DESTROY_INPUT); + plan_forward_blox[1] = fftwf_plan_many_r2r(2, nfwd, min_numblox_W, Lbloxtmp, nullptr, 1, TS * TS, fLbloxtmp, nullptr, 1, TS * TS, fwdkind, FFTW_MEASURE || FFTW_DESTROY_INPUT); + plan_backward_blox[1] = fftwf_plan_many_r2r(2, nfwd, min_numblox_W, fLbloxtmp, nullptr, 1, TS * TS, Lbloxtmp, nullptr, 1, TS * TS, bwdkind, FFTW_MEASURE || FFTW_DESTROY_INPUT); + fftwf_free(Lbloxtmp); + fftwf_free(fLbloxtmp); } #ifndef _OPENMP @@ -785,7 +790,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef } if (options.rgbDenoiseThreadLimit > 0) - while(denoiseNestedLevels * numthreads > options.rgbDenoiseThreadLimit) { + while (denoiseNestedLevels * numthreads > options.rgbDenoiseThreadLimit) { denoiseNestedLevels--; } @@ -801,12 +806,12 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef if (numtiles > 1 && denoiseLuminance) { for (int i = 0; i < denoiseNestedLevels * numthreads; ++i) { - LbloxArray[i] = reinterpret_cast( fftwf_malloc(max_numblox_W * TS * TS * sizeof(float))); - fLbloxArray[i] = reinterpret_cast( fftwf_malloc(max_numblox_W * TS * TS * sizeof(float))); + LbloxArray[i] = reinterpret_cast(fftwf_malloc(max_numblox_W * TS * TS * sizeof(float))); + fLbloxArray[i] = reinterpret_cast(fftwf_malloc(max_numblox_W * TS * TS * sizeof(float))); } } - TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.working); + TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.working); //inverse matrix user select const float wip[3][3] = { {static_cast(wiprof[0][0]), static_cast(wiprof[0][1]), static_cast(wiprof[0][2])}, @@ -814,7 +819,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef {static_cast(wiprof[2][0]), static_cast(wiprof[2][1]), static_cast(wiprof[2][2])} }; - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params->icm.working); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.working); const float wp[3][3] = { {static_cast(wprof[0][0]), static_cast(wprof[0][1]), static_cast(wprof[0][2])}, @@ -853,19 +858,19 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef int height = tilebottom - tiletop; int width2 = (width + 1) / 2; float realred, realblue; - float interm_med = static_cast( dnparams.chroma) / 10.0; + float interm_med = static_cast(dnparams.chroma) / 10.0; float intermred, intermblue; if (dnparams.redchro > 0.) { intermred = (dnparams.redchro / 10.); } else { - intermred = static_cast( dnparams.redchro) / 7.0; //increase slower than linear for more sensit + intermred = static_cast(dnparams.redchro) / 7.0; //increase slower than linear for more sensit } if (dnparams.bluechro > 0.) { intermblue = (dnparams.bluechro / 10.); } else { - intermblue = static_cast( dnparams.bluechro) / 7.0; //increase slower than linear for more sensit + intermblue = static_cast(dnparams.bluechro) / 7.0; //increase slower than linear for more sensit } if (ponder && kall == 2) { @@ -1079,7 +1084,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef //binary 1 or 0 for each level, eg subsampling = 0 means no subsampling, 1 means subsample //the first level only, 7 means subsample the first three levels, etc. //actual implementation only works with subsampling set to 1 - float interm_medT = static_cast( dnparams.chroma) / 10.0; + float interm_medT = static_cast(dnparams.chroma) / 10.0; bool execwavelet = true; if (!denoiseLuminance && interm_medT < 0.05f && dnparams.median && (dnparams.methodmed == "Lab" || dnparams.methodmed == "Lonly")) { @@ -1139,7 +1144,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef levwav = min(maxlev2, levwav); // if (settings->verbose) printf("levwavelet=%i noisevarA=%f noisevarB=%f \n",levwav, noisevarab_r, noisevarab_b); - Ldecomp = new wavelet_decomposition (labdn->L[0], labdn->W, labdn->H, levwav, 1, 1, max(1, denoiseNestedLevels)); + Ldecomp = new wavelet_decomposition(labdn->L[0], labdn->W, labdn->H, levwav, 1, 1, max(1, denoiseNestedLevels)); if (Ldecomp->memoryAllocationFailed) { memoryAllocationFailed = true; @@ -1176,7 +1181,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef float chmaxresid = 0.f; float chmaxresidtemp = 0.f; - adecomp = new wavelet_decomposition (labdn->a[0], labdn->W, labdn->H, levwav, 1, 1, max(1, denoiseNestedLevels)); + adecomp = new wavelet_decomposition(labdn->a[0], labdn->W, labdn->H, levwav, 1, 1, max(1, denoiseNestedLevels)); if (adecomp->memoryAllocationFailed) { memoryAllocationFailed = true; @@ -1213,7 +1218,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef delete adecomp; if (!memoryAllocationFailed) { - wavelet_decomposition* bdecomp = new wavelet_decomposition (labdn->b[0], labdn->W, labdn->H, levwav, 1, 1, max(1, denoiseNestedLevels)); + wavelet_decomposition* bdecomp = new wavelet_decomposition(labdn->b[0], labdn->W, labdn->H, levwav, 1, 1, max(1, denoiseNestedLevels)); if (bdecomp->memoryAllocationFailed) { memoryAllocationFailed = true; @@ -1295,79 +1300,6 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef } if (!memoryAllocationFailed) { - if ((metchoice == 1 || metchoice == 2 || metchoice == 3 || metchoice == 4) && dnparams.median) { - float** tmL; - int wid = labdn->W; - int hei = labdn->H; - tmL = new float*[hei]; - - for (int i = 0; i < hei; ++i) { - tmL[i] = new float[wid]; - } - - Median medianTypeL = Median::TYPE_3X3_SOFT; - Median medianTypeAB = Median::TYPE_3X3_SOFT; - - if (dnparams.medmethod == "soft") { - if (metchoice != 4) { - medianTypeL = medianTypeAB = Median::TYPE_3X3_SOFT; - } else { - medianTypeL = Median::TYPE_3X3_SOFT; - medianTypeAB = Median::TYPE_3X3_SOFT; - } - } else if (dnparams.medmethod == "33") { - if (metchoice != 4) { - medianTypeL = medianTypeAB = Median::TYPE_3X3_STRONG; - } else { - medianTypeL = Median::TYPE_3X3_SOFT; - medianTypeAB = Median::TYPE_3X3_STRONG; - } - } else if (dnparams.medmethod == "55soft") { - if (metchoice != 4) { - medianTypeL = medianTypeAB = Median::TYPE_5X5_SOFT; - } else { - medianTypeL = Median::TYPE_3X3_SOFT; - medianTypeAB = Median::TYPE_5X5_SOFT; - } - } else if (dnparams.medmethod == "55") { - if (metchoice != 4) { - medianTypeL = medianTypeAB = Median::TYPE_5X5_STRONG; - } else { - medianTypeL = Median::TYPE_3X3_STRONG; - medianTypeAB = Median::TYPE_5X5_STRONG; - } - } else if (dnparams.medmethod == "77") { - if (metchoice != 4) { - medianTypeL = medianTypeAB = Median::TYPE_7X7; - } else { - medianTypeL = Median::TYPE_3X3_STRONG; - medianTypeAB = Median::TYPE_7X7; - } - } else if (dnparams.medmethod == "99") { - if (metchoice != 4) { - medianTypeL = medianTypeAB = Median::TYPE_9X9; - } else { - medianTypeL = Median::TYPE_5X5_SOFT; - medianTypeAB = Median::TYPE_9X9; - } - } - - if (metchoice == 1 || metchoice == 2 || metchoice == 4) { - Median_Denoise(labdn->L, labdn->L, wid, hei, medianTypeL, dnparams.passes, denoiseNestedLevels, tmL); - } - - if (metchoice == 2 || metchoice == 3 || metchoice == 4) { - Median_Denoise(labdn->a, labdn->a, wid, hei, medianTypeAB, dnparams.passes, denoiseNestedLevels, tmL); - Median_Denoise(labdn->b, labdn->b, wid, hei, medianTypeAB, dnparams.passes, denoiseNestedLevels, tmL); - } - - for (int i = 0; i < hei; ++i) { - delete[] tmL[i]; - } - - delete[] tmL; - } - //wavelet denoised L channel //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1396,8 +1328,8 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef if (numtiles == 1) { for (int i = 0; i < denoiseNestedLevels * numthreads; ++i) { - LbloxArray[i] = reinterpret_cast( fftwf_malloc(max_numblox_W * TS * TS * sizeof(float))); - fLbloxArray[i] = reinterpret_cast( fftwf_malloc(max_numblox_W * TS * TS * sizeof(float))); + LbloxArray[i] = reinterpret_cast(fftwf_malloc(max_numblox_W * TS * TS * sizeof(float))); + fLbloxArray[i] = reinterpret_cast(fftwf_malloc(max_numblox_W * TS * TS * sizeof(float))); } } @@ -1492,7 +1424,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef for (int hblk = 0; hblk < numblox_W; ++hblk) { - RGBtile_denoise (fLblox, hblk, noisevar_Ldetail, nbrwt, blurbuffer); + RGBtile_denoise(fLblox, hblk, noisevar_Ldetail, nbrwt, blurbuffer); }//end of horizontal block loop //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1507,7 +1439,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef int topproc = (vblk - blkrad) * offset; //add row of blocks to output image tile - RGBoutput_tile_row (Lblox, Ldetail, tilemask_out, height, width, topproc); + RGBoutput_tile_row(Lblox, Ldetail, tilemask_out, height, width, topproc); //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1530,6 +1462,79 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef } } + if ((metchoice == 1 || metchoice == 2 || metchoice == 3 || metchoice == 4) && dnparams.median) { + float** tmL; + int wid = labdn->W; + int hei = labdn->H; + tmL = new float*[hei]; + + for (int i = 0; i < hei; ++i) { + tmL[i] = new float[wid]; + } + + Median medianTypeL = Median::TYPE_3X3_SOFT; + Median medianTypeAB = Median::TYPE_3X3_SOFT; + + if (dnparams.medmethod == "soft") { + if (metchoice != 4) { + medianTypeL = medianTypeAB = Median::TYPE_3X3_SOFT; + } else { + medianTypeL = Median::TYPE_3X3_SOFT; + medianTypeAB = Median::TYPE_3X3_SOFT; + } + } else if (dnparams.medmethod == "33") { + if (metchoice != 4) { + medianTypeL = medianTypeAB = Median::TYPE_3X3_STRONG; + } else { + medianTypeL = Median::TYPE_3X3_SOFT; + medianTypeAB = Median::TYPE_3X3_STRONG; + } + } else if (dnparams.medmethod == "55soft") { + if (metchoice != 4) { + medianTypeL = medianTypeAB = Median::TYPE_5X5_SOFT; + } else { + medianTypeL = Median::TYPE_3X3_SOFT; + medianTypeAB = Median::TYPE_5X5_SOFT; + } + } else if (dnparams.medmethod == "55") { + if (metchoice != 4) { + medianTypeL = medianTypeAB = Median::TYPE_5X5_STRONG; + } else { + medianTypeL = Median::TYPE_3X3_STRONG; + medianTypeAB = Median::TYPE_5X5_STRONG; + } + } else if (dnparams.medmethod == "77") { + if (metchoice != 4) { + medianTypeL = medianTypeAB = Median::TYPE_7X7; + } else { + medianTypeL = Median::TYPE_3X3_STRONG; + medianTypeAB = Median::TYPE_7X7; + } + } else if (dnparams.medmethod == "99") { + if (metchoice != 4) { + medianTypeL = medianTypeAB = Median::TYPE_9X9; + } else { + medianTypeL = Median::TYPE_5X5_SOFT; + medianTypeAB = Median::TYPE_9X9; + } + } + + if (metchoice == 1 || metchoice == 2 || metchoice == 4) { + Median_Denoise(labdn->L, labdn->L, wid, hei, medianTypeL, dnparams.passes, denoiseNestedLevels, tmL); + } + + if (metchoice == 2 || metchoice == 3 || metchoice == 4) { + Median_Denoise(labdn->a, labdn->a, wid, hei, medianTypeAB, dnparams.passes, denoiseNestedLevels, tmL); + Median_Denoise(labdn->b, labdn->b, wid, hei, medianTypeAB, dnparams.passes, denoiseNestedLevels, tmL); + } + + for (int i = 0; i < hei; ++i) { + delete[] tmL[i]; + } + + delete[] tmL; + } + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // transform denoised "Lab" to output RGB @@ -1776,7 +1781,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef fftwf_destroy_plan(plan_backward_blox[1]); fftwf_cleanup(); } - } while(memoryAllocationFailed && numTries < 2 && (options.rgbDenoiseThreadLimit == 0) && !ponder); + } while (memoryAllocationFailed && numTries < 2 && (options.rgbDenoiseThreadLimit == 0) && !ponder); if (memoryAllocationFailed) { printf("tiled denoise failed due to isufficient memory. Output is not denoised!\n"); @@ -1838,16 +1843,16 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef } } } - } else { + } else + { #pragma omp for - for (int i = 2; i < hei - 2; ++i) - { + for (int i = 2; i < hei - 2; ++i) { if (methmed == 3) { for (int j = 2; j < wid - 2; ++j) { tm[i][j] = median(source->r(i, j), source->r(i - 1, j), source->r(i + 1, j), source->r(i, j + 1), source->r(i, j - 1), source->r(i - 1, j - 1), source->r(i - 1, j + 1), source->r(i + 1, j - 1), source->r(i + 1, j + 1), - source->r(i - 2, j), source->r(i + 2, j), source->r(i, j + 2), source->r(i, j - 2), source->r(i - 2, j - 2), source->r(i - 2, j + 2), source->r(i + 2, j - 2), source->r(i + 2, j + 2), - source->r(i - 2, j + 1), source->r(i + 2, j + 1), source->r(i - 1, j + 2), source->r(i - 1, j - 2), source->r(i - 2, j - 1), source->r(i + 2, j - 1), source->r(i + 1, j + 2), source->r(i + 1, j - 2));//5x5 + source->r(i - 2, j), source->r(i + 2, j), source->r(i, j + 2), source->r(i, j - 2), source->r(i - 2, j - 2), source->r(i - 2, j + 2), source->r(i + 2, j - 2), source->r(i + 2, j + 2), + source->r(i - 2, j + 1), source->r(i + 2, j + 1), source->r(i - 1, j + 2), source->r(i - 1, j - 2), source->r(i - 2, j - 1), source->r(i + 2, j - 1), source->r(i + 1, j + 2), source->r(i + 1, j - 2));//5x5 } } else { for (int j = 2; j < wid - 2; ++j) { @@ -1870,6 +1875,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef } } } + #ifdef _OPENMP #pragma omp for nowait #endif @@ -1896,16 +1902,16 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef } } } - } else { + } else + { #pragma omp for - for (int i = 2; i < hei - 2; ++i) - { + for (int i = 2; i < hei - 2; ++i) { if (methmed == 3) { for (int j = 2; j < wid - 2; ++j) { tm[i][j] = median(source->b(i, j), source->b(i - 1, j), source->b(i + 1, j), source->b(i, j + 1), source->b(i, j - 1), source->b(i - 1, j - 1), source->b(i - 1, j + 1), source->b(i + 1, j - 1), source->b(i + 1, j + 1), - source->b(i - 2, j), source->b(i + 2, j), source->b(i, j + 2), source->b(i, j - 2), source->b(i - 2, j - 2), source->b(i - 2, j + 2), source->b(i + 2, j - 2), source->b(i + 2, j + 2), - source->b(i - 2, j + 1), source->b(i + 2, j + 1), source->b(i - 1, j + 2), source->b(i - 1, j - 2), source->b(i - 2, j - 1), source->b(i + 2, j - 1), source->b(i + 1, j + 2), source->b(i + 1, j - 2)); // 5x5 + source->b(i - 2, j), source->b(i + 2, j), source->b(i, j + 2), source->b(i, j - 2), source->b(i - 2, j - 2), source->b(i - 2, j + 2), source->b(i + 2, j - 2), source->b(i + 2, j + 2), + source->b(i - 2, j + 1), source->b(i + 2, j + 1), source->b(i - 1, j + 2), source->b(i - 1, j - 2), source->b(i - 2, j - 1), source->b(i + 2, j - 1), source->b(i + 1, j + 2), source->b(i + 1, j - 2)); // 5x5 } } else { for (int j = 2; j < wid - 2; ++j) { @@ -1956,16 +1962,16 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef } } } - } else { + } else + { #pragma omp for - for (int i = 2; i < hei - 2; ++i) - { + for (int i = 2; i < hei - 2; ++i) { if (methmed == 3) { for (int j = 2; j < wid - 2; ++j) { tm[i][j] = median(source->g(i, j), source->g(i - 1, j), source->g(i + 1, j), source->g(i, j + 1), source->g(i, j - 1), source->g(i - 1, j - 1), source->g(i - 1, j + 1), source->g(i + 1, j - 1), source->g(i + 1, j + 1), - source->g(i - 2, j), source->g(i + 2, j), source->g(i, j + 2), source->g(i, j - 2), source->g(i - 2, j - 2), source->g(i - 2, j + 2), source->g(i + 2, j - 2), source->g(i + 2, j + 2), - source->g(i - 2, j + 1), source->g(i + 2, j + 1), source->g(i - 1, j + 2), source->g(i - 1, j - 2), source->g(i - 2, j - 1), source->g(i + 2, j - 1), source->g(i + 1, j + 2), source->g(i + 1, j - 2)); // 5x5 + source->g(i - 2, j), source->g(i + 2, j), source->g(i, j + 2), source->g(i, j - 2), source->g(i - 2, j - 2), source->g(i - 2, j + 2), source->g(i + 2, j - 2), source->g(i + 2, j + 2), + source->g(i - 2, j + 1), source->g(i + 2, j + 1), source->g(i - 1, j + 2), source->g(i - 1, j - 2), source->g(i - 2, j - 1), source->g(i + 2, j - 1), source->g(i + 1, j + 2), source->g(i + 1, j - 2)); // 5x5 } } else { for (int j = 2; j < wid - 2; ++j) { @@ -2034,7 +2040,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -SSEFUNCTION void ImProcFunctions::RGBtile_denoise (float * fLblox, int hblproc, float noisevar_Ldetail, float * nbrwt, float * blurbuffer) //for DCT +SSEFUNCTION void ImProcFunctions::RGBtile_denoise(float * fLblox, int hblproc, float noisevar_Ldetail, float * nbrwt, float * blurbuffer) //for DCT { int blkstart = hblproc * TS * TS; @@ -2067,7 +2073,7 @@ SSEFUNCTION void ImProcFunctions::RGBtile_denoise (float * fLblox, int hblproc, //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void ImProcFunctions::RGBoutput_tile_row (float *bloxrow_L, float ** Ldetail, float ** tilemask_out, int height, int width, int top) +void ImProcFunctions::RGBoutput_tile_row(float *bloxrow_L, float ** Ldetail, float ** tilemask_out, int height, int width, int top) { const int numblox_W = ceil((static_cast(width)) / (offset)); const float DCTnorm = 1.0f / (4 * TS * TS); //for DCT @@ -2146,7 +2152,7 @@ float ImProcFunctions::MadMax(float * DataList, int & max, int datalen) float ImProcFunctions::Mad(float * DataList, const int datalen) { - if(datalen <= 1) { // Avoid possible buffer underrun + if (datalen <= 1) { // Avoid possible buffer underrun return 0; } @@ -2175,7 +2181,7 @@ float ImProcFunctions::Mad(float * DataList, const int datalen) float ImProcFunctions::MadRgb(float * DataList, const int datalen) { - if(datalen <= 1) { // Avoid possible buffer underrun + if (datalen <= 1) { // Avoid possible buffer underrun return 0; } @@ -2902,7 +2908,7 @@ SSEFUNCTION void ImProcFunctions::ShrinkAll_info(float ** WavCoeffs_a, float ** } } - const float reduc = (schoice == 2) ? static_cast( settings->nrhigh) : 1.f; + const float reduc = (schoice == 2) ? static_cast(settings->nrhigh) : 1.f; for (int dir = 1; dir < 4; ++dir) { float mada, madb; @@ -3002,7 +3008,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise_infoGamCurve(const procparams::Dir } } -void ImProcFunctions::calcautodn_info (float &chaut, float &delta, int Nb, int levaut, float maxmax, float lumema, float chromina, int mode, int lissage, float redyel, float skinc, float nsknc) +void ImProcFunctions::calcautodn_info(float &chaut, float &delta, int Nb, int levaut, float maxmax, float lumema, float chromina, int mode, int lissage, float redyel, float skinc, float nsknc) { float reducdelta = 1.f; @@ -3081,7 +3087,7 @@ void ImProcFunctions::calcautodn_info (float &chaut, float &delta, int Nb, int l delta *= 0.15f; } else if (chaut < 650.f) { delta *= 0.1f; - } else /*if (chaut >= 650.f)*/ { + } else { /*if (chaut >= 650.f)*/ delta *= 0.07f; } @@ -3119,7 +3125,7 @@ void ImProcFunctions::calcautodn_info (float &chaut, float &delta, int Nb, int l delta *= 0.3f; } else if (chaut < 650.f) { delta *= 0.2f; - } else /*if (chaut >= 650.f)*/ { + } else { /*if (chaut >= 650.f)*/ delta *= 0.15f; } @@ -3157,7 +3163,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise_info(Imagefloat * src, Imagefloat float** bcalc; hei = provicalc->getHeight(); wid = provicalc->getWidth(); - TMatrix wprofi = ICCStore::getInstance()->workingSpaceMatrix (params->icm.working); + TMatrix wprofi = ICCStore::getInstance()->workingSpaceMatrix(params->icm.working); const float wpi[3][3] = { {static_cast(wprofi[0][0]), static_cast(wprofi[0][1]), static_cast(wprofi[0][2])}, @@ -3209,7 +3215,7 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise_info(Imagefloat * src, Imagefloat bool denoiseMethodRgb = (dnparams.dmethod == "RGB"); - const float gain = pow (2.0f, float(expcomp)); + const float gain = pow(2.0f, float(expcomp)); int tilesize; int overlap; @@ -3228,11 +3234,11 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise_info(Imagefloat * src, Imagefloat //always no Tiles int kall = 0; - Tile_calc (tilesize, overlap, kall, imwidth, imheight, numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip); + Tile_calc(tilesize, overlap, kall, imwidth, imheight, numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip); //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params->icm.working); + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.working); const float wp[3][3] = { {static_cast(wprof[0][0]), static_cast(wprof[0][1]), static_cast(wprof[0][2])}, {static_cast(wprof[1][0]), static_cast(wprof[1][1]), static_cast(wprof[1][2])}, @@ -3276,19 +3282,19 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise_info(Imagefloat * src, Imagefloat } float realred, realblue; - float interm_med = static_cast( dnparams.chroma) / 10.0; + float interm_med = static_cast(dnparams.chroma) / 10.0; float intermred, intermblue; if (dnparams.redchro > 0.) { intermred = (dnparams.redchro / 10.); } else { - intermred = static_cast( dnparams.redchro) / 7.0; //increase slower than linear for more sensit + intermred = static_cast(dnparams.redchro) / 7.0; //increase slower than linear for more sensit } if (dnparams.bluechro > 0.) { intermblue = (dnparams.bluechro / 10.); } else { - intermblue = static_cast( dnparams.bluechro) / 7.0; //increase slower than linear for more sensit + intermblue = static_cast(dnparams.bluechro) / 7.0; //increase slower than linear for more sensit } realred = interm_med + intermred; @@ -3522,13 +3528,13 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise_info(Imagefloat * src, Imagefloat #pragma omp section #endif { - adecomp = new wavelet_decomposition (labdn->data + datalen, labdn->W, labdn->H, levwav, 1); + adecomp = new wavelet_decomposition(labdn->data + datalen, labdn->W, labdn->H, levwav, 1); } #ifdef _RT_NESTED_OPENMP #pragma omp section #endif { - bdecomp = new wavelet_decomposition (labdn->data + 2 * datalen, labdn->W, labdn->H, levwav, 1); + bdecomp = new wavelet_decomposition(labdn->data + 2 * datalen, labdn->W, labdn->H, levwav, 1); } } diff --git a/rtengine/amaze_demosaic_RT.cc b/rtengine/amaze_demosaic_RT.cc index 3cb0ee8de..30c673813 100644 --- a/rtengine/amaze_demosaic_RT.cc +++ b/rtengine/amaze_demosaic_RT.cc @@ -45,7 +45,7 @@ SSEFUNCTION void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, volatile double progress = 0.0; if (plistener) { - plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::amaze])); + plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZE))); plistener->setProgress (0.0); } @@ -223,13 +223,19 @@ SSEFUNCTION void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, // fill inner part for (int rr = rrmin; rr < rrmax; rr++) { int row = rr + top; - - for (int cc = ccmin; cc < ccmax; cc += 4) { + int cc = ccmin; + for (; cc < ccmax - 3; cc += 4) { int indx1 = rr * ts + cc; vfloat tempv = LVFU(rawData[row][cc + left]) / c65535v; STVF(cfa[indx1], tempv ); STVF(rgbgreen[indx1], tempv ); } + for (; cc < ccmax; ++cc) { + int indx1 = rr * ts + cc; + float temp = rawData[row][cc + left] / 65535.f; + cfa[indx1] = temp; + rgbgreen[indx1] = temp; + } } //fill lower border diff --git a/rtengine/colortemp.h b/rtengine/colortemp.h index d96e6f5ce..145c8ed20 100644 --- a/rtengine/colortemp.h +++ b/rtengine/colortemp.h @@ -21,6 +21,7 @@ #include #include +#include namespace rtengine { diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index 7fef1146f..9ae313530 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -6410,6 +6410,9 @@ guess_cfa_pc: } if (!use_cm) FORCC pre_mul[c] /= cc[cm_D65][c][c]; + + RT_from_adobe_dng_converter = !strncmp(software, "Adobe DNG Converter", 19); + return 0; } @@ -9690,14 +9693,16 @@ bw: colors = 1; } dng_skip: if ((use_camera_matrix & (use_camera_wb || dng_version)) - && cmatrix[0][0] > 0.125) { + && cmatrix[0][0] > 0.125 + && !RT_from_adobe_dng_converter /* RT -- do not use the embedded + * matrices for DNGs coming from the + * Adobe DNG Converter, to ensure + * consistency of WB values between + * DNG-converted and original raw + * files. See #4129 */) { memcpy (rgb_cam, cmatrix, sizeof cmatrix); raw_color = 0; - if (dng_version && !use_camera_wb) { // RT - raw_color = 1; - } } - // RT -- TODO: check if these special cases are still needed! if(!strncmp(make, "Panasonic", 9) && !strncmp(model, "DMC-LX100",9)) adobe_coeff (make, model); if(!strncmp(make, "Samsung", 7) && !strncmp(model, "GX20",4)) diff --git a/rtengine/dcraw.h b/rtengine/dcraw.h index cc1f36484..0a10f9732 100644 --- a/rtengine/dcraw.h +++ b/rtengine/dcraw.h @@ -58,6 +58,7 @@ public: ,RT_whitelevel_from_constant(0) ,RT_blacklevel_from_constant(0) ,RT_matrix_from_constant(0) + ,RT_from_adobe_dng_converter(false) ,getbithuff(this,ifp,zero_after_ff) { memset(&hbd, 0, sizeof(hbd)); @@ -151,6 +152,7 @@ protected: int RT_whitelevel_from_constant; int RT_blacklevel_from_constant; int RT_matrix_from_constant; + bool RT_from_adobe_dng_converter; float cam_mul[4], pre_mul[4], cmatrix[3][4], rgb_cam[3][4]; diff --git a/rtengine/demosaic_algos.cc b/rtengine/demosaic_algos.cc index 88d369969..16c0204dd 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -65,7 +65,7 @@ extern const Settings* settings; void RawImageSource::eahd_demosaic () { if (plistener) { - plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::eahd])); + plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::EAHD))); plistener->setProgress (0.0); } @@ -494,7 +494,7 @@ void RawImageSource::hphd_green (float** hpmap) void RawImageSource::hphd_demosaic () { if (plistener) { - plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::hphd])); + plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::HPHD))); plistener->setProgress (0.0); } @@ -595,7 +595,7 @@ void RawImageSource::vng4_demosaic () const bool plistenerActive = plistener; if (plistenerActive) { - plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::vng4])); + plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::VNG4))); plistener->setProgress (progress); } @@ -893,7 +893,7 @@ void RawImageSource::ppg_demosaic() if (plistener) { // looks like ppg isn't supported anymore - //plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::ppg])); + //plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::ppg))); plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), "xxx")); plistener->setProgress (0.0); } @@ -1201,7 +1201,7 @@ void RawImageSource::jdl_interpolate_omp() // from "Lassus" if (plistener) { // this function seems to be unused - //plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::jdl])); + //plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::jdl))); plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), "xxx")); plistener->setProgress (0.0); } @@ -1397,7 +1397,7 @@ SSEFUNCTION void RawImageSource::lmmse_interpolate_omp(int winw, int winh, array } if (plistener) { - plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::lmmse])); + plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::LMMSE))); plistener->setProgress (0.0); } @@ -1975,7 +1975,7 @@ SSEFUNCTION void RawImageSource::igv_interpolate(int winw, int winh) border_interpolate2(winw, winh, 7); if (plistener) { - plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::igv])); + plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::IGV))); plistener->setProgress (0.0); } @@ -2029,7 +2029,8 @@ SSEFUNCTION void RawImageSource::igv_interpolate(int winw, int winh) for (; col < width; col++, indx += 2) { dest1[indx >> 1] = CLIP(rawData[row][col]); //rawData = RT datas col++; - dest2[indx >> 1] = CLIP(rawData[row][col]); //rawData = RT datas + if(col < width) + dest2[indx >> 1] = CLIP(rawData[row][col]); //rawData = RT datas } } @@ -2364,7 +2365,7 @@ void RawImageSource::igv_interpolate(int winw, int winh) border_interpolate2(winw, winh, 7); if (plistener) { - plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::igv])); + plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::IGV))); plistener->setProgress (0.0); } @@ -2639,7 +2640,7 @@ void RawImageSource::ahd_demosaic() const float d65_white[3] = { 0.950456, 1, 1.088754 }; if (plistener) { - plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::ahd])); + plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AHD))); plistener->setProgress (0.0); } @@ -3702,7 +3703,7 @@ BENCHFUN double currentProgress = 0.0; if(plistener) { - plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::dcb])); + plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::DCB))); plistener->setProgress (currentProgress); } @@ -3927,6 +3928,299 @@ void RawImageSource::cielab (const float (*rgb)[3], float* l, float* a, float *b } } + +/** +* RATIO CORRECTED DEMOSAICING +* Luis Sanz Rodriguez (luis.sanz.rodriguez(at)gmail(dot)com) +* +* Release 2.3 @ 171125 +* +* Original code from https://github.com/LuisSR/RCD-Demosaicing +* Licensed under the GNU GPL version 3 +*/ +void RawImageSource::rcd_demosaic() +{ + // RT --------------------------------------------------------------------- + if (plistener) { + plistener->setProgressStr(Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), "rcd")); + plistener->setProgress(0); + } + + int width = W, height = H; + + std::vector cfa(width * height); + std::vector> rgb(width * height); + +#ifdef _OPENMP + #pragma omp parallel for +#endif + for (int row = 0; row < height; row++) { + for (int col = 0, indx = row * width + col; col < width; col++, indx++) { + int c = FC(row, col); + cfa[indx] = rgb[indx][c] = LIM01(rawData[row][col] / 65535.f); + } + } + + if (plistener) { + plistener->setProgress(0.05); + } + // ------------------------------------------------------------------------ +/* RT + int row, col, indx, c; +*/ + int w1 = width, w2 = 2 * width, w3 = 3 * width, w4 = 4 * width; + + //Tolerance to avoid dividing by zero + static const float eps = 1e-5, epssq = 1e-10; + +/* RT + //Gradients + float N_Grad, E_Grad, W_Grad, S_Grad, NW_Grad, NE_Grad, SW_Grad, SE_Grad; + + //Pixel estimation + float N_Est, E_Est, W_Est, S_Est, NW_Est, NE_Est, SW_Est, SE_Est, V_Est, H_Est, P_Est, Q_Est; + + //Directional discrimination + //float V_Stat, H_Stat, P_Stat, Q_Stat; + float VH_Central_Value, VH_Neighbour_Value, PQ_Central_Value, PQ_Neighbour_Value; +*/ + float ( *VH_Dir ), ( *PQ_Dir ); + + //Low pass filter + float ( *lpf ); + + + /** + * STEP 1: Find cardinal and diagonal interpolation directions + */ + + VH_Dir = ( float ( * ) ) calloc( width * height, sizeof *VH_Dir ); //merror ( VH_Dir, "rcd_demosaicing_171117()" ); + +#ifdef _OPENMP + #pragma omp parallel for +#endif + for (int row = 4; row < height - 4; row++ ) { + for (int col = 4, indx = row * width + col; col < width - 4; col++, indx++ ) { + //Calculate h/v local discrimination + float V_Stat = max(epssq, - 18.0f * cfa[indx] * cfa[indx - w1] - 18.0f * cfa[indx] * cfa[indx + w1] - 36.0f * cfa[indx] * cfa[indx - w2] - 36.0f * cfa[indx] * cfa[indx + w2] + 18.0f * cfa[indx] * cfa[indx - w3] + 18.0f * cfa[indx] * cfa[indx + w3] - 2.0f * cfa[indx] * cfa[indx - w4] - 2.0f * cfa[indx] * cfa[indx + w4] + 38.0f * cfa[indx] * cfa[indx] - 70.0f * cfa[indx - w1] * cfa[indx + w1] - 12.0f * cfa[indx - w1] * cfa[indx - w2] + 24.0f * cfa[indx - w1] * cfa[indx + w2] - 38.0f * cfa[indx - w1] * cfa[indx - w3] + 16.0f * cfa[indx - w1] * cfa[indx + w3] + 12.0f * cfa[indx - w1] * cfa[indx - w4] - 6.0f * cfa[indx - w1] * cfa[indx + w4] + 46.0f * cfa[indx - w1] * cfa[indx - w1] + 24.0f * cfa[indx + w1] * cfa[indx - w2] - 12.0f * cfa[indx + w1] * cfa[indx + w2] + 16.0f * cfa[indx + w1] * cfa[indx - w3] - 38.0f * cfa[indx + w1] * cfa[indx + w3] - 6.0f * cfa[indx + w1] * cfa[indx - w4] + 12.0f * cfa[indx + w1] * cfa[indx + w4] + 46.0f * cfa[indx + w1] * cfa[indx + w1] + 14.0f * cfa[indx - w2] * cfa[indx + w2] - 12.0f * cfa[indx - w2] * cfa[indx + w3] - 2.0f * cfa[indx - w2] * cfa[indx - w4] + 2.0f * cfa[indx - w2] * cfa[indx + w4] + 11.0f * cfa[indx - w2] * cfa[indx - w2] - 12.0f * cfa[indx + w2] * cfa[indx - w3] + 2.0f * cfa[indx + w2] * cfa[indx - w4] - 2.0f * cfa[indx + w2] * cfa[indx + w4] + 11.0f * cfa[indx + w2] * cfa[indx + w2] + 2.0f * cfa[indx - w3] * cfa[indx + w3] - 6.0f * cfa[indx - w3] * cfa[indx - w4] + 10.0f * cfa[indx - w3] * cfa[indx - w3] - 6.0f * cfa[indx + w3] * cfa[indx + w4] + 10.0f * cfa[indx + w3] * cfa[indx + w3] + 1.0f * cfa[indx - w4] * cfa[indx - w4] + 1.0f * cfa[indx + w4] * cfa[indx + w4]); + + float H_Stat = max(epssq, - 18.0f * cfa[indx] * cfa[indx - 1] - 18.0f * cfa[indx] * cfa[indx + 1] - 36.0f * cfa[indx] * cfa[indx - 2] - 36.0f * cfa[indx] * cfa[indx + 2] + 18.0f * cfa[indx] * cfa[indx - 3] + 18.0f * cfa[indx] * cfa[indx + 3] - 2.0f * cfa[indx] * cfa[indx - 4] - 2.0f * cfa[indx] * cfa[indx + 4] + 38.0f * cfa[indx] * cfa[indx] - 70.0f * cfa[indx - 1] * cfa[indx + 1] - 12.0f * cfa[indx - 1] * cfa[indx - 2] + 24.0f * cfa[indx - 1] * cfa[indx + 2] - 38.0f * cfa[indx - 1] * cfa[indx - 3] + 16.0f * cfa[indx - 1] * cfa[indx + 3] + 12.0f * cfa[indx - 1] * cfa[indx - 4] - 6.0f * cfa[indx - 1] * cfa[indx + 4] + 46.0f * cfa[indx - 1] * cfa[indx - 1] + 24.0f * cfa[indx + 1] * cfa[indx - 2] - 12.0f * cfa[indx + 1] * cfa[indx + 2] + 16.0f * cfa[indx + 1] * cfa[indx - 3] - 38.0f * cfa[indx + 1] * cfa[indx + 3] - 6.0f * cfa[indx + 1] * cfa[indx - 4] + 12.0f * cfa[indx + 1] * cfa[indx + 4] + 46.0f * cfa[indx + 1] * cfa[indx + 1] + 14.0f * cfa[indx - 2] * cfa[indx + 2] - 12.0f * cfa[indx - 2] * cfa[indx + 3] - 2.0f * cfa[indx - 2] * cfa[indx - 4] + 2.0f * cfa[indx - 2] * cfa[indx + 4] + 11.0f * cfa[indx - 2] * cfa[indx - 2] - 12.0f * cfa[indx + 2] * cfa[indx - 3] + 2.0f * cfa[indx + 2] * cfa[indx - 4] - 2.0f * cfa[indx + 2] * cfa[indx + 4] + 11.0f * cfa[indx + 2] * cfa[indx + 2] + 2.0f * cfa[indx - 3] * cfa[indx + 3] - 6.0f * cfa[indx - 3] * cfa[indx - 4] + 10.0f * cfa[indx - 3] * cfa[indx - 3] - 6.0f * cfa[indx + 3] * cfa[indx + 4] + 10.0f * cfa[indx + 3] * cfa[indx + 3] + 1.0f * cfa[indx - 4] * cfa[indx - 4] + 1.0f * cfa[indx + 4] * cfa[indx + 4]); + + VH_Dir[indx] = V_Stat / (V_Stat + H_Stat); + } + } + + // RT --------------------------------------------------------------------- + if (plistener) { + plistener->setProgress(0.2); + } + // ------------------------------------------------------------------------- + + /** + * STEP 2: Calculate the low pass filter + */ + + // Step 2.1: Low pass filter incorporating green, red and blue local samples from the raw data + lpf = ( float ( * ) ) calloc( width * height, sizeof *lpf ); //merror ( lpf, "rcd_demosaicing_171125()" ); + +#ifdef _OPENMP + #pragma omp parallel for +#endif + for ( int row = 2; row < height - 2; row++ ) { + for ( int col = 2 + (FC( row, 0 ) & 1), indx = row * width + col; col < width - 2; col += 2, indx += 2 ) { + + lpf[indx] = 0.25f * cfa[indx] + 0.125f * ( cfa[indx - w1] + cfa[indx + w1] + cfa[indx - 1] + cfa[indx + 1] ) + 0.0625f * ( cfa[indx - w1 - 1] + cfa[indx - w1 + 1] + cfa[indx + w1 - 1] + cfa[indx + w1 + 1] ); + + } + } + + // RT --------------------------------------------------------------------- + if (plistener) { + plistener->setProgress(0.4); + } + // ------------------------------------------------------------------------ + + /** + * STEP 3: Populate the green channel + */ + + // Step 3.1: Populate the green channel at blue and red CFA positions +#ifdef _OPENMP + #pragma omp parallel for +#endif + for ( int row = 4; row < height - 4; row++ ) { + for ( int col = 4 + (FC( row, 0 ) & 1), indx = row * width + col; col < width - 4; col += 2, indx += 2 ) { + + // Refined vertical and horizontal local discrimination + float VH_Central_Value = VH_Dir[indx]; + float VH_Neighbourhood_Value = 0.25f * ( VH_Dir[indx - w1 - 1] + VH_Dir[indx - w1 + 1] + VH_Dir[indx + w1 - 1] + VH_Dir[indx + w1 + 1] ); + + float VH_Disc = ( fabs( 0.5f - VH_Central_Value ) < fabs( 0.5f - VH_Neighbourhood_Value ) ) ? VH_Neighbourhood_Value : VH_Central_Value; + + // Cardinal gradients + float N_Grad = eps + fabs( cfa[indx - w1] - cfa[indx + w1] ) + fabs( cfa[indx] - cfa[indx - w2] ) + fabs( cfa[indx - w1] - cfa[indx - w3] ) + fabs( cfa[indx - w2] - cfa[indx - w4] ); + float S_Grad = eps + fabs( cfa[indx + w1] - cfa[indx - w1] ) + fabs( cfa[indx] - cfa[indx + w2] ) + fabs( cfa[indx + w1] - cfa[indx + w3] ) + fabs( cfa[indx + w2] - cfa[indx + w4] ); + float W_Grad = eps + fabs( cfa[indx - 1] - cfa[indx + 1] ) + fabs( cfa[indx] - cfa[indx - 2] ) + fabs( cfa[indx - 1] - cfa[indx - 3] ) + fabs( cfa[indx - 2] - cfa[indx - 4] ); + float E_Grad = eps + fabs( cfa[indx + 1] - cfa[indx - 1] ) + fabs( cfa[indx] - cfa[indx + 2] ) + fabs( cfa[indx + 1] - cfa[indx + 3] ) + fabs( cfa[indx + 2] - cfa[indx + 4] ); + + // Cardinal pixel estimations + float N_Est = cfa[indx - w1] * ( 1.f + ( lpf[indx] - lpf[indx - w2] ) / ( eps + lpf[indx] + lpf[indx - w2] ) ); + float S_Est = cfa[indx + w1] * ( 1.f + ( lpf[indx] - lpf[indx + w2] ) / ( eps + lpf[indx] + lpf[indx + w2] ) ); + float W_Est = cfa[indx - 1] * ( 1.f + ( lpf[indx] - lpf[indx - 2] ) / ( eps + lpf[indx] + lpf[indx - 2] ) ); + float E_Est = cfa[indx + 1] * ( 1.f + ( lpf[indx] - lpf[indx + 2] ) / ( eps + lpf[indx] + lpf[indx + 2] ) ); + + // Vertical and horizontal estimations + float V_Est = ( S_Grad * N_Est + N_Grad * S_Est ) / max(eps, N_Grad + S_Grad ); + float H_Est = ( W_Grad * E_Est + E_Grad * W_Est ) / max(eps, E_Grad + W_Grad ); + + // G@B and G@R interpolation + rgb[indx][1] = LIM( VH_Disc * H_Est + ( 1.f - VH_Disc ) * V_Est, 0.f, 1.f ); + + } + } + + free( lpf ); + + // RT --------------------------------------------------------------------- + if (plistener) { + plistener->setProgress(0.5); + } + // ------------------------------------------------------------------------ + + /** + * STEP 4: Populate the red and blue channels + */ + + // Step 4.1: Calculate P/Q diagonal local discrimination + PQ_Dir = ( float ( * ) ) calloc( width * height, sizeof *PQ_Dir ); //merror ( PQ_Dir, "rcd_demosaicing_171125()" ); + +#ifdef _OPENMP + #pragma omp parallel for +#endif + for ( int row = 4; row < height - 4; row++ ) { + for ( int col = 4 + (FC( row, 0 ) & 1), indx = row * width + col; col < width - 4; col += 2, indx += 2 ) { + + float P_Stat = max( - 18.f * cfa[indx] * cfa[indx - w1 - 1] - 18.f * cfa[indx] * cfa[indx + w1 + 1] - 36.f * cfa[indx] * cfa[indx - w2 - 2] - 36.f * cfa[indx] * cfa[indx + w2 + 2] + 18.f * cfa[indx] * cfa[indx - w3 - 3] + 18.f * cfa[indx] * cfa[indx + w3 + 3] - 2.f * cfa[indx] * cfa[indx - w4 - 4] - 2.f * cfa[indx] * cfa[indx + w4 + 4] + 38.f * cfa[indx] * cfa[indx] - 70.f * cfa[indx - w1 - 1] * cfa[indx + w1 + 1] - 12.f * cfa[indx - w1 - 1] * cfa[indx - w2 - 2] + 24.f * cfa[indx - w1 - 1] * cfa[indx + w2 + 2] - 38.f * cfa[indx - w1 - 1] * cfa[indx - w3 - 3] + 16.f * cfa[indx - w1 - 1] * cfa[indx + w3 + 3] + 12.f * cfa[indx - w1 - 1] * cfa[indx - w4 - 4] - 6.f * cfa[indx - w1 - 1] * cfa[indx + w4 + 4] + 46.f * cfa[indx - w1 - 1] * cfa[indx - w1 - 1] + 24.f * cfa[indx + w1 + 1] * cfa[indx - w2 - 2] - 12.f * cfa[indx + w1 + 1] * cfa[indx + w2 + 2] + 16.f * cfa[indx + w1 + 1] * cfa[indx - w3 - 3] - 38.f * cfa[indx + w1 + 1] * cfa[indx + w3 + 3] - 6.f * cfa[indx + w1 + 1] * cfa[indx - w4 - 4] + 12.f * cfa[indx + w1 + 1] * cfa[indx + w4 + 4] + 46.f * cfa[indx + w1 + 1] * cfa[indx + w1 + 1] + 14.f * cfa[indx - w2 - 2] * cfa[indx + w2 + 2] - 12.f * cfa[indx - w2 - 2] * cfa[indx + w3 + 3] - 2.f * cfa[indx - w2 - 2] * cfa[indx - w4 - 4] + 2.f * cfa[indx - w2 - 2] * cfa[indx + w4 + 4] + 11.f * cfa[indx - w2 - 2] * cfa[indx - w2 - 2] - 12.f * cfa[indx + w2 + 2] * cfa[indx - w3 - 3] + 2 * cfa[indx + w2 + 2] * cfa[indx - w4 - 4] - 2.f * cfa[indx + w2 + 2] * cfa[indx + w4 + 4] + 11.f * cfa[indx + w2 + 2] * cfa[indx + w2 + 2] + 2.f * cfa[indx - w3 - 3] * cfa[indx + w3 + 3] - 6.f * cfa[indx - w3 - 3] * cfa[indx - w4 - 4] + 10.f * cfa[indx - w3 - 3] * cfa[indx - w3 - 3] - 6.f * cfa[indx + w3 + 3] * cfa[indx + w4 + 4] + 10.f * cfa[indx + w3 + 3] * cfa[indx + w3 + 3] + 1.f * cfa[indx - w4 - 4] * cfa[indx - w4 - 4] + 1.f * cfa[indx + w4 + 4] * cfa[indx + w4 + 4], epssq ); + float Q_Stat = max( - 18.f * cfa[indx] * cfa[indx + w1 - 1] - 18.f * cfa[indx] * cfa[indx - w1 + 1] - 36.f * cfa[indx] * cfa[indx + w2 - 2] - 36.f * cfa[indx] * cfa[indx - w2 + 2] + 18.f * cfa[indx] * cfa[indx + w3 - 3] + 18.f * cfa[indx] * cfa[indx - w3 + 3] - 2.f * cfa[indx] * cfa[indx + w4 - 4] - 2.f * cfa[indx] * cfa[indx - w4 + 4] + 38.f * cfa[indx] * cfa[indx] - 70.f * cfa[indx + w1 - 1] * cfa[indx - w1 + 1] - 12.f * cfa[indx + w1 - 1] * cfa[indx + w2 - 2] + 24.f * cfa[indx + w1 - 1] * cfa[indx - w2 + 2] - 38.f * cfa[indx + w1 - 1] * cfa[indx + w3 - 3] + 16.f * cfa[indx + w1 - 1] * cfa[indx - w3 + 3] + 12.f * cfa[indx + w1 - 1] * cfa[indx + w4 - 4] - 6.f * cfa[indx + w1 - 1] * cfa[indx - w4 + 4] + 46.f * cfa[indx + w1 - 1] * cfa[indx + w1 - 1] + 24.f * cfa[indx - w1 + 1] * cfa[indx + w2 - 2] - 12.f * cfa[indx - w1 + 1] * cfa[indx - w2 + 2] + 16.f * cfa[indx - w1 + 1] * cfa[indx + w3 - 3] - 38.f * cfa[indx - w1 + 1] * cfa[indx - w3 + 3] - 6.f * cfa[indx - w1 + 1] * cfa[indx + w4 - 4] + 12.f * cfa[indx - w1 + 1] * cfa[indx - w4 + 4] + 46.f * cfa[indx - w1 + 1] * cfa[indx - w1 + 1] + 14.f * cfa[indx + w2 - 2] * cfa[indx - w2 + 2] - 12.f * cfa[indx + w2 - 2] * cfa[indx - w3 + 3] - 2.f * cfa[indx + w2 - 2] * cfa[indx + w4 - 4] + 2.f * cfa[indx + w2 - 2] * cfa[indx - w4 + 4] + 11.f * cfa[indx + w2 - 2] * cfa[indx + w2 - 2] - 12.f * cfa[indx - w2 + 2] * cfa[indx + w3 - 3] + 2 * cfa[indx - w2 + 2] * cfa[indx + w4 - 4] - 2.f * cfa[indx - w2 + 2] * cfa[indx - w4 + 4] + 11.f * cfa[indx - w2 + 2] * cfa[indx - w2 + 2] + 2.f * cfa[indx + w3 - 3] * cfa[indx - w3 + 3] - 6.f * cfa[indx + w3 - 3] * cfa[indx + w4 - 4] + 10.f * cfa[indx + w3 - 3] * cfa[indx + w3 - 3] - 6.f * cfa[indx - w3 + 3] * cfa[indx - w4 + 4] + 10.f * cfa[indx - w3 + 3] * cfa[indx - w3 + 3] + 1.f * cfa[indx + w4 - 4] * cfa[indx + w4 - 4] + 1.f * cfa[indx - w4 + 4] * cfa[indx - w4 + 4], epssq ); + + PQ_Dir[indx] = P_Stat / ( P_Stat + Q_Stat ); + + } + } + + // RT --------------------------------------------------------------------- + if (plistener) { + plistener->setProgress(0.7); + } + // ------------------------------------------------------------------------- + + // Step 4.2: Populate the red and blue channels at blue and red CFA positions +#ifdef _OPENMP + #pragma omp parallel for +#endif + for ( int row = 4; row < height - 4; row++ ) { + for ( int col = 4 + (FC( row, 0 ) & 1), indx = row * width + col, c = 2 - FC( row, col ); col < width - 4; col += 2, indx += 2 ) { + + // Refined P/Q diagonal local discrimination + float PQ_Central_Value = PQ_Dir[indx]; + float PQ_Neighbourhood_Value = 0.25f * ( PQ_Dir[indx - w1 - 1] + PQ_Dir[indx - w1 + 1] + PQ_Dir[indx + w1 - 1] + PQ_Dir[indx + w1 + 1] ); + + float PQ_Disc = ( fabs( 0.5f - PQ_Central_Value ) < fabs( 0.5f - PQ_Neighbourhood_Value ) ) ? PQ_Neighbourhood_Value : PQ_Central_Value; + + // Diagonal gradients + float NW_Grad = eps + fabs( rgb[indx - w1 - 1][c] - rgb[indx + w1 + 1][c] ) + fabs( rgb[indx - w1 - 1][c] - rgb[indx - w3 - 3][c] ) + fabs( rgb[indx][1] - rgb[indx - w2 - 2][1] ); + float NE_Grad = eps + fabs( rgb[indx - w1 + 1][c] - rgb[indx + w1 - 1][c] ) + fabs( rgb[indx - w1 + 1][c] - rgb[indx - w3 + 3][c] ) + fabs( rgb[indx][1] - rgb[indx - w2 + 2][1] ); + float SW_Grad = eps + fabs( rgb[indx + w1 - 1][c] - rgb[indx - w1 + 1][c] ) + fabs( rgb[indx + w1 - 1][c] - rgb[indx + w3 - 3][c] ) + fabs( rgb[indx][1] - rgb[indx + w2 - 2][1] ); + float SE_Grad = eps + fabs( rgb[indx + w1 + 1][c] - rgb[indx - w1 - 1][c] ) + fabs( rgb[indx + w1 + 1][c] - rgb[indx + w3 + 3][c] ) + fabs( rgb[indx][1] - rgb[indx + w2 + 2][1] ); + + // Diagonal colour differences + float NW_Est = rgb[indx - w1 - 1][c] - rgb[indx - w1 - 1][1]; + float NE_Est = rgb[indx - w1 + 1][c] - rgb[indx - w1 + 1][1]; + float SW_Est = rgb[indx + w1 - 1][c] - rgb[indx + w1 - 1][1]; + float SE_Est = rgb[indx + w1 + 1][c] - rgb[indx + w1 + 1][1]; + + // P/Q estimations + float P_Est = ( NW_Grad * SE_Est + SE_Grad * NW_Est ) / max(eps, NW_Grad + SE_Grad ); + float Q_Est = ( NE_Grad * SW_Est + SW_Grad * NE_Est ) / max(eps, NE_Grad + SW_Grad ); + + // R@B and B@R interpolation + rgb[indx][c] = LIM( rgb[indx][1] + ( 1.f - PQ_Disc ) * P_Est + PQ_Disc * Q_Est, 0.f, 1.f ); + + } + } + + free( PQ_Dir ); + + // RT --------------------------------------------------------------------- + if (plistener) { + plistener->setProgress(0.825); + } + // ------------------------------------------------------------------------- + + // Step 4.3: Populate the red and blue channels at green CFA positions +#ifdef _OPENMP + #pragma omp parallel for +#endif + for ( int row = 4; row < height - 4; row++ ) { + for ( int col = 4 + (FC( row, 1 ) & 1), indx = row * width + col; col < width - 4; col += 2, indx += 2 ) { + + // Refined vertical and horizontal local discrimination + float VH_Central_Value = VH_Dir[indx]; + float VH_Neighbourhood_Value = 0.25f * ( VH_Dir[indx - w1 - 1] + VH_Dir[indx - w1 + 1] + VH_Dir[indx + w1 - 1] + VH_Dir[indx + w1 + 1] ); + + float VH_Disc = ( fabs( 0.5f - VH_Central_Value ) < fabs( 0.5f - VH_Neighbourhood_Value ) ) ? VH_Neighbourhood_Value : VH_Central_Value; + + for ( int c = 0; c <= 2; c += 2 ) { + + // Cardinal gradients + float N_Grad = eps + fabs( rgb[indx][1] - rgb[indx - w2][1] ) + fabs( rgb[indx - w1][c] - rgb[indx + w1][c] ) + fabs( rgb[indx - w1][c] - rgb[indx - w3][c] ); + float S_Grad = eps + fabs( rgb[indx][1] - rgb[indx + w2][1] ) + fabs( rgb[indx + w1][c] - rgb[indx - w1][c] ) + fabs( rgb[indx + w1][c] - rgb[indx + w3][c] ); + float W_Grad = eps + fabs( rgb[indx][1] - rgb[indx - 2][1] ) + fabs( rgb[indx - 1][c] - rgb[indx + 1][c] ) + fabs( rgb[indx - 1][c] - rgb[indx - 3][c] ); + float E_Grad = eps + fabs( rgb[indx][1] - rgb[indx + 2][1] ) + fabs( rgb[indx + 1][c] - rgb[indx - 1][c] ) + fabs( rgb[indx + 1][c] - rgb[indx + 3][c] ); + + // Cardinal colour differences + float N_Est = rgb[indx - w1][c] - rgb[indx - w1][1]; + float S_Est = rgb[indx + w1][c] - rgb[indx + w1][1]; + float W_Est = rgb[indx - 1][c] - rgb[indx - 1][1]; + float E_Est = rgb[indx + 1][c] - rgb[indx + 1][1]; + + // Vertical and horizontal estimations + float V_Est = ( N_Grad * S_Est + S_Grad * N_Est ) / max(eps, N_Grad + S_Grad ); + float H_Est = ( E_Grad * W_Est + W_Grad * E_Est ) / max(eps, E_Grad + W_Grad ); + + // R@G and B@G interpolation + rgb[indx][c] = LIM( rgb[indx][1] + ( 1.f - VH_Disc ) * V_Est + VH_Disc * H_Est, 0.f, 1.f ); + + } + } + } + + free(VH_Dir); + + // RT --------------------------------------------------------------------- + if (plistener) { + plistener->setProgress(0.95); + } + +#ifdef _OPENMP + #pragma omp parallel for +#endif + for (int row = 0; row < height; ++row) { + for (int col = 0, idx = row * width + col ; col < width; ++col, ++idx) { + red[row][col] = CLIP(rgb[idx][0] * 65535.f); + green[row][col] = CLIP(rgb[idx][1] * 65535.f); + blue[row][col] = CLIP(rgb[idx][2] * 65535.f); + } + } + + border_interpolate2(width, height, 8); + + if (plistener) { + plistener->setProgress(1); + } + // ------------------------------------------------------------------------- +} + #define fcol(row,col) xtrans[(row)%6][(col)%6] #define isgreen(row,col) (xtrans[(row)%3][(col)%3]&1) diff --git a/rtengine/fast_demo.cc b/rtengine/fast_demo.cc index 6143d172e..8d02bafb2 100644 --- a/rtengine/fast_demo.cc +++ b/rtengine/fast_demo.cc @@ -62,7 +62,7 @@ SSEFUNCTION void RawImageSource::fast_demosaic() //int winw=W, winh=H; if (plistener) { - plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::fast])); + plistener->setProgressStr (Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST))); plistener->setProgress (progress); } diff --git a/rtengine/iccstore.h b/rtengine/iccstore.h index 48efae087..bdb15d2c0 100644 --- a/rtengine/iccstore.h +++ b/rtengine/iccstore.h @@ -34,7 +34,7 @@ namespace rtengine namespace procparams { - class ColorManagementParams; + struct ColorManagementParams; } diff --git a/rtengine/image16.cc b/rtengine/image16.cc index 1bd0680d0..1c023d181 100644 --- a/rtengine/image16.cc +++ b/rtengine/image16.cc @@ -137,17 +137,22 @@ void Image16::getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, Preview { // compute channel multipliers - double drm, dgm, dbm; - ctemp.getMultipliers (drm, dgm, dbm); - float rm = drm, gm = dgm, bm = dbm; + float rm = 1.f, gm = 1.f, bm = 1.f; + if (ctemp.getTemp() >= 0) { + double drm, dgm, dbm; + ctemp.getMultipliers (drm, dgm, dbm); + rm = drm; + gm = dgm; + bm = dbm; - rm = 1.0 / rm; - gm = 1.0 / gm; - bm = 1.0 / bm; - float mul_lum = 0.299 * rm + 0.587 * gm + 0.114 * bm; - rm /= mul_lum; - gm /= mul_lum; - bm /= mul_lum; + rm = 1.0 / rm; + gm = 1.0 / gm; + bm = 1.0 / bm; + float mul_lum = 0.299 * rm + 0.587 * gm + 0.114 * bm; + rm /= mul_lum; + gm /= mul_lum; + bm /= mul_lum; + } int sx1, sy1, sx2, sy2; diff --git a/rtengine/image8.cc b/rtengine/image8.cc index 56c2a63ee..86294236b 100644 --- a/rtengine/image8.cc +++ b/rtengine/image8.cc @@ -97,17 +97,22 @@ Image8* Image8::copy () void Image8::getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp) { // compute channel multipliers - double drm, dgm, dbm; - ctemp.getMultipliers (drm, dgm, dbm); - float rm = drm, gm = dgm, bm = dbm; + float rm = 1.f, gm = 1.f, bm = 1.f; + if (ctemp.getTemp() >= 0) { + double drm, dgm, dbm; + ctemp.getMultipliers (drm, dgm, dbm); + rm = drm; + gm = dgm; + bm = dbm; - rm = 1.0 / rm; - gm = 1.0 / gm; - bm = 1.0 / bm; - float mul_lum = 0.299 * rm + 0.587 * gm + 0.114 * bm; - rm /= mul_lum; - gm /= mul_lum; - bm /= mul_lum; + rm = 1.0 / rm; + gm = 1.0 / gm; + bm = 1.0 / bm; + float mul_lum = 0.299 * rm + 0.587 * gm + 0.114 * bm; + rm /= mul_lum; + gm /= mul_lum; + bm /= mul_lum; + } int sx1, sy1, sx2, sy2; diff --git a/rtengine/imagefloat.cc b/rtengine/imagefloat.cc index 41b10552a..bfeb85534 100644 --- a/rtengine/imagefloat.cc +++ b/rtengine/imagefloat.cc @@ -189,17 +189,22 @@ void Imagefloat::getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, Prev { // compute channel multipliers - double drm, dgm, dbm; - ctemp.getMultipliers (drm, dgm, dbm); - float rm = drm, gm = dgm, bm = dbm; + float rm = 1.f, gm = 1.f, bm = 1.f; + if (ctemp.getTemp() >= 0) { + double drm, dgm, dbm; + ctemp.getMultipliers (drm, dgm, dbm); + rm = drm; + gm = dgm; + bm = dbm; - rm = 1.0 / rm; - gm = 1.0 / gm; - bm = 1.0 / bm; - float mul_lum = 0.299 * rm + 0.587 * gm + 0.114 * bm; - rm /= mul_lum; - gm /= mul_lum; - bm /= mul_lum; + rm = 1.0 / rm; + gm = 1.0 / gm; + bm = 1.0 / bm; + float mul_lum = 0.299 * rm + 0.587 * gm + 0.114 * bm; + rm /= mul_lum; + gm /= mul_lum; + bm /= mul_lum; + } int sx1, sy1, sx2, sy2; diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 976676fc3..924e68400 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -171,14 +171,14 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) if ( !highDetailNeeded ) { // if below 100% magnification, take a fast path - if (rp.bayersensor.method != RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::none] && rp.bayersensor.method != RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::mono]) { - rp.bayersensor.method = RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::fast]; + if (rp.bayersensor.method != RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::NONE) && rp.bayersensor.method != RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::NONE)) { + rp.bayersensor.method = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST); } //bayerrp.all_enhance = false; - if (rp.xtranssensor.method != RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::none] && rp.xtranssensor.method != RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::mono]) { - rp.xtranssensor.method = RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::fast]; + if (rp.xtranssensor.method != RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::NONE) && rp.xtranssensor.method != RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::NONE)) { + rp.xtranssensor.method = RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FAST); } rp.bayersensor.ccSteps = 0; @@ -296,7 +296,9 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) currWB = ColorTemp (params.wb.temperature, params.wb.green, params.wb.equal, params.wb.method); - if (params.wb.method == "Camera") { + if (!params.wb.enabled) { + currWB = ColorTemp(); + } else if (params.wb.method == "Camera") { currWB = imgsrc->getWB (); } else if (params.wb.method == "Auto") { if (lastAwbEqual != params.wb.equal || lastAwbTempBias != params.wb.tempBias) { @@ -320,10 +322,12 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) currWB = autoWB; } - params.wb.temperature = currWB.getTemp (); - params.wb.green = currWB.getGreen (); + if (params.wb.enabled) { + params.wb.temperature = currWB.getTemp (); + params.wb.green = currWB.getGreen (); + } - if (params.wb.method == "Auto" && awbListener) { + if (params.wb.method == "Auto" && awbListener && params.wb.enabled) { awbListener->WBChanged (params.wb.temperature, params.wb.green); } diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index c22d7b509..5223a7f85 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -438,11 +438,11 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L } // extracting datas from 'params' to avoid cache flush (to be confirmed) - ColorAppearanceParams::eTCModeId curveMode = params->colorappearance.curveMode; - ColorAppearanceParams::eTCModeId curveMode2 = params->colorappearance.curveMode2; + ColorAppearanceParams::TcMode curveMode = params->colorappearance.curveMode; + ColorAppearanceParams::TcMode curveMode2 = params->colorappearance.curveMode2; bool hasColCurve1 = bool (customColCurve1); bool hasColCurve2 = bool (customColCurve2); - ColorAppearanceParams::eCTCModeId curveMode3 = params->colorappearance.curveMode3; + ColorAppearanceParams::CtcMode curveMode3 = params->colorappearance.curveMode3; bool hasColCurve3 = bool (customColCurve3); @@ -801,7 +801,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L } if (hasColCurve1) {//curve 1 with Lightness and Brightness - if (curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { + if (curveMode == ColorAppearanceParams::TcMode::LIGHT) { /* float Jj=(float) Jpro*327.68; float Jold=Jj; const Lightcurve& userColCurve = static_cast(customColCurve1); @@ -839,7 +839,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L } t1L = true; - } else if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + } else if (curveMode == ColorAppearanceParams::TcMode::BRIGHT) { //attention! Brightness curves are open - unlike Lightness or Lab or RGB==> rendering and algoritms will be different float coef = ((aw + 4.f) * (4.f / c)) / 100.f; float Qanc = Qpro; @@ -887,7 +887,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L } if (hasColCurve2) {//curve 2 with Lightness and Brightness - if (curveMode2 == ColorAppearanceParams::TC_MODE_LIGHT) { + if (curveMode2 == ColorAppearanceParams::TcMode::LIGHT) { float Jj = (float) Jpro * 327.68; float Jold = Jj; /* @@ -930,7 +930,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L Jpro = 1.; } - } else if (curveMode2 == ColorAppearanceParams::TC_MODE_BRIGHT) { // + } else if (curveMode2 == ColorAppearanceParams::TcMode::BRIGHT) { // float Qanc = Qpro; float coef = ((aw + 4.f) * (4.f / c)) / 100.f; float Qq = (float) Qpro * 327.68f * (1.f / coef); @@ -988,7 +988,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L } if (hasColCurve3) {//curve 3 with chroma saturation colorfullness - if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { + if (curveMode3 == ColorAppearanceParams::CtcMode::CHROMA) { double parsat = 0.8; //0.68; double coef = 327.68 / parsat; float Cc = (float) Cpro * coef; @@ -1012,7 +1012,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L } // Cpro=Cc/coef; - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { // + } else if (curveMode3 == ColorAppearanceParams::CtcMode::SATUR) { // double parsat = 0.8; //0.6 double coef = 327.68 / parsat; float Ss = (float) spro * coef; @@ -1032,7 +1032,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L Cpro = (spro * spro * Qpro) / (10000.0); c1s = 1; - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { // + } else if (curveMode3 == ColorAppearanceParams::CtcMode::COLORF) { // double parsat = 0.8; //0.68; double coef = 327.68 / parsat; float Mm = (float) Mpro * coef; @@ -1117,21 +1117,21 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L int libr = 0; int colch = 0; - if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + if (curveMode == ColorAppearanceParams::TcMode::BRIGHT) { brli = 70.0; libr = 1; - } else if (curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { + } else if (curveMode == ColorAppearanceParams::TcMode::LIGHT) { brli = 327.; libr = 0; } - if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { + if (curveMode3 == ColorAppearanceParams::CtcMode::CHROMA) { chsacol = 400.;//327.; colch = 0; - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { + } else if (curveMode3 == ColorAppearanceParams::CtcMode::SATUR) { chsacol = 450.0; colch = 1; - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { + } else if (curveMode3 == ColorAppearanceParams::CtcMode::COLORF) { chsacol = 400.;//327.0; colch = 2; } @@ -1302,9 +1302,9 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L // if (params->dirpyrequalizer.algo=="FI") choice=0; // else if(params->dirpyrequalizer.algo=="LA") choice=1; if (rtt == 1) { - float b_l = static_cast (params->dirpyrequalizer.hueskin.value[0]) / 100.0f; - float t_l = static_cast (params->dirpyrequalizer.hueskin.value[1]) / 100.0f; - float t_r = static_cast (params->dirpyrequalizer.hueskin.value[3]) / 100.0f; + float b_l = static_cast (params->dirpyrequalizer.hueskin.getBottomLeft()) / 100.0f; + float t_l = static_cast (params->dirpyrequalizer.hueskin.getTopLeft()) / 100.0f; + float t_r = static_cast (params->dirpyrequalizer.hueskin.getTopRight()) / 100.0f; dirpyr_equalizercam (ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, ncie->h_p, ncie->C_p, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, true, b_l, t_l, t_r, scale); //contrast by detail adapted to CIECAM } } @@ -1378,21 +1378,21 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int pW, int pwb, L int libr = 0; int colch = 0; - if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + if (curveMode == ColorAppearanceParams::TcMode::BRIGHT) { brli = 70.0; libr = 1; - } else if (curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { + } else if (curveMode == ColorAppearanceParams::TcMode::LIGHT) { brli = 327.; libr = 0; } - if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { + if (curveMode3 == ColorAppearanceParams::CtcMode::CHROMA) { chsacol = 400.;//327.; colch = 0; - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { + } else if (curveMode3 == ColorAppearanceParams::CtcMode::SATUR) { chsacol = 450.0; colch = 1; - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { + } else if (curveMode3 == ColorAppearanceParams::CtcMode::COLORF) { chsacol = 400.;//327.0; colch = 2; } @@ -1752,14 +1752,14 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw const float rstprotection = 100. - params->colorappearance.rstprotection; // extracting datas from 'params' to avoid cache flush (to be confirmed) - const ColorAppearanceParams::eTCModeId curveMode = params->colorappearance.curveMode; + const ColorAppearanceParams::TcMode curveMode = params->colorappearance.curveMode; const bool hasColCurve1 = bool (customColCurve1); - const bool t1L = hasColCurve1 && curveMode == ColorAppearanceParams::TC_MODE_LIGHT; + const bool t1L = hasColCurve1 && curveMode == ColorAppearanceParams::TcMode::LIGHT; - const ColorAppearanceParams::eTCModeId curveMode2 = params->colorappearance.curveMode2; + const ColorAppearanceParams::TcMode curveMode2 = params->colorappearance.curveMode2; const bool hasColCurve2 = bool (customColCurve2); - const ColorAppearanceParams::eCTCModeId curveMode3 = params->colorappearance.curveMode3; + const ColorAppearanceParams::CtcMode curveMode3 = params->colorappearance.curveMode3; const bool hasColCurve3 = bool (customColCurve3); bool needJ = (alg == 0 || alg == 1 || alg == 3); @@ -2212,7 +2212,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw } if (hasColCurve1) {//curve 1 with Lightness and Brightness - if (curveMode == ColorAppearanceParams::TC_MODE_LIGHT) { + if (curveMode == ColorAppearanceParams::TcMode::LIGHT) { float Jj = (float) Jpro * 327.68f; float Jold = Jj; float Jold100 = (float) Jpro; @@ -2241,7 +2241,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw if (Jpro < 1.f) { Jpro = 1.f; } - } else if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + } else if (curveMode == ColorAppearanceParams::TcMode::BRIGHT) { //attention! Brightness curves are open - unlike Lightness or Lab or RGB==> rendering and algoritms will be different float coef = ((aw + 4.f) * (4.f / c)) / 100.f; float Qanc = Qpro; @@ -2285,7 +2285,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw } if (hasColCurve2) {//curve 2 with Lightness and Brightness - if (curveMode2 == ColorAppearanceParams::TC_MODE_LIGHT) { + if (curveMode2 == ColorAppearanceParams::TcMode::LIGHT) { float Jj = (float) Jpro * 327.68f; float Jold = Jj; float Jold100 = (float) Jpro; @@ -2323,7 +2323,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw Jpro = 1.f; } - } else if (curveMode2 == ColorAppearanceParams::TC_MODE_BRIGHT) { // + } else if (curveMode2 == ColorAppearanceParams::TcMode::BRIGHT) { // float Qanc = Qpro; float coef = ((aw + 4.f) * (4.f / c)) / 100.f; @@ -2380,7 +2380,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw } if (hasColCurve3) {//curve 3 with chroma saturation colorfullness - if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { + if (curveMode3 == ColorAppearanceParams::CtcMode::CHROMA) { float parsat = 0.8f; //0.68; float coef = 327.68f / parsat; float Cc = (float) Cpro * coef; @@ -2403,7 +2403,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw Cpro = 50.f; } */ - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { // + } else if (curveMode3 == ColorAppearanceParams::CtcMode::SATUR) { // float parsat = 0.8f; //0.6 float coef = 327.68f / parsat; float Ss = (float) spro * coef; @@ -2420,7 +2420,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw Color::skinredfloat (Jpro, hpro, Ss, Sold, dred, protect_red, sk, rstprotection, ko, spro); Qpro = ( 4.0f / c ) * sqrtf ( Jpro / 100.0f ) * ( aw + 4.0f ) ; Cpro = (spro * spro * Qpro) / (10000.0f); - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_COLORF) { // + } else if (curveMode3 == ColorAppearanceParams::CtcMode::COLORF) { // float parsat = 0.8f; //0.68; float coef = 327.68f / parsat; float Mm = (float) Mpro * coef; @@ -2490,10 +2490,10 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw float colch; //update histogram - if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + if (curveMode == ColorAppearanceParams::TcMode::BRIGHT) { brli = 70.0f; libr = Q; //40.0 to 100.0 approximative factor for Q - 327 for J - } else { /*if(curveMode == ColorAppearanceParams::TC_MODE_LIGHT)*/ + } else { /*if(curveMode == ColorAppearanceParams::TCMode::LIGHT)*/ brli = 327.f; libr = J; //327 for J } @@ -2501,13 +2501,13 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw posl = (int) (libr * brli); hist16JCAM[posl]++; - if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { + if (curveMode3 == ColorAppearanceParams::CtcMode::CHROMA) { chsacol = 400.f;//327 colch = C; //450.0 approximative factor for s 320 for M - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { + } else if (curveMode3 == ColorAppearanceParams::CtcMode::SATUR) { chsacol = 450.0f; colch = s; - } else { /*if(curveMode3 == ColorAppearanceParams::TC_MODE_COLORF)*/ + } else { /*if(curveMode3 == ColorAppearanceParams::CTCMode::COLORF)*/ chsacol = 400.0f;//327 colch = M; } @@ -2743,9 +2743,9 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw // else if(params->dirpyrequalizer.algo=="LA") choice=1; if (rtt == 1) { - float b_l = static_cast (params->dirpyrequalizer.hueskin.value[0]) / 100.0f; - float t_l = static_cast (params->dirpyrequalizer.hueskin.value[1]) / 100.0f; - float t_r = static_cast (params->dirpyrequalizer.hueskin.value[3]) / 100.0f; + float b_l = static_cast (params->dirpyrequalizer.hueskin.getBottomLeft()) / 100.0f; + float t_l = static_cast (params->dirpyrequalizer.hueskin.getTopLeft()) / 100.0f; + float t_r = static_cast (params->dirpyrequalizer.hueskin.getTopRight()) / 100.0f; lab->deleteLab(); dirpyr_equalizercam (ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, ncie->h_p, ncie->C_p, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, true, b_l, t_l, t_r, scale); //contrast by detail adapted to CIECAM lab->reallocLab(); @@ -2837,10 +2837,10 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw float libr; float colch; - if (curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { + if (curveMode == ColorAppearanceParams::TcMode::BRIGHT) { brli = 70.0f; libr = ncie->Q_p[i][j]; //40.0 to 100.0 approximative factor for Q - 327 for J - } else { /*if(curveMode == ColorAppearanceParams::TC_MODE_LIGHT)*/ + } else { /*if(curveMode == ColorAppearanceParams::TCMode::LIGHT)*/ brli = 327.f; libr = ncie->J_p[i][j]; //327 for J } @@ -2848,13 +2848,13 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw posl = (int) (libr * brli); hist16JCAM[posl]++; - if (curveMode3 == ColorAppearanceParams::TC_MODE_CHROMA) { + if (curveMode3 == ColorAppearanceParams::CtcMode::CHROMA) { chsacol = 400.f;//327.f; colch = ncie_C_p; - } else if (curveMode3 == ColorAppearanceParams::TC_MODE_SATUR) { + } else if (curveMode3 == ColorAppearanceParams::CtcMode::SATUR) { chsacol = 450.0f; colch = 100.f * sqrtf (ncie_C_p / ncie->Q_p[i][j]); - } else { /*if(curveMode3 == ColorAppearanceParams::TC_MODE_COLORF)*/ + } else { /*if(curveMode3 == ColorAppearanceParams::CTCMode::COLORF)*/ chsacol = 400.f;//327.0f; colch = ncie->M_p[i][j]; } @@ -3146,7 +3146,8 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer {wprof[2][0], wprof[2][1], wprof[2][2]} }; - bool mixchannels = (params->chmixer.red[0] != 100 || params->chmixer.red[1] != 0 || params->chmixer.red[2] != 0 || + bool mixchannels = params->chmixer.enabled && + (params->chmixer.red[0] != 100 || params->chmixer.red[1] != 0 || params->chmixer.red[2] != 0 || params->chmixer.green[0] != 0 || params->chmixer.green[1] != 100 || params->chmixer.green[2] != 0 || params->chmixer.blue[0] != 0 || params->chmixer.blue[1] != 0 || params->chmixer.blue[2] != 100); @@ -3159,9 +3160,9 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer FlatCurveType sCurveType = (FlatCurveType)params->hsvequalizer.scurve.at (0); FlatCurveType vCurveType = (FlatCurveType)params->hsvequalizer.vcurve.at (0); FlatCurveType bwlCurveType = (FlatCurveType)params->blackwhite.luminanceCurve.at (0); - bool hCurveEnabled = hCurveType > FCT_Linear; - bool sCurveEnabled = sCurveType > FCT_Linear; - bool vCurveEnabled = vCurveType > FCT_Linear; + bool hCurveEnabled = params->hsvequalizer.enabled && hCurveType > FCT_Linear; + bool sCurveEnabled = params->hsvequalizer.enabled && sCurveType > FCT_Linear; + bool vCurveEnabled = params->hsvequalizer.enabled && vCurveType > FCT_Linear; bool bwlCurveEnabled = bwlCurveType > FCT_Linear; // TODO: We should create a 'skip' value like for CurveFactory::complexsgnCurve (rtengine/curves.cc) @@ -3250,25 +3251,25 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer const float hlrange = 65536.0 - shoulder; const bool isProPhoto = (params->icm.working == "ProPhoto"); // extracting datas from 'params' to avoid cache flush (to be confirmed) - ToneCurveParams::eTCModeId curveMode = params->toneCurve.curveMode; - ToneCurveParams::eTCModeId curveMode2 = params->toneCurve.curveMode2; + ToneCurveParams::TcMode curveMode = params->toneCurve.curveMode; + ToneCurveParams::TcMode curveMode2 = params->toneCurve.curveMode2; bool highlight = params->toneCurve.hrenabled;//Get the value if "highlight reconstruction" is activated bool hasToneCurve1 = bool (customToneCurve1); bool hasToneCurve2 = bool (customToneCurve2); - BlackWhiteParams::eTCModeId beforeCurveMode = params->blackwhite.beforeCurveMode; - BlackWhiteParams::eTCModeId afterCurveMode = params->blackwhite.afterCurveMode; + BlackWhiteParams::TcMode beforeCurveMode = params->blackwhite.beforeCurveMode; + BlackWhiteParams::TcMode afterCurveMode = params->blackwhite.afterCurveMode; bool hasToneCurvebw1 = bool (customToneCurvebw1); bool hasToneCurvebw2 = bool (customToneCurvebw2); PerceptualToneCurveState ptc1ApplyState, ptc2ApplyState; - if (hasToneCurve1 && curveMode == ToneCurveParams::TC_MODE_PERCEPTUAL) { + if (hasToneCurve1 && curveMode == ToneCurveParams::TcMode::PERCEPTUAL) { const PerceptualToneCurve& userToneCurve = static_cast (customToneCurve1); userToneCurve.initApplyState (ptc1ApplyState, params->icm.working); } - if (hasToneCurve2 && curveMode2 == ToneCurveParams::TC_MODE_PERCEPTUAL) { + if (hasToneCurve2 && curveMode2 == ToneCurveParams::TcMode::PERCEPTUAL) { const PerceptualToneCurve& userToneCurve = static_cast (customToneCurve2); userToneCurve.initApplyState (ptc2ApplyState, params->icm.working); } @@ -3317,8 +3318,8 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float RedHigh = (100.f + float (params->colorToning.redhigh)) / 100.f; //printf("RedH=%f\n",RedHigh); float GreenHigh = (100.f + float (params->colorToning.greenhigh)) / 100.f; float BlueHigh = (100.f + float (params->colorToning.bluehigh)) / 100.f; - float SatLow = float (params->colorToning.shadowsColSat.value[0]) / 100.f; - float SatHigh = float (params->colorToning.hlColSat.value[0]) / 100.f; + float SatLow = float (params->colorToning.shadowsColSat.getBottom()) / 100.f; + float SatHigh = float (params->colorToning.hlColSat.getBottom()) / 100.f; float Balan = float (params->colorToning.balance); @@ -3621,21 +3622,21 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } if (hasToneCurve1) { - if (curveMode == ToneCurveParams::TC_MODE_STD) { // Standard + if (curveMode == ToneCurveParams::TcMode::STD) { // Standard for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const StandardToneCurve& userToneCurve = static_cast (customToneCurve1); userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode == ToneCurveParams::TC_MODE_FILMLIKE) { // Adobe like + } else if (curveMode == ToneCurveParams::TcMode::FILMLIKE) { // Adobe like for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const AdobeToneCurve& userToneCurve = static_cast (customToneCurve1); userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode == ToneCurveParams::TC_MODE_SATANDVALBLENDING) { // apply the curve on the saturation and value channels + } else if (curveMode == ToneCurveParams::TcMode::SATANDVALBLENDING) { // apply the curve on the saturation and value channels for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const SatAndValueBlendingToneCurve& userToneCurve = static_cast (customToneCurve1); @@ -3645,7 +3646,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode == ToneCurveParams::TC_MODE_WEIGHTEDSTD) { // apply the curve to the rgb channels, weighted + } else if (curveMode == ToneCurveParams::TcMode::WEIGHTEDSTD) { // apply the curve to the rgb channels, weighted const WeightedStdToneCurve& userToneCurve = static_cast (customToneCurve1); for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -3656,7 +3657,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode == ToneCurveParams::TC_MODE_LUMINANCE) { // apply the curve to the luminance channel + } else if (curveMode == ToneCurveParams::TcMode::LUMINANCE) { // apply the curve to the luminance channel const LuminanceToneCurve& userToneCurve = static_cast (customToneCurve1); for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -3667,7 +3668,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode == ToneCurveParams::TC_MODE_PERCEPTUAL) { // apply curve while keeping color appearance constant + } else if (curveMode == ToneCurveParams::TcMode::PERCEPTUAL) { // apply curve while keeping color appearance constant const PerceptualToneCurve& userToneCurve = static_cast (customToneCurve1); for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -3692,28 +3693,28 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } if (hasToneCurve2) { - if (curveMode2 == ToneCurveParams::TC_MODE_STD) { // Standard + if (curveMode2 == ToneCurveParams::TcMode::STD) { // Standard for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const StandardToneCurve& userToneCurve = static_cast (customToneCurve2); userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode2 == ToneCurveParams::TC_MODE_FILMLIKE) { // Adobe like + } else if (curveMode2 == ToneCurveParams::TcMode::FILMLIKE) { // Adobe like for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const AdobeToneCurve& userToneCurve = static_cast (customToneCurve2); userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode2 == ToneCurveParams::TC_MODE_SATANDVALBLENDING) { // apply the curve on the saturation and value channels + } else if (curveMode2 == ToneCurveParams::TcMode::SATANDVALBLENDING) { // apply the curve on the saturation and value channels for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const SatAndValueBlendingToneCurve& userToneCurve = static_cast (customToneCurve2); userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode2 == ToneCurveParams::TC_MODE_WEIGHTEDSTD) { // apply the curve to the rgb channels, weighted + } else if (curveMode2 == ToneCurveParams::TcMode::WEIGHTEDSTD) { // apply the curve to the rgb channels, weighted const WeightedStdToneCurve& userToneCurve = static_cast (customToneCurve2); for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -3721,7 +3722,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode2 == ToneCurveParams::TC_MODE_LUMINANCE) { // apply the curve to the luminance channel + } else if (curveMode2 == ToneCurveParams::TcMode::LUMINANCE) { // apply the curve to the luminance channel const LuminanceToneCurve& userToneCurve = static_cast (customToneCurve2); for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -3729,7 +3730,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer userToneCurve.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (curveMode2 == ToneCurveParams::TC_MODE_PERCEPTUAL) { // apply curve while keeping color appearance constant + } else if (curveMode2 == ToneCurveParams::TcMode::PERCEPTUAL) { // apply curve while keeping color appearance constant const PerceptualToneCurve& userToneCurve = static_cast (customToneCurve2); for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -3760,7 +3761,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } } - if (rCurve || gCurve || bCurve) { // if any of the RGB curves is engaged + if (params->rgbCurves.enabled && (rCurve || gCurve || bCurve)) { // if any of the RGB curves is engaged if (!params->rgbCurves.lumamode) { // normal RGB mode for (int i = istart, ti = 0; i < tH; i++, ti++) { @@ -4192,21 +4193,21 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer //black and white if (blackwhite) { if (hasToneCurvebw1) { - if (beforeCurveMode == BlackWhiteParams::TC_MODE_STD_BW) { // Standard + if (beforeCurveMode == BlackWhiteParams::TcMode::STD_BW) { // Standard for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const StandardToneCurve& userToneCurvebw = static_cast (customToneCurvebw1); userToneCurvebw.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (beforeCurveMode == BlackWhiteParams::TC_MODE_FILMLIKE_BW) { // Adobe like + } else if (beforeCurveMode == BlackWhiteParams::TcMode::FILMLIKE_BW) { // Adobe like for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const AdobeToneCurve& userToneCurvebw = static_cast (customToneCurvebw1); userToneCurvebw.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (beforeCurveMode == BlackWhiteParams::TC_MODE_SATANDVALBLENDING_BW) { // apply the curve on the saturation and value channels + } else if (beforeCurveMode == BlackWhiteParams::TcMode::SATANDVALBLENDING_BW) { // apply the curve on the saturation and value channels for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const SatAndValueBlendingToneCurve& userToneCurvebw = static_cast (customToneCurvebw1); @@ -4216,7 +4217,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer userToneCurvebw.Apply (rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj]); } } - } else if (beforeCurveMode == BlackWhiteParams::TC_MODE_WEIGHTEDSTD_BW) { // apply the curve to the rgb channels, weighted + } else if (beforeCurveMode == BlackWhiteParams::TcMode::WEIGHTEDSTD_BW) { // apply the curve to the rgb channels, weighted for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { const WeightedStdToneCurve& userToneCurvebw = static_cast (customToneCurvebw1); @@ -4652,7 +4653,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer if (hasToneCurvebw2) { - if (afterCurveMode == BlackWhiteParams::TC_MODE_STD_BW) { // Standard + if (afterCurveMode == BlackWhiteParams::TcMode::STD_BW) { // Standard #ifdef _OPENMP #pragma omp parallel for schedule(dynamic, 5) #endif @@ -4663,7 +4664,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer userToneCurve.Apply (tmpImage->r (i, j), tmpImage->g (i, j), tmpImage->b (i, j)); } } - } else if (afterCurveMode == BlackWhiteParams::TC_MODE_WEIGHTEDSTD_BW) { // apply the curve to the rgb channels, weighted + } else if (afterCurveMode == BlackWhiteParams::TcMode::WEIGHTEDSTD_BW) { // apply the curve to the rgb channels, weighted #ifdef _OPENMP #pragma omp parallel for schedule(dynamic, 5) #endif @@ -5585,6 +5586,10 @@ void ImProcFunctions::luminanceCurve (LabImage* lold, LabImage* lnew, LUTf & cur SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, LUTf & acurve, LUTf & bcurve, LUTf & satcurve, LUTf & lhskcurve, LUTf & clcurve, LUTf & curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLCurve) { + if (!params->labCurve.enabled) { + return; + } + int W = lold->W; int H = lold->H; // lhskcurve.dump("lh_curve"); @@ -6488,9 +6493,9 @@ void ImProcFunctions::badpixlab (LabImage* lab, double rad, int thr, int mode, f void ImProcFunctions::dirpyrequalizer (LabImage* lab, int scale) { if (params->dirpyrequalizer.enabled && lab->W >= 8 && lab->H >= 8) { - float b_l = static_cast (params->dirpyrequalizer.hueskin.value[0]) / 100.0f; - float t_l = static_cast (params->dirpyrequalizer.hueskin.value[1]) / 100.0f; - float t_r = static_cast (params->dirpyrequalizer.hueskin.value[3]) / 100.0f; + float b_l = static_cast (params->dirpyrequalizer.hueskin.getBottomLeft()) / 100.0f; + float t_l = static_cast (params->dirpyrequalizer.hueskin.getTopLeft()) / 100.0f; + float t_r = static_cast (params->dirpyrequalizer.hueskin.getTopRight()) / 100.0f; // if (params->dirpyrequalizer.algo=="FI") choice=0; // else if(params->dirpyrequalizer.algo=="LA") choice=1; float artifact = (float) settings->artifact_cbdl; diff --git a/rtengine/ipvibrance.cc b/rtengine/ipvibrance.cc index 68efd1aea..f17d5d9b1 100644 --- a/rtengine/ipvibrance.cc +++ b/rtengine/ipvibrance.cc @@ -126,7 +126,7 @@ void ImProcFunctions::vibrance (LabImage* lab) const float chromaPastel = float (params->vibrance.pastels) / 100.0f; const float chromaSatur = float (params->vibrance.saturated) / 100.0f; const float p00 = 0.07f; - const float limitpastelsatur = (static_cast (params->vibrance.psthreshold.value[ThresholdSelector::TS_TOPLEFT]) / 100.0f) * (1.0f - p00) + p00; + const float limitpastelsatur = (static_cast(params->vibrance.psthreshold.getTopLeft()) / 100.0f) * (1.0f - p00) + p00; const float maxdp = (limitpastelsatur - p00) / 4.0f; const float maxds = (1.0 - limitpastelsatur) / 4.0f; const float p0 = p00 + maxdp; @@ -135,7 +135,7 @@ void ImProcFunctions::vibrance (LabImage* lab) const float s0 = limitpastelsatur + maxds; const float s1 = limitpastelsatur + 2.0f * maxds; const float s2 = limitpastelsatur + 3.0f * maxds; - const float transitionweighting = static_cast (params->vibrance.psthreshold.value[ThresholdSelector::TS_BOTTOMLEFT]) / 100.0f; + const float transitionweighting = static_cast(params->vibrance.psthreshold.getBottomLeft()) / 100.0f; float chromamean = 0.0f; if (chromaPastel != chromaSatur) { diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 85b35ef18..189d61ddf 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -432,56 +432,56 @@ SSEFUNCTION void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int cp.thH = float(waparams.thrH); cp.sky = waparams.sky; //skin - cp.b_l = static_cast(params->wavelet.hueskin.value[0]) / 100.0f; - cp.t_l = static_cast(params->wavelet.hueskin.value[1]) / 100.0f; - cp.b_r = static_cast(params->wavelet.hueskin.value[2]) / 100.0f; - cp.t_r = static_cast(params->wavelet.hueskin.value[3]) / 100.0f; + cp.b_l = static_cast(params->wavelet.hueskin.getBottomLeft()) / 100.0f; + cp.t_l = static_cast(params->wavelet.hueskin.getTopLeft()) / 100.0f; + cp.b_r = static_cast(params->wavelet.hueskin.getBottomRight()) / 100.0f; + cp.t_r = static_cast(params->wavelet.hueskin.getTopRight()) / 100.0f; - cp.b_ly = static_cast(params->wavelet.hueskin2.value[0]) / 100.0f; - cp.t_ly = static_cast(params->wavelet.hueskin2.value[1]) / 100.0f; - cp.b_ry = static_cast(params->wavelet.hueskin2.value[2]) / 100.0f; - cp.t_ry = static_cast(params->wavelet.hueskin2.value[3]) / 100.0f; + cp.b_ly = static_cast(params->wavelet.hueskin2.getBottomLeft()) / 100.0f; + cp.t_ly = static_cast(params->wavelet.hueskin2.getTopLeft()) / 100.0f; + cp.b_ry = static_cast(params->wavelet.hueskin2.getBottomRight()) / 100.0f; + cp.t_ry = static_cast(params->wavelet.hueskin2.getTopRight()) / 100.0f; cp.numlevH = params->wavelet.threshold; //shadows - cp.b_lsl = static_cast(params->wavelet.bllev.value[0]); - cp.t_lsl = static_cast(params->wavelet.bllev.value[1]); - cp.b_rsl = static_cast(params->wavelet.bllev.value[2]); - cp.t_rsl = static_cast(params->wavelet.bllev.value[3]); + cp.b_lsl = static_cast(params->wavelet.bllev.getBottomLeft()); + cp.t_lsl = static_cast(params->wavelet.bllev.getTopLeft()); + cp.b_rsl = static_cast(params->wavelet.bllev.getBottomRight()); + cp.t_rsl = static_cast(params->wavelet.bllev.getTopRight()); cp.numlevS = params->wavelet.threshold2; int maxlevS = 9 - cp.numlevH; cp.numlevS = MIN(cp.numlevS, maxlevS); //printf("levHigh=%d levShad=%d\n",cp.numlevH,cp.numlevS); //highlight - cp.b_lhl = static_cast(params->wavelet.hllev.value[0]); - cp.t_lhl = static_cast(params->wavelet.hllev.value[1]); - cp.b_rhl = static_cast(params->wavelet.hllev.value[2]); - cp.t_rhl = static_cast(params->wavelet.hllev.value[3]); + cp.b_lhl = static_cast(params->wavelet.hllev.getBottomLeft()); + cp.t_lhl = static_cast(params->wavelet.hllev.getTopLeft()); + cp.b_rhl = static_cast(params->wavelet.hllev.getBottomRight()); + cp.t_rhl = static_cast(params->wavelet.hllev.getTopRight()); //printf("BL=%f TL=%f BR=%f TR=%f\n",cp.b_lhl,cp.t_lhl,cp.b_rhl,cp.t_rhl); //pastel - cp.b_lpast = static_cast(params->wavelet.pastlev.value[0]); - cp.t_lpast = static_cast(params->wavelet.pastlev.value[1]); - cp.b_rpast = static_cast(params->wavelet.pastlev.value[2]); - cp.t_rpast = static_cast(params->wavelet.pastlev.value[3]); + cp.b_lpast = static_cast(params->wavelet.pastlev.getBottomLeft()); + cp.t_lpast = static_cast(params->wavelet.pastlev.getTopLeft()); + cp.b_rpast = static_cast(params->wavelet.pastlev.getBottomRight()); + cp.t_rpast = static_cast(params->wavelet.pastlev.getTopRight()); //saturated - cp.b_lsat = static_cast(params->wavelet.satlev.value[0]); - cp.t_lsat = static_cast(params->wavelet.satlev.value[1]); - cp.b_rsat = static_cast(params->wavelet.satlev.value[2]); - cp.t_rsat = static_cast(params->wavelet.satlev.value[3]); + cp.b_lsat = static_cast(params->wavelet.satlev.getBottomLeft()); + cp.t_lsat = static_cast(params->wavelet.satlev.getTopLeft()); + cp.b_rsat = static_cast(params->wavelet.satlev.getBottomRight()); + cp.t_rsat = static_cast(params->wavelet.satlev.getTopRight()); //edge local contrast - cp.edg_low = static_cast(params->wavelet.edgcont.value[0]); - cp.edg_mean = static_cast(params->wavelet.edgcont.value[1]); - cp.edg_max = static_cast(params->wavelet.edgcont.value[2]); - cp.edg_sd = static_cast(params->wavelet.edgcont.value[3]); + cp.edg_low = static_cast(params->wavelet.edgcont.getBottomLeft()); + cp.edg_mean = static_cast(params->wavelet.edgcont.getTopLeft()); + cp.edg_max = static_cast(params->wavelet.edgcont.getBottomRight()); + cp.edg_sd = static_cast(params->wavelet.edgcont.getTopRight()); //level noise - cp.lev0s = static_cast(params->wavelet.level0noise.value[0]); - cp.lev0n = static_cast(params->wavelet.level0noise.value[1]); - cp.lev1s = static_cast(params->wavelet.level1noise.value[0]); - cp.lev1n = static_cast(params->wavelet.level1noise.value[1]); - cp.lev2s = static_cast(params->wavelet.level2noise.value[0]); - cp.lev2n = static_cast(params->wavelet.level2noise.value[1]); - cp.lev3s = static_cast(params->wavelet.level3noise.value[0]); - cp.lev3n = static_cast(params->wavelet.level3noise.value[1]); + cp.lev0s = static_cast(params->wavelet.level0noise.getBottom()); + cp.lev0n = static_cast(params->wavelet.level0noise.getTop()); + cp.lev1s = static_cast(params->wavelet.level1noise.getBottom()); + cp.lev1n = static_cast(params->wavelet.level1noise.getTop()); + cp.lev2s = static_cast(params->wavelet.level2noise.getBottom()); + cp.lev2n = static_cast(params->wavelet.level2noise.getTop()); + cp.lev3s = static_cast(params->wavelet.level3noise.getBottom()); + cp.lev3n = static_cast(params->wavelet.level3noise.getTop()); cp.detectedge = params->wavelet.medianlev; //printf("low=%f mean=%f sd=%f max=%f\n",cp.edg_low,cp.edg_mean,cp.edg_sd,cp.edg_max); diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index 15e68d9f1..baaa88767 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -361,7 +361,7 @@ void rtengine::LCPProfile::calcParams( const float focDist = aPersModel[pm]->focDist; const float focDistLog = std::log(focDist) + euler; - double meanErr; + double meanErr = 0.0; if (aPersModel[pm]->hasModeData(mode)) { double lowMeanErr = 0.0; diff --git a/rtengine/pixelshift.cc b/rtengine/pixelshift.cc index 5a7e88f1c..256aaaf63 100644 --- a/rtengine/pixelshift.cc +++ b/rtengine/pixelshift.cc @@ -311,11 +311,11 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA bayerParams.pixelShiftAutomatic = true; - if(bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::Automatic) { + if(bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::PSMotionCorrectionMethod::AUTO) { bool pixelShiftEqualBright = bayerParams.pixelShiftEqualBright; bayerParams.setPixelShiftDefaults(); bayerParams.pixelShiftEqualBright = pixelShiftEqualBright; - } else if(bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::Off) { + } else if(bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::PSMotionCorrectionMethod::OFF) { bayerParams.pixelShiftAutomatic = false; bayerParams.pixelShiftShowMotion = false; } @@ -506,7 +506,7 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA static const float ePerIsoK70 = 0.5f; if(plistener) { - plistener->setProgressStr(Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::pixelshift])); + plistener->setProgressStr(Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT))); plistener->setProgress(0.0); } diff --git a/rtengine/previewimage.cc b/rtengine/previewimage.cc index 1bd72a354..0b3610de2 100644 --- a/rtengine/previewimage.cc +++ b/rtengine/previewimage.cc @@ -108,10 +108,10 @@ PreviewImage::PreviewImage (const Glib::ustring &fname, const Glib::ustring &ext rawImage.getFullSize (fw, fh, TR_NONE); PreviewProps pp (0, 0, fw, fh, 1); params.icm.input = Glib::ustring("(embedded)"); - params.raw.bayersensor.method = RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::fast]; + params.raw.bayersensor.method = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST); params.raw.deadPixelFilter = false; params.raw.ca_autocorrect = false; - params.raw.xtranssensor.method = RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::fast]; + params.raw.xtranssensor.method = RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FAST); rawImage.preprocess(params.raw, params.lensProf, params.coarse); rawImage.demosaic(params.raw); Imagefloat image(fw, fh); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 3aa5505b5..f4dfd7dfb 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -511,14 +511,15 @@ enum ProcEvent { EvCATgreensc = 481, EvCATybscen = 482, EvCATAutoyb = 483, - // profiled lens correction new events EvLensCorrMode = 484, EvLensCorrLensfunCamera = 485, EvLensCorrLensfunLens = 486, - // Fattal tone mapping EvTMFattalEnabled = 487, EvTMFattalThreshold = 488, EvTMFattalAmount = 489, + EvWBEnabled = 490, + EvRGBEnabled = 491, + EvLEnabled = 492, NUMOFEVENTS diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 0ada68a62..ccdafec5c 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -16,17 +16,21 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#include -#include "procparams.h" -#include "curves.h" -#include "../rtgui/multilangmgr.h" -#include "../rtgui/version.h" -#include "../rtgui/ppversion.h" -#include "../rtgui/paramsedited.h" -#include "../rtgui/options.h" + +#include + #include -#define APPVERSION RTVERSION +#include + +#include "curves.h" +#include "procparams.h" + +#include "../rtgui/multilangmgr.h" +#include "../rtgui/options.h" +#include "../rtgui/paramsedited.h" +#include "../rtgui/ppversion.h" +#include "../rtgui/version.h" using namespace std; extern Options options; @@ -34,6 +38,56 @@ extern Options options; namespace { +Glib::ustring expandRelativePath (const Glib::ustring &procparams_fname, const Glib::ustring &prefix, Glib::ustring embedded_fname) +{ + if (embedded_fname == "" || !Glib::path_is_absolute (procparams_fname)) { + return embedded_fname; + } + + if (prefix != "") { + if (embedded_fname.length() < prefix.length() || embedded_fname.substr (0, prefix.length()) != prefix) { + return embedded_fname; + } + + embedded_fname = embedded_fname.substr (prefix.length()); + } + + if (Glib::path_is_absolute (embedded_fname)) { + return prefix + embedded_fname; + } + + Glib::ustring absPath = prefix + Glib::path_get_dirname (procparams_fname) + G_DIR_SEPARATOR_S + embedded_fname; + return absPath; +} + +Glib::ustring relativePathIfInside (const Glib::ustring &procparams_fname, bool fnameAbsolute, Glib::ustring embedded_fname) +{ + if (fnameAbsolute || embedded_fname == "" || !Glib::path_is_absolute (procparams_fname)) { + return embedded_fname; + } + + Glib::ustring prefix = ""; + + if (embedded_fname.length() > 5 && embedded_fname.substr (0, 5) == "file:") { + embedded_fname = embedded_fname.substr (5); + prefix = "file:"; + } + + if (!Glib::path_is_absolute (embedded_fname)) { + return prefix + embedded_fname; + } + + Glib::ustring dir1 = Glib::path_get_dirname (procparams_fname) + G_DIR_SEPARATOR_S; + Glib::ustring dir2 = Glib::path_get_dirname (embedded_fname) + G_DIR_SEPARATOR_S; + + if (dir2.substr (0, dir1.length()) != dir1) { + // it's in a different directory, ie not inside + return prefix + embedded_fname; + } + + return prefix + embedded_fname.substr (dir1.length()); +} + void avoidEmptyCurve (std::vector &curve) { if (curve.empty()) { @@ -41,277 +95,612 @@ void avoidEmptyCurve (std::vector &curve) } } +void getFromKeyfile( + const Glib::KeyFile& keyfile, + const Glib::ustring& group_name, + const Glib::ustring& key, + int& value +) +{ + value = keyfile.get_integer(group_name, key); +} + +void getFromKeyfile( + const Glib::KeyFile& keyfile, + const Glib::ustring& group_name, + const Glib::ustring& key, + double& value +) +{ + value = keyfile.get_double(group_name, key); +} + +void getFromKeyfile( + const Glib::KeyFile& keyfile, + const Glib::ustring& group_name, + const Glib::ustring& key, + bool& value +) +{ + value = keyfile.get_boolean(group_name, key); +} + +void getFromKeyfile( + const Glib::KeyFile& keyfile, + const Glib::ustring& group_name, + const Glib::ustring& key, + Glib::ustring& value +) +{ + value = keyfile.get_string(group_name, key); +} + +void getFromKeyfile( + const Glib::KeyFile& keyfile, + const Glib::ustring& group_name, + const Glib::ustring& key, + std::vector& value +) +{ + value = keyfile.get_double_list(group_name, key); + avoidEmptyCurve(value); +} + +template +bool assignFromKeyfile( + const Glib::KeyFile& keyfile, + const Glib::ustring& group_name, + const Glib::ustring& key, + bool has_params_edited, + T& value, + bool& params_edited_value +) +{ + if (keyfile.has_key(group_name, key)) { + getFromKeyfile(keyfile, group_name, key, value); + + if (has_params_edited) { + params_edited_value = true; + } + + return true; + } + return false; +} + +template::value>::type> +bool assignFromKeyfile( + const Glib::KeyFile& keyfile, + const Glib::ustring& group_name, + const Glib::ustring& key, + bool has_params_edited, + const std::map& mapping, + T& value, + bool& params_edited_value +) +{ + if (keyfile.has_key(group_name, key)) { + Glib::ustring v; + getFromKeyfile(keyfile, group_name, key, v); + + const typename std::map::const_iterator m = mapping.find(v); + + if (m != mapping.end()) { + value = m->second; + } else { + return false; + } + + if (has_params_edited) { + params_edited_value = true; + } + + return true; + } + return false; +} + +void putToKeyfile( + const Glib::ustring& group_name, + const Glib::ustring& key, + int value, + Glib::KeyFile& keyfile +) +{ + keyfile.set_integer(group_name, key, value); +} + +void putToKeyfile( + const Glib::ustring& group_name, + const Glib::ustring& key, + double value, + Glib::KeyFile& keyfile +) +{ + keyfile.set_double(group_name, key, value); +} + +void putToKeyfile( + const Glib::ustring& group_name, + const Glib::ustring& key, + bool value, + Glib::KeyFile& keyfile +) +{ + keyfile.set_boolean(group_name, key, value); +} + +void putToKeyfile( + const Glib::ustring& group_name, + const Glib::ustring& key, + const Glib::ustring& value, + Glib::KeyFile& keyfile +) +{ + keyfile.set_string(group_name, key, value); +} + +void putToKeyfile( + const Glib::ustring& group_name, + const Glib::ustring& key, + const std::vector& value, + Glib::KeyFile& keyfile +) +{ + const Glib::ArrayHandle list = value; + keyfile.set_integer_list(group_name, key, list); +} + +void putToKeyfile( + const Glib::ustring& group_name, + const Glib::ustring& key, + const std::vector& value, + Glib::KeyFile& keyfile +) +{ + const Glib::ArrayHandle list = value; + keyfile.set_double_list(group_name, key, list); +} + +template +bool saveToKeyfile( + bool save, + const Glib::ustring& group_name, + const Glib::ustring& key, + const T& value, + Glib::KeyFile& keyfile +) +{ + if (save) { + putToKeyfile(group_name, key, value, keyfile); + return true; + } + return false; +} + +template::value>::type> +bool saveToKeyfile( + bool save, + const Glib::ustring& group_name, + const Glib::ustring& key, + const std::map& mapping, + const T& value, + Glib::KeyFile& keyfile +) +{ + if (save) { + const typename std::map::const_iterator m = mapping.find(value); + + if (m != mapping.end()) { + keyfile.set_string(group_name, key, m->second); + return true; + } + } + return false; +} + } namespace rtengine { + namespace procparams { -const int tr = (int) options.rtSettings.top_right; -const int br = (int) options.rtSettings.bot_right; -const int tl = (int) options.rtSettings.top_left; -const int bl = (int) options.rtSettings.bot_left; -const char *LensProfParams::methodstring[static_cast(LensProfParams::LcMode::LCP) + 1u] = {"none", "lfauto", "lfmanual", "lcp"}; -const char *RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::numMethods] = {"amaze", "igv", "lmmse", "eahd", "hphd", "vng4", "dcb", "ahd", "fast", "mono", "none", "pixelshift" }; -const char *RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::numMethods] = {"3-pass (best)", "1-pass (medium)", "fast", "mono", "none" }; - -const char *RAWParams::ff_BlurTypestring[RAWParams::numFlatFileBlurTypes] = {/*"Parametric",*/ "Area Flatfield", "Vertical Flatfield", "Horizontal Flatfield", "V+H Flatfield"}; -std::vector WBParams::wbEntries; - -bool ToneCurveParams::HLReconstructionNecessary (LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw) +ToneCurveParams::ToneCurveParams() : + autoexp(false), + clip(0.02), + hrenabled(false), + method("Blend"), + expcomp(0), + curve{ + DCT_Linear + }, + curve2{ + DCT_Linear + }, + curveMode(ToneCurveParams::TcMode::STD), + curveMode2(ToneCurveParams::TcMode::STD), + brightness(0), + black(0), + contrast(0), + saturation(0), + shcompr(50), + hlcompr(0), + hlcomprthresh(33) { - if (options.rtSettings.verbose) - printf ("histRedRaw[ 0]=%07d, histGreenRaw[ 0]=%07d, histBlueRaw[ 0]=%07d\nhistRedRaw[255]=%07d, histGreenRaw[255]=%07d, histBlueRaw[255]=%07d\n", +} + +bool ToneCurveParams::operator ==(const ToneCurveParams& other) const +{ + return + autoexp == other.autoexp + && clip == other.clip + && hrenabled == other.hrenabled + && method == other.method + && expcomp == other.expcomp + && curve == other.curve + && curve2 == other.curve2 + && curveMode == other.curveMode + && curveMode2 == other.curveMode2 + && brightness == other.brightness + && black == other.black + && contrast == other.contrast + && saturation == other.saturation + && shcompr == other.shcompr + && hlcompr == other.hlcompr + && hlcomprthresh == other.hlcomprthresh; +} + +bool ToneCurveParams::operator !=(const ToneCurveParams& other) const +{ + return !(*this == other); +} + +bool ToneCurveParams::HLReconstructionNecessary(const LUTu& histRedRaw, const LUTu& histGreenRaw, const LUTu& histBlueRaw) +{ + if (options.rtSettings.verbose) { + printf("histRedRaw[ 0]=%07d, histGreenRaw[ 0]=%07d, histBlueRaw[ 0]=%07d\nhistRedRaw[255]=%07d, histGreenRaw[255]=%07d, histBlueRaw[255]=%07d\n", histRedRaw[0], histGreenRaw[0], histBlueRaw[0], histRedRaw[255], histGreenRaw[255], histBlueRaw[255]); - - return histRedRaw[255] > 50 || histGreenRaw[255] > 50 || histBlueRaw[255] > 50 || histRedRaw[0] > 50 || histGreenRaw[0] > 50 || histBlueRaw[0] > 50; -} - -void WBParams::init() -{ - // Creation of the different methods and its associated temperature value - wbEntries.push_back (new WBEntry ("Camera", WBT_CAMERA, M ("TP_WBALANCE_CAMERA"), 0, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Auto", WBT_AUTO, M ("TP_WBALANCE_AUTO"), 0, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Daylight", WBT_DAYLIGHT, M ("TP_WBALANCE_DAYLIGHT"), 5300, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Cloudy", WBT_CLOUDY, M ("TP_WBALANCE_CLOUDY"), 6200, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Shade", WBT_SHADE, M ("TP_WBALANCE_SHADE"), 7600, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Water 1", WBT_WATER, M ("TP_WBALANCE_WATER1"), 35000, 0.3f, 1.1f, 0.f)); - wbEntries.push_back (new WBEntry ("Water 2", WBT_WATER, M ("TP_WBALANCE_WATER2"), 48000, 0.63f, 1.38f, 0.f)); - wbEntries.push_back (new WBEntry ("Tungsten", WBT_TUNGSTEN, M ("TP_WBALANCE_TUNGSTEN"), 2856, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Fluo F1", WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO1"), 6430, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Fluo F2", WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO2"), 4230, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Fluo F3", WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO3"), 3450, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Fluo F4", WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO4"), 2940, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Fluo F5", WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO5"), 6350, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Fluo F6", WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO6"), 4150, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Fluo F7", WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO7"), 6500, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Fluo F8", WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO8"), 5020, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Fluo F9", WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO9"), 4330, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Fluo F10", WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO10"), 5300, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Fluo F11", WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO11"), 4000, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Fluo F12", WBT_FLUORESCENT, M ("TP_WBALANCE_FLUO12"), 3000, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("HMI Lamp", WBT_LAMP, M ("TP_WBALANCE_HMI"), 4800, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("GTI Lamp", WBT_LAMP, M ("TP_WBALANCE_GTI"), 5000, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("JudgeIII Lamp", WBT_LAMP, M ("TP_WBALANCE_JUDGEIII"), 5100, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Solux Lamp 3500K", WBT_LAMP, M ("TP_WBALANCE_SOLUX35"), 3480, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Solux Lamp 4100K", WBT_LAMP, M ("TP_WBALANCE_SOLUX41"), 3930, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Solux Lamp 4700K", WBT_LAMP, M ("TP_WBALANCE_SOLUX47"), 4700, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("NG Solux Lamp 4700K", WBT_LAMP, M ("TP_WBALANCE_SOLUX47_NG"), 4480, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("LED LSI Lumelex 2040", WBT_LED, M ("TP_WBALANCE_LED_LSI"), 2970, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("LED CRS SP12 WWMR16", WBT_LED, M ("TP_WBALANCE_LED_CRS"), 3050, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Flash 5500K", WBT_FLASH, M ("TP_WBALANCE_FLASH55"), 5500, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Flash 6000K", WBT_FLASH, M ("TP_WBALANCE_FLASH60"), 6000, 1.f, 1.f, 0.f)); - wbEntries.push_back (new WBEntry ("Flash 6500K", WBT_FLASH, M ("TP_WBALANCE_FLASH65"), 6500, 1.f, 1.f, 0.f)); - // Should remain the last one - wbEntries.push_back (new WBEntry ("Custom", WBT_CUSTOM, M ("TP_WBALANCE_CUSTOM"), 0, 1.f, 1.f, 0.f)); -} - -void WBParams::cleanup() -{ - for (unsigned int i = 0; i < wbEntries.size(); i++) { - delete wbEntries[i]; } + + return + histRedRaw[255] > 50 + || histGreenRaw[255] > 50 + || histBlueRaw[255] > 50 + || histRedRaw[0] > 50 + || histGreenRaw[0] > 50 + || histBlueRaw[0] > 50; } -// Maps crop to resized width (e.g. smaller previews) -void CropParams::mapToResized (int resizedWidth, int resizedHeight, int scale, int &x1, int &x2, int &y1, int &y2) const +RetinexParams::RetinexParams() : + enabled(false), + cdcurve{ + DCT_Linear + }, + cdHcurve{ + DCT_Linear + }, + lhcurve{ + DCT_Linear + }, + transmissionCurve{ + FCT_MinMaxCPoints, + 0.00, + 0.50, + 0.35, + 0.35, + 0.60, + 0.75, + 0.35, + 0.35, + 1.00, + 0.50, + 0.35, + 0.35 + }, + gaintransmissionCurve{ + FCT_MinMaxCPoints, + 0.00, + 0.1, + 0.35, + 0.00, + 0.25, + 0.25, + 0.35, + 0.35, + 0.70, + 0.25, + 0.35, + 0.35, + 1.00, + 0.1, + 0.00, + 0.00 + }, + mapcurve{ + DCT_Linear + }, + str(20), + scal(3), + iter(1), + grad(1), + grads(1), + gam(1.30), + slope(3.), + neigh(80), + offs(0), + highlights(0), + htonalwidth(80), + shadows(0), + stonalwidth(80), + radius(40), + retinexMethod("high"), + retinexcolorspace("Lab"), + gammaretinex("none"), + mapMethod("none"), + viewMethod("none"), + vart(200), + limd(8), + highl(4), + skal(3), + medianmap(false) { - x1 = 0, x2 = resizedWidth, y1 = 0, y2 = resizedHeight; +} - if (enabled) { - x1 = min (resizedWidth - 1, max (0, x / scale)); - y1 = min (resizedHeight - 1, max (0, y / scale)); - x2 = min (resizedWidth, max (0, (x + w) / scale)); - y2 = min (resizedHeight, max (0, (y + h) / scale)); +bool RetinexParams::operator ==(const RetinexParams& other) const +{ + return + enabled == other.enabled + && cdcurve == other.cdcurve + && cdHcurve == other.cdHcurve + && lhcurve == other.lhcurve + && transmissionCurve == other.transmissionCurve + && gaintransmissionCurve == other.gaintransmissionCurve + && mapcurve == other.mapcurve + && str == other.str + && scal == other.scal + && iter == other.iter + && grad == other.grad + && grads == other.grads + && gam == other.gam + && slope == other.slope + && neigh == other.neigh + && offs == other.offs + && highlights == other.highlights + && htonalwidth == other.htonalwidth + && shadows == other.shadows + && stonalwidth == other.stonalwidth + && radius == other.radius + && retinexMethod == other.retinexMethod + && retinexcolorspace == other.retinexcolorspace + && gammaretinex == other.gammaretinex + && mapMethod == other.mapMethod + && viewMethod == other.viewMethod + && vart == other.vart + && limd == other.limd + && highl == other.highl + && skal == other.skal + && medianmap == other.medianmap; +} + +bool RetinexParams::operator !=(const RetinexParams& other) const +{ + return !(*this == other); +} + +void RetinexParams::getCurves(RetinextransmissionCurve &transmissionCurveLUT, RetinexgaintransmissionCurve &gaintransmissionCurveLUT) const +{ + transmissionCurveLUT.Set(this->transmissionCurve); + gaintransmissionCurveLUT.Set(this->gaintransmissionCurve); + +} + +LCurveParams::LCurveParams() : + enabled(false), + lcurve{ + DCT_Linear + }, + acurve{ + DCT_Linear + }, + bcurve{ + DCT_Linear + }, + cccurve{ + DCT_Linear + }, + chcurve{ + FCT_Linear + }, + lhcurve{ + FCT_Linear + }, + hhcurve{ + FCT_Linear + }, + lccurve{ + DCT_Linear + }, + clcurve{ + DCT_Linear + }, + brightness(0), + contrast(0), + chromaticity(0), + avoidcolorshift(false), + rstprotection(0), + lcredsk(true) +{ +} + +bool LCurveParams::operator ==(const LCurveParams& other) const +{ + return + enabled == other.enabled + && lcurve == other.lcurve + && acurve == other.acurve + && bcurve == other.bcurve + && cccurve == other.cccurve + && chcurve == other.chcurve + && lhcurve == other.lhcurve + && hhcurve == other.hhcurve + && lccurve == other.lccurve + && clcurve == other.clcurve + && brightness == other.brightness + && contrast == other.contrast + && chromaticity == other.chromaticity + && avoidcolorshift == other.avoidcolorshift + && rstprotection == other.rstprotection + && lcredsk == other.lcredsk; +} + +bool LCurveParams::operator !=(const LCurveParams& other) const +{ + return !(*this == other); +} + +RGBCurvesParams::RGBCurvesParams() : + enabled(false), + lumamode(false), + rcurve{ + DCT_Linear + }, + gcurve{ + DCT_Linear + }, + bcurve{ + DCT_Linear } -} - -RetinexParams::RetinexParams () { - setDefaults (); } -void RetinexParams::getDefaulttransmissionCurve (std::vector &curve) +bool RGBCurvesParams::operator ==(const RGBCurvesParams& other) const { - double v[12] = { 0.00, 0.50, 0.35, 0.35, - 0.60, 0.75, 0.35, 0.35, - 1.00, 0.50, 0.35, 0.35, - }; - - - curve.resize (13); - curve.at (0 ) = double (FCT_MinMaxCPoints); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } + return + enabled == other.enabled + && lumamode == other.lumamode + && rcurve == other.rcurve + && gcurve == other.gcurve + && bcurve == other.bcurve; } -void RetinexParams::getDefaultgaintransmissionCurve (std::vector &curve) + +bool RGBCurvesParams::operator !=(const RGBCurvesParams& other) const { - double v[16] = { 0.00, 0.1, 0.35, 0.00, - 0.25, 0.25, 0.35, 0.35, - 0.70, 0.25, 0.35, 0.35, - 1.00, 0.1, 0.00, 0.00 - }; - - - curve.resize (17); - curve.at (0 ) = double (FCT_MinMaxCPoints); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } + return !(*this == other); } - -void RetinexParams::setDefaults() +ColorToningParams::ColorToningParams() : + enabled(false), + autosat(true), + opacityCurve{ + FCT_MinMaxCPoints, + 0.00, + 0.3, + 0.35, + 0.00, + 0.25, + 0.8, + 0.35, + 0.35, + 0.70, + 0.8, + 0.35, + 0.35, + 1.00, + 0.3, + 0.00, + 0.00 + }, + colorCurve{ + FCT_MinMaxCPoints, + 0.050, + 0.62, + 0.25, + 0.25, + 0.585, + 0.11, + 0.25, + 0.25 + }, + satProtectionThreshold(30), + saturatedOpacity(80), + strength(50), + balance(0), + hlColSat(60, 80, false), + shadowsColSat (80, 208, false), + clcurve{ + DCT_NURBS, + 0.00, + 0.00, + 0.35, + 0.65, + 1.00, + 1.00 + }, + cl2curve{ + DCT_NURBS, + 0.00, + 0.00, + 0.35, + 0.65, + 1.00, + 1.00 + }, + method("Lab"), + twocolor("Std"), + redlow(0.0), + greenlow(0.0), + bluelow(0.0), + redmed(0.0), + greenmed(0.0), + bluemed(0.0), + redhigh(0.0), + greenhigh(0.0), + bluehigh(0.0), + satlow(0.0), + sathigh(0.0), + lumamode(true) { - enabled = false; - str = 20; - scal = 3; - iter = 1; - grad = 1; - grads = 1; - gam = 1.30; - slope = 3.; - neigh = 80; - offs = 0; - vart = 200; - limd = 8; - highl = 4; - highlights = 0; - htonalwidth = 80; - shadows = 0; - stonalwidth = 80; - radius = 40; - - skal = 3; - retinexMethod = "high"; - mapMethod = "none"; - viewMethod = "none"; - retinexcolorspace = "Lab"; - gammaretinex = "none"; - medianmap = false; - cdcurve.clear(); - cdcurve.push_back (DCT_Linear); - cdHcurve.clear(); - cdHcurve.push_back (DCT_Linear); - lhcurve.clear(); - lhcurve.push_back (DCT_Linear); - mapcurve.clear(); - mapcurve.push_back (DCT_Linear); - getDefaultgaintransmissionCurve (gaintransmissionCurve); - - getDefaulttransmissionCurve (transmissionCurve); } -void RetinexParams::getCurves (RetinextransmissionCurve &transmissionCurveLUT, RetinexgaintransmissionCurve &gaintransmissionCurveLUT) const +bool ColorToningParams::operator ==(const ColorToningParams& other) const { - transmissionCurveLUT.Set (this->transmissionCurve); - gaintransmissionCurveLUT.Set (this->gaintransmissionCurve); - + return + enabled == other.enabled + && autosat == other.autosat + && opacityCurve == other.opacityCurve + && colorCurve == other.colorCurve + && satProtectionThreshold == other.satProtectionThreshold + && saturatedOpacity == other.saturatedOpacity + && strength == other.strength + && balance == other.balance + && hlColSat == other.hlColSat + && shadowsColSat == other.shadowsColSat + && clcurve == other.clcurve + && cl2curve == other.cl2curve + && method == other.method + && twocolor == other.twocolor + && redlow == other.redlow + && greenlow == other.greenlow + && bluelow == other.bluelow + && redmed == other.redmed + && greenmed == other.greenmed + && bluemed == other.bluemed + && redhigh == other.redhigh + && greenhigh == other.greenhigh + && bluehigh == other.bluehigh + && satlow == other.satlow + && sathigh == other.sathigh + && lumamode == other.lumamode; } - -ColorToningParams::ColorToningParams () : hlColSat (60, 80, false), shadowsColSat (80, 208, false) +bool ColorToningParams::operator !=(const ColorToningParams& other) const { - setDefaults(); + return !(*this == other); } -void ColorToningParams::getDefaultColorCurve (std::vector &curve) -{ - double v[8] = { 0.050, 0.62, 0.25, 0.25, - 0.585, 0.11, 0.25, 0.25 - }; - - curve.resize (9); - curve.at (0) = double (FCT_MinMaxCPoints); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } -} - - -void ColorToningParams::getDefaultOpacityCurve (std::vector &curve) -{ - double v[16] = { 0.00, 0.3, 0.35, 0.00, - 0.25, 0.8, 0.35, 0.35, - 0.70, 0.8, 0.35, 0.35, - 1.00, 0.3, 0.00, 0.00 - }; - curve.resize (17); - curve.at (0 ) = double (FCT_MinMaxCPoints); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } -} - -void ColorToningParams::getDefaultCLCurve (std::vector &curve) -{ - double v[6] = { 0.00, 0.00, - 0.35, 0.65, - 1.00, 1.00 - }; - - curve.resize (7); - curve.at (0) = double (DCT_NURBS); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } -} - -void ColorToningParams::getDefaultCL2Curve (std::vector &curve) -{ - double v[6] = { 0.00, 0.00, - 0.35, 0.65, - 1.00, 1.00 - }; - - curve.resize (7); - curve.at (0) = double (DCT_NURBS); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } -} - -void ColorToningParams::setDefaults() -{ - enabled = false; - autosat = true; - method = "Lab"; - - getDefaultColorCurve (colorCurve); - getDefaultOpacityCurve (opacityCurve); - getDefaultCLCurve (clcurve); - getDefaultCL2Curve (cl2curve); - - hlColSat.setValues (60, 80); - shadowsColSat.setValues (80, 208); - balance = 0; - satProtectionThreshold = 30; - saturatedOpacity = 80; - strength = 50; - lumamode = true; - twocolor = "Std"; - redlow = 0.0; - greenlow = 0.0; - bluelow = 0.0; - satlow = 0.0; - sathigh = 0.0; - redmed = 0.0; - greenmed = 0.0; - bluemed = 0.0; - redhigh = 0.0; - greenhigh = 0.0; - bluehigh = 0.0; -} - -void ColorToningParams::mixerToCurve (std::vector &colorCurve, std::vector &opacityCurve) const +void ColorToningParams::mixerToCurve(std::vector& colorCurve, std::vector& opacityCurve) const { // check if non null first if (!redlow && !greenlow && !bluelow && !redmed && !greenmed && !bluemed && !redhigh && !greenhigh && !bluehigh) { @@ -456,15 +845,10 @@ void ColorToningParams::mixerToCurve (std::vector &colorCurve, std::vect high[0] = high[1] = high[2] = 1.f; } - - - const double xPosLow = 0.1; const double xPosMed = 0.4; const double xPosHigh = 0.7; - - colorCurve.resize ( medSat != 0.f ? 13 : 9 ); colorCurve.at (0) = FCT_MinMaxCPoints; opacityCurve.resize (13); @@ -525,9 +909,9 @@ void ColorToningParams::mixerToCurve (std::vector &colorCurve, std::vect opacityCurve.at (12) = 0.35; } -void ColorToningParams::slidersToCurve (std::vector &colorCurve, std::vector &opacityCurve) const +void ColorToningParams::slidersToCurve(std::vector& colorCurve, std::vector& opacityCurve) const { - if (hlColSat.value[0] == 0 && shadowsColSat.value[0] == 0) { // if both opacity are null, set both curves to Linear + if (hlColSat.getBottom() == 0 && shadowsColSat.getBottom() == 0) { // if both opacity are null, set both curves to Linear colorCurve.resize (1); colorCurve.at (0) = FCT_Linear; opacityCurve.resize (1); @@ -538,27 +922,27 @@ void ColorToningParams::slidersToCurve (std::vector &colorCurve, std::ve colorCurve.resize (9); colorCurve.at (0) = FCT_MinMaxCPoints; colorCurve.at (1) = 0.26 + 0.12 * double (balance) / 100.; - colorCurve.at (2) = double (shadowsColSat.value[1]) / 360.; + colorCurve.at (2) = double (shadowsColSat.getTop()) / 360.; colorCurve.at (3) = 0.35; colorCurve.at (4) = 0.35; colorCurve.at (5) = 0.64 + 0.12 * double (balance) / 100.; - colorCurve.at (6) = double (hlColSat.value[1]) / 360.; + colorCurve.at (6) = double (hlColSat.getTop()) / 360.; colorCurve.at (7) = 0.35; colorCurve.at (8) = 0.35; opacityCurve.resize (9); opacityCurve.at (0) = FCT_MinMaxCPoints; opacityCurve.at (1) = colorCurve.at (1); - opacityCurve.at (2) = double (shadowsColSat.value[0]) / 100.; + opacityCurve.at (2) = double (shadowsColSat.getBottom()) / 100.; opacityCurve.at (3) = 0.35; opacityCurve.at (4) = 0.35; opacityCurve.at (5) = colorCurve.at (5); - opacityCurve.at (6) = double (hlColSat.value[0]) / 100.; + opacityCurve.at (6) = double (hlColSat.getBottom()) / 100.; opacityCurve.at (7) = 0.35; opacityCurve.at (8) = 0.35; } -void ColorToningParams::getCurves (ColorGradientCurve &colorCurveLUT, OpacityCurve &opacityCurveLUT, const double xyz_rgb[3][3], bool &opautili) const +void ColorToningParams::getCurves(ColorGradientCurve& colorCurveLUT, OpacityCurve& opacityCurveLUT, const double xyz_rgb[3][3], bool& opautili) const { float satur = 0.8f; float lumin = 0.5f; //middle of luminance for optimization of gamut - no real importance...as we work in XYZ and gamut control @@ -596,131 +980,1242 @@ void ColorToningParams::getCurves (ColorGradientCurve &colorCurveLUT, OpacityCur } SharpeningParams::SharpeningParams() : - enabled (false), - radius (0.5), - amount (200), - threshold (20, 80, 2000, 1200, false), - edgesonly (false), - edges_radius (1.9), - edges_tolerance (1800), - halocontrol (false), - halocontrol_amount (85), - deconvamount (75), - deconvradius (0.75), - deconviter (30), - deconvdamping (20) -{}; + enabled(false), + radius(0.5), + amount(200), + threshold(20, 80, 2000, 1200, false), + edgesonly(false), + edges_radius(1.9), + edges_tolerance(1800), + halocontrol(false), + halocontrol_amount(85), + method("usm"), + deconvamount(75), + deconvradius(0.75), + deconviter(30), + deconvdamping(20) +{ +} +bool SharpeningParams::operator ==(const SharpeningParams& other) const +{ + return + enabled == other.enabled + && radius == other.radius + && amount == other.amount + && threshold == other.threshold + && edgesonly == other.edgesonly + && edges_radius == other.edges_radius + && edges_tolerance == other.edges_tolerance + && halocontrol == other.halocontrol + && halocontrol_amount == other.halocontrol_amount + && method == other.method + && deconvamount == other.deconvamount + && deconvradius == other.deconvradius + && deconviter == other.deconviter + && deconvdamping == other.deconvdamping; +} + +bool SharpeningParams::operator !=(const SharpeningParams& other) const +{ + return !(*this == other); +} + +SharpenEdgeParams::SharpenEdgeParams() : + enabled(false), + passes(2), + amount(50.0), + threechannels(false) +{ +} + +bool SharpenEdgeParams::operator ==(const SharpenEdgeParams& other) const +{ + return + enabled == other.enabled + && passes == other.passes + && amount == other.amount + && threechannels == other.threechannels; +} + +bool SharpenEdgeParams::operator !=(const SharpenEdgeParams& other) const +{ + return !(*this == other); +} + +SharpenMicroParams::SharpenMicroParams() : + enabled(false), + matrix(false), + amount(20.0), + uniformity(50.0) +{ +} + +bool SharpenMicroParams::operator ==(const SharpenMicroParams& other) const +{ + return + enabled == other.enabled + && matrix == other.matrix + && amount == other.amount + && uniformity == other.uniformity; +} + +bool SharpenMicroParams::operator !=(const SharpenMicroParams& other) const +{ + return !(*this == other); +} VibranceParams::VibranceParams() : - enabled (false), - pastels (0), - saturated (0), - psthreshold (0, 75, false), - protectskins (false), - avoidcolorshift (true), - pastsattog (true) -{}; + enabled(false), + pastels(0), + saturated(0), + psthreshold(0, 75, false), + protectskins(false), + avoidcolorshift(true), + pastsattog(true), + skintonescurve{ + DCT_Linear + } +{ +} +bool VibranceParams::operator ==(const VibranceParams& other) const +{ + return + enabled == other.enabled + && pastels == other.pastels + && saturated == other.saturated + && psthreshold == other.psthreshold + && protectskins == other.protectskins + && avoidcolorshift == other.avoidcolorshift + && pastsattog == other.pastsattog + && skintonescurve == other.skintonescurve; +} -//WaveletParams::WaveletParams (): hueskin(-5, 25, 170, 120, false), hueskin2(-260, -250, -130, -140, false), hllev(50, 75, 100, 98, false), bllev(0, 2, 50, 25, false), pastlev(0, 2, 30, 20, false), satlev(30, 45, 130, 100, false), edgcont(0, 20, 100, 75, false){ +bool VibranceParams::operator !=(const VibranceParams& other) const +{ + return !(*this == other); +} + +WBParams::WBParams() : + enabled(true), + method("Camera"), + temperature(6504), + green(1.0), + equal(1.0), + tempBias(0.0) +{ +} + +bool WBParams::operator ==(const WBParams& other) const +{ + return + enabled == other.enabled + && method == other.method + && temperature == other.temperature + && green == other.green + && equal == other.equal + && tempBias == other.tempBias; +} + +bool WBParams::operator !=(const WBParams& other) const +{ + return !(*this == other); +} + +const std::vector& WBParams::getWbEntries() +{ + static const std::vector wb_entries = { + {"Camera", WBEntry::Type::CAMERA, M("TP_WBALANCE_CAMERA"), 0, 1.f, 1.f, 0.f}, + {"Auto", WBEntry::Type::AUTO, M("TP_WBALANCE_AUTO"), 0, 1.f, 1.f, 0.f}, + {"Daylight", WBEntry::Type::DAYLIGHT, M("TP_WBALANCE_DAYLIGHT"), 5300, 1.f, 1.f, 0.f}, + {"Cloudy", WBEntry::Type::CLOUDY, M("TP_WBALANCE_CLOUDY"), 6200, 1.f, 1.f, 0.f}, + {"Shade", WBEntry::Type::SHADE, M("TP_WBALANCE_SHADE"), 7600, 1.f, 1.f, 0.f}, + {"Water 1", WBEntry::Type::WATER, M("TP_WBALANCE_WATER1"), 35000, 0.3f, 1.1f, 0.f}, + {"Water 2", WBEntry::Type::WATER, M("TP_WBALANCE_WATER2"), 48000, 0.63f, 1.38f, 0.f}, + {"Tungsten", WBEntry::Type::TUNGSTEN, M("TP_WBALANCE_TUNGSTEN"), 2856, 1.f, 1.f, 0.f}, + {"Fluo F1", WBEntry::Type::FLUORESCENT, M("TP_WBALANCE_FLUO1"), 6430, 1.f, 1.f, 0.f}, + {"Fluo F2", WBEntry::Type::FLUORESCENT, M("TP_WBALANCE_FLUO2"), 4230, 1.f, 1.f, 0.f}, + {"Fluo F3", WBEntry::Type::FLUORESCENT, M("TP_WBALANCE_FLUO3"), 3450, 1.f, 1.f, 0.f}, + {"Fluo F4", WBEntry::Type::FLUORESCENT, M("TP_WBALANCE_FLUO4"), 2940, 1.f, 1.f, 0.f}, + {"Fluo F5", WBEntry::Type::FLUORESCENT, M("TP_WBALANCE_FLUO5"), 6350, 1.f, 1.f, 0.f}, + {"Fluo F6", WBEntry::Type::FLUORESCENT, M("TP_WBALANCE_FLUO6"), 4150, 1.f, 1.f, 0.f}, + {"Fluo F7", WBEntry::Type::FLUORESCENT, M("TP_WBALANCE_FLUO7"), 6500, 1.f, 1.f, 0.f}, + {"Fluo F8", WBEntry::Type::FLUORESCENT, M("TP_WBALANCE_FLUO8"), 5020, 1.f, 1.f, 0.f}, + {"Fluo F9", WBEntry::Type::FLUORESCENT, M("TP_WBALANCE_FLUO9"), 4330, 1.f, 1.f, 0.f}, + {"Fluo F10", WBEntry::Type::FLUORESCENT, M("TP_WBALANCE_FLUO10"), 5300, 1.f, 1.f, 0.f}, + {"Fluo F11", WBEntry::Type::FLUORESCENT, M("TP_WBALANCE_FLUO11"), 4000, 1.f, 1.f, 0.f}, + {"Fluo F12", WBEntry::Type::FLUORESCENT, M("TP_WBALANCE_FLUO12"), 3000, 1.f, 1.f, 0.f}, + {"HMI Lamp", WBEntry::Type::LAMP, M("TP_WBALANCE_HMI"), 4800, 1.f, 1.f, 0.f}, + {"GTI Lamp", WBEntry::Type::LAMP, M("TP_WBALANCE_GTI"), 5000, 1.f, 1.f, 0.f}, + {"JudgeIII Lamp", WBEntry::Type::LAMP, M("TP_WBALANCE_JUDGEIII"), 5100, 1.f, 1.f, 0.f}, + {"Solux Lamp 3500K", WBEntry::Type::LAMP, M("TP_WBALANCE_SOLUX35"), 3480, 1.f, 1.f, 0.f}, + {"Solux Lamp 4100K", WBEntry::Type::LAMP, M("TP_WBALANCE_SOLUX41"), 3930, 1.f, 1.f, 0.f}, + {"Solux Lamp 4700K", WBEntry::Type::LAMP, M("TP_WBALANCE_SOLUX47"), 4700, 1.f, 1.f, 0.f}, + {"NG Solux Lamp 4700K", WBEntry::Type::LAMP, M("TP_WBALANCE_SOLUX47_NG"), 4480, 1.f, 1.f, 0.f}, + {"LED LSI Lumelex 2040", WBEntry::Type::LED, M("TP_WBALANCE_LED_LSI"), 2970, 1.f, 1.f, 0.f}, + {"LED CRS SP12 WWMR16", WBEntry::Type::LED, M("TP_WBALANCE_LED_CRS"), 3050, 1.f, 1.f, 0.f}, + {"Flash 5500K", WBEntry::Type::FLASH, M("TP_WBALANCE_FLASH55"), 5500, 1.f, 1.f, 0.f}, + {"Flash 6000K", WBEntry::Type::FLASH, M("TP_WBALANCE_FLASH60"), 6000, 1.f, 1.f, 0.f}, + {"Flash 6500K", WBEntry::Type::FLASH, M("TP_WBALANCE_FLASH65"), 6500, 1.f, 1.f, 0.f}, + // Should remain the last one + {"Custom", WBEntry::Type::CUSTOM, M ("TP_WBALANCE_CUSTOM"), 0, 1.f, 1.f, 0.f} + }; + + return wb_entries; +} + +ColorAppearanceParams::ColorAppearanceParams() : + enabled(false), + degree(90), + autodegree(true), + degreeout(90), + autodegreeout(true), + curve{ + DCT_Linear + }, + curve2{ + DCT_Linear + }, + curve3{ + DCT_Linear + }, + curveMode(TcMode::LIGHT), + curveMode2(TcMode::LIGHT), + curveMode3(CtcMode::CHROMA), + surround("Average"), + surrsrc("Average"), + adapscen(2000.0), + autoadapscen(true), + ybscen(18), + autoybscen(true), + adaplum(16), + badpixsl(0), + wbmodel("RawT"), + algo("No"), + contrast(0.0), + qcontrast(0.0), + jlight(0.0), + qbright(0.0), + chroma(0.0), + schroma(0.0), + mchroma(0.0), + colorh(0.0), + rstprotection(0.0), + surrsource(false), + gamut(true), + datacie(false), + tonecie(false), + tempout(5000), + ybout(18), + greenout(1.0), + tempsc(5000), + greensc(1.0) +{ +} + +bool ColorAppearanceParams::operator ==(const ColorAppearanceParams& other) const +{ + return + enabled == other.enabled + && degree == other.degree + && autodegree == other.autodegree + && degreeout == other.degreeout + && autodegreeout == other.autodegreeout + && curve == other.curve + && curve2 == other.curve2 + && curve3 == other.curve3 + && curveMode == other.curveMode + && curveMode2 == other.curveMode2 + && curveMode3 == other.curveMode3 + && surround == other.surround + && surrsrc == other.surrsrc + && adapscen == other.adapscen + && autoadapscen == other.autoadapscen + && ybscen == other.ybscen + && autoybscen == other.autoybscen + && adaplum == other.adaplum + && badpixsl == other.badpixsl + && wbmodel == other.wbmodel + && algo == other.algo + && contrast == other.contrast + && qcontrast == other.qcontrast + && jlight == other.jlight + && qbright == other.qbright + && chroma == other.chroma + && schroma == other.schroma + && mchroma == other.mchroma + && colorh == other.colorh + && rstprotection == other.rstprotection + && surrsource == other.surrsource + && gamut == other.gamut + && datacie == other.datacie + && tonecie == other.tonecie + && tempout == other.tempout + && ybout == other.ybout + && greenout == other.greenout + && tempsc == other.tempsc + && greensc == other.greensc; +} + +bool ColorAppearanceParams::operator !=(const ColorAppearanceParams& other) const +{ + return !(*this == other); +} + +DefringeParams::DefringeParams() : + enabled(false), + radius(2.0), + threshold(13), + huecurve{ + FCT_MinMaxCPoints, + 0.166666667, + 0., + 0.35, + 0.35, + 0.347, + 0., + 0.35, + 0.35, + 0.513667426, + 0, + 0.35, + 0.35, + 0.668944571, + 0., + 0.35, + 0.35, + 0.8287775246, + 0.97835991, + 0.35, + 0.35, + 0.9908883827, + 0., + 0.35, + 0.35 + } +{ +} + +bool DefringeParams::operator ==(const DefringeParams& other) const +{ + return + enabled == other.enabled + && radius == other.radius + && threshold == other.threshold + && huecurve == other.huecurve; +} + +bool DefringeParams::operator !=(const DefringeParams& other) const +{ + return !(*this == other); +} + +ImpulseDenoiseParams::ImpulseDenoiseParams() : + enabled(false), + thresh(50) +{ +} + +bool ImpulseDenoiseParams::operator ==(const ImpulseDenoiseParams& other) const +{ + return + enabled == other.enabled + && thresh == other.thresh; +} + +bool ImpulseDenoiseParams::operator !=(const ImpulseDenoiseParams& other) const +{ + return !(*this == other); +} + +DirPyrDenoiseParams::DirPyrDenoiseParams() : + lcurve{ + FCT_MinMaxCPoints, + 0.05, + 0.15, + 0.35, + 0.35, + 0.55, + 0.04, + 0.35, + 0.35 + }, + cccurve{ + FCT_MinMaxCPoints, + 0.05, + 0.50, + 0.35, + 0.35, + 0.35, + 0.05, + 0.35, + 0.35 + }, + enabled(false), + enhance(false), + median(false), + perform(false), + luma(0), + Ldetail(0), + chroma(15), + redchro(0), + bluechro(0), + gamma(1.7), + dmethod("Lab"), + Lmethod("SLI"), + Cmethod("MAN"), + C2method("AUTO"), + smethod("shal"), + medmethod("soft"), + methodmed("none"), + rgbmethod("soft"), + passes(1) +{ +} + +bool DirPyrDenoiseParams::operator ==(const DirPyrDenoiseParams& other) const +{ + return + lcurve == other.lcurve + && cccurve == other.cccurve + && enabled == other.enabled + && enhance == other.enhance + && median == other.median + && perform == other.perform + && luma == other.luma + && Ldetail == other.Ldetail + && chroma == other.chroma + && redchro == other.redchro + && bluechro == other.bluechro + && gamma == other.gamma + && dmethod == other.dmethod + && Lmethod == other.Lmethod + && Cmethod == other.Cmethod + && C2method == other.C2method + && smethod == other.smethod + && medmethod == other.medmethod + && methodmed == other.methodmed + && rgbmethod == other.rgbmethod + && passes == other.passes; +} + +bool DirPyrDenoiseParams::operator !=(const DirPyrDenoiseParams& other) const +{ + return !(*this == other); +} + +void DirPyrDenoiseParams::getCurves (NoiseCurve &lCurve, NoiseCurve &cCurve) const +{ + lCurve.Set(this->lcurve); + cCurve.Set(this->cccurve); +} + +EPDParams::EPDParams() : + enabled(false), + strength(0.5), + gamma(1.0), + edgeStopping(1.4), + scale(1.0), + reweightingIterates(0) +{ +} + +bool EPDParams::operator ==(const EPDParams& other) const +{ + return + enabled == other.enabled + && strength == other.strength + && gamma == other.gamma + && edgeStopping == other.edgeStopping + && scale == other.scale + && reweightingIterates == other.reweightingIterates; +} + +bool EPDParams::operator !=(const EPDParams& other) const +{ + return !(*this == other); +} + +FattalToneMappingParams::FattalToneMappingParams() : + enabled(false), + threshold(0), + amount(1) +{ +} + +bool FattalToneMappingParams::operator ==(const FattalToneMappingParams& other) const +{ + return + enabled == other.enabled + && threshold == other.threshold + && amount == other.amount; +} + +bool FattalToneMappingParams::operator !=(const FattalToneMappingParams& other) const +{ + return !(*this == other); +} + +SHParams::SHParams() : + enabled(false), + hq(false), + highlights(0), + htonalwidth(80), + shadows(0), + stonalwidth(80), + localcontrast(0), + radius(40) +{ +} + +bool SHParams::operator ==(const SHParams& other) const +{ + return + enabled == other.enabled + && hq == other.hq + && highlights == other.highlights + && htonalwidth == other.htonalwidth + && shadows == other.shadows + && stonalwidth == other.stonalwidth + && localcontrast == other.localcontrast + && radius == other.radius; +} + +bool SHParams::operator !=(const SHParams& other) const +{ + return !(*this == other); +} + +CropParams::CropParams() : + enabled(false), + x(-1), + y(-1), + w(15000), + h(15000), + fixratio(true), + ratio("3:2"), + orientation("As Image"), + guide("Frame") +{ +} + +bool CropParams::operator ==(const CropParams& other) const +{ + return + enabled == other.enabled + && x == other.x + && y == other.y + && w == other.w + && h == other.h + && fixratio == other.fixratio + && ratio == other.ratio + && orientation == other.orientation + && guide == other.guide; +} + +bool CropParams::operator !=(const CropParams& other) const +{ + return !(*this == other); +} + +void CropParams::mapToResized(int resizedWidth, int resizedHeight, int scale, int& x1, int& x2, int& y1, int& y2) const +{ + x1 = 0, x2 = resizedWidth, y1 = 0, y2 = resizedHeight; + + if (enabled) { + x1 = min(resizedWidth - 1, max (0, x / scale)); + y1 = min(resizedHeight - 1, max (0, y / scale)); + x2 = min(resizedWidth, max (0, (x + w) / scale)); + y2 = min(resizedHeight, max (0, (y + h) / scale)); + } +} + +CoarseTransformParams::CoarseTransformParams() : + rotate(0), + hflip(false), + vflip(false) +{ +} + +bool CoarseTransformParams::operator ==(const CoarseTransformParams& other) const +{ + return + rotate == other.rotate + && hflip == other.hflip + && vflip == other.vflip; +} + +bool CoarseTransformParams::operator !=(const CoarseTransformParams& other) const +{ + return !(*this == other); +} + +CommonTransformParams::CommonTransformParams() : + autofill(true) +{ +} + +bool CommonTransformParams::operator ==(const CommonTransformParams& other) const +{ + return autofill == other.autofill; +} + +bool CommonTransformParams::operator !=(const CommonTransformParams& other) const +{ + return !(*this == other); +} + +RotateParams::RotateParams() : + degree(0.0) +{ +} + +bool RotateParams::operator ==(const RotateParams& other) const +{ + return degree == other.degree; +} + +bool RotateParams::operator !=(const RotateParams& other) const +{ + return !(*this == other); +} + +DistortionParams::DistortionParams() : + amount(0.0) +{ +} + +bool DistortionParams::operator ==(const DistortionParams& other) const +{ + return amount == other.amount; +} + +bool DistortionParams::operator !=(const DistortionParams& other) const +{ + return !(*this == other); +} + +LensProfParams::LensProfParams() : + lcMode(LcMode::NONE), + useDist(true), + useVign(true), + useCA(false) +{ +} + +bool LensProfParams::operator ==(const LensProfParams& other) const +{ + return + lcMode == other.lcMode + && lcpFile == other.lcpFile + && useCA == other.useCA + && lfCameraMake == other.lfCameraMake + && lfCameraModel == other.lfCameraModel + && lfLens == other.lfLens; +} + +bool LensProfParams::operator !=(const LensProfParams& other) const +{ + return !(*this == other); +} + +bool LensProfParams::useLensfun() const +{ + return lcMode == LcMode::LENSFUNAUTOMATCH || lcMode == LcMode::LENSFUNMANUAL; +} + +bool LensProfParams::lfAutoMatch() const +{ + return lcMode == LcMode::LENSFUNAUTOMATCH; +} + +bool LensProfParams::useLcp() const +{ + return lcMode == LcMode::LCP && lcpFile.length() > 0; +} + +bool LensProfParams::lfManual() const +{ + return lcMode == LcMode::LENSFUNMANUAL; +} + +const std::vector& LensProfParams::getMethodStrings() const +{ + static const std::vector method_strings = { + "none", + "lfauto", + "lfmanual", + "lcp" + }; + return method_strings; +} + +Glib::ustring LensProfParams::getMethodString(LcMode mode) const +{ + return getMethodStrings()[toUnderlying(mode)]; +} + +LensProfParams::LcMode LensProfParams::getMethodNumber(const Glib::ustring& mode) const +{ + for (std::vector::size_type i = 0; i < getMethodStrings().size(); ++i) { + if (getMethodStrings()[i] == mode) { + return static_cast(i); + } + } + return LcMode::NONE; +} + +PerspectiveParams::PerspectiveParams() : + horizontal(0.0), + vertical(0.0) +{ +} + +bool PerspectiveParams::operator ==(const PerspectiveParams& other) const +{ + return + horizontal == other.horizontal + && vertical == other.vertical; +} + +bool PerspectiveParams::operator !=(const PerspectiveParams& other) const +{ + return !(*this == other); +} + +GradientParams::GradientParams() : + enabled(false), + degree(0.0), + feather(25), + strength(0.60), + centerX(0), + centerY(0) +{ +} + +bool GradientParams::operator ==(const GradientParams& other) const +{ + return + enabled == other.enabled + && degree == other.degree + && feather == other.feather + && strength == other.strength + && centerX == other.centerX + && centerY == other.centerY; +} + +bool GradientParams::operator !=(const GradientParams& other) const +{ + return !(*this == other); +} + +PCVignetteParams::PCVignetteParams() : + enabled(false), + strength(0.60), + feather(50), + roundness(50) +{ +} + +bool PCVignetteParams::operator ==(const PCVignetteParams& other) const +{ + return + enabled == other.enabled + && strength == other.strength + && feather == other.feather + && roundness == other.roundness; +} + +bool PCVignetteParams::operator !=(const PCVignetteParams& other) const +{ + return !(*this == other); +} + +VignettingParams::VignettingParams() : + amount(0), + radius(50), + strength(1), + centerX(0), + centerY(0) +{ +} + +bool VignettingParams::operator ==(const VignettingParams& other) const +{ + return + amount == other.amount + && radius == other.radius + && strength == other.strength + && centerX == other.centerX + && centerY == other.centerY; +} + +bool VignettingParams::operator !=(const VignettingParams& other) const +{ + return !(*this == other); +} + +ChannelMixerParams::ChannelMixerParams() : + enabled(false), + red{ + 100, + 0, + 0 + }, + green{ + 0, + 100, + 0 + }, + blue{ + 0, + 0, + 100 + } +{ +} + +bool ChannelMixerParams::operator ==(const ChannelMixerParams& other) const +{ + if (enabled != other.enabled) { + return false; + } + for (unsigned int i = 0; i < 3; ++i) { + if ( + red[i] != other.red[i] + || green[i] != other.green[i] + || blue[i] != other.blue[i] + ) { + return false; + } + } + return true; +} + +bool ChannelMixerParams::operator !=(const ChannelMixerParams& other) const +{ + return !(*this == other); +} + +BlackWhiteParams::BlackWhiteParams() : + beforeCurve{ + DCT_Linear + }, + beforeCurveMode(BlackWhiteParams::TcMode::STD_BW), + afterCurve{ + DCT_Linear + }, + afterCurveMode(BlackWhiteParams::TcMode::STD_BW), + algo("SP"), + luminanceCurve{ + FCT_Linear + }, + autoc(false), + enabledcc(true), + enabled(false), + filter("None"), + setting("NormalContrast"), + method("Desaturation"), + mixerRed(33), + mixerOrange(33), + mixerYellow(33), + mixerGreen(33), + mixerCyan(33), + mixerBlue(33), + mixerMagenta(33), + mixerPurple(33), + gammaRed(0), + gammaGreen(0), + gammaBlue(0) +{ +} + +bool BlackWhiteParams::operator ==(const BlackWhiteParams& other) const +{ + return + beforeCurve == other.beforeCurve + && beforeCurveMode == other.beforeCurveMode + && afterCurve == other.afterCurve + && afterCurveMode == other.afterCurveMode + && algo == other.algo + && luminanceCurve == other.luminanceCurve + && autoc == other.autoc + && enabledcc == other.enabledcc + && enabled == other.enabled + && filter == other.filter + && setting == other.setting + && method == other.method + && mixerRed == other.mixerRed + && mixerOrange == other.mixerOrange + && mixerYellow == other.mixerYellow + && mixerGreen == other.mixerGreen + && mixerCyan == other.mixerCyan + && mixerBlue == other.mixerBlue + && mixerMagenta == other.mixerMagenta + && mixerPurple == other.mixerPurple + && gammaRed == other.gammaRed + && gammaGreen == other.gammaGreen + && gammaBlue == other.gammaBlue; +} + +bool BlackWhiteParams::operator !=(const BlackWhiteParams& other) const +{ + return !(*this == other); +} + +CACorrParams::CACorrParams() : + red(0.0), + blue(0.0) +{ +} + +bool CACorrParams::operator ==(const CACorrParams& other) const +{ + return + red == other.red + && blue == other.blue; +} + +bool CACorrParams::operator !=(const CACorrParams& other) const +{ + return !(*this == other); +} + +ResizeParams::ResizeParams() : + enabled(false), + scale(1.0), + appliesTo("Cropped area"), + method("Lanczos"), + dataspec(3), + width(900), + height(900) +{ +} + +bool ResizeParams::operator ==(const ResizeParams& other) const +{ + return + enabled == other.enabled + && scale == other.scale + && appliesTo == other.appliesTo + && method == other.method + && dataspec == other.dataspec + && width == other.width + && height == other.height; +} + +bool ResizeParams::operator !=(const ResizeParams& other) const +{ + return !(*this == other); +} + +const Glib::ustring ColorManagementParams::NoICMString = Glib::ustring ("No ICM: sRGB output"); + +ColorManagementParams::ColorManagementParams() : + input("(cameraICC)"), + toneCurve(false), + applyLookTable(false), + applyBaselineExposureOffset(true), + applyHueSatMap(true), + dcpIlluminant(0), + working("ProPhoto"), + output("RT_sRGB"), + outputIntent(RI_RELATIVE), + outputBPC(true), + gamma("default"), + gampos(2.22), + slpos(4.5), + freegamma(false) +{ +} + +bool ColorManagementParams::operator ==(const ColorManagementParams& other) const +{ + return + input == other.input + && toneCurve == other.toneCurve + && applyLookTable == other.applyLookTable + && applyBaselineExposureOffset == other.applyBaselineExposureOffset + && applyHueSatMap == other.applyHueSatMap + && dcpIlluminant == other.dcpIlluminant + && working == other.working + && output == other.output + && outputIntent == other.outputIntent + && outputBPC == other.outputBPC + && gamma == other.gamma + && gampos == other.gampos + && slpos == other.slpos + && freegamma == other.freegamma; +} + +bool ColorManagementParams::operator !=(const ColorManagementParams& other) const +{ + return !(*this == other); +} WaveletParams::WaveletParams() : - hueskin ( -5, 25, 170, 120, false), - hueskin2 (-260, -250, -130, -140, false), - hllev ( 50, 75, 100, 98, false), - bllev ( 0, 2, 50, 25, false), - pastlev ( 0, 2, 30, 20, false), - satlev ( 30, 45, 130, 100, false), - edgcont ( bl, tl, br, tr, false), - /*edgcont ( 0, 10, 75, 40, false),*/ - level0noise (0, 0, false), - level1noise (0, 0, false), - level2noise (0, 0, false), - level3noise (0, 0, false) + ccwcurve{ + static_cast(FCT_MinMaxCPoints), + 0.0, + 0.25, + 0.35, + 0.35, + 0.50, + 0.75, + 0.35, + 0.35, + 0.90, + 0.0, + 0.35, + 0.35 + }, + opacityCurveRG{ + static_cast(FCT_MinMaxCPoints), + 0.0, + 0.50, + 0.35, + 0.35, + 1.00, + 0.50, + 0.35, + 0.35 + }, + opacityCurveBY{ + static_cast(FCT_MinMaxCPoints), + 0.0, + 0.50, + 0.35, + 0.35, + 1.00, + 0.50, + 0.35, + 0.35 + }, + opacityCurveW{ + static_cast(FCT_MinMaxCPoints), + 0.00, + 0.35, + 0.35, + 0.00, + 0.35, + 0.75, + 0.35, + 0.35, + 0.60, + 0.75, + 0.35, + 0.35, + 1.00, + 0.35, + 0.00, + 0.00 + }, + opacityCurveWL{ + static_cast(FCT_MinMaxCPoints), + 0.0, + 0.50, + 0.35, + 0.35, + 1.00, + 0.50, + 0.35, + 0.35 + }, + hhcurve{ + FCT_Linear + }, + Chcurve{ + FCT_Linear + }, + wavclCurve { + DCT_Linear + }, + enabled(false), + median(false), + medianlev(false), + linkedg(true), + cbenab(false), + greenlow(0), + bluelow(0), + greenmed(0), + bluemed(0), + greenhigh(0), + bluehigh(0), + lipst(false), + avoid(false), + tmr(false), + strength(100), + balance(0), + iter(0), + expcontrast(false), + expchroma(false), + c{}, + ch{}, + expedge(false), + expresid(false), + expfinal(false), + exptoning(false), + expnoise(false), + Lmethod("4_"), + CLmethod("all"), + Backmethod("grey"), + Tilesmethod("full"), + daubcoeffmethod("4_"), + CHmethod("without"), + Medgreinf("less"), + CHSLmethod("SL"), + EDmethod("CU"), + NPmethod("none"), + BAmethod("none"), + TMmethod("cont"), + Dirmethod("all"), + HSmethod("with"), + rescon(0), + resconH(0), + reschro(0), + tmrs(0), + gamma(1), + sup(0), + sky(0.0), + thres(7), + chroma(5), + chro(0), + threshold(5), + threshold2(4), + edgedetect(90), + edgedetectthr(20), + edgedetectthr2(0), + edgesensi(60), + edgeampli(10), + contrast(0), + edgrad(15), + edgval(0), + edgthresh(10), + thr(35), + thrH(65), + skinprotect(0.0), + hueskin(-5, 25, 170, 120, false), + hueskin2(-260, -250, -130, -140, false), + hllev(50, 75, 100, 98, false), + bllev(0, 2, 50, 25, false), + pastlev(0, 2, 30, 20, false), + satlev(30, 45, 130, 100, false), + edgcont(0, 10, 75, 40, false), + level0noise(0, 0, false), + level1noise(0, 0, false), + level2noise(0, 0, false), + level3noise(0, 0, false) { - setDefaults (); } -void WaveletParams::getDefaultOpacityCurveRG (std::vector &curve) +bool WaveletParams::operator ==(const WaveletParams& other) const { - double v[8] = { 0.0, 0.50, 0.35, 0.35, - 1.00, 0.50, 0.35, 0.35 - }; - - curve.resize (9); - curve.at (0) = double (FCT_MinMaxCPoints); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } -} -void WaveletParams::getDefaultOpacityCurveBY (std::vector &curve) -{ - double v[8] = { 0.0, 0.50, 0.35, 0.35, - 1.00, 0.50, 0.35, 0.35 - }; - - curve.resize (9); - curve.at (0 ) = double (FCT_MinMaxCPoints); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } + return + ccwcurve == other.ccwcurve + && opacityCurveRG == other.opacityCurveRG + && opacityCurveBY == other.opacityCurveBY + && opacityCurveW == other.opacityCurveW + && opacityCurveWL == other.opacityCurveWL + && hhcurve == other.hhcurve + && Chcurve == other.Chcurve + && wavclCurve == other.wavclCurve + && enabled == other.enabled + && median == other.median + && medianlev == other.medianlev + && linkedg == other.linkedg + && cbenab == other.cbenab + && greenlow == other.greenlow + && bluelow == other.bluelow + && greenmed == other.greenmed + && bluemed == other.bluemed + && greenhigh == other.greenhigh + && bluehigh == other.bluehigh + && lipst == other.lipst + && avoid == other.avoid + && tmr == other.tmr + && strength == other.strength + && balance == other.balance + && iter == other.iter + && expcontrast == other.expcontrast + && expchroma == other.expchroma + && [this, &other]() -> bool + { + for (unsigned int i = 0; i < 9; ++i) { + if (c[i] != other.c[i] || ch[i] != other.ch[i]) { + return false; + } + } + return true; + }() + && expedge == other.expedge + && expresid == other.expresid + && expfinal == other.expfinal + && exptoning == other.exptoning + && expnoise == other.expnoise + && Lmethod == other.Lmethod + && CLmethod == other.CLmethod + && Backmethod == other.Backmethod + && Tilesmethod == other.Tilesmethod + && daubcoeffmethod == other.daubcoeffmethod + && CHmethod == other.CHmethod + && Medgreinf == other.Medgreinf + && CHSLmethod == other.CHSLmethod + && EDmethod == other.EDmethod + && NPmethod == other.NPmethod + && BAmethod == other.BAmethod + && TMmethod == other.TMmethod + && Dirmethod == other.Dirmethod + && HSmethod == other.HSmethod + && rescon == other.rescon + && resconH == other.resconH + && reschro == other.reschro + && tmrs == other.tmrs + && gamma == other.gamma + && sup == other.sup + && sky == other.sky + && thres == other.thres + && chroma == other.chroma + && chro == other.chro + && threshold == other.threshold + && threshold2 == other.threshold2 + && edgedetect == other.edgedetect + && edgedetectthr == other.edgedetectthr + && edgedetectthr2 == other.edgedetectthr2 + && edgesensi == other.edgesensi + && edgeampli == other.edgeampli + && contrast == other.contrast + && edgrad == other.edgrad + && edgval == other.edgval + && edgthresh == other.edgthresh + && thr == other.thr + && thrH == other.thrH + && skinprotect == other.skinprotect + && hueskin == other.hueskin + && hueskin2 == other.hueskin2 + && hllev == other.hllev + && bllev == other.bllev + && pastlev == other.pastlev + && satlev == other.satlev + && edgcont == other.edgcont + && level0noise == other.level0noise + && level1noise == other.level1noise + && level2noise == other.level2noise + && level3noise == other.level3noise; } - -void WaveletParams::getDefaultOpacityCurveW (std::vector &curve) +bool WaveletParams::operator !=(const WaveletParams& other) const { - double v[16] = { 0.00, 0.35, 0.35, 0.00, - 0.35, 0.75, 0.35, 0.35, - 0.60, 0.75, 0.35, 0.35, - 1.00, 0.35, 0.00, 0.00 - }; - curve.resize (17); - curve.at (0) = double (FCT_MinMaxCPoints); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } + return !(*this == other); } -void WaveletParams::getDefaultOpacityCurveWL (std::vector &curve) -{ - double v[8] = { 0.0, 0.50, 0.35, 0.35, - 1.00, 0.50, 0.35, 0.35 - }; - - /*double v[12]={ 0.00, 0.53, 0.35, 0.00, - 0.42, 0.53, 0.35, 0.35, - 1.00, 0.15, 0.00, 0.00 }; - */ - curve.resize (9); - curve.at (0) = double (FCT_MinMaxCPoints); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } -} - - -void WaveletParams::getDefaultCCWCurve (std::vector &curve) -{ - double v[12] = { 0.0, 0.25, 0.35, 0.35, - 0.50, 0.75, 0.35, 0.35, - 0.90, 0.0, 0.35, 0.35 - }; - - curve.resize (13); - curve.at (0 ) = double (FCT_MinMaxCPoints); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } - -} - -void WaveletParams::getCurves (WavCurve &cCurve, WavOpacityCurveRG &opacityCurveLUTRG, WavOpacityCurveBY &opacityCurveLUTBY, WavOpacityCurveW &opacityCurveLUTW, WavOpacityCurveWL &opacityCurveLUTWL) const +void WaveletParams::getCurves( + WavCurve& cCurve, + WavOpacityCurveRG& opacityCurveLUTRG, + WavOpacityCurveBY& opacityCurveLUTBY, + WavOpacityCurveW& opacityCurveLUTW, + WavOpacityCurveWL& opacityCurveLUTWL +) const { cCurve.Set (this->ccwcurve); opacityCurveLUTRG.Set (this->opacityCurveRG); @@ -730,216 +2225,201 @@ void WaveletParams::getCurves (WavCurve &cCurve, WavOpacityCurveRG &opacityCurve } -void WaveletParams::setDefaults() +DirPyrEqualizerParams::DirPyrEqualizerParams() : + enabled(false), + gamutlab(false), + mult{ + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0 + }, + threshold(0.2), + skinprotect(0.0), + hueskin (-5, 25, 170, 120, false), + cbdlMethod("bef") { - getDefaultCCWCurve (ccwcurve); - getDefaultOpacityCurveRG (opacityCurveRG); - getDefaultOpacityCurveBY (opacityCurveBY); - getDefaultOpacityCurveW (opacityCurveW); - getDefaultOpacityCurveWL (opacityCurveWL); - enabled = false; - median = false; - medianlev = false; - linkedg = true; - cbenab = false; - lipst = false; - Medgreinf = "less"; //"none"; - avoid = false; - tmr = false; - strength = 100; - balance = 0; - iter = 0; - wavclCurve.clear (); - wavclCurve.push_back (DCT_Linear); +} - Lmethod = "4_"; - CHmethod = "without"; - CHSLmethod = "SL"; - EDmethod = "CU"; - NPmethod = "none"; - BAmethod = "none"; - TMmethod = "cont"; - HSmethod = "with"; - CLmethod = "all"; - Backmethod = "grey"; - Dirmethod = "all"; - Tilesmethod = "full"; - daubcoeffmethod = "4_"; - rescon = 0; - resconH = 0; - reschro = 0; - tmrs = 0; - gamma = 1; - sky = 0.; - sup = 0; - thres = 7; - chroma = 5; - chro = 0; - contrast = 0; - edgrad = 15; - edgval = 0; - edgthresh = 10; - thr = 35; - thrH = 65; - skinprotect = 0.; - hueskin.setValues ( -5, 25, 170, 120); - hueskin2.setValues (-260, -250, -130, -140); - threshold = 5; - threshold2 = 4; - edgedetect = 90; - edgedetectthr = 20; - edgedetectthr2 = 0; - edgesensi = 60; - edgeampli = 10; - hllev.setValues (50, 75, 100, 98); - bllev.setValues ( 0, 2, 50, 25); - pastlev.setValues ( 0, 2, 30, 20); - satlev.setValues (30, 45, 130, 100); - //edgcont.setValues (bl, tl, br, tr); - edgcont.setValues ( 0, 10, 75, 40); - level0noise.setValues (0, 0); - level1noise.setValues (0, 0); - level2noise.setValues (0, 0); - level3noise.setValues (0, 0); - hhcurve.clear (); - hhcurve.push_back (FCT_Linear); - Chcurve.clear (); - Chcurve.push_back (FCT_Linear); - expcontrast = false; - expchroma = false; - expedge = false; - expresid = false; - expfinal = false; - exptoning = false; - expnoise = false; +bool DirPyrEqualizerParams::operator ==(const DirPyrEqualizerParams& other) const +{ + return + enabled == other.enabled + && gamutlab == other.gamutlab + && [this, &other]() -> bool + { + for (unsigned int i = 0; i < 6; ++i) { + if (mult[i] != other.mult[i]) { + return false; + } + } + return true; + }() + && threshold == other.threshold + && skinprotect == other.skinprotect + && hueskin == other.hueskin + && cbdlMethod == other.cbdlMethod; +} - for (int i = 0; i < 9; i ++) { - c[i] = 0; +bool DirPyrEqualizerParams::operator !=(const DirPyrEqualizerParams& other) const +{ + return !(*this == other); +} + +HSVEqualizerParams::HSVEqualizerParams() : + enabled(false), + hcurve{ + FCT_Linear + }, + scurve{ + FCT_Linear + }, + vcurve{ + FCT_Linear } - - for (int i = 0; i < 9; i ++) { - ch[i] = 0; - } - - greenlow = greenmed = greenhigh = 0.0; - bluelow = bluemed = bluehigh = 0.0; - -} - - -DirPyrDenoiseParams::DirPyrDenoiseParams () { - setDefaults (); } -void DirPyrDenoiseParams::getDefaultNoisCurve (std::vector &curve) +bool HSVEqualizerParams::operator ==(const HSVEqualizerParams& other) const { - double v[8] = { 0.05, 0.15, 0.35, 0.35, - 0.55, 0.04, 0.35, 0.35 - }; - curve.resize (9); - curve.at (0 ) = double (FCT_MinMaxCPoints); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } + return + enabled == other.enabled + && hcurve == other.hcurve + && scurve == other.scurve + && vcurve == other.vcurve; } -void DirPyrDenoiseParams::getDefaultCCCurve (std::vector &curve) +bool HSVEqualizerParams::operator !=(const HSVEqualizerParams& other) const { - // double v[8]= { 0.15, 0.00,0.35,0.35, - // 0.60, 0.05,0.35,0.35}; - double v[8] = { 0.05, 0.50, 0.35, 0.35, - 0.35, 0.05, 0.35, 0.35 - }; - - curve.resize (9); - curve.at (0 ) = double (FCT_MinMaxCPoints); - - for (size_t i = 1; i < curve.size(); ++i) { - curve.at (i) = v[i - 1]; - } + return !(*this == other); } - -void DirPyrDenoiseParams::setDefaults() +FilmSimulationParams::FilmSimulationParams() : + enabled(false), + strength(100) { - - getDefaultNoisCurve (lcurve); - getDefaultCCCurve (cccurve); - - enabled = false; - enhance = false; - median = false; - perform = false; - luma = 0; - passes = 1; - dmethod = "Lab"; - Lmethod = "SLI";//"CUR";// SLIDER method with value 0 is set as default, while the default Lcurve is populated via getDefaultNoisCurve and can be switched to by the user - Cmethod = "MAN"; - C2method = "AUTO"; - smethod = "shal"; - medmethod = "soft"; - methodmed = "none"; - rgbmethod = "soft"; - Ldetail = 0; - chroma = 15; - redchro = 0; - bluechro = 0; - gamma = 1.7; - perform = false; } -void DirPyrDenoiseParams::getCurves (NoiseCurve &lCurve, NoiseCurve &cCurve) const +bool FilmSimulationParams::operator ==(const FilmSimulationParams& other) const { - lCurve.Set (this->lcurve); - cCurve.Set (this->cccurve); + return + enabled == other.enabled + && clutFilename == other.clutFilename + && strength == other.strength; } -void ToneCurveParams::setDefaults() +bool FilmSimulationParams::operator !=(const FilmSimulationParams& other) const { - autoexp = false; - clip = 0.02; - expcomp = 0; - brightness = 0; - contrast = 0; - saturation = 0; - black = 0; - hlcompr = 0; - hlcomprthresh = 33; - shcompr = 50; - curve.clear (); - curve.push_back (DCT_Linear); - curve2.clear (); - curve2.push_back (DCT_Linear); - curveMode = ToneCurveParams::TC_MODE_STD; - curveMode2 = ToneCurveParams::TC_MODE_STD; - hrenabled = false; - method = "Blend"; + return !(*this == other); } -void LensProfParams::setDefaults() +RAWParams::BayerSensor::BayerSensor() : + method(getMethodString(Method::AMAZE)), + imageNum(0), + ccSteps(0), + black0(0.0), + black1(0.0), + black2(0.0), + black3(0.0), + twogreen(true), + linenoise(0), + greenthresh(0), + dcb_iterations(2), + lmmse_iterations(2), + pixelShiftMotion(0), + pixelShiftMotionCorrection(PSMotionCorrection::GRID_3X3_NEW), + pixelShiftMotionCorrectionMethod(PSMotionCorrectionMethod::AUTO), + pixelShiftStddevFactorGreen(5.0), + pixelShiftStddevFactorRed(5.0), + pixelShiftStddevFactorBlue(5.0), + pixelShiftEperIso(0.0), + pixelShiftNreadIso(0.0), + pixelShiftPrnu(1.0), + pixelShiftSigma(1.0), + pixelShiftSum(3.0), + pixelShiftRedBlueWeight(0.7), + pixelShiftShowMotion(false), + pixelShiftShowMotionMaskOnly(false), + pixelShiftAutomatic(true), + pixelShiftNonGreenHorizontal(false), + pixelShiftNonGreenVertical(false), + pixelShiftHoleFill(true), + pixelShiftMedian(false), + pixelShiftMedian3(false), + pixelShiftGreen(true), + pixelShiftBlur(true), + pixelShiftSmoothFactor(0.7), + pixelShiftExp0(false), + pixelShiftLmmse(false), + pixelShiftEqualBright(false), + pixelShiftEqualBrightChannel(false), + pixelShiftNonGreenCross(true), + pixelShiftNonGreenCross2(false), + pixelShiftNonGreenAmaze(false), + dcb_enhance(true) { - lcMode = LcMode::NONE; - lcpFile = ""; - useDist = useVign = true; - useCA = false; - lfCameraMake = ""; - lfCameraModel = ""; - lfLens = ""; } -void CoarseTransformParams::setDefaults() +bool RAWParams::BayerSensor::operator ==(const BayerSensor& other) const { - rotate = 0; - hflip = false; - vflip = false; + return + method == other.method + && imageNum == other.imageNum + && ccSteps == other.ccSteps + && black0 == other.black0 + && black1 == other.black1 + && black2 == other.black2 + && black3 == other.black3 + && twogreen == other.twogreen + && linenoise == other.linenoise + && greenthresh == other.greenthresh + && dcb_iterations == other.dcb_iterations + && lmmse_iterations == other.lmmse_iterations + && pixelShiftMotion == other.pixelShiftMotion + && pixelShiftMotionCorrection == other.pixelShiftMotionCorrection + && pixelShiftMotionCorrectionMethod == other.pixelShiftMotionCorrectionMethod + && pixelShiftStddevFactorGreen == other.pixelShiftStddevFactorGreen + && pixelShiftStddevFactorRed == other.pixelShiftStddevFactorRed + && pixelShiftStddevFactorBlue == other.pixelShiftStddevFactorBlue + && pixelShiftEperIso == other.pixelShiftEperIso + && pixelShiftNreadIso == other.pixelShiftNreadIso + && pixelShiftPrnu == other.pixelShiftPrnu + && pixelShiftSigma == other.pixelShiftSigma + && pixelShiftSum == other.pixelShiftSum + && pixelShiftRedBlueWeight == other.pixelShiftRedBlueWeight + && pixelShiftShowMotion == other.pixelShiftShowMotion + && pixelShiftShowMotionMaskOnly == other.pixelShiftShowMotionMaskOnly + && pixelShiftAutomatic == other.pixelShiftAutomatic + && pixelShiftNonGreenHorizontal == other.pixelShiftNonGreenHorizontal + && pixelShiftNonGreenVertical == other.pixelShiftNonGreenVertical + && pixelShiftHoleFill == other.pixelShiftHoleFill + && pixelShiftMedian == other.pixelShiftMedian + && pixelShiftMedian3 == other.pixelShiftMedian3 + && pixelShiftGreen == other.pixelShiftGreen + && pixelShiftBlur == other.pixelShiftBlur + && pixelShiftSmoothFactor == other.pixelShiftSmoothFactor + && pixelShiftExp0 == other.pixelShiftExp0 + && pixelShiftLmmse == other.pixelShiftLmmse + && pixelShiftEqualBright == other.pixelShiftEqualBright + && pixelShiftEqualBrightChannel == other.pixelShiftEqualBrightChannel + && pixelShiftNonGreenCross == other.pixelShiftNonGreenCross + && pixelShiftNonGreenCross2 == other.pixelShiftNonGreenCross2 + && pixelShiftNonGreenAmaze == other.pixelShiftNonGreenAmaze + && dcb_enhance == other.dcb_enhance; } + +bool RAWParams::BayerSensor::operator !=(const BayerSensor& other) const +{ + return !(*this == other); +} + void RAWParams::BayerSensor::setPixelShiftDefaults() { pixelShiftMotion = 0; - pixelShiftMotionCorrection = RAWParams::BayerSensor::Grid3x3New; - pixelShiftMotionCorrectionMethod = RAWParams::BayerSensor::Automatic; + pixelShiftMotionCorrection = RAWParams::BayerSensor::PSMotionCorrection::GRID_3X3_NEW; + pixelShiftMotionCorrectionMethod = RAWParams::BayerSensor::PSMotionCorrectionMethod::AUTO; pixelShiftStddevFactorGreen = 5.0; pixelShiftStddevFactorRed = 5.0; pixelShiftStddevFactorBlue = 5.0; @@ -967,407 +2447,219 @@ void RAWParams::BayerSensor::setPixelShiftDefaults() pixelShiftNonGreenAmaze = false; } -void RAWParams::setDefaults() +const std::vector& RAWParams::BayerSensor::getMethodStrings() { - bayersensor.method = RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::amaze]; - bayersensor.imageNum = 0; - bayersensor.ccSteps = 0; - bayersensor.dcb_iterations = 2; - bayersensor.dcb_enhance = true; -//bayersensor.all_enhance = false; - bayersensor.lmmse_iterations = 2; - bayersensor.black0 = 0.0; - bayersensor.black1 = 0.0; - bayersensor.black2 = 0.0; - bayersensor.black3 = 0.0; - bayersensor.twogreen = true; - bayersensor.linenoise = 0; - bayersensor.greenthresh = 0; - - xtranssensor.method = RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::threePass]; - xtranssensor.ccSteps = 0; - xtranssensor.blackred = 0.0; - xtranssensor.blackgreen = 0.0; - xtranssensor.blackblue = 0.0; - - expos = 1.0; - preser = 0.0; - df_autoselect = false; - ff_AutoSelect = false; - ff_BlurRadius = 32; - ff_BlurType = RAWParams::ff_BlurTypestring[RAWParams::area_ff]; - ff_AutoClipControl = false; - ff_clipControl = 0; - cared = 0; - cablue = 0; - ca_autocorrect = false; - hotPixelFilter = false; - deadPixelFilter = false; - hotdeadpix_thresh = 100; - bayersensor.setPixelShiftDefaults(); - bayersensor.pixelShiftShowMotion = false; - bayersensor.pixelShiftShowMotionMaskOnly = false; - + static const std::vector method_strings { + "amaze", + "igv", + "lmmse", + "eahd", + "hphd", + "vng4", + "dcb", + "ahd", + "rcd", + "fast", + "mono", + "none", + "pixelshift" + }; + return method_strings; } -void ColorManagementParams::setDefaults() +Glib::ustring RAWParams::BayerSensor::getMethodString(Method method) { - input = "(cameraICC)"; - toneCurve = false; - applyLookTable = false; - applyBaselineExposureOffset = true; - applyHueSatMap = true; - dcpIlluminant = 0; - working = "ProPhoto"; - output = "RT_sRGB"; - outputIntent = RI_RELATIVE; - outputBPC = true; - gamma = "default"; - gampos = 2.22; - slpos = 4.5; - freegamma = false; + return getMethodStrings()[toUnderlying(method)]; +} + +RAWParams::XTransSensor::XTransSensor() : + method(getMethodString(Method::THREE_PASS)), + ccSteps(0), + blackred(0.0), + blackgreen(0.0), + blackblue(0.0) +{ +} + +bool RAWParams::XTransSensor::operator ==(const XTransSensor& other) const +{ + return + method == other.method + && ccSteps == other.ccSteps + && blackred == other.blackred + && blackgreen == other.blackgreen + && blackblue == other.blackblue; +} + +bool RAWParams::XTransSensor::operator !=(const XTransSensor& other) const +{ + return !(*this == other); +} + +const std::vector& RAWParams::XTransSensor::getMethodStrings() +{ + static const std::vector method_strings { + "3-pass (best)", + "1-pass (medium)", + "fast", + "mono", + "none" + }; + return method_strings; +} + +Glib::ustring RAWParams::XTransSensor::getMethodString(Method method) +{ + return getMethodStrings()[toUnderlying(method)]; +} + +RAWParams::RAWParams() : + df_autoselect(false), + ff_AutoSelect(false), + ff_BlurRadius(32), + ff_BlurType(getFlatFieldBlurTypeString(FlatFieldBlurType::AREA)), + ff_AutoClipControl(false), + ff_clipControl(0), + ca_autocorrect(false), + cared(0.0), + cablue(0.0), + expos(1.0), + preser(0.0), + hotPixelFilter(false), + deadPixelFilter(false), + hotdeadpix_thresh(100) +{ +} + +bool RAWParams::operator ==(const RAWParams& other) const +{ + return + bayersensor == other.bayersensor + && xtranssensor == other.xtranssensor + && dark_frame == other.dark_frame + && df_autoselect == other.df_autoselect + && ff_file == other.ff_file + && ff_AutoSelect == other.ff_AutoSelect + && ff_BlurRadius == other.ff_BlurRadius + && ff_BlurType == other.ff_BlurType + && ff_AutoClipControl == other.ff_AutoClipControl + && ff_clipControl == other.ff_clipControl + && ca_autocorrect == other.ca_autocorrect + && cared == other.cared + && cablue == other.cablue + && expos == other.expos + && preser == other.preser + && hotPixelFilter == other.hotPixelFilter + && deadPixelFilter == other.deadPixelFilter + && hotdeadpix_thresh == other.hotdeadpix_thresh; +} + +bool RAWParams::operator !=(const RAWParams& other) const +{ + return !(*this == other); +} + +const std::vector& RAWParams::getFlatFieldBlurTypeStrings() +{ + static const std::vector blur_type_strings { + "Area Flatfield", + "Vertical Flatfield", + "Horizontal Flatfield", + "V+H Flatfield" + }; + return blur_type_strings; +} + +Glib::ustring RAWParams::getFlatFieldBlurTypeString(FlatFieldBlurType type) +{ + return getFlatFieldBlurTypeStrings()[toUnderlying(type)]; } ProcParams::ProcParams () { - setDefaults (); } -void ProcParams::init () -{ - - WBParams::init(); -} - -void ProcParams::cleanup () -{ - - WBParams::cleanup(); -} - -ProcParams* ProcParams::create () -{ - - return new ProcParams(); -} - -void ProcParams::destroy (ProcParams* pp) -{ - - delete pp; -} - void ProcParams::setDefaults () { + toneCurve = ToneCurveParams(); - toneCurve.setDefaults(); + labCurve = LCurveParams(); - labCurve.brightness = 0; - labCurve.contrast = 0; - labCurve.chromaticity = 0; - labCurve.avoidcolorshift = false; - labCurve.lcredsk = true; - labCurve.rstprotection = 0; - labCurve.lcurve.clear (); - labCurve.lcurve.push_back (DCT_Linear); - labCurve.acurve.clear (); - labCurve.acurve.push_back (DCT_Linear); - labCurve.bcurve.clear (); - labCurve.bcurve.push_back (DCT_Linear); - labCurve.cccurve.clear (); - labCurve.cccurve.push_back (DCT_Linear); - labCurve.chcurve.clear (); - labCurve.chcurve.push_back (FCT_Linear); - labCurve.lhcurve.clear (); - labCurve.lhcurve.push_back (FCT_Linear); - labCurve.hhcurve.clear (); - labCurve.hhcurve.push_back (FCT_Linear); + rgbCurves = RGBCurvesParams(); - labCurve.lccurve.clear (); - labCurve.lccurve.push_back (DCT_Linear); - labCurve.clcurve.clear (); - labCurve.clcurve.push_back (DCT_Linear); + colorToning = ColorToningParams(); - rgbCurves.lumamode = false; - rgbCurves.rcurve.clear (); - rgbCurves.rcurve.push_back (DCT_Linear); - rgbCurves.gcurve.clear (); - rgbCurves.gcurve.push_back (DCT_Linear); - rgbCurves.bcurve.clear (); - rgbCurves.bcurve.push_back (DCT_Linear); + sharpenEdge = SharpenEdgeParams(); - colorToning.setDefaults(); + sharpenMicro = SharpenMicroParams(); - sharpenEdge.enabled = false; - sharpenEdge.passes = 2; - sharpenEdge.amount = 50.0; - sharpenEdge.threechannels = false; + sharpening = SharpeningParams(); - sharpenMicro.enabled = false; - sharpenMicro.amount = 20.0; - sharpenMicro.uniformity = 50.0; - sharpenMicro.matrix = false; - - sharpening.enabled = false; - sharpening.radius = 0.5; - sharpening.amount = 200; - sharpening.threshold.setValues (20, 80, 2000, 1200); - sharpening.edgesonly = false; - sharpening.edges_radius = 1.9; - sharpening.edges_tolerance = 1800; - sharpening.halocontrol = false; - sharpening.halocontrol_amount = 85; - sharpening.method = "usm"; - sharpening.deconvradius = 0.75; - sharpening.deconviter = 30; - sharpening.deconvdamping = 20; - sharpening.deconvamount = 75; - - prsharpening.enabled = false; - prsharpening.radius = 0.5; - prsharpening.amount = 200; - prsharpening.threshold.setValues (20, 80, 2000, 1200); - prsharpening.edgesonly = false; - prsharpening.edges_radius = 1.9; - prsharpening.edges_tolerance = 1800; - prsharpening.halocontrol = false; - prsharpening.halocontrol_amount = 85; + prsharpening = SharpeningParams(); prsharpening.method = "rld"; + prsharpening.deconvamount = 100; prsharpening.deconvradius = 0.45; prsharpening.deconviter = 100; prsharpening.deconvdamping = 0; - prsharpening.deconvamount = 100; - vibrance.enabled = false; - vibrance.pastels = 0; - vibrance.saturated = 0; - vibrance.psthreshold.setValues (0, 75); - vibrance.protectskins = false; - vibrance.avoidcolorshift = true; - vibrance.pastsattog = true; - vibrance.skintonescurve.clear (); - vibrance.skintonescurve.push_back (DCT_Linear); + vibrance = VibranceParams(); - wb.method = "Camera"; - wb.temperature = 6504; - wb.green = 1.0; - wb.equal = 1.0; - wb.tempBias = 0.0; - colorappearance.enabled = false; - colorappearance.degree = 90; - colorappearance.autodegree = true; - colorappearance.degreeout = 90; - colorappearance.autodegreeout = true; - colorappearance.surround = "Average"; - colorappearance.surrsrc = "Average"; - colorappearance.adaplum = 16; - colorappearance.badpixsl = 0; - colorappearance.adapscen = 2000.0; - colorappearance.autoadapscen = true; - colorappearance.ybscen = 18; - colorappearance.autoybscen = true; - colorappearance.algo = "No"; - colorappearance.wbmodel = "RawT"; - colorappearance.jlight = 0.0; - colorappearance.qbright = 0.0; - colorappearance.chroma = 0.0; - colorappearance.schroma = 0.0; - colorappearance.mchroma = 0.0; - colorappearance.rstprotection = 0.0; - colorappearance.contrast = 0.0; - colorappearance.qcontrast = 0.0; - colorappearance.colorh = 0.0; - colorappearance.surrsource = false; - colorappearance.gamut = true; -// colorappearance.badpix = false; - colorappearance.datacie = false; - colorappearance.tonecie = false; -// colorappearance.sharpcie = false; - colorappearance.curve.clear (); - colorappearance.curve.push_back (DCT_Linear); - colorappearance.curve2.clear (); - colorappearance.curve2.push_back (DCT_Linear); - colorappearance.curveMode = ColorAppearanceParams::TC_MODE_LIGHT; - colorappearance.curveMode2 = ColorAppearanceParams::TC_MODE_LIGHT; - colorappearance.curve3.clear (); - colorappearance.curve3.push_back (DCT_Linear); - colorappearance.curveMode3 = ColorAppearanceParams::TC_MODE_CHROMA; - colorappearance.tempout = 5000; - colorappearance.greenout = 1.0; - colorappearance.ybout = 18; - colorappearance.tempsc = 5000; - colorappearance.greensc = 1.0; + wb = WBParams(); - impulseDenoise.enabled = false; - impulseDenoise.thresh = 50; + colorappearance = ColorAppearanceParams(); - defringe.enabled = false; - defringe.radius = 2.0; - defringe.threshold = 13; - defringe.huecurve.resize (25); - defringe.huecurve.at (0) = FCT_MinMaxCPoints; - defringe.huecurve.at (1) = 0.166666667; - defringe.huecurve.at (2) = 0.; - defringe.huecurve.at (3) = 0.35; - defringe.huecurve.at (4) = 0.35; - defringe.huecurve.at (5) = 0.347; - defringe.huecurve.at (6) = 0.; - defringe.huecurve.at (7) = 0.35; - defringe.huecurve.at (8) = 0.35; - defringe.huecurve.at (9) = 0.513667426; - defringe.huecurve.at (10) = 0; - defringe.huecurve.at (11) = 0.35; - defringe.huecurve.at (12) = 0.35; - defringe.huecurve.at (13) = 0.668944571; - defringe.huecurve.at (14) = 0.; - defringe.huecurve.at (15) = 0.35; - defringe.huecurve.at (16) = 0.35; - defringe.huecurve.at (17) = 0.8287775246; - defringe.huecurve.at (18) = 0.97835991; - defringe.huecurve.at (19) = 0.35; - defringe.huecurve.at (20) = 0.35; - defringe.huecurve.at (21) = 0.9908883827; - defringe.huecurve.at (22) = 0.; - defringe.huecurve.at (23) = 0.35; - defringe.huecurve.at (24) = 0.35; + defringe = DefringeParams(); - dirpyrDenoise.setDefaults(); + impulseDenoise = ImpulseDenoiseParams(); - epd.enabled = false; - epd.strength = 0.5; - epd.gamma = 1.0; - epd.edgeStopping = 1.4; - epd.scale = 1.0; - epd.reweightingIterates = 0; + dirpyrDenoise = DirPyrDenoiseParams(); - fattal.setDefaults(); + epd = EPDParams(); - sh.enabled = false; - sh.hq = false; - sh.highlights = 0; - sh.htonalwidth = 80; - sh.shadows = 0; - sh.stonalwidth = 80; - sh.localcontrast = 0; - sh.radius = 40; + fattal = FattalToneMappingParams(); - crop.enabled = false; - crop.x = -1; - crop.y = -1; - crop.w = 15000; - crop.h = 15000; - crop.fixratio = true; - crop.ratio = "3:2"; - crop.orientation = "As Image"; - crop.guide = "Frame"; + sh = SHParams(); - coarse.setDefaults(); + crop = CropParams(); - commonTrans.autofill = true; + coarse = CoarseTransformParams(); - rotate.degree = 0; + commonTrans = CommonTransformParams(); - distortion.amount = 0; + rotate = RotateParams(); - perspective.horizontal = 0; - perspective.vertical = 0; + distortion = DistortionParams(); - gradient.enabled = false; - gradient.degree = 0; - gradient.feather = 25; - gradient.strength = 0.60; - gradient.centerX = 0; - gradient.centerY = 0; + lensProf = LensProfParams(); - pcvignette.enabled = false; - pcvignette.strength = 0.60; - pcvignette.feather = 50; - pcvignette.roundness = 50; + perspective = PerspectiveParams(); - cacorrection.red = 0; - cacorrection.blue = 0; + gradient = GradientParams(); + pcvignette = PCVignetteParams(); - vignetting.amount = 0; - vignetting.radius = 50; - vignetting.strength = 1; - vignetting.centerX = 0; - vignetting.centerY = 0; + vignetting = VignettingParams(); - lensProf.setDefaults(); + chmixer = ChannelMixerParams(); - chmixer.red[0] = 100; - chmixer.red[1] = 0; - chmixer.red[2] = 0; - chmixer.green[0] = 0; - chmixer.green[1] = 100; - chmixer.green[2] = 0; - chmixer.blue[0] = 0; - chmixer.blue[1] = 0; - chmixer.blue[2] = 100; + blackwhite = BlackWhiteParams(); - blackwhite.autoc = false; - blackwhite.enabledcc = true; - blackwhite.enabled = false; - blackwhite.mixerRed = 33; - blackwhite.mixerGreen = 33; - blackwhite.mixerBlue = 33; - blackwhite.mixerOrange = 33; - blackwhite.mixerYellow = 33; - blackwhite.mixerCyan = 33; - blackwhite.mixerMagenta = 33; - blackwhite.mixerPurple = 33; - blackwhite.gammaRed = 0; - blackwhite.gammaGreen = 0; - blackwhite.gammaBlue = 0; - blackwhite.luminanceCurve.clear (); - blackwhite.luminanceCurve.push_back (FCT_Linear); - blackwhite.method = "Desaturation"; - blackwhite.filter = "None"; - blackwhite.setting = "NormalContrast"; - blackwhite.beforeCurve.clear (); - blackwhite.beforeCurve.push_back (DCT_Linear); - blackwhite.beforeCurveMode = BlackWhiteParams::TC_MODE_STD_BW; - blackwhite.afterCurve.clear (); - blackwhite.afterCurve.push_back (DCT_Linear); - blackwhite.afterCurveMode = BlackWhiteParams::TC_MODE_STD_BW; - blackwhite.algo = "SP"; + cacorrection = CACorrParams(); - resize.enabled = false; - resize.scale = 1.0; - resize.appliesTo = "Cropped area"; - resize.method = "Lanczos"; - resize.dataspec = 3; - resize.width = 900; - resize.height = 900; + resize = ResizeParams(); - icm.setDefaults(); + icm = ColorManagementParams(); - dirpyrequalizer.enabled = false; - dirpyrequalizer.gamutlab = false; - dirpyrequalizer.cbdlMethod = "bef"; + wavelet = WaveletParams(); + dirpyrequalizer = DirPyrEqualizerParams(); - for (int i = 0; i < 6; i ++) { - dirpyrequalizer.mult[i] = 1.0; - } + hsvequalizer = HSVEqualizerParams(); - dirpyrequalizer.threshold = 0.2; - dirpyrequalizer.skinprotect = 0.; - dirpyrequalizer.hueskin.setValues (-5, 25, 170, 120); //default (b_l 0, t_l 30, b_r 170, t_r 120); -// dirpyrequalizer.algo = "FI"; + filmSimulation = FilmSimulationParams(); - hsvequalizer.hcurve.clear (); - hsvequalizer.hcurve.push_back (FCT_Linear); - hsvequalizer.scurve.clear (); - hsvequalizer.scurve.push_back (FCT_Linear); - hsvequalizer.vcurve.clear (); - hsvequalizer.vcurve.push_back (FCT_Linear); - - filmSimulation.setDefaults(); - - raw.setDefaults(); + raw = RAWParams(); exif.clear (); iptc.clear (); @@ -1379,59 +2671,8 @@ void ProcParams::setDefaults () ppVersion = PPVERSION; } -static Glib::ustring expandRelativePath (const Glib::ustring &procparams_fname, const Glib::ustring &prefix, Glib::ustring embedded_fname) +int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bool fnameAbsolute, ParamsEdited* pedited) { - if (embedded_fname == "" || !Glib::path_is_absolute (procparams_fname)) { - return embedded_fname; - } - - if (prefix != "") { - if (embedded_fname.length() < prefix.length() || embedded_fname.substr (0, prefix.length()) != prefix) { - return embedded_fname; - } - - embedded_fname = embedded_fname.substr (prefix.length()); - } - - if (Glib::path_is_absolute (embedded_fname)) { - return prefix + embedded_fname; - } - - Glib::ustring absPath = prefix + Glib::path_get_dirname (procparams_fname) + G_DIR_SEPARATOR_S + embedded_fname; - return absPath; -} - -static Glib::ustring relativePathIfInside (const Glib::ustring &procparams_fname, bool fnameAbsolute, Glib::ustring embedded_fname) -{ - if (fnameAbsolute || embedded_fname == "" || !Glib::path_is_absolute (procparams_fname)) { - return embedded_fname; - } - - Glib::ustring prefix = ""; - - if (embedded_fname.length() > 5 && embedded_fname.substr (0, 5) == "file:") { - embedded_fname = embedded_fname.substr (5); - prefix = "file:"; - } - - if (!Glib::path_is_absolute (embedded_fname)) { - return prefix + embedded_fname; - } - - Glib::ustring dir1 = Glib::path_get_dirname (procparams_fname) + G_DIR_SEPARATOR_S; - Glib::ustring dir2 = Glib::path_get_dirname (embedded_fname) + G_DIR_SEPARATOR_S; - - if (dir2.substr (0, dir1.length()) != dir1) { - // it's in a different directory, ie not inside - return prefix + embedded_fname; - } - - return prefix + embedded_fname.substr (dir1.length()); -} - -int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, bool fnameAbsolute, ParamsEdited* pedited) -{ - if (fname.empty () && fname2.empty ()) { return 0; } @@ -1439,283 +2680,83 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b Glib::ustring sPParams; try { - Glib::KeyFile keyFile; - keyFile.set_string ("Version", "AppVersion", APPVERSION); +// Version + keyFile.set_string ("Version", "AppVersion", RTVERSION); keyFile.set_integer ("Version", "Version", PPVERSION); - if (!pedited || pedited->general.rank) { - keyFile.set_integer ("General", "Rank", rank); - } - - if (!pedited || pedited->general.colorlabel) { - keyFile.set_integer ("General", "ColorLabel", colorlabel); - } - - if (!pedited || pedited->general.intrash) { - keyFile.set_boolean ("General", "InTrash", inTrash); - } - -// save tone curve - if (!pedited || pedited->toneCurve.autoexp) { - keyFile.set_boolean ("Exposure", "Auto", toneCurve.autoexp); - } - - if (!pedited || pedited->toneCurve.clip) { - keyFile.set_double ("Exposure", "Clip", toneCurve.clip); - } - - if (!pedited || pedited->toneCurve.expcomp) { - keyFile.set_double ("Exposure", "Compensation", toneCurve.expcomp); - } - - if (!pedited || pedited->toneCurve.brightness) { - keyFile.set_integer ("Exposure", "Brightness", toneCurve.brightness); - } - - if (!pedited || pedited->toneCurve.contrast) { - keyFile.set_integer ("Exposure", "Contrast", toneCurve.contrast); - } - - if (!pedited || pedited->toneCurve.saturation) { - keyFile.set_integer ("Exposure", "Saturation", toneCurve.saturation); - } - - if (!pedited || pedited->toneCurve.black) { - keyFile.set_integer ("Exposure", "Black", toneCurve.black); - } - - if (!pedited || pedited->toneCurve.hlcompr) { - keyFile.set_integer ("Exposure", "HighlightCompr", toneCurve.hlcompr); - } - - if (!pedited || pedited->toneCurve.hlcomprthresh) { - keyFile.set_integer ("Exposure", "HighlightComprThreshold", toneCurve.hlcomprthresh); - } - - if (!pedited || pedited->toneCurve.shcompr) { - keyFile.set_integer ("Exposure", "ShadowCompr", toneCurve.shcompr); - } - -// save highlight recovery settings - if (!pedited || pedited->toneCurve.hrenabled) { - keyFile.set_boolean ("HLRecovery", "Enabled", toneCurve.hrenabled); - } - - if (!pedited || pedited->toneCurve.method) { - keyFile.set_string ("HLRecovery", "Method", toneCurve.method); - } - - if (!pedited || pedited->toneCurve.curveMode) { - Glib::ustring method; - - switch (toneCurve.curveMode) { - case (ToneCurveParams::TC_MODE_STD): - method = "Standard"; - break; - - case (ToneCurveParams::TC_MODE_FILMLIKE): - method = "FilmLike"; - break; - - case (ToneCurveParams::TC_MODE_SATANDVALBLENDING): - method = "SatAndValueBlending"; - break; - - case (ToneCurveParams::TC_MODE_WEIGHTEDSTD): - method = "WeightedStd"; - break; - - case (ToneCurveParams::TC_MODE_LUMINANCE): - method = "Luminance"; - break; - - case (ToneCurveParams::TC_MODE_PERCEPTUAL): - method = "Perceptual"; - break; - } - - keyFile.set_string ("Exposure", "CurveMode", method); - } - - if (!pedited || pedited->toneCurve.curveMode2) { - Glib::ustring method; - - switch (toneCurve.curveMode2) { - case (ToneCurveParams::TC_MODE_STD): - method = "Standard"; - break; - - case (ToneCurveParams::TC_MODE_FILMLIKE): - method = "FilmLike"; - break; - - case (ToneCurveParams::TC_MODE_SATANDVALBLENDING): - method = "SatAndValueBlending"; - break; - - case (ToneCurveParams::TC_MODE_WEIGHTEDSTD): - method = "WeightedStd"; - break; - - case (ToneCurveParams::TC_MODE_LUMINANCE): - method = "Luminance"; - break; - - case (ToneCurveParams::TC_MODE_PERCEPTUAL): - method = "Perceptual"; - break; - } - - keyFile.set_string ("Exposure", "CurveMode2", method); - } - - if (!pedited || pedited->toneCurve.curve) { - Glib::ArrayHandle tcurve = toneCurve.curve; - keyFile.set_double_list ("Exposure", "Curve", tcurve); - } - - if (!pedited || pedited->toneCurve.curve2) { - Glib::ArrayHandle tcurve = toneCurve.curve2; - keyFile.set_double_list ("Exposure", "Curve2", tcurve); - } - -//save retinex - - if (!pedited || pedited->retinex.enabled) { - keyFile.set_boolean ("Retinex", "Enabled", retinex.enabled); - } - - if (!pedited || pedited->retinex.str) { - keyFile.set_integer ("Retinex", "Str", retinex.str); - } - - if (!pedited || pedited->retinex.scal) { - keyFile.set_integer ("Retinex", "Scal", retinex.scal); - } - - if (!pedited || pedited->retinex.iter) { - keyFile.set_integer ("Retinex", "Iter", retinex.iter); - } - - if (!pedited || pedited->retinex.grad) { - keyFile.set_integer ("Retinex", "Grad", retinex.grad); - } - - if (!pedited || pedited->retinex.grads) { - keyFile.set_integer ("Retinex", "Grads", retinex.grads); - } - - if (!pedited || pedited->retinex.gam) { - keyFile.set_double ("Retinex", "Gam", retinex.gam); - } - - if (!pedited || pedited->retinex.slope) { - keyFile.set_double ("Retinex", "Slope", retinex.slope); - } - - if (!pedited || pedited->retinex.medianmap) { - keyFile.set_boolean ("Retinex", "Median", retinex.medianmap); - } - - - - if (!pedited || pedited->retinex.neigh) { - keyFile.set_integer ("Retinex", "Neigh", retinex.neigh); - } - - if (!pedited || pedited->retinex.offs) { - keyFile.set_integer ("Retinex", "Offs", retinex.offs); - } - - if (!pedited || pedited->retinex.vart) { - keyFile.set_integer ("Retinex", "Vart", retinex.vart); - } - - if (!pedited || pedited->retinex.limd) { - keyFile.set_integer ("Retinex", "Limd", retinex.limd); - } - - if (!pedited || pedited->retinex.highl) { - keyFile.set_integer ("Retinex", "highl", retinex.highl); - } - - if (!pedited || pedited->retinex.skal) { - keyFile.set_integer ("Retinex", "skal", retinex.skal); - } - - if (!pedited || pedited->retinex.retinexMethod) { - keyFile.set_string ("Retinex", "RetinexMethod", retinex.retinexMethod); - } - - if (!pedited || pedited->retinex.mapMethod) { - keyFile.set_string ("Retinex", "mapMethod", retinex.mapMethod); - } - - if (!pedited || pedited->retinex.viewMethod) { - keyFile.set_string ("Retinex", "viewMethod", retinex.viewMethod); - } - - if (!pedited || pedited->retinex.retinexcolorspace) { - keyFile.set_string ("Retinex", "Retinexcolorspace", retinex.retinexcolorspace); - } - - if (!pedited || pedited->retinex.gammaretinex) { - keyFile.set_string ("Retinex", "Gammaretinex", retinex.gammaretinex); - } - - if (!pedited || pedited->retinex.cdcurve) { - Glib::ArrayHandle cdcurve = retinex.cdcurve; - keyFile.set_double_list ("Retinex", "CDCurve", cdcurve); - } - - if (!pedited || pedited->retinex.mapcurve) { - Glib::ArrayHandle mapcurve = retinex.mapcurve; - keyFile.set_double_list ("Retinex", "MAPCurve", mapcurve); - } - - if (!pedited || pedited->retinex.cdHcurve) { - Glib::ArrayHandle cdHcurve = retinex.cdHcurve; - keyFile.set_double_list ("Retinex", "CDHCurve", cdHcurve); - } - - if (!pedited || pedited->retinex.lhcurve) { - Glib::ArrayHandle lhcurve = retinex.lhcurve; - keyFile.set_double_list ("Retinex", "LHCurve", lhcurve); - } - - if (!pedited || pedited->retinex.highlights) { - keyFile.set_integer ("Retinex", "Highlights", retinex.highlights); - } - - if (!pedited || pedited->retinex.htonalwidth) { - keyFile.set_integer ("Retinex", "HighlightTonalWidth", retinex.htonalwidth); - } - - if (!pedited || pedited->retinex.shadows) { - keyFile.set_integer ("Retinex", "Shadows", retinex.shadows); - } - - if (!pedited || pedited->retinex.stonalwidth) { - keyFile.set_integer ("Retinex", "ShadowTonalWidth", retinex.stonalwidth); - } - - if (!pedited || pedited->retinex.radius) { - keyFile.set_integer ("Retinex", "Radius", retinex.radius); - } - - if (!pedited || pedited->retinex.transmissionCurve) { - Glib::ArrayHandle transmissionCurve = retinex.transmissionCurve; - keyFile.set_double_list ("Retinex", "TransmissionCurve", transmissionCurve); - } - - if (!pedited || pedited->retinex.gaintransmissionCurve) { - Glib::ArrayHandle gaintransmissionCurve = retinex.gaintransmissionCurve; - keyFile.set_double_list ("Retinex", "GainTransmissionCurve", gaintransmissionCurve); - } - -// save channel mixer + saveToKeyfile(!pedited || pedited->general.rank, "General", "Rank", rank, keyFile); + saveToKeyfile(!pedited || pedited->general.colorlabel, "General", "ColorLabel", colorlabel, keyFile); + saveToKeyfile(!pedited || pedited->general.intrash, "General", "InTrash", inTrash, keyFile); + +// Tone curve + saveToKeyfile(!pedited || pedited->toneCurve.autoexp, "Exposure", "Auto", toneCurve.autoexp, keyFile); + saveToKeyfile(!pedited || pedited->toneCurve.clip, "Exposure", "Clip", toneCurve.clip, keyFile); + saveToKeyfile(!pedited || pedited->toneCurve.expcomp, "Exposure", "Compensation", toneCurve.expcomp, keyFile); + saveToKeyfile(!pedited || pedited->toneCurve.brightness, "Exposure", "Brightness", toneCurve.brightness, keyFile); + saveToKeyfile(!pedited || pedited->toneCurve.contrast, "Exposure", "Contrast", toneCurve.contrast, keyFile); + saveToKeyfile(!pedited || pedited->toneCurve.saturation, "Exposure", "Saturation", toneCurve.saturation, keyFile); + saveToKeyfile(!pedited || pedited->toneCurve.black, "Exposure", "Black", toneCurve.black, keyFile); + saveToKeyfile(!pedited || pedited->toneCurve.hlcompr, "Exposure", "HighlightCompr", toneCurve.hlcompr, keyFile); + saveToKeyfile(!pedited || pedited->toneCurve.hlcomprthresh, "Exposure", "HighlightComprThreshold", toneCurve.hlcomprthresh, keyFile); + saveToKeyfile(!pedited || pedited->toneCurve.shcompr, "Exposure", "ShadowCompr", toneCurve.shcompr, keyFile); + +// Highlight recovery + saveToKeyfile(!pedited || pedited->toneCurve.hrenabled, "HLRecovery", "Enabled", toneCurve.hrenabled, keyFile); + saveToKeyfile(!pedited || pedited->toneCurve.method, "HLRecovery", "Method", toneCurve.method, keyFile); + + const std::map tc_mapping = { + {ToneCurveParams::TcMode::STD, "Standard"}, + {ToneCurveParams::TcMode::FILMLIKE, "FilmLike"}, + {ToneCurveParams::TcMode::SATANDVALBLENDING, "SatAndValueBlending"}, + {ToneCurveParams::TcMode::WEIGHTEDSTD,"WeightedStd"}, + {ToneCurveParams::TcMode::LUMINANCE, "Luminance"}, + {ToneCurveParams::TcMode::PERCEPTUAL, "Perceptual"} + }; + + saveToKeyfile(!pedited || pedited->toneCurve.curveMode, "Exposure", "CurveMode", tc_mapping, toneCurve.curveMode, keyFile); + saveToKeyfile(!pedited || pedited->toneCurve.curveMode2, "Exposure", "CurveMode2", tc_mapping, toneCurve.curveMode2, keyFile); + + saveToKeyfile(!pedited || pedited->toneCurve.curve, "Exposure", "Curve", toneCurve.curve, keyFile); + saveToKeyfile(!pedited || pedited->toneCurve.curve2, "Exposure", "Curve2", toneCurve.curve2, keyFile); + +// Retinex + saveToKeyfile(!pedited || pedited->retinex.enabled, "Retinex", "Enabled", retinex.enabled, keyFile); + saveToKeyfile(!pedited || pedited->retinex.str, "Retinex", "Str", retinex.str, keyFile); + saveToKeyfile(!pedited || pedited->retinex.scal, "Retinex", "Scal", retinex.scal, keyFile); + saveToKeyfile(!pedited || pedited->retinex.iter, "Retinex", "Iter", retinex.iter, keyFile); + saveToKeyfile(!pedited || pedited->retinex.grad, "Retinex", "Grad", retinex.grad, keyFile); + saveToKeyfile(!pedited || pedited->retinex.grads, "Retinex", "Grads", retinex.grads, keyFile); + saveToKeyfile(!pedited || pedited->retinex.gam, "Retinex", "Gam", retinex.gam, keyFile); + saveToKeyfile(!pedited || pedited->retinex.slope, "Retinex", "Slope", retinex.slope, keyFile); + saveToKeyfile(!pedited || pedited->retinex.medianmap, "Retinex", "Median", retinex.medianmap, keyFile); + + saveToKeyfile(!pedited || pedited->retinex.neigh, "Retinex", "Neigh", retinex.neigh, keyFile); + saveToKeyfile(!pedited || pedited->retinex.offs, "Retinex", "Offs", retinex.offs, keyFile); + saveToKeyfile(!pedited || pedited->retinex.vart, "Retinex", "Vart", retinex.vart, keyFile); + saveToKeyfile(!pedited || pedited->retinex.limd, "Retinex", "Limd", retinex.limd, keyFile); + saveToKeyfile(!pedited || pedited->retinex.highl, "Retinex", "highl", retinex.highl, keyFile); + saveToKeyfile(!pedited || pedited->retinex.skal, "Retinex", "skal", retinex.skal, keyFile); + saveToKeyfile(!pedited || pedited->retinex.retinexMethod, "Retinex", "RetinexMethod", retinex.retinexMethod, keyFile); + saveToKeyfile(!pedited || pedited->retinex.mapMethod, "Retinex", "mapMethod", retinex.mapMethod, keyFile); + saveToKeyfile(!pedited || pedited->retinex.viewMethod, "Retinex", "viewMethod", retinex.viewMethod, keyFile); + saveToKeyfile(!pedited || pedited->retinex.retinexcolorspace, "Retinex", "Retinexcolorspace", retinex.retinexcolorspace, keyFile); + saveToKeyfile(!pedited || pedited->retinex.gammaretinex, "Retinex", "Gammaretinex", retinex.gammaretinex, keyFile); + saveToKeyfile(!pedited || pedited->retinex.cdcurve, "Retinex", "CDCurve", retinex.cdcurve, keyFile); + saveToKeyfile(!pedited || pedited->retinex.mapcurve, "Retinex", "MAPCurve", retinex.mapcurve, keyFile); + saveToKeyfile(!pedited || pedited->retinex.cdHcurve, "Retinex", "CDHCurve", retinex.cdHcurve, keyFile); + saveToKeyfile(!pedited || pedited->retinex.lhcurve, "Retinex", "LHCurve", retinex.lhcurve, keyFile); + saveToKeyfile(!pedited || pedited->retinex.highlights, "Retinex", "Highlights", retinex.highlights, keyFile); + saveToKeyfile(!pedited || pedited->retinex.htonalwidth, "Retinex", "HighlightTonalWidth", retinex.htonalwidth, keyFile); + saveToKeyfile(!pedited || pedited->retinex.shadows, "Retinex", "Shadows", retinex.shadows, keyFile); + saveToKeyfile(!pedited || pedited->retinex.stonalwidth, "Retinex", "ShadowTonalWidth", retinex.stonalwidth, keyFile); + saveToKeyfile(!pedited || pedited->retinex.radius, "Retinex", "Radius", retinex.radius, keyFile); + saveToKeyfile(!pedited || pedited->retinex.transmissionCurve, "Retinex", "TransmissionCurve", retinex.transmissionCurve, keyFile); + saveToKeyfile(!pedited || pedited->retinex.gaintransmissionCurve, "Retinex", "GainTransmissionCurve", retinex.gaintransmissionCurve, keyFile); + +// Channel mixer + saveToKeyfile(!pedited || pedited->chmixer.enabled, "Channel Mixer", "Enabled", chmixer.enabled, keyFile); if (!pedited || pedited->chmixer.red[0] || pedited->chmixer.red[1] || pedited->chmixer.red[2]) { Glib::ArrayHandle rmix (chmixer.red, 3, Glib::OWNERSHIP_NONE); keyFile.set_integer_list ("Channel Mixer", "Red", rmix); @@ -1731,1954 +2772,592 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b keyFile.set_integer_list ("Channel Mixer", "Blue", bmix); } -//save Black & White - if (!pedited || pedited->blackwhite.enabled) { - keyFile.set_boolean ("Black & White", "Enabled", blackwhite.enabled); - } - - if (!pedited || pedited->blackwhite.method) { - keyFile.set_string ("Black & White", "Method", blackwhite.method ); - } - - if (!pedited || pedited->blackwhite.autoc) { - keyFile.set_boolean ("Black & White", "Auto", blackwhite.autoc); - } - - if (!pedited || pedited->blackwhite.enabledcc) { - keyFile.set_boolean ("Black & White", "ComplementaryColors", blackwhite.enabledcc); - } - - if (!pedited || pedited->blackwhite.setting) { - keyFile.set_string ("Black & White", "Setting", blackwhite.setting ); - } - - if (!pedited || pedited->blackwhite.filter) { - keyFile.set_string ("Black & White", "Filter", blackwhite.filter ); - } - - if (!pedited || pedited->blackwhite.mixerRed) { - keyFile.set_integer ("Black & White", "MixerRed", blackwhite.mixerRed); - } - - if (!pedited || pedited->blackwhite.mixerOrange) { - keyFile.set_integer ("Black & White", "MixerOrange", blackwhite.mixerOrange); - } - - if (!pedited || pedited->blackwhite.mixerYellow) { - keyFile.set_integer ("Black & White", "MixerYellow", blackwhite.mixerYellow); - } - - if (!pedited || pedited->blackwhite.mixerGreen) { - keyFile.set_integer ("Black & White", "MixerGreen", blackwhite.mixerGreen); - } - - if (!pedited || pedited->blackwhite.mixerCyan) { - keyFile.set_integer ("Black & White", "MixerCyan", blackwhite.mixerCyan); - } - - if (!pedited || pedited->blackwhite.mixerBlue) { - keyFile.set_integer ("Black & White", "MixerBlue", blackwhite.mixerBlue); - } - - if (!pedited || pedited->blackwhite.mixerMagenta) { - keyFile.set_integer ("Black & White", "MixerMagenta", blackwhite.mixerMagenta); - } - - if (!pedited || pedited->blackwhite.mixerPurple) { - keyFile.set_integer ("Black & White", "MixerPurple", blackwhite.mixerPurple); - } - - if (!pedited || pedited->blackwhite.gammaRed) { - keyFile.set_integer ("Black & White", "GammaRed", blackwhite.gammaRed); - } - - if (!pedited || pedited->blackwhite.gammaGreen) { - keyFile.set_integer ("Black & White", "GammaGreen", blackwhite.gammaGreen); - } - - if (!pedited || pedited->blackwhite.gammaBlue) { - keyFile.set_integer ("Black & White", "GammaBlue", blackwhite.gammaBlue); - } - - if (!pedited || pedited->blackwhite.algo) { - keyFile.set_string ("Black & White", "Algorithm", blackwhite.algo); - } - - if (!pedited || pedited->blackwhite.luminanceCurve) { - Glib::ArrayHandle luminanceCurve = blackwhite.luminanceCurve; - keyFile.set_double_list ("Black & White", "LuminanceCurve", luminanceCurve); - } - - if (!pedited || pedited->blackwhite.beforeCurveMode) { - Glib::ustring mode; - - switch (blackwhite.beforeCurveMode) { - case (BlackWhiteParams::TC_MODE_STD_BW): - mode = "Standard"; - break; - - case (BlackWhiteParams::TC_MODE_FILMLIKE_BW): - mode = "FilmLike"; - break; - - case (BlackWhiteParams::TC_MODE_SATANDVALBLENDING_BW): - mode = "SatAndValueBlending"; - break; - - case (BlackWhiteParams::TC_MODE_WEIGHTEDSTD_BW): - mode = "WeightedStd"; - break; - } - - keyFile.set_string ("Black & White", "BeforeCurveMode", mode); - } - - if (!pedited || pedited->blackwhite.afterCurveMode) { - Glib::ustring mode; - - switch (blackwhite.afterCurveMode) { - case (BlackWhiteParams::TC_MODE_STD_BW): - mode = "Standard"; - break; - - case (BlackWhiteParams::TC_MODE_WEIGHTEDSTD_BW): - mode = "WeightedStd"; - break; - - default: - break; - } - - keyFile.set_string ("Black & White", "AfterCurveMode", mode); - } - - if (!pedited || pedited->blackwhite.beforeCurve) { - Glib::ArrayHandle tcurvebw = blackwhite.beforeCurve; - keyFile.set_double_list ("Black & White", "BeforeCurve", tcurvebw); - } - - if (!pedited || pedited->blackwhite.afterCurve) { - Glib::ArrayHandle tcurvebw = blackwhite.afterCurve; - keyFile.set_double_list ("Black & White", "AfterCurve", tcurvebw); - } - -// save luma curve - if (!pedited || pedited->labCurve.brightness) { - keyFile.set_integer ("Luminance Curve", "Brightness", labCurve.brightness); - } - - if (!pedited || pedited->labCurve.contrast) { - keyFile.set_integer ("Luminance Curve", "Contrast", labCurve.contrast); - } - - if (!pedited || pedited->labCurve.chromaticity) { - keyFile.set_integer ("Luminance Curve", "Chromaticity", labCurve.chromaticity); - } - - if (!pedited || pedited->labCurve.avoidcolorshift) { - keyFile.set_boolean ("Luminance Curve", "AvoidColorShift", labCurve.avoidcolorshift); - } - - if (!pedited || pedited->labCurve.rstprotection) { - keyFile.set_double ("Luminance Curve", "RedAndSkinTonesProtection", labCurve.rstprotection); - } - - if (!pedited || pedited->labCurve.lcredsk) { - keyFile.set_boolean ("Luminance Curve", "LCredsk", labCurve.lcredsk); - } - - if (!pedited || pedited->labCurve.lcurve) { - Glib::ArrayHandle lcurve = labCurve.lcurve; - keyFile.set_double_list ("Luminance Curve", "LCurve", lcurve); - } - - if (!pedited || pedited->labCurve.acurve) { - Glib::ArrayHandle acurve = labCurve.acurve; - keyFile.set_double_list ("Luminance Curve", "aCurve", acurve); - } - - if (!pedited || pedited->labCurve.bcurve) { - Glib::ArrayHandle bcurve = labCurve.bcurve; - keyFile.set_double_list ("Luminance Curve", "bCurve", bcurve); - } - - if (!pedited || pedited->labCurve.cccurve) { - Glib::ArrayHandle cccurve = labCurve.cccurve; - keyFile.set_double_list ("Luminance Curve", "ccCurve", cccurve); - } - - if (!pedited || pedited->labCurve.chcurve) { - Glib::ArrayHandle chcurve = labCurve.chcurve; - keyFile.set_double_list ("Luminance Curve", "chCurve", chcurve); - } - - if (!pedited || pedited->labCurve.lhcurve) { - Glib::ArrayHandle lhcurve = labCurve.lhcurve; - keyFile.set_double_list ("Luminance Curve", "lhCurve", lhcurve); - } - - if (!pedited || pedited->labCurve.hhcurve) { - Glib::ArrayHandle hhcurve = labCurve.hhcurve; - keyFile.set_double_list ("Luminance Curve", "hhCurve", hhcurve); - } - - if (!pedited || pedited->labCurve.lccurve) { - Glib::ArrayHandle lccurve = labCurve.lccurve; - keyFile.set_double_list ("Luminance Curve", "LcCurve", lccurve); - } - - if (!pedited || pedited->labCurve.clcurve) { - Glib::ArrayHandle clcurve = labCurve.clcurve; - keyFile.set_double_list ("Luminance Curve", "ClCurve", clcurve); - } - -// save sharpening - if (!pedited || pedited->sharpening.enabled) { - keyFile.set_boolean ("Sharpening", "Enabled", sharpening.enabled); - } - - if (!pedited || pedited->sharpening.method) { - keyFile.set_string ("Sharpening", "Method", sharpening.method); - } - - if (!pedited || pedited->sharpening.radius) { - keyFile.set_double ("Sharpening", "Radius", sharpening.radius); - } - - if (!pedited || pedited->sharpening.amount) { - keyFile.set_integer ("Sharpening", "Amount", sharpening.amount); - } - - if (!pedited || pedited->sharpening.threshold) { - Glib::ArrayHandle thresh (sharpening.threshold.value, 4, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("Sharpening", "Threshold", thresh); - } - - if (!pedited || pedited->sharpening.edgesonly) { - keyFile.set_boolean ("Sharpening", "OnlyEdges", sharpening.edgesonly); - } - - if (!pedited || pedited->sharpening.edges_radius) { - keyFile.set_double ("Sharpening", "EdgedetectionRadius", sharpening.edges_radius); - } - - if (!pedited || pedited->sharpening.edges_tolerance) { - keyFile.set_integer ("Sharpening", "EdgeTolerance", sharpening.edges_tolerance); - } - - if (!pedited || pedited->sharpening.halocontrol) { - keyFile.set_boolean ("Sharpening", "HalocontrolEnabled", sharpening.halocontrol); - } - - if (!pedited || pedited->sharpening.halocontrol_amount) { - keyFile.set_integer ("Sharpening", "HalocontrolAmount", sharpening.halocontrol_amount); - } - - if (!pedited || pedited->sharpening.deconvradius) { - keyFile.set_double ("Sharpening", "DeconvRadius", sharpening.deconvradius); - } - - if (!pedited || pedited->sharpening.deconvamount) { - keyFile.set_integer ("Sharpening", "DeconvAmount", sharpening.deconvamount); - } - - if (!pedited || pedited->sharpening.deconvdamping) { - keyFile.set_integer ("Sharpening", "DeconvDamping", sharpening.deconvdamping); - } - - if (!pedited || pedited->sharpening.deconviter) { - keyFile.set_integer ("Sharpening", "DeconvIterations", sharpening.deconviter); - } - -// save vibrance - if (!pedited || pedited->vibrance.enabled) { - keyFile.set_boolean ("Vibrance", "Enabled", vibrance.enabled); - } - - if (!pedited || pedited->vibrance.pastels) { - keyFile.set_integer ("Vibrance", "Pastels", vibrance.pastels); - } - - if (!pedited || pedited->vibrance.saturated) { - keyFile.set_integer ("Vibrance", "Saturated", vibrance.saturated); - } - - if (!pedited || pedited->vibrance.psthreshold) { - Glib::ArrayHandle thresh (vibrance.psthreshold.value, 2, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("Vibrance", "PSThreshold", thresh); - } - - if (!pedited || pedited->vibrance.protectskins) { - keyFile.set_boolean ("Vibrance", "ProtectSkins", vibrance.protectskins); - } - - if (!pedited || pedited->vibrance.avoidcolorshift) { - keyFile.set_boolean ("Vibrance", "AvoidColorShift", vibrance.avoidcolorshift); - } - - if (!pedited || pedited->vibrance.pastsattog) { - keyFile.set_boolean ("Vibrance", "PastSatTog", vibrance.pastsattog); - } - - if (!pedited || pedited->vibrance.skintonescurve) { - Glib::ArrayHandle skintonescurve = vibrance.skintonescurve; - keyFile.set_double_list ("Vibrance", "SkinTonesCurve", skintonescurve); - } - -//save edge sharpening - if (!pedited || pedited->sharpenEdge.enabled) { - keyFile.set_boolean ("SharpenEdge", "Enabled", sharpenEdge.enabled); - } - - if (!pedited || pedited->sharpenEdge.passes) { - keyFile.set_integer ("SharpenEdge", "Passes", sharpenEdge.passes); - } - - if (!pedited || pedited->sharpenEdge.amount) { - keyFile.set_double ("SharpenEdge", "Strength", sharpenEdge.amount); - } - - if (!pedited || pedited->sharpenEdge.threechannels) { - keyFile.set_boolean ("SharpenEdge", "ThreeChannels", sharpenEdge.threechannels); - } - -//save micro-contrast sharpening - if (!pedited || pedited->sharpenMicro.enabled) { - keyFile.set_boolean ("SharpenMicro", "Enabled", sharpenMicro.enabled); - } - - if (!pedited || pedited->sharpenMicro.matrix) { - keyFile.set_boolean ("SharpenMicro", "Matrix", sharpenMicro.matrix); - } - - if (!pedited || pedited->sharpenMicro.amount) { - keyFile.set_double ("SharpenMicro", "Strength", sharpenMicro.amount); - } - - if (!pedited || pedited->sharpenMicro.uniformity) { - keyFile.set_double ("SharpenMicro", "Uniformity", sharpenMicro.uniformity); - } - - /* - // save colorBoost - if (!pedited || pedited->colorBoost.amount) keyFile.set_integer ("Color Boost", "Amount", colorBoost.amount); - if (!pedited || pedited->colorBoost.avoidclip) keyFile.set_boolean ("Color Boost", "AvoidColorClipping", colorBoost.avoidclip); - if (!pedited || pedited->colorBoost.enable_saturationlimiter) keyFile.set_boolean ("Color Boost", "SaturationLimiter", colorBoost.enable_saturationlimiter); - if (!pedited || pedited->colorBoost.saturationlimit) keyFile.set_double ("Color Boost", "SaturationLimit", colorBoost.saturationlimit); - */ - - // save wb - if (!pedited || pedited->wb.method) { - keyFile.set_string ("White Balance", "Setting", wb.method); - } - - if (!pedited || pedited->wb.temperature) { - keyFile.set_integer ("White Balance", "Temperature", wb.temperature); - } - - if (!pedited || pedited->wb.green) { - keyFile.set_double ("White Balance", "Green", wb.green); - } - - if (!pedited || pedited->wb.equal) { - keyFile.set_double ("White Balance", "Equal", wb.equal); - } - - if (!pedited || pedited->wb.tempBias) { - keyFile.set_double ("White Balance", "TemperatureBias", wb.tempBias); - } - - /* - // save colorShift - if (!pedited || pedited->colorShift.a) keyFile.set_double ("Color Shift", "ChannelA", colorShift.a); - if (!pedited || pedited->colorShift.b) keyFile.set_double ("Color Shift", "ChannelB", colorShift.b); - */ -// save colorappearance - if (!pedited || pedited->colorappearance.enabled) { - keyFile.set_boolean ("Color appearance", "Enabled", colorappearance.enabled); - } - - if (!pedited || pedited->colorappearance.degree) { - keyFile.set_integer ("Color appearance", "Degree", colorappearance.degree); - } - - if (!pedited || pedited->colorappearance.autodegree) { - keyFile.set_boolean ("Color appearance", "AutoDegree", colorappearance.autodegree); - } - - if (!pedited || pedited->colorappearance.degreeout) { - keyFile.set_integer ("Color appearance", "Degreeout", colorappearance.degreeout); - } - - if (!pedited || pedited->colorappearance.autodegreeout) { - keyFile.set_boolean ("Color appearance", "AutoDegreeout", colorappearance.autodegreeout); - } - - if (!pedited || pedited->colorappearance.surround) { - keyFile.set_string ("Color appearance", "Surround", colorappearance.surround); - } - - if (!pedited || pedited->colorappearance.surrsrc) { - keyFile.set_string ("Color appearance", "Surrsrc", colorappearance.surrsrc); - } - -// if (!pedited || pedited->colorappearance.backgrd) keyFile.set_integer ("Color appearance", "Background", colorappearance.backgrd); - if (!pedited || pedited->colorappearance.adaplum) { - keyFile.set_double ("Color appearance", "AdaptLum", colorappearance.adaplum); - } - - if (!pedited || pedited->colorappearance.badpixsl) { - keyFile.set_integer ("Color appearance", "Badpixsl", colorappearance.badpixsl); - } - - if (!pedited || pedited->colorappearance.wbmodel) { - keyFile.set_string ("Color appearance", "Model", colorappearance.wbmodel); - } - - if (!pedited || pedited->colorappearance.algo) { - keyFile.set_string ("Color appearance", "Algorithm", colorappearance.algo); - } - - if (!pedited || pedited->colorappearance.jlight) { - keyFile.set_double ("Color appearance", "J-Light", colorappearance.jlight); - } - - if (!pedited || pedited->colorappearance.qbright) { - keyFile.set_double ("Color appearance", "Q-Bright", colorappearance.qbright); - } - - if (!pedited || pedited->colorappearance.chroma) { - keyFile.set_double ("Color appearance", "C-Chroma", colorappearance.chroma); - } - - if (!pedited || pedited->colorappearance.schroma) { - keyFile.set_double ("Color appearance", "S-Chroma", colorappearance.schroma); - } - - if (!pedited || pedited->colorappearance.mchroma) { - keyFile.set_double ("Color appearance", "M-Chroma", colorappearance.mchroma); - } - - if (!pedited || pedited->colorappearance.contrast) { - keyFile.set_double ("Color appearance", "J-Contrast", colorappearance.contrast); - } - - if (!pedited || pedited->colorappearance.qcontrast) { - keyFile.set_double ("Color appearance", "Q-Contrast", colorappearance.qcontrast); - } - - if (!pedited || pedited->colorappearance.colorh) { - keyFile.set_double ("Color appearance", "H-Hue", colorappearance.colorh); - } - - if (!pedited || pedited->colorappearance.rstprotection) { - keyFile.set_double ("Color appearance", "RSTProtection", colorappearance.rstprotection); - } - - if (!pedited || pedited->colorappearance.adapscen) { - keyFile.set_double ("Color appearance", "AdaptScene", colorappearance.adapscen); - } - - if (!pedited || pedited->colorappearance.autoadapscen) { - keyFile.set_boolean ("Color appearance", "AutoAdapscen", colorappearance.autoadapscen); - } - - if (!pedited || pedited->colorappearance.ybscen) { - keyFile.set_integer ("Color appearance", "YbScene", colorappearance.ybscen); - } - - if (!pedited || pedited->colorappearance.autoybscen) { - keyFile.set_boolean ("Color appearance", "Autoybscen", colorappearance.autoybscen); - } - - if (!pedited || pedited->colorappearance.surrsource) { - keyFile.set_boolean ("Color appearance", "SurrSource", colorappearance.surrsource); - } - - if (!pedited || pedited->colorappearance.gamut) { - keyFile.set_boolean ("Color appearance", "Gamut", colorappearance.gamut); - } - - if (!pedited || pedited->colorappearance.tempout) { - keyFile.set_integer ("Color appearance", "Tempout", colorappearance.tempout); - } - - if (!pedited || pedited->colorappearance.greenout) { - keyFile.set_double ("Color appearance", "Greenout", colorappearance.greenout); - } - - if (!pedited || pedited->colorappearance.tempsc) { - keyFile.set_integer ("Color appearance", "Tempsc", colorappearance.tempsc); - } - - if (!pedited || pedited->colorappearance.greensc) { - keyFile.set_double ("Color appearance", "Greensc", colorappearance.greensc); - } - - if (!pedited || pedited->colorappearance.ybout) { - keyFile.set_integer ("Color appearance", "Ybout", colorappearance.ybout); - } - -// if (!pedited || pedited->colorappearance.badpix) keyFile.set_boolean ("Color appearance", "Badpix", colorappearance.badpix); - if (!pedited || pedited->colorappearance.datacie) { - keyFile.set_boolean ("Color appearance", "Datacie", colorappearance.datacie); - } - - if (!pedited || pedited->colorappearance.tonecie) { - keyFile.set_boolean ("Color appearance", "Tonecie", colorappearance.tonecie); - } - -// if (!pedited || pedited->colorappearance.sharpcie) keyFile.set_boolean ("Color appearance", "Sharpcie", colorappearance.sharpcie); - if (!pedited || pedited->colorappearance.curveMode) { - Glib::ustring method; - - switch (colorappearance.curveMode) { - case (ColorAppearanceParams::TC_MODE_LIGHT): - method = "Lightness"; - break; - - case (ColorAppearanceParams::TC_MODE_BRIGHT): - method = "Brightness"; - break; - } - - keyFile.set_string ("Color appearance", "CurveMode", method); - } - - if (!pedited || pedited->colorappearance.curveMode2) { - Glib::ustring method; - - switch (colorappearance.curveMode2) { - case (ColorAppearanceParams::TC_MODE_LIGHT): - method = "Lightness"; - break; - - case (ColorAppearanceParams::TC_MODE_BRIGHT): - method = "Brightness"; - break; - } - - keyFile.set_string ("Color appearance", "CurveMode2", method); - } - - if (!pedited || pedited->colorappearance.curveMode3) { - Glib::ustring method; - - switch (colorappearance.curveMode3) { - case (ColorAppearanceParams::TC_MODE_CHROMA): - method = "Chroma"; - break; - - case (ColorAppearanceParams::TC_MODE_SATUR): - method = "Saturation"; - break; - - case (ColorAppearanceParams::TC_MODE_COLORF): - method = "Colorfullness"; - break; - - } - - keyFile.set_string ("Color appearance", "CurveMode3", method); - } - - if (!pedited || pedited->colorappearance.curve) { - Glib::ArrayHandle tcurve = colorappearance.curve; - keyFile.set_double_list ("Color appearance", "Curve", tcurve); - } - - if (!pedited || pedited->colorappearance.curve2) { - Glib::ArrayHandle tcurve = colorappearance.curve2; - keyFile.set_double_list ("Color appearance", "Curve2", tcurve); - } - - if (!pedited || pedited->colorappearance.curve3) { - Glib::ArrayHandle tcurve = colorappearance.curve3; - keyFile.set_double_list ("Color appearance", "Curve3", tcurve); - } - - - -// save impulseDenoise - if (!pedited || pedited->impulseDenoise.enabled) { - keyFile.set_boolean ("Impulse Denoising", "Enabled", impulseDenoise.enabled); - } - - if (!pedited || pedited->impulseDenoise.thresh) { - keyFile.set_integer ("Impulse Denoising", "Threshold", impulseDenoise.thresh); - } - -// save defringe - if (!pedited || pedited->defringe.enabled) { - keyFile.set_boolean ("Defringing", "Enabled", defringe.enabled); - } - - if (!pedited || pedited->defringe.radius) { - keyFile.set_double ("Defringing", "Radius", defringe.radius); - } - - if (!pedited || pedited->defringe.threshold) { - keyFile.set_integer ("Defringing", "Threshold", defringe.threshold); - } - - if (!pedited || pedited->defringe.huecurve) { - Glib::ArrayHandle huecurve = defringe.huecurve; - keyFile.set_double_list ("Defringing", "HueCurve", huecurve); - } - -// save dirpyrDenoise - if (!pedited || pedited->dirpyrDenoise.enabled) { - keyFile.set_boolean ("Directional Pyramid Denoising", "Enabled", dirpyrDenoise.enabled); - } - - if (!pedited || pedited->dirpyrDenoise.enhance) { - keyFile.set_boolean ("Directional Pyramid Denoising", "Enhance", dirpyrDenoise.enhance); - } - - if (!pedited || pedited->dirpyrDenoise.median) { - keyFile.set_boolean ("Directional Pyramid Denoising", "Median", dirpyrDenoise.median); - } - -// if (!pedited || pedited->dirpyrDenoise.perform) keyFile.set_boolean ("Directional Pyramid Denoising", "Perform", dirpyrDenoise.perform); - if (!pedited || pedited->dirpyrDenoise.luma) { - keyFile.set_double ("Directional Pyramid Denoising", "Luma", dirpyrDenoise.luma); - } - - if (!pedited || pedited->dirpyrDenoise.Ldetail) { - keyFile.set_double ("Directional Pyramid Denoising", "Ldetail", dirpyrDenoise.Ldetail); - } - - if (!pedited || pedited->dirpyrDenoise.chroma) { - keyFile.set_double ("Directional Pyramid Denoising", "Chroma", dirpyrDenoise.chroma); - } - - if (!pedited || pedited->dirpyrDenoise.dmethod) { - keyFile.set_string ("Directional Pyramid Denoising", "Method", dirpyrDenoise.dmethod); - } - - if (!pedited || pedited->dirpyrDenoise.Lmethod) { - keyFile.set_string ("Directional Pyramid Denoising", "LMethod", dirpyrDenoise.Lmethod); - } - -// never save 'auto chroma preview mode' to pp3 - if (!pedited || pedited->dirpyrDenoise.Cmethod) { - if (dirpyrDenoise.Cmethod == "PRE") { - dirpyrDenoise.Cmethod = "MAN"; - } - - keyFile.set_string ("Directional Pyramid Denoising", "CMethod", dirpyrDenoise.Cmethod); - } - - if (!pedited || pedited->dirpyrDenoise.C2method) { - if (dirpyrDenoise.C2method == "PREV") { - dirpyrDenoise.C2method = "MANU"; - } - - keyFile.set_string ("Directional Pyramid Denoising", "C2Method", dirpyrDenoise.C2method); - } - - if (!pedited || pedited->dirpyrDenoise.smethod) { - keyFile.set_string ("Directional Pyramid Denoising", "SMethod", dirpyrDenoise.smethod); - } - - if (!pedited || pedited->dirpyrDenoise.medmethod) { - keyFile.set_string ("Directional Pyramid Denoising", "MedMethod", dirpyrDenoise.medmethod); - } - - if (!pedited || pedited->dirpyrDenoise.rgbmethod) { - keyFile.set_string ("Directional Pyramid Denoising", "RGBMethod", dirpyrDenoise.rgbmethod); - } - - if (!pedited || pedited->dirpyrDenoise.methodmed) { - keyFile.set_string ("Directional Pyramid Denoising", "MethodMed", dirpyrDenoise.methodmed); - } - - if (!pedited || pedited->dirpyrDenoise.redchro) { - keyFile.set_double ("Directional Pyramid Denoising", "Redchro", dirpyrDenoise.redchro); - } - - if (!pedited || pedited->dirpyrDenoise.bluechro) { - keyFile.set_double ("Directional Pyramid Denoising", "Bluechro", dirpyrDenoise.bluechro); - } - - if (!pedited || pedited->dirpyrDenoise.gamma) { - keyFile.set_double ("Directional Pyramid Denoising", "Gamma", dirpyrDenoise.gamma); - } - - if (!pedited || pedited->dirpyrDenoise.passes) { - keyFile.set_integer ("Directional Pyramid Denoising", "Passes", dirpyrDenoise.passes); - } - - if (!pedited || pedited->dirpyrDenoise.lcurve) { - Glib::ArrayHandle lcurve = dirpyrDenoise.lcurve; - keyFile.set_double_list ("Directional Pyramid Denoising", "LCurve", lcurve); - } - - if (!pedited || pedited->dirpyrDenoise.cccurve) { - Glib::ArrayHandle cccurve = dirpyrDenoise.cccurve; - keyFile.set_double_list ("Directional Pyramid Denoising", "CCCurve", cccurve); - } - -// save epd. - if (!pedited || pedited->epd.enabled) { - keyFile.set_boolean ("EPD", "Enabled", epd.enabled); - } - - if (!pedited || pedited->epd.strength) { - keyFile.set_double ("EPD", "Strength", epd.strength); - } - - if (!pedited || pedited->epd.gamma) { - keyFile.set_double ("EPD", "Gamma", epd.gamma); - } - - if (!pedited || pedited->epd.edgeStopping) { - keyFile.set_double ("EPD", "EdgeStopping", epd.edgeStopping); - } - - if (!pedited || pedited->epd.scale) { - keyFile.set_double ("EPD", "Scale", epd.scale); - } - - if (!pedited || pedited->epd.reweightingIterates) { - keyFile.set_integer ("EPD", "ReweightingIterates", epd.reweightingIterates); - } - -// save fattal - if (!pedited || pedited->fattal.enabled) { - keyFile.set_boolean ("FattalToneMapping", "Enabled", fattal.enabled); - } - - if (!pedited || pedited->fattal.threshold) { - keyFile.set_integer ("FattalToneMapping", "Threshold", fattal.threshold); - } - - if (!pedited || pedited->fattal.amount) { - keyFile.set_integer ("FattalToneMapping", "Amount", fattal.amount); - } - - /* - // save lumaDenoise - if (!pedited || pedited->lumaDenoise.enabled) keyFile.set_boolean ("Luminance Denoising", "Enabled", lumaDenoise.enabled); - if (!pedited || pedited->lumaDenoise.radius) keyFile.set_double ("Luminance Denoising", "Radius", lumaDenoise.radius); - if (!pedited || pedited->lumaDenoise.edgetolerance) keyFile.set_integer ("Luminance Denoising", "EdgeTolerance", lumaDenoise.edgetolerance); - */ - - /* - // save colorDenoise - //if (!pedited || pedited->colorDenoise.enabled) keyFile.set_boolean ("Chrominance Denoising", "Enabled", colorDenoise.enabled); - if (!pedited || pedited->colorDenoise.amount) keyFile.set_integer ("Chrominance Denoising", "Amount", colorDenoise.amount); - */ - -// save sh - if (!pedited || pedited->sh.enabled) { - keyFile.set_boolean ("Shadows & Highlights", "Enabled", sh.enabled); - } - - if (!pedited || pedited->sh.hq) { - keyFile.set_boolean ("Shadows & Highlights", "HighQuality", sh.hq); - } - - if (!pedited || pedited->sh.highlights) { - keyFile.set_integer ("Shadows & Highlights", "Highlights", sh.highlights); - } - - if (!pedited || pedited->sh.htonalwidth) { - keyFile.set_integer ("Shadows & Highlights", "HighlightTonalWidth", sh.htonalwidth); - } - - if (!pedited || pedited->sh.shadows) { - keyFile.set_integer ("Shadows & Highlights", "Shadows", sh.shadows); - } - - if (!pedited || pedited->sh.stonalwidth) { - keyFile.set_integer ("Shadows & Highlights", "ShadowTonalWidth", sh.stonalwidth); - } - - if (!pedited || pedited->sh.localcontrast) { - keyFile.set_integer ("Shadows & Highlights", "LocalContrast", sh.localcontrast); - } - - if (!pedited || pedited->sh.radius) { - keyFile.set_integer ("Shadows & Highlights", "Radius", sh.radius); - } - -// save crop - if (!pedited || pedited->crop.enabled) { - keyFile.set_boolean ("Crop", "Enabled", crop.enabled); - } - - if (!pedited || pedited->crop.x) { - keyFile.set_integer ("Crop", "X", crop.x); - } - - if (!pedited || pedited->crop.y) { - keyFile.set_integer ("Crop", "Y", crop.y); - } - - if (!pedited || pedited->crop.w) { - keyFile.set_integer ("Crop", "W", crop.w); - } - - if (!pedited || pedited->crop.h) { - keyFile.set_integer ("Crop", "H", crop.h); - } - - if (!pedited || pedited->crop.fixratio) { - keyFile.set_boolean ("Crop", "FixedRatio", crop.fixratio); - } - - if (!pedited || pedited->crop.ratio) { - keyFile.set_string ("Crop", "Ratio", crop.ratio); - } - - if (!pedited || pedited->crop.orientation) { - keyFile.set_string ("Crop", "Orientation", crop.orientation); - } - - if (!pedited || pedited->crop.guide) { - keyFile.set_string ("Crop", "Guide", crop.guide); - } - -// save coarse - if (!pedited || pedited->coarse.rotate) { - keyFile.set_integer ("Coarse Transformation", "Rotate", coarse.rotate); - } - - if (!pedited || pedited->coarse.hflip) { - keyFile.set_boolean ("Coarse Transformation", "HorizontalFlip", coarse.hflip); - } - - if (!pedited || pedited->coarse.vflip) { - keyFile.set_boolean ("Coarse Transformation", "VerticalFlip", coarse.vflip); - } - -// save commonTrans - if (!pedited || pedited->commonTrans.autofill) { - keyFile.set_boolean ("Common Properties for Transformations", "AutoFill", commonTrans.autofill); - } - -// save rotate - if (!pedited || pedited->rotate.degree) { - keyFile.set_double ("Rotation", "Degree", rotate.degree); - } - -// save distortion - if (!pedited || pedited->distortion.amount) { - keyFile.set_double ("Distortion", "Amount", distortion.amount); - } - -// lens profile - if (!pedited || pedited->lensProf.lcMode) { - keyFile.set_string ("LensProfile", "LcMode", lensProf.getMethodString (lensProf.lcMode)); - } - - if (!pedited || pedited->lensProf.lcpFile) { - keyFile.set_string ("LensProfile", "LCPFile", relativePathIfInside (fname, fnameAbsolute, lensProf.lcpFile)); - } - - if (!pedited || pedited->lensProf.useDist) { - keyFile.set_boolean ("LensProfile", "UseDistortion", lensProf.useDist); - } - - if (!pedited || pedited->lensProf.useVign) { - keyFile.set_boolean ("LensProfile", "UseVignette", lensProf.useVign); - } - - if (!pedited || pedited->lensProf.useCA) { - keyFile.set_boolean ("LensProfile", "UseCA", lensProf.useCA); - } - - if (!pedited || pedited->lensProf.lfCameraMake) { - keyFile.set_string("LensProfile", "LFCameraMake", lensProf.lfCameraMake); - } - if (!pedited || pedited->lensProf.lfCameraModel) { - keyFile.set_string("LensProfile", "LFCameraModel", lensProf.lfCameraModel); - } - if (!pedited || pedited->lensProf.lfLens) { - keyFile.set_string("LensProfile", "LFLens", lensProf.lfLens); - } - -// save perspective correction - if (!pedited || pedited->perspective.horizontal) { - keyFile.set_double ("Perspective", "Horizontal", perspective.horizontal); - } - - if (!pedited || pedited->perspective.vertical) { - keyFile.set_double ("Perspective", "Vertical", perspective.vertical); - } - -// save gradient - if (!pedited || pedited->gradient.enabled) { - keyFile.set_boolean ("Gradient", "Enabled", gradient.enabled); - } - - if (!pedited || pedited->gradient.degree) { - keyFile.set_double ("Gradient", "Degree", gradient.degree); - } - - if (!pedited || pedited->gradient.feather) { - keyFile.set_integer ("Gradient", "Feather", gradient.feather); - } - - if (!pedited || pedited->gradient.strength) { - keyFile.set_double ("Gradient", "Strength", gradient.strength); - } - - if (!pedited || pedited->gradient.centerX) { - keyFile.set_integer ("Gradient", "CenterX", gradient.centerX); - } - - if (!pedited || pedited->gradient.centerY) { - keyFile.set_integer ("Gradient", "CenterY", gradient.centerY); - } - -// save post-crop vignette - if (!pedited || pedited->pcvignette.enabled) { - keyFile.set_boolean ("PCVignette", "Enabled", pcvignette.enabled); - } - - if (!pedited || pedited->pcvignette.strength) { - keyFile.set_double ("PCVignette", "Strength", pcvignette.strength); - } - - if (!pedited || pedited->pcvignette.feather) { - keyFile.set_integer ("PCVignette", "Feather", pcvignette.feather); - } - - if (!pedited || pedited->pcvignette.roundness) { - keyFile.set_integer ("PCVignette", "Roundness", pcvignette.roundness); - } - -// save C/A correction - if (!pedited || pedited->cacorrection.red) { - keyFile.set_double ("CACorrection", "Red", cacorrection.red); - } - - if (!pedited || pedited->cacorrection.blue) { - keyFile.set_double ("CACorrection", "Blue", cacorrection.blue); - } - -// save vignetting correction - if (!pedited || pedited->vignetting.amount) { - keyFile.set_integer ("Vignetting Correction", "Amount", vignetting.amount); - } - - if (!pedited || pedited->vignetting.radius) { - keyFile.set_integer ("Vignetting Correction", "Radius", vignetting.radius); - } - - if (!pedited || pedited->vignetting.strength) { - keyFile.set_integer ("Vignetting Correction", "Strength", vignetting.strength); - } - - if (!pedited || pedited->vignetting.centerX) { - keyFile.set_integer ("Vignetting Correction", "CenterX", vignetting.centerX); - } - - if (!pedited || pedited->vignetting.centerY) { - keyFile.set_integer ("Vignetting Correction", "CenterY", vignetting.centerY); - } - - - if (!pedited || pedited->resize.enabled) { - keyFile.set_boolean ("Resize", "Enabled", resize.enabled); - } - - if (!pedited || pedited->resize.scale) { - keyFile.set_double ("Resize", "Scale", resize.scale); - } - - if (!pedited || pedited->resize.appliesTo) { - keyFile.set_string ("Resize", "AppliesTo", resize.appliesTo); - } - - if (!pedited || pedited->resize.method) { - keyFile.set_string ("Resize", "Method", resize.method); - } - - if (!pedited || pedited->resize.dataspec) { - keyFile.set_integer ("Resize", "DataSpecified", resize.dataspec); - } - - if (!pedited || pedited->resize.width) { - keyFile.set_integer ("Resize", "Width", resize.width); - } - - if (!pedited || pedited->resize.height) { - keyFile.set_integer ("Resize", "Height", resize.height); - } - - if (!pedited || pedited->prsharpening.enabled) { - keyFile.set_boolean ("PostResizeSharpening", "Enabled", prsharpening.enabled); - } - - if (!pedited || pedited->prsharpening.method) { - keyFile.set_string ("PostResizeSharpening", "Method", prsharpening.method); - } - - if (!pedited || pedited->prsharpening.radius) { - keyFile.set_double ("PostResizeSharpening", "Radius", prsharpening.radius); - } - - if (!pedited || pedited->prsharpening.amount) { - keyFile.set_integer ("PostResizeSharpening", "Amount", prsharpening.amount); - } - - if (!pedited || pedited->prsharpening.threshold) { - Glib::ArrayHandle thresh (prsharpening.threshold.value, 4, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("PostResizeSharpening", "Threshold", thresh); - } - - if (!pedited || pedited->prsharpening.edgesonly) { - keyFile.set_boolean ("PostResizeSharpening", "OnlyEdges", prsharpening.edgesonly); - } - - if (!pedited || pedited->prsharpening.edges_radius) { - keyFile.set_double ("PostResizeSharpening", "EdgedetectionRadius", prsharpening.edges_radius); - } - - if (!pedited || pedited->prsharpening.edges_tolerance) { - keyFile.set_integer ("PostResizeSharpening", "EdgeTolerance", prsharpening.edges_tolerance); - } - - if (!pedited || pedited->prsharpening.halocontrol) { - keyFile.set_boolean ("PostResizeSharpening", "HalocontrolEnabled", prsharpening.halocontrol); - } - - if (!pedited || pedited->prsharpening.halocontrol_amount) { - keyFile.set_integer ("PostResizeSharpening", "HalocontrolAmount", prsharpening.halocontrol_amount); - } - - if (!pedited || pedited->prsharpening.deconvradius) { - keyFile.set_double ("PostResizeSharpening", "DeconvRadius", prsharpening.deconvradius); - } - - if (!pedited || pedited->prsharpening.deconvamount) { - keyFile.set_integer ("PostResizeSharpening", "DeconvAmount", prsharpening.deconvamount); - } - - if (!pedited || pedited->prsharpening.deconvdamping) { - keyFile.set_integer ("PostResizeSharpening", "DeconvDamping", prsharpening.deconvdamping); - } - - if (!pedited || pedited->prsharpening.deconviter) { - keyFile.set_integer ("PostResizeSharpening", "DeconvIterations", prsharpening.deconviter); - } - - -// save color management settings - if (!pedited || pedited->icm.input) { - keyFile.set_string ("Color Management", "InputProfile", relativePathIfInside (fname, fnameAbsolute, icm.input)); - } - - if (!pedited || pedited->icm.toneCurve) { - keyFile.set_boolean ("Color Management", "ToneCurve", icm.toneCurve); - } - - if (!pedited || pedited->icm.applyLookTable) { - keyFile.set_boolean ("Color Management", "ApplyLookTable", icm.applyLookTable); - } - - if (!pedited || pedited->icm.applyBaselineExposureOffset) { - keyFile.set_boolean ("Color Management", "ApplyBaselineExposureOffset", icm.applyBaselineExposureOffset); - } - - if (!pedited || pedited->icm.applyHueSatMap) { - keyFile.set_boolean ("Color Management", "ApplyHueSatMap", icm.applyHueSatMap); - } - - if (!pedited || pedited->icm.dcpIlluminant) { - keyFile.set_integer ("Color Management", "DCPIlluminant", icm.dcpIlluminant); - } - - if (!pedited || pedited->icm.working) { - keyFile.set_string ("Color Management", "WorkingProfile", icm.working); - } - - if (!pedited || pedited->icm.output) { - keyFile.set_string ("Color Management", "OutputProfile", icm.output); - } - - if (!pedited || pedited->icm.outputIntent) { - Glib::ustring intent; - - switch (icm.outputIntent) { - default: - case RI_PERCEPTUAL: - intent = "Perceptual"; - break; - - case RI_RELATIVE: - intent = "Relative"; - break; - - case RI_SATURATION: - intent = "Saturation"; - break; - - case RI_ABSOLUTE: - intent = "Absolute"; - break; - } - - keyFile.set_string ("Color Management", "OutputProfileIntent", intent); - } - - if (!pedited || pedited->icm.outputBPC) { - keyFile.set_boolean ("Color Management", "OutputBPC", icm.outputBPC); - } - - if (!pedited || pedited->icm.gamma) { - keyFile.set_string ("Color Management", "Gammafree", icm.gamma); - } - - if (!pedited || pedited->icm.freegamma) { - keyFile.set_boolean ("Color Management", "Freegamma", icm.freegamma); - } - - if (!pedited || pedited->icm.gampos) { - keyFile.set_double ("Color Management", "GammaValue", icm.gampos); - } - - if (!pedited || pedited->icm.slpos) { - keyFile.set_double ("Color Management", "GammaSlope", icm.slpos); - } - - - -// save wavelet parameters - if (!pedited || pedited->wavelet.enabled) { - keyFile.set_boolean ("Wavelet", "Enabled", wavelet.enabled); - } - - if (!pedited || pedited->wavelet.strength) { - keyFile.set_integer ("Wavelet", "Strength", wavelet.strength); - } - - if (!pedited || pedited->wavelet.balance) { - keyFile.set_integer ("Wavelet", "Balance", wavelet.balance); - } - - if (!pedited || pedited->wavelet.iter) { - keyFile.set_integer ("Wavelet", "Iter", wavelet.iter); - } - - if (!pedited || pedited->wavelet.thres) { - keyFile.set_integer ("Wavelet", "MaxLev", wavelet.thres); - } - - if (!pedited || pedited->wavelet.Tilesmethod) { - keyFile.set_string ("Wavelet", "TilesMethod", wavelet.Tilesmethod); - } - - if (!pedited || pedited->wavelet.daubcoeffmethod) { - keyFile.set_string ("Wavelet", "DaubMethod", wavelet.daubcoeffmethod); - } - - if (!pedited || pedited->wavelet.CLmethod) { - keyFile.set_string ("Wavelet", "ChoiceLevMethod", wavelet.CLmethod); - } - - if (!pedited || pedited->wavelet.Backmethod) { - keyFile.set_string ("Wavelet", "BackMethod", wavelet.Backmethod); - } - - if (!pedited || pedited->wavelet.Lmethod) { - keyFile.set_string ("Wavelet", "LevMethod", wavelet.Lmethod); - } - - if (!pedited || pedited->wavelet.Dirmethod) { - keyFile.set_string ("Wavelet", "DirMethod", wavelet.Dirmethod); - } - - if (!pedited || pedited->wavelet.greenhigh) { - keyFile.set_integer ("Wavelet", "CBgreenhigh", wavelet.greenhigh); - } - - if (!pedited || pedited->wavelet.greenmed) { - keyFile.set_integer ("Wavelet", "CBgreenmed", wavelet.greenmed); - } - - if (!pedited || pedited->wavelet.greenlow) { - keyFile.set_integer ("Wavelet", "CBgreenlow", wavelet.greenlow); - } - - if (!pedited || pedited->wavelet.bluehigh) { - keyFile.set_integer ("Wavelet", "CBbluehigh", wavelet.bluehigh); - } - - if (!pedited || pedited->wavelet.bluemed) { - keyFile.set_integer ("Wavelet", "CBbluemed", wavelet.bluemed); - } - - if (!pedited || pedited->wavelet.bluelow) { - keyFile.set_integer ("Wavelet", "CBbluelow", wavelet.bluelow); - } - - if (!pedited || pedited->wavelet.expcontrast) { - keyFile.set_boolean ("Wavelet", "Expcontrast", wavelet.expcontrast); - } - - if (!pedited || pedited->wavelet.expchroma) { - keyFile.set_boolean ("Wavelet", "Expchroma", wavelet.expchroma); - } - - if (!pedited || pedited->wavelet.expedge) { - keyFile.set_boolean ("Wavelet", "Expedge", wavelet.expedge); - } - - if (!pedited || pedited->wavelet.expresid) { - keyFile.set_boolean ("Wavelet", "Expresid", wavelet.expresid); - } - - if (!pedited || pedited->wavelet.expfinal) { - keyFile.set_boolean ("Wavelet", "Expfinal", wavelet.expfinal); - } - - if (!pedited || pedited->wavelet.exptoning) { - keyFile.set_boolean ("Wavelet", "Exptoning", wavelet.exptoning); - } - - if (!pedited || pedited->wavelet.expnoise) { - keyFile.set_boolean ("Wavelet", "Expnoise", wavelet.expnoise); - } +// Black & White + saveToKeyfile(!pedited || pedited->blackwhite.enabled, "Black & White", "Enabled", blackwhite.enabled, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.method, "Black & White", "Method", blackwhite.method, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.autoc, "Black & White", "Auto", blackwhite.autoc, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.enabledcc, "Black & White", "ComplementaryColors", blackwhite.enabledcc, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.setting, "Black & White", "Setting", blackwhite.setting, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.filter, "Black & White", "Filter", blackwhite.filter, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.mixerRed, "Black & White", "MixerRed", blackwhite.mixerRed, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.mixerOrange, "Black & White", "MixerOrange", blackwhite.mixerOrange, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.mixerYellow, "Black & White", "MixerYellow", blackwhite.mixerYellow, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.mixerGreen, "Black & White", "MixerGreen", blackwhite.mixerGreen, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.mixerCyan, "Black & White", "MixerCyan", blackwhite.mixerCyan, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.mixerBlue, "Black & White", "MixerBlue", blackwhite.mixerBlue, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.mixerMagenta, "Black & White", "MixerMagenta", blackwhite.mixerMagenta, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.mixerPurple, "Black & White", "MixerPurple", blackwhite.mixerPurple, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.gammaRed, "Black & White", "GammaRed", blackwhite.gammaRed, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.gammaGreen, "Black & White", "GammaGreen", blackwhite.gammaGreen, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.gammaBlue, "Black & White", "GammaBlue", blackwhite.gammaBlue, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.algo, "Black & White", "Algorithm", blackwhite.algo, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.luminanceCurve, "Black & White", "LuminanceCurve", blackwhite.luminanceCurve, keyFile); + saveToKeyfile( + !pedited || pedited->blackwhite.beforeCurveMode, + "Black & White", + "BeforeCurveMode", + { + {BlackWhiteParams::TcMode::STD_BW, "Standard"}, + {BlackWhiteParams::TcMode::FILMLIKE_BW, "FilmLike"}, + {BlackWhiteParams::TcMode::SATANDVALBLENDING_BW, "SatAndValueBlending"}, + {BlackWhiteParams::TcMode::WEIGHTEDSTD_BW, "WeightedStd"} + + }, + blackwhite.beforeCurveMode, + keyFile + ); + saveToKeyfile( + !pedited || pedited->blackwhite.afterCurveMode, + "Black & White", + "AfterCurveMode", + { + {BlackWhiteParams::TcMode::STD_BW, "Standard"}, + {BlackWhiteParams::TcMode::WEIGHTEDSTD_BW, "WeightedStd"} + + }, + blackwhite.afterCurveMode, + keyFile + ); + saveToKeyfile(!pedited || pedited->blackwhite.beforeCurve, "Black & White", "BeforeCurve", blackwhite.beforeCurve, keyFile); + saveToKeyfile(!pedited || pedited->blackwhite.afterCurve, "Black & White", "AfterCurve", blackwhite.afterCurve, keyFile); + +// Luma curve + saveToKeyfile(!pedited || pedited->labCurve.enabled, "Luminance Curve", "Enabled", labCurve.enabled, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.brightness, "Luminance Curve", "Brightness", labCurve.brightness, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.contrast, "Luminance Curve", "Contrast", labCurve.contrast, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.chromaticity, "Luminance Curve", "Chromaticity", labCurve.chromaticity, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.avoidcolorshift, "Luminance Curve", "AvoidColorShift", labCurve.avoidcolorshift, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.rstprotection, "Luminance Curve", "RedAndSkinTonesProtection", labCurve.rstprotection, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.lcredsk, "Luminance Curve", "LCredsk", labCurve.lcredsk, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.lcurve, "Luminance Curve", "LCurve", labCurve.lcurve, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.acurve, "Luminance Curve", "aCurve", labCurve.acurve, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.bcurve, "Luminance Curve", "bCurve", labCurve.bcurve, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.cccurve, "Luminance Curve", "ccCurve", labCurve.cccurve, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.chcurve, "Luminance Curve", "chCurve", labCurve.chcurve, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.lhcurve, "Luminance Curve", "lhCurve", labCurve.lhcurve, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.hhcurve, "Luminance Curve", "hhCurve", labCurve.hhcurve, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.lccurve, "Luminance Curve", "LcCurve", labCurve.lccurve, keyFile); + saveToKeyfile(!pedited || pedited->labCurve.clcurve, "Luminance Curve", "ClCurve", labCurve.clcurve, keyFile); + +// Sharpening + saveToKeyfile(!pedited || pedited->sharpening.enabled, "Sharpening", "Enabled", sharpening.enabled, keyFile); + saveToKeyfile(!pedited || pedited->sharpening.method, "Sharpening", "Method", sharpening.method, keyFile); + saveToKeyfile(!pedited || pedited->sharpening.radius, "Sharpening", "Radius", sharpening.radius, keyFile); + saveToKeyfile(!pedited || pedited->sharpening.amount, "Sharpening", "Amount", sharpening.amount, keyFile); + saveToKeyfile(!pedited || pedited->sharpening.threshold, "Sharpening", "Threshold", sharpening.threshold.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->sharpening.edgesonly, "Sharpening", "OnlyEdges", sharpening.edgesonly, keyFile); + saveToKeyfile(!pedited || pedited->sharpening.edges_radius, "Sharpening", "EdgedetectionRadius", sharpening.edges_radius, keyFile); + saveToKeyfile(!pedited || pedited->sharpening.edges_tolerance, "Sharpening", "EdgeTolerance", sharpening.edges_tolerance, keyFile); + saveToKeyfile(!pedited || pedited->sharpening.halocontrol, "Sharpening", "HalocontrolEnabled", sharpening.halocontrol, keyFile); + saveToKeyfile(!pedited || pedited->sharpening.halocontrol_amount, "Sharpening", "HalocontrolAmount", sharpening.halocontrol_amount, keyFile); + saveToKeyfile(!pedited || pedited->sharpening.deconvradius, "Sharpening", "DeconvRadius", sharpening.deconvradius, keyFile); + saveToKeyfile(!pedited || pedited->sharpening.deconvamount, "Sharpening", "DeconvAmount", sharpening.deconvamount, keyFile); + saveToKeyfile(!pedited || pedited->sharpening.deconvdamping, "Sharpening", "DeconvDamping", sharpening.deconvdamping, keyFile); + saveToKeyfile(!pedited || pedited->sharpening.deconviter, "Sharpening", "DeconvIterations", sharpening.deconviter, keyFile); + +// Vibrance + saveToKeyfile(!pedited || pedited->vibrance.enabled, "Vibrance", "Enabled", vibrance.enabled, keyFile); + saveToKeyfile(!pedited || pedited->vibrance.pastels, "Vibrance", "Pastels", vibrance.pastels, keyFile); + saveToKeyfile(!pedited || pedited->vibrance.saturated, "Vibrance", "Saturated", vibrance.saturated, keyFile); + saveToKeyfile(!pedited || pedited->vibrance.psthreshold, "Vibrance", "PSThreshold", vibrance.psthreshold.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->vibrance.protectskins, "Vibrance", "ProtectSkins", vibrance.protectskins, keyFile); + saveToKeyfile(!pedited || pedited->vibrance.avoidcolorshift, "Vibrance", "AvoidColorShift", vibrance.avoidcolorshift, keyFile); + saveToKeyfile(!pedited || pedited->vibrance.pastsattog, "Vibrance", "PastSatTog", vibrance.pastsattog, keyFile); + saveToKeyfile(!pedited || pedited->vibrance.skintonescurve, "Vibrance", "SkinTonesCurve", vibrance.skintonescurve, keyFile); + +// Edge sharpening + saveToKeyfile(!pedited || pedited->sharpenEdge.enabled, "SharpenEdge", "Enabled", sharpenEdge.enabled, keyFile); + saveToKeyfile(!pedited || pedited->sharpenEdge.passes, "SharpenEdge", "Passes", sharpenEdge.passes, keyFile); + saveToKeyfile(!pedited || pedited->sharpenEdge.amount, "SharpenEdge", "Strength", sharpenEdge.amount, keyFile); + saveToKeyfile(!pedited || pedited->sharpenEdge.threechannels, "SharpenEdge", "ThreeChannels", sharpenEdge.threechannels, keyFile); + +// Micro-contrast sharpening + saveToKeyfile(!pedited || pedited->sharpenMicro.enabled, "SharpenMicro", "Enabled", sharpenMicro.enabled, keyFile); + saveToKeyfile(!pedited || pedited->sharpenMicro.matrix, "SharpenMicro", "Matrix", sharpenMicro.matrix, keyFile); + saveToKeyfile(!pedited || pedited->sharpenMicro.amount, "SharpenMicro", "Strength", sharpenMicro.amount, keyFile); + saveToKeyfile(!pedited || pedited->sharpenMicro.uniformity, "SharpenMicro", "Uniformity", sharpenMicro.uniformity, keyFile); + +// WB + saveToKeyfile(!pedited || pedited->wb.enabled, "White Balance", "Enabled", wb.enabled, keyFile); + saveToKeyfile(!pedited || pedited->wb.method, "White Balance", "Setting", wb.method, keyFile); + saveToKeyfile(!pedited || pedited->wb.temperature, "White Balance", "Temperature", wb.temperature, keyFile); + saveToKeyfile(!pedited || pedited->wb.green, "White Balance", "Green", wb.green, keyFile); + saveToKeyfile(!pedited || pedited->wb.equal, "White Balance", "Equal", wb.equal, keyFile); + saveToKeyfile(!pedited || pedited->wb.tempBias, "White Balance", "TemperatureBias", wb.tempBias, keyFile); + +// Colorappearance + saveToKeyfile(!pedited || pedited->colorappearance.enabled, "Color appearance", "Enabled", colorappearance.enabled, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.degree, "Color appearance", "Degree", colorappearance.degree, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.autodegree, "Color appearance", "AutoDegree", colorappearance.autodegree, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.degreeout, "Color appearance", "Degreeout", colorappearance.degreeout, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.autodegreeout, "Color appearance", "AutoDegreeout", colorappearance.autodegreeout, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.surround, "Color appearance", "Surround", colorappearance.surround, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.surrsrc, "Color appearance", "Surrsrc", colorappearance.surrsrc, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.adaplum, "Color appearance", "AdaptLum", colorappearance.adaplum, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.badpixsl, "Color appearance", "Badpixsl", colorappearance.badpixsl, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.wbmodel, "Color appearance", "Model", colorappearance.wbmodel, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.algo, "Color appearance", "Algorithm", colorappearance.algo, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.jlight, "Color appearance", "J-Light", colorappearance.jlight, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.qbright, "Color appearance", "Q-Bright", colorappearance.qbright, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.chroma, "Color appearance", "C-Chroma", colorappearance.chroma, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.schroma, "Color appearance", "S-Chroma", colorappearance.schroma, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.mchroma, "Color appearance", "M-Chroma", colorappearance.mchroma, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.contrast, "Color appearance", "J-Contrast", colorappearance.contrast, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.qcontrast, "Color appearance", "Q-Contrast", colorappearance.qcontrast, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.colorh, "Color appearance", "H-Hue", colorappearance.colorh, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.rstprotection, "Color appearance", "RSTProtection", colorappearance.rstprotection, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.adapscen, "Color appearance", "AdaptScene", colorappearance.adapscen, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.autoadapscen, "Color appearance", "AutoAdapscen", colorappearance.autoadapscen, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.ybscen, "Color appearance", "YbScene", colorappearance.ybscen, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.autoybscen, "Color appearance", "Autoybscen", colorappearance.autoybscen, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.surrsource, "Color appearance", "SurrSource", colorappearance.surrsource, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.gamut, "Color appearance", "Gamut", colorappearance.gamut, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.tempout, "Color appearance", "Tempout", colorappearance.tempout, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.greenout, "Color appearance", "Greenout", colorappearance.greenout, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.tempsc, "Color appearance", "Tempsc", colorappearance.tempsc, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.greensc, "Color appearance", "Greensc", colorappearance.greensc, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.ybout, "Color appearance", "Ybout", colorappearance.ybout, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.datacie, "Color appearance", "Datacie", colorappearance.datacie, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.tonecie, "Color appearance", "Tonecie", colorappearance.tonecie, keyFile); + + const std::map ca_mapping = { + {ColorAppearanceParams::TcMode::LIGHT, "Lightness"}, + {ColorAppearanceParams::TcMode::BRIGHT, "Brightness"} + }; + + saveToKeyfile(!pedited || pedited->colorappearance.curveMode, "Color appearance", "CurveMode", ca_mapping, colorappearance.curveMode, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.curveMode2, "Color appearance", "CurveMode2", ca_mapping, colorappearance.curveMode2, keyFile); + saveToKeyfile( + !pedited || pedited->colorappearance.curveMode3, + "Color appearance", + "CurveMode3", + { + {ColorAppearanceParams::CtcMode::CHROMA, "Chroma"}, + {ColorAppearanceParams::CtcMode::SATUR, "Saturation"}, + {ColorAppearanceParams::CtcMode::COLORF, "Colorfullness"} + + }, + colorappearance.curveMode3, + keyFile + ); + saveToKeyfile(!pedited || pedited->colorappearance.curve, "Color appearance", "Curve", colorappearance.curve, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.curve2, "Color appearance", "Curve2", colorappearance.curve2, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.curve3, "Color appearance", "Curve3", colorappearance.curve3, keyFile); + +// Impulse denoise + saveToKeyfile(!pedited || pedited->impulseDenoise.enabled, "Impulse Denoising", "Enabled", impulseDenoise.enabled, keyFile); + saveToKeyfile(!pedited || pedited->impulseDenoise.thresh, "Impulse Denoising", "Threshold", impulseDenoise.thresh, keyFile); + +// Defringe + saveToKeyfile(!pedited || pedited->defringe.enabled, "Defringing", "Enabled", defringe.enabled, keyFile); + saveToKeyfile(!pedited || pedited->defringe.radius, "Defringing", "Radius", defringe.radius, keyFile); + saveToKeyfile(!pedited || pedited->defringe.threshold, "Defringing", "Threshold", defringe.threshold, keyFile); + saveToKeyfile(!pedited || pedited->defringe.huecurve, "Defringing", "HueCurve", defringe.huecurve, keyFile); + +// Directional pyramid denoising + saveToKeyfile(!pedited || pedited->dirpyrDenoise.enabled, "Directional Pyramid Denoising", "Enabled", dirpyrDenoise.enabled, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.enhance, "Directional Pyramid Denoising", "Enhance", dirpyrDenoise.enhance, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.median, "Directional Pyramid Denoising", "Median", dirpyrDenoise.median, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.luma, "Directional Pyramid Denoising", "Luma", dirpyrDenoise.luma, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.Ldetail, "Directional Pyramid Denoising", "Ldetail", dirpyrDenoise.Ldetail, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.chroma, "Directional Pyramid Denoising", "Chroma", dirpyrDenoise.chroma, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.dmethod, "Directional Pyramid Denoising", "Method", dirpyrDenoise.dmethod, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.Lmethod, "Directional Pyramid Denoising", "LMethod", dirpyrDenoise.Lmethod, keyFile); + if (dirpyrDenoise.Cmethod == "PRE") { + dirpyrDenoise.Cmethod = "MAN"; // Never save 'auto chroma preview mode' to pp3 + } + saveToKeyfile(!pedited || pedited->dirpyrDenoise.Cmethod, "Directional Pyramid Denoising", "CMethod", dirpyrDenoise.Cmethod, keyFile); + if (dirpyrDenoise.C2method == "PREV") { + dirpyrDenoise.C2method = "MANU"; + } + saveToKeyfile(!pedited || pedited->dirpyrDenoise.C2method, "Directional Pyramid Denoising", "C2Method", dirpyrDenoise.C2method, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.smethod, "Directional Pyramid Denoising", "SMethod", dirpyrDenoise.smethod, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.medmethod, "Directional Pyramid Denoising", "MedMethod", dirpyrDenoise.medmethod, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.rgbmethod, "Directional Pyramid Denoising", "RGBMethod", dirpyrDenoise.rgbmethod, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.methodmed, "Directional Pyramid Denoising", "MethodMed", dirpyrDenoise.methodmed, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.redchro, "Directional Pyramid Denoising", "Redchro", dirpyrDenoise.redchro, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.bluechro, "Directional Pyramid Denoising", "Bluechro", dirpyrDenoise.bluechro, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.gamma, "Directional Pyramid Denoising", "Gamma", dirpyrDenoise.gamma, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.passes, "Directional Pyramid Denoising", "Passes", dirpyrDenoise.passes, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.lcurve, "Directional Pyramid Denoising", "LCurve", dirpyrDenoise.lcurve, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrDenoise.cccurve, "Directional Pyramid Denoising", "CCCurve", dirpyrDenoise.cccurve, keyFile); + +// EPD + saveToKeyfile(!pedited || pedited->epd.enabled, "EPD", "Enabled", epd.enabled, keyFile); + saveToKeyfile(!pedited || pedited->epd.strength, "EPD", "Strength", epd.strength, keyFile); + saveToKeyfile(!pedited || pedited->epd.gamma, "EPD", "Gamma", epd.gamma, keyFile); + saveToKeyfile(!pedited || pedited->epd.edgeStopping, "EPD", "EdgeStopping", epd.edgeStopping, keyFile); + saveToKeyfile(!pedited || pedited->epd.scale, "EPD", "Scale", epd.scale, keyFile); + saveToKeyfile(!pedited || pedited->epd.reweightingIterates, "EPD", "ReweightingIterates", epd.reweightingIterates, keyFile); + +// Fattal + saveToKeyfile(!pedited || pedited->fattal.enabled, "FattalToneMapping", "Enabled", fattal.enabled, keyFile); + saveToKeyfile(!pedited || pedited->fattal.threshold, "FattalToneMapping", "Threshold", fattal.threshold, keyFile); + saveToKeyfile(!pedited || pedited->fattal.amount, "FattalToneMapping", "Amount", fattal.amount, keyFile); + +// Shadows & highlights + saveToKeyfile(!pedited || pedited->sh.enabled, "Shadows & Highlights", "Enabled", sh.enabled, keyFile); + saveToKeyfile(!pedited || pedited->sh.hq, "Shadows & Highlights", "HighQuality", sh.hq, keyFile); + saveToKeyfile(!pedited || pedited->sh.highlights, "Shadows & Highlights", "Highlights", sh.highlights, keyFile); + saveToKeyfile(!pedited || pedited->sh.htonalwidth, "Shadows & Highlights", "HighlightTonalWidth", sh.htonalwidth, keyFile); + saveToKeyfile(!pedited || pedited->sh.shadows, "Shadows & Highlights", "Shadows", sh.shadows, keyFile); + saveToKeyfile(!pedited || pedited->sh.stonalwidth, "Shadows & Highlights", "ShadowTonalWidth", sh.stonalwidth, keyFile); + saveToKeyfile(!pedited || pedited->sh.localcontrast, "Shadows & Highlights", "LocalContrast", sh.localcontrast, keyFile); + saveToKeyfile(!pedited || pedited->sh.radius, "Shadows & Highlights", "Radius", sh.radius, keyFile); + +// Crop + saveToKeyfile(!pedited || pedited->crop.enabled, "Crop", "Enabled", crop.enabled, keyFile); + saveToKeyfile(!pedited || pedited->crop.x, "Crop", "X", crop.x, keyFile); + saveToKeyfile(!pedited || pedited->crop.y, "Crop", "Y", crop.y, keyFile); + saveToKeyfile(!pedited || pedited->crop.w, "Crop", "W", crop.w, keyFile); + saveToKeyfile(!pedited || pedited->crop.h, "Crop", "H", crop.h, keyFile); + saveToKeyfile(!pedited || pedited->crop.fixratio, "Crop", "FixedRatio", crop.fixratio, keyFile); + saveToKeyfile(!pedited || pedited->crop.ratio, "Crop", "Ratio", crop.ratio, keyFile); + saveToKeyfile(!pedited || pedited->crop.orientation, "Crop", "Orientation", crop.orientation, keyFile); + saveToKeyfile(!pedited || pedited->crop.guide, "Crop", "Guide", crop.guide, keyFile); + +// Coarse transformation + saveToKeyfile(!pedited || pedited->coarse.rotate, "Coarse Transformation", "Rotate", coarse.rotate, keyFile); + saveToKeyfile(!pedited || pedited->coarse.hflip, "Coarse Transformation", "HorizontalFlip", coarse.hflip, keyFile); + saveToKeyfile(!pedited || pedited->coarse.vflip, "Coarse Transformation", "VerticalFlip", coarse.vflip, keyFile); + +// Common properties for transformations + saveToKeyfile(!pedited || pedited->commonTrans.autofill, "Common Properties for Transformations", "AutoFill", commonTrans.autofill, keyFile); + +// Rotation + saveToKeyfile(!pedited || pedited->rotate.degree, "Rotation", "Degree", rotate.degree, keyFile); + +// Distortion + saveToKeyfile(!pedited || pedited->distortion.amount, "Distortion", "Amount", distortion.amount, keyFile); + +// Lens profile + saveToKeyfile(!pedited || pedited->lensProf.lcMode, "LensProfile", "LcMode", lensProf.getMethodString (lensProf.lcMode), keyFile); + saveToKeyfile(!pedited || pedited->lensProf.lcpFile, "LensProfile", "LCPFile", relativePathIfInside (fname, fnameAbsolute, lensProf.lcpFile), keyFile); + saveToKeyfile(!pedited || pedited->lensProf.useDist, "LensProfile", "UseDistortion", lensProf.useDist, keyFile); + saveToKeyfile(!pedited || pedited->lensProf.useVign, "LensProfile", "UseVignette", lensProf.useVign, keyFile); + saveToKeyfile(!pedited || pedited->lensProf.useCA, "LensProfile", "UseCA", lensProf.useCA, keyFile); + saveToKeyfile(!pedited || pedited->lensProf.lfCameraMake, "LensProfile", "LFCameraMake", lensProf.lfCameraMake, keyFile); + saveToKeyfile(!pedited || pedited->lensProf.lfCameraModel, "LensProfile", "LFCameraModel", lensProf.lfCameraModel, keyFile); + saveToKeyfile(!pedited || pedited->lensProf.lfLens, "LensProfile", "LFLens", lensProf.lfLens, keyFile); + +// Perspective correction + saveToKeyfile(!pedited || pedited->perspective.horizontal, "Perspective", "Horizontal", perspective.horizontal, keyFile); + saveToKeyfile(!pedited || pedited->perspective.vertical, "Perspective", "Vertical", perspective.vertical, keyFile); + +// Gradient + saveToKeyfile(!pedited || pedited->gradient.enabled, "Gradient", "Enabled", gradient.enabled, keyFile); + saveToKeyfile(!pedited || pedited->gradient.degree, "Gradient", "Degree", gradient.degree, keyFile); + saveToKeyfile(!pedited || pedited->gradient.feather, "Gradient", "Feather", gradient.feather, keyFile); + saveToKeyfile(!pedited || pedited->gradient.strength, "Gradient", "Strength", gradient.strength, keyFile); + saveToKeyfile(!pedited || pedited->gradient.centerX, "Gradient", "CenterX", gradient.centerX, keyFile); + saveToKeyfile(!pedited || pedited->gradient.centerY, "Gradient", "CenterY", gradient.centerY, keyFile); + +// Post-crop vignette + saveToKeyfile(!pedited || pedited->pcvignette.enabled, "PCVignette", "Enabled", pcvignette.enabled, keyFile); + saveToKeyfile(!pedited || pedited->pcvignette.strength, "PCVignette", "Strength", pcvignette.strength, keyFile); + saveToKeyfile(!pedited || pedited->pcvignette.feather, "PCVignette", "Feather", pcvignette.feather, keyFile); + saveToKeyfile(!pedited || pedited->pcvignette.roundness, "PCVignette", "Roundness", pcvignette.roundness, keyFile); + +// C/A correction + saveToKeyfile(!pedited || pedited->cacorrection.red, "CACorrection", "Red", cacorrection.red, keyFile); + saveToKeyfile(!pedited || pedited->cacorrection.blue, "CACorrection", "Blue", cacorrection.blue, keyFile); + +// Vignetting correction + saveToKeyfile(!pedited || pedited->vignetting.amount, "Vignetting Correction", "Amount", vignetting.amount, keyFile); + saveToKeyfile(!pedited || pedited->vignetting.radius, "Vignetting Correction", "Radius", vignetting.radius, keyFile); + saveToKeyfile(!pedited || pedited->vignetting.strength, "Vignetting Correction", "Strength", vignetting.strength, keyFile); + saveToKeyfile(!pedited || pedited->vignetting.centerX, "Vignetting Correction", "CenterX", vignetting.centerX, keyFile); + saveToKeyfile(!pedited || pedited->vignetting.centerY, "Vignetting Correction", "CenterY", vignetting.centerY, keyFile); + +// Resize + saveToKeyfile(!pedited || pedited->resize.enabled, "Resize", "Enabled", resize.enabled, keyFile); + saveToKeyfile(!pedited || pedited->resize.scale, "Resize", "Scale", resize.scale, keyFile); + saveToKeyfile(!pedited || pedited->resize.appliesTo, "Resize", "AppliesTo", resize.appliesTo, keyFile); + saveToKeyfile(!pedited || pedited->resize.method, "Resize", "Method", resize.method, keyFile); + saveToKeyfile(!pedited || pedited->resize.dataspec, "Resize", "DataSpecified", resize.dataspec, keyFile); + saveToKeyfile(!pedited || pedited->resize.width, "Resize", "Width", resize.width, keyFile); + saveToKeyfile(!pedited || pedited->resize.height, "Resize", "Height", resize.height, keyFile); + +// Post resize sharpening + saveToKeyfile(!pedited || pedited->prsharpening.enabled, "PostResizeSharpening", "Enabled", prsharpening.enabled, keyFile); + saveToKeyfile(!pedited || pedited->prsharpening.method, "PostResizeSharpening", "Method", prsharpening.method, keyFile); + saveToKeyfile(!pedited || pedited->prsharpening.radius, "PostResizeSharpening", "Radius", prsharpening.radius, keyFile); + saveToKeyfile(!pedited || pedited->prsharpening.amount, "PostResizeSharpening", "Amount", prsharpening.amount, keyFile); + saveToKeyfile(!pedited || pedited->prsharpening.threshold, "PostResizeSharpening", "Threshold", prsharpening.threshold.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->prsharpening.edgesonly, "PostResizeSharpening", "OnlyEdges", prsharpening.edgesonly, keyFile); + saveToKeyfile(!pedited || pedited->prsharpening.edges_radius, "PostResizeSharpening", "EdgedetectionRadius", prsharpening.edges_radius, keyFile); + saveToKeyfile(!pedited || pedited->prsharpening.edges_tolerance, "PostResizeSharpening", "EdgeTolerance", prsharpening.edges_tolerance, keyFile); + saveToKeyfile(!pedited || pedited->prsharpening.halocontrol, "PostResizeSharpening", "HalocontrolEnabled", prsharpening.halocontrol, keyFile); + saveToKeyfile(!pedited || pedited->prsharpening.halocontrol_amount, "PostResizeSharpening", "HalocontrolAmount", prsharpening.halocontrol_amount, keyFile); + saveToKeyfile(!pedited || pedited->prsharpening.deconvradius, "PostResizeSharpening", "DeconvRadius", prsharpening.deconvradius, keyFile); + saveToKeyfile(!pedited || pedited->prsharpening.deconvamount, "PostResizeSharpening", "DeconvAmount", prsharpening.deconvamount, keyFile); + saveToKeyfile(!pedited || pedited->prsharpening.deconvdamping, "PostResizeSharpening", "DeconvDamping", prsharpening.deconvdamping, keyFile); + saveToKeyfile(!pedited || pedited->prsharpening.deconviter, "PostResizeSharpening", "DeconvIterations", prsharpening.deconviter, keyFile); + +// Color management + saveToKeyfile(!pedited || pedited->icm.input, "Color Management", "InputProfile", relativePathIfInside (fname, fnameAbsolute, icm.input), keyFile); + saveToKeyfile(!pedited || pedited->icm.toneCurve, "Color Management", "ToneCurve", icm.toneCurve, keyFile); + saveToKeyfile(!pedited || pedited->icm.applyLookTable, "Color Management", "ApplyLookTable", icm.applyLookTable, keyFile); + saveToKeyfile(!pedited || pedited->icm.applyBaselineExposureOffset, "Color Management", "ApplyBaselineExposureOffset", icm.applyBaselineExposureOffset, keyFile); + saveToKeyfile(!pedited || pedited->icm.applyHueSatMap, "Color Management", "ApplyHueSatMap", icm.applyHueSatMap, keyFile); + saveToKeyfile(!pedited || pedited->icm.dcpIlluminant, "Color Management", "DCPIlluminant", icm.dcpIlluminant, keyFile); + saveToKeyfile(!pedited || pedited->icm.working, "Color Management", "WorkingProfile", icm.working, keyFile); + saveToKeyfile(!pedited || pedited->icm.output, "Color Management", "OutputProfile", icm.output, keyFile); + saveToKeyfile( + !pedited || pedited->icm.outputIntent, + "Color Management", + "OutputProfileIntent", + { + {RI_PERCEPTUAL, "Perceptual"}, + {RI_RELATIVE, "Relative"}, + {RI_SATURATION, "Saturation"}, + {RI_ABSOLUTE, "Absolute"} + + }, + icm.outputIntent, + keyFile + ); + saveToKeyfile(!pedited || pedited->icm.outputBPC, "Color Management", "OutputBPC", icm.outputBPC, keyFile); + saveToKeyfile(!pedited || pedited->icm.gamma, "Color Management", "Gammafree", icm.gamma, keyFile); + saveToKeyfile(!pedited || pedited->icm.freegamma, "Color Management", "Freegamma", icm.freegamma, keyFile); + saveToKeyfile(!pedited || pedited->icm.gampos, "Color Management", "GammaValue", icm.gampos, keyFile); + saveToKeyfile(!pedited || pedited->icm.slpos, "Color Management", "GammaSlope", icm.slpos, keyFile); + +// Wavelet + saveToKeyfile(!pedited || pedited->wavelet.enabled, "Wavelet", "Enabled", wavelet.enabled, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.strength, "Wavelet", "Strength", wavelet.strength, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.balance, "Wavelet", "Balance", wavelet.balance, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.iter, "Wavelet", "Iter", wavelet.iter, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.thres, "Wavelet", "MaxLev", wavelet.thres, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.Tilesmethod, "Wavelet", "TilesMethod", wavelet.Tilesmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.daubcoeffmethod, "Wavelet", "DaubMethod", wavelet.daubcoeffmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.CLmethod, "Wavelet", "ChoiceLevMethod", wavelet.CLmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.Backmethod, "Wavelet", "BackMethod", wavelet.Backmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.Lmethod, "Wavelet", "LevMethod", wavelet.Lmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.Dirmethod, "Wavelet", "DirMethod", wavelet.Dirmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.greenhigh, "Wavelet", "CBgreenhigh", wavelet.greenhigh, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.greenmed, "Wavelet", "CBgreenmed", wavelet.greenmed, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.greenlow, "Wavelet", "CBgreenlow", wavelet.greenlow, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.bluehigh, "Wavelet", "CBbluehigh", wavelet.bluehigh, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.bluemed, "Wavelet", "CBbluemed", wavelet.bluemed, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.bluelow, "Wavelet", "CBbluelow", wavelet.bluelow, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.expcontrast, "Wavelet", "Expcontrast", wavelet.expcontrast, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.expchroma, "Wavelet", "Expchroma", wavelet.expchroma, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.expedge, "Wavelet", "Expedge", wavelet.expedge, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.expresid, "Wavelet", "Expresid", wavelet.expresid, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.expfinal, "Wavelet", "Expfinal", wavelet.expfinal, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.exptoning, "Wavelet", "Exptoning", wavelet.exptoning, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.expnoise, "Wavelet", "Expnoise", wavelet.expnoise, keyFile); for (int i = 0; i < 9; i++) { std::stringstream ss; ss << "Contrast" << (i + 1); - if (!pedited || pedited->wavelet.c[i]) { - keyFile.set_integer ("Wavelet", ss.str(), wavelet.c[i]); - } + saveToKeyfile(!pedited || pedited->wavelet.c[i], "Wavelet", ss.str(), wavelet.c[i], keyFile); } for (int i = 0; i < 9; i++) { std::stringstream ss; ss << "Chroma" << (i + 1); - if (!pedited || pedited->wavelet.ch[i]) { - keyFile.set_integer ("Wavelet", ss.str(), wavelet.ch[i]); - } + saveToKeyfile(!pedited || pedited->wavelet.ch[i], "Wavelet", ss.str(), wavelet.ch[i], keyFile); } - if (!pedited || pedited->wavelet.sup) { - keyFile.set_integer ("Wavelet", "ContExtra", wavelet.sup); - } + saveToKeyfile(!pedited || pedited->wavelet.sup, "Wavelet", "ContExtra", wavelet.sup, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.HSmethod, "Wavelet", "HSMethod", wavelet.HSmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.hllev, "Wavelet", "HLRange", wavelet.hllev.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->wavelet.bllev, "Wavelet", "SHRange", wavelet.bllev.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->wavelet.edgcont, "Wavelet", "Edgcont", wavelet.edgcont.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->wavelet.level0noise, "Wavelet", "Level0noise", wavelet.level0noise.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->wavelet.level1noise, "Wavelet", "Level1noise", wavelet.level1noise.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->wavelet.level2noise, "Wavelet", "Level2noise", wavelet.level2noise.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->wavelet.level3noise, "Wavelet", "Level3noise", wavelet.level3noise.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->wavelet.threshold, "Wavelet", "ThresholdHighlight", wavelet.threshold, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.threshold2, "Wavelet", "ThresholdShadow", wavelet.threshold2, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.edgedetect, "Wavelet", "Edgedetect", wavelet.edgedetect, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.edgedetectthr, "Wavelet", "Edgedetectthr", wavelet.edgedetectthr, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.edgedetectthr2, "Wavelet", "EdgedetectthrHi", wavelet.edgedetectthr2, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.edgesensi, "Wavelet", "Edgesensi", wavelet.edgesensi, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.edgeampli, "Wavelet", "Edgeampli", wavelet.edgeampli, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.chroma, "Wavelet", "ThresholdChroma", wavelet.chroma, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.CHmethod, "Wavelet", "CHromaMethod", wavelet.CHmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.Medgreinf, "Wavelet", "Medgreinf", wavelet.Medgreinf, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.CHSLmethod, "Wavelet", "CHSLromaMethod", wavelet.CHSLmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.EDmethod, "Wavelet", "EDMethod", wavelet.EDmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.NPmethod, "Wavelet", "NPMethod", wavelet.NPmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.BAmethod, "Wavelet", "BAMethod", wavelet.BAmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.TMmethod, "Wavelet", "TMMethod", wavelet.TMmethod, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.chro, "Wavelet", "ChromaLink", wavelet.chro, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.ccwcurve, "Wavelet", "ContrastCurve", wavelet.ccwcurve, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.pastlev, "Wavelet", "Pastlev", wavelet.pastlev.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->wavelet.satlev, "Wavelet", "Satlev", wavelet.satlev.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->wavelet.opacityCurveRG, "Wavelet", "OpacityCurveRG", wavelet.opacityCurveRG, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.opacityCurveBY, "Wavelet", "OpacityCurveBY", wavelet.opacityCurveBY, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.opacityCurveW, "Wavelet", "OpacityCurveW", wavelet.opacityCurveW, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.opacityCurveWL, "Wavelet", "OpacityCurveWL", wavelet.opacityCurveWL, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.hhcurve, "Wavelet", "HHcurve", wavelet.hhcurve, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.Chcurve, "Wavelet", "CHcurve", wavelet.Chcurve, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.wavclCurve, "Wavelet", "WavclCurve", wavelet.wavclCurve, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.median, "Wavelet", "Median", wavelet.median, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.medianlev, "Wavelet", "Medianlev", wavelet.medianlev, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.linkedg, "Wavelet", "Linkedg", wavelet.linkedg, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.cbenab, "Wavelet", "CBenab", wavelet.cbenab, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.lipst, "Wavelet", "Lipst", wavelet.lipst, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.skinprotect, "Wavelet", "Skinprotect", wavelet.skinprotect, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.hueskin, "Wavelet", "Hueskin", wavelet.hueskin.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->wavelet.edgrad, "Wavelet", "Edgrad", wavelet.edgrad, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.edgval, "Wavelet", "Edgval", wavelet.edgval, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.edgthresh, "Wavelet", "ThrEdg", wavelet.edgthresh, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.avoid, "Wavelet", "AvoidColorShift", wavelet.avoid, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.tmr, "Wavelet", "TMr", wavelet.tmr, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.rescon, "Wavelet", "ResidualcontShadow", wavelet.rescon, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.resconH, "Wavelet", "ResidualcontHighlight", wavelet.resconH, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.thr, "Wavelet", "ThresholdResidShadow", wavelet.thr, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.thrH, "Wavelet", "ThresholdResidHighLight", wavelet.thrH, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.reschro, "Wavelet", "Residualchroma", wavelet.reschro, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.tmrs, "Wavelet", "ResidualTM", wavelet.tmrs, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.gamma, "Wavelet", "Residualgamma", wavelet.gamma, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.sky, "Wavelet", "HueRangeResidual", wavelet.sky, keyFile); + saveToKeyfile(!pedited || pedited->wavelet.hueskin2, "Wavelet", "HueRange", wavelet.hueskin2.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->wavelet.contrast, "Wavelet", "Contrast", wavelet.contrast, keyFile); - if (!pedited || pedited->wavelet.HSmethod) { - keyFile.set_string ("Wavelet", "HSMethod", wavelet.HSmethod); - } - - if (!pedited || pedited->wavelet.hllev) { - Glib::ArrayHandle thresh (wavelet.hllev.value, 4, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("Wavelet", "HLRange", thresh); - } - - if (!pedited || pedited->wavelet.bllev) { - Glib::ArrayHandle thresh (wavelet.bllev.value, 4, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("Wavelet", "SHRange", thresh); - } - - if (!pedited || pedited->wavelet.edgcont) { - Glib::ArrayHandle thresh (wavelet.edgcont.value, 4, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("Wavelet", "Edgcont", thresh); - } - - if (!pedited || pedited->wavelet.level0noise) { - Glib::ArrayHandle thresh (wavelet.level0noise.value, 2, Glib::OWNERSHIP_NONE); - keyFile.set_double_list ("Wavelet", "Level0noise", thresh); - } - - if (!pedited || pedited->wavelet.level1noise) { - Glib::ArrayHandle thresh (wavelet.level1noise.value, 2, Glib::OWNERSHIP_NONE); - keyFile.set_double_list ("Wavelet", "Level1noise", thresh); - } - - if (!pedited || pedited->wavelet.level2noise) { - Glib::ArrayHandle thresh (wavelet.level2noise.value, 2, Glib::OWNERSHIP_NONE); - keyFile.set_double_list ("Wavelet", "Level2noise", thresh); - } - - if (!pedited || pedited->wavelet.level3noise) { - Glib::ArrayHandle thresh (wavelet.level3noise.value, 2, Glib::OWNERSHIP_NONE); - keyFile.set_double_list ("Wavelet", "Level3noise", thresh); - } - - - if (!pedited || pedited->wavelet.threshold) { - keyFile.set_integer ("Wavelet", "ThresholdHighlight", wavelet.threshold); - } - - if (!pedited || pedited->wavelet.threshold2) { - keyFile.set_integer ("Wavelet", "ThresholdShadow", wavelet.threshold2); - } - - if (!pedited || pedited->wavelet.edgedetect) { - keyFile.set_integer ("Wavelet", "Edgedetect", wavelet.edgedetect); - } - - if (!pedited || pedited->wavelet.edgedetectthr) { - keyFile.set_integer ("Wavelet", "Edgedetectthr", wavelet.edgedetectthr); - } - - if (!pedited || pedited->wavelet.edgedetectthr2) { - keyFile.set_integer ("Wavelet", "EdgedetectthrHi", wavelet.edgedetectthr2); - } - - if (!pedited || pedited->wavelet.edgesensi) { - keyFile.set_integer ("Wavelet", "Edgesensi", wavelet.edgesensi); - } - - if (!pedited || pedited->wavelet.edgeampli) { - keyFile.set_integer ("Wavelet", "Edgeampli", wavelet.edgeampli); - } - - if (!pedited || pedited->wavelet.chroma) { - keyFile.set_integer ("Wavelet", "ThresholdChroma", wavelet.chroma); - } - - if (!pedited || pedited->wavelet.CHmethod) { - keyFile.set_string ("Wavelet", "CHromaMethod", wavelet.CHmethod); - } - - if (!pedited || pedited->wavelet.Medgreinf) { - keyFile.set_string ("Wavelet", "Medgreinf", wavelet.Medgreinf); - } - - if (!pedited || pedited->wavelet.CHSLmethod) { - keyFile.set_string ("Wavelet", "CHSLromaMethod", wavelet.CHSLmethod); - } - - if (!pedited || pedited->wavelet.EDmethod) { - keyFile.set_string ("Wavelet", "EDMethod", wavelet.EDmethod); - } - - if (!pedited || pedited->wavelet.NPmethod) { - keyFile.set_string ("Wavelet", "NPMethod", wavelet.NPmethod); - } - - if (!pedited || pedited->wavelet.BAmethod) { - keyFile.set_string ("Wavelet", "BAMethod", wavelet.BAmethod); - } - - if (!pedited || pedited->wavelet.TMmethod) { - keyFile.set_string ("Wavelet", "TMMethod", wavelet.TMmethod); - } - - if (!pedited || pedited->wavelet.chro) { - keyFile.set_integer ("Wavelet", "ChromaLink", wavelet.chro); - } - - if (!pedited || pedited->wavelet.ccwcurve) { - Glib::ArrayHandle ccwcurve = wavelet.ccwcurve; - keyFile.set_double_list ("Wavelet", "ContrastCurve", ccwcurve); - } - - if (!pedited || pedited->wavelet.pastlev) { - Glib::ArrayHandle thresh (wavelet.pastlev.value, 4, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("Wavelet", "Pastlev", thresh); - } - - if (!pedited || pedited->wavelet.satlev) { - Glib::ArrayHandle thresh (wavelet.satlev.value, 4, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("Wavelet", "Satlev", thresh); - } - - if (!pedited || pedited->wavelet.opacityCurveRG) { - Glib::ArrayHandle curve = wavelet.opacityCurveRG; - keyFile.set_double_list ("Wavelet", "OpacityCurveRG", curve); - } - - if (!pedited || pedited->wavelet.opacityCurveBY) { - Glib::ArrayHandle curve = wavelet.opacityCurveBY; - keyFile.set_double_list ("Wavelet", "OpacityCurveBY", curve); - } - - if (!pedited || pedited->wavelet.opacityCurveW) { - Glib::ArrayHandle curve = wavelet.opacityCurveW; - keyFile.set_double_list ("Wavelet", "OpacityCurveW", curve); - } - - if (!pedited || pedited->wavelet.opacityCurveWL) { - Glib::ArrayHandle curve = wavelet.opacityCurveWL; - keyFile.set_double_list ("Wavelet", "OpacityCurveWL", curve); - } - - if (!pedited || pedited->wavelet.hhcurve) { - Glib::ArrayHandle curve = wavelet.hhcurve; - keyFile.set_double_list ("Wavelet", "HHcurve", curve); - } - - if (!pedited || pedited->wavelet.Chcurve) { - Glib::ArrayHandle curve = wavelet.Chcurve; - keyFile.set_double_list ("Wavelet", "CHcurve", curve); - } - - if (!pedited || pedited->wavelet.wavclCurve) { - Glib::ArrayHandle wavclCurve = wavelet.wavclCurve; - keyFile.set_double_list ("Wavelet", "WavclCurve", wavclCurve); - } - - - if (!pedited || pedited->wavelet.median) { - keyFile.set_boolean ("Wavelet", "Median", wavelet.median); - } - - if (!pedited || pedited->wavelet.medianlev) { - keyFile.set_boolean ("Wavelet", "Medianlev", wavelet.medianlev); - } - - if (!pedited || pedited->wavelet.linkedg) { - keyFile.set_boolean ("Wavelet", "Linkedg", wavelet.linkedg); - } - - if (!pedited || pedited->wavelet.cbenab) { - keyFile.set_boolean ("Wavelet", "CBenab", wavelet.cbenab); - } - - if (!pedited || pedited->wavelet.lipst) { - keyFile.set_boolean ("Wavelet", "Lipst", wavelet.lipst); - } - -// if (!pedited || pedited->wavelet.edgreinf) keyFile.set_boolean ("Wavelet", "Edgreinf", wavelet.edgreinf); - if (!pedited || pedited->wavelet.skinprotect) { - keyFile.set_double ("Wavelet", "Skinprotect", wavelet.skinprotect); - } - - if (!pedited || pedited->wavelet.hueskin) { - Glib::ArrayHandle thresh (wavelet.hueskin.value, 4, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("Wavelet", "Hueskin", thresh); - } - - if (!pedited || pedited->wavelet.edgrad) { - keyFile.set_integer ("Wavelet", "Edgrad", wavelet.edgrad); - } - - if (!pedited || pedited->wavelet.edgval) { - keyFile.set_integer ("Wavelet", "Edgval", wavelet.edgval); - } - - if (!pedited || pedited->wavelet.edgthresh) { - keyFile.set_integer ("Wavelet", "ThrEdg", wavelet.edgthresh); - } - -// if (!pedited || pedited->wavelet.strength) keyFile.set_integer ("Wavelet", "Strength", wavelet.strength); -// if (!pedited || pedited->wavelet.balance) keyFile.set_integer ("Wavelet", "Balance", wavelet.balance); - - if (!pedited || pedited->wavelet.avoid) { - keyFile.set_boolean ("Wavelet", "AvoidColorShift", wavelet.avoid); - } - - if (!pedited || pedited->wavelet.tmr) { - keyFile.set_boolean ("Wavelet", "TMr", wavelet.tmr); - } - - if (!pedited || pedited->wavelet.rescon) { - keyFile.set_integer ("Wavelet", "ResidualcontShadow", wavelet.rescon); - } - - if (!pedited || pedited->wavelet.resconH) { - keyFile.set_integer ("Wavelet", "ResidualcontHighlight", wavelet.resconH); - } - - if (!pedited || pedited->wavelet.thr) { - keyFile.set_integer ("Wavelet", "ThresholdResidShadow", wavelet.thr); - } - - if (!pedited || pedited->wavelet.thrH) { - keyFile.set_integer ("Wavelet", "ThresholdResidHighLight", wavelet.thrH); - } - - if (!pedited || pedited->wavelet.reschro) { - keyFile.set_integer ("Wavelet", "Residualchroma", wavelet.reschro); - } - - if (!pedited || pedited->wavelet.tmrs) { - keyFile.set_double ("Wavelet", "ResidualTM", wavelet.tmrs); - } - - if (!pedited || pedited->wavelet.gamma) { - keyFile.set_double ("Wavelet", "Residualgamma", wavelet.gamma); - } - - if (!pedited || pedited->wavelet.sky) { - keyFile.set_double ("Wavelet", "HueRangeResidual", wavelet.sky); - } - - if (!pedited || pedited->wavelet.hueskin2) { - Glib::ArrayHandle thresh (wavelet.hueskin2.value, 4, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("Wavelet", "HueRange", thresh); - } - - if (!pedited || pedited->wavelet.contrast) { - keyFile.set_integer ("Wavelet", "Contrast", wavelet.contrast); - } - - -// save directional pyramid wavelet parameters - if (!pedited || pedited->dirpyrequalizer.enabled) { - keyFile.set_boolean ("Directional Pyramid Equalizer", "Enabled", dirpyrequalizer.enabled); - } - - if (!pedited || pedited->dirpyrequalizer.gamutlab) { - keyFile.set_boolean ("Directional Pyramid Equalizer", "Gamutlab", dirpyrequalizer.gamutlab); - } - - if (!pedited || pedited->dirpyrequalizer.cbdlMethod) { - keyFile.set_string ("Directional Pyramid Equalizer", "cbdlMethod", dirpyrequalizer.cbdlMethod); - } +// Directional pyramid equalizer + saveToKeyfile(!pedited || pedited->dirpyrequalizer.enabled, "Directional Pyramid Equalizer", "Enabled", dirpyrequalizer.enabled, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrequalizer.gamutlab, "Directional Pyramid Equalizer", "Gamutlab", dirpyrequalizer.gamutlab, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrequalizer.cbdlMethod, "Directional Pyramid Equalizer", "cbdlMethod", dirpyrequalizer.cbdlMethod, keyFile); for (int i = 0; i < 6; i++) { std::stringstream ss; ss << "Mult" << i; - if (!pedited || pedited->dirpyrequalizer.mult[i]) { - keyFile.set_double ("Directional Pyramid Equalizer", ss.str(), dirpyrequalizer.mult[i]); - } - } - - if (!pedited || pedited->dirpyrequalizer.threshold) { - keyFile.set_double ("Directional Pyramid Equalizer", "Threshold", dirpyrequalizer.threshold); - } - - if (!pedited || pedited->dirpyrequalizer.skinprotect) { - keyFile.set_double ("Directional Pyramid Equalizer", "Skinprotect", dirpyrequalizer.skinprotect); - } - -// if (!pedited || pedited->dirpyrequalizer.algo) keyFile.set_string ("Directional Pyramid Equalizer", "Algorithm", dirpyrequalizer.algo); - if (!pedited || pedited->dirpyrequalizer.hueskin) { - Glib::ArrayHandle thresh (dirpyrequalizer.hueskin.value, 4, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("Directional Pyramid Equalizer", "Hueskin", thresh); - } - -// save hsv wavelet parameters - if (!pedited || pedited->hsvequalizer.hcurve) { - Glib::ArrayHandle hcurve = hsvequalizer.hcurve; - keyFile.set_double_list ("HSV Equalizer", "HCurve", hcurve); - } - - if (!pedited || pedited->hsvequalizer.scurve) { - Glib::ArrayHandle scurve = hsvequalizer.scurve; - keyFile.set_double_list ("HSV Equalizer", "SCurve", scurve); - } - - if (!pedited || pedited->hsvequalizer.vcurve) { - Glib::ArrayHandle vcurve = hsvequalizer.vcurve; - keyFile.set_double_list ("HSV Equalizer", "VCurve", vcurve); - } - -//save film simulation parameters - if ( !pedited || pedited->filmSimulation.enabled ) { - keyFile.set_boolean ( "Film Simulation", "Enabled", filmSimulation.enabled ); - } - - if ( !pedited || pedited->filmSimulation.clutFilename ) { - keyFile.set_string ( "Film Simulation", "ClutFilename", filmSimulation.clutFilename ); - } - - if ( !pedited || pedited->filmSimulation.strength ) { - keyFile.set_integer ( "Film Simulation", "Strength", filmSimulation.strength ); - } - - - if (!pedited || pedited->rgbCurves.lumamode) { - keyFile.set_boolean ("RGB Curves", "LumaMode", rgbCurves.lumamode); - } - - if (!pedited || pedited->rgbCurves.rcurve) { - Glib::ArrayHandle RGBrcurve = rgbCurves.rcurve; - keyFile.set_double_list ("RGB Curves", "rCurve", RGBrcurve); - } - - if (!pedited || pedited->rgbCurves.gcurve) { - Glib::ArrayHandle RGBgcurve = rgbCurves.gcurve; - keyFile.set_double_list ("RGB Curves", "gCurve", RGBgcurve); - } - - if (!pedited || pedited->rgbCurves.bcurve) { - Glib::ArrayHandle RGBbcurve = rgbCurves.bcurve; - keyFile.set_double_list ("RGB Curves", "bCurve", RGBbcurve); - } - -// save Color Toning - if (!pedited || pedited->colorToning.enabled) { - keyFile.set_boolean ("ColorToning", "Enabled", colorToning.enabled); - } - - if (!pedited || pedited->colorToning.method) { - keyFile.set_string ("ColorToning", "Method", colorToning.method); - } - - if (!pedited || pedited->colorToning.lumamode) { - keyFile.set_boolean ("ColorToning", "Lumamode", colorToning.lumamode); - } - - if (!pedited || pedited->colorToning.twocolor) { - keyFile.set_string ("ColorToning", "Twocolor", colorToning.twocolor); - } - - if (!pedited || pedited->colorToning.redlow) { - keyFile.set_double ("ColorToning", "Redlow", colorToning.redlow); - } - - if (!pedited || pedited->colorToning.greenlow) { - keyFile.set_double ("ColorToning", "Greenlow", colorToning.greenlow); - } - - if (!pedited || pedited->colorToning.bluelow) { - keyFile.set_double ("ColorToning", "Bluelow", colorToning.bluelow); - } - - if (!pedited || pedited->colorToning.satlow) { - keyFile.set_double ("ColorToning", "Satlow", colorToning.satlow); - } - - if (!pedited || pedited->colorToning.balance) { - keyFile.set_integer ("ColorToning", "Balance", colorToning.balance); - } - - if (!pedited || pedited->colorToning.sathigh) { - keyFile.set_double ("ColorToning", "Sathigh", colorToning.sathigh); - } - - if (!pedited || pedited->colorToning.redmed) { - keyFile.set_double ("ColorToning", "Redmed", colorToning.redmed); - } - - if (!pedited || pedited->colorToning.greenmed) { - keyFile.set_double ("ColorToning", "Greenmed", colorToning.greenmed); - } - - if (!pedited || pedited->colorToning.bluemed) { - keyFile.set_double ("ColorToning", "Bluemed", colorToning.bluemed); - } - - if (!pedited || pedited->colorToning.redhigh) { - keyFile.set_double ("ColorToning", "Redhigh", colorToning.redhigh); - } - - if (!pedited || pedited->colorToning.greenhigh) { - keyFile.set_double ("ColorToning", "Greenhigh", colorToning.greenhigh); - } - - if (!pedited || pedited->colorToning.bluehigh) { - keyFile.set_double ("ColorToning", "Bluehigh", colorToning.bluehigh); - } - - if (!pedited || pedited->colorToning.autosat) { - keyFile.set_boolean ("ColorToning", "Autosat", colorToning.autosat); - } - - if (!pedited || pedited->colorToning.opacityCurve) { - Glib::ArrayHandle curve = colorToning.opacityCurve; - keyFile.set_double_list ("ColorToning", "OpacityCurve", curve); - } - - if (!pedited || pedited->colorToning.colorCurve) { - Glib::ArrayHandle curve = colorToning.colorCurve; - keyFile.set_double_list ("ColorToning", "ColorCurve", curve); - } - - if (!pedited || pedited->colorToning.satprotectionthreshold) { - keyFile.set_integer ("ColorToning", "SatProtectionThreshold", colorToning.satProtectionThreshold ); - } - - if (!pedited || pedited->colorToning.saturatedopacity) { - keyFile.set_integer ("ColorToning", "SaturatedOpacity", colorToning.saturatedOpacity ); - } - - if (!pedited || pedited->colorToning.strength) { - keyFile.set_integer ("ColorToning", "Strength", colorToning.strength ); - } - - if (!pedited || pedited->colorToning.hlColSat) { - Glib::ArrayHandle thresh (colorToning.hlColSat.value, 2, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("ColorToning", "HighlightsColorSaturation", thresh); - } - - if (!pedited || pedited->colorToning.shadowsColSat) { - Glib::ArrayHandle thresh (colorToning.shadowsColSat.value, 2, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list ("ColorToning", "ShadowsColorSaturation", thresh); - } - - if (!pedited || pedited->colorToning.clcurve) { - Glib::ArrayHandle clcurve = colorToning.clcurve; - keyFile.set_double_list ("ColorToning", "ClCurve", clcurve); - } - - if (!pedited || pedited->colorToning.cl2curve) { - Glib::ArrayHandle cl2curve = colorToning.cl2curve; - keyFile.set_double_list ("ColorToning", "Cl2Curve", cl2curve); - } - -// save raw parameters - if (!pedited || pedited->raw.darkFrame) { - keyFile.set_string ("RAW", "DarkFrame", relativePathIfInside (fname, fnameAbsolute, raw.dark_frame) ); - } - - if (!pedited || pedited->raw.dfAuto) { - keyFile.set_boolean ("RAW", "DarkFrameAuto", raw.df_autoselect ); - } - - if (!pedited || pedited->raw.ff_file) { - keyFile.set_string ("RAW", "FlatFieldFile", relativePathIfInside (fname, fnameAbsolute, raw.ff_file) ); - } - - if (!pedited || pedited->raw.ff_AutoSelect) { - keyFile.set_boolean ("RAW", "FlatFieldAutoSelect", raw.ff_AutoSelect ); - } - - if (!pedited || pedited->raw.ff_BlurRadius) { - keyFile.set_integer ("RAW", "FlatFieldBlurRadius", raw.ff_BlurRadius ); - } - - if (!pedited || pedited->raw.ff_BlurType) { - keyFile.set_string ("RAW", "FlatFieldBlurType", raw.ff_BlurType ); - } - - if (!pedited || pedited->raw.ff_AutoClipControl) { - keyFile.set_boolean ("RAW", "FlatFieldAutoClipControl", raw.ff_AutoClipControl ); - } - - if (!pedited || pedited->raw.ff_clipControl) { - keyFile.set_boolean ("RAW", "FlatFieldClipControl", raw.ff_clipControl ); - } - - if (!pedited || pedited->raw.caCorrection) { - keyFile.set_boolean ("RAW", "CA", raw.ca_autocorrect ); - } - - if (!pedited || pedited->raw.caRed) { - keyFile.set_double ("RAW", "CARed", raw.cared ); - } - - if (!pedited || pedited->raw.caBlue) { - keyFile.set_double ("RAW", "CABlue", raw.cablue ); - } - - if (!pedited || pedited->raw.hotPixelFilter) { - keyFile.set_boolean ("RAW", "HotPixelFilter", raw.hotPixelFilter ); - } - - if (!pedited || pedited->raw.deadPixelFilter) { - keyFile.set_boolean ("RAW", "DeadPixelFilter", raw.deadPixelFilter ); - } - - if (!pedited || pedited->raw.hotDeadPixelThresh) { - keyFile.set_integer ("RAW", "HotDeadPixelThresh", raw.hotdeadpix_thresh ); - } - - if (!pedited || pedited->raw.bayersensor.method) { - keyFile.set_string ("RAW Bayer", "Method", raw.bayersensor.method ); - } - - if (!pedited || pedited->raw.bayersensor.imageNum) { - keyFile.set_integer ("RAW Bayer", "ImageNum", raw.bayersensor.imageNum + 1 ); - } - - if (!pedited || pedited->raw.bayersensor.ccSteps) { - keyFile.set_integer ("RAW Bayer", "CcSteps", raw.bayersensor.ccSteps); - } - - if (!pedited || pedited->raw.bayersensor.exBlack0) { - keyFile.set_double ("RAW Bayer", "PreBlack0", raw.bayersensor.black0 ); - } - - if (!pedited || pedited->raw.bayersensor.exBlack1) { - keyFile.set_double ("RAW Bayer", "PreBlack1", raw.bayersensor.black1 ); - } - - if (!pedited || pedited->raw.bayersensor.exBlack2) { - keyFile.set_double ("RAW Bayer", "PreBlack2", raw.bayersensor.black2 ); - } - - if (!pedited || pedited->raw.bayersensor.exBlack3) { - keyFile.set_double ("RAW Bayer", "PreBlack3", raw.bayersensor.black3 ); - } - - if (!pedited || pedited->raw.bayersensor.exTwoGreen) { - keyFile.set_boolean ("RAW Bayer", "PreTwoGreen", raw.bayersensor.twogreen ); - } - - if (!pedited || pedited->raw.bayersensor.linenoise) { - keyFile.set_integer ("RAW Bayer", "LineDenoise", raw.bayersensor.linenoise); - } - - if (!pedited || pedited->raw.bayersensor.greenEq) { - keyFile.set_integer ("RAW Bayer", "GreenEqThreshold", raw.bayersensor.greenthresh); - } - - if (!pedited || pedited->raw.bayersensor.dcbIterations) { - keyFile.set_integer ("RAW Bayer", "DCBIterations", raw.bayersensor.dcb_iterations ); - } - - if (!pedited || pedited->raw.bayersensor.dcbEnhance) { - keyFile.set_boolean ("RAW Bayer", "DCBEnhance", raw.bayersensor.dcb_enhance ); - } - - if (!pedited || pedited->raw.bayersensor.lmmseIterations) { - keyFile.set_integer ("RAW Bayer", "LMMSEIterations", raw.bayersensor.lmmse_iterations ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftMotion) { - keyFile.set_integer ("RAW Bayer", "PixelShiftMotion", raw.bayersensor.pixelShiftMotion ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftMotionCorrection) { - keyFile.set_integer ("RAW Bayer", "PixelShiftMotionCorrection", raw.bayersensor.pixelShiftMotionCorrection ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftMotionCorrectionMethod) { - keyFile.set_integer ("RAW Bayer", "PixelShiftMotionCorrectionMethod", raw.bayersensor.pixelShiftMotionCorrectionMethod ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftStddevFactorGreen) { - keyFile.set_double ("RAW Bayer", "pixelShiftStddevFactorGreen", raw.bayersensor.pixelShiftStddevFactorGreen ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftStddevFactorRed) { - keyFile.set_double ("RAW Bayer", "pixelShiftStddevFactorRed", raw.bayersensor.pixelShiftStddevFactorRed ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftStddevFactorBlue) { - keyFile.set_double ("RAW Bayer", "pixelShiftStddevFactorBlue", raw.bayersensor.pixelShiftStddevFactorBlue ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftEperIso) { - keyFile.set_double ("RAW Bayer", "PixelShiftEperIso", raw.bayersensor.pixelShiftEperIso ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftNreadIso) { - keyFile.set_double ("RAW Bayer", "PixelShiftNreadIso", raw.bayersensor.pixelShiftNreadIso ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftPrnu) { - keyFile.set_double ("RAW Bayer", "PixelShiftPrnu", raw.bayersensor.pixelShiftPrnu ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftSigma) { - keyFile.set_double ("RAW Bayer", "PixelShiftSigma", raw.bayersensor.pixelShiftSigma ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftSum) { - keyFile.set_double ("RAW Bayer", "PixelShiftSum", raw.bayersensor.pixelShiftSum ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftRedBlueWeight) { - keyFile.set_double ("RAW Bayer", "PixelShiftRedBlueWeight", raw.bayersensor.pixelShiftRedBlueWeight ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftShowMotion) { - keyFile.set_boolean ("RAW Bayer", "PixelShiftShowMotion", raw.bayersensor.pixelShiftShowMotion ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftShowMotionMaskOnly) { - keyFile.set_boolean ("RAW Bayer", "PixelShiftShowMotionMaskOnly", raw.bayersensor.pixelShiftShowMotionMaskOnly ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftAutomatic) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftAutomatic", raw.bayersensor.pixelShiftAutomatic ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftNonGreenHorizontal) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftNonGreenHorizontal", raw.bayersensor.pixelShiftNonGreenHorizontal ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftNonGreenVertical) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftNonGreenVertical", raw.bayersensor.pixelShiftNonGreenVertical ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftHoleFill) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftHoleFill", raw.bayersensor.pixelShiftHoleFill ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftMedian) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftMedian", raw.bayersensor.pixelShiftMedian ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftMedian3) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftMedian3", raw.bayersensor.pixelShiftMedian3 ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftGreen) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftGreen", raw.bayersensor.pixelShiftGreen ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftBlur) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftBlur", raw.bayersensor.pixelShiftBlur ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftSmooth) { - keyFile.set_double ("RAW Bayer", "pixelShiftSmoothFactor", raw.bayersensor.pixelShiftSmoothFactor ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftExp0) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftExp0", raw.bayersensor.pixelShiftExp0 ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftLmmse) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftLmmse", raw.bayersensor.pixelShiftLmmse ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftEqualBright) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftEqualBright", raw.bayersensor.pixelShiftEqualBright ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftEqualBrightChannel) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftEqualBrightChannel", raw.bayersensor.pixelShiftEqualBrightChannel ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftNonGreenCross) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftNonGreenCross", raw.bayersensor.pixelShiftNonGreenCross ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftNonGreenCross2) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftNonGreenCross2", raw.bayersensor.pixelShiftNonGreenCross2 ); - } - - if (!pedited || pedited->raw.bayersensor.pixelShiftNonGreenAmaze) { - keyFile.set_boolean ("RAW Bayer", "pixelShiftNonGreenAmaze", raw.bayersensor.pixelShiftNonGreenAmaze ); - } - - if (!pedited || pedited->raw.xtranssensor.method) { - keyFile.set_string ("RAW X-Trans", "Method", raw.xtranssensor.method ); - } - - if (!pedited || pedited->raw.xtranssensor.ccSteps) { - keyFile.set_integer ("RAW X-Trans", "CcSteps", raw.xtranssensor.ccSteps); - } - - if (!pedited || pedited->raw.xtranssensor.exBlackRed) { - keyFile.set_double ("RAW X-Trans", "PreBlackRed", raw.xtranssensor.blackred ); - } - - if (!pedited || pedited->raw.xtranssensor.exBlackGreen) { - keyFile.set_double ("RAW X-Trans", "PreBlackGreen", raw.xtranssensor.blackgreen ); - } - - if (!pedited || pedited->raw.xtranssensor.exBlackBlue) { - keyFile.set_double ("RAW X-Trans", "PreBlackBlue", raw.xtranssensor.blackblue ); - } - - -// save raw exposition - if (!pedited || pedited->raw.exPos) { - keyFile.set_double ("RAW", "PreExposure", raw.expos ); - } - - if (!pedited || pedited->raw.exPreser) { - keyFile.set_double ("RAW", "PrePreserv", raw.preser ); - } - -// save exif change list + saveToKeyfile(!pedited || pedited->dirpyrequalizer.mult[i], "Directional Pyramid Equalizer", ss.str(), dirpyrequalizer.mult[i], keyFile); + } + + saveToKeyfile(!pedited || pedited->dirpyrequalizer.threshold, "Directional Pyramid Equalizer", "Threshold", dirpyrequalizer.threshold, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrequalizer.skinprotect, "Directional Pyramid Equalizer", "Skinprotect", dirpyrequalizer.skinprotect, keyFile); + saveToKeyfile(!pedited || pedited->dirpyrequalizer.hueskin, "Directional Pyramid Equalizer", "Hueskin", dirpyrequalizer.hueskin.toVector(), keyFile); + +// HSV Equalizer + saveToKeyfile(!pedited || pedited->hsvequalizer.enabled, "HSV Equalizer", "Enabled", hsvequalizer.enabled, keyFile); + saveToKeyfile(!pedited || pedited->hsvequalizer.hcurve, "HSV Equalizer", "HCurve", hsvequalizer.hcurve, keyFile); + saveToKeyfile(!pedited || pedited->hsvequalizer.scurve, "HSV Equalizer", "SCurve", hsvequalizer.scurve, keyFile); + saveToKeyfile(!pedited || pedited->hsvequalizer.vcurve, "HSV Equalizer", "VCurve", hsvequalizer.vcurve, keyFile); + +// Film simulation + saveToKeyfile(!pedited || pedited->filmSimulation.enabled, "Film Simulation", "Enabled", filmSimulation.enabled, keyFile); + saveToKeyfile(!pedited || pedited->filmSimulation.clutFilename, "Film Simulation", "ClutFilename", filmSimulation.clutFilename, keyFile); + saveToKeyfile(!pedited || pedited->filmSimulation.strength, "Film Simulation", "Strength", filmSimulation.strength, keyFile); + + saveToKeyfile(!pedited || pedited->rgbCurves.enabled, "RGB Curves", "Enabled", rgbCurves.enabled, keyFile); + saveToKeyfile(!pedited || pedited->rgbCurves.lumamode, "RGB Curves", "LumaMode", rgbCurves.lumamode, keyFile); + saveToKeyfile(!pedited || pedited->rgbCurves.rcurve, "RGB Curves", "rCurve", rgbCurves.rcurve, keyFile); + saveToKeyfile(!pedited || pedited->rgbCurves.gcurve, "RGB Curves", "gCurve", rgbCurves.gcurve, keyFile); + saveToKeyfile(!pedited || pedited->rgbCurves.bcurve, "RGB Curves", "bCurve", rgbCurves.bcurve, keyFile); + +// Color toning + saveToKeyfile(!pedited || pedited->colorToning.enabled, "ColorToning", "Enabled", colorToning.enabled, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.method, "ColorToning", "Method", colorToning.method, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.lumamode, "ColorToning", "Lumamode", colorToning.lumamode, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.twocolor, "ColorToning", "Twocolor", colorToning.twocolor, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.redlow, "ColorToning", "Redlow", colorToning.redlow, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.greenlow, "ColorToning", "Greenlow", colorToning.greenlow, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.bluelow, "ColorToning", "Bluelow", colorToning.bluelow, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.satlow, "ColorToning", "Satlow", colorToning.satlow, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.balance, "ColorToning", "Balance", colorToning.balance, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.sathigh, "ColorToning", "Sathigh", colorToning.sathigh, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.redmed, "ColorToning", "Redmed", colorToning.redmed, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.greenmed, "ColorToning", "Greenmed", colorToning.greenmed, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.bluemed, "ColorToning", "Bluemed", colorToning.bluemed, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.redhigh, "ColorToning", "Redhigh", colorToning.redhigh, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.greenhigh, "ColorToning", "Greenhigh", colorToning.greenhigh, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.bluehigh, "ColorToning", "Bluehigh", colorToning.bluehigh, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.autosat, "ColorToning", "Autosat", colorToning.autosat, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.opacityCurve, "ColorToning", "OpacityCurve", colorToning.opacityCurve, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.colorCurve, "ColorToning", "ColorCurve", colorToning.colorCurve, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.satprotectionthreshold, "ColorToning", "SatProtectionThreshold", colorToning.satProtectionThreshold, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.saturatedopacity, "ColorToning", "SaturatedOpacity", colorToning.saturatedOpacity, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.strength, "ColorToning", "Strength", colorToning.strength, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.hlColSat, "ColorToning", "HighlightsColorSaturation", colorToning.hlColSat.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->colorToning.shadowsColSat, "ColorToning", "ShadowsColorSaturation", colorToning.shadowsColSat.toVector(), keyFile); + saveToKeyfile(!pedited || pedited->colorToning.clcurve, "ColorToning", "ClCurve", colorToning.clcurve, keyFile); + saveToKeyfile(!pedited || pedited->colorToning.cl2curve, "ColorToning", "Cl2Curve", colorToning.cl2curve, keyFile); + +// Raw + saveToKeyfile(!pedited || pedited->raw.darkFrame, "RAW", "DarkFrame", relativePathIfInside (fname, fnameAbsolute, raw.dark_frame), keyFile); + saveToKeyfile(!pedited || pedited->raw.df_autoselect, "RAW", "DarkFrameAuto", raw.df_autoselect, keyFile); + saveToKeyfile(!pedited || pedited->raw.ff_file, "RAW", "FlatFieldFile", relativePathIfInside (fname, fnameAbsolute, raw.ff_file), keyFile); + saveToKeyfile(!pedited || pedited->raw.ff_AutoSelect, "RAW", "FlatFieldAutoSelect", raw.ff_AutoSelect, keyFile); + saveToKeyfile(!pedited || pedited->raw.ff_BlurRadius, "RAW", "FlatFieldBlurRadius", raw.ff_BlurRadius, keyFile); + saveToKeyfile(!pedited || pedited->raw.ff_BlurType, "RAW", "FlatFieldBlurType", raw.ff_BlurType, keyFile); + saveToKeyfile(!pedited || pedited->raw.ff_AutoClipControl, "RAW", "FlatFieldAutoClipControl", raw.ff_AutoClipControl, keyFile); + saveToKeyfile(!pedited || pedited->raw.ff_clipControl, "RAW", "FlatFieldClipControl", raw.ff_clipControl, keyFile); + saveToKeyfile(!pedited || pedited->raw.ca_autocorrect, "RAW", "CA", raw.ca_autocorrect, keyFile); + saveToKeyfile(!pedited || pedited->raw.cared, "RAW", "CARed", raw.cared, keyFile); + saveToKeyfile(!pedited || pedited->raw.cablue, "RAW", "CABlue", raw.cablue, keyFile); + saveToKeyfile(!pedited || pedited->raw.hotPixelFilter, "RAW", "HotPixelFilter", raw.hotPixelFilter, keyFile); + saveToKeyfile(!pedited || pedited->raw.deadPixelFilter, "RAW", "DeadPixelFilter", raw.deadPixelFilter, keyFile); + saveToKeyfile(!pedited || pedited->raw.hotdeadpix_thresh, "RAW", "HotDeadPixelThresh", raw.hotdeadpix_thresh, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.method, "RAW Bayer", "Method", raw.bayersensor.method, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.imageNum, "RAW Bayer", "ImageNum", raw.bayersensor.imageNum + 1, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.ccSteps, "RAW Bayer", "CcSteps", raw.bayersensor.ccSteps, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.exBlack0, "RAW Bayer", "PreBlack0", raw.bayersensor.black0, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.exBlack1, "RAW Bayer", "PreBlack1", raw.bayersensor.black1, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.exBlack2, "RAW Bayer", "PreBlack2", raw.bayersensor.black2, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.exBlack3, "RAW Bayer", "PreBlack3", raw.bayersensor.black3, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.exTwoGreen, "RAW Bayer", "PreTwoGreen", raw.bayersensor.twogreen, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.linenoise, "RAW Bayer", "LineDenoise", raw.bayersensor.linenoise, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.greenEq, "RAW Bayer", "GreenEqThreshold", raw.bayersensor.greenthresh, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.dcbIterations, "RAW Bayer", "DCBIterations", raw.bayersensor.dcb_iterations, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.dcbEnhance, "RAW Bayer", "DCBEnhance", raw.bayersensor.dcb_enhance, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.lmmseIterations, "RAW Bayer", "LMMSEIterations", raw.bayersensor.lmmse_iterations, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftMotion, "RAW Bayer", "PixelShiftMotion", raw.bayersensor.pixelShiftMotion, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftMotionCorrection, "RAW Bayer", "PixelShiftMotionCorrection", toUnderlying(raw.bayersensor.pixelShiftMotionCorrection), keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftMotionCorrectionMethod, "RAW Bayer", "PixelShiftMotionCorrectionMethod", toUnderlying(raw.bayersensor.pixelShiftMotionCorrectionMethod), keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftStddevFactorGreen, "RAW Bayer", "pixelShiftStddevFactorGreen", raw.bayersensor.pixelShiftStddevFactorGreen, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftStddevFactorRed, "RAW Bayer", "pixelShiftStddevFactorRed", raw.bayersensor.pixelShiftStddevFactorRed, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftStddevFactorBlue, "RAW Bayer", "pixelShiftStddevFactorBlue", raw.bayersensor.pixelShiftStddevFactorBlue, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftEperIso, "RAW Bayer", "PixelShiftEperIso", raw.bayersensor.pixelShiftEperIso, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftNreadIso, "RAW Bayer", "PixelShiftNreadIso", raw.bayersensor.pixelShiftNreadIso, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftPrnu, "RAW Bayer", "PixelShiftPrnu", raw.bayersensor.pixelShiftPrnu, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftSigma, "RAW Bayer", "PixelShiftSigma", raw.bayersensor.pixelShiftSigma, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftSum, "RAW Bayer", "PixelShiftSum", raw.bayersensor.pixelShiftSum, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftRedBlueWeight, "RAW Bayer", "PixelShiftRedBlueWeight", raw.bayersensor.pixelShiftRedBlueWeight, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftShowMotion, "RAW Bayer", "PixelShiftShowMotion", raw.bayersensor.pixelShiftShowMotion, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftShowMotionMaskOnly, "RAW Bayer", "PixelShiftShowMotionMaskOnly", raw.bayersensor.pixelShiftShowMotionMaskOnly, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftAutomatic, "RAW Bayer", "pixelShiftAutomatic", raw.bayersensor.pixelShiftAutomatic, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftNonGreenHorizontal, "RAW Bayer", "pixelShiftNonGreenHorizontal", raw.bayersensor.pixelShiftNonGreenHorizontal, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftNonGreenVertical, "RAW Bayer", "pixelShiftNonGreenVertical", raw.bayersensor.pixelShiftNonGreenVertical, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftHoleFill, "RAW Bayer", "pixelShiftHoleFill", raw.bayersensor.pixelShiftHoleFill, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftMedian, "RAW Bayer", "pixelShiftMedian", raw.bayersensor.pixelShiftMedian, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftMedian3, "RAW Bayer", "pixelShiftMedian3", raw.bayersensor.pixelShiftMedian3, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftGreen, "RAW Bayer", "pixelShiftGreen", raw.bayersensor.pixelShiftGreen, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftBlur, "RAW Bayer", "pixelShiftBlur", raw.bayersensor.pixelShiftBlur, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftSmooth, "RAW Bayer", "pixelShiftSmoothFactor", raw.bayersensor.pixelShiftSmoothFactor, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftExp0, "RAW Bayer", "pixelShiftExp0", raw.bayersensor.pixelShiftExp0, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftLmmse, "RAW Bayer", "pixelShiftLmmse", raw.bayersensor.pixelShiftLmmse, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftEqualBright, "RAW Bayer", "pixelShiftEqualBright", raw.bayersensor.pixelShiftEqualBright, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftEqualBrightChannel, "RAW Bayer", "pixelShiftEqualBrightChannel", raw.bayersensor.pixelShiftEqualBrightChannel, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftNonGreenCross, "RAW Bayer", "pixelShiftNonGreenCross", raw.bayersensor.pixelShiftNonGreenCross, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftNonGreenCross2, "RAW Bayer", "pixelShiftNonGreenCross2", raw.bayersensor.pixelShiftNonGreenCross2, keyFile); + saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftNonGreenAmaze, "RAW Bayer", "pixelShiftNonGreenAmaze", raw.bayersensor.pixelShiftNonGreenAmaze, keyFile); + saveToKeyfile(!pedited || pedited->raw.xtranssensor.method, "RAW X-Trans", "Method", raw.xtranssensor.method, keyFile); + saveToKeyfile(!pedited || pedited->raw.xtranssensor.ccSteps, "RAW X-Trans", "CcSteps", raw.xtranssensor.ccSteps, keyFile); + saveToKeyfile(!pedited || pedited->raw.xtranssensor.exBlackRed, "RAW X-Trans", "PreBlackRed", raw.xtranssensor.blackred, keyFile); + saveToKeyfile(!pedited || pedited->raw.xtranssensor.exBlackGreen, "RAW X-Trans", "PreBlackGreen", raw.xtranssensor.blackgreen, keyFile); + saveToKeyfile(!pedited || pedited->raw.xtranssensor.exBlackBlue, "RAW X-Trans", "PreBlackBlue", raw.xtranssensor.blackblue, keyFile); + +// Raw exposition + saveToKeyfile(!pedited || pedited->raw.exPos, "RAW", "PreExposure", raw.expos, keyFile); + saveToKeyfile(!pedited || pedited->raw.exPreser, "RAW", "PrePreserv", raw.preser, keyFile); + +// EXIF change list if (!pedited || pedited->exif) { for (ExifPairs::const_iterator i = exif.begin(); i != exif.end(); ++i) { keyFile.set_string ("Exif", i->first, i->second); } } -// save iptc change list +// IPTC change list if (!pedited || pedited->iptc) { for (IPTCPairs::const_iterator i = iptc.begin(); i != iptc.end(); ++i) { Glib::ArrayHandle values = i->second; @@ -3707,27 +3386,7 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b } } -int ProcParams::write (const Glib::ustring &fname, const Glib::ustring &content) const -{ - - int error = 0; - - if (fname.length()) { - FILE *f; - f = g_fopen (fname.c_str (), "wt"); - - if (f == nullptr) { - error = 1; - } else { - fprintf (f, "%s", content.c_str()); - fclose (f); - } - } - - return error; -} - -int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) +int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) { setlocale (LC_NUMERIC, "C"); // to set decimal point to "." @@ -3738,36 +3397,17 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) Glib::KeyFile keyFile; try { - if (pedited) { pedited->set (false); } - FILE* f = g_fopen (fname.c_str (), "rt"); - - if (!f) { + if (!Glib::file_test(fname, Glib::FILE_TEST_EXISTS) || + !keyFile.load_from_file(fname)) { return 1; } - char* buffer = new char[1024]; - std::ostringstream ostr; - - while (fgets (buffer, 1024, f)) { - ostr << buffer << "\n"; - } - - delete [] buffer; - - if (!keyFile.load_from_data (ostr.str())) { - return 1; - } - - fclose (f); - - // load tonecurve: - ppVersion = PPVERSION; - appVersion = APPVERSION; + appVersion = RTVERSION; if (keyFile.has_group ("Version")) { if (keyFile.has_key ("Version", "AppVersion")) { @@ -3780,204 +3420,62 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } if (keyFile.has_group ("General")) { - if (keyFile.has_key ("General", "Rank")) { - rank = keyFile.get_integer ("General", "Rank"); - - if (pedited) { - pedited->general.rank = true; - } - } - - if (keyFile.has_key ("General", "ColorLabel")) { - colorlabel = keyFile.get_integer ("General", "ColorLabel"); - - if (pedited) { - pedited->general.colorlabel = true; - } - } - - if (keyFile.has_key ("General", "InTrash")) { - inTrash = keyFile.get_boolean ("General", "InTrash"); - - if (pedited) { - pedited->general.intrash = true; - } - } + assignFromKeyfile(keyFile, "General", "Rank", pedited, rank, pedited->general.rank); + assignFromKeyfile(keyFile, "General", "ColorLabel", pedited, colorlabel, pedited->general.colorlabel); + assignFromKeyfile(keyFile, "General", "InTrash", pedited, inTrash, pedited->general.intrash); } if (keyFile.has_group ("Exposure")) { if (ppVersion < PPVERSION_AEXP) { toneCurve.autoexp = false; // prevent execution of autoexp when opening file created with earlier verions of autoexp algorithm - } else if (keyFile.has_key ("Exposure", "Auto")) { - toneCurve.autoexp = keyFile.get_boolean ("Exposure", "Auto"); - - if (pedited) { - pedited->toneCurve.autoexp = true; - } + } else { + assignFromKeyfile(keyFile, "Exposure", "Auto", pedited, toneCurve.autoexp, pedited->toneCurve.autoexp); } - - if (keyFile.has_key ("Exposure", "Clip")) { - toneCurve.clip = keyFile.get_double ("Exposure", "Clip"); - - if (pedited) { - pedited->toneCurve.clip = true; - } - } - - if (keyFile.has_key ("Exposure", "Compensation")) { - toneCurve.expcomp = keyFile.get_double ("Exposure", "Compensation"); - - if (pedited) { - pedited->toneCurve.expcomp = true; - } - } - - if (keyFile.has_key ("Exposure", "Brightness")) { - toneCurve.brightness = keyFile.get_integer ("Exposure", "Brightness"); - - if (pedited) { - pedited->toneCurve.brightness = true; - } - } - - if (keyFile.has_key ("Exposure", "Contrast")) { - toneCurve.contrast = keyFile.get_integer ("Exposure", "Contrast"); - - if (pedited) { - pedited->toneCurve.contrast = true; - } - } - - if (keyFile.has_key ("Exposure", "Saturation")) { - toneCurve.saturation = keyFile.get_integer ("Exposure", "Saturation"); - - if (pedited) { - pedited->toneCurve.saturation = true; - } - } - - if (keyFile.has_key ("Exposure", "Black")) { - toneCurve.black = keyFile.get_integer ("Exposure", "Black"); - - if (pedited) { - pedited->toneCurve.black = true; - } - } - - if (keyFile.has_key ("Exposure", "HighlightCompr")) { - toneCurve.hlcompr = keyFile.get_integer ("Exposure", "HighlightCompr"); - - if (pedited) { - pedited->toneCurve.hlcompr = true; - } - } - - if (keyFile.has_key ("Exposure", "HighlightComprThreshold")) { - toneCurve.hlcomprthresh = keyFile.get_integer ("Exposure", "HighlightComprThreshold"); - - if (pedited) { - pedited->toneCurve.hlcomprthresh = true; - } - } - - if (keyFile.has_key ("Exposure", "ShadowCompr")) { - toneCurve.shcompr = keyFile.get_integer ("Exposure", "ShadowCompr"); - - if (pedited) { - pedited->toneCurve.shcompr = true; - } - } - -// load highlight recovery settings + assignFromKeyfile(keyFile, "Exposure", "Clip", pedited, toneCurve.clip, pedited->toneCurve.clip); + assignFromKeyfile(keyFile, "Exposure", "Compensation", pedited, toneCurve.expcomp, pedited->toneCurve.expcomp); + assignFromKeyfile(keyFile, "Exposure", "Brightness", pedited, toneCurve.brightness, pedited->toneCurve.brightness); + assignFromKeyfile(keyFile, "Exposure", "Contrast", pedited, toneCurve.contrast, pedited->toneCurve.contrast); + assignFromKeyfile(keyFile, "Exposure", "Saturation", pedited, toneCurve.saturation, pedited->toneCurve.saturation); + assignFromKeyfile(keyFile, "Exposure", "Black", pedited, toneCurve.black, pedited->toneCurve.black); + assignFromKeyfile(keyFile, "Exposure", "HighlightCompr", pedited, toneCurve.hlcompr, pedited->toneCurve.hlcompr); + assignFromKeyfile(keyFile, "Exposure", "HighlightComprThreshold", pedited, toneCurve.hlcomprthresh, pedited->toneCurve.hlcomprthresh); + assignFromKeyfile(keyFile, "Exposure", "ShadowCompr", pedited, toneCurve.shcompr, pedited->toneCurve.shcompr); if (toneCurve.shcompr > 100) { toneCurve.shcompr = 100; // older pp3 files can have values above 100. } - if (keyFile.has_key ("Exposure", "CurveMode")) { - Glib::ustring sMode = keyFile.get_string ("Exposure", "CurveMode"); + const std::map tc_mapping = { + {"Standard", ToneCurveParams::TcMode::STD}, + {"FilmLike", ToneCurveParams::TcMode::FILMLIKE}, + {"SatAndValueBlending", ToneCurveParams::TcMode::SATANDVALBLENDING}, + {"WeightedStd", ToneCurveParams::TcMode::WEIGHTEDSTD}, + {"Luminance", ToneCurveParams::TcMode::LUMINANCE}, + {"Perceptual", ToneCurveParams::TcMode::PERCEPTUAL} + }; - if (sMode == "Standard") { - toneCurve.curveMode = ToneCurveParams::TC_MODE_STD; - } else if (sMode == "FilmLike") { - toneCurve.curveMode = ToneCurveParams::TC_MODE_FILMLIKE; - } else if (sMode == "SatAndValueBlending") { - toneCurve.curveMode = ToneCurveParams::TC_MODE_SATANDVALBLENDING; - } else if (sMode == "WeightedStd") { - toneCurve.curveMode = ToneCurveParams::TC_MODE_WEIGHTEDSTD; - } else if (sMode == "Luminance") { - toneCurve.curveMode = ToneCurveParams::TC_MODE_LUMINANCE; - } else if (sMode == "Perceptual") { - toneCurve.curveMode = ToneCurveParams::TC_MODE_PERCEPTUAL; - } - - if (pedited) { - pedited->toneCurve.curveMode = true; - } - } - - if (keyFile.has_key ("Exposure", "CurveMode2")) { - Glib::ustring sMode = keyFile.get_string ("Exposure", "CurveMode2"); - - if (sMode == "Standard") { - toneCurve.curveMode2 = ToneCurveParams::TC_MODE_STD; - } else if (sMode == "FilmLike") { - toneCurve.curveMode2 = ToneCurveParams::TC_MODE_FILMLIKE; - } else if (sMode == "SatAndValueBlending") { - toneCurve.curveMode2 = ToneCurveParams::TC_MODE_SATANDVALBLENDING; - } else if (sMode == "WeightedStd") { - toneCurve.curveMode2 = ToneCurveParams::TC_MODE_WEIGHTEDSTD; - } else if (sMode == "Luminance") { - toneCurve.curveMode2 = ToneCurveParams::TC_MODE_LUMINANCE; - } else if (sMode == "Perceptual") { - toneCurve.curveMode2 = ToneCurveParams::TC_MODE_PERCEPTUAL; - } - - if (pedited) { - pedited->toneCurve.curveMode2 = true; - } - } + assignFromKeyfile(keyFile, "Exposure", "CurveMode", pedited, tc_mapping, toneCurve.curveMode, pedited->toneCurve.curveMode); + assignFromKeyfile(keyFile, "Exposure", "CurveMode2", pedited, tc_mapping, toneCurve.curveMode2, pedited->toneCurve.curveMode2); if (ppVersion > 200) { - if (keyFile.has_key ("Exposure", "Curve")) { - toneCurve.curve = keyFile.get_double_list ("Exposure", "Curve"); - avoidEmptyCurve (toneCurve.curve); - - if (pedited) { - pedited->toneCurve.curve = true; - } - } - - if (keyFile.has_key ("Exposure", "Curve2")) { - toneCurve.curve2 = keyFile.get_double_list ("Exposure", "Curve2"); - avoidEmptyCurve (toneCurve.curve2); - - if (pedited) { - pedited->toneCurve.curve2 = true; - } - } + assignFromKeyfile(keyFile, "Exposure", "Curve", pedited, toneCurve.curve, pedited->toneCurve.curve); + assignFromKeyfile(keyFile, "Exposure", "Curve2", pedited, toneCurve.curve2, pedited->toneCurve.curve2); } } if (keyFile.has_group ("HLRecovery")) { - if (keyFile.has_key ("HLRecovery", "Enabled")) { - toneCurve.hrenabled = keyFile.get_boolean ("HLRecovery", "Enabled"); - - if (pedited) { - pedited->toneCurve.hrenabled = true; - } - } - - if (keyFile.has_key ("HLRecovery", "Method")) { - toneCurve.method = keyFile.get_string ("HLRecovery", "Method"); - - if (pedited) { - pedited->toneCurve.method = true; - } - } + assignFromKeyfile(keyFile, "HLRecovery", "Enabled", pedited, toneCurve.hrenabled, pedited->toneCurve.hrenabled); + assignFromKeyfile(keyFile, "HLRecovery", "Method", pedited, toneCurve.method, pedited->toneCurve.method); } - // load channel mixer curve if (keyFile.has_group ("Channel Mixer")) { + if (ppVersion >= 329) { + assignFromKeyfile(keyFile, "Channel Mixer", "Enabled", pedited, chmixer.enabled, pedited->chmixer.enabled); + } else { + chmixer.enabled = true; + if (pedited) { + pedited->chmixer.enabled = true; + } + } if (keyFile.has_key ("Channel Mixer", "Red") && keyFile.has_key ("Channel Mixer", "Green") && keyFile.has_key ("Channel Mixer", "Blue")) { const std::vector rmix = keyFile.get_integer_list ("Channel Mixer", "Red"); const std::vector gmix = keyFile.get_integer_list ("Channel Mixer", "Green"); @@ -3997,513 +3495,120 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } -// load black & white if (keyFile.has_group ("Black & White")) { - if (keyFile.has_key ("Black & White", "Enabled")) { - blackwhite.enabled = keyFile.get_boolean ("Black & White", "Enabled"); + assignFromKeyfile(keyFile, "Black & White", "Enabled", pedited, blackwhite.enabled, pedited->blackwhite.enabled); + assignFromKeyfile(keyFile, "Black & White", "Method", pedited, blackwhite.method, pedited->blackwhite.method); + assignFromKeyfile(keyFile, "Black & White", "Auto", pedited, blackwhite.autoc, pedited->blackwhite.autoc); + assignFromKeyfile(keyFile, "Black & White", "ComplementaryColors", pedited, blackwhite.enabledcc, pedited->blackwhite.enabledcc); + assignFromKeyfile(keyFile, "Black & White", "MixerRed", pedited, blackwhite.mixerRed, pedited->blackwhite.mixerRed); + assignFromKeyfile(keyFile, "Black & White", "MixerOrange", pedited, blackwhite.mixerOrange, pedited->blackwhite.mixerOrange); + assignFromKeyfile(keyFile, "Black & White", "MixerYellow", pedited, blackwhite.mixerYellow, pedited->blackwhite.mixerYellow); + assignFromKeyfile(keyFile, "Black & White", "MixerGreen", pedited, blackwhite.mixerGreen, pedited->blackwhite.mixerGreen); + assignFromKeyfile(keyFile, "Black & White", "MixerCyan", pedited, blackwhite.mixerCyan, pedited->blackwhite.mixerCyan); + assignFromKeyfile(keyFile, "Black & White", "MixerBlue", pedited, blackwhite.mixerBlue, pedited->blackwhite.mixerBlue); + assignFromKeyfile(keyFile, "Black & White", "MixerMagenta", pedited, blackwhite.mixerMagenta, pedited->blackwhite.mixerMagenta); + assignFromKeyfile(keyFile, "Black & White", "MixerPurple", pedited, blackwhite.mixerPurple, pedited->blackwhite.mixerPurple); + assignFromKeyfile(keyFile, "Black & White", "GammaRed", pedited, blackwhite.gammaRed, pedited->blackwhite.gammaRed); + assignFromKeyfile(keyFile, "Black & White", "GammaGreen", pedited, blackwhite.gammaGreen, pedited->blackwhite.gammaGreen); + assignFromKeyfile(keyFile, "Black & White", "GammaBlue", pedited, blackwhite.gammaBlue, pedited->blackwhite.gammaBlue); + assignFromKeyfile(keyFile, "Black & White", "Filter", pedited, blackwhite.filter, pedited->blackwhite.filter); + assignFromKeyfile(keyFile, "Black & White", "Setting", pedited, blackwhite.setting, pedited->blackwhite.setting); + assignFromKeyfile(keyFile, "Black & White", "LuminanceCurve", pedited, blackwhite.luminanceCurve, pedited->blackwhite.luminanceCurve); - if (pedited) { - pedited->blackwhite.enabled = true; - } - } + assignFromKeyfile(keyFile, "Black & White", "BeforeCurve", pedited, blackwhite.beforeCurve, pedited->blackwhite.beforeCurve); - if (keyFile.has_key ("Black & White", "Method")) { - blackwhite.method = keyFile.get_string ("Black & White", "Method"); + assignFromKeyfile(keyFile, "Black & White", "Algorithm", pedited, blackwhite.algo, pedited->blackwhite.algo); + assignFromKeyfile( + keyFile, + "Black & White", + "BeforeCurveMode", + pedited, + { + {"Standard", BlackWhiteParams::TcMode::STD_BW}, + {"FilmLike", BlackWhiteParams::TcMode::FILMLIKE_BW}, + {"SatAndValueBlending", BlackWhiteParams::TcMode::SATANDVALBLENDING_BW}, + {"WeightedStd", BlackWhiteParams::TcMode::WEIGHTEDSTD_BW} + }, + blackwhite.beforeCurveMode, + pedited->blackwhite.beforeCurveMode + ); - if (pedited) { - pedited->blackwhite.method = true; - } - } - - if (keyFile.has_key ("Black & White", "Auto")) { - blackwhite.autoc = keyFile.get_boolean ("Black & White", "Auto"); - - if (pedited) { - pedited->blackwhite.autoc = true; - } - } - - if (keyFile.has_key ("Black & White", "ComplementaryColors")) { - blackwhite.enabledcc = keyFile.get_boolean ("Black & White", "ComplementaryColors"); - - if (pedited) { - pedited->blackwhite.enabledcc = true; - } - } - - if (keyFile.has_key ("Black & White", "MixerRed")) { - blackwhite.mixerRed = keyFile.get_integer ("Black & White", "MixerRed"); - - if (pedited) { - pedited->blackwhite.mixerRed = true; - } - } - - if (keyFile.has_key ("Black & White", "MixerOrange")) { - blackwhite.mixerOrange = keyFile.get_integer ("Black & White", "MixerOrange"); - - if (pedited) { - pedited->blackwhite.mixerOrange = true; - } - } - - if (keyFile.has_key ("Black & White", "MixerYellow")) { - blackwhite.mixerYellow = keyFile.get_integer ("Black & White", "MixerYellow"); - - if (pedited) { - pedited->blackwhite.mixerYellow = true; - } - } - - if (keyFile.has_key ("Black & White", "MixerGreen")) { - blackwhite.mixerGreen = keyFile.get_integer ("Black & White", "MixerGreen"); - - if (pedited) { - pedited->blackwhite.mixerGreen = true; - } - } - - if (keyFile.has_key ("Black & White", "MixerCyan")) { - blackwhite.mixerCyan = keyFile.get_integer ("Black & White", "MixerCyan"); - - if (pedited) { - pedited->blackwhite.mixerCyan = true; - } - } - - if (keyFile.has_key ("Black & White", "MixerBlue")) { - blackwhite.mixerBlue = keyFile.get_integer ("Black & White", "MixerBlue"); - - if (pedited) { - pedited->blackwhite.mixerBlue = true; - } - } - - if (keyFile.has_key ("Black & White", "MixerMagenta")) { - blackwhite.mixerMagenta = keyFile.get_integer ("Black & White", "MixerMagenta"); - - if (pedited) { - pedited->blackwhite.mixerMagenta = true; - } - } - - if (keyFile.has_key ("Black & White", "MixerPurple")) { - blackwhite.mixerPurple = keyFile.get_integer ("Black & White", "MixerPurple"); - - if (pedited) { - pedited->blackwhite.mixerPurple = true; - } - } - - if (keyFile.has_key ("Black & White", "GammaRed")) { - blackwhite.gammaRed = keyFile.get_integer ("Black & White", "GammaRed"); - - if (pedited) { - pedited->blackwhite.gammaRed = true; - } - } - - if (keyFile.has_key ("Black & White", "GammaGreen")) { - blackwhite.gammaGreen = keyFile.get_integer ("Black & White", "GammaGreen"); - - if (pedited) { - pedited->blackwhite.gammaGreen = true; - } - } - - if (keyFile.has_key ("Black & White", "GammaBlue")) { - blackwhite.gammaBlue = keyFile.get_integer ("Black & White", "GammaBlue"); - - if (pedited) { - pedited->blackwhite.gammaBlue = true; - } - } - - if (keyFile.has_key ("Black & White", "Filter")) { - blackwhite.filter = keyFile.get_string ("Black & White", "Filter"); - - if (pedited) { - pedited->blackwhite.filter = true; - } - } - - if (keyFile.has_key ("Black & White", "Setting")) { - blackwhite.setting = keyFile.get_string ("Black & White", "Setting"); - - if (pedited) { - pedited->blackwhite.setting = true; - } - } - - if (keyFile.has_key ("Black & White", "LuminanceCurve")) { - blackwhite.luminanceCurve = keyFile.get_double_list ("Black & White", "LuminanceCurve"); - avoidEmptyCurve (blackwhite.luminanceCurve); - - if (pedited) { - pedited->blackwhite.luminanceCurve = true; - } - } - - if (keyFile.has_key ("Black & White", "BeforeCurve")) { - blackwhite.beforeCurve = keyFile.get_double_list ("Black & White", "BeforeCurve"); - avoidEmptyCurve (blackwhite.beforeCurve); - - if (pedited) { - pedited->blackwhite.beforeCurve = true; - } - } - - if (keyFile.has_key ("Black & White", "Algorithm")) { - blackwhite.algo = keyFile.get_string ("Black & White", "Algorithm"); - - if (pedited) { - pedited->blackwhite.algo = true; - } - } - - if (keyFile.has_key ("Black & White", "BeforeCurveMode")) { - Glib::ustring sMode = keyFile.get_string ("Black & White", "BeforeCurveMode"); - - if (sMode == "Standard") { - blackwhite.beforeCurveMode = BlackWhiteParams::TC_MODE_STD_BW; - } else if (sMode == "FilmLike") { - blackwhite.beforeCurveMode = BlackWhiteParams::TC_MODE_FILMLIKE_BW; - } else if (sMode == "SatAndValueBlending") { - blackwhite.beforeCurveMode = BlackWhiteParams::TC_MODE_SATANDVALBLENDING_BW; - } else if (sMode == "WeightedStd") { - blackwhite.beforeCurveMode = BlackWhiteParams::TC_MODE_WEIGHTEDSTD_BW; - } - - if (pedited) { - pedited->blackwhite.beforeCurveMode = true; - } - } - - if (keyFile.has_key ("Black & White", "AfterCurve")) { - blackwhite.afterCurve = keyFile.get_double_list ("Black & White", "AfterCurve"); - avoidEmptyCurve (blackwhite.afterCurve); - - if (pedited) { - pedited->blackwhite.afterCurve = true; - } - } - - if (keyFile.has_key ("Black & White", "AfterCurveMode")) { - Glib::ustring sMode2 = keyFile.get_string ("Black & White", "AfterCurveMode"); - - if (sMode2 == "Standard") { - blackwhite.afterCurveMode = BlackWhiteParams::TC_MODE_STD_BW; - } else if (sMode2 == "WeightedStd") { - blackwhite.afterCurveMode = BlackWhiteParams::TC_MODE_WEIGHTEDSTD_BW; - } - - if (pedited) { - pedited->blackwhite.afterCurveMode = true; - } - } + assignFromKeyfile(keyFile, "Black & White", "AfterCurve", pedited, blackwhite.afterCurve, pedited->blackwhite.afterCurve); + assignFromKeyfile( + keyFile, + "Black & White", + "AfterCurveMode", + pedited, + { + {"Standard", BlackWhiteParams::TcMode::STD_BW}, + {"WeightedStd", BlackWhiteParams::TcMode::WEIGHTEDSTD_BW} + }, + blackwhite.afterCurveMode, + pedited->blackwhite.afterCurveMode + ); } -//load retinex if (keyFile.has_group ("Retinex")) { - - if (keyFile.has_key ("Retinex", "Median")) { - retinex.medianmap = keyFile.get_boolean ("Retinex", "Median"); - - if (pedited) { - pedited->retinex.medianmap = true; - } - } - - if (keyFile.has_key ("Retinex", "RetinexMethod")) { - retinex.retinexMethod = keyFile.get_string ("Retinex", "RetinexMethod"); - - if (pedited) { - pedited->retinex.retinexMethod = true; - } - } - - if (keyFile.has_key ("Retinex", "mapMethod")) { - retinex.mapMethod = keyFile.get_string ("Retinex", "mapMethod"); - - if (pedited) { - pedited->retinex.mapMethod = true; - } - } - - if (keyFile.has_key ("Retinex", "viewMethod")) { - retinex.viewMethod = keyFile.get_string ("Retinex", "viewMethod"); - - if (pedited) { - pedited->retinex.viewMethod = true; - } - } - - - if (keyFile.has_key ("Retinex", "Retinexcolorspace")) { - retinex.retinexcolorspace = keyFile.get_string ("Retinex", "Retinexcolorspace"); - - if (pedited) { - pedited->retinex.retinexcolorspace = true; - } - } - - if (keyFile.has_key ("Retinex", "Gammaretinex")) { - retinex.gammaretinex = keyFile.get_string ("Retinex", "Gammaretinex"); - - if (pedited) { - pedited->retinex.gammaretinex = true; - } - } - - if (keyFile.has_key ("Retinex", "Enabled")) { - retinex.enabled = keyFile.get_boolean ("Retinex", "Enabled"); - - if (pedited) { - pedited->retinex.enabled = true; - } - } - - if (keyFile.has_key ("Retinex", "Neigh")) { - retinex.neigh = keyFile.get_integer ("Retinex", "Neigh"); - - if (pedited) { - pedited->retinex.neigh = true; - } - } - - if (keyFile.has_key ("Retinex", "Str")) { - retinex.str = keyFile.get_integer ("Retinex", "Str"); - - if (pedited) { - pedited->retinex.str = true; - } - } - - if (keyFile.has_key ("Retinex", "Scal")) { - retinex.scal = keyFile.get_integer ("Retinex", "Scal"); - - if (pedited) { - pedited->retinex.scal = true; - } - } - - if (keyFile.has_key ("Retinex", "Iter")) { - retinex.iter = keyFile.get_integer ("Retinex", "Iter"); - - if (pedited) { - pedited->retinex.iter = true; - } - } - - if (keyFile.has_key ("Retinex", "Grad")) { - retinex.grad = keyFile.get_integer ("Retinex", "Grad"); - - if (pedited) { - pedited->retinex.grad = true; - } - } - - if (keyFile.has_key ("Retinex", "Grads")) { - retinex.grads = keyFile.get_integer ("Retinex", "Grads"); - - if (pedited) { - pedited->retinex.grads = true; - } - } - - if (keyFile.has_key ("Retinex", "Gam")) { - retinex.gam = keyFile.get_double ("Retinex", "Gam"); - - if (pedited) { - pedited->retinex.gam = true; - } - } - - if (keyFile.has_key ("Retinex", "Slope")) { - retinex.slope = keyFile.get_double ("Retinex", "Slope"); - - if (pedited) { - pedited->retinex.slope = true; - } - } - - if (keyFile.has_key ("Retinex", "Offs")) { - retinex.offs = keyFile.get_integer ("Retinex", "Offs"); - - if (pedited) { - pedited->retinex.offs = true; - } - } - - if (keyFile.has_key ("Retinex", "Vart")) { - retinex.vart = keyFile.get_integer ("Retinex", "Vart"); - - if (pedited) { - pedited->retinex.vart = true; - } - } - - if (keyFile.has_key ("Retinex", "Limd")) { - retinex.limd = keyFile.get_integer ("Retinex", "Limd"); - - if (pedited) { - pedited->retinex.limd = true; - } - } - - if (keyFile.has_key ("Retinex", "highl")) { - retinex.highl = keyFile.get_integer ("Retinex", "highl"); - - if (pedited) { - pedited->retinex.highl = true; - } - } - - if (keyFile.has_key ("Retinex", "skal")) { - retinex.skal = keyFile.get_integer ("Retinex", "skal"); - - if (pedited) { - pedited->retinex.skal = true; - } - } - - if (keyFile.has_key ("Retinex", "CDCurve")) { - retinex.cdcurve = keyFile.get_double_list ("Retinex", "CDCurve"); - avoidEmptyCurve (retinex.cdcurve); - - if (pedited) { - pedited->retinex.cdcurve = true; - } - } - - if (keyFile.has_key ("Retinex", "MAPCurve")) { - retinex.mapcurve = keyFile.get_double_list ("Retinex", "MAPCurve"); - avoidEmptyCurve (retinex.mapcurve); - - if (pedited) { - pedited->retinex.mapcurve = true; - } - } - - if (keyFile.has_key ("Retinex", "CDHCurve")) { - retinex.cdHcurve = keyFile.get_double_list ("Retinex", "CDHCurve"); - avoidEmptyCurve (retinex.cdHcurve); - - if (pedited) { - pedited->retinex.cdHcurve = true; - } - } - - if (keyFile.has_key ("Retinex", "LHCurve")) { - retinex.lhcurve = keyFile.get_double_list ("Retinex", "LHCurve"); - avoidEmptyCurve (retinex.lhcurve); - - if (pedited) { - pedited->retinex.lhcurve = true; - } - } - - if (keyFile.has_key ("Retinex", "Highlights")) { - retinex.highlights = keyFile.get_integer ("Retinex", "Highlights"); - - if (pedited) { - pedited->retinex.highlights = true; - } - } - - if (keyFile.has_key ("Retinex", "HighlightTonalWidth")) { - retinex.htonalwidth = keyFile.get_integer ("Retinex", "HighlightTonalWidth"); - - if (pedited) { - pedited->retinex.htonalwidth = true; - } - } - - if (keyFile.has_key ("Retinex", "Shadows")) { - retinex.shadows = keyFile.get_integer ("Retinex", "Shadows"); - - if (pedited) { - pedited->retinex.shadows = true; - } - } - - if (keyFile.has_key ("Retinex", "ShadowTonalWidth")) { - retinex.stonalwidth = keyFile.get_integer ("Retinex", "ShadowTonalWidth"); - - if (pedited) { - pedited->retinex.stonalwidth = true; - } - } - - - if (keyFile.has_key ("Retinex", "Radius")) { - retinex.radius = keyFile.get_integer ("Retinex", "Radius"); - - if (pedited) { - pedited->retinex.radius = true; - } - } - - - if (keyFile.has_key ("Retinex", "TransmissionCurve")) { - retinex.transmissionCurve = keyFile.get_double_list ("Retinex", "TransmissionCurve"); - avoidEmptyCurve (retinex.transmissionCurve); - - if (pedited) { - pedited->retinex.transmissionCurve = true; - } - } - - - if (keyFile.has_key ("Retinex", "GainTransmissionCurve")) { - retinex.gaintransmissionCurve = keyFile.get_double_list ("Retinex", "GainTransmissionCurve"); - avoidEmptyCurve (retinex.gaintransmissionCurve); - - if (pedited) { - pedited->retinex.gaintransmissionCurve = true; - } - } - + assignFromKeyfile(keyFile, "Retinex", "Median", pedited, retinex.medianmap, pedited->retinex.medianmap); + assignFromKeyfile(keyFile, "Retinex", "RetinexMethod", pedited, retinex.retinexMethod, pedited->retinex.retinexMethod); + assignFromKeyfile(keyFile, "Retinex", "mapMethod", pedited, retinex.mapMethod, pedited->retinex.mapMethod); + assignFromKeyfile(keyFile, "Retinex", "viewMethod", pedited, retinex.viewMethod, pedited->retinex.viewMethod); + + assignFromKeyfile(keyFile, "Retinex", "Retinexcolorspace", pedited, retinex.retinexcolorspace, pedited->retinex.retinexcolorspace); + assignFromKeyfile(keyFile, "Retinex", "Gammaretinex", pedited, retinex.gammaretinex, pedited->retinex.gammaretinex); + assignFromKeyfile(keyFile, "Retinex", "Enabled", pedited, retinex.enabled, pedited->retinex.enabled); + assignFromKeyfile(keyFile, "Retinex", "Neigh", pedited, retinex.neigh, pedited->retinex.neigh); + assignFromKeyfile(keyFile, "Retinex", "Str", pedited, retinex.str, pedited->retinex.str); + assignFromKeyfile(keyFile, "Retinex", "Scal", pedited, retinex.scal, pedited->retinex.scal); + assignFromKeyfile(keyFile, "Retinex", "Iter", pedited, retinex.iter, pedited->retinex.iter); + assignFromKeyfile(keyFile, "Retinex", "Grad", pedited, retinex.grad, pedited->retinex.grad); + assignFromKeyfile(keyFile, "Retinex", "Grads", pedited, retinex.grads, pedited->retinex.grads); + assignFromKeyfile(keyFile, "Retinex", "Gam", pedited, retinex.gam, pedited->retinex.gam); + assignFromKeyfile(keyFile, "Retinex", "Slope", pedited, retinex.slope, pedited->retinex.slope); + assignFromKeyfile(keyFile, "Retinex", "Offs", pedited, retinex.offs, pedited->retinex.offs); + assignFromKeyfile(keyFile, "Retinex", "Vart", pedited, retinex.vart, pedited->retinex.vart); + assignFromKeyfile(keyFile, "Retinex", "Limd", pedited, retinex.limd, pedited->retinex.limd); + assignFromKeyfile(keyFile, "Retinex", "highl", pedited, retinex.highl, pedited->retinex.highl); + assignFromKeyfile(keyFile, "Retinex", "skal", pedited, retinex.skal, pedited->retinex.skal); + assignFromKeyfile(keyFile, "Retinex", "CDCurve", pedited, retinex.cdcurve, pedited->retinex.cdcurve); + + assignFromKeyfile(keyFile, "Retinex", "MAPCurve", pedited, retinex.mapcurve, pedited->retinex.mapcurve); + + assignFromKeyfile(keyFile, "Retinex", "CDHCurve", pedited, retinex.cdHcurve, pedited->retinex.cdHcurve); + + assignFromKeyfile(keyFile, "Retinex", "LHCurve", pedited, retinex.lhcurve, pedited->retinex.lhcurve); + + assignFromKeyfile(keyFile, "Retinex", "Highlights", pedited, retinex.highlights, pedited->retinex.highlights); + assignFromKeyfile(keyFile, "Retinex", "HighlightTonalWidth", pedited, retinex.htonalwidth, pedited->retinex.htonalwidth); + assignFromKeyfile(keyFile, "Retinex", "Shadows", pedited, retinex.shadows, pedited->retinex.shadows); + assignFromKeyfile(keyFile, "Retinex", "ShadowTonalWidth", pedited, retinex.stonalwidth, pedited->retinex.stonalwidth); + + assignFromKeyfile(keyFile, "Retinex", "Radius", pedited, retinex.radius, pedited->retinex.radius); + + assignFromKeyfile(keyFile, "Retinex", "TransmissionCurve", pedited, retinex.transmissionCurve, pedited->retinex.transmissionCurve); + + assignFromKeyfile(keyFile, "Retinex", "GainTransmissionCurve", pedited, retinex.gaintransmissionCurve, pedited->retinex.gaintransmissionCurve); } - -// load luma curve if (keyFile.has_group ("Luminance Curve")) { - if (keyFile.has_key ("Luminance Curve", "Brightness")) { - labCurve.brightness = keyFile.get_integer ("Luminance Curve", "Brightness"); - + if (ppVersion >= 329) { + assignFromKeyfile(keyFile, "Luminance Curve", "Enabled", pedited, labCurve.enabled, pedited->labCurve.enabled); + } else { + labCurve.enabled = true; if (pedited) { - pedited->labCurve.brightness = true; - } - } - - if (keyFile.has_key ("Luminance Curve", "Contrast")) { - labCurve.contrast = keyFile.get_integer ("Luminance Curve", "Contrast"); - - if (pedited) { - pedited->labCurve.contrast = true; + pedited->labCurve.enabled = true; } } + + assignFromKeyfile(keyFile, "Luminance Curve", "Brightness", pedited, labCurve.brightness, pedited->labCurve.brightness); + assignFromKeyfile(keyFile, "Luminance Curve", "Contrast", pedited, labCurve.contrast, pedited->labCurve.contrast); if (ppVersion < 303) { -// transform Saturation into Chromaticity -// if Saturation == 0, should we set BWToning on? - if (keyFile.has_key ("Luminance Curve", "Saturation")) { - labCurve.chromaticity = keyFile.get_integer ("Luminance Curve", "Saturation"); - - if (pedited) { - pedited->labCurve.chromaticity = true; - } - } - -// transform AvoidColorClipping into AvoidColorShift - if (keyFile.has_key ("Luminance Curve", "AvoidColorClipping")) { - labCurve.avoidcolorshift = keyFile.get_boolean ("Luminance Curve", "AvoidColorClipping"); - - if (pedited) { - pedited->labCurve.avoidcolorshift = true; - } - } + // transform Saturation into Chromaticity + // if Saturation == 0, should we set BWToning on? + assignFromKeyfile(keyFile, "Luminance Curve", "Saturation", pedited, labCurve.chromaticity, pedited->labCurve.chromaticity); + // transform AvoidColorClipping into AvoidColorShift + assignFromKeyfile(keyFile, "Luminance Curve", "AvoidColorClipping", pedited, labCurve.avoidcolorshift, pedited->labCurve.avoidcolorshift); } else { if (keyFile.has_key ("Luminance Curve", "Chromaticity")) { labCurve.chromaticity = keyFile.get_integer ("Luminance Curve", "Chromaticity"); @@ -4517,35 +3622,15 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Luminance Curve", "AvoidColorShift")) { - labCurve.avoidcolorshift = keyFile.get_boolean ("Luminance Curve", "AvoidColorShift"); - - if (pedited) { - pedited->labCurve.avoidcolorshift = true; - } - } - - if (keyFile.has_key ("Luminance Curve", "RedAndSkinTonesProtection")) { - labCurve.rstprotection = keyFile.get_double ("Luminance Curve", "RedAndSkinTonesProtection"); - - if (pedited) { - pedited->labCurve.rstprotection = true; - } - } + assignFromKeyfile(keyFile, "Luminance Curve", "AvoidColorShift", pedited, labCurve.avoidcolorshift, pedited->labCurve.avoidcolorshift); + assignFromKeyfile(keyFile, "Luminance Curve", "RedAndSkinTonesProtection", pedited, labCurve.rstprotection, pedited->labCurve.rstprotection); } - if (keyFile.has_key ("Luminance Curve", "LCredsk")) { - labCurve.lcredsk = keyFile.get_boolean ("Luminance Curve", "LCredsk"); + assignFromKeyfile(keyFile, "Luminance Curve", "LCredsk", pedited, labCurve.lcredsk, pedited->labCurve.lcredsk); - if (pedited) { - pedited->labCurve.lcredsk = true; - } - } - - if (ppVersion < 314) - -// Backward compatibility: If BWtoning is true, Chromaticity has to be set to -100, which will produce the same effect -// and will enable the b&w toning mode ('a' & 'b' curves) + if (ppVersion < 314) { + // Backward compatibility: If BWtoning is true, Chromaticity has to be set to -100, which will produce the same effect + // and will enable the b&w toning mode ('a' & 'b' curves) if (keyFile.has_key ("Luminance Curve", "BWtoning")) { if ( keyFile.get_boolean ("Luminance Curve", "BWtoning")) { labCurve.chromaticity = -100; @@ -4555,115 +3640,23 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } } - - if (keyFile.has_key ("Luminance Curve", "LCurve")) { - labCurve.lcurve = keyFile.get_double_list ("Luminance Curve", "LCurve"); - avoidEmptyCurve (labCurve.lcurve); - - if (pedited) { - pedited->labCurve.lcurve = true; - } - } - - if (keyFile.has_key ("Luminance Curve", "aCurve")) { - labCurve.acurve = keyFile.get_double_list ("Luminance Curve", "aCurve"); - avoidEmptyCurve (labCurve.acurve); - - if (pedited) { - pedited->labCurve.acurve = true; - } - } - - if (keyFile.has_key ("Luminance Curve", "bCurve")) { - labCurve.bcurve = keyFile.get_double_list ("Luminance Curve", "bCurve"); - avoidEmptyCurve (labCurve.bcurve); - - if (pedited) { - pedited->labCurve.bcurve = true; - } - } - - if (keyFile.has_key ("Luminance Curve", "ccCurve")) { - labCurve.cccurve = keyFile.get_double_list ("Luminance Curve", "ccCurve"); - avoidEmptyCurve (labCurve.cccurve); - - if (pedited) { - pedited->labCurve.cccurve = true; - } - } - - if (keyFile.has_key ("Luminance Curve", "chCurve")) { - labCurve.chcurve = keyFile.get_double_list ("Luminance Curve", "chCurve"); - avoidEmptyCurve (labCurve.chcurve); - - if (pedited) { - pedited->labCurve.chcurve = true; - } - } - - if (keyFile.has_key ("Luminance Curve", "lhCurve")) { - labCurve.lhcurve = keyFile.get_double_list ("Luminance Curve", "lhCurve"); - avoidEmptyCurve (labCurve.lhcurve); - - if (pedited) { - pedited->labCurve.lhcurve = true; - } - } - - if (keyFile.has_key ("Luminance Curve", "hhCurve")) { - labCurve.hhcurve = keyFile.get_double_list ("Luminance Curve", "hhCurve"); - avoidEmptyCurve (labCurve.hhcurve); - - if (pedited) { - pedited->labCurve.hhcurve = true; - } - } - - if (keyFile.has_key ("Luminance Curve", "LcCurve")) { - labCurve.lccurve = keyFile.get_double_list ("Luminance Curve", "LcCurve"); - avoidEmptyCurve (labCurve.lccurve); - - if (pedited) { - pedited->labCurve.lccurve = true; - } - } - - if (keyFile.has_key ("Luminance Curve", "ClCurve")) { - labCurve.clcurve = keyFile.get_double_list ("Luminance Curve", "ClCurve"); - avoidEmptyCurve (labCurve.clcurve); - - if (pedited) { - pedited->labCurve.clcurve = true; - } } + assignFromKeyfile(keyFile, "Luminance Curve", "LCurve", pedited, labCurve.lcurve, pedited->labCurve.lcurve); + assignFromKeyfile(keyFile, "Luminance Curve", "aCurve", pedited, labCurve.acurve, pedited->labCurve.acurve); + assignFromKeyfile(keyFile, "Luminance Curve", "bCurve", pedited, labCurve.bcurve, pedited->labCurve.bcurve); + assignFromKeyfile(keyFile, "Luminance Curve", "ccCurve", pedited, labCurve.cccurve, pedited->labCurve.cccurve); + assignFromKeyfile(keyFile, "Luminance Curve", "chCurve", pedited, labCurve.chcurve, pedited->labCurve.chcurve); + assignFromKeyfile(keyFile, "Luminance Curve", "lhCurve", pedited, labCurve.lhcurve, pedited->labCurve.lhcurve); + assignFromKeyfile(keyFile, "Luminance Curve", "hhCurve", pedited, labCurve.hhcurve, pedited->labCurve.hhcurve); + assignFromKeyfile(keyFile, "Luminance Curve", "LcCurve", pedited, labCurve.lccurve, pedited->labCurve.lccurve); + assignFromKeyfile(keyFile, "Luminance Curve", "ClCurve", pedited, labCurve.clcurve, pedited->labCurve.clcurve); } -// load sharpening if (keyFile.has_group ("Sharpening")) { - if (keyFile.has_key ("Sharpening", "Enabled")) { - sharpening.enabled = keyFile.get_boolean ("Sharpening", "Enabled"); - - if (pedited) { - pedited->sharpening.enabled = true; - } - } - - if (keyFile.has_key ("Sharpening", "Radius")) { - sharpening.radius = keyFile.get_double ("Sharpening", "Radius"); - - if (pedited) { - pedited->sharpening.radius = true; - } - } - - if (keyFile.has_key ("Sharpening", "Amount")) { - sharpening.amount = keyFile.get_integer ("Sharpening", "Amount"); - - if (pedited) { - pedited->sharpening.amount = true; - } - } + assignFromKeyfile(keyFile, "Sharpening", "Enabled", pedited, sharpening.enabled, pedited->sharpening.enabled); + assignFromKeyfile(keyFile, "Sharpening", "Radius", pedited, sharpening.radius, pedited->sharpening.radius); + assignFromKeyfile(keyFile, "Sharpening", "Amount", pedited, sharpening.amount, pedited->sharpening.amount); if (keyFile.has_key ("Sharpening", "Threshold")) { if (ppVersion < 302) { @@ -4682,182 +3675,36 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Sharpening", "OnlyEdges")) { - sharpening.edgesonly = keyFile.get_boolean ("Sharpening", "OnlyEdges"); - - if (pedited) { - pedited->sharpening.edgesonly = true; - } - } - - if (keyFile.has_key ("Sharpening", "EdgedetectionRadius")) { - sharpening.edges_radius = keyFile.get_double ("Sharpening", "EdgedetectionRadius"); - - if (pedited) { - pedited->sharpening.edges_radius = true; - } - } - - if (keyFile.has_key ("Sharpening", "EdgeTolerance")) { - sharpening.edges_tolerance = keyFile.get_integer ("Sharpening", "EdgeTolerance"); - - if (pedited) { - pedited->sharpening.edges_tolerance = true; - } - } - - if (keyFile.has_key ("Sharpening", "HalocontrolEnabled")) { - sharpening.halocontrol = keyFile.get_boolean ("Sharpening", "HalocontrolEnabled"); - - if (pedited) { - pedited->sharpening.halocontrol = true; - } - } - - if (keyFile.has_key ("Sharpening", "HalocontrolAmount")) { - sharpening.halocontrol_amount = keyFile.get_integer ("Sharpening", "HalocontrolAmount"); - - if (pedited) { - pedited->sharpening.halocontrol_amount = true; - } - } - - if (keyFile.has_key ("Sharpening", "Method")) { - sharpening.method = keyFile.get_string ("Sharpening", "Method"); - - if (pedited) { - pedited->sharpening.method = true; - } - } - - if (keyFile.has_key ("Sharpening", "DeconvRadius")) { - sharpening.deconvradius = keyFile.get_double ("Sharpening", "DeconvRadius"); - - if (pedited) { - pedited->sharpening.deconvradius = true; - } - } - - if (keyFile.has_key ("Sharpening", "DeconvAmount")) { - sharpening.deconvamount = keyFile.get_integer ("Sharpening", "DeconvAmount"); - - if (pedited) { - pedited->sharpening.deconvamount = true; - } - } - - if (keyFile.has_key ("Sharpening", "DeconvDamping")) { - sharpening.deconvdamping = keyFile.get_integer ("Sharpening", "DeconvDamping"); - - if (pedited) { - pedited->sharpening.deconvdamping = true; - } - } - - if (keyFile.has_key ("Sharpening", "DeconvIterations")) { - sharpening.deconviter = keyFile.get_integer ("Sharpening", "DeconvIterations"); - - if (pedited) { - pedited->sharpening.deconviter = true; - } - } + assignFromKeyfile(keyFile, "Sharpening", "OnlyEdges", pedited, sharpening.edgesonly, pedited->sharpening.edgesonly); + assignFromKeyfile(keyFile, "Sharpening", "EdgedetectionRadius", pedited, sharpening.edges_radius, pedited->sharpening.edges_radius); + assignFromKeyfile(keyFile, "Sharpening", "EdgeTolerance", pedited, sharpening.edges_tolerance, pedited->sharpening.edges_tolerance); + assignFromKeyfile(keyFile, "Sharpening", "HalocontrolEnabled", pedited, sharpening.halocontrol, pedited->sharpening.halocontrol); + assignFromKeyfile(keyFile, "Sharpening", "HalocontrolAmount", pedited, sharpening.halocontrol_amount, pedited->sharpening.halocontrol_amount); + assignFromKeyfile(keyFile, "Sharpening", "Method", pedited, sharpening.method, pedited->sharpening.method); + assignFromKeyfile(keyFile, "Sharpening", "DeconvRadius", pedited, sharpening.deconvradius, pedited->sharpening.deconvradius); + assignFromKeyfile(keyFile, "Sharpening", "DeconvAmount", pedited, sharpening.deconvamount, pedited->sharpening.deconvamount); + assignFromKeyfile(keyFile, "Sharpening", "DeconvDamping", pedited, sharpening.deconvdamping, pedited->sharpening.deconvdamping); + assignFromKeyfile(keyFile, "Sharpening", "DeconvIterations", pedited, sharpening.deconviter, pedited->sharpening.deconviter); } -// load edge sharpening if (keyFile.has_group ("SharpenEdge")) { - if (keyFile.has_key ("SharpenEdge", "Enabled")) { - sharpenEdge.enabled = keyFile.get_boolean ("SharpenEdge", "Enabled"); - - if (pedited) { - pedited->sharpenEdge.enabled = true; - } - } - - if (keyFile.has_key ("SharpenEdge", "Passes")) { - sharpenEdge.passes = keyFile.get_integer ("SharpenEdge", "Passes"); - - if (pedited) { - pedited->sharpenEdge.passes = true; - } - } - - if (keyFile.has_key ("SharpenEdge", "Strength")) { - sharpenEdge.amount = keyFile.get_double ("SharpenEdge", "Strength"); - - if (pedited) { - pedited->sharpenEdge.amount = true; - } - } - - if (keyFile.has_key ("SharpenEdge", "ThreeChannels")) { - sharpenEdge.threechannels = keyFile.get_boolean ("SharpenEdge", "ThreeChannels"); - - if (pedited) { - pedited->sharpenEdge.threechannels = true; - } - } + assignFromKeyfile(keyFile, "SharpenEdge", "Enabled", pedited, sharpenEdge.enabled, pedited->sharpenEdge.enabled); + assignFromKeyfile(keyFile, "SharpenEdge", "Passes", pedited, sharpenEdge.passes, pedited->sharpenEdge.passes); + assignFromKeyfile(keyFile, "SharpenEdge", "Strength", pedited, sharpenEdge.amount, pedited->sharpenEdge.amount); + assignFromKeyfile(keyFile, "SharpenEdge", "ThreeChannels", pedited, sharpenEdge.threechannels, pedited->sharpenEdge.threechannels); } -// load micro-contrast sharpening if (keyFile.has_group ("SharpenMicro")) { - if (keyFile.has_key ("SharpenMicro", "Enabled")) { - sharpenMicro.enabled = keyFile.get_boolean ("SharpenMicro", "Enabled"); - - if (pedited) { - pedited->sharpenMicro.enabled = true; - } - } - - if (keyFile.has_key ("SharpenMicro", "Matrix")) { - sharpenMicro.matrix = keyFile.get_boolean ("SharpenMicro", "Matrix"); - - if (pedited) { - pedited->sharpenMicro.matrix = true; - } - } - - if (keyFile.has_key ("SharpenMicro", "Strength")) { - sharpenMicro.amount = keyFile.get_double ("SharpenMicro", "Strength"); - - if (pedited) { - pedited->sharpenMicro.amount = true; - } - } - - if (keyFile.has_key ("SharpenMicro", "Uniformity")) { - sharpenMicro.uniformity = keyFile.get_double ("SharpenMicro", "Uniformity"); - - if (pedited) { - pedited->sharpenMicro.uniformity = true; - } - } + assignFromKeyfile(keyFile, "SharpenMicro", "Enabled", pedited, sharpenMicro.enabled, pedited->sharpenMicro.enabled); + assignFromKeyfile(keyFile, "SharpenMicro", "Matrix", pedited, sharpenMicro.matrix, pedited->sharpenMicro.matrix); + assignFromKeyfile(keyFile, "SharpenMicro", "Strength", pedited, sharpenMicro.amount, pedited->sharpenMicro.amount); + assignFromKeyfile(keyFile, "SharpenMicro", "Uniformity", pedited, sharpenMicro.uniformity, pedited->sharpenMicro.uniformity); } -// load vibrance if (keyFile.has_group ("Vibrance")) { - if (keyFile.has_key ("Vibrance", "Enabled")) { - vibrance.enabled = keyFile.get_boolean ("Vibrance", "Enabled"); - - if (pedited) { - pedited->vibrance.enabled = true; - } - } - - if (keyFile.has_key ("Vibrance", "Pastels")) { - vibrance.pastels = keyFile.get_integer ("Vibrance", "Pastels"); - - if (pedited) { - pedited->vibrance.pastels = true; - } - } - - if (keyFile.has_key ("Vibrance", "Saturated")) { - vibrance.saturated = keyFile.get_integer ("Vibrance", "Saturated"); - - if (pedited) { - pedited->vibrance.saturated = true; - } - } + assignFromKeyfile(keyFile, "Vibrance", "Enabled", pedited, vibrance.enabled, pedited->vibrance.enabled); + assignFromKeyfile(keyFile, "Vibrance", "Pastels", pedited, vibrance.pastels, pedited->vibrance.pastels); + assignFromKeyfile(keyFile, "Vibrance", "Saturated", pedited, vibrance.saturated, pedited->vibrance.saturated); if (keyFile.has_key ("Vibrance", "PSThreshold")) { if (ppVersion < 302) { @@ -4876,121 +3723,24 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Vibrance", "ProtectSkins")) { - vibrance.protectskins = keyFile.get_boolean ("Vibrance", "ProtectSkins"); - - if (pedited) { - pedited->vibrance.protectskins = true; - } - } - - if (keyFile.has_key ("Vibrance", "AvoidColorShift")) { - vibrance.avoidcolorshift = keyFile.get_boolean ("Vibrance", "AvoidColorShift"); - - if (pedited) { - pedited->vibrance.avoidcolorshift = true; - } - } - - if (keyFile.has_key ("Vibrance", "PastSatTog")) { - vibrance.pastsattog = keyFile.get_boolean ("Vibrance", "PastSatTog"); - - if (pedited) { - pedited->vibrance.pastsattog = true; - } - } - - if (keyFile.has_key ("Vibrance", "SkinTonesCurve")) { - vibrance.skintonescurve = keyFile.get_double_list ("Vibrance", "SkinTonesCurve"); - avoidEmptyCurve (vibrance.skintonescurve); - - if (pedited) { - pedited->vibrance.skintonescurve = true; - } - } + assignFromKeyfile(keyFile, "Vibrance", "ProtectSkins", pedited, vibrance.protectskins, pedited->vibrance.protectskins); + assignFromKeyfile(keyFile, "Vibrance", "AvoidColorShift", pedited, vibrance.avoidcolorshift, pedited->vibrance.avoidcolorshift); + assignFromKeyfile(keyFile, "Vibrance", "PastSatTog", pedited, vibrance.pastsattog, pedited->vibrance.pastsattog); + assignFromKeyfile(keyFile, "Vibrance", "SkinTonesCurve", pedited, vibrance.skintonescurve, pedited->vibrance.skintonescurve); } - // load colorBoost - /*if (keyFile.has_group ("Color Boost")) { - if (keyFile.has_key ("Color Boost", "Amount")) { colorBoost.amount = keyFile.get_integer ("Color Boost", "Amount"); if (pedited) pedited->colorBoost.amount = true; } - else { - int a=0, b=0; - if (keyFile.has_key ("Color Boost", "ChannelA")) { a = keyFile.get_integer ("Color Boost", "ChannelA"); } - if (keyFile.has_key ("Color Boost", "ChannelB")) { b = keyFile.get_integer ("Color Boost", "ChannelB"); } - colorBoost.amount = (a+b) / 2; - if (pedited) pedited->colorBoost.amount = true; - } - if (keyFile.has_key ("Color Boost", "AvoidColorClipping")) { colorBoost.avoidclip = keyFile.get_boolean ("Color Boost", "AvoidColorClipping"); if (pedited) pedited->colorBoost.avoidclip = true; } - if (keyFile.has_key ("Color Boost", "SaturationLimiter")) { colorBoost.enable_saturationlimiter= keyFile.get_boolean ("Color Boost", "SaturationLimiter"); if (pedited) pedited->colorBoost.enable_saturationlimiter = true; } - if (keyFile.has_key ("Color Boost", "SaturationLimit")) { colorBoost.saturationlimit = keyFile.get_double ("Color Boost", "SaturationLimit"); if (pedited) pedited->colorBoost.saturationlimit = true; } - }*/ - - // load wb if (keyFile.has_group ("White Balance")) { - if (keyFile.has_key ("White Balance", "Setting")) { - wb.method = keyFile.get_string ("White Balance", "Setting"); - - if (pedited) { - pedited->wb.method = true; - } - } - - if (keyFile.has_key ("White Balance", "Temperature")) { - wb.temperature = keyFile.get_integer ("White Balance", "Temperature"); - - if (pedited) { - pedited->wb.temperature = true; - } - } - - if (keyFile.has_key ("White Balance", "Green")) { - wb.green = keyFile.get_double ("White Balance", "Green"); - - if (pedited) { - pedited->wb.green = true; - } - } - - if (keyFile.has_key ("White Balance", "Equal")) { - wb.equal = keyFile.get_double ("White Balance", "Equal"); - - if (pedited) { - pedited->wb.equal = true; - } - } - - if (keyFile.has_key ("White Balance", "TemperatureBias")) { - wb.tempBias = keyFile.get_double ("White Balance", "TemperatureBias"); - - if (pedited) { - pedited->wb.tempBias = true; - } - } + assignFromKeyfile(keyFile, "White Balance", "Enabled", pedited, wb.enabled, pedited->wb.enabled); + assignFromKeyfile(keyFile, "White Balance", "Setting", pedited, wb.method, pedited->wb.method); + assignFromKeyfile(keyFile, "White Balance", "Temperature", pedited, wb.temperature, pedited->wb.temperature); + assignFromKeyfile(keyFile, "White Balance", "Green", pedited, wb.green, pedited->wb.green); + assignFromKeyfile(keyFile, "White Balance", "Equal", pedited, wb.equal, pedited->wb.equal); + assignFromKeyfile(keyFile, "White Balance", "TemperatureBias", pedited, wb.tempBias, pedited->wb.tempBias); } - // load colorShift - /*if (keyFile.has_group ("Color Shift")) { - if (keyFile.has_key ("Color Shift", "ChannelA")) { colorShift.a = keyFile.get_double ("Color Shift", "ChannelA"); if (pedited) pedited->colorShift.a = true; } - if (keyFile.has_key ("Color Shift", "ChannelB")) { colorShift.b = keyFile.get_double ("Color Shift", "ChannelB"); if (pedited) pedited->colorShift.b = true; } - }*/ - - // load defringe if (keyFile.has_group ("Defringing")) { - if (keyFile.has_key ("Defringing", "Enabled")) { - defringe.enabled = keyFile.get_boolean ("Defringing", "Enabled"); - - if (pedited) { - pedited->defringe.enabled = true; - } - } - - if (keyFile.has_key ("Defringing", "Radius")) { - defringe.radius = keyFile.get_double ("Defringing", "Radius"); - - if (pedited) { - pedited->defringe.radius = true; - } - } + assignFromKeyfile(keyFile, "Defringing", "Enabled", pedited, defringe.enabled, pedited->defringe.enabled); + assignFromKeyfile(keyFile, "Defringing", "Radius", pedited, defringe.radius, pedited->defringe.radius); if (keyFile.has_key ("Defringing", "Threshold")) { defringe.threshold = (float)keyFile.get_integer ("Defringing", "Threshold"); @@ -5004,739 +3754,144 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) defringe.threshold = sqrt (defringe.threshold * 33.f / 5.f); } - if (keyFile.has_key ("Defringing", "HueCurve")) { - defringe.huecurve = keyFile.get_double_list ("Defringing", "HueCurve"); - avoidEmptyCurve (defringe.huecurve); - - if (pedited) { - pedited->defringe.huecurve = true; - } - } + assignFromKeyfile(keyFile, "Defringing", "HueCurve", pedited, defringe.huecurve, pedited->defringe.huecurve); } -// load colorappearance if (keyFile.has_group ("Color appearance")) { - if (keyFile.has_key ("Color appearance", "Enabled")) { - colorappearance.enabled = keyFile.get_boolean ("Color appearance", "Enabled"); - - if (pedited) { - pedited->colorappearance.enabled = true; - } - } - - if (keyFile.has_key ("Color appearance", "Degree")) { - colorappearance.degree = keyFile.get_integer ("Color appearance", "Degree"); - - if (pedited) { - pedited->colorappearance.degree = true; - } - } - - if (keyFile.has_key ("Color appearance", "AutoDegree")) { - colorappearance.autodegree = keyFile.get_boolean ("Color appearance", "AutoDegree"); - - if (pedited) { - pedited->colorappearance.autodegree = true; - } - } - - if (keyFile.has_key ("Color appearance", "Degreeout")) { - colorappearance.degreeout = keyFile.get_integer ("Color appearance", "Degreeout"); - - if (pedited) { - pedited->colorappearance.degreeout = true; - } - } - - if (keyFile.has_key ("Color appearance", "AutoDegreeout")) { - colorappearance.autodegreeout = keyFile.get_boolean ("Color appearance", "AutoDegreeout"); - - if (pedited) { - pedited->colorappearance.autodegreeout = true; - } - } - - if (keyFile.has_key ("Color appearance", "Surround")) { - colorappearance.surround = keyFile.get_string ("Color appearance", "Surround"); - - if (pedited) { - pedited->colorappearance.surround = true; - } - } - - if (keyFile.has_key ("Color appearance", "Surrsrc")) { - colorappearance.surrsrc = keyFile.get_string ("Color appearance", "Surrsrc"); - - if (pedited) { - pedited->colorappearance.surrsrc = true; - } - } - -// if (keyFile.has_key ("Color appearance", "Background")) {colorappearance.backgrd = keyFile.get_integer ("Color appearance", "Background"); if (pedited) pedited->colorappearance.backgrd = true; } - if (keyFile.has_key ("Color appearance", "AdaptLum")) { - colorappearance.adaplum = keyFile.get_double ("Color appearance", "AdaptLum"); - - if (pedited) { - pedited->colorappearance.adaplum = true; - } - } - - if (keyFile.has_key ("Color appearance", "Badpixsl")) { - colorappearance.badpixsl = keyFile.get_integer ("Color appearance", "Badpixsl"); - - if (pedited) { - pedited->colorappearance.badpixsl = true; - } - } - - if (keyFile.has_key ("Color appearance", "Model")) { - colorappearance.wbmodel = keyFile.get_string ("Color appearance", "Model"); - - if (pedited) { - pedited->colorappearance.wbmodel = true; - } - } - - if (keyFile.has_key ("Color appearance", "Algorithm")) { - colorappearance.algo = keyFile.get_string ("Color appearance", "Algorithm"); - - if (pedited) { - pedited->colorappearance.algo = true; - } - } - - if (keyFile.has_key ("Color appearance", "J-Light")) { - colorappearance.jlight = keyFile.get_double ("Color appearance", "J-Light"); - - if (pedited) { - pedited->colorappearance.jlight = true; - } - } - - if (keyFile.has_key ("Color appearance", "Q-Bright")) { - colorappearance.qbright = keyFile.get_double ("Color appearance", "Q-Bright"); - - if (pedited) { - pedited->colorappearance.qbright = true; - } - } - - if (keyFile.has_key ("Color appearance", "C-Chroma")) { - colorappearance.chroma = keyFile.get_double ("Color appearance", "C-Chroma"); - - if (pedited) { - pedited->colorappearance.chroma = true; - } - } - - if (keyFile.has_key ("Color appearance", "S-Chroma")) { - colorappearance.schroma = keyFile.get_double ("Color appearance", "S-Chroma"); - - if (pedited) { - pedited->colorappearance.schroma = true; - } - } - - if (keyFile.has_key ("Color appearance", "M-Chroma")) { - colorappearance.mchroma = keyFile.get_double ("Color appearance", "M-Chroma"); - - if (pedited) { - pedited->colorappearance.mchroma = true; - } - } - - if (keyFile.has_key ("Color appearance", "RSTProtection")) { - colorappearance.rstprotection = keyFile.get_double ("Color appearance", "RSTProtection"); - - if (pedited) { - pedited->colorappearance.rstprotection = true; - } - } - - if (keyFile.has_key ("Color appearance", "J-Contrast")) { - colorappearance.contrast = keyFile.get_double ("Color appearance", "J-Contrast"); - - if (pedited) { - pedited->colorappearance.contrast = true; - } - } - - if (keyFile.has_key ("Color appearance", "Q-Contrast")) { - colorappearance.qcontrast = keyFile.get_double ("Color appearance", "Q-Contrast"); - - if (pedited) { - pedited->colorappearance.qcontrast = true; - } - } - - if (keyFile.has_key ("Color appearance", "H-Hue")) { - colorappearance.colorh = keyFile.get_double ("Color appearance", "H-Hue"); - - if (pedited) { - pedited->colorappearance.colorh = true; - } - } - - if (keyFile.has_key ("Color appearance", "AdaptScene")) { - colorappearance.adapscen = keyFile.get_double ("Color appearance", "AdaptScene"); - - if (pedited) { - pedited->colorappearance.adapscen = true; - } - } - - if (keyFile.has_key ("Color appearance", "AutoAdapscen")) { - colorappearance.autoadapscen = keyFile.get_boolean ("Color appearance", "AutoAdapscen"); - - if (pedited) { - pedited->colorappearance.autoadapscen = true; - } - } - - if (keyFile.has_key ("Color appearance", "YbScene")) { - colorappearance.ybscen = keyFile.get_integer ("Color appearance", "YbScene"); - - if (pedited) { - pedited->colorappearance.ybscen = true; - } - } - - if (keyFile.has_key ("Color appearance", "Autoybscen")) { - colorappearance.autoybscen = keyFile.get_boolean ("Color appearance", "Autoybscen"); - - if (pedited) { - pedited->colorappearance.autoybscen = true; - } - } - - if (keyFile.has_key ("Color appearance", "SurrSource")) { - colorappearance.surrsource = keyFile.get_boolean ("Color appearance", "SurrSource"); - - if (pedited) { - pedited->colorappearance.surrsource = true; - } - } - - if (keyFile.has_key ("Color appearance", "Gamut")) { - colorappearance.gamut = keyFile.get_boolean ("Color appearance", "Gamut"); - - if (pedited) { - pedited->colorappearance.gamut = true; - } - } - - if (keyFile.has_key ("Color appearance", "Tempout")) { - colorappearance.tempout = keyFile.get_integer ("Color appearance", "Tempout"); - - if (pedited) { - pedited->colorappearance.tempout = true; - } - } - - if (keyFile.has_key ("Color appearance", "Greenout")) { - colorappearance.greenout = keyFile.get_double ("Color appearance", "Greenout"); - - if (pedited) { - pedited->colorappearance.greenout = true; - } - } - - if (keyFile.has_key ("Color appearance", "Tempsc")) { - colorappearance.tempsc = keyFile.get_integer ("Color appearance", "Tempsc"); - - if (pedited) { - pedited->colorappearance.tempsc = true; - } - } - - if (keyFile.has_key ("Color appearance", "Greensc")) { - colorappearance.greensc = keyFile.get_double ("Color appearance", "Greensc"); - - if (pedited) { - pedited->colorappearance.greensc = true; - } - } - - if (keyFile.has_key ("Color appearance", "Ybout")) { - colorappearance.ybout = keyFile.get_integer ("Color appearance", "Ybout"); - - if (pedited) { - pedited->colorappearance.ybout = true; - } - } - -// if (keyFile.has_key ("Color appearance", "Badpix")) {colorappearance.badpix = keyFile.get_boolean ("Color appearance", "Badpix"); if (pedited) pedited->colorappearance.badpix = true; } - if (keyFile.has_key ("Color appearance", "Datacie")) { - colorappearance.datacie = keyFile.get_boolean ("Color appearance", "Datacie"); - - if (pedited) { - pedited->colorappearance.datacie = true; - } - } - - if (keyFile.has_key ("Color appearance", "Tonecie")) { - colorappearance.tonecie = keyFile.get_boolean ("Color appearance", "Tonecie"); - - if (pedited) { - pedited->colorappearance.tonecie = true; - } - } - -// if (keyFile.has_key ("Color appearance", "Sharpcie")) {colorappearance.sharpcie = keyFile.get_boolean ("Color appearance", "Sharpcie"); if (pedited) pedited->colorappearance.sharpcie = true; } - if (keyFile.has_key ("Color appearance", "CurveMode")) { - Glib::ustring sMode = keyFile.get_string ("Color appearance", "CurveMode"); - - if (sMode == "Lightness") { - colorappearance.curveMode = ColorAppearanceParams::TC_MODE_LIGHT; - } else if (sMode == "Brightness") { - colorappearance.curveMode = ColorAppearanceParams::TC_MODE_BRIGHT; - } - - if (pedited) { - pedited->colorappearance.curveMode = true; - } - } - - if (keyFile.has_key ("Color appearance", "CurveMode2")) { - Glib::ustring sMode = keyFile.get_string ("Color appearance", "CurveMode2"); - - if (sMode == "Lightness") { - colorappearance.curveMode2 = ColorAppearanceParams::TC_MODE_LIGHT; - } else if (sMode == "Brightness") { - colorappearance.curveMode2 = ColorAppearanceParams::TC_MODE_BRIGHT; - } - - if (pedited) { - pedited->colorappearance.curveMode2 = true; - } - } - - if (keyFile.has_key ("Color appearance", "CurveMode3")) { - Glib::ustring sMode = keyFile.get_string ("Color appearance", "CurveMode3"); - - if (sMode == "Chroma") { - colorappearance.curveMode3 = ColorAppearanceParams::TC_MODE_CHROMA; - } else if (sMode == "Saturation") { - colorappearance.curveMode3 = ColorAppearanceParams::TC_MODE_SATUR; - } else if (sMode == "Colorfullness") { - colorappearance.curveMode3 = ColorAppearanceParams::TC_MODE_COLORF; - } - - if (pedited) { - pedited->colorappearance.curveMode3 = true; - } - } + assignFromKeyfile(keyFile, "Color appearance", "Enabled", pedited, colorappearance.enabled, pedited->colorappearance.enabled); + assignFromKeyfile(keyFile, "Color appearance", "Degree", pedited, colorappearance.degree, pedited->colorappearance.degree); + assignFromKeyfile(keyFile, "Color appearance", "AutoDegree", pedited, colorappearance.autodegree, pedited->colorappearance.autodegree); + assignFromKeyfile(keyFile, "Color appearance", "Degreeout", pedited, colorappearance.degreeout, pedited->colorappearance.degreeout); + + assignFromKeyfile(keyFile, "Color appearance", "AutoDegreeout", pedited, colorappearance.autodegreeout, pedited->colorappearance.autodegreeout); + + assignFromKeyfile(keyFile, "Color appearance", "Surround", pedited, colorappearance.surround, pedited->colorappearance.surround); + assignFromKeyfile(keyFile, "Color appearance", "Surrsrc", pedited, colorappearance.surrsrc, pedited->colorappearance.surrsrc); + assignFromKeyfile(keyFile, "Color appearance", "AdaptLum", pedited, colorappearance.adaplum, pedited->colorappearance.adaplum); + assignFromKeyfile(keyFile, "Color appearance", "Badpixsl", pedited, colorappearance.badpixsl, pedited->colorappearance.badpixsl); + assignFromKeyfile(keyFile, "Color appearance", "Model", pedited, colorappearance.wbmodel, pedited->colorappearance.wbmodel); + assignFromKeyfile(keyFile, "Color appearance", "Algorithm", pedited, colorappearance.algo, pedited->colorappearance.algo); + assignFromKeyfile(keyFile, "Color appearance", "J-Light", pedited, colorappearance.jlight, pedited->colorappearance.jlight); + assignFromKeyfile(keyFile, "Color appearance", "Q-Bright", pedited, colorappearance.qbright, pedited->colorappearance.qbright); + assignFromKeyfile(keyFile, "Color appearance", "C-Chroma", pedited, colorappearance.chroma, pedited->colorappearance.chroma); + assignFromKeyfile(keyFile, "Color appearance", "S-Chroma", pedited, colorappearance.schroma, pedited->colorappearance.schroma); + assignFromKeyfile(keyFile, "Color appearance", "M-Chroma", pedited, colorappearance.mchroma, pedited->colorappearance.mchroma); + assignFromKeyfile(keyFile, "Color appearance", "RSTProtection", pedited, colorappearance.rstprotection, pedited->colorappearance.rstprotection); + assignFromKeyfile(keyFile, "Color appearance", "J-Contrast", pedited, colorappearance.contrast, pedited->colorappearance.contrast); + assignFromKeyfile(keyFile, "Color appearance", "Q-Contrast", pedited, colorappearance.qcontrast, pedited->colorappearance.qcontrast); + assignFromKeyfile(keyFile, "Color appearance", "H-Hue", pedited, colorappearance.colorh, pedited->colorappearance.colorh); + assignFromKeyfile(keyFile, "Color appearance", "AdaptScene", pedited, colorappearance.adapscen, pedited->colorappearance.adapscen); + assignFromKeyfile(keyFile, "Color appearance", "AutoAdapscen", pedited, colorappearance.autoadapscen, pedited->colorappearance.autoadapscen); + assignFromKeyfile(keyFile, "Color appearance", "YbScene", pedited, colorappearance.ybscen, pedited->colorappearance.ybscen); + assignFromKeyfile(keyFile, "Color appearance", "Autoybscen", pedited, colorappearance.autoybscen, pedited->colorappearance.autoybscen); + assignFromKeyfile(keyFile, "Color appearance", "SurrSource", pedited, colorappearance.surrsource, pedited->colorappearance.surrsource); + assignFromKeyfile(keyFile, "Color appearance", "Gamut", pedited, colorappearance.gamut, pedited->colorappearance.gamut); + assignFromKeyfile(keyFile, "Color appearance", "Tempout", pedited, colorappearance.tempout, pedited->colorappearance.tempout); + assignFromKeyfile(keyFile, "Color appearance", "Greenout", pedited, colorappearance.greenout, pedited->colorappearance.greenout); + assignFromKeyfile(keyFile, "Color appearance", "Tempsc", pedited, colorappearance.tempsc, pedited->colorappearance.tempsc); + assignFromKeyfile(keyFile, "Color appearance", "Greensc", pedited, colorappearance.greensc, pedited->colorappearance.greensc); + assignFromKeyfile(keyFile, "Color appearance", "Ybout", pedited, colorappearance.ybout, pedited->colorappearance.ybout); + assignFromKeyfile(keyFile, "Color appearance", "Datacie", pedited, colorappearance.datacie, pedited->colorappearance.datacie); + assignFromKeyfile(keyFile, "Color appearance", "Tonecie", pedited, colorappearance.tonecie, pedited->colorappearance.tonecie); + + const std::map tc_mapping = { + {"Lightness", ColorAppearanceParams::TcMode::LIGHT}, + {"Brightness", ColorAppearanceParams::TcMode::BRIGHT} + }; + assignFromKeyfile(keyFile, "Color appearance", "CurveMode", pedited, tc_mapping, colorappearance.curveMode, pedited->colorappearance.curveMode); + assignFromKeyfile(keyFile, "Color appearance", "CurveMode2", pedited, tc_mapping, colorappearance.curveMode2, pedited->colorappearance.curveMode2); + + assignFromKeyfile( + keyFile, + "Color appearance", + "CurveMode3", + pedited, + { + {"Chroma", ColorAppearanceParams::CtcMode::CHROMA}, + {"Saturation", ColorAppearanceParams::CtcMode::SATUR}, + {"Colorfullness", ColorAppearanceParams::CtcMode::COLORF} + }, + colorappearance.curveMode3, + pedited->colorappearance.curveMode3 + ); if (ppVersion > 200) { - if (keyFile.has_key ("Color appearance", "Curve")) { - colorappearance.curve = keyFile.get_double_list ("Color appearance", "Curve"); - avoidEmptyCurve (colorappearance.curve); - - if (pedited) { - pedited->colorappearance.curve = true; - } - } - - if (keyFile.has_key ("Color appearance", "Curve2")) { - colorappearance.curve2 = keyFile.get_double_list ("Color appearance", "Curve2"); - avoidEmptyCurve (colorappearance.curve2); - - if (pedited) { - pedited->colorappearance.curve2 = true; - } - } - - if (keyFile.has_key ("Color appearance", "Curve3")) { - colorappearance.curve3 = keyFile.get_double_list ("Color appearance", "Curve3"); - avoidEmptyCurve (colorappearance.curve3); - - if (pedited) { - pedited->colorappearance.curve3 = true; - } - } + assignFromKeyfile(keyFile, "Color appearance", "Curve", pedited, colorappearance.curve, pedited->colorappearance.curve); + assignFromKeyfile(keyFile, "Color appearance", "Curve2", pedited, colorappearance.curve2, pedited->colorappearance.curve2); + assignFromKeyfile(keyFile, "Color appearance", "Curve3", pedited, colorappearance.curve3, pedited->colorappearance.curve3); } } -// load impulseDenoise if (keyFile.has_group ("Impulse Denoising")) { - if (keyFile.has_key ("Impulse Denoising", "Enabled")) { - impulseDenoise.enabled = keyFile.get_boolean ("Impulse Denoising", "Enabled"); - - if (pedited) { - pedited->impulseDenoise.enabled = true; - } - } - - if (keyFile.has_key ("Impulse Denoising", "Threshold")) { - impulseDenoise.thresh = keyFile.get_integer ("Impulse Denoising", "Threshold"); - - if (pedited) { - pedited->impulseDenoise.thresh = true; - } - } + assignFromKeyfile(keyFile, "Impulse Denoising", "Enabled", pedited, impulseDenoise.enabled, pedited->impulseDenoise.enabled); + assignFromKeyfile(keyFile, "Impulse Denoising", "Threshold", pedited, impulseDenoise.thresh, pedited->impulseDenoise.thresh); } -// load dirpyrDenoise if (keyFile.has_group ("Directional Pyramid Denoising")) {//TODO: No longer an accurate description for FT denoise - if (keyFile.has_key ("Directional Pyramid Denoising", "Enabled")) { - dirpyrDenoise.enabled = keyFile.get_boolean ("Directional Pyramid Denoising", "Enabled"); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Enabled", pedited, dirpyrDenoise.enabled, pedited->dirpyrDenoise.enabled); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Enhance", pedited, dirpyrDenoise.enhance, pedited->dirpyrDenoise.enhance); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Median", pedited, dirpyrDenoise.median, pedited->dirpyrDenoise.median); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Luma", pedited, dirpyrDenoise.luma, pedited->dirpyrDenoise.luma); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Ldetail", pedited, dirpyrDenoise.Ldetail, pedited->dirpyrDenoise.Ldetail); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Chroma", pedited, dirpyrDenoise.chroma, pedited->dirpyrDenoise.chroma); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Method", pedited, dirpyrDenoise.dmethod, pedited->dirpyrDenoise.dmethod); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "LMethod", pedited, dirpyrDenoise.Lmethod, pedited->dirpyrDenoise.Lmethod); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "CMethod", pedited, dirpyrDenoise.Cmethod, pedited->dirpyrDenoise.Cmethod); - if (pedited) { - pedited->dirpyrDenoise.enabled = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "Enhance")) { - dirpyrDenoise.enhance = keyFile.get_boolean ("Directional Pyramid Denoising", "Enhance"); - - if (pedited) { - pedited->dirpyrDenoise.enhance = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "Median")) { - dirpyrDenoise.median = keyFile.get_boolean ("Directional Pyramid Denoising", "Median"); - - if (pedited) { - pedited->dirpyrDenoise.median = true; - } - } - -// if (keyFile.has_key ("Directional Pyramid Denoising", "Perform")) { dirpyrDenoise.perform = keyFile.get_boolean ("Directional Pyramid Denoising", "Perform"); if (pedited) pedited->dirpyrDenoise.perform = true; } - if (keyFile.has_key ("Directional Pyramid Denoising", "Luma")) { - dirpyrDenoise.luma = keyFile.get_double ("Directional Pyramid Denoising", "Luma"); - - if (pedited) { - pedited->dirpyrDenoise.luma = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "Ldetail")) { - dirpyrDenoise.Ldetail = keyFile.get_double ("Directional Pyramid Denoising", "Ldetail"); - - if (pedited) { - pedited->dirpyrDenoise.Ldetail = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "Chroma")) { - dirpyrDenoise.chroma = keyFile.get_double ("Directional Pyramid Denoising", "Chroma"); - - if (pedited) { - pedited->dirpyrDenoise.chroma = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "Method")) { - dirpyrDenoise.dmethod = keyFile.get_string ("Directional Pyramid Denoising", "Method"); - - if (pedited) { - pedited->dirpyrDenoise.dmethod = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "LMethod")) { - dirpyrDenoise.Lmethod = keyFile.get_string ("Directional Pyramid Denoising", "LMethod"); - - if (pedited) { - pedited->dirpyrDenoise.Lmethod = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "CMethod")) { - dirpyrDenoise.Cmethod = keyFile.get_string ("Directional Pyramid Denoising", "CMethod"); - - if (pedited) { - pedited->dirpyrDenoise.Cmethod = true; - } - } - -// never load 'auto chroma preview mode' from pp3 if (dirpyrDenoise.Cmethod == "PRE") { - dirpyrDenoise.Cmethod = "MAN"; - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "C2Method")) { - dirpyrDenoise.C2method = keyFile.get_string ("Directional Pyramid Denoising", "C2Method"); - - if (pedited) { - pedited->dirpyrDenoise.C2method = true; - } + dirpyrDenoise.Cmethod = "MAN"; // Never load 'auto chroma preview mode' from pp3 } + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "C2Method", pedited, dirpyrDenoise.C2method, pedited->dirpyrDenoise.C2method); if (dirpyrDenoise.C2method == "PREV") { dirpyrDenoise.C2method = "MANU"; } - if (keyFile.has_key ("Directional Pyramid Denoising", "SMethod")) { - dirpyrDenoise.smethod = keyFile.get_string ("Directional Pyramid Denoising", "SMethod"); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "SMethod", pedited, dirpyrDenoise.smethod, pedited->dirpyrDenoise.smethod); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "MedMethod", pedited, dirpyrDenoise.medmethod, pedited->dirpyrDenoise.medmethod); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "MethodMed", pedited, dirpyrDenoise.methodmed, pedited->dirpyrDenoise.methodmed); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "RGBMethod", pedited, dirpyrDenoise.rgbmethod, pedited->dirpyrDenoise.rgbmethod); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "LCurve", pedited, dirpyrDenoise.lcurve, pedited->dirpyrDenoise.lcurve); - if (pedited) { - pedited->dirpyrDenoise.smethod = true; - } - } + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "CCCurve", pedited, dirpyrDenoise.cccurve, pedited->dirpyrDenoise.cccurve); - if (keyFile.has_key ("Directional Pyramid Denoising", "MedMethod")) { - dirpyrDenoise.medmethod = keyFile.get_string ("Directional Pyramid Denoising", "MedMethod"); - - if (pedited) { - pedited->dirpyrDenoise.medmethod = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "MethodMed")) { - dirpyrDenoise.methodmed = keyFile.get_string ("Directional Pyramid Denoising", "MethodMed"); - - if (pedited) { - pedited->dirpyrDenoise.methodmed = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "RGBMethod")) { - dirpyrDenoise.rgbmethod = keyFile.get_string ("Directional Pyramid Denoising", "RGBMethod"); - - if (pedited) { - pedited->dirpyrDenoise.rgbmethod = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "LCurve")) { - dirpyrDenoise.lcurve = keyFile.get_double_list ("Directional Pyramid Denoising", "LCurve"); - avoidEmptyCurve (dirpyrDenoise.lcurve); - - if (pedited) { - pedited->dirpyrDenoise.lcurve = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "CCCurve")) { - dirpyrDenoise.cccurve = keyFile.get_double_list ("Directional Pyramid Denoising", "CCCurve"); - avoidEmptyCurve (dirpyrDenoise.cccurve); - - if (pedited) { - pedited->dirpyrDenoise.cccurve = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "Redchro")) { - dirpyrDenoise.redchro = keyFile.get_double ("Directional Pyramid Denoising", "Redchro"); - - if (pedited) { - pedited->dirpyrDenoise.redchro = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "Bluechro")) { - dirpyrDenoise.bluechro = keyFile.get_double ("Directional Pyramid Denoising", "Bluechro"); - - if (pedited) { - pedited->dirpyrDenoise.bluechro = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "Gamma")) { - dirpyrDenoise.gamma = keyFile.get_double ("Directional Pyramid Denoising", "Gamma"); - - if (pedited) { - pedited->dirpyrDenoise.gamma = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Denoising", "Passes")) { - dirpyrDenoise.passes = keyFile.get_integer ("Directional Pyramid Denoising", "Passes"); - - if (pedited) { - pedited->dirpyrDenoise.passes = true; - } - } + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Redchro", pedited, dirpyrDenoise.redchro, pedited->dirpyrDenoise.redchro); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Bluechro", pedited, dirpyrDenoise.bluechro, pedited->dirpyrDenoise.bluechro); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Gamma", pedited, dirpyrDenoise.gamma, pedited->dirpyrDenoise.gamma); + assignFromKeyfile(keyFile, "Directional Pyramid Denoising", "Passes", pedited, dirpyrDenoise.passes, pedited->dirpyrDenoise.passes); } -//Load EPD. if (keyFile.has_group ("EPD")) { - if (keyFile.has_key ("EPD", "Enabled")) { - epd.enabled = keyFile.get_boolean ("EPD", "Enabled"); - - if (pedited) { - pedited->epd.enabled = true; - } - } - - if (keyFile.has_key ("EPD", "Strength")) { - epd.strength = keyFile.get_double ("EPD", "Strength"); - - if (pedited) { - pedited->epd.strength = true; - } - } - - if (keyFile.has_key ("EPD", "Gamma")) { - epd.gamma = keyFile.get_double ("EPD", "Gamma"); - - if (pedited) { - pedited->epd.gamma = true; - } - } - - if (keyFile.has_key ("EPD", "EdgeStopping")) { - epd.edgeStopping = keyFile.get_double ("EPD", "EdgeStopping"); - - if (pedited) { - pedited->epd.edgeStopping = true; - } - } - - if (keyFile.has_key ("EPD", "Scale")) { - epd.scale = keyFile.get_double ("EPD", "Scale"); - - if (pedited) { - pedited->epd.scale = true; - } - } - - if (keyFile.has_key ("EPD", "ReweightingIterates")) { - epd.reweightingIterates = keyFile.get_integer ("EPD", "ReweightingIterates"); - - if (pedited) { - pedited->epd.reweightingIterates = true; - } - } + assignFromKeyfile(keyFile, "EPD", "Enabled", pedited, epd.enabled, pedited->epd.enabled); + assignFromKeyfile(keyFile, "EPD", "Strength", pedited, epd.strength, pedited->epd.strength); + assignFromKeyfile(keyFile, "EPD", "Gamma", pedited, epd.gamma, pedited->epd.gamma); + assignFromKeyfile(keyFile, "EPD", "EdgeStopping", pedited, epd.edgeStopping, pedited->epd.edgeStopping); + assignFromKeyfile(keyFile, "EPD", "Scale", pedited, epd.scale, pedited->epd.scale); + assignFromKeyfile(keyFile, "EPD", "ReweightingIterates", pedited, epd.reweightingIterates, pedited->epd.reweightingIterates); } -//Load FattalToneMapping if (keyFile.has_group ("FattalToneMapping")) { - if (keyFile.has_key ("FattalToneMapping", "Enabled")) { - fattal.enabled = keyFile.get_boolean ("FattalToneMapping", "Enabled"); - - if (pedited) { - pedited->fattal.enabled = true; - } - } - - if (keyFile.has_key ("FattalToneMapping", "Threshold")) { - fattal.threshold = keyFile.get_double ("FattalToneMapping", "Threshold"); - - if (pedited) { - pedited->fattal.threshold = true; - } - } - - if (keyFile.has_key ("FattalToneMapping", "Amount")) { - fattal.amount = keyFile.get_double ("FattalToneMapping", "Amount"); - - if (pedited) { - pedited->fattal.amount = true; - } - } - } - - // load lumaDenoise - /*if (keyFile.has_group ("Luminance Denoising")) { - if (keyFile.has_key ("Luminance Denoising", "Enabled")) { lumaDenoise.enabled = keyFile.get_boolean ("Luminance Denoising", "Enabled"); if (pedited) pedited->lumaDenoise.enabled = true; } - if (keyFile.has_key ("Luminance Denoising", "Radius")) { lumaDenoise.radius = keyFile.get_double ("Luminance Denoising", "Radius"); if (pedited) pedited->lumaDenoise.radius = true; } - if (keyFile.has_key ("Luminance Denoising", "EdgeTolerance")) { lumaDenoise.edgetolerance = keyFile.get_integer ("Luminance Denoising", "EdgeTolerance"); if (pedited) pedited->lumaDenoise.edgetolerance = true; } - }*/ - - // load colorDenoise - /*if (keyFile.has_group ("Chrominance Denoising")) { - if (keyFile.has_key ("Chrominance Denoising", "Enabled")) { colorDenoise.enabled = keyFile.get_boolean ("Chrominance Denoising", "Enabled"); if (pedited) pedited->colorDenoise.enabled = true; } - // WARNING: radius doesn't exist anymore; is there any compatibility issue that require to keep the following line? - if (keyFile.has_key ("Chrominance Denoising", "Radius")) { colorDenoise.amount = 10*keyFile.get_double ("Chrominance Denoising", "Radius"); } - if (keyFile.has_key ("Chrominance Denoising", "Amount")) { colorDenoise.amount = keyFile.get_integer ("Chrominance Denoising", "Amount"); if (pedited) pedited->colorDenoise.amount = true; } - }*/ - - // load sh - if (keyFile.has_group ("Shadows & Highlights")) { - if (keyFile.has_key ("Shadows & Highlights", "Enabled")) { - sh.enabled = keyFile.get_boolean ("Shadows & Highlights", "Enabled"); - - if (pedited) { - pedited->sh.enabled = true; - } - } - - if (keyFile.has_key ("Shadows & Highlights", "HighQuality")) { - sh.hq = keyFile.get_boolean ("Shadows & Highlights", "HighQuality"); - - if (pedited) { - pedited->sh.hq = true; - } - } - - if (keyFile.has_key ("Shadows & Highlights", "Highlights")) { - sh.highlights = keyFile.get_integer ("Shadows & Highlights", "Highlights"); - - if (pedited) { - pedited->sh.highlights = true; - } - } - - if (keyFile.has_key ("Shadows & Highlights", "HighlightTonalWidth")) { - sh.htonalwidth = keyFile.get_integer ("Shadows & Highlights", "HighlightTonalWidth"); - - if (pedited) { - pedited->sh.htonalwidth = true; - } - } - - if (keyFile.has_key ("Shadows & Highlights", "Shadows")) { - sh.shadows = keyFile.get_integer ("Shadows & Highlights", "Shadows"); - - if (pedited) { - pedited->sh.shadows = true; - } - } - - if (keyFile.has_key ("Shadows & Highlights", "ShadowTonalWidth")) { - sh.stonalwidth = keyFile.get_integer ("Shadows & Highlights", "ShadowTonalWidth"); - - if (pedited) { - pedited->sh.stonalwidth = true; - } - } - - if (keyFile.has_key ("Shadows & Highlights", "LocalContrast")) { - sh.localcontrast = keyFile.get_integer ("Shadows & Highlights", "LocalContrast"); - - if (pedited) { - pedited->sh.localcontrast = true; - } - } - - if (keyFile.has_key ("Shadows & Highlights", "Radius")) { - sh.radius = keyFile.get_integer ("Shadows & Highlights", "Radius"); - - if (pedited) { - pedited->sh.radius = true; - } - } + assignFromKeyfile(keyFile, "FattalToneMapping", "Enabled", pedited, fattal.enabled, pedited->fattal.enabled); + assignFromKeyfile(keyFile, "FattalToneMapping", "Threshold", pedited, fattal.threshold, pedited->fattal.threshold); + assignFromKeyfile(keyFile, "FattalToneMapping", "Amount", pedited, fattal.amount, pedited->fattal.amount); + } + + if (keyFile.has_group ("Shadows & Highlights")) { + assignFromKeyfile(keyFile, "Shadows & Highlights", "Enabled", pedited, sh.enabled, pedited->sh.enabled); + assignFromKeyfile(keyFile, "Shadows & Highlights", "HighQuality", pedited, sh.hq, pedited->sh.hq); + assignFromKeyfile(keyFile, "Shadows & Highlights", "Highlights", pedited, sh.highlights, pedited->sh.highlights); + assignFromKeyfile(keyFile, "Shadows & Highlights", "HighlightTonalWidth", pedited, sh.htonalwidth, pedited->sh.htonalwidth); + assignFromKeyfile(keyFile, "Shadows & Highlights", "Shadows", pedited, sh.shadows, pedited->sh.shadows); + assignFromKeyfile(keyFile, "Shadows & Highlights", "ShadowTonalWidth", pedited, sh.stonalwidth, pedited->sh.stonalwidth); + assignFromKeyfile(keyFile, "Shadows & Highlights", "LocalContrast", pedited, sh.localcontrast, pedited->sh.localcontrast); + assignFromKeyfile(keyFile, "Shadows & Highlights", "Radius", pedited, sh.radius, pedited->sh.radius); } -// load crop if (keyFile.has_group ("Crop")) { - if (keyFile.has_key ("Crop", "Enabled")) { - crop.enabled = keyFile.get_boolean ("Crop", "Enabled"); - - if (pedited) { - pedited->crop.enabled = true; - } - } - - if (keyFile.has_key ("Crop", "X")) { - crop.x = keyFile.get_integer ("Crop", "X"); - - if (pedited) { - pedited->crop.x = true; - } - } - - if (keyFile.has_key ("Crop", "Y")) { - crop.y = keyFile.get_integer ("Crop", "Y"); - - if (pedited) { - pedited->crop.y = true; - } - } + assignFromKeyfile(keyFile, "Crop", "Enabled", pedited, crop.enabled, pedited->crop.enabled); + assignFromKeyfile(keyFile, "Crop", "X", pedited, crop.x, pedited->crop.x); + assignFromKeyfile(keyFile, "Crop", "Y", pedited, crop.y, pedited->crop.y); if (keyFile.has_key ("Crop", "W")) { crop.w = std::max (keyFile.get_integer ("Crop", "W"), 1); @@ -5754,22 +3909,10 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Crop", "FixedRatio")) { - crop.fixratio = keyFile.get_boolean ("Crop", "FixedRatio"); + assignFromKeyfile(keyFile, "Crop", "FixedRatio", pedited, crop.fixratio, pedited->crop.fixratio); - if (pedited) { - pedited->crop.fixratio = true; - } - } - - if (keyFile.has_key ("Crop", "Ratio")) { - crop.ratio = keyFile.get_string ("Crop", "Ratio"); - - if (pedited) { - pedited->crop.ratio = true; - } - -//backwards compatibility for crop.ratio + if (assignFromKeyfile(keyFile, "Crop", "Ratio", pedited, crop.ratio, pedited->crop.ratio)) { + //backwards compatibility for crop.ratio if (crop.ratio == "DIN") { crop.ratio = "1.414 - DIN EN ISO 216"; } @@ -5782,85 +3925,28 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) crop.ratio = "11:17 - Tabloid"; } } - - if (keyFile.has_key ("Crop", "Orientation")) { - crop.orientation = keyFile.get_string ("Crop", "Orientation"); - - if (pedited) { - pedited->crop.orientation = true; - } - } - - if (keyFile.has_key ("Crop", "Guide")) { - crop.guide = keyFile.get_string ("Crop", "Guide"); - - if (pedited) { - pedited->crop.guide = true; - } - } + assignFromKeyfile(keyFile, "Crop", "Orientation", pedited, crop.orientation, pedited->crop.orientation); + assignFromKeyfile(keyFile, "Crop", "Guide", pedited, crop.guide, pedited->crop.guide); } -// load coarse if (keyFile.has_group ("Coarse Transformation")) { - if (keyFile.has_key ("Coarse Transformation", "Rotate")) { - coarse.rotate = keyFile.get_integer ("Coarse Transformation", "Rotate"); - - if (pedited) { - pedited->coarse.rotate = true; - } - } - - if (keyFile.has_key ("Coarse Transformation", "HorizontalFlip")) { - coarse.hflip = keyFile.get_boolean ("Coarse Transformation", "HorizontalFlip"); - - if (pedited) { - pedited->coarse.hflip = true; - } - } - - if (keyFile.has_key ("Coarse Transformation", "VerticalFlip")) { - coarse.vflip = keyFile.get_boolean ("Coarse Transformation", "VerticalFlip"); - - if (pedited) { - pedited->coarse.vflip = true; - } - } + assignFromKeyfile(keyFile, "Coarse Transformation", "Rotate", pedited, coarse.rotate, pedited->coarse.rotate); + assignFromKeyfile(keyFile, "Coarse Transformation", "HorizontalFlip", pedited, coarse.hflip, pedited->coarse.hflip); + assignFromKeyfile(keyFile, "Coarse Transformation", "VerticalFlip", pedited, coarse.vflip, pedited->coarse.vflip); } -// load rotate if (keyFile.has_group ("Rotation")) { - if (keyFile.has_key ("Rotation", "Degree")) { - rotate.degree = keyFile.get_double ("Rotation", "Degree"); - - if (pedited) { - pedited->rotate.degree = true; - } - } + assignFromKeyfile(keyFile, "Rotation", "Degree", pedited, rotate.degree, pedited->rotate.degree); } -// load commonTrans if (keyFile.has_group ("Common Properties for Transformations")) { - if (keyFile.has_key ("Common Properties for Transformations", "AutoFill")) { - commonTrans.autofill = keyFile.get_boolean ("Common Properties for Transformations", "AutoFill"); - - if (pedited) { - pedited->commonTrans.autofill = true; - } - } + assignFromKeyfile(keyFile, "Common Properties for Transformations", "AutoFill", pedited, commonTrans.autofill, pedited->commonTrans.autofill); } -// load distortion if (keyFile.has_group ("Distortion")) { - if (keyFile.has_key ("Distortion", "Amount")) { - distortion.amount = keyFile.get_double ("Distortion", "Amount"); - - if (pedited) { - pedited->distortion.amount = true; - } - } + assignFromKeyfile(keyFile, "Distortion", "Amount", pedited, distortion.amount, pedited->distortion.amount); } -// lens profile if (keyFile.has_group ("LensProfile")) { if (keyFile.has_key ("LensProfile", "LcMode")) { lensProf.lcMode = lensProf.getMethodNumber (keyFile.get_string ("LensProfile", "LcMode")); @@ -5877,34 +3963,14 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) pedited->lensProf.lcpFile = true; } - if(ppVersion < 327 && !lensProf.lcpFile.empty()) { + if (ppVersion < 327 && !lensProf.lcpFile.empty()) { lensProf.lcMode = LensProfParams::LcMode::LCP; } } - if (keyFile.has_key ("LensProfile", "UseDistortion")) { - lensProf.useDist = keyFile.get_boolean ("LensProfile", "UseDistortion"); - - if (pedited) { - pedited->lensProf.useDist = true; - } - } - - if (keyFile.has_key ("LensProfile", "UseVignette")) { - lensProf.useVign = keyFile.get_boolean ("LensProfile", "UseVignette"); - - if (pedited) { - pedited->lensProf.useVign = true; - } - } - - if (keyFile.has_key ("LensProfile", "UseCA")) { - lensProf.useCA = keyFile.get_boolean ("LensProfile", "UseCA"); - - if (pedited) { - pedited->lensProf.useCA = true; - } - } + assignFromKeyfile(keyFile, "LensProfile", "UseDistortion", pedited, lensProf.useDist, pedited->lensProf.useDist); + assignFromKeyfile(keyFile, "LensProfile", "UseVignette", pedited, lensProf.useVign, pedited->lensProf.useVign); + assignFromKeyfile(keyFile, "LensProfile", "UseCA", pedited, lensProf.useCA, pedited->lensProf.useCA); if (keyFile.has_key("LensProfile", "LFCameraMake")) { lensProf.lfCameraMake = keyFile.get_string("LensProfile", "LFCameraMake"); @@ -5928,256 +3994,54 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } -// load perspective correction if (keyFile.has_group ("Perspective")) { - if (keyFile.has_key ("Perspective", "Horizontal")) { - perspective.horizontal = keyFile.get_double ("Perspective", "Horizontal"); - - if (pedited) { - pedited->perspective.horizontal = true; - } - } - - if (keyFile.has_key ("Perspective", "Vertical")) { - perspective.vertical = keyFile.get_double ("Perspective", "Vertical"); - - if (pedited) { - pedited->perspective.vertical = true; - } - } + assignFromKeyfile(keyFile, "Perspective", "Horizontal", pedited, perspective.horizontal, pedited->perspective.horizontal); + assignFromKeyfile(keyFile, "Perspective", "Vertical", pedited, perspective.vertical, pedited->perspective.vertical); } -// load gradient if (keyFile.has_group ("Gradient")) { - if (keyFile.has_key ("Gradient", "Enabled")) { - gradient.enabled = keyFile.get_boolean ("Gradient", "Enabled"); - - if (pedited) { - pedited->gradient.enabled = true; - } - } - - if (keyFile.has_key ("Gradient", "Degree")) { - gradient.degree = keyFile.get_double ("Gradient", "Degree"); - - if (pedited) { - pedited->gradient.degree = true; - } - } - - if (keyFile.has_key ("Gradient", "Feather")) { - gradient.feather = keyFile.get_integer ("Gradient", "Feather"); - - if (pedited) { - pedited->gradient.feather = true; - } - } - - if (keyFile.has_key ("Gradient", "Strength")) { - gradient.strength = keyFile.get_double ("Gradient", "Strength"); - - if (pedited) { - pedited->gradient.strength = true; - } - } - - if (keyFile.has_key ("Gradient", "CenterX")) { - gradient.centerX = keyFile.get_integer ("Gradient", "CenterX"); - - if (pedited) { - pedited->gradient.centerX = true; - } - } - - if (keyFile.has_key ("Gradient", "CenterY")) { - gradient.centerY = keyFile.get_integer ("Gradient", "CenterY"); - - if (pedited) { - pedited->gradient.centerY = true; - } - } + assignFromKeyfile(keyFile, "Gradient", "Enabled", pedited, gradient.enabled, pedited->gradient.enabled); + assignFromKeyfile(keyFile, "Gradient", "Degree", pedited, gradient.degree, pedited->gradient.degree); + assignFromKeyfile(keyFile, "Gradient", "Feather", pedited, gradient.feather, pedited->gradient.feather); + assignFromKeyfile(keyFile, "Gradient", "Strength", pedited, gradient.strength, pedited->gradient.strength); + assignFromKeyfile(keyFile, "Gradient", "CenterX", pedited, gradient.centerX, pedited->gradient.centerX); + assignFromKeyfile(keyFile, "Gradient", "CenterY", pedited, gradient.centerY, pedited->gradient.centerY); } if (keyFile.has_group ("PCVignette")) { - if (keyFile.has_key ("PCVignette", "Enabled")) { - pcvignette.enabled = keyFile.get_boolean ("PCVignette", "Enabled"); - - if (pedited) { - pedited->pcvignette.enabled = true; - } - } - - if (keyFile.has_key ("PCVignette", "Strength")) { - pcvignette.strength = keyFile.get_double ("PCVignette", "Strength"); - - if (pedited) { - pedited->pcvignette.strength = true; - } - } - - if (keyFile.has_key ("PCVignette", "Feather")) { - pcvignette.feather = keyFile.get_integer ("PCVignette", "Feather"); - - if (pedited) { - pedited->pcvignette.feather = true; - } - } - - if (keyFile.has_key ("PCVignette", "Roundness")) { - pcvignette.roundness = keyFile.get_integer ("PCVignette", "Roundness"); - - if (pedited) { - pedited->pcvignette.roundness = true; - } - } + assignFromKeyfile(keyFile, "PCVignette", "Enabled", pedited, pcvignette.enabled, pedited->pcvignette.enabled); + assignFromKeyfile(keyFile, "PCVignette", "Strength", pedited, pcvignette.strength, pedited->pcvignette.strength); + assignFromKeyfile(keyFile, "PCVignette", "Feather", pedited, pcvignette.feather, pedited->pcvignette.feather); + assignFromKeyfile(keyFile, "PCVignette", "Roundness", pedited, pcvignette.roundness, pedited->pcvignette.roundness); } -// load c/a correction if (keyFile.has_group ("CACorrection")) { - if (keyFile.has_key ("CACorrection", "Red")) { - cacorrection.red = keyFile.get_double ("CACorrection", "Red"); - - if (pedited) { - pedited->cacorrection.red = true; - } - } - - if (keyFile.has_key ("CACorrection", "Blue")) { - cacorrection.blue = keyFile.get_double ("CACorrection", "Blue"); - - if (pedited) { - pedited->cacorrection.blue = true; - } - } + assignFromKeyfile(keyFile, "CACorrection", "Red", pedited, cacorrection.red, pedited->cacorrection.red); + assignFromKeyfile(keyFile, "CACorrection", "Blue", pedited, cacorrection.blue, pedited->cacorrection.blue); } -// load vignetting correction if (keyFile.has_group ("Vignetting Correction")) { - if (keyFile.has_key ("Vignetting Correction", "Amount")) { - vignetting.amount = keyFile.get_integer ("Vignetting Correction", "Amount"); - - if (pedited) { - pedited->vignetting.amount = true; - } - } - - if (keyFile.has_key ("Vignetting Correction", "Radius")) { - vignetting.radius = keyFile.get_integer ("Vignetting Correction", "Radius"); - - if (pedited) { - pedited->vignetting.radius = true; - } - } - - if (keyFile.has_key ("Vignetting Correction", "Strength")) { - vignetting.strength = keyFile.get_integer ("Vignetting Correction", "Strength"); - - if (pedited) { - pedited->vignetting.strength = true; - } - } - - if (keyFile.has_key ("Vignetting Correction", "CenterX")) { - vignetting.centerX = keyFile.get_integer ("Vignetting Correction", "CenterX"); - - if (pedited) { - pedited->vignetting.centerX = true; - } - } - - if (keyFile.has_key ("Vignetting Correction", "CenterY")) { - vignetting.centerY = keyFile.get_integer ("Vignetting Correction", "CenterY"); - - if (pedited) { - pedited->vignetting.centerY = true; - } - } + assignFromKeyfile(keyFile, "Vignetting Correction", "Amount", pedited, vignetting.amount, pedited->vignetting.amount); + assignFromKeyfile(keyFile, "Vignetting Correction", "Radius", pedited, vignetting.radius, pedited->vignetting.radius); + assignFromKeyfile(keyFile, "Vignetting Correction", "Strength", pedited, vignetting.strength, pedited->vignetting.strength); + assignFromKeyfile(keyFile, "Vignetting Correction", "CenterX", pedited, vignetting.centerX, pedited->vignetting.centerX); + assignFromKeyfile(keyFile, "Vignetting Correction", "CenterY", pedited, vignetting.centerY, pedited->vignetting.centerY); } -// load resize settings if (keyFile.has_group ("Resize")) { - if (keyFile.has_key ("Resize", "Enabled")) { - resize.enabled = keyFile.get_boolean ("Resize", "Enabled"); - - if (pedited) { - pedited->resize.enabled = true; - } - } - - if (keyFile.has_key ("Resize", "Scale")) { - resize.scale = keyFile.get_double ("Resize", "Scale"); - - if (pedited) { - pedited->resize.scale = true; - } - } - - if (keyFile.has_key ("Resize", "AppliesTo")) { - resize.appliesTo = keyFile.get_string ("Resize", "AppliesTo"); - - if (pedited) { - pedited->resize.appliesTo = true; - } - } - - if (keyFile.has_key ("Resize", "Method")) { - resize.method = keyFile.get_string ("Resize", "Method"); - - if (pedited) { - pedited->resize.method = true; - } - } - - if (keyFile.has_key ("Resize", "DataSpecified")) { - resize.dataspec = keyFile.get_integer ("Resize", "DataSpecified"); - - if (pedited) { - pedited->resize.dataspec = true; - } - } - - if (keyFile.has_key ("Resize", "Width")) { - resize.width = keyFile.get_integer ("Resize", "Width"); - - if (pedited) { - pedited->resize.width = true; - } - } - - if (keyFile.has_key ("Resize", "Height")) { - resize.height = keyFile.get_integer ("Resize", "Height"); - - if (pedited) { - pedited->resize.height = true; - } - } + assignFromKeyfile(keyFile, "Resize", "Enabled", pedited, resize.enabled, pedited->resize.enabled); + assignFromKeyfile(keyFile, "Resize", "Scale", pedited, resize.scale, pedited->resize.scale); + assignFromKeyfile(keyFile, "Resize", "AppliesTo", pedited, resize.appliesTo, pedited->resize.appliesTo); + assignFromKeyfile(keyFile, "Resize", "Method", pedited, resize.method, pedited->resize.method); + assignFromKeyfile(keyFile, "Resize", "DataSpecified", pedited, resize.dataspec, pedited->resize.dataspec); + assignFromKeyfile(keyFile, "Resize", "Width", pedited, resize.width, pedited->resize.width); + assignFromKeyfile(keyFile, "Resize", "Height", pedited, resize.height, pedited->resize.height); } -// load post resize sharpening if (keyFile.has_group ("PostResizeSharpening")) { - if (keyFile.has_key ("PostResizeSharpening", "Enabled")) { - prsharpening.enabled = keyFile.get_boolean ("PostResizeSharpening", "Enabled"); - - if (pedited) { - pedited->prsharpening.enabled = true; - } - } - - if (keyFile.has_key ("PostResizeSharpening", "Radius")) { - prsharpening.radius = keyFile.get_double ("PostResizeSharpening", "Radius"); - - if (pedited) { - pedited->prsharpening.radius = true; - } - } - - if (keyFile.has_key ("PostResizeSharpening", "Amount")) { - prsharpening.amount = keyFile.get_integer ("PostResizeSharpening", "Amount"); - - if (pedited) { - pedited->prsharpening.amount = true; - } - } + assignFromKeyfile(keyFile, "PostResizeSharpening", "Enabled", pedited, prsharpening.enabled, pedited->prsharpening.enabled); + assignFromKeyfile(keyFile, "PostResizeSharpening", "Radius", pedited, prsharpening.radius, pedited->prsharpening.radius); + assignFromKeyfile(keyFile, "PostResizeSharpening", "Amount", pedited, prsharpening.amount, pedited->prsharpening.amount); if (keyFile.has_key ("PostResizeSharpening", "Threshold")) { if (ppVersion < 302) { @@ -6196,88 +4060,18 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("PostResizeSharpening", "OnlyEdges")) { - prsharpening.edgesonly = keyFile.get_boolean ("PostResizeSharpening", "OnlyEdges"); - - if (pedited) { - pedited->prsharpening.edgesonly = true; - } - } - - if (keyFile.has_key ("PostResizeSharpening", "EdgedetectionRadius")) { - prsharpening.edges_radius = keyFile.get_double ("PostResizeSharpening", "EdgedetectionRadius"); - - if (pedited) { - pedited->prsharpening.edges_radius = true; - } - } - - if (keyFile.has_key ("PostResizeSharpening", "EdgeTolerance")) { - prsharpening.edges_tolerance = keyFile.get_integer ("PostResizeSharpening", "EdgeTolerance"); - - if (pedited) { - pedited->prsharpening.edges_tolerance = true; - } - } - - if (keyFile.has_key ("PostResizeSharpening", "HalocontrolEnabled")) { - prsharpening.halocontrol = keyFile.get_boolean ("PostResizeSharpening", "HalocontrolEnabled"); - - if (pedited) { - pedited->prsharpening.halocontrol = true; - } - } - - if (keyFile.has_key ("PostResizeSharpening", "HalocontrolAmount")) { - prsharpening.halocontrol_amount = keyFile.get_integer ("PostResizeSharpening", "HalocontrolAmount"); - - if (pedited) { - pedited->prsharpening.halocontrol_amount = true; - } - } - - if (keyFile.has_key ("PostResizeSharpening", "Method")) { - prsharpening.method = keyFile.get_string ("PostResizeSharpening", "Method"); - - if (pedited) { - pedited->prsharpening.method = true; - } - } - - if (keyFile.has_key ("PostResizeSharpening", "DeconvRadius")) { - prsharpening.deconvradius = keyFile.get_double ("PostResizeSharpening", "DeconvRadius"); - - if (pedited) { - pedited->prsharpening.deconvradius = true; - } - } - - if (keyFile.has_key ("PostResizeSharpening", "DeconvAmount")) { - prsharpening.deconvamount = keyFile.get_integer ("PostResizeSharpening", "DeconvAmount"); - - if (pedited) { - pedited->prsharpening.deconvamount = true; - } - } - - if (keyFile.has_key ("PostResizeSharpening", "DeconvDamping")) { - prsharpening.deconvdamping = keyFile.get_integer ("PostResizeSharpening", "DeconvDamping"); - - if (pedited) { - pedited->prsharpening.deconvdamping = true; - } - } - - if (keyFile.has_key ("PostResizeSharpening", "DeconvIterations")) { - prsharpening.deconviter = keyFile.get_integer ("PostResizeSharpening", "DeconvIterations"); - - if (pedited) { - pedited->prsharpening.deconviter = true; - } - } + assignFromKeyfile(keyFile, "PostResizeSharpening", "OnlyEdges", pedited, prsharpening.edgesonly, pedited->prsharpening.edgesonly); + assignFromKeyfile(keyFile, "PostResizeSharpening", "EdgedetectionRadius", pedited, prsharpening.edges_radius, pedited->prsharpening.edges_radius); + assignFromKeyfile(keyFile, "PostResizeSharpening", "EdgeTolerance", pedited, prsharpening.edges_tolerance, pedited->prsharpening.edges_tolerance); + assignFromKeyfile(keyFile, "PostResizeSharpening", "HalocontrolEnabled", pedited, prsharpening.halocontrol, pedited->prsharpening.halocontrol); + assignFromKeyfile(keyFile, "PostResizeSharpening", "HalocontrolAmount", pedited, prsharpening.halocontrol_amount, pedited->prsharpening.halocontrol_amount); + assignFromKeyfile(keyFile, "PostResizeSharpening", "Method", pedited, prsharpening.method, pedited->prsharpening.method); + assignFromKeyfile(keyFile, "PostResizeSharpening", "DeconvRadius", pedited, prsharpening.deconvradius, pedited->prsharpening.deconvradius); + assignFromKeyfile(keyFile, "PostResizeSharpening", "DeconvAmount", pedited, prsharpening.deconvamount, pedited->prsharpening.deconvamount); + assignFromKeyfile(keyFile, "PostResizeSharpening", "DeconvDamping", pedited, prsharpening.deconvdamping, pedited->prsharpening.deconvdamping); + assignFromKeyfile(keyFile, "PostResizeSharpening", "DeconvIterations", pedited, prsharpening.deconviter, pedited->prsharpening.deconviter); } -// load color management settings if (keyFile.has_group ("Color Management")) { if (keyFile.has_key ("Color Management", "InputProfile")) { icm.input = expandRelativePath (fname, "file:", keyFile.get_string ("Color Management", "InputProfile")); @@ -6287,61 +4081,13 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Color Management", "ToneCurve")) { - icm.toneCurve = keyFile.get_boolean ("Color Management", "ToneCurve"); - - if (pedited) { - pedited->icm.toneCurve = true; - } - } - - if (keyFile.has_key ("Color Management", "ApplyLookTable")) { - icm.applyLookTable = keyFile.get_boolean ("Color Management", "ApplyLookTable"); - - if (pedited) { - pedited->icm.applyLookTable = true; - } - } - - if (keyFile.has_key ("Color Management", "ApplyBaselineExposureOffset")) { - icm.applyBaselineExposureOffset = keyFile.get_boolean ("Color Management", "ApplyBaselineExposureOffset"); - - if (pedited) { - pedited->icm.applyBaselineExposureOffset = true; - } - } - - if (keyFile.has_key ("Color Management", "ApplyHueSatMap")) { - icm.applyHueSatMap = keyFile.get_boolean ("Color Management", "ApplyHueSatMap"); - - if (pedited) { - pedited->icm.applyHueSatMap = true; - } - } - - if (keyFile.has_key ("Color Management", "DCPIlluminant")) { - icm.dcpIlluminant = keyFile.get_integer ("Color Management", "DCPIlluminant"); - - if (pedited) { - pedited->icm.dcpIlluminant = true; - } - } - - if (keyFile.has_key ("Color Management", "WorkingProfile")) { - icm.working = keyFile.get_string ("Color Management", "WorkingProfile"); - - if (pedited) { - pedited->icm.working = true; - } - } - - if (keyFile.has_key ("Color Management", "OutputProfile")) { - icm.output = keyFile.get_string ("Color Management", "OutputProfile"); - - if (pedited) { - pedited->icm.output = true; - } - } + assignFromKeyfile(keyFile, "Color Management", "ToneCurve", pedited, icm.toneCurve, pedited->icm.toneCurve); + assignFromKeyfile(keyFile, "Color Management", "ApplyLookTable", pedited, icm.applyLookTable, pedited->icm.applyLookTable); + assignFromKeyfile(keyFile, "Color Management", "ApplyBaselineExposureOffset", pedited, icm.applyBaselineExposureOffset, pedited->icm.applyBaselineExposureOffset); + assignFromKeyfile(keyFile, "Color Management", "ApplyHueSatMap", pedited, icm.applyHueSatMap, pedited->icm.applyHueSatMap); + assignFromKeyfile(keyFile, "Color Management", "DCPIlluminant", pedited, icm.dcpIlluminant, pedited->icm.dcpIlluminant); + assignFromKeyfile(keyFile, "Color Management", "WorkingProfile", pedited, icm.working, pedited->icm.working); + assignFromKeyfile(keyFile, "Color Management", "OutputProfile", pedited, icm.output, pedited->icm.output); if (keyFile.has_key ("Color Management", "OutputProfileIntent")) { Glib::ustring intent = keyFile.get_string ("Color Management", "OutputProfileIntent"); @@ -6361,554 +4107,76 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Color Management", "OutputBPC")) { - icm.outputBPC = keyFile.get_boolean ("Color Management", "OutputBPC"); - - if (pedited) { - pedited->icm.outputBPC = true; - } - } - - if (keyFile.has_key ("Color Management", "Gammafree")) { - icm.gamma = keyFile.get_string ("Color Management", "Gammafree"); - - if (pedited) { - pedited->icm.gamfree = true; - } - } - - if (keyFile.has_key ("Color Management", "Freegamma")) { - icm.freegamma = keyFile.get_boolean ("Color Management", "Freegamma"); - - if (pedited) { - pedited->icm.freegamma = true; - } - } - - if (keyFile.has_key ("Color Management", "GammaValue")) { - icm.gampos = keyFile.get_double ("Color Management", "GammaValue"); - - if (pedited) { - pedited->icm.gampos = true; - } - } - - if (keyFile.has_key ("Color Management", "GammaSlope")) { - icm.slpos = keyFile.get_double ("Color Management", "GammaSlope"); - - if (pedited) { - pedited->icm.slpos = true; - } - } - + assignFromKeyfile(keyFile, "Color Management", "OutputBPC", pedited, icm.outputBPC, pedited->icm.outputBPC); + assignFromKeyfile(keyFile, "Color Management", "Gammafree", pedited, icm.gamma, pedited->icm.gamma); + assignFromKeyfile(keyFile, "Color Management", "Freegamma", pedited, icm.freegamma, pedited->icm.freegamma); + assignFromKeyfile(keyFile, "Color Management", "GammaValue", pedited, icm.gampos, pedited->icm.gampos); + assignFromKeyfile(keyFile, "Color Management", "GammaSlope", pedited, icm.slpos, pedited->icm.slpos); } -// load wavelet wavelet parameters if (keyFile.has_group ("Wavelet")) { - if (keyFile.has_key ("Wavelet", "Enabled")) { - wavelet.enabled = keyFile.get_boolean ("Wavelet", "Enabled"); - - if (pedited) { - pedited->wavelet.enabled = true; - } - } - - if (keyFile.has_key ("Wavelet", "Strength")) { - wavelet.strength = keyFile.get_integer ("Wavelet", "Strength"); - - if (pedited) { - pedited->wavelet.strength = true; - } - } - - if (keyFile.has_key ("Wavelet", "Balance")) { - wavelet.balance = keyFile.get_integer ("Wavelet", "Balance"); - - if (pedited) { - pedited->wavelet.balance = true; - } - } - - if (keyFile.has_key ("Wavelet", "Iter")) { - wavelet.iter = keyFile.get_integer ("Wavelet", "Iter"); - - if (pedited) { - pedited->wavelet.iter = true; - } - } - - if (keyFile.has_key ("Wavelet", "Median")) { - wavelet.median = keyFile.get_boolean ("Wavelet", "Median"); - - if (pedited) { - pedited->wavelet.median = true; - } - } - - if (keyFile.has_key ("Wavelet", "Medianlev")) { - wavelet.medianlev = keyFile.get_boolean ("Wavelet", "Medianlev"); - - if (pedited) { - pedited->wavelet.medianlev = true; - } - } - - if (keyFile.has_key ("Wavelet", "Linkedg")) { - wavelet.linkedg = keyFile.get_boolean ("Wavelet", "Linkedg"); - - if (pedited) { - pedited->wavelet.linkedg = true; - } - } - - if (keyFile.has_key ("Wavelet", "CBenab")) { - wavelet.cbenab = keyFile.get_boolean ("Wavelet", "CBenab"); - - if (pedited) { - pedited->wavelet.cbenab = true; - } - } - - if (keyFile.has_key ("Wavelet", "CBgreenhigh")) { - wavelet.greenhigh = keyFile.get_integer ("Wavelet", "CBgreenhigh"); - - if (pedited) { - pedited->wavelet.greenhigh = true; - } - } - - if (keyFile.has_key ("Wavelet", "CBgreenmed")) { - wavelet.greenmed = keyFile.get_integer ("Wavelet", "CBgreenmed"); - - if (pedited) { - pedited->wavelet.greenmed = true; - } - } - - if (keyFile.has_key ("Wavelet", "CBgreenlow")) { - wavelet.greenlow = keyFile.get_integer ("Wavelet", "CBgreenlow"); - - if (pedited) { - pedited->wavelet.greenlow = true; - } - } - - if (keyFile.has_key ("Wavelet", "CBbluehigh")) { - wavelet.bluehigh = keyFile.get_integer ("Wavelet", "CBbluehigh"); - - if (pedited) { - pedited->wavelet.bluehigh = true; - } - } - - if (keyFile.has_key ("Wavelet", "CBbluemed")) { - wavelet.bluemed = keyFile.get_integer ("Wavelet", "CBbluemed"); - - if (pedited) { - pedited->wavelet.bluemed = true; - } - } - - if (keyFile.has_key ("Wavelet", "CBbluelow")) { - wavelet.bluelow = keyFile.get_integer ("Wavelet", "CBbluelow"); - - if (pedited) { - pedited->wavelet.bluelow = true; - } - } - -// if (keyFile.has_key ("Wavelet", "Edgreinf")) {wavelet.edgreinf = keyFile.get_boolean ("Wavelet", "Edgreinf");if (pedited) pedited->wavelet.edgreinf = true;} - if (keyFile.has_key ("Wavelet", "Lipst")) { - wavelet.lipst = keyFile.get_boolean ("Wavelet", "Lipst"); - - if (pedited) { - pedited->wavelet.lipst = true; - } - } - - if (keyFile.has_key ("Wavelet", "AvoidColorShift")) { - wavelet.avoid = keyFile.get_boolean ("Wavelet", "AvoidColorShift"); - - if (pedited) { - pedited->wavelet.avoid = true; - } - } - - if (keyFile.has_key ("Wavelet", "TMr")) { - wavelet.tmr = keyFile.get_boolean ("Wavelet", "TMr"); - - if (pedited) { - pedited->wavelet.tmr = true; - } - } - - if (keyFile.has_key ("Wavelet", "LevMethod")) { - wavelet.Lmethod = keyFile.get_string ("Wavelet", "LevMethod"); - - if (pedited) { - pedited->wavelet.Lmethod = true; - } - } - - if (keyFile.has_key ("Wavelet", "ChoiceLevMethod")) { - wavelet.CLmethod = keyFile.get_string ("Wavelet", "ChoiceLevMethod"); - - if (pedited) { - pedited->wavelet.CLmethod = true; - } - } - - if (keyFile.has_key ("Wavelet", "BackMethod")) { - wavelet.Backmethod = keyFile.get_string ("Wavelet", "BackMethod"); - - if (pedited) { - pedited->wavelet.Backmethod = true; - } - } - - if (keyFile.has_key ("Wavelet", "TilesMethod")) { - wavelet.Tilesmethod = keyFile.get_string ("Wavelet", "TilesMethod"); - - if (pedited) { - pedited->wavelet.Tilesmethod = true; - } - } - - if (keyFile.has_key ("Wavelet", "DaubMethod")) { - wavelet.daubcoeffmethod = keyFile.get_string ("Wavelet", "DaubMethod"); - - if (pedited) { - pedited->wavelet.daubcoeffmethod = true; - } - } - - if (keyFile.has_key ("Wavelet", "CHromaMethod")) { - wavelet.CHmethod = keyFile.get_string ("Wavelet", "CHromaMethod"); - - if (pedited) { - pedited->wavelet.CHmethod = true; - } - } - - if (keyFile.has_key ("Wavelet", "Medgreinf")) { - wavelet.Medgreinf = keyFile.get_string ("Wavelet", "Medgreinf"); - - if (pedited) { - pedited->wavelet.Medgreinf = true; - } - } - - if (keyFile.has_key ("Wavelet", "CHSLromaMethod")) { - wavelet.CHSLmethod = keyFile.get_string ("Wavelet", "CHSLromaMethod"); - - if (pedited) { - pedited->wavelet.CHSLmethod = true; - } - } - - if (keyFile.has_key ("Wavelet", "EDMethod")) { - wavelet.EDmethod = keyFile.get_string ("Wavelet", "EDMethod"); - - if (pedited) { - pedited->wavelet.EDmethod = true; - } - } - - if (keyFile.has_key ("Wavelet", "NPMethod")) { - wavelet.NPmethod = keyFile.get_string ("Wavelet", "NPMethod"); - - if (pedited) { - pedited->wavelet.NPmethod = true; - } - } - - if (keyFile.has_key ("Wavelet", "BAMethod")) { - wavelet.BAmethod = keyFile.get_string ("Wavelet", "BAMethod"); - - if (pedited) { - pedited->wavelet.BAmethod = true; - } - } - - if (keyFile.has_key ("Wavelet", "TMMethod")) { - wavelet.TMmethod = keyFile.get_string ("Wavelet", "TMMethod"); - - if (pedited) { - pedited->wavelet.TMmethod = true; - } - } - - if (keyFile.has_key ("Wavelet", "HSMethod")) { - wavelet.HSmethod = keyFile.get_string ("Wavelet", "HSMethod"); - - if (pedited) { - pedited->wavelet.HSmethod = true; - } - } - - if (keyFile.has_key ("Wavelet", "DirMethod")) { - wavelet.Dirmethod = keyFile.get_string ("Wavelet", "DirMethod"); - - if (pedited) { - pedited->wavelet.Dirmethod = true; - } - } - - if (keyFile.has_key ("Wavelet", "ResidualcontShadow")) { - wavelet.rescon = keyFile.get_integer ("Wavelet", "ResidualcontShadow"); - - if (pedited) { - pedited->wavelet.rescon = true; - } - } - - if (keyFile.has_key ("Wavelet", "ResidualcontHighlight")) { - wavelet.resconH = keyFile.get_integer ("Wavelet", "ResidualcontHighlight"); - - if (pedited) { - pedited->wavelet.resconH = true; - } - } - - if (keyFile.has_key ("Wavelet", "Residualchroma")) { - wavelet.reschro = keyFile.get_integer ("Wavelet", "Residualchroma"); - - if (pedited) { - pedited->wavelet.reschro = true; - } - } - - if (keyFile.has_key ("Wavelet", "ResidualTM")) { - wavelet.tmrs = keyFile.get_double ("Wavelet", "ResidualTM"); - - if (pedited) { - pedited->wavelet.tmrs = true; - } - } - - if (keyFile.has_key ("Wavelet", "Residualgamma")) { - wavelet.gamma = keyFile.get_double ("Wavelet", "Residualgamma"); - - if (pedited) { - pedited->wavelet.gamma = true; - } - } - - if (keyFile.has_key ("Wavelet", "ContExtra")) { - wavelet.sup = keyFile.get_integer ("Wavelet", "ContExtra"); - - if (pedited) { - pedited->wavelet.sup = true; - } - } - - if (keyFile.has_key ("Wavelet", "HueRangeResidual")) { - wavelet.sky = keyFile.get_double ("Wavelet", "HueRangeResidual"); - - if (pedited) { - pedited->wavelet.sky = true; - } - } - - if (keyFile.has_key ("Wavelet", "MaxLev")) { - wavelet.thres = keyFile.get_integer ("Wavelet", "MaxLev"); - - if (pedited) { - pedited->wavelet.thres = true; - } - } - - if (keyFile.has_key ("Wavelet", "ThresholdHighLight")) { - wavelet.threshold = keyFile.get_integer ("Wavelet", "ThresholdHighLight"); - - if (pedited) { - pedited->wavelet.threshold = true; - } - } - - if (keyFile.has_key ("Wavelet", "ThresholdShadow")) { - wavelet.threshold2 = keyFile.get_integer ("Wavelet", "ThresholdShadow"); - - if (pedited) { - pedited->wavelet.threshold2 = true; - } - } - - if (keyFile.has_key ("Wavelet", "Edgedetect")) { - wavelet.edgedetect = keyFile.get_integer ("Wavelet", "Edgedetect"); - - if (pedited) { - pedited->wavelet.edgedetect = true; - } - } - - if (keyFile.has_key ("Wavelet", "Edgedetectthr")) { - wavelet.edgedetectthr = keyFile.get_integer ("Wavelet", "Edgedetectthr"); - - if (pedited) { - pedited->wavelet.edgedetectthr = true; - } - } - - if (keyFile.has_key ("Wavelet", "EdgedetectthrHi")) { - wavelet.edgedetectthr2 = keyFile.get_integer ("Wavelet", "EdgedetectthrHi"); - - if (pedited) { - pedited->wavelet.edgedetectthr2 = true; - } - } - - if (keyFile.has_key ("Wavelet", "Edgesensi")) { - wavelet.edgesensi = keyFile.get_integer ("Wavelet", "Edgesensi"); - - if (pedited) { - pedited->wavelet.edgesensi = true; - } - } - - if (keyFile.has_key ("Wavelet", "Edgeampli")) { - wavelet.edgeampli = keyFile.get_integer ("Wavelet", "Edgeampli"); - - if (pedited) { - pedited->wavelet.edgeampli = true; - } - } - - if (keyFile.has_key ("Wavelet", "ThresholdChroma")) { - wavelet.chroma = keyFile.get_integer ("Wavelet", "ThresholdChroma"); - - if (pedited) { - pedited->wavelet.chroma = true; - } - } - - if (keyFile.has_key ("Wavelet", "ChromaLink")) { - wavelet.chro = keyFile.get_integer ("Wavelet", "ChromaLink"); - - if (pedited) { - pedited->wavelet.chro = true; - } - } - - if (keyFile.has_key ("Wavelet", "Contrast")) { - wavelet.contrast = keyFile.get_integer ("Wavelet", "Contrast"); - - if (pedited) { - pedited->wavelet.contrast = true; - } - } - - if (keyFile.has_key ("Wavelet", "Edgrad")) { - wavelet.edgrad = keyFile.get_integer ("Wavelet", "Edgrad"); - - if (pedited) { - pedited->wavelet.edgrad = true; - } - } - - if (keyFile.has_key ("Wavelet", "Edgval")) { - wavelet.edgval = keyFile.get_integer ("Wavelet", "Edgval"); - - if (pedited) { - pedited->wavelet.edgval = true; - } - } - - if (keyFile.has_key ("Wavelet", "ThrEdg")) { - wavelet.edgthresh = keyFile.get_integer ("Wavelet", "ThrEdg"); - - if (pedited) { - pedited->wavelet.edgthresh = true; - } - } - - if (keyFile.has_key ("Wavelet", "ThresholdResidShadow")) { - wavelet.thr = keyFile.get_integer ("Wavelet", "ThresholdResidShadow"); - - if (pedited) { - pedited->wavelet.thr = true; - } - } - - if (keyFile.has_key ("Wavelet", "ThresholdResidHighLight")) { - wavelet.thrH = keyFile.get_integer ("Wavelet", "ThresholdResidHighLight"); - - if (pedited) { - pedited->wavelet.thrH = true; - } - } - - if (keyFile.has_key ("Wavelet", "ContrastCurve")) { - wavelet.ccwcurve = keyFile.get_double_list ("Wavelet", "ContrastCurve"); - avoidEmptyCurve (wavelet.ccwcurve); - - if (pedited) { - pedited->wavelet.ccwcurve = true; - } - } - - if (keyFile.has_key ("Wavelet", "OpacityCurveRG")) { - wavelet.opacityCurveRG = keyFile.get_double_list ("Wavelet", "OpacityCurveRG"); - avoidEmptyCurve (wavelet.opacityCurveRG); - - if (pedited) { - pedited->wavelet.opacityCurveRG = true; - } - } - - if (keyFile.has_key ("Wavelet", "OpacityCurveBY")) { - wavelet.opacityCurveBY = keyFile.get_double_list ("Wavelet", "OpacityCurveBY"); - avoidEmptyCurve (wavelet.opacityCurveBY); - - if (pedited) { - pedited->wavelet.opacityCurveBY = true; - } - } - - if (keyFile.has_key ("Wavelet", "OpacityCurveW")) { - wavelet.opacityCurveW = keyFile.get_double_list ("Wavelet", "OpacityCurveW"); - avoidEmptyCurve (wavelet.opacityCurveW); - - if (pedited) { - pedited->wavelet.opacityCurveW = true; - } - } - - if (keyFile.has_key ("Wavelet", "OpacityCurveWL")) { - wavelet.opacityCurveWL = keyFile.get_double_list ("Wavelet", "OpacityCurveWL"); - avoidEmptyCurve (wavelet.opacityCurveWL); - - if (pedited) { - pedited->wavelet.opacityCurveWL = true; - } - } - - if (keyFile.has_key ("Wavelet", "HHcurve")) { - wavelet.hhcurve = keyFile.get_double_list ("Wavelet", "HHcurve"); - avoidEmptyCurve (wavelet.hhcurve); - - if (pedited) { - pedited->wavelet.hhcurve = true; - } - } - - if (keyFile.has_key ("Wavelet", "CHcurve")) { - wavelet.Chcurve = keyFile.get_double_list ("Wavelet", "CHcurve"); - avoidEmptyCurve (wavelet.Chcurve); - - if (pedited) { - pedited->wavelet.Chcurve = true; - } - } - - if (keyFile.has_key ("Wavelet", "WavclCurve")) { - wavelet.wavclCurve = keyFile.get_double_list ("Wavelet", "WavclCurve"); - avoidEmptyCurve (wavelet.wavclCurve); - - if (pedited) { - pedited->wavelet.wavclCurve = true; - } - } + assignFromKeyfile(keyFile, "Wavelet", "Enabled", pedited, wavelet.enabled, pedited->wavelet.enabled); + assignFromKeyfile(keyFile, "Wavelet", "Strength", pedited, wavelet.strength, pedited->wavelet.strength); + assignFromKeyfile(keyFile, "Wavelet", "Balance", pedited, wavelet.balance, pedited->wavelet.balance); + assignFromKeyfile(keyFile, "Wavelet", "Iter", pedited, wavelet.iter, pedited->wavelet.iter); + assignFromKeyfile(keyFile, "Wavelet", "Median", pedited, wavelet.median, pedited->wavelet.median); + assignFromKeyfile(keyFile, "Wavelet", "Medianlev", pedited, wavelet.medianlev, pedited->wavelet.medianlev); + assignFromKeyfile(keyFile, "Wavelet", "Linkedg", pedited, wavelet.linkedg, pedited->wavelet.linkedg); + assignFromKeyfile(keyFile, "Wavelet", "CBenab", pedited, wavelet.cbenab, pedited->wavelet.cbenab); + assignFromKeyfile(keyFile, "Wavelet", "CBgreenhigh", pedited, wavelet.greenhigh, pedited->wavelet.greenhigh); + assignFromKeyfile(keyFile, "Wavelet", "CBgreenmed", pedited, wavelet.greenmed, pedited->wavelet.greenmed); + assignFromKeyfile(keyFile, "Wavelet", "CBgreenlow", pedited, wavelet.greenlow, pedited->wavelet.greenlow); + assignFromKeyfile(keyFile, "Wavelet", "CBbluehigh", pedited, wavelet.bluehigh, pedited->wavelet.bluehigh); + assignFromKeyfile(keyFile, "Wavelet", "CBbluemed", pedited, wavelet.bluemed, pedited->wavelet.bluemed); + assignFromKeyfile(keyFile, "Wavelet", "CBbluelow", pedited, wavelet.bluelow, pedited->wavelet.bluelow); + assignFromKeyfile(keyFile, "Wavelet", "Lipst", pedited, wavelet.lipst, pedited->wavelet.lipst); + assignFromKeyfile(keyFile, "Wavelet", "AvoidColorShift", pedited, wavelet.avoid, pedited->wavelet.avoid); + assignFromKeyfile(keyFile, "Wavelet", "TMr", pedited, wavelet.tmr, pedited->wavelet.tmr); + assignFromKeyfile(keyFile, "Wavelet", "LevMethod", pedited, wavelet.Lmethod, pedited->wavelet.Lmethod); + assignFromKeyfile(keyFile, "Wavelet", "ChoiceLevMethod", pedited, wavelet.CLmethod, pedited->wavelet.CLmethod); + assignFromKeyfile(keyFile, "Wavelet", "BackMethod", pedited, wavelet.Backmethod, pedited->wavelet.Backmethod); + assignFromKeyfile(keyFile, "Wavelet", "TilesMethod", pedited, wavelet.Tilesmethod, pedited->wavelet.Tilesmethod); + assignFromKeyfile(keyFile, "Wavelet", "DaubMethod", pedited, wavelet.daubcoeffmethod, pedited->wavelet.daubcoeffmethod); + assignFromKeyfile(keyFile, "Wavelet", "CHromaMethod", pedited, wavelet.CHmethod, pedited->wavelet.CHmethod); + assignFromKeyfile(keyFile, "Wavelet", "Medgreinf", pedited, wavelet.Medgreinf, pedited->wavelet.Medgreinf); + assignFromKeyfile(keyFile, "Wavelet", "CHSLromaMethod", pedited, wavelet.CHSLmethod, pedited->wavelet.CHSLmethod); + assignFromKeyfile(keyFile, "Wavelet", "EDMethod", pedited, wavelet.EDmethod, pedited->wavelet.EDmethod); + assignFromKeyfile(keyFile, "Wavelet", "NPMethod", pedited, wavelet.NPmethod, pedited->wavelet.NPmethod); + assignFromKeyfile(keyFile, "Wavelet", "BAMethod", pedited, wavelet.BAmethod, pedited->wavelet.BAmethod); + assignFromKeyfile(keyFile, "Wavelet", "TMMethod", pedited, wavelet.TMmethod, pedited->wavelet.TMmethod); + assignFromKeyfile(keyFile, "Wavelet", "HSMethod", pedited, wavelet.HSmethod, pedited->wavelet.HSmethod); + assignFromKeyfile(keyFile, "Wavelet", "DirMethod", pedited, wavelet.Dirmethod, pedited->wavelet.Dirmethod); + assignFromKeyfile(keyFile, "Wavelet", "ResidualcontShadow", pedited, wavelet.rescon, pedited->wavelet.rescon); + assignFromKeyfile(keyFile, "Wavelet", "ResidualcontHighlight", pedited, wavelet.resconH, pedited->wavelet.resconH); + assignFromKeyfile(keyFile, "Wavelet", "Residualchroma", pedited, wavelet.reschro, pedited->wavelet.reschro); + assignFromKeyfile(keyFile, "Wavelet", "ResidualTM", pedited, wavelet.tmrs, pedited->wavelet.tmrs); + assignFromKeyfile(keyFile, "Wavelet", "Residualgamma", pedited, wavelet.gamma, pedited->wavelet.gamma); + assignFromKeyfile(keyFile, "Wavelet", "ContExtra", pedited, wavelet.sup, pedited->wavelet.sup); + assignFromKeyfile(keyFile, "Wavelet", "HueRangeResidual", pedited, wavelet.sky, pedited->wavelet.sky); + assignFromKeyfile(keyFile, "Wavelet", "MaxLev", pedited, wavelet.thres, pedited->wavelet.thres); + assignFromKeyfile(keyFile, "Wavelet", "ThresholdHighlight", pedited, wavelet.threshold, pedited->wavelet.threshold); + assignFromKeyfile(keyFile, "Wavelet", "ThresholdShadow", pedited, wavelet.threshold2, pedited->wavelet.threshold2); + assignFromKeyfile(keyFile, "Wavelet", "Edgedetect", pedited, wavelet.edgedetect, pedited->wavelet.edgedetect); + assignFromKeyfile(keyFile, "Wavelet", "Edgedetectthr", pedited, wavelet.edgedetectthr, pedited->wavelet.edgedetectthr); + assignFromKeyfile(keyFile, "Wavelet", "EdgedetectthrHi", pedited, wavelet.edgedetectthr2, pedited->wavelet.edgedetectthr2); + assignFromKeyfile(keyFile, "Wavelet", "Edgesensi", pedited, wavelet.edgesensi, pedited->wavelet.edgesensi); + assignFromKeyfile(keyFile, "Wavelet", "Edgeampli", pedited, wavelet.edgeampli, pedited->wavelet.edgeampli); + assignFromKeyfile(keyFile, "Wavelet", "ThresholdChroma", pedited, wavelet.chroma, pedited->wavelet.chroma); + assignFromKeyfile(keyFile, "Wavelet", "ChromaLink", pedited, wavelet.chro, pedited->wavelet.chro); + assignFromKeyfile(keyFile, "Wavelet", "Contrast", pedited, wavelet.contrast, pedited->wavelet.contrast); + assignFromKeyfile(keyFile, "Wavelet", "Edgrad", pedited, wavelet.edgrad, pedited->wavelet.edgrad); + assignFromKeyfile(keyFile, "Wavelet", "Edgval", pedited, wavelet.edgval, pedited->wavelet.edgval); + assignFromKeyfile(keyFile, "Wavelet", "ThrEdg", pedited, wavelet.edgthresh, pedited->wavelet.edgthresh); + assignFromKeyfile(keyFile, "Wavelet", "ThresholdResidShadow", pedited, wavelet.thr, pedited->wavelet.thr); + assignFromKeyfile(keyFile, "Wavelet", "ThresholdResidHighLight", pedited, wavelet.thrH, pedited->wavelet.thrH); + assignFromKeyfile(keyFile, "Wavelet", "ContrastCurve", pedited, wavelet.ccwcurve, pedited->wavelet.ccwcurve); + assignFromKeyfile(keyFile, "Wavelet", "OpacityCurveRG", pedited, wavelet.opacityCurveRG, pedited->wavelet.opacityCurveRG); + assignFromKeyfile(keyFile, "Wavelet", "OpacityCurveBY", pedited, wavelet.opacityCurveBY, pedited->wavelet.opacityCurveBY); + assignFromKeyfile(keyFile, "Wavelet", "OpacityCurveW", pedited, wavelet.opacityCurveW, pedited->wavelet.opacityCurveW); + assignFromKeyfile(keyFile, "Wavelet", "OpacityCurveWL", pedited, wavelet.opacityCurveWL, pedited->wavelet.opacityCurveWL); + assignFromKeyfile(keyFile, "Wavelet", "HHcurve", pedited, wavelet.hhcurve, pedited->wavelet.hhcurve); + assignFromKeyfile(keyFile, "Wavelet", "CHcurve", pedited, wavelet.Chcurve, pedited->wavelet.Chcurve); + assignFromKeyfile(keyFile, "Wavelet", "WavclCurve", pedited, wavelet.wavclCurve, pedited->wavelet.wavclCurve); if (keyFile.has_key ("Wavelet", "Hueskin")) { const std::vector thresh = keyFile.get_integer_list ("Wavelet", "Hueskin"); @@ -7018,7 +4286,6 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Wavelet", "Pastlev")) { const std::vector thresh = keyFile.get_integer_list ("Wavelet", "Pastlev"); @@ -7043,32 +4310,11 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } + assignFromKeyfile(keyFile, "Wavelet", "Skinprotect", pedited, wavelet.skinprotect, pedited->wavelet.skinprotect); + assignFromKeyfile(keyFile, "Wavelet", "Expcontrast", pedited, wavelet.expcontrast, pedited->wavelet.expcontrast); + assignFromKeyfile(keyFile, "Wavelet", "Expchroma", pedited, wavelet.expchroma, pedited->wavelet.expchroma); - if (keyFile.has_key ("Wavelet", "Skinprotect")) { - wavelet.skinprotect = keyFile.get_double ("Wavelet", "Skinprotect"); - - if (pedited) { - pedited->wavelet.skinprotect = true; - } - } - - if (keyFile.has_key ("Wavelet", "Expcontrast")) { - wavelet.expcontrast = keyFile.get_boolean ("Wavelet", "Expcontrast"); - - if (pedited) { - pedited->wavelet.expcontrast = true; - } - } - - if (keyFile.has_key ("Wavelet", "Expchroma")) { - wavelet.expchroma = keyFile.get_boolean ("Wavelet", "Expchroma"); - - if (pedited) { - pedited->wavelet.expchroma = true; - } - } - - for (int i = 0; i < 9; i ++) { + for (int i = 0; i < 9; ++i) { std::stringstream ss; ss << "Contrast" << (i + 1); @@ -7081,7 +4327,7 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - for (int i = 0; i < 9; i ++) { + for (int i = 0; i < 9; ++i) { std::stringstream ss; ss << "Chroma" << (i + 1); @@ -7093,79 +4339,18 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } } - - if (keyFile.has_key ("Wavelet", "Expedge")) { - wavelet.expedge = keyFile.get_boolean ("Wavelet", "Expedge"); - - if (pedited) { - pedited->wavelet.expedge = true; - } - } - - if (keyFile.has_key ("Wavelet", "Expresid")) { - wavelet.expresid = keyFile.get_boolean ("Wavelet", "Expresid"); - - if (pedited) { - pedited->wavelet.expresid = true; - } - } - - if (keyFile.has_key ("Wavelet", "Expfinal")) { - wavelet.expfinal = keyFile.get_boolean ("Wavelet", "Expfinal"); - - if (pedited) { - pedited->wavelet.expfinal = true; - } - } - - if (keyFile.has_key ("Wavelet", "Exptoning")) { - wavelet.exptoning = keyFile.get_boolean ("Wavelet", "Exptoning"); - - if (pedited) { - pedited->wavelet.exptoning = true; - } - } - - if (keyFile.has_key ("Wavelet", "Expnoise")) { - wavelet.expnoise = keyFile.get_boolean ("Wavelet", "Expnoise"); - - if (pedited) { - pedited->wavelet.expnoise = true; - } - } - - + assignFromKeyfile(keyFile, "Wavelet", "Expedge", pedited, wavelet.expedge, pedited->wavelet.expedge); + assignFromKeyfile(keyFile, "Wavelet", "Expresid", pedited, wavelet.expresid, pedited->wavelet.expresid); + assignFromKeyfile(keyFile, "Wavelet", "Expfinal", pedited, wavelet.expfinal, pedited->wavelet.expfinal); + assignFromKeyfile(keyFile, "Wavelet", "Exptoning", pedited, wavelet.exptoning, pedited->wavelet.exptoning); + assignFromKeyfile(keyFile, "Wavelet", "Expnoise", pedited, wavelet.expnoise, pedited->wavelet.expnoise); } -// load directional pyramid equalizer parameters if (keyFile.has_group ("Directional Pyramid Equalizer")) { - if (keyFile.has_key ("Directional Pyramid Equalizer", "Enabled")) { - dirpyrequalizer.enabled = keyFile.get_boolean ("Directional Pyramid Equalizer", "Enabled"); + assignFromKeyfile(keyFile, "Directional Pyramid Equalizer", "Enabled", pedited, dirpyrequalizer.enabled, pedited->dirpyrequalizer.enabled); + assignFromKeyfile(keyFile, "Directional Pyramid Equalizer", "Gamutlab", pedited, dirpyrequalizer.gamutlab, pedited->dirpyrequalizer.gamutlab); + assignFromKeyfile(keyFile, "Directional Pyramid Equalizer", "cbdlMethod", pedited, dirpyrequalizer.cbdlMethod, pedited->dirpyrequalizer.cbdlMethod); - if (pedited) { - pedited->dirpyrequalizer.enabled = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Equalizer", "Gamutlab")) { - dirpyrequalizer.gamutlab = keyFile.get_boolean ("Directional Pyramid Equalizer", "Gamutlab"); - - if (pedited) { - pedited->dirpyrequalizer.gamutlab = true; - } - } - - - if (keyFile.has_key ("Directional Pyramid Equalizer", "cbdlMethod")) { - dirpyrequalizer.cbdlMethod = keyFile.get_string ("Directional Pyramid Equalizer", "cbdlMethod"); - - if (pedited) { - pedited->dirpyrequalizer.cbdlMethod = true; - } - } - - -// if (keyFile.has_key ("Directional Pyramid Equalizer", "Algorithm")) { dirpyrequalizer.algo = keyFile.get_string ("Directional Pyramid Equalizer", "Algorithm"); if (pedited) pedited->dirpyrequalizer.algo = true; } if (keyFile.has_key ("Directional Pyramid Equalizer", "Hueskin")) { const std::vector thresh = keyFile.get_integer_list ("Directional Pyramid Equalizer", "Hueskin"); @@ -7202,7 +4387,7 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) dirpyrequalizer.mult[4] = 1.0; } else { -// 5 level wavelet + dedicated threshold parameter + // 5 level wavelet + dedicated threshold parameter for (int i = 0; i < 6; i ++) { std::stringstream ss; ss << "Mult" << i; @@ -7216,208 +4401,69 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Directional Pyramid Equalizer", "Threshold")) { - dirpyrequalizer.threshold = keyFile.get_double ("Directional Pyramid Equalizer", "Threshold"); - - if (pedited) { - pedited->dirpyrequalizer.threshold = true; - } - } - - if (keyFile.has_key ("Directional Pyramid Equalizer", "Skinprotect")) { - dirpyrequalizer.skinprotect = keyFile.get_double ("Directional Pyramid Equalizer", "Skinprotect"); - - if (pedited) { - pedited->dirpyrequalizer.skinprotect = true; - } - } + assignFromKeyfile(keyFile, "Directional Pyramid Equalizer", "Threshold", pedited, dirpyrequalizer.threshold, pedited->dirpyrequalizer.threshold); + assignFromKeyfile(keyFile, "Directional Pyramid Equalizer", "Skinprotect", pedited, dirpyrequalizer.skinprotect, pedited->dirpyrequalizer.skinprotect); } } -// load CLUT parameters - if ( keyFile.has_group ( "Film Simulation" ) ) { - if ( keyFile.has_key ( "Film Simulation", "Enabled" ) ) { - filmSimulation.enabled = keyFile.get_boolean ( "Film Simulation", "Enabled" ); - - if ( pedited ) { - pedited->filmSimulation.enabled = true; - } - } - - if ( keyFile.has_key ( "Film Simulation", "ClutFilename" ) ) { - filmSimulation.clutFilename = keyFile.get_string ( "Film Simulation", "ClutFilename" ); - - if ( pedited ) { - pedited->filmSimulation.clutFilename = true; - } - } - - if ( keyFile.has_key ( "Film Simulation", "Strength" ) ) { + if (keyFile.has_group ("Film Simulation")) { + assignFromKeyfile(keyFile, "Film Simulation", "Enabled", pedited, filmSimulation.enabled, pedited->filmSimulation.enabled); + assignFromKeyfile(keyFile, "Film Simulation", "ClutFilename", pedited, filmSimulation.clutFilename, pedited->filmSimulation.clutFilename); + if (keyFile.has_key ("Film Simulation", "Strength")) { if (ppVersion < 321) { - filmSimulation.strength = int (keyFile.get_double ( "Film Simulation", "Strength" ) * 100 + 0.1); + filmSimulation.strength = keyFile.get_double ("Film Simulation", "Strength") * 100 + 0.1; } else { - filmSimulation.strength = keyFile.get_integer ( "Film Simulation", "Strength" ); + filmSimulation.strength = keyFile.get_integer ("Film Simulation", "Strength"); } - if ( pedited ) { + if (pedited) { pedited->filmSimulation.strength = true; } } } -// load HSV wavelet parameters if (keyFile.has_group ("HSV Equalizer")) { + if (ppVersion >= 329) { + assignFromKeyfile(keyFile, "HSV Equalizer", "Enabled", pedited, hsvequalizer.enabled, pedited->hsvequalizer.enabled); + } else { + hsvequalizer.enabled = true; + if (pedited) { + pedited->hsvequalizer.enabled = true; + } + } if (ppVersion >= 300) { - if (keyFile.has_key ("HSV Equalizer", "HCurve")) { - hsvequalizer.hcurve = keyFile.get_double_list ("HSV Equalizer", "HCurve"); - avoidEmptyCurve (hsvequalizer.hcurve); - - if (pedited) { - pedited->hsvequalizer.hcurve = true; - } - } - - if (keyFile.has_key ("HSV Equalizer", "SCurve")) { - hsvequalizer.scurve = keyFile.get_double_list ("HSV Equalizer", "SCurve"); - avoidEmptyCurve (hsvequalizer.scurve); - - if (pedited) { - pedited->hsvequalizer.scurve = true; - } - } - - if (keyFile.has_key ("HSV Equalizer", "VCurve")) { - hsvequalizer.vcurve = keyFile.get_double_list ("HSV Equalizer", "VCurve"); - avoidEmptyCurve (hsvequalizer.vcurve); - - if (pedited) { - pedited->hsvequalizer.vcurve = true; - } - } + assignFromKeyfile(keyFile, "HSV Equalizer", "HCurve", pedited, hsvequalizer.hcurve, pedited->hsvequalizer.hcurve); + assignFromKeyfile(keyFile, "HSV Equalizer", "SCurve", pedited, hsvequalizer.scurve, pedited->hsvequalizer.scurve); + assignFromKeyfile(keyFile, "HSV Equalizer", "VCurve", pedited, hsvequalizer.vcurve, pedited->hsvequalizer.vcurve); } } -// load RGB curves if (keyFile.has_group ("RGB Curves")) { - if (keyFile.has_key ("RGB Curves", "LumaMode")) { - rgbCurves.lumamode = keyFile.get_boolean ("RGB Curves", "LumaMode"); - + if (ppVersion >= 329) { + assignFromKeyfile(keyFile, "RGB Curves", "Enabled", pedited, rgbCurves.enabled, pedited->rgbCurves.enabled); + } else { + rgbCurves.enabled = true; if (pedited) { - pedited->rgbCurves.lumamode = true; - } - } - - if (keyFile.has_key ("RGB Curves", "rCurve")) { - rgbCurves.rcurve = keyFile.get_double_list ("RGB Curves", "rCurve"); - avoidEmptyCurve (rgbCurves.rcurve); - - if (pedited) { - pedited->rgbCurves.rcurve = true; - } - } - - if (keyFile.has_key ("RGB Curves", "gCurve")) { - rgbCurves.gcurve = keyFile.get_double_list ("RGB Curves", "gCurve"); - avoidEmptyCurve (rgbCurves.gcurve); - - if (pedited) { - pedited->rgbCurves.gcurve = true; - } - } - - if (keyFile.has_key ("RGB Curves", "bCurve")) { - rgbCurves.bcurve = keyFile.get_double_list ("RGB Curves", "bCurve"); - avoidEmptyCurve (rgbCurves.bcurve); - - if (pedited) { - pedited->rgbCurves.bcurve = true; + pedited->rgbCurves.enabled = true; } } + assignFromKeyfile(keyFile, "RGB Curves", "LumaMode", pedited, rgbCurves.lumamode, pedited->rgbCurves.lumamode); + assignFromKeyfile(keyFile, "RGB Curves", "rCurve", pedited, rgbCurves.rcurve, pedited->rgbCurves.rcurve); + assignFromKeyfile(keyFile, "RGB Curves", "gCurve", pedited, rgbCurves.gcurve, pedited->rgbCurves.gcurve); + assignFromKeyfile(keyFile, "RGB Curves", "bCurve", pedited, rgbCurves.bcurve, pedited->rgbCurves.bcurve); } -// load Color Toning if (keyFile.has_group ("ColorToning")) { - if (keyFile.has_key ("ColorToning", "Enabled")) { - colorToning.enabled = keyFile.get_boolean ("ColorToning", "Enabled"); - - if (pedited) { - pedited->colorToning.enabled = true; - } - } - - if (keyFile.has_key ("ColorToning", "Method")) { - colorToning.method = keyFile.get_string ("ColorToning", "Method"); - - if (pedited) { - pedited->colorToning.method = true; - } - } - - if (keyFile.has_key ("ColorToning", "Lumamode")) { - colorToning.lumamode = keyFile.get_boolean ("ColorToning", "Lumamode"); - - if (pedited) { - pedited->colorToning.lumamode = true; - } - } - - if (keyFile.has_key ("ColorToning", "Twocolor")) { - colorToning.twocolor = keyFile.get_string ("ColorToning", "Twocolor"); - - if (pedited) { - pedited->colorToning.twocolor = true; - } - } - - if (keyFile.has_key ("ColorToning", "OpacityCurve")) { - colorToning.opacityCurve = keyFile.get_double_list ("ColorToning", "OpacityCurve"); - avoidEmptyCurve (colorToning.opacityCurve); - - if (pedited) { - pedited->colorToning.opacityCurve = true; - } - } - - if (keyFile.has_key ("ColorToning", "ColorCurve")) { - colorToning.colorCurve = keyFile.get_double_list ("ColorToning", "ColorCurve"); - avoidEmptyCurve (colorToning.colorCurve); - - if (pedited) { - pedited->colorToning.colorCurve = true; - } - } - - if (keyFile.has_key ("ColorToning", "Autosat")) { - colorToning.autosat = keyFile.get_boolean ("ColorToning", "Autosat"); - - if (pedited) { - pedited->colorToning.autosat = true; - } - } - - if (keyFile.has_key ("ColorToning", "SatProtectionThreshold")) { - colorToning.satProtectionThreshold = keyFile.get_integer ("ColorToning", "SatProtectionThreshold"); - - if (pedited) { - pedited->colorToning.satprotectionthreshold = true; - } - } - - if (keyFile.has_key ("ColorToning", "SaturatedOpacity")) { - colorToning.saturatedOpacity = keyFile.get_integer ("ColorToning", "SaturatedOpacity"); - - if (pedited) { - pedited->colorToning.saturatedopacity = true; - } - } - - if (keyFile.has_key ("ColorToning", "Strength")) { - colorToning.strength = keyFile.get_integer ("ColorToning", "Strength"); - - if (pedited) { - pedited->colorToning.strength = true; - } - } + assignFromKeyfile(keyFile, "ColorToning", "Enabled", pedited, colorToning.enabled, pedited->colorToning.enabled); + assignFromKeyfile(keyFile, "ColorToning", "Method", pedited, colorToning.method, pedited->colorToning.method); + assignFromKeyfile(keyFile, "ColorToning", "Lumamode", pedited, colorToning.lumamode, pedited->colorToning.lumamode); + assignFromKeyfile(keyFile, "ColorToning", "Twocolor", pedited, colorToning.twocolor, pedited->colorToning.twocolor); + assignFromKeyfile(keyFile, "ColorToning", "OpacityCurve", pedited, colorToning.opacityCurve, pedited->colorToning.opacityCurve); + assignFromKeyfile(keyFile, "ColorToning", "ColorCurve", pedited, colorToning.colorCurve, pedited->colorToning.colorCurve); + assignFromKeyfile(keyFile, "ColorToning", "Autosat", pedited, colorToning.autosat, pedited->colorToning.autosat); + assignFromKeyfile(keyFile, "ColorToning", "SatProtectionThreshold", pedited, colorToning.satProtectionThreshold, pedited->colorToning.satprotectionthreshold); + assignFromKeyfile(keyFile, "ColorToning", "SaturatedOpacity", pedited, colorToning.saturatedOpacity, pedited->colorToning.saturatedopacity); + assignFromKeyfile(keyFile, "ColorToning", "Strength", pedited, colorToning.strength, pedited->colorToning.strength); if (keyFile.has_key ("ColorToning", "HighlightsColorSaturation")) { const std::vector thresh = keyFile.get_integer_list ("ColorToning", "HighlightsColorSaturation"); @@ -7443,122 +4489,22 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("ColorToning", "ClCurve")) { - colorToning.clcurve = keyFile.get_double_list ("ColorToning", "ClCurve"); - avoidEmptyCurve (colorToning.clcurve); - - if (pedited) { - pedited->colorToning.clcurve = true; - } - } - - if (keyFile.has_key ("ColorToning", "Cl2Curve")) { - colorToning.cl2curve = keyFile.get_double_list ("ColorToning", "Cl2Curve"); - avoidEmptyCurve (colorToning.cl2curve); - - if (pedited) { - pedited->colorToning.cl2curve = true; - } - } - - if (keyFile.has_key ("ColorToning", "Redlow")) { - colorToning.redlow = keyFile.get_double ("ColorToning", "Redlow"); - - if (pedited) { - pedited->colorToning.redlow = true; - } - } - - if (keyFile.has_key ("ColorToning", "Greenlow")) { - colorToning.greenlow = keyFile.get_double ("ColorToning", "Greenlow"); - - if (pedited) { - pedited->colorToning.greenlow = true; - } - } - - if (keyFile.has_key ("ColorToning", "Bluelow")) { - colorToning.bluelow = keyFile.get_double ("ColorToning", "Bluelow"); - - if (pedited) { - pedited->colorToning.bluelow = true; - } - } - - if (keyFile.has_key ("ColorToning", "Satlow")) { - colorToning.satlow = keyFile.get_double ("ColorToning", "Satlow"); - - if (pedited) { - pedited->colorToning.satlow = true; - } - } - - if (keyFile.has_key ("ColorToning", "Balance")) { - colorToning.balance = keyFile.get_integer ("ColorToning", "Balance"); - - if (pedited) { - pedited->colorToning.balance = true; - } - } - - if (keyFile.has_key ("ColorToning", "Sathigh")) { - colorToning.sathigh = keyFile.get_double ("ColorToning", "Sathigh"); - - if (pedited) { - pedited->colorToning.sathigh = true; - } - } - - if (keyFile.has_key ("ColorToning", "Redmed")) { - colorToning.redmed = keyFile.get_double ("ColorToning", "Redmed"); - - if (pedited) { - pedited->colorToning.redmed = true; - } - } - - if (keyFile.has_key ("ColorToning", "Greenmed")) { - colorToning.greenmed = keyFile.get_double ("ColorToning", "Greenmed"); - - if (pedited) { - pedited->colorToning.greenmed = true; - } - } - - if (keyFile.has_key ("ColorToning", "Bluemed")) { - colorToning.bluemed = keyFile.get_double ("ColorToning", "Bluemed"); - - if (pedited) { - pedited->colorToning.bluemed = true; - } - } - - if (keyFile.has_key ("ColorToning", "Redhigh")) { - colorToning.redhigh = keyFile.get_double ("ColorToning", "Redhigh"); - - if (pedited) { - pedited->colorToning.redhigh = true; - } - } - - if (keyFile.has_key ("ColorToning", "Greenhigh")) { - colorToning.greenhigh = keyFile.get_double ("ColorToning", "Greenhigh"); - - if (pedited) { - pedited->colorToning.greenhigh = true; - } - } - - if (keyFile.has_key ("ColorToning", "Bluehigh")) { - colorToning.bluehigh = keyFile.get_double ("ColorToning", "Bluehigh"); - - if (pedited) { - pedited->colorToning.bluehigh = true; - } - } + assignFromKeyfile(keyFile, "ColorToning", "ClCurve", pedited, colorToning.clcurve, pedited->colorToning.clcurve); + assignFromKeyfile(keyFile, "ColorToning", "Cl2Curve", pedited, colorToning.cl2curve, pedited->colorToning.cl2curve); + assignFromKeyfile(keyFile, "ColorToning", "Redlow", pedited, colorToning.redlow, pedited->colorToning.redlow); + assignFromKeyfile(keyFile, "ColorToning", "Greenlow", pedited, colorToning.greenlow, pedited->colorToning.greenlow); + assignFromKeyfile(keyFile, "ColorToning", "Bluelow", pedited, colorToning.bluelow, pedited->colorToning.bluelow); + assignFromKeyfile(keyFile, "ColorToning", "Satlow", pedited, colorToning.satlow, pedited->colorToning.satlow); + assignFromKeyfile(keyFile, "ColorToning", "Balance", pedited, colorToning.balance, pedited->colorToning.balance); + assignFromKeyfile(keyFile, "ColorToning", "Sathigh", pedited, colorToning.sathigh, pedited->colorToning.sathigh); + assignFromKeyfile(keyFile, "ColorToning", "Redmed", pedited, colorToning.redmed, pedited->colorToning.redmed); + assignFromKeyfile(keyFile, "ColorToning", "Greenmed", pedited, colorToning.greenmed, pedited->colorToning.greenmed); + assignFromKeyfile(keyFile, "ColorToning", "Bluemed", pedited, colorToning.bluemed, pedited->colorToning.bluemed); + assignFromKeyfile(keyFile, "ColorToning", "Redhigh", pedited, colorToning.redhigh, pedited->colorToning.redhigh); + assignFromKeyfile(keyFile, "ColorToning", "Greenhigh", pedited, colorToning.greenhigh, pedited->colorToning.greenhigh); + assignFromKeyfile(keyFile, "ColorToning", "Bluehigh", pedited, colorToning.bluehigh, pedited->colorToning.bluehigh); } -// load raw settings if (keyFile.has_group ("RAW")) { if (keyFile.has_key ("RAW", "DarkFrame")) { raw.dark_frame = expandRelativePath (fname, "", keyFile.get_string ("RAW", "DarkFrame" )); @@ -7568,13 +4514,7 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("RAW", "DarkFrameAuto")) { - raw.df_autoselect = keyFile.get_boolean ("RAW", "DarkFrameAuto" ); - - if (pedited) { - pedited->raw.dfAuto = true; - } - } + assignFromKeyfile(keyFile, "RAW", "DarkFrameAuto", pedited, raw.df_autoselect, pedited->raw.df_autoselect); if (keyFile.has_key ("RAW", "FlatFieldFile")) { raw.ff_file = expandRelativePath (fname, "", keyFile.get_string ("RAW", "FlatFieldFile" )); @@ -7584,229 +4524,49 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("RAW", "FlatFieldAutoSelect")) { - raw.ff_AutoSelect = keyFile.get_boolean ("RAW", "FlatFieldAutoSelect" ); - - if (pedited) { - pedited->raw.ff_AutoSelect = true; - } + assignFromKeyfile(keyFile, "RAW", "FlatFieldAutoSelect", pedited, raw.ff_AutoSelect, pedited->raw.ff_AutoSelect); + assignFromKeyfile(keyFile, "RAW", "FlatFieldBlurRadius", pedited, raw.ff_BlurRadius, pedited->raw.ff_BlurRadius); + assignFromKeyfile(keyFile, "RAW", "FlatFieldBlurType", pedited, raw.ff_BlurType, pedited->raw.ff_BlurType); + assignFromKeyfile(keyFile, "RAW", "FlatFieldAutoClipControl", pedited, raw.ff_AutoClipControl, pedited->raw.ff_AutoClipControl); + if (ppVersion < 328) { + // With ppversion < 328 this value was stored as a boolean, which is nonsense. + // To avoid annoying warnings we skip reading and assume 0. + raw.ff_clipControl = 0; + } else { + assignFromKeyfile(keyFile, "RAW", "FlatFieldClipControl", pedited, raw.ff_clipControl, pedited->raw.ff_clipControl); } - - if (keyFile.has_key ("RAW", "FlatFieldBlurRadius")) { - raw.ff_BlurRadius = keyFile.get_integer ("RAW", "FlatFieldBlurRadius" ); - - if (pedited) { - pedited->raw.ff_BlurRadius = true; - } + assignFromKeyfile(keyFile, "RAW", "CA", pedited, raw.ca_autocorrect, pedited->raw.ca_autocorrect); + assignFromKeyfile(keyFile, "RAW", "CARed", pedited, raw.cared, pedited->raw.cared); + assignFromKeyfile(keyFile, "RAW", "CABlue", pedited, raw.cablue, pedited->raw.cablue); + // For compatibility to elder pp3 versions + assignFromKeyfile(keyFile, "RAW", "HotDeadPixels", pedited, raw.hotPixelFilter, pedited->raw.hotPixelFilter); + raw.deadPixelFilter = raw.hotPixelFilter; + if (pedited) { + pedited->raw.deadPixelFilter = pedited->raw.hotPixelFilter; } - - if (keyFile.has_key ("RAW", "FlatFieldBlurType")) { - raw.ff_BlurType = keyFile.get_string ("RAW", "FlatFieldBlurType" ); - - if (pedited) { - pedited->raw.ff_BlurType = true; - } - } - - if (keyFile.has_key ("RAW", "FlatFieldAutoClipControl")) { - raw.ff_AutoClipControl = keyFile.get_boolean ("RAW", "FlatFieldAutoClipControl" ); - - if (pedited) { - pedited->raw.ff_AutoClipControl = true; - } - } - - if (keyFile.has_key ("RAW", "FlatFieldClipControl")) { - raw.ff_clipControl = keyFile.get_boolean ("RAW", "FlatFieldClipControl" ); - - if (pedited) { - pedited->raw.ff_clipControl = true; - } - } - - if (keyFile.has_key ("RAW", "CA")) { - raw.ca_autocorrect = keyFile.get_boolean ("RAW", "CA" ); - - if (pedited) { - pedited->raw.caCorrection = true; - } - } - - if (keyFile.has_key ("RAW", "CARed")) { - raw.cared = keyFile.get_double ("RAW", "CARed" ); - - if (pedited) { - pedited->raw.caRed = true; - } - } - - if (keyFile.has_key ("RAW", "CABlue")) { - raw.cablue = keyFile.get_double ("RAW", "CABlue" ); - - if (pedited) { - pedited->raw.caBlue = true; - } - } - -// for compatibility to elder pp3 versions - if (keyFile.has_key ("RAW", "HotDeadPixels")) { - raw.deadPixelFilter = raw.hotPixelFilter = keyFile.get_boolean ("RAW", "HotDeadPixels" ); - - if (pedited) { - pedited->raw.hotPixelFilter = pedited->raw.deadPixelFilter = true; - } - } - - if (keyFile.has_key ("RAW", "HotPixelFilter")) { - raw.hotPixelFilter = keyFile.get_boolean ("RAW", "HotPixelFilter" ); - - if (pedited) { - pedited->raw.hotPixelFilter = true; - } - } - - if (keyFile.has_key ("RAW", "DeadPixelFilter")) { - raw.deadPixelFilter = keyFile.get_boolean ("RAW", "DeadPixelFilter" ); - - if (pedited) { - pedited->raw.deadPixelFilter = true; - } - } - - if (keyFile.has_key ("RAW", "HotDeadPixelThresh")) { - raw.hotdeadpix_thresh = keyFile.get_integer ("RAW", "HotDeadPixelThresh" ); - - if (pedited) { - pedited->raw.hotDeadPixelThresh = true; - } - } - - if (keyFile.has_key ("RAW", "PreExposure")) { - raw.expos = keyFile.get_double ("RAW", "PreExposure"); - - if (pedited) { - pedited->raw.exPos = true; - } - } - - if (keyFile.has_key ("RAW", "PrePreserv")) { - raw.preser = keyFile.get_double ("RAW", "PrePreserv"); - - if (pedited) { - pedited->raw.exPreser = true; - } - } - + assignFromKeyfile(keyFile, "RAW", "HotPixelFilter", pedited, raw.hotPixelFilter, pedited->raw.hotPixelFilter); + assignFromKeyfile(keyFile, "RAW", "DeadPixelFilter", pedited, raw.deadPixelFilter, pedited->raw.deadPixelFilter); + assignFromKeyfile(keyFile, "RAW", "HotDeadPixelThresh", pedited, raw.hotdeadpix_thresh, pedited->raw.hotdeadpix_thresh); + assignFromKeyfile(keyFile, "RAW", "PreExposure", pedited, raw.expos, pedited->raw.exPos); + assignFromKeyfile(keyFile, "RAW", "PrePreserv", pedited, raw.preser, pedited->raw.exPreser); if (ppVersion < 320) { - if (keyFile.has_key ("RAW", "Method")) { - raw.bayersensor.method = keyFile.get_string ("RAW", "Method"); - - if (pedited) { - pedited->raw.bayersensor.method = true; - } - } - - if (keyFile.has_key ("RAW", "CcSteps")) { - raw.bayersensor.ccSteps = keyFile.get_integer ("RAW", "CcSteps"); - - if (pedited) { - pedited->raw.bayersensor.ccSteps = true; - } - } - - if (keyFile.has_key ("RAW", "LineDenoise")) { - raw.bayersensor.linenoise = keyFile.get_integer ("RAW", "LineDenoise" ); - - if (pedited) { - pedited->raw.bayersensor.linenoise = true; - } - } - - if (keyFile.has_key ("RAW", "GreenEqThreshold")) { - raw.bayersensor.greenthresh = keyFile.get_integer ("RAW", "GreenEqThreshold"); - - if (pedited) { - pedited->raw.bayersensor.greenEq = true; - } - } - - if (keyFile.has_key ("RAW", "DCBIterations")) { - raw.bayersensor.dcb_iterations = keyFile.get_integer ("RAW", "DCBIterations"); - - if (pedited) { - pedited->raw.bayersensor.dcbIterations = true; - } - } - - if (keyFile.has_key ("RAW", "DCBEnhance")) { - raw.bayersensor.dcb_enhance = keyFile.get_boolean ("RAW", "DCBEnhance"); - - if (pedited) { - pedited->raw.bayersensor.dcbEnhance = true; - } - } - - if (keyFile.has_key ("RAW", "LMMSEIterations")) { - raw.bayersensor.lmmse_iterations = keyFile.get_integer ("RAW", "LMMSEIterations"); - - if (pedited) { - pedited->raw.bayersensor.lmmseIterations = true; - } - } - - if (keyFile.has_key ("RAW", "PreBlackzero")) { - raw.bayersensor.black0 = keyFile.get_double ("RAW", "PreBlackzero"); - - if (pedited) { - pedited->raw.bayersensor.exBlack0 = true; - } - } - - if (keyFile.has_key ("RAW", "PreBlackone")) { - raw.bayersensor.black1 = keyFile.get_double ("RAW", "PreBlackone"); - - if (pedited) { - pedited->raw.bayersensor.exBlack1 = true; - } - } - - if (keyFile.has_key ("RAW", "PreBlacktwo")) { - raw.bayersensor.black2 = keyFile.get_double ("RAW", "PreBlacktwo"); - - if (pedited) { - pedited->raw.bayersensor.exBlack2 = true; - } - } - - if (keyFile.has_key ("RAW", "PreBlackthree")) { - raw.bayersensor.black3 = keyFile.get_double ("RAW", "PreBlackthree"); - - if (pedited) { - pedited->raw.bayersensor.exBlack3 = true; - } - } - - if (keyFile.has_key ("RAW", "PreTwoGreen")) { - raw.bayersensor.twogreen = keyFile.get_boolean ("RAW", "PreTwoGreen"); - - if (pedited) { - pedited->raw.bayersensor.exTwoGreen = true; - } - } - -//if (keyFile.has_key ("RAW", "ALLEnhance")) { raw.bayersensor.all_enhance = keyFile.get_boolean("RAW", "ALLEnhance"); if (pedited) pedited->raw.bayersensor.allEnhance = true; } + assignFromKeyfile(keyFile, "RAW", "Method", pedited, raw.bayersensor.method, pedited->raw.bayersensor.method); + assignFromKeyfile(keyFile, "RAW", "CcSteps", pedited, raw.bayersensor.ccSteps, pedited->raw.bayersensor.ccSteps); + assignFromKeyfile(keyFile, "RAW", "LineDenoise", pedited, raw.bayersensor.linenoise, pedited->raw.bayersensor.linenoise); + assignFromKeyfile(keyFile, "RAW", "GreenEqThreshold", pedited, raw.bayersensor.greenthresh, pedited->raw.bayersensor.greenEq); + assignFromKeyfile(keyFile, "RAW", "DCBIterations", pedited, raw.bayersensor.dcb_iterations, pedited->raw.bayersensor.dcbIterations); + assignFromKeyfile(keyFile, "RAW", "DCBEnhance", pedited, raw.bayersensor.dcb_enhance, pedited->raw.bayersensor.dcbEnhance); + assignFromKeyfile(keyFile, "RAW", "LMMSEIterations", pedited, raw.bayersensor.lmmse_iterations, pedited->raw.bayersensor.lmmseIterations); + assignFromKeyfile(keyFile, "RAW", "PreBlackzero", pedited, raw.bayersensor.black0, pedited->raw.bayersensor.exBlack0); + assignFromKeyfile(keyFile, "RAW", "PreBlackone", pedited, raw.bayersensor.black1, pedited->raw.bayersensor.exBlack1); + assignFromKeyfile(keyFile, "RAW", "PreBlacktwo", pedited, raw.bayersensor.black2, pedited->raw.bayersensor.exBlack2); + assignFromKeyfile(keyFile, "RAW", "PreBlackthree", pedited, raw.bayersensor.black3, pedited->raw.bayersensor.exBlack3); + assignFromKeyfile(keyFile, "RAW", "PreTwoGreen", pedited, raw.bayersensor.twogreen, pedited->raw.bayersensor.exTwoGreen); } } -// load Bayer sensors' raw settings if (keyFile.has_group ("RAW Bayer")) { - if (keyFile.has_key ("RAW Bayer", "Method")) { - raw.bayersensor.method = keyFile.get_string ("RAW Bayer", "Method"); - - if (pedited) { - pedited->raw.bayersensor.method = true; - } - } + assignFromKeyfile(keyFile, "RAW Bayer", "Method", pedited, raw.bayersensor.method, pedited->raw.bayersensor.method); if (keyFile.has_key ("RAW Bayer", "ImageNum")) { raw.bayersensor.imageNum = keyFile.get_integer ("RAW Bayer", "ImageNum") - 1; @@ -7816,104 +4576,21 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("RAW Bayer", "CcSteps")) { - raw.bayersensor.ccSteps = keyFile.get_integer ("RAW Bayer", "CcSteps"); - - if (pedited) { - pedited->raw.bayersensor.ccSteps = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "PreBlack0")) { - raw.bayersensor.black0 = keyFile.get_double ("RAW Bayer", "PreBlack0"); - - if (pedited) { - pedited->raw.bayersensor.exBlack0 = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "PreBlack1")) { - raw.bayersensor.black1 = keyFile.get_double ("RAW Bayer", "PreBlack1"); - - if (pedited) { - pedited->raw.bayersensor.exBlack1 = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "PreBlack2")) { - raw.bayersensor.black2 = keyFile.get_double ("RAW Bayer", "PreBlack2"); - - if (pedited) { - pedited->raw.bayersensor.exBlack2 = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "PreBlack3")) { - raw.bayersensor.black3 = keyFile.get_double ("RAW Bayer", "PreBlack3"); - - if (pedited) { - pedited->raw.bayersensor.exBlack3 = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "PreTwoGreen")) { - raw.bayersensor.twogreen = keyFile.get_boolean ("RAW Bayer", "PreTwoGreen"); - - if (pedited) { - pedited->raw.bayersensor.exTwoGreen = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "LineDenoise")) { - raw.bayersensor.linenoise = keyFile.get_integer ("RAW Bayer", "LineDenoise" ); - - if (pedited) { - pedited->raw.bayersensor.linenoise = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "GreenEqThreshold")) { - raw.bayersensor.greenthresh = keyFile.get_integer ("RAW Bayer", "GreenEqThreshold"); - - if (pedited) { - pedited->raw.bayersensor.greenEq = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "DCBIterations")) { - raw.bayersensor.dcb_iterations = keyFile.get_integer ("RAW Bayer", "DCBIterations"); - - if (pedited) { - pedited->raw.bayersensor.dcbIterations = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "DCBEnhance")) { - raw.bayersensor.dcb_enhance = keyFile.get_boolean ("RAW Bayer", "DCBEnhance"); - - if (pedited) { - pedited->raw.bayersensor.dcbEnhance = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "LMMSEIterations")) { - raw.bayersensor.lmmse_iterations = keyFile.get_integer ("RAW Bayer", "LMMSEIterations"); - - if (pedited) { - pedited->raw.bayersensor.lmmseIterations = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "PixelShiftMotion")) { - raw.bayersensor.pixelShiftMotion = keyFile.get_integer ("RAW Bayer", "PixelShiftMotion"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftMotion = true; - } - } + assignFromKeyfile(keyFile, "RAW Bayer", "CcSteps", pedited, raw.bayersensor.ccSteps, pedited->raw.bayersensor.ccSteps); + assignFromKeyfile(keyFile, "RAW Bayer", "PreBlack0", pedited, raw.bayersensor.black0, pedited->raw.bayersensor.exBlack0); + assignFromKeyfile(keyFile, "RAW Bayer", "PreBlack1", pedited, raw.bayersensor.black1, pedited->raw.bayersensor.exBlack1); + assignFromKeyfile(keyFile, "RAW Bayer", "PreBlack2", pedited, raw.bayersensor.black2, pedited->raw.bayersensor.exBlack2); + assignFromKeyfile(keyFile, "RAW Bayer", "PreBlack3", pedited, raw.bayersensor.black3, pedited->raw.bayersensor.exBlack3); + assignFromKeyfile(keyFile, "RAW Bayer", "PreTwoGreen", pedited, raw.bayersensor.twogreen, pedited->raw.bayersensor.exTwoGreen); + assignFromKeyfile(keyFile, "RAW Bayer", "LineDenoise", pedited, raw.bayersensor.linenoise, pedited->raw.bayersensor.linenoise); + assignFromKeyfile(keyFile, "RAW Bayer", "GreenEqThreshold", pedited, raw.bayersensor.greenthresh, pedited->raw.bayersensor.greenEq); + assignFromKeyfile(keyFile, "RAW Bayer", "DCBIterations", pedited, raw.bayersensor.dcb_iterations, pedited->raw.bayersensor.dcbIterations); + assignFromKeyfile(keyFile, "RAW Bayer", "DCBEnhance", pedited, raw.bayersensor.dcb_enhance, pedited->raw.bayersensor.dcbEnhance); + assignFromKeyfile(keyFile, "RAW Bayer", "LMMSEIterations", pedited, raw.bayersensor.lmmse_iterations, pedited->raw.bayersensor.lmmseIterations); + assignFromKeyfile(keyFile, "RAW Bayer", "PixelShiftMotion", pedited, raw.bayersensor.pixelShiftMotion, pedited->raw.bayersensor.pixelShiftMotion); if (keyFile.has_key ("RAW Bayer", "PixelShiftMotionCorrection")) { - raw.bayersensor.pixelShiftMotionCorrection = (RAWParams::BayerSensor::ePSMotionCorrection)keyFile.get_integer ("RAW Bayer", "PixelShiftMotionCorrection"); + raw.bayersensor.pixelShiftMotionCorrection = (RAWParams::BayerSensor::PSMotionCorrection)keyFile.get_integer ("RAW Bayer", "PixelShiftMotionCorrection"); if (pedited) { pedited->raw.bayersensor.pixelShiftMotionCorrection = true; @@ -7921,280 +4598,55 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } if (keyFile.has_key ("RAW Bayer", "PixelShiftMotionCorrectionMethod")) { - raw.bayersensor.pixelShiftMotionCorrectionMethod = (RAWParams::BayerSensor::ePSMotionCorrectionMethod)keyFile.get_integer ("RAW Bayer", "PixelShiftMotionCorrectionMethod"); + raw.bayersensor.pixelShiftMotionCorrectionMethod = (RAWParams::BayerSensor::PSMotionCorrectionMethod)keyFile.get_integer ("RAW Bayer", "PixelShiftMotionCorrectionMethod"); if (pedited) { pedited->raw.bayersensor.pixelShiftMotionCorrectionMethod = true; } } - if (keyFile.has_key ("RAW Bayer", "pixelShiftStddevFactorGreen")) { - raw.bayersensor.pixelShiftStddevFactorGreen = keyFile.get_double ("RAW Bayer", "pixelShiftStddevFactorGreen"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftStddevFactorGreen = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftStddevFactorRed")) { - raw.bayersensor.pixelShiftStddevFactorRed = keyFile.get_double ("RAW Bayer", "pixelShiftStddevFactorRed"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftStddevFactorRed = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftStddevFactorBlue")) { - raw.bayersensor.pixelShiftStddevFactorBlue = keyFile.get_double ("RAW Bayer", "pixelShiftStddevFactorBlue"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftStddevFactorBlue = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "PixelShiftEperIso")) { - raw.bayersensor.pixelShiftEperIso = keyFile.get_double ("RAW Bayer", "PixelShiftEperIso"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftEperIso = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "PixelShiftNreadIso")) { - raw.bayersensor.pixelShiftNreadIso = keyFile.get_double ("RAW Bayer", "PixelShiftNreadIso"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftNreadIso = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "PixelShiftPrnu")) { - raw.bayersensor.pixelShiftPrnu = keyFile.get_double ("RAW Bayer", "PixelShiftPrnu"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftPrnu = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "PixelShiftSigma")) { - raw.bayersensor.pixelShiftSigma = keyFile.get_double ("RAW Bayer", "PixelShiftSigma"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftSigma = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "PixelShiftSum")) { - raw.bayersensor.pixelShiftSum = keyFile.get_double ("RAW Bayer", "PixelShiftSum"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftSum = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "PixelShiftRedBlueWeight")) { - raw.bayersensor.pixelShiftRedBlueWeight = keyFile.get_double ("RAW Bayer", "PixelShiftRedBlueWeight"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftRedBlueWeight = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "PixelShiftShowMotion")) { - raw.bayersensor.pixelShiftShowMotion = keyFile.get_boolean ("RAW Bayer", "PixelShiftShowMotion"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftShowMotion = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "PixelShiftShowMotionMaskOnly")) { - raw.bayersensor.pixelShiftShowMotionMaskOnly = keyFile.get_boolean ("RAW Bayer", "PixelShiftShowMotionMaskOnly"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftShowMotionMaskOnly = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftAutomatic")) { - raw.bayersensor.pixelShiftAutomatic = keyFile.get_boolean ("RAW Bayer", "pixelShiftAutomatic"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftAutomatic = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftNonGreenHorizontal")) { - raw.bayersensor.pixelShiftNonGreenHorizontal = keyFile.get_boolean ("RAW Bayer", "pixelShiftNonGreenHorizontal"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftNonGreenHorizontal = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftNonGreenVertical")) { - raw.bayersensor.pixelShiftNonGreenVertical = keyFile.get_boolean ("RAW Bayer", "pixelShiftNonGreenVertical"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftNonGreenVertical = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftHoleFill")) { - raw.bayersensor.pixelShiftHoleFill = keyFile.get_boolean ("RAW Bayer", "pixelShiftHoleFill"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftHoleFill = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftMedian")) { - raw.bayersensor.pixelShiftMedian = keyFile.get_boolean ("RAW Bayer", "pixelShiftMedian"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftMedian = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftMedian3")) { - raw.bayersensor.pixelShiftMedian3 = keyFile.get_boolean ("RAW Bayer", "pixelShiftMedian3"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftMedian3 = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftGreen")) { - raw.bayersensor.pixelShiftGreen = keyFile.get_boolean ("RAW Bayer", "pixelShiftGreen"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftGreen = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftBlur")) { - raw.bayersensor.pixelShiftBlur = keyFile.get_boolean ("RAW Bayer", "pixelShiftBlur"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftBlur = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftSmoothFactor")) { - raw.bayersensor.pixelShiftSmoothFactor = keyFile.get_double ("RAW Bayer", "pixelShiftSmoothFactor"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftSmooth = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftExp0")) { - raw.bayersensor.pixelShiftExp0 = keyFile.get_boolean ("RAW Bayer", "pixelShiftExp0"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftExp0 = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftLmmse")) { - raw.bayersensor.pixelShiftLmmse = keyFile.get_boolean ("RAW Bayer", "pixelShiftLmmse"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftLmmse = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftEqualBright")) { - raw.bayersensor.pixelShiftEqualBright = keyFile.get_boolean ("RAW Bayer", "pixelShiftEqualBright"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftEqualBright = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftEqualBrightChannel")) { - raw.bayersensor.pixelShiftEqualBrightChannel = keyFile.get_boolean ("RAW Bayer", "pixelShiftEqualBrightChannel"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftEqualBrightChannel = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftNonGreenCross")) { - raw.bayersensor.pixelShiftNonGreenCross = keyFile.get_boolean ("RAW Bayer", "pixelShiftNonGreenCross"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftNonGreenCross = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftNonGreenCross2")) { - raw.bayersensor.pixelShiftNonGreenCross2 = keyFile.get_boolean ("RAW Bayer", "pixelShiftNonGreenCross2"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftNonGreenCross2 = true; - } - } - - if (keyFile.has_key ("RAW Bayer", "pixelShiftNonGreenAmaze")) { - raw.bayersensor.pixelShiftNonGreenAmaze = keyFile.get_boolean ("RAW Bayer", "pixelShiftNonGreenAmaze"); - - if (pedited) { - pedited->raw.bayersensor.pixelShiftNonGreenAmaze = true; - } - } + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftStddevFactorGreen", pedited, raw.bayersensor.pixelShiftStddevFactorGreen, pedited->raw.bayersensor.pixelShiftStddevFactorGreen); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftStddevFactorRed", pedited, raw.bayersensor.pixelShiftStddevFactorRed, pedited->raw.bayersensor.pixelShiftStddevFactorRed); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftStddevFactorBlue", pedited, raw.bayersensor.pixelShiftStddevFactorBlue, pedited->raw.bayersensor.pixelShiftStddevFactorBlue); + assignFromKeyfile(keyFile, "RAW Bayer", "PixelShiftEperIso", pedited, raw.bayersensor.pixelShiftEperIso, pedited->raw.bayersensor.pixelShiftEperIso); + assignFromKeyfile(keyFile, "RAW Bayer", "PixelShiftNreadIso", pedited, raw.bayersensor.pixelShiftNreadIso, pedited->raw.bayersensor.pixelShiftNreadIso); + assignFromKeyfile(keyFile, "RAW Bayer", "PixelShiftPrnu", pedited, raw.bayersensor.pixelShiftPrnu, pedited->raw.bayersensor.pixelShiftPrnu); + assignFromKeyfile(keyFile, "RAW Bayer", "PixelShiftSigma", pedited, raw.bayersensor.pixelShiftSigma, pedited->raw.bayersensor.pixelShiftSigma); + assignFromKeyfile(keyFile, "RAW Bayer", "PixelShiftSum", pedited, raw.bayersensor.pixelShiftSum, pedited->raw.bayersensor.pixelShiftSum); + assignFromKeyfile(keyFile, "RAW Bayer", "PixelShiftRedBlueWeight", pedited, raw.bayersensor.pixelShiftRedBlueWeight, pedited->raw.bayersensor.pixelShiftRedBlueWeight); + assignFromKeyfile(keyFile, "RAW Bayer", "PixelShiftShowMotion", pedited, raw.bayersensor.pixelShiftShowMotion, pedited->raw.bayersensor.pixelShiftShowMotion); + assignFromKeyfile(keyFile, "RAW Bayer", "PixelShiftShowMotionMaskOnly", pedited, raw.bayersensor.pixelShiftShowMotionMaskOnly, pedited->raw.bayersensor.pixelShiftShowMotionMaskOnly); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftAutomatic", pedited, raw.bayersensor.pixelShiftAutomatic, pedited->raw.bayersensor.pixelShiftAutomatic); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftNonGreenHorizontal", pedited, raw.bayersensor.pixelShiftNonGreenHorizontal, pedited->raw.bayersensor.pixelShiftNonGreenHorizontal); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftNonGreenVertical", pedited, raw.bayersensor.pixelShiftNonGreenVertical, pedited->raw.bayersensor.pixelShiftNonGreenVertical); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftHoleFill", pedited, raw.bayersensor.pixelShiftHoleFill, pedited->raw.bayersensor.pixelShiftHoleFill); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftMedian", pedited, raw.bayersensor.pixelShiftMedian, pedited->raw.bayersensor.pixelShiftMedian); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftMedian3", pedited, raw.bayersensor.pixelShiftMedian3, pedited->raw.bayersensor.pixelShiftMedian3); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftGreen", pedited, raw.bayersensor.pixelShiftGreen, pedited->raw.bayersensor.pixelShiftGreen); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftBlur", pedited, raw.bayersensor.pixelShiftBlur, pedited->raw.bayersensor.pixelShiftBlur); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftSmoothFactor", pedited, raw.bayersensor.pixelShiftSmoothFactor, pedited->raw.bayersensor.pixelShiftSmooth); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftExp0", pedited, raw.bayersensor.pixelShiftExp0, pedited->raw.bayersensor.pixelShiftExp0); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftLmmse", pedited, raw.bayersensor.pixelShiftLmmse, pedited->raw.bayersensor.pixelShiftLmmse); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftEqualBright", pedited, raw.bayersensor.pixelShiftEqualBright, pedited->raw.bayersensor.pixelShiftEqualBright); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftEqualBrightChannel", pedited, raw.bayersensor.pixelShiftEqualBrightChannel, pedited->raw.bayersensor.pixelShiftEqualBrightChannel); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftNonGreenCross", pedited, raw.bayersensor.pixelShiftNonGreenCross, pedited->raw.bayersensor.pixelShiftNonGreenCross); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftNonGreenCross2", pedited, raw.bayersensor.pixelShiftNonGreenCross2, pedited->raw.bayersensor.pixelShiftNonGreenCross2); + assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftNonGreenAmaze", pedited, raw.bayersensor.pixelShiftNonGreenAmaze, pedited->raw.bayersensor.pixelShiftNonGreenAmaze); } -// load X-Trans sensors' raw settings if (keyFile.has_group ("RAW X-Trans")) { - if (keyFile.has_key ("RAW X-Trans", "Method")) { - raw.xtranssensor.method = keyFile.get_string ("RAW X-Trans", "Method"); - - if (pedited) { - pedited->raw.xtranssensor.method = true; - } - } - - if (keyFile.has_key ("RAW X-Trans", "CcSteps")) { - raw.xtranssensor.ccSteps = keyFile.get_integer ("RAW X-Trans", "CcSteps"); - - if (pedited) { - pedited->raw.xtranssensor.ccSteps = true; - } - } - - if (keyFile.has_key ("RAW X-Trans", "PreBlackRed")) { - raw.xtranssensor.blackred = keyFile.get_double ("RAW X-Trans", "PreBlackRed"); - - if (pedited) { - pedited->raw.xtranssensor.exBlackRed = true; - } - } - - if (keyFile.has_key ("RAW X-Trans", "PreBlackGreen")) { - raw.xtranssensor.blackgreen = keyFile.get_double ("RAW X-Trans", "PreBlackGreen"); - - if (pedited) { - pedited->raw.xtranssensor.exBlackGreen = true; - } - } - - if (keyFile.has_key ("RAW X-Trans", "PreBlackBlue")) { - raw.xtranssensor.blackblue = keyFile.get_double ("RAW X-Trans", "PreBlackBlue"); - - if (pedited) { - pedited->raw.xtranssensor.exBlackBlue = true; - } - } + assignFromKeyfile(keyFile, "RAW X-Trans", "Method", pedited, raw.xtranssensor.method, pedited->raw.xtranssensor.method); + assignFromKeyfile(keyFile, "RAW X-Trans", "CcSteps", pedited, raw.xtranssensor.ccSteps, pedited->raw.xtranssensor.ccSteps); + assignFromKeyfile(keyFile, "RAW X-Trans", "PreBlackRed", pedited, raw.xtranssensor.blackred, pedited->raw.xtranssensor.exBlackRed); + assignFromKeyfile(keyFile, "RAW X-Trans", "PreBlackGreen", pedited, raw.xtranssensor.blackgreen, pedited->raw.xtranssensor.exBlackGreen); + assignFromKeyfile(keyFile, "RAW X-Trans", "PreBlackBlue", pedited, raw.xtranssensor.blackblue, pedited->raw.xtranssensor.exBlackBlue); } - // load exif change settings if (keyFile.has_group ("Exif")) { std::vector keys = keyFile.get_keys ("Exif"); - for (int i = 0; i < (int)keys.size(); i++) { - Glib::ustring tmpStr = keyFile.get_string ("Exif", keys[i]); - exif[keys[i]] = keyFile.get_string ("Exif", keys[i]); + for (const auto& key : keyFile.get_keys("Exif")) { + exif[key] = keyFile.get_string ("Exif", key); if (pedited) { pedited->exif = true; @@ -8215,12 +4667,9 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) * i.e. they don't merge */ if (keyFile.has_group ("IPTC")) { - std::vector keys = keyFile.get_keys ("IPTC"); - IPTCPairs::iterator element; - - for (unsigned int i = 0; i < keys.size(); i++) { + for (const auto& key : keyFile.get_keys("IPTC")) { // does this key already exist? - element = iptc.find (keys[i]); + const IPTCPairs::iterator element = iptc.find(key); if (element != iptc.end()) { // it already exist so we cleanup the values @@ -8228,13 +4677,8 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } // TODO: look out if merging Keywords and SupplementalCategories from the procparams chain would be interesting - std::vector currIptc = keyFile.get_string_list ("IPTC", keys[i]); - - for ( - std::vector::iterator currLoadedTagValue = currIptc.begin(); - currLoadedTagValue != currIptc.end(); - ++currLoadedTagValue) { - iptc[keys[i]].push_back (currLoadedTagValue->data()); + for (const auto& currLoadedTagValue : keyFile.get_string_list ("IPTC", key)) { + iptc[key].push_back (currLoadedTagValue); } if (pedited) { @@ -8243,7 +4687,6 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - return 0; } catch (const Glib::Error& e) { printf ("-->%s\n", e.what().c_str()); @@ -8258,537 +4701,94 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) return 0; } -const Glib::ustring ColorManagementParams::NoICMString = Glib::ustring ("No ICM: sRGB output"); - -bool operator== (const WaveletParams & a, const WaveletParams & b) +ProcParams* ProcParams::create() { - if (a.enabled != b.enabled) { - return false; - } - - for (int i = 0; i < 9; i++) { - if (a.c[i] != b.c[i]) { - return false; - } - } - - for (int i = 0; i < 9; i++) { - if (a.ch[i] != b.ch[i]) { - return false; - } - } - - return true; + return new ProcParams(); } - - -bool operator== (const DirPyrEqualizerParams & a, const DirPyrEqualizerParams & b) +void ProcParams::destroy(ProcParams* pp) { - if (a.enabled != b.enabled) { - return false; - } - - for (int i = 0; i < 6; i++) { - if (a.mult[i] != b.mult[i]) { - return false; - } - } - - return a.threshold == b.threshold; + delete pp; } -/*bool operator==(const ExifPairs& a, const ExifPairs& b) { - - return a.field == b.field && a.value == b.value; -} - -bool operator==(const IPTCPairs& a, const IPTCPairs& b) { - - return a.field == b.field && a.values == b.values; -}*/ -bool ProcParams::operator== (const ProcParams& other) +bool ProcParams::operator ==(const ProcParams& other) const { - return - toneCurve.curve == other.toneCurve.curve - && toneCurve.curve2 == other.toneCurve.curve2 - && toneCurve.brightness == other.toneCurve.brightness - && toneCurve.black == other.toneCurve.black - && toneCurve.contrast == other.toneCurve.contrast - && toneCurve.saturation == other.toneCurve.saturation - && toneCurve.shcompr == other.toneCurve.shcompr - && toneCurve.hlcompr == other.toneCurve.hlcompr - && toneCurve.hlcomprthresh == other.toneCurve.hlcomprthresh - && toneCurve.autoexp == other.toneCurve.autoexp - && toneCurve.clip == other.toneCurve.clip - && toneCurve.expcomp == other.toneCurve.expcomp - && toneCurve.curveMode == other.toneCurve.curveMode - && toneCurve.curveMode2 == other.toneCurve.curveMode2 - && toneCurve.hrenabled == other.toneCurve.hrenabled - && toneCurve.method == other.toneCurve.method - && retinex.cdcurve == other.retinex.cdcurve - && retinex.mapcurve == other.retinex.mapcurve - && retinex.cdHcurve == other.retinex.cdHcurve - && retinex.lhcurve == other.retinex.lhcurve - && retinex.transmissionCurve == other.retinex.transmissionCurve - && retinex.gaintransmissionCurve == other.retinex.gaintransmissionCurve - && retinex.str == other.retinex.str - && retinex.scal == other.retinex.scal - && retinex.iter == other.retinex.iter - && retinex.grad == other.retinex.grad - && retinex.grads == other.retinex.grads - && retinex.gam == other.retinex.gam - && retinex.slope == other.retinex.slope - && retinex.neigh == other.retinex.neigh - && retinex.limd == other.retinex.limd - && retinex.highl == other.retinex.highl - && retinex.highlights == other.retinex.highlights - && retinex.htonalwidth == other.retinex.htonalwidth - && retinex.shadows == other.retinex.shadows - && retinex.stonalwidth == other.retinex.stonalwidth - && retinex.radius == other.retinex.radius - && retinex.skal == other.retinex.skal - && retinex.offs == other.retinex.offs - && retinex.retinexMethod == other.retinex.retinexMethod - && retinex.mapMethod == other.retinex.mapMethod - && retinex.viewMethod == other.retinex.viewMethod - && retinex.retinexcolorspace == other.retinex.retinexcolorspace - && retinex.gammaretinex == other.retinex.gammaretinex - && retinex.vart == other.retinex.vart - && retinex.medianmap == other.retinex.medianmap - && retinex.enabled == other.retinex.enabled - && labCurve.lcurve == other.labCurve.lcurve - && labCurve.acurve == other.labCurve.acurve - && labCurve.bcurve == other.labCurve.bcurve - && labCurve.cccurve == other.labCurve.cccurve - && labCurve.chcurve == other.labCurve.chcurve - && labCurve.lhcurve == other.labCurve.lhcurve - && labCurve.hhcurve == other.labCurve.hhcurve - && labCurve.lccurve == other.labCurve.lccurve - && labCurve.clcurve == other.labCurve.clcurve - && labCurve.brightness == other.labCurve.brightness - && labCurve.contrast == other.labCurve.contrast - && labCurve.chromaticity == other.labCurve.chromaticity - && labCurve.avoidcolorshift == other.labCurve.avoidcolorshift - && labCurve.rstprotection == other.labCurve.rstprotection - && labCurve.lcredsk == other.labCurve.lcredsk - && sharpenEdge.enabled == other.sharpenEdge.enabled - && sharpenEdge.passes == other.sharpenEdge.passes - && sharpenEdge.amount == other.sharpenEdge.amount - && sharpenEdge.threechannels == other.sharpenEdge.threechannels - && sharpenMicro.enabled == other.sharpenMicro.enabled - && sharpenMicro.matrix == other.sharpenMicro.matrix - && sharpenMicro.amount == other.sharpenMicro.amount - && sharpenMicro.uniformity == other.sharpenMicro.uniformity - && sharpening.enabled == other.sharpening.enabled - && sharpening.radius == other.sharpening.radius - && sharpening.amount == other.sharpening.amount - && sharpening.threshold == other.sharpening.threshold - && sharpening.edgesonly == other.sharpening.edgesonly - && sharpening.edges_radius == other.sharpening.edges_radius - && sharpening.edges_tolerance == other.sharpening.edges_tolerance - && sharpening.halocontrol == other.sharpening.halocontrol - && sharpening.halocontrol_amount == other.sharpening.halocontrol_amount - && sharpening.method == other.sharpening.method - && sharpening.deconvamount == other.sharpening.deconvamount - && sharpening.deconvradius == other.sharpening.deconvradius - && sharpening.deconviter == other.sharpening.deconviter - && sharpening.deconvdamping == other.sharpening.deconvdamping - && prsharpening.enabled == other.prsharpening.enabled - && prsharpening.radius == other.prsharpening.radius - && prsharpening.amount == other.prsharpening.amount - && prsharpening.threshold == other.prsharpening.threshold - && prsharpening.edgesonly == other.prsharpening.edgesonly - && prsharpening.edges_radius == other.prsharpening.edges_radius - && prsharpening.edges_tolerance == other.prsharpening.edges_tolerance - && prsharpening.halocontrol == other.prsharpening.halocontrol - && prsharpening.halocontrol_amount == other.prsharpening.halocontrol_amount - && prsharpening.method == other.prsharpening.method - && prsharpening.deconvamount == other.prsharpening.deconvamount - && prsharpening.deconvradius == other.prsharpening.deconvradius - && prsharpening.deconviter == other.prsharpening.deconviter - && prsharpening.deconvdamping == other.prsharpening.deconvdamping - && vibrance.enabled == other.vibrance.enabled - && vibrance.pastels == other.vibrance.pastels - && vibrance.saturated == other.vibrance.saturated - && vibrance.psthreshold == other.vibrance.psthreshold - && vibrance.protectskins == other.vibrance.protectskins - && vibrance.avoidcolorshift == other.vibrance.avoidcolorshift - && vibrance.pastsattog == other.vibrance.pastsattog - && vibrance.skintonescurve == other.vibrance.skintonescurve - //&& colorBoost.amount == other.colorBoost.amount - //&& colorBoost.avoidclip == other.colorBoost.avoidclip - //&& colorBoost.enable_saturationlimiter == other.colorBoost.enable_saturationlimiter - //&& colorBoost.saturationlimit == other.colorBoost.saturationlimit - && wb.method == other.wb.method - && wb.green == other.wb.green - && wb.temperature == other.wb.temperature - && wb.equal == other.wb.equal - //&& colorShift.a == other.colorShift.a - //&& colorShift.b == other.colorShift.b - && colorappearance.enabled == other.colorappearance.enabled - && colorappearance.degree == other.colorappearance.degree - && colorappearance.autodegree == other.colorappearance.autodegree - && colorappearance.degreeout == other.colorappearance.degreeout - && colorappearance.autodegreeout == other.colorappearance.autodegreeout - && colorappearance.surround == other.colorappearance.surround - && colorappearance.surrsrc == other.colorappearance.surrsrc - && colorappearance.adapscen == other.colorappearance.adapscen - && colorappearance.autoadapscen == other.colorappearance.autoadapscen - && colorappearance.ybscen == other.colorappearance.ybscen - && colorappearance.autoybscen == other.colorappearance.autoybscen - && colorappearance.adaplum == other.colorappearance.adaplum - && colorappearance.badpixsl == other.colorappearance.badpixsl - && colorappearance.wbmodel == other.colorappearance.wbmodel - && colorappearance.algo == other.colorappearance.algo - && colorappearance.curveMode == other.colorappearance.curveMode - && colorappearance.curveMode2 == other.colorappearance.curveMode2 - && colorappearance.curveMode3 == other.colorappearance.curveMode3 - && colorappearance.jlight == other.colorappearance.jlight - && colorappearance.qbright == other.colorappearance.qbright - && colorappearance.chroma == other.colorappearance.chroma - && colorappearance.schroma == other.colorappearance.schroma - && colorappearance.mchroma == other.colorappearance.mchroma - && colorappearance.rstprotection == other.colorappearance.rstprotection - && colorappearance.contrast == other.colorappearance.contrast - && colorappearance.qcontrast == other.colorappearance.qcontrast - && colorappearance.colorh == other.colorappearance.colorh - && colorappearance.tempout == other.colorappearance.tempout - && colorappearance.greenout == other.colorappearance.greenout - && colorappearance.tempsc == other.colorappearance.tempsc - && colorappearance.greensc == other.colorappearance.greensc - && colorappearance.ybout == other.colorappearance.ybout - && impulseDenoise.enabled == other.impulseDenoise.enabled - && impulseDenoise.thresh == other.impulseDenoise.thresh - && dirpyrDenoise.enabled == other.dirpyrDenoise.enabled - && dirpyrDenoise.enhance == other.dirpyrDenoise.enhance - && dirpyrDenoise.median == other.dirpyrDenoise.median -// && dirpyrDenoise.perform == other.dirpyrDenoise.perform - && dirpyrDenoise.luma == other.dirpyrDenoise.luma - && dirpyrDenoise.lcurve == other.dirpyrDenoise.lcurve - && dirpyrDenoise.cccurve == other.dirpyrDenoise.cccurve - && dirpyrDenoise.Ldetail == other.dirpyrDenoise.Ldetail - && dirpyrDenoise.chroma == other.dirpyrDenoise.chroma - && dirpyrDenoise.dmethod == other.dirpyrDenoise.dmethod - && dirpyrDenoise.Lmethod == other.dirpyrDenoise.Lmethod - && dirpyrDenoise.Cmethod == other.dirpyrDenoise.Cmethod - && dirpyrDenoise.C2method == other.dirpyrDenoise.C2method - && dirpyrDenoise.smethod == other.dirpyrDenoise.smethod - && dirpyrDenoise.medmethod == other.dirpyrDenoise.medmethod - && dirpyrDenoise.methodmed == other.dirpyrDenoise.methodmed - && dirpyrDenoise.rgbmethod == other.dirpyrDenoise.rgbmethod - && dirpyrDenoise.redchro == other.dirpyrDenoise.redchro - && dirpyrDenoise.bluechro == other.dirpyrDenoise.bluechro - && dirpyrDenoise.gamma == other.dirpyrDenoise.gamma - && dirpyrDenoise.passes == other.dirpyrDenoise.passes - && epd.enabled == other.epd.enabled - && epd.strength == other.epd.strength - && epd.gamma == other.epd.gamma - && epd.edgeStopping == other.epd.edgeStopping - && epd.scale == other.epd.scale - && epd.reweightingIterates == other.epd.reweightingIterates - && fattal.enabled == other.fattal.enabled - && fattal.threshold == other.fattal.threshold - && fattal.amount == other.fattal.amount - && defringe.enabled == other.defringe.enabled - && defringe.radius == other.defringe.radius - && defringe.threshold == other.defringe.threshold - && defringe.huecurve == other.defringe.huecurve - - //&& lumaDenoise.enabled == other.lumaDenoise.enabled - //&& lumaDenoise.radius == other.lumaDenoise.radius - //&& lumaDenoise.edgetolerance == other.lumaDenoise.edgetolerance - //&& colorDenoise.enabled == other.colorDenoise.enabled - //&& colorDenoise.edgetolerance == other.colorDenoise.edgetolerance - //&& colorDenoise.edgesensitive == other.colorDenoise.edgesensitive - && sh.enabled == other.sh.enabled - && sh.hq == other.sh.hq - && sh.highlights == other.sh.highlights - && sh.htonalwidth == other.sh.htonalwidth - && sh.shadows == other.sh.shadows - && sh.stonalwidth == other.sh.stonalwidth - && sh.localcontrast == other.sh.localcontrast - && sh.radius == other.sh.radius - && crop.enabled == other.crop.enabled - && crop.x == other.crop.x - && crop.y == other.crop.y - && crop.w == other.crop.w - && crop.h == other.crop.h - && crop.fixratio == other.crop.fixratio - && crop.ratio == other.crop.ratio - && crop.orientation == other.crop.orientation - && crop.guide == other.crop.guide - && coarse.rotate == other.coarse.rotate - && coarse.hflip == other.coarse.hflip - && coarse.vflip == other.coarse.vflip - && rotate.degree == other.rotate.degree - && commonTrans.autofill == other.commonTrans.autofill - && distortion.amount == other.distortion.amount - && lensProf.lcMode == other.lensProf.lcMode - && lensProf.lcpFile == other.lensProf.lcpFile - && lensProf.useDist == other.lensProf.useDist - && lensProf.useVign == other.lensProf.useVign - && lensProf.useCA == other.lensProf.useCA - && lensProf.lfCameraMake == other.lensProf.lfCameraMake - && lensProf.lfCameraModel == other.lensProf.lfCameraModel - && lensProf.lfLens == other.lensProf.lfLens - && perspective.horizontal == other.perspective.horizontal - && perspective.vertical == other.perspective.vertical - && gradient.enabled == other.gradient.enabled - && gradient.degree == other.gradient.degree - && gradient.feather == other.gradient.feather - && gradient.strength == other.gradient.strength - && gradient.centerX == other.gradient.centerX - && gradient.centerY == other.gradient.centerY - && pcvignette.enabled == other.pcvignette.enabled - && pcvignette.strength == other.pcvignette.strength - && pcvignette.feather == other.pcvignette.feather - && pcvignette.roundness == other.pcvignette.roundness - && cacorrection.red == other.cacorrection.red - && cacorrection.blue == other.cacorrection.blue - && vignetting.amount == other.vignetting.amount - && vignetting.radius == other.vignetting.radius - && vignetting.strength == other.vignetting.strength - && vignetting.centerX == other.vignetting.centerX - && vignetting.centerY == other.vignetting.centerY - && !memcmp (&chmixer.red, &other.chmixer.red, 3 * sizeof (int)) - && !memcmp (&chmixer.green, &other.chmixer.green, 3 * sizeof (int)) - && !memcmp (&chmixer.blue, &other.chmixer.blue, 3 * sizeof (int)) - && blackwhite.mixerRed == other.blackwhite.mixerRed - && blackwhite.mixerOrange == other.blackwhite.mixerOrange - && blackwhite.mixerYellow == other.blackwhite.mixerYellow - && blackwhite.mixerGreen == other.blackwhite.mixerGreen - && blackwhite.mixerCyan == other.blackwhite.mixerCyan - && blackwhite.mixerBlue == other.blackwhite.mixerBlue - && blackwhite.mixerMagenta == other.blackwhite.mixerMagenta - && blackwhite.mixerPurple == other.blackwhite.mixerPurple - && blackwhite.gammaRed == other.blackwhite.gammaRed - && blackwhite.gammaGreen == other.blackwhite.gammaGreen - && blackwhite.gammaBlue == other.blackwhite.gammaBlue - && blackwhite.filter == other.blackwhite.filter - && blackwhite.setting == other.blackwhite.setting - && blackwhite.method == other.blackwhite.method - && blackwhite.luminanceCurve == other.blackwhite.luminanceCurve - && blackwhite.beforeCurve == other.blackwhite.beforeCurve - && blackwhite.afterCurve == other.blackwhite.afterCurve - && blackwhite.beforeCurveMode == other.blackwhite.beforeCurveMode - && blackwhite.afterCurveMode == other.blackwhite.afterCurveMode - && blackwhite.autoc == other.blackwhite.autoc - && blackwhite.algo == other.blackwhite.algo - && resize.scale == other.resize.scale - && resize.appliesTo == other.resize.appliesTo - && resize.method == other.resize.method - && resize.dataspec == other.resize.dataspec - && resize.width == other.resize.width - && resize.height == other.resize.height - && raw.bayersensor.method == other.raw.bayersensor.method - && raw.bayersensor.imageNum == other.raw.bayersensor.imageNum - && raw.bayersensor.ccSteps == other.raw.bayersensor.ccSteps - && raw.bayersensor.black0 == other.raw.bayersensor.black0 - && raw.bayersensor.black1 == other.raw.bayersensor.black1 - && raw.bayersensor.black2 == other.raw.bayersensor.black2 - && raw.bayersensor.black3 == other.raw.bayersensor.black3 - && raw.bayersensor.twogreen == other.raw.bayersensor.twogreen - && raw.bayersensor.greenthresh == other.raw.bayersensor.greenthresh - && raw.bayersensor.linenoise == other.raw.bayersensor.linenoise - && raw.bayersensor.dcb_iterations == other.raw.bayersensor.dcb_iterations - && raw.bayersensor.lmmse_iterations == other.raw.bayersensor.lmmse_iterations - && raw.bayersensor.pixelShiftMotion == other.raw.bayersensor.pixelShiftMotion - && raw.bayersensor.pixelShiftMotionCorrection == other.raw.bayersensor.pixelShiftMotionCorrection - && raw.bayersensor.pixelShiftMotionCorrectionMethod == other.raw.bayersensor.pixelShiftMotionCorrectionMethod - && raw.bayersensor.pixelShiftStddevFactorGreen == other.raw.bayersensor.pixelShiftStddevFactorGreen - && raw.bayersensor.pixelShiftStddevFactorRed == other.raw.bayersensor.pixelShiftStddevFactorRed - && raw.bayersensor.pixelShiftStddevFactorBlue == other.raw.bayersensor.pixelShiftStddevFactorBlue - && raw.bayersensor.pixelShiftEperIso == other.raw.bayersensor.pixelShiftEperIso - && raw.bayersensor.pixelShiftNreadIso == other.raw.bayersensor.pixelShiftNreadIso - && raw.bayersensor.pixelShiftPrnu == other.raw.bayersensor.pixelShiftPrnu - && raw.bayersensor.pixelShiftSigma == other.raw.bayersensor.pixelShiftSigma - && raw.bayersensor.pixelShiftSum == other.raw.bayersensor.pixelShiftSum - && raw.bayersensor.pixelShiftRedBlueWeight == other.raw.bayersensor.pixelShiftRedBlueWeight - && raw.bayersensor.pixelShiftShowMotion == other.raw.bayersensor.pixelShiftShowMotion - && raw.bayersensor.pixelShiftShowMotionMaskOnly == other.raw.bayersensor.pixelShiftShowMotionMaskOnly - && raw.bayersensor.pixelShiftAutomatic == other.raw.bayersensor.pixelShiftAutomatic - && raw.bayersensor.pixelShiftNonGreenHorizontal == other.raw.bayersensor.pixelShiftNonGreenHorizontal - && raw.bayersensor.pixelShiftNonGreenVertical == other.raw.bayersensor.pixelShiftNonGreenVertical - && raw.bayersensor.pixelShiftHoleFill == other.raw.bayersensor.pixelShiftHoleFill - && raw.bayersensor.pixelShiftMedian == other.raw.bayersensor.pixelShiftMedian - && raw.bayersensor.pixelShiftMedian3 == other.raw.bayersensor.pixelShiftMedian3 - && raw.bayersensor.pixelShiftGreen == other.raw.bayersensor.pixelShiftGreen - && raw.bayersensor.pixelShiftBlur == other.raw.bayersensor.pixelShiftBlur - && raw.bayersensor.pixelShiftSmoothFactor == other.raw.bayersensor.pixelShiftSmoothFactor - && raw.bayersensor.pixelShiftExp0 == other.raw.bayersensor.pixelShiftExp0 - && raw.bayersensor.pixelShiftLmmse == other.raw.bayersensor.pixelShiftLmmse - && raw.bayersensor.pixelShiftEqualBright == other.raw.bayersensor.pixelShiftEqualBright - && raw.bayersensor.pixelShiftEqualBrightChannel == other.raw.bayersensor.pixelShiftEqualBrightChannel - && raw.bayersensor.pixelShiftNonGreenCross == other.raw.bayersensor.pixelShiftNonGreenCross - && raw.bayersensor.pixelShiftNonGreenCross2 == other.raw.bayersensor.pixelShiftNonGreenCross2 - && raw.bayersensor.pixelShiftNonGreenAmaze == other.raw.bayersensor.pixelShiftNonGreenAmaze - && raw.bayersensor.dcb_enhance == other.raw.bayersensor.dcb_enhance - && raw.xtranssensor.method == other.raw.xtranssensor.method - && raw.xtranssensor.ccSteps == other.raw.xtranssensor.ccSteps - && raw.xtranssensor.blackred == other.raw.xtranssensor.blackred - && raw.xtranssensor.blackgreen == other.raw.xtranssensor.blackgreen - && raw.xtranssensor.blackblue == other.raw.xtranssensor.blackblue - && raw.dark_frame == other.raw.dark_frame - && raw.df_autoselect == other.raw.df_autoselect - && raw.ff_file == other.raw.ff_file - && raw.ff_AutoSelect == other.raw.ff_AutoSelect - && raw.ff_BlurRadius == other.raw.ff_BlurRadius - && raw.ff_BlurType == other.raw.ff_BlurType - && raw.ff_AutoClipControl == other.raw.ff_AutoClipControl - && raw.ff_clipControl == other.raw.ff_clipControl - && raw.expos == other.raw.expos - && raw.preser == other.raw.preser - && raw.ca_autocorrect == other.raw.ca_autocorrect - && raw.cared == other.raw.cared - && raw.cablue == other.raw.cablue - && raw.hotPixelFilter == other.raw.hotPixelFilter - && raw.deadPixelFilter == other.raw.deadPixelFilter - && raw.hotdeadpix_thresh == other.raw.hotdeadpix_thresh - && icm.input == other.icm.input - && icm.toneCurve == other.icm.toneCurve - && icm.applyLookTable == other.icm.applyLookTable - && icm.applyBaselineExposureOffset == other.icm.applyBaselineExposureOffset - && icm.applyHueSatMap == other.icm.applyHueSatMap - && icm.dcpIlluminant == other.icm.dcpIlluminant - && icm.working == other.icm.working - && icm.output == other.icm.output - && icm.gamma == other.icm.gamma - && icm.freegamma == other.icm.freegamma - && icm.gampos == other.icm.gampos - && icm.slpos == other.icm.slpos + toneCurve == other.toneCurve + && retinex == other.retinex + && labCurve == other.labCurve + && sharpenEdge == other.sharpenEdge + && sharpenMicro == other.sharpenMicro + && sharpening == other.sharpening + && prsharpening == other.prsharpening + && vibrance == other.vibrance + && wb == other.wb + && colorappearance == other.colorappearance + && impulseDenoise == other.impulseDenoise + && dirpyrDenoise == other.dirpyrDenoise + && epd == other.epd + && fattal == other.fattal + && defringe == other.defringe + && sh == other.sh + && crop == other.crop + && coarse == other.coarse + && rotate == other.rotate + && commonTrans == other.commonTrans + && distortion == other.distortion + && lensProf == other.lensProf + && perspective == other.perspective + && gradient == other.gradient + && pcvignette == other.pcvignette + && cacorrection == other.cacorrection + && vignetting == other.vignetting + && chmixer == other.chmixer + && blackwhite == other.blackwhite + && resize == other.resize + && raw == other.raw + && icm == other.icm && wavelet == other.wavelet - && wavelet.Lmethod == other.wavelet.Lmethod - && wavelet.CLmethod == other.wavelet.CLmethod - && wavelet.Backmethod == other.wavelet.Backmethod - && wavelet.Tilesmethod == other.wavelet.Tilesmethod - && wavelet.daubcoeffmethod == other.wavelet.daubcoeffmethod - && wavelet.CHmethod == other.wavelet.CHmethod - && wavelet.CHSLmethod == other.wavelet.CHSLmethod - && wavelet.EDmethod == other.wavelet.EDmethod - && wavelet.NPmethod == other.wavelet.NPmethod - && wavelet.BAmethod == other.wavelet.BAmethod - && wavelet.TMmethod == other.wavelet.TMmethod - && wavelet.HSmethod == other.wavelet.HSmethod - && wavelet.Dirmethod == other.wavelet.Dirmethod - && wavelet.rescon == other.wavelet.rescon - && wavelet.resconH == other.wavelet.resconH - && wavelet.reschro == other.wavelet.reschro - && wavelet.tmrs == other.wavelet.tmrs - && wavelet.gamma == other.wavelet.gamma - && wavelet.sup == other.wavelet.sup - && wavelet.sky == other.wavelet.sky - && wavelet.thres == other.wavelet.thres - && wavelet.chroma == other.wavelet.chroma - && wavelet.chro == other.wavelet.chro - && wavelet.tmr == other.wavelet.tmr - && wavelet.contrast == other.wavelet.contrast - && wavelet.median == other.wavelet.median - && wavelet.expcontrast == other.wavelet.expcontrast - && wavelet.expchroma == other.wavelet.expchroma - && wavelet.expedge == other.wavelet.expedge - && wavelet.expresid == other.wavelet.expresid - && wavelet.expfinal == other.wavelet.expfinal - && wavelet.exptoning == other.wavelet.exptoning - && wavelet.expnoise == other.wavelet.expnoise - && wavelet.medianlev == other.wavelet.medianlev - && wavelet.linkedg == other.wavelet.linkedg - && wavelet.cbenab == other.wavelet.cbenab - && wavelet.lipst == other.wavelet.lipst - && wavelet.Medgreinf == other.wavelet.Medgreinf - && wavelet.edgrad == other.wavelet.edgrad - && wavelet.edgval == other.wavelet.edgval - && wavelet.edgthresh == other.wavelet.edgthresh - && wavelet.thr == other.wavelet.thr - && wavelet.thrH == other.wavelet.thrH - && wavelet.threshold == other.wavelet.threshold - && wavelet.threshold2 == other.wavelet.threshold2 - && wavelet.edgedetect == other.wavelet.edgedetect - && wavelet.edgedetectthr == other.wavelet.edgedetectthr - && wavelet.edgedetectthr2 == other.wavelet.edgedetectthr2 - && wavelet.edgesensi == other.wavelet.edgesensi - && wavelet.edgeampli == other.wavelet.edgeampli - && wavelet.hueskin == other.wavelet.hueskin - && wavelet.hueskin2 == other.wavelet.hueskin2 - && wavelet.hllev == other.wavelet.hllev - && wavelet.bllev == other.wavelet.bllev - && wavelet.edgcont == other.wavelet.edgcont - && wavelet.level0noise == other.wavelet.level0noise - && wavelet.level1noise == other.wavelet.level1noise - && wavelet.level2noise == other.wavelet.level2noise - && wavelet.level3noise == other.wavelet.level3noise - && wavelet.pastlev == other.wavelet.pastlev - && wavelet.satlev == other.wavelet.satlev - && wavelet.opacityCurveRG == other.wavelet.opacityCurveRG - && wavelet.opacityCurveBY == other.wavelet.opacityCurveBY - && wavelet.opacityCurveW == other.wavelet.opacityCurveW - && wavelet.opacityCurveWL == other.wavelet.opacityCurveWL - && wavelet.hhcurve == other.wavelet.hhcurve - && wavelet.Chcurve == other.wavelet.Chcurve - && wavelet.ccwcurve == other.wavelet.ccwcurve - && wavelet.wavclCurve == other.wavelet.wavclCurve - && wavelet.skinprotect == other.wavelet.skinprotect - && wavelet.strength == other.wavelet.strength - && wavelet.balance == other.wavelet.balance - && wavelet.greenhigh == other.wavelet.greenhigh - && wavelet.greenmed == other.wavelet.greenmed - && wavelet.greenlow == other.wavelet.greenlow - && wavelet.bluehigh == other.wavelet.bluehigh - && wavelet.bluemed == other.wavelet.bluemed - && wavelet.bluelow == other.wavelet.bluelow - && wavelet.iter == other.wavelet.iter && dirpyrequalizer == other.dirpyrequalizer - // && dirpyrequalizer.algo == other.dirpyrequalizer.algo - && dirpyrequalizer.hueskin == other.dirpyrequalizer.hueskin - && dirpyrequalizer.threshold == other.dirpyrequalizer.threshold - && dirpyrequalizer.cbdlMethod == other.dirpyrequalizer.cbdlMethod - && dirpyrequalizer.skinprotect == other.dirpyrequalizer.skinprotect - && hsvequalizer.hcurve == other.hsvequalizer.hcurve - && hsvequalizer.scurve == other.hsvequalizer.scurve - && hsvequalizer.vcurve == other.hsvequalizer.vcurve - && filmSimulation.enabled == other.filmSimulation.enabled - && filmSimulation.clutFilename == other.filmSimulation.clutFilename - && filmSimulation.strength == other.filmSimulation.strength - && rgbCurves.rcurve == other.rgbCurves.rcurve - && rgbCurves.gcurve == other.rgbCurves.gcurve - && rgbCurves.bcurve == other.rgbCurves.bcurve - && colorToning.enabled == other.colorToning.enabled - && colorToning.twocolor == other.colorToning.twocolor - && colorToning.method == other.colorToning.method - && colorToning.colorCurve == other.colorToning.colorCurve - && colorToning.opacityCurve == other.colorToning.opacityCurve - && colorToning.autosat == other.colorToning.autosat - && colorToning.satProtectionThreshold == other.colorToning.satProtectionThreshold - && colorToning.saturatedOpacity == other.colorToning.saturatedOpacity - && colorToning.strength == other.colorToning.strength - && colorToning.hlColSat == other.colorToning.hlColSat - && colorToning.shadowsColSat == other.colorToning.shadowsColSat - && colorToning.balance == other.colorToning.balance - && colorToning.clcurve == other.colorToning.clcurve - && colorToning.cl2curve == other.colorToning.cl2curve - && colorToning.redlow == other.colorToning.redlow - && colorToning.greenlow == other.colorToning.greenlow - && colorToning.bluelow == other.colorToning.bluelow - && colorToning.satlow == other.colorToning.satlow - && colorToning.sathigh == other.colorToning.sathigh - && colorToning.redmed == other.colorToning.redmed - && colorToning.greenmed == other.colorToning.greenmed - && colorToning.bluemed == other.colorToning.bluemed - && colorToning.redhigh == other.colorToning.redhigh - && colorToning.greenhigh == other.colorToning.greenhigh - && colorToning.bluehigh == other.colorToning.bluehigh + && hsvequalizer == other.hsvequalizer + && filmSimulation == other.filmSimulation + && rgbCurves == other.rgbCurves + && colorToning == other.colorToning && exif == other.exif && iptc == other.iptc; } -bool ProcParams::operator!= (const ProcParams& other) +bool ProcParams::operator !=(const ProcParams& other) const { - - return ! (*this == other); + return !(*this == other); } -PartialProfile::PartialProfile (bool createInstance, bool paramsEditedValue) +void ProcParams::init() +{ +} + +void ProcParams::cleanup() +{ +} + +int ProcParams::write(const Glib::ustring& fname, const Glib::ustring& content) const +{ + int error = 0; + + if (fname.length()) { + FILE *f; + f = g_fopen (fname.c_str (), "wt"); + + if (f == nullptr) { + error = 1; + } else { + fprintf (f, "%s", content.c_str()); + fclose (f); + } + } + + return error; +} + +PartialProfile::PartialProfile(bool createInstance, bool paramsEditedValue) { if (createInstance) { pparams = new ProcParams(); @@ -8799,7 +4799,7 @@ PartialProfile::PartialProfile (bool createInstance, bool paramsEditedValue) } } -PartialProfile::PartialProfile (ProcParams* pp, ParamsEdited* pe, bool fullCopy) +PartialProfile::PartialProfile(ProcParams* pp, ParamsEdited* pe, bool fullCopy) { if (fullCopy && pp) { pparams = new ProcParams (*pp); @@ -8814,7 +4814,7 @@ PartialProfile::PartialProfile (ProcParams* pp, ParamsEdited* pe, bool fullCopy) } } -PartialProfile::PartialProfile (const ProcParams* pp, const ParamsEdited* pe) +PartialProfile::PartialProfile(const ProcParams* pp, const ParamsEdited* pe) { if (pp) { pparams = new ProcParams (*pp); @@ -8829,7 +4829,29 @@ PartialProfile::PartialProfile (const ProcParams* pp, const ParamsEdited* pe) } } -int PartialProfile::load (const Glib::ustring &fName) +void PartialProfile::deleteInstance() +{ + if (pparams) { + delete pparams; + pparams = nullptr; + } + + if (pedited) { + delete pedited; + pedited = nullptr; + } +} + +void PartialProfile::clearGeneral() +{ + if (pedited) { + pedited->general.colorlabel = false; + pedited->general.intrash = false; + pedited->general.rank = false; + } +} + +int PartialProfile::load(const Glib::ustring& fName) { if (!pparams) { pparams = new ProcParams(); @@ -8848,46 +4870,34 @@ int PartialProfile::load (const Glib::ustring &fName) } } -void PartialProfile::deleteInstance () -{ - if (pparams) { - delete pparams; - pparams = nullptr; - } - - if (pedited) { - delete pedited; - pedited = nullptr; - } -} - /* * Set the all values of the General section to false * in order to preserve them in applyTo */ -void PartialProfile::clearGeneral () -{ - if (pedited) { - pedited->general.colorlabel = false; - pedited->general.intrash = false; - pedited->general.rank = false; - } -} - -void PartialProfile::applyTo (ProcParams *destParams) const -{ - if (destParams && pparams && pedited) { - pedited->combine (*destParams, *pparams, true); - } -} - -void PartialProfile::set (bool v) +void PartialProfile::set(bool v) { if (pedited) { pedited->set (v); } } -} +void PartialProfile::applyTo(ProcParams* destParams) const +{ + if (destParams && pparams && pedited) { + pedited->combine (*destParams, *pparams, true); + } } +AutoPartialProfile::AutoPartialProfile() : + PartialProfile(true) +{ +} + +AutoPartialProfile::~AutoPartialProfile() +{ + deleteInstance(); +} + +} + +} diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 39be8e33e..39d84ac12 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -16,19 +16,19 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PROCPARAMS_H_ -#define _PROCPARAMS_H_ +#pragma once -#include -#include #include +#include #include +#include #include #include -#include "LUT.h" #include "coord.h" +#include "LUT.h" +#include "noncopyable.h" class ParamsEdited; @@ -36,15 +36,15 @@ namespace rtengine { class ColorGradientCurve; -class OpacityCurve; class NoiseCurve; +class OpacityCurve; +class RetinexgaintransmissionCurve; +class RetinextransmissionCurve; class WavCurve; -class WavOpacityCurveRG; class WavOpacityCurveBY; +class WavOpacityCurveRG; class WavOpacityCurveW; class WavOpacityCurveWL; -class RetinextransmissionCurve; -class RetinexgaintransmissionCurve; enum RenderingIntent { RI_PERCEPTUAL = INTENT_PERCEPTUAL, @@ -57,213 +57,211 @@ enum RenderingIntent { namespace procparams { -template -class Threshold +template +class Threshold final { public: - T value[4]; - -protected: - bool initEq1; - bool _isDouble; - -public: - Threshold (T bottom, T top, bool startAtOne) + Threshold(T _bottom, T _top, bool _start_at_one) : + Threshold(_bottom, _top, 0, 0, _start_at_one, false) { - initEq1 = startAtOne; - value[0] = bottom; - value[1] = top; - value[2] = T (0); - value[3] = T (0); - _isDouble = false; } - Threshold (T bottomLeft, T topLeft, T bottomRight, T topRight, bool startAtOne) + Threshold(T _bottom_left, T _top_left, T _bottom_right, T _top_right, bool _start_at_one) : + Threshold(_bottom_left, _top_left, _bottom_right, _top_right, _start_at_one, true) { - initEq1 = startAtOne; - value[0] = bottomLeft; - value[1] = topLeft; - value[2] = bottomRight; - value[3] = topRight; - _isDouble = true; } - // for convenience, since 'values' is public - void setValues (T bottom, T top) + template + typename std::enable_if::value, bool>::type operator ==(const Threshold& rhs) const { - value[0] = bottom; - value[1] = top; + if (is_double) { + return + std::fabs (bottom_left - rhs.bottom_left) < 1e-10 + && std::fabs (top_left - rhs.top_left) < 1e-10 + && std::fabs (bottom_right - rhs.bottom_right) < 1e-10 + && std::fabs (top_right - rhs.top_right) < 1e-10; + } else { + return + std::fabs (bottom_left - rhs.bottom_left) < 1e-10 + && std::fabs (top_left - rhs.top_left) < 1e-10; + } } - // for convenience, since 'values' is public - void setValues (T bottomLeft, T topLeft, T bottomRight, T topRight) + template + typename std::enable_if::value, bool>::type operator ==(const Threshold& rhs) const { - value[0] = bottomLeft; - value[1] = topLeft; - value[2] = bottomRight; - value[3] = topRight; + if (is_double) { + return + bottom_left == rhs.bottom_left + && top_left == rhs.top_left + && bottom_right == rhs.bottom_right + && top_right == rhs.top_right; + } else { + return + bottom_left == rhs.bottom_left + && top_left == rhs.top_left; + } + } + + T getBottom() const + { + return bottom_left; + } + + T getTop() const + { + return top_left; + } + + T getBottomLeft() const + { + return bottom_left; + } + + T getTopLeft() const + { + return top_left; + } + + T getBottomRight() const + { + return bottom_right; + } + + T getTopRight() const + { + return top_right; + } + + void setValues(T bottom, T top) + { + bottom_left = bottom; + top_left = top; + } + + void setValues(T bottom_left, T top_left, T bottom_right, T top_right) + { + this->bottom_left = bottom_left; + this->top_left = top_left; + this->bottom_right = bottom_right; + this->top_right = top_right; } bool isDouble() const { - return _isDouble; + return is_double; + } + + std::vector toVector() const + { + if (is_double) { + return { + bottom_left, + top_left, + bottom_right, + top_right + }; + } else { + return { + bottom_left, + top_left + }; + } } // RT: Type of the returned value // RV: Type of the value on the X axis // RV2: Type of the maximum value on the Y axis template - RT multiply (RV x, RV2 yMax) const + RT multiply (RV x, RV2 y_max) const { - double val = double (x); + const double val = x; - if (initEq1) { - if (_isDouble) { - if (val == double (value[2]) && double (value[2]) == double (value[3])) - // this handle the special case where the 2 right values are the same, then bottom one is sent back, + if (init_eql) { + if (is_double) { + if (val == static_cast(bottom_right) && static_cast(bottom_right) == static_cast(top_right)) { + // This handles the special case where the 2 right values are the same, then bottom one is sent back, // useful if one wants to keep the bottom value even beyond the x max bound - { - return RT (0.); + return 0; } - if (val >= double (value[3])) { - return RT (yMax); + if (val >= static_cast(top_right)) { + return y_max; } - if (val > double (value[2])) { - return RT (double (yMax) * (val - double (value[2])) / (double (value[3]) - double (value[2]))); + if (val > static_cast(bottom_right)) { + return static_cast(y_max * (val - static_cast(bottom_right)) / (static_cast(top_right) - static_cast(bottom_right))); } } - if (val >= double (value[0])) { - return RT (0); + if (val >= static_cast(bottom_left)) { + return 0; } - if (val > double (value[1])) { - return RT (double (yMax) * (1. - (val - double (value[0])) / (double (value[1]) - double (value[0])))); + if (val > static_cast(top_left)) { + return static_cast(y_max * (1. - (val - static_cast(bottom_left)) / (static_cast(top_left) - static_cast(bottom_left)))); } - return RT (yMax); + return y_max; } else { - if (_isDouble) { - if (val == double (value[2]) && double (value[2]) == double (value[3])) - // this handle the special case where the 2 right values are the same, then top one is sent back, + if (is_double) { + if (val == static_cast(bottom_right) && static_cast(bottom_right) == static_cast(top_right)) { + // This handles the special case where the 2 right values are the same, then top one is sent back, // useful if one wants to keep the top value even beyond the x max bound - { - return RT (yMax); + return y_max; } - if (val >= double (value[2])) { - return RT (0); + if (val >= static_cast(bottom_right)) { + return 0; } - if (val > double (value[3])) { - return RT (double (yMax) * (1. - (val - double (value[3])) / (double (value[2]) - double (value[3])))); + if (val > static_cast(top_right)) { + return static_cast(y_max * (1.0 - (val - static_cast(top_right)) / (static_cast(bottom_right) - static_cast(top_right)))); } } - if (val >= double (value[1])) { - return RT (yMax); + if (val >= static_cast(top_left)) { + return y_max; } - if (val > double (value[0])) { - return RT (double (yMax) * (val - double (value[0])) / (double (value[1]) - double (value[0]))); + if (val > static_cast(bottom_left)) { + return static_cast(y_max * (val - static_cast(bottom_left)) / (static_cast(top_left) - static_cast(bottom_left))); } - return RT (0); + return 0; } } - // RT: Type of the returned value - // RV: Type of the value on the X axis - /*template - RT getRatio(RV val) const { - double val = double(val); - if (initEq1) { - if (_isDouble) { // assuming that simple thresholds will be more frequent - if (val >= double(value[3])) - return RT(1); - if (val > double(value[2])) - return (val-double(value[2]))/(double(value[3])-double(value[2])); - } - if (val >= double(value[1])) - return RT(0); - if (val > double(value[0])) - return 1.-(val-double(value[0]))/(double(value[1])-double(value[0])); - return RT(1); - } - else { - if (_isDouble) { // assuming that simple thresholds will be more frequent - if (val >= double(value[3])) - return RT(0); - if (val > double(value[2])) - return 1.-(val-double(value[2]))/(double(value[3])-double(value[2])); - } - if (val >= double(value[1])) - return RT(1); - if (val > double(value[0])) - return (val-double(value[0]))/(double(value[1])-double(value[0])); - return RT(0); - } - }*/ - - Threshold& operator = (const Threshold &rhs) +private: + Threshold(T _bottom_left, T _top_left, T _bottom_right, T _top_right, bool _start_at_one, bool _is_double) : + bottom_left(_bottom_left), + top_left(_top_left), + bottom_right(_bottom_right), + top_right(_top_right), + init_eql(_start_at_one), + is_double(_is_double) { - value[0] = rhs.value[0]; - value[1] = rhs.value[1]; - value[2] = rhs.value[2]; - value[3] = rhs.value[3]; - initEq1 = rhs.initEq1; - _isDouble = rhs._isDouble; - return *this; } - template - typename std::enable_if::value, bool>::type operator == (const Threshold &rhs) const - { - if (_isDouble) { - return std::fabs (value[0] - rhs.value[0]) < 1e-10 - && std::fabs (value[1] - rhs.value[1]) < 1e-10 - && std::fabs (value[2] - rhs.value[2]) < 1e-10 - && std::fabs (value[3] - rhs.value[3]) < 1e-10; - } else { - return std::fabs (value[0] - rhs.value[0]) < 1e-10 - && std::fabs (value[1] - rhs.value[1]) < 1e-10; - } - } - - template - typename std::enable_if::value, bool>::type operator == (const Threshold &rhs) const - { - if (_isDouble) { - return - value[0] == rhs.value[0] - && value[1] == rhs.value[1] - && value[2] == rhs.value[2] - && value[3] == rhs.value[3]; - } else { - return - value[0] == rhs.value[0] - && value[1] == rhs.value[1]; - } - } + T bottom_left; + T top_left; + T bottom_right; + T top_right; + bool init_eql; + bool is_double; }; /** * Parameters of the tone curve */ -class ToneCurveParams -{ - -public: - - enum eTCModeId { - TC_MODE_STD, // Standard modes, the curve is applied on all component individually - TC_MODE_WEIGHTEDSTD, // Weighted standard mode - TC_MODE_FILMLIKE, // Film-like mode, as defined in Adobe's reference code - TC_MODE_SATANDVALBLENDING, // Modify the Saturation and Value channel - TC_MODE_LUMINANCE, // Modify the Luminance channel with coefficients from Rec 709's - TC_MODE_PERCEPTUAL // Keep color appearance constant using perceptual modeling +struct ToneCurveParams { + enum class TcMode { + STD, // Standard modes, the curve is applied on all component individually + WEIGHTEDSTD, // Weighted standard mode + FILMLIKE, // Film-like mode, as defined in Adobe's reference code + SATANDVALBLENDING, // Modify the Saturation and Value channel + LUMINANCE, // Modify the Luminance channel with coefficients from Rec 709's + PERCEPTUAL // Keep color appearance constant using perceptual modeling }; bool autoexp; @@ -273,8 +271,8 @@ public: double expcomp; std::vector curve; std::vector curve2; - eTCModeId curveMode; - eTCModeId curveMode2; + TcMode curveMode; + TcMode curveMode2; int brightness; int black; int contrast; @@ -283,20 +281,19 @@ public: int hlcompr; // Highlight Recovery's compression int hlcomprthresh; // Highlight Recovery's threshold - ToneCurveParams () - { - setDefaults(); - } - void setDefaults(); - static bool HLReconstructionNecessary (LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw); + ToneCurveParams(); + + bool operator ==(const ToneCurveParams& other) const; + bool operator !=(const ToneCurveParams& other) const; + + static bool HLReconstructionNecessary(const LUTu& histRedRaw, const LUTu& histGreenRaw, const LUTu& histBlueRaw); }; + /** * Parameters of Retinex */ -class RetinexParams +struct RetinexParams { - -public: bool enabled; std::vector cdcurve; std::vector cdHcurve; @@ -329,23 +326,22 @@ public: int highl; int skal; bool medianmap; - RetinexParams (); - void setDefaults(); - void getCurves (RetinextransmissionCurve &transmissionCurveLUT, RetinexgaintransmissionCurve &gaintransmissionCurveLUT) const; - static void getDefaultgaintransmissionCurve (std::vector &curve); + RetinexParams(); - static void getDefaulttransmissionCurve (std::vector &curve); + bool operator ==(const RetinexParams& other) const; + bool operator !=(const RetinexParams& other) const; + + void getCurves(RetinextransmissionCurve& transmissionCurveLUT, RetinexgaintransmissionCurve& gaintransmissionCurveLUT) const; }; /** * Parameters of the luminance curve */ -class LCurveParams +struct LCurveParams { - -public: + bool enabled; std::vector lcurve; std::vector acurve; std::vector bcurve; @@ -361,29 +357,34 @@ public: bool avoidcolorshift; double rstprotection; bool lcredsk; + + LCurveParams(); + + bool operator ==(const LCurveParams& other) const; + bool operator !=(const LCurveParams& other) const; }; /** * Parameters of the RGB curves */ -class RGBCurvesParams -{ - -public: +struct RGBCurvesParams { + bool enabled; bool lumamode; std::vector rcurve; std::vector gcurve; std::vector bcurve; + + RGBCurvesParams(); + + bool operator ==(const RGBCurvesParams& other) const; + bool operator !=(const RGBCurvesParams& other) const; }; /** * Parameters of the Color Toning */ -class ColorToningParams -{ - -public: +struct ColorToningParams { bool enabled; bool autosat; std::vector opacityCurve; @@ -428,28 +429,23 @@ public: double sathigh; bool lumamode; - ColorToningParams (); - void setDefaults(); // SHOULD BE GENERALIZED TO ALL CLASSES! - /// @brief Transform the mixer values to their curve equivalences - void mixerToCurve (std::vector &colorCurve, std::vector &opacityCurve) const; - /// @brief Specifically transform the sliders values to their curve equivalences - void slidersToCurve (std::vector &colorCurve, std::vector &opacityCurve) const; - /// @brief Fill the ColorGradientCurve and OpacityCurve LUTf from the control points curve or sliders value - void getCurves (ColorGradientCurve &colorCurveLUT, OpacityCurve &opacityCurveLUT, const double xyz_rgb[3][3], bool &opautili) const; + ColorToningParams(); - static void getDefaultColorCurve (std::vector &curve); - static void getDefaultOpacityCurve (std::vector &curve); - static void getDefaultCLCurve (std::vector &curve); - static void getDefaultCL2Curve (std::vector &curve); + bool operator ==(const ColorToningParams& other) const; + bool operator !=(const ColorToningParams& other) const; + + /// @brief Transform the mixer values to their curve equivalences + void mixerToCurve(std::vector& colorCurve, std::vector& opacityCurve) const; + /// @brief Specifically transform the sliders values to their curve equivalences + void slidersToCurve(std::vector& colorCurve, std::vector& opacityCurve) const; + /// @brief Fill the ColorGradientCurve and OpacityCurve LUTf from the control points curve or sliders value + void getCurves(ColorGradientCurve& colorCurveLUT, OpacityCurve& opacityCurveLUT, const double xyz_rgb[3][3], bool& opautili) const; }; /** * Parameters of the sharpening */ -class SharpeningParams -{ - -public: +struct SharpeningParams { bool enabled; double radius; int amount; @@ -466,31 +462,39 @@ public: int deconvdamping; SharpeningParams(); + + bool operator ==(const SharpeningParams& other) const; + bool operator !=(const SharpeningParams& other) const; }; -class SharpenEdgeParams -{ -public: + +struct SharpenEdgeParams { bool enabled; int passes; double amount; bool threechannels; + + SharpenEdgeParams(); + + bool operator ==(const SharpenEdgeParams& other) const; + bool operator !=(const SharpenEdgeParams& other) const; }; -class SharpenMicroParams -{ -public: + +struct SharpenMicroParams { bool enabled; bool matrix; double amount; double uniformity; + + SharpenMicroParams(); + + bool operator ==(const SharpenMicroParams& other) const; + bool operator !=(const SharpenMicroParams& other) const; }; /** * Parameters of the vibrance */ -class VibranceParams -{ - -public: +struct VibranceParams { bool enabled; int pastels; int saturated; @@ -501,85 +505,69 @@ public: std::vector skintonescurve; VibranceParams(); + + bool operator ==(const VibranceParams& other) const; + bool operator !=(const VibranceParams& other) const; }; -/** - * Parameters of the color boost - */ -/*class ColorBoostParams { - - public: - int amount; - bool avoidclip; - bool enable_saturationlimiter; - double saturationlimit; -};*/ - /** * Parameters of the white balance adjustments */ +struct WBEntry { + enum class Type { + CAMERA, + AUTO, + DAYLIGHT, + CLOUDY, + SHADE, + WATER, + TUNGSTEN, + FLUORESCENT, + LAMP, + FLASH, + LED, + // CUSTOM one must remain the last one! + CUSTOM + }; -enum WBTypes { - WBT_CAMERA, - WBT_AUTO, - WBT_DAYLIGHT, - WBT_CLOUDY, - WBT_SHADE, - WBT_WATER, - WBT_TUNGSTEN, - WBT_FLUORESCENT, - WBT_LAMP, - WBT_FLASH, - WBT_LED, - // WBT_CUSTOM one must remain the last one! - WBT_CUSTOM -}; - -class WBEntry -{ -public: Glib::ustring ppLabel; - enum WBTypes type; + Type type; Glib::ustring GUILabel; int temperature; double green; double equal; double tempBias; - - WBEntry (const Glib::ustring &p, enum WBTypes t, const Glib::ustring &l, int temp, double green, double equal, double bias) : ppLabel (p), type (t), GUILabel (l), temperature (temp), green (green), equal (equal), tempBias (bias) {}; }; -class WBParams -{ - -public: - static std::vector wbEntries; +struct WBParams { + bool enabled; Glib::ustring method; int temperature; double green; double equal; double tempBias; - static void init(); - static void cleanup(); + WBParams(); + + bool operator ==(const WBParams& other) const; + bool operator !=(const WBParams& other) const; + + static const std::vector& getWbEntries(); }; /** * Parameters of colorappearance */ -class ColorAppearanceParams -{ - -public: - enum eTCModeId { - TC_MODE_LIGHT, // Lightness mode - TC_MODE_BRIGHT, // Brightness mode +struct ColorAppearanceParams { + enum class TcMode { + LIGHT, // Lightness mode + BRIGHT, // Brightness mode }; - enum eCTCModeId { - TC_MODE_CHROMA, // chroma mode - TC_MODE_SATUR, // saturation mode - TC_MODE_COLORF, // colorfullness mode + enum class CtcMode { + CHROMA, // chroma mode + SATUR, // saturation mode + COLORF, // colorfullness mode }; bool enabled; @@ -590,9 +578,9 @@ public: std::vector curve; std::vector curve2; std::vector curve3; - eTCModeId curveMode; - eTCModeId curveMode2; - eCTCModeId curveMode3; + TcMode curveMode; + TcMode curveMode2; + CtcMode curveMode3; Glib::ustring surround; Glib::ustring surrsrc; @@ -616,7 +604,6 @@ public: double rstprotection; bool surrsource; bool gamut; - // bool badpix; bool datacie; bool tonecie; int tempout; @@ -625,74 +612,44 @@ public: int tempsc; double greensc; - // bool sharpcie; + ColorAppearanceParams(); + + bool operator ==(const ColorAppearanceParams& other) const; + bool operator !=(const ColorAppearanceParams& other) const; }; -/** - * Parameters of the color shift - */ -/*class ColorShiftParams { - - public: - double a; - double b; -};*/ - -/** - * Parameters of the luminance denoising - */ -/*class LumaDenoiseParams { - - public: - bool enabled; - double radius; - int edgetolerance; -};*/ - -/** - * Parameters of the color denoising - */ -/*class ColorDenoiseParams { - - public: - bool enabled; - int edgetolerance; - bool edgesensitive; - int amount; -};*/ - /** * Parameters of defringing */ -class DefringeParams -{ - -public: +struct DefringeParams { bool enabled; double radius; float threshold; std::vector huecurve; + + DefringeParams(); + + bool operator ==(const DefringeParams& other) const; + bool operator !=(const DefringeParams& other) const; }; /** * Parameters of impulse denoising */ -class ImpulseDenoiseParams -{ - -public: +struct ImpulseDenoiseParams { bool enabled; int thresh; + ImpulseDenoiseParams(); + + bool operator ==(const ImpulseDenoiseParams& other) const; + bool operator !=(const ImpulseDenoiseParams& other) const; }; /** * Parameters of the directional pyramid denoising */ -class DirPyrDenoiseParams -{ - -public: +struct DirPyrDenoiseParams { std::vector lcurve; std::vector cccurve; @@ -717,55 +674,46 @@ public: Glib::ustring rgbmethod; int passes; - DirPyrDenoiseParams (); - void setDefaults(); // SHOULD BE GENERALIZED TO ALL CLASSES! - void getCurves (NoiseCurve &lCurve, NoiseCurve &cCurve) const; + DirPyrDenoiseParams(); - static void getDefaultNoisCurve (std::vector &curve); - static void getDefaultCCCurve (std::vector &curve); + bool operator ==(const DirPyrDenoiseParams& other) const; + bool operator !=(const DirPyrDenoiseParams& other) const; + + void getCurves(NoiseCurve& lCurve, NoiseCurve& cCurve) const; }; -//EPD related parameters. -class EPDParams -{ -public: +// EPD related parameters. +struct EPDParams { bool enabled; double strength; double gamma; double edgeStopping; double scale; int reweightingIterates; + + EPDParams(); + + bool operator ==(const EPDParams& other) const; + bool operator !=(const EPDParams& other) const; }; - // Fattal02 Tone-Mapping parameters -class FattalToneMappingParams { -public: +struct FattalToneMappingParams { bool enabled; int threshold; int amount; - - FattalToneMappingParams() - { - setDefaults(); - } - - void setDefaults() - { - enabled = false; - threshold = 0; - amount = 1; - } + + FattalToneMappingParams(); + + bool operator ==(const FattalToneMappingParams& other) const; + bool operator !=(const FattalToneMappingParams& other) const; }; /** * Parameters of the shadow/highlight enhancement */ -class SHParams -{ - -public: +struct SHParams { bool enabled; bool hq; int highlights; @@ -774,15 +722,17 @@ public: int stonalwidth; int localcontrast; int radius; + + SHParams(); + + bool operator ==(const SHParams& other) const; + bool operator !=(const SHParams& other) const; }; /** * Parameters of the cropping */ -class CropParams -{ - -public: +struct CropParams { bool enabled; int x; int y; @@ -793,63 +743,66 @@ public: Glib::ustring orientation; Glib::ustring guide; - CropParams() : enabled (false), x (0), y (0), w (0), h (0), fixratio (false) {}; - void mapToResized (int resizedWidth, int resizedHeight, int scale, int &x1, int &x2, int &y1, int &y2) const; + CropParams(); + + bool operator ==(const CropParams& other) const; + bool operator !=(const CropParams& other) const; + + void mapToResized(int resizedWidth, int resizedHeight, int scale, int& x1, int& x2, int& y1, int& y2) const; }; /** * Parameters of the coarse transformations like 90 deg rotations and h/v flipping */ -class CoarseTransformParams -{ - -public: +struct CoarseTransformParams { int rotate; bool hflip; bool vflip; - CoarseTransformParams() - { - setDefaults(); - } - void setDefaults(); + CoarseTransformParams(); + + bool operator ==(const CoarseTransformParams& other) const; + bool operator !=(const CoarseTransformParams& other) const; }; /** * Common transformation parameters */ -class CommonTransformParams -{ - -public: +struct CommonTransformParams { bool autofill; + + CommonTransformParams(); + + bool operator ==(const CommonTransformParams& other) const; + bool operator !=(const CommonTransformParams& other) const; }; /** * Parameters of the rotation */ -class RotateParams -{ - -public: +struct RotateParams { double degree; + + RotateParams(); + + bool operator ==(const RotateParams& other) const; + bool operator !=(const RotateParams& other) const; }; /** * Parameters of the distortion correction */ -class DistortionParams -{ - -public: +struct DistortionParams { double amount; + + DistortionParams(); + + bool operator ==(const DistortionParams& other) const; + bool operator !=(const DistortionParams& other) const; }; // Lens profile correction parameters -class LensProfParams -{ - -public: +struct LensProfParams { enum class LcMode { NONE, // No lens correction LENSFUNAUTOMATCH, // Lens correction using auto matched lensfun database entry @@ -857,7 +810,6 @@ public: LCP // Lens correction using lcp file }; - static const char *methodstring[static_cast(LcMode::LCP) + 1u]; LcMode lcMode; Glib::ustring lcpFile; bool useDist, useVign, useCA; @@ -865,129 +817,110 @@ public: Glib::ustring lfCameraModel; Glib::ustring lfLens; - LensProfParams() - { - setDefaults(); - } - void setDefaults(); + LensProfParams(); - bool useLensfun() const - { - return lcMode == LcMode::LENSFUNAUTOMATCH || lcMode == LcMode::LENSFUNMANUAL; - } + bool operator ==(const LensProfParams& other) const; + bool operator !=(const LensProfParams& other) const; - bool lfAutoMatch() const - { - return lcMode == LcMode::LENSFUNAUTOMATCH; - } + bool useLensfun() const; + bool lfAutoMatch() const; + bool useLcp() const; + bool lfManual() const; - bool useLcp() const - { - return lcMode == LcMode::LCP && lcpFile.length() > 0; - } - - bool lfManual() const - { - return lcMode == LcMode::LENSFUNMANUAL; - } - - Glib::ustring getMethodString(LcMode mode) const - { - return methodstring[static_cast(mode)]; - } - - LcMode getMethodNumber(const Glib::ustring &mode) const - { - for(size_t i = 0; i <= static_cast(LcMode::LCP); ++i) { - if(methodstring[i] == mode) { - return static_cast(i); - } - } - return LcMode::NONE; - } + const std::vector& getMethodStrings() const; + Glib::ustring getMethodString(LcMode mode) const; + LcMode getMethodNumber(const Glib::ustring& mode) const; }; /** * Parameters of the perspective correction */ -class PerspectiveParams -{ - -public: +struct PerspectiveParams { double horizontal; double vertical; + + PerspectiveParams(); + + bool operator ==(const PerspectiveParams& other) const; + bool operator !=(const PerspectiveParams& other) const; }; /** * Parameters of the gradient filter */ -class GradientParams -{ - -public: +struct GradientParams { bool enabled; double degree; int feather; double strength; int centerX; int centerY; + + GradientParams(); + + bool operator ==(const GradientParams& other) const; + bool operator !=(const GradientParams& other) const; }; /** * Parameters of the post-crop vignette filter */ -class PCVignetteParams -{ - -public: +struct PCVignetteParams { bool enabled; double strength; int feather; int roundness; + + PCVignetteParams(); + + bool operator ==(const PCVignetteParams& other) const; + bool operator !=(const PCVignetteParams& other) const; }; /** * Parameters of the vignetting correction */ -class VignettingParams -{ - -public: +struct VignettingParams { int amount; int radius; int strength; int centerX; int centerY; + + VignettingParams(); + + bool operator ==(const VignettingParams& other) const; + bool operator !=(const VignettingParams& other) const; }; /** * Parameters of the color mixer */ -class ChannelMixerParams -{ - -public: +struct ChannelMixerParams { + bool enabled; int red[3]; int green[3]; int blue[3]; + + ChannelMixerParams(); + + bool operator ==(const ChannelMixerParams& other) const; + bool operator !=(const ChannelMixerParams& other) const; }; -class BlackWhiteParams -{ - -public: - enum eTCModeId { - TC_MODE_STD_BW, // Standard modes, the curve is applied on all component individually - TC_MODE_WEIGHTEDSTD_BW, // Weighted standard mode - TC_MODE_FILMLIKE_BW, // Film-like mode, as defined in Adobe's reference code - TC_MODE_SATANDVALBLENDING_BW // Modify the Saturation and Value channel +struct BlackWhiteParams { + enum class TcMode { + STD_BW, // Standard modes, the curve is applied on all component individually + WEIGHTEDSTD_BW, // Weighted standard mode + FILMLIKE_BW, // Film-like mode, as defined in Adobe's reference code + SATANDVALBLENDING_BW // Modify the Saturation and Value channel }; std::vector beforeCurve; - eTCModeId beforeCurveMode; + TcMode beforeCurveMode; std::vector afterCurve; - eTCModeId afterCurveMode; + TcMode afterCurveMode; Glib::ustring algo; std::vector luminanceCurve; @@ -1008,37 +941,30 @@ public: int gammaRed; int gammaGreen; int gammaBlue; + + BlackWhiteParams(); + + bool operator ==(const BlackWhiteParams& other) const; + bool operator !=(const BlackWhiteParams& other) const; }; /** * Parameters of the c/a correction */ -class CACorrParams -{ - -public: +struct CACorrParams { double red; double blue; + + CACorrParams(); + + bool operator ==(const CACorrParams& other) const; + bool operator !=(const CACorrParams& other) const; }; -/** - * Parameters of the highlight recovery - */ -/* -class HRecParams { - - public: - bool enabled; - Glib::ustring method; -}; -*/ /** * Parameters of the resizing */ -class ResizeParams -{ - -public: +struct ResizeParams { bool enabled; double scale; Glib::ustring appliesTo; @@ -1046,15 +972,17 @@ public: int dataspec; int width; int height; + + ResizeParams(); + + bool operator ==(const ResizeParams& other) const; + bool operator !=(const ResizeParams& other) const; }; /** * Parameters of the color spaces used during the processing */ -class ColorManagementParams -{ - -public: +struct ColorManagementParams { Glib::ustring input; bool toneCurve; bool applyLookTable; @@ -1065,18 +993,18 @@ public: Glib::ustring output; RenderingIntent outputIntent; bool outputBPC; - static const Glib::ustring NoICMString; Glib::ustring gamma; double gampos; double slpos; bool freegamma; - ColorManagementParams() - { - setDefaults(); - } - void setDefaults(); + static const Glib::ustring NoICMString; + + ColorManagementParams(); + + bool operator ==(const ColorManagementParams& other) const; + bool operator !=(const ColorManagementParams& other) const; }; /** @@ -1087,14 +1015,10 @@ typedef std::map ExifPairs; /** * The IPTC key/value pairs */ -typedef std::map > IPTCPairs; +typedef std::map> IPTCPairs; - -class WaveletParams -{ - -public: - std::vector ccwcurve; +struct WaveletParams { + std::vector ccwcurve; std::vector opacityCurveRG; std::vector opacityCurveBY; std::vector opacityCurveW; @@ -1107,15 +1031,14 @@ public: bool medianlev; bool linkedg; bool cbenab; - double greenlow; - double bluelow; - double greenmed; - double bluemed; - double greenhigh; - double bluehigh; + int greenlow; + int bluelow; + int greenmed; + int bluemed; + int greenhigh; + int bluehigh; bool lipst; - // bool edgreinf; bool avoid; bool tmr; int strength; @@ -1181,47 +1104,52 @@ public: Threshold level2noise; Threshold level3noise; + WaveletParams(); - WaveletParams (); - void setDefaults(); - void getCurves (WavCurve &cCurve, WavOpacityCurveRG &opacityCurveLUTRG, WavOpacityCurveBY &opacityCurveLUTBY, WavOpacityCurveW &opacityCurveLUTW, WavOpacityCurveWL &opacityCurveLUTWL) const; - static void getDefaultCCWCurve (std::vector &curve); - static void getDefaultOpacityCurveRG (std::vector &curve); - static void getDefaultOpacityCurveBY (std::vector &curve); - static void getDefaultOpacityCurveW (std::vector &curve); - static void getDefaultOpacityCurveWL (std::vector &curve); + bool operator ==(const WaveletParams& other) const; + bool operator !=(const WaveletParams& other) const; + void getCurves( + WavCurve& cCurve, + WavOpacityCurveRG& + opacityCurveLUTRG, + WavOpacityCurveBY& opacityCurveLUTBY, + WavOpacityCurveW& opacityCurveLUTW, + WavOpacityCurveWL& opacityCurveLUTWL + ) const; }; - /** * Directional pyramid equalizer params */ -class DirPyrEqualizerParams -{ - -public: +struct DirPyrEqualizerParams { bool enabled; bool gamutlab; double mult[6]; double threshold; double skinprotect; Threshold hueskin; - //Glib::ustring algo; Glib::ustring cbdlMethod; - DirPyrEqualizerParams() : hueskin (20, 80, 2000, 1200, false) {}; + + DirPyrEqualizerParams(); + + bool operator ==(const DirPyrEqualizerParams& other) const; + bool operator !=(const DirPyrEqualizerParams& other) const; }; /** * HSV equalizer params */ -class HSVEqualizerParams -{ +struct HSVEqualizerParams { + bool enabled; + std::vector hcurve; + std::vector scurve; + std::vector vcurve; -public: - std::vector hcurve; - std::vector scurve; - std::vector vcurve; + HSVEqualizerParams(); + + bool operator ==(const HSVEqualizerParams& other) const; + bool operator !=(const HSVEqualizerParams& other) const; }; @@ -1233,45 +1161,51 @@ struct FilmSimulationParams { Glib::ustring clutFilename; int strength; - FilmSimulationParams() - { - setDefaults(); - } + FilmSimulationParams(); - void setDefaults() - { - enabled = false; - clutFilename = Glib::ustring(); - strength = 100; - } + bool operator ==(const FilmSimulationParams& other) const; + bool operator !=(const FilmSimulationParams& other) const; }; /** * Parameters for RAW demosaicing, common to all sensor type */ -class RAWParams -{ - -public: +struct RAWParams { /** * Parameters for RAW demosaicing specific to Bayer sensors */ - class BayerSensor - { - public: - //enum eMethod{ eahd,hphd,vng4,dcb,amaze,ahd,IGV_noise,fast, - //numMethods }; // This MUST be the last enum - enum eMethod { amaze, igv, lmmse, eahd, hphd, vng4, dcb, ahd, fast, mono, none, pixelshift, - numMethods - }; // This MUST be the last enum - enum ePSMotionCorrection { - Grid1x1, Grid1x2, Grid3x3, Grid5x5, Grid7x7, Grid3x3New + struct BayerSensor { + enum class Method { + AMAZE, + IGV, + LMMSE, + EAHD, + HPHD, + VNG4, + DCB, + AHD, + RCD, + FAST, + MONO, + NONE, + PIXELSHIFT }; - enum ePSMotionCorrectionMethod { - Off, Automatic, Custom + + enum class PSMotionCorrection { + GRID_1X1, + GRID_1X2, + GRID_3X3, + GRID_5X5, + GRID_7X7, + GRID_3X3_NEW + }; + + enum class PSMotionCorrectionMethod { + OFF, + AUTO, + CUSTOM }; - static const char *methodstring[numMethods]; Glib::ustring method; int imageNum; @@ -1286,8 +1220,8 @@ public: int dcb_iterations; int lmmse_iterations; int pixelShiftMotion; - ePSMotionCorrection pixelShiftMotionCorrection; - ePSMotionCorrectionMethod pixelShiftMotionCorrectionMethod; + PSMotionCorrection pixelShiftMotionCorrection; + PSMotionCorrectionMethod pixelShiftMotionCorrectionMethod; double pixelShiftStddevFactorGreen; double pixelShiftStddevFactorRed; double pixelShiftStddevFactorBlue; @@ -1316,38 +1250,54 @@ public: bool pixelShiftNonGreenCross2; bool pixelShiftNonGreenAmaze; bool dcb_enhance; - //bool all_enhance; + + BayerSensor(); + + bool operator ==(const BayerSensor& other) const; + bool operator !=(const BayerSensor& other) const; void setPixelShiftDefaults(); + static const std::vector& getMethodStrings(); + static Glib::ustring getMethodString(Method method); }; /** * Parameters for RAW demosaicing specific to X-Trans sensors */ - class XTransSensor - { - public: - enum eMethod { threePass, onePass, fast, mono, none, - numMethods - }; // This MUST be the last enum - static const char *methodstring[numMethods]; + struct XTransSensor { + enum class Method { + THREE_PASS, + ONE_PASS, + FAST, + MONO, + NONE + }; Glib::ustring method; int ccSteps; double blackred; double blackgreen; double blackblue; - }; + + XTransSensor(); + + bool operator ==(const XTransSensor& other) const; + bool operator !=(const XTransSensor& other) const; + + static const std::vector& getMethodStrings(); + static Glib::ustring getMethodString(Method method); + }; BayerSensor bayersensor; ///< RAW parameters for Bayer sensors XTransSensor xtranssensor; ///< RAW parameters for X-Trans sensors - enum eFlatFileBlurType { /*parametric,*/area_ff, v_ff, h_ff, vh_ff, - numFlatFileBlurTypes - }; // This MUST be the last enum - - static const char *ff_BlurTypestring[numFlatFileBlurTypes]; + enum class FlatFieldBlurType { + AREA, + V, + H, + VH, + }; Glib::ustring dark_frame; bool df_autoselect; @@ -1371,11 +1321,13 @@ public: bool deadPixelFilter; int hotdeadpix_thresh; - RAWParams() - { - setDefaults(); - } - void setDefaults(); + RAWParams(); + + bool operator ==(const RAWParams& other) const; + bool operator !=(const RAWParams& other) const; + + static const std::vector& getFlatFieldBlurTypeStrings(); + static Glib::ustring getFlatFieldBlurTypeString(FlatFieldBlurType type); }; /** @@ -1387,7 +1339,7 @@ class ProcParams public: ToneCurveParams toneCurve; ///< Tone curve parameters LCurveParams labCurve; ///< CIELAB luminance curve parameters - RetinexParams retinex; ///< Retinex parameters + RetinexParams retinex; ///< Retinex parameters RGBCurvesParams rgbCurves; ///< RGB curves parameters ColorToningParams colorToning; ///< Color Toning parameters SharpeningParams sharpening; ///< Sharpening parameters @@ -1395,17 +1347,13 @@ public: SharpenEdgeParams sharpenEdge; ///< Sharpen edge parameters SharpenMicroParams sharpenMicro; ///< Sharpen microcontrast parameters VibranceParams vibrance; ///< Vibrance parameters - //ColorBoostParams colorBoost; ///< Color boost parameters WBParams wb; ///< White balance parameters ColorAppearanceParams colorappearance; - //ColorShiftParams colorShift; ///< Color shift parameters - //LumaDenoiseParams lumaDenoise; ///< Luminance denoising parameters - //ColorDenoiseParams colorDenoise; ///< Color denoising parameters DefringeParams defringe; ///< Defringing parameters ImpulseDenoiseParams impulseDenoise; ///< Impulse denoising parameters DirPyrDenoiseParams dirpyrDenoise; ///< Directional Pyramid denoising parameters EPDParams epd; ///< Edge Preserving Decomposition parameters - FattalToneMappingParams fattal; ///< Fattal02 tone mapping + FattalToneMappingParams fattal; ///< Fattal02 tone mapping SHParams sh; ///< Shadow/highlight enhancement parameters CropParams crop; ///< Crop parameters CoarseTransformParams coarse; ///< Coarse transformation (90, 180, 270 deg rotation, h/v flipping) parameters @@ -1419,7 +1367,7 @@ public: CACorrParams cacorrection; ///< Lens c/a correction parameters VignettingParams vignetting; ///< Lens vignetting correction parameters ChannelMixerParams chmixer; ///< Channel mixer parameters - BlackWhiteParams blackwhite; ///< Black & White parameters + BlackWhiteParams blackwhite; ///< Black& White parameters ResizeParams resize; ///< Resize parameters ColorManagementParams icm; ///< profiles/color spaces used during the image processing RAWParams raw; ///< RAW parameters before demosaicing @@ -1427,23 +1375,23 @@ public: DirPyrEqualizerParams dirpyrequalizer; ///< directional pyramid wavelet parameters HSVEqualizerParams hsvequalizer; ///< hsv wavelet parameters FilmSimulationParams filmSimulation; ///< film simulation parameters - char rank; ///< Custom image quality ranking - char colorlabel; ///< Custom color label + int rank; ///< Custom image quality ranking + int colorlabel; ///< Custom color label bool inTrash; ///< Marks deleted image Glib::ustring appVersion; ///< Version of the application that generated the parameters int ppVersion; ///< Version of the PP file from which the parameters have been read - ExifPairs exif; ///< List of modifications appplied on the exif tags of the input image - IPTCPairs iptc; ///< The IPTC tags and values to be saved to the output image + ExifPairs exif; ///< List of modifications appplied on the exif tags of the input image + IPTCPairs iptc; ///< The IPTC tags and values to be saved to the output image /** * The constructor only sets the hand-wired defaults. */ - ProcParams (); + ProcParams(); /** * Sets the hand-wired defaults parameters. */ - void setDefaults (); + void setDefaults(); /** * Saves the parameters to possibly two files. This is a performance improvement if a function has to * save the same file in two different location, i.e. the cache and the image's directory @@ -1454,28 +1402,28 @@ public: * @param pedited pointer to a ParamsEdited object (optional) to store which values has to be saved * @return Error code (=0 if all supplied filenames where created correctly) */ - int save (const Glib::ustring &fname, const Glib::ustring &fname2 = "", bool fnameAbsolute = true, ParamsEdited* pedited = nullptr); + int save(const Glib::ustring& fname, const Glib::ustring& fname2 = Glib::ustring(), bool fnameAbsolute = true, ParamsEdited* pedited = nullptr); /** * Loads the parameters from a file. * @param fname the name of the file * @params pedited pointer to a ParamsEdited object (optional) to store which values has been loaded * @return Error code (=0 if no error) */ - int load (const Glib::ustring &fname, ParamsEdited* pedited = nullptr); + int load(const Glib::ustring& fname, ParamsEdited* pedited = nullptr); /** Creates a new instance of ProcParams. * @return a pointer to the new ProcParams instance. */ - static ProcParams* create (); + static ProcParams* create (); /** Destroys an instance of ProcParams. * @param pp a pointer to the ProcParams instance to destroy. */ - static void destroy (ProcParams* pp); + static void destroy(ProcParams* pp); - static void init (); - static void cleanup (); + static void init(); + static void cleanup(); - bool operator== (const ProcParams& other); - bool operator!= (const ProcParams& other); + bool operator ==(const ProcParams& other) const; + bool operator !=(const ProcParams& other) const; private: /** Write the ProcParams's text in the file of the given name. @@ -1483,8 +1431,7 @@ private: * @param content the text to write * @return Error code (=0 if no error) * */ - int write (const Glib::ustring &fname, const Glib::ustring &content) const; - + int write(const Glib::ustring& fname, const Glib::ustring& content) const; }; /** @@ -1496,26 +1443,21 @@ private: * and hence is not responsible of their destructions. The function that instanciate * PartialProfile object has to handle all this itself. */ -class PartialProfile +class PartialProfile : + public NonCopyable { public: + PartialProfile(bool createInstance = false, bool paramsEditedValue = false); + PartialProfile(ProcParams* pp, ParamsEdited* pe = nullptr, bool fullCopy = false); + PartialProfile(const ProcParams* pp, const ParamsEdited* pe = nullptr); + void deleteInstance(); + void clearGeneral(); + int load(const Glib::ustring& fName); + void set(bool v); + void applyTo(ProcParams* destParams) const ; + rtengine::procparams::ProcParams* pparams; ParamsEdited* pedited; - PartialProfile& operator = (const PartialProfile& rhs) - { - pparams = rhs.pparams; - pedited = rhs.pedited; - return *this; - }; - - PartialProfile (bool createInstance = false, bool paramsEditedValue = false); - PartialProfile (ProcParams* pp, ParamsEdited* pe = nullptr, bool fullCopy = false); - PartialProfile (const ProcParams* pp, const ParamsEdited* pe = nullptr); - void deleteInstance (); - void clearGeneral (); - int load (const Glib::ustring &fName); - void set (bool v); - void applyTo (ProcParams *destParams) const ; }; /** @@ -1523,16 +1465,13 @@ public: * and automatically delete them in the destructor. This class has been mostly created * to be used with vectors, which use the default constructor/destructor */ -class AutoPartialProfile : public PartialProfile +class AutoPartialProfile : + public PartialProfile { public: - AutoPartialProfile() : PartialProfile (true) {} - ~AutoPartialProfile() - { - deleteInstance(); - } + AutoPartialProfile(); + ~AutoPartialProfile(); }; } } -#endif diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 5eb7aa7b9..bcc16d5cb 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -650,8 +650,8 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima const float new_pre_mul[4] = { ri->get_pre_mul(0) / rm, ri->get_pre_mul(1) / gm, ri->get_pre_mul(2) / bm, ri->get_pre_mul(3) / gm }; float new_scale_mul[4]; - bool isMono = (ri->getSensorType() == ST_FUJI_XTRANS && raw.xtranssensor.method == RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::mono]) - || (ri->getSensorType() == ST_BAYER && raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::mono]); + bool isMono = (ri->getSensorType() == ST_FUJI_XTRANS && raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::MONO)) + || (ri->getSensorType() == ST_BAYER && raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::MONO)); float gain = calculate_scale_mul(new_scale_mul, new_pre_mul, c_white, cblacksom, isMono, ri->get_colors()); rm = new_scale_mul[0] / scale_mul[0] * gain; gm = new_scale_mul[1] / scale_mul[1] * gain; @@ -1921,7 +1921,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le } // check if it is an olympus E camera or green equilibration is enabled. If yes, compute G channel pre-compensation factors - if ( ri->getSensorType() == ST_BAYER && (raw.bayersensor.greenthresh || (((idata->getMake().size() >= 7 && idata->getMake().substr(0, 7) == "OLYMPUS" && idata->getModel()[0] == 'E') || (idata->getMake().size() >= 9 && idata->getMake().substr(0, 9) == "Panasonic")) && raw.bayersensor.method != RAWParams::BayerSensor::methodstring[ RAWParams::BayerSensor::vng4])) ) { + if ( ri->getSensorType() == ST_BAYER && (raw.bayersensor.greenthresh || (((idata->getMake().size() >= 7 && idata->getMake().substr(0, 7) == "OLYMPUS" && idata->getModel()[0] == 'E') || (idata->getMake().size() >= 9 && idata->getMake().substr(0, 9) == "Panasonic")) && raw.bayersensor.method != RAWParams::BayerSensor::getMethodString( RAWParams::BayerSensor::Method::VNG4))) ) { // global correction if(numFrames == 4) { for(int i = 0; i < 4; ++i) { @@ -2027,28 +2027,30 @@ void RawImageSource::demosaic(const RAWParams &raw) t1.set(); if (ri->getSensorType() == ST_BAYER) { - if ( raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::hphd] ) { + if ( raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::HPHD) ) { hphd_demosaic (); - } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::vng4] ) { + } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::VNG4) ) { vng4_demosaic (); - } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::ahd] ) { + } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AHD) ) { ahd_demosaic (); - } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::amaze] ) { + } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZE) ) { amaze_demosaic_RT (0, 0, W, H, rawData, red, green, blue); - } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::pixelshift] ) { + } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT) ) { pixelshift(0, 0, W, H, raw.bayersensor, currFrame, ri->get_model(), raw.expos); - } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::dcb] ) { + } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::DCB) ) { dcb_demosaic(raw.bayersensor.dcb_iterations, raw.bayersensor.dcb_enhance); - } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::eahd]) { + } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::EAHD)) { eahd_demosaic (); - } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::igv]) { + } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::IGV)) { igv_interpolate(W, H); - } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::lmmse]) { + } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::LMMSE)) { lmmse_interpolate_omp(W, H, rawData, red, green, blue, raw.bayersensor.lmmse_iterations); - } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::fast] ) { + } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST) ) { fast_demosaic(); - } else if (raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::mono] ) { + } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::MONO) ) { nodemosaic(true); + } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::RCD) ) { + rcd_demosaic (); } else { nodemosaic(false); } @@ -2056,13 +2058,13 @@ void RawImageSource::demosaic(const RAWParams &raw) //if (raw.all_enhance) refinement_lassus(); } else if (ri->getSensorType() == ST_FUJI_XTRANS) { - if (raw.xtranssensor.method == RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::fast] ) { + if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FAST) ) { fast_xtrans_interpolate(); - } else if (raw.xtranssensor.method == RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::onePass]) { + } else if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::ONE_PASS)) { xtrans_interpolate(1, false); - } else if (raw.xtranssensor.method == RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::threePass] ) { + } else if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::THREE_PASS) ) { xtrans_interpolate(3, true); - } else if(raw.xtranssensor.method == RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::mono] ) { + } else if(raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::MONO) ) { nodemosaic(true); } else { nodemosaic(false); @@ -2803,14 +2805,14 @@ void RawImageSource::processFlatField(const RAWParams &raw, RawImage *riFlatFile BS += BS & 1; //function call to cfabloxblur - if (raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::v_ff]) { + if (raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::FlatFieldBlurType::V)) { cfaboxblur(riFlatFile, cfablur, 2 * BS, 0); - } else if (raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::h_ff]) { + } else if (raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::FlatFieldBlurType::H)) { cfaboxblur(riFlatFile, cfablur, 0, 2 * BS); - } else if (raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::vh_ff]) { + } else if (raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::FlatFieldBlurType::VH)) { //slightly more complicated blur if trying to correct both vertical and horizontal anomalies cfaboxblur(riFlatFile, cfablur, BS, BS); //first do area blur to correct vignette - } else { //(raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::area_ff]) + } else { //(raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::area_ff)) cfaboxblur(riFlatFile, cfablur, BS, BS); } @@ -3008,7 +3010,7 @@ void RawImageSource::processFlatField(const RAWParams &raw, RawImage *riFlatFile } } - if (raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::vh_ff]) { + if (raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::FlatFieldBlurType::VH)) { float *cfablur1 = (float (*)) malloc (H * W * sizeof * cfablur1); float *cfablur2 = (float (*)) malloc (H * W * sizeof * cfablur2); //slightly more complicated blur if trying to correct both vertical and horizontal anomalies @@ -3429,7 +3431,7 @@ void RawImageSource::scaleColors(int winx, int winy, int winw, int winh, const R black_lev[2] = raw.bayersensor.black2; //B black_lev[3] = raw.bayersensor.black3; //G2 - isMono = RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::mono] == raw.bayersensor.method; + isMono = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::MONO) == raw.bayersensor.method; } else if (getSensorType() == ST_FUJI_XTRANS) { black_lev[0] = raw.xtranssensor.blackred; //R @@ -3437,7 +3439,7 @@ void RawImageSource::scaleColors(int winx, int winy, int winw, int winh, const R black_lev[2] = raw.xtranssensor.blackblue; //B black_lev[3] = raw.xtranssensor.blackgreen; //G2 (set, only used with a Bayer filter) - isMono = RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::mono] == raw.xtranssensor.method; + isMono = RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::MONO) == raw.xtranssensor.method; } for(int i = 0; i < 4 ; i++) { diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index d2ce77fed..4924b955a 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -248,6 +248,7 @@ protected: void fast_demosaic();//Emil's code for fast demosaicing void dcb_demosaic(int iterations, bool dcb_enhance); void ahd_demosaic(); + void rcd_demosaic(); void border_interpolate(unsigned int border, float (*image)[4], unsigned int start = 0, unsigned int end = 0); void border_interpolate2(int winw, int winh, int lborders); void dcb_initTileLimits(int &colMin, int &rowMin, int &colMax, int &rowMax, int x0, int y0, int border); diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index c95b53c0a..6105bb508 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -516,7 +516,9 @@ int refreshmap[rtengine::NUMOFEVENTS] = { DARKFRAME, // EvLensCorrLensfunLens ALLNORAW, // EvTMFattalEnabled HDR, // EvTMFattalThreshold - HDR // EvTMFattalAmount - + HDR, // EvTMFattalAmount + ALLNORAW, // EvWBEnabled + RGBCURVE, // EvRGBEnabled + LUMINANCECURVE // EvLEnabled }; diff --git a/rtengine/rt_algo.cc b/rtengine/rt_algo.cc new file mode 100644 index 000000000..79508cfb3 --- /dev/null +++ b/rtengine/rt_algo.cc @@ -0,0 +1,167 @@ +/* + * This file is part of RawTherapee. + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ + +#include +#include +#include +#include +#include + +#ifdef _OPENMP +#include +#endif + +#include "rt_algo.h" + +namespace rtengine +{ + +void findMinMaxPercentile(const float* data, size_t size, float minPrct, float& minOut, float maxPrct, float& maxOut, bool multithread) +{ + // Copyright (c) 2017 Ingo Weyrich + // We need to find the (minPrct*size) smallest value and the (maxPrct*size) smallest value in data. + // We use a histogram based search for speed and to reduce memory usage. + // Memory usage of this method is histoSize * sizeof(uint32_t) * (t + 1) byte, + // where t is the number of threads and histoSize is in [1;65536]. + // Processing time is O(n) where n is size of the input array. + // It scales well with multiple threads if the size of the input array is large. + // The current implementation is not guaranteed to work correctly if size > 2^32 (4294967296). + + assert(minPrct <= maxPrct); + + if (size == 0) { + return; + } + + size_t numThreads = 1; +#ifdef _OPENMP + // Because we have an overhead in the critical region of the main loop for each thread + // we make a rough calculation to reduce the number of threads for small data size. + // This also works fine for the minmax loop. + if (multithread) { + const size_t maxThreads = omp_get_max_threads(); + while (size > numThreads * numThreads * 16384 && numThreads < maxThreads) { + ++numThreads; + } + } +#endif + + // We need min and max value of data to calculate the scale factor for the histogram + float minVal = data[0]; + float maxVal = data[0]; +#ifdef _OPENMP + #pragma omp parallel for reduction(min:minVal) reduction(max:maxVal) num_threads(numThreads) +#endif + for (size_t i = 1; i < size; ++i) { + minVal = std::min(minVal, data[i]); + maxVal = std::max(maxVal, data[i]); + } + + if (std::fabs(maxVal - minVal) == 0.f) { // fast exit, also avoids division by zero in calculation of scale factor + minOut = maxOut = minVal; + return; + } + + // Caution: Currently this works correctly only for histoSize in range[1;65536]. + // For small data size (i.e. thumbnails) we reduce the size of the histogram to the size of data. + const unsigned int histoSize = std::min(65536, size); + + // calculate scale factor to use full range of histogram + const float scale = (histoSize - 1) / (maxVal - minVal); + + // We need one main histogram + std::vector histo(histoSize, 0); + + if (numThreads == 1) { + // just one thread => use main histogram + for (size_t i = 0; i < size; ++i) { + // we have to subtract minVal and multiply with scale to get the data in [0;histosize] range + histo[static_cast(scale * (data[i] - minVal))]++; + } + } else { +#ifdef _OPENMP + #pragma omp parallel num_threads(numThreads) +#endif + { + // We need one histogram per thread + std::vector histothr(histoSize, 0); + +#ifdef _OPENMP + #pragma omp for nowait +#endif + for (size_t i = 0; i < size; ++i) { + // we have to subtract minVal and multiply with scale to get the data in [0;histosize] range + histothr[static_cast(scale * (data[i] - minVal))]++; + } + +#ifdef _OPENMP + #pragma omp critical +#endif + { + // add per thread histogram to main histogram +#ifdef _OPENMP + #pragma omp simd +#endif + + for (size_t i = 0; i < histoSize; ++i) { + histo[i] += histothr[i]; + } + } + } + } + + size_t k = 0; + size_t count = 0; + + // find (minPrct*size) smallest value + const float threshmin = minPrct * size; + while (count < threshmin) { + count += histo[k++]; + } + + if (k > 0) { // interpolate + const size_t count_ = count - histo[k - 1]; + const float c0 = count - threshmin; + const float c1 = threshmin - count_; + minOut = (c1 * k + c0 * (k - 1)) / (c0 + c1); + } else { + minOut = k; + } + // go back to original range + minOut /= scale; + minOut += minVal; + + // find (maxPrct*size) smallest value + const float threshmax = maxPrct * size; + while (count < threshmax) { + count += histo[k++]; + } + + if (k > 0) { // interpolate + const size_t count_ = count - histo[k - 1]; + const float c0 = count - threshmax; + const float c1 = threshmax - count_; + maxOut = (c1 * k + c0 * (k - 1)) / (c0 + c1); + } else { + maxOut = k; + } + // go back to original range + maxOut /= scale; + maxOut += minVal; +} + +} diff --git a/rtengine/rt_algo.h b/rtengine/rt_algo.h new file mode 100644 index 000000000..2630bbf41 --- /dev/null +++ b/rtengine/rt_algo.h @@ -0,0 +1,29 @@ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2017 Ingo Weyrich + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ + +#pragma once + +#include + +namespace rtengine +{ + +void findMinMaxPercentile(const float* data, size_t size, float minPrct, float& minOut, float maxPrct, float& maxOut, bool multiThread = true); + +} diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 8adab4ec5..fcc039a81 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -944,7 +944,9 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT // compute WB multipliers ColorTemp currWB = ColorTemp (params.wb.temperature, params.wb.green, params.wb.equal, params.wb.method); - if (params.wb.method == "Camera") { + if (!params.wb.enabled) { + currWB = ColorTemp(); + } else if (params.wb.method == "Camera") { //recall colorMatrix is rgb_cam double cam_r = colorMatrix[0][0] * camwbRed + colorMatrix[0][1] * camwbGreen + colorMatrix[0][2] * camwbBlue; double cam_g = colorMatrix[1][0] * camwbRed + colorMatrix[1][1] * camwbGreen + colorMatrix[1][2] * camwbBlue; @@ -954,12 +956,19 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT currWB = ColorTemp (autoWBTemp, autoWBGreen, wbEqual, "Custom"); } - double r, g, b; - currWB.getMultipliers (r, g, b); - //iColorMatrix is cam_rgb - double rm = iColorMatrix[0][0] * r + iColorMatrix[0][1] * g + iColorMatrix[0][2] * b; - double gm = iColorMatrix[1][0] * r + iColorMatrix[1][1] * g + iColorMatrix[1][2] * b; - double bm = iColorMatrix[2][0] * r + iColorMatrix[2][1] * g + iColorMatrix[2][2] * b; + double rm, gm, bm; + if (currWB.getTemp() < 0) { + rm = redMultiplier; + gm = greenMultiplier; + bm = blueMultiplier; + } else { + double r, g, b; + currWB.getMultipliers (r, g, b); + //iColorMatrix is cam_rgb + rm = iColorMatrix[0][0] * r + iColorMatrix[0][1] * g + iColorMatrix[0][2] * b; + gm = iColorMatrix[1][0] * r + iColorMatrix[1][1] * g + iColorMatrix[1][2] * b; + bm = iColorMatrix[2][0] * r + iColorMatrix[2][1] * g + iColorMatrix[2][2] * b; + } rm = camwbRed / rm; gm = camwbGreen / gm; bm = camwbBlue / bm; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 45595a379..ed1262fbd 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -223,7 +223,9 @@ private: // set the color temperature currWB = ColorTemp (params.wb.temperature, params.wb.green, params.wb.equal, params.wb.method); - if (params.wb.method == "Camera") { + if (!params.wb.enabled) { + currWB = ColorTemp(); + } else if (params.wb.method == "Camera") { currWB = imgsrc->getWB (); } else if (params.wb.method == "Auto") { double rm, gm, bm; @@ -1475,16 +1477,12 @@ private: params.defringe.radius); adjust_radius (defaultparams.sh.radius, scale_factor, params.sh.radius); - if (params.raw.xtranssensor.method == - procparams::RAWParams::XTransSensor::methodstring[ - procparams::RAWParams::XTransSensor::threePass]) { - params.raw.xtranssensor.method = - procparams::RAWParams::XTransSensor::methodstring[ - procparams::RAWParams::XTransSensor::onePass]; + if (params.raw.xtranssensor.method == procparams::RAWParams::XTransSensor::getMethodString(procparams::RAWParams::XTransSensor::Method::THREE_PASS)) { + params.raw.xtranssensor.method = procparams::RAWParams::XTransSensor::getMethodString(procparams::RAWParams::XTransSensor::Method::ONE_PASS); } - if (params.raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::pixelshift]) { - params.raw.bayersensor.method = procparams::RAWParams::BayerSensor::methodstring[params.raw.bayersensor.pixelShiftLmmse ? procparams::RAWParams::BayerSensor::lmmse : procparams::RAWParams::BayerSensor::amaze]; + if (params.raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::PIXELSHIFT)) { + params.raw.bayersensor.method = procparams::RAWParams::BayerSensor::getMethodString(params.raw.bayersensor.pixelShiftLmmse ? procparams::RAWParams::BayerSensor::Method::LMMSE : procparams::RAWParams::BayerSensor::Method::AMAZE); } } diff --git a/rtengine/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index 6e4b45ccb..645451905 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -69,10 +69,12 @@ #include "improcfun.h" #include "settings.h" #include "iccstore.h" -#define BENCHMARK +//#define BENCHMARK #include "StopWatch.h" #include "sleef.c" #include "opthelper.h" +#include "rt_algo.h" + namespace rtengine { @@ -167,7 +169,7 @@ void downSample (const Array2Df& A, Array2Df& B) } } -void gaussianBlur (const Array2Df& I, Array2Df& L) +void gaussianBlur (const Array2Df& I, Array2Df& L, bool multithread) { const int width = I.getCols(); const int height = I.getRows(); @@ -185,7 +187,7 @@ void gaussianBlur (const Array2Df& I, Array2Df& L) Array2Df T (width, height); //--- X blur - #pragma omp parallel for shared(I, T) + #pragma omp parallel for shared(I, T) if(multithread) for ( int y = 0 ; y < height ; y++ ) { for ( int x = 1 ; x < width - 1 ; x++ ) { @@ -200,7 +202,7 @@ void gaussianBlur (const Array2Df& I, Array2Df& L) } //--- Y blur - #pragma omp parallel for + #pragma omp parallel for if(multithread) for ( int x = 0 ; x < width - 7 ; x += 8 ) { for ( int y = 1 ; y < height - 1 ; y++ ) { @@ -231,21 +233,15 @@ void gaussianBlur (const Array2Df& I, Array2Df& L) } } -void createGaussianPyramids ( Array2Df* H, Array2Df** pyramids, int nlevels) +void createGaussianPyramids (Array2Df** pyramids, int nlevels, bool multithread) { - int width = H->getCols(); - int height = H->getRows(); - const int size = width * height; + // pyramids[0] is already set + int width = pyramids[0]->getCols(); + int height = pyramids[0]->getRows(); - pyramids[0] = new Array2Df (width, height); - -//#pragma omp parallel for shared(pyramids, H) - for ( int i = 0 ; i < size ; i++ ) { - (*pyramids[0]) (i) = (*H) (i); - } Array2Df* L = new Array2Df (width, height); - gaussianBlur ( *pyramids[0], *L ); + gaussianBlur ( *pyramids[0], *L, multithread ); for ( int k = 1 ; k < nlevels ; k++ ) { if (width > 2 && height > 2) { @@ -267,7 +263,7 @@ void createGaussianPyramids ( Array2Df* H, Array2Df** pyramids, int nlevels) if (k < nlevels - 1) { delete L; L = new Array2Df (width, height); - gaussianBlur ( *pyramids[k], *L ); + gaussianBlur ( *pyramids[k], *L, multithread ); } } @@ -276,14 +272,14 @@ void createGaussianPyramids ( Array2Df* H, Array2Df** pyramids, int nlevels) //-------------------------------------------------------------------- -float calculateGradients (Array2Df* H, Array2Df* G, int k) +float calculateGradients (Array2Df* H, Array2Df* G, int k, bool multithread) { const int width = H->getCols(); const int height = H->getRows(); const float divider = pow ( 2.0f, k + 1 ); float avgGrad = 0.0f; - #pragma omp parallel for reduction(+:avgGrad) + #pragma omp parallel for reduction(+:avgGrad) if(multithread) for ( int y = 0 ; y < height ; y++ ) { int n = (y == 0 ? 0 : y - 1); @@ -350,20 +346,17 @@ void upSample (const Array2Df& A, Array2Df& B) void calculateFiMatrix (Array2Df* FI, Array2Df* gradients[], float avgGrad[], int nlevels, int detail_level, - float alfa, float beta, float noise) + float alfa, float beta, float noise, bool multithread) { - const bool newfattal = true; int width = gradients[nlevels - 1]->getCols(); int height = gradients[nlevels - 1]->getRows(); Array2Df** fi = new Array2Df*[nlevels]; fi[nlevels - 1] = new Array2Df (width, height); - if (newfattal) { - //#pragma omp parallel for shared(fi) - for ( int k = 0 ; k < width * height ; k++ ) { - (*fi[nlevels - 1]) (k) = 1.0f; - } + #pragma omp parallel for shared(fi) if(multithread) + for ( int k = 0 ; k < width * height ; k++ ) { + (*fi[nlevels - 1]) (k) = 1.0f; } for ( int k = nlevels - 1; k >= 0 ; k-- ) { @@ -371,23 +364,16 @@ void calculateFiMatrix (Array2Df* FI, Array2Df* gradients[], height = gradients[k]->getRows(); // only apply gradients to levels>=detail_level but at least to the coarsest - if ( k >= detail_level - || k == nlevels - 1 - || newfattal == false) { + if ((k >= detail_level || k == nlevels - 1) && beta != 1.f) { //DEBUG_STR << "calculateFiMatrix: apply gradient to level " << k << endl; - #pragma omp parallel for shared(fi,avgGrad) + #pragma omp parallel for shared(fi,avgGrad) if(multithread) for ( int y = 0; y < height; y++ ) { for ( int x = 0; x < width; x++ ) { float grad = ((*gradients[k]) (x, y) < 1e-4f) ? 1e-4 : (*gradients[k]) (x, y); float a = alfa * avgGrad[k]; - float value = pow ((grad + noise) / a, beta - 1.0f); - if (newfattal) { - (*fi[k]) (x, y) *= value; - } else { - (*fi[k]) (x, y) = value; - } + (*fi[k]) (x, y) *= value; } } } @@ -401,9 +387,9 @@ void calculateFiMatrix (Array2Df* FI, Array2Df* gradients[], fi[0] = FI; // highest level -> result } - if ( k > 0 && newfattal ) { + if (k > 0) { upSample (*fi[k], *fi[k - 1]); // upsample to next level - gaussianBlur (*fi[k - 1], *fi[k - 1]); + gaussianBlur (*fi[k - 1], *fi[k - 1], multithread); } } @@ -414,80 +400,6 @@ void calculateFiMatrix (Array2Df* FI, Array2Df* gradients[], delete[] fi; } -inline -void findMaxMinPercentile (const Array2Df& I, - float minPrct, float& minLum, - float maxPrct, float& maxLum) -{ - assert (minPrct <= maxPrct); - - const int size = I.getRows() * I.getCols(); - const float* data = I.data(); - - // we need to find the (minPrct*size) smallest value and the (maxPrct*size) smallest value in I - // We use a histogram based search for speed and to reduce memory usage - // memory usage of this method is 65536 * sizeof(float) * (t + 1) byte, where t is the number of threads - - // We need one global histogram - LUTu histo (65536, LUT_CLIP_BELOW | LUT_CLIP_ABOVE); - histo.clear(); -#ifdef _OPENMP - #pragma omp parallel -#endif - { - // We need one histogram per thread - LUTu histothr (65536, LUT_CLIP_BELOW | LUT_CLIP_ABOVE); - histothr.clear(); - -#ifdef _OPENMP - #pragma omp for nowait -#endif - - for (int i = 0; i < size; ++i) { - // values are in [0;1] range, so we have to multiply with 65535 to get the histogram index - histothr[ (unsigned int) (65535.f * data[i])]++; - } - -#ifdef _OPENMP - #pragma omp critical -#endif - // add per thread histogram to global histogram - histo += histothr; - } - - int k = 0; - int count = 0; - - // find (minPrct*size) smallest value - while (count < minPrct * size) { - count += histo[k++]; - } - - if (k > 0) { // interpolate - int count_ = count - histo[k - 1]; - float c0 = count - minPrct * size; - float c1 = minPrct * size - count_; - minLum = (c1 * k + c0 * (k - 1)) / ((c0 + c1) * 65535.f); - } else { - minLum = k / 65535.f; - } - - // find (maxPrct*size) smallest value - while (count < maxPrct * size) { - count += histo[k++]; - } - - if (k > 0) { // interpolate - int count_ = count - histo[k - 1]; - float c0 = count - maxPrct * size; - float c1 = maxPrct * size - count_; - maxLum = (c1 * k + c0 * (k - 1)) / ((c0 + c1) * 65535.f); - } else { - maxLum = k / 65535.f; - } - -} - void solve_pde_fft (Array2Df *F, Array2Df *U, Array2Df *buf, bool multithread); void tmo_fattal02 (size_t width, @@ -543,7 +455,7 @@ void tmo_fattal02 (size_t width, float minLum = Y (0, 0); float maxLum = Y (0, 0); - #pragma omp parallel for reduction(max:maxLum) + #pragma omp parallel for reduction(max:maxLum) if(multithread) for ( int i = 0 ; i < size ; i++ ) { maxLum = std::max (maxLum, Y (i)); @@ -552,7 +464,7 @@ void tmo_fattal02 (size_t width, Array2Df* H = new Array2Df (width, height); float temp = 100.f / maxLum; float eps = 1e-4f; - #pragma omp parallel + #pragma omp parallel if(multithread) { #ifdef __SSE2__ vfloat epsv = F2V (eps); @@ -613,78 +525,55 @@ void tmo_fattal02 (size_t width, /** RT */ - // create gaussian pyramids - // int mins = (width= MSIZE ) - // { - // nlevels++; - // mins /= 2; - // } - // // std::cout << "DEBUG: nlevels = " << nlevels << ", mins = " << mins << std::endl; - // // The following lines solves a bug with images particularly small - // if (nlevels == 0) nlevels = 1; const int nlevels = 7; // RT -- see above - Array2Df** pyramids = new Array2Df*[nlevels]; - createGaussianPyramids (H, pyramids, nlevels); - // ph.setValue(8); + Array2Df* pyramids[nlevels]; + pyramids[0] = H; + createGaussianPyramids (pyramids, nlevels, multithread); // calculate gradients and its average values on pyramid levels - Array2Df** gradients = new Array2Df*[nlevels]; - float* avgGrad = new float[nlevels]; + Array2Df* gradients[nlevels]; + float avgGrad[nlevels]; for ( int k = 0 ; k < nlevels ; k++ ) { gradients[k] = new Array2Df (pyramids[k]->getCols(), pyramids[k]->getRows()); - avgGrad[k] = calculateGradients (pyramids[k], gradients[k], k); - delete pyramids[k]; + avgGrad[k] = calculateGradients (pyramids[k], gradients[k], k, multithread); + if(k != 0) // pyramids[0] is H. Will be deleted later + delete pyramids[k]; } - delete[] pyramids; - // ph.setValue(12); // calculate fi matrix Array2Df* FI = new Array2Df (width, height); - calculateFiMatrix (FI, gradients, avgGrad, nlevels, detail_level, alfa, beta, noise); + calculateFiMatrix (FI, gradients, avgGrad, nlevels, detail_level, alfa, beta, noise, multithread); -// dumpPFS( "FI.pfs", FI, "Y" ); for ( int i = 0 ; i < nlevels ; i++ ) { delete gradients[i]; } - delete[] gradients; - delete[] avgGrad; - // ph.setValue(16); - // if (ph.canceled()){ - // delete FI; - // delete H; - // return; - // } - /** - RT - bring back the FI image to the input size if it was downscaled */ if (fullH) { + delete H; + H = fullH; Array2Df *FI2 = new Array2Df (fullwidth, fullheight); rescale_bilinear (*FI, *FI2, multithread); delete FI; FI = FI2; width = fullwidth; height = fullheight; - delete H; - H = fullH; } /** RT */ // attenuate gradients Array2Df* Gx = new Array2Df (width, height); - Array2Df* Gy = new Array2Df (width, height); + Array2Df* Gy = &L; // use L as buffer for Gy // the fft solver solves the Poisson pde but with slightly different // boundary conditions, so we need to adjust the assembly of the right hand // side accordingly (basically fft solver assumes U(-1) = U(1), whereas zero // Neumann conditions assume U(-1)=U(0)), see also divergence calculation - // if (fftsolver) - #pragma omp parallel for + #pragma omp parallel for if(multithread) for ( size_t y = 0 ; y < height ; y++ ) { // sets index+1 based on the boundary assumption H(N+1)=H(N-1) @@ -702,7 +591,7 @@ void tmo_fattal02 (size_t width, delete H; // calculate divergence - #pragma omp parallel for + #pragma omp parallel for if(multithread) for ( size_t y = 0; y < height; ++y ) { for ( size_t x = 0; x < width; ++x ) { @@ -716,77 +605,58 @@ void tmo_fattal02 (size_t width, (*FI) (x, y) -= (*Gy) (x, y - 1); } - // if (fftsolver) - { - if (x == 0) { - (*FI) (x, y) += (*Gx) (x, y); - } + if (x == 0) { + (*FI) (x, y) += (*Gx) (x, y); + } - if (y == 0) { - (*FI) (x, y) += (*Gy) (x, y); - } + if (y == 0) { + (*FI) (x, y) += (*Gy) (x, y); } } } //delete Gx; // RT - reused as temp buffer in solve_pde_fft, deleted later - delete Gy; // solve pde and exponentiate (ie recover compressed image) { - // if (fftsolver) - { - MyMutex::MyLock lock (*fftwMutex); - solve_pde_fft (FI, &L, Gx, multithread); //, ph); - } - delete Gx; - delete FI; - // else - // { - // solve_pde_multigrid(&DivG, &U, ph); - // } -// #ifndef NDEBUG -// printf("\npde residual error: %f\n", residual_pde(&U, &DivG)); -// #endif - // ph.setValue(90); - // if ( ph.canceled() ) - // { - // return; - // } - #pragma omp parallel - { + MyMutex::MyLock lock (*fftwMutex); + solve_pde_fft (FI, &L, Gx, multithread); + } + delete Gx; + delete FI; + + #pragma omp parallel if(multithread) + { #ifdef __SSE2__ - vfloat gammav = F2V (gamma); + vfloat gammav = F2V (gamma); #endif - #pragma omp for schedule(dynamic,16) + #pragma omp for schedule(dynamic,16) - for (size_t i = 0 ; i < height ; i++) { - size_t j = 0; + for (size_t i = 0 ; i < height ; i++) { + size_t j = 0; #ifdef __SSE2__ - for (; j < width - 3; j += 4) { - STVFU (L[i][j], xexpf (gammav * LVFU (L[i][j]))); - } + for (; j < width - 3; j += 4) { + STVFU (L[i][j], xexpf (gammav * LVFU (L[i][j]))); + } #endif - for (; j < width; j++) { - L[i][j] = xexpf ( gamma * L[i][j]); - } + for (; j < width; j++) { + L[i][j] = xexpf ( gamma * L[i][j]); } } } - // ph.setValue(95); // remove percentile of min and max values and renormalize float cut_min = 0.01f * black_point; float cut_max = 1.0f - 0.01f * white_point; assert (cut_min >= 0.0f && (cut_max <= 1.0f) && (cut_min < cut_max)); - findMaxMinPercentile (L, cut_min, minLum, cut_max, maxLum); + findMinMaxPercentile (L.data(), L.getRows() * L.getCols(), cut_min, minLum, cut_max, maxLum, multithread); float dividor = (maxLum - minLum); - #pragma omp parallel for + #pragma omp parallel for if(multithread) for (size_t i = 0; i < height; ++i) { for (size_t j = 0; j < width; ++j) { @@ -841,35 +711,10 @@ void tmo_fattal02 (size_t width, // atimes(). This means the assembly of the right hand side F is different // for both solvers. -// #include - -// #include - -// #include -// #include -// #include "arch/math.h" -// #include -// #ifdef _OPENMP -// #include -// #endif -// #include -// #include - -// #include "Libpfs/progress.h" -// #include "Libpfs/array2d.h" -// #include "pde.h" - -// using namespace std; - - -// #ifndef SQR -// #define SQR(x) (x)*(x) -// #endif - // returns T = EVy A EVx^tr // note, modifies input data -void transform_ev2normal (Array2Df *A, Array2Df *T) +void transform_ev2normal (Array2Df *A, Array2Df *T, bool multithread) { int width = A->getCols(); int height = A->getRows(); @@ -877,7 +722,7 @@ void transform_ev2normal (Array2Df *A, Array2Df *T) // the discrete cosine transform is not exactly the transform needed // need to scale input values to get the right transformation - #pragma omp parallel for + #pragma omp parallel for if(multithread) for (int y = 1 ; y < height - 1 ; y++ ) for (int x = 1 ; x < width - 1 ; x++ ) { @@ -913,7 +758,7 @@ void transform_ev2normal (Array2Df *A, Array2Df *T) // returns T = EVy^-1 * A * (EVx^-1)^tr -void transform_normal2ev (Array2Df *A, Array2Df *T) +void transform_normal2ev (Array2Df *A, Array2Df *T, bool multithread) { int width = A->getCols(); int height = A->getRows(); @@ -928,7 +773,7 @@ void transform_normal2ev (Array2Df *A, Array2Df *T) // need to scale the output matrix to get the right transform float factor = (1.0f / ((height - 1) * (width - 1))); - #pragma omp parallel for + #pragma omp parallel for if(multithread) for (int y = 0 ; y < height ; y++ ) for (int x = 0 ; x < width ; x++ ) { @@ -1037,27 +882,17 @@ void solve_pde_fft (Array2Df *F, Array2Df *U, Array2Df *buf, bool multithread)/* // transforms F into eigenvector space: Ftr = //DEBUG_STR << "solve_pde_fft: transform F to ev space (fft)" << std::endl; - Array2Df* F_tr = buf; //new Array2Df(width,height); - transform_normal2ev (F, F_tr); + Array2Df* F_tr = buf; + transform_normal2ev (F, F_tr, multithread); // TODO: F no longer needed so could release memory, but as it is an // input parameter we won't do that - // ph.setValue(50); - // if (ph.canceled()) - // { - // delete F_tr; - // return; - // } - //DEBUG_STR << "solve_pde_fft: F_tr(0,0) = " << (*F_tr)(0,0); - //DEBUG_STR << " (must be 0 for solution to exist)" << std::endl; // in the eigenvector space the solution is very simple - //DEBUG_STR << "solve_pde_fft: solve in eigenvector space" << std::endl; -// Array2Df* U_tr = new Array2Df(width,height); std::vector l1 = get_lambda (height); std::vector l2 = get_lambda (width); - #pragma omp parallel for + #pragma omp parallel for if(multithread) for (int y = 0 ; y < height ; y++ ) { for (int x = 0 ; x < width ; x++ ) { @@ -1067,10 +902,8 @@ void solve_pde_fft (Array2Df *F, Array2Df *U, Array2Df *buf, bool multithread)/* (*F_tr) (0, 0) = 0.f; // any value ok, only adds a const to the solution - // transforms U_tr back to the normal space - //DEBUG_STR << "solve_pde_fft: transform U_tr to normal space (fft)" << std::endl; - transform_ev2normal (F_tr, U); -// delete F_tr; // no longer needed so release memory + // transforms F_tr back to the normal space + transform_ev2normal (F_tr, U, multithread); // the solution U as calculated will satisfy something like int U = 0 // since for any constant c, U-c is also a solution and we are mainly @@ -1079,13 +912,13 @@ void solve_pde_fft (Array2Df *F, Array2Df *U, Array2Df *buf, bool multithread)/* // (not really needed but good for numerics as we later take exp(U)) //DEBUG_STR << "solve_pde_fft: removing constant from solution" << std::endl; float max = 0.f; - #pragma omp parallel for reduction(max:max) + #pragma omp parallel for reduction(max:max) if(multithread) for (int i = 0; i < width * height; i++) { max = std::max (max, (*U) (i)); } - #pragma omp parallel for + #pragma omp parallel for if(multithread) for (int i = 0; i < width * height; i++) { (*U) (i) -= max; @@ -1335,17 +1168,18 @@ void ImProcFunctions::ToneMapFattal02 (Imagefloat *rgb) rescale_nearest (Yr, L, multiThread); tmo_fattal02 (w2, h2, L, L, alpha, beta, noise, detail_level, multiThread); -// tmo_fattal02(w, h, Yr, L, alpha, beta, noise, detail_level, multiThread); - + const float hr = float(h2) / float(h); + const float wr = float(w2) / float(w); + #ifdef _OPENMP #pragma omp parallel for if(multiThread) #endif - for (int y = 0; y < h; y++) { - int yy = y * h2 / h; - + int yy = y * hr + 1; + for (int x = 0; x < w; x++) { - int xx = x * w2 / w; + int xx = x * wr + 1; + float Y = Yr (x, y); float l = std::max (L (xx, yy), epsilon) * (65535.f / Y); rgb->r (y, x) = std::max (rgb->r (y, x), 0.f) * l; diff --git a/rtengine/utils.h b/rtengine/utils.h index 9c56ad0a0..5730c2544 100644 --- a/rtengine/utils.h +++ b/rtengine/utils.h @@ -38,7 +38,7 @@ void hflip(unsigned char* img, int w, int h); void vflip(unsigned char* img, int w, int h); template -typename std::underlying_type::type toUnderlying(ENUM value) +constexpr typename std::underlying_type::type toUnderlying(ENUM value) { return static_cast::type>(value); } diff --git a/rtexif/canonattribs.cc b/rtexif/canonattribs.cc index c1ab6f4f2..3b0d9c9ef 100644 --- a/rtexif/canonattribs.cc +++ b/rtexif/canonattribs.cc @@ -555,364 +555,366 @@ class CALensInterpreter : public IntLensInterpreter< int > public: CALensInterpreter () { - choices.insert (p_t (1, "Canon EF 50mm f/1.8")); - choices.insert (p_t (2, "Canon EF 28mm f/2.8")); - choices.insert (p_t (3, "Canon EF 135mm f/2.8 Soft")); - choices.insert (p_t (4, "Canon EF 35-105mm f/3.5-4.5 or Sigma Lens")); - choices.insert (p_t (4, "Sigma UC Zoom 35-135mm f/4-5.6")); - choices.insert (p_t (5, "Canon EF 35-70mm f/3.5-4.5")); - choices.insert (p_t (6, "Canon EF 28-70mm f/3.5-4.5 or Sigma or Tokina Lens")); - choices.insert (p_t (6, "Sigma 18-50mm f/3.5-5.6 DC")); - choices.insert (p_t (6, "Sigma 18-125mm f/3.5-5.6 DC IF ASP")); - choices.insert (p_t (6, "Tokina AF 193-2 19-35mm f/3.5-4.5")); - choices.insert (p_t (6, "Sigma 28-80mm f/3.5-5.6 II Macro")); - choices.insert (p_t (7, "Canon EF 100-300mm f/5.6L")); - choices.insert (p_t (8, "Canon EF 100-300mm f/5.6 or Sigma or Tokina Lens")); - choices.insert (p_t (8, "Sigma 70-300mm f/4-5.6 [APO] DG Macro")); - choices.insert (p_t (8, "Tokina AT-X 242 AF 24-200mm f/3.5-5.6")); - choices.insert (p_t (9, "Canon EF 70-210mm f/4")); - choices.insert (p_t (9, "Sigma 55-200mm f/4-5.6 DC")); - choices.insert (p_t (10, "Canon EF 50mm f/2.5 Macro or Sigma Lens")); - choices.insert (p_t (10, "Sigma 50mm f/2.8 EX")); - choices.insert (p_t (10, "Sigma 28mm f/1.8")); - choices.insert (p_t (10, "Sigma 105mm f/2.8 Macro EX")); - choices.insert (p_t (10, "Sigma 70mm f/2.8 EX DG Macro EF")); - choices.insert (p_t (11, "Canon EF 35mm f/2")); - choices.insert (p_t (13, "Canon EF 15mm f/2.8 Fisheye")); - choices.insert (p_t (14, "Canon EF 50-200mm f/3.5-4.5L")); - choices.insert (p_t (15, "Canon EF 50-200mm f/3.5-4.5")); - choices.insert (p_t (16, "Canon EF 35-135mm f/3.5-4.5")); - choices.insert (p_t (17, "Canon EF 35-70mm f/3.5-4.5A")); - choices.insert (p_t (18, "Canon EF 28-70mm f/3.5-4.5")); - choices.insert (p_t (20, "Canon EF 100-200mm f/4.5A")); - choices.insert (p_t (21, "Canon EF 80-200mm f/2.8L")); - choices.insert (p_t (22, "Canon EF 20-35mm f/2.8L or Tokina Lens")); - choices.insert (p_t (22, "Tokina AT-X 280 AF Pro 28-80mm f/2.8 Aspherical")); - choices.insert (p_t (23, "Canon EF 35-105mm f/3.5-4.5")); - choices.insert (p_t (24, "Canon EF 35-80mm f/4-5.6 Power Zoom")); - choices.insert (p_t (25, "Canon EF 35-80mm f/4-5.6 Power Zoom")); - choices.insert (p_t (26, "Canon EF 100mm f/2.8 Macro or Other Lens")); - choices.insert (p_t (26, "Cosina 100mm f/3.5 Macro AF")); - choices.insert (p_t (26, "Tamron SP AF 90mm f/2.8 Di Macro")); - choices.insert (p_t (26, "Tamron SP AF 180mm f/3.5 Di Macro")); - choices.insert (p_t (26, "Carl Zeiss Planar T* 50mm f/1.4")); - choices.insert (p_t (27, "Canon EF 35-80mm f/4-5.6")); - choices.insert (p_t (28, "Canon EF 80-200mm f/4.5-5.6 or Tamron Lens")); - choices.insert (p_t (28, "Tamron SP AF 28-105mm f/2.8 LD Aspherical IF")); - choices.insert (p_t (28, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical [IF] Macro")); - choices.insert (p_t (28, "Tamron AF 70-300mm f/4-5.6 Di LD 1:2 Macro")); - choices.insert (p_t (28, "Tamron AF Aspherical 28-200mm f/3.8-5.6")); - choices.insert (p_t (29, "Canon EF 50mm f/1.8 II")); - choices.insert (p_t (30, "Canon EF 35-105mm f/4.5-5.6")); - choices.insert (p_t (31, "Canon EF 75-300mm f/4-5.6 or Tamron Lens")); - choices.insert (p_t (31, "Tamron SP AF 300mm f/2.8 LD IF")); - choices.insert (p_t (32, "Canon EF 24mm f/2.8 or Sigma Lens")); - choices.insert (p_t (32, "Sigma 15mm f/2.8 EX Fisheye")); - choices.insert (p_t (33, "Voigtlander or Carl Zeiss Lens")); - choices.insert (p_t (33, "Voigtlander Ultron 40mm f/2 SLII Aspherical")); - choices.insert (p_t (33, "Voigtlander Color Skopar 20mm f/3.5 SLII Aspherical")); - choices.insert (p_t (33, "Voigtlander APO-Lanthar 90mm f/3.5 SLII Close Focus")); - choices.insert (p_t (33, "Carl Zeiss Distagon T* 15mm f/2.8 ZE")); - choices.insert (p_t (33, "Carl Zeiss Distagon T* 18mm f/3.5 ZE")); - choices.insert (p_t (33, "Carl Zeiss Distagon T* 21mm f/2.8 ZE")); - choices.insert (p_t (33, "Carl Zeiss Distagon T* 25mm f/2 ZE")); - choices.insert (p_t (33, "Carl Zeiss Distagon T* 28mm f/2 ZE")); - choices.insert (p_t (33, "Carl Zeiss Distagon T* 35mm f/2 ZE")); - choices.insert (p_t (33, "Carl Zeiss Distagon T* 35mm f/1.4 ZE")); - choices.insert (p_t (33, "Carl Zeiss Planar T* 50mm f/1.4 ZE")); - choices.insert (p_t (33, "Carl Zeiss Makro-Planar T* 50mm f/2 ZE")); - choices.insert (p_t (33, "Carl Zeiss Makro-Planar T* 100mm f/2 ZE")); - choices.insert (p_t (33, "Carl Zeiss Apo-Sonnar T* 135mm f/2 ZE")); - choices.insert (p_t (35, "Canon EF 35-80mm f/4-5.6")); - choices.insert (p_t (36, "Canon EF 38-76mm f/4.5-5.6")); - choices.insert (p_t (37, "Canon EF 35-80mm f/4-5.6 or Tamron Lens")); - choices.insert (p_t (37, "Tamron 70-200mm f/2.8 Di LD IF Macro")); - choices.insert (p_t (37, "Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical [IF] Macro Model A20")); - choices.insert (p_t (37, "Tamron SP AF 17-50mm f/2.8 XR Di II VC LD Aspherical [IF]")); - choices.insert (p_t (37, "Tamron AF 18-270mm f/3.5-6.3 Di II VC LD Aspherical [IF] Macro")); - choices.insert (p_t (38, "Canon EF 80-200mm f/4.5-5.6")); - choices.insert (p_t (39, "Canon EF 75-300mm f/4-5.6")); - choices.insert (p_t (40, "Canon EF 28-80mm f/3.5-5.6")); - choices.insert (p_t (41, "Canon EF 28-90mm f/4-5.6")); - choices.insert (p_t (42, "Canon EF 28-200mm f/3.5-5.6 or Tamron Lens")); - choices.insert (p_t (42, "Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical [IF] Macro Model A20")); - choices.insert (p_t (43, "Canon EF 28-105mm f/4-5.6")); - choices.insert (p_t (44, "Canon EF 90-300mm f/4.5-5.6")); - choices.insert (p_t (45, "Canon EF-S 18-55mm f/3.5-5.6 [II]")); - choices.insert (p_t (46, "Canon EF 28-90mm f/4-5.6")); - choices.insert (p_t (47, "Zeiss Milvus 35mm f/2 or 50mm f/2")); - choices.insert (p_t (47, "Zeiss Milvus 50mm f/2 Makro")); - choices.insert (p_t (48, "Canon EF-S 18-55mm f/3.5-5.6 IS")); - choices.insert (p_t (49, "Canon EF-S 55-250mm f/4-5.6 IS")); - choices.insert (p_t (50, "Canon EF-S 18-200mm f/3.5-5.6 IS")); - choices.insert (p_t (51, "Canon EF-S 18-135mm f/3.5-5.6 IS")); - choices.insert (p_t (52, "Canon EF-S 18-55mm f/3.5-5.6 IS II")); - choices.insert (p_t (53, "Canon EF-S 18-55mm f/3.5-5.6 III")); - choices.insert (p_t (54, "Canon EF-S 55-250mm f/4-5.6 IS II")); - choices.insert (p_t (60, "Irix 11mm f/4")); - choices.insert (p_t (80, "Canon TS-E 50mm f/2.8L Macro")); - choices.insert (p_t (81, "Canon TS-E 90mm f/2.8L Macro")); - choices.insert (p_t (82, "Canon TS-E 135mm f/4L Macro")); - choices.insert (p_t (94, "Canon TS-E 17mm f/4L")); - choices.insert (p_t (95, "Canon TS-E 24mm f/3.5L II")); - choices.insert (p_t (124, "Canon MP-E 65mm f/2.8 1-5x Macro Photo")); - choices.insert (p_t (125, "Canon TS-E 24mm f/3.5L")); - choices.insert (p_t (126, "Canon TS-E 45mm f/2.8")); - choices.insert (p_t (127, "Canon TS-E 90mm f/2.8")); - choices.insert (p_t (129, "Canon EF 300mm f/2.8L")); - choices.insert (p_t (130, "Canon EF 50mm f/1.0L")); - choices.insert (p_t (131, "Canon EF 28-80mm f/2.8-4L or Sigma Lens")); - choices.insert (p_t (131, "Sigma 8mm f/3.5 EX DG Circular Fisheye")); - choices.insert (p_t (131, "Sigma 17-35mm f/2.8-4 EX DG Aspherical HSM")); - choices.insert (p_t (131, "Sigma 17-70mm f/2.8-4.5 DC Macro")); - choices.insert (p_t (131, "Sigma APO 50-150mm f/2.8 [II] EX DC HSM")); - choices.insert (p_t (131, "Sigma APO 120-300mm f/2.8 EX DG HSM")); - choices.insert (p_t (131, "Sigma 4.5mm f/2.8 EX DC HSM Circular Fisheye")); - choices.insert (p_t (131, "Sigma 70-200mm f/2.8 APO EX HSM")); - choices.insert (p_t (132, "Canon EF 1200mm f/5.6L")); - choices.insert (p_t (134, "Canon EF 600mm f/4L IS")); - choices.insert (p_t (135, "Canon EF 200mm f/1.8L")); - choices.insert (p_t (136, "Canon EF 300mm f/2.8L")); - choices.insert (p_t (137, "Canon EF 85mm f/1.2L or Sigma or Tamron Lens")); - choices.insert (p_t (137, "Sigma 18-50mm f/2.8-4.5 DC OS HSM")); - choices.insert (p_t (137, "Sigma 50-200mm f/4-5.6 DC OS HSM")); - choices.insert (p_t (137, "Sigma 18-250mm f/3.5-6.3 DC OS HSM")); - choices.insert (p_t (137, "Sigma 24-70mm f/2.8 IF EX DG HSM")); - choices.insert (p_t (137, "Sigma 18-125mm f/3.8-5.6 DC OS HSM")); - choices.insert (p_t (137, "Sigma 17-70mm f/2.8-4 DC Macro OS HSM | C")); - choices.insert (p_t (137, "Sigma 17-50mm f/2.8 OS HSM")); - choices.insert (p_t (137, "Sigma 18-200mm f/3.5-6.3 DC OS HSM [II]")); - choices.insert (p_t (137, "Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD")); - choices.insert (p_t (137, "Sigma 8-16mm f/4.5-5.6 DC HSM")); - choices.insert (p_t (137, "Tamron SP 17-50mm f/2.8 XR Di II VC")); - choices.insert (p_t (137, "Tamron SP 60mm f/2 Macro Di II")); - choices.insert (p_t (137, "Sigma 10-20mm f/3.5 EX DC HSM")); - choices.insert (p_t (137, "Tamron SP 24-70mm f/2.8 Di VC USD")); - choices.insert (p_t (137, "Sigma 18-35mm f/1.8 DC HSM")); - choices.insert (p_t (137, "Sigma 12-24mm f/4.5-5.6 DG HSM II")); - choices.insert (p_t (138, "Canon EF 28-80mm f/2.8-4L")); - choices.insert (p_t (139, "Canon EF 400mm f/2.8L")); - choices.insert (p_t (140, "Canon EF 500mm f/4.5L")); - choices.insert (p_t (141, "Canon EF 500mm f/4.5L")); - choices.insert (p_t (142, "Canon EF 300mm f/2.8L IS")); - choices.insert (p_t (143, "Canon EF 500mm f/4L IS or Sigma Lens")); - choices.insert (p_t (143, "Sigma 17-70mm f/2.8-4 DC Macro OS HSM")); - choices.insert (p_t (144, "Canon EF 35-135mm f/4-5.6 USM")); - choices.insert (p_t (145, "Canon EF 100-300mm f/4.5-5.6 USM")); - choices.insert (p_t (146, "Canon EF 70-210mm f/3.5-4.5 USM")); - choices.insert (p_t (147, "Canon EF 35-135mm f/4-5.6 USM")); - choices.insert (p_t (148, "Canon EF 28-80mm f/3.5-5.6 USM")); - choices.insert (p_t (149, "Canon EF 100mm f/2 USM")); - choices.insert (p_t (150, "Canon EF 14mm f/2.8L or Sigma Lens")); - choices.insert (p_t (150, "Sigma 20mm EX f/1.8")); - choices.insert (p_t (150, "Sigma 30mm f/1.4 DC HSM")); - choices.insert (p_t (150, "Sigma 24mm f/1.8 DG Macro EX")); - choices.insert (p_t (150, "Sigma 28mm f/1.8 DG Macro EX")); - choices.insert (p_t (151, "Canon EF 200mm f/2.8L")); - choices.insert (p_t (152, "Canon EF 300mm f/4L IS or Sigma Lens")); - choices.insert (p_t (152, "Sigma 12-24mm f/4.5-5.6 EX DG ASPHERICAL HSM")); - choices.insert (p_t (152, "Sigma 14mm f/2.8 EX Aspherical HSM")); - choices.insert (p_t (152, "Sigma 10-20mm f/4-5.6")); - choices.insert (p_t (152, "Sigma 100-300mm f/4")); - choices.insert (p_t (153, "Canon EF 35-350mm f/3.5-5.6L or Sigma or Tamron Lens")); - choices.insert (p_t (153, "Sigma 50-500mm f/4-6.3 APO HSM EX")); - choices.insert (p_t (153, "Tamron AF 28-300mm f/3.5-6.3 XR LD Aspherical [IF] Macro")); - choices.insert (p_t (153, "Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical [IF] Macro Model A14")); - choices.insert (p_t (153, "Tamron 18-250mm f/3.5-6.3 Di II LD Aspherical [IF] Macro")); - choices.insert (p_t (154, "Canon EF 20mm f/2.8 USM or Zeiss Lens")); - choices.insert (p_t (154, "Zeiss Milvus 21mm f/2.8")); - choices.insert (p_t (155, "Canon EF 85mm f/1.8 USM")); - choices.insert (p_t (156, "Canon EF 28-105mm f/3.5-4.5 USM or Tamron Lens")); - choices.insert (p_t (156, "Tamron SP 70-300mm f/4.0-5.6 Di VC USD")); - choices.insert (p_t (156, "Tamron SP AF 28-105mm f/2.8 LD Aspherical IF")); - choices.insert (p_t (160, "Canon EF 20-35mm f/3.5-4.5 USM or Tamron or Tokina Lens")); - choices.insert (p_t (160, "Tamron AF 19-35mm f/3.5-4.5")); - choices.insert (p_t (160, "Tokina AT-X 124 AF Pro DX 12-24mm f/4")); - choices.insert (p_t (160, "Tokina AT-X 107 AF DX 10-17mm f/3.5-4.5 Fisheye")); - choices.insert (p_t (160, "Tokina AT-X 116 AF Pro DX 11-16mm f/2.8")); - choices.insert (p_t (160, "Tokina AT-X 11-20 F2.8 PRO DX Aspherical 11-20mm f/2.8")); - choices.insert (p_t (161, "Canon EF 28-70mm f/2.8L or Sigma or Tamron Lens")); - choices.insert (p_t (161, "Sigma 24-70mm f/2.8 EX")); - choices.insert (p_t (161, "Sigma 28-70mm f/2.8 EX")); - choices.insert (p_t (161, "Sigma 24-60mm f/2.8 EX DG")); - choices.insert (p_t (161, "Tamron AF 17-50mm f/2.8 Di-II LD Aspherical")); - choices.insert (p_t (161, "Tamron 90mm f/2.8")); - choices.insert (p_t (161, "Tamron SP AF 17-35mm f/2.8-4 Di LD Aspherical IF")); - choices.insert (p_t (161, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical [IF] Macro")); - choices.insert (p_t (162, "Canon EF 200mm f/2.8L")); - choices.insert (p_t (163, "Canon EF 300mm f/4L")); - choices.insert (p_t (164, "Canon EF 400mm f/5.6L")); - choices.insert (p_t (165, "Canon EF 70-200mm f/2.8 L")); - choices.insert (p_t (166, "Canon EF 70-200mm f/2.8 L + 1.4x")); - choices.insert (p_t (167, "Canon EF 70-200mm f/2.8 L + 2x")); - choices.insert (p_t (168, "Canon EF 28mm f/1.8 USM or Sigma Lens")); - choices.insert (p_t (168, "Sigma 50-100mm f/1.8 DC HSM | A")); - choices.insert (p_t (169, "Canon EF 17-35mm f/2.8L or Sigma Lens")); - choices.insert (p_t (169, "Sigma 18-200mm f/3.5-6.3 DC OS")); - choices.insert (p_t (169, "Sigma 15-30mm f/3.5-4.5 EX DG Aspherical")); - choices.insert (p_t (169, "Sigma 18-50mm f/2.8 Macro")); - choices.insert (p_t (169, "Sigma 50mm f/1.4 EX DG HSM")); - choices.insert (p_t (169, "Sigma 85mm f/1.4 EX DG HSM")); - choices.insert (p_t (169, "Sigma 30mm f/1.4 EX DC HSM")); - choices.insert (p_t (169, "Sigma 35mm f/1.4 DG HSM")); - choices.insert (p_t (170, "Canon EF 200mm f/2.8L II")); - choices.insert (p_t (171, "Canon EF 300mm f/4L")); - choices.insert (p_t (172, "Canon EF 400mm f/5.6L or Sigma Lens")); - choices.insert (p_t (172, "Sigma 150-600mm f/5-6.3 DG OS HSM | S")); - choices.insert (p_t (173, "Canon EF 180mm Macro f/3.5L or Sigma Lens")); - choices.insert (p_t (173, "Sigma 180mm EX HSM Macro f/3.5")); - choices.insert (p_t (173, "Sigma APO Macro 150mm f/2.8 EX DG HSM")); - choices.insert (p_t (174, "Canon EF 135mm f/2L or Other Lens")); - choices.insert (p_t (174, "Sigma 70-200mm f/2.8 EX DG APO OS HSM")); - choices.insert (p_t (174, "Sigma 50-500mm f/4.5-6.3 APO DG OS HSM")); - choices.insert (p_t (174, "Sigma 150-500mm f/5-6.3 APO DG OS HSM")); - choices.insert (p_t (174, "Zeiss Milvus 100mm f/2 Makro")); - choices.insert (p_t (175, "Canon EF 400mm f/2.8L")); - choices.insert (p_t (176, "Canon EF 24-85mm f/3.5-4.5 USM")); - choices.insert (p_t (177, "Canon EF 300mm f/4L IS")); - choices.insert (p_t (178, "Canon EF 28-135mm f/3.5-5.6 IS")); - choices.insert (p_t (179, "Canon EF 24mm f/1.4L")); - choices.insert (p_t (180, "Canon EF 35mm f/1.4L or Other Lens")); - choices.insert (p_t (180, "Sigma 50mm f/1.4 DG HSM | A")); - choices.insert (p_t (180, "Sigma 24mm f/1.4 DG HSM | A")); - choices.insert (p_t (180, "Zeiss Milvus 50mm f/1.4")); - choices.insert (p_t (180, "Zeiss Milvus 85mm f/1.4")); - choices.insert (p_t (180, "Zeiss Otus 28mm f/1.4 ZE")); - choices.insert (p_t (181, "Canon EF 100-400mm f/4.5-5.6L IS + 1.4x or Sigma Lens")); - choices.insert (p_t (181, "Sigma 150-600mm f/5-6.3 DG OS HSM | S + 1.4x")); - choices.insert (p_t (182, "Canon EF 100-400mm f/4.5-5.6L IS + 2x or Sigma Lens")); - choices.insert (p_t (182, "Sigma 150-600mm f/5-6.3 DG OS HSM | S + 2x")); - choices.insert (p_t (183, "Canon EF 100-400mm f/4.5-5.6L IS or Sigma Lens")); - choices.insert (p_t (183, "Sigma 150mm f/2.8 EX DG OS HSM APO Macro")); - choices.insert (p_t (183, "Sigma 105mm f/2.8 EX DG OS HSM Macro")); - choices.insert (p_t (183, "Sigma 180mm f/2.8 EX DG OS HSM APO Macro")); - choices.insert (p_t (183, "Sigma 150-600mm f/5-6.3 DG OS HSM | C")); - choices.insert (p_t (183, "Sigma 150-600mm f/5-6.3 DG OS HSM | S")); - choices.insert (p_t (183, "Sigma 100-400mm f/5-6.3 DG OS HSM")); - choices.insert (p_t (184, "Canon EF 400mm f/2.8L + 2x")); - choices.insert (p_t (185, "Canon EF 600mm f/4L IS")); - choices.insert (p_t (186, "Canon EF 70-200mm f/4L")); - choices.insert (p_t (187, "Canon EF 70-200mm f/4L + 1.4x")); - choices.insert (p_t (188, "Canon EF 70-200mm f/4L + 2x")); - choices.insert (p_t (189, "Canon EF 70-200mm f/4L + 2.8x")); - choices.insert (p_t (190, "Canon EF 100mm f/2.8 Macro USM")); - choices.insert (p_t (191, "Canon EF 400mm f/4 DO IS")); - choices.insert (p_t (193, "Canon EF 35-80mm f/4-5.6 USM")); - choices.insert (p_t (194, "Canon EF 80-200mm f/4.5-5.6 USM")); - choices.insert (p_t (195, "Canon EF 35-105mm f/4.5-5.6 USM")); - choices.insert (p_t (196, "Canon EF 75-300mm f/4-5.6 USM")); - choices.insert (p_t (197, "Canon EF 75-300mm f/4-5.6 IS USM or Sigma Lens")); - choices.insert (p_t (197, "Sigma 18-300mm f/3.5-6.3 DC Macro OS HS")); - choices.insert (p_t (198, "Canon EF 50mm f/1.4 USM or Zeiss Lens")); - choices.insert (p_t (198, "Zeiss Otus 55mm f/1.4 ZE")); - choices.insert (p_t (198, "Zeiss Otus 85mm f/1.4 ZE")); - choices.insert (p_t (199, "Canon EF 28-80mm f/3.5-5.6 USM")); - choices.insert (p_t (200, "Canon EF 75-300mm f/4-5.6 USM")); - choices.insert (p_t (201, "Canon EF 28-80mm f/3.5-5.6 USM")); - choices.insert (p_t (202, "Canon EF 28-80mm f/3.5-5.6 USM IV")); - choices.insert (p_t (208, "Canon EF 22-55mm f/4-5.6 USM")); - choices.insert (p_t (209, "Canon EF 55-200mm f/4.5-5.6")); - choices.insert (p_t (210, "Canon EF 28-90mm f/4-5.6 USM")); - choices.insert (p_t (211, "Canon EF 28-200mm f/3.5-5.6 USM")); - choices.insert (p_t (212, "Canon EF 28-105mm f/4-5.6 USM")); - choices.insert (p_t (213, "Canon EF 90-300mm f/4.5-5.6 USM or Tamron Lens")); - choices.insert (p_t (213, "Tamron SP 150-600mm f/5-6.3 Di VC USD")); - choices.insert (p_t (213, "Tamron 16-300mm f/3.5-6.3 Di II VC PZD Macro")); - choices.insert (p_t (213, "Tamron SP 35mm f/1.8 Di VC USD")); - choices.insert (p_t (213, "Tamron SP 45mm f/1.8 Di VC USD")); - choices.insert (p_t (214, "Canon EF-S 18-55mm f/3.5-5.6 USM")); - choices.insert (p_t (215, "Canon EF 55-200mm f/4.5-5.6 II USM")); - choices.insert (p_t (217, "Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD")); - choices.insert (p_t (224, "Canon EF 70-200mm f/2.8L IS")); - choices.insert (p_t (225, "Canon EF 70-200mm f/2.8L IS + 1.4x")); - choices.insert (p_t (226, "Canon EF 70-200mm f/2.8L IS + 2x")); - choices.insert (p_t (227, "Canon EF 70-200mm f/2.8L IS + 2.8x")); - choices.insert (p_t (228, "Canon EF 28-105mm f/3.5-4.5 USM")); - choices.insert (p_t (229, "Canon EF 16-35mm f/2.8L")); - choices.insert (p_t (230, "Canon EF 24-70mm f/2.8L")); - choices.insert (p_t (231, "Canon EF 17-40mm f/4L")); - choices.insert (p_t (232, "Canon EF 70-300mm f/4.5-5.6 DO IS USM")); - choices.insert (p_t (233, "Canon EF 28-300mm f/3.5-5.6L IS")); - choices.insert (p_t (234, "Canon EF-S 17-85mm f/4-5.6 IS USM or Tokina Lens")); - choices.insert (p_t (234, "Tokina AT-X 12-28 PRO DX 12-28mm f/4")); - choices.insert (p_t (235, "Canon EF-S 10-22mm f/3.5-4.5 USM")); - choices.insert (p_t (236, "Canon EF-S 60mm f/2.8 Macro USM")); - choices.insert (p_t (237, "Canon EF 24-105mm f/4L IS")); - choices.insert (p_t (238, "Canon EF 70-300mm f/4-5.6 IS USM")); - choices.insert (p_t (239, "Canon EF 85mm f/1.2L II")); - choices.insert (p_t (240, "Canon EF-S 17-55mm f/2.8 IS USM")); - choices.insert (p_t (241, "Canon EF 50mm f/1.2L")); - choices.insert (p_t (242, "Canon EF 70-200mm f/4L IS")); - choices.insert (p_t (243, "Canon EF 70-200mm f/4L IS + 1.4x")); - choices.insert (p_t (244, "Canon EF 70-200mm f/4L IS + 2x")); - choices.insert (p_t (245, "Canon EF 70-200mm f/4L IS + 2.8x")); - choices.insert (p_t (246, "Canon EF 16-35mm f/2.8L II")); - choices.insert (p_t (247, "Canon EF 14mm f/2.8L II USM")); - choices.insert (p_t (248, "Canon EF 200mm f/2L IS or Sigma Lens")); - choices.insert (p_t (248, "Sigma 24-35mm f/2 DG HSM | A")); - choices.insert (p_t (249, "Canon EF 800mm f/5.6L IS")); - choices.insert (p_t (250, "Canon EF 24mm f/1.4L II or Sigma Lens")); - choices.insert (p_t (250, "Sigma 20mm f/1.4 DG HSM | A")); - choices.insert (p_t (251, "Canon EF 70-200mm f/2.8L IS II USM")); - choices.insert (p_t (252, "Canon EF 70-200mm f/2.8L IS II USM + 1.4x")); - choices.insert (p_t (253, "Canon EF 70-200mm f/2.8L IS II USM + 2x")); - choices.insert (p_t (254, "Canon EF 100mm f/2.8L Macro IS USM")); - choices.insert (p_t (255, "Sigma 24-105mm f/4 DG OS HSM | A or Other Sigma Lens")); - choices.insert (p_t (255, "Sigma 180mm f/2.8 EX DG OS HSM APO Macro")); - choices.insert (p_t (488, "Canon EF-S 15-85mm f/3.5-5.6 IS USM")); - choices.insert (p_t (489, "Canon EF 70-300mm f/4-5.6L IS USM")); - choices.insert (p_t (490, "Canon EF 8-15mm f/4L Fisheye USM")); - choices.insert (p_t (491, "Canon EF 300mm f/2.8L IS II USM or Tamron Lens")); - choices.insert (p_t (491, "Tamron SP 70-200mm f/2.8 Di VC USD G2 (A025)")); - choices.insert (p_t (491, "Tamron 18-400mm f/3.5-6.3 Di II VC HLD (B028)")); - choices.insert (p_t (492, "Canon EF 400mm f/2.8L IS II USM")); - choices.insert (p_t (493, "Canon EF 500mm f/4L IS II USM or EF 24-105mm f4L IS USM")); - choices.insert (p_t (493, "Canon EF 24-105mm f/4L IS USM")); - choices.insert (p_t (494, "Canon EF 600mm f/4.0L IS II USM")); - choices.insert (p_t (495, "Canon EF 24-70mm f/2.8L II USM or Sigma Lens")); - choices.insert (p_t (495, "Sigma 24-70mm F2.8 DG OS HSM | A")); - choices.insert (p_t (496, "Canon EF 200-400mm f/4L IS USM")); - choices.insert (p_t (499, "Canon EF 200-400mm f/4L IS USM + 1.4x")); - choices.insert (p_t (502, "Canon EF 28mm f/2.8 IS USM")); - choices.insert (p_t (503, "Canon EF 24mm f/2.8 IS USM")); - choices.insert (p_t (504, "Canon EF 24-70mm f/4L IS USM")); - choices.insert (p_t (505, "Canon EF 35mm f/2 IS USM")); - choices.insert (p_t (506, "Canon EF 400mm f/4 DO IS II USM")); - choices.insert (p_t (507, "Canon EF 16-35mm f/4L IS USM")); - choices.insert (p_t (508, "Canon EF 11-24mm f/4L USM or Tamron Lens")); - choices.insert (p_t (508, "Tamron 10-24mm f/3.5-4.5 Di II VC HLD")); - choices.insert (p_t (747, "Canon EF 100-400mm f/4.5-5.6L IS II USM or Tamron Lens")); - choices.insert (p_t (747, "Tamron SP 150-600mm F5-6.3 Di VC USD G2")); - choices.insert (p_t (748, "Canon EF 100-400mm f/4.5-5.6L IS II USM + 1.4x")); - choices.insert (p_t (750, "Canon EF 35mm f/1.4L II USM")); - choices.insert (p_t (751, "Canon EF 16-35mm f/2.8L III USM")); - choices.insert (p_t (752, "Canon EF 24-105mm f/4L IS II USM")); - choices.insert (p_t (4142, "Canon EF-S 18-135mm f/3.5-5.6 IS STM")); - choices.insert (p_t (4143, "Canon EF-M 18-55mm f/3.5-5.6 IS STM or Tamron Lens")); - choices.insert (p_t (4143, "Tamron 18-200mm f/3.5-6.3 Di III VC")); - choices.insert (p_t (4144, "Canon EF 40mm f/2.8 STM")); - choices.insert (p_t (4145, "Canon EF-M 22mm f/2 STM")); - choices.insert (p_t (4146, "Canon EF-S 18-55mm f/3.5-5.6 IS STM")); - choices.insert (p_t (4147, "Canon EF-M 11-22mm f/4-5.6 IS STM")); - choices.insert (p_t (4148, "Canon EF-S 55-250mm f/4-5.6 IS STM")); - choices.insert (p_t (4149, "Canon EF-M 55-200mm f/4.5-6.3 IS STM")); - choices.insert (p_t (4150, "Canon EF-S 10-18mm f/4.5-5.6 IS STM")); - choices.insert (p_t (4152, "Canon EF 24-105mm f/3.5-5.6 IS STM")); - choices.insert (p_t (4153, "Canon EF-M 15-45mm f/3.5-6.3 IS STM")); - choices.insert (p_t (4154, "Canon EF-S 24mm f/2.8 STM")); - choices.insert (p_t (4155, "Canon EF-M 28mm f/3.5 Macro IS STM")); - choices.insert (p_t (4156, "Canon EF 50mm f/1.8 STM")); - choices.insert (p_t (4157, "Canon EF-M 18-150mm 1:3.5-6.3 IS STM")); - choices.insert (p_t (4158, "Canon EF-S 18-55mm f/4-5.6 IS STM")); - choices.insert (p_t (4160, "Canon EF-S 35mm f/2.8 Macro IS STM")); - choices.insert (p_t (36910, "Canon EF 70-300mm f/4-5.6 IS II USM")); - choices.insert (p_t (36912, "Canon EF-S 18-135mm f/3.5-5.6 IS USM")); - choices.insert (p_t (61491, "Canon CN-E 14mm T3.1 L F")); - choices.insert (p_t (61492, "Canon CN-E 24mm T1.5 L F")); - choices.insert (p_t (61494, "Canon CN-E 85mm T1.3 L F")); - choices.insert (p_t (61495, "Canon CN-E 135mm T2.2 L F")); - choices.insert (p_t (61496, "Canon CN-E 35mm T1.5 L F")); - choices.insert (p_t (65535, "n/a")); + choices = { + {1, "Canon EF 50mm f/1.8"}, + {2, "Canon EF 28mm f/2.8"}, + {3, "Canon EF 135mm f/2.8 Soft"}, + {4, "Canon EF 35-105mm f/3.5-4.5 or Sigma Lens"}, + {4, "Sigma UC Zoom 35-135mm f/4-5.6"}, + {5, "Canon EF 35-70mm f/3.5-4.5"}, + {6, "Canon EF 28-70mm f/3.5-4.5 or Sigma or Tokina Lens"}, + {6, "Sigma 18-50mm f/3.5-5.6 DC"}, + {6, "Sigma 18-125mm f/3.5-5.6 DC IF ASP"}, + {6, "Tokina AF 193-2 19-35mm f/3.5-4.5"}, + {6, "Sigma 28-80mm f/3.5-5.6 II Macro"}, + {7, "Canon EF 100-300mm f/5.6L"}, + {8, "Canon EF 100-300mm f/5.6 or Sigma or Tokina Lens"}, + {8, "Sigma 70-300mm f/4-5.6 [APO] DG Macro"}, + {8, "Tokina AT-X 242 AF 24-200mm f/3.5-5.6"}, + {9, "Canon EF 70-210mm f/4"}, + {9, "Sigma 55-200mm f/4-5.6 DC"}, + {10, "Canon EF 50mm f/2.5 Macro or Sigma Lens"}, + {10, "Sigma 50mm f/2.8 EX"}, + {10, "Sigma 28mm f/1.8"}, + {10, "Sigma 105mm f/2.8 Macro EX"}, + {10, "Sigma 70mm f/2.8 EX DG Macro EF"}, + {11, "Canon EF 35mm f/2"}, + {13, "Canon EF 15mm f/2.8 Fisheye"}, + {14, "Canon EF 50-200mm f/3.5-4.5L"}, + {15, "Canon EF 50-200mm f/3.5-4.5"}, + {16, "Canon EF 35-135mm f/3.5-4.5"}, + {17, "Canon EF 35-70mm f/3.5-4.5A"}, + {18, "Canon EF 28-70mm f/3.5-4.5"}, + {20, "Canon EF 100-200mm f/4.5A"}, + {21, "Canon EF 80-200mm f/2.8L"}, + {22, "Canon EF 20-35mm f/2.8L or Tokina Lens"}, + {22, "Tokina AT-X 280 AF Pro 28-80mm f/2.8 Aspherical"}, + {23, "Canon EF 35-105mm f/3.5-4.5"}, + {24, "Canon EF 35-80mm f/4-5.6 Power Zoom"}, + {25, "Canon EF 35-80mm f/4-5.6 Power Zoom"}, + {26, "Canon EF 100mm f/2.8 Macro or Other Lens"}, + {26, "Cosina 100mm f/3.5 Macro AF"}, + {26, "Tamron SP AF 90mm f/2.8 Di Macro"}, + {26, "Tamron SP AF 180mm f/3.5 Di Macro"}, + {26, "Carl Zeiss Planar T* 50mm f/1.4"}, + {27, "Canon EF 35-80mm f/4-5.6"}, + {28, "Canon EF 80-200mm f/4.5-5.6 or Tamron Lens"}, + {28, "Tamron SP AF 28-105mm f/2.8 LD Aspherical IF"}, + {28, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical [IF] Macro"}, + {28, "Tamron AF 70-300mm f/4-5.6 Di LD 1:2 Macro"}, + {28, "Tamron AF Aspherical 28-200mm f/3.8-5.6"}, + {29, "Canon EF 50mm f/1.8 II"}, + {30, "Canon EF 35-105mm f/4.5-5.6"}, + {31, "Canon EF 75-300mm f/4-5.6 or Tamron Lens"}, + {31, "Tamron SP AF 300mm f/2.8 LD IF"}, + {32, "Canon EF 24mm f/2.8 or Sigma Lens"}, + {32, "Sigma 15mm f/2.8 EX Fisheye"}, + {33, "Voigtlander or Carl Zeiss Lens"}, + {33, "Voigtlander Ultron 40mm f/2 SLII Aspherical"}, + {33, "Voigtlander Color Skopar 20mm f/3.5 SLII Aspherical"}, + {33, "Voigtlander APO-Lanthar 90mm f/3.5 SLII Close Focus"}, + {33, "Carl Zeiss Distagon T* 15mm f/2.8 ZE"}, + {33, "Carl Zeiss Distagon T* 18mm f/3.5 ZE"}, + {33, "Carl Zeiss Distagon T* 21mm f/2.8 ZE"}, + {33, "Carl Zeiss Distagon T* 25mm f/2 ZE"}, + {33, "Carl Zeiss Distagon T* 28mm f/2 ZE"}, + {33, "Carl Zeiss Distagon T* 35mm f/2 ZE"}, + {33, "Carl Zeiss Distagon T* 35mm f/1.4 ZE"}, + {33, "Carl Zeiss Planar T* 50mm f/1.4 ZE"}, + {33, "Carl Zeiss Makro-Planar T* 50mm f/2 ZE"}, + {33, "Carl Zeiss Makro-Planar T* 100mm f/2 ZE"}, + {33, "Carl Zeiss Apo-Sonnar T* 135mm f/2 ZE"}, + {35, "Canon EF 35-80mm f/4-5.6"}, + {36, "Canon EF 38-76mm f/4.5-5.6"}, + {37, "Canon EF 35-80mm f/4-5.6 or Tamron Lens"}, + {37, "Tamron 70-200mm f/2.8 Di LD IF Macro"}, + {37, "Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical [IF] Macro Model A20"}, + {37, "Tamron SP AF 17-50mm f/2.8 XR Di II VC LD Aspherical [IF]"}, + {37, "Tamron AF 18-270mm f/3.5-6.3 Di II VC LD Aspherical [IF] Macro"}, + {38, "Canon EF 80-200mm f/4.5-5.6"}, + {39, "Canon EF 75-300mm f/4-5.6"}, + {40, "Canon EF 28-80mm f/3.5-5.6"}, + {41, "Canon EF 28-90mm f/4-5.6"}, + {42, "Canon EF 28-200mm f/3.5-5.6 or Tamron Lens"}, + {42, "Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical [IF] Macro Model A20"}, + {43, "Canon EF 28-105mm f/4-5.6"}, + {44, "Canon EF 90-300mm f/4.5-5.6"}, + {45, "Canon EF-S 18-55mm f/3.5-5.6 [II]"}, + {46, "Canon EF 28-90mm f/4-5.6"}, + {47, "Zeiss Milvus 35mm f/2 or 50mm f/2"}, + {47, "Zeiss Milvus 50mm f/2 Makro"}, + {48, "Canon EF-S 18-55mm f/3.5-5.6 IS"}, + {49, "Canon EF-S 55-250mm f/4-5.6 IS"}, + {50, "Canon EF-S 18-200mm f/3.5-5.6 IS"}, + {51, "Canon EF-S 18-135mm f/3.5-5.6 IS"}, + {52, "Canon EF-S 18-55mm f/3.5-5.6 IS II"}, + {53, "Canon EF-S 18-55mm f/3.5-5.6 III"}, + {54, "Canon EF-S 55-250mm f/4-5.6 IS II"}, + {60, "Irix 11mm f/4"}, + {80, "Canon TS-E 50mm f/2.8L Macro"}, + {81, "Canon TS-E 90mm f/2.8L Macro"}, + {82, "Canon TS-E 135mm f/4L Macro"}, + {94, "Canon TS-E 17mm f/4L"}, + {95, "Canon TS-E 24mm f/3.5L II"}, + {124, "Canon MP-E 65mm f/2.8 1-5x Macro Photo"}, + {125, "Canon TS-E 24mm f/3.5L"}, + {126, "Canon TS-E 45mm f/2.8"}, + {127, "Canon TS-E 90mm f/2.8"}, + {129, "Canon EF 300mm f/2.8L"}, + {130, "Canon EF 50mm f/1.0L"}, + {131, "Canon EF 28-80mm f/2.8-4L or Sigma Lens"}, + {131, "Sigma 8mm f/3.5 EX DG Circular Fisheye"}, + {131, "Sigma 17-35mm f/2.8-4 EX DG Aspherical HSM"}, + {131, "Sigma 17-70mm f/2.8-4.5 DC Macro"}, + {131, "Sigma APO 50-150mm f/2.8 [II] EX DC HSM"}, + {131, "Sigma APO 120-300mm f/2.8 EX DG HSM"}, + {131, "Sigma 4.5mm f/2.8 EX DC HSM Circular Fisheye"}, + {131, "Sigma 70-200mm f/2.8 APO EX HSM"}, + {132, "Canon EF 1200mm f/5.6L"}, + {134, "Canon EF 600mm f/4L IS"}, + {135, "Canon EF 200mm f/1.8L"}, + {136, "Canon EF 300mm f/2.8L"}, + {137, "Canon EF 85mm f/1.2L or Sigma or Tamron Lens"}, + {137, "Sigma 18-50mm f/2.8-4.5 DC OS HSM"}, + {137, "Sigma 50-200mm f/4-5.6 DC OS HSM"}, + {137, "Sigma 18-250mm f/3.5-6.3 DC OS HSM"}, + {137, "Sigma 24-70mm f/2.8 IF EX DG HSM"}, + {137, "Sigma 18-125mm f/3.8-5.6 DC OS HSM"}, + {137, "Sigma 17-70mm f/2.8-4 DC Macro OS HSM | C"}, + {137, "Sigma 17-50mm f/2.8 OS HSM"}, + {137, "Sigma 18-200mm f/3.5-6.3 DC OS HSM [II]"}, + {137, "Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD"}, + {137, "Sigma 8-16mm f/4.5-5.6 DC HSM"}, + {137, "Tamron SP 17-50mm f/2.8 XR Di II VC"}, + {137, "Tamron SP 60mm f/2 Macro Di II"}, + {137, "Sigma 10-20mm f/3.5 EX DC HSM"}, + {137, "Tamron SP 24-70mm f/2.8 Di VC USD"}, + {137, "Sigma 18-35mm f/1.8 DC HSM"}, + {137, "Sigma 12-24mm f/4.5-5.6 DG HSM II"}, + {138, "Canon EF 28-80mm f/2.8-4L"}, + {139, "Canon EF 400mm f/2.8L"}, + {140, "Canon EF 500mm f/4.5L"}, + {141, "Canon EF 500mm f/4.5L"}, + {142, "Canon EF 300mm f/2.8L IS"}, + {143, "Canon EF 500mm f/4L IS or Sigma Lens"}, + {143, "Sigma 17-70mm f/2.8-4 DC Macro OS HSM"}, + {144, "Canon EF 35-135mm f/4-5.6 USM"}, + {145, "Canon EF 100-300mm f/4.5-5.6 USM"}, + {146, "Canon EF 70-210mm f/3.5-4.5 USM"}, + {147, "Canon EF 35-135mm f/4-5.6 USM"}, + {148, "Canon EF 28-80mm f/3.5-5.6 USM"}, + {149, "Canon EF 100mm f/2 USM"}, + {150, "Canon EF 14mm f/2.8L or Sigma Lens"}, + {150, "Sigma 20mm EX f/1.8"}, + {150, "Sigma 30mm f/1.4 DC HSM"}, + {150, "Sigma 24mm f/1.8 DG Macro EX"}, + {150, "Sigma 28mm f/1.8 DG Macro EX"}, + {151, "Canon EF 200mm f/2.8L"}, + {152, "Canon EF 300mm f/4L IS or Sigma Lens"}, + {152, "Sigma 12-24mm f/4.5-5.6 EX DG ASPHERICAL HSM"}, + {152, "Sigma 14mm f/2.8 EX Aspherical HSM"}, + {152, "Sigma 10-20mm f/4-5.6"}, + {152, "Sigma 100-300mm f/4"}, + {153, "Canon EF 35-350mm f/3.5-5.6L or Sigma or Tamron Lens"}, + {153, "Sigma 50-500mm f/4-6.3 APO HSM EX"}, + {153, "Tamron AF 28-300mm f/3.5-6.3 XR LD Aspherical [IF] Macro"}, + {153, "Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical [IF] Macro Model A14"}, + {153, "Tamron 18-250mm f/3.5-6.3 Di II LD Aspherical [IF] Macro"}, + {154, "Canon EF 20mm f/2.8 USM or Zeiss Lens"}, + {154, "Zeiss Milvus 21mm f/2.8"}, + {155, "Canon EF 85mm f/1.8 USM"}, + {156, "Canon EF 28-105mm f/3.5-4.5 USM or Tamron Lens"}, + {156, "Tamron SP 70-300mm f/4.0-5.6 Di VC USD"}, + {156, "Tamron SP AF 28-105mm f/2.8 LD Aspherical IF"}, + {160, "Canon EF 20-35mm f/3.5-4.5 USM or Tamron or Tokina Lens"}, + {160, "Tamron AF 19-35mm f/3.5-4.5"}, + {160, "Tokina AT-X 124 AF Pro DX 12-24mm f/4"}, + {160, "Tokina AT-X 107 AF DX 10-17mm f/3.5-4.5 Fisheye"}, + {160, "Tokina AT-X 116 AF Pro DX 11-16mm f/2.8"}, + {160, "Tokina AT-X 11-20 F2.8 PRO DX Aspherical 11-20mm f/2.8"}, + {161, "Canon EF 28-70mm f/2.8L or Sigma or Tamron Lens"}, + {161, "Sigma 24-70mm f/2.8 EX"}, + {161, "Sigma 28-70mm f/2.8 EX"}, + {161, "Sigma 24-60mm f/2.8 EX DG"}, + {161, "Tamron AF 17-50mm f/2.8 Di-II LD Aspherical"}, + {161, "Tamron 90mm f/2.8"}, + {161, "Tamron SP AF 17-35mm f/2.8-4 Di LD Aspherical IF"}, + {161, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical [IF] Macro"}, + {162, "Canon EF 200mm f/2.8L"}, + {163, "Canon EF 300mm f/4L"}, + {164, "Canon EF 400mm f/5.6L"}, + {165, "Canon EF 70-200mm f/2.8 L"}, + {166, "Canon EF 70-200mm f/2.8 L + 1.4x"}, + {167, "Canon EF 70-200mm f/2.8 L + 2x"}, + {168, "Canon EF 28mm f/1.8 USM or Sigma Lens"}, + {168, "Sigma 50-100mm f/1.8 DC HSM | A"}, + {169, "Canon EF 17-35mm f/2.8L or Sigma Lens"}, + {169, "Sigma 18-200mm f/3.5-6.3 DC OS"}, + {169, "Sigma 15-30mm f/3.5-4.5 EX DG Aspherical"}, + {169, "Sigma 18-50mm f/2.8 Macro"}, + {169, "Sigma 50mm f/1.4 EX DG HSM"}, + {169, "Sigma 85mm f/1.4 EX DG HSM"}, + {169, "Sigma 30mm f/1.4 EX DC HSM"}, + {169, "Sigma 35mm f/1.4 DG HSM"}, + {170, "Canon EF 200mm f/2.8L II"}, + {171, "Canon EF 300mm f/4L"}, + {172, "Canon EF 400mm f/5.6L or Sigma Lens"}, + {172, "Sigma 150-600mm f/5-6.3 DG OS HSM | S"}, + {173, "Canon EF 180mm Macro f/3.5L or Sigma Lens"}, + {173, "Sigma 180mm EX HSM Macro f/3.5"}, + {173, "Sigma APO Macro 150mm f/2.8 EX DG HSM"}, + {174, "Canon EF 135mm f/2L or Other Lens"}, + {174, "Sigma 70-200mm f/2.8 EX DG APO OS HSM"}, + {174, "Sigma 50-500mm f/4.5-6.3 APO DG OS HSM"}, + {174, "Sigma 150-500mm f/5-6.3 APO DG OS HSM"}, + {174, "Zeiss Milvus 100mm f/2 Makro"}, + {175, "Canon EF 400mm f/2.8L"}, + {176, "Canon EF 24-85mm f/3.5-4.5 USM"}, + {177, "Canon EF 300mm f/4L IS"}, + {178, "Canon EF 28-135mm f/3.5-5.6 IS"}, + {179, "Canon EF 24mm f/1.4L"}, + {180, "Canon EF 35mm f/1.4L or Other Lens"}, + {180, "Sigma 50mm f/1.4 DG HSM | A"}, + {180, "Sigma 24mm f/1.4 DG HSM | A"}, + {180, "Zeiss Milvus 50mm f/1.4"}, + {180, "Zeiss Milvus 85mm f/1.4"}, + {180, "Zeiss Otus 28mm f/1.4 ZE"}, + {181, "Canon EF 100-400mm f/4.5-5.6L IS + 1.4x or Sigma Lens"}, + {181, "Sigma 150-600mm f/5-6.3 DG OS HSM | S + 1.4x"}, + {182, "Canon EF 100-400mm f/4.5-5.6L IS + 2x or Sigma Lens"}, + {182, "Sigma 150-600mm f/5-6.3 DG OS HSM | S + 2x"}, + {183, "Canon EF 100-400mm f/4.5-5.6L IS or Sigma Lens"}, + {183, "Sigma 150mm f/2.8 EX DG OS HSM APO Macro"}, + {183, "Sigma 105mm f/2.8 EX DG OS HSM Macro"}, + {183, "Sigma 180mm f/2.8 EX DG OS HSM APO Macro"}, + {183, "Sigma 150-600mm f/5-6.3 DG OS HSM | C"}, + {183, "Sigma 150-600mm f/5-6.3 DG OS HSM | S"}, + {183, "Sigma 100-400mm f/5-6.3 DG OS HSM"}, + {184, "Canon EF 400mm f/2.8L + 2x"}, + {185, "Canon EF 600mm f/4L IS"}, + {186, "Canon EF 70-200mm f/4L"}, + {187, "Canon EF 70-200mm f/4L + 1.4x"}, + {188, "Canon EF 70-200mm f/4L + 2x"}, + {189, "Canon EF 70-200mm f/4L + 2.8x"}, + {190, "Canon EF 100mm f/2.8 Macro USM"}, + {191, "Canon EF 400mm f/4 DO IS"}, + {193, "Canon EF 35-80mm f/4-5.6 USM"}, + {194, "Canon EF 80-200mm f/4.5-5.6 USM"}, + {195, "Canon EF 35-105mm f/4.5-5.6 USM"}, + {196, "Canon EF 75-300mm f/4-5.6 USM"}, + {197, "Canon EF 75-300mm f/4-5.6 IS USM or Sigma Lens"}, + {197, "Sigma 18-300mm f/3.5-6.3 DC Macro OS HS"}, + {198, "Canon EF 50mm f/1.4 USM or Zeiss Lens"}, + {198, "Zeiss Otus 55mm f/1.4 ZE"}, + {198, "Zeiss Otus 85mm f/1.4 ZE"}, + {199, "Canon EF 28-80mm f/3.5-5.6 USM"}, + {200, "Canon EF 75-300mm f/4-5.6 USM"}, + {201, "Canon EF 28-80mm f/3.5-5.6 USM"}, + {202, "Canon EF 28-80mm f/3.5-5.6 USM IV"}, + {208, "Canon EF 22-55mm f/4-5.6 USM"}, + {209, "Canon EF 55-200mm f/4.5-5.6"}, + {210, "Canon EF 28-90mm f/4-5.6 USM"}, + {211, "Canon EF 28-200mm f/3.5-5.6 USM"}, + {212, "Canon EF 28-105mm f/4-5.6 USM"}, + {213, "Canon EF 90-300mm f/4.5-5.6 USM or Tamron Lens"}, + {213, "Tamron SP 150-600mm f/5-6.3 Di VC USD"}, + {213, "Tamron 16-300mm f/3.5-6.3 Di II VC PZD Macro"}, + {213, "Tamron SP 35mm f/1.8 Di VC USD"}, + {213, "Tamron SP 45mm f/1.8 Di VC USD"}, + {214, "Canon EF-S 18-55mm f/3.5-5.6 USM"}, + {215, "Canon EF 55-200mm f/4.5-5.6 II USM"}, + {217, "Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD"}, + {224, "Canon EF 70-200mm f/2.8L IS"}, + {225, "Canon EF 70-200mm f/2.8L IS + 1.4x"}, + {226, "Canon EF 70-200mm f/2.8L IS + 2x"}, + {227, "Canon EF 70-200mm f/2.8L IS + 2.8x"}, + {228, "Canon EF 28-105mm f/3.5-4.5 USM"}, + {229, "Canon EF 16-35mm f/2.8L"}, + {230, "Canon EF 24-70mm f/2.8L"}, + {231, "Canon EF 17-40mm f/4L"}, + {232, "Canon EF 70-300mm f/4.5-5.6 DO IS USM"}, + {233, "Canon EF 28-300mm f/3.5-5.6L IS"}, + {234, "Canon EF-S 17-85mm f/4-5.6 IS USM or Tokina Lens"}, + {234, "Tokina AT-X 12-28 PRO DX 12-28mm f/4"}, + {235, "Canon EF-S 10-22mm f/3.5-4.5 USM"}, + {236, "Canon EF-S 60mm f/2.8 Macro USM"}, + {237, "Canon EF 24-105mm f/4L IS"}, + {238, "Canon EF 70-300mm f/4-5.6 IS USM"}, + {239, "Canon EF 85mm f/1.2L II"}, + {240, "Canon EF-S 17-55mm f/2.8 IS USM"}, + {241, "Canon EF 50mm f/1.2L"}, + {242, "Canon EF 70-200mm f/4L IS"}, + {243, "Canon EF 70-200mm f/4L IS + 1.4x"}, + {244, "Canon EF 70-200mm f/4L IS + 2x"}, + {245, "Canon EF 70-200mm f/4L IS + 2.8x"}, + {246, "Canon EF 16-35mm f/2.8L II"}, + {247, "Canon EF 14mm f/2.8L II USM"}, + {248, "Canon EF 200mm f/2L IS or Sigma Lens"}, + {248, "Sigma 24-35mm f/2 DG HSM | A"}, + {249, "Canon EF 800mm f/5.6L IS"}, + {250, "Canon EF 24mm f/1.4L II or Sigma Lens"}, + {250, "Sigma 20mm f/1.4 DG HSM | A"}, + {251, "Canon EF 70-200mm f/2.8L IS II USM"}, + {252, "Canon EF 70-200mm f/2.8L IS II USM + 1.4x"}, + {253, "Canon EF 70-200mm f/2.8L IS II USM + 2x"}, + {254, "Canon EF 100mm f/2.8L Macro IS USM"}, + {255, "Sigma 24-105mm f/4 DG OS HSM | A or Other Sigma Lens"}, + {255, "Sigma 180mm f/2.8 EX DG OS HSM APO Macro"}, + {488, "Canon EF-S 15-85mm f/3.5-5.6 IS USM"}, + {489, "Canon EF 70-300mm f/4-5.6L IS USM"}, + {490, "Canon EF 8-15mm f/4L Fisheye USM"}, + {491, "Canon EF 300mm f/2.8L IS II USM or Tamron Lens"}, + {491, "Tamron SP 70-200mm f/2.8 Di VC USD G2 (A025)"}, + {491, "Tamron 18-400mm f/3.5-6.3 Di II VC HLD (B028)"}, + {492, "Canon EF 400mm f/2.8L IS II USM"}, + {493, "Canon EF 500mm f/4L IS II USM or EF 24-105mm f4L IS USM"}, + {493, "Canon EF 24-105mm f/4L IS USM"}, + {494, "Canon EF 600mm f/4.0L IS II USM"}, + {495, "Canon EF 24-70mm f/2.8L II USM or Sigma Lens"}, + {495, "Sigma 24-70mm F2.8 DG OS HSM | A"}, + {496, "Canon EF 200-400mm f/4L IS USM"}, + {499, "Canon EF 200-400mm f/4L IS USM + 1.4x"}, + {502, "Canon EF 28mm f/2.8 IS USM"}, + {503, "Canon EF 24mm f/2.8 IS USM"}, + {504, "Canon EF 24-70mm f/4L IS USM"}, + {505, "Canon EF 35mm f/2 IS USM"}, + {506, "Canon EF 400mm f/4 DO IS II USM"}, + {507, "Canon EF 16-35mm f/4L IS USM"}, + {508, "Canon EF 11-24mm f/4L USM or Tamron Lens"}, + {508, "Tamron 10-24mm f/3.5-4.5 Di II VC HLD"}, + {747, "Canon EF 100-400mm f/4.5-5.6L IS II USM or Tamron Lens"}, + {747, "Tamron SP 150-600mm F5-6.3 Di VC USD G2"}, + {748, "Canon EF 100-400mm f/4.5-5.6L IS II USM + 1.4x"}, + {750, "Canon EF 35mm f/1.4L II USM"}, + {751, "Canon EF 16-35mm f/2.8L III USM"}, + {752, "Canon EF 24-105mm f/4L IS II USM"}, + {4142, "Canon EF-S 18-135mm f/3.5-5.6 IS STM"}, + {4143, "Canon EF-M 18-55mm f/3.5-5.6 IS STM or Tamron Lens"}, + {4143, "Tamron 18-200mm f/3.5-6.3 Di III VC"}, + {4144, "Canon EF 40mm f/2.8 STM"}, + {4145, "Canon EF-M 22mm f/2 STM"}, + {4146, "Canon EF-S 18-55mm f/3.5-5.6 IS STM"}, + {4147, "Canon EF-M 11-22mm f/4-5.6 IS STM"}, + {4148, "Canon EF-S 55-250mm f/4-5.6 IS STM"}, + {4149, "Canon EF-M 55-200mm f/4.5-6.3 IS STM"}, + {4150, "Canon EF-S 10-18mm f/4.5-5.6 IS STM"}, + {4152, "Canon EF 24-105mm f/3.5-5.6 IS STM"}, + {4153, "Canon EF-M 15-45mm f/3.5-6.3 IS STM"}, + {4154, "Canon EF-S 24mm f/2.8 STM"}, + {4155, "Canon EF-M 28mm f/3.5 Macro IS STM"}, + {4156, "Canon EF 50mm f/1.8 STM"}, + {4157, "Canon EF-M 18-150mm 1:3.5-6.3 IS STM"}, + {4158, "Canon EF-S 18-55mm f/4-5.6 IS STM"}, + {4160, "Canon EF-S 35mm f/2.8 Macro IS STM"}, + {36910, "Canon EF 70-300mm f/4-5.6 IS II USM"}, + {36912, "Canon EF-S 18-135mm f/3.5-5.6 IS USM"}, + {61491, "Canon CN-E 14mm T3.1 L F"}, + {61492, "Canon CN-E 24mm T1.5 L F"}, + {61494, "Canon CN-E 85mm T1.3 L F"}, + {61495, "Canon CN-E 135mm T2.2 L F"}, + {61496, "Canon CN-E 35mm T1.5 L F"}, + {65535, "n/a"} + }; } virtual std::string toString (Tag* t) diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index 1701b3058..60f8b6619 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -1671,7 +1671,7 @@ void Tag::toString (char* buffer, int ofs) strcpy (buffer, ""); - for (size_t i = 0; i < maxcount; i++) { + for (ssize_t i = 0; i < std::min(maxcount, valuesize - ofs); i++) { if (i > 0) { strcat (buffer, ", "); } diff --git a/rtgui/bayerprocess.cc b/rtgui/bayerprocess.cc index d5a728a97..9df7c106d 100644 --- a/rtgui/bayerprocess.cc +++ b/rtgui/bayerprocess.cc @@ -29,8 +29,8 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); method = Gtk::manage (new MyComboBoxText ()); - for( size_t i = 0; i < procparams::RAWParams::BayerSensor::numMethods; i++) { - method->append(M("TP_RAW_" + Glib::ustring(procparams::RAWParams::BayerSensor::methodstring[i]).uppercase())); + for(const auto method_string : procparams::RAWParams::BayerSensor::getMethodStrings()) { + method->append(M("TP_RAW_" + Glib::ustring(method_string).uppercase())); } method->set_active(0); @@ -112,7 +112,7 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA pixelShiftMotionMethod->append(M("TP_RAW_PIXELSHIFTMM_OFF")); pixelShiftMotionMethod->append(M("TP_RAW_PIXELSHIFTMM_AUTO")); pixelShiftMotionMethod->append(M("TP_RAW_PIXELSHIFTMM_CUSTOM")); - pixelShiftMotionMethod->set_active(RAWParams::BayerSensor::ePSMotionCorrectionMethod::Automatic); + pixelShiftMotionMethod->set_active(toUnderlying(RAWParams::BayerSensor::PSMotionCorrectionMethod::AUTO)); pixelShiftMotionMethod->show(); hb3->pack_start(*pixelShiftMotionMethod); pixelShiftFrame->pack_start(*hb3); @@ -347,11 +347,11 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params pixelShiftMotionCorrection->block (true); #endif - method->set_active(procparams::RAWParams::BayerSensor::numMethods); + method->set_active(std::numeric_limits::max()); imageNumber->set_active(pp->raw.bayersensor.imageNum); - for( size_t i = 0; i < procparams::RAWParams::BayerSensor::numMethods; i++) { - if( pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[i]) { + for (size_t i = 0; i < procparams::RAWParams::BayerSensor::getMethodStrings().size(); ++i) { + if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodStrings()[i]) { method->set_active(i); oldMethod = i; break; @@ -452,7 +452,7 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params #endif if(!pedited->raw.bayersensor.method) { - method->set_active(procparams::RAWParams::BayerSensor::numMethods); // No name + method->set_active(std::numeric_limits::max()); // No name } if(!pedited->raw.bayersensor.imageNum) { imageNumber->set_active_text(M("GENERAL_UNCHANGED")); @@ -468,21 +468,21 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params } if (!batchMode) { - if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::dcb] || - method->get_active_row_number() == procparams::RAWParams::BayerSensor::numMethods) { + if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::DCB) || + method->get_active_row_number() == std::numeric_limits::max()) { dcbOptions->show(); } else { dcbOptions->hide(); } - if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::lmmse] || - method->get_active_row_number() == procparams::RAWParams::BayerSensor::numMethods) { + if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::LMMSE) || + method->get_active_row_number() == std::numeric_limits::max()) { lmmseOptions->show(); } else { lmmseOptions->hide(); } - if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::pixelshift] || - method->get_active_row_number() == procparams::RAWParams::BayerSensor::numMethods) { - if(pp->raw.bayersensor.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::Custom) { + if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::PIXELSHIFT) || + method->get_active_row_number() == std::numeric_limits::max()) { + if(pp->raw.bayersensor.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::PSMotionCorrectionMethod::CUSTOM) { pixelShiftOptions->show(); } else { pixelShiftOptions->hide(); @@ -493,9 +493,9 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params } // Flase color suppression is applied to all demozaicing method, so don't hide anything - /*if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::eahd] || - pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::hphd] || - pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::vng4]) + /*if (pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::EAHD) || + pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::HPHD) || + pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::VNG4)) ccSteps->show(); else ccSteps->hide();*/ @@ -520,7 +520,7 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe pp->raw.bayersensor.dcb_enhance = dcbEnhance->getLastActive (); //pp->raw.bayersensor.all_enhance = allEnhance->getLastActive (); pp->raw.bayersensor.lmmse_iterations = lmmseIterations->getIntValue(); - pp->raw.bayersensor.pixelShiftMotionCorrectionMethod = (RAWParams::BayerSensor::ePSMotionCorrectionMethod)pixelShiftMotionMethod->get_active_row_number(); + pp->raw.bayersensor.pixelShiftMotionCorrectionMethod = (RAWParams::BayerSensor::PSMotionCorrectionMethod)pixelShiftMotionMethod->get_active_row_number(); pp->raw.bayersensor.pixelShiftEperIso = pixelShiftEperIso->getValue(); pp->raw.bayersensor.pixelShiftSigma = pixelShiftSigma->getValue(); pp->raw.bayersensor.pixelShiftShowMotion = pixelShiftShowMotion->getLastActive (); @@ -554,8 +554,8 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe #endif int currentRow = method->get_active_row_number(); - if( currentRow >= 0 && currentRow < procparams::RAWParams::BayerSensor::numMethods) { - pp->raw.bayersensor.method = procparams::RAWParams::BayerSensor::methodstring[currentRow]; + if( currentRow >= 0 && currentRow < std::numeric_limits::max()) { + pp->raw.bayersensor.method = procparams::RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method(currentRow)); } currentRow = imageNumber->get_active_row_number(); @@ -566,7 +566,7 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe if (pedited) { pedited->raw.bayersensor.ccSteps = ccSteps->getEditedState (); - pedited->raw.bayersensor.method = method->get_active_row_number() != procparams::RAWParams::BayerSensor::numMethods; + pedited->raw.bayersensor.method = method->get_active_row_number() != std::numeric_limits::max(); pedited->raw.bayersensor.imageNum = imageNumber->get_active_text() != M("GENERAL_UNCHANGED"); pedited->raw.bayersensor.dcbIterations = dcbIterations->getEditedState (); pedited->raw.bayersensor.dcbEnhance = !dcbEnhance->get_inconsistent(); @@ -610,7 +610,7 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe void BayerProcess::setBatchMode(bool batchMode) { method->append (M("GENERAL_UNCHANGED")); - method->set_active(procparams::RAWParams::BayerSensor::numMethods); // No name + method->set_active(std::numeric_limits::max()); // No name #ifdef PIXELSHIFTDEV pixelShiftMotionCorrection->append (M("GENERAL_UNCHANGED")); pixelShiftMotionCorrection->set_active_text (M("GENERAL_UNCHANGED")); @@ -750,22 +750,23 @@ void BayerProcess::psMotionCorrectionChanged () void BayerProcess::methodChanged () { - int curSelection = method->get_active_row_number(); + const int curSelection = method->get_active_row_number(); + const RAWParams::BayerSensor::Method method = RAWParams::BayerSensor::Method(curSelection); if (!batchMode) { - if ( curSelection == procparams::RAWParams::BayerSensor::dcb) { + if (method == procparams::RAWParams::BayerSensor::Method::DCB) { dcbOptions->show(); } else { dcbOptions->hide(); } - if ( curSelection == procparams::RAWParams::BayerSensor::lmmse) { + if (method == procparams::RAWParams::BayerSensor::Method::LMMSE) { lmmseOptions->show(); } else { lmmseOptions->hide(); } - if ( curSelection == procparams::RAWParams::BayerSensor::pixelshift) { + if (method == procparams::RAWParams::BayerSensor::Method::PIXELSHIFT) { if(pixelShiftMotionMethod->get_active_row_number() == 2) { pixelShiftOptions->show(); } else { @@ -780,10 +781,10 @@ void BayerProcess::methodChanged () Glib::ustring methodName = ""; bool ppreq = false; - if( curSelection >= 0 && curSelection < procparams::RAWParams::BayerSensor::numMethods) { - methodName = procparams::RAWParams::BayerSensor::methodstring[curSelection]; + if (curSelection >= 0 && curSelection < std::numeric_limits::max()) { + methodName = procparams::RAWParams::BayerSensor::getMethodString(method); - if (curSelection == procparams::RAWParams::BayerSensor::mono || oldMethod == procparams::RAWParams::BayerSensor::mono) { + if (method == procparams::RAWParams::BayerSensor::Method::MONO || RAWParams::BayerSensor::Method(oldMethod) == procparams::RAWParams::BayerSensor::Method::MONO) { ppreq = true; } } diff --git a/rtgui/blackwhite.cc b/rtgui/blackwhite.cc index efa960a81..2b410846f 100644 --- a/rtgui/blackwhite.cc +++ b/rtgui/blackwhite.cc @@ -500,7 +500,7 @@ void BlackWhite::read (const ProcParams* pp, const ParamsEdited* pedited) mixerPurple->setValue (pp->blackwhite.mixerPurple); luminanceCurve->setCurve (pp->blackwhite.luminanceCurve); beforeCurve->setCurve (pp->blackwhite.beforeCurve); - beforeCurveMode->set_active(pp->blackwhite.beforeCurveMode); + beforeCurveMode->set_active(toUnderlying(pp->blackwhite.beforeCurveMode)); afterCurve->setCurve (pp->blackwhite.afterCurve); // afterCurveMode->set_active(pp->blackwhite.afterCurveMode); @@ -583,18 +583,18 @@ void BlackWhite::write (ProcParams* pp, ParamsEdited* pedited) int tcMode = beforeCurveMode->get_active_row_number(); if (tcMode == 0) { - pp->blackwhite.beforeCurveMode = BlackWhiteParams::TC_MODE_STD_BW; + pp->blackwhite.beforeCurveMode = BlackWhiteParams::TcMode::STD_BW; } else if (tcMode == 1) { - pp->blackwhite.beforeCurveMode = BlackWhiteParams::TC_MODE_WEIGHTEDSTD_BW; + pp->blackwhite.beforeCurveMode = BlackWhiteParams::TcMode::WEIGHTEDSTD_BW; } else if (tcMode == 2) { - pp->blackwhite.beforeCurveMode = BlackWhiteParams::TC_MODE_FILMLIKE_BW; + pp->blackwhite.beforeCurveMode = BlackWhiteParams::TcMode::FILMLIKE_BW; } else if (tcMode == 3) { - pp->blackwhite.beforeCurveMode = BlackWhiteParams::TC_MODE_SATANDVALBLENDING_BW; + pp->blackwhite.beforeCurveMode = BlackWhiteParams::TcMode::SATANDVALBLENDING_BW; } // tcMode = afterCurveMode->get_active_row_number(); -// if (tcMode == 0) pp->blackwhite.afterCurveMode = BlackWhiteParams::TC_MODE_STD_BW; - // else if (tcMode == 1) pp->blackwhite.afterCurveMode = BlackWhiteParams::TC_MODE_WEIGHTEDSTD; +// if (tcMode == 0) pp->blackwhite.afterCurveMode = BlackWhiteParams::TCMode::STD_BW; + // else if (tcMode == 1) pp->blackwhite.afterCurveMode = BlackWhiteParams::TCMode::WEIGHTEDSTD; if (pedited) { pedited->blackwhite.enabled = !get_inconsistent(); diff --git a/rtgui/chmixer.cc b/rtgui/chmixer.cc index 7d71da9a9..c6c098883 100644 --- a/rtgui/chmixer.cc +++ b/rtgui/chmixer.cc @@ -22,7 +22,7 @@ using namespace rtengine; using namespace rtengine::procparams; -ChMixer::ChMixer (): FoldableToolPanel(this, "chmixer", M("TP_CHMIXER_LABEL")) +ChMixer::ChMixer (): FoldableToolPanel(this, "chmixer", M("TP_CHMIXER_LABEL"), false, true) { imgIcon[0] = Gtk::manage (new RTImage ("Chanmixer-RR.png")); @@ -99,12 +99,16 @@ void ChMixer::read (const ProcParams* pp, const ParamsEdited* pedited) disableListener (); - if (pedited) + setEnabled(pp->chmixer.enabled); + + if (pedited) { for (int i = 0; i < 3; i++) { red[i]->setEditedState (pedited->chmixer.red[i] ? Edited : UnEdited); green[i]->setEditedState (pedited->chmixer.green[i] ? Edited : UnEdited); blue[i]->setEditedState (pedited->chmixer.blue[i] ? Edited : UnEdited); } + set_inconsistent(multiImage && !pedited->chmixer.enabled); + } for (int i = 0; i < 3; i++) { red[i]->setValue (pp->chmixer.red[i]); @@ -123,13 +127,16 @@ void ChMixer::write (ProcParams* pp, ParamsEdited* pedited) pp->chmixer.green[i] = (int) green[i]->getValue (); pp->chmixer.blue[i] = (int) blue[i]->getValue (); } + pp->chmixer.enabled = getEnabled(); - if (pedited) + if (pedited) { for (int i = 0; i < 3; i++) { pedited->chmixer.red[i] = red[i]->getEditedState (); pedited->chmixer.green[i] = green[i]->getEditedState (); pedited->chmixer.blue[i] = blue[i]->getEditedState (); } + pedited->chmixer.enabled = !get_inconsistent(); + } } void ChMixer::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) @@ -158,7 +165,7 @@ void ChMixer::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi void ChMixer::adjusterChanged (Adjuster* a, double newval) { - if (listener) { + if (listener && getEnabled()) { Glib::ustring descr = Glib::ustring::compose ("R=%1,%2,%3\nG=%4,%5,%6\nB=%7,%8,%9", (int)red[0]->getValue(), (int)red[1]->getValue(), (int)red[2]->getValue(), (int)green[0]->getValue(), (int)green[1]->getValue(), (int)green[2]->getValue(), @@ -167,6 +174,21 @@ void ChMixer::adjusterChanged (Adjuster* a, double newval) } } + +void ChMixer::enabledChanged() +{ + if (listener) { + if (get_inconsistent()) { + listener->panelChanged(EvChMixer, M("GENERAL_UNCHANGED")); + } else if (getEnabled()) { + listener->panelChanged(EvChMixer, M("GENERAL_ENABLED")); + } else { + listener->panelChanged(EvChMixer, M("GENERAL_DISABLED")); + } + } +} + + void ChMixer::setBatchMode (bool batchMode) { diff --git a/rtgui/chmixer.h b/rtgui/chmixer.h index bd85517de..410ac0d16 100644 --- a/rtgui/chmixer.h +++ b/rtgui/chmixer.h @@ -44,6 +44,7 @@ public: void adjusterChanged (Adjuster* a, double newval); void setAdjusterBehavior (bool rgbadd); void trimValues (rtengine::procparams::ProcParams* pp); + void enabledChanged(); }; #endif diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index 91f58f42e..c9fb1baa3 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -21,7 +21,7 @@ #include "guiutils.h" #include "../rtengine/color.h" -#define MINTEMP0 1500 //1200 +#define MINTEMP0 2000 //1200 #define MAXTEMP0 12000 //12000 #define CENTERTEMP0 5000 #define MINGREEN0 0.8 @@ -799,9 +799,9 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) shape->setCurve (pp->colorappearance.curve); shape2->setCurve (pp->colorappearance.curve2); shape3->setCurve (pp->colorappearance.curve3); - toneCurveMode->set_active (pp->colorappearance.curveMode); - toneCurveMode2->set_active (pp->colorappearance.curveMode2); - toneCurveMode3->set_active (pp->colorappearance.curveMode3); + toneCurveMode->set_active (toUnderlying(pp->colorappearance.curveMode)); + toneCurveMode2->set_active (toUnderlying(pp->colorappearance.curveMode2)); + toneCurveMode3->set_active (toUnderlying(pp->colorappearance.curveMode3)); curveMode3Changed(); // This will set the correct sensitive state of depending Adjusters if (pedited) { @@ -1044,27 +1044,27 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited) int tcMode = toneCurveMode->get_active_row_number(); if (tcMode == 0) { - pp->colorappearance.curveMode = ColorAppearanceParams::TC_MODE_LIGHT; + pp->colorappearance.curveMode = ColorAppearanceParams::TcMode::LIGHT; } else if (tcMode == 1) { - pp->colorappearance.curveMode = ColorAppearanceParams::TC_MODE_BRIGHT; + pp->colorappearance.curveMode = ColorAppearanceParams::TcMode::BRIGHT; } tcMode = toneCurveMode2->get_active_row_number(); if (tcMode == 0) { - pp->colorappearance.curveMode2 = ColorAppearanceParams::TC_MODE_LIGHT; + pp->colorappearance.curveMode2 = ColorAppearanceParams::TcMode::LIGHT; } else if (tcMode == 1) { - pp->colorappearance.curveMode2 = ColorAppearanceParams::TC_MODE_BRIGHT; + pp->colorappearance.curveMode2 = ColorAppearanceParams::TcMode::BRIGHT; } int tcMode3 = toneCurveMode3->get_active_row_number(); if (tcMode3 == 0) { - pp->colorappearance.curveMode3 = ColorAppearanceParams::TC_MODE_CHROMA; + pp->colorappearance.curveMode3 = ColorAppearanceParams::CtcMode::CHROMA; } else if (tcMode3 == 1) { - pp->colorappearance.curveMode3 = ColorAppearanceParams::TC_MODE_SATUR; + pp->colorappearance.curveMode3 = ColorAppearanceParams::CtcMode::SATUR; } else if (tcMode3 == 2) { - pp->colorappearance.curveMode3 = ColorAppearanceParams::TC_MODE_COLORF; + pp->colorappearance.curveMode3 = ColorAppearanceParams::CtcMode::COLORF; } if (pedited) { diff --git a/rtgui/colortoning.cc b/rtgui/colortoning.cc index 786030a73..b53f7e5db 100644 --- a/rtgui/colortoning.cc +++ b/rtgui/colortoning.cc @@ -54,14 +54,14 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR colorShape->setLeftBarBgGradient(milestones); + const ColorToningParams default_params; + // luminance gradient milestones.clear(); milestones.push_back( GradientMilestone(0., 0., 0., 0.) ); milestones.push_back( GradientMilestone(1., 1., 1., 1.) ); colorShape->setBottomBarBgGradient(milestones); - std::vector defaultCurve; - rtengine::ColorToningParams::getDefaultColorCurve(defaultCurve); - colorShape->setResetCurve(FCT_MinMaxCPoints, defaultCurve); + colorShape->setResetCurve(FCT_MinMaxCPoints, default_params.colorCurve); // This will add the reset button at the end of the curveType buttons colorCurveEditorG->curveListComplete(); @@ -88,10 +88,9 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR opacityCurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_OPACITY")); opacityCurveEditorG->setCurveListener (this); - rtengine::ColorToningParams::getDefaultOpacityCurve(defaultCurve); opacityShape = static_cast(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); opacityShape->setIdentityValue(0.); - opacityShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); + opacityShape->setResetCurve(FlatCurveType(default_params.opacityCurve.at(0)), default_params.opacityCurve); opacityShape->setBottomBarBgGradient(milestones); // This will add the reset button at the end of the curveType buttons @@ -107,9 +106,8 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR clCurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_CHROMAC")); clCurveEditorG->setCurveListener (this); - rtengine::ColorToningParams::getDefaultCLCurve(defaultCurve); clshape = static_cast(clCurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_AB"), irg, false)); - clshape->setResetCurve(DiagonalCurveType(defaultCurve.at(0)), defaultCurve); + clshape->setResetCurve(DiagonalCurveType(default_params.clcurve.at(0)), default_params.clcurve); clshape->setTooltip(M("TP_COLORTONING_CURVEEDITOR_CL_TOOLTIP")); clshape->setLeftBarColorProvider(this, 1); @@ -127,9 +125,8 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR cl2CurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_CHROMAC")); cl2CurveEditorG->setCurveListener (this); - rtengine::ColorToningParams::getDefaultCL2Curve(defaultCurve); cl2shape = static_cast(cl2CurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_BY"), iby, false)); - cl2shape->setResetCurve(DiagonalCurveType(defaultCurve.at(0)), defaultCurve); + cl2shape->setResetCurve(DiagonalCurveType(default_params.cl2curve.at(0)), default_params.cl2curve); cl2shape->setTooltip(M("TP_COLORTONING_CURVEEDITOR_CL_TOOLTIP")); cl2shape->setLeftBarColorProvider(this, 1); @@ -957,36 +954,34 @@ void ColorToning::colorForValue (double valX, double valY, enum ColorCaller::Ele if (callerId == 1) { // ch - main curve Color::hsv2rgb01(float(valY), 1.0f, 0.5f, R, G, B); } else if (callerId == 2) { // Slider 1 background - if (valY > 0.5) + if (valY <= 0.5) // the hue range { Color::hsv2rgb01(float(valX), 1.0f, 0.5f, R, G, B); } else { // the strength applied to the current hue double strength, hue; - float r_, g_, b_; hlColSat->getValue(strength, hue); - Color::hsv2rgb01(valY * 2.f, 1.f, 1.f, r_, g_, b_); Color::hsv2rgb01(hue / 360.f, 1.f, 1.f, R, G, B); - R = r_ + (R - r_) * valX; - G = g_ + (G - g_) * valX; - B = b_ + (B - b_) * valX; + const double gray = 0.46; + R = (gray * (1.0 - valX)) + R * valX; + G = (gray * (1.0 - valX)) + G * valX; + B = (gray * (1.0 - valX)) + B * valX; } } else if (callerId == 3) { // Slider 2 background - if (valY > 0.5) + if (valY <= 0.5) // the hue range { Color::hsv2rgb01(float(valX), 1.0f, 0.5f, R, G, B); } else { // the strength applied to the current hue double strength, hue; - float r_, g_, b_; shadowsColSat->getValue(strength, hue); - Color::hsv2rgb01(valY * 2.f, 1.f, 1.f, r_, g_, b_); Color::hsv2rgb01(hue / 360.f, 1.f, 1.f, R, G, B); - R = r_ + (R - r_) * valX; - G = g_ + (G - g_) * valX; - B = b_ + (B - b_) * valX; + const double gray = 0.46; + R = (gray * (1.0 - valX)) + R * valX; + G = (gray * (1.0 - valX)) + G * valX; + B = (gray * (1.0 - valX)) + B * valX; } } diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index 4e5e885ea..f4510682e 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -1047,7 +1047,7 @@ void CropWindow::pointerMoved (int bstate, int x, int y) if(ipc) { procparams::ProcParams params; ipc->getParams(¶ms); - if(params.raw.bayersensor.method == RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::none] || params.raw.xtranssensor.method == RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::none]) { + if(params.raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::NONE) || params.raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::NONE)) { ImageSource *isrc = static_cast(ipc->getInitialImage()); isrc->getRawValues(mx, my, params.coarse.rotate, rval, gval, bval); } diff --git a/rtgui/darkframe.cc b/rtgui/darkframe.cc index ab9156d7d..9f1f61d18 100644 --- a/rtgui/darkframe.cc +++ b/rtgui/darkframe.cc @@ -77,7 +77,7 @@ void DarkFrame::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi dfAuto->set_active( pp->raw.df_autoselect ); if(pedited ) { - dfAuto->set_inconsistent(!pedited->raw.dfAuto ); + dfAuto->set_inconsistent(!pedited->raw.df_autoselect ); } if (Glib::file_test (pp->raw.dark_frame, Glib::FILE_TEST_EXISTS)) { @@ -152,7 +152,7 @@ void DarkFrame::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedit if (pedited) { pedited->raw.darkFrame = dfChanged; - pedited->raw.dfAuto = !dfAuto->get_inconsistent(); + pedited->raw.df_autoselect = !dfAuto->get_inconsistent(); } } diff --git a/rtgui/dirpyrdenoise.cc b/rtgui/dirpyrdenoise.cc index 168a9df03..2a90f183e 100644 --- a/rtgui/dirpyrdenoise.cc +++ b/rtgui/dirpyrdenoise.cc @@ -61,7 +61,7 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP NoiscurveEditorG = new CurveEditorGroup (options.lastDenoiseCurvesDir, M("TP_DIRPYRDENOISE_LCURVE")); //curveEditorG = new CurveEditorGroup (options.lastLabCurvesDir); NoiscurveEditorG->setCurveListener (this); - rtengine::DirPyrDenoiseParams::getDefaultNoisCurve(defaultCurve); + defaultCurve = rtengine::DirPyrDenoiseParams().lcurve; lshape = static_cast(NoiscurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); lshape->setIdentityValue(0.); lshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); @@ -145,7 +145,7 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP CCcurveEditorG = new CurveEditorGroup (options.lastDenoiseCurvesDir, M("TP_DIRPYRDENOISE_CCCURVE")); CCcurveEditorG->setCurveListener (this); - rtengine::DirPyrDenoiseParams::getDefaultCCCurve(defaultCurve); + defaultCurve = rtengine::DirPyrDenoiseParams().cccurve; ccshape = static_cast(CCcurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); ccshape->setIdentityValue(0.); ccshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 7099007b6..348d2fa2c 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -464,6 +464,12 @@ public: updateParameters (); } + void updateHistogram() + { + updateParameters(); + } + + void defaultMonitorProfileChanged (const Glib::ustring &profile_name, bool auto_monitor_profile) { ConnectionBlocker profileBlocker (profileConn); @@ -585,6 +591,16 @@ EditorPanel::EditorPanel (FilePanel* filePanel) Gtk::VSeparator* vsep1 = Gtk::manage (new Gtk::VSeparator ()); Gtk::VSeparator* vsep2 = Gtk::manage (new Gtk::VSeparator ()); + // Histogram profile toggle controls + toggleHistogramProfile = Gtk::manage (new Gtk::ToggleButton ()); + Gtk::Image* histProfImg = Gtk::manage (new RTImage ("gamut-hist.png")); + toggleHistogramProfile->add (*histProfImg); + toggleHistogramProfile->set_relief (Gtk::RELIEF_NONE); + toggleHistogramProfile->set_active (options.rtSettings.HistogramWorking); + toggleHistogramProfile->set_tooltip_markup ( (M ("PREFERENCES_HISTOGRAM_TOOLTIP"))); + + Gtk::VSeparator* vsep3 = Gtk::manage (new Gtk::VSeparator ()); + iareapanel = new ImageAreaPanel (); tpc->setEditProvider (iareapanel->imageArea); tpc->getToolBar()->setLockablePickerToolListener (iareapanel->imageArea); @@ -607,6 +623,10 @@ EditorPanel::EditorPanel (FilePanel* filePanel) toolBarPanel->pack_end (*tpc->coarse, Gtk::PACK_SHRINK, 2); toolBarPanel->pack_end (*vsepcl, Gtk::PACK_SHRINK, 2); + // Histogram profile toggle + toolBarPanel->pack_end (*toggleHistogramProfile, Gtk::PACK_SHRINK, 1); + toolBarPanel->pack_end (*vsep3, Gtk::PACK_SHRINK, 2); + toolBarPanel->pack_end (*iareapanel->imageArea->indClippedPanel, Gtk::PACK_SHRINK, 0); toolBarPanel->pack_end (*vsepz, Gtk::PACK_SHRINK, 2); toolBarPanel->pack_end (*iareapanel->imageArea->previewModePanel, Gtk::PACK_SHRINK, 0); @@ -819,6 +839,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) saveimgas->signal_pressed().connect ( sigc::mem_fun (*this, &EditorPanel::saveAsPressed) ); queueimg->signal_pressed().connect ( sigc::mem_fun (*this, &EditorPanel::queueImgPressed) ); sendtogimp->signal_pressed().connect ( sigc::mem_fun (*this, &EditorPanel::sendToGimpPressed) ); + toggleHistogramProfile->signal_toggled().connect( sigc::mem_fun (*this, &EditorPanel::histogramProfile_toggled) ); if (navPrev) { navPrev->signal_pressed().connect ( sigc::mem_fun (*this, &EditorPanel::openPreviousEditorImage) ); @@ -2015,6 +2036,12 @@ void EditorPanel::syncFileBrowser() // synchronize filebrowser with image in E } } +void EditorPanel::histogramProfile_toggled() +{ + options.rtSettings.HistogramWorking = toggleHistogramProfile->get_active(); + colorMgmtToolBar->updateHistogram(); +} + bool EditorPanel::idle_sendToGimp ( ProgressConnector *pc, Glib::ustring fname) { @@ -2186,6 +2213,11 @@ void EditorPanel::beforeAfterToggled () beforeIpc = rtengine::StagedImageProcessor::create (beforeImg); beforeIpc->setPreviewScale (10); beforeIpc->setPreviewImageListener (beforePreviewHandler); + Glib::ustring monitorProfile; + rtengine::RenderingIntent intent; + ipc->getMonitorProfile(monitorProfile, intent); + beforeIpc->setMonitorProfile(monitorProfile, intent); + beforeIarea->imageArea->setPreviewHandler (beforePreviewHandler); beforeIarea->imageArea->setImProcCoordinator (beforeIpc); diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 50fc337ed..7876d18e1 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -150,6 +150,8 @@ private: bool idle_saveImage (ProgressConnector *pc, Glib::ustring fname, SaveFormat sf, rtengine::procparams::ProcParams &pparams); bool idle_sendToGimp ( ProgressConnector *pc, Glib::ustring fname); bool idle_sentToGimp (ProgressConnector *pc, rtengine::IImagefloat* img, Glib::ustring filename); + void histogramProfile_toggled (); + Glib::ustring lastSaveAsFileName; bool realized; @@ -196,6 +198,7 @@ private: Gtk::HBox* beforeAfterBox; Gtk::HBox* beforeHeaderBox; Gtk::HBox* afterHeaderBox; + Gtk::ToggleButton* toggleHistogramProfile; Gtk::Frame* ppframe; ProfilePanel* profilep; diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc index da2659a4f..168106804 100644 --- a/rtgui/exifpanel.cc +++ b/rtgui/exifpanel.cc @@ -46,11 +46,7 @@ ExifPanel::ExifPanel () : idata (nullptr) exifTreeModel = Gtk::TreeStore::create (exifColumns); exifTree->set_model (exifTreeModel); exifTree->set_grid_lines (Gtk::TREE_VIEW_GRID_LINES_NONE); - exifTree->set_row_separator_func ( - [&] (const Glib::RefPtr& model, const Gtk::TreeModel::iterator & row) { - return row->get_value (exifColumns.isSeparator); - } - ); + exifTree->set_row_separator_func (sigc::mem_fun(*this, &ExifPanel::rowSeperatorFunc)); delicon = RTImage::createFromFile ("gtk-close.png"); keepicon = RTImage::createFromFile ("gtk-apply.png"); @@ -540,6 +536,11 @@ void ExifPanel::showAlltoggled () setImageData (idata); } +bool ExifPanel::rowSeperatorFunc(const Glib::RefPtr& model, const Gtk::TreeModel::iterator& iter) +{ + return iter->get_value(exifColumns.isSeparator); +} + void ExifPanel::editTag (Gtk::TreeModel::Children root, Glib::ustring name, Glib::ustring value) { diff --git a/rtgui/exifpanel.h b/rtgui/exifpanel.h index b9d76f25d..5121eff4f 100644 --- a/rtgui/exifpanel.h +++ b/rtgui/exifpanel.h @@ -93,6 +93,7 @@ private: void resetAllPressed(); void addPressed(); void showAlltoggled(); + bool rowSeperatorFunc(const Glib::RefPtr& model, const Gtk::TreeModel::iterator& iter); public: ExifPanel (); diff --git a/rtgui/exportpanel.cc b/rtgui/exportpanel.cc index 7fdc3ae50..144a107d5 100644 --- a/rtgui/exportpanel.cc +++ b/rtgui/exportpanel.cc @@ -68,8 +68,8 @@ ExportPanel::ExportPanel () : listener (nullptr) hb_raw_bayer_method->pack_start (*Gtk::manage (new Gtk::Label ( M ("EXPORT_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); raw_bayer_method = Gtk::manage (new MyComboBoxText ()); - for ( size_t i = 0; i < procparams::RAWParams::BayerSensor::numMethods; i++) { - raw_bayer_method->append (procparams::RAWParams::BayerSensor::methodstring[i]); + for (const auto method_string : RAWParams::BayerSensor::getMethodStrings()) { + raw_bayer_method->append(method_string); } raw_bayer_method->set_active (0); @@ -91,8 +91,8 @@ ExportPanel::ExportPanel () : listener (nullptr) hb_raw_xtrans_method->pack_start (*Gtk::manage (new Gtk::Label ( M ("EXPORT_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); raw_xtrans_method = Gtk::manage (new MyComboBoxText ()); - for ( size_t i = 0; i < procparams::RAWParams::XTransSensor::numMethods; i++) { - raw_xtrans_method->append (procparams::RAWParams::XTransSensor::methodstring[i]); + for (const auto method_string : RAWParams::XTransSensor::getMethodStrings()) { + raw_xtrans_method->append(method_string); } raw_xtrans_method->set_active (0); @@ -275,15 +275,15 @@ void ExportPanel::SaveSettingsAsDefault() //saving Bayer demosaic_method int currentRow = raw_bayer_method->get_active_row_number(); - if ( currentRow >= 0 && currentRow < procparams::RAWParams::BayerSensor::numMethods) { - FE_OPT_STORE_ (options.fastexport_raw_bayer_method, procparams::RAWParams::BayerSensor::methodstring[currentRow]); + if (currentRow >= 0 && currentRow < std::numeric_limits::max()) { + FE_OPT_STORE_ (options.fastexport_raw_bayer_method, procparams::RAWParams::BayerSensor::getMethodStrings()[currentRow]); } //saving X-Trans demosaic_method currentRow = raw_xtrans_method->get_active_row_number(); - if ( currentRow >= 0 && currentRow < procparams::RAWParams::XTransSensor::numMethods) { - FE_OPT_STORE_ (options.fastexport_raw_xtrans_method, procparams::RAWParams::XTransSensor::methodstring[currentRow]); + if (currentRow >= 0 && currentRow < std::numeric_limits::max()) { + FE_OPT_STORE_ (options.fastexport_raw_xtrans_method, procparams::RAWParams::XTransSensor::getMethodStrings()[currentRow]); } // options.fastexport_icm_input = icm_input ; @@ -337,20 +337,20 @@ void ExportPanel::LoadDefaultSettings() bypass_raw_ff->set_active (options.fastexport_bypass_raw_ff ); // Bayer demosaic method - raw_bayer_method->set_active (procparams::RAWParams::BayerSensor::numMethods); + raw_bayer_method->set_active(std::numeric_limits::max()); - for ( size_t i = 0; i < procparams::RAWParams::BayerSensor::numMethods; i++) - if ( options.fastexport_raw_bayer_method == procparams::RAWParams::BayerSensor::methodstring[i]) { - raw_bayer_method->set_active (i); + for (size_t i = 0; i < RAWParams::BayerSensor::getMethodStrings().size(); ++i) + if (options.fastexport_raw_bayer_method == procparams::RAWParams::BayerSensor::getMethodStrings()[i]) { + raw_bayer_method->set_active(i); break; } // X-Trans demosaic method - raw_xtrans_method->set_active (procparams::RAWParams::XTransSensor::numMethods); + raw_xtrans_method->set_active(std::numeric_limits::max()); - for ( size_t i = 0; i < procparams::RAWParams::XTransSensor::numMethods; i++) - if ( options.fastexport_raw_xtrans_method == procparams::RAWParams::XTransSensor::methodstring[i]) { - raw_xtrans_method->set_active (i); + for (size_t i = 0; i < procparams::RAWParams::XTransSensor::getMethodStrings().size(); ++i) + if (options.fastexport_raw_xtrans_method == procparams::RAWParams::XTransSensor::getMethodStrings()[i]) { + raw_xtrans_method->set_active(i); break; } diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index cda737285..b308911a7 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -1021,7 +1021,7 @@ void FileBrowser::pasteProfile () for (unsigned int i = 0; i < mselected.size(); i++) { // copying read only clipboard PartialProfile to a temporary one - rtengine::procparams::PartialProfile cbPartProf = clipboard.getPartialProfile(); + const rtengine::procparams::PartialProfile& cbPartProf = clipboard.getPartialProfile(); rtengine::procparams::PartialProfile pastedPartProf(cbPartProf.pparams, cbPartProf.pedited, true); // applying the PartialProfile to the thumb's ProcParams @@ -1069,7 +1069,7 @@ void FileBrowser::partPasteProfile () for (unsigned int i = 0; i < mselected.size(); i++) { // copying read only clipboard PartialProfile to a temporary one, initialized to the thumb's ProcParams mselected[i]->thumbnail->createProcParamsForUpdate(false, false); // this can execute customprofilebuilder to generate param file - rtengine::procparams::PartialProfile cbPartProf = clipboard.getPartialProfile(); + const rtengine::procparams::PartialProfile& cbPartProf = clipboard.getPartialProfile(); rtengine::procparams::PartialProfile pastedPartProf(&mselected[i]->thumbnail->getProcParams (), nullptr); // pushing the selected values of the clipboard PartialProfile to the temporary PartialProfile diff --git a/rtgui/flatfield.cc b/rtgui/flatfield.cc index 5b52ce9d2..2b57aa470 100644 --- a/rtgui/flatfield.cc +++ b/rtgui/flatfield.cc @@ -111,13 +111,14 @@ void FlatField::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi flatFieldBlurTypeconn.block (true); //flatFieldBlurType - for( size_t i = 0; i < procparams::RAWParams::numFlatFileBlurTypes; i++) - if( pp->raw.ff_BlurType == procparams::RAWParams::ff_BlurTypestring[i]) { + for (size_t i = 0; i < procparams::RAWParams::getFlatFieldBlurTypeStrings().size(); ++i) { + if (pp->raw.ff_BlurType == procparams::RAWParams::getFlatFieldBlurTypeStrings()[i]) { flatFieldBlurType->set_active(i); break; } + } - if (multiImage || pp->raw.ff_BlurType == procparams::RAWParams::ff_BlurTypestring[procparams::RAWParams::area_ff]) { + if (multiImage || pp->raw.ff_BlurType == procparams::RAWParams::getFlatFieldBlurTypeString(procparams::RAWParams::FlatFieldBlurType::AREA)) { flatFieldClipControl->show(); } else { flatFieldClipControl->hide(); @@ -135,7 +136,7 @@ void FlatField::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi flatFieldClipControl->setAutoInconsistent(multiImage && !pedited->raw.ff_AutoClipControl); if( !pedited->raw.ff_BlurType ) { - flatFieldBlurType->set_active(procparams::RAWParams::numFlatFileBlurTypes); // No name + flatFieldBlurType->set_active(std::numeric_limits::max()); // No name } } @@ -216,8 +217,8 @@ void FlatField::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedit int currentRow = flatFieldBlurType->get_active_row_number(); - if( currentRow >= 0 && currentRow < procparams::RAWParams::numFlatFileBlurTypes) { - pp->raw.ff_BlurType = procparams::RAWParams::ff_BlurTypestring[currentRow]; + if( currentRow >= 0 && currentRow < std::numeric_limits::max()) { + pp->raw.ff_BlurType = procparams::RAWParams::getFlatFieldBlurTypeStrings()[currentRow]; } if (pedited) { @@ -226,7 +227,7 @@ void FlatField::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedit pedited->raw.ff_BlurRadius = flatFieldBlurRadius->getEditedState (); pedited->raw.ff_clipControl = flatFieldClipControl->getEditedState (); pedited->raw.ff_AutoClipControl = !flatFieldClipControl->getAutoInconsistent(); - pedited->raw.ff_BlurType = flatFieldBlurType->get_active_row_number() != procparams::RAWParams::numFlatFileBlurTypes; + pedited->raw.ff_BlurType = flatFieldBlurType->get_active_row_number() != std::numeric_limits::max(); } } @@ -336,15 +337,16 @@ void FlatField::flatFieldFile_Reset() void FlatField::flatFieldBlurTypeChanged () { - int curSelection = flatFieldBlurType->get_active_row_number(); + const int curSelection = flatFieldBlurType->get_active_row_number(); + const RAWParams::FlatFieldBlurType blur_type = RAWParams::FlatFieldBlurType(curSelection); - Glib::ustring s = ""; + Glib::ustring s; - if( curSelection >= 0 && curSelection < procparams::RAWParams::numFlatFileBlurTypes) { + if (curSelection >= 0 && curSelection < std::numeric_limits::max()) { s = flatFieldBlurType->get_active_text(); } - if (multiImage || curSelection == procparams::RAWParams::area_ff) { + if (multiImage || blur_type == procparams::RAWParams::FlatFieldBlurType::AREA) { flatFieldClipControl->show(); } else { flatFieldClipControl->hide(); diff --git a/rtgui/hsvequalizer.cc b/rtgui/hsvequalizer.cc index e74848cf3..1dfb017a7 100644 --- a/rtgui/hsvequalizer.cc +++ b/rtgui/hsvequalizer.cc @@ -25,7 +25,7 @@ using namespace rtengine::procparams; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -HSVEqualizer::HSVEqualizer () : FoldableToolPanel(this, "hsvequalizer", M("TP_HSVEQUALIZER_LABEL")) +HSVEqualizer::HSVEqualizer () : FoldableToolPanel(this, "hsvequalizer", M("TP_HSVEQUALIZER_LABEL"), false, true) { std::vector bottomMilestones; @@ -84,11 +84,13 @@ void HSVEqualizer::read (const ProcParams* pp, const ParamsEdited* pedited) hshape->setUnChanged (!pedited->hsvequalizer.hcurve); sshape->setUnChanged (!pedited->hsvequalizer.scurve); vshape->setUnChanged (!pedited->hsvequalizer.vcurve); + set_inconsistent(multiImage && !pedited->hsvequalizer.enabled); } hshape->setCurve (pp->hsvequalizer.hcurve); sshape->setCurve (pp->hsvequalizer.scurve); vshape->setCurve (pp->hsvequalizer.vcurve); + setEnabled(pp->hsvequalizer.enabled); enableListener (); } @@ -116,7 +118,7 @@ void HSVEqualizer::autoOpenCurve () void HSVEqualizer::write (ProcParams* pp, ParamsEdited* pedited) { - + pp->hsvequalizer.enabled = getEnabled(); pp->hsvequalizer.hcurve = hshape->getCurve (); pp->hsvequalizer.scurve = sshape->getCurve (); pp->hsvequalizer.vcurve = vshape->getCurve (); @@ -126,6 +128,7 @@ void HSVEqualizer::write (ProcParams* pp, ParamsEdited* pedited) pedited->hsvequalizer.hcurve = !hshape->isUnChanged (); pedited->hsvequalizer.scurve = !sshape->isUnChanged (); pedited->hsvequalizer.vcurve = !vshape->isUnChanged (); + pedited->hsvequalizer.enabled = !get_inconsistent(); } } @@ -138,7 +141,7 @@ void HSVEqualizer::write (ProcParams* pp, ParamsEdited* pedited) void HSVEqualizer::curveChanged (CurveEditor* ce) { - if (listener) { + if (listener && getEnabled()) { if (ce == hshape) { listener->panelChanged (EvHSVEqualizerH, M("HISTORY_CUSTOMCURVE")); } @@ -199,3 +202,17 @@ void HSVEqualizer::setBatchMode (bool batchMode) curveEditorG->setBatchMode (batchMode); } + + +void HSVEqualizer::enabledChanged() +{ + if (listener) { + if (get_inconsistent()) { + listener->panelChanged (EvHSVEqEnabled, M("GENERAL_UNCHANGED")); + } else if (getEnabled()) { + listener->panelChanged (EvHSVEqEnabled, M("GENERAL_ENABLED")); + } else { + listener->panelChanged (EvHSVEqEnabled, M("GENERAL_DISABLED")); + } + } +} diff --git a/rtgui/hsvequalizer.h b/rtgui/hsvequalizer.h index d02cc378c..fc3d22984 100644 --- a/rtgui/hsvequalizer.h +++ b/rtgui/hsvequalizer.h @@ -54,6 +54,7 @@ public: virtual void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller); //void adjusterChanged (Adjuster* a, double newval); + void enabledChanged(); }; #endif diff --git a/rtgui/labcurve.cc b/rtgui/labcurve.cc index c39dc99fc..8b2b2a217 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -24,7 +24,7 @@ using namespace rtengine; using namespace rtengine::procparams; -LCurve::LCurve () : FoldableToolPanel(this, "labcurves", M("TP_LABCURVE_LABEL")) +LCurve::LCurve () : FoldableToolPanel(this, "labcurves", M("TP_LABCURVE_LABEL"), false, true) { std::vector milestones; @@ -244,6 +244,8 @@ void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited) hhshape->setUnChanged (!pedited->labCurve.hhcurve); lcshape->setUnChanged (!pedited->labCurve.lccurve); clshape->setUnChanged (!pedited->labCurve.clcurve); + + set_inconsistent(multiImage && !pedited->labCurve.enabled); } brightness->setValue (pp->labCurve.brightness); @@ -277,6 +279,8 @@ void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited) lcshape->setCurve (pp->labCurve.lccurve); clshape->setCurve (pp->labCurve.clcurve); + setEnabled(pp->labCurve.enabled); + queue_draw(); enableListener (); @@ -338,7 +342,8 @@ void LCurve::setEditProvider (EditDataProvider *provider) void LCurve::write (ProcParams* pp, ParamsEdited* pedited) { - + pp->labCurve.enabled = getEnabled(); + pp->labCurve.brightness = brightness->getValue (); pp->labCurve.contrast = (int)contrast->getValue (); pp->labCurve.chromaticity = (int)chromaticity->getValue (); @@ -380,7 +385,7 @@ void LCurve::write (ProcParams* pp, ParamsEdited* pedited) pedited->labCurve.lccurve = !lcshape->isUnChanged (); pedited->labCurve.clcurve = !clshape->isUnChanged (); - + pedited->labCurve.enabled = !get_inconsistent(); } } @@ -424,7 +429,7 @@ void LCurve::avoidcolorshift_toggled () lastACVal = avoidcolorshift->get_active (); } - if (listener) { + if (listener && getEnabled()) { if (avoidcolorshift->get_active ()) { listener->panelChanged (EvLAvoidColorShift, M("GENERAL_ENABLED")); } else { @@ -451,7 +456,7 @@ void LCurve::lcredsk_toggled () lcshape->refresh(); } - if (listener) { + if (listener && getEnabled()) { if (lcredsk->get_active ()) { listener->panelChanged (EvLLCredsk, M("GENERAL_ENABLED")); } else { @@ -471,7 +476,7 @@ void LCurve::lcredsk_toggled () void LCurve::curveChanged (CurveEditor* ce) { - if (listener) { + if (listener && getEnabled()) { if (ce == lshape) { listener->panelChanged (EvLLCurve, M("HISTORY_CUSTOMCURVE")); } @@ -526,15 +531,15 @@ void LCurve::adjusterChanged (Adjuster* a, double newval) } if (a == brightness) { - if (listener) { + if (listener && getEnabled()) { listener->panelChanged (EvLBrightness, costr); } } else if (a == contrast) { - if (listener) { + if (listener && getEnabled()) { listener->panelChanged (EvLContrast, costr); } } else if (a == rstprotection) { - if (listener) { + if (listener && getEnabled()) { listener->panelChanged (EvLRSTProtection, costr); } } else if (a == chromaticity) { @@ -550,7 +555,7 @@ void LCurve::adjusterChanged (Adjuster* a, double newval) lcredsk->set_sensitive( int(newval) > -100 ); } - if (listener) { + if (listener && getEnabled()) { listener->panelChanged (EvLSaturation, costr); } } @@ -668,3 +673,16 @@ void LCurve::trimValues (rtengine::procparams::ProcParams* pp) contrast->trimValue(pp->labCurve.contrast); chromaticity->trimValue(pp->labCurve.chromaticity); } + +void LCurve::enabledChanged() +{ + if (listener) { + if (get_inconsistent()) { + listener->panelChanged (EvLEnabled, M("GENERAL_UNCHANGED")); + } else if (getEnabled()) { + listener->panelChanged (EvLEnabled, M("GENERAL_ENABLED")); + } else { + listener->panelChanged (EvLEnabled, M("GENERAL_DISABLED")); + } + } +} diff --git a/rtgui/labcurve.h b/rtgui/labcurve.h index 403b49f9e..e0b912559 100644 --- a/rtgui/labcurve.h +++ b/rtgui/labcurve.h @@ -82,10 +82,7 @@ public: virtual void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller); -private: - - - + void enabledChanged(); }; #endif diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index f5c9a11ab..052cb1455 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -190,10 +190,6 @@ void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const Pa updateDisabled(false); } - ckbUseDist->set_active (pp->lensProf.useDist); - ckbUseVign->set_active (pp->lensProf.useVign && isRaw); - ckbUseCA->set_active(pp->lensProf.useCA && isRaw && ckbUseCA->get_sensitive()); - const LFDatabase *db = LFDatabase::getInstance(); LFCamera c; @@ -226,6 +222,10 @@ void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const Pa updateLensfunWarning(); + ckbUseDist->set_active (pp->lensProf.useDist); + ckbUseVign->set_active (pp->lensProf.useVign && isRaw); + ckbUseCA->set_active(pp->lensProf.useCA && isRaw && ckbUseCA->get_sensitive()); + enableListener (); conUseDist.block(false); } diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index dc1a65b64..391438cd6 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -82,6 +82,7 @@ void ParamsEdited::set (bool v) retinex.radius = v; retinex.retinex = v; + labCurve.enabled = v; labCurve.lcurve = v; labCurve.acurve = v; labCurve.bcurve = v; @@ -97,6 +98,7 @@ void ParamsEdited::set (bool v) labCurve.avoidcolorshift = v; labCurve.rstprotection = v; labCurve.lcredsk = v; + rgbCurves.enabled = v; rgbCurves.lumamode = v; rgbCurves.rcurve = v; rgbCurves.gcurve = v; @@ -219,6 +221,7 @@ void ParamsEdited::set (bool v) //colorBoost.avoidclip = v; //colorBoost.enable_saturationlimiter = v; //colorBoost.saturationlimit = v; + wb.enabled = v; wb.method = v; wb.green = v; wb.temperature = v; @@ -319,6 +322,7 @@ void ParamsEdited::set (bool v) vignetting.strength = v; vignetting.centerX = v; vignetting.centerY = v; + chmixer.enabled = v; chmixer.red[0] = v; chmixer.red[1] = v; chmixer.red[2] = v; @@ -423,14 +427,14 @@ void ParamsEdited::set (bool v) raw.xtranssensor.exBlackRed = v; raw.xtranssensor.exBlackGreen = v; raw.xtranssensor.exBlackBlue = v; - raw.caCorrection = v; - raw.caBlue = v; - raw.caRed = v; + raw.ca_autocorrect = v; + raw.cablue = v; + raw.cared = v; raw.hotPixelFilter = v; raw.deadPixelFilter = v; - raw.hotDeadPixelThresh = v; + raw.hotdeadpix_thresh = v; raw.darkFrame = v; - raw.dfAuto = v; + raw.df_autoselect = v; raw.ff_file = v; raw.ff_AutoSelect = v; raw.ff_BlurRadius = v; @@ -547,6 +551,7 @@ void ParamsEdited::set (bool v) dirpyrequalizer.skinprotect = v; dirpyrequalizer.hueskin = v; //dirpyrequalizer.algo = v; + hsvequalizer.enabled = v; hsvequalizer.hcurve = v; hsvequalizer.scurve = v; hsvequalizer.vcurve = v; @@ -622,6 +627,7 @@ void ParamsEdited::initFrom (const std::vector retinex.radius = retinex.radius && p.retinex.radius == other.retinex.radius; retinex.enabled = retinex.enabled && p.retinex.enabled == other.retinex.enabled; + labCurve.enabled = labCurve.enabled && p.labCurve.enabled == other.labCurve.enabled; labCurve.lcurve = labCurve.lcurve && p.labCurve.lcurve == other.labCurve.lcurve; labCurve.acurve = labCurve.acurve && p.labCurve.acurve == other.labCurve.acurve; labCurve.bcurve = labCurve.bcurve && p.labCurve.bcurve == other.labCurve.bcurve; @@ -637,6 +643,7 @@ void ParamsEdited::initFrom (const std::vector labCurve.avoidcolorshift = labCurve.avoidcolorshift && p.labCurve.avoidcolorshift == other.labCurve.avoidcolorshift; labCurve.rstprotection = labCurve.rstprotection && p.labCurve.rstprotection == other.labCurve.rstprotection; labCurve.lcredsk = labCurve.lcredsk && p.labCurve.lcredsk == other.labCurve.lcredsk; + rgbCurves.enabled = rgbCurves.enabled && p.rgbCurves.enabled == other.rgbCurves.enabled; rgbCurves.lumamode = rgbCurves.lumamode && p.rgbCurves.lumamode == other.rgbCurves.lumamode; rgbCurves.rcurve = rgbCurves.rcurve && p.rgbCurves.rcurve == other.rgbCurves.rcurve; rgbCurves.gcurve = rgbCurves.gcurve && p.rgbCurves.gcurve == other.rgbCurves.gcurve; @@ -758,6 +765,7 @@ void ParamsEdited::initFrom (const std::vector //colorBoost.avoidclip = colorBoost.avoidclip && p.colorBoost.avoidclip == other.colorBoost.avoidclip; //colorBoost.enable_saturationlimiter = colorBoost.enable_saturationlimiter && p.colorBoost.enable_saturationlimiter == other.colorBoost.enable_saturationlimiter; //colorBoost.saturationlimit = colorBoost.saturationlimit && p.colorBoost.saturationlimit == other.colorBoost.saturationlimit; + wb.enabled = wb.enabled && p.wb.enabled == other.wb.enabled; wb.method = wb.method && p.wb.method == other.wb.method; wb.green = wb.green && p.wb.green == other.wb.green; wb.equal = wb.equal && p.wb.equal == other.wb.equal; @@ -863,6 +871,7 @@ void ParamsEdited::initFrom (const std::vector vignetting.strength = vignetting.strength && p.vignetting.strength == other.vignetting.strength; vignetting.centerX = vignetting.centerX && p.vignetting.centerX == other.vignetting.centerX; vignetting.centerY = vignetting.centerY && p.vignetting.centerY == other.vignetting.centerY; + chmixer.enabled = chmixer.enabled && p.chmixer.enabled == other.chmixer.enabled; chmixer.red[0] = chmixer.red[0] && p.chmixer.red[0] == other.chmixer.red[0]; chmixer.red[1] = chmixer.red[1] && p.chmixer.red[1] == other.chmixer.red[1]; chmixer.red[2] = chmixer.red[2] && p.chmixer.red[2] == other.chmixer.red[2]; @@ -965,14 +974,14 @@ void ParamsEdited::initFrom (const std::vector raw.xtranssensor.exBlackRed = raw.xtranssensor.exBlackRed && p.raw.xtranssensor.blackred == other.raw.xtranssensor.blackred; raw.xtranssensor.exBlackGreen = raw.xtranssensor.exBlackGreen && p.raw.xtranssensor.blackgreen == other.raw.xtranssensor.blackgreen; raw.xtranssensor.exBlackBlue = raw.xtranssensor.exBlackBlue && p.raw.xtranssensor.blackblue == other.raw.xtranssensor.blackblue; - raw.caCorrection = raw.caCorrection && p.raw.ca_autocorrect == other.raw.ca_autocorrect; - raw.caRed = raw.caRed && p.raw.cared == other.raw.cared; - raw.caBlue = raw.caBlue && p.raw.cablue == other.raw.cablue; + raw.ca_autocorrect = raw.ca_autocorrect && p.raw.ca_autocorrect == other.raw.ca_autocorrect; + raw.cared = raw.cared && p.raw.cared == other.raw.cared; + raw.cablue = raw.cablue && p.raw.cablue == other.raw.cablue; raw.hotPixelFilter = raw.hotPixelFilter && p.raw.hotPixelFilter == other.raw.hotPixelFilter; raw.deadPixelFilter = raw.deadPixelFilter && p.raw.deadPixelFilter == other.raw.deadPixelFilter; - raw.hotDeadPixelThresh = raw.hotDeadPixelThresh && p.raw.hotdeadpix_thresh == other.raw.hotdeadpix_thresh; + raw.hotdeadpix_thresh = raw.hotdeadpix_thresh && p.raw.hotdeadpix_thresh == other.raw.hotdeadpix_thresh; raw.darkFrame = raw.darkFrame && p.raw.dark_frame == other.raw.dark_frame; - raw.dfAuto = raw.dfAuto && p.raw.df_autoselect == other.raw.df_autoselect; + raw.df_autoselect = raw.df_autoselect && p.raw.df_autoselect == other.raw.df_autoselect; raw.ff_file = raw.ff_file && p.raw.ff_file == other.raw.ff_file; raw.ff_AutoSelect = raw.ff_AutoSelect && p.raw.ff_AutoSelect == other.raw.ff_AutoSelect; raw.ff_BlurRadius = raw.ff_BlurRadius && p.raw.ff_BlurRadius == other.raw.ff_BlurRadius; @@ -1084,6 +1093,7 @@ void ParamsEdited::initFrom (const std::vector dirpyrequalizer.skinprotect = dirpyrequalizer.skinprotect && p.dirpyrequalizer.skinprotect == other.dirpyrequalizer.skinprotect; // dirpyrequalizer.algo = dirpyrequalizer.algo && p.dirpyrequalizer.algo == other.dirpyrequalizer.algo; dirpyrequalizer.hueskin = dirpyrequalizer.hueskin && p.dirpyrequalizer.hueskin == other.dirpyrequalizer.hueskin; + hsvequalizer.enabled = hsvequalizer.enabled && p.hsvequalizer.enabled == other.hsvequalizer.enabled; hsvequalizer.hcurve = hsvequalizer.hcurve && p.hsvequalizer.hcurve == other.hsvequalizer.hcurve; hsvequalizer.scurve = hsvequalizer.scurve && p.hsvequalizer.scurve == other.hsvequalizer.scurve; hsvequalizer.vcurve = hsvequalizer.vcurve && p.hsvequalizer.vcurve == other.hsvequalizer.vcurve; @@ -1296,6 +1306,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten } + if (labCurve.enabled) { + toEdit.labCurve.enabled = mods.labCurve.enabled; + } + if (labCurve.lcurve) { toEdit.labCurve.lcurve = mods.labCurve.lcurve; } @@ -1356,6 +1370,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten toEdit.labCurve.lcredsk = mods.labCurve.lcredsk; } + if (rgbCurves.enabled) { + toEdit.rgbCurves.enabled = mods.rgbCurves.enabled; + } + if (rgbCurves.lumamode) { toEdit.rgbCurves.lumamode = mods.rgbCurves.lumamode; } @@ -1664,6 +1682,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten //if (colorBoost.avoidclip) toEdit.colorBoost.avoidclip = mods.colorBoost.avoidclip; //if (colorBoost.enable_saturationlimiter)toEdit.colorBoost.enable_saturationlimiter = mods.colorBoost.enable_saturationlimiter; //if (colorBoost.saturationlimit) toEdit.colorBoost.saturationlimit = mods.colorBoost.saturationlimit; + if (wb.enabled) { + toEdit.wb.enabled = mods.wb.enabled; + } + if (wb.method) { toEdit.wb.method = mods.wb.method; } @@ -2189,6 +2211,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten toEdit.vignetting.centerY = dontforceSet && options.baBehav[ADDSET_VIGN_CENTER] ? toEdit.vignetting.centerY + mods.vignetting.centerY : mods.vignetting.centerY; } + if (chmixer.enabled) { + toEdit.chmixer.enabled = mods.chmixer.enabled; + } + for (int i = 0; i < 3; i++) { if (chmixer.red[i]) { toEdit.chmixer.red[i] = dontforceSet && options.baBehav[ADDSET_CHMIXER] ? toEdit.chmixer.red[i] + mods.chmixer.red[i] : mods.chmixer.red[i]; @@ -2571,15 +2597,15 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten toEdit.raw.xtranssensor.blackblue = dontforceSet && options.baBehav[ADDSET_RAWEXPOS_BLACKS] ? toEdit.raw.xtranssensor.blackblue + mods.raw.xtranssensor.blackblue : mods.raw.xtranssensor.blackblue; } - if (raw.caCorrection) { + if (raw.ca_autocorrect) { toEdit.raw.ca_autocorrect = mods.raw.ca_autocorrect; } - if (raw.caRed) { + if (raw.cared) { toEdit.raw.cared = dontforceSet && options.baBehav[ADDSET_RAWCACORR] ? toEdit.raw.cared + mods.raw.cared : mods.raw.cared; } - if (raw.caBlue) { + if (raw.cablue) { toEdit.raw.cablue = dontforceSet && options.baBehav[ADDSET_RAWCACORR] ? toEdit.raw.cablue + mods.raw.cablue : mods.raw.cablue; } @@ -2599,7 +2625,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten toEdit.raw.deadPixelFilter = mods.raw.deadPixelFilter; } - if (raw.hotDeadPixelThresh) { + if (raw.hotdeadpix_thresh) { toEdit.raw.hotdeadpix_thresh = mods.raw.hotdeadpix_thresh; } @@ -2607,7 +2633,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten toEdit.raw.dark_frame = mods.raw.dark_frame; } - if (raw.dfAuto) { + if (raw.df_autoselect) { toEdit.raw.df_autoselect = mods.raw.df_autoselect; } @@ -3008,6 +3034,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten } // if (dirpyrequalizer.algo) toEdit.dirpyrequalizer.algo = mods.dirpyrequalizer.algo; + if (hsvequalizer.enabled) { + toEdit.hsvequalizer.enabled = mods.hsvequalizer.enabled; + } + if (hsvequalizer.hcurve) { toEdit.hsvequalizer.hcurve = mods.hsvequalizer.hcurve; } @@ -3062,8 +3092,8 @@ bool RAWParamsEdited::XTransSensor::isUnchanged() const bool RAWParamsEdited::isUnchanged() const { - return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && caCorrection && caRed && caBlue && hotPixelFilter && deadPixelFilter && hotDeadPixelThresh && darkFrame - && dfAuto && ff_file && ff_AutoSelect && ff_BlurRadius && ff_BlurType && exPos && exPreser && ff_AutoClipControl && ff_clipControl; + return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && ca_autocorrect && cared && cablue && hotPixelFilter && deadPixelFilter && hotdeadpix_thresh && darkFrame + && df_autoselect && ff_file && ff_AutoSelect && ff_BlurRadius && ff_BlurType && exPos && exPreser && ff_AutoClipControl && ff_clipControl; } bool LensProfParamsEdited::isUnchanged() const diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 4d205b1f5..fcb3a0b49 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -100,6 +100,7 @@ public: class LCurveParamsEdited { public: + bool enabled; bool brightness; bool contrast; bool chromaticity; @@ -115,14 +116,13 @@ public: bool hhcurve; bool lccurve; bool clcurve; - bool enabled; - bool method; }; class RGBCurvesParamsEdited { public: + bool enabled; bool lumamode; bool rcurve; bool gcurve; @@ -229,6 +229,7 @@ class WBParamsEdited { public: + bool enabled; bool method; bool temperature; bool green; @@ -487,6 +488,7 @@ class ChannelMixerParamsEdited { public: + bool enabled; bool red[3]; bool green[3]; bool blue[3]; @@ -567,7 +569,6 @@ public: bool gamma; bool gampos; bool slpos; - bool gamfree; bool freegamma; }; class WaveletParamsEdited @@ -678,6 +679,7 @@ class HSVEqualizerParamsEdited { public: + bool enabled; bool hcurve; bool scurve; bool vcurve; @@ -764,14 +766,14 @@ public: BayerSensor bayersensor; XTransSensor xtranssensor; - bool caCorrection; - bool caRed; - bool caBlue; + bool ca_autocorrect; + bool cared; + bool cablue; bool hotPixelFilter; bool deadPixelFilter; - bool hotDeadPixelThresh; + bool hotdeadpix_thresh; bool darkFrame; - bool dfAuto; + bool df_autoselect; bool ff_file; bool ff_AutoSelect; bool ff_BlurRadius; @@ -839,8 +841,5 @@ public: void set (bool v); void initFrom (const std::vector& src); void combine (rtengine::procparams::ProcParams& toEdit, const rtengine::procparams::ProcParams& mods, bool forceSet); - - bool operator== (const ParamsEdited& other); - bool operator!= (const ParamsEdited& other); }; #endif diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index 7d91e0172..4b5c7a857 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -379,14 +379,14 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren void PartialPasteDlg::everythingToggled () { - basicConn.block (true); - detailConn.block (true); - colorConn.block (true); - lensConn.block (true); - compositionConn.block (true); - metaConn.block (true); - rawConn.block (true); - wavConn.block (true); + ConnectionBlocker basicBlocker(basicConn); + ConnectionBlocker detailBlocker(detailConn); + ConnectionBlocker colorBlocker(colorConn); + ConnectionBlocker lensBlocker(lensConn); + ConnectionBlocker compositionBlocker(compositionConn); + ConnectionBlocker metaBlocker(metaConn); + ConnectionBlocker rawBlocker(rawConn); + ConnectionBlocker wavBlocker(wavConn); everything->set_inconsistent (false); @@ -409,44 +409,35 @@ void PartialPasteDlg::everythingToggled () PartialPasteDlg::metaToggled (); PartialPasteDlg::rawToggled (); PartialPasteDlg::wavToggled (); - - basicConn.block (false); - detailConn.block (false); - colorConn.block (false); - lensConn.block (false); - compositionConn.block (false); - metaConn.block (false); - rawConn.block (false); - wavConn.block (false); } void PartialPasteDlg::rawToggled () { - raw_methodConn.block (true); - raw_imagenumConn.block (true); - raw_ccStepsConn.block (true); - raw_dcb_iterationsConn.block (true); - raw_dcb_enhanceConn.block (true); - //raw_all_enhanceConn.block (true); - raw_lmmse_iterationsConn.block (true); - raw_pixelshiftConn.block (true); - raw_exposConn.block (true); - raw_preserConn.block (true); - raw_blackConn.block (true); - raw_ca_autocorrectConn.block (true); - raw_caredblueConn.block (true); - raw_hotpix_filtConn.block (true); - raw_deadpix_filtConn.block (true); - raw_linenoiseConn.block (true); - raw_greenthreshConn.block (true); - df_fileConn.block (true); - df_AutoSelectConn.block (true); - ff_fileConn.block (true); - ff_AutoSelectConn.block (true); - ff_BlurRadiusConn.block (true); - ff_BlurTypeConn.block (true); - ff_ClipControlConn.block (true); + ConnectionBlocker raw_methodBlocker(raw_methodConn); + ConnectionBlocker raw_imagenumBlocker(raw_imagenumConn); + ConnectionBlocker raw_ccStepsBlocker(raw_ccStepsConn); + ConnectionBlocker raw_dcb_iterationsBlocker(raw_dcb_iterationsConn); + ConnectionBlocker raw_dcb_enhanceBlocker(raw_dcb_enhanceConn); + //ConnectionBlocker raw_all_enhanceConnBlocker(raw_all_enhanceConnConn); + ConnectionBlocker raw_lmmse_iterationsBlocker(raw_lmmse_iterationsConn); + ConnectionBlocker raw_pixelshiftBlocker(raw_pixelshiftConn); + ConnectionBlocker raw_exposBlocker(raw_exposConn); + ConnectionBlocker raw_preserBlocker(raw_preserConn); + ConnectionBlocker raw_blackBlocker(raw_blackConn); + ConnectionBlocker raw_ca_autocorrectBlocker(raw_ca_autocorrectConn); + ConnectionBlocker raw_caredblueBlocker(raw_caredblueConn); + ConnectionBlocker raw_hotpix_filtBlocker(raw_hotpix_filtConn); + ConnectionBlocker raw_deadpix_filtBlocker(raw_deadpix_filtConn); + ConnectionBlocker raw_linenoiseBlocker(raw_linenoiseConn); + ConnectionBlocker raw_greenthreshBlocker(raw_greenthreshConn); + ConnectionBlocker df_fileBlocker(df_fileConn); + ConnectionBlocker df_AutoSelectBlocker(df_AutoSelectConn); + ConnectionBlocker ff_fileBlocker(ff_fileConn); + ConnectionBlocker ff_AutoSelectBlocker(ff_AutoSelectConn); + ConnectionBlocker ff_BlurRadiusBlocker(ff_BlurRadiusConn); + ConnectionBlocker ff_BlurTypeBlocker(ff_BlurTypeConn); + ConnectionBlocker ff_ClipControlBlocker(ff_ClipControlConn); raw->set_inconsistent (false); @@ -474,45 +465,21 @@ void PartialPasteDlg::rawToggled () ff_BlurRadius->set_active (raw->get_active ()); ff_BlurType->set_active (raw->get_active ()); ff_ClipControl->set_active (raw->get_active ()); - - raw_methodConn.block (false); - raw_imagenumConn.block (false); - raw_ccStepsConn.block (false); - raw_dcb_iterationsConn.block (false); - raw_dcb_enhanceConn.block (false); - //raw_all_enhanceConn.block (false); - raw_pixelshiftConn.block (false); - raw_lmmse_iterationsConn.block (false); - raw_exposConn.block (false); - raw_preserConn.block (false); - raw_blackConn.block (false); - raw_ca_autocorrectConn.block (false); - raw_caredblueConn.block (false); - raw_hotpix_filtConn.block (false); - raw_deadpix_filtConn.block (false); - raw_linenoiseConn.block (false); - raw_greenthreshConn.block (false); - df_fileConn.block (false); - df_AutoSelectConn.block (false); - ff_fileConn.block (false); - ff_AutoSelectConn.block (false); - ff_BlurRadiusConn.block (false); - ff_BlurTypeConn.block (false); - ff_ClipControlConn.block (false); } void PartialPasteDlg::basicToggled () { - wbConn.block (true); - exposureConn.block (true); - shConn.block (true); - epdConn.block(true); - pcvignetteConn.block (true); - gradientConn.block (true); - labcurveConn.block (true); - colorappearanceConn.block (true); - retinexConn.block (true); + ConnectionBlocker wbBlocker(wbConn); + ConnectionBlocker exposureBlocker(exposureConn); + ConnectionBlocker shBlocker(shConn); + ConnectionBlocker epdBlocker(epdConn); + ConnectionBlocker fattalBlocker(fattalConn); + ConnectionBlocker pcvignetteBlocker(pcvignetteConn); + ConnectionBlocker gradientBlocker(gradientConn); + ConnectionBlocker retinexBlocker(retinexConn); + ConnectionBlocker labcurveBlocker(labcurveConn); + ConnectionBlocker colorappearanceBlocker(colorappearanceConn); basic->set_inconsistent (false); @@ -526,29 +493,18 @@ void PartialPasteDlg::basicToggled () retinex->set_active (basic->get_active ()); labcurve->set_active (basic->get_active ()); colorappearance->set_active (basic->get_active ()); - - wbConn.block (false); - exposureConn.block (false); - shConn.block (false); - epdConn.block (false); - pcvignetteConn.block (false); - gradientConn.block (false); - retinexConn.block (false); - - labcurveConn.block (false); - colorappearanceConn.block (false); } void PartialPasteDlg::detailToggled () { - sharpenConn.block (true); - gradsharpenConn.block(true); - microcontrastConn.block(true); - impdenConn.block (true); - dirpyrdenConn.block (true); - defringeConn.block (true); - dirpyreqConn.block (true); + ConnectionBlocker sharpenBlocker(sharpenConn); + ConnectionBlocker gradsharpenBlocker(gradsharpenConn); + ConnectionBlocker microcontrastBlocker(microcontrastConn); + ConnectionBlocker impdenBlocker(impdenConn); + ConnectionBlocker dirpyrdenBlocker(dirpyrdenConn); + ConnectionBlocker defringeBlocker(defringeConn); + ConnectionBlocker dirpyreqBlocker(dirpyreqConn); detail->set_inconsistent (false); @@ -559,41 +515,32 @@ void PartialPasteDlg::detailToggled () dirpyrden->set_active (detail->get_active ()); defringe->set_active (detail->get_active ()); dirpyreq->set_active (detail->get_active ()); - - sharpenConn.block (false); - gradsharpenConn.block(false); - microcontrastConn.block(false); - impdenConn.block (false); - dirpyrdenConn.block (false); - defringeConn.block (false); - dirpyreqConn.block (false); } void PartialPasteDlg::wavToggled () { - waveletConn.block (true); + ConnectionBlocker waveletBlocker(waveletConn); wav->set_inconsistent (false); wavelet->set_active (wav->get_active ()); - - waveletConn.block (false); } void PartialPasteDlg::colorToggled () { - icmConn.block (true); - //gamcsconn.block (true); - vibranceConn.block (true); - chmixerConn.block (true); - chmixerbwConn.block (true); - hsveqConn.block (true); - filmSimulationConn.block (true); - rgbcurvesConn.block (true); - colortoningConn.block (true); + ConnectionBlocker icmBlocker(icmConn); + ConnectionBlocker vibranceBlocker(vibranceConn); + ConnectionBlocker chmixerBlocker(chmixerConn); + ConnectionBlocker chmixerbwBlocker(chmixerbwConn); + ConnectionBlocker hsveqBlocker(hsveqConn); + ConnectionBlocker filmSimulationBlocker(filmSimulationConn); + //ConnectionBlocker gamcsconnBlocker(gamcsconnConn); + ConnectionBlocker rgbcurvesBlocker(rgbcurvesConn); + ConnectionBlocker colortoningBlocker(colortoningConn); color->set_inconsistent (false); + icm->set_active (color->get_active ()); //gam->set_active (color->get_active ()); vibrance->set_active (color->get_active ()); @@ -603,25 +550,15 @@ void PartialPasteDlg::colorToggled () filmSimulation->set_active (color->get_active ()); rgbcurves->set_active (color->get_active ()); colortoning->set_active(color->get_active ()); - - icmConn.block (false); - //gamcsconn.block (false); - vibranceConn.block (false); - chmixerbwConn.block (false); - chmixerConn.block (false); - hsveqConn.block (false); - filmSimulationConn.block (false); - rgbcurvesConn.block (false); - colortoningConn.block (false); } void PartialPasteDlg::lensToggled () { - distortionConn.block (true); - cacorrConn.block (true); - vignettingConn.block (true); - lcpConn.block (true); + ConnectionBlocker distortionBlocker(distortionConn); + ConnectionBlocker cacorrBlocker(cacorrConn); + ConnectionBlocker vignettingBlocker(vignettingConn); + ConnectionBlocker lcpBlocker(lcpConn); lens->set_inconsistent (false); @@ -629,23 +566,18 @@ void PartialPasteDlg::lensToggled () cacorr->set_active (lens->get_active ()); vignetting->set_active (lens->get_active ()); lcp->set_active (lens->get_active ()); - - distortionConn.block (false); - cacorrConn.block (false); - vignettingConn.block (false); - lcpConn.block (false); } void PartialPasteDlg::compositionToggled () { - coarserotConn.block (true); - finerotConn.block (true); - cropConn.block (true); - resizeConn.block (true); - prsharpeningConn.block (true); - perspectiveConn.block (true); - commonTransConn.block (true); + ConnectionBlocker coarserotBlocker(coarserotConn); + ConnectionBlocker finerotBlocker(finerotConn); + ConnectionBlocker cropBlocker(cropConn); + ConnectionBlocker resizeBlocker(resizeConn); + ConnectionBlocker prsharpeningBlocker(prsharpeningConn); + ConnectionBlocker perspectiveBlocker(perspectiveConn); + ConnectionBlocker commonTransBlocker(commonTransConn); composition->set_inconsistent (false); @@ -656,28 +588,18 @@ void PartialPasteDlg::compositionToggled () prsharpening->set_active (composition->get_active ()); perspective->set_active (composition->get_active ()); commonTrans->set_active (composition->get_active ()); - - coarserotConn.block (false); - finerotConn.block (false); - cropConn.block (false); - resizeConn.block (false); - prsharpeningConn.block (false); - perspectiveConn.block (false); - commonTransConn.block (false); } void PartialPasteDlg::metaToggled () { - exifchConn.block (true); - iptcConn.block (true); + ConnectionBlocker exifchBlocker(exifchConn); + ConnectionBlocker iptcBlocker(iptcConn); + meta->set_inconsistent (false); exifch->set_active (meta->get_active ()); iptc->set_active (meta->get_active ()); - - exifchConn.block (false); - iptcConn.block (false); } @@ -943,12 +865,12 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param } if (!raw_ca_autocorrect->get_active ()) { - filterPE.raw.caCorrection = falsePE.raw.caCorrection; + filterPE.raw.ca_autocorrect = falsePE.raw.ca_autocorrect; } if (!raw_caredblue->get_active ()) { - filterPE.raw.caRed = falsePE.raw.caRed; - filterPE.raw.caBlue = falsePE.raw.caBlue; + filterPE.raw.cared = falsePE.raw.cared; + filterPE.raw.cablue = falsePE.raw.cablue; } if (!raw_hotpix_filt->get_active ()) { @@ -960,7 +882,7 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param } if (!raw_deadpix_filt->get_active () && !raw_hotpix_filt->get_active ()) { - filterPE.raw.hotDeadPixelThresh = falsePE.raw.hotDeadPixelThresh; + filterPE.raw.hotdeadpix_thresh = falsePE.raw.hotdeadpix_thresh; } if (!df_file->get_active ()) { @@ -968,7 +890,7 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param } if (!df_AutoSelect->get_active ()) { - filterPE.raw.dfAuto = falsePE.raw.dfAuto; + filterPE.raw.df_autoselect = falsePE.raw.df_autoselect; } if (!ff_file->get_active ()) { diff --git a/rtgui/ppversion.h b/rtgui/ppversion.h index d2e9be090..c6f2598b0 100644 --- a/rtgui/ppversion.h +++ b/rtgui/ppversion.h @@ -1,14 +1,17 @@ -#ifndef _PPVERSION_ -#define _PPVERSION_ +#pragma once // This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes -#define PPVERSION 327 +#define PPVERSION 329 #define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified /* Log of version changes + 329 2017-12-09 + Added 'Enabled' flag for Channel Mixer, RGB Curves and HSV Equalizer + 328 2017-11-22 + Fix wrong type of ff_clipControl 327 2017-09-15 - [Profiles Lens Correction] Added Lensfun + [Profiled Lens Correction] Added Lensfun 326 2015-07-26 [Exposure] Added 'Perceptual' tone curve mode 325 2015-07-23 @@ -45,5 +48,3 @@ added [Directional Pyramid Denoising] Method, Redchro, Bluechro added [RGB Curves] LumaMode */ - -#endif diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 3f414321b..7e6018ff0 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -990,18 +990,14 @@ Gtk::Widget* Preferences::getGeneralPanel () ckbHistogramPositionLeft = Gtk::manage ( new Gtk::CheckButton (M ("PREFERENCES_HISTOGRAMPOSITIONLEFT")) ); setExpandAlignProperties (ckbHistogramPositionLeft, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); - ckbHistogramWorking = Gtk::manage ( new Gtk::CheckButton (M ("PREFERENCES_HISTOGRAMWORKING")) ); - setExpandAlignProperties (ckbHistogramWorking, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); - ckbHistogramWorking->set_tooltip_markup (M ("PREFERENCES_HISTOGRAM_TOOLTIP")); workflowGrid->attach_next_to (*ckbHistogramPositionLeft, *curveBBoxPosL, Gtk::POS_BOTTOM, 1, 1); - workflowGrid->attach_next_to (*ckbHistogramWorking, *curveBBoxPosC, Gtk::POS_BOTTOM, 2, 1); ckbFileBrowserToolbarSingleRow = Gtk::manage ( new Gtk::CheckButton (M ("PREFERENCES_FILEBROWSERTOOLBARSINGLEROW")) ); setExpandAlignProperties (ckbFileBrowserToolbarSingleRow, false, false, Gtk::ALIGN_START, Gtk::ALIGN_START); ckbShowFilmStripToolBar = Gtk::manage ( new Gtk::CheckButton (M ("PREFERENCES_SHOWFILMSTRIPTOOLBAR")) ); setExpandAlignProperties (ckbShowFilmStripToolBar, false, false, Gtk::ALIGN_START, Gtk::ALIGN_START); workflowGrid->attach_next_to (*ckbFileBrowserToolbarSingleRow, *ckbHistogramPositionLeft, Gtk::POS_BOTTOM, 1, 1); - workflowGrid->attach_next_to (*ckbShowFilmStripToolBar, *ckbHistogramWorking, Gtk::POS_BOTTOM, 2, 1); + workflowGrid->attach_next_to (*ckbShowFilmStripToolBar, *curveBBoxPosC, Gtk::POS_BOTTOM, 2, 1); Gtk::Label* hb4label = Gtk::manage ( new Gtk::Label (M ("PREFERENCES_TP_LABEL")) ); setExpandAlignProperties (hb4label, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); @@ -1757,7 +1753,6 @@ void Preferences::storePreferences () // moptions.rtSettings.viewinggreySc = greySc->get_active_row_number (); // moptions.rtSettings.autocielab = cbAutocielab->get_active (); moptions.rtSettings.ciecamfloat = cbciecamfloat->get_active (); - moptions.rtSettings.HistogramWorking = ckbHistogramWorking->get_active (); moptions.rtSettings.leveldnv = dnv->get_active_row_number (); moptions.rtSettings.leveldnti = dnti->get_active_row_number (); moptions.rtSettings.leveldnliss = dnliss->get_active_row_number (); @@ -1928,7 +1923,6 @@ void Preferences::fillPreferences () // cbAutocielab->set_active (moptions.rtSettings.autocielab); cbciecamfloat->set_active (moptions.rtSettings.ciecamfloat); - ckbHistogramWorking->set_active (moptions.rtSettings.HistogramWorking); languages->set_active_text (moptions.language); ckbLangAutoDetect->set_active (moptions.languageAutoDetect); int themeNbr = getThemeRowNumber (moptions.theme); diff --git a/rtgui/preferences.h b/rtgui/preferences.h index b3efd8b6a..70cef4bee 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -195,7 +195,6 @@ class Preferences : public Gtk::Dialog, public ProfileStoreListener Gtk::ComboBoxText* custProfBuilderLabelType; Gtk::CheckButton* ckbHistogramPositionLeft; - Gtk::CheckButton* ckbHistogramWorking; Gtk::CheckButton* ckbFileBrowserToolbarSingleRow; Gtk::CheckButton* ckbShowFilmStripToolBar; Gtk::CheckButton* ckbHideTPVScrollbar; diff --git a/rtgui/preprocess.cc b/rtgui/preprocess.cc index 44d054214..02e0ff220 100644 --- a/rtgui/preprocess.cc +++ b/rtgui/preprocess.cc @@ -81,7 +81,7 @@ void PreProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedi pp->raw.hotdeadpix_thresh = hdThreshold->getIntValue(); if (pedited) { - pedited->raw.hotDeadPixelThresh = hdThreshold->getEditedState (); + pedited->raw.hotdeadpix_thresh = hdThreshold->getEditedState (); pedited->raw.hotPixelFilter = !hotPixel->get_inconsistent(); pedited->raw.deadPixelFilter = !deadPixel->get_inconsistent(); } diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index ca3b1a970..75c60a7a2 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -61,9 +61,9 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi disableListener (); if(pedited ) { - caAutocorrect->setEdited(pedited->raw.caCorrection); - caRed->setEditedState( pedited->raw.caRed ? Edited : UnEdited ); - caBlue->setEditedState( pedited->raw.caBlue ? Edited : UnEdited ); + caAutocorrect->setEdited(pedited->raw.ca_autocorrect); + caRed->setEditedState( pedited->raw.cared ? Edited : UnEdited ); + caBlue->setEditedState( pedited->raw.cablue ? Edited : UnEdited ); } // disable Red and Blue sliders when caAutocorrect is enabled @@ -84,9 +84,9 @@ void RAWCACorr::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedit pp->raw.cablue = caBlue->getValue(); if (pedited) { - pedited->raw.caCorrection = !caAutocorrect->get_inconsistent(); - pedited->raw.caRed = caRed->getEditedState (); - pedited->raw.caBlue = caBlue->getEditedState (); + pedited->raw.ca_autocorrect = !caAutocorrect->get_inconsistent(); + pedited->raw.cared = caRed->getEditedState (); + pedited->raw.cablue = caBlue->getEditedState (); } } @@ -132,8 +132,8 @@ void RAWCACorr::setDefaults(const rtengine::procparams::ProcParams* defParams, c caBlue->setDefault( defParams->raw.cablue); if (pedited) { - caRed->setDefaultEditedState( pedited->raw.caRed ? Edited : UnEdited); - caBlue->setDefaultEditedState( pedited->raw.caBlue ? Edited : UnEdited); + caRed->setDefaultEditedState( pedited->raw.cared ? Edited : UnEdited); + caBlue->setDefaultEditedState( pedited->raw.cablue ? Edited : UnEdited); } else { caRed->setDefaultEditedState( Irrelevant ); caBlue->setDefaultEditedState( Irrelevant ); diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index bf88a85e4..320c91fd5 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -380,14 +380,15 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") Gtk::Grid *tranGrid = Gtk::manage (new Gtk::Grid()); setExpandAlignProperties (tranGrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + const RetinexParams default_params; + // Transmission map curve transmissionCurveEditorG = new CurveEditorGroup (options.lastRetinexDir, M ("TP_RETINEX_TRANSMISSION")); setExpandAlignProperties (transmissionCurveEditorG, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); transmissionCurveEditorG->setCurveListener (this); - rtengine::RetinexParams::getDefaulttransmissionCurve (defaultCurve); transmissionShape = static_cast (transmissionCurveEditorG->addCurve (CT_Flat, "", nullptr, false, false)); transmissionShape->setIdentityValue (0.); - transmissionShape->setResetCurve (FlatCurveType (defaultCurve.at (0)), defaultCurve); + transmissionShape->setResetCurve (FlatCurveType (default_params.transmissionCurve.at (0)), default_params.transmissionCurve); // transmissionShape->setBottomBarBgGradient(milestones); transmissionCurveEditorG->curveListComplete(); transmissionCurveEditorG->set_tooltip_markup (M ("TP_RETINEX_TRANSMISSION_TOOLTIP")); @@ -439,10 +440,9 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") gaintransmissionCurve = new CurveEditorGroup (options.lastRetinexDir, M ("TP_RETINEX_GAINTRANSMISSION")); setExpandAlignProperties (gaintransmissionCurve, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); gaintransmissionCurve->setCurveListener (this); - rtengine::RetinexParams::getDefaultgaintransmissionCurve (defaultCurve); gaintransmissionShape = static_cast (gaintransmissionCurve->addCurve (CT_Flat, "", nullptr, false, false)); gaintransmissionShape->setIdentityValue (0.); - gaintransmissionShape->setResetCurve (FlatCurveType (defaultCurve.at (0)), defaultCurve); + gaintransmissionShape->setResetCurve (FlatCurveType (default_params.gaintransmissionCurve.at (0)), default_params.gaintransmissionCurve); //gaintransmissionShape->setBottomBarBgGradient(milestones); gaintransmissionCurve->set_tooltip_markup (M ("TP_RETINEX_GAINTRANSMISSION_TOOLTIP")); gaintransmissionCurve->curveListComplete(); diff --git a/rtgui/rgbcurves.cc b/rtgui/rgbcurves.cc index d9c970f7a..d32633bf4 100644 --- a/rtgui/rgbcurves.cc +++ b/rtgui/rgbcurves.cc @@ -21,7 +21,7 @@ using namespace rtengine; using namespace rtengine::procparams; -RGBCurves::RGBCurves () : FoldableToolPanel(this, "rgbcurves", M("TP_RGBCURVES_LABEL")) +RGBCurves::RGBCurves () : FoldableToolPanel(this, "rgbcurves", M("TP_RGBCURVES_LABEL"), false, true) { lumamode = Gtk::manage (new Gtk::CheckButton (M("TP_RGBCURVES_LUMAMODE"))); @@ -84,6 +84,7 @@ void RGBCurves::read (const ProcParams* pp, const ParamsEdited* pedited) Gshape->setUnChanged (!pedited->rgbCurves.gcurve); Bshape->setUnChanged (!pedited->rgbCurves.bcurve); lumamode->set_inconsistent (!pedited->rgbCurves.lumamode); + set_inconsistent(multiImage && !pedited->rgbCurves.enabled); } lumamodeConn.block (true); @@ -96,6 +97,8 @@ void RGBCurves::read (const ProcParams* pp, const ParamsEdited* pedited) Gshape->setCurve (pp->rgbCurves.gcurve); Bshape->setCurve (pp->rgbCurves.bcurve); + setEnabled(pp->rgbCurves.enabled); + enableListener (); } @@ -122,13 +125,14 @@ void RGBCurves::autoOpenCurve () void RGBCurves::write (ProcParams* pp, ParamsEdited* pedited) { - + pp->rgbCurves.enabled = getEnabled(); pp->rgbCurves.rcurve = Rshape->getCurve (); pp->rgbCurves.gcurve = Gshape->getCurve (); pp->rgbCurves.bcurve = Bshape->getCurve (); pp->rgbCurves.lumamode = lumamode->get_active(); if (pedited) { + pedited->rgbCurves.enabled = !get_inconsistent(); pedited->rgbCurves.rcurve = !Rshape->isUnChanged (); pedited->rgbCurves.gcurve = !Gshape->isUnChanged (); pedited->rgbCurves.bcurve = !Bshape->isUnChanged (); @@ -146,7 +150,7 @@ void RGBCurves::write (ProcParams* pp, ParamsEdited* pedited) void RGBCurves::curveChanged (CurveEditor* ce) { - if (listener) { + if (listener && getEnabled()) { if (ce == Rshape) { listener->panelChanged (EvRGBrCurve, M("HISTORY_CUSTOMCURVE")); } @@ -177,7 +181,7 @@ void RGBCurves::lumamodeChanged () lastLumamode = lumamode->get_active (); } - if (listener) { + if (listener && getEnabled()) { if (lumamode->get_active ()) { listener->panelChanged (EvRGBrCurveLumamode, M("GENERAL_ENABLED")); } else { @@ -202,3 +206,16 @@ void RGBCurves::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & his // Bshape->updateBackgroundHistogram (histBlue); } + +void RGBCurves::enabledChanged() +{ + if (listener) { + if (get_inconsistent()) { + listener->panelChanged(EvRGBEnabled, M("GENERAL_UNCHANGED")); + } else if (getEnabled()) { + listener->panelChanged(EvRGBEnabled, M("GENERAL_ENABLED")); + } else { + listener->panelChanged(EvRGBEnabled, M("GENERAL_DISABLED")); + } + } +} diff --git a/rtgui/rgbcurves.h b/rtgui/rgbcurves.h index efca76422..dfcba71f9 100644 --- a/rtgui/rgbcurves.h +++ b/rtgui/rgbcurves.h @@ -53,6 +53,7 @@ public: void curveChanged (CurveEditor* ce); void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, /*LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI); void lumamodeChanged (); + void enabledChanged(); }; #endif diff --git a/rtgui/thresholdadjuster.cc b/rtgui/thresholdadjuster.cc index 754205e2e..7afd128b5 100644 --- a/rtgui/thresholdadjuster.cc +++ b/rtgui/thresholdadjuster.cc @@ -341,20 +341,20 @@ void ThresholdAdjuster::sendToListener () rtengine::procparams::Threshold t = tSelector.getPositions(); if (tSelector.isDouble()) { - adjusterListener->adjusterChanged (this, t.value[0], t.value[1], t.value[2], t.value[3]); - adjusterListener->adjusterChanged2 (this, t.value[0], t.value[1], t.value[2], t.value[3]); + adjusterListener->adjusterChanged (this, t.getBottomLeft(), t.getTopLeft(), t.getBottomRight(), t.getTopRight()); + adjusterListener->adjusterChanged2 (this, t.getBottomLeft(), t.getTopLeft(), t.getBottomRight(), t.getTopRight()); } else { - adjusterListener->adjusterChanged (this, t.value[0], t.value[1]); + adjusterListener->adjusterChanged (this, t.getBottomLeft(), t.getTopLeft()); } } else { // if precision is equal to 0, then we assume that the listener is waiting for integers rtengine::procparams::Threshold t = tSelector.getPositions(); if (tSelector.isDouble()) { - adjusterListener->adjusterChanged (this, t.value[0], t.value[1], t.value[2], t.value[3]); - adjusterListener->adjusterChanged2 (this, t.value[0], t.value[1], t.value[2], t.value[3]); + adjusterListener->adjusterChanged (this, t.getBottomLeft(), t.getTopLeft(), t.getBottomRight(), t.getTopRight()); + adjusterListener->adjusterChanged2 (this, t.getBottomLeft(), t.getTopLeft(), t.getBottomRight(), t.getTopRight()); } else { - adjusterListener->adjusterChanged (this, t.value[0], t.value[1]); + adjusterListener->adjusterChanged (this, t.getBottomLeft(), t.getTopLeft()); } } } diff --git a/rtgui/thresholdselector.cc b/rtgui/thresholdselector.cc index 0f9b11cf2..891095e6f 100644 --- a/rtgui/thresholdselector.cc +++ b/rtgui/thresholdselector.cc @@ -284,6 +284,9 @@ void ThresholdSelector::updateBackBuffer() cr->set_line_cap(Cairo::LINE_CAP_BUTT); if (is_sensitive() && coloredBar.canGetColors()) { + if (updatePolicy == RTUP_DYNAMIC) { + coloredBar.setDirty(true); + } // this will eventually create/update the off-screen Surface for the gradient area only ! coloredBar.setDrawRectangle(hb + hwslider, int(float(h) * 1.5f / 7.f + 0.5f), iw + 1, int(float(h) * 4.f / 7.f + 0.5f)); // that we're displaying here diff --git a/rtgui/thresholdselector.h b/rtgui/thresholdselector.h index f6caa4302..32b423e64 100644 --- a/rtgui/thresholdselector.h +++ b/rtgui/thresholdselector.h @@ -138,12 +138,12 @@ public: template void setDefaults (const rtengine::procparams::Threshold &t) { - defPos[TS_BOTTOMLEFT] = double(t.value[0]); // should we use shapeValue() ? - defPos[TS_TOPLEFT] = double(t.value[1]); + defPos[TS_BOTTOMLEFT] = double(t.getBottomLeft()); // should we use shapeValue() ? + defPos[TS_TOPLEFT] = double(t.getTopLeft()); if (doubleThresh) { - defPos[TS_BOTTOMRIGHT] = double(t.value[2]); - defPos[TS_TOPRIGHT] = double(t.value[3]); + defPos[TS_BOTTOMRIGHT] = double(t.getBottomRight()); + defPos[TS_TOPRIGHT] = double(t.getTopRight()); } } void setDefaults (double bottom, double top); @@ -151,12 +151,12 @@ public: template void setPositions (const rtengine::procparams::Threshold &tValues) { - positions[TS_BOTTOMLEFT] = static_cast(tValues.value[TS_BOTTOMLEFT]); - positions[TS_TOPLEFT] = static_cast(tValues.value[TS_TOPLEFT]); + positions[TS_BOTTOMLEFT] = static_cast(tValues.getBottomLeft()); + positions[TS_TOPLEFT] = static_cast(tValues.getTopLeft()); if (tValues.isDouble()) { - positions[TS_BOTTOMRIGHT] = static_cast(tValues.value[TS_BOTTOMRIGHT]); - positions[TS_TOPRIGHT] = static_cast(tValues.value[TS_TOPRIGHT]); + positions[TS_BOTTOMRIGHT] = static_cast(tValues.getBottomRight()); + positions[TS_TOPRIGHT] = static_cast(tValues.getTopRight()); } updateTooltip(); diff --git a/rtgui/thumbbrowserentrybase.cc b/rtgui/thumbbrowserentrybase.cc index 0cb53d0c2..2fff95904 100644 --- a/rtgui/thumbbrowserentrybase.cc +++ b/rtgui/thumbbrowserentrybase.cc @@ -400,7 +400,7 @@ void ThumbBrowserEntryBase::resize (int h) MYWRITERLOCK(l, lockRW); height = h; - int old_preh = preh, old_width = width; + int old_preh = preh; // dimensions of the button set int bsw = 0, bsh = 0; @@ -462,7 +462,7 @@ void ThumbBrowserEntryBase::resize (int h) width = bsw + 2 * sideMargin + 2 * borderWidth; } - if ( preh != old_preh || width != old_width ) { + if (preh != old_preh) { delete [] preview; preview = nullptr; refreshThumbnailImage (); diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 28dcf9f3d..a9dd35466 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -223,8 +223,8 @@ void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited) shape->setCurve (pp->toneCurve.curve); shape2->setCurve (pp->toneCurve.curve2); - toneCurveMode->set_active(pp->toneCurve.curveMode); - toneCurveMode2->set_active(pp->toneCurve.curveMode2); + toneCurveMode->set_active(rtengine::toUnderlying(pp->toneCurve.curveMode)); + toneCurveMode2->set_active(rtengine::toUnderlying(pp->toneCurve.curveMode2)); if (pedited) { expcomp->setEditedState (pedited->toneCurve.expcomp ? Edited : UnEdited); @@ -314,33 +314,33 @@ void ToneCurve::write (ProcParams* pp, ParamsEdited* pedited) int tcMode = toneCurveMode->get_active_row_number(); if (tcMode == 0) { - pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_STD; + pp->toneCurve.curveMode = ToneCurveParams::TcMode::STD; } else if (tcMode == 1) { - pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_WEIGHTEDSTD; + pp->toneCurve.curveMode = ToneCurveParams::TcMode::WEIGHTEDSTD; } else if (tcMode == 2) { - pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_FILMLIKE; + pp->toneCurve.curveMode = ToneCurveParams::TcMode::FILMLIKE; } else if (tcMode == 3) { - pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_SATANDVALBLENDING; + pp->toneCurve.curveMode = ToneCurveParams::TcMode::SATANDVALBLENDING; } else if (tcMode == 4) { - pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_LUMINANCE; + pp->toneCurve.curveMode = ToneCurveParams::TcMode::LUMINANCE; } else if (tcMode == 5) { - pp->toneCurve.curveMode = ToneCurveParams::TC_MODE_PERCEPTUAL; + pp->toneCurve.curveMode = ToneCurveParams::TcMode::PERCEPTUAL; } tcMode = toneCurveMode2->get_active_row_number(); if (tcMode == 0) { - pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_STD; + pp->toneCurve.curveMode2 = ToneCurveParams::TcMode::STD; } else if (tcMode == 1) { - pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_WEIGHTEDSTD; + pp->toneCurve.curveMode2 = ToneCurveParams::TcMode::WEIGHTEDSTD; } else if (tcMode == 2) { - pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_FILMLIKE; + pp->toneCurve.curveMode2 = ToneCurveParams::TcMode::FILMLIKE; } else if (tcMode == 3) { - pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_SATANDVALBLENDING; + pp->toneCurve.curveMode2 = ToneCurveParams::TcMode::SATANDVALBLENDING; } else if (tcMode == 4) { - pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_LUMINANCE; + pp->toneCurve.curveMode2 = ToneCurveParams::TcMode::LUMINANCE; } else if (tcMode == 5) { - pp->toneCurve.curveMode2 = ToneCurveParams::TC_MODE_PERCEPTUAL; + pp->toneCurve.curveMode2 = ToneCurveParams::TcMode::PERCEPTUAL; } if (pedited) { diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index b61c9acd4..d3a594848 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -408,12 +408,11 @@ Wavelet::Wavelet() : opaCurveEditorG->setCurveListener (this); - std::vector defaultCurve; + const WaveletParams default_params; - rtengine::WaveletParams::getDefaultOpacityCurveRG(defaultCurve); opacityShapeRG = static_cast(opaCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); opacityShapeRG->setIdentityValue(0.); - opacityShapeRG->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); + opacityShapeRG->setResetCurve(FlatCurveType(default_params.opacityCurveRG.at(0)), default_params.opacityCurveRG); opaCurveEditorG->curveListComplete(); opaCurveEditorG->show(); @@ -422,10 +421,9 @@ Wavelet::Wavelet() : opacityCurveEditorG->setCurveListener (this); - rtengine::WaveletParams::getDefaultOpacityCurveBY(defaultCurve); opacityShapeBY = static_cast(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); opacityShapeBY->setIdentityValue(0.); - opacityShapeBY->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); + opacityShapeBY->setResetCurve(FlatCurveType(default_params.opacityCurveBY.at(0)), default_params.opacityCurveBY); opacityCurveEditorG->curveListComplete(); opacityCurveEditorG->show(); @@ -502,11 +500,10 @@ Wavelet::Wavelet() : // <-- Edge Sharpness Local Contrast curve CCWcurveEditorG->setCurveListener (this); - rtengine::WaveletParams::getDefaultCCWCurve(defaultCurve); ccshape = static_cast(CCWcurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); ccshape->setIdentityValue(0.); - ccshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); + ccshape->setResetCurve(FlatCurveType(default_params.ccwcurve.at(0)), default_params.ccwcurve); ccshape->setTooltip(M("TP_WAVELET_CURVEEDITOR_CC_TOOLTIP")); CCWcurveEditorG->curveListComplete(); @@ -781,10 +778,9 @@ Wavelet::Wavelet() : opacityCurveEditorW->setCurveListener (this); - rtengine::WaveletParams::getDefaultOpacityCurveW(defaultCurve); opacityShape = static_cast(opacityCurveEditorW->addCurve(CT_Flat, "", nullptr, false, false)); opacityShape->setIdentityValue(0.); - opacityShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); + opacityShape->setResetCurve(FlatCurveType(default_params.opacityCurveW.at(0)), default_params.opacityCurveW); opacityShape->setBottomBarBgGradient(milestones2); // This will add the reset button at the end of the curveType buttons @@ -798,10 +794,9 @@ Wavelet::Wavelet() : opacityCurveEditorWL->setCurveListener (this); - rtengine::WaveletParams::getDefaultOpacityCurveWL(defaultCurve); opacityShapeWL = static_cast(opacityCurveEditorWL->addCurve(CT_Flat, "", nullptr, false, false)); opacityShapeWL->setIdentityValue(0.); - opacityShapeWL->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); + opacityShapeWL->setResetCurve(FlatCurveType(default_params.opacityCurveWL.at(0)), default_params.opacityCurveWL); opacityShapeWL->setTooltip(M("TP_WAVELET_OPACITYWL_TOOLTIP")); // This will add the reset button at the end of the curveType buttons diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index d16dafa08..57d73b15f 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -34,7 +34,7 @@ using namespace rtengine; using namespace rtengine::procparams; -Glib::RefPtr WhiteBalance::wbPixbufs[rtengine::procparams::WBT_CUSTOM + 1]; +Glib::RefPtr WhiteBalance::wbPixbufs[toUnderlying(WBEntry::Type::CUSTOM) + 1]; /* Glib::RefPtr WhiteBalance::wbCameraPB, WhiteBalance::wbAutoPB, WhiteBalance::wbSunPB, WhiteBalance::wbTungstenPB, WhiteBalance::wbCloudyPB, WhiteBalance::wbShadePB, WhiteBalance::wbFluorescentPB, WhiteBalance::wbLampPB, @@ -43,24 +43,24 @@ Glib::RefPtr WhiteBalance::wbCameraPB, WhiteBalance::wbAutoPB, Whit void WhiteBalance::init () { - wbPixbufs[WBT_CAMERA] = RTImage::createFromFile ("wb-camera.png"); - wbPixbufs[WBT_AUTO] = RTImage::createFromFile ("wb-auto.png"); - wbPixbufs[WBT_DAYLIGHT] = RTImage::createFromFile ("wb-sun.png"); - wbPixbufs[WBT_CLOUDY] = RTImage::createFromFile ("wb-cloudy.png"); - wbPixbufs[WBT_SHADE] = RTImage::createFromFile ("wb-shade.png"); - wbPixbufs[WBT_WATER] = RTImage::createFromFile ("wb-water.png"); -// wbPixbufs[WBT_WATER2] = RTImage::createFromFile ("wb-water.png"); - wbPixbufs[WBT_TUNGSTEN] = RTImage::createFromFile ("wb-tungsten.png"); - wbPixbufs[WBT_FLUORESCENT] = RTImage::createFromFile ("wb-fluorescent.png"); - wbPixbufs[WBT_LAMP] = RTImage::createFromFile ("wb-lamp.png"); - wbPixbufs[WBT_FLASH] = RTImage::createFromFile ("wb-flash.png"); - wbPixbufs[WBT_LED] = RTImage::createFromFile ("wb-led.png"); - wbPixbufs[WBT_CUSTOM] = RTImage::createFromFile ("wb-custom.png"); + wbPixbufs[toUnderlying(WBEntry::Type::CAMERA)] = RTImage::createFromFile ("wb-camera.png"); + wbPixbufs[toUnderlying(WBEntry::Type::AUTO)] = RTImage::createFromFile ("wb-auto.png"); + wbPixbufs[toUnderlying(WBEntry::Type::DAYLIGHT)] = RTImage::createFromFile ("wb-sun.png"); + wbPixbufs[toUnderlying(WBEntry::Type::CLOUDY)] = RTImage::createFromFile ("wb-cloudy.png"); + wbPixbufs[toUnderlying(WBEntry::Type::SHADE)] = RTImage::createFromFile ("wb-shade.png"); + wbPixbufs[toUnderlying(WBEntry::Type::WATER)] = RTImage::createFromFile ("wb-water.png"); +// wbPixbufs[WBEntry::Type::WATER2] = RTImage::createFromFile ("wb-water.png"); + wbPixbufs[toUnderlying(WBEntry::Type::TUNGSTEN)] = RTImage::createFromFile ("wb-tungsten.png"); + wbPixbufs[toUnderlying(WBEntry::Type::FLUORESCENT)] = RTImage::createFromFile ("wb-fluorescent.png"); + wbPixbufs[toUnderlying(WBEntry::Type::LAMP)] = RTImage::createFromFile ("wb-lamp.png"); + wbPixbufs[toUnderlying(WBEntry::Type::FLASH)] = RTImage::createFromFile ("wb-flash.png"); + wbPixbufs[toUnderlying(WBEntry::Type::LED)] = RTImage::createFromFile ("wb-led.png"); + wbPixbufs[toUnderlying(WBEntry::Type::CUSTOM)] = RTImage::createFromFile ("wb-custom.png"); } void WhiteBalance::cleanup () { - for (unsigned int i = 0; i < WBT_CUSTOM + 1; i++) { + for (unsigned int i = 0; i < toUnderlying(WBEntry::Type::CUSTOM) + 1; i++) { wbPixbufs[i].reset(); } } @@ -147,7 +147,7 @@ static double wbTemp2Slider(double temp) return sval; } -WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WBALANCE_LABEL")), wbp(nullptr), wblistener(nullptr) +WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WBALANCE_LABEL"), false, true), wbp(nullptr), wblistener(nullptr) { Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); @@ -163,68 +163,68 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB // Assign the model to the Combobox method->set_model(refTreeModel); - enum WBTypes oldType = WBParams::wbEntries[0]->type; - enum WBTypes currType; + WBEntry::Type oldType = WBParams::getWbEntries()[0].type; + WBEntry::Type currType; Gtk::TreeModel::Row row, childrow; - for (unsigned int i = 0; i < WBParams::wbEntries.size(); i++) { - if (oldType != (currType = WBParams::wbEntries[i]->type)) { + for (unsigned int i = 0; i < WBParams::getWbEntries().size(); i++) { + if (oldType != (currType = WBParams::getWbEntries()[i].type)) { // New entry type - if (currType == WBT_FLUORESCENT) { + if (currType == WBEntry::Type::FLUORESCENT) { // Creating the Fluorescent subcategory header row = *(refTreeModel->append()); - row[methodColumns.colIcon] = wbPixbufs[currType]; + row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; row[methodColumns.colLabel] = M("TP_WBALANCE_FLUO_HEADER"); row[methodColumns.colId] = i + 100; } - if (currType == WBT_WATER) { + if (currType == WBEntry::Type::WATER) { // Creating the under water subcategory header row = *(refTreeModel->append()); - row[methodColumns.colIcon] = wbPixbufs[currType]; + row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; row[methodColumns.colLabel] = M("TP_WBALANCE_WATER_HEADER"); row[methodColumns.colId] = i + 100; } - if (currType == WBT_LAMP) { + if (currType == WBEntry::Type::LAMP) { // Creating the Lamp subcategory header row = *(refTreeModel->append()); - row[methodColumns.colIcon] = wbPixbufs[currType]; + row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; row[methodColumns.colLabel] = M("TP_WBALANCE_LAMP_HEADER"); row[methodColumns.colId] = i + 100; } - if (currType == WBT_LED) { + if (currType == WBEntry::Type::LED) { // Creating the LED subcategory header row = *(refTreeModel->append()); - row[methodColumns.colIcon] = wbPixbufs[currType]; + row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; row[methodColumns.colLabel] = M("TP_WBALANCE_LED_HEADER"); row[methodColumns.colId] = i + 100; } - if (currType == WBT_FLASH) { + if (currType == WBEntry::Type::FLASH) { // Creating the Flash subcategory header row = *(refTreeModel->append()); - row[methodColumns.colIcon] = wbPixbufs[currType]; + row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; row[methodColumns.colLabel] = M("TP_WBALANCE_FLASH_HEADER"); row[methodColumns.colId] = i + 100; } } - if (currType == WBT_FLUORESCENT - || currType == WBT_LAMP - || currType == WBT_WATER - || currType == WBT_FLASH - || currType == WBT_LED + if (currType == WBEntry::Type::FLUORESCENT + || currType == WBEntry::Type::LAMP + || currType == WBEntry::Type::WATER + || currType == WBEntry::Type::FLASH + || currType == WBEntry::Type::LED ) { childrow = *(refTreeModel->append(row.children())); - childrow[methodColumns.colIcon] = wbPixbufs[currType]; - childrow[methodColumns.colLabel] = WBParams::wbEntries[i]->GUILabel; + childrow[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; + childrow[methodColumns.colLabel] = WBParams::getWbEntries()[i].GUILabel; childrow[methodColumns.colId] = i; } else { row = *(refTreeModel->append()); - row[methodColumns.colIcon] = wbPixbufs[currType]; - row[methodColumns.colLabel] = WBParams::wbEntries[i]->GUILabel; + row[methodColumns.colIcon] = wbPixbufs[toUnderlying(currType)]; + row[methodColumns.colLabel] = WBParams::getWbEntries()[i].GUILabel; row[methodColumns.colId] = i; } @@ -349,9 +349,23 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB spotsize->signal_changed().connect( sigc::mem_fun(*this, &WhiteBalance::spotSizeChanged) ); } + +void WhiteBalance::enabledChanged() +{ + if (listener) { + if (get_inconsistent()) { + listener->panelChanged(EvWBEnabled, M("GENERAL_UNCHANGED")); + } else if (getEnabled()) { + listener->panelChanged(EvWBEnabled, M("GENERAL_ENABLED")); + } else { + listener->panelChanged(EvWBEnabled, M("GENERAL_DISABLED")); + } + } +} + + void WhiteBalance::adjusterChanged (Adjuster* a, double newval) { - int tVal = (int)temp->getValue(); double gVal = green->getValue(); double eVal = equal->getValue(); @@ -362,12 +376,24 @@ void WhiteBalance::adjusterChanged (Adjuster* a, double newval) } Glib::ustring colLabel = row[methodColumns.colLabel]; - WBEntry* ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI); - WBEntry* wbCustom = findWBEntry ("Custom", WBLT_PP); + const std::pair ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI); + const std::pair wbCustom = findWBEntry ("Custom", WBLT_PP); - if (!ppMethod || (ppMethod->ppLabel != wbCustom->ppLabel && !((a == equal || a == tempBias) && ppMethod->type == WBT_AUTO)) ) { + if ( + !ppMethod.first + || ( + ppMethod.second.ppLabel != wbCustom.second.ppLabel + && !( + ( + a == equal + || a == tempBias + ) + && ppMethod.second.type == WBEntry::Type::AUTO + ) + ) + ) { methconn.block(true); - opt = setActiveMethod(wbCustom->GUILabel); + opt = setActiveMethod(wbCustom.second.GUILabel); tempBias->set_sensitive(false); cache_customWB (tVal, gVal); @@ -388,7 +414,7 @@ void WhiteBalance::adjusterChanged (Adjuster* a, double newval) // Recomputing AutoWB if it's the current method will happen in improccoordinator.cc - if (listener) { + if (listener && getEnabled()) { if (a == temp) { listener->panelChanged (EvWBTemp, Glib::ustring::format ((int)a->getValue())); } else if (a == green) { @@ -403,7 +429,6 @@ void WhiteBalance::adjusterChanged (Adjuster* a, double newval) void WhiteBalance::optChanged () { - Gtk::TreeModel::Row row = getActiveMethod(); if (row == refTreeModel->children().end()) { @@ -429,12 +454,12 @@ void WhiteBalance::optChanged () tempBias->setEditedState (UnEdited); } else { unsigned int methodId = findWBEntryId (row[methodColumns.colLabel], WBLT_GUI); - WBEntry* currMethod = WBParams::wbEntries[methodId]; + const WBEntry& currMethod = WBParams::getWbEntries()[methodId]; - tempBias->set_sensitive(currMethod->type == WBT_AUTO); + tempBias->set_sensitive(currMethod.type == WBEntry::Type::AUTO); - switch (currMethod->type) { - case WBT_CAMERA: + switch (currMethod.type) { + case WBEntry::Type::CAMERA: if (wbp) { double ctemp, cgreen; wbp->getCamWB (ctemp, cgreen); @@ -451,7 +476,7 @@ void WhiteBalance::optChanged () break; - case WBT_AUTO: + case WBEntry::Type::AUTO: if (wbp) { if (batchMode) { temp->setEditedState (UnEdited); @@ -464,7 +489,7 @@ void WhiteBalance::optChanged () break; - case WBT_CUSTOM: + case WBEntry::Type::CUSTOM: if (custom_temp > 0) { temp->setValue (temp->getAddMode() ? 0.0 : custom_temp); green->setValue (green->getAddMode() ? 0.0 : custom_green); @@ -484,19 +509,19 @@ void WhiteBalance::optChanged () break; /* All other solution are the default cases - case WBT_DAYLIGHT: - case WBT_CLOUDY: - case WBT_SHADE: - case WBT_TUNGSTEN: - case WBT_FLUORESCENT: - case WBT_LAMP: - case WBT_FLASH: - case WBT_LED:*/ + case WBEntry::Type::DAYLIGHT: + case WBEntry::Type::CLOUDY: + case WBEntry::Type::SHADE: + case WBEntry::Type::TUNGSTEN: + case WBEntry::Type::FLUORESCENT: + case WBEntry::Type::LAMP: + case WBEntry::Type::FLASH: + case WBEntry::Type::LED:*/ default: // recall custom WB settings if it exists, set to 1.0 otherwise - temp->setValue ( temp->getAddMode() ? 0.0 : (double)(currMethod->temperature)); - green->setValue (green->getAddMode() ? 0.0 : (double)(currMethod->green)); - equal->setValue (equal->getAddMode() ? 0.0 : (double)(currMethod->equal)); + temp->setValue ( temp->getAddMode() ? 0.0 : (double)(currMethod.temperature)); + green->setValue (green->getAddMode() ? 0.0 : (double)(currMethod.green)); + equal->setValue (equal->getAddMode() ? 0.0 : (double)(currMethod.equal)); if (batchMode) { temp->setEditedState (Edited); @@ -508,7 +533,7 @@ void WhiteBalance::optChanged () } } - if (listener) { + if (listener && getEnabled()) { listener->panelChanged (EvWBMethod, row[methodColumns.colLabel]); } } @@ -516,7 +541,6 @@ void WhiteBalance::optChanged () void WhiteBalance::spotPressed () { - if (wblistener) { wblistener->spotWBRequested (getSize()); } @@ -551,17 +575,21 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) if (pedited && !pedited->wb.method) { opt = setActiveMethod(M("GENERAL_UNCHANGED")); } else { - WBEntry* wbValues = findWBEntry(pp->wb.method, WBLT_PP); + const WBEntry& wbValues = + [this, pp]() -> const WBEntry& + { + const std::pair res = findWBEntry(pp->wb.method, WBLT_PP); + return + !res.first + ? findWBEntry("Camera", WBLT_PP).second + : res.second; + }(); - if (!wbValues) { - wbValues = findWBEntry("Camera", WBLT_PP); - } - - opt = setActiveMethod(wbValues->GUILabel); + opt = setActiveMethod(wbValues.GUILabel); // temperature is reset to the associated temperature, or 0.0 if addMode is set. - switch (wbValues->type) { - case WBT_CUSTOM: + switch (wbValues.type) { + case WBEntry::Type::CUSTOM: temp->setValue (temp->getAddMode() ? 0.0 : pp->wb.temperature); green->setValue (green->getAddMode() ? 0.0 : pp->wb.green); equal->setValue (equal->getAddMode() ? 0.0 : pp->wb.equal); @@ -578,7 +606,7 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) break; - case WBT_CAMERA: + case WBEntry::Type::CAMERA: if (wbp) { double ctemp = -1.0; double cgreen = -1.0; @@ -600,7 +628,7 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) break; - case WBT_AUTO: + case WBEntry::Type::AUTO: // the equalizer's value is restored for the AutoWB equal->setValue (equal->getAddMode() ? 0.0 : pp->wb.equal); tempBias->setValue (tempBias->getAddMode() ? 0.0 : pp->wb.tempBias); @@ -620,18 +648,18 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) /* All those types are the "default" case: - case WBT_DAYLIGHT: - case WBT_CLOUDY: - case WBT_SHADE: - case WBT_TUNGSTEN: - case WBT_FLUORESCENT: - case WBT_LAMP: - case WBT_FLASH: - case WBT_LED: + case WBEntry::Type::DAYLIGHT: + case WBEntry::Type::CLOUDY: + case WBEntry::Type::SHADE: + case WBEntry::Type::TUNGSTEN: + case WBEntry::Type::FLUORESCENT: + case WBEntry::Type::LAMP: + case WBEntry::Type::FLASH: + case WBEntry::Type::LED: */ default: // Set the associated temperature, or 0.0 if in ADD mode - temp->setValue(temp->getAddMode() ? 0.0 : (double)wbValues->temperature); + temp->setValue(temp->getAddMode() ? 0.0 : (double)wbValues.temperature); // Set the stored temperature, or 0.0 if in ADD mode green->setValue(green->getAddMode() ? 0.0 : pp->wb.green); equal->setValue(equal->getAddMode() ? 0.0 : pp->wb.equal); @@ -648,7 +676,12 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited) break; } - tempBias->set_sensitive(wbValues->type == WBT_AUTO); + tempBias->set_sensitive(wbValues.type == WBEntry::Type::AUTO); + } + + setEnabled(pp->wb.enabled); + if (pedited) { + set_inconsistent(multiImage && !pedited->wb.enabled); } methconn.block (false); @@ -666,12 +699,15 @@ void WhiteBalance::write (ProcParams* pp, ParamsEdited* pedited) pedited->wb.equal = equal->getEditedState (); pedited->wb.tempBias = tempBias->getEditedState (); pedited->wb.method = row[methodColumns.colLabel] != M("GENERAL_UNCHANGED"); + pedited->wb.enabled = !get_inconsistent(); } - WBEntry* ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI); + pp->wb.enabled = getEnabled(); - if (ppMethod) { - pp->wb.method = ppMethod->ppLabel; + const std::pair ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI); + + if (ppMethod.first) { + pp->wb.method = ppMethod.second.ppLabel; } pp->wb.temperature = temp->getIntValue (); @@ -724,7 +760,7 @@ void WhiteBalance::setBatchMode (bool batchMode) equal->showEditedCB (); tempBias->showEditedCB (); Gtk::TreeModel::Row row = *(refTreeModel->append()); - row[methodColumns.colId] = WBParams::wbEntries.size(); + row[methodColumns.colId] = WBParams::getWbEntries().size(); row[methodColumns.colLabel] = M("GENERAL_UNCHANGED"); } @@ -739,10 +775,11 @@ void WhiteBalance::setWB (int vtemp, double vgreen) { methconn.block(true); - WBEntry *wbValues = findWBEntry("Custom", WBLT_PP); + const std::pair wbValues = findWBEntry("Custom", WBLT_PP); + setEnabled(true); temp->setValue (vtemp); green->setValue (vgreen); - opt = setActiveMethod(wbValues->GUILabel); + opt = setActiveMethod(wbValues.second.GUILabel); cache_customWB (vtemp, vgreen); // sequence in which this call is made is important; must be before "method->set_active (2);" cache_customEqual(equal->getValue()); temp->setEditedState (Edited); @@ -792,10 +829,10 @@ void WhiteBalance::cache_customWB(int temp, double green) cache_customGreen (green); } -unsigned int WhiteBalance::findWBEntryId (const Glib::ustring &label, enum WB_LabelType lblType) +unsigned int WhiteBalance::findWBEntryId (const Glib::ustring& label, enum WB_LabelType lblType) { - for (unsigned int i = 0; i < WBParams::wbEntries.size(); i++) { - if (label == (lblType == WBLT_GUI ? WBParams::wbEntries[i]->GUILabel : WBParams::wbEntries[i]->ppLabel)) { + for (unsigned int i = 0; i < WBParams::getWbEntries().size(); i++) { + if (label == (lblType == WBLT_GUI ? WBParams::getWbEntries()[i].GUILabel : WBParams::getWbEntries()[i].ppLabel)) { return i; } } @@ -803,15 +840,15 @@ unsigned int WhiteBalance::findWBEntryId (const Glib::ustring &label, enum WB_La return 0; // default to camera wb } -WBEntry* WhiteBalance::findWBEntry (Glib::ustring label, enum WB_LabelType lblType) +std::pair WhiteBalance::findWBEntry(const Glib::ustring& label, enum WB_LabelType lblType) { - for (unsigned int i = 0; i < WBParams::wbEntries.size(); i++) { - if (label == (lblType == WBLT_GUI ? WBParams::wbEntries[i]->GUILabel : WBParams::wbEntries[i]->ppLabel)) { - return WBParams::wbEntries[i]; + for (unsigned int i = 0; i < WBParams::getWbEntries().size(); ++i) { + if (label == (lblType == WBLT_GUI ? WBParams::getWbEntries()[i].GUILabel : WBParams::getWbEntries()[i].ppLabel)) { + return {true, WBParams::getWbEntries()[i]}; } } - return nullptr; + return {false, WBParams::getWbEntries()[0]}; } int WhiteBalance::_setActiveMethod(Glib::ustring &label, Gtk::TreeModel::Children &children) @@ -860,6 +897,7 @@ void WhiteBalance::WBChanged(double temperature, double greenVal) { GThreadLock lock; disableListener(); + setEnabled(true); temp->setValue(temperature); green->setValue(greenVal); temp->setDefault(temperature); diff --git a/rtgui/whitebalance.h b/rtgui/whitebalance.h index 7366e55b5..ecf65f476 100644 --- a/rtgui/whitebalance.h +++ b/rtgui/whitebalance.h @@ -57,7 +57,7 @@ protected: } }; - static Glib::RefPtr wbPixbufs[rtengine::procparams::WBT_CUSTOM + 1]; + static Glib::RefPtr wbPixbufs[rtengine::toUnderlying(rtengine::procparams::WBEntry::Type::CUSTOM) + 1]; Glib::RefPtr refTreeModel; MethodColumns methodColumns; MyComboBox* method; @@ -85,9 +85,9 @@ protected: int setActiveMethod (Glib::ustring label); int _setActiveMethod (Glib::ustring &label, Gtk::TreeModel::Children &children); - Gtk::TreeModel::Row getActiveMethod (); - unsigned int findWBEntryId (const Glib::ustring &label, enum WB_LabelType lblType = WBLT_GUI); - rtengine::procparams::WBEntry* findWBEntry (Glib::ustring label, enum WB_LabelType lblType = WBLT_GUI); + Gtk::TreeModel::Row getActiveMethod(); + unsigned int findWBEntryId (const Glib::ustring& label, enum WB_LabelType lblType = WBLT_GUI); + std::pair findWBEntry (const Glib::ustring& label, enum WB_LabelType lblType = WBLT_GUI); public: @@ -119,6 +119,7 @@ public: void setAdjusterBehavior (bool tempadd, bool greenadd, bool equaladd, bool tempbiasadd); void trimValues (rtengine::procparams::ProcParams* pp); + void enabledChanged(); }; #endif diff --git a/rtgui/xtransprocess.cc b/rtgui/xtransprocess.cc index 453f0a53d..9e0c94ea0 100644 --- a/rtgui/xtransprocess.cc +++ b/rtgui/xtransprocess.cc @@ -29,11 +29,11 @@ XTransProcess::XTransProcess () : FoldableToolPanel(this, "xtransprocess", M("TP hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); method = Gtk::manage (new MyComboBoxText ()); - for( size_t i = 0; i < procparams::RAWParams::XTransSensor::numMethods; i++) { + for (const auto method_string : RAWParams::XTransSensor::getMethodStrings()) { const std::string langKey = - [i]() -> std::string + [method_string]() -> std::string { - const std::string str(procparams::RAWParams::XTransSensor::methodstring[i]); + const std::string str(method_string); std::string res; for (const auto& c : str) { @@ -83,10 +83,10 @@ void XTransProcess::read(const rtengine::procparams::ProcParams* pp, const Param disableListener (); methodconn.block (true); - method->set_active(procparams::RAWParams::XTransSensor::numMethods); + method->set_active(std::numeric_limits::max()); - for( size_t i = 0; i < procparams::RAWParams::XTransSensor::numMethods; i++) - if( pp->raw.xtranssensor.method == procparams::RAWParams::XTransSensor::methodstring[i]) { + for (size_t i = 0; i < RAWParams::XTransSensor::getMethodStrings().size(); ++i) + if( pp->raw.xtranssensor.method == RAWParams::XTransSensor::getMethodStrings()[i]) { method->set_active(i); oldSelection = i; break; @@ -96,7 +96,7 @@ void XTransProcess::read(const rtengine::procparams::ProcParams* pp, const Param ccSteps->setEditedState (pedited->raw.xtranssensor.ccSteps ? Edited : UnEdited); if( !pedited->raw.xtranssensor.method ) { - method->set_active(procparams::RAWParams::XTransSensor::numMethods); // No name + method->set_active(std::numeric_limits::max()); // No name } } @@ -113,12 +113,12 @@ void XTransProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* p int currentRow = method->get_active_row_number(); - if( currentRow >= 0 && currentRow < procparams::RAWParams::XTransSensor::numMethods) { - pp->raw.xtranssensor.method = procparams::RAWParams::XTransSensor::methodstring[currentRow]; + if (currentRow >= 0 && currentRow < std::numeric_limits::max()) { + pp->raw.xtranssensor.method = procparams::RAWParams::XTransSensor::getMethodStrings()[currentRow]; } if (pedited) { - pedited->raw.xtranssensor.method = method->get_active_row_number() != procparams::RAWParams::XTransSensor::numMethods; + pedited->raw.xtranssensor.method = method->get_active_row_number() != std::numeric_limits::max(); pedited->raw.xtranssensor.ccSteps = ccSteps->getEditedState (); } } @@ -126,7 +126,7 @@ void XTransProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* p void XTransProcess::setBatchMode(bool batchMode) { method->append (M("GENERAL_UNCHANGED")); - method->set_active(procparams::RAWParams::XTransSensor::numMethods); // No name + method->set_active(std::numeric_limits::max()); // No name ToolPanel::setBatchMode (batchMode); ccSteps->showEditedCB (); } @@ -153,15 +153,16 @@ void XTransProcess::adjusterChanged (Adjuster* a, double newval) void XTransProcess::methodChanged () { - int curSelection = method->get_active_row_number(); + const int curSelection = method->get_active_row_number(); + const RAWParams::XTransSensor::Method method = RAWParams::XTransSensor::Method(curSelection); - Glib::ustring methodName = ""; + Glib::ustring methodName; bool ppreq = false; - if( curSelection >= 0 && curSelection < procparams::RAWParams::XTransSensor::numMethods) { - methodName = procparams::RAWParams::XTransSensor::methodstring[curSelection]; + if (curSelection >= 0 && curSelection < std::numeric_limits::max()) { + methodName = RAWParams::XTransSensor::getMethodStrings()[curSelection]; - if (curSelection == procparams::RAWParams::XTransSensor::mono || oldSelection == procparams::RAWParams::XTransSensor::mono) { + if (method == RAWParams::XTransSensor::Method::MONO || RAWParams::XTransSensor::Method(oldSelection) == RAWParams::XTransSensor::Method::MONO) { ppreq = true; } } diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index 8b9cbccb6..20a140ce5 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -156,7 +156,13 @@ ditto {"${GTK_PREFIX}","${RESOURCES}"}/share/icons/Adwaita/index.theme # Copy the Lensfun database into the app bundle mkdir -p "${RESOURCES}/share/lensfun" -cp /opt/local/share/lensfun/version_1/* "${RESOURCES}/share/lensfun" +cp /opt/local/share/lensfun/version_2/* "${RESOURCES}/share/lensfun" + +# Copy liblensfun to Frameworks +cp /opt/local/lib/liblensfun.1.dylib "${RESOURCES}/../Frameworks" + +# Copy libiomp5 to Frameworks +cp /opt/local/lib/libomp/libiomp5.dylib "${RESOURCES}/../Frameworks" # Copy the libiomp5 license into the app bundle cp "${PROJECT_SOURCE_DIR}/licenses/osx_libiomp5_LICENSE.txt" "${RESOURCES}" diff --git a/tools/source_icons/scalable/gamut-hist.file b/tools/source_icons/scalable/gamut-hist.file new file mode 100644 index 000000000..5eb359187 --- /dev/null +++ b/tools/source_icons/scalable/gamut-hist.file @@ -0,0 +1 @@ +gamut-hist.png,w22,actions diff --git a/tools/source_icons/scalable/gamut-hist.svg b/tools/source_icons/scalable/gamut-hist.svg new file mode 100644 index 000000000..cf163df83 --- /dev/null +++ b/tools/source_icons/scalable/gamut-hist.svg @@ -0,0 +1,852 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + Morgan Hardwood + + + RawTherapee www.rawtherapee.com + + + + + + + + + + + + + + + + + diff --git a/tools/source_icons/scalable/gamut_srgb_prophoto_xy.svg b/tools/source_icons/scalable/gamut_srgb_prophoto_xy.svg new file mode 100644 index 000000000..21058878e --- /dev/null +++ b/tools/source_icons/scalable/gamut_srgb_prophoto_xy.svg @@ -0,0 +1,656 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + Morgan Hardwood + + + RawTherapee www.rawtherapee.com + + + + + + + + + + + + + + + + + + +