diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index a38254bb8..1262cd065 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -731,10 +731,14 @@ PROFILEPANEL_PLASTPHOTO;Photo précédente PROFILEPANEL_PLASTSAVED;Dernière sauvegarde PROFILEPANEL_PROFILE;Profil PROFILEPANEL_SAVEDLGLABEL;Enregistrer les paramètres de post-traitement... -PROFILEPANEL_TOOLTIPCOPY;Copie le profil courant dans le presse-papier -PROFILEPANEL_TOOLTIPLOAD;Charger un profil depuis un fichier -PROFILEPANEL_TOOLTIPPASTE; Colle le profil depuis le presse-papier -PROFILEPANEL_TOOLTIPSAVE;Enregistrer le profil actuel +PROFILEPANEL_COPYPPASTE;Paramètres à copier +PROFILEPANEL_LOADPPASTE;Paramètres à charger +PROFILEPANEL_PASTEPPASTE;Paramètres à coller +PROFILEPANEL_SAVEPPASTE;Paramètres à enregistrer +PROFILEPANEL_TOOLTIPCOPY;Copie le profil courant dans le presse-papier\nCTRL-clic pour sélectionner les paramètres à copier +PROFILEPANEL_TOOLTIPLOAD;Charger un profil depuis un fichier\nCTRL-clic pour sélectionner les paramètres à charger +PROFILEPANEL_TOOLTIPPASTE;Colle le profil depuis le presse-papier\nCTRL-clic pour sélectionner les paramètres à coller +PROFILEPANEL_TOOLTIPSAVE;Enregistrer le profil actuel\nCTRL-clic pour sélectionner les paramètres à enregistrer PROGRESSBAR_BADPIXELS;Pixels chauds/morts... PROGRESSBAR_CACORRECTION;Correction de l'aberr. chomatique... PROGRESSBAR_DARKFRAME;Trame Noire... @@ -808,6 +812,7 @@ TP_COLORSHIFT_GREENMAGENTA;Vert-Magenta TP_COLORSHIFT_LABEL;Décalage couleur TP_CROP_FIXRATIO;Ratio fixe: TP_CROP_GTDIAGONALS;Règle des diagonales +TP_CROP_GTEPASSPORT;Passeport biométrique TP_CROP_GTGRID;Grille TP_CROP_GTHARMMEANS1;Manière harmonique 1 TP_CROP_GTHARMMEANS2;Manière harmonique 2 @@ -927,6 +932,7 @@ TP_PERSPECTIVE_LABEL;Perspective TP_PERSPECTIVE_VERTICAL;Verticale TP_PREPROCESS_GREENEQUIL;Équilibrage du vert TP_PREPROCESS_HOTDEADPIXFILT;Filtrer les pixels chauds/morts +TP_PREPROCESS_HOTDEADPIXTHRESH;Seuil de détection des pixels morts TP_PREPROCESS_LABEL;Traitement pre-dématriçage TP_PREPROCESS_LINEDENOISE;Filtre de bruit de ligne TP_PREPROCESS_NO_FOUND;Aucun trouvé diff --git a/rtdata/languages/default b/rtdata/languages/default index c811628f3..bfa94fe7e 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -748,10 +748,14 @@ PROFILEPANEL_PLASTPHOTO;Last Photo PROFILEPANEL_PLASTSAVED;Last Saved PROFILEPANEL_PROFILE;Profile PROFILEPANEL_SAVEDLGLABEL;Save Postprocessing Parameters... -PROFILEPANEL_TOOLTIPCOPY;Copy current profile to clipboard -PROFILEPANEL_TOOLTIPLOAD;Load a profile from file -PROFILEPANEL_TOOLTIPPASTE; Paste profile from clipboard -PROFILEPANEL_TOOLTIPSAVE;Save current profile +PROFILEPANEL_COPYPPASTE;Parameters to copy +PROFILEPANEL_LOADPPASTE;Parameters to load +PROFILEPANEL_PASTEPPASTE;Parameters to paste +PROFILEPANEL_SAVEPPASTE;Parameters to save +PROFILEPANEL_TOOLTIPCOPY;Copy current profile to clipboard\nCTRL-click to select the parameters to copy +PROFILEPANEL_TOOLTIPLOAD;Load a profile from file\nCTRL-click to select the parameters to load +PROFILEPANEL_TOOLTIPPASTE;Paste profile from clipboard\nCTRL-click key to select the parameters to paste +PROFILEPANEL_TOOLTIPSAVE;Save current profile\nCTRL-click key to select the parameters to save PROGRESSBAR_BADPIXELS;Bad pixels... PROGRESSBAR_CACORRECTION;CA correction... PROGRESSBAR_DARKFRAME;Darkframe... @@ -955,6 +959,7 @@ TP_PERSPECTIVE_LABEL;Perspective TP_PERSPECTIVE_VERTICAL;Vertical TP_PREPROCESS_GREENEQUIL;Green equilibration TP_PREPROCESS_HOTDEADPIXFILT;Apply hot/dead pixel filter +TP_PREPROCESS_HOTDEADPIXTHRESH;Hot/dead pixel detection threshold TP_PREPROCESS_LABEL;Preprocessing TP_PREPROCESS_LINEDENOISE;Line noise filter TP_PREPROCESS_NO_FOUND;None found @@ -1101,4 +1106,5 @@ ZOOMPANEL_ZOOMFITSCREEN;Fit to screen F ZOOMPANEL_ZOOMIN;Zoom In + ZOOMPANEL_ZOOMOUT;Zoom Out - #00 default translation file -#01 Developers should add translations to this file and then run 'generateDifferences.sh' script to update other locales. +#01 Developers should add translations to this file and then run 'generateTranslationDiffs' script to update other locales. +#02 WARNING: This script works on Linux only diff --git a/rtdata/profiles/BW-1.pp3 b/rtdata/profiles/BW-1.pp3 index f8aa974db..6e126b417 100644 --- a/rtdata/profiles/BW-1.pp3 +++ b/rtdata/profiles/BW-1.pp3 @@ -19,7 +19,7 @@ Black=0 HighlightCompr=0 HighlightComprThreshold=33 ShadowCompr=50 -Curve=1;0;0;0.040000000000000015;0.029999999999999995;0.17684498029510265;0.21732319394192093;0.70232558139534862;0.74883720930232545;1;1; +Curve=1;0;0;0.04;0.03;0.17684498029510265;0.21732319394192093;0.70232558139534862;0.74883720930232545;1;1; [Channel Mixer] Red=100;0;0; @@ -53,6 +53,15 @@ DeconvAmount=75 DeconvDamping=20 DeconvIterations=30 +[Vibrance] +Enabled=false +Pastels=50 +Saturated=50 +PSThreshold=75 +ProtectSkins=false +AvoidColorShift=true +PastSatTog=true + [SharpenEdge] Enabled=false Passes=2 @@ -65,20 +74,10 @@ Matrix=false Strength=20 Uniformity=50 -[Color Boost] -Amount=0 -AvoidColorClipping=false -SaturationLimiter=false -SaturationLimit=75 - [White Balance] Setting=Camera -Temperature=5000 -Green=1 - -[Color Shift] -ChannelA=0 -ChannelB=0 +Temperature=5745 +Green=1.0 [Impulse Denoising] Enabled=false @@ -97,15 +96,6 @@ Gamma=2 LumCurve=0; ChromCurve=0; -[Luminance Denoising] -Enabled=false -Radius=2.5 -EdgeTolerance=1500 - -[Chrominance Denoising] -Enabled=false -Amount=20 - [Shadows & Highlights] Enabled=false HighQuality=false @@ -116,60 +106,13 @@ ShadowTonalWidth=80 LocalContrast=0 Radius=30 -[Crop] -Enabled=false -X=0 -Y=0 -W=4281 -H=2871 -FixedRatio=false -Ratio=3:2 -Orientation=Landscape -Guide=None - -[Coarse Transformation] -Rotate=0 -HorizontalFlip=false -VerticalFlip=false - [Common Properties for Transformations] AutoFill=false -[Rotation] -Degree=0 - -[Distortion] -Amount=0 -UseLensFun=false - -[Perspective] -Horizontal=0 -Vertical=0 - -[CACorrection] -Red=0 -Blue=0 - -[Vignetting Correction] -Amount=0 -Radius=50 -Strength=1 -CenterX=0 -CenterY=0 - [HLRecovery] Enabled=false Method=Blend -[Resize] -Enabled=false -Scale=1 -AppliesTo=Cropped area -Method=Bicubic -DataSpecified=0 -Width=4281 -Height=2871 - [Color Management] InputProfile=(cameraICC) BlendCMSMatrix=true @@ -193,13 +136,12 @@ HCurve=0; SCurve=0; VCurve=0; +[RGB Curves] +rCurve=0; +gCurve=0; +bCurve=0; + [RAW] -DarkFrame= -DarkFrameAuto=false -FlatFieldFile= -FlatFieldAutoSelect=false -FlatFieldBlurRadius=32 -FlatFieldBlurType=Area Flatfield CA=false CARed=0 CABlue=0 diff --git a/rtdata/profiles/BW-2.pp3 b/rtdata/profiles/BW-2.pp3 index 1ffc444c6..b22114c4a 100644 --- a/rtdata/profiles/BW-2.pp3 +++ b/rtdata/profiles/BW-2.pp3 @@ -53,6 +53,15 @@ DeconvAmount=75 DeconvDamping=20 DeconvIterations=30 +[Vibrance] +Enabled=false +Pastels=50 +Saturated=50 +PSThreshold=75 +ProtectSkins=false +AvoidColorShift=true +PastSatTog=true + [SharpenEdge] Enabled=false Passes=2 @@ -65,20 +74,10 @@ Matrix=false Strength=20 Uniformity=50 -[Color Boost] -Amount=0 -AvoidColorClipping=false -SaturationLimiter=false -SaturationLimit=75 - [White Balance] Setting=Camera -Temperature=5000 -Green=1 - -[Color Shift] -ChannelA=0 -ChannelB=0 +Temperature=5745 +Green=1.0 [Impulse Denoising] Enabled=false @@ -97,15 +96,6 @@ Gamma=2 LumCurve=0; ChromCurve=0; -[Luminance Denoising] -Enabled=false -Radius=2.5 -EdgeTolerance=1500 - -[Chrominance Denoising] -Enabled=false -Amount=20 - [Shadows & Highlights] Enabled=false HighQuality=false @@ -116,60 +106,13 @@ ShadowTonalWidth=80 LocalContrast=0 Radius=30 -[Crop] -Enabled=false -X=0 -Y=0 -W=4281 -H=2871 -FixedRatio=false -Ratio=3:2 -Orientation=Landscape -Guide=None - -[Coarse Transformation] -Rotate=0 -HorizontalFlip=false -VerticalFlip=false - [Common Properties for Transformations] AutoFill=false -[Rotation] -Degree=0 - -[Distortion] -Amount=0 -UseLensFun=false - -[Perspective] -Horizontal=0 -Vertical=0 - -[CACorrection] -Red=0 -Blue=0 - -[Vignetting Correction] -Amount=0 -Radius=50 -Strength=1 -CenterX=0 -CenterY=0 - [HLRecovery] Enabled=false Method=Blend -[Resize] -Enabled=false -Scale=1 -AppliesTo=Cropped area -Method=Bicubic -DataSpecified=0 -Width=4281 -Height=2871 - [Color Management] InputProfile=(cameraICC) BlendCMSMatrix=true @@ -193,13 +136,12 @@ HCurve=0; SCurve=0; VCurve=0; +[RGB Curves] +rCurve=0; +gCurve=0; +bCurve=0; + [RAW] -DarkFrame= -DarkFrameAuto=false -FlatFieldFile= -FlatFieldAutoSelect=false -FlatFieldBlurRadius=32 -FlatFieldBlurType=Area Flatfield CA=false CARed=0 CABlue=0 diff --git a/rtdata/profiles/BW-3.pp3 b/rtdata/profiles/BW-3.pp3 index 03130b738..e70e43ad3 100644 --- a/rtdata/profiles/BW-3.pp3 +++ b/rtdata/profiles/BW-3.pp3 @@ -53,6 +53,15 @@ DeconvAmount=75 DeconvDamping=20 DeconvIterations=30 +[Vibrance] +Enabled=false +Pastels=50 +Saturated=50 +PSThreshold=75 +ProtectSkins=false +AvoidColorShift=true +PastSatTog=true + [SharpenEdge] Enabled=false Passes=2 @@ -65,21 +74,11 @@ Matrix=false Strength=20 Uniformity=50 -[Color Boost] -Amount=0 -AvoidColorClipping=false -SaturationLimiter=false -SaturationLimit=75 - [White Balance] Setting=Camera -Temperature=5000 +Temperature=5745 Green=1.0 -[Color Shift] -ChannelA=0 -ChannelB=0 - [Impulse Denoising] Enabled=false Threshold=50 @@ -97,15 +96,6 @@ Gamma=2 LumCurve=0; ChromCurve=0; -[Luminance Denoising] -Enabled=false -Radius=2.5 -EdgeTolerance=1500 - -[Chrominance Denoising] -Enabled=false -Amount=20 - [Shadows & Highlights] Enabled=false HighQuality=false @@ -116,60 +106,13 @@ ShadowTonalWidth=80 LocalContrast=0 Radius=30 -[Crop] -Enabled=false -X=0 -Y=0 -W=4276 -H=2836 -FixedRatio=false -Ratio=3:2 -Orientation=Landscape -Guide=None - -[Coarse Transformation] -Rotate=0 -HorizontalFlip=false -VerticalFlip=false - [Common Properties for Transformations] AutoFill=false -[Rotation] -Degree=0 - -[Distortion] -Amount=0 -UseLensFun=false - -[Perspective] -Horizontal=0 -Vertical=0 - -[CACorrection] -Red=0 -Blue=0 - -[Vignetting Correction] -Amount=0 -Radius=50 -Strength=1 -CenterX=0 -CenterY=0 - [HLRecovery] Enabled=false Method=Blend -[Resize] -Enabled=false -Scale=1 -AppliesTo=Cropped area -Method=Bicubic -DataSpecified=0 -Width=4276 -Height=2836 - [Color Management] InputProfile=(cameraICC) BlendCMSMatrix=true @@ -193,13 +136,12 @@ HCurve=0; SCurve=0; VCurve=0; +[RGB Curves] +rCurve=0; +gCurve=0; +bCurve=0; + [RAW] -DarkFrame= -DarkFrameAuto=false -FlatFieldFile= -FlatFieldAutoSelect=false -FlatFieldBlurRadius=32 -FlatFieldBlurType=Area Flatfield CA=false CARed=0 CABlue=0 diff --git a/rtdata/profiles/BW-4.pp3 b/rtdata/profiles/BW-4.pp3 index 67596d667..ddd7361d0 100644 --- a/rtdata/profiles/BW-4.pp3 +++ b/rtdata/profiles/BW-4.pp3 @@ -53,6 +53,15 @@ DeconvAmount=75 DeconvDamping=20 DeconvIterations=30 +[Vibrance] +Enabled=false +Pastels=50 +Saturated=50 +PSThreshold=75 +ProtectSkins=false +AvoidColorShift=true +PastSatTog=true + [SharpenEdge] Enabled=false Passes=2 @@ -65,21 +74,11 @@ Matrix=false Strength=20 Uniformity=50 -[Color Boost] -Amount=0 -AvoidColorClipping=false -SaturationLimiter=false -SaturationLimit=75 - [White Balance] Setting=Camera -Temperature=5000 +Temperature=5745 Green=1.0 -[Color Shift] -ChannelA=0 -ChannelB=0 - [Impulse Denoising] Enabled=false Threshold=50 @@ -97,15 +96,6 @@ Gamma=2 LumCurve=0; ChromCurve=0; -[Luminance Denoising] -Enabled=false -Radius=2.5 -EdgeTolerance=1500 - -[Chrominance Denoising] -Enabled=false -Amount=20 - [Shadows & Highlights] Enabled=false HighQuality=false @@ -116,60 +106,13 @@ ShadowTonalWidth=80 LocalContrast=0 Radius=30 -[Crop] -Enabled=false -X=0 -Y=0 -W=4276 -H=2836 -FixedRatio=false -Ratio=3:2 -Orientation=Landscape -Guide=None - -[Coarse Transformation] -Rotate=0 -HorizontalFlip=false -VerticalFlip=false - [Common Properties for Transformations] AutoFill=false -[Rotation] -Degree=0 - -[Distortion] -Amount=0 -UseLensFun=false - -[Perspective] -Horizontal=0 -Vertical=0 - -[CACorrection] -Red=0 -Blue=0 - -[Vignetting Correction] -Amount=0 -Radius=50 -Strength=1 -CenterX=0 -CenterY=0 - [HLRecovery] Enabled=false Method=Blend -[Resize] -Enabled=false -Scale=1 -AppliesTo=Cropped area -Method=Bicubic -DataSpecified=0 -Width=4276 -Height=2836 - [Color Management] InputProfile=(cameraICC) BlendCMSMatrix=true @@ -193,13 +136,12 @@ HCurve=0; SCurve=0; VCurve=0; +[RGB Curves] +rCurve=0; +gCurve=0; +bCurve=0; + [RAW] -DarkFrame= -DarkFrameAuto=false -FlatFieldFile= -FlatFieldAutoSelect=false -FlatFieldBlurRadius=32 -FlatFieldBlurType=Area Flatfield CA=false CARed=0 CABlue=0 diff --git a/rtdata/profiles/Highkey-1.pp3 b/rtdata/profiles/Highkey-1.pp3 index f5a34bafc..b83d3f82f 100644 --- a/rtdata/profiles/Highkey-1.pp3 +++ b/rtdata/profiles/Highkey-1.pp3 @@ -53,6 +53,15 @@ DeconvAmount=75 DeconvDamping=20 DeconvIterations=30 +[Vibrance] +Enabled=false +Pastels=50 +Saturated=50 +PSThreshold=75 +ProtectSkins=false +AvoidColorShift=true +PastSatTog=true + [SharpenEdge] Enabled=false Passes=2 @@ -65,20 +74,10 @@ Matrix=false Strength=20 Uniformity=50 -[Color Boost] -Amount=0 -AvoidColorClipping=false -SaturationLimiter=false -SaturationLimit=75 - [White Balance] Setting=Camera -Temperature=5000 -Green=1 - -[Color Shift] -ChannelA=0 -ChannelB=0 +Temperature=5745 +Green=1.0 [Impulse Denoising] Enabled=false @@ -97,15 +96,6 @@ Gamma=2 LumCurve=0; ChromCurve=0; -[Luminance Denoising] -Enabled=false -Radius=2.5 -EdgeTolerance=1500 - -[Chrominance Denoising] -Enabled=false -Amount=20 - [Shadows & Highlights] Enabled=false HighQuality=false @@ -116,60 +106,13 @@ ShadowTonalWidth=80 LocalContrast=0 Radius=30 -[Crop] -Enabled=false -X=0 -Y=0 -W=4281 -H=2871 -FixedRatio=false -Ratio=3:2 -Orientation=Landscape -Guide=None - -[Coarse Transformation] -Rotate=0 -HorizontalFlip=false -VerticalFlip=false - [Common Properties for Transformations] AutoFill=false -[Rotation] -Degree=0 - -[Distortion] -Amount=0 -UseLensFun=false - -[Perspective] -Horizontal=0 -Vertical=0 - -[CACorrection] -Red=0 -Blue=0 - -[Vignetting Correction] -Amount=0 -Radius=50 -Strength=1 -CenterX=0 -CenterY=0 - [HLRecovery] Enabled=false Method=Blend -[Resize] -Enabled=false -Scale=1 -AppliesTo=Cropped area -Method=Bicubic -DataSpecified=0 -Width=4281 -Height=2871 - [Color Management] InputProfile=(cameraICC) BlendCMSMatrix=true @@ -193,13 +136,12 @@ HCurve=0; SCurve=0; VCurve=0; +[RGB Curves] +rCurve=0; +gCurve=0; +bCurve=0; + [RAW] -DarkFrame= -DarkFrameAuto=false -FlatFieldFile= -FlatFieldAutoSelect=false -FlatFieldBlurRadius=32 -FlatFieldBlurType=Area Flatfield CA=false CARed=0 CABlue=0 diff --git a/rtdata/profiles/Natural-1.pp3 b/rtdata/profiles/Natural-1.pp3 index 2cf6e2217..6ca2bfb7d 100644 --- a/rtdata/profiles/Natural-1.pp3 +++ b/rtdata/profiles/Natural-1.pp3 @@ -53,6 +53,15 @@ DeconvAmount=75 DeconvDamping=20 DeconvIterations=30 +[Vibrance] +Enabled=false +Pastels=50 +Saturated=50 +PSThreshold=75 +ProtectSkins=false +AvoidColorShift=true +PastSatTog=true + [SharpenEdge] Enabled=false Passes=2 @@ -65,20 +74,10 @@ Matrix=false Strength=20 Uniformity=50 -[Color Boost] -Amount=0 -AvoidColorClipping=false -SaturationLimiter=false -SaturationLimit=75 - [White Balance] Setting=Camera -Temperature=5000 -Green=1 - -[Color Shift] -ChannelA=0 -ChannelB=0 +Temperature=5745 +Green=1.0 [Impulse Denoising] Enabled=false @@ -97,15 +96,6 @@ Gamma=2 LumCurve=0; ChromCurve=0; -[Luminance Denoising] -Enabled=false -Radius=2.5 -EdgeTolerance=1500 - -[Chrominance Denoising] -Enabled=false -Amount=20 - [Shadows & Highlights] Enabled=false HighQuality=false @@ -116,60 +106,13 @@ ShadowTonalWidth=80 LocalContrast=0 Radius=30 -[Crop] -Enabled=false -X=0 -Y=0 -W=4281 -H=2871 -FixedRatio=false -Ratio=3:2 -Orientation=Landscape -Guide=None - -[Coarse Transformation] -Rotate=0 -HorizontalFlip=false -VerticalFlip=false - [Common Properties for Transformations] AutoFill=false -[Rotation] -Degree=0 - -[Distortion] -Amount=0 -UseLensFun=false - -[Perspective] -Horizontal=0 -Vertical=0 - -[CACorrection] -Red=0 -Blue=0 - -[Vignetting Correction] -Amount=0 -Radius=50 -Strength=1 -CenterX=0 -CenterY=0 - [HLRecovery] Enabled=false Method=Blend -[Resize] -Enabled=false -Scale=1 -AppliesTo=Cropped area -Method=Bicubic -DataSpecified=0 -Width=4281 -Height=2871 - [Color Management] InputProfile=(cameraICC) BlendCMSMatrix=true @@ -193,13 +136,12 @@ HCurve=0; SCurve=0; VCurve=0; +[RGB Curves] +rCurve=0; +gCurve=0; +bCurve=0; + [RAW] -DarkFrame= -DarkFrameAuto=false -FlatFieldFile= -FlatFieldAutoSelect=false -FlatFieldBlurRadius=32 -FlatFieldBlurType=Area Flatfield CA=false CARed=0 CABlue=0 diff --git a/rtdata/profiles/Natural-2.pp3 b/rtdata/profiles/Natural-2.pp3 index 004cee28e..7d7c6b93b 100644 --- a/rtdata/profiles/Natural-2.pp3 +++ b/rtdata/profiles/Natural-2.pp3 @@ -53,6 +53,15 @@ DeconvAmount=75 DeconvDamping=20 DeconvIterations=30 +[Vibrance] +Enabled=false +Pastels=50 +Saturated=50 +PSThreshold=75 +ProtectSkins=false +AvoidColorShift=true +PastSatTog=true + [SharpenEdge] Enabled=false Passes=2 @@ -65,20 +74,10 @@ Matrix=false Strength=20 Uniformity=50 -[Color Boost] -Amount=0 -AvoidColorClipping=false -SaturationLimiter=false -SaturationLimit=75 - [White Balance] Setting=Camera -Temperature=5000 -Green=1 - -[Color Shift] -ChannelA=0 -ChannelB=0 +Temperature=5745 +Green=1.0 [Impulse Denoising] Enabled=false @@ -97,15 +96,6 @@ Gamma=2 LumCurve=0; ChromCurve=0; -[Luminance Denoising] -Enabled=false -Radius=2.5 -EdgeTolerance=1500 - -[Chrominance Denoising] -Enabled=false -Amount=20 - [Shadows & Highlights] Enabled=false HighQuality=false @@ -116,60 +106,13 @@ ShadowTonalWidth=80 LocalContrast=0 Radius=30 -[Crop] -Enabled=false -X=0 -Y=0 -W=4281 -H=2871 -FixedRatio=false -Ratio=3:2 -Orientation=Landscape -Guide=None - -[Coarse Transformation] -Rotate=0 -HorizontalFlip=false -VerticalFlip=false - [Common Properties for Transformations] AutoFill=false -[Rotation] -Degree=0 - -[Distortion] -Amount=0 -UseLensFun=false - -[Perspective] -Horizontal=0 -Vertical=0 - -[CACorrection] -Red=0 -Blue=0 - -[Vignetting Correction] -Amount=0 -Radius=50 -Strength=1 -CenterX=0 -CenterY=0 - [HLRecovery] Enabled=false Method=Blend -[Resize] -Enabled=false -Scale=1 -AppliesTo=Cropped area -Method=Bicubic -DataSpecified=0 -Width=4281 -Height=2871 - [Color Management] InputProfile=(cameraICC) BlendCMSMatrix=true @@ -193,13 +136,12 @@ HCurve=0; SCurve=0; VCurve=0; +[RGB Curves] +rCurve=0; +gCurve=0; +bCurve=0; + [RAW] -DarkFrame= -DarkFrameAuto=false -FlatFieldFile= -FlatFieldAutoSelect=false -FlatFieldBlurRadius=32 -FlatFieldBlurType=Area Flatfield CA=false CARed=0 CABlue=0 diff --git a/rtdata/profiles/Punchy-1.pp3 b/rtdata/profiles/Punchy-1.pp3 index 2c0eca159..969a1cc1d 100644 --- a/rtdata/profiles/Punchy-1.pp3 +++ b/rtdata/profiles/Punchy-1.pp3 @@ -11,7 +11,7 @@ InTrash=false [Exposure] Auto=true Clip=0 -Compensation=-0 +Compensation=0.0 Brightness=0 Contrast=0 Saturation=0 @@ -74,20 +74,10 @@ Matrix=false Strength=20 Uniformity=50 -[Color Boost] -Amount=0 -AvoidColorClipping=false -SaturationLimiter=false -SaturationLimit=75 - [White Balance] Setting=Camera Temperature=5745 -Green=1.0353332844067824 - -[Color Shift] -ChannelA=0 -ChannelB=0 +Green=1.0 [Impulse Denoising] Enabled=false @@ -106,15 +96,6 @@ Gamma=2 LumCurve=0; ChromCurve=0; -[Luminance Denoising] -Enabled=false -Radius=2.5 -EdgeTolerance=1500 - -[Chrominance Denoising] -Enabled=false -Amount=20 - [Shadows & Highlights] Enabled=false HighQuality=false @@ -125,60 +106,13 @@ ShadowTonalWidth=80 LocalContrast=0 Radius=30 -[Crop] -Enabled=false -X=0 -Y=0 -W=4276 -H=2836 -FixedRatio=false -Ratio=3:2 -Orientation=Landscape -Guide=None - -[Coarse Transformation] -Rotate=0 -HorizontalFlip=false -VerticalFlip=false - [Common Properties for Transformations] AutoFill=false -[Rotation] -Degree=0 - -[Distortion] -Amount=0 -UseLensFun=false - -[Perspective] -Horizontal=0 -Vertical=0 - -[CACorrection] -Red=0 -Blue=0 - -[Vignetting Correction] -Amount=0 -Radius=50 -Strength=1 -CenterX=0 -CenterY=0 - [HLRecovery] Enabled=false Method=Blend -[Resize] -Enabled=false -Scale=1.0 -AppliesTo=Cropped area -Method=Bicubic -DataSpecified=0 -Width=4281 -Height=2871 - [Color Management] InputProfile=(cameraICC) BlendCMSMatrix=true @@ -202,13 +136,12 @@ HCurve=0; SCurve=0; VCurve=0; +[RGB Curves] +rCurve=0; +gCurve=0; +bCurve=0; + [RAW] -DarkFrame= -DarkFrameAuto=false -FlatFieldFile= -FlatFieldAutoSelect=false -FlatFieldBlurRadius=32 -FlatFieldBlurType=Area Flatfield CA=false CARed=0 CABlue=0 diff --git a/rtdata/profiles/Punchy-2.pp3 b/rtdata/profiles/Punchy-2.pp3 index 401a491ae..31256eee3 100644 --- a/rtdata/profiles/Punchy-2.pp3 +++ b/rtdata/profiles/Punchy-2.pp3 @@ -74,20 +74,10 @@ Matrix=false Strength=20 Uniformity=50 -[Color Boost] -Amount=0 -AvoidColorClipping=false -SaturationLimiter=false -SaturationLimit=75 - [White Balance] Setting=Camera Temperature=5745 -Green=1.0349999999999993 - -[Color Shift] -ChannelA=0 -ChannelB=0 +Green=1.0 [Impulse Denoising] Enabled=false @@ -106,15 +96,6 @@ Gamma=2 LumCurve=0; ChromCurve=0; -[Luminance Denoising] -Enabled=false -Radius=2.5 -EdgeTolerance=1500 - -[Chrominance Denoising] -Enabled=false -Amount=20 - [Shadows & Highlights] Enabled=false HighQuality=false @@ -125,60 +106,13 @@ ShadowTonalWidth=80 LocalContrast=0 Radius=30 -[Crop] -Enabled=false -X=0 -Y=0 -W=4276 -H=2836 -FixedRatio=false -Ratio=3:2 -Orientation=Landscape -Guide=None - -[Coarse Transformation] -Rotate=0 -HorizontalFlip=false -VerticalFlip=false - [Common Properties for Transformations] AutoFill=false -[Rotation] -Degree=0 - -[Distortion] -Amount=0 -UseLensFun=false - -[Perspective] -Horizontal=0 -Vertical=0 - -[CACorrection] -Red=0 -Blue=0 - -[Vignetting Correction] -Amount=0 -Radius=50 -Strength=1 -CenterX=0 -CenterY=0 - [HLRecovery] Enabled=false Method=Blend -[Resize] -Enabled=false -Scale=1.0 -AppliesTo=Cropped area -Method=Bicubic -DataSpecified=0 -Width=4276 -Height=2836 - [Color Management] InputProfile=(cameraICC) BlendCMSMatrix=true @@ -202,13 +136,12 @@ HCurve=0; SCurve=0; VCurve=0; +[RGB Curves] +rCurve=0; +gCurve=0; +bCurve=0; + [RAW] -DarkFrame= -DarkFrameAuto=false -FlatFieldFile= -FlatFieldAutoSelect=false -FlatFieldBlurRadius=32 -FlatFieldBlurType=Area Flatfield CA=false CARed=0 CABlue=0 diff --git a/rtdata/profiles/default-ISO-high.pp3 b/rtdata/profiles/default-ISO-high.pp3 index 3326523ad..034061cf7 100644 --- a/rtdata/profiles/default-ISO-high.pp3 +++ b/rtdata/profiles/default-ISO-high.pp3 @@ -53,6 +53,15 @@ DeconvAmount=75 DeconvDamping=20 DeconvIterations=30 +[Vibrance] +Enabled=false +Pastels=50 +Saturated=50 +PSThreshold=75 +ProtectSkins=false +AvoidColorShift=true +PastSatTog=true + [SharpenEdge] Enabled=false Passes=2 @@ -65,20 +74,10 @@ Matrix=false Strength=20 Uniformity=50 -[Color Boost] -Amount=0 -AvoidColorClipping=false -SaturationLimiter=false -SaturationLimit=75 - [White Balance] Setting=Camera -Temperature=5000 -Green=1 - -[Color Shift] -ChannelA=0 -ChannelB=0 +Temperature=5745 +Green=1.0 [Impulse Denoising] Enabled=true @@ -97,15 +96,6 @@ Gamma=1.2 LumCurve=0; ChromCurve=0; -[Luminance Denoising] -Enabled=false -Radius=2.5 -EdgeTolerance=1500 - -[Chrominance Denoising] -Enabled=false -Amount=20 - [Shadows & Highlights] Enabled=false HighQuality=false @@ -116,60 +106,13 @@ ShadowTonalWidth=80 LocalContrast=0 Radius=30 -[Crop] -Enabled=false -X=0 -Y=0 -W=4281 -H=2871 -FixedRatio=false -Ratio=3:2 -Orientation=Landscape -Guide=None - -[Coarse Transformation] -Rotate=0 -HorizontalFlip=false -VerticalFlip=false - [Common Properties for Transformations] AutoFill=false -[Rotation] -Degree=0 - -[Distortion] -Amount=0 -UseLensFun=false - -[Perspective] -Horizontal=0 -Vertical=0 - -[CACorrection] -Red=0 -Blue=0 - -[Vignetting Correction] -Amount=0 -Radius=50 -Strength=1 -CenterX=0 -CenterY=0 - [HLRecovery] Enabled=false Method=Blend -[Resize] -Enabled=false -Scale=1 -AppliesTo=Cropped area -Method=Bicubic -DataSpecified=0 -Width=4281 -Height=2871 - [Color Management] InputProfile=(cameraICC) BlendCMSMatrix=true @@ -193,13 +136,12 @@ HCurve=0; SCurve=0; VCurve=0; +[RGB Curves] +rCurve=0; +gCurve=0; +bCurve=0; + [RAW] -DarkFrame= -DarkFrameAuto=false -FlatFieldFile= -FlatFieldAutoSelect=false -FlatFieldBlurRadius=32 -FlatFieldBlurType=Area Flatfield CA=false CARed=0 CABlue=0 diff --git a/rtdata/profiles/default-ISO-medium.pp3 b/rtdata/profiles/default-ISO-medium.pp3 index 679934bd4..98ff56a44 100644 --- a/rtdata/profiles/default-ISO-medium.pp3 +++ b/rtdata/profiles/default-ISO-medium.pp3 @@ -53,6 +53,15 @@ DeconvAmount=75 DeconvDamping=20 DeconvIterations=30 +[Vibrance] +Enabled=false +Pastels=50 +Saturated=50 +PSThreshold=75 +ProtectSkins=false +AvoidColorShift=true +PastSatTog=true + [SharpenEdge] Enabled=false Passes=2 @@ -65,20 +74,10 @@ Matrix=false Strength=20 Uniformity=50 -[Color Boost] -Amount=0 -AvoidColorClipping=false -SaturationLimiter=false -SaturationLimit=75 - [White Balance] Setting=Camera -Temperature=5000 -Green=1 - -[Color Shift] -ChannelA=0 -ChannelB=0 +Temperature=5745 +Green=1.0 [Impulse Denoising] Enabled=true @@ -97,15 +96,6 @@ Gamma=1.2 LumCurve=0; ChromCurve=0; -[Luminance Denoising] -Enabled=false -Radius=2.5 -EdgeTolerance=1500 - -[Chrominance Denoising] -Enabled=false -Amount=20 - [Shadows & Highlights] Enabled=false HighQuality=false @@ -116,60 +106,13 @@ ShadowTonalWidth=80 LocalContrast=0 Radius=30 -[Crop] -Enabled=false -X=0 -Y=0 -W=4281 -H=2871 -FixedRatio=false -Ratio=3:2 -Orientation=Landscape -Guide=None - -[Coarse Transformation] -Rotate=0 -HorizontalFlip=false -VerticalFlip=false - [Common Properties for Transformations] AutoFill=false -[Rotation] -Degree=0 - -[Distortion] -Amount=0 -UseLensFun=false - -[Perspective] -Horizontal=0 -Vertical=0 - -[CACorrection] -Red=0 -Blue=0 - -[Vignetting Correction] -Amount=0 -Radius=50 -Strength=1 -CenterX=0 -CenterY=0 - [HLRecovery] Enabled=false Method=Blend -[Resize] -Enabled=false -Scale=1 -AppliesTo=Cropped area -Method=Bicubic -DataSpecified=0 -Width=4281 -Height=2871 - [Color Management] InputProfile=(cameraICC) BlendCMSMatrix=true @@ -193,13 +136,12 @@ HCurve=0; SCurve=0; VCurve=0; +[RGB Curves] +rCurve=0; +gCurve=0; +bCurve=0; + [RAW] -DarkFrame= -DarkFrameAuto=false -FlatFieldFile= -FlatFieldAutoSelect=false -FlatFieldBlurRadius=32 -FlatFieldBlurType=Area Flatfield CA=false CARed=0 CABlue=0 diff --git a/rtdata/profiles/default.pp3 b/rtdata/profiles/default.pp3 index 52122c976..58955be74 100644 --- a/rtdata/profiles/default.pp3 +++ b/rtdata/profiles/default.pp3 @@ -53,6 +53,15 @@ DeconvAmount=75 DeconvDamping=20 DeconvIterations=30 +[Vibrance] +Enabled=false +Pastels=50 +Saturated=50 +PSThreshold=75 +ProtectSkins=false +AvoidColorShift=true +PastSatTog=true + [SharpenEdge] Enabled=false Passes=2 @@ -65,20 +74,10 @@ Matrix=false Strength=20 Uniformity=50 -[Color Boost] -Amount=0 -AvoidColorClipping=false -SaturationLimiter=false -SaturationLimit=75 - [White Balance] Setting=Camera -Temperature=5000 -Green=1 - -[Color Shift] -ChannelA=0 -ChannelB=0 +Temperature=5745 +Green=1.0 [Impulse Denoising] Enabled=false @@ -97,15 +96,6 @@ Gamma=2 LumCurve=0; ChromCurve=0; -[Luminance Denoising] -Enabled=false -Radius=2.5 -EdgeTolerance=1500 - -[Chrominance Denoising] -Enabled=false -Amount=20 - [Shadows & Highlights] Enabled=false HighQuality=false @@ -116,60 +106,13 @@ ShadowTonalWidth=80 LocalContrast=0 Radius=30 -[Crop] -Enabled=false -X=0 -Y=0 -W=4281 -H=2871 -FixedRatio=false -Ratio=3:2 -Orientation=Landscape -Guide=None - -[Coarse Transformation] -Rotate=0 -HorizontalFlip=false -VerticalFlip=false - [Common Properties for Transformations] AutoFill=false -[Rotation] -Degree=0 - -[Distortion] -Amount=0 -UseLensFun=false - -[Perspective] -Horizontal=0 -Vertical=0 - -[CACorrection] -Red=0 -Blue=0 - -[Vignetting Correction] -Amount=0 -Radius=50 -Strength=1 -CenterX=0 -CenterY=0 - [HLRecovery] Enabled=false Method=Blend -[Resize] -Enabled=false -Scale=1 -AppliesTo=Cropped area -Method=Bicubic -DataSpecified=0 -Width=4281 -Height=2871 - [Color Management] InputProfile=(cameraICC) BlendCMSMatrix=true @@ -193,13 +136,12 @@ HCurve=0; SCurve=0; VCurve=0; +[RGB Curves] +rCurve=0; +gCurve=0; +bCurve=0; + [RAW] -DarkFrame= -DarkFrameAuto=false -FlatFieldFile= -FlatFieldAutoSelect=false -FlatFieldBlurRadius=32 -FlatFieldBlurType=Area Flatfield CA=false CARed=0 CABlue=0 diff --git a/rtdata/profiles/full neutral.pp3 b/rtdata/profiles/full neutral.pp3 new file mode 100644 index 000000000..34b482458 --- /dev/null +++ b/rtdata/profiles/full neutral.pp3 @@ -0,0 +1,216 @@ + +[Version] +AppVersion=4.0.6 +Version=301 + +[General] +Rank=0 +ColorLabel=0 +InTrash=false + +[Exposure] +Auto=false +Clip=0.0000 +Compensation=0 +Brightness=0 +Contrast=0 +Saturation=0 +Black=0 +HighlightCompr=0 +HighlightComprThreshold=0 +ShadowCompr=0 +Curve=0; + +[Channel Mixer] +Red=100;0;0; +Green=0;100;0; +Blue=0;0;100; + +[Luminance Curve] +Brightness=0 +Contrast=0 +Saturation=0 +AvoidColorClipping=false +SaturationLimiter=false +SaturationLimit=50 +LCurve=0; +aCurve=0; +bCurve=0; + +[Sharpening] +Enabled=false +Method=usm +Radius=0.5 +Amount=125 +Threshold=512 +OnlyEdges=false +EdgedetectionRadius=1.9 +EdgeTolerance=1800 +HalocontrolEnabled=false +HalocontrolAmount=85 +DeconvRadius=0.75 +DeconvAmount=75 +DeconvDamping=20 +DeconvIterations=30 + +[Vibrance] +Enabled=false +Pastels=50 +Saturated=50 +PSThreshold=75 +ProtectSkins=false +AvoidColorShift=true +PastSatTog=true + +[SharpenEdge] +Enabled=false +Passes=2 +Strength=50 +ThreeChannels=false + +[SharpenMicro] +Enabled=false +Matrix=false +Strength=20 +Uniformity=50 + +[White Balance] +Setting=Camera +Temperature=5745 +Green=1.0 + +[Impulse Denoising] +Enabled=false +Threshold=50 + +[Defringing] +Enabled=false +Radius=2.0 +Threshold=25 + +[Directional Pyramid Denoising] +Enabled=false +Luma=5 +Chroma=5 +Gamma=2 +LumCurve=0; +ChromCurve=0; + +[Shadows & Highlights] +Enabled=false +HighQuality=false +Highlights=10 +HighlightTonalWidth=80 +Shadows=10 +ShadowTonalWidth=80 +LocalContrast=0 +Radius=30 + +[Crop] +Enabled=false +X=0 +Y=0 +W=4276 +H=2836 +FixedRatio=false +Ratio=3:2 +Orientation=Landscape +Guide=None + +[Coarse Transformation] +Rotate=0 +HorizontalFlip=false +VerticalFlip=false + +[Common Properties for Transformations] +AutoFill=false + +[Rotation] +Degree=0 + +[Distortion] +Amount=0 +UseLensFun=false + +[Perspective] +Horizontal=0 +Vertical=0 + +[CACorrection] +Red=0 +Blue=0 + +[Vignetting Correction] +Amount=0 +Radius=50 +Strength=1 +CenterX=0 +CenterY=0 + +[HLRecovery] +Enabled=false +Method=Blend + +[Resize] +Enabled=false +Scale=1 +AppliesTo=Cropped area +Method=Bicubic +DataSpecified=0 +Width=4276 +Height=2836 + +[Color Management] +InputProfile=(cameraICC) +BlendCMSMatrix=true +WorkingProfile=sRGB +OutputProfile=RT_sRGB +Gammafree=default +Freegamma=false +GammaValue=2.22 +GammaSlope=4.5 + +[Directional Pyramid Equalizer] +Enabled=false +Mult0=1 +Mult1=1 +Mult2=1 +Mult3=1 +Mult4=0.2 + +[HSV Equalizer] +HCurve=0; +SCurve=0; +VCurve=0; + +[RGB Curves] +rCurve=0; +gCurve=0; +bCurve=0; + +[RAW] +DarkFrame= +DarkFrameAuto=false +FlatFieldFile= +FlatFieldAutoSelect=false +FlatFieldBlurRadius=32 +FlatFieldBlurType=Area Flatfield +CA=false +CARed=0 +CABlue=0 +HotDeadPixels=false +HotDeadPixelThresh=40 +LineDenoise=0 +GreenEqThreshold=0 +CcSteps=1 +Method=amaze +DCBIterations=2 +DCBEnhance=false +ALLEnhance=false +PreExposure=1 +PrePreserv=0 +PreBlackzero=0 +PreBlackone=0 +PreBlacktwo=0 +PreBlackthree=0 +PreTwoGreen=true diff --git a/rtdata/profiles/neutral.pp3 b/rtdata/profiles/neutral.pp3 index 8b8250f65..53c4e6f34 100644 --- a/rtdata/profiles/neutral.pp3 +++ b/rtdata/profiles/neutral.pp3 @@ -53,6 +53,15 @@ DeconvAmount=75 DeconvDamping=20 DeconvIterations=30 +[Vibrance] +Enabled=false +Pastels=50 +Saturated=50 +PSThreshold=75 +ProtectSkins=false +AvoidColorShift=true +PastSatTog=true + [SharpenEdge] Enabled=false Passes=2 @@ -65,20 +74,10 @@ Matrix=false Strength=20 Uniformity=50 -[Color Boost] -Amount=0 -AvoidColorClipping=false -SaturationLimiter=false -SaturationLimit=75 - [White Balance] Setting=Camera -Temperature=5200 -Green=1 - -[Color Shift] -ChannelA=0 -ChannelB=0 +Temperature=5745 +Green=1.0 [Impulse Denoising] Enabled=false @@ -86,7 +85,7 @@ Threshold=50 [Defringing] Enabled=false -Radius=2 +Radius=2.0 Threshold=25 [Directional Pyramid Denoising] @@ -97,15 +96,6 @@ Gamma=2 LumCurve=0; ChromCurve=0; -[Luminance Denoising] -Enabled=false -Radius=2.5 -EdgeTolerance=1500 - -[Chrominance Denoising] -Enabled=false -Amount=20 - [Shadows & Highlights] Enabled=false HighQuality=false @@ -116,69 +106,22 @@ ShadowTonalWidth=80 LocalContrast=0 Radius=30 -[Crop] -Enabled=false -X=0 -Y=0 -W=4276 -H=2836 -FixedRatio=false -Ratio=3:2 -Orientation=Landscape -Guide=None - -[Coarse Transformation] -Rotate=0 -HorizontalFlip=false -VerticalFlip=false - [Common Properties for Transformations] AutoFill=false -[Rotation] -Degree=0 - -[Distortion] -Amount=0 -UseLensFun=false - -[Perspective] -Horizontal=0 -Vertical=0 - -[CACorrection] -Red=0 -Blue=0 - -[Vignetting Correction] -Amount=0 -Radius=50 -Strength=1 -CenterX=0 -CenterY=0 - [HLRecovery] Enabled=false Method=Blend -[Resize] -Enabled=false -Scale=1 -AppliesTo=Cropped area -Method=Bicubic -DataSpecified=0 -Width=4276 -Height=2836 - [Color Management] -InputProfile=(cameraICC) -BlendCMSMatrix=true -WorkingProfile=sRGB -OutputProfile=RT_sRGB +InputProfile=(cameraICC) +BlendCMSMatrix=true +WorkingProfile=sRGB +OutputProfile=RT_sRGB Gammafree=default Freegamma=false -GammaValue=2.22 -GammaSlope=4.5 +GammaValue=2.22 +GammaSlope=4.5 [Directional Pyramid Equalizer] Enabled=false @@ -193,13 +136,12 @@ HCurve=0; SCurve=0; VCurve=0; +[RGB Curves] +rCurve=0; +gCurve=0; +bCurve=0; + [RAW] -DarkFrame= -DarkFrameAuto=false -FlatFieldFile= -FlatFieldAutoSelect=false -FlatFieldBlurRadius=32 -FlatFieldBlurType=Area Flatfield CA=false CARed=0 CABlue=0 diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index 733c28354..508df3a80 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -277,9 +277,9 @@ ImageData::~ImageData () { iptc_data_free (iptc); } -const std::vector ImageData::getIPTCData () const { +const procparams::IPTCPairs ImageData::getIPTCData () const { - std::vector iptcc; + procparams::IPTCPairs iptcc; if (!iptc) return iptcc; @@ -288,31 +288,28 @@ const std::vector ImageData::getIPTCData () const { IptcDataSet* ds = iptc_data_get_next_dataset (iptc, NULL, IPTC_RECORD_APP_2, strTags[i].tag); if (ds) { iptc_dataset_get_data (ds, buffer, 2100); - procparams::IPTCPair ic; - ic.field = strTags[i].field; - ic.values.push_back (safe_locale_to_utf8((char*)buffer)); + std::vector icValues; + icValues.push_back (safe_locale_to_utf8((char*)buffer)); - iptcc.push_back (ic); + iptcc[strTags[i].field] = icValues; iptc_dataset_unref (ds); } } IptcDataSet* ds = NULL; - procparams::IPTCPair ickw; - ickw.field = "Keywords"; + std::vector keywords; while ((ds=iptc_data_get_next_dataset (iptc, ds, IPTC_RECORD_APP_2, IPTC_TAG_KEYWORDS))) { iptc_dataset_get_data (ds, buffer, 2100); - ickw.values.push_back (safe_locale_to_utf8((char*)buffer)); + keywords.push_back (safe_locale_to_utf8((char*)buffer)); } - iptcc.push_back (ickw); + iptcc["Keywords"] = keywords; ds = NULL; - procparams::IPTCPair icsc; - icsc.field = "SupplementalCategories"; + std::vector suppCategories; while ((ds=iptc_data_get_next_dataset (iptc, ds, IPTC_RECORD_APP_2, IPTC_TAG_SUPPL_CATEGORY))) { iptc_dataset_get_data (ds, buffer, 2100); - icsc.values.push_back (safe_locale_to_utf8((char*)buffer)); + suppCategories.push_back (safe_locale_to_utf8((char*)buffer)); iptc_dataset_unref (ds); } - iptcc.push_back (icsc); + iptcc["SupplementalCategories"] = suppCategories; return iptcc; } diff --git a/rtengine/imagedata.h b/rtengine/imagedata.h index 9cfd7039d..f6f127ad5 100644 --- a/rtengine/imagedata.h +++ b/rtengine/imagedata.h @@ -55,7 +55,7 @@ class ImageData : public ImageMetaData { virtual ~ImageData (); const rtexif::TagDirectory* getExifData () const { return root; } - const std::vector getIPTCData () const; + const procparams::IPTCPairs getIPTCData () const; bool hasExif () const { return root && root->getCount(); } bool hasIPTC () const { return iptc; } diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index df012bca7..440faede1 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -61,14 +61,17 @@ void ImageIO::setMetadata (const rtexif::TagDirectory* eroot) { } // For merging with RT specific data -void ImageIO::setMetadata (const rtexif::TagDirectory* eroot, const std::vector& exif, const std::vector& iptcc) { +void ImageIO::setMetadata (const rtexif::TagDirectory* eroot, const rtengine::procparams::ExifPairs& exif, const rtengine::procparams::IPTCPairs& iptcc) { // store exif info - exifChange.resize (exif.size()); - for (int i=0; ifirst; + exifChange.at(j).second = i->second; + j++; + }*/ if (exifRoot!=NULL) { delete exifRoot; exifRoot = NULL; } @@ -82,23 +85,23 @@ void ImageIO::setMetadata (const rtexif::TagDirectory* eroot, const std::vector< return; iptc = iptc_data_new (); - for (int i=0; ifirst == "Keywords" && !(i->second.empty())) { + for (unsigned int j=0; jsecond.size(); j++) { IptcDataSet * ds = iptc_dataset_new (); iptc_dataset_set_tag (ds, IPTC_RECORD_APP_2, IPTC_TAG_KEYWORDS); - std::string loc = safe_locale_to_utf8(iptcc[i].values[j]); + std::string loc = safe_locale_to_utf8(i->second.at(j)); iptc_dataset_set_data (ds, (unsigned char*)loc.c_str(), MIN(64,loc.size()), IPTC_DONT_VALIDATE); iptc_data_add_dataset (iptc, ds); iptc_dataset_unref (ds); } continue; } - else if (iptcc[i].field == "SupplementalCategories" && !(iptcc[i].values.empty())) { - for (int j=0; jfirst == "SupplementalCategories" && !(i->second.empty())) { + for (unsigned int j=0; jsecond.size(); j++) { IptcDataSet * ds = iptc_dataset_new (); iptc_dataset_set_tag (ds, IPTC_RECORD_APP_2, IPTC_TAG_SUPPL_CATEGORY); - std::string loc = safe_locale_to_utf8(iptcc[i].values[j]); + std::string loc = safe_locale_to_utf8(i->second.at(j)); iptc_dataset_set_data (ds, (unsigned char*)loc.c_str(), MIN(32,loc.size()), IPTC_DONT_VALIDATE); iptc_data_add_dataset (iptc, ds); iptc_dataset_unref (ds); @@ -106,10 +109,10 @@ void ImageIO::setMetadata (const rtexif::TagDirectory* eroot, const std::vector< continue; } for (int j=0; j<16; j++) - if (iptcc[i].field == strTags[j].field && !(iptcc[i].values.empty())) { + if (i->first == strTags[j].field && !(i->second.empty())) { IptcDataSet * ds = iptc_dataset_new (); iptc_dataset_set_tag (ds, IPTC_RECORD_APP_2, strTags[j].tag); - std::string loc = safe_locale_to_utf8(iptcc[i].values[0]); + std::string loc = safe_locale_to_utf8(i->second.at(0)); iptc_dataset_set_data (ds, (unsigned char*)loc.c_str(), MIN(strTags[j].size,loc.size()), IPTC_DONT_VALIDATE); iptc_data_add_dataset (iptc, ds); iptc_dataset_unref (ds); @@ -243,7 +246,7 @@ int ImageIO::loadPNG (Glib::ustring fname) { png_read_row (png, (png_byte*)row, NULL); if (bit_depth==16) { // convert scanline to host byte order unsigned short* srow = (unsigned short*)row; - for (int j=0; j > exifChange; + procparams::ExifPairs exifChange; IptcData* iptc; const rtexif::TagDirectory* exifRoot; Glib::Mutex imutex; public: static Glib::ustring errorMsg[6]; - + ImageIO () : pl (NULL), embProfile(NULL), profileData(NULL), loadedProfileData(NULL), loadedProfileLength(0), iptc(NULL), exifRoot (NULL) {} - + virtual ~ImageIO (); void setProgressListener (ProgressListener* l) { pl = l; } virtual int getW () =0; - virtual int getH () =0; - virtual void allocate (int width, int height) =0; + virtual int getH () =0; + virtual void allocate (int width, int height) =0; virtual int getBPS () =0; virtual void getScanline (int row, unsigned char* buffer, int bps) {} virtual void setScanline (int row, unsigned char* buffer, int bps) {} @@ -78,12 +78,12 @@ class ImageIO { int savePNG (Glib::ustring fname, int compression = -1, volatile int bps = -1); int saveJPEG (Glib::ustring fname, int quality = 100); int saveTIFF (Glib::ustring fname, int bps = -1, bool uncompressed = false); - + cmsHPROFILE getEmbeddedProfile () { return embProfile; } void getEmbeddedProfileData (int& length, unsigned char*& pdata) { length = loadedProfileLength; pdata = (unsigned char*)loadedProfileData; } - void setMetadata (const rtexif::TagDirectory* eroot); - void setMetadata (const rtexif::TagDirectory* eroot, const std::vector& exif, const std::vector& iptcc); + void setMetadata (const rtexif::TagDirectory* eroot); + void setMetadata (const rtexif::TagDirectory* eroot, const rtengine::procparams::ExifPairs& exif, const rtengine::procparams::IPTCPairs& iptcc); void setOutputProfile (char* pdata, int plen); Glib::Mutex& mutex () { return imutex; } }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 95bec374b..969c4796f 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -30,6 +30,7 @@ #include "safekeyfile.h" #include "rawimage.h" #include "../rtgui/ppversion.h" +#include "../rtgui/paramsedited.h" #define APPVERSION VERSION @@ -186,31 +187,30 @@ void ProcParams::setDefaults () { vibrance.protectskins = false; vibrance.avoidcolorshift = true; vibrance.pastsattog = true; - - colorBoost.amount = 0; - colorBoost.avoidclip = false; - colorBoost.enable_saturationlimiter = false; - colorBoost.saturationlimit = 50; - + + //colorBoost.amount = 0; + //colorBoost.avoidclip = false; + //colorBoost.enable_saturationlimiter = false; + //colorBoost.saturationlimit = 50; + wb.method = "Camera"; wb.temperature = 6504; wb.green = 1.0; - - colorShift.a = 0; - colorShift.b = 0; - - lumaDenoise.enabled = false; - lumaDenoise.radius = 1.9; - lumaDenoise.edgetolerance = 2000; - - colorDenoise.enabled = false; - colorDenoise.edgesensitive = false; - colorDenoise.radius = 1.9; - colorDenoise.edgetolerance = 2000; - + + //colorShift.a = 0; + //colorShift.b = 0; + + //lumaDenoise.enabled = false; + //lumaDenoise.radius = 1.9; + //lumaDenoise.edgetolerance = 2000; + + //colorDenoise.enabled = false; + //colorDenoise.edgesensitive = false; + //colorDenoise.edgetolerance = 2000; + impulseDenoise.enabled = false; impulseDenoise.thresh = 50; - + defringe.enabled = false; defringe.radius = 2.0; defringe.threshold = 25; @@ -219,16 +219,12 @@ void ProcParams::setDefaults () { dirpyrDenoise.luma = 10; dirpyrDenoise.chroma = 10; dirpyrDenoise.gamma = 2.0; - dirpyrDenoise.lumcurve.clear (); - dirpyrDenoise.lumcurve.push_back (DCT_Linear); - dirpyrDenoise.chromcurve.clear (); - dirpyrDenoise.chromcurve.push_back (DCT_Linear); - - edgePreservingDecompositionUI.enabled = false; - edgePreservingDecompositionUI.Strength = 0.25; - edgePreservingDecompositionUI.EdgeStopping = 1.4; - edgePreservingDecompositionUI.Scale = 1.0; - edgePreservingDecompositionUI.ReweightingIterates = 0; + + edgePreservingDecompositionUI.enabled = false; + edgePreservingDecompositionUI.Strength = 0.25; + edgePreservingDecompositionUI.EdgeStopping = 1.4; + edgePreservingDecompositionUI.Scale = 1.0; + edgePreservingDecompositionUI.ReweightingIterates = 0; sh.enabled = false; sh.hq = false; @@ -349,7 +345,7 @@ void ProcParams::setDefaults () { ppVersion = PPVERSION; } -int ProcParams::save (Glib::ustring fname, Glib::ustring fname2) const { +int ProcParams::save (Glib::ustring fname, Glib::ustring fname2, ParamsEdited* pedited) const { if (!fname.length() && !fname2.length()) return 0; @@ -359,270 +355,301 @@ int ProcParams::save (Glib::ustring fname, Glib::ustring fname2) const { keyFile.set_string ("Version", "AppVersion", APPVERSION); keyFile.set_integer ("Version", "Version", PPVERSION); - keyFile.set_integer ("General", "Rank", rank); - keyFile.set_integer ("General", "ColorLabel", colorlabel); - keyFile.set_boolean ("General", "InTrash", inTrash); + 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 tonecurve: - keyFile.set_boolean ("Exposure", "Auto", toneCurve.autoexp); - keyFile.set_double ("Exposure", "Clip", toneCurve.clip); - keyFile.set_double ("Exposure", "Compensation", toneCurve.expcomp); - keyFile.set_integer ("Exposure", "Brightness", toneCurve.brightness); - keyFile.set_integer ("Exposure", "Contrast", toneCurve.contrast); - keyFile.set_integer ("Exposure", "Saturation", toneCurve.saturation); - keyFile.set_integer ("Exposure", "Black", toneCurve.black); - keyFile.set_integer ("Exposure", "HighlightCompr", toneCurve.hlcompr); - keyFile.set_integer ("Exposure", "HighlightComprThreshold", toneCurve.hlcomprthresh); - keyFile.set_integer ("Exposure", "ShadowCompr", toneCurve.shcompr); - Glib::ArrayHandle tcurve = toneCurve.curve; - keyFile.set_double_list("Exposure", "Curve", tcurve); + 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); + if (!pedited || pedited->toneCurve.curve) { + Glib::ArrayHandle tcurve = toneCurve.curve; + keyFile.set_double_list("Exposure", "Curve", tcurve); + } // save channel mixer - Glib::ArrayHandle rmix (chmixer.red, 3, Glib::OWNERSHIP_NONE); - Glib::ArrayHandle gmix (chmixer.green, 3, Glib::OWNERSHIP_NONE); - Glib::ArrayHandle bmix (chmixer.blue, 3, Glib::OWNERSHIP_NONE); - keyFile.set_integer_list("Channel Mixer", "Red", rmix); - keyFile.set_integer_list("Channel Mixer", "Green", gmix); - keyFile.set_integer_list("Channel Mixer", "Blue", bmix); + 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); + } + if (!pedited || pedited->chmixer.green[0] || pedited->chmixer.green[1] || pedited->chmixer.green[2]) { + Glib::ArrayHandle gmix (chmixer.green, 3, Glib::OWNERSHIP_NONE); + keyFile.set_integer_list("Channel Mixer", "Green", gmix); + } + if (!pedited || pedited->chmixer.blue[0] || pedited->chmixer.blue[1] || pedited->chmixer.blue[2]) { + Glib::ArrayHandle bmix (chmixer.blue, 3, Glib::OWNERSHIP_NONE); + keyFile.set_integer_list("Channel Mixer", "Blue", bmix); + } // save luma curve - keyFile.set_integer ("Luminance Curve", "Brightness", labCurve.brightness); - keyFile.set_integer ("Luminance Curve", "Contrast", labCurve.contrast); - keyFile.set_integer ("Luminance Curve", "Saturation", labCurve.saturation); - keyFile.set_boolean ("Luminance Curve", "AvoidColorClipping", labCurve.avoidclip); - keyFile.set_boolean ("Luminance Curve", "SaturationLimiter", labCurve.enable_saturationlimiter); - keyFile.set_double ("Luminance Curve", "SaturationLimit", labCurve.saturationlimit); - Glib::ArrayHandle lcurve = labCurve.lcurve; - Glib::ArrayHandle acurve = labCurve.acurve; - Glib::ArrayHandle bcurve = labCurve.bcurve; - keyFile.set_double_list("Luminance Curve", "LCurve", lcurve); - keyFile.set_double_list("Luminance Curve", "aCurve", acurve); - keyFile.set_double_list("Luminance Curve", "bCurve", bcurve); + 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.saturation) keyFile.set_integer ("Luminance Curve", "Saturation", labCurve.saturation); + if (!pedited || pedited->labCurve.avoidclip) keyFile.set_boolean ("Luminance Curve", "AvoidColorClipping", labCurve.avoidclip); + if (!pedited || pedited->labCurve.enable_saturationlimiter) keyFile.set_boolean ("Luminance Curve", "SaturationLimiter", labCurve.enable_saturationlimiter); + if (!pedited || pedited->labCurve.saturationlimit) keyFile.set_double ("Luminance Curve", "SaturationLimit", labCurve.saturationlimit); + 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); + } // save sharpening - keyFile.set_boolean ("Sharpening", "Enabled", sharpening.enabled); - keyFile.set_string ("Sharpening", "Method", sharpening.method); - keyFile.set_double ("Sharpening", "Radius", sharpening.radius); - keyFile.set_integer ("Sharpening", "Amount", sharpening.amount); - keyFile.set_integer ("Sharpening", "Threshold", sharpening.threshold); - keyFile.set_boolean ("Sharpening", "OnlyEdges", sharpening.edgesonly); - keyFile.set_double ("Sharpening", "EdgedetectionRadius", sharpening.edges_radius); - keyFile.set_integer ("Sharpening", "EdgeTolerance", sharpening.edges_tolerance); - keyFile.set_boolean ("Sharpening", "HalocontrolEnabled", sharpening.halocontrol); - keyFile.set_integer ("Sharpening", "HalocontrolAmount", sharpening.halocontrol_amount); - keyFile.set_double ("Sharpening", "DeconvRadius", sharpening.deconvradius); - keyFile.set_integer ("Sharpening", "DeconvAmount", sharpening.deconvamount); - keyFile.set_integer ("Sharpening", "DeconvDamping", sharpening.deconvdamping); - keyFile.set_integer ("Sharpening", "DeconvIterations", sharpening.deconviter); + 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) keyFile.set_integer ("Sharpening", "Threshold", sharpening.threshold); + 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 - keyFile.set_boolean ("Vibrance", "Enabled", vibrance.enabled); - keyFile.set_integer ("Vibrance", "Pastels", vibrance.pastels); - keyFile.set_integer ("Vibrance", "Saturated", vibrance.saturated); - keyFile.set_integer ("Vibrance", "PSThreshold", vibrance.psthreshold); - keyFile.set_boolean ("Vibrance", "ProtectSkins", vibrance.protectskins); - keyFile.set_boolean ("Vibrance", "AvoidColorShift", vibrance.avoidcolorshift); - keyFile.set_boolean ("Vibrance", "PastSatTog", vibrance.pastsattog); + 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) keyFile.set_integer ("Vibrance", "PSThreshold", vibrance.psthreshold); + 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); //save edge sharpening - keyFile.set_boolean ("SharpenEdge", "Enabled", sharpenEdge.enabled); - keyFile.set_integer ("SharpenEdge", "Passes", sharpenEdge.passes); - keyFile.set_double ("SharpenEdge", "Strength", sharpenEdge.amount); - keyFile.set_boolean ("SharpenEdge", "ThreeChannels", sharpenEdge.threechannels); + 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 - keyFile.set_boolean ("SharpenMicro", "Enabled", sharpenMicro.enabled); - keyFile.set_boolean ("SharpenMicro", "Matrix", sharpenMicro.matrix); - keyFile.set_double ("SharpenMicro", "Strength", sharpenMicro.amount); - keyFile.set_double ("SharpenMicro", "Uniformity", sharpenMicro.uniformity); + 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 - keyFile.set_integer ("Color Boost", "Amount", colorBoost.amount); - keyFile.set_boolean ("Color Boost", "AvoidColorClipping", colorBoost.avoidclip); - keyFile.set_boolean ("Color Boost", "SaturationLimiter", colorBoost.enable_saturationlimiter); - keyFile.set_double ("Color Boost", "SaturationLimit", colorBoost.saturationlimit); + 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 - keyFile.set_string ("White Balance", "Setting", wb.method); - keyFile.set_integer ("White Balance", "Temperature", wb.temperature); - keyFile.set_double ("White Balance", "Green", wb.green); - + 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); + +/* // save colorShift - keyFile.set_double ("Color Shift", "ChannelA", colorShift.a); - keyFile.set_double ("Color Shift", "ChannelB", colorShift.b); - - // save impulseDenoise - keyFile.set_boolean ("Impulse Denoising", "Enabled", impulseDenoise.enabled); - keyFile.set_integer ("Impulse Denoising", "Threshold", impulseDenoise.thresh); + 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 defringe - keyFile.set_boolean ("Defringing", "Enabled", defringe.enabled); - keyFile.set_double ("Defringing", "Radius", defringe.radius); - keyFile.set_integer ("Defringing", "Threshold", defringe.threshold); - - // save dirpyrDenoise - keyFile.set_boolean ("Directional Pyramid Denoising", "Enabled", dirpyrDenoise.enabled); - keyFile.set_integer ("Directional Pyramid Denoising", "Luma", dirpyrDenoise.luma); - keyFile.set_integer ("Directional Pyramid Denoising", "Chroma", dirpyrDenoise.chroma); - keyFile.set_double ("Directional Pyramid Denoising", "Gamma", dirpyrDenoise.gamma); - Glib::ArrayHandle lumcurve = dirpyrDenoise.lumcurve; - Glib::ArrayHandle chromcurve = dirpyrDenoise.chromcurve; - keyFile.set_double_list("Directional Pyramid Denoising", "LumCurve", lumcurve); - keyFile.set_double_list("Directional Pyramid Denoising", "ChromCurve", chromcurve); + // 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 edgePreservingDecompositionUI. - keyFile.set_boolean ("EPD", "Enabled", edgePreservingDecompositionUI.enabled); - keyFile.set_double ("EPD", "Strength", edgePreservingDecompositionUI.Strength); - keyFile.set_double ("EPD", "EdgeStopping", edgePreservingDecompositionUI.EdgeStopping); - keyFile.set_double ("EPD", "Scale", edgePreservingDecompositionUI.Scale); - keyFile.set_integer ("EPD", "ReweightingIterates", edgePreservingDecompositionUI.ReweightingIterates); + // 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); + // save dirpyrDenoise + if (!pedited || pedited->dirpyrDenoise.enabled) keyFile.set_boolean ("Directional Pyramid Denoising", "Enabled", dirpyrDenoise.enabled); + if (!pedited || pedited->dirpyrDenoise.luma) keyFile.set_integer ("Directional Pyramid Denoising", "Luma", dirpyrDenoise.luma); + if (!pedited || pedited->dirpyrDenoise.chroma) keyFile.set_integer ("Directional Pyramid Denoising", "Chroma", dirpyrDenoise.chroma); + if (!pedited || pedited->dirpyrDenoise.gamma) keyFile.set_double ("Directional Pyramid Denoising", "Gamma", dirpyrDenoise.gamma); + + //Save edgePreservingDecompositionUI. + if (!pedited || pedited->edgePreservingDecompositionUI.enabled) keyFile.set_boolean ("EPD", "Enabled", edgePreservingDecompositionUI.enabled); + if (!pedited || pedited->edgePreservingDecompositionUI.Strength) keyFile.set_double ("EPD", "Strength", edgePreservingDecompositionUI.Strength); + if (!pedited || pedited->edgePreservingDecompositionUI.EdgeStopping) keyFile.set_double ("EPD", "EdgeStopping", edgePreservingDecompositionUI.EdgeStopping); + if (!pedited || pedited->edgePreservingDecompositionUI.Scale) keyFile.set_double ("EPD", "Scale", edgePreservingDecompositionUI.Scale); + if (!pedited || pedited->edgePreservingDecompositionUI.ReweightingIterates) keyFile.set_integer ("EPD", "ReweightingIterates", edgePreservingDecompositionUI.ReweightingIterates); + +/* // save lumaDenoise - keyFile.set_boolean ("Luminance Denoising", "Enabled", lumaDenoise.enabled); - keyFile.set_double ("Luminance Denoising", "Radius", lumaDenoise.radius); - keyFile.set_integer ("Luminance Denoising", "EdgeTolerance", lumaDenoise.edgetolerance); + 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 - keyFile.set_boolean ("Chrominance Denoising", "Enabled", colorDenoise.enabled); - keyFile.set_integer ("Chrominance Denoising", "Amount", colorDenoise.amount); + //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 - keyFile.set_boolean ("Shadows & Highlights", "Enabled", sh.enabled); - keyFile.set_boolean ("Shadows & Highlights", "HighQuality", sh.hq); - keyFile.set_integer ("Shadows & Highlights", "Highlights", sh.highlights); - keyFile.set_integer ("Shadows & Highlights", "HighlightTonalWidth", sh.htonalwidth); - keyFile.set_integer ("Shadows & Highlights", "Shadows", sh.shadows); - keyFile.set_integer ("Shadows & Highlights", "ShadowTonalWidth", sh.stonalwidth); - keyFile.set_integer ("Shadows & Highlights", "LocalContrast", sh.localcontrast); - keyFile.set_integer ("Shadows & Highlights", "Radius", sh.radius); + 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 - keyFile.set_boolean ("Crop", "Enabled", crop.enabled); - keyFile.set_integer ("Crop", "X", crop.x); - keyFile.set_integer ("Crop", "Y", crop.y); - keyFile.set_integer ("Crop", "W", crop.w); - keyFile.set_integer ("Crop", "H", crop.h); - keyFile.set_boolean ("Crop", "FixedRatio", crop.fixratio); - keyFile.set_string ("Crop", "Ratio", crop.ratio); - keyFile.set_string ("Crop", "Orientation", crop.orientation); - keyFile.set_string ("Crop", "Guide", crop.guide); + 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 - keyFile.set_integer ("Coarse Transformation", "Rotate", coarse.rotate); - keyFile.set_boolean ("Coarse Transformation", "HorizontalFlip", coarse.hflip); - keyFile.set_boolean ("Coarse Transformation", "VerticalFlip", coarse.vflip); + 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 - keyFile.set_boolean ("Common Properties for Transformations", "AutoFill", commonTrans.autofill); + if (!pedited || pedited->commonTrans.autofill) keyFile.set_boolean ("Common Properties for Transformations", "AutoFill", commonTrans.autofill); // save rotate - keyFile.set_double ("Rotation", "Degree", rotate.degree); + if (!pedited || pedited->rotate.degree) keyFile.set_double ("Rotation", "Degree", rotate.degree); // save distortion - keyFile.set_double ("Distortion", "Amount", distortion.amount); - keyFile.set_boolean ("Distortion", "UseLensFun", distortion.uselensfun); + if (!pedited || pedited->distortion.amount) keyFile.set_double ("Distortion", "Amount", distortion.amount); + if (!pedited || pedited->distortion.uselensfun) keyFile.set_boolean ("Distortion", "UseLensFun", distortion.uselensfun); // save perspective correction - keyFile.set_integer ("Perspective", "Horizontal", perspective.horizontal); - keyFile.set_integer ("Perspective", "Vertical", perspective.vertical); + if (!pedited || pedited->perspective.horizontal) keyFile.set_integer ("Perspective", "Horizontal", perspective.horizontal); + if (!pedited || pedited->perspective.vertical) keyFile.set_integer ("Perspective", "Vertical", perspective.vertical); // save C/A correction - keyFile.set_double ("CACorrection", "Red", cacorrection.red); - keyFile.set_double ("CACorrection", "Blue", cacorrection.blue); + 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 - keyFile.set_integer ("Vignetting Correction", "Amount", vignetting.amount); - keyFile.set_integer ("Vignetting Correction", "Radius", vignetting.radius); - keyFile.set_integer ("Vignetting Correction", "Strength", vignetting.strength); - keyFile.set_integer ("Vignetting Correction", "CenterX", vignetting.centerX); - keyFile.set_integer ("Vignetting Correction", "CenterY", vignetting.centerY); + 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); // save highlight recovery settings - keyFile.set_boolean ("HLRecovery", "Enabled", hlrecovery.enabled); - keyFile.set_string ("HLRecovery", "Method", hlrecovery.method); + if (!pedited || pedited->hlrecovery.enabled) keyFile.set_boolean ("HLRecovery", "Enabled", hlrecovery.enabled); + if (!pedited || pedited->hlrecovery.method) keyFile.set_string ("HLRecovery", "Method", hlrecovery.method); - keyFile.set_boolean ("Resize", "Enabled",resize.enabled); - keyFile.set_double ("Resize", "Scale", resize.scale); - keyFile.set_string ("Resize", "AppliesTo", resize.appliesTo); - keyFile.set_string ("Resize", "Method", resize.method); - keyFile.set_integer ("Resize", "DataSpecified", resize.dataspec); - keyFile.set_integer ("Resize", "Width", resize.width); - keyFile.set_integer ("Resize", "Height", resize.height); + 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); // save color management settings - keyFile.set_string ("Color Management", "InputProfile", icm.input); - keyFile.set_boolean ("Color Management", "BlendCMSMatrix", icm.blendCMSMatrix); - keyFile.set_string ("Color Management", "WorkingProfile", icm.working); - keyFile.set_string ("Color Management", "OutputProfile", icm.output); - keyFile.set_string ("Color Management", "Gammafree", icm.gamma); - keyFile.set_boolean ("Color Management", "Freegamma", icm.freegamma); - keyFile.set_double ("Color Management", "GammaValue", icm.gampos); - keyFile.set_double ("Color Management", "GammaSlope", icm.slpos); + if (!pedited || pedited->icm.input) keyFile.set_string ("Color Management", "InputProfile", icm.input); + if (!pedited || pedited->icm.blendCMSMatrix) keyFile.set_boolean ("Color Management", "BlendCMSMatrix", icm.blendCMSMatrix); + 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.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 directional pyramid equalizer parameters - keyFile.set_boolean ("Directional Pyramid Equalizer", "Enabled", dirpyrequalizer.enabled); + // save directional pyramid equalizer parameters + if (!pedited || pedited->dirpyrequalizer.enabled) keyFile.set_boolean ("Directional Pyramid Equalizer", "Enabled", dirpyrequalizer.enabled); for(int i = 0; i < 5; i++) { std::stringstream ss; ss << "Mult" << i; - keyFile.set_double("Directional Pyramid Equalizer", ss.str(), dirpyrequalizer.mult[i]); + if (!pedited || pedited->dirpyrequalizer.mult[i]) keyFile.set_double("Directional Pyramid Equalizer", ss.str(), dirpyrequalizer.mult[i]); } - + // save hsv equalizer parameters - //keyFile.set_boolean ("HSV Equalizer", "Enabled", hsvequalizer.enabled); - //keyFile.set_string ("HSV Equalizer", "Channel", hsvequalizer.hsvchannel); - Glib::ArrayHandle hcurve = hsvequalizer.hcurve; - Glib::ArrayHandle scurve = hsvequalizer.scurve; - Glib::ArrayHandle vcurve = hsvequalizer.vcurve; - keyFile.set_double_list("HSV Equalizer", "HCurve", hcurve); - keyFile.set_double_list("HSV Equalizer", "SCurve", scurve); - keyFile.set_double_list("HSV Equalizer", "VCurve", vcurve); + 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); + } - Glib::ArrayHandle RGBrcurve = rgbCurves.rcurve; - Glib::ArrayHandle RGBgcurve = rgbCurves.gcurve; - Glib::ArrayHandle RGBbcurve = rgbCurves.bcurve; - keyFile.set_double_list("RGB Curves", "rCurve", RGBrcurve); - keyFile.set_double_list("RGB Curves", "gCurve", RGBgcurve); - keyFile.set_double_list("RGB Curves", "bCurve", RGBbcurve); + 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 RAW parameters - keyFile.set_string ("RAW", "DarkFrame", raw.dark_frame ); - keyFile.set_boolean ("RAW", "DarkFrameAuto", raw.df_autoselect ); - keyFile.set_string ("RAW", "FlatFieldFile", raw.ff_file ); - keyFile.set_boolean ("RAW", "FlatFieldAutoSelect", raw.ff_AutoSelect ); - keyFile.set_integer ("RAW", "FlatFieldBlurRadius", raw.ff_BlurRadius ); - keyFile.set_string ("RAW", "FlatFieldBlurType", raw.ff_BlurType ); - keyFile.set_boolean ("RAW", "CA", raw.ca_autocorrect ); - keyFile.set_double ("RAW", "CARed", raw.cared ); - keyFile.set_double ("RAW", "CABlue", raw.cablue ); - keyFile.set_boolean ("RAW", "HotDeadPixels", raw.hotdeadpix_filt ); - keyFile.set_integer ("RAW", "HotDeadPixelThresh", raw.hotdeadpix_thresh ); - keyFile.set_integer ("RAW", "LineDenoise", raw.linenoise); - keyFile.set_integer ("RAW", "GreenEqThreshold", raw.greenthresh); - keyFile.set_integer ("RAW", "CcSteps", raw.ccSteps); - keyFile.set_string ("RAW", "Method", raw.dmethod ); - keyFile.set_integer ("RAW", "DCBIterations", raw.dcb_iterations ); - keyFile.set_boolean ("RAW", "DCBEnhance", raw.dcb_enhance ); - keyFile.set_boolean ("RAW", "ALLEnhance", raw.all_enhance ); - - keyFile.set_double ("RAW", "PreExposure", raw.expos ); - keyFile.set_double ("RAW", "PrePreserv", raw.preser ); - keyFile.set_double ("RAW", "PreBlackzero", raw.blackzero ); - keyFile.set_double ("RAW", "PreBlackone", raw.blackone ); - keyFile.set_double ("RAW", "PreBlacktwo", raw.blacktwo ); - keyFile.set_double ("RAW", "PreBlackthree", raw.blackthree ); - keyFile.set_boolean ("RAW", "PreTwoGreen", raw.twogreen ); + // save raw parameters + if (!pedited || pedited->raw.darkFrame) keyFile.set_string ("RAW", "DarkFrame", 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", 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.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.hotDeadPixelFilter) keyFile.set_boolean ("RAW", "HotDeadPixels", raw.hotdeadpix_filt ); + if (!pedited || pedited->raw.hotDeadPixelThresh) keyFile.set_integer ("RAW", "HotDeadPixelThresh", raw.hotdeadpix_thresh ); + if (!pedited || pedited->raw.linenoise) keyFile.set_integer ("RAW", "LineDenoise", raw.linenoise); + if (!pedited || pedited->raw.greenEq) keyFile.set_integer ("RAW", "GreenEqThreshold", raw.greenthresh); + if (!pedited || pedited->raw.ccSteps) keyFile.set_integer ("RAW", "CcSteps", raw.ccSteps); + if (!pedited || pedited->raw.dmethod) keyFile.set_string ("RAW", "Method", raw.dmethod ); + if (!pedited || pedited->raw.dcbIterations) keyFile.set_integer ("RAW", "DCBIterations", raw.dcb_iterations ); + if (!pedited || pedited->raw.dcbEnhance) keyFile.set_boolean ("RAW", "DCBEnhance", raw.dcb_enhance ); + if (!pedited || pedited->raw.allEnhance) keyFile.set_boolean ("RAW", "ALLEnhance", raw.all_enhance ); - // exposition + // 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 ); + if (!pedited || pedited->raw.exBlackzero) keyFile.set_double ("RAW", "PreBlackzero", raw.blackzero ); + if (!pedited || pedited->raw.exBlackone) keyFile.set_double ("RAW", "PreBlackone", raw.blackone ); + if (!pedited || pedited->raw.exBlacktwo) keyFile.set_double ("RAW", "PreBlacktwo", raw.blacktwo ); + if (!pedited || pedited->raw.exBlackthree) keyFile.set_double ("RAW", "PreBlackthree", raw.blackthree ); + if (!pedited || pedited->raw.exTwoGreen) keyFile.set_boolean ("RAW", "PreTwoGreen", raw.twogreen ); // save exif change list - for (int i=0; i<(int)exif.size(); i++) - keyFile.set_string ("Exif", exif[i].field, exif[i].value); + 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 - for (int i=0; i<(int)iptc.size(); i++) { - Glib::ArrayHandle values = iptc[i].values; - keyFile.set_string_list ("IPTC", iptc[i].field, values); + if (!pedited || pedited->iptc) { + for (IPTCPairs::const_iterator i=iptc.begin(); i!=iptc.end(); i++) { + Glib::ArrayHandle values = i->second; + keyFile.set_string_list ("IPTC", i->first, values); + } } Glib::ustring sPParams = keyFile.to_data(); @@ -637,7 +664,7 @@ int ProcParams::write (Glib::ustring &fname, Glib::ustring &content) const { int error = 0; if (fname.length()) { - FILE *f; + FILE *f; f = safe_g_fopen (fname, "wt"); if (f==NULL) @@ -650,11 +677,13 @@ int ProcParams::write (Glib::ustring &fname, Glib::ustring &content) const { return error; } -int ProcParams::load (Glib::ustring fname) { +int ProcParams::load (Glib::ustring fname, ParamsEdited* pedited) { SafeKeyFile keyFile; try { - setDefaults (); + //setDefaults (); + if (pedited) + pedited->set(false); FILE* f = safe_g_fopen (fname, "rt"); if (!f) @@ -679,34 +708,39 @@ if (keyFile.has_group ("Version")) { //printf("ProcParams::load called ppVersion=%i\n",ppVersion); if (keyFile.has_group ("General")) { - if (keyFile.has_key ("General", "Rank")) rank = keyFile.get_integer ("General", "Rank"); - if (keyFile.has_key ("General", "ColorLabel")) colorlabel = keyFile.get_integer ("General", "ColorLabel"); - if (keyFile.has_key ("General", "InTrash")) inTrash = keyFile.get_boolean ("General", "InTrash"); + 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; } } if (keyFile.has_group ("Exposure")) { - if (ppVersiontoneCurve.autoexp = true; } - if (keyFile.has_key ("Exposure", "Clip")) toneCurve.clip = keyFile.get_double ("Exposure", "Clip"); - if (keyFile.has_key ("Exposure", "Compensation")) toneCurve.expcomp = keyFile.get_double ("Exposure", "Compensation"); - if (keyFile.has_key ("Exposure", "Brightness")) toneCurve.brightness = keyFile.get_integer ("Exposure", "Brightness"); - if (keyFile.has_key ("Exposure", "Contrast")) toneCurve.contrast = keyFile.get_integer ("Exposure", "Contrast"); - if (keyFile.has_key ("Exposure", "Saturation")) toneCurve.saturation = keyFile.get_integer ("Exposure", "Saturation"); - if (keyFile.has_key ("Exposure", "Black")) toneCurve.black = keyFile.get_integer ("Exposure", "Black"); - if (keyFile.has_key ("Exposure", "HighlightCompr")) toneCurve.hlcompr = keyFile.get_integer ("Exposure", "HighlightCompr"); - if (keyFile.has_key ("Exposure", "HighlightComprThreshold")) toneCurve.hlcomprthresh = keyFile.get_integer ("Exposure", "HighlightComprThreshold"); - if (keyFile.has_key ("Exposure", "ShadowCompr")) toneCurve.shcompr = keyFile.get_integer ("Exposure", "ShadowCompr"); + 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; } if (toneCurve.shcompr > 100) toneCurve.shcompr = 100; // older pp3 files can have values above 100. if (ppVersion>200) - if (keyFile.has_key ("Exposure", "Curve")) toneCurve.curve = keyFile.get_double_list ("Exposure", "Curve"); + if (keyFile.has_key ("Exposure", "Curve")) { toneCurve.curve = keyFile.get_double_list ("Exposure", "Curve"); if (pedited) pedited->toneCurve.curve = true; } } // load channel mixer curve if (keyFile.has_group ("Channel Mixer")) { if (keyFile.has_key ("Channel Mixer", "Red") && keyFile.has_key ("Channel Mixer", "Green") && keyFile.has_key ("Channel Mixer", "Blue")) { + if (pedited) { + pedited->chmixer.red[0] = pedited->chmixer.red[1] = pedited->chmixer.red[2] = true; + pedited->chmixer.green[0] = pedited->chmixer.green[1] = pedited->chmixer.green[2] = true; + pedited->chmixer.blue[0] = pedited->chmixer.blue[1] = pedited->chmixer.blue[2] = true; + } Glib::ArrayHandle rmix = keyFile.get_integer_list ("Channel Mixer", "Red"); Glib::ArrayHandle gmix = keyFile.get_integer_list ("Channel Mixer", "Green"); Glib::ArrayHandle bmix = keyFile.get_integer_list ("Channel Mixer", "Blue"); @@ -718,313 +752,339 @@ if (keyFile.has_group ("Channel Mixer")) { // 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 (keyFile.has_key ("Luminance Curve", "Contrast")) labCurve.contrast = keyFile.get_integer ("Luminance Curve", "Contrast"); - if (keyFile.has_key ("Luminance Curve", "Saturation")) labCurve.saturation = keyFile.get_integer ("Luminance Curve", "Saturation"); - if (keyFile.has_key ("Luminance Curve", "AvoidColorClipping")) labCurve.avoidclip = keyFile.get_boolean ("Luminance Curve", "AvoidColorClipping"); - if (keyFile.has_key ("Luminance Curve", "SaturationLimiter")) labCurve.enable_saturationlimiter= keyFile.get_boolean ("Luminance Curve", "SaturationLimiter"); - if (keyFile.has_key ("Luminance Curve", "SaturationLimit")) labCurve.saturationlimit = keyFile.get_double ("Luminance Curve", "SaturationLimit"); - if (keyFile.has_key ("Luminance Curve", "LCurve")) labCurve.lcurve = keyFile.get_double_list ("Luminance Curve", "LCurve"); - if (keyFile.has_key ("Luminance Curve", "aCurve")) labCurve.acurve = keyFile.get_double_list ("Luminance Curve", "aCurve"); - if (keyFile.has_key ("Luminance Curve", "bCurve")) labCurve.bcurve = keyFile.get_double_list ("Luminance Curve", "bCurve"); + if (keyFile.has_key ("Luminance Curve", "Brightness")) { labCurve.brightness = keyFile.get_integer ("Luminance Curve", "Brightness"); 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; } + if (keyFile.has_key ("Luminance Curve", "Saturation")) { labCurve.saturation = keyFile.get_integer ("Luminance Curve", "Saturation"); if (pedited) pedited->labCurve.saturation = true; } + if (keyFile.has_key ("Luminance Curve", "AvoidColorClipping")) { labCurve.avoidclip = keyFile.get_boolean ("Luminance Curve", "AvoidColorClipping"); if (pedited) pedited->labCurve.avoidclip = true; } + if (keyFile.has_key ("Luminance Curve", "SaturationLimiter")) { labCurve.enable_saturationlimiter = keyFile.get_boolean ("Luminance Curve", "SaturationLimiter"); if (pedited) pedited->labCurve.enable_saturationlimiter = true; } + if (keyFile.has_key ("Luminance Curve", "SaturationLimit")) { labCurve.saturationlimit = keyFile.get_double ("Luminance Curve", "SaturationLimit"); if (pedited) pedited->labCurve.saturationlimit = true; } + if (keyFile.has_key ("Luminance Curve", "LCurve")) { labCurve.lcurve = keyFile.get_double_list ("Luminance Curve", "LCurve"); if (pedited) pedited->labCurve.lcurve = true; } + if (keyFile.has_key ("Luminance Curve", "aCurve")) { labCurve.acurve = keyFile.get_double_list ("Luminance Curve", "aCurve"); if (pedited) pedited->labCurve.acurve = true; } + if (keyFile.has_key ("Luminance Curve", "bCurve")) { labCurve.bcurve = keyFile.get_double_list ("Luminance Curve", "bCurve"); if (pedited) pedited->labCurve.bcurve = true; } } // load sharpening -if (keyFile.has_group ("Sharpening")) { - if (keyFile.has_key ("Sharpening", "Enabled")) sharpening.enabled = keyFile.get_boolean ("Sharpening", "Enabled"); - if (keyFile.has_key ("Sharpening", "Radius")) sharpening.radius = keyFile.get_double ("Sharpening", "Radius"); - if (keyFile.has_key ("Sharpening", "Amount")) sharpening.amount = keyFile.get_integer ("Sharpening", "Amount"); - if (keyFile.has_key ("Sharpening", "Threshold")) sharpening.threshold = keyFile.get_integer ("Sharpening", "Threshold"); - if (keyFile.has_key ("Sharpening", "OnlyEdges")) sharpening.edgesonly = keyFile.get_boolean ("Sharpening", "OnlyEdges"); - if (keyFile.has_key ("Sharpening", "EdgedetectionRadius")) sharpening.edges_radius = keyFile.get_double ("Sharpening", "EdgedetectionRadius"); - if (keyFile.has_key ("Sharpening", "EdgeTolerance")) sharpening.edges_tolerance = keyFile.get_integer ("Sharpening", "EdgeTolerance"); - if (keyFile.has_key ("Sharpening", "HalocontrolEnabled")) sharpening.halocontrol = keyFile.get_boolean ("Sharpening", "HalocontrolEnabled"); - if (keyFile.has_key ("Sharpening", "HalocontrolAmount")) sharpening.halocontrol_amount = keyFile.get_integer ("Sharpening", "HalocontrolAmount"); - if (keyFile.has_key ("Sharpening", "Method")) sharpening.method = keyFile.get_string ("Sharpening", "Method"); - if (keyFile.has_key ("Sharpening", "DeconvRadius")) sharpening.deconvradius = keyFile.get_double ("Sharpening", "DeconvRadius"); - if (keyFile.has_key ("Sharpening", "DeconvAmount")) sharpening.deconvamount = keyFile.get_integer ("Sharpening", "DeconvAmount"); - if (keyFile.has_key ("Sharpening", "DeconvDamping")) sharpening.deconvdamping = keyFile.get_integer ("Sharpening", "DeconvDamping"); - if (keyFile.has_key ("Sharpening", "DeconvIterations")) sharpening.deconviter = keyFile.get_integer ("Sharpening", "DeconvIterations"); +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; } + if (keyFile.has_key ("Sharpening", "Threshold")) { sharpening.threshold = keyFile.get_integer ("Sharpening", "Threshold"); if (pedited) pedited->sharpening.threshold = true; } + 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; } } // load edge sharpening if (keyFile.has_group ("SharpenEdge")) { - if (keyFile.has_key ("SharpenEdge", "Enabled")) sharpenEdge.enabled = keyFile.get_boolean ("SharpenEdge", "Enabled"); - if (keyFile.has_key ("SharpenEdge", "Passes")) sharpenEdge.passes = keyFile.get_integer ("SharpenEdge", "Passes"); - if (keyFile.has_key ("SharpenEdge", "Strength")) sharpenEdge.amount = keyFile.get_double ("SharpenEdge", "Strength"); - if (keyFile.has_key ("SharpenEdge", "ThreeChannels")) sharpenEdge.threechannels = keyFile.get_boolean ("SharpenEdge", "ThreeChannels"); + 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; } } // load micro-contrast sharpening if (keyFile.has_group ("SharpenMicro")) { - if (keyFile.has_key ("SharpenMicro", "Enabled")) sharpenMicro.enabled = keyFile.get_boolean ("SharpenMicro", "Enabled"); - if (keyFile.has_key ("SharpenMicro", "Matrix")) sharpenMicro.matrix = keyFile.get_boolean ("SharpenMicro", "Matrix"); - if (keyFile.has_key ("SharpenMicro", "Strength")) sharpenMicro.amount = keyFile.get_double ("SharpenMicro", "Strength"); - if (keyFile.has_key ("SharpenMicro", "Uniformity")) sharpenMicro.uniformity = keyFile.get_double ("SharpenMicro", "Uniformity"); + 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; } } // load vibrance if (keyFile.has_group ("Vibrance")) { - if (keyFile.has_key ("Vibrance", "Enabled")) vibrance.enabled = keyFile.get_boolean ("Vibrance", "Enabled"); - if (keyFile.has_key ("Vibrance", "Pastels")) vibrance.pastels = keyFile.get_integer ("Vibrance", "Pastels"); - if (keyFile.has_key ("Vibrance", "Saturated")) vibrance.saturated = keyFile.get_integer ("Vibrance", "Saturated"); - if (keyFile.has_key ("Vibrance", "PSThreshold")) vibrance.psthreshold = keyFile.get_integer ("Vibrance", "PSThreshold"); - if (keyFile.has_key ("Vibrance", "ProtectSkins")) vibrance.protectskins = keyFile.get_boolean ("Vibrance", "ProtectSkins"); - if (keyFile.has_key ("Vibrance", "AvoidColorShift")) vibrance.avoidcolorshift = keyFile.get_boolean ("Vibrance", "AvoidColorShift"); - if (keyFile.has_key ("Vibrance", "PastSatTog")) vibrance.pastsattog = keyFile.get_boolean ("Vibrance", "PastSatTog"); + 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; } + if (keyFile.has_key ("Vibrance", "PSThreshold")) { vibrance.psthreshold = keyFile.get_integer ("Vibrance", "PSThreshold"); if (pedited) pedited->vibrance.psthreshold = true; } + 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; } } // load colorBoost -if (keyFile.has_group ("Color Boost")) { - if (keyFile.has_key ("Color Boost", "Amount")) colorBoost.amount = keyFile.get_integer ("Color Boost", "Amount"); +/*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"); + 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 (keyFile.has_key ("Color Boost", "SaturationLimiter")) colorBoost.enable_saturationlimiter= keyFile.get_boolean ("Color Boost", "SaturationLimiter"); - if (keyFile.has_key ("Color Boost", "SaturationLimit")) colorBoost.saturationlimit = keyFile.get_double ("Color Boost", "SaturationLimit"); -} + 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 (keyFile.has_key ("White Balance", "Temperature")) wb.temperature = keyFile.get_integer ("White Balance", "Temperature"); - if (keyFile.has_key ("White Balance", "Green")) wb.green = keyFile.get_double ("White Balance", "Green"); +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; } } // load colorShift -if (keyFile.has_group ("Color Shift")) { - if (keyFile.has_key ("Color Shift", "ChannelA")) colorShift.a = keyFile.get_double ("Color Shift", "ChannelA"); - if (keyFile.has_key ("Color Shift", "ChannelB")) colorShift.b = keyFile.get_double ("Color Shift", "ChannelB"); -} +/*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 (keyFile.has_key ("Defringing", "Radius")) defringe.radius = keyFile.get_double ("Defringing", "Radius"); - if (keyFile.has_key ("Defringing", "Threshold")) defringe.threshold = keyFile.get_integer ("Defringing", "Threshold"); +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; } + if (keyFile.has_key ("Defringing", "Threshold")) { defringe.threshold = keyFile.get_integer ("Defringing", "Threshold"); if (pedited) pedited->defringe.threshold = true; } } // load impulseDenoise -if (keyFile.has_group ("Impulse Denoising")) { - if (keyFile.has_key ("Impulse Denoising", "Enabled")) impulseDenoise.enabled = keyFile.get_boolean ("Impulse Denoising", "Enabled"); - if (keyFile.has_key ("Impulse Denoising", "Threshold")) impulseDenoise.thresh = keyFile.get_integer ("Impulse Denoising", "Threshold"); +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; } } // load dirpyrDenoise -if (keyFile.has_group ("Directional Pyramid Denoising")) { - if (keyFile.has_key ("Directional Pyramid Denoising", "Enabled")) dirpyrDenoise.enabled = keyFile.get_boolean ("Directional Pyramid Denoising", "Enabled"); - if (keyFile.has_key ("Directional Pyramid Denoising", "Luma")) dirpyrDenoise.luma = keyFile.get_integer ("Directional Pyramid Denoising", "Luma"); - if (keyFile.has_key ("Directional Pyramid Denoising", "Chroma")) dirpyrDenoise.chroma = keyFile.get_integer ("Directional Pyramid Denoising", "Chroma"); - if (keyFile.has_key ("Directional Pyramid Denoising", "Gamma")) dirpyrDenoise.gamma = keyFile.get_double ("Directional Pyramid Denoising", "Gamma"); - if (keyFile.has_key ("Directional Pyramid Denoising", "LumCurve")) dirpyrDenoise.lumcurve = keyFile.get_double_list ("Directional Pyramid Denoising", "LumCurve"); - if (keyFile.has_key ("Directional Pyramid Denoising", "ChromCurve")) dirpyrDenoise.chromcurve = keyFile.get_double_list ("Directional Pyramid Denoising", "ChromCurve"); +if (keyFile.has_group ("Directional Pyramid Denoising")) { + if (keyFile.has_key ("Directional Pyramid Denoising", "Enabled")) { dirpyrDenoise.enabled = keyFile.get_boolean ("Directional Pyramid Denoising", "Enabled"); if (pedited) pedited->dirpyrDenoise.enabled = true; } + if (keyFile.has_key ("Directional Pyramid Denoising", "Luma")) { dirpyrDenoise.luma = keyFile.get_integer ("Directional Pyramid Denoising", "Luma"); if (pedited) pedited->dirpyrDenoise.luma = true; } + if (keyFile.has_key ("Directional Pyramid Denoising", "Chroma")) { dirpyrDenoise.chroma = keyFile.get_integer ("Directional Pyramid Denoising", "Chroma"); if (pedited) pedited->dirpyrDenoise.chroma = true; } + if (keyFile.has_key ("Directional Pyramid Denoising", "Gamma")) { dirpyrDenoise.gamma = keyFile.get_double ("Directional Pyramid Denoising", "Gamma"); if (pedited) pedited->dirpyrDenoise.gamma = true; } } //Load EPD. -if (keyFile.has_group ("EPD")) { - if(keyFile.has_key("EPD", "Enabled")) edgePreservingDecompositionUI.enabled = keyFile.get_boolean ("EPD", "Enabled"); - if(keyFile.has_key("EPD", "Strength")) edgePreservingDecompositionUI.Strength = keyFile.get_double ("EPD", "Strength"); - if(keyFile.has_key("EPD", "EdgeStopping")) edgePreservingDecompositionUI.EdgeStopping = keyFile.get_double ("EPD", "EdgeStopping"); - if(keyFile.has_key("EPD", "Scale")) edgePreservingDecompositionUI.Scale = keyFile.get_double ("EPD", "Scale"); - if(keyFile.has_key("EPD", "ReweightingIterates")) edgePreservingDecompositionUI.ReweightingIterates = keyFile.get_integer ("EPD", "ReweightingIterates"); +if (keyFile.has_group ("EPD")) { + if(keyFile.has_key("EPD", "Enabled")) { edgePreservingDecompositionUI.enabled = keyFile.get_boolean ("EPD", "Enabled"); if (pedited) pedited->edgePreservingDecompositionUI.enabled = true; } + if(keyFile.has_key("EPD", "Strength")) { edgePreservingDecompositionUI.Strength = keyFile.get_double ("EPD", "Strength"); if (pedited) pedited->edgePreservingDecompositionUI.Strength = true; } + if(keyFile.has_key("EPD", "EdgeStopping")) { edgePreservingDecompositionUI.EdgeStopping = keyFile.get_double ("EPD", "EdgeStopping"); if (pedited) pedited->edgePreservingDecompositionUI.EdgeStopping = true; } + if(keyFile.has_key("EPD", "Scale")) { edgePreservingDecompositionUI.Scale = keyFile.get_double ("EPD", "Scale"); if (pedited) pedited->edgePreservingDecompositionUI.Scale = true; } + if(keyFile.has_key("EPD", "ReweightingIterates")) { edgePreservingDecompositionUI.ReweightingIterates = keyFile.get_integer ("EPD", "ReweightingIterates"); if (pedited) pedited->edgePreservingDecompositionUI.ReweightingIterates = 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 (keyFile.has_key ("Luminance Denoising", "Radius")) lumaDenoise.radius = keyFile.get_double ("Luminance Denoising", "Radius"); - if (keyFile.has_key ("Luminance Denoising", "EdgeTolerance")) lumaDenoise.edgetolerance = keyFile.get_integer ("Luminance Denoising", "EdgeTolerance"); -} +/*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 (keyFile.has_key ("Chrominance Denoising", "Radius")) colorDenoise.amount = 10*keyFile.get_double ("Chrominance Denoising", "Radius"); - else if (keyFile.has_key ("Chrominance Denoising", "Amount")) colorDenoise.amount = keyFile.get_integer ("Chrominance Denoising", "Amount"); -} +/*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 (keyFile.has_key ("Shadows & Highlights", "HighQuality")) sh.hq = keyFile.get_boolean ("Shadows & Highlights", "HighQuality"); - if (keyFile.has_key ("Shadows & Highlights", "Highlights")) sh.highlights = keyFile.get_integer ("Shadows & Highlights", "Highlights"); - if (keyFile.has_key ("Shadows & Highlights", "HighlightTonalWidth")) sh.htonalwidth = keyFile.get_integer ("Shadows & Highlights", "HighlightTonalWidth"); - if (keyFile.has_key ("Shadows & Highlights", "Shadows")) sh.shadows = keyFile.get_integer ("Shadows & Highlights", "Shadows"); - if (keyFile.has_key ("Shadows & Highlights", "ShadowTonalWidth")) sh.stonalwidth = keyFile.get_integer ("Shadows & Highlights", "ShadowTonalWidth"); - if (keyFile.has_key ("Shadows & Highlights", "LocalContrast")) sh.localcontrast = keyFile.get_integer ("Shadows & Highlights", "LocalContrast"); - if (keyFile.has_key ("Shadows & Highlights", "Radius")) sh.radius = keyFile.get_integer ("Shadows & Highlights", "Radius"); +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; } } // load crop -if (keyFile.has_group ("Crop")) { - if (keyFile.has_key ("Crop", "Enabled")) crop.enabled = keyFile.get_boolean ("Crop", "Enabled"); - if (keyFile.has_key ("Crop", "X")) crop.x = keyFile.get_integer ("Crop", "X"); - if (keyFile.has_key ("Crop", "Y")) crop.y = keyFile.get_integer ("Crop", "Y"); - if (keyFile.has_key ("Crop", "W")) crop.w = keyFile.get_integer ("Crop", "W"); - if (keyFile.has_key ("Crop", "H")) crop.h = keyFile.get_integer ("Crop", "H"); - if (keyFile.has_key ("Crop", "FixedRatio")) crop.fixratio = keyFile.get_boolean ("Crop", "FixedRatio"); - if (keyFile.has_key ("Crop", "Ratio")){ - crop.ratio = keyFile.get_string ("Crop", "Ratio"); - //backwards compatibility for crop.ratio - if (crop.ratio=="DIN") crop.ratio = "1.414 - DIN EN ISO 216"; - if (crop.ratio=="8.5:11") crop.ratio = "8.5:11 - US Letter"; - if (crop.ratio=="11:17") crop.ratio = "11:17 - Tabloid"; +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; } + if (keyFile.has_key ("Crop", "W")) { crop.w = keyFile.get_integer ("Crop", "W"); if (pedited) pedited->crop.w = true; } + if (keyFile.has_key ("Crop", "H")) { crop.h = keyFile.get_integer ("Crop", "H"); if (pedited) pedited->crop.h = true; } + if (keyFile.has_key ("Crop", "FixedRatio")) { crop.fixratio = keyFile.get_boolean ("Crop", "FixedRatio"); 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 (crop.ratio=="DIN") crop.ratio = "1.414 - DIN EN ISO 216"; + if (crop.ratio=="8.5:11") crop.ratio = "8.5:11 - US Letter"; + if (crop.ratio=="11:17") crop.ratio = "11:17 - Tabloid"; } - if (keyFile.has_key ("Crop", "Orientation"))crop.orientation= keyFile.get_string ("Crop", "Orientation"); - if (keyFile.has_key ("Crop", "Guide")) crop.guide = keyFile.get_string ("Crop", "Guide"); + 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; } } // load coarse -if (keyFile.has_group ("Coarse Transformation")) { - if (keyFile.has_key ("Coarse Transformation", "Rotate")) coarse.rotate = keyFile.get_integer ("Coarse Transformation", "Rotate"); - if (keyFile.has_key ("Coarse Transformation", "HorizontalFlip")) coarse.hflip = keyFile.get_boolean ("Coarse Transformation", "HorizontalFlip"); - if (keyFile.has_key ("Coarse Transformation", "VerticalFlip")) coarse.vflip = keyFile.get_boolean ("Coarse Transformation", "VerticalFlip"); +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; } } // load rotate -if (keyFile.has_group ("Rotation")) { - if (keyFile.has_key ("Rotation", "Degree")) rotate.degree = keyFile.get_double ("Rotation", "Degree"); +if (keyFile.has_group ("Rotation")) { + if (keyFile.has_key ("Rotation", "Degree")) { rotate.degree = keyFile.get_double ("Rotation", "Degree"); if (pedited) pedited->rotate.degree = true; } } - // load commonTrans + // 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 (keyFile.has_key ("Common Properties for Transformations", "AutoFill")) { commonTrans.autofill = keyFile.get_boolean ("Common Properties for Transformations", "AutoFill"); if (pedited) pedited->commonTrans.autofill = true; } } // load distortion -if (keyFile.has_group ("Distortion")) { - if (keyFile.has_key ("Distortion", "Amount")) distortion.amount = keyFile.get_double ("Distortion", "Amount"); - if (keyFile.has_key ("Distortion", "UseLensFun")) distortion.uselensfun = keyFile.get_boolean ("Distortion", "UseLensFun"); +if (keyFile.has_group ("Distortion")) { + if (keyFile.has_key ("Distortion", "Amount")) { distortion.amount = keyFile.get_double ("Distortion", "Amount"); if (pedited) pedited->distortion.amount = true; } + if (keyFile.has_key ("Distortion", "UseLensFun")) { distortion.uselensfun = keyFile.get_boolean ("Distortion", "UseLensFun"); if (pedited) pedited->distortion.uselensfun = true; } } - // load perspective correction + // load perspective correction if (keyFile.has_group ("Perspective")) { - if (keyFile.has_key ("Perspective", "Horizontal")) perspective.horizontal = keyFile.get_integer ("Perspective", "Horizontal"); - if (keyFile.has_key ("Perspective", "Vertical")) perspective.vertical = keyFile.get_integer ("Perspective", "Vertical"); + if (keyFile.has_key ("Perspective", "Horizontal")) { perspective.horizontal = keyFile.get_integer ("Perspective", "Horizontal"); if (pedited) pedited->perspective.horizontal = true; } + if (keyFile.has_key ("Perspective", "Vertical")) { perspective.vertical = keyFile.get_integer ("Perspective", "Vertical"); if (pedited) pedited->perspective.vertical = true; } } // load c/a correction -if (keyFile.has_group ("CACorrection")) { - if (keyFile.has_key ("CACorrection", "Red")) cacorrection.red = keyFile.get_double ("CACorrection", "Red"); - if (keyFile.has_key ("CACorrection", "Blue")) cacorrection.blue = keyFile.get_double ("CACorrection", "Blue"); +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; } } // 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 (keyFile.has_key ("Vignetting Correction", "Radius")) vignetting.radius = keyFile.get_integer ("Vignetting Correction", "Radius"); - if (keyFile.has_key ("Vignetting Correction", "Strength")) vignetting.strength = keyFile.get_integer ("Vignetting Correction", "Strength"); - if (keyFile.has_key ("Vignetting Correction", "CenterX")) vignetting.centerX = keyFile.get_integer ("Vignetting Correction", "CenterX"); - if (keyFile.has_key ("Vignetting Correction", "CenterY")) vignetting.centerY = keyFile.get_integer ("Vignetting Correction", "CenterY"); +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; } } // load highlight recovery settings -if (keyFile.has_group ("HLRecovery")) { - if (keyFile.has_key ("HLRecovery", "Enabled")) hlrecovery.enabled = keyFile.get_boolean ("HLRecovery", "Enabled"); - if (keyFile.has_key ("HLRecovery", "Method")) hlrecovery.method = keyFile.get_string ("HLRecovery", "Method"); +if (keyFile.has_group ("HLRecovery")) { + if (keyFile.has_key ("HLRecovery", "Enabled")) { hlrecovery.enabled = keyFile.get_boolean ("HLRecovery", "Enabled"); if (pedited) pedited->hlrecovery.enabled = true; } + if (keyFile.has_key ("HLRecovery", "Method")) { hlrecovery.method = keyFile.get_string ("HLRecovery", "Method"); if (pedited) pedited->hlrecovery.method = true; } } // load resize settings -if (keyFile.has_group ("Resize")) { - if (keyFile.has_key ("Resize", "Enabled")) resize.enabled = keyFile.get_boolean ("Resize", "Enabled"); - if (keyFile.has_key ("Resize", "Scale")) resize.scale = keyFile.get_double ("Resize", "Scale"); - if (keyFile.has_key ("Resize", "AppliesTo")) resize.appliesTo = keyFile.get_string ("Resize", "AppliesTo"); - if (keyFile.has_key ("Resize", "Method")) resize.method = keyFile.get_string ("Resize", "Method"); - if (keyFile.has_key ("Resize", "DataSpecified")) resize.dataspec = keyFile.get_integer ("Resize", "DataSpecified"); - if (keyFile.has_key ("Resize", "Width")) resize.width = keyFile.get_integer ("Resize", "Width"); - if (keyFile.has_key ("Resize", "Height")) resize.height = keyFile.get_integer ("Resize", "Height"); +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; } } // load color management settings -if (keyFile.has_group ("Color Management")) { - if (keyFile.has_key ("Color Management", "InputProfile")) icm.input = keyFile.get_string ("Color Management", "InputProfile"); - if (keyFile.has_key ("Color Management", "BlendCMSMatrix")) icm.blendCMSMatrix = keyFile.get_boolean ("Color Management", "BlendCMSMatrix"); - if (keyFile.has_key ("Color Management", "WorkingProfile")) icm.working = keyFile.get_string ("Color Management", "WorkingProfile"); - if (keyFile.has_key ("Color Management", "OutputProfile")) icm.output = keyFile.get_string ("Color Management", "OutputProfile"); - if (keyFile.has_key ("Color Management", "Gammafree")) icm.gamma = keyFile.get_string ("Color Management", "Gammafree"); - if (keyFile.has_key ("Color Management", "Freegamma")) icm.freegamma = keyFile.get_boolean ("Color Management", "Freegamma"); - if (keyFile.has_key ("Color Management", "GammaVal")) icm.gampos = keyFile.get_double ("Color Management", "GammaVal"); - if (keyFile.has_key ("Color Management", "GammaSlope")) icm.slpos = keyFile.get_double ("Color Management", "GammaSlope"); - +if (keyFile.has_group ("Color Management")) { + if (keyFile.has_key ("Color Management", "InputProfile")) { icm.input = keyFile.get_string ("Color Management", "InputProfile"); if (pedited) pedited->icm.input = true; } + if (keyFile.has_key ("Color Management", "BlendCMSMatrix")) { icm.blendCMSMatrix = keyFile.get_boolean ("Color Management", "BlendCMSMatrix"); if (pedited) pedited->icm.blendCMSMatrix = 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; } + 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", "GammaVal")) { icm.gampos = keyFile.get_double ("Color Management", "GammaVal"); if (pedited) pedited->icm.gamma = true; } + if (keyFile.has_key ("Color Management", "GammaSlope")) { icm.slpos = keyFile.get_double ("Color Management", "GammaSlope"); if (pedited) pedited->icm.slpos = true; } + } - // load directional pyramid equalizer parameters + // 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"); - for(int i = 0; i < 5; i ++) - { - std::stringstream ss; - ss << "Mult" << i; - if(keyFile.has_key ("Directional Pyramid Equalizer", ss.str())) dirpyrequalizer.mult[i] = keyFile.get_double ("Directional Pyramid Equalizer", ss.str()); - } + if (keyFile.has_key ("Directional Pyramid Equalizer", "Enabled")) { dirpyrequalizer.enabled = keyFile.get_boolean ("Directional Pyramid Equalizer", "Enabled"); if (pedited) pedited->dirpyrequalizer.enabled = true; } + for(int i = 0; i < 5; i ++) { + std::stringstream ss; + ss << "Mult" << i; + if(keyFile.has_key ("Directional Pyramid Equalizer", ss.str())) { dirpyrequalizer.mult[i] = keyFile.get_double ("Directional Pyramid Equalizer", ss.str()); if (pedited) pedited->dirpyrequalizer.mult[i] = true; } + } } - // load HSV equalizer parameters + // load HSV equalizer parameters if (keyFile.has_group ("HSV Equalizer")) { - if (ppVersion>=300) { - if (keyFile.has_key ("HSV Equalizer", "HCurve")) hsvequalizer.hcurve = keyFile.get_double_list ("HSV Equalizer", "HCurve"); - if (keyFile.has_key ("HSV Equalizer", "SCurve")) hsvequalizer.scurve = keyFile.get_double_list ("HSV Equalizer", "SCurve"); - if (keyFile.has_key ("HSV Equalizer", "VCurve")) hsvequalizer.vcurve = keyFile.get_double_list ("HSV Equalizer", "VCurve"); - } + if (ppVersion>=300) { + if (keyFile.has_key ("HSV Equalizer", "HCurve")) { hsvequalizer.hcurve = keyFile.get_double_list ("HSV Equalizer", "HCurve"); if (pedited) pedited->hsvequalizer.hcurve = true; } + if (keyFile.has_key ("HSV Equalizer", "SCurve")) { hsvequalizer.scurve = keyFile.get_double_list ("HSV Equalizer", "SCurve"); if (pedited) pedited->hsvequalizer.scurve = true; } + if (keyFile.has_key ("HSV Equalizer", "VCurve")) { hsvequalizer.vcurve = keyFile.get_double_list ("HSV Equalizer", "VCurve"); if (pedited) pedited->hsvequalizer.vcurve = true; } + } } - // load RGB curves + // load RGB curves if (keyFile.has_group ("RGB Curves")) { - if (keyFile.has_key ("RGB Curves", "rCurve")) rgbCurves.rcurve = keyFile.get_double_list ("RGB Curves", "rCurve"); - if (keyFile.has_key ("RGB Curves", "gCurve")) rgbCurves.gcurve = keyFile.get_double_list ("RGB Curves", "gCurve"); - if (keyFile.has_key ("RGB Curves", "bCurve")) rgbCurves.bcurve = keyFile.get_double_list ("RGB Curves", "bCurve"); + if (keyFile.has_key ("RGB Curves", "rCurve")) { rgbCurves.rcurve = keyFile.get_double_list ("RGB Curves", "rCurve"); if (pedited) pedited->rgbCurves.rcurve = true; } + if (keyFile.has_key ("RGB Curves", "gCurve")) { rgbCurves.gcurve = keyFile.get_double_list ("RGB Curves", "gCurve"); if (pedited) pedited->rgbCurves.gcurve = true; } + if (keyFile.has_key ("RGB Curves", "bCurve")) { rgbCurves.bcurve = keyFile.get_double_list ("RGB Curves", "bCurve"); if (pedited) pedited->rgbCurves.bcurve = true; } } - // load raw settings + // load raw settings if (keyFile.has_group ("RAW")) { - if (keyFile.has_key ("RAW", "DarkFrame")) raw.dark_frame = keyFile.get_string ("RAW", "DarkFrame" ); - if (keyFile.has_key ("RAW", "DarkFrameAuto")) raw.df_autoselect = keyFile.get_boolean ("RAW", "DarkFrameAuto" ); - if (keyFile.has_key ("RAW", "FlatFieldFile")) raw.ff_file = keyFile.get_string ("RAW", "FlatFieldFile" ); - if (keyFile.has_key ("RAW", "FlatFieldAutoSelect")) raw.ff_AutoSelect = keyFile.get_boolean ("RAW", "FlatFieldAutoSelect" ); - if (keyFile.has_key ("RAW", "FlatFieldBlurRadius")) raw.ff_BlurRadius = keyFile.get_integer ("RAW", "FlatFieldBlurRadius" ); - if (keyFile.has_key ("RAW", "FlatFieldBlurType")) raw.ff_BlurType = keyFile.get_string ("RAW", "FlatFieldBlurType" ); - if (keyFile.has_key ("RAW", "CA")) raw.ca_autocorrect = keyFile.get_boolean ("RAW", "CA" ); - if (keyFile.has_key ("RAW", "CARed")) raw.cared = keyFile.get_double ("RAW", "CARed" ); - if (keyFile.has_key ("RAW", "CABlue")) raw.cablue = keyFile.get_double ("RAW", "CABlue" ); - if (keyFile.has_key ("RAW", "HotDeadPixels")) raw.hotdeadpix_filt = keyFile.get_boolean ("RAW", "HotDeadPixels" ); - if (keyFile.has_key ("RAW", "HotDeadPixelThresh")) raw.hotdeadpix_thresh = keyFile.get_integer ("RAW", "HotDeadPixelThresh" ); - if (keyFile.has_key ("RAW", "LineDenoise")) raw.linenoise = keyFile.get_integer ("RAW", "LineDenoise" ); - if (keyFile.has_key ("RAW", "GreenEqThreshold")) raw.greenthresh= keyFile.get_integer ("RAW", "GreenEqThreshold"); - if (keyFile.has_key ("RAW", "CcSteps")) raw.ccSteps = keyFile.get_integer ("RAW", "CcSteps"); - if (keyFile.has_key ("RAW", "Method")) raw.dmethod = keyFile.get_string ("RAW", "Method"); - if (keyFile.has_key ("RAW", "DCBIterations")) raw.dcb_iterations = keyFile.get_integer("RAW", "DCBIterations"); - if (keyFile.has_key ("RAW", "DCBEnhance")) raw.dcb_enhance =keyFile.get_boolean("RAW", "DCBEnhance"); - if (keyFile.has_key ("RAW", "ALLEnhance")) raw.all_enhance =keyFile.get_boolean("RAW", "ALLEnhance"); - - if (keyFile.has_key ("RAW", "PreExposure")) raw.expos =keyFile.get_double("RAW", "PreExposure"); - if (keyFile.has_key ("RAW", "PrePreserv")) raw.preser =keyFile.get_double("RAW", "PrePreserv"); - if (keyFile.has_key ("RAW", "PreBlackzero")) raw.blackzero =keyFile.get_double("RAW", "PreBlackzero"); - if (keyFile.has_key ("RAW", "PreBlackone")) raw.blackone =keyFile.get_double("RAW", "PreBlackone"); - if (keyFile.has_key ("RAW", "PreBlacktwo")) raw.blacktwo =keyFile.get_double("RAW", "PreBlacktwo"); - if (keyFile.has_key ("RAW", "PreBlackthree")) raw.blackthree =keyFile.get_double("RAW", "PreBlackthree"); - if (keyFile.has_key ("RAW", "PreTwoGreen")) raw.twogreen =keyFile.get_boolean("RAW", "PreTwoGreen"); - + if (keyFile.has_key ("RAW", "DarkFrame")) { raw.dark_frame = keyFile.get_string ("RAW", "DarkFrame" ); if (pedited) pedited->raw.darkFrame = true; } + if (keyFile.has_key ("RAW", "DarkFrameAuto")) { raw.df_autoselect = keyFile.get_boolean ("RAW", "DarkFrameAuto" ); if (pedited) pedited->raw.dfAuto = true; } + if (keyFile.has_key ("RAW", "FlatFieldFile")) { raw.ff_file = keyFile.get_string ("RAW", "FlatFieldFile" ); if (pedited) pedited->raw.ff_file = true; } + if (keyFile.has_key ("RAW", "FlatFieldAutoSelect")) { raw.ff_AutoSelect = keyFile.get_boolean ("RAW", "FlatFieldAutoSelect" ); if (pedited) pedited->raw.ff_AutoSelect = true; } + if (keyFile.has_key ("RAW", "FlatFieldBlurRadius")) { raw.ff_BlurRadius = keyFile.get_integer ("RAW", "FlatFieldBlurRadius" ); if (pedited) pedited->raw.ff_BlurRadius = true; } + 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", "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; } + if (keyFile.has_key ("RAW", "HotDeadPixels")) { raw.hotdeadpix_filt = keyFile.get_boolean ("RAW", "HotDeadPixels" ); if (pedited) pedited->raw.hotDeadPixelFilter = 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", "LineDenoise")) { raw.linenoise = keyFile.get_integer ("RAW", "LineDenoise" ); if (pedited) pedited->raw.linenoise = true; } + if (keyFile.has_key ("RAW", "GreenEqThreshold")) { raw.greenthresh= keyFile.get_integer ("RAW", "GreenEqThreshold"); if (pedited) pedited->raw.greenEq = true; } + if (keyFile.has_key ("RAW", "CcSteps")) { raw.ccSteps = keyFile.get_integer ("RAW", "CcSteps"); if (pedited) pedited->raw.ccSteps = true; } + if (keyFile.has_key ("RAW", "Method")) { raw.dmethod = keyFile.get_string ("RAW", "Method"); if (pedited) pedited->raw.dmethod = true; } + if (keyFile.has_key ("RAW", "DCBIterations")) { raw.dcb_iterations = keyFile.get_integer("RAW", "DCBIterations"); if (pedited) pedited->raw.dcbIterations = true; } + if (keyFile.has_key ("RAW", "DCBEnhance")) { raw.dcb_enhance =keyFile.get_boolean("RAW", "DCBEnhance"); if (pedited) pedited->raw.dcbEnhance = true; } + if (keyFile.has_key ("RAW", "ALLEnhance")) { raw.all_enhance =keyFile.get_boolean("RAW", "ALLEnhance"); if (pedited) pedited->raw.allEnhance = 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; } + if (keyFile.has_key ("RAW", "PreBlackzero")) { raw.blackzero =keyFile.get_double("RAW", "PreBlackzero"); if (pedited) pedited->raw.exBlackzero = true; } + if (keyFile.has_key ("RAW", "PreBlackone")) { raw.blackone =keyFile.get_double("RAW", "PreBlackone"); if (pedited) pedited->raw.exBlackone = true; } + if (keyFile.has_key ("RAW", "PreBlacktwo")) { raw.blacktwo =keyFile.get_double("RAW", "PreBlacktwo"); if (pedited) pedited->raw.exBlacktwo = true; } + if (keyFile.has_key ("RAW", "PreBlackthree")) { raw.blackthree =keyFile.get_double("RAW", "PreBlackthree"); if (pedited) pedited->raw.exBlackthree = true; } + if (keyFile.has_key ("RAW", "PreTwoGreen")) { raw.twogreen =keyFile.get_boolean("RAW", "PreTwoGreen"); if (pedited) pedited->raw.exTwoGreen = true; } + } // load exif change settings if (keyFile.has_group ("Exif")) { std::vector keys = keyFile.get_keys ("Exif"); - exif.resize (keys.size()); for (int i=0; i<(int)keys.size(); i++) { - exif[i].field = keys[i]; - exif[i].value = keyFile.get_string ("Exif", keys[i]); + Glib::ustring tmpStr = keyFile.get_string ("Exif", keys[i]); + exif[keys[i]] = keyFile.get_string ("Exif", keys[i]); + if (pedited) pedited->exif = true; } } - // load iptc change settings + /* + * Load iptc change settings + * + * Existing values are preserved, and the stored values + * are added to the list. To reset a field, the user has to + * save the profile with the field leaved empty, but still + * terminated by a semi-column ";" + * + * Please note that the old Keywords and SupplementalCategories + * tag content is fully replaced by the new one, + * i.e. they don't merge + */ if (keyFile.has_group ("IPTC")) { std::vector keys = keyFile.get_keys ("IPTC"); - iptc.resize (keys.size()); - for (int i=0; i<(int)keys.size(); i++) { - iptc[i].field = keys[i]; - iptc[i].values = keyFile.get_string_list ("IPTC", keys[i]); + IPTCPairs::iterator element; + for (unsigned int i=0; isecond.clear(); + } + + // 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()); + } + if (pedited) pedited->iptc = true; } } @@ -1054,15 +1114,15 @@ bool operator==(const DirPyrEqualizerParams & a, const DirPyrEqualizerParams & b return true; } -bool operator==(const ExifPair& a, const ExifPair& b) { +/*bool operator==(const ExifPairs& a, const ExifPairs& b) { return a.field == b.field && a.value == b.value; } -bool operator==(const IPTCPair& a, const IPTCPair& b) { +bool operator==(const IPTCPairs& a, const IPTCPairs& b) { return a.field == b.field && a.values == b.values; -} +}*/ bool ProcParams::operator== (const ProcParams& other) { return @@ -1115,23 +1175,21 @@ bool ProcParams::operator== (const ProcParams& other) { && vibrance.protectskins == other.vibrance.protectskins && vibrance.avoidcolorshift == other.vibrance.avoidcolorshift && vibrance.pastsattog == other.vibrance.pastsattog - && colorBoost.amount == other.colorBoost.amount - && colorBoost.avoidclip == other.colorBoost.avoidclip - && colorBoost.enable_saturationlimiter == other.colorBoost.enable_saturationlimiter - && colorBoost.saturationlimit == other.colorBoost.saturationlimit + //&& 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 - && colorShift.a == other.colorShift.a - && colorShift.b == other.colorShift.b + //&& colorShift.a == other.colorShift.a + //&& colorShift.b == other.colorShift.b && impulseDenoise.enabled == other.impulseDenoise.enabled && impulseDenoise.thresh == other.impulseDenoise.thresh && dirpyrDenoise.enabled == other.dirpyrDenoise.enabled && dirpyrDenoise.luma == other.dirpyrDenoise.luma && dirpyrDenoise.chroma == other.dirpyrDenoise.chroma && dirpyrDenoise.gamma == other.dirpyrDenoise.gamma - && dirpyrDenoise.lumcurve == other.dirpyrDenoise.lumcurve - && dirpyrDenoise.chromcurve == other.dirpyrDenoise.chromcurve && edgePreservingDecompositionUI.enabled == other.edgePreservingDecompositionUI.enabled && edgePreservingDecompositionUI.Strength == other.edgePreservingDecompositionUI.Strength && edgePreservingDecompositionUI.EdgeStopping == other.edgePreservingDecompositionUI.EdgeStopping @@ -1140,13 +1198,12 @@ bool ProcParams::operator== (const ProcParams& other) { && defringe.enabled == other.defringe.enabled && defringe.radius == other.defringe.radius && defringe.threshold == other.defringe.threshold - && lumaDenoise.enabled == other.lumaDenoise.enabled - && lumaDenoise.radius == other.lumaDenoise.radius - && lumaDenoise.edgetolerance == other.lumaDenoise.edgetolerance - && colorDenoise.enabled == other.colorDenoise.enabled - && colorDenoise.radius == other.colorDenoise.radius - && colorDenoise.edgetolerance == other.colorDenoise.edgetolerance - && colorDenoise.edgesensitive == other.colorDenoise.edgesensitive + //&& 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 @@ -1204,6 +1261,7 @@ bool ProcParams::operator== (const ProcParams& other) { && raw.cared == other.raw.cared && raw.cablue == other.raw.cablue && raw.hotdeadpix_filt == other.raw.hotdeadpix_filt + && raw.hotdeadpix_thresh == other.raw.hotdeadpix_thresh && raw.dmethod == other.raw.dmethod && raw.greenthresh == other.raw.greenthresh && raw.linenoise == other.raw.linenoise @@ -1233,12 +1291,92 @@ bool ProcParams::operator== (const ProcParams& other) { && raw.blackthree==other.raw.blackthree && raw.twogreen==other.raw.twogreen; - } +} bool ProcParams::operator!= (const ProcParams& other) { return !(*this==other); } + +PartialProfile::PartialProfile(bool createInstance) { + if (createInstance) { + pparams = new ProcParams(); + pedited = new ParamsEdited(); + } + else { + pparams = NULL; + pedited=NULL; + } +} + +PartialProfile::PartialProfile(ProcParams* pp, ParamsEdited* pe, bool fullCopy) { + if (fullCopy && pp) { + pparams = new ProcParams(*pp); + } + else + pparams = pp; + + if (fullCopy && pe) { + pedited = new ParamsEdited(*pe); + } + else + pedited = pe; +}; + +PartialProfile::PartialProfile(const ProcParams* pp, const ParamsEdited* pe) { + if (pp) { + pparams = new ProcParams(*pp); + } + else + pparams = NULL; + + if (pe) { + pedited = new ParamsEdited(*pe); + } + else + pedited = NULL; +}; + +int PartialProfile::load (Glib::ustring fName) { + if (!pparams) pparams = new ProcParams(); + if (!pedited) pedited = new ParamsEdited(); + return pparams->load(fName, pedited); +} + +void PartialProfile::deleteInstance () { + if (pparams) { delete pparams; pparams = NULL; } + if (pedited) { delete pedited; pedited = NULL; } +} + +/* + * 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) { + if (pedited->coarse.rotate) + destParams->coarse.rotate = 0; + if (pedited->coarse.hflip) + destParams->coarse.hflip = false; + if (pedited->coarse.vflip) + destParams->coarse.vflip = false; + + pedited->combine(*destParams, *pparams, true); + } +} + +void PartialProfile::set(bool v) { + if (pedited) pedited->set(v); +}; + } } diff --git a/rtengine/procparams.h b/rtengine/procparams.h index b1dbc3913..147f1b5b2 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -22,6 +22,8 @@ #include #include +class ParamsEdited; + namespace rtengine { namespace procparams { @@ -126,14 +128,14 @@ class VibranceParams { /** * Parameters of the color boost */ -class ColorBoostParams { +/*class ColorBoostParams { public: int amount; bool avoidclip; bool enable_saturationlimiter; double saturationlimit; -}; +};*/ /** * Parameters of the white balance adjustments @@ -179,36 +181,35 @@ class WBParams { /** * Parameters of the color shift */ -class ColorShiftParams { +/*class ColorShiftParams { public: double a; double b; -}; +};*/ /** * Parameters of the luminance denoising */ -class LumaDenoiseParams { +/*class LumaDenoiseParams { public: bool enabled; double radius; int edgetolerance; -}; +};*/ /** * Parameters of the color denoising */ -class ColorDenoiseParams { +/*class ColorDenoiseParams { public: bool enabled; - double radius; int edgetolerance; bool edgesensitive; int amount; -}; +};*/ /** * Parameters of defringing @@ -243,8 +244,6 @@ class ColorDenoiseParams { int luma; int chroma; float gamma; - std::vector lumcurve; - std::vector chromcurve; }; //EPD related parameters. @@ -420,24 +419,14 @@ class ColorManagementParams { }; /** - * A class representing a key/value for the exif metadata information + * Typedef for representing a key/value for the exif metadata information */ -class ExifPair { - - public: - Glib::ustring field; - Glib::ustring value; -}; +typedef std::map ExifPairs; /** * The IPTC key/value pairs */ -class IPTCPair { - - public: - Glib::ustring field; - std::vector values; -}; +typedef std::map > IPTCPairs; /** * Directional pyramid equalizer params @@ -522,11 +511,11 @@ class ProcParams { SharpenEdgeParams sharpenEdge; ///< Sharpen edge parameters SharpenMicroParams sharpenMicro; ///< Sharpen microcontrast parameters VibranceParams vibrance; ///< Vibrance parameters - ColorBoostParams colorBoost; ///< Color boost parameters + //ColorBoostParams colorBoost; ///< Color boost parameters WBParams wb; ///< White balance parameters - ColorShiftParams colorShift; ///< Color shift parameters - LumaDenoiseParams lumaDenoise; ///< Luminance denoising parameters - ColorDenoiseParams colorDenoise; ///< Color denoising parameters + //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 @@ -544,18 +533,18 @@ class ProcParams { HRecParams hlrecovery; ///< Highlight recovery parameters ResizeParams resize; ///< Resize parameters ColorManagementParams icm; ///< profiles/color spaces used during the image processing - ColorManagementParams gam; ///< profiles/color spaces used during the image processing RAWParams raw; ///< RAW parameters before demosaicing DirPyrEqualizerParams dirpyrequalizer; ///< directional pyramid equalizer parameters HSVEqualizerParams hsvequalizer; ///< hsv equalizer parameters - std::vector exif; ///< List of modifications appplied on the exif tags of the input image - std::vector iptc; ///< The IPTC tags and values to be saved to the output image char rank; ///< Custom image quality ranking char 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 + 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 /** * The constructor only sets the hand-wired defaults. @@ -568,17 +557,19 @@ class ProcParams { /** * 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 - * @param fname the name of the first file (can be an empty string) - * @param fname2 the name of the second file (can be an empty string) (optional) + * @param fname the name of the first file (can be an empty string) + * @param fname2 the name of the second file (can be an empty string) (optional) + * @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 (Glib::ustring fname, Glib::ustring fname2 = "") const; + int save (Glib::ustring fname, Glib::ustring fname2 = "", ParamsEdited* pedited=NULL) const; /** * 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 (Glib::ustring fname); + int load (Glib::ustring fname, ParamsEdited* pedited=NULL); /** Creates a new instance of ProcParams. * @return a pointer to the new ProcParams instance. */ @@ -603,6 +594,32 @@ class ProcParams { int write (Glib::ustring &fname, Glib::ustring &content) const; }; + +/** + * This class associate a ProcParams object and a ParamEdited object through a pointer + * to instance of each type in order to handle partial pp3 file loading (and later maybe + * saving too) + * + * PartialProfile is not responsible of ProcParams and ParamsEdited object creation + * and hence is not responsible of their destructions. The function that instanciate + * PartialProfile object has to handle all this itself. + */ +class PartialProfile { + public: + rtengine::procparams::ProcParams* pparams; + ParamsEdited* pedited; + PartialProfile& operator=(PartialProfile& rhs) { pparams=rhs.pparams; pedited=rhs.pedited; return *this; }; + + PartialProfile (bool createInstance=false); + PartialProfile (ProcParams* pp, ParamsEdited* pe=NULL, bool fullCopy=false); + PartialProfile (const ProcParams* pp, const ParamsEdited* pe=NULL); + void deleteInstance (); + void clearGeneral (); + int load (Glib::ustring fName); + void set (bool v); + void applyTo (ProcParams *destParams) const ; +}; + } } #endif diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index f170889b5..3fe8c1361 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -58,7 +58,7 @@ namespace rtengine { virtual bool hasIPTC () const =0; /** Returns the directory of IPTC tags. * @return The directory of IPTC tags */ - virtual const std::vector getIPTCData () const =0; + virtual const procparams::IPTCPairs getIPTCData () const =0; /** @return a struct containing the date and time of the image */ virtual struct tm getDateTime () const =0; /** @return a timestamp containing the date and time of the image */ diff --git a/rtexif/CMakeLists.txt b/rtexif/CMakeLists.txt index 90d39c836..e22ac7fef 100644 --- a/rtexif/CMakeLists.txt +++ b/rtexif/CMakeLists.txt @@ -3,8 +3,17 @@ add_library (rtexif rtexif.cc stdattribs.cc nikonattribs.cc canonattribs.cc IF (WIN32) set_target_properties (rtexif PROPERTIES COMPILE_FLAGS " -ffast-math -fexpensive-optimizations") + include_directories (${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} + ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS}) + link_directories (. ../rtexif ${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} + ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS}) + #set_target_properties (rth PROPERTIES LINK_FLAGS "-mwindows") ELSE (WIN32) set_target_properties (rtexif PROPERTIES COMPILE_FLAGS " -ffast-math -fexpensive-optimizations -fPIC") + include_directories (${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} + ${GLIBMM_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS}) + link_directories (${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} + ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS}) ENDIF (WIN32) IF (BUILD_SHARED_LIBS) diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index 50d7f6dcf..bc8c7e095 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -1404,7 +1404,7 @@ const std::vector& ExifManager::getDefaultTIFFTags (TagDirectory* forthis) -int ExifManager::createJPEGMarker (const TagDirectory* root, const std::vector< std::pair >& changeList, int W, int H, unsigned char* buffer) { +int ExifManager::createJPEGMarker (const TagDirectory* root, const rtengine::procparams::ExifPairs& changeList, int W, int H, unsigned char* buffer) { // write tiff header int offs = 6; @@ -1423,8 +1423,8 @@ int ExifManager::createJPEGMarker (const TagDirectory* root, const std::vector< else cl = new TagDirectory (NULL, ifdAttribs, INTEL); - for (int i=0; iapplyChange (changeList[i].first, changeList[i].second); + for (rtengine::procparams::ExifPairs::const_iterator i=changeList.begin(); i!=changeList.end(); i++) + cl->applyChange (i->first, i->second); getDefaultTIFFTags (cl); @@ -1442,7 +1442,7 @@ int ExifManager::createJPEGMarker (const TagDirectory* root, const std::vector< return size + 6; } -int ExifManager::createTIFFHeader (const TagDirectory* root, const std::vector< std::pair >& changeList, int W, int H, int bps, const char* profiledata, int profilelen, const char* iptcdata, int iptclen, unsigned char* buffer) { +int ExifManager::createTIFFHeader (const TagDirectory* root, const rtengine::procparams::ExifPairs& changeList, int W, int H, int bps, const char* profiledata, int profilelen, const char* iptcdata, int iptclen, unsigned char* buffer) { // write tiff header int offs = 0; @@ -1489,8 +1489,8 @@ int ExifManager::createTIFFHeader (const TagDirectory* root, const std::vector< } // apply list of changes - for (int i=0; iapplyChange (changeList[i].first, changeList[i].second); + for (rtengine::procparams::ExifPairs::const_iterator i=changeList.begin(); i!=changeList.end(); i++) + cl->applyChange (i->first, i->second); // append default properties getDefaultTIFFTags (cl); diff --git a/rtexif/rtexif.h b/rtexif/rtexif.h index 95a1723bc..58c1bbc8c 100644 --- a/rtexif/rtexif.h +++ b/rtexif/rtexif.h @@ -26,6 +26,7 @@ #include #include #include +#include "../rtengine/procparams.h" namespace rtexif { @@ -203,8 +204,8 @@ class ExifManager { static void parseCIFF (FILE* f, int base, int length, TagDirectory* root); static const std::vector& getDefaultTIFFTags (TagDirectory* forthis); - static int createJPEGMarker (const TagDirectory* root, const std::vector< std::pair >& changeList, int W, int H, unsigned char* buffer); - static int createTIFFHeader (const TagDirectory* root, const std::vector< std::pair >& changeList, int W, int H, int bps, const char* profiledata, int profilelen, const char* iptcdata, int iptclen, unsigned char* buffer); + static int createJPEGMarker (const TagDirectory* root, const rtengine::procparams::ExifPairs& changeList, int W, int H, unsigned char* buffer); + static int createTIFFHeader (const TagDirectory* root, const rtengine::procparams::ExifPairs& changeList, int W, int H, int bps, const char* profiledata, int profilelen, const char* iptcdata, int iptclen, unsigned char* buffer); }; class Interpreter { diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index 26be6a17b..97ef4fc1a 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -45,8 +45,6 @@ else (WIN32) ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${GIO_LIBRARY_DIRS} ${GIOMM_LIBRARY_DIRS} ${IPTCDATA_LIBRARY_DIRS} ${LCMS_LIBRARY_DIRS} ${GTHREAD_LIBRARY_DIRS} ${GOBJECT_LIBRARY_DIRS}) endif (WIN32) # create config.h which defines where data are stored -message (STATUS --- CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR}) -message (STATUS --- CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h) add_executable (rth ${EXTRA_SRC} ${BASESOURCEFILES}) diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index 98da9a8a9..d7a216055 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -77,7 +77,7 @@ void BatchToolPanelCoordinator::closeSession (bool save) { for (unsigned int j=0; jtrimValues (&newParams); - selected[i]->setProcParams (newParams, BATCHEDITOR, true); + selected[i]->setProcParams (newParams, NULL, BATCHEDITOR, true); } } for (int i=0; iaddThumbnailListener (this); } + // compare all the ProcParams and describe which parameters has different (i.e. inconsistent) values in pparamsEdited pparamsEdited.initFrom (initialPP); crop->setDimensions (100000, 100000); @@ -188,7 +189,7 @@ void BatchToolPanelCoordinator::initSession () { if (options.baBehav[ADDSET_SHARPENMICRO_UNIFORMITY]) pparams.sharpenMicro.uniformity = 0; if (options.baBehav[ADDSET_CHMIXER]) for (int i=0; i<3; i++) pparams.chmixer.red[i] = pparams.chmixer.green[i] = pparams.chmixer.blue[i] = 0; - if (options.baBehav[ADDSET_LD_EDGETOLERANCE]) pparams.lumaDenoise.edgetolerance = 0; + //if (options.baBehav[ADDSET_LD_EDGETOLERANCE]) pparams.lumaDenoise.edgetolerance = 0; if (options.baBehav[ADDSET_WB_TEMPERATURE]) pparams.wb.temperature = 0; if (options.baBehav[ADDSET_WB_GREEN]) pparams.wb.green = 0; @@ -199,10 +200,10 @@ void BatchToolPanelCoordinator::initSession () { if (options.baBehav[ADDSET_FREE_OUPUT_GAMMA]) pparams.icm.gampos = 0; if (options.baBehav[ADDSET_FREE_OUTPUT_SLOPE]) pparams.icm.slpos = 0; - if (options.baBehav[ADDSET_CBOOST_AMOUNT]) pparams.colorBoost.amount = 0; + //if (options.baBehav[ADDSET_CBOOST_AMOUNT]) pparams.colorBoost.amount = 0; - if (options.baBehav[ADDSET_CS_BLUEYELLOW]) pparams.colorShift.a = 0; - if (options.baBehav[ADDSET_CS_GREENMAGENTA]) pparams.colorShift.b = 0; + //if (options.baBehav[ADDSET_CS_BLUEYELLOW]) pparams.colorShift.a = 0; + //if (options.baBehav[ADDSET_CS_GREENMAGENTA]) pparams.colorShift.b = 0; if (options.baBehav[ADDSET_ROTATE_DEGREE]) pparams.rotate.degree = 0; if (options.baBehav[ADDSET_DIST_AMOUNT]) pparams.distortion.amount = 0; @@ -228,6 +229,7 @@ void BatchToolPanelCoordinator::initSession () { toolPanels[i]->read (&pparams, &pparamsEdited); } for (int i=0; iprocParamsChanged (&pparams, rtengine::EvPhotoLoaded, M("BATCH_PROCESSING"), &pparamsEdited); } } @@ -271,7 +273,7 @@ void BatchToolPanelCoordinator::panelChanged (rtengine::ProcEvent event, const G for (unsigned int j=0; jtrimValues (&newParams); - selected[i]->setProcParams (newParams, BATCHEDITOR, false); + selected[i]->setProcParams (newParams, NULL, BATCHEDITOR, false); } for (int i=0; i ACTUALLY NOT SUPPORTED + return; + } + + pparams = *(nparams->pparams); if (paramsEdited) pparamsEdited = *paramsEdited; + for (int i=0; iread (&pparams, &pparamsEdited); somethingChanged = true; @@ -319,12 +334,12 @@ void BatchToolPanelCoordinator::profileChange (const ProcParams *nparams, rteng for (int i=0; iwrite (&pparams, &pparamsEdited); - // combine with initial parameters and set + // combine with initial parameters of each image and set ProcParams newParams; for (int i=0; isetProcParams (newParams, BATCHEDITOR, false); + selected[i]->setProcParams (newParams, NULL, BATCHEDITOR, false); } for (int i=0; i #include "../rtengine/rtengine.h" +#include "../rtengine/procparams.h" +#include "paramsedited.h" #include "mydiagonalcurve.h" class Clipboard { - + bool _hasIPTC; - std::vector iptc; - bool _hasProcParams; - rtengine::procparams::ProcParams procParams; + rtengine::procparams::IPTCPairs iptc; + rtengine::procparams::PartialProfile partProfile; DiagonalCurveType hasCurveDataType; std::vector curve; public: - void setIPTC (const std::vector& iptcc) { iptc = iptcc; _hasIPTC = true;} - const std::vector& getIPTC () { return iptc; } + void setIPTC (const rtengine::procparams::IPTCPairs& iptcc) { iptc = iptcc; _hasIPTC = true;} + const rtengine::procparams::IPTCPairs& getIPTC () { return iptc; } bool hasIPTC () { return _hasIPTC; } - - void setProcParams (const rtengine::procparams::ProcParams& pparams) { procParams = pparams; _hasProcParams = true; } - const rtengine::procparams::ProcParams& getProcParams () { return procParams; } - bool hasProcParams () { return _hasProcParams; } + + void setPartialProfile (const rtengine::procparams::PartialProfile& pprofile); + const rtengine::procparams::PartialProfile& getPartialProfile () { return partProfile; }; + void setProcParams (const rtengine::procparams::ProcParams& pparams); + const rtengine::procparams::ProcParams& getProcParams () { return *partProfile.pparams; } + bool hasProcParams () { return partProfile.pparams; } + bool hasPEdited () { return partProfile.pedited; } void setCurveData (std::vector& p, DiagonalCurveType type ) { curve = p; hasCurveDataType = type; return; } const std::vector & getCurveData () { return curve; } DiagonalCurveType hasCurveData () { return hasCurveDataType; } + Clipboard (); + ~Clipboard (); }; diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 1202fd307..e194e6a76 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -479,7 +479,7 @@ void EditorPanel::saveProfile () { ipc->getParams (¶ms); // Will call updateCache, which will update both the cached and sidecar files if necessary - openThm->setProcParams (params, EDITOR); + openThm->setProcParams (params, NULL, EDITOR); } } @@ -592,7 +592,7 @@ void EditorPanel::refreshProcessingState (bool inProcessingP) { if (ipc && openThm && tpc->getChangedState()) { rtengine::procparams::ProcParams pparams; ipc->getParams (&pparams); - openThm->setProcParams (pparams, EDITOR, false); + openThm->setProcParams (pparams, NULL, EDITOR, false); } // Ring a sound if it was a long event @@ -908,8 +908,13 @@ bool EditorPanel::handleShortcutKey (GdkEventKey* event) { void EditorPanel::procParamsChanged (Thumbnail* thm, int whoChangedIt) { - if (whoChangedIt!=EDITOR) - tpc->profileChange (&openThm->getProcParams(), rtengine::EvProfileChangeNotification, M("PROGRESSDLG_PROFILECHANGEDINBROWSER")); + if (whoChangedIt!=EDITOR) { + PartialProfile pp(true); + pp.set(true); + *(pp.pparams) = openThm->getProcParams(); + tpc->profileChange (&pp, rtengine::EvProfileChangeNotification, M("PROGRESSDLG_PROFILECHANGEDINBROWSER")); + pp.deleteInstance(); + } } bool EditorPanel::idle_saveImage (ProgressConnector *pc, Glib::ustring fname, SaveFormat sf) { diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc index b696ab641..828ef877c 100644 --- a/rtgui/exifpanel.cc +++ b/rtgui/exifpanel.cc @@ -512,27 +512,15 @@ void ExifPanel::updateChangeList (Gtk::TreeModel::Children root, std::string pre if (prefix!="") prefix = prefix + "."; - + Gtk::TreeModel::iterator iter; for (iter = root.begin(); iter!=root.end(); iter++) { - if (iter->get_value (exifColumns.edited) == true) { - ExifPair ec; - ec.field = prefix + iter->get_value (exifColumns.field_nopango); - ec.value = iter->get_value (exifColumns.value_nopango); - changeList.push_back (ec); - } - else if (iter->get_value (exifColumns.action) == WRITE && iter->get_value (exifColumns.icon) == delicon) { - ExifPair ec; - ec.field = prefix + iter->get_value (exifColumns.field_nopango); - ec.value = "#delete"; - changeList.push_back (ec); - } - else if (iter->get_value (exifColumns.action) == DONTWRITE && iter->get_value (exifColumns.icon) == keepicon) { - ExifPair ec; - ec.field = prefix + iter->get_value (exifColumns.field_nopango); - ec.value = "#keep"; - changeList.push_back (ec); - } + if (iter->get_value (exifColumns.edited) == true) + changeList[ prefix+iter->get_value (exifColumns.field_nopango) ] = iter->get_value (exifColumns.value_nopango); + else if (iter->get_value (exifColumns.action) == WRITE && iter->get_value (exifColumns.icon) == delicon) + changeList[ prefix+iter->get_value (exifColumns.field_nopango) ] = "#delete"; + else if (iter->get_value (exifColumns.action) == DONTWRITE && iter->get_value (exifColumns.icon) == keepicon) + changeList[ prefix+iter->get_value (exifColumns.field_nopango) ] = "#keep"; if (iter->get_value (exifColumns.icon) == keepicon) updateChangeList (iter->children(), prefix + iter->get_value (exifColumns.field_nopango)); } @@ -546,8 +534,8 @@ void ExifPanel::updateChangeList () { void ExifPanel::applyChangeList () { - for (int i=0; ichildren(), changeList[i].field, changeList[i].value); + for (rtengine::procparams::ExifPairs::iterator i=changeList.begin(); i!=changeList.end(); i++) + editTag (exifTreeModel->children(), i->first, i->second); } void ExifPanel::row_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column) { diff --git a/rtgui/exifpanel.h b/rtgui/exifpanel.h index eb9e10a49..5dbc3676b 100644 --- a/rtgui/exifpanel.h +++ b/rtgui/exifpanel.h @@ -28,8 +28,8 @@ class ExifPanel : public Gtk::VBox, public ToolPanel { const rtengine::ImageMetaData* idata; int fullw, fullh, cx, cy, cw, ch; bool crenabled; - std::vector changeList; - std::vector defChangeList; + rtengine::procparams::ExifPairs changeList; + rtengine::procparams::ExifPairs defChangeList; bool recursiveOp; class ExifColumns : public Gtk::TreeModelColumnRecord { diff --git a/rtgui/exportpanel.cc b/rtgui/exportpanel.cc index aabf59ddc..4e060b97a 100644 --- a/rtgui/exportpanel.cc +++ b/rtgui/exportpanel.cc @@ -50,8 +50,8 @@ ExportPanel::ExportPanel () : listener (NULL) { bypass_sharpening = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_SHARPENING"))); bypass_sharpenEdge = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_SHARPENEDGE"))); bypass_sharpenMicro = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_SHARPENMICRO"))); - bypass_lumaDenoise = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_LUMADENOISE"))); - bypass_colorDenoise = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_COLORDENOISE"))); + //bypass_lumaDenoise = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_LUMADENOISE"))); + //bypass_colorDenoise = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_COLORDENOISE"))); bypass_defringe = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_DEFRINGE"))); bypass_dirpyrDenoise = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_DIRPYRDENOISE"))); bypass_sh_hq = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_SH_HQ"))); @@ -162,8 +162,8 @@ ExportPanel::ExportPanel () : listener (NULL) { bypass_sharpeningConn = bypass_sharpening->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_sharpenEdgeConn = bypass_sharpenEdge->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_sharpenMicroConn = bypass_sharpenMicro->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); - bypass_lumaDenoiseConn = bypass_lumaDenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); - bypass_colorDenoiseConn = bypass_colorDenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); + //bypass_lumaDenoiseConn = bypass_lumaDenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); + //bypass_colorDenoiseConn = bypass_colorDenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_defringeConn = bypass_defringe->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_dirpyrDenoiseConn = bypass_dirpyrDenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_sh_hqConn = bypass_sh_hq->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); @@ -201,8 +201,8 @@ void ExportPanel::SaveSettingsAsDefault(){ options.fastexport_bypass_sharpening = bypass_sharpening->get_active (); options.fastexport_bypass_sharpenEdge = bypass_sharpenEdge->get_active (); options.fastexport_bypass_sharpenMicro = bypass_sharpenMicro->get_active (); - options.fastexport_bypass_lumaDenoise = bypass_lumaDenoise->get_active (); - options.fastexport_bypass_colorDenoise = bypass_colorDenoise->get_active (); + //options.fastexport_bypass_lumaDenoise = bypass_lumaDenoise->get_active (); + //options.fastexport_bypass_colorDenoise = bypass_colorDenoise->get_active (); options.fastexport_bypass_defringe = bypass_defringe->get_active (); options.fastexport_bypass_dirpyrDenoise = bypass_dirpyrDenoise->get_active (); options.fastexport_bypass_sh_hq = bypass_sh_hq->get_active (); @@ -254,8 +254,8 @@ void ExportPanel::LoadDefaultSettings(){ bypass_sharpening->set_active (options.fastexport_bypass_sharpening ); bypass_sharpenEdge->set_active (options.fastexport_bypass_sharpenEdge ); bypass_sharpenMicro->set_active (options.fastexport_bypass_sharpenMicro ); - bypass_lumaDenoise->set_active (options.fastexport_bypass_lumaDenoise ); - bypass_colorDenoise->set_active (options.fastexport_bypass_colorDenoise ); + //bypass_lumaDenoise->set_active (options.fastexport_bypass_lumaDenoise ); + //bypass_colorDenoise->set_active (options.fastexport_bypass_colorDenoise ); bypass_defringe->set_active (options.fastexport_bypass_defringe ); bypass_dirpyrDenoise->set_active (options.fastexport_bypass_dirpyrDenoise ); bypass_sh_hq->set_active (options.fastexport_bypass_sh_hq ); @@ -323,8 +323,8 @@ void ExportPanel::bypassALL_Toggled(){ bypass_sharpeningConn.block (true); bypass_sharpenEdgeConn.block (true); bypass_sharpenMicroConn.block (true); - bypass_lumaDenoiseConn.block (true); - bypass_colorDenoiseConn.block (true); + //bypass_lumaDenoiseConn.block (true); + //bypass_colorDenoiseConn.block (true); bypass_defringeConn.block (true); bypass_dirpyrDenoiseConn.block (true); bypass_sh_hqConn.block (true); @@ -344,8 +344,8 @@ void ExportPanel::bypassALL_Toggled(){ bypass_sharpening->set_active(bypass_ALL->get_active()); bypass_sharpenEdge->set_active(bypass_ALL->get_active()); bypass_sharpenMicro->set_active(bypass_ALL->get_active()); - bypass_lumaDenoise->set_active(bypass_ALL->get_active()); - bypass_colorDenoise->set_active(bypass_ALL->get_active()); + //bypass_lumaDenoise->set_active(bypass_ALL->get_active()); + //bypass_colorDenoise->set_active(bypass_ALL->get_active()); bypass_defringe->set_active(bypass_ALL->get_active()); bypass_dirpyrDenoise->set_active(bypass_ALL->get_active()); bypass_sh_hq->set_active(bypass_ALL->get_active()); @@ -363,8 +363,8 @@ void ExportPanel::bypassALL_Toggled(){ bypass_sharpeningConn.block (false); bypass_sharpenEdgeConn.block (false); bypass_sharpenMicroConn.block (false); - bypass_lumaDenoiseConn.block (false); - bypass_colorDenoiseConn.block (false); + //bypass_lumaDenoiseConn.block (false); + //bypass_colorDenoiseConn.block (false); bypass_defringeConn.block (false); bypass_dirpyrDenoiseConn.block (false); bypass_sh_hqConn.block (false); diff --git a/rtgui/exportpanel.h b/rtgui/exportpanel.h index d9cd8661e..f7318967a 100644 --- a/rtgui/exportpanel.h +++ b/rtgui/exportpanel.h @@ -39,8 +39,8 @@ class ExportPanel : public Gtk::VBox { Gtk::CheckButton* bypass_sharpenEdge; Gtk::CheckButton* bypass_sharpenMicro; Gtk::CheckButton* bypass_sharpening; - Gtk::CheckButton* bypass_lumaDenoise; - Gtk::CheckButton* bypass_colorDenoise; + //Gtk::CheckButton* bypass_lumaDenoise; + //Gtk::CheckButton* bypass_colorDenoise; Gtk::CheckButton* bypass_defringe; Gtk::CheckButton* bypass_dirpyrDenoise; Gtk::CheckButton* bypass_sh_hq; @@ -77,8 +77,8 @@ class ExportPanel : public Gtk::VBox { sigc::connection bypass_sharpeningConn ; sigc::connection bypass_sharpenEdgeConn ; sigc::connection bypass_sharpenMicroConn ; - sigc::connection bypass_lumaDenoiseConn ; - sigc::connection bypass_colorDenoiseConn ; + //sigc::connection bypass_lumaDenoiseConn ; + //sigc::connection bypass_colorDenoiseConn ; sigc::connection bypass_defringeConn ; sigc::connection bypass_dirpyrDenoiseConn ; sigc::connection bypass_sh_hqConn ; diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 737e9004d..0c8c7a8d3 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -32,7 +32,7 @@ extern Options options; FileBrowser::FileBrowser () - : tbl(NULL),numFiltered(0) { + : tbl(NULL),numFiltered(0), partialPasteDlg(M("PARTIALPASTE_DIALOGLABEL")) { fbih = new FileBrowserIdleHelper; fbih->fbrowser = this; @@ -514,7 +514,7 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m) { rtengine::procparams::ProcParams pp=mselected[i]->thumbnail->getProcParams(); pp.raw.df_autoselect= true; pp.raw.dark_frame.clear(); - mselected[i]->thumbnail->setProcParams(pp,FILEBROWSER,false); + mselected[i]->thumbnail->setProcParams(pp,NULL,FILEBROWSER,false); } }else if (m==selectDF){ if( !mselected.empty() ){ @@ -531,7 +531,7 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m) { rtengine::procparams::ProcParams pp=mselected[i]->thumbnail->getProcParams(); pp.raw.dark_frame= fc.get_filename(); pp.raw.df_autoselect= false; - mselected[i]->thumbnail->setProcParams(pp,FILEBROWSER,false); + mselected[i]->thumbnail->setProcParams(pp,NULL,FILEBROWSER,false); } } } @@ -553,7 +553,7 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m) { rtengine::procparams::ProcParams pp=mselected[i]->thumbnail->getProcParams(); pp.raw.ff_AutoSelect= true; pp.raw.ff_file.clear(); - mselected[i]->thumbnail->setProcParams(pp,FILEBROWSER,false); + mselected[i]->thumbnail->setProcParams(pp,NULL,FILEBROWSER,false); } } else if (m==selectFF){ @@ -571,7 +571,7 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m) { rtengine::procparams::ProcParams pp=mselected[i]->thumbnail->getProcParams(); pp.raw.ff_file= fc.get_filename(); pp.raw.ff_AutoSelect= false; - mselected[i]->thumbnail->setProcParams(pp,FILEBROWSER,false); + mselected[i]->thumbnail->setProcParams(pp,NULL,FILEBROWSER,false); } } } @@ -605,7 +605,7 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m) { // Empty run to update the thumb rtengine::procparams::ProcParams params = mselected[i]->thumbnail->getProcParams (); - mselected[i]->thumbnail->setProcParams (params, FILEBROWSER); + mselected[i]->thumbnail->setProcParams (params, NULL, FILEBROWSER); } } else if (m==clearFromCache) { for (int i=0; i mselected; - for (int i=0; i(selected[i])); + if (clipboard.hasProcParams()) { + std::vector mselected; + for (unsigned int i=0; i(selected[i])); - if (!tbl || mselected.empty()) - return; + if (!tbl || mselected.empty()) + return; - for (int i=0; ithumbnail->setProcParams (clipboard.getProcParams(), FILEBROWSER); - - queue_draw (); -} + for (unsigned int i=0; i mselected; - for (int i=0; i(selected[i])); - - if (!tbl || mselected.empty()) - return; - - if (partialPasteDlg.run ()) { - - for (int i=0; ithumbnail->createProcParamsForUpdate(false,false); // this can execute customprofilebuilder to generate param file - rtengine::procparams::ProcParams params = mselected[i]->thumbnail->getProcParams (); - partialPasteDlg.applyPaste (¶ms, &clipboard.getProcParams()); - mselected[i]->thumbnail->setProcParams (params, FILEBROWSER); + // applying the PartialProfile to the thumb's ProcParams + mselected[i]->thumbnail->setProcParams (*pastedPartProf.pparams, pastedPartProf.pedited, FILEBROWSER); + pastedPartProf.deleteInstance(); } queue_draw (); } - partialPasteDlg.hide (); +} + +void FileBrowser::partPasteProfile () { + + if (clipboard.hasProcParams()) { + + std::vector mselected; + for (unsigned int i=0; i(selected[i])); + + if (!tbl || mselected.empty()) + return; + + int i = partialPasteDlg.run (); + if (i == Gtk::RESPONSE_OK) { + + for (unsigned int i=0; ithumbnail->createProcParamsForUpdate(false,false); // this can execute customprofilebuilder to generate param file + rtengine::procparams::PartialProfile cbPartProf = clipboard.getPartialProfile(); + rtengine::procparams::PartialProfile pastedPartProf(&mselected[i]->thumbnail->getProcParams (), NULL); + + // pushing the selected values of the clipboard PartialProfile to the temporary PartialProfile + partialPasteDlg.applyPaste (pastedPartProf.pparams, pastedPartProf.pedited, cbPartProf.pparams, cbPartProf.pedited); + + // applying the temporary PartialProfile to the thumb's ProcParams + mselected[i]->thumbnail->setProcParams (*pastedPartProf.pparams, pastedPartProf.pedited, FILEBROWSER); + pastedPartProf.deleteInstance(); + } + + queue_draw (); + } + partialPasteDlg.hide (); + } } void FileBrowser::openDefaultViewer (int destination) { @@ -726,10 +746,10 @@ bool FileBrowser::keyPressed (GdkEventKey* event) { void FileBrowser::applyMenuItemActivated (Glib::ustring ppname) { - rtengine::procparams::ProcParams* pparams = profileStore.getProfile (ppname); - if (pparams && !selected.empty()) { - for (int i=0; i(selected[i]))->thumbnail->setProcParams (*pparams, FILEBROWSER); + rtengine::procparams::PartialProfile* partProfile = profileStore.getProfile (ppname); + if (partProfile->pparams && !selected.empty()) { + for (int i=0; i(selected[i]))->thumbnail->setProcParams (*partProfile->pparams, partProfile->pedited, FILEBROWSER); queue_draw (); } } @@ -739,17 +759,20 @@ void FileBrowser::applyPartialMenuItemActivated (Glib::ustring ppname) { if (!tbl || selected.empty()) return; - rtengine::procparams::ProcParams* pparams = profileStore.getProfile (ppname); + rtengine::procparams::PartialProfile* srcProfiles = profileStore.getProfile (ppname); - if (pparams) { - if (partialPasteDlg.run ()) { + if (srcProfiles->pparams) { + if (partialPasteDlg.run()==Gtk::RESPONSE_OK) { for (int i=0; ithumbnail->createProcParamsForUpdate(false, false); // this can execute customprofilebuilder to generate param file + selected[i]->thumbnail->createProcParamsForUpdate(false, false); // this can execute customprofilebuilder to generate param file - rtengine::procparams::ProcParams params = (static_cast(selected[i]))->thumbnail->getProcParams (); - partialPasteDlg.applyPaste (¶ms, pparams); - (static_cast(selected[i]))->thumbnail->setProcParams (params, FILEBROWSER); + rtengine::procparams::PartialProfile dstProfile(true); + *dstProfile.pparams = (static_cast(selected[i]))->thumbnail->getProcParams (); + dstProfile.set(true); + partialPasteDlg.applyPaste (dstProfile.pparams, dstProfile.pedited, srcProfiles->pparams, srcProfiles->pedited); + (static_cast(selected[i]))->thumbnail->setProcParams (*dstProfile.pparams, dstProfile.pedited, FILEBROWSER); + dstProfile.deleteInstance(); } queue_draw (); } diff --git a/rtgui/filebrowser.h b/rtgui/filebrowser.h index cdd38d499..6aba267cd 100644 --- a/rtgui/filebrowser.h +++ b/rtgui/filebrowser.h @@ -102,8 +102,8 @@ class FileBrowser : public ThumbBrowserBase, FileBrowserListener* tbl; BrowserFilter filter; - PartialPasteDlg partialPasteDlg; int numFiltered; + PartialPasteDlg partialPasteDlg; FileBrowserIdleHelper* fbih; void toTrashRequested (std::vector tbe); diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 1dd9c3b78..75bb63d5a 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -867,8 +867,8 @@ void FileCatalog::developRequested (std::vector tbe, bool fas if (options.fastexport_bypass_sharpening ) params.sharpening.enabled = false; if (options.fastexport_bypass_sharpenEdge ) params.sharpenEdge.enabled = false; if (options.fastexport_bypass_sharpenMicro ) params.sharpenMicro.enabled = false; - if (options.fastexport_bypass_lumaDenoise ) params.lumaDenoise.enabled = false; - if (options.fastexport_bypass_colorDenoise ) params.colorDenoise.enabled = false; + //if (options.fastexport_bypass_lumaDenoise ) params.lumaDenoise.enabled = false; + //if (options.fastexport_bypass_colorDenoise ) params.colorDenoise.enabled = false; if (options.fastexport_bypass_defringe ) params.defringe.enabled = false; if (options.fastexport_bypass_dirpyrDenoise ) params.dirpyrDenoise.enabled = false; if (options.fastexport_bypass_sh_hq ) params.sh.hq = false; diff --git a/rtgui/history.cc b/rtgui/history.cc index 920d5dd7a..e9212c3e6 100644 --- a/rtgui/history.cc +++ b/rtgui/history.cc @@ -144,9 +144,12 @@ void History::historySelectionChanged () { if (row) bTreeView->get_selection()->unselect_all (); if (row && tpc) { - ProcParams params = row[historyColumns.params]; + ProcParams pparams = row[historyColumns.params]; + ParamsEdited pe; + pe.set(true); + PartialProfile pp(&pparams, &pe); ParamsEdited paramsEdited = row[historyColumns.paramsEdited]; - tpc->profileChange (¶ms, EvHistoryBrowsed, row[historyColumns.text], ¶msEdited); + tpc->profileChange (&pp, EvHistoryBrowsed, row[historyColumns.text], ¶msEdited); } if (blistener && blistenerLock==false) { Gtk::TreeModel::Path path = historyModel->get_path (iter); @@ -167,9 +170,12 @@ void History::bookmarkSelectionChanged () { if (row) hTreeView->get_selection()->unselect_all (); if (row && tpc) { - ProcParams params = row[bookmarkColumns.params]; + ProcParams pparams = row[bookmarkColumns.params]; + ParamsEdited pe; + pe.set(true); + PartialProfile pp(&pparams, &pe); ParamsEdited paramsEdited = row[bookmarkColumns.paramsEdited]; - tpc->profileChange (¶ms, EvBookmarkSelected, row[bookmarkColumns.text], ¶msEdited); + tpc->profileChange (&pp, EvBookmarkSelected, row[bookmarkColumns.text], ¶msEdited); } } } @@ -201,7 +207,7 @@ void History::procParamsChanged (ProcParams* params, ProcEvent ev, Glib::ustring if (size>0) row = historyModel->children()[size-1]; // if there is no last item or its chev!=ev, create a new one - if (size==0 || !row || row[historyColumns.chev]!=ev) { + if (size==0 || !row || row[historyColumns.chev]!=ev || ev==EvProfileChanged) { Gtk::TreeModel::Row newrow = *(historyModel->append()); newrow[historyColumns.realText] = eventDescrArray[ev]; newrow[historyColumns.text] = text; diff --git a/rtgui/iptcpanel.cc b/rtgui/iptcpanel.cc index b0d592006..4a0c216c0 100644 --- a/rtgui/iptcpanel.cc +++ b/rtgui/iptcpanel.cc @@ -339,6 +339,7 @@ IPTCPanel::IPTCPanel () { void IPTCPanel::read (const ProcParams* pp, const ParamsEdited* pedited) { disableListener (); + changeList.clear(); if (!pp->iptc.empty()) changeList = pp->iptc; else @@ -377,7 +378,7 @@ void IPTCPanel::addKeyWord () { keyword->get_entry()->select_region (0, keyword->get_entry()->get_text().size()); - for (int i=0; isize(); i++) + for (unsigned int i=0; isize(); i++) if (keywords->get_text (i) == keyword->get_entry()->get_text()) return; @@ -390,7 +391,7 @@ void IPTCPanel::addKeyWord () { items.push_back (s); } keyword->clear_items (); - for (int i=0; i<10 && iappend_text (items[i]); keywords->scroll_to_row (keywords->get_model()->get_path(--keywords->get_model()->children().end())); @@ -402,11 +403,11 @@ void IPTCPanel::delKeyWord () { std::vector selection = keywords->get_selected (); if (!selection.empty()) { std::vector keep; - for (int i=0; isize(); i++) + for (unsigned int i=0; isize(); i++) if (std::find (selection.begin(), selection.end(), i) == selection.end()) keep.push_back (keywords->get_text (i)); keywords->clear_items (); - for (int i=0; iappend_text (keep[i]); } @@ -415,7 +416,7 @@ void IPTCPanel::delKeyWord () { void IPTCPanel::addSuppCategory () { - for (int i=0; isize(); i++) + for (unsigned int i=0; isize(); i++) if (suppCategories->get_text (i) == suppCategory->get_entry()->get_text()) return; @@ -428,7 +429,7 @@ void IPTCPanel::addSuppCategory () { items.push_back (s); } suppCategory->clear_items (); - for (int i=0; i<10 && iappend_text (items[i]); suppCategories->scroll_to_row (suppCategories->get_model()->get_path(--suppCategories->get_model()->children().end())); suppCategory->get_entry()->select_region (0, suppCategory->get_entry()->get_text().size()); @@ -441,11 +442,11 @@ void IPTCPanel::delSuppCategory () { std::vector selection = suppCategories->get_selected (); if (!selection.empty()) { std::vector keep; - for (int i=0; isize(); i++) + for (unsigned int i=0; isize(); i++) if (std::find (selection.begin(), selection.end(), i) == selection.end()) keep.push_back (suppCategories->get_text (i)); suppCategories->clear_items (); - for (int i=0; iappend_text (keep[i]); } @@ -455,45 +456,30 @@ void IPTCPanel::delSuppCategory () { void IPTCPanel::updateChangeList () { changeList.clear (); - changeList.resize (18); - changeList[0].field = "Caption"; - changeList[0].values.push_back (captionText->get_text ()); - changeList[1].field = "CaptionWriter"; - changeList[1].values.push_back (captionWriter->get_text ()); - changeList[2].field = "Headline"; - changeList[2].values.push_back (headline->get_text ()); - changeList[3].field = "Instructions"; - changeList[3].values.push_back (instructions->get_text ()); - changeList[4].field = "Keywords"; - for (int i=0; isize(); i++) - changeList[4].values.push_back (keywords->get_text (i)); - changeList[5].field = "Category"; - changeList[5].values.push_back (category->get_entry()->get_text ()); - changeList[6].field = "SupplementalCategories"; - for (int i=0; isize(); i++) - changeList[6].values.push_back (suppCategories->get_text (i)); - changeList[7].field = "Author"; - changeList[7].values.push_back (author->get_text ()); - changeList[8].field = "AuthorsPosition"; - changeList[8].values.push_back (authorPos->get_text ()); - changeList[9].field = "Credit"; - changeList[9].values.push_back (credit->get_text ()); - changeList[10].field = "Source"; - changeList[10].values.push_back (source->get_text ()); - changeList[11].field = "Copyright"; - changeList[11].values.push_back (copyright->get_text ()); - changeList[12].field = "City"; - changeList[12].values.push_back (city->get_text ()); - changeList[13].field = "Province"; - changeList[13].values.push_back (province->get_text ()); - changeList[14].field = "Country"; - changeList[14].values.push_back (country->get_text ()); - changeList[15].field = "Title"; - changeList[15].values.push_back (title->get_text ()); - changeList[16].field = "DateCreated"; - changeList[16].values.push_back (dateCreated->get_text ()); - changeList[17].field = "TransReference"; - changeList[17].values.push_back (transReference->get_text ()); + changeList["Caption" ].push_back (captionText->get_text ()); + changeList["CaptionWriter" ].push_back (captionWriter->get_text ()); + changeList["Headline" ].push_back (headline->get_text ()); + changeList["Instructions" ].push_back (instructions->get_text ()); + + for (unsigned int i=0; isize(); i++) + changeList["Keywords" ].push_back (keywords->get_text (i)); + + changeList["Category" ].push_back (category->get_entry()->get_text ()); + + for (unsigned int i=0; isize(); i++) + changeList["SupplementalCategories"].push_back (suppCategories->get_text (i)); + + changeList["Author" ].push_back (author->get_text ()); + changeList["AuthorsPosition"].push_back (authorPos->get_text ()); + changeList["Credit" ].push_back (credit->get_text ()); + changeList["Source" ].push_back (source->get_text ()); + changeList["Copyright" ].push_back (copyright->get_text ()); + changeList["City" ].push_back (city->get_text ()); + changeList["Province" ].push_back (province->get_text ()); + changeList["Country" ].push_back (country->get_text ()); + changeList["Title" ].push_back (title->get_text ()); + changeList["DateCreated" ].push_back (dateCreated->get_text ()); + changeList["TransReference" ].push_back (transReference->get_text ()); notifyListener (); } @@ -524,45 +510,47 @@ void IPTCPanel::applyChangeList () { keyword->get_entry()->set_text (""); suppCategory->get_entry()->set_text (""); - for (int i=0; iset_text (changeList[i].values[0]); - else if (changeList[i].field == "CaptionWriter" && !changeList[i].values.empty()) - captionWriter->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Headline" && !changeList[i].values.empty()) - headline->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Instructions" && !changeList[i].values.empty()) - instructions->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Keywords") - for (int j=0; jappend_text (changeList[i].values[j]); - else if (changeList[i].field == "Category" && !changeList[i].values.empty()) - category->get_entry()->set_text (changeList[i].values[0]); - else if (changeList[i].field == "SupplementalCategories") - for (int j=0; jappend_text (changeList[i].values[j]); - else if (changeList[i].field == "Author" && !changeList[i].values.empty()) - author->set_text (changeList[i].values[0]); - else if (changeList[i].field == "AuthorsPosition" && !changeList[i].values.empty()) - authorPos->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Credit" && !changeList[i].values.empty()) - credit->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Source" && !changeList[i].values.empty()) - source->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Copyright" && !changeList[i].values.empty()) - copyright->set_text (changeList[i].values[0]); - else if (changeList[i].field == "City" && !changeList[i].values.empty()) - city->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Province" && !changeList[i].values.empty()) - province->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Country" && !changeList[i].values.empty()) - country->set_text (changeList[i].values[0]); - else if (changeList[i].field == "Title" && !changeList[i].values.empty()) - title->set_text (changeList[i].values[0]); - else if (changeList[i].field == "DateCreated" && !changeList[i].values.empty()) - dateCreated->set_text (changeList[i].values[0]); - else if (changeList[i].field == "TransReference" && !changeList[i].values.empty()) - transReference->set_text (changeList[i].values[0]); + for (rtengine::procparams::IPTCPairs::iterator i=changeList.begin(); i!=changeList.end(); i++) { + printf("- %s: %s\n", i->first.c_str(), i->second.empty()?"[vide]":i->second.at(0).c_str()); + if (i->first == "Caption" && !i->second.empty()) + captionText->set_text (i->second.at(0)); + else if (i->first == "CaptionWriter" && !i->second.empty()) + captionWriter->set_text (i->second.at(0)); + else if (i->first == "Headline" && !i->second.empty()) + headline->set_text (i->second.at(0)); + else if (i->first == "Instructions" && !i->second.empty()) + instructions->set_text (i->second.at(0)); + else if (i->first == "Keywords") + for (unsigned int j=0; jsecond.size(); j++) + keywords->append_text (i->second.at(j)); + else if (i->first == "Category" && !i->second.empty()) + category->get_entry()->set_text (i->second.at(0)); + else if (i->first == "SupplementalCategories") + for (unsigned int j=0; jsecond.size(); j++) + suppCategories->append_text (i->second.at(j)); + else if (i->first == "Author" && !i->second.empty()) + author->set_text (i->second.at(0)); + else if (i->first == "AuthorsPosition" && !i->second.empty()) + authorPos->set_text (i->second.at(0)); + else if (i->first == "Credit" && !i->second.empty()) + credit->set_text (i->second.at(0)); + else if (i->first == "Source" && !i->second.empty()) + source->set_text (i->second.at(0)); + else if (i->first == "Copyright" && !i->second.empty()) + copyright->set_text (i->second.at(0)); + else if (i->first == "City" && !i->second.empty()) + city->set_text (i->second.at(0)); + else if (i->first == "Province" && !i->second.empty()) + province->set_text (i->second.at(0)); + else if (i->first == "Country" && !i->second.empty()) + country->set_text (i->second.at(0)); + else if (i->first == "Title" && !i->second.empty()) + title->set_text (i->second.at(0)); + else if (i->first == "DateCreated" && !i->second.empty()) + dateCreated->set_text (i->second.at(0)); + else if (i->first == "TransReference" && !i->second.empty()) + transReference->set_text (i->second.at(0)); +} for (int i=0; i<16; i++) conns[i].block (false); diff --git a/rtgui/iptcpanel.h b/rtgui/iptcpanel.h index 3c97b91d1..128bf3018 100644 --- a/rtgui/iptcpanel.h +++ b/rtgui/iptcpanel.h @@ -26,9 +26,9 @@ class IPTCPanel : public Gtk::VBox, public ToolPanel { private: - std::vector changeList; - std::vector defChangeList; - std::vector embeddedData; + rtengine::procparams::IPTCPairs changeList; + rtengine::procparams::IPTCPairs defChangeList; + rtengine::procparams::IPTCPairs embeddedData; Gtk::TextView* captionView; Glib::RefPtr captionText; diff --git a/rtgui/main.cc b/rtgui/main.cc index c8a081b1d..f8c0838cc 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -58,7 +58,8 @@ bool simpleEditor; * 1 to start GUI (with a dir or file option) * 2 to start GUI because no files found * -1 if there is an error in parameters - * -2 if an error occurred during processing */ + * -2 if an error occurred during processing + * -3 if at least one required procparam file was not found */ int processLineParams( int argc, char **argv ); int main(int argc, char **argv) @@ -164,24 +165,36 @@ int main(int argc, char **argv) return 0; } +void deleteProcParams(std::vector &pparams) { + for (unsigned int i=0; ideleteInstance(); + delete pparams[i]; + pparams[i] = NULL; + } + return; +} + int processLineParams( int argc, char **argv ) { + rtengine::procparams::PartialProfile *rawParams=NULL, *imgParams=NULL; std::vector inputFiles; Glib::ustring outputPath = ""; - Glib::ustring processingParams = ""; + std::vector processingParams; bool isDirectory=false; bool outputDirectory=false; bool overwriteFiles=false; bool sideProcParams=false; bool copyParamsFile=false; - bool useDefaultIfAbsent=true; + bool skipIfNoSidecar=false; + bool useDefault=false; + unsigned int sideCarFilePos = 0; int compression=100; int bits=-1; std::string outputType = ""; unsigned errors=0; for( int iArg=1; iArgload ( fname ))) { + processingParams.push_back(currentParams); + } + else { + std::cerr << "Error: \""<< fname <<"\" not found" << std::endl; + deleteProcParams(processingParams); + return -3; + } } break; case 'S': - useDefaultIfAbsent=false; - case 's': // Processing params next to file (.pp3 appended) + skipIfNoSidecar=true; + case 's': // Processing params next to file (file extension appended) sideProcParams = true; + sideCarFilePos = processingParams.size(); + break; + case 'd': + useDefault = true; break; case 'Y': overwriteFiles =true; @@ -232,7 +264,7 @@ int processLineParams( int argc, char **argv ) safe_build_file_list (dir, names, argv[iArg] ); for(size_t iFile=0; iFile< names.size(); iFile++ ){ if( !safe_file_test( names[iFile] , Glib::FILE_TEST_IS_DIR)){ - // skip files without extension and pp3 files + // skip files without extension and without sidecar files Glib::ustring s(names[iFile]); Glib::ustring::size_type ext= s.find_last_of('.'); if( Glib::ustring::npos == ext ) @@ -250,27 +282,41 @@ int processLineParams( int argc, char **argv ) case 'h': case '?': default: - std::cerr << "RawTherapee, " << VERSION << std::endl; - std::cerr << "Copyright (c)2004-2011 Gabor Horvath "<< std::endl << std::endl; + { + Glib::ustring pparamsExt = paramFileExtension.substr(1); + std::cerr << "RawTherapee, V" << VERSION << std::endl; + std::cerr << "Copyright (c)2004-2012 Gabor Horvath "<< std::endl << std::endl; std::cerr << "Usage:"<< std::endl; std::cerr << Glib::path_get_basename(argv[0]) << " [] : start RT GUI browser inside dir."<< std::endl; std::cerr << Glib::path_get_basename(argv[0]) << " : start GUI editor with file."<< std::endl; std::cerr << Glib::path_get_basename(argv[0]) << " -c | : convert files in batch with default parameters."<< std::endl<< std::endl; std::cerr << "Other options used with -c (that must be last option) "<< std::endl; - std::cerr << Glib::path_get_basename(argv[0]) <<" [-o | -O ] [-s | -S | -p ] [-j[1-100]|-t|-n] -Y -c "<< std::endl; + std::cerr << Glib::path_get_basename(argv[0]) <<" [-o | -O ] [-s|-S] [-p ] [-d] [-j[1-100]|-t|-n] -Y -c "<< std::endl; std::cerr << " -o | : select output directory."<< std::endl; - std::cerr << " -O | : select output dir and copy pp3 file into it"<< std::endl; - std::cerr << " -s : select parameters to be pp3 file next to input file (with same name)"<< std::endl; - std::cerr << " ex: for IMG001.NEF there should be IMG001.NEF.pp3 in the same dir" << std::endl; + std::cerr << " -O | : select output dir and copy " << pparamsExt << " file into it"<< std::endl; + std::cerr << " -s : include the " << pparamsExt << " file next to the input file (with same name) to build the image's parameters"<< std::endl; + std::cerr << " ex: for IMG001.NEF there should be IMG001.NEF." << pparamsExt << " in the same dir" << std::endl; std::cerr << " if absent use default" << std::endl; - std::cerr << " -S : like -s but skip if pp3 file not found." << std::endl; - std::cerr << " -p : specify pp3 file to be used for all conversions."<< std::endl; + std::cerr << " -S : like -s but skip if " << pparamsExt << " file not found." << std::endl; + std::cerr << " -p : specify " << pparamsExt << " file to be used for all conversions."<< std::endl; + std::cerr << " you can specify as much -p option as you want (see the note below)."<< std::endl; + std::cerr << " -d : use the default Raw or Image " << pparamsExt << " file to build the image's parameters"<< std::endl; std::cerr << " -j[compression] : specify output to be jpeg.(default)"<< std::endl; - std::cerr << " -t : specify output to be tif."<< std::endl; + std::cerr << " -t : specify output to be uncompressed tiff."<< std::endl; + std::cerr << " -t1: specify output to be compressed tiff."<< std::endl; std::cerr << " -n : specify output to be png."<< std::endl; - std::cerr << " -Y : overwrite output if present."<< std::endl; + std::cerr << " -Y : overwrite output if present."<< std::endl<0 ) - params.load ( processingParams ); - else{ - paramsRaw.load(options.profilePath+"/"+options.defProfRaw+paramFileExtension); - paramsImg.load(options.profilePath+"/"+options.defProfImg+paramFileExtension); + if (useDefault) { + rawParams = new rtengine::procparams::PartialProfile(true); + if (rawParams->load(options.profilePath+"/" + options.defProfRaw + paramFileExtension)) { + std::cerr << "Error: default Raw procparams file \""<< (options.profilePath+"/" + options.defProfRaw + paramFileExtension) << "\" not found" << std::endl; + rawParams->deleteInstance(); + delete rawParams; + deleteProcParams(processingParams); + return -3; + } + imgParams = new rtengine::procparams::PartialProfile(true); + if (imgParams->load(options.profilePath+"/" + options.defProfImg + paramFileExtension)) { + std::cerr << "Error: default Image procparams file \""<< (options.profilePath+"/" + options.defProfImg + paramFileExtension) << "\" not found" << std::endl; + imgParams->deleteInstance(); + delete imgParams; + rawParams->deleteInstance(); + delete rawParams; + deleteProcParams(processingParams); + return -3; } } + ParamsEdited paramsEdited; for( size_t iFile=0; iFile< inputFiles.size(); iFile++){ + + // Has to be reinstanciated at each profile to have a ProcParams object with default values + rtengine::procparams::ProcParams currentParams; + Glib::ustring inputFile = inputFiles[iFile]; std::cout << "Processing: " << inputFile << std::endl; @@ -354,27 +416,48 @@ int processLineParams( int argc, char **argv ) std::cerr << "Error loading file: "<< inputFile << std::endl; continue; } - if( sideProcParams ){ - Glib::ustring sideProcessingParams = inputFile + paramFileExtension; - if( !safe_file_test( sideProcessingParams, Glib::FILE_TEST_EXISTS ) || params.load ( sideProcessingParams )){ - if( useDefaultIfAbsent ){ - currentParams = isRaw? ¶msRaw: ¶msImg; - }else{ - delete ii; - errors++; - std::cerr << "Error loading processing params: "<< sideProcessingParams << std::endl; - continue; - } - }else - currentParams = ¶ms; - }else if( processingParams.length()>0 ){ - currentParams = ¶ms; - }else if(isRaw ){ - currentParams = ¶msRaw; - }else{ - currentParams = ¶msImg; + + if (useDefault) { + if (isRaw) { + std::cout << " Merging default Raw profile" << std::endl; + rawParams->applyTo(¤tParams); + } + else { + std::cout << " Merging default Image profile" << std::endl; + imgParams->applyTo(¤tParams); + } } - job = rtengine::ProcessingJob::create (ii, *currentParams); + + bool sideCarFound = false; + unsigned int i=0; + // Iterate the procparams file list in order to build the final ProcParams + do { + if (sideProcParams && i==sideCarFilePos) { + // using the sidecar file + Glib::ustring sideProcessingParams = inputFile + paramFileExtension; + // the "load" method don't reset the procparams values anymore, so values found in the procparam file override the one of currentParams + if( !safe_file_test( sideProcessingParams, Glib::FILE_TEST_EXISTS ) || currentParams.load ( sideProcessingParams )) + std::cerr << "Warning: sidecar file requested but not found for: "<< sideProcessingParams << std::endl; + else { + sideCarFound = true; + std::cout << " Merging sidecar procparams" << std::endl; + } + } + if( processingParams.size()>i ) { + std::cout << " Merging procparams #" << i << std::endl; + processingParams[i]->applyTo(¤tParams); + } + i++; + } while (i < processingParams.size()+(sideProcParams?1:0)); + + if( sideProcParams && !sideCarFound && skipIfNoSidecar ){ + delete ii; + errors++; + std::cerr << "Error: no sidecar procparams found for: "<< inputFile << std::endl; + continue; + } + + job = rtengine::ProcessingJob::create (ii, currentParams); if( !job ){ errors++; std::cerr << "Error creating processing for: "<< inputFile << std::endl; @@ -406,12 +489,17 @@ int processLineParams( int argc, char **argv ) }else{ if( copyParamsFile ){ Glib::ustring outputProcessingParams = outputFile + paramFileExtension; - currentParams->save( outputProcessingParams ); + currentParams.save( outputProcessingParams ); } } ii->decreaseRef(); resultImage->free(); } + + if (imgParams) { imgParams->deleteInstance(); delete imgParams; } + if (rawParams) { rawParams->deleteInstance(); delete rawParams; } + deleteProcParams(processingParams); + return errors>0?-2:0; } diff --git a/rtgui/options.cc b/rtgui/options.cc index fab5ec2a1..1e23c4966 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -76,6 +76,7 @@ void Options::setDefaults () { startupDir = STARTUPDIR_LAST; // was STARTUPDIR_HOME ; an empty startupPath is now correctly handled (open in the Home dir) startupPath = ""; profilePath = "profiles"; + loadSaveProfilePath = ""; dirBrowserWidth = 200; dirBrowserHeight = 150; preferencesWidth = 0; @@ -165,8 +166,8 @@ void Options::setDefaults () { fastexport_bypass_sharpening = true; fastexport_bypass_sharpenEdge = true; fastexport_bypass_sharpenMicro = true; - fastexport_bypass_lumaDenoise = true; - fastexport_bypass_colorDenoise = true; + //fastexport_bypass_lumaDenoise = true; + //fastexport_bypass_colorDenoise = true; fastexport_bypass_defringe = true; fastexport_bypass_dirpyrDenoise = true; fastexport_bypass_sh_hq = true; @@ -211,12 +212,12 @@ void Options::setDefaults () { 0, // ADDSET_LC_BRIGHTNESS 0, // ADDSET_LC_CONTRAST 0, // ADDSET_SHARP_AMOUNT - 0, // ADDSET_LD_EDGETOLERANCE + //0, // ADDSET_LD_EDGETOLERANCE -- From obsolete and removed tool 0, // ADDSET_WB_TEMPERATURE 0, // ADDSET_WB_GREEN - 0, // ADDSET_CBOOST_AMOUNT - 0, // ADDSET_CS_BLUEYELLOW - 0, // ADDSET_CS_GREENMAGENTA + //0, // ADDSET_CBOOST_AMOUNT -- From obsolete and removed tool + //0, // ADDSET_CS_BLUEYELLOW -- From obsolete and removed tool + //0, // ADDSET_CS_GREENMAGENTA -- From obsolete and removed tool 0, // ADDSET_ROTATE_DEGREE 0, // ADDSET_DIST_AMOUNT 0, // ADDSET_PERSPECTIVE @@ -367,12 +368,13 @@ if (keyFile.has_group ("Output")) { } if (keyFile.has_group ("Profiles")) { - if (keyFile.has_key ("Profiles", "Directory")) profilePath = keyFile.get_string ("Profiles", "Directory"); - if (keyFile.has_key ("Profiles", "RawDefault")) defProfRaw = keyFile.get_string ("Profiles", "RawDefault"); - if (keyFile.has_key ("Profiles", "ImgDefault")) defProfImg = keyFile.get_string ("Profiles", "ImgDefault"); - if (keyFile.has_key ("Profiles", "SaveParamsWithFile")) saveParamsFile = keyFile.get_boolean ("Profiles", "SaveParamsWithFile"); - if (keyFile.has_key ("Profiles", "SaveParamsToCache")) saveParamsCache = keyFile.get_boolean ("Profiles", "SaveParamsToCache"); - if (keyFile.has_key ("Profiles", "LoadParamsFromLocation")) paramsLoadLocation = (PPLoadLocation)keyFile.get_integer ("Profiles", "LoadParamsFromLocation"); + if (keyFile.has_key ("Profiles", "Directory")) profilePath = keyFile.get_string ("Profiles", "Directory"); + if (keyFile.has_key ("Profiles", "LoadSaveProfilePath")) loadSaveProfilePath = keyFile.get_string ("Profiles", "LoadSaveProfilePath"); + if (keyFile.has_key ("Profiles", "RawDefault")) defProfRaw = keyFile.get_string ("Profiles", "RawDefault"); + if (keyFile.has_key ("Profiles", "ImgDefault")) defProfImg = keyFile.get_string ("Profiles", "ImgDefault"); + if (keyFile.has_key ("Profiles", "SaveParamsWithFile")) saveParamsFile = keyFile.get_boolean ("Profiles", "SaveParamsWithFile"); + if (keyFile.has_key ("Profiles", "SaveParamsToCache")) saveParamsCache = keyFile.get_boolean ("Profiles", "SaveParamsToCache"); + if (keyFile.has_key ("Profiles", "LoadParamsFromLocation")) paramsLoadLocation = (PPLoadLocation)keyFile.get_integer ("Profiles", "LoadParamsFromLocation"); if (keyFile.has_key ("Profiles", "CustomProfileBuilder")) customProfileBuilder = keyFile.get_string ("Profiles", "CustomProfileBuilder"); } @@ -494,8 +496,8 @@ if (keyFile.has_group ("Fast Export")) { if (keyFile.has_key ("Fast Export", "fastexport_bypass_sharpening" )) fastexport_bypass_sharpening = keyFile.get_boolean ("Fast Export", "fastexport_bypass_sharpening" ); if (keyFile.has_key ("Fast Export", "fastexport_bypass_sharpenEdge" )) fastexport_bypass_sharpenEdge = keyFile.get_boolean ("Fast Export", "fastexport_bypass_sharpenEdge" ); if (keyFile.has_key ("Fast Export", "fastexport_bypass_sharpenMicro" )) fastexport_bypass_sharpenMicro = keyFile.get_boolean ("Fast Export", "fastexport_bypass_sharpenMicro" ); - if (keyFile.has_key ("Fast Export", "fastexport_bypass_lumaDenoise" )) fastexport_bypass_lumaDenoise = keyFile.get_boolean ("Fast Export", "fastexport_bypass_lumaDenoise" ); - if (keyFile.has_key ("Fast Export", "fastexport_bypass_colorDenoise" )) fastexport_bypass_colorDenoise = keyFile.get_boolean ("Fast Export", "fastexport_bypass_colorDenoise" ); + //if (keyFile.has_key ("Fast Export", "fastexport_bypass_lumaDenoise" )) fastexport_bypass_lumaDenoise = keyFile.get_boolean ("Fast Export", "fastexport_bypass_lumaDenoise" ); + //if (keyFile.has_key ("Fast Export", "fastexport_bypass_colorDenoise" )) fastexport_bypass_colorDenoise = keyFile.get_boolean ("Fast Export", "fastexport_bypass_colorDenoise" ); if (keyFile.has_key ("Fast Export", "fastexport_bypass_defringe" )) fastexport_bypass_defringe = keyFile.get_boolean ("Fast Export", "fastexport_bypass_defringe" ); if (keyFile.has_key ("Fast Export", "fastexport_bypass_dirpyrDenoise" )) fastexport_bypass_dirpyrDenoise = keyFile.get_boolean ("Fast Export", "fastexport_bypass_dirpyrDenoise" ); if (keyFile.has_key ("Fast Export", "fastexport_bypass_sh_hq" )) fastexport_bypass_sh_hq = keyFile.get_boolean ("Fast Export", "fastexport_bypass_sh_hq" ); @@ -622,6 +624,7 @@ int Options::saveToFile (Glib::ustring fname) { keyFile.set_boolean ("Output", "TunnelMetaData", tunnelMetaData); keyFile.set_string ("Profiles", "Directory", profilePath); + keyFile.set_string ("Profiles", "LoadSaveProfilePath", loadSaveProfilePath); keyFile.set_string ("Profiles", "RawDefault", defProfRaw); keyFile.set_string ("Profiles", "ImgDefault", defProfImg); keyFile.set_boolean ("Profiles", "SaveParamsWithFile", saveParamsFile); @@ -700,8 +703,8 @@ int Options::saveToFile (Glib::ustring fname) { keyFile.set_boolean ("Fast Export", "fastexport_bypass_sharpening" , fastexport_bypass_sharpening ); keyFile.set_boolean ("Fast Export", "fastexport_bypass_sharpenEdge" , fastexport_bypass_sharpenEdge ); keyFile.set_boolean ("Fast Export", "fastexport_bypass_sharpenMicro" , fastexport_bypass_sharpenMicro ); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_lumaDenoise" , fastexport_bypass_lumaDenoise ); - keyFile.set_boolean ("Fast Export", "fastexport_bypass_colorDenoise" , fastexport_bypass_colorDenoise ); + //keyFile.set_boolean ("Fast Export", "fastexport_bypass_lumaDenoise" , fastexport_bypass_lumaDenoise ); + //keyFile.set_boolean ("Fast Export", "fastexport_bypass_colorDenoise" , fastexport_bypass_colorDenoise ); keyFile.set_boolean ("Fast Export", "fastexport_bypass_defringe" , fastexport_bypass_defringe ); keyFile.set_boolean ("Fast Export", "fastexport_bypass_dirpyrDenoise" , fastexport_bypass_dirpyrDenoise ); keyFile.set_boolean ("Fast Export", "fastexport_bypass_sh_hq" , fastexport_bypass_sh_hq ); diff --git a/rtgui/options.h b/rtgui/options.h index bb28585ae..eb5964936 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -61,6 +61,7 @@ class Options { int startupDir; Glib::ustring startupPath; Glib::ustring profilePath; + Glib::ustring loadSaveProfilePath; Glib::ustring lastSaveAsPath; int saveAsDialogWidth; int saveAsDialogHeight; @@ -167,8 +168,8 @@ class Options { bool fastexport_bypass_sharpening; bool fastexport_bypass_sharpenEdge; bool fastexport_bypass_sharpenMicro; - bool fastexport_bypass_lumaDenoise; - bool fastexport_bypass_colorDenoise; + //bool fastexport_bypass_lumaDenoise; + //bool fastexport_bypass_colorDenoise; bool fastexport_bypass_defringe; bool fastexport_bypass_dirpyrDenoise; bool fastexport_bypass_sh_hq; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index ed0b87071..e71fba16d 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -28,7 +28,11 @@ ParamsEdited::ParamsEdited () { void ParamsEdited::set (bool v) { - toneCurve.curve = v; + general.rank = v; + general.colorlabel = v; + general.intrash = v; + + toneCurve.curve = v; toneCurve.brightness = v; toneCurve.black = v; toneCurve.contrast = v; @@ -80,20 +84,20 @@ void ParamsEdited::set (bool v) { vibrance.protectskins = v; vibrance.avoidcolorshift = v; vibrance.pastsattog = v; - colorBoost.amount = v; - colorBoost.avoidclip = v; - colorBoost.enable_saturationlimiter = v; - colorBoost.saturationlimit = v; + //colorBoost.amount = v; + //colorBoost.avoidclip = v; + //colorBoost.enable_saturationlimiter = v; + //colorBoost.saturationlimit = v; wb.method = v; wb.green = v; wb.temperature = v; - colorShift.a = v; - colorShift.b = v; - lumaDenoise.enabled = v; - lumaDenoise.radius = v; - lumaDenoise.edgetolerance = v; - colorDenoise.enabled = v; - colorDenoise.amount = v; + //colorShift.a = v; + //colorShift.b = v; + //lumaDenoise.enabled = v; + //lumaDenoise.radius = v; + //lumaDenoise.edgetolerance = v; + //colorDenoise.enabled = v; + //colorDenoise.amount = v; defringe.enabled = v; defringe.radius = v; defringe.threshold = v; @@ -176,7 +180,8 @@ void ParamsEdited::set (bool v) { raw.caBlue = v; raw.caRed = v; raw.greenEq = v; - raw.hotDeadPixel = v; + raw.hotDeadPixelFilter = v; + raw.hotDeadPixelThresh = v; raw.linenoise = v; raw.darkFrame = v; raw.dfAuto = v; @@ -199,8 +204,8 @@ void ParamsEdited::set (bool v) { hsvequalizer.hcurve = v; hsvequalizer.scurve = v; hsvequalizer.vcurve = v; - exif.clear (); - iptc.clear (); + exif = v; + iptc = v; } using namespace rtengine; @@ -267,20 +272,20 @@ void ParamsEdited::initFrom (const std::vector vibrance.protectskins = vibrance.protectskins && p.vibrance.protectskins == other.vibrance.protectskins; vibrance.avoidcolorshift = vibrance.avoidcolorshift && p.vibrance.avoidcolorshift == other.vibrance.avoidcolorshift; vibrance.pastsattog = vibrance.pastsattog && p.vibrance.pastsattog == other.vibrance.pastsattog; - colorBoost.amount = colorBoost.amount && p.colorBoost.amount == other.colorBoost.amount; - 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; + //colorBoost.amount = colorBoost.amount && p.colorBoost.amount == other.colorBoost.amount; + //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.method = wb.method && p.wb.method == other.wb.method; wb.green = wb.green && p.wb.green == other.wb.green; wb.temperature = wb.temperature && p.wb.temperature == other.wb.temperature; - colorShift.a = colorShift.a && p.colorShift.a == other.colorShift.a; - colorShift.b = colorShift.b && p.colorShift.b == other.colorShift.b; - lumaDenoise.enabled = lumaDenoise.enabled && p.lumaDenoise.enabled == other.lumaDenoise.enabled; - lumaDenoise.radius = lumaDenoise.radius && p.lumaDenoise.radius == other.lumaDenoise.radius; - lumaDenoise.edgetolerance = lumaDenoise.edgetolerance && p.lumaDenoise.edgetolerance == other.lumaDenoise.edgetolerance; - colorDenoise.enabled = colorDenoise.enabled && p.colorDenoise.enabled == other.colorDenoise.enabled; - colorDenoise.amount = colorDenoise.amount && p.colorDenoise.amount == other.colorDenoise.amount; + //colorShift.a = colorShift.a && p.colorShift.a == other.colorShift.a; + //colorShift.b = colorShift.b && p.colorShift.b == other.colorShift.b; + //lumaDenoise.enabled = lumaDenoise.enabled && p.lumaDenoise.enabled == other.lumaDenoise.enabled; + //lumaDenoise.radius = lumaDenoise.radius && p.lumaDenoise.radius == other.lumaDenoise.radius; + //lumaDenoise.edgetolerance = lumaDenoise.edgetolerance && p.lumaDenoise.edgetolerance == other.lumaDenoise.edgetolerance; + //colorDenoise.enabled = colorDenoise.enabled && p.colorDenoise.enabled == other.colorDenoise.enabled; + //colorDenoise.amount = colorDenoise.amount && p.colorDenoise.amount == other.colorDenoise.amount; defringe.enabled = defringe.enabled && p.defringe.enabled == other.defringe.enabled; defringe.radius = defringe.radius && p.defringe.radius == other.defringe.radius; defringe.threshold = defringe.threshold && p.defringe.threshold == other.defringe.threshold; @@ -364,24 +369,25 @@ void ParamsEdited::initFrom (const std::vector raw.dcbEnhance = raw.dcbEnhance && p.raw.dcb_enhance == other.raw.dcb_enhance; raw.allEnhance = raw.allEnhance && p.raw.all_enhance == other.raw.all_enhance; raw.caCorrection = raw.caCorrection && p.raw.ca_autocorrect == other.raw.ca_autocorrect; - raw.caRed = raw.caRed && p.raw.cared == other.raw.cared; + raw.caRed = raw.caRed && p.raw.cared == other.raw.cared; raw.caBlue = raw.caBlue && p.raw.cablue == other.raw.cablue; raw.greenEq = raw.greenEq && p.raw.greenthresh == other.raw.greenthresh; - raw.hotDeadPixel = raw.hotDeadPixel && p.raw.hotdeadpix_filt == other.raw.hotdeadpix_filt; + raw.hotDeadPixelFilter = raw.hotDeadPixelFilter && p.raw.hotdeadpix_filt == other.raw.hotdeadpix_filt; + raw.hotDeadPixelThresh = raw.hotDeadPixelThresh && p.raw.hotdeadpix_thresh == other.raw.hotdeadpix_thresh; raw.linenoise = raw.linenoise && p.raw.linenoise == other.raw.linenoise; 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.ff_file = raw.ff_file && p.raw.ff_file == other.raw.ff_file; + 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; - raw.ff_BlurType = raw.ff_BlurType && p.raw.ff_BlurType == other.raw.ff_BlurType; - raw.exPos = raw.exPos && p.raw.expos == other.raw.expos; - raw.exPreser = raw.exPreser && p.raw.preser == other.raw.preser; - raw.exBlackzero = raw.exBlackzero && p.raw.blackzero == other.raw.blackzero; - raw.exBlackone = raw.exBlackone && p.raw.blackone == other.raw.blackone; - raw.exBlacktwo = p.raw.blacktwo == other.raw.blacktwo; - raw.exBlackthree = p.raw.blackthree == other.raw.blackthree; - raw.exTwoGreen = p.raw.twogreen == other.raw.twogreen; + raw.ff_BlurType = raw.ff_BlurType && p.raw.ff_BlurType == other.raw.ff_BlurType; + raw.exPos = raw.exPos && p.raw.expos == other.raw.expos; + raw.exPreser = raw.exPreser && p.raw.preser == other.raw.preser; + raw.exBlackzero = raw.exBlackzero && p.raw.blackzero == other.raw.blackzero; + raw.exBlackone = raw.exBlackone && p.raw.blackone == other.raw.blackone; + raw.exBlacktwo = p.raw.blacktwo == other.raw.blacktwo; + raw.exBlackthree = p.raw.blackthree == other.raw.blackthree; + raw.exTwoGreen = p.raw.twogreen == other.raw.twogreen; dirpyrequalizer.enabled = dirpyrequalizer.enabled && p.dirpyrequalizer.enabled == other.dirpyrequalizer.enabled; for(int i = 0; i < 8; i++) { @@ -390,8 +396,10 @@ void ParamsEdited::initFrom (const std::vector 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; -// exif = exif && p.exif==other.exif -// iptc = other.iptc; + +// How the hell can we handle that??? +// exif = exif && p.exif==other.exif +// iptc = other.iptc; } } @@ -453,25 +461,21 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (vibrance.protectskins) toEdit.vibrance.protectskins = mods.vibrance.protectskins; if (vibrance.avoidcolorshift) toEdit.vibrance.avoidcolorshift = mods.vibrance.avoidcolorshift; if (vibrance.pastsattog) toEdit.vibrance.pastsattog = mods.vibrance.pastsattog; - - - - - - if (colorBoost.amount) toEdit.colorBoost.amount = dontforceSet && options.baBehav[ADDSET_CBOOST_AMOUNT] ? toEdit.colorBoost.amount + mods.colorBoost.amount : mods.colorBoost.amount; - 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 (colorBoost.amount) toEdit.colorBoost.amount = dontforceSet && options.baBehav[ADDSET_CBOOST_AMOUNT] ? toEdit.colorBoost.amount + mods.colorBoost.amount : mods.colorBoost.amount; + //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.method) toEdit.wb.method = mods.wb.method; if (wb.green) toEdit.wb.green = dontforceSet && options.baBehav[ADDSET_WB_GREEN] ? toEdit.wb.green + mods.wb.green : mods.wb.green; if (wb.temperature) toEdit.wb.temperature = dontforceSet && options.baBehav[ADDSET_WB_TEMPERATURE] ? toEdit.wb.temperature + mods.wb.temperature : mods.wb.temperature; - if (colorShift.a) toEdit.colorShift.a = dontforceSet && options.baBehav[ADDSET_CS_BLUEYELLOW] ? toEdit.colorShift.a + mods.colorShift.a : mods.colorShift.a; - if (colorShift.b) toEdit.colorShift.b = dontforceSet && options.baBehav[ADDSET_CS_GREENMAGENTA] ? toEdit.colorShift.b + mods.colorShift.b : mods.colorShift.b; - if (lumaDenoise.enabled) toEdit.lumaDenoise.enabled = mods.lumaDenoise.enabled; - if (lumaDenoise.radius) toEdit.lumaDenoise.radius = mods.lumaDenoise.radius; - if (lumaDenoise.edgetolerance) toEdit.lumaDenoise.edgetolerance = dontforceSet && options.baBehav[ADDSET_LD_EDGETOLERANCE] ? toEdit.lumaDenoise.edgetolerance + mods.lumaDenoise.edgetolerance : mods.lumaDenoise.edgetolerance; - if (colorDenoise.enabled) toEdit.colorDenoise.enabled = mods.colorDenoise.enabled; - if (colorDenoise.amount) toEdit.colorDenoise.amount = mods.colorDenoise.amount; + //if (colorShift.a) toEdit.colorShift.a = dontforceSet && options.baBehav[ADDSET_CS_BLUEYELLOW] ? toEdit.colorShift.a + mods.colorShift.a : mods.colorShift.a; + //if (colorShift.b) toEdit.colorShift.b = dontforceSet && options.baBehav[ADDSET_CS_GREENMAGENTA] ? toEdit.colorShift.b + mods.colorShift.b : mods.colorShift.b; + //if (lumaDenoise.enabled) toEdit.lumaDenoise.enabled = mods.lumaDenoise.enabled; + //if (lumaDenoise.radius) toEdit.lumaDenoise.radius = mods.lumaDenoise.radius; + //if (lumaDenoise.edgetolerance) toEdit.lumaDenoise.edgetolerance = dontforceSet && options.baBehav[ADDSET_LD_EDGETOLERANCE] ? toEdit.lumaDenoise.edgetolerance + mods.lumaDenoise.edgetolerance : mods.lumaDenoise.edgetolerance; + //if (colorDenoise.enabled) toEdit.colorDenoise.enabled = mods.colorDenoise.enabled; + //if (colorDenoise.amount) toEdit.colorDenoise.amount = mods.colorDenoise.amount; if (defringe.enabled) toEdit.defringe.enabled = mods.defringe.enabled; if (defringe.radius) toEdit.defringe.radius = mods.defringe.radius; @@ -512,7 +516,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (coarse.hflip) toEdit.coarse.hflip = mods.coarse.hflip ? !toEdit.coarse.hflip : toEdit.coarse.hflip; if (coarse.vflip) toEdit.coarse.vflip = mods.coarse.vflip ? !toEdit.coarse.vflip : toEdit.coarse.vflip; if (commonTrans.autofill) toEdit.commonTrans.autofill = mods.commonTrans.autofill; - if (rotate.degree) toEdit.rotate.degree = dontforceSet && options.baBehav[17] ? toEdit.rotate.degree + mods.rotate.degree : mods.rotate.degree; + if (rotate.degree) toEdit.rotate.degree = dontforceSet && options.baBehav[ADDSET_ROTATE_DEGREE] ? toEdit.rotate.degree + mods.rotate.degree : mods.rotate.degree; if (distortion.uselensfun) toEdit.distortion.uselensfun = mods.distortion.uselensfun; if (distortion.amount) toEdit.distortion.amount = dontforceSet && options.baBehav[ADDSET_DIST_AMOUNT] ? toEdit.distortion.amount + mods.distortion.amount : mods.distortion.amount; if (perspective.horizontal) toEdit.perspective.horizontal = dontforceSet && options.baBehav[ADDSET_PERSPECTIVE] ? toEdit.perspective.horizontal + mods.perspective.horizontal : mods.perspective.horizontal; @@ -547,7 +551,7 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (icm.gampos) toEdit.icm.gampos = dontforceSet && options.baBehav[ADDSET_FREE_OUPUT_GAMMA] ? toEdit.icm.gampos + mods.icm.gampos : mods.icm.gampos; if (icm.slpos) toEdit.icm.slpos = dontforceSet && options.baBehav[ADDSET_FREE_OUTPUT_SLOPE] ? toEdit.icm.slpos + mods.icm.slpos : mods.icm.slpos; if (icm.gamma) toEdit.icm.gamma = mods.icm.gamma; - if (icm.freegamma) toEdit.icm.freegamma = mods.icm.freegamma; + if (icm.freegamma) toEdit.icm.freegamma = mods.icm.freegamma; if (raw.ccSteps) toEdit.raw.ccSteps = mods.raw.ccSteps; if (raw.dmethod) toEdit.raw.dmethod = mods.raw.dmethod; if (raw.dcbIterations) toEdit.raw.dcb_iterations = mods.raw.dcb_iterations; @@ -565,11 +569,12 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (raw.exBlackthree) toEdit.raw.blackthree = dontforceSet && options.baBehav[ADDSET_RAWEXPOS_BLACKS] ? toEdit.raw.blackthree + mods.raw.blackthree : mods.raw.blackthree; if (raw.exTwoGreen) toEdit.raw.twogreen = mods.raw.twogreen; - if (raw.greenEq) toEdit.raw.greenthresh = dontforceSet && options.baBehav[ADDSET_PREPROCESS_GREENEQUIL] ? toEdit.raw.greenthresh + mods.raw.greenthresh : mods.raw.greenthresh; - if (raw.hotDeadPixel) toEdit.raw.hotdeadpix_filt = mods.raw.hotdeadpix_filt; - if (raw.linenoise) toEdit.raw.linenoise = dontforceSet && options.baBehav[ADDSET_PREPROCESS_LINEDENOISE] ? toEdit.raw.linenoise + mods.raw.linenoise : mods.raw.linenoise; - if (raw.darkFrame) toEdit.raw.dark_frame = mods.raw.dark_frame; - if (raw.dfAuto) toEdit.raw.df_autoselect = mods.raw.df_autoselect; + if (raw.greenEq) toEdit.raw.greenthresh = dontforceSet && options.baBehav[ADDSET_PREPROCESS_GREENEQUIL] ? toEdit.raw.greenthresh + mods.raw.greenthresh : mods.raw.greenthresh; + if (raw.hotDeadPixelFilter) toEdit.raw.hotdeadpix_filt = mods.raw.hotdeadpix_filt; + if (raw.hotDeadPixelThresh) toEdit.raw.hotdeadpix_thresh = mods.raw.hotdeadpix_thresh; + if (raw.linenoise) toEdit.raw.linenoise = dontforceSet && options.baBehav[ADDSET_PREPROCESS_LINEDENOISE] ? toEdit.raw.linenoise + mods.raw.linenoise : mods.raw.linenoise; + if (raw.darkFrame) toEdit.raw.dark_frame = mods.raw.dark_frame; + if (raw.dfAuto) toEdit.raw.df_autoselect = mods.raw.df_autoselect; if (raw.ff_file) toEdit.raw.ff_file = mods.raw.ff_file; if (raw.ff_AutoSelect) toEdit.raw.ff_AutoSelect = mods.raw.ff_AutoSelect; @@ -584,12 +589,21 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (hsvequalizer.scurve) toEdit.hsvequalizer.scurve = mods.hsvequalizer.scurve; if (hsvequalizer.vcurve) toEdit.hsvequalizer.vcurve = mods.hsvequalizer.vcurve; -// if (exif) toEdit.exif==mo.exif = mods.exif==other.exif; -// if (iptc;) toEdit.iptc==other.iptc; = mods.iptc==other.iptc;; + // Exif changes are added to the existing ones + if (exif) + for (procparams::ExifPairs::const_iterator i=mods.exif.begin(); i!=mods.exif.end(); i++) { + toEdit.exif[i->first] = i->second; + } + + // IPTC changes are added to the existing ones + if (iptc) + for (procparams::IPTCPairs::const_iterator i=mods.iptc.begin(); i!=mods.iptc.end(); i++) { + toEdit.iptc[i->first] = i->second; + } } bool RAWParamsEdited::isUnchanged() const { return ccSteps && dmethod && dcbIterations && dcbEnhance && allEnhance && caCorrection && caRed && caBlue && greenEq - && hotDeadPixel && linenoise && darkFrame && dfAuto && ff_file && ff_AutoSelect && ff_BlurRadius && ff_BlurType + && hotDeadPixelFilter && hotDeadPixelThresh && linenoise && darkFrame && dfAuto && ff_file && ff_AutoSelect && ff_BlurRadius && ff_BlurType && exPos && exPreser && exBlackzero && exBlackone && exBlacktwo && exBlackthree && exTwoGreen; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 0de19d54b..03ae09c2a 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -21,8 +21,16 @@ #include #include -#include "../rtengine/rtengine.h" #include "../rtengine/procparams.h" +#include "../rtengine/rtengine.h" + +class GeneralParamsEdited { + + public: + bool rank; + bool colorlabel; + bool intrash; +}; class ToneCurveParamsEdited { @@ -111,14 +119,14 @@ class VibranceParamsEdited { bool pastsattog; }; -class ColorBoostParamsEdited { +/*class ColorBoostParamsEdited { public: bool amount; bool avoidclip; bool enable_saturationlimiter; bool saturationlimit; -}; +};*/ class WBParamsEdited { @@ -128,27 +136,27 @@ class WBParamsEdited { bool green; }; -class ColorShiftParamsEdited { +/*class ColorShiftParamsEdited { public: bool a; bool b; -}; +};*/ -class LumaDenoiseParamsEdited { +/*class LumaDenoiseParamsEdited { public: bool enabled; bool radius; bool edgetolerance; -}; +};*/ -class ColorDenoiseParamsEdited { +/*class ColorDenoiseParamsEdited { public: bool enabled; bool amount; -}; +};*/ class DefringeParamsEdited { @@ -326,47 +334,35 @@ class RAWParamsEdited { bool dmethod; bool dcbIterations; bool dcbEnhance; - bool allEnhance; + bool allEnhance; bool caCorrection; - bool caRed; - bool caBlue; + bool caRed; + bool caBlue; bool greenEq; - bool hotDeadPixel; + bool hotDeadPixelFilter; + bool hotDeadPixelThresh; bool linenoise; bool darkFrame; bool dfAuto; - bool ff_file; - bool ff_AutoSelect; - bool ff_BlurRadius; - bool ff_BlurType; - bool exPos; - bool exPreser; - bool exBlackzero; - bool exBlackone; - bool exBlacktwo; - bool exBlackthree; - bool exTwoGreen; + bool ff_file; + bool ff_AutoSelect; + bool ff_BlurRadius; + bool ff_BlurType; + bool exPos; + bool exPreser; + bool exBlackzero; + bool exBlackone; + bool exBlacktwo; + bool exBlackthree; + bool exTwoGreen; bool isUnchanged() const; }; -class ExifPairEdited { - - public: - Glib::ustring field; - bool value; -}; - -class IPTCPairEdited { - - public: - Glib::ustring field; - bool values; -}; - class ParamsEdited { public: + GeneralParamsEdited general; ToneCurveParamsEdited toneCurve; LCurveParamsEdited labCurve; RGBCurvesParamsEdited rgbCurves; @@ -374,22 +370,22 @@ class ParamsEdited { SharpenEdgeParamsEdited sharpenEdge; SharpenMicroParamsEdited sharpenMicro; VibranceParamsEdited vibrance; - ColorBoostParamsEdited colorBoost; + //ColorBoostParamsEdited colorBoost; WBParamsEdited wb; - ColorShiftParamsEdited colorShift; - LumaDenoiseParamsEdited lumaDenoise; - ColorDenoiseParamsEdited colorDenoise; + //ColorShiftParamsEdited colorShift; + //LumaDenoiseParamsEdited lumaDenoise; + //ColorDenoiseParamsEdited colorDenoise; DefringeParamsEdited defringe; DirPyrDenoiseParamsEdited dirpyrDenoise; - EPDParamsEdited edgePreservingDecompositionUI; + EPDParamsEdited edgePreservingDecompositionUI; ImpulseDenoiseParamsEdited impulseDenoise; SHParamsEdited sh; CropParamsEdited crop; CoarseTransformParamsEdited coarse; - CommonTransformParamsEdited commonTrans; + CommonTransformParamsEdited commonTrans; RotateParamsEdited rotate; DistortionParamsEdited distortion; - PerspectiveParamsEdited perspective; + PerspectiveParamsEdited perspective; CACorrParamsEdited cacorrection; VignettingParamsEdited vignetting; ChannelMixerParamsEdited chmixer; @@ -399,8 +395,8 @@ class ParamsEdited { RAWParamsEdited raw; DirPyrEqualizerParamsEdited dirpyrequalizer; HSVEqualizerParamsEdited hsvequalizer; - std::vector exif; - std::vector iptc; + bool exif; + bool iptc; ParamsEdited (); diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index b28cbb1b6..a30837ffa 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -18,11 +18,12 @@ */ #include "partialpastedlg.h" #include "multilangmgr.h" +#include "paramsedited.h" -PartialPasteDlg::PartialPasteDlg () { +PartialPasteDlg::PartialPasteDlg (Glib::ustring title) { set_modal (true); - set_title (M("PARTIALPASTE_DIALOGLABEL")); + set_title (title); everything = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_EVERYTHING"))); everything ->set_name("partialPasteHeader"); @@ -47,6 +48,7 @@ PartialPasteDlg::PartialPasteDlg () { exposure = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_EXPOSURE"))); hlrec = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_HLRECONSTRUCTION"))); sh = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_SHADOWSHIGHLIGHTS"))); + epd = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_EPD"))); labcurve = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_LABCURVE"))); // options in detail: @@ -56,7 +58,6 @@ PartialPasteDlg::PartialPasteDlg () { impden = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_IMPULSEDENOISE"))); dirpyreq = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_DIRPYREQUALIZER"))); defringe = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_DEFRINGE"))); - edgePreservingDecompositionUI = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_EPD"))); // options in color: vibrance = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_VIBRANCE"))); @@ -122,6 +123,7 @@ PartialPasteDlg::PartialPasteDlg () { vboxes[0]->pack_start (*exposure, Gtk::PACK_SHRINK, 2); vboxes[0]->pack_start (*hlrec, Gtk::PACK_SHRINK, 2); vboxes[0]->pack_start (*sh, Gtk::PACK_SHRINK, 2); + vboxes[0]->pack_start (*epd, Gtk::PACK_SHRINK, 2); vboxes[0]->pack_start (*labcurve, Gtk::PACK_SHRINK, 2); vboxes[1]->pack_start (*detail, Gtk::PACK_SHRINK, 2); @@ -132,7 +134,6 @@ PartialPasteDlg::PartialPasteDlg () { vboxes[1]->pack_start (*impden, Gtk::PACK_SHRINK, 2); vboxes[1]->pack_start (*dirpyrden, Gtk::PACK_SHRINK, 2); vboxes[1]->pack_start (*defringe, Gtk::PACK_SHRINK, 2); - vboxes[1]->pack_start (*edgePreservingDecompositionUI, Gtk::PACK_SHRINK, 2); vboxes[1]->pack_start (*dirpyreq, Gtk::PACK_SHRINK, 2); //vboxes[1]->pack_start (*waveq, Gtk::PACK_SHRINK, 2); @@ -239,6 +240,7 @@ PartialPasteDlg::PartialPasteDlg () { exposureConn = exposure->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); hlrecConn = hlrec->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); shConn = sh->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); + epdConn = epd->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); labcurveConn = labcurve->signal_toggled().connect (sigc::bind (sigc::mem_fun(*basic, &Gtk::CheckButton::set_inconsistent), true)); sharpenConn = sharpen->signal_toggled().connect (sigc::bind (sigc::mem_fun(*detail, &Gtk::CheckButton::set_inconsistent), true)); @@ -249,7 +251,6 @@ PartialPasteDlg::PartialPasteDlg () { dirpyreqConn = dirpyreq->signal_toggled().connect (sigc::bind (sigc::mem_fun(*detail, &Gtk::CheckButton::set_inconsistent), true)); //waveqConn = waveq->signal_toggled().connect (sigc::bind (sigc::mem_fun(*detail, &Gtk::CheckButton::set_inconsistent), true)); defringeConn = defringe->signal_toggled().connect (sigc::bind (sigc::mem_fun(*detail, &Gtk::CheckButton::set_inconsistent), true)); - edgePreservingDecompositionUIConn = edgePreservingDecompositionUI->signal_toggled().connect (sigc::bind (sigc::mem_fun(*detail, &Gtk::CheckButton::set_inconsistent), true)); vibranceConn = vibrance->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); chmixerConn = chmixer->signal_toggled().connect (sigc::bind (sigc::mem_fun(*color, &Gtk::CheckButton::set_inconsistent), true)); @@ -294,10 +295,10 @@ PartialPasteDlg::PartialPasteDlg () { ff_BlurRadiusConn = ff_BlurRadius->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true)); ff_BlurTypeConn = ff_BlurType->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true)); - add_button (Gtk::StockID("gtk-ok"), 1); - add_button (Gtk::StockID("gtk-cancel"), 0); - set_response_sensitive (1); - set_default_response (1); + add_button (Gtk::StockID("gtk-ok"), Gtk::RESPONSE_OK); + add_button (Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); + set_response_sensitive (Gtk::RESPONSE_OK); + set_default_response (Gtk::RESPONSE_OK); show_all_children (); } @@ -414,6 +415,7 @@ void PartialPasteDlg::basicToggled () { exposureConn.block (true); hlrecConn.block (true); shConn.block (true); + epdConn.block(true); labcurveConn.block (true); basic->set_inconsistent (false); @@ -422,13 +424,15 @@ void PartialPasteDlg::basicToggled () { exposure->set_active (basic->get_active ()); hlrec->set_active (basic->get_active ()); sh->set_active (basic->get_active ()); + epd->set_active (basic->get_active ()); labcurve->set_active (basic->get_active ()); wbConn.block (false); exposureConn.block (false); hlrecConn.block (false); - labcurveConn.block (false); shConn.block (false); + epdConn.block (false); + labcurveConn.block (false); } void PartialPasteDlg::detailToggled () { @@ -439,7 +443,6 @@ void PartialPasteDlg::detailToggled () { impdenConn.block (true); dirpyrdenConn.block (true); defringeConn.block (true); - edgePreservingDecompositionUIConn.block(true); dirpyreqConn.block (true); //waveqConn.block (true); @@ -448,10 +451,9 @@ void PartialPasteDlg::detailToggled () { sharpen->set_active (detail->get_active ()); sharpenedge->set_active (detail->get_active ()); sharpenmicro->set_active (detail->get_active ()); - impden->set_active (detail->get_active ()); + impden->set_active (detail->get_active ()); dirpyrden->set_active (detail->get_active ()); defringe->set_active (detail->get_active ()); - edgePreservingDecompositionUI->set_active (detail->get_active ()); dirpyreq->set_active (detail->get_active ()); //waveq->set_active (detail->get_active ()); @@ -461,32 +463,31 @@ void PartialPasteDlg::detailToggled () { impdenConn.block (false); dirpyrdenConn.block (false); defringeConn.block (false); - edgePreservingDecompositionUIConn.block (false); dirpyreqConn.block (false); //waveqConn.block (false); } void PartialPasteDlg::colorToggled () { - vibranceConn.block (true); + vibranceConn.block (true); chmixerConn.block (true); hsveqConn.block (true); rgbcurvesConn.block (true); - gamcsconn.block (true); + gamcsconn.block (true); color->set_inconsistent (false); vibrance->set_active (color->get_active ()); chmixer->set_active (color->get_active ()); - hsveq->set_active (color->get_active ()); - rgbcurves->set_active (color->get_active ()); - icm->set_active (color->get_active ()); - - vibranceConn.block (false); + hsveq->set_active (color->get_active ()); + rgbcurves->set_active (color->get_active ()); + icm->set_active (color->get_active ()); + + vibranceConn.block (false); chmixerConn.block (false); hsveqConn.block (false); rgbcurvesConn.block (false); - gamcsconn.block (false); - + gamcsconn.block (false); + } void PartialPasteDlg::lensToggled () { @@ -537,7 +538,7 @@ void PartialPasteDlg::metaicmToggled () { exifchConn.block (true); iptcConn.block (true); icmConn.block (true); - gamcsconn.block (true); + gamcsconn.block (true); metaicm->set_inconsistent (false); exifch->set_active (metaicm->get_active ()); @@ -548,75 +549,99 @@ void PartialPasteDlg::metaicmToggled () { exifchConn.block (false); iptcConn.block (false); icmConn.block (false); - gamcsconn.block (false); + gamcsconn.block (false); } -void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dst, const rtengine::procparams::ProcParams* src) { +/* + * Copies the selected items from the source ProcParams+ParamsEdited(optional) + * to the destination ProcParams. + */ +void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, ParamsEdited* dstPE, const rtengine::procparams::ProcParams* srcPP, const ParamsEdited* srcPE) { - if (wb->get_active ()) dst->wb = src->wb; - if (exposure->get_active ()) dst->toneCurve = src->toneCurve; - if (hlrec->get_active ()) dst->hlrecovery = src->hlrecovery; - if (sh->get_active ()) dst->sh = src->sh; - if (labcurve->get_active ()) dst->labCurve = src->labCurve; - - if (sharpen->get_active ()) dst->sharpening = src->sharpening; - if (sharpenedge->get_active ()) dst->sharpenEdge = src->sharpenEdge; - if (sharpenmicro->get_active()) dst->sharpenMicro = src->sharpenMicro; - if (impden->get_active ()) dst->impulseDenoise = src->impulseDenoise; - if (dirpyreq->get_active ()) dst->dirpyrequalizer = src->dirpyrequalizer; - if (defringe->get_active ()) dst->defringe = src->defringe; - if (dirpyrden->get_active ()) dst->dirpyrDenoise = src->dirpyrDenoise; - - if (vibrance->get_active ()) dst->vibrance = src->vibrance; - if (chmixer->get_active ()) dst->chmixer = src->chmixer; - if (hsveq->get_active ()) dst->hsvequalizer = src->hsvequalizer; - if (rgbcurves->get_active ()) dst->rgbCurves = src->rgbCurves; - if (icm->get_active ()) dst->icm = src->icm; - - if (distortion->get_active ()) dst->distortion = src->distortion; - if (cacorr->get_active ()) dst->cacorrection = src->cacorrection; - if (vignetting->get_active ()) dst->vignetting = src->vignetting; - - if (coarserot->get_active ()) dst->coarse = src->coarse; - if (finerot->get_active ()) dst->rotate = src->rotate; - if (crop->get_active ()) dst->crop = src->crop; - if (resize->get_active ()) dst->resize = src->resize; - if (perspective->get_active ()) dst->perspective = src->perspective; - if (commonTrans->get_active ()) dst->commonTrans = src->commonTrans; - - if (exifch->get_active ()) dst->exif = src->exif; - if (iptc->get_active ()) dst->iptc = src->iptc; - if (icm->get_active ()) dst->icm = src->icm; - if (gam->get_active ()) dst->gam = src->gam; - - if (raw_dmethod->get_active ()) dst->raw.dmethod =src->raw.dmethod; - if (raw_ccSteps->get_active ()) dst->raw.ccSteps =src->raw.ccSteps; - if (raw_dcb_iterations->get_active ()) dst->raw.dcb_iterations =src->raw.dcb_iterations; - if (raw_dcb_enhance->get_active ()) dst->raw.dcb_enhance =src->raw.dcb_enhance; - if (raw_all_enhance->get_active ()) dst->raw.all_enhance =src->raw.all_enhance; - - if (raw_expos->get_active ()) dst->raw.expos =src->raw.expos; - if (raw_preser->get_active ()) dst->raw.preser =src->raw.preser; - if (raw_black->get_active ()){ - dst->raw.blackzero =src->raw.blackzero; - dst->raw.blackone =src->raw.blackone; - dst->raw.blacktwo =src->raw.blacktwo; - dst->raw.blackthree =src->raw.blackthree; - dst->raw.twogreen =src->raw.twogreen; + ParamsEdited falsePE; // falsePE is a workaround to set a group of ParamsEdited to false + ParamsEdited filterPE; // Contains the initial information about the loaded values + if (srcPE) { + filterPE = *srcPE; } - if (raw_ca_autocorrect->get_active ()) dst->raw.ca_autocorrect =src->raw.ca_autocorrect; - if (raw_cared->get_active ()) dst->raw.cared =src->raw.cared; - if (raw_cablue->get_active ()) dst->raw.cablue =src->raw.cablue; - if (raw_hotdeadpix_filt->get_active ()) dst->raw.hotdeadpix_filt=src->raw.hotdeadpix_filt; - if (raw_linenoise->get_active ()) dst->raw.linenoise =src->raw.linenoise; - if (raw_greenthresh->get_active ()) dst->raw.greenthresh =src->raw.greenthresh; - if (df_file->get_active ()) dst->raw.dark_frame = src->raw.dark_frame; - if (df_AutoSelect->get_active ()) dst->raw.df_autoselect = src->raw.df_autoselect; - if (ff_file->get_active ()) dst->raw.ff_file = src->raw.ff_file; - if (ff_AutoSelect->get_active ()) dst->raw.ff_AutoSelect = src->raw.ff_AutoSelect; - if (ff_BlurRadius->get_active ()) dst->raw.ff_BlurRadius = src->raw.ff_BlurRadius; - if (ff_BlurType->get_active ()) dst->raw.ff_BlurType = src->raw.ff_BlurType; + else { + // By default, everything has to be copied + filterPE.set(true); + } + + + // the general section is always ignored, whichever operation we use the PartialPaste for + filterPE.general = falsePE.general; + + + // Now we filter out the filter depending on the checked items + if (!wb->get_active ()) filterPE.wb = falsePE.wb; + if (!exposure->get_active ()) filterPE.toneCurve = falsePE.toneCurve; + if (!hlrec->get_active ()) filterPE.hlrecovery = falsePE.hlrecovery; + if (!sh->get_active ()) filterPE.sh = falsePE.sh; + if (!epd->get_active ()) filterPE.edgePreservingDecompositionUI = falsePE.edgePreservingDecompositionUI; + if (!labcurve->get_active ()) filterPE.labCurve = falsePE.labCurve; + + if (!sharpen->get_active ()) filterPE.sharpening = falsePE.sharpening; + if (!sharpenedge->get_active ()) filterPE.sharpenEdge = falsePE.sharpenEdge; + if (!sharpenmicro->get_active()) filterPE.sharpenMicro = falsePE.sharpenMicro; + if (!impden->get_active ()) filterPE.impulseDenoise = falsePE.impulseDenoise; + if (!dirpyreq->get_active ()) filterPE.dirpyrequalizer = falsePE.dirpyrequalizer; + if (!defringe->get_active ()) filterPE.defringe = falsePE.defringe; + if (!dirpyrden->get_active ()) filterPE.dirpyrDenoise = falsePE.dirpyrDenoise; + + if (!vibrance->get_active ()) filterPE.vibrance = falsePE.vibrance; + if (!chmixer->get_active ()) filterPE.chmixer = falsePE.chmixer; + if (!hsveq->get_active ()) filterPE.hsvequalizer = falsePE.hsvequalizer; + if (!rgbcurves->get_active ()) filterPE.rgbCurves = falsePE.rgbCurves; + if (!icm->get_active ()) filterPE.icm = falsePE.icm; + + if (!distortion->get_active ()) filterPE.distortion = falsePE.distortion; + if (!cacorr->get_active ()) filterPE.cacorrection = falsePE.cacorrection; + if (!vignetting->get_active ()) filterPE.vignetting = falsePE.vignetting; + + if (!coarserot->get_active ()) filterPE.coarse = falsePE.coarse; + if (!finerot->get_active ()) filterPE.rotate = falsePE.rotate; + if (!crop->get_active ()) filterPE.crop = falsePE.crop; + if (!resize->get_active ()) filterPE.resize = falsePE.resize; + if (!perspective->get_active ()) filterPE.perspective = falsePE.perspective; + if (!commonTrans->get_active ()) filterPE.commonTrans = falsePE.commonTrans; + + if (!exifch->get_active ()) filterPE.exif = falsePE.exif; + if (!iptc->get_active ()) filterPE.iptc = falsePE.iptc; + if (!icm->get_active ()) filterPE.icm = falsePE.icm; + + if (!raw_dmethod->get_active ()) filterPE.raw.dmethod = falsePE.raw.dmethod; + if (!raw_ccSteps->get_active ()) filterPE.raw.ccSteps = falsePE.raw.ccSteps; + if (!raw_dcb_iterations->get_active ()) filterPE.raw.dcbIterations = falsePE.raw.dcbIterations; + if (!raw_dcb_enhance->get_active ()) filterPE.raw.dcbEnhance = falsePE.raw.dcbEnhance; + if (!raw_all_enhance->get_active ()) filterPE.raw.allEnhance = falsePE.raw.allEnhance; + + if (!raw_expos->get_active ()) filterPE.raw.exPos = falsePE.raw.exPos; + if (!raw_preser->get_active ()) filterPE.raw.exPreser = falsePE.raw.exPreser; + if (!raw_black->get_active ()) { filterPE.raw.exBlackzero = falsePE.raw.exBlackzero; + filterPE.raw.exBlackone = falsePE.raw.exBlackone; + filterPE.raw.exBlacktwo = falsePE.raw.exBlacktwo; + filterPE.raw.exBlackthree = falsePE.raw.exBlackthree; + filterPE.raw.exTwoGreen = falsePE.raw.exTwoGreen; } + if (!raw_ca_autocorrect->get_active ()) filterPE.raw.caCorrection = falsePE.raw.caCorrection; + if (!raw_cared->get_active ()) filterPE.raw.caRed = falsePE.raw.caRed; + if (!raw_cablue->get_active ()) filterPE.raw.caBlue = falsePE.raw.caBlue; + if (!raw_hotdeadpix_filt->get_active ()) { filterPE.raw.hotDeadPixelFilter = falsePE.raw.hotDeadPixelFilter; + filterPE.raw.hotDeadPixelThresh = falsePE.raw.hotDeadPixelThresh; } + if (!raw_linenoise->get_active ()) filterPE.raw.linenoise = falsePE.raw.linenoise; + if (!raw_greenthresh->get_active ()) filterPE.raw.greenEq = falsePE.raw.greenEq; + if (!df_file->get_active ()) filterPE.raw.darkFrame = falsePE.raw.darkFrame; + if (!df_AutoSelect->get_active ()) filterPE.raw.dfAuto = falsePE.raw.dfAuto; + if (!ff_file->get_active ()) filterPE.raw.ff_file = falsePE.raw.ff_file; + if (!ff_AutoSelect->get_active ()) filterPE.raw.ff_AutoSelect = falsePE.raw.ff_AutoSelect; + if (!ff_BlurRadius->get_active ()) filterPE.raw.ff_BlurRadius = falsePE.raw.ff_BlurRadius; + if (!ff_BlurType->get_active ()) filterPE.raw.ff_BlurType = falsePE.raw.ff_BlurType; + + if (dstPE) *dstPE = filterPE; + + // Apply the filter! + filterPE.combine(*dstPP, *srcPP, true); } diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index 83841dcaf..fbeb78dba 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -26,7 +26,7 @@ class PartialPasteDlg : public Gtk::Dialog { public: - Gtk::CheckButton* everything; + Gtk::CheckButton* everything; // main groups: Gtk::CheckButton* basic; @@ -42,24 +42,24 @@ class PartialPasteDlg : public Gtk::Dialog { Gtk::CheckButton* exposure; Gtk::CheckButton* hlrec; Gtk::CheckButton* sh; + Gtk::CheckButton* epd; Gtk::CheckButton* labcurve; // options in detail: Gtk::CheckButton* sharpen; Gtk::CheckButton* sharpenedge; Gtk::CheckButton* sharpenmicro; - Gtk::CheckButton* impden; - Gtk::CheckButton* waveq; - Gtk::CheckButton* dirpyrden; - Gtk::CheckButton* defringe; - Gtk::CheckButton* edgePreservingDecompositionUI; - Gtk::CheckButton* dirpyreq; + Gtk::CheckButton* impden; + //Gtk::CheckButton* waveq; + Gtk::CheckButton* dirpyrden; + Gtk::CheckButton* defringe; + Gtk::CheckButton* dirpyreq; // options in color: Gtk::CheckButton* vibrance; Gtk::CheckButton* chmixer; - Gtk::CheckButton* hsveq; - Gtk::CheckButton* rgbcurves; + Gtk::CheckButton* hsveq; + Gtk::CheckButton* rgbcurves; // Gtk::CheckButton* icm; // options in lens: @@ -96,18 +96,18 @@ class PartialPasteDlg : public Gtk::Dialog { Gtk::CheckButton* raw_dcb_iterations; Gtk::CheckButton* raw_dcb_enhance; Gtk::CheckButton* raw_all_enhance; - + Gtk::CheckButton* df_file; - Gtk::CheckButton* df_AutoSelect; - Gtk::CheckButton* ff_file; - Gtk::CheckButton* ff_AutoSelect; - Gtk::CheckButton* ff_BlurRadius; - Gtk::CheckButton* ff_BlurType; + Gtk::CheckButton* df_AutoSelect; + Gtk::CheckButton* ff_file; + Gtk::CheckButton* ff_AutoSelect; + Gtk::CheckButton* ff_BlurRadius; + Gtk::CheckButton* ff_BlurType; sigc::connection everythingConn, basicConn, detailConn, colorConn, lensConn, compositionConn, metaicmConn, rawConn;; sigc::connection wbConn, exposureConn, hlrecConn, shConn, labcurveConn; - sigc::connection sharpenConn, gradsharpenConn, microcontrastConn, impdenConn, dirpyrdenConn, waveqConn, defringeConn, edgePreservingDecompositionUIConn, dirpyreqConn; + sigc::connection sharpenConn, gradsharpenConn, microcontrastConn, impdenConn, dirpyrdenConn, waveqConn, defringeConn, epdConn, dirpyreqConn; sigc::connection vibranceConn, chmixerConn, hsveqConn, rgbcurvesConn; sigc::connection distortionConn, cacorrConn, vignettingConn; sigc::connection coarserotConn, finerotConn, cropConn, resizeConn, perspectiveConn, commonTransConn; @@ -115,19 +115,19 @@ class PartialPasteDlg : public Gtk::Dialog { sigc::connection df_fileConn, df_AutoSelectConn, ff_fileConn, ff_AutoSelectConn, ff_BlurRadiusConn, ff_BlurTypeConn; sigc::connection raw_caredConn, raw_cablueConn, raw_ca_autocorrectConn, raw_hotdeadpix_filtConn, raw_linenoiseConn, raw_greenthreshConn, raw_ccStepsConn, raw_dmethodConn, raw_dcb_iterationsConn, raw_all_enhanceConn, raw_dcb_enhanceConn, raw_exposConn, raw_preserConn, raw_blackConn; - public: - PartialPasteDlg (); + public: + PartialPasteDlg (Glib::ustring title); - void applyPaste (rtengine::procparams::ProcParams* dst, const rtengine::procparams::ProcParams* src); + void applyPaste (rtengine::procparams::ProcParams* dstPP, ParamsEdited* dstPE, const rtengine::procparams::ProcParams* srcPP, const ParamsEdited* srcPE=NULL); - void everythingToggled (); - void basicToggled (); - void detailToggled (); - void colorToggled (); - void lensToggled (); - void compositionToggled (); - void metaicmToggled (); - void rawToggled (); + void everythingToggled (); + void basicToggled (); + void detailToggled (); + void colorToggled (); + void lensToggled (); + void compositionToggled (); + void metaicmToggled (); + void rawToggled (); }; #endif diff --git a/rtgui/preprocess.cc b/rtgui/preprocess.cc index d389ff828..c6424e5de 100644 --- a/rtgui/preprocess.cc +++ b/rtgui/preprocess.cc @@ -57,7 +57,7 @@ void PreProcess::read(const rtengine::procparams::ProcParams* pp, const ParamsEd hdpixelconn.block (true); if(pedited ){ - hotDeadPixel->set_inconsistent (!pedited->raw.hotDeadPixel); + hotDeadPixel->set_inconsistent (!pedited->raw.hotDeadPixelFilter); lineDenoise->setEditedState( pedited->raw.linenoise ? Edited : UnEdited ); greenEqThreshold->setEditedState( pedited->raw.greenEq ? Edited : UnEdited ); } @@ -81,7 +81,7 @@ void PreProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedi if (pedited) { pedited->raw.linenoise = lineDenoise->getEditedState (); pedited->raw.greenEq= greenEqThreshold->getEditedState (); - pedited->raw.hotDeadPixel = !hotDeadPixel->get_inconsistent(); + pedited->raw.hotDeadPixelFilter = !hotDeadPixel->get_inconsistent(); } } diff --git a/rtgui/profilechangelistener.h b/rtgui/profilechangelistener.h index 84093ec30..6465f64c9 100644 --- a/rtgui/profilechangelistener.h +++ b/rtgui/profilechangelistener.h @@ -25,7 +25,7 @@ class ProfileChangeListener { public: - virtual void profileChange (const rtengine::procparams::ProcParams* nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited=NULL) {} + virtual void profileChange (const rtengine::procparams::PartialProfile* nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited=NULL) {} virtual void setDefaults (rtengine::procparams::ProcParams* defparams) {} }; diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index 3edeb24ce..0da96dddc 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -29,7 +29,18 @@ using namespace rtengine::procparams; extern Glib::ustring argv0; -ProfilePanel::ProfilePanel () { +PartialPasteDlg* ProfilePanel::partialProfileDlg; + + +void ProfilePanel::init () { + partialProfileDlg = new PartialPasteDlg("Foo"); +} + +void ProfilePanel::cleanup () { + delete partialProfileDlg; +} + +ProfilePanel::ProfilePanel (bool readOnly) { tpc = NULL; @@ -40,25 +51,25 @@ ProfilePanel::ProfilePanel () { pack_start (*hbox, Gtk::PACK_SHRINK, 4); - save = Gtk::manage (new Gtk::Button ()); - save->add (*Gtk::manage (new RTImage ("gtk-save-large.png"))); load = Gtk::manage (new Gtk::Button ()); load->add (*Gtk::manage (new RTImage ("gtk-open.png"))); - copy = Gtk::manage (new Gtk::Button ()); - copy->add (*Gtk::manage (new RTImage ("edit-copy.png"))); + if (!readOnly) save = Gtk::manage (new Gtk::Button ()); + if (!readOnly) save->add (*Gtk::manage (new RTImage ("gtk-save-large.png"))); + if (!readOnly) copy = Gtk::manage (new Gtk::Button ()); + if (!readOnly) copy->add (*Gtk::manage (new RTImage ("edit-copy.png"))); paste = Gtk::manage (new Gtk::Button ()); paste->add (*Gtk::manage (new RTImage ("edit-paste.png"))); hbox->pack_start (*profiles); hbox->pack_start (*load, Gtk::PACK_SHRINK, 1); - hbox->pack_start (*save, Gtk::PACK_SHRINK, 1); + if (!readOnly) hbox->pack_start (*save, Gtk::PACK_SHRINK, 1); hbox->pack_start (*copy, Gtk::PACK_SHRINK, 1); - hbox->pack_start (*paste, Gtk::PACK_SHRINK, 1); + if (!readOnly) hbox->pack_start (*paste, Gtk::PACK_SHRINK, 1); - load->signal_clicked().connect( sigc::mem_fun(*this, &ProfilePanel::load_clicked) ); - save->signal_clicked().connect( sigc::mem_fun(*this, &ProfilePanel::save_clicked) ); - copy->signal_clicked().connect( sigc::mem_fun(*this, &ProfilePanel::copy_clicked) ); - paste->signal_clicked().connect( sigc::mem_fun(*this, &ProfilePanel::paste_clicked) ); + load->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &ProfilePanel::load_clicked) ); + if (!readOnly) save->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &ProfilePanel::save_clicked) ); + if (!readOnly) copy->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &ProfilePanel::copy_clicked) ); + paste->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &ProfilePanel::paste_clicked) ); custom = NULL; lastphoto = NULL; @@ -71,9 +82,9 @@ ProfilePanel::ProfilePanel () { old = profiles->get_active_text(); changeconn = profiles->signal_changed().connect( sigc::mem_fun(*this, &ProfilePanel::selection_changed) ); - save->set_tooltip_text (M("PROFILEPANEL_TOOLTIPSAVE")); load->set_tooltip_text (M("PROFILEPANEL_TOOLTIPLOAD")); - copy->set_tooltip_text (M("PROFILEPANEL_TOOLTIPCOPY")); + if (!readOnly) save->set_tooltip_text (M("PROFILEPANEL_TOOLTIPSAVE")); + if (!readOnly) copy->set_tooltip_text (M("PROFILEPANEL_TOOLTIPCOPY")); paste->set_tooltip_text (M("PROFILEPANEL_TOOLTIPPASTE")); show_all_children (); @@ -81,9 +92,9 @@ ProfilePanel::ProfilePanel () { ProfilePanel::~ProfilePanel () { - delete custom; - delete lastsaved; - delete lastphoto; + if (custom) { custom->deleteInstance(); delete custom; } + if (lastsaved) { lastsaved->deleteInstance(); delete lastsaved; } + if (lastphoto) { lastphoto->deleteInstance(); delete lastphoto; } } void ProfilePanel::refreshProfileList () { @@ -98,7 +109,7 @@ void ProfilePanel::refreshProfileList () { // re-parse profile directories (deletes old ones) profileStore.parseProfiles (); pparams = profileStore.getProfileNames (); - for (int i=0; iappend_text (pparams[i]); if (custom) @@ -112,10 +123,15 @@ void ProfilePanel::refreshProfileList () { changeconn.block (false); } -void ProfilePanel::save_clicked () { +void ProfilePanel::save_clicked (GdkEventButton* event) { + + if (event->button != 1) + return; Gtk::FileChooserDialog dialog(M("PROFILEPANEL_SAVEDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_SAVE); - if (options.multiUser) + if (options.loadSaveProfilePath.length()) + dialog.set_current_folder (options.loadSaveProfilePath); + else if (options.multiUser) dialog.set_current_folder (Options::rtdir + "/" + options.profilePath); else dialog.set_current_folder (argv0 + "/" + options.profilePath); @@ -140,54 +156,85 @@ void ProfilePanel::save_clicked () { savedialog = &dialog; - int result = dialog.run(); + bool done = false; + do { + int result = dialog.run(); + dialog.hide(); - if (result==Gtk::RESPONSE_OK) { + if (result==Gtk::RESPONSE_OK) { - std::string fname = dialog.get_filename(); + std::string fname = dialog.get_filename(); + options.loadSaveProfilePath = Glib::path_get_dirname(fname); - bool hasext = true; - int dotpos = fname.find_last_of ('.'); - if (dotpos==Glib::ustring::npos) - hasext = false; - int dirpos1 = fname.find_last_of ('/'); - if (dirpos1!=Glib::ustring::npos && dirpos1>dotpos) - hasext = false; - int dirpos2 = fname.find_last_of ('\\'); - if (dirpos2!=Glib::ustring::npos && dirpos2>dotpos) - hasext = false; + bool hasext = true; + int dotpos = fname.find_last_of ('.'); + if (dotpos==Glib::ustring::npos) + hasext = false; + int dirpos1 = fname.find_last_of ('/'); + if (dirpos1!=Glib::ustring::npos && dirpos1>dotpos) + hasext = false; + int dirpos2 = fname.find_last_of ('\\'); + if (dirpos2!=Glib::ustring::npos && dirpos2>dotpos) + hasext = false; - if (!hasext) - fname = fname + paramFileExtension; + if (!hasext) + fname = fname + paramFileExtension; - if (safe_file_test (fname, Glib::FILE_TEST_EXISTS)) { - Glib::ustring msg_ = Glib::ustring("") + fname + ": " + M("MAIN_MSG_ALREADYEXISTS") + "\n" + M("MAIN_MSG_QOVERWRITE") + ""; - Gtk::MessageDialog msgd (msg_, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_YES_NO, true); - int response = msgd.run (); - if (response==Gtk::RESPONSE_NO) - return; + if (safe_file_test (fname, Glib::FILE_TEST_EXISTS)) { + Glib::ustring msg_ = Glib::ustring("") + fname + ": " + M("MAIN_MSG_ALREADYEXISTS") + "\n" + M("MAIN_MSG_QOVERWRITE") + ""; + Gtk::MessageDialog msgd (msg_, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_YES_NO, true); + int response = msgd.run (); + if (response==Gtk::RESPONSE_NO) + // make another try + continue; + } + + PartialProfile* toSave = NULL; + if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")") + toSave = custom; + else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")") + toSave = lastsaved; + else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")") + toSave = lastphoto; + else + toSave = profileStore.getProfile (profiles->get_active_text()); + + if (toSave) { + if (event->state & Gdk::CONTROL_MASK) { + // opening the partial paste dialog window + partialProfileDlg->set_title(M("PROFILEPANEL_SAVEPPASTE")); + int i = partialProfileDlg->run(); + partialProfileDlg->hide(); + if (i != Gtk::RESPONSE_OK) + return; + + // saving the partial profile + PartialProfile ppTemp(true); + partialProfileDlg->applyPaste (ppTemp.pparams, ppTemp.pedited, toSave->pparams, toSave->pedited); + ppTemp.pparams->save (fname, "", ppTemp.pedited); + ppTemp.deleteInstance(); + } + else { + // saving a full profile + toSave->pparams->save (fname); + } + refreshProfileList (); + } } - - ProcParams* toSave = NULL; - if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")") - toSave = custom; - else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")") - toSave = lastsaved; - else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")") - toSave = lastphoto; - else - toSave = profileStore.getProfile (profiles->get_active_text()); - - if (toSave) { - toSave->save (fname); - refreshProfileList (); - } - } + done = true; + } while (!done); + return; } -void ProfilePanel::copy_clicked () { +/* + * Copy the actual full profile to the clipboard + */ +void ProfilePanel::copy_clicked (GdkEventButton* event) { - ProcParams* toSave = NULL; + if (event->button != 1) + return; + + PartialProfile* toSave = NULL; if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")") toSave = custom; else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTSAVED") + ")") @@ -196,15 +243,41 @@ void ProfilePanel::copy_clicked () { toSave = lastphoto; else toSave = profileStore.getProfile (profiles->get_active_text()); - - if (toSave) - clipboard.setProcParams (*toSave); + + // toSave has to be a complete procparams + if (toSave) { + if (event->state & Gdk::CONTROL_MASK) { + // opening the partial paste dialog window + partialProfileDlg->set_title(M("PROFILEPANEL_COPYPPASTE")); + int i = partialProfileDlg->run(); + partialProfileDlg->hide(); + if (i != Gtk::RESPONSE_OK) + return; + + // saving a partial profile + PartialProfile ppTemp(true); + partialProfileDlg->applyPaste (ppTemp.pparams, ppTemp.pedited, toSave->pparams, toSave->pedited); + clipboard.setPartialProfile(ppTemp); + ppTemp.deleteInstance(); + } + else + clipboard.setProcParams (*toSave->pparams); + } + return; } -void ProfilePanel::load_clicked () { +/* + * Load a potentially partial profile + */ +void ProfilePanel::load_clicked (GdkEventButton* event) { + + if (event->button != 1) + return; Gtk::FileChooserDialog dialog(M("PROFILEPANEL_LOADDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN); - if (options.multiUser) + if (options.loadSaveProfilePath.length()) + dialog.set_current_folder (options.loadSaveProfilePath); + else if (options.multiUser) dialog.set_current_folder (Options::rtdir + "/" + options.profilePath); else dialog.set_current_folder (argv0 + "/" + options.profilePath); @@ -226,65 +299,100 @@ void ProfilePanel::load_clicked () { dialog.add_filter(filter_any); int result = dialog.run(); + dialog.hide(); if (result==Gtk::RESPONSE_OK) { - if (!custom) { - custom = new ProcParams (); - profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); + bool prevState = changeconn.block(true); + Glib::ustring fname = dialog.get_filename(); + options.loadSaveProfilePath = Glib::path_get_dirname(fname); + + if (event->state & Gdk::CONTROL_MASK) { + // opening the partial paste dialog window + partialProfileDlg->set_title(M("PROFILEPANEL_LOADPPASTE")); + int i = partialProfileDlg->run(); + partialProfileDlg->hide(); + if (i != Gtk::RESPONSE_OK) + return; + } + bool customCreated = false; + if (!custom) { + custom = new PartialProfile (true); + custom->set(true); + customCreated = true; + } + int err = custom->load (fname); + if (!err) { + profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); + profiles->set_active_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); + old = profiles->get_active_text(); + changeconn.block(prevState); + + if (event->state & Gdk::CONTROL_MASK) { + // applying partial profile + PartialProfile ppTemp(true); + // the 2 next line modify custom->pedited without modifying custom->pparams + partialProfileDlg->applyPaste (ppTemp.pparams, ppTemp.pedited, custom->pparams, custom->pedited); + *custom->pedited = *ppTemp.pedited; + ppTemp.deleteInstance(); + } + + changeTo (custom, M("PROFILEPANEL_PFILE")); + } + else if (customCreated) { + // we delete custom + custom->deleteInstance(); + delete custom; } - custom->load (dialog.get_filename()); - profiles->set_active_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); - old = profiles->get_active_text(); - changeTo (custom, M("PROFILEPANEL_PFILE")); } + return; } -void ProfilePanel::paste_clicked () { +/* + * Paste a full profile from the clipboard + */ +void ProfilePanel::paste_clicked (GdkEventButton* event) { + if (event->button != 1) + return; if (!clipboard.hasProcParams()) return; + if (event->state & Gdk::CONTROL_MASK) { + partialProfileDlg->set_title(M("PROFILEPANEL_PASTEPPASTE")); + int i = partialProfileDlg->run(); + partialProfileDlg->hide(); + if (i != Gtk::RESPONSE_OK) + return; + } + if (!custom) { - custom = new ProcParams (); + custom = new PartialProfile (true); + custom->pedited->set(true); profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); } - *custom = clipboard.getProcParams (); + ProcParams pp = clipboard.getProcParams (); + custom->pparams = &pp; profiles->set_active_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); old = profiles->get_active_text(); + + if (event->state & Gdk::CONTROL_MASK) { + // applying partial profile + PartialProfile ppTemp(true); + // the 2 next line modify custom->pedited without modifying custom->pparams + partialProfileDlg->applyPaste (ppTemp.pparams, ppTemp.pedited, custom->pparams, custom->pedited); + *custom->pedited = *ppTemp.pedited; + ppTemp.deleteInstance(); + } + changeTo (custom, M("HISTORY_FROMCLIPBOARD")); + return; } -void ProfilePanel::changeTo (ProcParams* newpp, Glib::ustring profname) { +void ProfilePanel::changeTo (PartialProfile* newpp, Glib::ustring profname) { if (!newpp) return; - // Keep transformation parameters while changing the profile - -/* int cropx = working->crop_x; - int cropy = working->crop_y; - int cropw = working->crop_w; - int croph = working->crop_h; - bool crope = working->crop_enabled; - int rotcor = working->rotate_coarse; - double rotfine = working->rotate_fine; - double lenscorr = working->lens_distortion; - bool hflip = working->horizontal_flip; - bool vflip = working->vertical_flip; - - working->copy (newpp); - - working->crop_x = cropx; - working->crop_y = cropy; - working->crop_w = cropw; - working->crop_h = croph; - working->crop_enabled = crope; - working->rotate_coarse = rotcor; - working->rotate_fine = rotfine; - working->lens_distortion = lenscorr; - working->horizontal_flip = hflip; - working->vertical_flip = vflip; -*/ if (tpc) tpc->profileChange (newpp, EvProfileChanged, profname); } @@ -300,7 +408,7 @@ void ProfilePanel::selection_changed () { else if (profiles->get_active_text() == Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")") changeTo (lastphoto, Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")"); else { - ProcParams* s = profileStore.getProfile (profiles->get_active_text()); + PartialProfile* s = profileStore.getProfile (profiles->get_active_text()); if (s) changeTo (s, profiles->get_active_text()); } @@ -310,24 +418,26 @@ void ProfilePanel::selection_changed () { void ProfilePanel::procParamsChanged (rtengine::procparams::ProcParams* p, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited) { - // to prevent recursion filter out the events caused by the profilepanel + // to prevent recursion, filter out the events caused by the profilepanel if (ev==EvProfileChanged || ev==EvPhotoLoaded) return; if (profiles->get_active_text() != Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")") { dontupdate = true; if (!custom) { - custom = new ProcParams (); + custom = new PartialProfile (true); + custom->set(true); profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); } - *custom = *p; profiles->set_active_text (Glib::ustring("(") + M("PROFILEPANEL_PCUSTOM") + ")"); old = profiles->get_active_text(); } - else - *custom = *p; + *(custom->pparams) = *p; } +/* + * TODO: "lastPhoto" is not used anymore, a code cleanup should delete everything related to it + */ void ProfilePanel::initProfile (const Glib::ustring& profname, ProcParams* lastSaved, ProcParams* lastPhoto) { changeconn.block (true); @@ -336,18 +446,36 @@ void ProfilePanel::initProfile (const Glib::ustring& profname, ProcParams* lastS pparams.clear (); pparams = profileStore.getProfileNames (); - for (int i=0; iappend_text (pparams[i]); - delete custom; - custom = NULL; - delete lastsaved; - lastsaved = lastSaved; - delete lastphoto; - lastphoto = lastPhoto; - + if (custom) { + custom->deleteInstance(); + delete custom; custom = NULL; + } + + if (lastsaved) { + lastsaved->deleteInstance(); + delete lastsaved; lastsaved = NULL; + } + if (lastSaved) { + ParamsEdited* pe = new ParamsEdited(); + pe->set(true); + lastsaved = new PartialProfile(lastSaved, pe); + } + + if (lastphoto) { + lastphoto->deleteInstance(); + delete lastphoto; lastphoto = NULL; + } + if (lastPhoto) { + ParamsEdited* pe = new ParamsEdited(); + pe->set(true); + lastphoto = new PartialProfile(lastPhoto, pe); + } + Glib::ustring defline = profname; - ProcParams* defprofile = profileStore.getProfile (profname); + PartialProfile* defprofile = profileStore.getProfile (profname); if (lastphoto) profiles->append_text (Glib::ustring("(") + M("PROFILEPANEL_PLASTPHOTO") + ")"); @@ -360,9 +488,9 @@ void ProfilePanel::initProfile (const Glib::ustring& profname, ProcParams* lastS if (tpc) { if (lastsaved) - tpc->setDefaults (lastsaved); + tpc->setDefaults (lastsaved->pparams); else - tpc->setDefaults (profileStore.getProfile (profname)); + tpc->setDefaults (profileStore.getProfile (profname)->pparams); } if (defprofile) { old = defline; @@ -372,16 +500,26 @@ void ProfilePanel::initProfile (const Glib::ustring& profname, ProcParams* lastS tpc->profileChange (defprofile, EvPhotoLoaded, defline); } else { + bool dels = false; // select first valid profile old = ""; profiles->set_active (0); - ProcParams* s = profileStore.getProfile (profiles->get_active_text()); - if (!s) - s = new ProcParams (); + PartialProfile* s = profileStore.getProfile (profiles->get_active_text()); + if (!s) { + s = new PartialProfile (true); + s->set(true); + dels = true; // we've created a temporary PartialProfile, so we set a flag to destroy it + } changeconn.block (false); if (tpc) tpc->profileChange (s, EvPhotoLoaded, profiles->get_active_text()); + + if (dels) { + s->deleteInstance(); + delete s; + } } } + diff --git a/rtgui/profilepanel.h b/rtgui/profilepanel.h index dbd908b9b..51c2d0364 100644 --- a/rtgui/profilepanel.h +++ b/rtgui/profilepanel.h @@ -24,47 +24,52 @@ #include "../rtengine/rtengine.h" #include "pparamschangelistener.h" #include "profilechangelistener.h" +#include "partialpastedlg.h" #include "guiutils.h" class ProfilePanel : public Gtk::VBox, public PParamsChangeListener { protected: + static PartialPasteDlg* partialProfileDlg; Gtk::Button* save; Gtk::Button* load; Gtk::Button* copy; Gtk::Button* paste; MyComboBoxText* profiles; std::vector pparams; - rtengine::procparams::ProcParams* custom; - rtengine::procparams::ProcParams* lastsaved; - rtengine::procparams::ProcParams* lastphoto; + rtengine::procparams::PartialProfile* custom; + rtengine::procparams::PartialProfile* lastsaved; + rtengine::procparams::PartialProfile* lastphoto; Glib::ustring old; ProfileChangeListener* tpc; bool dontupdate; sigc::connection changeconn; Gtk::FileChooserDialog* savedialog; - void changeTo (rtengine::procparams::ProcParams* newpp, Glib::ustring profname); + void changeTo (rtengine::procparams::PartialProfile* newpp, Glib::ustring profname); void refreshProfileList (); public: - ProfilePanel (); + ProfilePanel (bool readOnly=false); virtual ~ProfilePanel (); void setProfileChangeListener (ProfileChangeListener* ppl) { tpc = ppl; } + static void init (); + static void cleanup (); + void initProfile (const Glib::ustring& profname, rtengine::procparams::ProcParams* lastSaved, rtengine::procparams::ProcParams* lastPhoto); // PParamsChangeListener interface void procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited=NULL); // gui callbacks - void save_clicked (); - void load_clicked (); - void copy_clicked (); - void paste_clicked (); + void save_clicked (GdkEventButton* event); + void load_clicked (GdkEventButton* event); + void copy_clicked (GdkEventButton* event); + void paste_clicked (GdkEventButton* event); void selection_changed (); }; diff --git a/rtgui/profilestore.cc b/rtgui/profilestore.cc index 153bf9d26..17f9b4720 100644 --- a/rtgui/profilestore.cc +++ b/rtgui/profilestore.cc @@ -28,12 +28,23 @@ using namespace rtengine::procparams; extern Glib::ustring argv0; +ProfileStore::~ProfileStore () { + for (std::map::iterator i = partProfiles.begin(); i!=partProfiles.end(); i++) { + if (i->second->pparams) delete i->second->pparams; + if (i->second->pedited) delete i->second->pedited; + delete i->second; + } +} + void ProfileStore::parseProfiles () { // clear loaded profiles - for (std::map::iterator i = pparams.begin(); i!=pparams.end(); i++) + for (std::map::iterator i = partProfiles.begin(); i!=partProfiles.end(); i++) { + delete i->second->pparams; + delete i->second->pedited; delete i->second; - pparams.clear (); + } + partProfiles.clear (); if (options.multiUser) { Glib::ustring userPD = options.rtdir + "/" + options.profilePath; @@ -68,16 +79,21 @@ void ProfileStore::parseDir (const Glib::ustring& pdir) { if( options.rtSettings.verbose ) printf ("Processing file %s...\n", fname.c_str()); Glib::ustring name = sname.substr(0,lastdot); - if (pparams.find(name)!=pparams.end()) { - delete pparams[name]; - pparams.erase (pparams.find(name)); + std::map::iterator j = partProfiles.find(name); + if (j!=partProfiles.end()) { + j->second->deleteInstance(); + delete j->second; + partProfiles.erase (j); + } + PartialProfile* pProf = new PartialProfile (true); + int res = pProf->load (fname); + if (!res && pProf->pparams->ppVersion>=220) { + partProfiles[name] = pProf; + } + else { + pProf->deleteInstance(); + delete pProf; } - ProcParams* pp = new ProcParams (); - int res = pp->load (fname); - if (!res && pp->ppVersion>=220) - pparams[name] = pp; - else - delete pp; } } } @@ -85,26 +101,31 @@ void ProfileStore::parseDir (const Glib::ustring& pdir) { } } -rtengine::procparams::ProcParams* ProfileStore::getProfile (const Glib::ustring& profname) { +PartialProfile* ProfileStore::getProfile (const Glib::ustring& profname) { - return pparams[profname]; + std::map::iterator prof = partProfiles.find(profname); + if (prof != partProfiles.end()) + return partProfiles[profname]; + else + return NULL; } std::vector ProfileStore::getProfileNames () { std::vector ret; - for (std::map::iterator i = pparams.begin(); i!=pparams.end(); i++) + for (std::map::iterator i = partProfiles.begin(); i!=partProfiles.end(); i++) ret.push_back (i->first); return ret; } -rtengine::procparams::ProcParams* ProfileStore::getDefaultProcParams (bool isRaw) { +ProcParams* ProfileStore::getDefaultProcParams (bool isRaw) { - rtengine::procparams::ProcParams* pp = getProfile (isRaw ? options.defProfRaw : options.defProfImg); - if (!pp) { - pp = new ProcParams (); - pparams[isRaw ? options.defProfRaw : options.defProfImg] = pp; - } - return pp; + PartialProfile* pProf = getProfile (isRaw ? options.defProfRaw : options.defProfImg); + if (!pProf) { + Glib::ustring profName = isRaw ? options.defProfRaw : options.defProfImg; + pProf = new PartialProfile (true); + partProfiles[profName] = pProf; + } + return pProf->pparams; } diff --git a/rtgui/profilestore.h b/rtgui/profilestore.h index b0b7f3200..4c11df795 100644 --- a/rtgui/profilestore.h +++ b/rtgui/profilestore.h @@ -22,19 +22,21 @@ #include #include #include "../rtengine/rtengine.h" +#include "paramsedited.h" #include class ProfileStore { - std::map pparams; + std::map partProfiles; void parseDir (const Glib::ustring& pdir); public: - + + ~ProfileStore(); void parseProfiles (); - rtengine::procparams::ProcParams* getProfile (const Glib::ustring& profname); - std::vector getProfileNames (); - rtengine::procparams::ProcParams* getDefaultProcParams (bool isRaw); + rtengine::procparams::PartialProfile* getProfile (const Glib::ustring& profname); + std::vector getProfileNames (); + rtengine::procparams::ProcParams* getDefaultProcParams (bool isRaw); }; extern ProfileStore profileStore; diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index e1dc40d42..5e99fccfc 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -34,6 +34,7 @@ RTWindow::RTWindow () cacheMgr->init (); WhiteBalance::init(); + ProfilePanel::init(); Glib::ustring fName = "rt-logo.png"; Glib::ustring fullPath = RTImage::findIconAbsolutePath(fName); @@ -450,6 +451,7 @@ bool RTWindow::on_delete_event(GdkEventAny* event) { cacheMgr->closeCache (); // also makes cleanup if too large WhiteBalance::cleanup(); + ProfilePanel::cleanup(); if (!options.windowMaximized) { diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index f2ab436b8..917a494dc 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -174,7 +174,10 @@ const ProcParams& Thumbnail::getProcParams () { return pparams; // there is no valid pp to return, but we have to return something } -// Create default params on demand and returns a new updatable object +/* + * Create default params on demand and returns a new updatable object + * The loaded profile may be partial, but it return a complete ProcParams (i.e. without ParamsEdited) + */ rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool returnParams, bool forceCPB) { // try to load the last saved parameters from the cache or from the paramfile file ProcParams* ldprof = NULL; @@ -195,7 +198,7 @@ rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool retu bool success = safe_spawn_command_line_sync (cmdLine + strm.str()); - // Now they SHOULD be there, so try to load them + // Now they SHOULD be there (and potentially "partial"), so try to load them and store it as a full procparam if (success) loadProcParams(); } @@ -212,6 +215,14 @@ void Thumbnail::notifylisterners_procParamsChanged(int whoChangedIt){ listeners[i]->procParamsChanged (this, whoChangedIt); } +/* + * Load the procparams from the cache or from the sidecar file (priority set in + * the Preferences). + * + * The result is a complete ProcParams with default values merged with the values + * from the default Raw or Image ProcParams, then with the values from the loaded + * ProcParams (sidecar or cache file). + */ void Thumbnail::loadProcParams () { // TODO: Check for Linux #ifdef WIN32 @@ -219,17 +230,22 @@ void Thumbnail::loadProcParams () { #endif pparamsValid = false; + pparams.setDefaults(); + // WARNING: loading the default Raw or Img pp3 file at each thumbnail may be a performance bottleneck + pparams.load(options.profilePath+"/" + (getType()==FT_Raw?options.defProfRaw:options.defProfImg) + paramFileExtension); + if (options.paramsLoadLocation==PLL_Input) { // try to load it from params file next to the image file int ppres = pparams.load (fname + paramFileExtension); pparamsValid = !ppres && pparams.ppVersion>=220; + // if no success, try to load the cached version of the procparams if (!pparamsValid) - pparamsValid = !pparams.load (getCacheFileName ("profiles")+paramFileExtension); + pparamsValid = !pparams.load (getCacheFileName ("profiles")+paramFileExtension); } else { // try to load it from cache pparamsValid = !pparams.load (getCacheFileName ("profiles")+paramFileExtension); - // if no success, load it from params file next to the image file + // if no success, try to load it from params file next to the image file if (!pparamsValid) { int ppres = pparams.load (fname + paramFileExtension); pparamsValid = !ppres && pparams.ppVersion>=220; @@ -304,7 +320,7 @@ bool Thumbnail::hasProcParams () { return pparamsValid; } -void Thumbnail::setProcParams (const ProcParams& pp, int whoChangedIt, bool updateCacheNow) { +void Thumbnail::setProcParams (const ProcParams& pp, ParamsEdited* pe, int whoChangedIt, bool updateCacheNow) { // TODO: Check for Linux #ifdef WIN32 Glib::Mutex::Lock lock(mutex); @@ -318,7 +334,13 @@ void Thumbnail::setProcParams (const ProcParams& pp, int whoChangedIt, bool upda int colorlabel = getColorLabel(); int inTrash = getStage(); - pparams = pp; + if (pe) { + // coarse.rotate works in ADD mode only, so we set it to 0 first + if (pe->coarse.rotate) + pparams.coarse.rotate = 0; + pe->combine(pparams, pp, true); + } + else pparams = pp; pparamsValid = true; needsReProcessing = true; diff --git a/rtgui/thumbnail.h b/rtgui/thumbnail.h index e0d182211..63c3422a6 100644 --- a/rtgui/thumbnail.h +++ b/rtgui/thumbnail.h @@ -86,7 +86,7 @@ class Thumbnail { // Use this to create params on demand for update rtengine::procparams::ProcParams* createProcParamsForUpdate (bool returnParams, bool forceCPB); - void setProcParams (const rtengine::procparams::ProcParams& pp, int whoChangedIt=-1, bool updateCacheNow=true); + void setProcParams (const rtengine::procparams::ProcParams& pp, ParamsEdited* pe=NULL, int whoChangedIt=-1, bool updateCacheNow=true); void clearProcParams (int whoClearedIt=-1); void loadProcParams (); diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index d94046945..88570fc9c 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -85,7 +85,7 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc(NULL) { addPanel (detailsPanel, sharpenEdge, M("TP_SHARPENEDGE_LABEL")); toolPanels.push_back (sharpenEdge); addPanel (detailsPanel, sharpenMicro, M("TP_SHARPENMICRO_LABEL")); toolPanels.push_back (sharpenMicro); addPanel (colorPanel, hsvequalizer, M("TP_HSVEQUALIZER_LABEL")); toolPanels.push_back (hsvequalizer); - addPanel (colorPanel, rgbcurves, M("TP_RGBCURVES_LABEL")); toolPanels.push_back (rgbcurves); + addPanel (colorPanel, rgbcurves, M("TP_RGBCURVES_LABEL")); toolPanels.push_back (rgbcurves); addPanel (exposurePanel, edgePreservingDecompositionUI, M("TP_EPD_LABEL")); toolPanels.push_back (edgePreservingDecompositionUI); addPanel (exposurePanel, lcurve, M("TP_LABCURVE_LABEL")); toolPanels.push_back (lcurve); addPanel (detailsPanel, impulsedenoise, M("TP_IMPULSEDENOISE_LABEL")); toolPanels.push_back (impulsedenoise); @@ -263,26 +263,40 @@ void ToolPanelCoordinator::panelChanged (rtengine::ProcEvent event, const Glib:: paramcListeners[i]->procParamsChanged (params, event, descr); } -void ToolPanelCoordinator::profileChange (const ProcParams *nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited) { +void ToolPanelCoordinator::profileChange (const PartialProfile *nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited) { int fw, fh, tr; if (!ipc) return; ProcParams *params = ipc->beginUpdateParams (); + ProcParams *mergedParams = new ProcParams(); + + // Copy the current params as default values for the fusion + *mergedParams = *params; + + // Reset IPTC values when switching procparams from the History + if (event == rtengine::EvHistoryBrowsed) { + mergedParams->iptc.clear(); + mergedParams->exif.clear(); + } + + // And apply the partial profile nparams to mergedParams + nparams->applyTo(mergedParams); // Derive the effective changes, if it's a profile change, to prevent slow RAW rerendering if not necessary bool filterRawRefresh=false; if (event!=rtengine::EvPhotoLoaded) { ParamsEdited pe; std::vector lParams(2); - lParams[0]=*params; lParams[1]=*nparams; + lParams[0]=*params; lParams[1]=*mergedParams; pe.set(true); pe.initFrom (lParams); filterRawRefresh=pe.raw.isUnchanged(); } - *params = *nparams; + *params = *mergedParams; + delete mergedParams; tr = TR_NONE; if (params->coarse.rotate==90) tr |= TR_R90; diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index fee45d1b6..7d51128e5 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -185,7 +185,7 @@ class ToolPanelCoordinator : public ToolPanelListener, void panelChanged (rtengine::ProcEvent event, const Glib::ustring& descr); // profilechangelistener interface - void profileChange (const rtengine::procparams::ProcParams* nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited=NULL); + void profileChange (const rtengine::procparams::PartialProfile* nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited=NULL); void setDefaults (rtengine::procparams::ProcParams* defparams); // to support the GUI: