diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index 2aeb2d8f5..6403a3ab6 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -185,6 +185,7 @@ FILEBROWSER_ZOOMINHINT;Augmenter la taille des vignettes + FILEBROWSER_ZOOMOUTHINT;Diminuer la taille des vignettes - GENERAL_ABOUT;À propos GENERAL_AFTER;Après +GENERAL_AUTO;Automatique GENERAL_BEFORE;Avant GENERAL_CANCEL;Annuler GENERAL_DISABLED;Désactivé @@ -395,6 +396,26 @@ HISTORY_MSG_169;Courbe 'CT' HISTORY_MSG_170;Vibrance - courbe HISTORY_MSG_171;Courbe 'LC' HISTORY_MSG_172;Restreindre 'LC' aux tons rouge et peau +HISTORY_MSG_173;Réd. Bruit - Détail Luminance +HISTORY_MSG_174;Modèle d'Apparence de la Couleur 2002 +HISTORY_MSG_175;CAM02 - Quantité d'adaptation chrom. +HISTORY_MSG_176;CAM02 - Environ. de visionnage sombre +HISTORY_MSG_177;CAM02 - Adapt. lum. de la scène +HISTORY_MSG_178;CAM02 - Addap. lum. du visionnage +HISTORY_MSG_179;CAM02 - Modèle +HISTORY_MSG_180;CAM02 - Lumière (J) +HISTORY_MSG_181;CAM02 - Couleur (C) +HISTORY_MSG_182;CAM02 - CAT02 Automatique +HISTORY_MSG_183;CAM02 - Contraste (J) +HISTORY_MSG_184;CAM02 - Scène avec entourage sombre +HISTORY_MSG_185;CAM02 - Controle du gamut +HISTORY_MSG_186;CAM02 - Algorithme +HISTORY_MSG_187;CAM02 - Prot. tons rouges & chair +HISTORY_MSG_188;CAM02 - Brillance (Q) +HISTORY_MSG_189;CAM02 - Contraste (Q) +HISTORY_MSG_190;CAM02 - Saturation (S) +HISTORY_MSG_191;CAM02 - Niveau de couleur (M) +HISTORY_MSG_192;CAM02 - Teinte (angle) HISTORY_NEWSNAPSHOTAS;Sous... HISTORY_NEWSNAPSHOT;Ajouter HISTORY_NEWSSDIALOGLABEL;Label de la capture: @@ -644,6 +665,20 @@ PREFERENCES_CACHESTRAT;Stratégie de gestion du Cache PREFERENCES_CACHETHUMBFORM;Format des vignettes du Cache PREFERENCES_CACHETHUMBHEIGHT;Hauteur maximale des vignettes PREFERENCES_CLIPPINGIND;Indication du dépassement de plage dynamique +PREFERENCES_VIEW;Réglage du point blanc du périphérique sortie (moniteur, TV, projecteur,...) +PREFERENCES_D65;6500K +PREFERENCES_D60;6000K +PREFERENCES_D55;5500K +PREFERENCES_D50;5000K +PREFERENCES_BLACKBODY;Tungstène +PREFERENCES_GREY;Luminance Yb du périphérique de sortie (%) +PREFERENCES_GREY05;Yb=05 CIE L#30 +PREFERENCES_GREY10;Yb=10 CIE L#40 +PREFERENCES_GREY15;Yb=15 CIE L#45 +PREFERENCES_GREY18;Yb=18 CIE L#50 +PREFERENCES_GREY23;Yb=23 CIE L#55 +PREFERENCES_GREY30;Yb=30 CIE L#60 +PREFERENCES_GREY40;Yb=40 CIE L#70 PREFERENCES_CMETRICINTENT;Intention Colorimétrique PREFERENCES_CUSTPROFBUILDHINT;Fichier éxecutable (ou script) appelé lorsqu'un nouveau profil initial doit être généré pour une image.\nParamètres de ligne de commande pour permettre la génération d'un .pp3 basé sur des règles:\n[Chemin vers le fichier RAW/JPG] [Chemin vers le profil par défault] [ouverture f] [tps d'exposition en seconde] [longueur focale en mm] [ISO] [Objectif] [Appareil photo] PREFERENCES_CUSTPROFBUILDPATH;Chemin de l'exécutable @@ -850,22 +885,55 @@ TP_COARSETRAF_TOOLTIP_HFLIP;Symétriser / axe vertical TP_COARSETRAF_TOOLTIP_ROTLEFT;Rotation vers la gauche TP_COARSETRAF_TOOLTIP_ROTRIGHT;Rotation vers la droite TP_COARSETRAF_TOOLTIP_VFLIP;Symétriser / axe horizontal -TP_COLORBOOST_ACHANNEL;canal "a" -TP_COLORBOOST_AMOUNT;Quantité -TP_COLORBOOST_AVOIDCOLORCLIP;Éviter l'écrêtage couleur -TP_COLORBOOST_BCHANNEL;canal "b" -TP_COLORBOOST_CHANNEL;Canal -TP_COLORBOOST_CHSEPARATE;séparé -TP_COLORBOOST_ENABLESATLIMITER;Activer le limiteur de saturation -TP_COLORBOOST_LABEL;Rehaussement couleur -TP_COLORBOOST_SATLIMIT;Limite de saturation -TP_COLORDENOISE_EDGESENSITIVE;Sensible aux bords -TP_COLORDENOISE_EDGETOLERANCE;Tolérance des bords -TP_COLORDENOISE_LABEL;Réduction du bruit chromatique -TP_COLORDENOISE_RADIUS;Rayon -TP_COLORSHIFT_BLUEYELLOW;Bleu-Jaune -TP_COLORSHIFT_GREENMAGENTA;Vert-Magenta -TP_COLORSHIFT_LABEL;Décalage couleur +TP_COLORAPP_ADAPTSCENE;Luminosité d'adaptation (cd/m2) +TP_COLORAPP_ADAPTSCENE_TOOLTIP;Luminance absolue de l'environnement de la scène\n(souvent 2000cd/m2) +TP_COLORAPP_ADAPTVIEWING;Luminosité d'adaptation (cd/m2) +TP_COLORAPP_ADAPTVIEWING_TOOLTIP;Luminance absolue de l'environnement de visionnage\n(souvent 16cd/m2) +TP_COLORAPP_ALGO;Algorithme +TP_COLORAPP_ALGO_ALL;Tout +TP_COLORAPP_ALGO_JC;Luminosité + Chroma (JC) +TP_COLORAPP_ALGO_JS;Luminosité + Saturation (JS) +TP_COLORAPP_ALGO_QM;Brillance + Niveau de couleur (QM) +TP_COLORAPP_ALGO_TOOLTIP;Permet de choisir entre des jeux réduits de paramètre ou tout les paramètres +TP_COLORAPP_BRIGHT;Brillance (Q) +TP_COLORAPP_BRIGHT_TOOLTIP;Brillance dans CIECAM02 est différent de Lab et RVB, prend en compte la luminosité du blanc +TP_COLORAPP_CHROMA;Chroma (C) +TP_COLORAPP_CHROMA_M;Niveau de couleurs (M) +TP_COLORAPP_CHROMA_M_TOOLTIP;Niveau de couleurs dans CIECAM02 est différent de Lab et RVB +TP_COLORAPP_CHROMA_S;Saturation (S) +TP_COLORAPP_CHROMA_S_TOOLTIP;Saturation dans CIECAM02 est différent de Lab et RVB +TP_COLORAPP_CHROMA_TOOLTIP;Chroma dans CIECAM02 est différent de Lab et RVB +TP_COLORAPP_CIECAT_DEGREE;Adaptation CAT02 +TP_COLORAPP_CONTRAST;Contraste (J) +TP_COLORAPP_CONTRAST_Q;Contraste (Q) +TP_COLORAPP_CONTRAST_Q_TOOLTIP;Contraste dans CIECAM02 pour le curseur (Q); est différent du contraste Lab et RVB +TP_COLORAPP_CONTRAST_TOOLTIP;Contraste dans CIECAM02 pour le curseur (J); est différent du contraste Lab et RVB +TP_COLORAPP_DEGREE_TOOLTIP;Niveau d'adaptation chromatique CIE CAT 2002\nSi vous sélectionnez " Automatic ", RT essaiera de trouver la meilleure valeur +TP_COLORAPP_EQUAL;Préservé +TP_COLORAPP_GAMUT;Contrôle du gamut (Lab & CIECAM) +TP_COLORAPP_GAMUT_TOOLTIP;Permet le controle du gamut en mode Lab +TP_COLORAPP_HUE;Teinte (H) +TP_COLORAPP_HUE_TOOLTIP;Teinte (H) - angle entre 0° et 360° +TP_COLORAPP_LABEL;Modèle CIE d'Apparence de la Couleur (CAM02) +TP_COLORAPP_LABEL_CAM02;Édition de l'image avec CIECAM +TP_COLORAPP_LABEL_SCENE;Conditions de la scène +TP_COLORAPP_LABEL_VIEWING;Conditions de visionnage +TP_COLORAPP_LIGHT;Luminosité (J) +TP_COLORAPP_LIGHT_TOOLTIP;Luminosité dans CIECAM02 est différent de Lab et RVB +TP_COLORAPP_MODEL;Modèle de Point Blanc +TP_COLORAPP_MODEL_TOOLTIP;BB [RT] + [sortie]:\nLa BB de RT est utilisée pour la scène, CIECAM est réglé sur D50, le blanc du périphérique de sortie utilise la valeur réglé dans Préférences\n\nBB [RT+CAT02] + [sortie]:\nLes réglages de BB de RT sont utilisés par CAT02 et le blanc du périphérique de sortie utilise la valeur réglé dans Préférences +TP_COLORAPP_RSTPRO;Protection des tons chairs et rouges (C) +TP_COLORAPP_RSTPRO_TOOLTIP;Protection par le curseur (C) des tons chairs et rouges +TP_COLORAPP_SURROUND;Entourage +TP_COLORAPP_SURROUND_AVER;Moyen +TP_COLORAPP_SURROUND_DARK;Sombre +TP_COLORAPP_SURROUND_DIM;Tamisé +TP_COLORAPP_SURROUND_EXDARK;Extrêmement Sombre (Transparent) +TP_COLORAPP_SURROUND_TOOLTIP;Changes les tons et couleurs pour prendre en compte les conditions de visionnage du périphérique de sortie\n\nMoyen:\nLuminance de l'entourage moyen (standard)\nL'image ne vas pas changer\n\nTamisé:\nEntourage légèrement sombre (TV)\nL'image va devenir un peu plus sombre\n\nSombre:\nEntourage sombre (projecteur)\nL'image va devenir plus sombre\n\nExtrêmement sombre:\nEntourage noir (transparents)\nL'image va devenir encore plus sombre +TP_COLORAPP_SURSOURCE;Entourage sombre +TP_COLORAPP_SURSOURCE_TOOLTIP;Peut être utilisé si l'image source a un bord noir. +TP_COLORAPP_WBCAM;BB [RT+CAT02] + [sortie] +TP_COLORAPP_WBRT;BB [RT] + [sortie] TP_CROP_FIXRATIO;Ratio fixe: TP_CROP_GTDIAGONALS;Règle des diagonales TP_CROP_GTEPASSPORT;Passeport biométrique @@ -883,8 +951,8 @@ TP_CROP_LABEL;Recadrage TP_CROP_PPI;PPI= TP_CROP_SELECTCROP; Sélection du recadrage TP_CROP_W;L -TP_CROP_X;x -TP_CROP_Y;y +TP_CROP_X;X +TP_CROP_Y;Y TP_DARKFRAME_AUTOSELECT;Sélection automatique TP_DARKFRAME_LABEL;Trame Noire TP_DEFRINGE_LABEL;Aberration chromatique diff --git a/rtdata/languages/default b/rtdata/languages/default index bc44c6ab0..88e6b1140 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -185,6 +185,7 @@ FILEBROWSER_ZOOMINHINT;Increase thumbnail size.\nShortcut: + FILEBROWSER_ZOOMOUTHINT;Decrease thumbnail size.\nShortcut: - GENERAL_ABOUT;About GENERAL_AFTER;After +GENERAL_AUTO;Automatic GENERAL_BEFORE;Before GENERAL_CANCEL;Cancel GENERAL_DISABLED;Disabled @@ -396,6 +397,25 @@ HISTORY_MSG_170;Vibrance - Curve HISTORY_MSG_171;'LC' curve HISTORY_MSG_172;Restrict LC to red and skin tones HISTORY_MSG_173;NR - Luminance Detail +HISTORY_MSG_174;Color Appearance Modele 2002 +HISTORY_MSG_175;CAM02 - Chrom. adaptation amount +HISTORY_MSG_176;CAM02 - Viewing's black surround +HISTORY_MSG_177;CAM02 - Scene's Lum. Adaptation +HISTORY_MSG_178;CAM02 - Viewing's Lum. Adaptation +HISTORY_MSG_179;CAM02 - Model +HISTORY_MSG_180;CAM02 - Lightness (J) +HISTORY_MSG_181;CAM02 - Chroma (C) +HISTORY_MSG_182;CAM02 - Automatic CAT02 +HISTORY_MSG_183;CAM02 - Contrast (J) +HISTORY_MSG_184;CAM02 - Scene with dark surround +HISTORY_MSG_185;CAM02 - Gamut control +HISTORY_MSG_186;CAM02 - Algorithm +HISTORY_MSG_187;CAM02 - Red & skin tones protection +HISTORY_MSG_188;CAM02 - Brightness (Q) +HISTORY_MSG_189;CAM02 - Contrast (Q) +HISTORY_MSG_190;CAM02 - Saturation (S) +HISTORY_MSG_191;CAM02 - Colorfullness (M) +HISTORY_MSG_192;CAM02 - Hue (angle) HISTORY_NEWSNAPSHOTAS;As... HISTORY_NEWSNAPSHOT;Add HISTORY_NEWSSDIALOGLABEL;Label of the snapshot: @@ -646,6 +666,20 @@ PREFERENCES_CACHESTRAT;Cache Strategy PREFERENCES_CACHETHUMBFORM;Cache thumbnail format PREFERENCES_CACHETHUMBHEIGHT;Maximal thumbnail height PREFERENCES_CLIPPINGIND;Clipping Indication +PREFERENCES_VIEW;Output device's white balance setting (monitor, TV, projector,...) +PREFERENCES_D65;6500K +PREFERENCES_D60;6000K +PREFERENCES_D55;5500K +PREFERENCES_D50;5000K +PREFERENCES_BLACKBODY;Tungsten +PREFERENCES_GREY;Output device's Yb luminance (%) +PREFERENCES_GREY05;Yb=05 CIE L#30 +PREFERENCES_GREY10;Yb=10 CIE L#40 +PREFERENCES_GREY15;Yb=15 CIE L#45 +PREFERENCES_GREY18;Yb=18 CIE L#50 +PREFERENCES_GREY23;Yb=23 CIE L#55 +PREFERENCES_GREY30;Yb=30 CIE L#60 +PREFERENCES_GREY40;Yb=40 CIE L#70 PREFERENCES_CMETRICINTENT;Colorimetric intent PREFERENCES_CUSTPROFBUILDHINT;Executable (or script) file called when a new initial processing profile should be generated for an image.\nReceives command line parameters to allow a rules-based processing profile generation:\n[raw/JPG path] [default processing profile path] [f-number] [exposure in secs] [focal length in mm] [ISO] [lens] [camera] PREFERENCES_CUSTPROFBUILDPATH;Executable path @@ -844,6 +878,55 @@ TP_COARSETRAF_TOOLTIP_HFLIP;Flip horizontally TP_COARSETRAF_TOOLTIP_ROTLEFT;Rotate left.\nShortcut: [ TP_COARSETRAF_TOOLTIP_ROTRIGHT;Rotate right.\nShortcut: ] TP_COARSETRAF_TOOLTIP_VFLIP;Flip vertically +TP_COLORAPP_ADAPTSCENE;Adaptation luminosity (cd/m2) +TP_COLORAPP_ADAPTSCENE_TOOLTIP;Absolute luminance of the scene environnement\n(usually 2000cd/m2) +TP_COLORAPP_ADAPTVIEWING;Adaptation luminosity (cd/m2) +TP_COLORAPP_ADAPTVIEWING_TOOLTIP;Absolute luminance of the viewing environnement\n(usually 16cd/m2) +TP_COLORAPP_ALGO;Algorithm +TP_COLORAPP_ALGO_ALL;All +TP_COLORAPP_ALGO_JC;Lightness + Chroma (JC) +TP_COLORAPP_ALGO_JS;Lightnes + Saturation (JS) +TP_COLORAPP_ALGO_QM;Brightness + Colorfullness (QM) +TP_COLORAPP_ALGO_TOOLTIP;Lets you chose between parameters subsets or all parameters +TP_COLORAPP_BRIGHT;Brightness (Q) +TP_COLORAPP_BRIGHT_TOOLTIP;Brightness in CIECAM02 is different from Lab and RGB, take into account the white's luminosity +TP_COLORAPP_CHROMA;Chroma (C) +TP_COLORAPP_CHROMA_M;Colorfullnes (M) +TP_COLORAPP_CHROMA_M_TOOLTIP;Colorfullness in CIECAM02 is different from Lab and RGB +TP_COLORAPP_CHROMA_S;Saturation (S) +TP_COLORAPP_CHROMA_S_TOOLTIP;Saturation in CIECAM02 is different from Lab and RGB +TP_COLORAPP_CHROMA_TOOLTIP;Chroma in CIECAM02 is different from Lab and RGB +TP_COLORAPP_CIECAT_DEGREE;CAT02 adaptation +TP_COLORAPP_CONTRAST;Contrast (J) +TP_COLORAPP_CONTRAST_Q;Contrast (Q) +TP_COLORAPP_CONTRAST_Q_TOOLTIP;Contrast in CIECAM02 for the Q slider; is different from Lab and RGB +TP_COLORAPP_CONTRAST_TOOLTIP;Contrast in CIECAM02 for the J slider; is different from Lab and RGB +TP_COLORAPP_DEGREE_TOOLTIP;Amount of CIE Chromatic Adaptation Transform 2002\nIf you check the " Automatic " box, RT will try to find the best value +TP_COLORAPP_EQUAL;Equal +TP_COLORAPP_GAMUT;Gamut control (Lab & CIECAM) +TP_COLORAPP_GAMUT_TOOLTIP;Allow gamut control in Lab mode +TP_COLORAPP_HUE;Hue (H) +TP_COLORAPP_HUE_TOOLTIP;Hue (H) - angle between 0° and 360° +TP_COLORAPP_LABEL;CIE Color Appearance Model 2002 +TP_COLORAPP_LABEL_CAM02;Modifying image with CIECAM +TP_COLORAPP_LABEL_SCENE;Scene conditions +TP_COLORAPP_LABEL_VIEWING;Viewing conditions +TP_COLORAPP_LIGHT;Lightness (J) +TP_COLORAPP_LIGHT_TOOLTIP;Lightness in CIECAM02 is different from Lab and RGB +TP_COLORAPP_MODEL;White-Point Model +TP_COLORAPP_MODEL_TOOLTIP;WB [RT] + [output]:\nRT's WB is used for the scene, CIECAM is set to D50, the output device's white uses the value set in Preferences\n\nWB [RT+CAT02] + [output]:\nRT's WB settings are used by CAT02 and the output device's white uses the value set in Preferences +TP_COLORAPP_RSTPRO;Red & skin tones protection (C) +TP_COLORAPP_RSTPRO_TOOLTIP;Red and skin tones protection by the (C) slider +TP_COLORAPP_SURROUND;Surround +TP_COLORAPP_SURROUND_AVER;Average +TP_COLORAPP_SURROUND_DARK;Dark +TP_COLORAPP_SURROUND_DIM;Dim +TP_COLORAPP_SURROUND_EXDARK;Extremly Dark (Cutsheet) +TP_COLORAPP_SURROUND_TOOLTIP;Change tones and colors to take into account the viewing conditions of the output device\n\nAverage:\nAverage light environment (standard)\nThe image will not change\n\nDim:\nDim environment (TV)\nThe image will become slighty dark\n\nDark:\nDark environment (projector)\nThe image will become much dark\n\nExtremly Dark:\nExtremly dark environment (Cutsheet)\nThe image will become very much dark +TP_COLORAPP_SURSOURCE;Dark surround +TP_COLORAPP_SURSOURCE_TOOLTIP;Can be used if source image has a dark border +TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] +TP_COLORAPP_WBRT;WB [RT] + [output] TP_CROP_FIXRATIO;Fix ratio: TP_CROP_GTDIAGONALS;Rule of Diagonals TP_CROP_GTEPASSPORT;Biometric Passport @@ -861,8 +944,8 @@ TP_CROP_LABEL;Crop TP_CROP_PPI;PPI= TP_CROP_SELECTCROP;Select Crop TP_CROP_W;Width -TP_CROP_X;x -TP_CROP_Y;y +TP_CROP_X;X +TP_CROP_Y;Y TP_DARKFRAME_AUTOSELECT;Auto selection TP_DARKFRAME_LABEL;Dark Frame TP_DEFRINGE_LABEL;Defringe diff --git a/rtdata/profiles/BW-1.pp3 b/rtdata/profiles/BW-1.pp3 index 53cf95043..96d721cf8 100644 --- a/rtdata/profiles/BW-1.pp3 +++ b/rtdata/profiles/BW-1.pp3 @@ -1,7 +1,7 @@ [Version] AppVersion=4.0.9 -Version=305 +Version=306 [General] Rank=0 @@ -87,6 +87,27 @@ Setting=Camera Temperature=5745 Green=1.0 +[Color appearance] +Enabled=false +Degree=90 +AutoDegree=true +Surround=Average +AdaptLum=16 +Model=RawT +Algorithm=JC +J-Light=0 +Q-Bright=0 +C-Chroma=0 +S-Chroma=0 +M-Chroma=0 +J-Contrast=0 +Q-Contrast=0 +H-Hue=0 +RSTProtection=0 +AdaptScene=2000 +SurrSource=false +Gamut=false + [Impulse Denoising] Enabled=false Threshold=50 diff --git a/rtdata/profiles/BW-2.pp3 b/rtdata/profiles/BW-2.pp3 index b3504fe4a..765f106f4 100644 --- a/rtdata/profiles/BW-2.pp3 +++ b/rtdata/profiles/BW-2.pp3 @@ -1,7 +1,7 @@ [Version] AppVersion=4.0.9 -Version=305 +Version=306 [General] Rank=0 @@ -87,6 +87,27 @@ Setting=Camera Temperature=5745 Green=1.0 +[Color appearance] +Enabled=false +Degree=90 +AutoDegree=true +Surround=Average +AdaptLum=16 +Model=RawT +Algorithm=JC +J-Light=0 +Q-Bright=0 +C-Chroma=0 +S-Chroma=0 +M-Chroma=0 +J-Contrast=0 +Q-Contrast=0 +H-Hue=0 +RSTProtection=0 +AdaptScene=2000 +SurrSource=false +Gamut=false + [Impulse Denoising] Enabled=false Threshold=50 diff --git a/rtdata/profiles/BW-3.pp3 b/rtdata/profiles/BW-3.pp3 index 163e6d558..f8cb16b67 100644 --- a/rtdata/profiles/BW-3.pp3 +++ b/rtdata/profiles/BW-3.pp3 @@ -1,7 +1,7 @@ [Version] AppVersion=4.0.9 -Version=305 +Version=306 [General] Rank=0 @@ -87,6 +87,27 @@ Setting=Camera Temperature=5745 Green=1.0 +[Color appearance] +Enabled=false +Degree=90 +AutoDegree=true +Surround=Average +AdaptLum=16 +Model=RawT +Algorithm=JC +J-Light=0 +Q-Bright=0 +C-Chroma=0 +S-Chroma=0 +M-Chroma=0 +J-Contrast=0 +Q-Contrast=0 +H-Hue=0 +RSTProtection=0 +AdaptScene=2000 +SurrSource=false +Gamut=false + [Impulse Denoising] Enabled=false Threshold=50 diff --git a/rtdata/profiles/BW-4.pp3 b/rtdata/profiles/BW-4.pp3 index 03b394eb3..42c8aefe8 100644 --- a/rtdata/profiles/BW-4.pp3 +++ b/rtdata/profiles/BW-4.pp3 @@ -1,7 +1,7 @@ [Version] AppVersion=4.0.9 -Version=305 +Version=306 [General] Rank=0 @@ -87,6 +87,27 @@ Setting=Camera Temperature=5745 Green=1.0 +[Color appearance] +Enabled=false +Degree=90 +AutoDegree=true +Surround=Average +AdaptLum=16 +Model=RawT +Algorithm=JC +J-Light=0 +Q-Bright=0 +C-Chroma=0 +S-Chroma=0 +M-Chroma=0 +J-Contrast=0 +Q-Contrast=0 +H-Hue=0 +RSTProtection=0 +AdaptScene=2000 +SurrSource=false +Gamut=false + [Impulse Denoising] Enabled=false Threshold=50 diff --git a/rtdata/profiles/Default-ISO-High.pp3 b/rtdata/profiles/Default-ISO-High.pp3 index 4d839002c..d2462794b 100644 --- a/rtdata/profiles/Default-ISO-High.pp3 +++ b/rtdata/profiles/Default-ISO-High.pp3 @@ -1,7 +1,7 @@ [Version] AppVersion=4.0.9 -Version=305 +Version=306 [General] Rank=0 @@ -87,6 +87,27 @@ Setting=Camera Temperature=5745 Green=1.0 +[Color appearance] +Enabled=false +Degree=90 +AutoDegree=true +Surround=Average +AdaptLum=16 +Model=RawT +Algorithm=JC +J-Light=0 +Q-Bright=0 +C-Chroma=0 +S-Chroma=0 +M-Chroma=0 +J-Contrast=0 +Q-Contrast=0 +H-Hue=0 +RSTProtection=0 +AdaptScene=2000 +SurrSource=false +Gamut=false + [Impulse Denoising] Enabled=false Threshold=80 diff --git a/rtdata/profiles/Default-ISO-Medium.pp3 b/rtdata/profiles/Default-ISO-Medium.pp3 index 56d4d9a57..694212683 100644 --- a/rtdata/profiles/Default-ISO-Medium.pp3 +++ b/rtdata/profiles/Default-ISO-Medium.pp3 @@ -1,7 +1,7 @@ [Version] AppVersion=4.0.9 -Version=305 +Version=306 [General] Rank=0 @@ -87,6 +87,27 @@ Setting=Camera Temperature=5745 Green=1.0 +[Color appearance] +Enabled=false +Degree=90 +AutoDegree=true +Surround=Average +AdaptLum=16 +Model=RawT +Algorithm=JC +J-Light=0 +Q-Bright=0 +C-Chroma=0 +S-Chroma=0 +M-Chroma=0 +J-Contrast=0 +Q-Contrast=0 +H-Hue=0 +RSTProtection=0 +AdaptScene=2000 +SurrSource=false +Gamut=false + [Impulse Denoising] Enabled=false Threshold=50 diff --git a/rtdata/profiles/Default.pp3 b/rtdata/profiles/Default.pp3 index 84a29cb06..36ac1bbb9 100644 --- a/rtdata/profiles/Default.pp3 +++ b/rtdata/profiles/Default.pp3 @@ -1,7 +1,7 @@ [Version] AppVersion=4.0.9 -Version=305 +Version=306 [General] Rank=0 @@ -87,6 +87,27 @@ Setting=Camera Temperature=5745 Green=1.0 +[Color appearance] +Enabled=false +Degree=90 +AutoDegree=true +Surround=Average +AdaptLum=16 +Model=RawT +Algorithm=JC +J-Light=0 +Q-Bright=0 +C-Chroma=0 +S-Chroma=0 +M-Chroma=0 +J-Contrast=0 +Q-Contrast=0 +H-Hue=0 +RSTProtection=0 +AdaptScene=2000 +SurrSource=false +Gamut=false + [Impulse Denoising] Enabled=false Threshold=50 diff --git a/rtdata/profiles/Highkey-1.pp3 b/rtdata/profiles/Highkey-1.pp3 index d90907f28..cd8332ccd 100644 --- a/rtdata/profiles/Highkey-1.pp3 +++ b/rtdata/profiles/Highkey-1.pp3 @@ -1,7 +1,7 @@ [Version] AppVersion=4.0.9 -Version=305 +Version=306 [General] Rank=0 @@ -87,6 +87,27 @@ Setting=Camera Temperature=5745 Green=1.0 +[Color appearance] +Enabled=false +Degree=90 +AutoDegree=true +Surround=Average +AdaptLum=16 +Model=RawT +Algorithm=JC +J-Light=0 +Q-Bright=0 +C-Chroma=0 +S-Chroma=0 +M-Chroma=0 +J-Contrast=0 +Q-Contrast=0 +H-Hue=0 +RSTProtection=0 +AdaptScene=2000 +SurrSource=false +Gamut=false + [Impulse Denoising] Enabled=false Threshold=50 diff --git a/rtdata/profiles/Natural-1.pp3 b/rtdata/profiles/Natural-1.pp3 index 27a1b37db..08521855a 100644 --- a/rtdata/profiles/Natural-1.pp3 +++ b/rtdata/profiles/Natural-1.pp3 @@ -1,7 +1,7 @@ [Version] AppVersion=4.0.9 -Version=305 +Version=306 [General] Rank=0 @@ -87,6 +87,27 @@ Setting=Camera Temperature=5745 Green=1.0 +[Color appearance] +Enabled=false +Degree=90 +AutoDegree=true +Surround=Average +AdaptLum=16 +Model=RawT +Algorithm=JC +J-Light=0 +Q-Bright=0 +C-Chroma=0 +S-Chroma=0 +M-Chroma=0 +J-Contrast=0 +Q-Contrast=0 +H-Hue=0 +RSTProtection=0 +AdaptScene=2000 +SurrSource=false +Gamut=false + [Impulse Denoising] Enabled=false Threshold=50 diff --git a/rtdata/profiles/Natural-2.pp3 b/rtdata/profiles/Natural-2.pp3 index 6e14e5f9b..866fc0d1c 100644 --- a/rtdata/profiles/Natural-2.pp3 +++ b/rtdata/profiles/Natural-2.pp3 @@ -1,7 +1,7 @@ [Version] AppVersion=4.0.9 -Version=305 +Version=306 [General] Rank=0 @@ -87,6 +87,27 @@ Setting=Camera Temperature=5745 Green=1.0 +[Color appearance] +Enabled=false +Degree=90 +AutoDegree=true +Surround=Average +AdaptLum=16 +Model=RawT +Algorithm=JC +J-Light=0 +Q-Bright=0 +C-Chroma=0 +S-Chroma=0 +M-Chroma=0 +J-Contrast=0 +Q-Contrast=0 +H-Hue=0 +RSTProtection=0 +AdaptScene=2000 +SurrSource=false +Gamut=false + [Impulse Denoising] Enabled=false Threshold=50 diff --git a/rtdata/profiles/Neutral.pp3 b/rtdata/profiles/Neutral.pp3 index bf41369b5..0cf2ad992 100644 --- a/rtdata/profiles/Neutral.pp3 +++ b/rtdata/profiles/Neutral.pp3 @@ -1,7 +1,7 @@ [Version] AppVersion=4.0.9 -Version=305 +Version=306 [General] Rank=0 @@ -87,6 +87,27 @@ Setting=Camera Temperature=5745 Green=1.0 +[Color appearance] +Enabled=false +Degree=90 +AutoDegree=true +Surround=Average +AdaptLum=16 +Model=RawT +Algorithm=JC +J-Light=0 +Q-Bright=0 +C-Chroma=0 +S-Chroma=0 +M-Chroma=0 +J-Contrast=0 +Q-Contrast=0 +H-Hue=0 +RSTProtection=0 +AdaptScene=2000 +SurrSource=false +Gamut=false + [Impulse Denoising] Enabled=false Threshold=50 diff --git a/rtdata/profiles/Punchy-1.pp3 b/rtdata/profiles/Punchy-1.pp3 index 2c52362ba..bc051e165 100644 --- a/rtdata/profiles/Punchy-1.pp3 +++ b/rtdata/profiles/Punchy-1.pp3 @@ -1,7 +1,7 @@ [Version] AppVersion=4.0.9 -Version=305 +Version=306 [General] Rank=0 @@ -87,6 +87,27 @@ Setting=Camera Temperature=5745 Green=1.0 +[Color appearance] +Enabled=false +Degree=90 +AutoDegree=true +Surround=Average +AdaptLum=16 +Model=RawT +Algorithm=JC +J-Light=0 +Q-Bright=0 +C-Chroma=0 +S-Chroma=0 +M-Chroma=0 +J-Contrast=0 +Q-Contrast=0 +H-Hue=0 +RSTProtection=0 +AdaptScene=2000 +SurrSource=false +Gamut=false + [Impulse Denoising] Enabled=false Threshold=50 diff --git a/rtdata/profiles/Punchy-2.pp3 b/rtdata/profiles/Punchy-2.pp3 index ea7a18b9e..678f4d18a 100644 --- a/rtdata/profiles/Punchy-2.pp3 +++ b/rtdata/profiles/Punchy-2.pp3 @@ -1,7 +1,7 @@ [Version] AppVersion=4.0.9 -Version=305 +Version=306 [General] Rank=0 @@ -87,6 +87,27 @@ Setting=Camera Temperature=5745 Green=1.0 +[Color appearance] +Enabled=false +Degree=90 +AutoDegree=true +Surround=Average +AdaptLum=16 +Model=RawT +Algorithm=JC +J-Light=0 +Q-Bright=0 +C-Chroma=0 +S-Chroma=0 +M-Chroma=0 +J-Contrast=0 +Q-Contrast=0 +H-Hue=0 +RSTProtection=0 +AdaptScene=2000 +SurrSource=false +Gamut=false + [Impulse Denoising] Enabled=false Threshold=50 diff --git a/rtengine/LUT.h b/rtengine/LUT.h index 09cdc856b..f2f0c3c26 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -64,6 +64,7 @@ #define LUTf LUT #define LUTi LUT #define LUTu LUT +#define LUTd LUT #include #ifndef NDEBUG @@ -171,6 +172,8 @@ public: T p2 = data[idx + 1]-p1; return (p1 + p2*diff); } + + #ifndef NDEBUG // Debug facility ; dump the content of the LUT in a file. No control of the filename is done void dump(Glib::ustring fname) { diff --git a/rtengine/color.cc b/rtengine/color.cc index b66654946..c071fa87b 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -397,42 +397,43 @@ namespace rtengine { } void Color::Lab2XYZ(float L, float a, float b, float &x, float &y, float &z) { - float fy = (0.00862069 * L) + 0.137932; // (L+16)/116 - float fx = (0.002 * a) + fy; - float fz = fy - (0.005 * b); - - x = 65535.0*f2xyz(fx)*D50x; - // y = 65535.0*f2xyz(fy); - z = 65535.0*f2xyz(fz)*D50z; - y=(L>epskap) ? 65535.0*fy*fy*fy : 65535.0*L/kappa; - + float LL=L/327.68f; + float aa=a/327.68f; + float bb=b/327.68f; + float fy = (0.00862069f * LL) + 0.137932f; // (L+16)/116 + float fx = (0.002f * aa) + fy; + float fz = fy - (0.005f * bb); + x = 65535.0f*f2xyz(fx)*D50x; + z = 65535.0f*f2xyz(fz)*D50z; + y=(LL>epskap) ? 65535.0f*fy*fy*fy : 65535.0f*LL/kappa; } void Color::XYZ2Lab(float X, float Y, float Z, float &L, float &a, float &b) { - float X1 = X/D50x; - float Z1 = Z/D50z; + float x = X/D50x; + float z = Z/D50z; + float y= Y; + float fx,fy,fz; - float fx = (X1<65535.0 ? (cachef[std::max(X1,0.f)]) : (327.68*exp(log(X1/MAXVAL)/3.0 ))); - float fy = (Y<65535.0 ? (cachef[std::max(Y,0.f)]) : (327.68*exp(log(Y/MAXVAL)/3.0 ))); - float fz = (Z1<65535.0 ? (cachef[std::max(Z1,0.f)]) : (327.68*exp(log(Z1/MAXVAL)/3.0 ))); - - L = (116.0 * fy - 5242.88); //5242.88=16.0*327.68; - a = (500.0 * (fx - fy) ); - b = (200.0 * (fy - fz) ); + fx = (x<65535.0f ? cachef[std::max(x,0.f)] : (327.68f*exp(log(x/MAXVAL)/3.0f ))); + fy = (y<65535.0f ? cachef[std::max(y,0.f)] : (327.68f*exp(log(y/MAXVAL)/3.0f ))); + fz = (z<65535.0f ? cachef[std::max(z,0.f)] : (327.68f*exp(log(z/MAXVAL)/3.0f ))); + L = (116.0f * fy - 5242.88f); //5242.88=16.0*327.68; + a = (500.0f * (fx - fy) ); + b = (200.0f * (fy - fz) ); } void Color::Lab2Yuv(float L, float a, float b, float &Y, float &u, float &v) { float fy = (0.00862069 * L/327.68) + 0.137932; // (L+16)/116 float fx = (0.002 * a/327.68) + fy; float fz = fy - (0.005 * b/327.68); - float LL=L/327.68; + float LL=L/327.68; float X = 65535.0*f2xyz(fx)*D50x; // Y = 65535.0*f2xyz(fy); float Z = 65535.0*f2xyz(fz)*D50z; - Y=(LL>epskap) ? 65535.0*fy*fy*fy : 65535.0*LL/kappa; + Y=(LL/327.68f>epskap) ? 65535.0*fy*fy*fy : 65535.0*LL/kappa; u = 4.0*X/(X+15*Y+3*Z)-u0; v = 9.0*Y/(X+15*Y+3*Z)-v0; diff --git a/rtengine/colortemp.cc b/rtengine/colortemp.cc index 747aa107d..27221eeeb 100644 --- a/rtengine/colortemp.cc +++ b/rtengine/colortemp.cc @@ -21,11 +21,56 @@ #include "rtengine.h" #include "improcfun.h" #include "curves.h" +#include +#include +#include +#include "mytime.h" +#undef CLIPD +#define CLIPD(a) ((a)>0.0?((a)<1.0?(a):1.0):0.0) +#define CLIPQQ(a) ((a)>0?((a)<250?(a):250):0) +#define MAXR(a,b) ((a) > (b) ? (a) : (b)) namespace rtengine { + using namespace procparams; extern const Settings* settings; + static const double cie_colour_match_jd[97][3] = {//350nm to 830nm 5 nm J.Desmis observer 2° + {0.0000000,0.000000,0.000000}, {0.0000000,0.000000,0.000000}, {0.0001299,0.0003917,0.0006061}, + {0.0002321,0.000006965,0.001086}, {0.0004149,0.00001239,0.001946}, {0.0007416,0.00002202,0.003846}, + {0.001368,0.000039,0.006450001}, {0.002236,0.000064,0.01054999}, {0.004243,0.000120,0.02005001}, + {0.007650,0.000217,0.036210}, {0.014310,0.000396,0.06785001}, {0.023190,0.000640,0.110200}, + {0.043510,0.001210,0.207400}, {0.077630,0.002180,0.371300}, {0.134380,0.004000,0.645600}, + {0.214770,0.007300,1.0390501}, {0.283900,0.011600,1.385600}, {0.328500,0.016840,1.622960}, + {0.348280,0.023000,1.747060}, {0.348060,0.029800,1.782600}, {0.336200,0.038000,1.772110}, + {0.318700,0.048000,1.744100}, {0.290800,0.060000,1.669200}, {0.251100,0.073900,1.528100}, + {0.195360,0.090980,1.287640}, {0.142100,0.112600,1.041900}, {0.095640,0.139020,0.8129501}, + {0.05795001,0.169300,0.616200}, {0.032010,0.208020,0.465180}, {0.014700,0.258600,0.353300}, + {0.004900,0.323000,0.272000}, {0.002400,0.407300,0.212300}, {0.009300,0.503000,0.158200}, + {0.029100,0.608200,0.111700}, {0.063270,0.710000,0.07824999}, {0.109600,0.793200,0.05725001}, + {0.165500,0.862000,0.042160}, {0.2257499,0.9148501,0.029840}, {0.290400,0.954000,0.020300}, + {0.359700,0.980300,0.013400}, {0.43344990,0.9949501,0.008749999}, {0.5120501,1.000000,0.005749999}, + {0.594500,0.995000,0.003900}, {0.678400,0.978600,0.002749999}, {0.762100,0.952000,0.002100}, + {0.842500,0.915400,0.001800}, {0.916300,0.870000,0.001650001}, {0.978600,0.816300,0.001400}, + {1.026300,0.757000,0.001100}, {1.056700,0.694900,0.001000}, {1.062200,0.631000,0.000800}, + {1.045600,0.566800,0.000600}, {1.002600,0.503000,0.000340}, {0.938400,0.441200,0.000240}, + {0.8544499,0.381000,0.000190}, {0.751400,0.321000,0.000100}, {0.642400,0.265000,0.00004999999}, + {0.541900,0.217000,0.000030}, {0.447900,0.175000,0.000020}, {0.360800,0.138200,0.000010}, + {0.283500,0.107000,0.000000}, {0.218700,0.081600,0.000000}, {0.164900,0.061000,0.000000}, + {0.121200,0.044580,0.000000}, {0.087400,0.032000,0.000000}, {0.063600,0.023200,0.000000}, + {0.046770,0.017000,0.000000}, {0.032900,0.011920,0.000000}, {0.022700,0.008210,0.000000}, + {0.015840,0.005723,0.000000}, {0.01135916,0.004102,0.000000}, {0.008110916,0.002929,0.000000}, + {0.005790346,0.002091,0.000000}, {0.004109457,0.001484,0.000000}, {0.002899327,0.001047,0.000000}, + {0.00204919,0.000740,0.000000}, {0.001439971,0.000520,0.000000}, {0.0009999493,0.0003611,0.000000}, + {0.0006900786,0.0002492,0.000000}, {0.0004760213,0.0001719,0.000000}, {0.0003323011,0.000120,0.000000}, + {0.0002348261,0.0000848,0.000000}, {0.0001661505,0.000060,0.000000}, {0.000117413,0.0000424,0.000000}, + {0.00008307527,0.000030,0.000000}, {0.00005870652,0.0000212,0.000000}, {0.00004150994,0.00001499,0.000000}, + {0.00002935326,0.0000106,0.000000}, {0.00002067383,0.0000074657,0.000000}, {0.00001455977,0.0000052578,0.000000}, + {0.00001025398,0.0000037029,0.000000}, {0.000007221456,0.00000260778,0.000000}, {0.000005085868,0.0000018366,0.000000}, + {0.000003581652,0.0000012934,0.000000}, {0.000002522525,0.00000091093,0.000000}, {0.000001776509,0.00000064153,0.000000}, + {0.000001251141,0.00000045181,0.000000} + }; + ColorTemp::ColorTemp (double t, double g, Glib::ustring m) : temp(t), green(g), method(m) { clip (temp, green); @@ -67,6 +112,2044 @@ void ColorTemp::mul2temp (double rmul, double gmul, double bmul, double& temp, d clip (temp, green); } + +// spectral data for Daylight direct Sun: I have choose 5300K beacuse Nikon=5200K, Olympus=5300K, Panasonic=5500K, Leica=5400K, Minolta=5100K +const double ColorTemp::Daylight5300_spect[97] = { + 24.82,26.27,27.72,28.97,30.22,29.71,29.19,31.95,34.71,45.49,56.26,59.97,63.68,65.30,66.92,65.39,63.86,72.59,81.32,87.53,93.73,95.15,96.56,96.55,96.54,98.13,99.73,97.70,95.66,97.19,98.72, + 98.90,99.08,98.98,98.87,101.13,103.39,102.48,101.57,102.14,102.71,101.36,100.00,98.71,97.42,97.81,98.21,95.20,92.20,93.92,95.63,96.15,96.67,96.34,96.01,94.21,92.41,93.58,94.74,93.05,91.36,92.29, + 93.21,95.25,97.28,95.30,93.32,87.92,82.51,84.29,86.06,86.94,87.81,80.24,72.68,77.32,81.96,84.88,87.79,81.01,74.22,64.41,54.60,66.55,78.51,76.35,74.20,74.79,75.38,72.48,69.58,65.11,60.64, + 63.88,67.13,68.85,70.57 +}; + +//spectral data for Daylight Cloudy: I have choose 6200K beacuse Nikon=6000K, Olympus=6000K, Panasonic=6200K, Leica=6400K, Minolta=6500K +const double ColorTemp::Cloudy6200_spect[97] = { + 39.50,40.57,41.63,43.85,46.08,45.38,44.69,47.20,49.71,63.06,76.41,80.59,84.77,85.91,87.05,84.14,81.23,90.29,99.35,105.47,111.58,112.23,112.87,111.74,110.62,111.41,112.20,108.98,105.76,106.32, + 106.89,106.34,105.79,104.62,103.45,105.09,106.72,105.24,103.76,103.75,103.75,101.87,100.00,98.29,96.58,96.46,96.34,92.85,89.37,90.25,91.12,91.06,90.99,90.17,89.35,87.22,85.10,85.48,85.85, + 84.03,82.20,82.45,82.69,83.92,85.15,83.14,81.13,76.65,72.17,73.27,74.36,75.65,76.95,70.34,63.74,67.98,72.22,74.88,77.54,71.59,65.65,56.82,47.99,58.53,69.06,67.27,65.47,65.96,66.44,63.92,61.41,57.52, + 53.63,56.47,59.31,60.80,62.29 +}; + +//spectral data for Daylight Shade: I have choose 7600K beacuse Nikon=8000K, Olympus=7500K, Panasonic=7500K, Leica=7500K, Minolta=7500K +const double ColorTemp::Shade7600_spect[97] = { + 64.42,64.46,64.51,68.35,72.20,70.22,68.24,69.79,71.35,87.49,103.64,108.68,113.72,114.12,114.53,109.54,104.55,113.59,122.63,128.52,134.41,134.02,133.63,131.02,128.41,128.08,127.75,123.16, + 118.57,117.89,117.22,115.72,114.22,111.60,108.99,109.84,110.68,108.57,106.45,105.71,104.98,102.49,100.00,97.78,95.55,94.82,94.08,90.47,86.87,86.94,87.01,86.45,85.88,84.57,83.27,80.83,78.40,78.21, + 78.03,76.22,74.42,74.15,73.89,74.41,74.92,73.01,71.09,67.26,63.42,64.01,64.60,66.10,67.60,61.83,56.06,59.94,63.82,66.27,68.71,63.49,58.26,50.30,42.34,51.64,60.95,59.45,57.95,58.35,58.76,56.57, + 54.38,51.00,47.62,50.10,52.58,53.88,55.19 +}; + +//spectral data for tungsten - incandescent 2856K +const double ColorTemp::A2856_spect[97] = { + 4.75,5.42,6.15,6.95,7.83,8.78,9.80,10.91,12.09,13.36,14.72,16.16,17.69,19.30,21.01,22.80,24.68,26.65,28.71,30.86,33.10,35.42,37.82,40.31,42.88,45.53,48.25,51.05,53.92,56.87,59.87,62.94,66.07,69.26,72.50, + 75.80,79.14,82.53,85.95,89.42,92.91,96.44,100.00,103.58,107.18,110.80,114.43,118.07,121.72,125.38,129.03,132.68,136.33,139.97,143.60,147.21,150.81,154.39,157.95,161.48,164.99,168.47,171.92,175.34, + 178.72,182.07,185.38,188.65,191.88,195.06,198.20,201.30,204.34,207.34,210.29,213.19,216.04,218.84,221.58,224.28,226.91,229.49,232.02,234.49,236.91,239.27,241.57,243.82,246.01,248.14,250.21,252.23,254.19, + 256.10,257.95,259.74,261.47 +}; + +//spectral data for fluo F1 Daylight 6430K +const double ColorTemp::FluoF1_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,1.87,2.36,2.94,3.47,5.17,19.49,6.13,6.24,7.01,7.79,8.56,43.67,16.94,10.72,11.35,11.89,12.37,12.75,13.00,13.15,13.23,13.17,13.13,12.85,12.52, + 12.20,11.83,11.50,11.22,11.05,11.03,11.18,11.53,27.74,17.05,13.55,14.33,15.01,15.52,18.29,19.55,15.48,14.91,14.15,13.22,12.19,11.12,10.03,8.95,7.96,7.02,6.20,5.42,4.73,4.15,3.64,3.20,2.81, + 2.47,2.18,1.93,1.72,1.67,1.43,1.29,1.19,1.08,0.96,0.88,0.81,0.77,0.75,0.73,0.68,0.69,0.64,0.68,0.69,0.61,0.52,0.43,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for fluo F2 Cool white 4230K +const double ColorTemp::FluoF2_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,1.18,1.48,1.84,2.15,3.44,15.69,3.85,3.74,4.19,4.62,5.06,34.98,11.81,6.27,6.63,6.93,7.19,7.40,7.54,7.62,7.65,7.62,7.62,7.45,7.28,7.15,7.05,7.04,7.16,7.47,8.04,8.88,10.01,24.88,16.64,14.59,16.16,17.60,18.62,21.47,22.79,19.29,18.66,17.73,16.54,15.21,13.80,12.36,10.95,9.65,8.40,7.32,6.31,5.43,4.68,4.02,3.45, + 2.96,2.55,2.19,1.89,1.64,1.53,1.27,1.10,0.99,0.88,0.76,0.68,0.61,0.56,0.54,0.51,0.47,0.47,0.43,0.46,0.47,0.40,0.33,0.27,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for fluo F3 White 3450K +const double ColorTemp::FluoF3_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,0.82,1.02,1.26,1.44,2.57,14.36,2.70,2.45,2.73,3.00,3.28,31.85,9.47,4.02,4.25,4.44,4.59,4.72,4.80,4.86,4.87,4.85,4.88,4.77,4.67,4.62,4.62,4.73,4.99,5.48,6.25, + 7.34,8.78,23.82,16.14,14.59,16.63,18.49,19.95,23.11,24.69,21.41,20.85,19.93,18.67,17.22,15.65,14.04,12.45,10.95,9.51,8.27,7.11,6.09,5.22,4.45,3.80,3.23,2.75,2.33,1.99,1.70,1.55, + 1.27,1.09,0.96,0.83,0.71,0.62,0.54,0.49,0.46,0.43,0.39,0.39,0.35,0.38,0.39,0.33,0.28,0.21,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for fluo F4 Warm white 2940K +const double ColorTemp::FluoF4_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,0.57,0.70,0.87,0.98,2.01,13.75,1.95,1.59,1.76,1.93,2.10,30.28,8.03,2.55,2.70,2.82,2.91,2.99,3.04,3.08,3.09,3.09,3.14,3.06,3.00,2.98,3.01, + 3.14,3.41,3.90,4.69,5.81,7.32,22.59,15.11,13.88,16.33,18.68,20.64,24.28,26.26,23.28,22.94,22.14,20.91,19.43,17.74,16.00,14.42,12.56,10.93,9.52,8.18,7.01,6.00,5.11,4.36,3.69,3.13,2.64, + 2.24,1.91,1.70,1.39,1.18,1.03,0.88,0.74,0.64,0.54,0.49,0.46,0.42,0.37,0.37,0.33,0.35,0.36,0.31,0.26,0.19,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for fluo F5 Daylight 6350K +const double ColorTemp::FluoF5_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,1.87,2.35,2.92,3.45,5.10,18.91,6.00,6.11,6.85,7.58,8.31,40.76,16.06,10.32,10.91,11.40,11.83,12.17,12.40,12.54,12.58,12.52,12.47,12.20,11.89, + 11.61,11.33,11.10,10.96,10.97,11.16,11.54,12.12,27.78,17.73,14.47,15.20,15.77,16.10,18.54,19.50,15.39,14.64,13.72,12.69,11.57,10.45,9.35,8.29,7.32,6.41,5.63,4.90,4.26, + 3.72,3.25,2.83,2.49,2.19,1.93,1.71,1.52,1.43,1.26,1.13,1.05,0.96,0.85,0.78,0.72,0.68,0.67,0.65,0.61,0.62,0.59,0.62,0.64,0.55,0.47,0.40,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for fluo F6 Lite white 4150K +const double ColorTemp::FluoF6_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,1.05,1.31,1.63,1.90,3.11,14.8,3.43,3.30,3.68,4.07,4.45,32.61,10.74,5.48,5.78,6.03,6.25,6.41,6.52,6.58,6.59,6.56,6.56,6.42,6.28,6.20,6.19,6.30,6.60,7.12,7.94,9.07,10.49,25.22,17.46,15.63,17.22,18.53, + 19.43,21.97,23.01,19.41,18.56,17.42,16.09,14.64,13.15,11.68,10.25,8.96,7.74,6.69,5.71,4.87,4.16,3.55,3.02,2.57,2.20,1.87,1.60,1.37,1.29,1.05,0.91,0.81,0.71,0.61,0.54,0.48,0.44, + 0.43,0.40,0.37,0.38,0.35,0.39,0.41,0.33,0.26,0.21,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for fluo F7 D65 Daylight simulator 6500K +const double ColorTemp::FluoF7_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,2.56,3.18,3.84,4.53,6.15,19.37,7.37,7.05,7.71,8.41,9.15,44.14,17.52,11.35,12.00,12.58,13.08,13.45,13.71,13.88,13.95,13.93,13.82,13.64,13.43,13.25,13.08,12.93,12.78,12.60, + 12.44,12.33,12.26,29.52,17.05,12.44,12.58,12.72,12.83,15.46,16.75,12.83,12.67,12.43,12.19,11.89,11.60,11.35,11.12,10.95,10.76,10.42,10.11,10.04,10.02,10.11,9.87,8.65,7.27,6.44,5.83,5.41, + 5.04,4.57,4.12,3.77,3.46,3.08,2.73,2.47,2.25,2.06,1.90,1.75,1.62,1.54,1.45,1.32,1.17,0.99,0.81,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for fluo F8 D50 simulator Sylvania F40 Design 5000K +const double ColorTemp::FluoF8_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,1.21,1.5,1.81,2.13,3.17,13.08,3.83,3.45,3.86,4.42,5.09,34.1,12.42,7.68,8.60,9.46,10.24,10.84,11.33,11.71,11.98,12.17,12.28,12.32,12.35,12.44,12.55,12.68,12.77,12.72, + 12.60,12.43,12.22,28.96,16.51,11.79,11.76,11.77,11.84,14.61,16.11,12.34,13.61,13.87,14.07,14.20,14.16,14.13,14.34,14.50,14.46,14.00,12.58,10.99,9.98,9.22,8.62,8.07,7.39,6.71,6.16,5.63,5.03,4.46,4.02,3.66, + 3.36,3.09,2.85,2.65,2.51,2.37,2.15,1.89,1.61,1.32,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for fluo F9 Cool white deluxe 4150K +const double ColorTemp::FluoF9_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,0.9,1.12,1.36,1.60,2.59,12.8,3.05,2.56,2.86,3.30,3.82,32.62,10.77,5.84,6.57,7.25,7.86,8.35,8.75,9.06,9.31,9.48,9.61,9.68,10.04,10.26,10.48,10.63,10.76,10.96, + 11.18,27.71,16.29,12.28,12.74,13.21,13.65,16.57,18.14,14.55,14.65,14.66,14.61,14.50,14.39,14.40,14.47,14.62,14.72,14.55,14.4,14.58,14.88,15.51,15.47,13.20,10.57,9.18,8.25,7.57,7.03, + 6.35,5.72,5.25,4.80,4.29,3.80,3.43,3.12,2.86,2.64,2.43,2.26,2.14,2.02,1.83,1.61,1.38,1.12,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for fluo F10 Philips TL85 - 5000K +const double ColorTemp::FluoF10_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,1.11,0.63,0.62,0.57,1.48,12.16,2.12,2.70,3.74,5.14,6.75,34.39,14.86,10.4,10.76,10.11,9.27,8.29,7.29,7.91,16.64,16.73,10.44,5.94,3.34,2.35,1.88,1.59,1.47, + 1.80,5.71,40.98,73.69,33.61,8.24,3.38,2.47,4.86,11.45,14.79,12.16,8.97,6.52,8.81,44.12,34.55,12.09,12.15,10.52,4.43,1.95,2.19,3.19,2.77,2.29,2.00,1.52,1.35,1.47,1.79,1.74,1.02,1.14, + 3.32,4.49,2.05,0.49,0.24,0.21,0.21,0.24,0.24,0.21,0.17,0.21,0.22,0.17,0.12,0.09,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for fluo F11 Philips TL84 4150K +const double ColorTemp::FluoF11_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,0.91,0.63,0.46,0.37,1.29,12.68,1.59,1.79,2.46,3.38,4.49,33.94,12.13,6.95,7.19,7.12,6.72,6.13,5.46,4.79,5.66,14.29,14.96,8.97,4.72,2.33,1.47,1.10,0.89,0.83,1.18,4.90,39.59, + 72.84,32.61,7.52,2.83,1.96,1.67,4.43,11.28,14.76,12.73,9.74,7.33,9.72,55.27,42.58,13.18,13.16,12.26,5.11,2.07,2.34,3.58,3.01,2.48,2.14,1.54,1.33,1.46,1.94,2.00,1.20,1.35,4.10,5.58, + 2.51,0.57,0.27,0.23,0.21,0.24,0.24,0.20,0.24,0.32,0.26,0.16,0.12,0.09,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for fluo F12 Philips TL83 3000K +const double ColorTemp::FluoF12_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,0.96,0.64,0.45,0.33,1.19,12.48,1.12,0.94,1.08,1.37,1.78,29.05,7.90,2.65,2.71,2.65,2.49,2.33,2.10,1.91,3.01,10.83,11.88,6.88,3.43,1.49,0.92,0.71,0.60,0.63,1.10,4.56,34.4,65.40,29.48, + 7.16,3.08,2.47,2.27,5.09,11.96,15.32,14.27,11.86,9.28,12.31,68.53,53.02,14.67,14.38,14.71,6.46,2.57,2.75,4.18,3.44,2.81,2.42,1.64,1.36,1.49,2.14,2.34,1.42,1.61,5.04,6.98,3.19,0.71,0.30,0.26,0.23,0.28,0.28,0.21, + 0.17,0.21,0.19,0.15,0.10,0.05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for HMI lamp studio "Osram" 4800K (for film, spectacle, studio...) +const double ColorTemp::HMI_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,9.66,11.45,13.24,14.93,16.63,17.90,19.20,20.12,21.03,23.84,26.65,26.38,26.12,26.52,27.92,31.15,34.37,34.98,35.61,35.71,35.81,34.90,34.02,34.06,34.08,34.68,35.28,34.72,34.20,33.63, + 33.05,34.70,36.35,38.01,39.48,37.29,35.10,36.22,37.28,38.76,40.24,39.56,38.90,39.35,39.79,38.90,38.01,38.05,38.10,37.45,36.64,35.82,35.00,35.06,33.13,33.85,34.55,35.26,35.77,34.92, + 34.09,33.40,32.72,32.08,31.45,26.83,22.23,21.50,20.79,21.41,22.03,11.01,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for GTI lamp : Graphiclite & ColorMatch for Photography 5000K +const double ColorTemp::GTI_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,3.26,4.71,6.17,12.71,19.27,20.53,21.80,19.15,16.53,28.25,39.97,48.52,57.06,43.66,30.27,30.22,30.16,31.48,32.98,34.01,35.04,35.83,36.62,37.12,37.62,37.99,38.19,38.29,38.48, + 38.82,39.16,45.40,51.63,51.83,62.04,52.41,42.80,42.95,43.09,45.64,48.20,46.23,44.27,43.74,43.22,43.30,43.41,43.10,42.78,42.03,41.29,40.29,39.29,37.89,36.58,34.92,33.27,31.47,29.68,27.90, + 26.13,24.55,22.98,21.42,19.86,18.40,16.92,14.46,13.99,12.36,11.73,5.86,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for JudgeIII Lamp D50 +const double ColorTemp::JudgeIII_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,4.08,4.25,4.43,6.90,9.40,9.75,10.11,9.30,8.54,14.90,21.16,26.01,30.83,24.90,19.00,19.00,19.00,19.56,20.13,20.28,20.44,20.64,20.85,21.05,21.24,21.65,22.11,22.85,23.58,24.00,24.43, + 27.75,31.27,33.90,36.59,30.90,25.32,25.05,24.76,26.03,27.31,25.90,24.48,23.85,23.29,23.10,22.94,23.24,23.53,24.02,24.52,23.80,23.13,24.51,25.76,27.90,29.15,24.70,20.25,16.60,12.98,11.63,10.27,9.30,8.34, + 7.60,6.91,6.25,5.67,5.15,4.68,2.34,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data for Solux lamp : 3500K +const double ColorTemp::Solux3500_spect[97] = { + 0.5268,0.93,1.3278,1.51,1.6987,2.65,3.6100,3.80,3.9927,6.08,8.1680,11.02,13.863,15.66,17.4600,18.78,20.130,21.43,22.749,24.02,25.290,27.40,29.504,31.77,34.031,36.35,38.672,40.55,42.426,44.15,45.865,47.37,48.879, + 49.71,50.531,51.2,51.872,51.9,51.928,52.97,54.015,55.93,57.846,60.25,62.650,64.36,66.065,66.72,67.369,68.81,70.260,71.37,72.487,72.53,72.578,72.51,72.447,72.46,72.471, + 72.76,73.047,74.25,75.449,76.5,77.543,78.79,80.040,80.72,81.394,82.12,82.840,83.23,83.614,83.36,83.100,82.36,81.615,80.11,78.606,75.91,73.221,69.61,66.006,62.43,58.844,56.07,53.292, + 51.07,48.839,46.93,45.013,43.54,42.070,40.61,39.150,37.79,36.425 +}; + +//spectral data for Solux lamp : 4100K +const double ColorTemp::Solux4100_spect[97] = { + 0.5717,0.70,0.8286,1.16,1.522,2.01,2.384,3.45,4.57,6.46,8.4548,11.31,14.205,16.10,17.949,19.51,21.068,22.60,24.197,25.37,26.566,28.15,29.742,30.90,32.060,33.26,34.481,34.80,35.130,35.42,35.697,36.20,36.763, + 37.90,39.004,40.26,41.494,43.10,44.690,45.80,46.900,47.45,47.885,47.75,47.635,47.00,46.410,46.22,46.058,46.70,47.344,48.65,50.005,51.02,52.045,53.55,55.075,55.98,56.823, + 56.85,56.884,56.15,55.523,54.60,53.732,52.55,51.425,50.30,49.1830,48.76,48.273,48.22,48.169,49.92,49.915,51.90,53.099,54.95,56.852,58.45,60.090,61.67,63.2530,63.55,63.834,63.55,63.468, + 62.40,61.373,59.75,58.1810,56.25,54.395,51.90,49.496,47.05,44.620 +}; + +//spectral data for Solux lamp : near Daylight (for example "musée d'Orsay..") - 4700K +const double ColorTemp::Solux4700_spect[97] = { + 0.4590,0.83,1.2011,1.53,1.8647,2.15,2.5338,3.06,3.5809,3.99,4.4137,4.82,5.2228,5.63,6.0387,6.53,6.9944,7.55,8.0266,8.475,8.9276,8.90,9.7840,10.20,10.6390,11.00,11.3600,11.75,12.1340,12.36,12.5880,12.74,12.8790, + 13.07,13.2560,13.38,13.5220,13.41,13.3070,13.35,13.3990,13.37,13.3420,13.39,13.4220,13.65,13.2710,13.25,13.2330,13.12,13.0110,12.93,12.8470,12.805,12.7630,12.66,12.5760,12.563,12.5490, + 12.59,12.6330,12.617,12.6010,12.616,12.6310,12.6275,12.6240,12.70,12.7710,12.776,12.7810,12.786,12.7950,12.74,12.6850,12.64,12.5950,12.55,12.5420,12.43,12.3180,12.07,11.8340,11.72,11.6190,11.55,11.5020, + 11.32,11.1510,11.05,10.9530,10.80,10.6550,10.495,10.4390,10.31,10.1790 +}; + +//spectral data for Solux lamp : near Daylight 4400K - test National Gallery +const double ColorTemp::NG_Solux4700_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,139,152,170,185,202,223,240,257,270,282,293,305,317,329,342,355,367,378,387,395,401,405,408,411,414,415,416,415,414,414,416,419,423,427,432,437,442,447,452, + 456,461,467,475,483,488,490,491,490,487,485,481,477,472,466,461,455,449,442,434,427,419,411,403,395,386,377,367,359,351,343,335,327,322,316,312,306,305,301,299,299,298, + 0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.0 +}; + +//spectral data for LED LSI Lumelex 2040 - test National Gallery +const double ColorTemp::NG_LEDLSI2040_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,1.5,1.2,0.5,0.7,0.6,1.6,1.7,7.0,16.6,35.5,64,106,162.5,230.5,272.2,249,213.4,214,227.6,231.9,233,235.2,241.4,253.7,270.3,288.5,306.2,322.3,337.6,352.5,367.2,381.7,395.9,409.6,416.2,423.2,429.7,435.8,442.8, + 451.7,464.2,480.3,501,526.3,555.9,587.5,625.4,655.1,681.7,705.3,721.5,728.5,729,719.8,702.5,676.7,646.2,611.5,571.7,530.3,488.3,445.9,404,365.2,326.8,290.8,257.6,226.9,199.8,175.2,154.2,133.8,116.4,101.5,88.5,76.6,67.3,57.9,50.7,44.2,38.2, + 0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.0 +}; + +//spectral data for LED CRS SP12 WWMR16 - test National Gallery +const double ColorTemp::NG_CRSSP12WWMR16_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,0.,0.,0.,0.,0.,0.14,0.33,1.31,3.34,7.9,17.4,36.5,72.6,145.4,260.5,359.2,365.3,303.1,256.1,221.7,193.6,185.8,191.4,207.3,232.8,257.5,285.1,310.5,333.4,351.5,368.8,383.7,398.8,411.6,424.7,435.6,447.9,459.7,471.7, + 484.6,497.9,512.3,531.1,548.9,567.9,587.5,608.6,625.3,640.1,648.6,654.0,654.3,647.2,633.9,616.1,590.5,561.5,526.5,494.8,457.9,420.8,382.4,347.3,309.9,280.5,249.2,220.0,194.9,170.8,149.1,130.0,112.3,97.5,84.9,73.2,63.1,54.1,45.6,39.0,32.6,27.4, + 0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.0 +}; + + +//Data for flash : +// in theory, should be the spectral data of each owner flash (Nikon, Canon, Sony ...) or studio flash (Profoto. ..) +// but: 1) I did not, 2) the data vary depending on the power used ... so by default, although this is not true, I chose the values "Daylight" for temp... +// CRI for flash near of 95 - 97 !! + +//spectral data for Flash daylight 5500K (Leica...) +const double ColorTemp::Flash5500_spect[97] = { + 27.77,29.17,30.58,32.02,33.47,33.00,32.53,35.28,38.04,49.46,60.88,64.68,68.48,69.99,71.51,69.68,67.85,76.70,85.54,91.74,97.93,99.17,100.41,100.14,99.86,101.28,102.70,100.37,98.04,99.35,100.65, + 100.66,100.67,100.32,99.97,102.08,104.20,103.15,102.09,102.53,102.96,101.48,100.00,98.61,97.22,97.49,97.76,94.60,91.44,92.94,94.44,94.80,95.16,94.70,94.25,92.36,90.48,91.42,92.36,90.63, + 88.89,89.62,90.36,92.18,94.00,92.00,90.00,84.86,79.72,81.30,82.88,83.88,84.89,77.58,70.27,74.80,82.19,85.03,78.47,71.91,62.37,52.82,64.39,75.96,73.91,71.85,72.41,72.97,70.17,67.38,63.07, + 58.75,61.89,65.02,66.68,68.34 +}; + +//spectral data for Flash daylight 6000K (Canon, Pentax, Olympus,...Standard) +const double ColorTemp::Flash6000_spect[97] = { + 36.00,37.18,38.36,40.36,42.35,41.77,41.19,43.79,46.40,59.24,72.09,76.15,80.22,81.47,82.71,80.12,77.52,86.54,95.56,101.70,107.85,108.66,109.46,108.57,107.68,108.65,109.61,106.63,103.65,104.42, + 105.19,104.79,104.39,103.45,102.51,104.28,106.05,104.68,103.31,103.42,103.54,101.77,100.00,98.38,96.75,96.74,96.72,93.30,89.89,90.92,91.95,91.99,92.03,91.30,90.57,88.51,86.45,86.96, + 87.47,85.66,83.85,84.21,84.57,85.95,87.32,85.31,83.30,78.66,74.03,75.24,76.45,77.68,78.91,72.13,65.35,69.67,73.98,76.68,79.39,73.29,67.19,58.19,49.19,59.98,70.77,68.91,67.05,67.55,68.05, + 65.47,62.88,58.89,54.90,57.81,60.72,62.25,63.78 +}; + +//spectral data for Flash daylight 6500K (Nikon, Minolta, Panasonic, Sony...) +const double ColorTemp::Flash6500_spect[97] = { + 44.86,45.72,46.59,49.16,51.74,50.83,49.92,52.26,54.60,68.65,82.69,87.06,91.42,92.39,93.37,90.00,86.63,95.72,104.81,110.88,116.96,117.36,117.76,116.29,114.82,115.35,115.89,112.33,108.78,109.06, + 109.33,108.56,107.78,106.28,104.78,106.23,107.68,106.04,104.40,104.22,104.04,102.02,100.00,98.17,96.34,96.06,95.79,92.24,88.69,89.35,90.02,89.81,89.61,88.66,87.71,85.51,83.30,83.51,83.72, + 81.88,80.05,80.14,80.24,81.27,82.30,80.31,78.31,74.03,69.74,70.69,71.63,73.00,74.37,68.00,61.62,65.76,69.91,72.51,75.11,69.36,63.61,55.02,46.43,56.63,66.83,65.11,63.40,63.86,64.32,61.90,59.47, + 55.72,51.97,54.72,57.46,58.89,60.33 +}; + +// Data for Color ==> CRI (Color Rendering Index and Palette +// actually 20 color that must be good enough for CRI + +// I think 40 color for palette (Skin, Sky, gray) + +//spectral data Colorchecker24 : Red C3 +const double ColorTemp::ColorchechredC3_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0478,0.0476,0.0474,0.0472,0.0470,0.0466,0.0461,0.0460,0.0459,0.0456,0.0453,0.0451,0.0449,0.0448,0.0447,0.0446,0.0445,0.0441,0.0437,0.0432,0.0427,0.0424,0.0421,0.0419, + 0.0417,0.0415,0.0412,0.0412,0.0412,0.0413,0.0413,0.0415,0.0416,0.0421,0.0426,0.0436,0.0446,0.0469,0.0491,0.0549,0.0607,0.0773,0.0939,0.1376,0.1812,0.2568,0.3323,0.4070,0.4816,0.5308, + 0.5800,0.6059,0.6317,0.6447,0.6577,0.6653,0.6728,0.6761,0.6793,0.6820,0.6847,0.6878,0.6909,0.6945,0.6980,0.7013,0.7046,0.7065,0.7084,0.7107,0.7129,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data Colorchecker24 : Orange A2 +const double ColorTemp::ColorchechOraA2_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0520,0.0530,0.0540,0.0535,0.0530,0.0532,0.0534,0.0532,0.0529,0.0529,0.0528,0.0530,0.0532,0.0537,0.0542,0.0550,0.0557,0.0565,0.0573,0.0585,0.0597,0.0613,0.0628,0.0656,0.0683,0.0793, + 0.0902,0.1085,0.1268,0.1414,0.1559,0.1645,0.1730,0.1837,0.1944,0.2184,0.2424,0.2877,0.3329,0.3923,0.4517,0.5021,0.5525,0.5739,0.5952,0.5967,0.5982,0.5962,0.5942,0.5932,0.5922,0.5927, + 0.5932,0.5938,0.5944,0.5988,0.6032,0.6105,0.6178,0.6284,0.6389,0.6498,0.6607,0.6699,0.6791,0.6839,0.6886,0.6879,0.6871,0.6886,0.6901,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data Colorchecker24 :yellow D3 +const double ColorTemp::ColorchechYelD3_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0476,0.0482,0.0488,0.0492,0.0496,0.0498,0.0499,0.0498,0.0496,0.0501,0.0506,0.0516,0.0526,0.0547,0.0567,0.0610,0.0652,0.0733,0.0813,0.0962,0.1110,0.1333,0.1556,0.1884,0.2211, + 0.2782,0.3353,0.4023,0.4692,0.5198,0.5703,0.5976,0.6249,0.6400,0.6551,0.6667,0.6783,0.6901,0.7018,0.7095,0.7171,0.7231,0.7290,0.7329,0.7367,0.7395,0.7423,0.7447,0.7471,0.7490,0.7508, + 0.7533,0.7558,0.7578,0.7598,0.7623,0.7647,0.7654,0.7661,0.7677,0.7693,0.7720,0.7746,0.7780,0.7814,0.7845,0.7876,0.7889,0.7902,0.7920,0.7938, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data Colorchecker24 : Green E2 +const double ColorTemp::ColorchechGreE2_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0560,0.0583,0.0605,0.0626,0.0646,0.0650,0.0653,0.0657,0.0661,0.0669,0.0676,0.0692,0.0708,0.0737,0.0765,0.0816,0.0867,0.0956,0.1044,0.1194,0.1344,0.1581,0.1818,0.2196,0.2574,0.3166,0.3757, + 0.4297,0.4837,0.5142,0.5446,0.5541,0.5636,0.5608,0.5579,0.5480,0.5381,0.5258,0.5135,0.4959,0.4783,0.4570,0.4356,0.4124,0.3891,0.3710,0.3529,0.3425,0.3320,0.3266,0.3211,0.3180,0.3149, + 0.3129,0.3108,0.3123,0.3137,0.3193,0.3248,0.3335,0.3422,0.3518,0.3613,0.3693,0.3772,0.3810,0.3847,0.3838,0.3829,0.3838,0.3847,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data Colorchecker24 : Green B3 +const double ColorTemp::ColorchechGreB3_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0531,0.0545,0.0559,0.0563,0.0566,0.0571,0.0576,0.0576,0.0575,0.0581,0.0586,0.0596,0.0606,0.0629,0.0652,0.0699,0.0745,0.0839,0.0932,0.1101,0.1270,0.1521,0.1771,0.2098,0.2424, + 0.2789,0.3154,0.3312,0.3470,0.3431,0.3392,0.3303,0.3213,0.3089,0.2964,0.2788,0.2612,0.2442,0.2271,0.2117,0.1962,0.1815,0.1667,0.1527,0.1386,0.1284,0.1182,0.1124,0.1066,0.1035,0.1003, + 0.0987,0.0971,0.0961,0.0950,0.0950,0.0950,0.0962,0.0973,0.0994,0.1014,0.1045,0.1075,0.1106,0.1137,0.1157,0.1176,0.1175,0.1173,0.1173,0.1173, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data Colorchecker24 : Cyan F3 +const double ColorTemp::ColorchechCyaF3_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0813,0.1048,0.1282,0.1611,0.1940,0.2198,0.2456,0.2575,0.2693,0.2807,0.2921,0.3079,0.3237,0.3424,0.3611,0.3820,0.4029,0.4234,0.4439,0.4547,0.4654,0.4638,0.4621,0.4482,0.4342,0.4119,0.3895, + 0.3656,0.3417,0.3160,0.2903,0.2654,0.2404,0.2167,0.1929,0.1720,0.1510,0.1368,0.1226,0.1138,0.1049,0.0993,0.0936,0.0890,0.0844,0.0810,0.0776,0.0759,0.0742,0.0733,0.0724,0.0723,0.0722,0.0727, + 0.0732,0.0745,0.0757,0.0763,0.0768,0.0764,0.0759,0.0748,0.0736,0.0723,0.0710,0.0703,0.0696,0.0707,0.0718,0.0756,0.0793,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data Colorchecker24 : Purple D2 +const double ColorTemp::ColorchechPurD2_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0854,0.1047,0.1240,0.1468,0.1696,0.1826,0.1955,0.1963,0.1970,0.1910,0.1849,0.1750,0.1651,0.1541,0.1430,0.1322,0.1213,0.1117,0.1020,0.0944,0.0868,0.0809,0.0750,0.0703,0.0655, + 0.0627,0.0599,0.0583,0.0567,0.0550,0.0533,0.0525,0.0517,0.0518,0.0519,0.0523,0.0526,0.0525,0.0524,0.0520,0.0516,0.0523,0.0529,0.0560,0.0591,0.0662,0.0732,0.0828,0.0924,0.1021, + 0.1117,0.1222,0.1327,0.1469,0.1610,0.1796,0.1981,0.2173,0.2365,0.2532,0.2698,0.2826,0.2953,0.3022,0.3090,0.3126,0.3161,0.3238,0.3314,0.3504,0.3694,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data Colorchecker24 : Magenta E3 +const double ColorTemp::ColorchechMagE3_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1112,0.1438,0.1763,0.2294,0.2824,0.3188,0.3552,0.3623,0.3693,0.3653,0.3612,0.3510,0.3407,0.3269,0.3130,0.2981,0.2832,0.2686,0.2539,0.2385,0.2230,0.2083,0.1935,0.1818,0.1700,0.1600,0.1499, + 0.1394,0.1288,0.1188,0.1088,0.1051,0.1014,0.1026,0.1038,0.1041,0.1043,0.1064,0.1085,0.1225,0.1364,0.1701,0.2037,0.2532,0.3027,0.3587,0.4147,0.4683,0.5219,0.5672,0.6124,0.6455,0.6785,0.7009, + 0.7232,0.7391,0.7550,0.7629,0.7707,0.7737,0.7766,0.7778,0.7790,0.7803,0.7815,0.7835,0.7854,0.7896,0.7937,0.8026,0.8114,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data Colorchecker24 : Skin A1 +//use also for palette WB +const double ColorTemp::ColorchechSkiA138_13_14_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0479,0.051,0.0553,0.058,0.0610,0.062,0.0626,0.0622,0.0619,0.0617,0.0616,0.0615,0.0614,0.0614,0.0615,0.0617,0.0618,0.0618,0.0619,0.0618,0.0618,0.062,0.0622,0.063,0.0638,0.066,0.0696, + 0.073,0.0767,0.078,0.0801,0.0807,0.0817,0.0831,0.0845,0.0870,0.0902,0.0955,0.1017,0.1096,0.1175,0.1250,0.1336,0.1385,0.1435,0.1455,0.1479,0.1490,0.1514,0.1547,0.1580,0.1625,0.1675, + 0.173,0.1772,0.181,0.1842,0.1846,0.1853,0.1831,0.1811,0.1788,0.1765,0.1769,0.1773,0.181,0.1834,0.1874,0.1914,0.1965,0.2018,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data Colorchecker24 : Gray C4 L=67 +//use also for palette WB +const double ColorTemp::ColorchechGraC4_67_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1074,0.1380,0.1704,0.22,0.2705,0.305,0.3409,0.35,0.3601,0.3628,0.3655,0.3675,0.3698,0.371,0.3724,0.373,0.3733,0.3725,0.3715,0.3705,0.3692, + 0.369,0.3689,0.368,0.3673,0.3678,0.3684,0.37,0.3711,0.3712,0.3714,0.3714,0.3714,0.371,0.3707,0.37,0.3694,0.3697,0.3703,0.3697,0.3692,0.3688,0.3685,0.3675,0.3669,0.3657,0.3647,0.3635,0.3625,0.361, + 0.3596,0.3585,0.3579,0.357,0.3560,0.3555,0.3548,0.3535,0.3526,0.3513,0.3500,0.349,0.3475,0.3467,0.3460,0.3452,0.3444,0.3431,0.3421,0.3411,0.3403,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data Colorchecker24 : Skin B1 +//use also for palette WB +const double ColorTemp::ColorchechSkiB166_18_18_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0962,0.114,0.1328,0.152,0.1706,0.1755,0.1877,0.189,0.1903,0.1913,0.1923,0.1946,0.1971,0.2015,0.2064,0.215,0.2245,0.239,0.2535,0.273,0.2922,0.31,0.3274,0.337,0.3473, + 0.348,0.3489,0.335,0.3224,0.303,0.2835,0.275,0.2671,0.27,0.2728,0.2735,0.2741,0.279,0.2836,0.308,0.3334,0.375,0.4183,0.457,0.4950,0.516,0.5409,0.5515,0.5625,0.568,0.5731,0.5786, + 0.5820,0.586,0.5902,0.596,0.6025,0.611,0.6174,0.627,0.6375,0.65,0.6626,0.677,0.6910,0.704,0.7171,0.723,0.7339,0.741,0.7475, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data Colorchecker24 : blue sky C1 +//use also for palette WB +const double ColorTemp::ColorchechBluC150_m5_m22_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1053,0.134,0.1633,0.2075,0.2518,0.283,0.3163,0.324,0.3325,0.334,0.3355,0.3352,0.3349,0.332,0.3294,0.325,0.3199,0.3127,0.3055,0.2955,0.2863,0.28,0.2737,0.267,0.2612,0.249,0.2378,0.228,0.2199, + 0.218,0.2173,0.2146,0.2118,0.20,0.1884,0.178,0.1682,0.166,0.1639,0.162,0.1613,0.158,0.1550,0.1504,0.1458,0.1415,0.1375,0.135,0.1327,0.1316,0.1305,0.1304,0.1302,0.131,0.1322,0.1342,0.1362, + 0.1367,0.1372,0.1356,0.1340,0.1311,0.1288,0.1253,0.1227,0.1205,0.1187,0.1195,0.1205,0.1255,0.1303,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorcheckerDC : blue sky N8 +//use also for palette WB +const double ColorTemp::ColorchechDCBluN881_m7_m14_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1371,0.17,0.2029,0.291,0.3790,0.495,0.6100,0.67,0.7249,0.737,0.7501,0.7545,0.7597,0.764,0.7677,0.7685,0.7693,0.7677,0.7662,0.763,0.7593,0.753,0.7471,0.737,0.7289,0.718,0.7077,0.705,0.6819,0.666,0.6515,0.636,0.6244, + 0.61,0.5948,0.577,0.5581,0.544,0.5293,0.522,0.5147,0.512,0.5091,0.506,0.5029,0.499,0.4950,0.494,0.4931,0.497,0.5007,0.508,0.5176,0.527,0.5359,0.542,0.5487,0.549,0.5494,0.544, + 0.5375,0.531,0.5244,0.522,0.5207,0.524,0.5264,0.532,0.5369,0.542,0.5505,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorcheckerSG : Skin F7 +//use also for palette WB +const double ColorTemp::ColorchechSGSkiF763_14_26_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0,0.0508,0.64,0.0776,0.903,0.1099,0.1128,0.1256,0.128,0.1307,0.133,0.1357,0.139,0.1425,0.148,0.1523,0.159,0.1669,0.177,0.1871,0.20,0.2118,0.2235,0.2355,0.2445,0.2537,0.259,0.2655,0.268, + 0.2700,0.2708,0.2716,0.2743,0.2770,0.2803,0.2827,0.283,0.2832,0.283,0.2828,0.295,0.3079,0.344,0.3803,0.4105,0.4409,0.455,0.4694,0.477,0.4851,0.4896,0.4962,0.501,0.5066,0.511,0.5160,0.521, + 0.5256,0.529,0.5318,0.535,0.5383,0.541,0.5451,0.549,0.5524,0.556,0.5597,0.562,0.5650,0.568,0.5709,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorcheckerSG : Skin K2 85 11 17 +//use also for palette WB +const double ColorTemp::ColorchechSGSkiK285_11_17_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1122,0.149,0.1866,0.259,0.3318,0.393,0.4547,0.469,0.4846,0.4845,0.4844,0.4838,0.4834,0.4837,0.4840,0.4847,0.4854,0.4852,0.4849,0.4842,0.4835,0.4832,0.4828,0.485, + 0.4874,0.501,0.5150,0.536,0.5572,0.5685,0.5798,0.586,0.5932,0.5987,0.6142,0.6342,0.6541,0.683,0.7119,0.734,0.7571,0.769,0.7829,0.788,0.7932,0.795,0.7968,0.7973, + 0.7977,0.7974,0.7969,0.797,0.7972,0.7973,0.7975,0.7983,0.7990,0.7978,0.7965,0.7957,0.7949,0.7944,0.7940,0.794,0.7941,0.7943,0.7946,0.7938,0.7930,0.7929,0.7928, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data Colorcheck24 : White A4 L=96 +//use also for palette WB +const double ColorTemp::ColorchechWhiA496_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1267,0.172,0.2179,0.317,0.4164,0.505,0.6780,0.758,0.8397,0.865,0.8911,0.897,0.9035,0.9062,0.9092,0.9124,0.9154,0.9167,0.9180,0.9187,0.9194,0.92,0.9225,0.9217,0.9209,0.921, + 0.9212,0.9227,0.9242,0.9235,0.9227,0.9232,0.9238,0.9243,0.9248,0.9237,0.9227,0.9239,0.9252,0.924,0.9233,0.9238,0.9242,0.924,0.9239,0.9239,0.9239,0.924,0.9242,0.9239, + 0.9237,0.925,0.9264,0.9276,0.9288,0.9298,0.9308,0.9296,0.9284,0.928,0.9276,0.928,0.9284,0.9294,0.9304,0.9316,0.9328,0.9328,0.9328,0.9337,0.9345, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data Colorcheck24 : foliage Green D1 +const double ColorTemp::ColorchechGreD1_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0477,0.0492,0.0507,0.0517,0.0527,0.0532,0.0537,0.054,0.0544,0.0554,0.0563,0.0573,0.0584,0.0592,0.0601,0.0607,0.0611,0.0613,0.0619,0.626,0.0634,0.0646,0.0659,0.069, + 0.0721,0.0837,0.0958,0.117,0.1386,0.156,0.1748,0.1802,0.1855,0.1795,0.1742,0.1636,0.1529,0.144,0.1351,0.13,0.1239,0.1202,0.1171,0.1138,0.1106,0.108,0.1048,0.1035, + 0.1022,0.1025,0.1030,0.1041,0.1052,0.106,0.1068,0.107,0.1073,0.1066,0.1060,0.1047,0.1035,0.1028,0.1021,0.1029,0.1034,0.105,0.1069,0.1086,0.1104,0.1127,0.1150, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorchecSG : black N3 L=6 +//use also for palette WB +const double ColorTemp::ColorchechSGBlaN3_6_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0066,0.0069,0.0071,0.0072,0.0074,0.0073,0.0072,0.0073,0.0074,0.0074,0.0074,0.0074,0.0074,0.0073,0.0073,0.0073,0.0073,0.0072,0.0072,0.0072,0.0072,0.0071,0.0071,0.0071, + 0.0071,0.0071,0.0071,0.0071,0.0071,0.0071,0.0071,0.0071,0.0071,0.0071,0.0071,0.0071,0.0070,0.0070,0.0071,0.0071,0.0071,0.0071,0.0071,0.0071,0.0071,0.0070, + 0.0070,0.0070,0.0070,0.0069,0.0069,0.0069,0.0068,0.0068,0.0068,0.0068,0.0068,0.0068,0.0067,0.0067,0.0067,0.0067,0.0066,0.0066,0.0066,0.0066,0.0066,0.0066,0.0066,0.0067, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data 468 color : gray K14 L=44 +//use also for palette WB +const double ColorTemp::JDC468_GraK14_44_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.04240,0.0485,0.05500,0.0624,0.06930,0.084,0.09820,0.109,0.12160,0.127,0.13300,0.13490,0.13690,0.1379,0.13890,0.1396,0.14060,0.1407,0.14080,0.1423,0.14380,0.1488,0.15370,0.157,0.16040, + 0.157,0.15360,0.1482,0.14290,0.1436,0.14470,0.1454,0.14620,0.137,0.12870,0.1205,0.11250,0.116,0.11930,0.1261,0.13350,0.1367,0.13990,0.139,0.13810,0.1371,0.13610,0.1372,0.13820, + 0.1408,0.14330,0.1475,0.15170,0.1583,0.16500,0.172,0.17940,0.1836,0.18780,0.188,0.18820,0.186,0.18430,0.1801,0.17620,0.1741,0.17210,0.179,0.18420,0.1991,0.21430, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data 468 color : Blue H10 - Gamut > WidegamutRGB +const double ColorTemp::JDC468_BluH10_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.01590,0.028,0.03970,0.0697,0.09970,0.1526,0.20550,0.253,0.30110,0.3412,0.38180,0.423,0.46610,0.4683,0.51030,0.4999,0.49950,0.4785,0.45810,0.429,0.39950,0.374,0.35010,0.3135,0.29630, + 0.2587,0.22070,0.182,0.14450,0.1125,0.09060,0.072,0.04810,0.033,0.01740,0.0113,0.00520,0.004,0.00290,0.0028,0.00270,0.0027,0.00270,0.0027,0.00280,0.0027,0.00270,0.0028,0.00280, + 0.0029,0.00300,0.0029,0.00290,0.0029,0.0029,0.00290,0.0029,0.00290,0.0029,0.00290,0.0029,0.00290,0.0029,0.00290,0.0029,0.0031,0.00320,0.0035,0.00380,0.047,0.00560, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 35 15 17 +const double ColorTemp::ColabSkin35_15_17_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0211,0.022, 0.0225,0.0234, 0.0244,0.0294, 0.0349,0.038, 0.0411,0.0425, 0.0441,0.0455, 0.0472,0.0473, 0.0475,0.0463, 0.0452,0.0435, 0.0417,0.0397, 0.0377, + 0.0375, 0.0372,0.0412, 0.0452,0.052, 0.0603,0.0655, 0.0707,0.0722, 0.0736,0.0738, 0.0741,0.0737, 0.0731,0.0721, 0.0711,0.0707, 0.0704,0.071, 0.0717, + 0.0782, 0.0846,0.099, 0.1159,0.1298, 0.1432,0.1497, 0.1581,0.1603, 0.1644,0.1659, 0.1673,0.1679, 0.1690,0.1696, 0.1702,0.1704, 0.1705,0.1706, 0.1707,0.1707, 0.1707,0.1707, 0.1706,0.1706, 0.1707,0.1707, 0.1706,0.1712, 0.1719, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 57 22 18 +const double ColorTemp::ColabSkin57_22_18_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0647,0.0677, 0.0709,0.0754, 0.0797,0.099, 0.1181,0.1296, 0.1409,0.1469, 0.1529,0.1594, 0.1657,0.1672, 0.1683,0.1648, 0.1615,0.1561, 0.1506,0.144, 0.1375,0.136, 0.1339, + 0.1437, 0.1531,0.172, 0.1911,0.2032, 0.2153,0.2171, 0.2190,0.2176, 0.2164,0.213, 0.2095,0.2048, 0.2005,0.1985, 0.1965,0.198, 0.1997,0.2196, 0.2396,0.288, 0.3362,0.378, + 0.4209,0.444, 0.4671,0.477, 0.4865,0.491, 0.4955,0.498, 0.5007,0.5027, 0.5048,0.5055, 0.5061,0.5063, 0.5066,0.5065, 0.5063,0.506, 0.5057,0.5056, 0.5055,0.5056, 0.5057,0.5078, 0.5099, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 40 17 17 +const double ColorTemp::ColabSkin40_17_17_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0296,0.0306, 0.0317,0.0332, 0.0346,0.042, 0.0498,0.0543, 0.0588,0.061, 0.0632,0.0624, 0.0678,0.068, 0.0682,0.0663, 0.0649,0.0625, 0.0598,0.057, 0.0540,0.0535, 0.0529,0.057, + 0.0631,0.072, 0.0827,0.089, 0.0959,0.0975, 0.0994,0.0996, 0.0997,0.0988, 0.0980,0.0966, 0.0951,0.0945, 0.0939,0.0948, 0.0957,0.105, 0.1143,0.136, 0.1589,0.178, 0.1980, + 0.2095, 0.2194,0.224, 0.2283,0.2302, 0.2325,0.2337, 0.2348,0.2357, 0.2366,0.2369, 0.2371,0.2372, 0.2373,0.2373, 0.2373,0.2373, 0.2372,0.2372, 0.2372,0.2372, 0.2372,0.238, 0.2389, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 91 4 14 +const double ColorTemp::ColabSkin91_4_14_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1430,0.16, 0.1778,0.202, 0.2303,0.301, 0.3813,0.4245, 0.4692,0.499, 0.5287,0.5635, 0.5977,0.6175, 0.6372,0.6394, 0.6418,0.638, 0.6341,0.6228, 0.6117,0.6121, 0.6125, + 0.646, 0.6807,0.742, 0.8032,0.8355, 0.8687,0.8595, 0.8510,0.828, 0.8059,0.778, 0.7490,0.721, 0.6914,0.676, 0.6608,0.657, 0.6530,0.6565, 0.7001,0.7609, 0.8219, + 0.876, 0.9297,0.9598, 0.9901,1.003, 1.0156,1.021, 1.0289,1.0346, 1.0396,1.045, 1.0513,1.0538, 1.0561,1.0559, 1.0557,1.054, 1.0523,1.049, 1.0466,1.045, 1.0436,1.0445, 1.0455,1.053, 1.0605, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 87 8 8 +const double ColorTemp::ColabSkin87_8_8_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1433,0.161, 0.1780,0.204, 0.2305,0.306, 0.3828,0.428, 0.4722,0.502, 0.5317,0.5645, 0.5997,0.618, 0.6366,0.6368, 0.6370,0.631, 0.6251,0.6120, 0.5994,0.596, + 0.5931,0.618, 0.6420,0.705, 0.7347,0.757, 0.7785,0.765, 0.7532,0.71, 0.7062,0.677, 0.6491,0.62, 0.5922,0.577, 0.5619,0.5586, 0.5556,0.579, 0.6121, + 0.684, 0.7563,0.82, 0.8837,0.918, 0.9545,0.969, 0.9843,0.992, 0.9991,1.005, 1.0104,1.016, 1.0223,1.0248, 1.0273,1.0272, 1.0271,1.025, 1.0238,1.02, 1.0182,1.017, 1.0151,1.016, 1.0171,1.024, 1.0321, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 89 8 21 +const double ColorTemp::ColabSkin89_8_21_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1394,0.152, 0.1659,0.1855, 0.2052,0.266, 0.3277,0.363, 0.3988,0.422, 0.4450,0.472, 0.4984,0.512, 0.5270,0.5274, 0.5278,0.522, 0.5177,0.5065, 0.4960,0.4975, + 0.4995,0.535, 0.5721,0.637, 0.7016,0.7395, 0.7786,0.7777, 0.7767,0.763, 0.7485,0.728, 0.7081,0.687, 0.6649,0.653, 0.6425,0.641, 0.6391,0.665, 0.6925,0.76, + 0.8266,0.885, 0.9447,0.975, 1.0106,1.025, 1.0383,1.045, 1.0525,1.058, 1.0628,1.068, 1.0730,1.075, 1.0768,1.0768, 1.0769,1.0755, 1.0744,1.0724, 1.0704,1.069, 1.0685,1.0691, 1.0697,1.075, 1.0823, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 75 8 4 +const double ColorTemp::ColabSkin75_8_4_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1030,0.116, 0.1294,0.1495, 0.1696,0.227, 0.2847,0.319, 0.3524,0.375, 0.3977,0.423, 0.4492,0.462, 0.4770,0.4768, 0.4767,0.471, 0.4675,0.458, 0.4480,0.444, 0.4408, + 0.455, 0.4688,0.496, 0.5243,0.535, 0.5465,0.534, 0.5228,0.503, 0.4851,0.463, 0.4408,0.419, 0.3974,0.385, 0.3741,0.371, 0.3692,0.391, 0.4110,0.464, 0.5180, + 0.565, 0.6126,0.638, 0.6651,0.676, 0.6871,0.692, 0.6979,0.702, 0.7062,0.71, 0.7151,0.717, 0.7189,0.7188, 0.7187,0.717, 0.7162,0.714, 0.7119,0.7105, 0.7095,0.7097, 0.7110,0.716, 0.7223, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 75 10 33 +const double ColorTemp::ColabSkin75_10_33_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0873,0.091, 0.0967,0.103, 0.1097,0.135, 0.1617,0.177, 0.1913,0.198, 0.2086,0.218, 0.2289,0.234, 0.2383,0.2375, 0.2370,0.2335, 0.2299,0.223, 0.2180,0.222, + 0.2259,0.256, 0.2860,0.338, 0.3905,0.426, 0.4613,0.47, 0.4786,0.478, 0.4772,0.471, 0.4668,0.459, 0.4522,0.449, 0.4454,0.446, 0.4467,0.464, 0.4834,0.527, + 0.5727,0.609, 0.6511,0.673, 0.6946,0.703, 0.7130,0.718, 0.7224,0.725, 0.7285,0.731, 0.7337,0.7345, 0.7351,0.7353, 0.7355,0.735, 0.7348,0.7342, 0.7337,0.7336, 0.7335,0.7335, 0.7336,0.737, 0.7395, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 65 33 11 +const double ColorTemp::ColabSkin65_33_11_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1067,0.113, 0.1182,0.126, 0.1346,0.165, 0.2033,0.224, 0.2448,0.259, 0.2666,0.277, 0.2891,0.291, 0.2927,0.285, 0.2783,0.268, 0.2569,0.244, 0.2323,0.225, 0.2195, + 0.225, 0.2323,0.248, 0.2655,0.275, 0.2832,0.281, 0.2797,0.275, 0.2708,0.264, 0.2567,0.248, 0.2403,0.236, 0.2326,0.235, 0.2386,0.274, 0.3116,0.40, 0.4885,0.56, + 0.6435,0.688, 0.7279,0.745, 0.7633,0.772, 0.7791,0.783, 0.7883,0.792, 0.7955,0.7965, 0.7978,0.7982, 0.7989,0.7985, 0.7983,0.7975, 0.7971,0.7968, 0.7966,0.7968, 0.7970,0.801, 0.8043, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 65 7 24 +const double ColorTemp::ColabSkin65_7_24_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0619,0.066, 0.0710,0.077, 0.0840,0.106, 0.1288,0.142, 0.1546,0.163, 0.1706,0.179, 0.1893,0.194, 0.1989,0.1988, 0.1987,0.196, 0.1941,0.189, 0.1853,0.188, 0.1894, + 0.209, 0.2282,0.262, 0.2962,0.318, 0.3402,0.343, 0.3469,0.343, 0.3407,0.334, 0.3285,0.321, 0.3140,0.31, 0.3069,0.308, 0.3066,0.319, 0.3311,0.362, 0.3918,0.418, + 0.4451,0.459, 0.4747,0.481, 0.4873,0.491, 0.4937,0.496, 0.4981,0.501, 0.5022,0.503, 0.5035,0.5035, 0.5036,0.5032, 0.5029,0.5022, 0.5016,0.5013, 0.5011,0.5013, 0.5014,0.504, 0.5063, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 57 19 6 +const double ColorTemp::ColabSkin57_19_6_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0662,0.071, 0.0773,0.085, 0.0939,0.115, 0.1491,0.165, 0.1821,0.192, 0.2019,0.214, 0.2236,0.228, 0.2321,0.2298, 0.2266,0.221, 0.2161,0.208, 0.2019,0.199, + 0.1951,0.201, 0.2066,0.219, 0.2325,0.239, 0.2443,0.241, 0.2366,0.23, 0.2235,0.215, 0.2068,0.199, 0.1895,0.185, 0.1806,0.1811, 0.1816,0.20, 0.2197,0.267, 0.3135, + 0.355, 0.3960,0.418, 0.4411,0.449, 0.4600,0.4643, 0.4687,0.471, 0.4743,0.477, 0.4792,0.48, 0.4811,0.4813, 0.4815,0.481, 0.4806,0.4798, 0.4790,0.4786, 0.4782,0.4786, 0.4788,0.481, 0.4844, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 57 4 19 +const double ColorTemp::ColabSkin57_4_19_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0430,0.047, 0.0505,0.056, 0.0614,0.077, 0.0963,0.1063, 0.1164,0.123, 0.1294,0.137, 0.1448,0.149, 0.1533,0.154, 0.1544,0.153, 0.1521,0.149, 0.1463,0.148, + 0.1496,0.164, 0.1780,0.202, 0.2273,0.242, 0.2585,0.26, 0.2616,0.258, 0.2550,0.2495, 0.2442,0.238, 0.2320,0.229, 0.2258,0.2253, 0.2247,0.232, 0.2394, + 0.258, 0.2763,0.292, 0.3087,0.318, 0.3269,0.331, 0.3346,0.337, 0.3387,0.341, 0.3417,0.343, 0.3447,0.345, 0.3457,0.3457, 0.3457,0.3455, 0.3451,0.3445, 0.3439,0.3437, 0.3435,0.3437, 0.3438,0.346, 0.3475, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 57 10 28 +const double ColorTemp::ColabSkin57_10_28_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0463,0.048, 0.0505,0.053, 0.0563,0.069, 0.0816,0.088, 0.0961,0.102, 0.1041,0.1085, 0.1135,0.1155, 0.1174,0.1168, 0.1161,0.114, 0.1118,0.1085, 0.1054,0.1074, 0.1094,0.124, + 0.1406,0.168, 0.1951,0.223, 0.2325,0.238, 0.2426,0.243, 0.2432,0.242, 0.2391,0.239, 0.2326,0.231, 0.2297,0.234, 0.2309,0.242, 0.2516,0.277, 0.3017,0.324, + 0.3456,0.358, 0.3700,0.375, 0.3802,0.3827, 0.3854,0.387, 0.3887,0.39, 0.3913,0.3916, 0.3920,0.3921, 0.3923,0.3921, 0.3920,0.3918, 0.3916,0.3916, 0.3915,0.3915, 0.3915,0.393, 0.3945, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 40 7 19 +const double ColorTemp::ColabSkin40_7_19_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0215,0.023, 0.0240,0.026, 0.0275,0.033, 0.0409,0.044, 0.0487,0.051, 0.0532,0.056, 0.0585,0.0595, 0.0608,0.0605, 0.0602,0.059, 0.0581,0.057, 0.0549,0.0555, 0.0562, + 0.061, 0.0692,0.08, 0.0922,0.099, 0.1075,0.109, 0.1107,0.11, 0.1098,0.1082, 0.1069,0.1045, 0.1031,0.102, 0.1013,0.1015, 0.1016,0.106, 0.1112,0.123, 0.1348,0.145, + 0.1554,0.161, 0.1668,0.169, 0.1716,0.1728, 0.1741,0.175, 0.1756,0.1763, 0.1769,0.1771, 0.1773,0.1773, 0.1774,0.1773, 0.1772,0.177, 0.1769,0.1769, 0.1769,0.1769, 0.1769,0.1777, 0.1784, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 40 17 6 +const double ColorTemp::ColabSkin40_17_6_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0314,0.033, 0.0359,0.039, 0.0427,0.054, 0.0668,0.074, 0.0812,0.085, 0.0895,0.094, 0.0985,0.10, 0.1015,0.0991, 0.0984,0.096, 0.0930,0.089, 0.0861,0.085, 0.0828, + 0.085, 0.0878,0.094, 0.0995,0.103, 0.1052,0.1035, 0.1026,0.10, 0.0976,0.094, 0.0911,0.088, 0.0840,0.083, 0.0805,0.081, 0.0814,0.09, 0.1006,0.124, + 0.1474,0.1685, 0.1885,0.1995, 0.2110,0.216, 0.2204,0.223, 0.2247,0.226, 0.2273,0.2284, 0.2296,0.230, 0.2304,0.2305, 0.2306,0.2305, 0.2303,0.23, 0.2297,0.2296, 0.2294,0.2295, 0.2296,0.231, 0.2321, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 40 4 11 +const double ColorTemp::ColabSkin40_4_11_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0209,0.023, 0.0250,0.028, 0.0310,0.039, 0.0497,0.056, 0.0605,0.064, 0.0675,0.072, 0.0758,0.078, 0.0802,0.0803, 0.0804,0.0797, 0.0790,0.078, 0.0758,0.076, 0.0764,0.082, + 0.0875,0.098, 0.1072,0.113, 0.1189,0.1187, 0.1185,0.116, 0.1141,0.111, 0.1078,0.104, 0.1012,0.099, 0.0977,0.098, 0.0971,0.101, 0.1049,0.115, 0.1245,0.133, + 0.1417,0.147, 0.1513,0.153, 0.1554,0.1564, 0.1575,0.158, 0.1590,0.1598, 0.1606,0.1608, 0.1611,0.1611, 0.1611,0.1609, 0.1608,0.1604, 0.1601,0.160, 0.1598,0.1599, 0.1600,0.1609, 0.1619, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 33 6 15 +const double ColorTemp::ColabSkin33_6_15_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0143,0.015, 0.0162,0.0175, 0.0189,0.023, 0.0286,0.031, 0.0342,0.036, 0.0376,0.039, 0.0415,0.0425, 0.0434,0.0432, 0.0431,0.0425, 0.0418,0.041, 0.0396,0.04, + 0.0404,0.0444, 0.0488,0.056, 0.0638,0.0689, 0.0735,0.074, 0.0752,0.0745, 0.0741,0.073, 0.0717,0.070, 0.0688,0.0681, 0.0673,0.0673, 0.0674,0.0710, 0.0737,0.0810, + 0.0889,0.0960, 0.1023,0.1065, 0.1098,0.1120, 0.1129,0.1135, 0.1145,0.1150, 0.1155,0.1160, 0.1164,0.1165, 0.1167,0.1167, 0.1168,0.1167, 0.1166,0.1165, 0.1164,0.1164, 0.1163,0.1163, 0.1164,0.1170, 0.1174, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 33 15 5 +const double ColorTemp::ColabSkin33_15_5_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0212,0.023, 0.0243,0.0265, 0.0289,0.037, 0.0451,0.051, 0.0549,0.058, 0.0605,0.063, 0.0666,0.0675, 0.0686,0.0672, 0.0664,0.065, 0.0627,0.0061, 0.0580,0.0565, 0.0557, + 0.057, 0.0590,0.063, 0.0666,0.069, 0.0703,0.0694, 0.0684,0.0666, 0.0651,0.063, 0.0607,0.0585, 0.0559,0.0545, 0.0535,0.0540, 0.0542,0.0610, 0.0672,0.0832, + 0.0992,0.1132, 0.1272,0.1345, 0.1425,0.1455, 0.1489,0.1505, 0.1518,0.1527, 0.1536,0.1545, 0.1552,0.1555, 0.1557,0.1558, 0.1559,0.1558, 0.1557,0.1155, 0.1552,0.1551, 0.1550,0.1551, 0.1552,0.1560, 0.1569, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; +//spectral data ColorLab : Skin 33 10 15 +const double ColorTemp::ColabSkin33_10_15_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0166,0.0175, 0.0183,0.0194, 0.0207,0.0260, 0.0306,0.033, 0.0364,0.0380, 0.0396,0.0415, 0.0431,0.0437, 0.0443,0.0438, 0.0432,0.0420, 0.0409,0.0395, 0.0380,0.0380, + 0.0381,0.0415, 0.0456,0.0525, 0.0595,0.0645, 0.0686,0.0695, 0.0705,0.0702, 0.0700,0.0690, 0.0681,0.0667, 0.0655,0.065, 0.0644,0.0648, 0.0650,0.0695, 0.0739,0.0852, + 0.0955,0.1040, 0.1145,0.1196, 0.1249,0.1271, 0.1293,0.1305, 0.1314,0.1322, 0.1327,0.1332, 0.1337,0.1338, 0.1340,0.1340, 0.1341,0.1340, 0.1340,0.1339, 0.1338,0.1338, 0.1338,0.1338, 0.1338,0.1345, 0.1349, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 24 5 6 +const double ColorTemp::ColabSkin24_5_6_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0086,0.0095, 0.0102,0.0112, 0.0127,0.0167, 0.0203,0.0225, 0.0248,0.0265, 0.0277,0.0295, 0.0309,0.0315, 0.0325,0.0324, 0.0323,0.0319, 0.0315,0.0307, 0.0299,0.0298, + 0.0297,0.0315, 0.0330,0.0365, 0.0392,0.0412, 0.0427,0.0424, 0.0421,0.0410, 0.0402,0.0390, 0.0377,0.0365, 0.0351,0.0345, 0.0337,0.0337, 0.0336,0.0356, 0.0374,0.0415, + 0.0470,0.0512, 0.0554,0.0575, 0.0601,0.0610, 0.0620,0.0625, 0.0630,0.0634, 0.0637,0.0640, 0.0643,0.0645, 0.0646,0.0646, 0.0646,0.0645, 0.0644,0.0643, 0.0642,0.0642, 0.0641,0.0641, 0.0641,0.0645, 0.0649, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 26 18 18 +const double ColorTemp::ColabSkin26_18_18_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0135,0.0137, 0.0138,0.0139, 0.0140,0.0163, 0.0187,0.0202, 0.0215,0.0220, 0.0224,0.0228, 0.0231,0.0227, 0.0222,0.0212, 0.0202,0.0189, 0.0174,0.0161, 0.0146,0.0143, + 0.0140,0.0163, 0.0184,0.0224, 0.0268,0.0291, 0.0331,0.0348, 0.0358,0.0366, 0.0374,0.0378, 0.0380,0.0380, 0.0379,0.0380, 0.0381,0.0388, 0.0394,0.0440, 0.0490, + 0.0605, 0.0720,0.0821, 0.0921,0.0976, 0.1030,0.1056, 0.1076,0.1087, 0.1097,0.1103, 0.1108,0.1111, 0.1115,0.1115, 0.1116,0.1117, 0.1118,0.1118, 0.1119,0.1119, 0.1120,0.1120, 0.1121,0.1121, 0.1120,0.1123, 0.1126, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 24 7 5 +const double ColorTemp::ColabSkin24_7_5_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0093,0.0105, 0.0111,0.0125, 0.0137,0.0180, 0.0221,0.0245, 0.0270,0.0285, 0.0301,0.0316, 0.0336,0.0345, 0.0353,0.0350, 0.0349,0.0343, 0.0338,0.0329, 0.0320,0.0317, 0.0315, + 0.0328, 0.0342,0.0368, 0.0397,0.0412, 0.0424,0.0420, 0.0415,0.0404, 0.0393,0.0379, 0.0366,0.0352, 0.0337,0.0330, 0.0323,0.0322, 0.0322,0.0344, 0.0367,0.0422, 0.0479,0.0529, + 0.0578,0.0606, 0.0633,0.0644, 0.0656,0.0662, 0.0667,0.0670, 0.0674,0.0678, 0.0681,0.0683, 0.0684,0.0684, 0.0684,0.0683, 0.0683,0.0682, 0.0680,0.0679, 0.0678,0.0678, 0.0679,0.0683, 0.0688, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 24 4 2 +const double ColorTemp::ColabSkin20_4_2_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0064,0.0074, 0.0080,0.00903, 0.0104,0.0139, 0.0174,0.0189, 0.0216,0.0222, 0.0243,0.0258, 0.0274,0.0282, 0.0291,0.0290, 0.0290,0.0288, 0.0284,0.0278, 0.0272,0.0270, 0.0267,0.0276, + 0.0285,0.0302, 0.0320,0.0327, 0.0335,0.0328, 0.0321,0.0311, 0.0299,0.0280, 0.0272,0.0259, 0.0246,0.0239, 0.0232,0.0230, 0.0229,0.0243, 0.0256,0.0291, 0.0324,0.0354, + 0.0385,0.0401, 0.0418,0.0425, 0.0432,0.0435, 0.0439,0.0442, 0.0444,0.0447, 0.0450,0.0451, 0.0452,0.0452, 0.0452,0.0451, 0.0450,0.0449, 0.0448,0.0447, 0.0446,0.0447, 0.0447,0.0450, 0.0454, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 98 -2 10 +const double ColorTemp::ColabSkin98_m2_10_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1627,0.1870, 0.2115,0.2480, 0.2860,0.3870, 0.4878,0.5460, 0.6050,0.6460, 0.6874,0.7355, 0.7836,0.8130, 0.8424,0.8494, 0.8543,0.8520, 0.8508,0.8390, 0.8267,0.8274, 0.8280, + 0.8680, 0.9076,0.9600, 1.0497,1.089, 1.1190,1.10, 1.0836,1.045, 1.0140,0.975, 0.9305,0.884, 0.8486,0.826, 0.8042,0.7980, 0.7895,0.8093, 0.8292,0.884, 0.9376,0.987, + 1.0341,1.059, 1.0892,1.104, 1.1125,1.1253, 1.1255,1.131, 1.1375,1.145, 1.1520,1.155, 1.1585,1.158, 1.1574,1.1548, 1.1523,1.148, 1.1439,1.141, 1.1394,1.141, 1.1423,1.151, 1.1619, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 90 -1 20 +const double ColorTemp::ColabSkin90_m1_20_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1228,0.138, 0.1532,0.175, 0.1987,0.261, 0.3279,0.365, 0.4022,0.428, 0.4537,0.4842, 0.5147,0.5337, 0.5521,0.557, 0.5611,0.5602, 0.5593,0.551, 0.5438,0.548, + 0.5527,0.593, 0.6334,0.703, 0.7732,0.8135, 0.8543,0.851, 0.8474,0.829, 0.8105,0.786, 0.7613,0.736, 0.7105,0.697, 0.6835,0.679, 0.6750,0.6895, 0.7045,0.743, + 0.7832,0.818, 0.8530,0.873, 0.8929,0.899, 0.9099,0.914, 0.9197,0.924, 0.9282,0.933, 0.9380,0.9395, 0.9419,0.9416, 0.9413,0.9398, 0.9382,0.9357, 0.9332,0.9322, 0.9306,0.9315, 0.9322,0.939, 0.9452, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 95 0 4 +const double ColorTemp::ColabSkin95_0_4_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1614,0.1865, 0.2118,0.2495, 0.2889,0.392, 0.4969,0.557, 0.6185,0.6605, 0.7035,0.749, 0.8018,0.832, 0.8605,0.865, 0.8696,0.866, 0.8633,0.849, 0.8365,0.834, + 0.8308,0.861, 0.8911,0.946, 1.0030,1.025, 1.0490,1.025, 1.0030,0.964, 0.9278,0.884, 0.8407,0.7985, 0.7565,0.734, 0.7107,0.6985, 0.6962,0.718, 0.7416,0.803, + 0.8642,0.919, 0.9733,1.001, 1.0349,1.051, 1.0609,1.068, 1.0747,1.081, 1.0872,1.095, 1.1021,1.105, 1.1089,1.1085, 1.1079,1.1055, 1.1027,1.098, 1.0940,1.091, 1.0892,1.0905, 1.0923,1.102, 1.1123, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 81 2 14 +const double ColorTemp::ColabSkin81_2_14_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1029,0.116, 0.1285,0.148, 0.1672,0.222, 0.2774,0.311, 0.3412,0.362, 0.3849,0.410, 0.4359,0.451, 0.4659,0.468, 0.4706,0.4685, 0.4664,0.4685, 0.4512,0.4525, 0.4536, + 0.461, 0.5076,0.551, 0.6035,0.6295, 0.6559,0.6495, 0.6442,0.627, 0.6112,0.5905, 0.5691,0.537, 0.5266,0.515, 0.5039,0.501, 0.4975,0.5125, 0.5283,0.568, 0.6087,0.643, + 0.6799,0.700, 0.7200,0.729, 0.7370,0.7415, 0.7461,0.750, 0.7536,0.759, 0.7620,0.764, 0.7655,0.7653, 0.7651,0.764, 0.7626,0.761, 0.7583,0.7572, 0.7561,0.7567, 0.7575,0.758, 0.7685, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 87 3 10 +const double ColorTemp::ColabSkin87_3_10_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1295,0.146, 0.1639,0.190, 0.2160,0.291, 0.3626,0.405, 0.4480,0.476, 0.5066,0.541, 0.5743,0.593, 0.6136,0.616, 0.6186,0.614, 0.6119,0.601, 0.5911,0.5905, + 0.5897,0.623, 0.6460,0.697, 0.7483,0.773, 0.7992,0.788, 0.7759,0.752, 0.7287,0.699, 0.6712,0.642, 0.6141,0.598, 0.5835,0.579, 0.5750,0.596, 0.6162,0.669, + 0.7239,0.772, 0.8193,0.845, 0.8728,0.888, 0.8954,0.901, 0.9073,0.912, 0.9171,0.922, 0.9281,0.931, 0.9328,0.9325, 0.9323,0.931, 0.9289,0.926, 0.9232,0.9215, 0.9201,0.921, 0.9220,0.929, 0.9364, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 77 12 21 +const double ColorTemp::ColabSkin77_12_21_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.1039,0.111, 0.1205,0.132, 0.1448,0.185, 0.2261,0.249, 0.2734,0.287, 0.3028,0.318, 0.3364,0.345, 0.3525,0.351, 0.3499,0.345, 0.3397,0.3295, 0.3224,0.329, 0.3234, + 0.349, 0.3729,0.418, 0.4625,0.490, 0.5173,0.5185, 0.5196,0.511, 0.5045,0.492, 0.4807,0.467, 0.4543,0.447, 0.4410,0.4409, 0.4407,0.464, 0.4872,0.544, 0.6020,0.6522, + 0.7029,0.731, 0.7588,0.771, 0.7823,0.787, 0.7939,0.798, 0.8017,0.805, 0.8090,0.8103, 0.8115,0.8117, 0.8118,0.8111, 0.8104,0.8193, 0.8081,0.8076, 0.8070,0.8073, 0.8077,0.812, 0.8162, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Skin 70 7 32 +const double ColorTemp::ColabSkin70_7_32_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0695,0.074, 0.0777,0.084, 0.0890,0.104, 0.1321,0.144, 0.1565,0.164, 0.1713,0.1795, 0.1889,0.194, 0.1978,0.198, 0.1983,0.196, 0.1939,0.189, 0.1853,0.189, + 0.1933,0.219, 0.2458,0.291, 0.3362,0.367, 0.3974,0.405, 0.4120,0.411, 0.4101,0.406, 0.4007,0.394, 0.3877,0.385, 0.3816,0.3817, 0.3819,0.395, 0.4081,0.440, + 0.4721,0.498, 0.5284,0.544, 0.5598,0.566, 0.5730,0.577, 0.5801,0.5825, 0.5848,0.587, 0.5890,0.5895, 0.5901,0.5903, 0.5903,0.59, 0.5897,0.5892, 0.5887,0.5885, 0.5884,0.5885, 0.5886,0.5896, 0.5934, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Sky 60 0 -31 +const double ColorTemp::ColabSky60_0_m31_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0752,0.094, 0.1121,0.141, 0.1699,0.243, 0.3150,0.357, 0.4015,0.432, 0.4631,0.497, 0.5325,0.553, 0.5730,0.574, 0.5758,0.572, 0.5695,0.559, 0.5503,0.539, + 0.5284,0.5175, 0.5066,0.493, 0.4800,0.459, 0.4336,0.401, 0.3684,0.333, 0.3003,0.265, 0.2313,0.199, 0.1695,0.167, 0.1349,0.129, 0.1234,0.136, 0.1489,0.184, + 0.2212,0.253, 0.2858,0.303, 0.3218,0.329, 0.3370,0.341, 0.3440,0.348, 0.3512,0.355, 0.3606,0.363, 0.3658,0.3653, 0.3649,0.3625, 0.3611,0.358, 0.3544,0.352, 0.3502,0.3512, 0.3529,0.359, 0.3660, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +//spectral data ColorLab : Sky 42 0 -24 +const double ColorTemp::ColabSky42_0_m24_spect[97] = { + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0336,0.041, 0.0501,0.063, 0.0761,0.103, 0.1412,0.151, 0.1799,0.193, 0.2076,0.223, 0.2387,0.248, 0.2569,0.2575, 0.2581,0.256, 0.2553,0.250, 0.2466,0.2411, + 0.2368,0.2318, 0.2268,0.2205, 0.2145,0.204, 0.1935,0.179, 0.1641,0.149, 0.1335,0.118, 0.1025,0.087, 0.0748,0.067, 0.0593,0.056, 0.0541,0.059, 0.0655,0.081, + 0.0979,0.112, 0.1269,0.134, 0.1430,0.147, 0.1497,0.151, 0.1529,0.1545, 0.1561,0.158, 0.1603,0.1616, 0.1627,0.1625, 0.1623,0.1614, 0.1605,0.159, 0.1575,0.1567, 0.1557,0.1563, 0.1569,0.159, 0.1627, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +}; + +/* + * Name: XYZtoCorColorTemp.c + * + * Author: Bruce Justin Lindbloom + * + * Copyright (c) 2003 Bruce Justin Lindbloom. All rights reserved. + * + * + * Description: + * This is an implementation of Robertson's method of computing the correlated color + * temperature of an XYZ color. It can compute correlated color temperatures in the + * range [1666.7K, infinity]. + * + * Reference: + * "Color Science: Concepts and Methods, Quantitative Data and Formulae", Second Edition, + * Gunter Wyszecki and W. S. Stiles, John Wiley & Sons, 1982, pp. 227, 228. + */ +//adaptation to RT by J.Desmis +#include + +/* LERP(a,b,c) = linear interpolation macro, is 'a' when c == 0.0 and 'b' when c == 1.0 */ +#define LERP(a,b,c) (((b) - (a)) * (c) + (a)) +int ColorTemp::XYZtoCorColorTemp(double x0, double y0, double z0, double &temp) +{ + + typedef struct UVT { + double u; + double v; + double t; + } UVT; + + double rt[31] = { /* reciprocal temperature (K) */ + DBL_MIN, 10.0e-6, 20.0e-6, 30.0e-6, 40.0e-6, 50.0e-6, + 60.0e-6, 70.0e-6, 80.0e-6, 90.0e-6, 100.0e-6, 125.0e-6, + 150.0e-6, 175.0e-6, 200.0e-6, 225.0e-6, 250.0e-6, 275.0e-6, + 300.0e-6, 325.0e-6, 350.0e-6, 375.0e-6, 400.0e-6, 425.0e-6, + 450.0e-6, 475.0e-6, 500.0e-6, 525.0e-6, 550.0e-6, 575.0e-6, + 600.0e-6 + }; + + UVT uvt[31] = { + {0.18006, 0.26352, -0.24341}, + {0.18066, 0.26589, -0.25479}, + {0.18133, 0.26846, -0.26876}, + {0.18208, 0.27119, -0.28539}, + {0.18293, 0.27407, -0.30470}, + {0.18388, 0.27709, -0.32675}, + {0.18494, 0.28021, -0.35156}, + {0.18611, 0.28342, -0.37915}, + {0.18740, 0.28668, -0.40955}, + {0.18880, 0.28997, -0.44278}, + {0.19032, 0.29326, -0.47888}, + {0.19462, 0.30141, -0.58204}, + {0.19962, 0.30921, -0.70471}, + {0.20525, 0.31647, -0.84901}, + {0.21142, 0.32312, -1.0182}, + {0.21807, 0.32909, -1.2168}, + {0.22511, 0.33439, -1.4512}, + {0.23247, 0.33904, -1.7298}, + {0.24010, 0.34308, -2.0637}, + {0.24792, 0.34655, -2.4681}, + {0.25591, 0.34951, -2.9641}, + {0.26400, 0.35200, -3.5814}, + {0.27218, 0.35407, -4.3633}, + {0.28039, 0.35577, -5.3762}, + {0.28863, 0.35714, -6.7262}, + {0.29685, 0.35823, -8.5955}, + {0.30505, 0.35907, -11.324}, + {0.31320, 0.35968, -15.628}, + {0.32129, 0.36011, -23.325}, + {0.32931, 0.36038, -40.770}, + {0.33724, 0.36051, -116.45} + }; + + double us, vs, p, di, dm; + int i; + if ((x0 < 1.0e-20) && (y0 < 1.0e-20) && (z0 < 1.0e-20)) + return -1; /* protect against possible divide-by-zero failure */ + us = (4.0 * x0) / (x0 + 15.0 * y0 + 3.0 * z0); + vs = (6.0 * y0) / (x0 + 15.0 * y0 + 3.0 * z0); + dm = 0.0; + for (i = 0; i < 31; i++) { + di = (vs - uvt[i].v) - uvt[i].t * (us - uvt[i].u); + if ((i > 0) && (((di < 0.0) && (dm >= 0.0)) || ((di >= 0.0) && (dm < 0.0)))) + break; /* found lines bounding (us, vs) : i-1 and i */ + dm = di; + } + if (i == 31) + return(-1); /* bad XYZ input, color temp would be less than minimum of 1666.7 degrees, or too far towards blue */ + di = di / sqrt(1.0 + uvt[i ].t * uvt[i ].t); + dm = dm / sqrt(1.0 + uvt[i - 1].t * uvt[i - 1].t); + p = dm / (dm - di); /* p = interpolation parameter, 0.0 : i-1, 1.0 : i */ + p = 1.0 / (LERP(rt[i - 1], rt[i], p)); + temp = p; + return 0; /* success */ +} + +void ColorTemp::curvecolor(double satind, double satval, double &sres, double parsat){ + if (satind >=0.0) { + sres = (1.-(satind)/100.)*satval+(satind)/100.*(1.-SQR(SQR(1.-min(satval,1.0)))); + if (sres>parsat) sres=parsat; + if (sres<0.) sres=0.; + } else { + if (satind < -0.1) + sres = satval*(1.+(satind)/100.); + } +} + + +void ColorTemp::curveJ (double br, double contr, int db, LUTf & outCurve, LUTu & histogram ) { + LUTf dcurve(65536,0); + int skip=1; + + // check if brightness curve is needed + if (br>0.00001 || br<-0.00001) { + + std::vector brightcurvePoints; + brightcurvePoints.resize(9); + brightcurvePoints.at(0) = double(DCT_NURBS); + + brightcurvePoints.at(1) = 0.; // black point. Value in [0 ; 1] range + brightcurvePoints.at(2) = 0.; // black point. Value in [0 ; 1] range + + if (br>0) { + brightcurvePoints.at(3) = 0.1; // toe point + brightcurvePoints.at(4) = 0.1+br/150.0; //value at toe point + + brightcurvePoints.at(5) = 0.7; // shoulder point + brightcurvePoints.at(6) = min(1.0,0.7+br/300.0); //value at shoulder point + } else { + brightcurvePoints.at(3) = 0.1-br/150.0; // toe point + brightcurvePoints.at(4) = 0.1; // value at toe point + + brightcurvePoints.at(5) = min(1.0,0.7-br/300.0); // shoulder point + brightcurvePoints.at(6) = 0.7; // value at shoulder point + } + brightcurvePoints.at(7) = 1.; // white point + brightcurvePoints.at(8) = 1.; // value at white point + + DiagonalCurve* brightcurve = new DiagonalCurve (brightcurvePoints, CURVES_MIN_POLY_POINTS/skip); + + // Applying brightness curve + for (int i=0; i<32768; i++) { + + // change to [0,1] range + float val = (float)i / 32767.0; + + // apply brightness curve + val = brightcurve->getVal (val); + + // store result in a temporary array + dcurve[i] = CLIPD(val); + } + delete brightcurve; + } + else { + // for (int i=0; i<32768; i++) { // L values range up to 32767, higher values are for highlight overflow + for (int i=0; i<(32768*db); i++) { // L values range up to 32767, higher values are for highlight overflow + + // set the identity curve in the temporary array + dcurve[i] = (float)i / (db*32768.0f); + } + } + + + if (contr>0.00001 || contr<-0.00001) { + + // compute mean luminance of the image with the curve applied + int sum = 0; + float avg = 0; + //float sqavg = 0; + for (int i=0; i<32768; i++) { + avg += dcurve[i] * histogram[i];//approximation for average : usage of L (lab) instead of J + sum += histogram[i]; + } + avg /= sum; + std::vector contrastcurvePoints; + contrastcurvePoints.resize(9); + contrastcurvePoints.at(0) = double(DCT_NURBS); + + contrastcurvePoints.at(1) = 0.; // black point. Value in [0 ; 1] range + contrastcurvePoints.at(2) = 0.; // black point. Value in [0 ; 1] range + + contrastcurvePoints.at(3) = avg-avg*(0.6-contr/250.0); // toe point + contrastcurvePoints.at(4) = avg-avg*(0.6+contr/250.0); // value at toe point + + contrastcurvePoints.at(5) = avg+(1-avg)*(0.6-contr/250.0); // shoulder point + contrastcurvePoints.at(6) = avg+(1-avg)*(0.6+contr/250.0); // value at shoulder point + + contrastcurvePoints.at(7) = 1.; // white point + contrastcurvePoints.at(8) = 1.; // value at white point + + DiagonalCurve* contrastcurve = new DiagonalCurve (contrastcurvePoints, CURVES_MIN_POLY_POINTS/skip); + + // apply contrast enhancement + for (int i=0; i<(32768*db); i++) { + dcurve[i] = contrastcurve->getVal (dcurve[i]); + } + + delete contrastcurve; + } + + // for (int i=0; i<32768; i++) outCurve[i] = 32768.0*dcurve[i]; + for (int i=0; i<(db*32768); i++) outCurve[i] = db*32768.0*dcurve[i]; +} + + +// * Copyright (c) October 2012 Jacques Desmis +void ColorTemp::ciecam_02 (LabImage* lab, const ProcParams* params ) +{ +if(params->colorappearance.enabled) { + +#ifdef _DEBUG + MyTime t1e,t2e; + t1e.set(); +#endif + + int width = lab->W, height = lab->H; + double Yw; + Yw=1.0; + double Xw, Zw; + double f,c,nc,yb,la,xw,yw,zw,f2,c2,nc2,yb2,la2; + double z,fl,n,nbb,ncb,d,aw; + double xwd,ywd,zwd; + int alg=0; + LUTf bright_curve (65536,0);//init curve + LUTf bright_curveQ (65536,0);//init curve + + LUTu hist16 (65536); + LUTu hist16Q (65536); + float koef=1.0f;//rough correspondence between L and J + hist16.clear();hist16Q.clear(); + float sum=0.f; + float mean; + for (int i=0; iL[i][j])/327.68f)>95.) koef=1.f; + else if(((lab->L[i][j])/327.68f)>85.) koef=0.97f; + else if(((lab->L[i][j])/327.68f)>80.) koef=0.93f; + else if(((lab->L[i][j])/327.68f)>70.) koef=0.87f; + else if(((lab->L[i][j])/327.68f)>60.) koef=0.85f; + else if(((lab->L[i][j])/327.68f)>50.) koef=0.8f; + else if(((lab->L[i][j])/327.68f)>40.) koef=0.75f; + else if(((lab->L[i][j])/327.68f)>30.) koef=0.7f; + else if(((lab->L[i][j])/327.68f)>20.) koef=0.7f; + else if(((lab->L[i][j])/327.68f)>10.) koef=0.9f; + else if(((lab->L[i][j])/327.68f)>0.) koef=1.0f; + + hist16[CLIP((int)((koef*lab->L[i][j])))]++;//evaluate histogram luminance L # J + sum+=koef*lab->L[i][j];//evaluate mean J to calcualte Yb + hist16Q[CLIP((int) (32768.f*sqrt((koef*(lab->L[i][j]))/32768.f)))]++; //for brightness Q : approximation for Q=wh*sqrt(J/100) J not equal L + } + mean=(sum/(height*width))/327.68f;//for Yb for all image...if one day "pipette" we can adapt Yb for each zone + if (mean<15.f) yb=3.0; + else if(mean<30.f) yb=5.0; + else if(mean<40.f) yb=10.0; + else if(mean<45.f) yb=15.0; + else if(mean<50.f) yb=18.0; + else if(mean<55.f) yb=23.0; + else if(mean<60.f) yb=30.0; + else if(mean<70.f) yb=40.0; + else if(mean<80.f) yb=60.0; + else if(mean<90.f) yb=80.0; + else yb=90.0; + + ColorTemp::temp2mulxyz (params->wb.temperature, params->wb.green, params->wb.method, Xw, Zw); //compute white Xw Yw Zw : white current WB + //viewing condition for surround + if(params->colorappearance.surround=="Average") { f = 1.00; c = 0.69; nc = 1.00;f2=1.0,c2=0.69,nc2=1.0;} + else if(params->colorappearance.surround=="Dim"){ f2 = 0.9; c2 = 0.59; nc2 = 0.9;f=1.0,c=0.69,nc=1.0;} + else if(params->colorappearance.surround=="Dark"){f2 = 0.8; c2 = 0.525;nc2 = 0.8;f=1.0,c=0.69,nc=1.0;} + else if(params->colorappearance.surround=="ExtremelyDark"){f2 = 0.8; c2 = 0.41;nc2 = 0.8;f=1.0,c=0.69,nc=1.0;} + + //scene condition for surround + if(params->colorappearance.surrsource) {f = 0.85; c = 0.55; nc = 0.85;}// if user => source image has surround very dark + //with which algorithme + if (params->colorappearance.algo=="JC") alg=0; + else if(params->colorappearance.algo=="JS") alg=1; + else if(params->colorappearance.algo=="QM") alg=2; + else if(params->colorappearance.algo=="ALL") alg=3; + //settings white point of output device + if (settings->viewingdevice==0) {xwd= 96.42; ywd=100.0; zwd= 82.52;}//5000K + else if(settings->viewingdevice==1) {xwd= 95.68; ywd=100.0; zwd= 92.15;}//5500 + else if(settings->viewingdevice==2) {xwd= 95.24; ywd=100.0; zwd=100.81;}//6000 + else if(settings->viewingdevice==3) {xwd= 95.04; ywd=100.0; zwd=108.88;}//6500 + else if(settings->viewingdevice==4) {xwd=109.85; ywd=100.0; zwd= 35.58;}//tungsten + //settings mean Luminance Y of output device + if(settings->viewingdevicegrey==0) {yb2=5.0;} + else if(settings->viewingdevicegrey==1) {yb2=10.0;} + else if(settings->viewingdevicegrey==2) {yb2=15.0;} + else if(settings->viewingdevicegrey==3) {yb2=18.0;} + else if(settings->viewingdevicegrey==4) {yb2=23.0;} + else if(settings->viewingdevicegrey==5) {yb2=30.0;} + else if(settings->viewingdevicegrey==6) {yb2=40.0;} + + //La and la2 = ambiant luminosity scene and viewing + la=double(params->colorappearance.adapscen); + la2=double(params->colorappearance.adaplum); + + // level of adaptation + double deg=(params->colorappearance.degree)/100.0; + double pilot=params->colorappearance.autodegree ? 2.0 : deg; + + //algoritm's params + float jli=params->colorappearance.jlight; + float chr=params->colorappearance.chroma; + float contra=params->colorappearance.contrast; + float qbri=params->colorappearance.qbright; + float schr=params->colorappearance.schroma; + float mchr=params->colorappearance.mchroma; + float qcontra=params->colorappearance.qcontrast; + float hue=params->colorappearance.colorh; + double rstprotection = 100.-params->colorappearance.rstprotection; + //evaluate lightness, contrast + curveJ (jli, contra, 1, bright_curve, hist16);//lightness and contrast J + curveJ (qbri, qcontra, 1, bright_curveQ, hist16Q);//brightness and contrast Q + int gamu=0; + bool highlight = params->hlrecovery.enabled; //Get the value if "highlight reconstruction" is activated + + if(params->colorappearance.gamut==true) gamu=1;//enabled gamut control + xw=100.0*Xw; + yw=100.0*Yw; + zw=100.0*Zw; + double xw1,yw1,zw1,xw2,yw2,zw2; + // settings of WB: scene and viewing + if(params->colorappearance.wbmodel=="RawT") {xw1=96.46;yw1=100.0;zw1=82.445;xw2=xwd;yw2=ywd;zw2=zwd;} //use RT WB; CAT 02 is used for output device (see prefreneces) + else if(params->colorappearance.wbmodel=="RawTCAT02") {xw1=xw;yw1=yw;zw1=zw;xw2=xwd;yw2=ywd;zw2=zwd;} // Settings RT WB are used for CAT02 => mix , CAT02 is use for output device (screen: D50 D65, projector: lamp, LED) see preferences + + /* double maxj=-100.0; + double minj= 500.0; + double minc=500.0; + double maxc=-100.0; +*/ + bool doneinit=true; + bool doneinit2=true; +#ifndef _DEBUG +#pragma omp parallel default(shared) firstprivate(lab,xw1,xw2,yw1,yw2,zw1,zw2,pilot,jli,chr,yb,la,fl,nc,f,c, height,width,doneinit,doneinit2, nc2,f2,c2, alg, gamu, highlight, rstprotection) +#endif +{ + TMatrix wiprof = iccStore->workingSpaceInverseMatrix (params->icm.working); + double wip[3][3] = { + {wiprof[0][0],wiprof[0][1],wiprof[0][2]}, + {wiprof[1][0],wiprof[1][1],wiprof[1][2]}, + {wiprof[2][0],wiprof[2][1],wiprof[2][2]} + }; + +#ifndef _DEBUG +#pragma omp for schedule(dynamic, 10) +#endif + for (int i=0; iL[i][j]; + float a=lab->a[i][j]; + float b=lab->b[i][j]; + float x1,y1,z1; + double x,y,z; + //convert Lab => XYZ + Color::Lab2XYZ(L, a, b, x1, y1, z1); + double J, C, h, Q, M, s, aw, fl, wh; + + x=(double)x1/655.35; + y=(double)y1/655.35; + z=(double)z1/655.35; + //process source==> normal + ColorTemp::xyz2jchqms_ciecam02( J, C, h, + Q, M, s, aw, fl, wh, + x, y, z, + xw1, yw1, zw1, + yb, la, + f, c, nc, pilot, doneinit, gamu ); + + if(alg==0) { + //lightness J + chroma C + J=(bright_curve[(float)(J*327.68)])/327.68;//ligthness CIECAM02 + contrast + double Cp,sres; + Cp=C/100.0; + double parsat=1.8;//parsat=1.5 =>saturation ; 1.8 => chroma ; 2.5 => colorfullness (personal evaluation : for not) + curvecolor(chr, Cp , sres, parsat); + float factorskin, factorsat, factor, factorskinext, interm; + float scale = 100.0f/100.1f;//reduction in normal zone + float scaleext=1.0f;//reduction in transition zone + float protect_red,protect_redh; + float deltaHH=0.3f;//HH value transition : I have choice 0.3 radians + float HH; + bool doskin=false; + //rough correspondence between h (JC) and H (lab) that has relatively little importance because of transitions that blur the correspondence is not linear + if((float)h>8.6f && (float)h<=74.f) {HH=(1.15f/65.4f)*(float)h-0.0012f;doskin=true;}//H > 0.15 H<1.3 + else if((float)h>0.f && (float)h<=8.6f) {HH=(0.19f/8.6f)*(float)h-0.04f;doskin=true;}//H>-0.04 H < 0.15 + else if((float)h>355.f && (float)h<=360.f) {HH=(0.11f/5.f)*(float)h-7.96f;doskin=true;}//H>-0.15 <-0.04 + else if((float)h>74.f && (float)h<95.f) {HH=(0.3f/21.f)*(float)h+0.24285f;doskin=true;}//H>1.3 H<1.6 + if(doskin){ + float chromapro=sres/Cp; + float dred=55.0f;//Skin max + if (J<16.0) dred = 40.0f; + else if(J<22.0) dred = (4.1666f)*(float)J -26.6f; + else if(J<60.0) dred = 55.0f; + else if(J<70.0) dred = -1.5f*(float)J +145.0f; + else dred = 40.0f; + + float protect_red=30.f; //==> 90=60+30 transition + if(chromapro>0.0) Color::scalered ( rstprotection, chromapro, 0.0, HH, deltaHH, scale, scaleext);//Scale factor + if(chromapro>1.0) {interm=(chromapro-1.0f)*100.0f; + factorskin= 1.0f+(interm*scale)/100.0f; + factorskinext=1.0f+(interm*scaleext)/100.0f;} + else { + factorskin= chromapro ; + factorskinext= chromapro ; + } + factorsat=chromapro; + factor=factorsat; + Color::transitred ( HH, C, dred, factorskin, protect_red, factorskinext, deltaHH, factorsat, factor); //transition + C*=factor; + } + else C=100.0*sres; + } + else if(alg==2) { + //Brightness Q Colorfullness M + double coef=32760./wh; + Q=(bright_curveQ[(float)(Q*coef)])/coef;//brightness and contrast + double Mp, sres; + double coe=pow(fl,0.25); + Mp=M/100.0; + double parsat=2.5; + curvecolor(mchr, Mp , sres, parsat); + M=100.0*sres; + J=(100.0* Q*Q) /(wh*wh); + C= M/coe; + } + else if(alg==1) { + // Lightness saturation + J=(bright_curve[(float)(J*327.68)])/327.68;//ligthness CIECAM02 + contrast + double sres; + double Sp=s/100.0; + double parsat=1.5; + curvecolor(schr, Sp , sres, parsat); + s=100.*sres; + double Q1; + Q1= ( 4.0 / c ) * sqrt( J / 100.0 ) * ( aw + 4.0 ) ; + C=(s*s*Q1)/(10000.0); + } + else if(alg==3) { + double coef=32760./wh; + Q=(bright_curveQ[(float)(Q*coef)])/coef;//brightness and contrast + double Mp, sres; + double coe=pow(fl,0.25); + Mp=M/100.0; + double parsat=2.5; + if(mchr==-100.0) mchr=-99.8 ; + if(mchr==100.0) mchr=99.9; + curvecolor(mchr, Mp , sres, parsat);//colorfullness + M=100.0*sres; + J=(100.0* Q*Q) /(wh*wh); + C= M/coe; + s = 100.0 * sqrt( M / Q ); + J=(bright_curve[(float)(J*327.68)])/327.68;//ligthness CIECAM02 + contrast + double Cp; + double Sp=s/100.0; + parsat=1.5; + if(schr==-100.0) schr=-99.; + if(schr==100.0) schr=98.; + curvecolor(schr, Sp , sres, parsat); //saturation + s=100.*sres; + double Q1; + Q1= ( 4.0 / c ) * sqrt( J / 100.0 ) * ( aw + 4.0 ) ; + C=(s*s*Q1)/(10000.0); + Cp=C/100.0; + parsat=1.8;//parsat=1.5 =>saturation ; 1.8 => chroma ; 2.5 => colorfullness (personal evaluation : for not) + curvecolor(chr, Cp , sres, parsat); //chroma + float factorskin, factorsat, factor, factorskinext, interm; + float scale = 100.0f/100.1f;//reduction in normal zone + float scaleext=1.0f;//reduction in transition zone + float protect_red,protect_redh; + float deltaHH=0.3f;//HH value transition : I have choice 0.3 radians + float HH; + bool doskin=false; + //rough correspondence between h (JC) and H (lab) that has relatively little importance because of transitions that blur the correspondence is not linear + if((float)h>8.6f && (float)h<=74.f) {HH=(1.15f/65.4f)*(float)h-0.0012f;doskin=true;}//H > 0.15 H<1.3 + else if((float)h>0.f && (float)h<=8.6f) {HH=(0.19f/8.6f)*(float)h-0.04f;doskin=true;}//H>-0.04 H < 0.15 + else if((float)h>355.f && (float)h<=360.f) {HH=(0.11f/5.f)*(float)h-7.96f;doskin=true;}//H>-0.15 <-0.04 + else if((float)h>74.f && (float)h<95.f) {HH=(0.3f/21.f)*(float)h+0.24285f;doskin=true;}//H>1.3 H<1.6 + if(doskin){ + float chromapro=sres/Cp; + float dred=55.0f;//Skin max + if (J<16.0) dred = 40.0f; + else if(J<22.0) dred = (4.1666f)*(float)J -26.6f; + else if(J<60.0) dred = 55.0f; + else if(J<70.0) dred = -1.5f*(float)J +145.0f; + else dred = 40.0f; + + float protect_red=30.f; //==> 90=60+30 transition + if(chromapro>0.0) Color::scalered ( rstprotection, chromapro, 0.0, HH, deltaHH, scale, scaleext);//Scale factor + if(chromapro>1.0) { + interm=(chromapro-1.0f)*100.0f; + factorskin= 1.0f+(interm*scale)/100.0f; + factorskinext=1.0f+(interm*scaleext)/100.0f; + } + else { + factorskin= chromapro ; + factorskinext= chromapro ; + } + factorsat=chromapro; + factor=factorsat; + Color::transitred ( HH, C, dred, factorskin, protect_red, factorskinext, deltaHH, factorsat, factor); //transition + C*=factor; + } + else C=100.0*sres; + h=h+hue;if( h < 0.0 ) h += 360.0;//hue + } + /* + if(J>maxj) maxj=J; + if(C>maxc) maxc=C; + if(Jmaxj) maxj=J; + if(C>maxc) maxc=C; + if(J viewing + ColorTemp::jch2xyz_ciecam02( xx, yy, zz, + J, C, h, + xw2, yw2, zw2, + yb2, la2, + f2, c2, nc2, doneinit2, gamu); + x=(float)xx*655.35; + y=(float)yy*655.35; + z=(float)zz*655.35; + float Ll,aa,bb; + //convert xyz=>lab + Color::XYZ2Lab(x, y, z, Ll, aa, bb); + lab->L[i][j]=Ll; + lab->a[i][j]=aa; + lab->b[i][j]=bb; + + // gamut control in Lab mode; I must study how to do with cIECAM only + if(gamu==1) { + float R,G,B; + float HH, Lprov1, Chprov1; + Lprov1=lab->L[i][j]/327.68f; + Chprov1=sqrt(SQR(lab->a[i][j]/327.68f) + SQR(lab->b[i][j]/327.68f)); + HH=atan2(lab->b[i][j],lab->a[i][j]); + +#ifdef _DEBUG + bool neg=false; + bool more_rgb=false; + //gamut control : Lab values are in gamut + Color::gamutLchonly(HH,Lprov1,Chprov1, R, G, B, wip, highlight, 0.15f, 0.96f, neg, more_rgb); +#else + //gamut control : Lab values are in gamut + Color::gamutLchonly(HH,Lprov1,Chprov1, R, G, B, wip, highlight, 0.15f, 0.96f); +#endif + + lab->L[i][j]=Lprov1*327.68f; + lab->a[i][j]=327.68f*Chprov1*cos(HH); + lab->b[i][j]=327.68f*Chprov1*sin(HH); + } + } + } + // End of parallelization + +#ifdef _DEBUG + if (settings->verbose) { + t2e.set(); + printf("CIECAM02 performed in %d usec:\n", t2e.etime(t1e)); + //printf("minc=%f maxc=%f minj=%f maxj=%f\n",minc,maxc,minj,maxj); + } +#endif +} +} + + +void ColorTemp::cieCAT02(double Xw, double Yw, double Zw, double &CAM02BB00,double &CAM02BB01,double &CAM02BB02,double &CAM02BB10,double &CAM02BB11,double &CAM02BB12,double &CAM02BB20,double &CAM02BB21,double &CAM02BB22, double adap ) { + +// CIECAT02 - J.Desmis January 2012 review September 2012 + const double whiteD50p[3]={0.9646019585,1.0,0.8244507152};//calculate with these tools + + double cam_dest[3]={0.,0.,0.}; + double cam_orig[3]={0.,0.,0.}; + const double CAT02[3][3] = {{0.7328, 0.4296, -0.1624},//CAT02 2002 + {-0.7036, 1.6975, 0.0061}, + {0.0030, 0.0136, 0.9834}}; + const double INVCAT02[3][3] = {{1.09612382083551, -0.278869000218287, 0.182745179382773}, //Inverse CAT02 + {0.454369041975359, 0.4735331543070412, 0.0720978037172291}, + {-0.009627608738442936, -0.00569803121611342, 1.01532563995454}}; + + double inv_white_orig[3][3]={{0., 0., 0.}, + {0., 0., 0.}, + {0., 0., 0.}}; + double intermed[3][3]={{0., 0., 0.}, + {0., 0., 0.}, + {0., 0., 0.}}; + + double intermed_2[3][3]={{0., 0., 0.}, + {0., 0., 0.}, + {0., 0., 0.}}; + double CAM02[3][3]= {{0., 0., 0.}, + {0., 0., 0.}, + {0., 0., 0.}}; + double D=adap; + + //white destination Wd : RT use always D50 + cam_dest[0]=CAT02[0][0]*whiteD50p[0]+CAT02[0][1]*whiteD50p[1]+CAT02[0][2]*whiteD50p[2];//Cone reponse RoD + cam_dest[1]=CAT02[1][0]*whiteD50p[0]+CAT02[1][1]*whiteD50p[1]+CAT02[1][2]*whiteD50p[2];//GaD + cam_dest[2]=CAT02[2][0]*whiteD50p[0]+CAT02[2][1]*whiteD50p[1]+CAT02[2][2]*whiteD50p[2];//BeD + + //origin white Ws : A, D65, custom, etc. + cam_orig[0]=CAT02[0][0]*Xw+CAT02[0][1]*Yw+CAT02[0][2]*Zw;//Cone reponse RoS + cam_orig[1]=CAT02[1][0]*Xw+CAT02[1][1]*Yw+CAT02[1][2]*Zw; + cam_orig[2]=CAT02[2][0]*Xw+CAT02[2][1]*Yw+CAT02[2][2]*Zw; + + //inverse white + inv_white_orig[0][0]=1./cam_orig[0];// 1/RoS + inv_white_orig[1][1]=1./cam_orig[1];// 1/GaS + inv_white_orig[2][2]=1./cam_orig[2];// 1/BeS + + //intermediates computation + for(int i=0; i< 3;i++) + for(int j=0; j<3 ; j++) + intermed[i][j]=inv_white_orig[i][i]*CAT02[i][j]; + + for(int i=0; i< 3;i++) + for(int j=0; j<3 ; j++) + intermed_2[i][j]=cam_dest[i]*intermed[i][j]; + //and CAM02 + for(int i=0; i<3; i++) + for(int j=0; j<3; j++) + for(int k=0; k<3; k++) + CAM02[i][j]+=INVCAT02[i][k]*intermed_2[k][j]; + + //adaptation jdc : slightly different from CIECAM02 : Rc=(Yw(D/Rw)+(1-D))*R , but it's work ! true at 0 and 1 + CAM02[1][1]=(CAM02[1][1]-1.0)*D + 1.0; + CAM02[0][0]=(CAM02[0][0]-1.0)*D + 1.0; + CAM02[2][2]=(CAM02[2][2]-1.0)*D + 1.0; + CAM02[0][1]*=D; + CAM02[0][2]*=D; + CAM02[1][0]*=D; + CAM02[1][2]*=D; + CAM02[2][0]*=D; + CAM02[2][1]*=D; + //CAT02 matrix with D adaptation + CAM02BB00=CAM02[0][0];CAM02BB01=CAM02[0][1];CAM02BB02=CAM02[0][2]; + CAM02BB10=CAM02[1][0];CAM02BB11=CAM02[1][1];CAM02BB12=CAM02[1][2]; + CAM02BB20=CAM02[2][0];CAM02BB21=CAM02[2][1];CAM02BB22=CAM02[2][2]; + +} + +void ColorTemp::temp2mulxyz (double tem, double gree, Glib::ustring method ,double &Xxyz, double &Zxyz) { + double xD, yD, x_D, y_D, interm; + double x, y, z; + + if (method == "Daylight" ) spectrum_to_xyz_preset(Daylight5300_spect, x, y, z); + else if(method == "Cloudy" ) spectrum_to_xyz_preset(Cloudy6200_spect, x, y, z); + else if(method == "Shade" ) spectrum_to_xyz_preset(Shade7600_spect, x, y, z); + else if(method == "Tungsten" ) spectrum_to_xyz_preset(A2856_spect, x, y, z); + else if(method == "Fluo F1" ) spectrum_to_xyz_preset(FluoF1_spect, x, y, z); + else if(method == "Fluo F2" ) spectrum_to_xyz_preset(FluoF2_spect, x, y, z); + else if(method == "Fluo F3" ) spectrum_to_xyz_preset(FluoF3_spect, x, y, z); + else if(method == "Fluo F4" ) spectrum_to_xyz_preset(FluoF4_spect, x, y, z); + else if(method == "Fluo F5" ) spectrum_to_xyz_preset(FluoF5_spect, x, y, z); + else if(method == "Fluo F6" ) spectrum_to_xyz_preset(FluoF6_spect, x, y, z); + else if(method == "Fluo F7" ) spectrum_to_xyz_preset(FluoF7_spect, x, y, z); + else if(method == "Fluo F8" ) spectrum_to_xyz_preset(FluoF8_spect, x, y, z); + else if(method == "Fluo F9" ) spectrum_to_xyz_preset(FluoF9_spect, x, y, z); + else if(method == "Fluo F10" ) spectrum_to_xyz_preset(FluoF10_spect, x, y, z); + else if(method == "Fluo F11" ) spectrum_to_xyz_preset(FluoF11_spect, x, y, z); + else if(method == "Fluo F12" ) spectrum_to_xyz_preset(FluoF12_spect, x, y, z); + else if(method == "HMI Lamp" ) spectrum_to_xyz_preset(HMI_spect, x, y, z); + else if(method == "GTI Lamp" ) spectrum_to_xyz_preset(GTI_spect, x, y, z); + else if(method == "JudgeIII Lamp" ) spectrum_to_xyz_preset(JudgeIII_spect, x, y, z); + else if(method == "Solux Lamp 3500K" ) spectrum_to_xyz_preset(Solux3500_spect, x, y, z); + else if(method == "Solux Lamp 4100K" ) spectrum_to_xyz_preset(Solux4100_spect, x, y, z); + else if(method == "Solux Lamp 4700K" ) spectrum_to_xyz_preset(Solux4700_spect, x, y, z); + else if(method == "NG Solux Lamp 4700K" ) spectrum_to_xyz_preset(NG_Solux4700_spect, x, y, z); + else if(method == "LED LSI Lumelex 2040") spectrum_to_xyz_preset(NG_LEDLSI2040_spect, x, y, z); + else if(method == "LED CRS SP12 WWMR16" ) spectrum_to_xyz_preset(NG_CRSSP12WWMR16_spect, x, y, z); + else if(method == "Flash 5500K" ) spectrum_to_xyz_preset(Flash5500_spect, x, y, z); + else if(method == "Flash 6000K" ) spectrum_to_xyz_preset(Flash6000_spect, x, y, z); + else if(method == "Flash 6500K" ) spectrum_to_xyz_preset(Flash6500_spect, x, y, z); + else { + // otherwise we use the Temp+Green generic solution + if (tem <= 4000) { + // if temperature is between 2000K and 4000K we use blackbody, because there will be no Daylight reference below 4000K... + // of course, the previous version of RT used the "magical" but wrong formula of U.Fuchs (Ufraw). + spectrum_to_xyz_blackbody(0., 0., tem, x, y, z); + } + else { + // from 4000K up to 25000K: using the D illuminant (daylight) which is standard + double m1, m2; + if (tem<=7000) + x_D = -4.6070e9/(tem*tem*tem) + 2.9678e6/(tem*tem) + 0.09911e3/tem + 0.244063; + else + x_D = -2.0064e9/(tem*tem*tem) + 1.9018e6/(tem*tem) + 0.24748e3/tem + 0.237040; + + y_D = -3.0*x_D*x_D + 2.87*x_D - 0.275; + //calculate D -daylight in function of s0, s1, s2 and temp ==> x_D y_D + //S(lamda)=So(lambda)+m1*s1(lambda)+m2*s2(lambda) + interm=(0.0241+0.2562*x_D-0.734*y_D); + m1=(-1.3515-1.7703*x_D+5.9114*y_D)/interm; + m2=(0.03-31.4424*x_D+30.0717*y_D)/interm; + spectrum_to_xyz_daylight(m1, m2, 0., x, y, z); + xD=x;yD=y; + } + + } + + xD=x; yD=y; + + double X = xD/yD; + double Z = (1.0-xD-yD)/yD; + Xxyz=X; + Zxyz=Z; + //printf("Xxyz=%f Zxyz=%f\n",Xxyz,Zxyz); +} + +void ColorTemp::temp2mul (double temp, double green, double& rmul, double& gmul, double& bmul) { + + clip (temp, green); + //variables for CRI and display Lab, and palette + bool CRI_type=false; + double xD, yD, x_D, y_D, interm; + double m1, m2; + double xp,yp; + + double x, y, z, xx, yy, zz; + double Xchk[50],Ychk[50],Zchk[50]; //50 : I think it's a good limit for number of color : for CRI and Palette + double Xcam02[50],Ycam02[50],Zcam02[50]; + double Xcam02pal[50],Ycam02pal[50],Zcam02pal[50]; + + double XchkLamp[50],YchkLamp[50],ZchkLamp[50]; + double Xcam02Lamp[50],Ycam02Lamp[50],Zcam02Lamp[50]; + double Xpal[50],Ypal[50],Zpal[50]; + double tempw; + const double epsilon=0.008856;//Lab + const double whiteD50[3]={0.9646019585,1.0,0.8244507152};//calculate with this tool : spect 5nm + double CAM02BB00,CAM02BB01,CAM02BB02,CAM02BB10,CAM02BB11,CAM02BB12,CAM02BB20,CAM02BB21,CAM02BB22;//for CIECAT02 + + double xr[50],yr[50],zr[50]; + double fx[50],fy[50],fz[50]; + double Llamp[50],alamp[50],blamp[50]; + double Lbb[50],abb[50],bbb[50]; + double Lpal[50],apal[50],bpal[50]; + + float DeltaE[50], DeltaEs[8]; + float quadCRI=0.0f,quadCRIs=0.0f; + float CRI_RT=0.0, CRI[50]; + float CRI_RTs=0.0, CRIs[8]; + int palet=-1; + bool palette=true; + // double tempalet; // correlated temperature + + // We first test for specially handled methods + if (method == "Daylight" ) {spectrum_to_xyz_preset(Daylight5300_spect, x, y, z);palet=0; /*tempalet=5300;*/ } + else if(method == "Cloudy" ) {spectrum_to_xyz_preset(Cloudy6200_spect, x, y, z);palet=1; /*tempalet=6200;*/ } + else if(method == "Shade" ) {spectrum_to_xyz_preset(Shade7600_spect, x, y, z);palet=2; /*tempalet=7600;*/ } + else if(method == "Tungsten" ) {spectrum_to_xyz_preset(A2856_spect, x, y, z);palet=3; /*tempalet=2856;*/ } + else if(method == "Fluo F1" ) {spectrum_to_xyz_preset(FluoF1_spect, x, y, z);palet=4; /*tempalet=6430;*/ } + else if(method == "Fluo F2" ) {spectrum_to_xyz_preset(FluoF2_spect, x, y, z);palet=5; /*tempalet=4230;*/ } + else if(method == "Fluo F3" ) {spectrum_to_xyz_preset(FluoF3_spect, x, y, z);palet=6; /*tempalet=3450;*/ } + else if(method == "Fluo F4" ) {spectrum_to_xyz_preset(FluoF4_spect, x, y, z);palet=7; /*tempalet=2940;*/ } + else if(method == "Fluo F5" ) {spectrum_to_xyz_preset(FluoF5_spect, x, y, z);palet=8; /*tempalet=6350;*/ } + else if(method == "Fluo F6" ) {spectrum_to_xyz_preset(FluoF6_spect, x, y, z);palet=9; /*tempalet=4150;*/ } + else if(method == "Fluo F7" ) {spectrum_to_xyz_preset(FluoF7_spect, x, y, z);palet=10; /*tempalet=6500;*/ } + else if(method == "Fluo F8" ) {spectrum_to_xyz_preset(FluoF8_spect, x, y, z);palet=11; /*tempalet=5020;*/ } + else if(method == "Fluo F9" ) {spectrum_to_xyz_preset(FluoF9_spect, x, y, z);palet=12; /*tempalet=4330;*/ } + else if(method == "Fluo F10" ) {spectrum_to_xyz_preset(FluoF10_spect, x, y, z);palet=13; /*tempalet=5300;*/ } + else if(method == "Fluo F11" ) {spectrum_to_xyz_preset(FluoF11_spect, x, y, z);palet=14; /*tempalet=4000;*/ } + else if(method == "Fluo F12" ) {spectrum_to_xyz_preset(FluoF12_spect, x, y, z);palet=15; /*tempalet=3000;*/ } + else if(method == "HMI Lamp" ) {spectrum_to_xyz_preset(HMI_spect, x, y, z);palet=16; /*tempalet=4760;*/ } + else if(method == "GTI Lamp" ) {spectrum_to_xyz_preset(GTI_spect, x, y, z);palet=17; /*tempalet=5000;*/ } + else if(method == "JudgeIII Lamp" ) {spectrum_to_xyz_preset(JudgeIII_spect, x, y, z);palet=18; /*tempalet=5100;*/ } + else if(method == "Solux Lamp 3500K" ) {spectrum_to_xyz_preset(Solux3500_spect, x, y, z);palet=19; /*tempalet=3480;*/ } + else if(method == "Solux Lamp 4100K" ) {spectrum_to_xyz_preset(Solux4100_spect, x, y, z);palet=20; /*tempalet=3930;*/ } + else if(method == "Solux Lamp 4700K" ) {spectrum_to_xyz_preset(Solux4700_spect, x, y, z);palet=21; /*tempalet=4700;*/ } + else if(method == "NG Solux Lamp 4700K" ) {spectrum_to_xyz_preset(NG_Solux4700_spect, x, y, z);palet=22; /*tempalet=4480;*/ } + else if(method == "LED LSI Lumelex 2040") {spectrum_to_xyz_preset(NG_LEDLSI2040_spect, x, y, z);palet=23; /*tempalet=2970;*/ } + else if(method == "LED CRS SP12 WWMR16" ) {spectrum_to_xyz_preset(NG_CRSSP12WWMR16_spect, x, y, z);palet=24; /*tempalet=3050;*/ } + else if(method == "Flash 5500K" ) {spectrum_to_xyz_preset(Flash5500_spect, x, y, z);palet=25; /*tempalet=5500;*/ } + else if(method == "Flash 6000K" ) {spectrum_to_xyz_preset(Flash6000_spect, x, y, z);palet=26; /*tempalet=6000;*/ } + else if(method == "Flash 6500K" ) {spectrum_to_xyz_preset(Flash6500_spect, x, y, z);palet=27; /*tempalet=6500;*/ } + else { + // otherwise we use the Temp+Green generic solution + if (temp <= 4000) { + // if temperature is between 2000K and 4000K we use blackbody, because there will be no Daylight reference below 4000K... + // of course, the previous version of RT used the "magical" but wrong formula of U.Fuchs (Ufraw). + spectrum_to_xyz_blackbody(0., 0., temp, x, y, z);palet=28; + } + else { + // from 4000K up to 25000K: using the D illuminant (daylight) which is standard + palet=29; + if (temp<=7000) + x_D = -4.6070e9/(temp*temp*temp) + 2.9678e6/(temp*temp) + 0.09911e3/temp + 0.244063; + else + x_D = -2.0064e9/(temp*temp*temp) + 1.9018e6/(temp*temp) + 0.24748e3/temp + 0.237040; + + y_D = -3.0*x_D*x_D + 2.87*x_D - 0.275; + //calculate D -daylight in function of s0, s1, s2 and temp ==> x_D y_D + //S(lamda)=So(lambda)+m1*s1(lambda)+m2*s2(lambda) + interm=(0.0241+0.2562*x_D-0.734*y_D); + m1=(-1.3515-1.7703*x_D+5.9114*y_D)/interm; + m2=(0.03-31.4424*x_D+30.0717*y_D)/interm; + spectrum_to_xyz_daylight(m1, m2, 0., x, y, z); + xD=x;yD=y; + } + } + + xD=x; yD=y; + double Xwb = xD/yD; + double Ywb = 1.0; + double Zwb = (1.0-xD-yD)/yD; + double correl_temp; + + + if (settings->verbose) { + // double u=4*xD/(-2*xD+12*yD+3); + // double v=6*yD/(-2*xD+12*yD+3); + // printf("xD=%f yD=%f u=%f v=%f\n",xD,yD,u,v); + if(settings->CRI_color != 0) + printf("xD=%f yD=%f === Xwb=%f Ywb=%f Zwb=%f\n",xD,yD,Xwb,Ywb,Zwb); + } + + /*if (isRaw) { + rmul = sRGB_xyz[0][0]*X + sRGB_xyz[0][1]*Y + sRGB_xyz[0][2]*Z; + gmul = sRGB_xyz[1][0]*X + sRGB_xyz[1][1]*Y + sRGB_xyz[1][2]*Z; + bmul = sRGB_xyz[2][0]*X + sRGB_xyz[2][1]*Y + sRGB_xyz[2][2]*Z; + } else {*/ + //recalculate channels multipliers with new values of XYZ tue to whitebalance + rmul = sRGBd65_xyz[0][0]*Xwb + sRGBd65_xyz[0][1]*Ywb + sRGBd65_xyz[0][2]*Zwb; + gmul = sRGBd65_xyz[1][0]*Xwb + sRGBd65_xyz[1][1]*Ywb + sRGBd65_xyz[1][2]*Zwb; + bmul = sRGBd65_xyz[2][0]*Xwb + sRGBd65_xyz[2][1]*Ywb + sRGBd65_xyz[2][2]*Zwb; + //}; + gmul /= green; + + double max = rmul; + if (gmul>max) max = gmul; + if (bmul>max) max = bmul; + rmul /= max; + gmul /= max; + bmul /= max; + + if(palette) // palette of color : 32 skin, 4 grey, 4 blue sky + //calculate L a b in function of color and illuminant + //J.Desmis january 2012 + { + double x_x,y_y,z_z; + // illuminants + const double* spect_illummax[] = { + Daylight5300_spect,Cloudy6200_spect,Shade7600_spect,A2856_spect,FluoF1_spect,FluoF2_spect,FluoF3_spect,FluoF4_spect,FluoF5_spect,FluoF6_spect,FluoF7_spect, + FluoF8_spect,FluoF9_spect,FluoF10_spect,FluoF11_spect,FluoF12_spect,HMI_spect,GTI_spect,JudgeIII_spect,Solux3500_spect,Solux4100_spect,Solux4700_spect,NG_Solux4700_spect,NG_CRSSP12WWMR16_spect,NG_CRSSP12WWMR16_spect, + Flash5500_spect,Flash6000_spect,Flash6500_spect + }; + // color + const double* spec_colorpalet[] = { + ColabSkin98_m2_10_spect, ColabSkin95_0_4_spect,ColabSkin91_4_14_spect, ColabSkin90_m1_20_spect, + ColorchechSGSkiK285_11_17_spect,ColabSkin87_8_8_spect,ColabSkin87_3_10_spect,ColabSkin89_8_21_spect, + ColabSkin70_7_32_spect,ColabSkin77_12_21_spect,ColabSkin75_8_4_spect,ColabSkin75_10_33_spect, + ColorchechSkiB166_18_18_spect,ColabSkin65_7_24_spect,ColorchechSGSkiF763_14_26_spect,ColabSkin65_33_11_spect, + ColabSkin57_19_6_spect,ColabSkin57_4_19_spect,ColabSkin57_10_28_spect,ColabSkin57_22_18_spect, + ColabSkin40_17_17_spect,ColabSkin40_7_19_spect,ColabSkin40_4_11_spect,ColabSkin40_17_6_spect, + ColorchechSkiA138_13_14_spect,ColabSkin33_6_15_spect,ColabSkin35_15_17_spect,ColabSkin33_15_5_spect, + ColabSkin26_18_18_spect,ColabSkin24_7_5_spect,ColabSkin24_5_6_spect,ColabSkin20_4_2_spect, + ColabSky42_0_m24_spect,ColorchechBluC150_m5_m22_spect,ColorchechWhiA496_spect, ColorchechSGBlaN3_6_spect, + JDC468_GraK14_44_spect,ColorchechGraC4_67_spect,ColabSky60_0_m31_spect,ColorchechDCBluN881_m7_m14_spect + //ColabSkin33_10_15_spect, + //ColabSkin81_2_14_spect, + }; + + int N_col = sizeof(spec_colorpalet)/sizeof(spec_colorpalet[0]);//number of color + + if(palet < 28) { + for(int i=0;i=28) { + if(temp<4000) { + for(int i=0;i epsilon + if(xr[i]> epsilon) fx[i]=pow(xr[i],0.333);else fx[i]=(903.3*xr[i]+16.0)/116.0; + if(yr[i]> epsilon) fy[i]=pow(yr[i],0.333);else fy[i]=(903.3*yr[i]+16.0)/116.0; + if(zr[i]> epsilon) fz[i]=pow(zr[i],0.333);else fz[i]=(903.3*zr[i]+16.0)/116.0; + } + //Lab values in function of color and illuminant + //these values can be compared to preview values when using white-balance (skin / sky / BW) + for(int i=0;iCRI_color != 0) printf("Lpal=%2.2f apal=%2.2f bpal=%2.2f\n", Lpal[0],apal[0],bpal[0]);//sample + //} + + } //end palette + + // begin CRI_RT : color rendering index RT - adaptation of CRI by J.Desmis + // CRI = 100 for Blackbody and Daylight + // calculate from spectral data values X, Y, Z , for color of colorchecker24 , SG, DC, JDC_468 + //only for lamp different of tungstene + //first calcul with illuminant (choice) + // and calcul with : blackbody at equivalent temp of lamp + + if(settings->CRI_color != 0) //activate if CRi_color !=0 + // CRI_color-1 = dispaly Lab values of color CRI_color -1 + { + int illum; + int numero_color=settings->CRI_color - 1; + + //spectral data illuminant (actually 21): only those necessary (lamp, fluorescent, LED) others CRI=100 (not Flash...) + const double* spect_illum[] = { + Daylight5300_spect,Cloudy6200_spect,Shade7600_spect,A2856_spect,FluoF1_spect,FluoF2_spect,FluoF3_spect, + FluoF4_spect,FluoF5_spect,FluoF6_spect,FluoF7_spect,FluoF8_spect,FluoF9_spect,FluoF10_spect,FluoF11_spect, + FluoF12_spect,HMI_spect,GTI_spect,JudgeIII_spect,Solux3500_spect,Solux4100_spect,Solux4700_spect, + NG_Solux4700_spect,NG_CRSSP12WWMR16_spect,NG_CRSSP12WWMR16_spect + }; + const double* spec_color[] = { + ColorchechredC3_spect, ColorchechOraA2_spect,ColorchechYelD3_spect,ColorchechGreE2_spect,ColorchechGreB3_spect, + ColorchechCyaF3_spect, ColorchechPurD2_spect,ColorchechMagE3_spect,ColorchechSkiA138_13_14_spect,ColorchechGraC4_67_spect, + ColorchechSkiB166_18_18_spect,ColorchechBluC150_m5_m22_spect,ColorchechDCBluN881_m7_m14_spect,ColorchechSGSkiF763_14_26_spect, + ColorchechSGSkiK285_11_17_spect,ColorchechWhiA496_spect, ColorchechGreD1_spect, ColorchechSGBlaN3_6_spect, + JDC468_GraK14_44_spect,JDC468_BluH10_spect + }; + + int N_c = sizeof(spec_color)/sizeof(spec_color[0]);//number of color + + if (method == "Fluo F1") {CRI_type=true; tempw=6430; illum=1;} + else if (method == "Fluo F2") {CRI_type=true; tempw=4230; illum=2;} + else if (method == "Fluo F3") {CRI_type=true; tempw=3450; illum=3;} + else if (method == "Fluo F4") {CRI_type=true; tempw=2940; illum=4;} + else if (method == "Fluo F5") {CRI_type=true; tempw=6350; illum=5;} + else if (method == "Fluo F6") {CRI_type=true; tempw=4150; illum=6;} + else if (method == "Fluo F7") {CRI_type=true; tempw=6500; illum=7;} + else if (method == "Fluo F8") {CRI_type=true; tempw=5020; illum=8;} + else if (method == "Fluo F9") {CRI_type=true; tempw=4330; illum=9;} + else if (method == "Fluo F10") {CRI_type=true; tempw=5300; illum=10;} + else if (method == "Fluo F11") {CRI_type=true; tempw=4000; illum=11;} + else if (method == "Fluo F12") {CRI_type=true; tempw=3000; illum=12;} + else if (method == "HMI Lamp") {CRI_type=true; tempw=4760; illum=13;} + else if (method == "GTI Lamp") {CRI_type=true; tempw=5000; illum=14;} + else if (method == "JudgeIII Lamp") {CRI_type=true; tempw=5100; illum=15;} + else if (method == "Solux Lamp 3500K") {CRI_type=true; tempw=3480; illum=16;} + else if (method == "Solux Lamp 4100K") {CRI_type=true; tempw=3930; illum=17;} + else if (method == "Solux Lamp 4700K" ) {CRI_type=true; tempw=4700; illum=18;} + else if (method == "NG Solux Lamp 4700K") {CRI_type=true; tempw=4480; illum=19;} + else if (method == "LED LSI Lumelex 2040") {CRI_type=true; tempw=2970; illum=20;} + else if (method == "LED CRS SP12 WWMR16") {CRI_type=true; tempw=3050; illum=21;} + else {CRI_type=false;} + + if (CRI_type) { + for(int i=0;i x_D y_D + //S(lamda)=So(lambda)+m1*s1(lambda)+m2*s2(lambda) + interm2=(0.0241+0.2562*x_DD-0.734*y_DD); + m11=(-1.3515-1.7703*x_DD+5.9114*y_DD)/interm2; + m22=(0.03-31.4424*x_DD+30.0717*y_DD)/interm2; + + for(int i=0;iverbose) { + printf("Correlated temperature (lamp)=%i\n", (int) correl_temp); //use only for lamp...otherwise It give an information!! + } + + double Xwb_bb = x/y;//white balance for blackbody + double Ywb_bb = 1.0; + double Zwb_bb = (1.0-x-y)/y; + + //calculate Matrix CAM02 : better than Von Kries and Bradford==> for Lamp + double adap=1.0; + cieCAT02(Xwb, Ywb, Zwb, CAM02BB00,CAM02BB01,CAM02BB02,CAM02BB10,CAM02BB11,CAM02BB12,CAM02BB20,CAM02BB21,CAM02BB22,adap); + //here new value of X,Y,Z for lamp with chromatic CAM02 adaptation + for(int i=0;i epsilon + if(xr[i]> epsilon) fx[i]=pow(xr[i],0.333);else fx[i]=(903.3*xr[i]+16.0)/116.0; + if(yr[i]> epsilon) fy[i]=pow(yr[i],0.333);else fy[i]=(903.3*yr[i]+16.0)/116.0; + if(zr[i]> epsilon) fz[i]=pow(zr[i],0.333);else fz[i]=(903.3*zr[i]+16.0)/116.0; + } + + for(int i=0;i epsilon) fx[i]=pow(xr[i],0.333);else fx[i]=(903.3*xr[i]+16.0)/116.0; + if(yr[i]> epsilon) fy[i]=pow(yr[i],0.333);else fy[i]=(903.3*yr[i]+16.0)/116.0; + if(zr[i]> epsilon) fz[i]=pow(zr[i],0.333);else fz[i]=(903.3*zr[i]+16.0)/116.0; + } + + for(int i=0;iCRI_color != 0) { + printf("Color Number %i\n",numero_color); + printf("L_refer=%2.2f a=%2.2f b=%2.2f\n", Lbb[numero_color],abb[numero_color],bbb[numero_color]); + printf("L_lamp=%2.2f al=%2.2f bl=%2.2f\n", Llamp[numero_color],alamp[numero_color],blamp[numero_color]); + } + + //then calculate DeltaE CIE 1976 + for(int i=0;i<8;i++) + DeltaEs[i]=sqrt((Lbb[i]-Llamp[i])*(Lbb[i]-Llamp[i])+(abb[i]-alamp[i])*(abb[i]-alamp[i])+(bbb[i]-blamp[i])*(bbb[i]-blamp[i])); + + for(int i=0;i<8;i++) + CRIs[i]=100-3.0*DeltaEs[i]; //3.0 coef to adapt ==> same results than CRI "official" + + for(int i=0;i<8;i++) + CRI_RTs+=CRIs[i]; + CRI_RTs/=8; + + for(int i=0;i<8;i++) + quadCRIs+=(CRIs[i]-CRI_RTs)*(CRIs[i]-CRI_RTs); + quadCRIs/=8; + + for(int i=0;i same results than CRI "official" + + for(int i=0;iCRI_color != 0) { + printf("CRI_standard=%i CRI:1->8=%i %i %i %i %i %i %i %i Sigma=%2.1f\n",(int) CRI_RTs, (int) CRIs[0], (int) CRIs[1],(int) CRIs[2],(int) CRIs[3],(int) CRIs[4],(int) CRIs[5],(int) CRIs[6],(int) CRIs[7],sqrt(quadCRIs)); + printf("CRI_RT_exten=%i CRI:9->20=%i %i %i %i %i %i %i %i %i %i %i %i Sigma=%2.1f\n",(int) CRI_RT,(int) CRI[8],(int) CRI[9], (int) CRI[10],(int) CRI[11],(int) CRI[12],(int) CRI[13],(int) CRI[14],(int) CRI[15],(int) CRI[16],(int) CRI[17],(int) CRI[18],(int) CRI[19],sqrt(quadCRI)); + } + } + } +} +/* J.Desmis october 2012 - CIECAM02 : +I have notably modified the code of Billy Biggs to adapt to RT +The code is update from last works of M.Fairchild +and also gamut correction M.H.Brill S.Susstrunk +*/ + +/** + * Copyright (c) 2003 Billy Biggs + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + +inline void Aab_to_rgb( double &r, double &g, double &b, double A, double aa, double bb, double nbb ) +{ + double x = (A / nbb) + 0.305; + + /* c1 c2 c3 */ + r = (0.32787 * x) + (0.32145 * aa) + (0.20527 * bb); + /* c1 c4 c5 */ + g = (0.32787 * x) - (0.63507 * aa) - (0.18603 * bb); + /* c1 c6 c7 */ + b = (0.32787 * x) - (0.15681 * aa) - (4.49038 * bb); +} + +inline void calculate_ab( double &aa, double &bb, double h, double e, double t, double nbb, double a ) +{ + double hrad = (h * M_PI) / 180.0; + double sinh = sin( hrad ); + double cosh = cos( hrad ); + double x = (a / nbb) + 0.305; + double p3 = 21.0/20.0; + if( fabs( sinh ) >= fabs( cosh ) ) { + bb = ((0.32787 * x) * (2.0 + p3)) / + ((e / (t * sinh)) - + // ((0.32145 - 0.63507 - (p3 * 0.15681)) * (cosh / sinh)) - + // (0.20527 - 0.18603 - (p3 * 4.49038))); + ((-0.31362 - (p3 * 0.15681)) * (cosh / sinh)) - + (0.01924 - (p3 * 4.49038))); + + aa = (bb * cosh) / sinh; + } else { + aa = ((0.32787 * x) * (2.0 + p3)) / + ((e / (t * cosh)) - + // (0.32145 - 0.63507 - (p3 * 0.15681)) - + // ((0.20527 - 0.18603 - (p3 * 4.49038)) * (sinh / cosh))); + (-0.31362 - (p3 * 0.15681)) - + ((0.01924 - (p3 * 4.49038)) * (sinh / cosh))); + + bb = (aa * sinh) / cosh; + } +} +void ColorTemp::xyz2jchqms_ciecam02( double &J, double &C, double &h, double &Q, double &M, double &s,double &aw, double &fl, double &wh, + double x, double y, double z, double xw, double yw, double zw, + double yb, double la, double f, double c, double nc, double pilotd, bool doneinit, int gamu) +{ + double r, g, b; + double rw, gw, bw; + double rc, gc, bc; + double rp, gp, bp; + double rpa, gpa, bpa; + double a, ca, cb; + double d; + double n, nbb, ncb; + double e, t; + double cz; + double myh, myj, myc, myq, mym, mys; + double pfl; + + xyz_to_cat02( r, g, b, x, y, z, gamu ); + xyz_to_cat02( rw, gw, bw, xw, yw, zw, gamu ); + + if(doneinit){//if one day, we have a pipette... + n = yb / yw; + if(pilotd==2.0) d = d_factor( f, la );else d=pilotd; + fl = calculate_fl_from_la_ciecam02( la ); + nbb = ncb = 0.725 * pow( 1.0 / n, 0.2 ); + cz = 1.48 + sqrt( n ); + aw = achromatic_response_to_white( xw, yw, zw, d, fl, nbb, gamu ); + wh =( 4.0 / c ) * ( aw + 4.0 ) * pow( fl, 0.25 ); + pfl = pow( fl, 0.25 ); + doneinit=false; + } + + rc = r * (((yw * d) / rw) + (1.0 - d)); + gc = g * (((yw * d) / gw) + (1.0 - d)); + bc = b * (((yw * d) / bw) + (1.0 - d)); + + ColorTemp::cat02_to_hpe( rp, gp, bp, rc, gc, bc ); + if(gamu==1){//gamut correction M.H.Brill S.Susstrunk + rp=MAXR(rp,0.0); + gp=MAXR(gp,0.0); + bp=MAXR(bp,0.0); + } + rpa = nonlinear_adaptation( rp, fl ); + gpa = nonlinear_adaptation( gp, fl ); + bpa = nonlinear_adaptation( bp, fl ); + + ca = rpa - ((12.0 * gpa) / 11.0) + (bpa / 11.0); + cb = (1.0 / 9.0) * (rpa + gpa - (2.0 * bpa)); + + myh = (180.0 / M_PI) * atan2( cb, ca ); + if( myh < 0.0 ) myh += 360.0; + //we can also calculate H, if necessary...but it's using time...for what usage ? + /*double temp; + if(myh<20.14) { + temp = ((myh + 122.47)/1.2) + ((20.14 - myh)/0.8); + H = 300 + (100*((myh + 122.47)/1.2)) / temp; + } + else if(myh < 90.0) { + temp = ((myh - 20.14)/0.8) + ((90.00 - myh)/0.7); + H = (100*((myh - 20.14)/0.8)) / temp; + } + else if (myh < 164.25) { + temp = ((myh - 90.00)/0.7) + ((164.25 - myh)/1.0); + H = 100 + ((100*((myh - 90.00)/0.7)) / temp); + } + else if (myh < 237.53) { + temp = ((myh - 164.25)/1.0) + ((237.53 - myh)/1.2); + H = 200 + ((100*((myh - 164.25)/1.0)) / temp); + } + else { + temp = ((myh - 237.53)/1.2) + ((360 - myh + 20.14)/0.8); + H = 300 + ((100*((myh - 237.53)/1.2)) / temp); + } + */ + a = ((2.0 * rpa) + gpa + ((1.0 / 20.0) * bpa) - 0.305) * nbb; + if (gamu==1) a=MAXR(a,0.0);//gamut correction M.H.Brill S.Susstrunk + J = 100.0 * pow( a / aw, c * cz ); + + e = ((12500.0 / 13.0) * nc * ncb) * (cos( ((myh * M_PI) / 180.0) + 2.0 ) + 3.8); + t = (e * sqrt( (ca * ca) + (cb * cb) )) / (rpa + gpa + ((21.0 / 20.0) * bpa)); + + C = pow( t, 0.9 ) * sqrt( J / 100.0 ) + * pow( 1.64 - pow( 0.29, n ), 0.73 ); + + Q = wh * sqrt( J / 100.0 ); + M = C * pfl; + s = 100.0 * sqrt( M / Q ); + h = myh; + +} + + +void ColorTemp::jch2xyz_ciecam02( double &x, double &y, double &z, double J, double C, double h, + double xw, double yw, double zw, double yb, double la, + double f, double c, double nc , bool doneinit2, int gamu) +{ + double r, g, b; + double rc, gc, bc; + double rp, gp, bp; + double rpa, gpa, bpa; + double rw, gw, bw; + double fl, d; + double n, nbb, ncb; + double a, ca, cb; + double aw; + double e, t; + double cz; + + ColorTemp::xyz_to_cat02( rw, gw, bw, xw, yw, zw, gamu ); + if(doneinit2){ + n = yb / yw; + d = d_factor( f, la ); + fl = calculate_fl_from_la_ciecam02( la ); + nbb = ncb = 0.725 * pow( 1.0 / n, 0.2 ); + cz = 1.48 + sqrt( n ); + aw = achromatic_response_to_white( xw, yw, zw, d, fl, nbb, gamu ); + doneinit2=false; + } + e = ((12500.0 / 13.0) * nc * ncb) * (cos( ((h * M_PI) / 180.0) + 2.0 ) + 3.8); + a = pow( J / 100.0, 1.0 / (c * cz) ) * aw; + t = pow( C / (sqrt( J / 100) * pow( 1.64 - pow( 0.29, n ), 0.73 )), 10.0 / 9.0 ); + + calculate_ab( ca, cb, h, e, t, nbb, a ); + Aab_to_rgb( rpa, gpa, bpa, a, ca, cb, nbb ); + + rp = inverse_nonlinear_adaptation( rpa, fl ); + gp = inverse_nonlinear_adaptation( gpa, fl ); + bp = inverse_nonlinear_adaptation( bpa, fl ); + + ColorTemp::hpe_to_xyz( x, y, z, rp, gp, bp ); + ColorTemp::xyz_to_cat02( rc, gc, bc, x, y, z, gamu ); + + r = rc / (((yw * d) / rw) + (1.0 - d)); + g = gc / (((yw * d) / gw) + (1.0 - d)); + b = bc / (((yw * d) / bw) + (1.0 - d)); + + ColorTemp::cat02_to_xyz( x, y, z, r, g, b, gamu ); +} + + +//end CIECAM Billy Bigg + + + + + /* Calculate Planck's radiation */ @@ -78,12 +2161,63 @@ double ColorTemp::blackbody_spect(double wavelength, double m1, double m2, doubl (exp(1.438786e-2 / (wlm * temp)) - 1.0); //1.4387..= c2 = h*c/k where k=Boltzmann constant } -void ColorTemp::spectrum_to_xyz(double (*spec_intens)(double wavelength, double m1, double m2, double temp), double _m1, double _m2, double _temp, double &x, double &y, double &z) +/* +The next 3 methods are inspired from: + + a) Colour Rendering of Spectra by John Walker + http://www.fourmilab.ch/ + This program is in the public domain. + + b) Bruce Lindbloom + Adapted to Rawtherapee by J.Desmis + +this values are often called xBar yBar zBar and are characteristics of a color / illuminant + +values cie_colour_match[][3] = Observer 2° x2, y2, z2 +E.g. for 380nm: x2=0.001368 y2=0.000039 z2=0.006451 round in J.Walker to 0.0014 0.0000 0.0065 above +I have increase precision used by J.Walker and pass to 350nm to 830nm +*/ + +void ColorTemp::spectrum_to_xyz_daylight(double _m1, double _m2, double _temp, double &x, double &y, double &z) { int i; double lambda, X = 0, Y = 0, Z = 0, XYZ; -/* + for (i=0, lambda=350.; lambda<830.1; i++, lambda+=5.) { + double Me = daylight_spect(lambda, _m1, _m2, _temp); + X += Me * cie_colour_match_jd[i][0]; + Y += Me * cie_colour_match_jd[i][1]; + Z += Me * cie_colour_match_jd[i][2]; + } + XYZ = (X + Y + Z); + x = X / XYZ; + y = Y / XYZ; + z = Z / XYZ; +} + +void ColorTemp::spectrum_to_xyz_blackbody(double _m1, double _m2, double _temp, double &x, double &y, double &z) +{ + int i; + double lambda, X = 0, Y = 0, Z = 0, XYZ; + + for (i=0, lambda=350.; lambda<830.1; i++, lambda+=5.) { + double Me = blackbody_spect(lambda, _m1, _m2, _temp); + X += Me * cie_colour_match_jd[i][0]; + Y += Me * cie_colour_match_jd[i][1]; + Z += Me * cie_colour_match_jd[i][2]; + } + XYZ = (X + Y + Z); + x = X / XYZ; + y = Y / XYZ; + z = Z / XYZ; +} + +void ColorTemp::spectrum_to_xyz_preset(const double* spec_intens, double &x, double &y, double &z) +{ + int i; + double lambda, X = 0, Y = 0, Z = 0, XYZ; + + /* Inspired from: a) Colour Rendering of Spectra by John Walker @@ -91,59 +2225,19 @@ void ColorTemp::spectrum_to_xyz(double (*spec_intens)(double wavelength, double This program is in the public domain. b) Bruce Lindbloom - Adapted to Rawtherapee by J.Desmis + Adapted to RawTherapee by J.Desmis this values are often called xBar yBar zBar and are characteristics of a color / illuminant values cie_colour_match[][3] = Observer 2° x2, y2, z2 - E.g. for 380nm: x2=0.001368 y2=0.000039 z2=0.00645 round in J.Walker to 0.0014 0.0000 0.0065 above - I have increase precision used by J.Walker and pass to 350nm to 830nm -*/ - - static const double cie_colour_match[97][3] = {//350nm to 830nm - {0.0000000,0.000000,0.000000}, {0.0000000,0.000000,0.000000}, {0.0001299,0.000392,0.000606}, - {0.0002321,0.000007,0.001086}, {0.0004149,0.000012,0.001946}, {0.0007416,0.000022,0.003846}, - {0.001368,0.000039,0.006450}, {0.002236,0.000064,0.010550}, {0.004243,0.000120,0.020050}, - {0.007650,0.000217,0.036210}, {0.014310,0.000396,0.067850}, {0.023190,0.000640,0.110200}, - {0.043510,0.001210,0.207400}, {0.077630,0.002180,0.371300}, {0.134380,0.004000,0.645600}, - {0.214770,0.007300,1.039050}, {0.283900,0.011600,1.385600}, {0.328500,0.016840,1.622960}, - {0.348280,0.023000,1.747100}, {0.348060,0.029800,1.782600}, {0.336200,0.038000,1.772110}, - {0.318700,0.048000,1.744100}, {0.290800,0.060000,1.669200}, {0.251100,0.073900,1.528100}, - {0.195360,0.090980,1.287640}, {0.142100,0.112600,1.041900}, {0.095640,0.139020,0.812950}, - {0.057950,0.169300,0.616200}, {0.032010,0.208020,0.465180}, {0.014700,0.258600,0.353300}, - {0.004900,0.323000,0.272000}, {0.002400,0.407300,0.212300}, {0.009300,0.503000,0.158200}, - {0.029100,0.608200,0.111700}, {0.063270,0.710000,0.078250}, {0.109600,0.793200,0.057250}, - {0.165500,0.862000,0.042160}, {0.225750,0.914850,0.029840}, {0.290400,0.954000,0.020300}, - {0.359700,0.980300,0.013400}, {0.433450,0.994950,0.008750}, {0.512050,1.000000,0.005750}, - {0.594500,0.995000,0.003900}, {0.678400,0.978600,0.002750}, {0.762100,0.952000,0.002100}, - {0.842500,0.915400,0.001800}, {0.916300,0.870000,0.001650}, {0.978600,0.816300,0.001400}, - {1.026300,0.757000,0.001100}, {1.056700,0.694900,0.001000}, {1.062200,0.631000,0.000800}, - {1.045600,0.566800,0.000600}, {1.002600,0.503000,0.000340}, {0.938400,0.441200,0.000240}, - {0.854450,0.381000,0.000190}, {0.751400,0.321000,0.000100}, {0.642400,0.265000,0.000050}, - {0.541900,0.217000,0.000030}, {0.447900,0.175000,0.000020}, {0.360800,0.138200,0.000010}, - {0.283500,0.107000,0.000000}, {0.218700,0.081600,0.000000}, {0.164900,0.061000,0.000000}, - {0.121200,0.044580,0.000000}, {0.087400,0.032000,0.000000}, {0.063600,0.023200,0.000000}, - {0.046770,0.017000,0.000000}, {0.032900,0.011920,0.000000}, {0.022700,0.008210,0.000000}, - {0.015840,0.005723,0.000000}, {0.011359,0.004102,0.000000}, {0.008111,0.002929,0.000000}, - {0.005790,0.002091,0.000000}, {0.004109,0.001484,0.000000}, {0.002899,0.001047,0.000000}, - {0.002049,0.000740,0.000000}, {0.001440,0.000520,0.000000}, {0.001000,0.000361,0.000000}, - {0.000690,0.000249,0.000000}, {0.000476,0.000172,0.000000}, {0.000332,0.000120,0.000000}, - {0.000235,0.000085,0.000000}, {0.000166,0.000060,0.000000}, {0.000117,0.000042,0.000000}, - {0.000083,0.000030,0.000000}, {0.000059,0.000021,0.000000}, {0.000042,0.000015,0.000000}, - {0.000029,0.000011,0.000000}, {0.000021,0.000007,0.000000}, {0.000015,0.000005,0.000000}, - {0.000010,0.000004,0.000000}, {0.000007,0.000003,0.000000}, {0.000005,0.000002,0.000000}, - {0.000004,0.000001,0.000000}, {0.000003,0.000001,0.000000}, {0.000002,0.000001,0.000000}, - {0.000001,0.000001,0.000000} - }; - - for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { - - double Me; - - Me = (*spec_intens)(lambda, _m1, _m2, _temp); - X += Me * cie_colour_match[i][0]; - Y += Me * cie_colour_match[i][1]; - Z += Me * cie_colour_match[i][2]; + E.g. for 380nm: x2=0.001368 y2=0.000039 z2=0.006451 round in J.Walker to 0.0014 0.0000 0.0065 above + I have increased the precision used by J.Walker and pass from 350nm to 830nm + */ + for (i=0, lambda=350.; lambda<830.1; i++, lambda+=5.) { + double Me = get_spectral_color(lambda, spec_intens); + X += Me * cie_colour_match_jd[i][0]; + Y += Me * cie_colour_match_jd[i][1]; + Z += Me * cie_colour_match_jd[i][2]; } XYZ = (X + Y + Z); x = X / XYZ; @@ -151,6 +2245,93 @@ void ColorTemp::spectrum_to_xyz(double (*spec_intens)(double wavelength, double z = Z / XYZ; } +//calculate XYZ from spectrum data (color) and illuminant : J.Desmis December 2011 +void ColorTemp::spectrum_to_color_xyz_preset(const double* spec_color, const double* spec_intens, double &xx, double &yy, double &zz) +{ + int i; + double lambda, X = 0, Y = 0, Z = 0, Yo=0; + for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { + + double Me; + double Mc; + + Me = get_spectral_color(lambda, spec_color); + Mc = get_spectral_color(lambda, spec_intens); + X += Mc * cie_colour_match_jd[i][0] * Me; + Y += Mc * cie_colour_match_jd[i][1] * Me; + Z += Mc * cie_colour_match_jd[i][2] * Me; + } + for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { + + double Ms; + + Ms = get_spectral_color(lambda, spec_intens); + Yo += cie_colour_match_jd[i][1] * Ms; + } + + xx = X / Yo; + yy = Y / Yo; + zz = Z / Yo; +} + +//calculate XYZ from spectrum data (color) and illuminant : J.Desmis december 2011 +void ColorTemp::spectrum_to_color_xyz_daylight(const double* spec_color, double _m1, double _m2, double _temp, double &xx, double &yy, double &zz) +{ + int i; + double lambda, X = 0, Y = 0, Z = 0, Yo=0; + for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { + + double Me; + double Mc; + + Me = get_spectral_color(lambda, spec_color); + Mc = daylight_spect(lambda,_m1, _m2, _temp); + X += Mc * cie_colour_match_jd[i][0] * Me; + Y += Mc * cie_colour_match_jd[i][1] * Me; + Z += Mc * cie_colour_match_jd[i][2] * Me; + } + for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { + + double Ms; + + Ms = daylight_spect(lambda,_m1, _m2, _temp); + Yo += cie_colour_match_jd[i][1] * Ms; + } + + xx = X / Yo; + yy = Y / Yo; + zz = Z / Yo; +} + +//calculate XYZ from spectrum data (color) and illuminant : J.Desmis december 2011 +void ColorTemp::spectrum_to_color_xyz_blackbody(const double* spec_color, double _m1, double _m2, double _temp, double &xx, double &yy, double &zz) +{ + int i; + double lambda, X = 0, Y = 0, Z = 0, Yo=0; + for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { + + double Me; + double Mc; + + Me = get_spectral_color(lambda, spec_color); + Mc = blackbody_spect(lambda,_m1, _m2, _temp); + X += Mc * cie_colour_match_jd[i][0] * Me; + Y += Mc * cie_colour_match_jd[i][1] * Me; + Z += Mc * cie_colour_match_jd[i][2] * Me; + } + for (i = 0, lambda = 350; lambda < 830.1; i++, lambda += 5) { + + double Ms; + + Ms = blackbody_spect(lambda,_m1, _m2, _temp); + Yo += cie_colour_match_jd[i][1] * Ms; + } + + xx = X / Yo; + yy = Y / Yo; + zz = Z / Yo; +} + double ColorTemp::daylight_spect(double wavelength, double m1, double m2, double temp) { //Values for Daylight illuminant: s0 s1 s2 @@ -173,417 +2354,6 @@ double ColorTemp::daylight_spect(double wavelength, double m1, double m2, double return (s0[wlm]+m1*s1[wlm]+m2*s2[wlm]); } -// spectral data for Daylight direct Sun: I have choose 5300K beacuse Nikon=5200K, Olympus=5300K, Panasonic=5500K, Leica=5400K, Minolta=5100K -double ColorTemp::Daylight5300_spect(double wavelength, double m1, double m2, double temp) -{ - static const double Su53[97]={24.82,26.27,27.72,28.97,30.22,29.71,29.19,31.95,34.71,45.49,56.26,59.97,63.68,65.30,66.92,65.39,63.86,72.59,81.32,87.53,93.73,95.15,96.56,96.55,96.54,98.13,99.73,97.70,95.66,97.19,98.72, - 98.90,99.08,98.98,98.87,101.13,103.39,102.48,101.57,102.14,102.71,101.36,100.00,98.71,97.42,97.81,98.21,95.20,92.20,93.92,95.63,96.15,96.67,96.34,96.01,94.21,92.41,93.58,94.74,93.05,91.36,92.29, - 93.21,95.25,97.28,95.30,93.32,87.92,82.51,84.29,86.06,86.94,87.81,80.24,72.68,77.32,81.96,84.88,87.79,81.01,74.22,64.41,54.60,66.55,78.51,76.35,74.20,74.79,75.38,72.48,69.58,65.11,60.64, - 63.88,67.13,68.85,70.57}; - int wlm = (int) ((wavelength -350.)/5.); - return (Su53[wlm]); } -//spectral data for Daylight Cloudy: I have choose 6200K beacuse Nikon=6000K, Olympus=6000K, Panasonic=6200K, Leica=6400K, Minolta=6500K -double ColorTemp::Cloudy6200_spect(double wavelength, double m1, double m2, double temp) -{ - static const double Clo62[97]={39.50,40.57,41.63,43.85,46.08,45.38,44.69,47.20,49.71,63.06,76.41,80.59,84.77,85.91,87.05,84.14,81.23,90.29,99.35,105.47,111.58,112.23,112.87,111.74,110.62,111.41,112.20,108.98,105.76,106.32, - 106.89,106.34,105.79,104.62,103.45,105.09,106.72,105.24,103.76,103.75,103.75,101.87,100.00,98.29,96.58,96.46,96.34,92.85,89.37,90.25,91.12,91.06,90.99,90.17,89.35,87.22,85.10,85.48,85.85, - 84.03,82.20,82.45,82.69,83.92,85.15,83.14,81.13,76.65,72.17,73.27,74.36,75.65,76.95,70.34,63.74,67.98,72.22,74.88,77.54,71.59,65.65,56.82,47.99,58.53,69.06,67.27,65.47,65.96,66.44,63.92,61.41,57.52, - 53.63,56.47,59.31,60.80,62.29}; - - int wlm = (int) ((wavelength -350.)/5.); - return (Clo62[wlm]); -} - -//spectral data for Daylight Shade: I have choose 7600K beacuse Nikon=8000K, Olympus=7500K, Panasonic=7500K, Leica=7500K, Minolta=7500K -double ColorTemp::Shade7600_spect(double wavelength, double m1, double m2, double temp) -{ - static const double Sha76[97]={64.42,64.46,64.51,68.35,72.20,70.22,68.24,69.79,71.35,87.49,103.64,108.68,113.72,114.12,114.53,109.54,104.55,113.59,122.63,128.52,134.41,134.02,133.63,131.02,128.41,128.08,127.75,123.16, - 118.57,117.89,117.22,115.72,114.22,111.60,108.99,109.84,110.68,108.57,106.45,105.71,104.98,102.49,100.00,97.78,95.55,94.82,94.08,90.47,86.87,86.94,87.01,86.45,85.88,84.57,83.27,80.83,78.40,78.21, - 78.03,76.22,74.42,74.15,73.89,74.41,74.92,73.01,71.09,67.26,63.42,64.01,64.60,66.10,67.60,61.83,56.06,59.94,63.82,66.27,68.71,63.49,58.26,50.30,42.34,51.64,60.95,59.45,57.95,58.35,58.76,56.57, - 54.38,51.00,47.62,50.10,52.58,53.88,55.19}; - - int wlm = (int) ((wavelength -350.)/5.); - return (Sha76[wlm]); -} - -//spectral data for tungsten - incandescent 2856K -double ColorTemp::A2856_spect(double wavelength, double m1, double m2, double temp) -{ - static const double A2856[97]={4.75,5.42,6.15,6.95,7.83,8.78,9.80,10.91,12.09,13.36,14.72,16.16,17.69,19.30,21.01,22.80,24.68,26.65,28.71,30.86,33.10,35.42,37.82,40.31,42.88,45.53,48.25,51.05,53.92,56.87,59.87,62.94,66.07,69.26,72.50, - 75.80,79.14,82.53,85.95,89.42,92.91,96.44,100.00,103.58,107.18,110.80,114.43,118.07,121.72,125.38,129.03,132.68,136.33,139.97,143.60,147.21,150.81,154.39,157.95,161.48,164.99,168.47,171.92,175.34, - 178.72,182.07,185.38,188.65,191.88,195.06,198.20,201.30,204.34,207.34,210.29,213.19,216.04,218.84,221.58,224.28,226.91,229.49,232.02,234.49,236.91,239.27,241.57,243.82,246.01,248.14,250.21,252.23,254.19, - 256.10,257.95,259.74,261.47}; - - int wlm = (int) ((wavelength -350.)/5.); - return (A2856[wlm]); -} - -//spectral data for fluo F1 Daylight 6430K -double ColorTemp::FluoF1_spect(double wavelength, double m1, double m2, double temp) -{ - static const double fluoF1[97]={0.0,0.0,0.0,0.0,0.0,0.0,1.87,2.36,2.94,3.47,5.17,19.49,6.13,6.24,7.01,7.79,8.56,43.67,16.94,10.72,11.35,11.89,12.37,12.75,13.00,13.15,13.23,13.17,13.13,12.85,12.52, - 12.20,11.83,11.50,11.22,11.05,11.03,11.18,11.53,27.74,17.05,13.55,14.33,15.01,15.52,18.29,19.55,15.48,14.91,14.15,13.22,12.19,11.12,10.03,8.95,7.96,7.02,6.20,5.42,4.73,4.15,3.64,3.20,2.81, - 2.47,2.18,1.93,1.72,1.67,1.43,1.29,1.19,1.08,0.96,0.88,0.81,0.77,0.75,0.73,0.68,0.69,0.64,0.68,0.69,0.61,0.52,0.43,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (fluoF1[wlm]); -} - -//spectral data for fluo F2 Cool white 4230K -double ColorTemp::FluoF2_spect(double wavelength, double m1, double m2, double temp) -{ - static const double fluoF2[97]={0.0,0.0,0.0,0.0,0.0,0.0,1.18,1.48,1.84,2.15,3.44,15.69,3.85,3.74,4.19,4.62,5.06,34.98,11.81,6.27,6.63,6.93,7.19,7.40,7.54,7.62,7.65,7.62,7.62,7.45,7.28,7.15,7.05,7.04,7.16,7.47,8.04,8.88,10.01,24.88,16.64,14.59,16.16,17.60,18.62,21.47,22.79,19.29,18.66,17.73,16.54,15.21,13.80,12.36,10.95,9.65,8.40,7.32,6.31,5.43,4.68,4.02,3.45, - 2.96,2.55,2.19,1.89,1.64,1.53,1.27,1.10,0.99,0.88,0.76,0.68,0.61,0.56,0.54,0.51,0.47,0.47,0.43,0.46,0.47,0.40,0.33,0.27,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (fluoF2[wlm]); -} - -//spectral data for fluo F3 White 3450K -double ColorTemp::FluoF3_spect(double wavelength, double m1, double m2, double temp) -{ - static const double fluoF3[97]={0.0,0.0,0.0,0.0,0.0,0.0,0.82,1.02,1.26,1.44,2.57,14.36,2.70,2.45,2.73,3.00,3.28,31.85,9.47,4.02,4.25,4.44,4.59,4.72,4.80,4.86,4.87,4.85,4.88,4.77,4.67,4.62,4.62,4.73,4.99,5.48,6.25, - 7.34,8.78,23.82,16.14,14.59,16.63,18.49,19.95,23.11,24.69,21.41,20.85,19.93,18.67,17.22,15.65,14.04,12.45,10.95,9.51,8.27,7.11,6.09,5.22,4.45,3.80,3.23,2.75,2.33,1.99,1.70,1.55, - 1.27,1.09,0.96,0.83,0.71,0.62,0.54,0.49,0.46,0.43,0.39,0.39,0.35,0.38,0.39,0.33,0.28,0.21,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (fluoF3[wlm]); -} - -//spectral data for fluo F4 Warm white 2940K -double ColorTemp::FluoF4_spect(double wavelength, double m1, double m2, double temp) -{ - static const double fluoF4[97]={0.0,0.0,0.0,0.0,0.0,0.0,0.57,0.70,0.87,0.98,2.01,13.75,1.95,1.59,1.76,1.93,2.10,30.28,8.03,2.55,2.70,2.82,2.91,2.99,3.04,3.08,3.09,3.09,3.14,3.06,3.00,2.98,3.01, - 3.14,3.41,3.90,4.69,5.81,7.32,22.59,15.11,13.88,16.33,18.68,20.64,24.28,26.26,23.28,22.94,22.14,20.91,19.43,17.74,16.00,14.42,12.56,10.93,9.52,8.18,7.01,6.00,5.11,4.36,3.69,3.13,2.64, - 2.24,1.91,1.70,1.39,1.18,1.03,0.88,0.74,0.64,0.54,0.49,0.46,0.42,0.37,0.37,0.33,0.35,0.36,0.31,0.26,0.19,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (fluoF4[wlm]); -} - -//spectral data for fluo F5 Daylight 6350K -double ColorTemp::FluoF5_spect(double wavelength, double m1, double m2, double temp) -{ - static const double fluoF5[97]={0.0,0.0,0.0,0.0,0.0,0.0,1.87,2.35,2.92,3.45,5.10,18.91,6.00,6.11,6.85,7.58,8.31,40.76,16.06,10.32,10.91,11.40,11.83,12.17,12.40,12.54,12.58,12.52,12.47,12.20,11.89, - 11.61,11.33,11.10,10.96,10.97,11.16,11.54,12.12,27.78,17.73,14.47,15.20,15.77,16.10,18.54,19.50,15.39,14.64,13.72,12.69,11.57,10.45,9.35,8.29,7.32,6.41,5.63,4.90,4.26, - 3.72,3.25,2.83,2.49,2.19,1.93,1.71,1.52,1.43,1.26,1.13,1.05,0.96,0.85,0.78,0.72,0.68,0.67,0.65,0.61,0.62,0.59,0.62,0.64,0.55,0.47,0.40,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (fluoF5[wlm]); -} - -//spectral data for fluo F6 Lite white 4150K -double ColorTemp::FluoF6_spect(double wavelength, double m1, double m2, double temp) -{ - static const double fluoF6[97]={0.0,0.0,0.0,0.0,0.0,0.0,1.05,1.31,1.63,1.90,3.11,14.8,3.43,3.30,3.68,4.07,4.45,32.61,10.74,5.48,5.78,6.03,6.25,6.41,6.52,6.58,6.59,6.56,6.56,6.42,6.28,6.20,6.19,6.30,6.60,7.12,7.94,9.07,10.49,25.22,17.46,15.63,17.22,18.53, - 19.43,21.97,23.01,19.41,18.56,17.42,16.09,14.64,13.15,11.68,10.25,8.96,7.74,6.69,5.71,4.87,4.16,3.55,3.02,2.57,2.20,1.87,1.60,1.37,1.29,1.05,0.91,0.81,0.71,0.61,0.54,0.48,0.44, - 0.43,0.40,0.37,0.38,0.35,0.39,0.41,0.33,0.26,0.21,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (fluoF6[wlm]); -} - -//spectral data for fluo F7 D65 Daylight simulator 6500K -double ColorTemp::FluoF7_spect(double wavelength, double m1, double m2, double temp) -{ - static const double fluoF7[97]={0.0,0.0,0.0,0.0,0.0,0.0,2.56,3.18,3.84,4.53,6.15,19.37,7.37,7.05,7.71,8.41,9.15,44.14,17.52,11.35,12.00,12.58,13.08,13.45,13.71,13.88,13.95,13.93,13.82,13.64,13.43,13.25,13.08,12.93,12.78,12.60, - 12.44,12.33,12.26,29.52,17.05,12.44,12.58,12.72,12.83,15.46,16.75,12.83,12.67,12.43,12.19,11.89,11.60,11.35,11.12,10.95,10.76,10.42,10.11,10.04,10.02,10.11,9.87,8.65,7.27,6.44,5.83,5.41, - 5.04,4.57,4.12,3.77,3.46,3.08,2.73,2.47,2.25,2.06,1.90,1.75,1.62,1.54,1.45,1.32,1.17,0.99,0.81,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (fluoF7[wlm]); -} - -//spectral data for fluo F8 D50 simulator Sylvania F40 Design 5000K -double ColorTemp::FluoF8_spect(double wavelength, double m1, double m2, double temp) -{ - static const double fluoF8[97]={0.0,0.0,0.0,0.0,0.0,0.0,1.21,1.5,1.81,2.13,3.17,13.08,3.83,3.45,3.86,4.42,5.09,34.1,12.42,7.68,8.60,9.46,10.24,10.84,11.33,11.71,11.98,12.17,12.28,12.32,12.35,12.44,12.55,12.68,12.77,12.72, - 12.60,12.43,12.22,28.96,16.51,11.79,11.76,11.77,11.84,14.61,16.11,12.34,13.61,13.87,14.07,14.20,14.16,14.13,14.34,14.50,14.46,14.00,12.58,10.99,9.98,9.22,8.62,8.07,7.39,6.71,6.16,5.63,5.03,4.46,4.02,3.66, - 3.36,3.09,2.85,2.65,2.51,2.37,2.15,1.89,1.61,1.32,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (fluoF8[wlm]); -} - -//spectral data for fluo F9 Cool white deluxe 4150K -double ColorTemp::FluoF9_spect(double wavelength, double m1, double m2, double temp) -{ - static const double fluoF9[97]={0.0,0.0,0.0,0.0,0.0,0.0,0.9,1.12,1.36,1.60,2.59,12.8,3.05,2.56,2.86,3.30,3.82,32.62,10.77,5.84,6.57,7.25,7.86,8.35,8.75,9.06,9.31,9.48,9.61,9.68,10.04,10.26,10.48,10.63,10.76,10.96, - 11.18,27.71,16.29,12.28,12.74,13.21,13.65,16.57,18.14,14.55,14.65,14.66,14.61,14.50,14.39,14.40,14.47,14.62,14.72,14.55,14.4,14.58,14.88,15.51,15.47,13.20,10.57,9.18,8.25,7.57,7.03, - 6.35,5.72,5.25,4.80,4.29,3.80,3.43,3.12,2.86,2.64,2.43,2.26,2.14,2.02,1.83,1.61,1.38,1.12,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (fluoF9[wlm]); -} - -//spectral data for fluo F10 Philips TL85 - 5000K -double ColorTemp::FluoF10_spect(double wavelength, double m1, double m2, double temp) -{ - static const double fluoF10[97]={0.0,0.0,0.0,0.0,0.0,0.0,1.11,0.63,0.62,0.57,1.48,12.16,2.12,2.70,3.74,5.14,6.75,34.39,14.86,10.4,10.76,10.11,9.27,8.29,7.29,7.91,16.64,16.73,10.44,5.94,3.34,2.35,1.88,1.59,1.47, - 1.80,5.71,40.98,73.69,33.61,8.24,3.38,2.47,4.86,11.45,14.79,12.16,8.97,6.52,8.81,44.12,34.55,12.09,12.15,10.52,4.43,1.95,2.19,3.19,2.77,2.29,2.00,1.52,1.35,1.47,1.79,1.74,1.02,1.14, - 3.32,4.49,2.05,0.49,0.24,0.21,0.21,0.24,0.24,0.21,0.17,0.21,0.22,0.17,0.12,0.09,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (fluoF10[wlm]); -} - -//spectral data for fluo F11 Philips TL84 4150K -double ColorTemp::FluoF11_spect(double wavelength, double m1, double m2, double temp) -{ - static const double fluoF11[97]={0.0,0.0,0.0,0.0,0.0,0.0,0.91,0.63,0.46,0.37,1.29,12.68,1.59,1.79,2.46,3.38,4.49,33.94,12.13,6.95,7.19,7.12,6.72,6.13,5.46,4.79,5.66,14.29,14.96,8.97,4.72,2.33,1.47,1.10,0.89,0.83,1.18,4.90,39.59, - 72.84,32.61,7.52,2.83,1.96,1.67,4.43,11.28,14.76,12.73,9.74,7.33,9.72,55.27,42.58,13.18,13.16,12.26,5.11,2.07,2.34,3.58,3.01,2.48,2.14,1.54,1.33,1.46,1.94,2.00,1.20,1.35,4.10,5.58, - 2.51,0.57,0.27,0.23,0.21,0.24,0.24,0.20,0.24,0.32,0.26,0.16,0.12,0.09,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (fluoF11[wlm]); -} - -//spectral data for fluo F12 Philips TL83 3000K -double ColorTemp::FluoF12_spect(double wavelength, double m1, double m2, double temp) -{ - static const double fluoF12[97]={0.0,0.0,0.0,0.0,0.0,0.0,0.96,0.64,0.45,0.33,1.19,12.48,1.12,0.94,1.08,1.37,1.78,29.05,7.90,2.65,2.71,2.65,2.49,2.33,2.10,1.91,3.01,10.83,11.88,6.88,3.43,1.49,0.92,0.71,0.60,0.63,1.10,4.56,34.4,65.40,29.48, - 7.16,3.08,2.47,2.27,5.09,11.96,15.32,14.27,11.86,9.28,12.31,68.53,53.02,14.67,14.38,14.71,6.46,2.57,2.75,4.18,3.44,2.81,2.42,1.64,1.36,1.49,2.14,2.34,1.42,1.61,5.04,6.98,3.19,0.71,0.30,0.26,0.23,0.28,0.28,0.21, - 0.17,0.21,0.19,0.15,0.10,0.05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (fluoF12[wlm]); -} - -//spectral data for HMI lamp studio "Osram" 4800K (for film, spectacle, studio...) -double ColorTemp::HMI_spect(double wavelength, double m1, double m2, double temp) -{ - static const double Hmi[97]={0.0,0.0,0.0,0.0,0.0,0.0,9.66,11.45,13.24,14.93,16.63,17.90,19.20,20.12,21.03,23.84,26.65,26.38,26.12,26.52,27.92,31.15,34.37,34.98,35.61,35.71,35.81,34.90,34.02,34.06,34.08,34.68,35.28,34.72,34.20,33.63, - 33.05,34.70,36.35,38.01,39.48,37.29,35.10,36.22,37.28,38.76,40.24,39.56,38.90,39.35,39.79,38.90,38.01,38.05,38.10,37.45,36.64,35.82,35.00,35.06,33.13,33.85,34.55,35.26,35.77,34.92, - 34.09,33.40,32.72,32.08,31.45,26.83,22.23,21.50,20.79,21.41,22.03,11.01,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (Hmi[wlm]); -} - -//spectral data for GTI lamp : Graphiclite & ColorMatch for Photography 5000K -double ColorTemp::GTI_spect(double wavelength, double m1, double m2, double temp) -{ - static const double Gti[97]={0.0,0.0,0.0,0.0,0.0,0.0,3.26,4.71,6.17,12.71,19.27,20.53,21.80,19.15,16.53,28.25,39.97,48.52,57.06,43.66,30.27,30.22,30.16,31.48,32.98,34.01,35.04,35.83,36.62,37.12,37.62,37.99,38.19,38.29,38.48, - 38.82,39.16,45.40,51.63,51.83,62.04,52.41,42.80,42.95,43.09,45.64,48.20,46.23,44.27,43.74,43.22,43.30,43.41,43.10,42.78,42.03,41.29,40.29,39.29,37.89,36.58,34.92,33.27,31.47,29.68,27.90, - 26.13,24.55,22.98,21.42,19.86,18.40,16.92,14.46,13.99,12.36,11.73,5.86,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (Gti[wlm]); -} - -//spectral data for JudgeIII Lamp D50 -double ColorTemp::JudgeIII_spect(double wavelength, double m1, double m2, double temp) -{ - static const double Jud[97]={0.0,0.0,0.0,0.0,0.0,0.0,4.08,4.25,4.43,6.90,9.40,9.75,10.11,9.30,8.54,14.90,21.16,26.01,30.83,24.90,19.00,19.00,19.00,19.56,20.13,20.28,20.44,20.64,20.85,21.05,21.24,21.65,22.11,22.85,23.58,24.00,24.43, - 27.75,31.27,33.90,36.59,30.90,25.32,25.05,24.76,26.03,27.31,25.90,24.48,23.85,23.29,23.10,22.94,23.24,23.53,24.02,24.52,23.80,23.13,24.51,25.76,27.90,29.15,24.70,20.25,16.60,12.98,11.63,10.27,9.30,8.34, - 7.60,6.91,6.25,5.67,5.15,4.68,2.34,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (Jud[wlm]); -} - -//spectral data for Solux lamp : 3500K -double ColorTemp::Solux3500_spect(double wavelength, double m1, double m2, double temp) -{ - static const double Solux35[97]={0.5268,0.93,1.3278,1.51,1.6987,2.65,3.6100,3.80,3.9927,6.08,8.1680,11.02,13.863,15.66,17.4600,18.78,20.130,21.43,22.749,24.02,25.290,27.40,29.504,31.77,34.031,36.35,38.672,40.55,42.426,44.15,45.865,47.37,48.879, - 49.71,50.531,51.2,51.872,51.9,51.928,52.97,54.015,55.93,57.846,60.25,62.650,64.36,66.065,66.72,67.369,68.81,70.260,71.37,72.487,72.53,72.578,72.51,72.447,72.46,72.471, - 72.76,73.047,74.25,75.449,76.5,77.543,78.79,80.040,80.72,81.394,82.12,82.840,83.23,83.614,83.36,83.100,82.36,81.615,80.11,78.606,75.91,73.221,69.61,66.006,62.43,58.844,56.07,53.292, - 51.07,48.839,46.93,45.013,43.54,42.070,40.61,39.150,37.79,36.425}; - - int wlm = (int) ((wavelength -350.)/5.); - return (Solux35[wlm]); -} - -//spectral data for Solux lamp : 4100K -double ColorTemp::Solux4100_spect(double wavelength, double m1, double m2, double temp) -{ - static const double Solux41[97]={0.5717,0.70,0.8286,1.16,1.522,2.01,2.384,3.45,4.57,6.46,8.4548,11.31,14.205,16.10,17.949,19.51,21.068,22.60,24.197,25.37,26.566,28.15,29.742,30.90,32.060,33.26,34.481,34.80,35.130,35.42,35.697,36.20,36.763, - 37.90,39.004,40.26,41.494,43.10,44.690,45.80,46.900,47.45,47.885,47.75,47.635,47.00,46.410,46.22,46.058,46.70,47.344,48.65,50.005,51.02,52.045,53.55,55.075,55.98,56.823, - 56.85,56.884,56.15,55.523,54.60,53.732,52.55,51.425,50.30,49.1830,48.76,48.273,48.22,48.169,49.92,49.915,51.90,53.099,54.95,56.852,58.45,60.090,61.67,63.2530,63.55,63.834,63.55,63.468, - 62.40,61.373,59.75,58.1810,56.25,54.395,51.90,49.496,47.05,44.620}; - - int wlm = (int) ((wavelength -350.)/5.); - return (Solux41[wlm]); -} - -//spectral data for Solux lamp : near Daylight (for example "musée d'Orsay..") - 4700K -double ColorTemp::Solux4700_spect(double wavelength, double m1, double m2, double temp) -{ - static const double Solux47[97]={0.4590,0.83,1.2011,1.53,1.8647,2.15,2.5338,3.06,3.5809,3.99,4.4137,4.82,5.2228,5.63,6.0387,6.53,6.9944,7.55,8.0266,8.475,8.9276,8.90,9.7840,10.20,10.6390,11.00,11.3600,11.75,12.1340,12.36,12.5880,12.74,12.8790, - 13.07,13.2560,13.38,13.5220,13.41,13.3070,13.35,13.3990,13.37,13.3420,13.39,13.4220,13.65,13.2710,13.25,13.2330,13.12,13.0110,12.93,12.8470,12.805,12.7630,12.66,12.5760,12.563,12.5490, - 12.59,12.6330,12.617,12.6010,12.616,12.6310,12.6275,12.6240,12.70,12.7710,12.776,12.7810,12.786,12.7950,12.74,12.6850,12.64,12.5950,12.55,12.5420,12.43,12.3180,12.07,11.8340,11.72,11.6190,11.55,11.5020, - 11.32,11.1510,11.05,10.9530,10.80,10.6550,10.495,10.4390,10.31,10.1790}; - - int wlm = (int) ((wavelength -350.)/5.); - return (Solux47[wlm]); -} - -//spectral data for Solux lamp : near Daylight 4400K - test National Gallery -double ColorTemp::NG_Solux4700_spect(double wavelength, double m1, double m2, double temp) -{ - static const double NGSolux[97]={0.0,0.0,0.0,0.0,0.0,0.0,139,152,170,185,202,223,240,257,270,282,293,305,317,329,342,355,367,378,387,395,401,405,408,411,414,415,416,415,414,414,416,419,423,427,432,437,442,447,452, - 456,461,467,475,483,488,490,491,490,487,485,481,477,472,466,461,455,449,442,434,427,419,411,403,395,386,377,367,359,351,343,335,327,322,316,312,306,305,301,299,299,298, - 0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (NGSolux[wlm]); -} - -//spectral data for LED LSI Lumelex 2040 - test National Gallery -double ColorTemp::NG_LEDLSI2040_spect(double wavelength, double m1, double m2, double temp) -{ - static const double NGLsi[97]={0.0,0.0,0.0,0.0,0.0,0.0,1.5,1.2,0.5,0.7,0.6,1.6,1.7,7.0,16.6,35.5,64,106,162.5,230.5,272.2,249,213.4,214,227.6,231.9,233,235.2,241.4,253.7,270.3,288.5,306.2,322.3,337.6,352.5,367.2,381.7,395.9,409.6,416.2,423.2,429.7,435.8,442.8, - 451.7,464.2,480.3,501,526.3,555.9,587.5,625.4,655.1,681.7,705.3,721.5,728.5,729,719.8,702.5,676.7,646.2,611.5,571.7,530.3,488.3,445.9,404,365.2,326.8,290.8,257.6,226.9,199.8,175.2,154.2,133.8,116.4,101.5,88.5,76.6,67.3,57.9,50.7,44.2,38.2, - 0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (NGLsi[wlm]); -} -//spectral data for LED CRS SP12 WWMR16 - test National Gallery -double ColorTemp::NG_CRSSP12WWMR16_spect(double wavelength, double m1, double m2, double temp) -{ - static const double NGCRSSP12[97]={0.0,0.0,0.0,0.0,0.0,0.0,0.,0.,0.,0.,0.,0.14,0.33,1.31,3.34,7.9,17.4,36.5,72.6,145.4,260.5,359.2,365.3,303.1,256.1,221.7,193.6,185.8,191.4,207.3,232.8,257.5,285.1,310.5,333.4,351.5,368.8,383.7,398.8,411.6,424.7,435.6,447.9,459.7,471.7, - 484.6,497.9,512.3,531.1,548.9,567.9,587.5,608.6,625.3,640.1,648.6,654.0,654.3,647.2,633.9,616.1,590.5,561.5,526.5,494.8,457.9,420.8,382.4,347.3,309.9,280.5,249.2,220.0,194.9,170.8,149.1,130.0,112.3,97.5,84.9,73.2,63.1,54.1,45.6,39.0,32.6,27.4, - 0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.0}; - - int wlm = (int) ((wavelength -350.)/5.); - return (NGCRSSP12[wlm]); -} - -//spectral data for Flash daylight 5500K (Leica...) -double ColorTemp::Flash5500_spect(double wavelength, double m1, double m2, double temp) -{ - static const double FL55[97]={27.77,29.17,30.58,32.02,33.47,33.00,32.53,35.28,38.04,49.46,60.88,64.68,68.48,69.99,71.51,69.68,67.85,76.70,85.54,91.74,97.93,99.17,100.41,100.14,99.86,101.28,102.70,100.37,98.04,99.35,100.65, - 100.66,100.67,100.32,99.97,102.08,104.20,103.15,102.09,102.53,102.96,101.48,100.00,98.61,97.22,97.49,97.76,94.60,91.44,92.94,94.44,94.80,95.16,94.70,94.25,92.36,90.48,91.42,92.36,90.63, - 88.89,89.62,90.36,92.18,94.00,92.00,90.00,84.86,79.72,81.30,82.88,83.88,84.89,77.58,70.27,74.80,82.19,85.03,78.47,71.91,62.37,52.82,64.39,75.96,73.91,71.85,72.41,72.97,70.17,67.38,63.07, - 58.75,61.89,65.02,66.68,68.34}; - - int wlm = (int) ((wavelength -350.)/5.); - return (FL55[wlm]); -} - -//spectral data for Flash daylight 6000K (Canon, Pentax, Olympus,...Standard) -double ColorTemp::Flash6000_spect(double wavelength, double m1, double m2, double temp) -{ - static const double FL60[97]={36.00,37.18,38.36,40.36,42.35,41.77,41.19,43.79,46.40,59.24,72.09,76.15,80.22,81.47,82.71,80.12,77.52,86.54,95.56,101.70,107.85,108.66,109.46,108.57,107.68,108.65,109.61,106.63,103.65,104.42, - 105.19,104.79,104.39,103.45,102.51,104.28,106.05,104.68,103.31,103.42,103.54,101.77,100.00,98.38,96.75,96.74,96.72,93.30,89.89,90.92,91.95,91.99,92.03,91.30,90.57,88.51,86.45,86.96, - 87.47,85.66,83.85,84.21,84.57,85.95,87.32,85.31,83.30,78.66,74.03,75.24,76.45,77.68,78.91,72.13,65.35,69.67,73.98,76.68,79.39,73.29,67.19,58.19,49.19,59.98,70.77,68.91,67.05,67.55,68.05, - 65.47,62.88,58.89,54.90,57.81,60.72,62.25,63.78}; - - int wlm = (int) ((wavelength -350.)/5.); - return (FL60[wlm]); -} - -//spectral data for Flash daylight 6500K (Nikon, Minolta, Panasonic, Sony...) -double ColorTemp::Flash6500_spect(double wavelength, double m1, double m2, double temp) -{ - static const double FL65[97]={44.86,45.72,46.59,49.16,51.74,50.83,49.92,52.26,54.60,68.65,82.69,87.06,91.42,92.39,93.37,90.00,86.63,95.72,104.81,110.88,116.96,117.36,117.76,116.29,114.82,115.35,115.89,112.33,108.78,109.06, - 109.33,108.56,107.78,106.28,104.78,106.23,107.68,106.04,104.40,104.22,104.04,102.02,100.00,98.17,96.34,96.06,95.79,92.24,88.69,89.35,90.02,89.81,89.61,88.66,87.71,85.51,83.30,83.51,83.72, - 81.88,80.05,80.14,80.24,81.27,82.30,80.31,78.31,74.03,69.74,70.69,71.63,73.00,74.37,68.00,61.62,65.76,69.91,72.51,75.11,69.36,63.61,55.02,46.43,56.63,66.83,65.11,63.40,63.86,64.32,61.90,59.47, - 55.72,51.97,54.72,57.46,58.89,60.33}; - - int wlm = (int) ((wavelength -350.)/5.); - return (FL65[wlm]); -} - -void ColorTemp::temp2mul (double temp, double green, double& rmul, double& gmul, double& bmul) { - - clip (temp, green); - - double xD, yD, x_D, y_D, interm; - double x, y, z; - - // We first test for specially handled methods - if (method == "Daylight" ) spectrum_to_xyz(Daylight5300_spect, 0., 0., 0., x, y, z); - else if(method == "Cloudy" ) spectrum_to_xyz(Cloudy6200_spect, 0., 0., 0., x, y, z); - else if(method == "Shade" ) spectrum_to_xyz(Shade7600_spect, 0., 0., 0., x, y, z); - else if(method == "Tungsten" ) spectrum_to_xyz(A2856_spect, 0., 0., 0., x, y, z); - else if(method == "Fluo F1" ) spectrum_to_xyz(FluoF1_spect, 0., 0., 0., x, y, z); - else if(method == "Fluo F2" ) spectrum_to_xyz(FluoF2_spect, 0., 0., 0., x, y, z); - else if(method == "Fluo F3" ) spectrum_to_xyz(FluoF3_spect, 0., 0., 0., x, y, z); - else if(method == "Fluo F4" ) spectrum_to_xyz(FluoF4_spect, 0., 0., 0., x, y, z); - else if(method == "Fluo F5" ) spectrum_to_xyz(FluoF5_spect, 0., 0., 0., x, y, z); - else if(method == "Fluo F6" ) spectrum_to_xyz(FluoF6_spect, 0., 0., 0., x, y, z); - else if(method == "Fluo F7" ) spectrum_to_xyz(FluoF7_spect, 0., 0., 0., x, y, z); - else if(method == "Fluo F8" ) spectrum_to_xyz(FluoF8_spect, 0., 0., 0., x, y, z); - else if(method == "Fluo F9" ) spectrum_to_xyz(FluoF9_spect, 0., 0., 0., x, y, z); - else if(method == "Fluo F10" ) spectrum_to_xyz(FluoF10_spect, 0., 0., 0., x, y, z); - else if(method == "Fluo F11" ) spectrum_to_xyz(FluoF11_spect, 0., 0., 0., x, y, z); - else if(method == "Fluo F12" ) spectrum_to_xyz(FluoF12_spect, 0., 0., 0., x, y, z); - else if(method == "HMI Lamp" ) spectrum_to_xyz(HMI_spect, 0., 0., 0., x, y, z); - else if(method == "GTI Lamp" ) spectrum_to_xyz(GTI_spect, 0., 0., 0., x, y, z); - else if(method == "JudgeIII Lamp" ) spectrum_to_xyz(JudgeIII_spect, 0., 0., 0., x, y, z); - else if(method == "Solux Lamp 3500K" ) spectrum_to_xyz(Solux3500_spect, 0., 0., 0., x, y, z); - else if(method == "Solux Lamp 4100K" ) spectrum_to_xyz(Solux4100_spect, 0., 0., 0., x, y, z); - else if(method == "Solux Lamp 4700K" ) spectrum_to_xyz(Solux4700_spect, 0., 0., 0., x, y, z); - else if(method == "NG Solux Lamp 4700K" ) spectrum_to_xyz(NG_Solux4700_spect, 0., 0., 0., x, y, z); - else if(method == "LED LSI Lumelex 2040") spectrum_to_xyz(NG_LEDLSI2040_spect, 0., 0., 0., x, y, z); - else if(method == "LED CRS SP12 WWMR16" ) spectrum_to_xyz(NG_CRSSP12WWMR16_spect, 0., 0., 0., x, y, z); - else if(method == "Flash 5500K" ) spectrum_to_xyz(Flash5500_spect, 0., 0., 0., x, y, z); - else if(method == "Flash 6000K" ) spectrum_to_xyz(Flash6000_spect, 0., 0., 0., x, y, z); - else if(method == "Flash 6500K" ) spectrum_to_xyz(Flash6500_spect, 0., 0., 0., x, y, z); - else { - // otherwise we use the Temp+Green generic solution - if (temp <= 4000) { - // if temperature is between 2000K and 4000K we use blackbody, because there will be no Daylight reference below 4000K... - // of course, the previous version of RT used the "magical" but wrong formula of U.Fuchs (Ufraw). - spectrum_to_xyz(blackbody_spect, 0., 0., temp, x, y, z); - } - else { - // from 4000K up to 25000K: using the D illuminant (daylight) which is standard - double m1, m2; - if (temp<=7000) - x_D = -4.6070e9/(temp*temp*temp) + 2.9678e6/(temp*temp) + 0.09911e3/temp + 0.244063; - else - x_D = -2.0064e9/(temp*temp*temp) + 1.9018e6/(temp*temp) + 0.24748e3/temp + 0.237040; - - y_D = -3.0*x_D*x_D + 2.87*x_D - 0.275; - //calculate D -daylight in function of s0, s1, s2 and temp ==> x_D y_D - //S(lamda)=So(lambda)+m1*s1(lambda)+m2*s2(lambda) - interm=(0.0241+0.2562*x_D-0.734*y_D); - m1=(-1.3515-1.7703*x_D+5.9114*y_D)/interm; - m2=(0.03-31.4424*x_D+30.0717*y_D)/interm; - spectrum_to_xyz(daylight_spect, m1, m2, 0., x, y, z); - xD=x;yD=y; - } - - } - - xD=x; yD=y; - - /* - if (settings->verbose) { - double u=4*xD/(-2*xD+12*yD+3); - double v=6*yD/(-2*xD+12*yD+3); - printf("xD=%f yD=%f u=%f v=%f\n",xD,yD,u,v); - } - */ - - double X = xD/yD; - double Y = 1.0; - double Z = (1.0-xD-yD)/yD; - - /*if (isRaw) { - rmul = sRGB_xyz[0][0]*X + sRGB_xyz[0][1]*Y + sRGB_xyz[0][2]*Z; - gmul = sRGB_xyz[1][0]*X + sRGB_xyz[1][1]*Y + sRGB_xyz[1][2]*Z; - bmul = sRGB_xyz[2][0]*X + sRGB_xyz[2][1]*Y + sRGB_xyz[2][2]*Z; - } else {*/ - //recalculate channels multipliers with new values of XYZ tue to whitebalance - rmul = sRGBd65_xyz[0][0]*X + sRGBd65_xyz[0][1]*Y + sRGBd65_xyz[0][2]*Z; - gmul = sRGBd65_xyz[1][0]*X + sRGBd65_xyz[1][1]*Y + sRGBd65_xyz[1][2]*Z; - bmul = sRGBd65_xyz[2][0]*X + sRGBd65_xyz[2][1]*Y + sRGBd65_xyz[2][2]*Z; - //}; - gmul /= green; - - double max = rmul; - if (gmul>max) max = gmul; - if (bmul>max) max = bmul; - rmul /= max; - gmul /= max; - bmul /= max; -} - -} diff --git a/rtengine/colortemp.h b/rtengine/colortemp.h index 8059c367f..f588d1833 100644 --- a/rtengine/colortemp.h +++ b/rtengine/colortemp.h @@ -21,6 +21,10 @@ #include #include +#include "colortemp.h" +#include "imagefloat.h" +#include "labimage.h" +#define MAXR(a,b) ((a) > (b) ? (a) : (b)) namespace rtengine { @@ -32,63 +36,260 @@ namespace rtengine { class ColorTemp { - private: - double temp; - double green; - Glib::ustring method; + private: + double temp; + double green; + Glib::ustring method; - static void clip (double &temp, double &green); + static void clip (double &temp, double &green); - public: + public: - ColorTemp () : temp(-1), green(-1), method("Custom") {} - ColorTemp (double t, double g, Glib::ustring m); - ColorTemp (double mulr, double mulg, double mulb); + ColorTemp () : temp(-1), green(-1), method("Custom") {} + ColorTemp (double t, double g, Glib::ustring m); + ColorTemp (double mulr, double mulg, double mulb); - inline double getTemp () { return temp; } - inline double getGreen () { return green; } + inline double getTemp () { return temp; } + inline double getGreen () { return green; } - void getMultipliers (double &mulr, double &mulg, double &mulb) { temp2mul (temp, green, mulr, mulg, mulb); } + void getMultipliers (double &mulr, double &mulg, double &mulb) { temp2mul (temp, green, mulr, mulg, mulb); } - void mul2temp (double rmul, double gmul, double bmul, double& temp, double& green); - void temp2mul (double temp, double green, double& rmul, double& gmul, double& bmul); - //void temp2mul (double& rmul, double& gmul, double& bmul); + void mul2temp (double rmul, double gmul, double bmul, double& temp, double& green); + void temp2mul (double temp, double green, double& rmul, double& gmul, double& bmul); + static void temp2mulxyz (double tem, double gree, Glib::ustring method, double &Xxyz, double &Zxyz); - bool operator== (const ColorTemp& other) { return fabs(temp-other.temp)<1e-10 && fabs(green-other.green)<1e-10; } - bool operator!= (const ColorTemp& other) { return !(*this==other); } + int XYZtoCorColorTemp(double x0,double y0 ,double z0, double &temp); + static void cieCAT02(double Xw, double Yw, double Zw,double &CAM02BB00,double &CAM02BB01,double &CAM02BB02, double &CAM02BB10,double &CAM02BB11,double &CAM02BB12,double &CAM02BB20,double &CAM02BB21,double &CAM02BB22, double adap ); + //static void CAT02 (Imagefloat* baseImg, const ProcParams* params); + static void ciecam_02 (LabImage* lab, const ProcParams* params); - static double blackbody_spect (double wavelength, double m1, double m2, double temp); - static double daylight_spect (double wavelength, double m1, double m2, double temp); - static double Cloudy6200_spect (double wavelength, double m1, double m2, double temp); - static double Daylight5300_spect (double wavelength, double m1, double m2, double temp); - static double Shade7600_spect (double wavelength, double m1, double m2, double temp); - static double A2856_spect (double wavelength, double m1, double m2, double temp); - static double FluoF1_spect (double wavelength, double m1, double m2, double temp); - static double FluoF2_spect (double wavelength, double m1, double m2, double temp); - static double FluoF3_spect (double wavelength, double m1, double m2, double temp); - static double FluoF4_spect (double wavelength, double m1, double m2, double temp); - static double FluoF5_spect (double wavelength, double m1, double m2, double temp); - static double FluoF6_spect (double wavelength, double m1, double m2, double temp); - static double FluoF7_spect (double wavelength, double m1, double m2, double temp); - static double FluoF8_spect (double wavelength, double m1, double m2, double temp); - static double FluoF9_spect (double wavelength, double m1, double m2, double temp); - static double FluoF10_spect (double wavelength, double m1, double m2, double temp); - static double FluoF11_spect (double wavelength, double m1, double m2, double temp); - static double FluoF12_spect (double wavelength, double m1, double m2, double temp); - static double HMI_spect (double wavelength, double m1, double m2, double temp); - static double GTI_spect (double wavelength, double m1, double m2, double temp); - static double JudgeIII_spect (double wavelength, double m1, double m2, double temp); - static double Solux3500_spect (double wavelength, double m1, double m2, double temp); - static double Solux4100_spect (double wavelength, double m1, double m2, double temp); - static double Solux4700_spect (double wavelength, double m1, double m2, double temp); - static double NG_Solux4700_spect (double wavelength, double m1, double m2, double temp); - static double NG_LEDLSI2040_spect (double wavelength, double m1, double m2, double temp); - static double NG_CRSSP12WWMR16_spect (double wavelength, double m1, double m2, double temp); - static double Flash5500_spect (double wavelength, double m1, double m2, double temp); - static double Flash6000_spect (double wavelength, double m1, double m2, double temp); - static double Flash6500_spect (double wavelength, double m1, double m2, double temp); + static double d_factor( double f, double la ) { + return f * (1.0 - ((1.0 / 3.6) * exp((-la - 42.0) / 92.0))); + } + + static double calculate_fl_from_la_ciecam02( double la ) { + double la5 = la * 5.0; + double k = 1.0 / (la5 + 1.0); + + /* Calculate k^4. */ + k = k * k; + k = k * k; + + return (0.2 * k * la5) + (0.1 * (1.0 - k) * (1.0 - k) * pow(la5, 1.0 / 3.0)); + } + + static double achromatic_response_to_white( double x, double y, double z, double d, double fl, double nbb, int gamu ) { + double r, g, b; + double rc, gc, bc; + double rp, gp, bp; + double rpa, gpa, bpa; + + xyz_to_cat02( r, g, b, x, y, z, gamu ); + + rc = r * (((y * d) / r) + (1.0 - d)); + gc = g * (((y * d) / g) + (1.0 - d)); + bc = b * (((y * d) / b) + (1.0 - d)); + + cat02_to_hpe( rp, gp, bp, rc, gc, bc ); + if(gamu==1){//gamut correction M.H.Brill S.Susstrunk + rp=MAXR(rp,0.0); + gp=MAXR(gp,0.0); + bp=MAXR(bp,0.0); + } + + rpa = nonlinear_adaptation( rp, fl ); + gpa = nonlinear_adaptation( gp, fl ); + bpa = nonlinear_adaptation( bp, fl ); + + return ((2.0 * rpa) + gpa + ((1.0 / 20.0) * bpa) - 0.305) * nbb; + } + + static void xyz_to_cat02 ( double &r, double &g, double &b, double x, double y, double z, int gamu ); + static void cat02_to_hpe ( double &rh, double &gh, double &bh, double r, double g, double b ); + static void cat02_to_xyz ( double &x, double &y, double &z, double r, double g, double b, int gamu ); + static void hpe_to_xyz ( double &x, double &y, double &z, double r, double g, double b ); + + static double nonlinear_adaptation( double c, double fl ) { + double p; + if(c<0.0){ p = pow( (-1.0*fl * c) / 100.0, 0.42 );return ((-1.0*400.0 * p) / (27.13 + p)) + 0.1;} + else {p = pow( (fl * c) / 100.0, 0.42 ); return ((400.0 * p) / (27.13 + p)) + 0.1;} + } + + static double inverse_nonlinear_adaptation( double c, double fl ) { + int c1; + if(c-0.1 < 0.0) c1=-1; else c1=1; + return c1*(100.0 / fl) * pow( (27.13 * fabs( c - 0.1 )) / (400.0 - fabs( c - 0.1 )), 1.0 / 0.42 ); + } + static void curvecolor(double satind, double satval, double &sres, double parsat); + static void curveJ (double br, double contr, int db, LUTf & outCurve , LUTu & histogram ) ; + + bool operator== (const ColorTemp& other) { return fabs(temp-other.temp)<1e-10 && fabs(green-other.green)<1e-10; } + bool operator!= (const ColorTemp& other) { return !(*this==other); } + + static double blackbody_spect (double wavelength, double m1, double m2, double temp); + static double daylight_spect (double wavelength, double m1, double m2, double temp); + static const double Cloudy6200_spect[97]; + static const double Daylight5300_spect[97]; + static const double Shade7600_spect[97]; + static const double A2856_spect[97]; + static const double FluoF1_spect[97]; + static const double FluoF2_spect[97]; + static const double FluoF3_spect[97]; + static const double FluoF4_spect[97]; + static const double FluoF5_spect[97]; + static const double FluoF6_spect[97]; + static const double FluoF7_spect[97]; + static const double FluoF8_spect[97]; + static const double FluoF9_spect[97]; + static const double FluoF10_spect[97]; + static const double FluoF11_spect[97]; + static const double FluoF12_spect[97]; + static const double HMI_spect[97]; + static const double GTI_spect[97]; + static const double JudgeIII_spect[97]; + static const double Solux3500_spect[97]; + static const double Solux4100_spect[97]; + static const double Solux4700_spect[97]; + static const double NG_Solux4700_spect[97]; + static const double NG_LEDLSI2040_spect[97]; + static const double NG_CRSSP12WWMR16_spect[97]; + static const double Flash5500_spect[97]; + static const double Flash6000_spect[97]; + static const double Flash6500_spect[97]; + + //spectral data 8 color Colorchecker24 + static double get_spectral_color (double wavelength, const double* array) { + int wlm = (int) ((wavelength -350.)/5.); + return (array[wlm]); + } + + static const double ColorchechredC3_spect[97]; + static const double ColorchechOraA2_spect[97]; + static const double ColorchechYelD3_spect[97]; + static const double ColorchechGreE2_spect[97]; + static const double ColorchechGreB3_spect[97]; + static const double ColorchechCyaF3_spect[97]; + static const double ColorchechPurD2_spect[97]; + static const double ColorchechMagE3_spect[97]; + static const double ColorchechSkiA138_13_14_spect[97]; + static const double ColorchechGraC4_67_spect[97]; + static const double ColorchechSkiB166_18_18_spect[97]; + static const double ColorchechBluC150_m5_m22_spect[97]; + static const double ColorchechDCBluN881_m7_m14_spect[97];//ColorChecker DC N8 + static const double ColorchechSGSkiF763_14_26_spect[97];//ColorChecker SG F7 + static const double ColorchechSGSkiK285_11_17_spect[97];//ColorChecker SG K2 + static const double ColorchechWhiA496_spect[97]; + static const double ColorchechGreD1_spect[97]; + static const double ColorchechSGBlaN3_6_spect[97];//ColorChecker SG N3 + static const double JDC468_GraK14_44_spect[97];//468 K14 + static const double JDC468_BluH10_spect[97];//468 H10 + static const double ColabSkin35_15_17_spect[97];//Skin L 35 + static const double ColabSkin57_22_18_spect[97];//Skin L 57 + static const double ColabSkin40_17_17_spect[97];//Skin L 40 + static const double ColabSkin91_4_14_spect[97];//Skin L 91 + static const double ColabSkin87_8_8_spect[97];//Skin L 87 + static const double ColabSkin89_8_21_spect[97];//Skin L 89 + static const double ColabSkin75_8_4_spect[97];//Skin L 75 + static const double ColabSkin75_10_33_spect[97];//Skin L 75 + static const double ColabSkin65_33_11_spect[97];//Skin L 65 + static const double ColabSkin65_7_24_spect[97];//Skin L 65 + static const double ColabSkin57_19_6_spect[97];//Skin L 57 + static const double ColabSkin57_4_19_spect[97];//Skin L 57 + static const double ColabSkin57_10_28_spect[97];//Skin L 57 + static const double ColabSkin40_7_19_spect[97];//Skin L 57 + static const double ColabSkin40_17_6_spect[97];//Skin L 40 + static const double ColabSkin40_4_11_spect[97];//Skin L 40 + static const double ColabSkin33_6_15_spect[97];//Skin L 33 + static const double ColabSkin33_15_5_spect[97];//Skin L 33 + static const double ColabSkin33_10_15_spect[97];//Skin L 33 + static const double ColabSkin24_5_6_spect[97];//Skin L 24 + static const double ColabSkin26_18_18_spect[97];//Skin L 26 + static const double ColabSkin24_7_5_spect[97];//Skin L 24 + static const double ColabSkin20_4_2_spect[97];//Skin L 20 + static const double ColabSkin98_m2_10_spect[97];//Skin L 98 + static const double ColabSkin90_m1_20_spect[97];//Skin L 90 + static const double ColabSkin95_0_4_spect[97];//Skin L 95 + static const double ColabSkin81_2_14_spect[97];//Skin L 81 + static const double ColabSkin87_3_10_spect[97];//Skin L 87 + static const double ColabSkin77_12_21_spect[97];//Skin L 77 + static const double ColabSkin70_7_32_spect[97];//Skin L 77 + static const double ColabSky60_0_m31_spect[97];//Sky L=60 + static const double ColabSky42_0_m24_spect[97];//Sky L=42 + + static void spectrum_to_xyz_daylight (double _m1, double _m2, double _temp, double &x, double &y, double &z); + static void spectrum_to_xyz_blackbody (double _m1, double _m2, double _temp, double &x, double &y, double &z); + static void spectrum_to_xyz_preset (const double* spec_intens, double &x, double &y, double &z); + + static void spectrum_to_color_xyz_daylight (const double* spec_color, double _m1, double _m2, double _temp, double &xx, double &yy, double &zz); + static void spectrum_to_color_xyz_blackbody (const double* spec_color, double _m1, double _m2, double _temp, double &xx, double &yy, double &zz); + static void spectrum_to_color_xyz_preset (const double* spec_color, const double* spec_intens, double &xx, double &yy, double &zz); + + + +/** + * Inverse transform from CIECAM02 JCh to XYZ. + */ + static void jch2xyz_ciecam02( double &x, double &y, double &z, + double J, double C, double h, + double xw, double yw, double zw, + double yb, double la, + double f, double c, double nc, bool doneinit2, int gamu ); +/** + * Forward transform from XYZ to CIECAM02 JCh. + */ + static void xyz2jchqms_ciecam02( double &J, double &C, double &h, + double &Q, double &M, double &s,double &aw, double &fl, double &wh, + double x, double y, double z, + double xw, double yw, double zw, + double yb, double la, + double f, double c, double nc, double pilotd, bool doneinit1, int gamu ); - static void spectrum_to_xyz (double (*spec_intens)(double wavelength, double m1, double m2, double temp), double _m1, double _m2, double _temp, double &x, double &y, double &z); }; +inline void ColorTemp::xyz_to_cat02( double &r, double &g, double &b, double x, double y, double z, int gamu ) +{ +if(gamu==0){ + r = ( 0.7328 * x) + (0.4296 * y) - (0.1624 * z); + g = (-0.7036 * x) + (1.6975 * y) + (0.0061 * z); + b = ( 0.0030 * x) + (0.0136 * y) + (0.9834 * z); + } +else if (gamu==1) {//gamut correction M.H.Brill S.Susstrunk + r = ( 0.7328 * x) + (0.4296 * y) - (0.1624 * z); + g = (-0.7036 * x) + (1.6975 * y) + (0.0061 * z); + b = ( 0.0000 * x) + (0.0000 * y) + (1.0000 * z); + + +} +} + +inline void ColorTemp::cat02_to_xyz( double &x, double &y, double &z, double r, double g, double b, int gamu ) +{ +if(gamu==0) { + x = ( 1.096124 * r) - (0.278869 * g) + (0.182745 * b); + y = ( 0.454369 * r) + (0.473533 * g) + (0.072098 * b); + z = (-0.009628 * r) - (0.005698 * g) + (1.015326 * b); + } +else if(gamu==1) {//gamut correction M.H.Brill S.Susstrunk + x = ( 1.0978566 * r) - (0.277843 * g) + (0.179987 * b); + y = ( 0.455053 * r) + (0.473938 * g) + (0.0710096* b); + z = ( 0.000000 * r) - (0.000000 * g) + (1.000000 * b); +} +} + +inline void ColorTemp::hpe_to_xyz( double &x, double &y, double &z, double r, double g, double b ) +{ + x = (1.910197 * r) - (1.112124 * g) + (0.201908 * b); + y = (0.370950 * r) + (0.629054 * g) - (0.000008 * b); + z = b; +} + +inline void ColorTemp::cat02_to_hpe( double &rh, double &gh, double &bh, double r, double g, double b ) +{ + rh = ( 0.7409792 * r) + (0.2180250 * g) + (0.0410058 * b); + gh = ( 0.2853532 * r) + (0.6242014 * g) + (0.0904454 * b); + bh = (-0.0096280 * r) - (0.0056980 * g) + (1.0153260 * b); +} + + + } #endif diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 8fdb42f22..980c612e5 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -21,6 +21,7 @@ #include "mytime.h" #include "refreshmap.h" #include "rt_math.h" +#include "colortemp.h" #define SKIPS(a,b) ((a) / (b) + ((a) % (b) > 0)) @@ -101,6 +102,7 @@ void Crop::update (int todo) { setCropSizes (rqcropx, rqcropy, rqcropw, rqcroph, skip, true); PreviewProps pp (trafx, trafy, trafw*skip, trafh*skip, skip); parent->imgsrc->getImage (parent->currWB, tr, origCrop, pp, params.hlrecovery, params.icm, params.raw ); + //ColorTemp::CAT02 (origCrop, ¶ms) ; //parent->imgsrc->convertColorSpace(origCrop, params.icm); @@ -187,6 +189,7 @@ void Crop::update (int todo) { parent->ipf.chromiLuminanceCurve (labnCrop, labnCrop, parent->chroma_acurve, parent->chroma_bcurve, parent->satcurve, parent->lhskcurve, parent->lumacurve, utili, autili, butili, ccutili,cclutili); //parent->ipf.colorCurve (labnCrop, labnCrop); parent->ipf.vibrance (labnCrop); + // ColorTemp::ciecam_02 (labnCrop, ¶ms); if (skip==1) { parent->ipf.impulsedenoise (labnCrop); @@ -198,6 +201,7 @@ void Crop::update (int todo) { parent->ipf.dirpyrequalizer (labnCrop); } } + ColorTemp::ciecam_02 (labnCrop, ¶ms); // switch back to rgb parent->ipf.lab2monitorRgb (labnCrop, cropImg); diff --git a/rtengine/gamutbdy.cc b/rtengine/gamutbdy.cc deleted file mode 100644 index 2e3ba23d9..000000000 --- a/rtengine/gamutbdy.cc +++ /dev/null @@ -1 +0,0 @@ -// File will be deleted on commit \ No newline at end of file diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 4550c35fc..383aefcf5 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -22,6 +22,7 @@ #include "refreshmap.h" #include "simpleprocess.h" #include "../rtgui/ppversion.h" +#include "colortemp.h" namespace rtengine { @@ -167,8 +168,11 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { params.wb.temperature = currWB.getTemp (); params.wb.green = currWB.getGreen (); - imgsrc->demosaic( rp ); - + imgsrc->demosaic( rp ); + //imgsrc->getImage (currWB, tr, orig_prev, pp, params.hlrecovery, params.icm, params.raw); + + //imgsrc->convertColorSpace(orig_prev, params.icm, params.raw); + if (highDetailNeeded) { highDetailRawComputed = true; if (params.hlrecovery.enabled && params.hlrecovery.method=="Color") { @@ -219,6 +223,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { PreviewProps pp (0, 0, fw, fh, scale); setScale (scale); imgsrc->getImage (currWB, tr, orig_prev, pp, params.hlrecovery, params.icm, params.raw); + //ColorTemp::CAT02 (orig_prev, ¶ms) ; //imgsrc->convertColorSpace(orig_prev, params.icm, params.raw); @@ -339,6 +344,8 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { ipf.chromiLuminanceCurve (nprevl, nprevl, chroma_acurve, chroma_bcurve, satcurve,lhskcurve, lumacurve, utili, autili, butili, ccutili,cclutili); //ipf.colorCurve (nprevl, nprevl); ipf.vibrance(nprevl); + // ColorTemp::ciecam_02 (nprevl, ¶ms); + readyphase++; if (scale==1) { progress ("Denoising luminance impulse...",100*readyphase/numofphases); @@ -377,6 +384,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) { readyphase++; } } + ColorTemp::ciecam_02 (nprevl, ¶ms); // process crop, if needed for (size_t i=0; iwidth; + int fh = baseImg->height; + + double CAM02BB00,CAM02BB01,CAM02BB02,CAM02BB10,CAM02BB11,CAM02BB12,CAM02BB20,CAM02BB21,CAM02BB22; + double Xxx,Yyy,Zzz; + // Xxx=1.09844; + // Yyy=1.0; + // Zzz=0.355961; + //params.wb.temperature, params.wb.green, params.wb.method + double Xxyz, Zxyz; +// ColorTemp::temp2mulxyz (params->wb.temperature, params->wb.green, params->wb.method, Xxyz, Zxyz); + ColorTemp::temp2mulxyz (5000.0, 1.0, "Camera", Xxyz, Zxyz); + + ColorTemp::cieCAT02(Xxx, Yyy, Zzz, CAM02BB00,CAM02BB01,CAM02BB02,CAM02BB10,CAM02BB11,CAM02BB12,CAM02BB20,CAM02BB21,CAM02BB22); + printf("00=%f 01=%f 11=%f 20=%f 22=%f\n", CAM02BB00,CAM02BB01,CAM02BB11,CAM02BB20,CAM02BB22); + + + for (int i=0; ir[i][j]; + float g = baseImg->g[i][j]; + float b = baseImg->b[i][j]; + + float x = toxyz[0][0] * r + toxyz[0][1] * g + toxyz[0][2] * b; + float y = toxyz[1][0] * r + toxyz[1][1] * g + toxyz[1][2] * b; + float z = toxyz[2][0] * r + toxyz[2][1] * g + toxyz[2][2] * b; + float Xcam=CAM02BB00* x +CAM02BB01* y + CAM02BB02* z ; + float Ycam=CAM02BB10* x +CAM02BB11* y + CAM02BB12* z ; + float Zcam=CAM02BB20* x +CAM02BB21* y + CAM02BB22* z ; + baseImg->r[i][j] = xyzto[0][0] * Xcam + xyzto[0][1] * Ycam + xyzto[0][2] * Zcam; + baseImg->g[i][j] = xyzto[1][0] * Xcam + xyzto[1][1] * Ycam + xyzto[1][2] * Zcam; + baseImg->b[i][j] = xyzto[2][0] * Xcam + xyzto[2][1] * Ycam + xyzto[2][2] * Zcam; + } + } +} +*/ void ImProcFunctions::firstAnalysis (Imagefloat* original, const ProcParams* params, LUTu & histogram, double gamma) { // set up monitor transform diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index d81643af1..2ef9a70ff 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -111,7 +111,8 @@ class ImProcFunctions { void dirpyrequalizer (LabImage* lab);//Emil's equalizer void EPDToneMap(LabImage *lab, unsigned int Iterates = 0, int skip = 1); - + // void CAT02 (Imagefloat* baseImg, const ProcParams* params); + // pyramid denoise procparams::DirPyrDenoiseParams dnparams; void dirpyrLab_denoise(LabImage * src, LabImage * dst, const procparams::DirPyrDenoiseParams & dnparams );//Emil's directional pyramid denoise diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 931d45bd4..d6020cf58 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -195,8 +195,27 @@ enum ProcEvent { EvLLCCurve=170, EvLLCredsk=171, EvDPDNLdetail=172, + EvCATEnabled=173, + EvCATDegree=174, + EvCATMethodsur=175, + EvCATAdapscen=176, + EvCATAdapLum=177, + EvCATMethodWB=178, + EvCATJLight=179, + EvCATChroma=180, + EvCATAutoDegree=181, + EvCATContrast=182, + EvCATsurr=183, + EvCATgamut=184, + EvCATMethodalg=185, + EvCATRstpro=186, + EvCATQbright=187, + EvCATQContrast=188, + EvCATSChroma=189, + EvCATMChroma=190, + EvCAThue=191, - NUMOFEVENTS=173 + NUMOFEVENTS=192 }; -} -#endif +} +#endif diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index de3b0abb1..f27225a9e 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -73,7 +73,7 @@ void WBParams::init() { wbEntries.push_back(new WBEntry("Solux Lamp 4100K" ,WBT_LAMP, M("TP_WBALANCE_SOLUX41"), 3930)); wbEntries.push_back(new WBEntry("Solux Lamp 4700K" ,WBT_LAMP, M("TP_WBALANCE_SOLUX47"), 4700)); wbEntries.push_back(new WBEntry("NG Solux Lamp 4700K" ,WBT_LAMP, M("TP_WBALANCE_SOLUX47_NG"), 4480)); - wbEntries.push_back(new WBEntry("LED LSI Lumelex 2040",WBT_LED, M("TP_WBALANCE_LED_LSI"), 3000)); + wbEntries.push_back(new WBEntry("LED LSI Lumelex 2040",WBT_LED, M("TP_WBALANCE_LED_LSI"), 2970)); wbEntries.push_back(new WBEntry("LED CRS SP12 WWMR16" ,WBT_LED, M("TP_WBALANCE_LED_CRS"), 3050)); wbEntries.push_back(new WBEntry("Flash 5500K" ,WBT_FLASH, M("TP_WBALANCE_FLASH55"), 5500)); wbEntries.push_back(new WBEntry("Flash 6000K" ,WBT_FLASH, M("TP_WBALANCE_FLASH60"), 6000)); @@ -207,25 +207,30 @@ void ProcParams::setDefaults () { vibrance.skintonescurve.clear (); vibrance.skintonescurve.push_back(DCT_Linear); - //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.edgetolerance = 2000; + colorappearance.enabled = false; + colorappearance.degree = 90; + colorappearance.autodegree = true; + colorappearance.surround = "Average"; +// colorappearance.backgrd = 20; + colorappearance.adaplum = 16; + colorappearance.adapscen = 2000.0; + colorappearance.algo = "JC"; + colorappearance.wbmodel = "RawT"; + colorappearance.jlight = 0.0; + colorappearance.qbright = 0.0; + colorappearance.chroma = 0.0; + colorappearance.schroma = 0.0; + colorappearance.mchroma = 0.0; + colorappearance.rstprotection = 0.0; + colorappearance.contrast = 0.0; + colorappearance.qcontrast = 0.0; + colorappearance.colorh = 0.0; + colorappearance.surrsource = false; + colorappearance.gamut = false; impulseDenoise.enabled = false; impulseDenoise.thresh = 50; @@ -555,6 +560,29 @@ int ProcParams::save (Glib::ustring fname, Glib::ustring fname2, ParamsEdited* p if (!pedited || pedited->colorShift.a) keyFile.set_double ("Color Shift", "ChannelA", colorShift.a); if (!pedited || pedited->colorShift.b) keyFile.set_double ("Color Shift", "ChannelB", colorShift.b); */ + // save colorappearance + if (!pedited || pedited->colorappearance.enabled) keyFile.set_boolean ("Color appearance", "Enabled", colorappearance.enabled); + if (!pedited || pedited->colorappearance.degree) keyFile.set_integer ("Color appearance", "Degree", colorappearance.degree); + if (!pedited || pedited->colorappearance.autodegree) keyFile.set_boolean ("Color appearance", "AutoDegree", colorappearance.autodegree); + if (!pedited || pedited->colorappearance.surround) keyFile.set_string ("Color appearance", "Surround", colorappearance.surround); + // if (!pedited || pedited->colorappearance.backgrd) keyFile.set_integer ("Color appearance", "Background", colorappearance.backgrd); + if (!pedited || pedited->colorappearance.adaplum) keyFile.set_double ("Color appearance", "AdaptLum", colorappearance.adaplum); + if (!pedited || pedited->colorappearance.wbmodel) keyFile.set_string ("Color appearance", "Model", colorappearance.wbmodel); + if (!pedited || pedited->colorappearance.algo) keyFile.set_string ("Color appearance", "Algorithm", colorappearance.algo); + + if (!pedited || pedited->colorappearance.jlight) keyFile.set_double ("Color appearance", "J-Light", colorappearance.jlight); + if (!pedited || pedited->colorappearance.qbright) keyFile.set_double ("Color appearance", "Q-Bright", colorappearance.qbright); + if (!pedited || pedited->colorappearance.chroma) keyFile.set_double ("Color appearance", "C-Chroma", colorappearance.chroma); + if (!pedited || pedited->colorappearance.schroma) keyFile.set_double ("Color appearance", "S-Chroma", colorappearance.schroma); + if (!pedited || pedited->colorappearance.mchroma) keyFile.set_double ("Color appearance", "M-Chroma", colorappearance.mchroma); + if (!pedited || pedited->colorappearance.contrast) keyFile.set_double ("Color appearance", "J-Contrast", colorappearance.contrast); + if (!pedited || pedited->colorappearance.qcontrast) keyFile.set_double ("Color appearance", "Q-Contrast", colorappearance.qcontrast); + if (!pedited || pedited->colorappearance.colorh) keyFile.set_double ("Color appearance", "H-Hue", colorappearance.colorh); + if (!pedited || pedited->colorappearance.rstprotection) keyFile.set_double ("Color appearance", "RSTProtection", colorappearance.rstprotection); + + if (!pedited || pedited->colorappearance.adapscen) keyFile.set_double ("Color appearance", "AdaptScene", colorappearance.adapscen); + if (!pedited || pedited->colorappearance.surrsource) keyFile.set_boolean ("Color appearance", "SurrSource", colorappearance.surrsource); + if (!pedited || pedited->colorappearance.gamut) keyFile.set_boolean ("Color appearance", "Gamut", colorappearance.gamut); // save impulseDenoise if (!pedited || pedited->impulseDenoise.enabled) keyFile.set_boolean ("Impulse Denoising", "Enabled", impulseDenoise.enabled); @@ -988,38 +1016,61 @@ if (keyFile.has_group ("White Balance")) { 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 + + // load defringe if (keyFile.has_group ("Defringing")) { - if (keyFile.has_key ("Defringing", "Enabled")) { defringe.enabled = keyFile.get_boolean ("Defringing", "Enabled"); if (pedited) pedited->defringe.enabled = true; } - if (keyFile.has_key ("Defringing", "Radius")) { defringe.radius = keyFile.get_double ("Defringing", "Radius"); if (pedited) pedited->defringe.radius = true; } - if (keyFile.has_key ("Defringing", "Threshold")) { defringe.threshold = keyFile.get_integer ("Defringing", "Threshold"); if (pedited) pedited->defringe.threshold = true; } + 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 (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")) {//TODO: No longer an accurate description for FT denoise - if (keyFile.has_key ("Directional Pyramid Denoising", "Enabled")) { dirpyrDenoise.enabled = keyFile.get_boolean ("Directional Pyramid Denoising", "Enabled"); if (pedited) pedited->dirpyrDenoise.enabled = true; } - if (keyFile.has_key ("Directional Pyramid Denoising", "Luma")) { dirpyrDenoise.luma = keyFile.get_double ("Directional Pyramid Denoising", "Luma"); if (pedited) pedited->dirpyrDenoise.luma = true; } - if (keyFile.has_key ("Directional Pyramid Denoising", "Ldetail")) { dirpyrDenoise.Ldetail = keyFile.get_double ("Directional Pyramid Denoising", "Ldetail"); if (pedited) pedited->dirpyrDenoise.Ldetail = true; } - if (keyFile.has_key ("Directional Pyramid Denoising", "Chroma")) { dirpyrDenoise.chroma = keyFile.get_double ("Directional Pyramid Denoising", "Chroma"); if (pedited) pedited->dirpyrDenoise.chroma = true; } - if (keyFile.has_key ("Directional Pyramid Denoising", "Gamma")) { dirpyrDenoise.gamma = keyFile.get_double ("Directional Pyramid Denoising", "Gamma"); if (pedited) pedited->dirpyrDenoise.gamma = true; } + // load colorappearance +if (keyFile.has_group ("Color appearance")) { + if (keyFile.has_key ("Color appearance", "Enabled")) {colorappearance.enabled = keyFile.get_boolean ("Color appearance", "Enabled"); if (pedited) pedited->colorappearance.enabled = true; } + if (keyFile.has_key ("Color appearance", "Degree")) {colorappearance.degree = keyFile.get_integer ("Color appearance", "Degree"); if (pedited) pedited->colorappearance.degree = true; } + if (keyFile.has_key ("Color appearance", "AutoDegree")) {colorappearance.autodegree = keyFile.get_boolean ("Color appearance", "AutoDegree"); if (pedited) pedited->colorappearance.autodegree = true; } + if (keyFile.has_key ("Color appearance", "Surround")) {colorappearance.surround = keyFile.get_string ("Color appearance", "Surround"); if (pedited) pedited->colorappearance.surround = true; } +// if (keyFile.has_key ("Color appearance", "Background")) {colorappearance.backgrd = keyFile.get_integer ("Color appearance", "Background"); if (pedited) pedited->colorappearance.backgrd = true; } + if (keyFile.has_key ("Color appearance", "AdaptLum")) {colorappearance.adaplum = keyFile.get_double ("Color appearance", "AdaptLum"); if (pedited) pedited->colorappearance.adaplum = true; } + if (keyFile.has_key ("Color appearance", "Model")) {colorappearance.wbmodel = keyFile.get_string ("Color appearance", "Model"); if (pedited) pedited->colorappearance.wbmodel = true; } + if (keyFile.has_key ("Color appearance", "Algorithm")) {colorappearance.algo = keyFile.get_string ("Color appearance", "Algorithm"); if (pedited) pedited->colorappearance.algo = true; } + if (keyFile.has_key ("Color appearance", "J-Light")) {colorappearance.jlight = keyFile.get_double ("Color appearance", "J-Light"); if (pedited) pedited->colorappearance.jlight = true; } + if (keyFile.has_key ("Color appearance", "Q-Bright")) {colorappearance.qbright = keyFile.get_double ("Color appearance", "Q-Bright"); if (pedited) pedited->colorappearance.qbright = true; } + if (keyFile.has_key ("Color appearance", "C-Chroma")) {colorappearance.chroma = keyFile.get_double ("Color appearance", "C-Chroma"); if (pedited) pedited->colorappearance.chroma = true; } + if (keyFile.has_key ("Color appearance", "S-Chroma")) {colorappearance.schroma = keyFile.get_double ("Color appearance", "S-Chroma"); if (pedited) pedited->colorappearance.schroma = true; } + if (keyFile.has_key ("Color appearance", "M-Chroma")) {colorappearance.mchroma = keyFile.get_double ("Color appearance", "M-Chroma"); if (pedited) pedited->colorappearance.mchroma = true; } + if (keyFile.has_key ("Color appearance", "RSTProtection")) {colorappearance.rstprotection = keyFile.get_double ("Color appearance", "RSTProtection"); if (pedited) pedited->colorappearance.rstprotection = true; } + if (keyFile.has_key ("Color appearance", "J-Contrast")) {colorappearance.contrast = keyFile.get_double ("Color appearance", "J-Contrast"); if (pedited) pedited->colorappearance.contrast = true; } + if (keyFile.has_key ("Color appearance", "Q-Contrast")) {colorappearance.qcontrast = keyFile.get_double ("Color appearance", "Q-Contrast"); if (pedited) pedited->colorappearance.qcontrast = true; } + if (keyFile.has_key ("Color appearance", "H-Hue")) {colorappearance.colorh = keyFile.get_double ("Color appearance", "H-Hue"); if (pedited) pedited->colorappearance.colorh = true; } + if (keyFile.has_key ("Color appearance", "AdaptScene")) {colorappearance.adapscen = keyFile.get_double ("Color appearance", "AdaptScene"); if (pedited) pedited->colorappearance.adapscen = true; } + if (keyFile.has_key ("Color appearance", "SurrSource")) {colorappearance.surrsource = keyFile.get_boolean ("Color appearance", "SurrSource"); if (pedited) pedited->colorappearance.surrsource = true; } + if (keyFile.has_key ("Color appearance", "Gamut")) {colorappearance.gamut = keyFile.get_boolean ("Color appearance", "Gamut"); if (pedited) pedited->colorappearance.gamut = true; } } -//Load EPD. -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 impulseDenoise +if (keyFile.has_group ("Impulse Denoising")) { + if (keyFile.has_key ("Impulse Denoising", "Enabled")) { impulseDenoise.enabled = keyFile.get_boolean ("Impulse Denoising", "Enabled"); if (pedited) pedited->impulseDenoise.enabled = true; } + if (keyFile.has_key ("Impulse Denoising", "Threshold")) { impulseDenoise.thresh = keyFile.get_integer ("Impulse Denoising", "Threshold"); if (pedited) pedited->impulseDenoise.thresh = true; } } - + + // load dirpyrDenoise +if (keyFile.has_group ("Directional Pyramid Denoising")) {//TODO: No longer an accurate description for FT denoise + if (keyFile.has_key ("Directional Pyramid Denoising", "Enabled")) { dirpyrDenoise.enabled = keyFile.get_boolean ("Directional Pyramid Denoising", "Enabled"); if (pedited) pedited->dirpyrDenoise.enabled = true; } + if (keyFile.has_key ("Directional Pyramid Denoising", "Luma")) { dirpyrDenoise.luma = keyFile.get_double ("Directional Pyramid Denoising", "Luma"); if (pedited) pedited->dirpyrDenoise.luma = true; } + if (keyFile.has_key ("Directional Pyramid Denoising", "Ldetail")) { dirpyrDenoise.Ldetail = keyFile.get_double ("Directional Pyramid Denoising", "Ldetail"); if (pedited) pedited->dirpyrDenoise.Ldetail = true; } + if (keyFile.has_key ("Directional Pyramid Denoising", "Chroma")) { dirpyrDenoise.chroma = keyFile.get_double ("Directional Pyramid Denoising", "Chroma"); if (pedited) pedited->dirpyrDenoise.chroma = true; } + if (keyFile.has_key ("Directional Pyramid Denoising", "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 (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 (pedited) pedited->lumaDenoise.enabled = true; } @@ -1356,6 +1407,24 @@ bool ProcParams::operator== (const ProcParams& other) { && wb.temperature == other.wb.temperature //&& colorShift.a == other.colorShift.a //&& colorShift.b == other.colorShift.b + && colorappearance.enabled == other.colorappearance.enabled + && colorappearance.degree == other.colorappearance.degree + && colorappearance.autodegree == other.colorappearance.autodegree + && colorappearance.surround == other.colorappearance.surround + && colorappearance.adapscen == other.colorappearance.adapscen + && colorappearance.adaplum == other.colorappearance.adaplum + && colorappearance.wbmodel == other.colorappearance.wbmodel + && colorappearance.algo == other.colorappearance.algo + + && colorappearance.jlight == other.colorappearance.jlight + && colorappearance.qbright == other.colorappearance.qbright + && colorappearance.chroma == other.colorappearance.chroma + && colorappearance.schroma == other.colorappearance.schroma + && colorappearance.mchroma == other.colorappearance.mchroma + && colorappearance.rstprotection == other.colorappearance.rstprotection + && colorappearance.contrast == other.colorappearance.contrast + && colorappearance.qcontrast == other.colorappearance.qcontrast + && colorappearance.colorh == other.colorappearance.colorh && impulseDenoise.enabled == other.impulseDenoise.enabled && impulseDenoise.thresh == other.impulseDenoise.thresh && dirpyrDenoise.enabled == other.dirpyrDenoise.enabled diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 6c3c37d59..97a8ec8b8 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -336,7 +336,7 @@ public: class WBParams { public: - static std::vector wbEntries; + static std::vector wbEntries; Glib::ustring method; int temperature; double green; @@ -345,6 +345,33 @@ class WBParams { static void cleanup(); }; + /** + * Parameters of colorappearance + */ + class ColorappearanceParams { + + public: + bool enabled; + int degree; + bool autodegree; + Glib::ustring surround; + double adapscen; + double adaplum; + Glib::ustring wbmodel; + Glib::ustring algo; + double contrast; + double qcontrast; + double jlight; + double qbright; + double chroma; + double schroma; + double mchroma; + double colorh; + double rstprotection; + bool surrsource; + bool gamut; + }; + /** * Parameters of the color shift */ @@ -377,43 +404,42 @@ class WBParams { bool edgesensitive; int amount; };*/ - - /** - * Parameters of defringing - */ - class DefringeParams { - + + /** + * Parameters of defringing + */ + class DefringeParams { + public: bool enabled; double radius; int threshold; - }; - - - /** - * Parameters of impulse denoising - */ - class ImpulseDenoiseParams { - + }; + + /** + * Parameters of impulse denoising + */ + class ImpulseDenoiseParams { + public: bool enabled; - int thresh; + int thresh; + + }; + + /** + * Parameters of the directional pyramid denoising + */ + class DirPyrDenoiseParams { - }; - - /** - * Parameters of the directional pyramid denoising - */ - class DirPyrDenoiseParams { - public: bool enabled; double luma; double Ldetail; double chroma; - double gamma; - double expcomp; - }; + double gamma; + double expcomp; + }; //EPD related parameters. class EPDParams{ @@ -691,13 +717,14 @@ class ProcParams { VibranceParams vibrance; ///< Vibrance parameters //ColorBoostParams colorBoost; ///< Color boost parameters WBParams wb; ///< White balance parameters + ColorappearanceParams colorappearance; //ColorShiftParams colorShift; ///< Color shift parameters //LumaDenoiseParams lumaDenoise; ///< Luminance denoising parameters //ColorDenoiseParams colorDenoise; ///< Color denoising parameters DefringeParams defringe; ///< Defringing parameters ImpulseDenoiseParams impulseDenoise; ///< Impulse denoising parameters DirPyrDenoiseParams dirpyrDenoise; ///< Directional Pyramid denoising parameters - EPDParams edgePreservingDecompositionUI; + EPDParams edgePreservingDecompositionUI; SHParams sh; ///< Shadow/highlight enhancement parameters CropParams crop; ///< Crop parameters CoarseTransformParams coarse; ///< Coarse transformation (90, 180, 270 deg rotation, h/v flipping) parameters @@ -712,7 +739,6 @@ class ProcParams { HRecParams hlrecovery; ///< Highlight recovery parameters ResizeParams resize; ///< Resize parameters ColorManagementParams icm; ///< 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 diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 2fc494523..bea100473 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -192,6 +192,26 @@ LUMINANCECURVE, // EvLCHCurve RGBCURVE, // EvVibranceSkinTonesCurve LUMINANCECURVE, // EvLLCCurve LUMINANCECURVE, // EvLLCredsk -ALLNORAW // EvDPDNLdetail +ALLNORAW, // EvDPDNLdetail +LUMINANCECURVE, // EvCATEnabled +LUMINANCECURVE, // EvCATDegree +LUMINANCECURVE, // EvCATMethodsur +LUMINANCECURVE, // EvCATAdapscen +LUMINANCECURVE, // EvCATAdapLum +LUMINANCECURVE, // EvCATMethodWB +LUMINANCECURVE, // EvCATJLight +LUMINANCECURVE, // EvCATChroma +LUMINANCECURVE, // EvCATAutoDegree +LUMINANCECURVE, // EvCATContrast +LUMINANCECURVE, // EvCATSurr +LUMINANCECURVE, // EvCATgamut +LUMINANCECURVE, // EvCATmethodalg +LUMINANCECURVE, // EvCATRstpro +LUMINANCECURVE, // EvCATQbright +LUMINANCECURVE, // EvCATQContrast +LUMINANCECURVE, // EvCATSChroma +LUMINANCECURVE, // EvCATMchroma +LUMINANCECURVE // EvCAThue + }; diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 7275066d8..f7e9d2475 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -691,6 +691,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei delete resImg;// << avoid mem leak! int fw = baseImg->width; int fh = baseImg->height; + //ColorTemp::CAT02 (baseImg, ¶ms) ;//perhaps not good! ImProcFunctions ipf (¶ms, false); ipf.setScale (sqrt(double(fw*fw+fh*fh))/sqrt(double(thumbImg->width*thumbImg->width+thumbImg->height*thumbImg->height))*scale); @@ -783,6 +784,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei //ipf.luminanceCurve (labView, labView, curve); ipf.chromiLuminanceCurve (labView, labView, curve1, curve2, satcurve,lhskcurve, curve, utili, autili, butili, ccutili,cclutili); ipf.vibrance(labView); + ColorTemp::ciecam_02 (labView, ¶ms); // color processing //ipf.colorCurve (labView, labView); diff --git a/rtengine/settings.h b/rtengine/settings.h index f4c93ab40..c0f067f0e 100644 --- a/rtengine/settings.h +++ b/rtengine/settings.h @@ -26,7 +26,10 @@ namespace rtengine { public: Glib::ustring iccDirectory; ///< The directory containing the possible output icc profiles int colorimetricIntent; ///< Colorimetric intent used at color space conversions - Glib::ustring monitorProfile; ///< ICC profile of the monitor (full path recommended) + int viewingdevice; // white of output device (D50...D65..) + int viewingdevicegrey; // level of grey output device + + Glib::ustring monitorProfile; ///< ICC profile of the monitor (full path recommended) bool autoMonitorProfile; ///< Try to auto-determine the correct monitor color profile bool verbose; @@ -43,11 +46,12 @@ namespace rtengine { Glib::ustring srgb; // default name of SRGB space profile Glib::ustring srgb10; // default name of SRGB space profile - bool gamutICC; // - bool gamutLch; - int protectred; - double protectredh; - + bool gamutICC; + bool gamutLch; + int protectred; + double protectredh; + int CRI_color; // N° for display Lab value ; 0 disabled + /** Creates a new instance of Settings. * @return a pointer to the new Settings instance. */ static Settings* create (); diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 359a818db..f86ddc49a 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -107,6 +107,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p imgsrc->getImage (currWB, tr, baseImg, pp, params.hlrecovery, params.icm, params.raw); if (pl) pl->setProgress (0.45); + // perform luma/chroma denoise LabImage* labView = new LabImage (fw,fh); if (params.dirpyrDenoise.enabled) { @@ -218,6 +219,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p //ipf.luminanceCurve (labView, labView, curve); ipf.chromiLuminanceCurve (labView, labView, curve1, curve2, satcurve,lhskcurve,curve, utili, autili, butili, ccutili,cclutili); ipf.vibrance(labView); +// ColorTemp::ciecam_02 (labView, ¶ms); ipf.impulsedenoise (labView); ipf.defringe (labView); @@ -241,6 +243,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p // directional pyramid equalizer ipf.dirpyrequalizer (labView);//TODO: this is the luminance tonecurve, not the RGB one + ColorTemp::ciecam_02 (labView, ¶ms); // end tile processing...??? //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index 0f63bceab..ba55d7356 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -28,7 +28,7 @@ set (BASESOURCEFILES profilestore.cc partialpastedlg.cc rawprocess.cc preprocess.cc darkframe.cc flatfield.cc rawcacorrection.cc rawexposure.cc dirpyrequalizer.cc hsvequalizer.cc defringe.cc - popupcommon.cc popupbutton.cc popuptogglebutton.cc sharpenedge.cc sharpenmicro.cc) + popupcommon.cc popupbutton.cc popuptogglebutton.cc sharpenedge.cc sharpenmicro.cc colorappearance.cc) include_directories (BEFORE "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/rtgui/addsetids.h b/rtgui/addsetids.h index 1f47a6d68..903733b6b 100644 --- a/rtgui/addsetids.h +++ b/rtgui/addsetids.h @@ -2,7 +2,7 @@ #define _ADDSETIDS_ -// UPDATE THE DEFAULT VALUE IN OPTIONS.CC TOO !!! +// UPDATE THE DEFAULT VALUE IN OPTIONS.CC int babehav[] TOO !!! #define ADDSET_TC_EXPCOMP 0 @@ -48,8 +48,19 @@ #define ADDSET_VIBRANCE_SATURATED 40 #define ADDSET_FREE_OUPUT_GAMMA 41 #define ADDSET_FREE_OUTPUT_SLOPE 42 - +#define ADDSET_CAT_DEGREE 43 +#define ADDSET_CAT_ADAPTSCENE 44 +#define ADDSET_CAT_ADAPTVIEWING 45 +#define ADDSET_CAT_LIGHT 46 +#define ADDSET_CAT_CHROMA 47 +#define ADDSET_CAT_CONTRAST 48 +#define ADDSET_CAT_RSTPRO 49 +#define ADDSET_CAT_BRIGHT 50 +#define ADDSET_CAT_CONTRAST_Q 51 +#define ADDSET_CAT_CHROMA_S 52 +#define ADDSET_CAT_CHROMA_M 53 +#define ADDSET_CAT_HUE 54 // When adding items, make sure to update ADDSET_PARAM_NUM -#define ADDSET_PARAM_NUM 43 // THIS IS USED AS A DELIMITER!! +#define ADDSET_PARAM_NUM 55 // THIS IS USED AS A DELIMITER!! #endif diff --git a/rtgui/adjuster.cc b/rtgui/adjuster.cc index de55ed34b..e2b64d3f3 100644 --- a/rtgui/adjuster.cc +++ b/rtgui/adjuster.cc @@ -27,13 +27,13 @@ #define MIN_RESET_BUTTON_HEIGHT 17 -extern Glib::ustring argv0; - Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep, double vdefault, bool editedcb) { adjusterListener = NULL; afterReset = false; blocked = false; + automatic = NULL; + eventPending = false; vMin = vmin; vMax = vmax; @@ -44,9 +44,12 @@ Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep // TODO: let the user chose the default value of Adjuster::delay, for slow machines delay = options.adjusterDelay; // delay is no more static, so we can set the delay individually (useful for the RAW editor tab) - set_border_width (2); + set_border_width (0); + set_spacing (2); hbox = Gtk::manage (new Gtk::HBox ()); + hbox->set_border_width(0); + hbox->set_spacing(2); adjustmentName = Glib::ustring(vlabel); @@ -61,7 +64,6 @@ Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep label = Gtk::manage (new Gtk::Label (adjustmentName, Gtk::ALIGN_LEFT)); hbox->pack_start (*label); } - reset = Gtk::manage (new Gtk::Button ()); reset->add (*Gtk::manage (new RTImage ("gtk-undo-ltr-small.png", "gtk-undo-rtl-small.png"))); @@ -90,6 +92,7 @@ Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep defaultVal = shapeValue (vdefault); initialDefaultVal = shapeValue (vdefault); editedState = defEditedState = Irrelevant; + autoState = Irrelevant; sliderChange = slider->signal_value_changed().connect( sigc::mem_fun(*this, &Adjuster::sliderChanged) ); spinChange = spin->signal_value_changed().connect ( sigc::mem_fun(*this, &Adjuster::spinChanged), true); @@ -104,6 +107,8 @@ Adjuster::Adjuster (Gtk::Image *imgIcon, double vmin, double vmax, double vstep, adjusterListener = NULL; afterReset = false; blocked = false; + automatic = NULL; + eventPending = false; vMin = vmin; vMax = vmax; @@ -114,13 +119,16 @@ Adjuster::Adjuster (Gtk::Image *imgIcon, double vmin, double vmax, double vstep, // TODO: let the user chose the default value of Adjuster::delay, for slow machines delay = options.adjusterDelay; // delay is no more static, so we can set the delay individually (useful for the RAW editor tab) - set_border_width (2); + set_border_width (0); + set_spacing (2); hbox = Gtk::manage (new Gtk::HBox ()); - + hbox->set_border_width(0); + hbox->set_spacing(2); if (editedcb) { editedCheckBox = Gtk::manage (new Gtk::CheckButton ()); + editedCheckBox->set_border_width (0); editedChange = editedCheckBox->signal_toggled().connect( sigc::mem_fun(*this, &Adjuster::editedToggled) ); hbox->pack_start (*editedCheckBox); } @@ -158,6 +166,7 @@ Adjuster::Adjuster (Gtk::Image *imgIcon, double vmin, double vmax, double vstep, defaultVal = shapeValue (vdefault); initialDefaultVal = shapeValue (vdefault); editedState = defEditedState = Irrelevant; + autoState = Irrelevant; sliderChange = slider->signal_value_changed().connect( sigc::mem_fun(*this, &Adjuster::sliderChanged) ); spinChange = spin->signal_value_changed().connect ( sigc::mem_fun(*this, &Adjuster::spinChanged), true); @@ -173,6 +182,45 @@ Adjuster::~Adjuster () { spinChange.block (true); delayConnection.block (true); adjusterListener = NULL; + if (automatic) delete automatic; +} + +void Adjuster::addAutoButton () { + if (!automatic) { + automatic = new Gtk::CheckButton (); + //automatic->add (*Gtk::manage (new RTImage ("processing.png"))); + automatic->set_border_width (0); + automatic->set_tooltip_text (M("GENERAL_AUTO")); + autoChange = automatic->signal_toggled().connect( sigc::mem_fun(*this, &Adjuster::autoToggled) ); + + hbox->pack_end (*automatic, Gtk::PACK_SHRINK, 0); + hbox->reorder_child (*automatic, 0); + } +} + +void Adjuster::delAutoButton () { + if (automatic) { + removeIfThere(hbox, automatic); + delete automatic; + automatic = NULL; + } +} + +void Adjuster::throwOnButtonRelease(bool throwOnBRelease) { + + if (throwOnBRelease) { + if (!buttonReleaseSlider.connected()) + buttonReleaseSlider = slider->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &Adjuster::sliderReleased) ); + if (!buttonReleaseSpin.connected()) + buttonReleaseSpin = spin->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &Adjuster::spinReleased) ); // Use the same callback hook + } + else { + if (buttonReleaseSlider.connected()) + buttonReleaseSlider.disconnect(); + if (buttonReleaseSpin.connected()) + buttonReleaseSpin.disconnect(); + } + eventPending = false; } void Adjuster::setDefault (double def) { @@ -185,24 +233,64 @@ void Adjuster::setDefaultEditedState (EditedState eState) { defEditedState = eState; } +void Adjuster::autoToggled () { + + if (!editedCheckBox) { + // If not used in the BatchEditor panel + if (automatic->get_active()) { + // Disable the slider and spin button + spin->set_sensitive(false); + slider->set_sensitive(false); + } + else { + // Enable the slider and spin button + spin->set_sensitive(true); + slider->set_sensitive(true); + } + } + + if (adjusterListener!=NULL && !blocked) { + adjusterListener->adjusterAutoToggled(this, automatic->get_active()); + } +} + +void Adjuster::sliderReleased (GdkEventButton* event) { + + if ((event != NULL) && (event->button == 1)) { + if (delayConnection.connected()) + delayConnection.disconnect (); + notifyListener(); + } +} + +void Adjuster::spinReleased (GdkEventButton* event) { + + if ((event != NULL) && delay==0) { + if (delayConnection.connected()) + delayConnection.disconnect (); + notifyListener(); + } +} + +// Please note that it won't change the "Auto" CheckBox's state, if there void Adjuster::resetPressed (GdkEventButton* event) { if (editedState!=Irrelevant) { editedState = defEditedState; if (editedCheckBox) { - editedChange.block (true); + editedChange.block (true); editedCheckBox->set_active (defEditedState==Edited); - editedChange.block (false); - } + editedChange.block (false); + } refreshLabelStyle (); } - afterReset = true; - if ((event != NULL) && (event->state & GDK_CONTROL_MASK) && (event->button == 1)) - // CTRL pressed : resetting to current default value - slider->set_value (defaultVal); - else - // no modifier key or addMode=true : resetting to initial default value - slider->set_value (initialDefaultVal); + afterReset = true; + if ((event != NULL) && (event->state & GDK_CONTROL_MASK) && (event->button == 1)) + // CTRL pressed : resetting to current default value + slider->set_value (defaultVal); + else + // no modifier key or addMode=true : resetting to initial default value + slider->set_value (initialDefaultVal); } double Adjuster::shapeValue (double a) { @@ -248,24 +336,34 @@ void Adjuster::setAddMode(bool addM) { void Adjuster::spinChanged () { + if (delayConnection.connected()) + delayConnection.disconnect (); + sliderChange.block (true); slider->set_value (spin->get_value ()); sliderChange.block (false); if (delay==0) { - if (adjusterListener!=NULL && !blocked) - adjusterListener->adjusterChanged (this, spin->get_value ()); + if (adjusterListener && !blocked) { + if (!buttonReleaseSlider.connected() || afterReset) { + eventPending = false; + adjusterListener->adjusterChanged (this, spin->get_value ()); + } + else eventPending = true; + } } - else - Glib::signal_idle().connect (sigc::mem_fun(*this, &Adjuster::notifyListener)); - + else { + eventPending = true; + delayConnection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &Adjuster::notifyListener), delay); + } + if (editedState==UnEdited) { editedState = Edited; if (editedCheckBox) { - editedChange.block (true); + editedChange.block (true); editedCheckBox->set_active (true); - editedChange.block (false); - } + editedChange.block (false); + } refreshLabelStyle (); } afterReset = false; @@ -275,25 +373,32 @@ void Adjuster::sliderChanged () { if (delayConnection.connected()) delayConnection.disconnect (); - + spinChange.block (true); spin->set_value (slider->get_value ()); spinChange.block (false); - if (delay==0) { - if (adjusterListener && !blocked) + if (delay==0 || afterReset) { + if (adjusterListener && !blocked) { + if (!buttonReleaseSlider.connected() || afterReset) { + eventPending = false; adjusterListener->adjusterChanged (this, spin->get_value ()); + } + else eventPending = true; + } } - else + else { + eventPending = true; delayConnection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &Adjuster::notifyListener), delay); + } if (!afterReset && editedState==UnEdited) { editedState = Edited; if (editedCheckBox) { - editedChange.block (true); + editedChange.block (true); editedCheckBox->set_active (true); - editedChange.block (false); - } + editedChange.block (false); + } refreshLabelStyle (); } afterReset = false; @@ -310,36 +415,71 @@ void Adjuster::setValue (double a) { afterReset = false; } +void Adjuster::setAutoValue (bool a) { + if (automatic) { + bool oldVal = autoChange.block(true); + automatic->set_active(a); + autoChange.block(oldVal); + if (!editedCheckBox) { + // If not used in the BatchEditor panel + if (a) { + // Disable the slider and spin button + spin->set_sensitive(false); + slider->set_sensitive(false); + } + else { + // Enable the slider and spin button + spin->set_sensitive(true); + slider->set_sensitive(true); + } + } + } +} + bool Adjuster::notifyListener () { + if (eventPending && adjusterListener!=NULL && !blocked) { + GThreadLock lock; + adjusterListener->adjusterChanged (this, spin->get_value ()); + } + eventPending = false; + + return false; +} + +bool Adjuster::notifyListenerAutoToggled () { + if (adjusterListener!=NULL && !blocked) { GThreadLock lock; - adjusterListener->adjusterChanged (this, spin->get_value ()); + adjusterListener->adjusterAutoToggled(this, automatic->get_active()); } return false; } void Adjuster::setEnabled (bool enabled) { - spin->set_sensitive (enabled); - slider->set_sensitive (enabled); + bool autoVal = automatic && !editedCheckBox ? automatic->get_active() : true; + spin->set_sensitive (enabled && autoVal); + slider->set_sensitive (enabled && autoVal); + if (automatic) + automatic->set_sensitive (enabled); } void Adjuster::setEditedState (EditedState eState) { if (editedState!=eState) { if (editedCheckBox) { - editedChange.block (true); + editedChange.block (true); editedCheckBox->set_active (eState==Edited); - editedChange.block (false); - } + editedChange.block (false); + } editedState = eState; refreshLabelStyle (); } } EditedState Adjuster::getEditedState () { - + if (editedState!=Irrelevant && editedCheckBox) editedState = editedCheckBox->get_active () ? Edited : UnEdited; return editedState; @@ -354,7 +494,7 @@ void Adjuster::showEditedCB () { editedCheckBox = Gtk::manage(new Gtk::CheckButton (adjustmentName)); hbox->pack_start (*editedCheckBox, Gtk::PACK_SHRINK, 2); hbox->reorder_child (*editedCheckBox, 0); - editedChange = editedCheckBox->signal_toggled().connect( sigc::mem_fun(*this, &Adjuster::editedToggled) ); + editedChange = editedCheckBox->signal_toggled().connect( sigc::mem_fun(*this, &Adjuster::editedToggled) ); } } @@ -365,13 +505,15 @@ void Adjuster::refreshLabelStyle () { fd.set_weight (editedState==Edited ? Pango::WEIGHT_BOLD : Pango::WEIGHT_NORMAL); style->set_font (fd); label->set_style (style); - label->queue_draw ();*/ + label->queue_draw ();*/ } void Adjuster::editedToggled () { - - if (adjusterListener && !blocked) + + if (adjusterListener && !blocked) { adjusterListener->adjusterChanged (this, spin->get_value ()); + } + eventPending = false; } double Adjuster::trimValue (double& val) { diff --git a/rtgui/adjuster.h b/rtgui/adjuster.h index cd9fe83e0..2390d6764 100644 --- a/rtgui/adjuster.h +++ b/rtgui/adjuster.h @@ -27,8 +27,9 @@ class Adjuster; class AdjusterListener { public: - virtual ~AdjusterListener() {}; + virtual ~AdjusterListener() {}; virtual void adjusterChanged (Adjuster* a, double newval) {} + virtual void adjusterAutoToggled (Adjuster* a, bool newval) {} }; @@ -41,21 +42,28 @@ class Adjuster : public Gtk::VBox { MyHScale* slider; MySpinButton* spin; Gtk::Button* reset; + Gtk::CheckButton* automatic; AdjusterListener* adjusterListener; sigc::connection delayConnection; sigc::connection spinChange; sigc::connection sliderChange; sigc::connection editedChange; + sigc::connection autoChange; + sigc::connection buttonReleaseSlider; + sigc::connection buttonReleaseSpin; bool listenerReady; double defaultVal; // current default value (it can change when switching from ADD or SET mode) double initialDefaultVal; // default value at construction time EditedState editedState; EditedState defEditedState; + EditedState autoState; + EditedState defAutoState; int digits; Gtk::CheckButton* editedCheckBox; - bool afterReset; + bool afterReset; bool blocked; bool addMode; + bool eventPending; double vMin; double vMax; double vStep; @@ -70,6 +78,19 @@ class Adjuster : public Gtk::VBox { Adjuster (Glib::ustring label, double vmin, double vmax, double vstep, double vdefault, bool editedCheckBox=false); Adjuster (Gtk::Image *imgIcon, double vmin, double vmax, double vstep, double vdefault, bool editedCheckBox=false); virtual ~Adjuster (); + + // Add an "Automatic" checkbox next to the reset button. + void addAutoButton(); + // Remove the "Automatic" checkbox next to the reset button. + void delAutoButton(); + // Send back the value of og the Auto checkbox + bool getAutoValue () { return automatic!=NULL ? automatic->get_active () : false; } + void setAutoValue (bool a); + bool notifyListenerAutoToggled (); + void autoToggled (); + void setAutoInconsistent (bool i) { if (automatic) automatic->set_inconsistent(i); } + bool getAutoInconsistent () { return automatic ? automatic->get_inconsistent() : true /* we have to return something */; } + void setAdjusterListener (AdjusterListener* alistener) { adjusterListener = alistener; } // return the value trimmed to the limits at construction time @@ -77,26 +98,30 @@ class Adjuster : public Gtk::VBox { // return the value trimmed to the limits at construction time int getIntValue () { return spin->get_value_as_int (); } // return the value trimmed to the limits at construction time, - // method only used by the history manager - Glib::ustring getTextValue () { return spin->get_text (); } + // method only used by the history manager, so decoration is added if addMode=true + Glib::ustring getTextValue () { if (addMode) return Glib::ustring::compose("%1", spin->get_text ()); else return spin->get_text (); } void setLabel (Glib::ustring lbl) { label->set_label(lbl); } - void setValue (double a); + void setValue (double a); void setLimits (double vmin, double vmax, double vstep, double vdefault); void setEnabled (bool enabled); void setDefault (double def); + // will let the adjuster throw it's "changed" signal when the mouse button is released. Can work altogether with the delay value. + void throwOnButtonRelease(bool throwOnBRelease=true); void setNbDisplayedChars (int nbr) { spin->set_width_chars(nbr); } void setEditedState (EditedState eState); EditedState getEditedState (); void setDefaultEditedState (EditedState eState); void showEditedCB (); - void block(bool isBlocked) { blocked = isBlocked; } - + bool block(bool isBlocked) { bool oldValue = blocked; blocked = isBlocked; return oldValue; } + void setAddMode(bool addM); bool getAddMode() { return addMode; }; void spinChanged (); void sliderChanged (); bool notifyListener (); + void sliderReleased (GdkEventButton* event); + void spinReleased (GdkEventButton* event); void resetPressed (GdkEventButton* event); void editedToggled (); double trimValue (double& val); diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index 4b4457054..c40b4cde3 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -38,7 +38,7 @@ BatchToolPanelCoordinator::BatchToolPanelCoordinator (FilePanel* parent) : ToolP metadataPanel = 0; toiM = 0; - for (size_t i=0; isetBatchMode (true); } @@ -48,7 +48,7 @@ void BatchToolPanelCoordinator::selectionChanged (const std::vector& closeSession (); this->selected = selected; selFileNames.clear (); - for (size_t i=0; igetFileName ()); initSession (); } @@ -58,18 +58,18 @@ void BatchToolPanelCoordinator::closeSession (bool save) { pparamsEdited.set (false); - for (size_t i=0; iremoveThumbnailListener (this); if (somethingChanged && save) { // read new values from the gui - for (size_t i=0; iwrite (&pparams, &pparamsEdited); // combine with initial parameters and set ProcParams newParams; - for (size_t i=0; isetProcParams (newParams, NULL, BATCHEDITOR, true); } } - for (size_t i=0; iclearParamChanges (); } @@ -89,7 +89,7 @@ void BatchToolPanelCoordinator::initSession () { somethingChanged = false; initialPP.resize (selected.size()); - for (size_t i=0; igetProcParams (); selected[i]->applyAutoExp (initialPP[i]); selected[i]->addThumbnailListener (this); @@ -120,11 +120,15 @@ void BatchToolPanelCoordinator::initSession () { if (selected.size()==1) { + for (size_t i=0; isetMultiImage(false); + toneCurve->setAdjusterBehavior (false, false, false, false, false, false, false, false); lcurve->setAdjusterBehavior (false, false, false); whitebalance->setAdjusterBehavior (false, false); vibrance->setAdjusterBehavior (false, false, false); vignetting->setAdjusterBehavior (false, false, false, false); + colorappearance->setAdjusterBehavior (false, false, false, false, false, false, false, false, false, false, false, false); rotate->setAdjusterBehavior (false); distortion->setAdjusterBehavior (false); perspective->setAdjusterBehavior (false); @@ -144,10 +148,14 @@ void BatchToolPanelCoordinator::initSession () { } else { + for (size_t i=0; isetMultiImage(true); + toneCurve->setAdjusterBehavior (options.baBehav[ADDSET_TC_EXPCOMP], options.baBehav[ADDSET_TC_HLCOMPAMOUNT],options.baBehav[ADDSET_TC_HLCOMPTHRESH], options.baBehav[ADDSET_TC_BRIGHTNESS], options.baBehav[ADDSET_TC_BLACKLEVEL],options.baBehav[ADDSET_TC_SHCOMP], options.baBehav[ADDSET_TC_CONTRAST], options.baBehav[ADDSET_TC_SATURATION]); lcurve->setAdjusterBehavior (options.baBehav[ADDSET_LC_BRIGHTNESS], options.baBehav[ADDSET_LC_CONTRAST], options.baBehav[ADDSET_LC_CHROMATICITY]); whitebalance->setAdjusterBehavior (options.baBehav[ADDSET_WB_TEMPERATURE], options.baBehav[ADDSET_WB_GREEN]); vignetting->setAdjusterBehavior (options.baBehav[ADDSET_VIGN_AMOUNT], options.baBehav[ADDSET_VIGN_RADIUS], options.baBehav[ADDSET_VIGN_STRENGTH], options.baBehav[ADDSET_VIGN_CENTER]); + colorappearance->setAdjusterBehavior (options.baBehav[ADDSET_CAT_DEGREE], options.baBehav[ADDSET_CAT_ADAPTSCENE], options.baBehav[ADDSET_CAT_ADAPTVIEWING], options.baBehav[ADDSET_CAT_LIGHT], options.baBehav[ADDSET_CAT_CHROMA],options.baBehav[ADDSET_CAT_CONTRAST],options.baBehav[ADDSET_CAT_RSTPRO],options.baBehav[ADDSET_CAT_BRIGHT],options.baBehav[ADDSET_CAT_CONTRAST_Q],options.baBehav[ADDSET_CAT_CHROMA_S],options.baBehav[ADDSET_CAT_CHROMA_M],options.baBehav[ADDSET_CAT_HUE]); rotate->setAdjusterBehavior (options.baBehav[ADDSET_ROTATE_DEGREE]); distortion->setAdjusterBehavior (options.baBehav[ADDSET_DIST_AMOUNT]); perspective->setAdjusterBehavior (options.baBehav[ADDSET_PERSPECTIVE]); @@ -196,6 +204,19 @@ void BatchToolPanelCoordinator::initSession () { if (options.baBehav[ADDSET_VIBRANCE_PASTELS]) pparams.vibrance.pastels = 0; if (options.baBehav[ADDSET_VIBRANCE_SATURATED]) pparams.vibrance.saturated = 0; + if (options.baBehav[ADDSET_CAT_DEGREE]) pparams.colorappearance.degree = 0; + if (options.baBehav[ADDSET_CAT_ADAPTSCENE]) pparams.colorappearance.adapscen = 0; + if (options.baBehav[ADDSET_CAT_ADAPTVIEWING]) pparams.colorappearance.adaplum = 0; + if (options.baBehav[ADDSET_CAT_LIGHT]) pparams.colorappearance.jlight = 0; + if (options.baBehav[ADDSET_CAT_BRIGHT]) pparams.colorappearance.qbright = 0; + if (options.baBehav[ADDSET_CAT_CHROMA]) pparams.colorappearance.chroma = 0; + if (options.baBehav[ADDSET_CAT_CHROMA_S]) pparams.colorappearance.schroma = 0; + if (options.baBehav[ADDSET_CAT_CHROMA_M]) pparams.colorappearance.mchroma = 0; + if (options.baBehav[ADDSET_CAT_RSTPRO]) pparams.colorappearance.rstprotection = 0; + if (options.baBehav[ADDSET_CAT_CONTRAST]) pparams.colorappearance.contrast = 0; + if (options.baBehav[ADDSET_CAT_CONTRAST_Q]) pparams.colorappearance.qcontrast = 0; + if (options.baBehav[ADDSET_CAT_HUE]) pparams.colorappearance.colorh = 0; + if (options.baBehav[ADDSET_FREE_OUPUT_GAMMA]) pparams.icm.gampos = 0; if (options.baBehav[ADDSET_FREE_OUTPUT_SLOPE]) pparams.icm.slpos = 0; @@ -227,14 +248,14 @@ void BatchToolPanelCoordinator::initSession () { if (options.baBehav[ADDSET_RAWEXPOS_BLACKS]) pparams.raw.blackzero = pparams.raw.blackone = pparams.raw.blacktwo = pparams.raw.blackthree = 0; } - for (size_t i=0; isetDefaults (&pparams, &pparamsEdited); toolPanels[i]->read (&pparams, &pparamsEdited); // TODO: autoOpenCurve has been disabled because initSession is called on each parameter change from the editor panel, // if the thumbnail remains selected in the DirectoryBrowser (i.e. always, unless the user think about deselecting it) //toolPanels[i]->autoOpenCurve(); } - for (size_t i=0; iprocParamsChanged (&pparams, rtengine::EvPhotoLoaded, M("BATCH_PROCESSING"), &pparamsEdited); } @@ -249,27 +270,27 @@ void BatchToolPanelCoordinator::panelChanged (rtengine::ProcEvent event, const G pparamsEdited.set (false); // read new values from the gui - for (size_t i=0; iwrite (&pparams, &pparamsEdited); // TODO: We may update the crop on coarse rotate events here, like in ToolPanelCoordinator::panelChanged if (event==rtengine::EvAutoExp || event==rtengine::EvClip) - for (size_t i=0; iapplyAutoExp (initialPP[i]); } if (event==rtengine::EvAutoDIST) { - for (size_t i=0; isetProcParams (newParams, NULL, BATCHEDITOR, false); } - for (size_t i=0; iprocParamsChanged (&pparams, event, descr, &pparamsEdited); } @@ -330,7 +351,7 @@ void BatchToolPanelCoordinator::profileChange (const rtengine::procparams::Part pparamsEdited = *paramsEdited; - for (size_t i=0; iread (&pparams, &pparamsEdited); // I guess we don't want to automatically unfold curve editors here... @@ -338,18 +359,18 @@ void BatchToolPanelCoordinator::profileChange (const rtengine::procparams::Part somethingChanged = true; // read new values from the gui - for (size_t i=0; iwrite (&pparams, &pparamsEdited); // combine with initial parameters of each image and set ProcParams newParams; - for (size_t i=0; isetProcParams (newParams, NULL, BATCHEDITOR, false); } - for (size_t i=0; iprocParamsChanged (&pparams, event, descr, &pparamsEdited); } @@ -379,7 +400,7 @@ void BatchToolPanelCoordinator::spotWBselected (int x, int y, Thumbnail* thm) { // toolBar->setTool (TOOL_HAND); if (x>0 && y>0 && thm) { - for (size_t i=0; isetAdjusterListener (this); diff --git a/rtgui/chmixer.cc b/rtgui/chmixer.cc index 8575a7be1..0f6795ef9 100644 --- a/rtgui/chmixer.cc +++ b/rtgui/chmixer.cc @@ -26,6 +26,8 @@ extern Glib::ustring argv0; ChMixer::ChMixer (): Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + imgIcon[0] = Gtk::manage (new RTImage ("Chanmixer-RR.png")); imgIcon[1] = Gtk::manage (new RTImage ("Chanmixer-RG.png")); imgIcon[2] = Gtk::manage (new RTImage ("Chanmixer-RB.png")); @@ -49,7 +51,7 @@ ChMixer::ChMixer (): Gtk::VBox(), FoldableToolPanel(this) { pack_start (*rlabel); for (int i=0; i<3; i++) pack_start (*red[i]); - pack_start (*rsep); + pack_start (*rsep, Gtk::PACK_EXPAND_WIDGET, 4); Gtk::Label* glabel = Gtk::manage (new Gtk::Label ()); glabel->set_markup (Glib::ustring("\t") + M("TP_CHMIXER_GREEN") + Glib::ustring(":")); @@ -65,7 +67,7 @@ ChMixer::ChMixer (): Gtk::VBox(), FoldableToolPanel(this) { pack_start (*glabel); for (int i=0; i<3; i++) pack_start (*green[i]); - pack_start (*gsep); + pack_start (*gsep, Gtk::PACK_EXPAND_WIDGET, 4); Gtk::Label* blabel = Gtk::manage (new Gtk::Label ()); blabel->set_markup (Glib::ustring("\t") + M("TP_CHMIXER_BLUE") + Glib::ustring(":")); diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc new file mode 100644 index 000000000..4158a1e1e --- /dev/null +++ b/rtgui/colorappearance.cc @@ -0,0 +1,726 @@ +/* +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include "colorappearance.h" +#include +#include +#include "guiutils.h" + +using namespace rtengine; +using namespace rtengine::procparams; + +Colorappearance::Colorappearance () : Gtk::VBox(), FoldableToolPanel(this) { + + set_border_width(4); + + enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); + enabled->set_active (false); + pack_start (*enabled); + + + // ------------------------ Process #1: Converting to CIECAM + + + // Process 1 frame + Gtk::Frame *p1Frame; + // Vertical box container for the content of the Process 1 frame + Gtk::VBox *p1VBox; + + p1Frame = Gtk::manage (new Gtk::Frame(M("TP_COLORAPP_LABEL_SCENE")) ); + p1Frame->set_border_width(0); + p1Frame->set_label_align(0.025, 0.5); + + p1VBox = Gtk::manage ( new Gtk::VBox()); + p1VBox->set_border_width(4); + p1VBox->set_spacing(2); + + degree = Gtk::manage (new Adjuster (M("TP_COLORAPP_CIECAT_DEGREE"), 0., 100., 1., 100.)); + if (degree->delay < 1000) degree->delay = 1000; + degree->throwOnButtonRelease(); + degree->addAutoButton(); + degree->set_tooltip_markup (M("TP_COLORAPP_DEGREE_TOOLTIP")); + p1VBox->pack_start (*degree); + + surrsource = Gtk::manage (new Gtk::CheckButton (M("TP_COLORAPP_SURSOURCE"))); + surrsource->set_tooltip_markup (M("TP_COLORAPP_SURSOURCE_TOOLTIP")); + p1VBox->pack_start (*surrsource, Gtk::PACK_SHRINK); + + Gtk::HBox* wbmHBox = Gtk::manage (new Gtk::HBox ()); + wbmHBox->set_border_width (0); + wbmHBox->set_spacing (2); + wbmHBox->set_tooltip_markup (M("TP_COLORAPP_MODEL_TOOLTIP")); + Gtk::Label* wbmLab = Gtk::manage (new Gtk::Label (M("TP_COLORAPP_MODEL")+":")); + wbmHBox->pack_start (*wbmLab, Gtk::PACK_SHRINK); + wbmodel = Gtk::manage (new MyComboBoxText ()); + wbmodel->append_text (M("TP_COLORAPP_WBRT")); + wbmodel->append_text (M("TP_COLORAPP_WBCAM")); + wbmodel->set_active (0); + wbmHBox->pack_start (*wbmodel); + p1VBox->pack_start (*wbmHBox); + + adapscen = Gtk::manage (new Adjuster (M("TP_COLORAPP_ADAPTSCENE"), 1, 4000., 1., 2000.)); + if (adapscen->delay < 1000) adapscen->delay = 1000; + adapscen->throwOnButtonRelease(); + adapscen->set_tooltip_markup (M("TP_COLORAPP_ADAPTSCENE_TOOLTIP")); + p1VBox->pack_start (*adapscen); + + p1Frame->add(*p1VBox); + pack_start (*p1Frame, Gtk::PACK_EXPAND_WIDGET, 4); + + + // ------------------------ Process #2: Modifying image inside CIECAM + + + // Process 1 frame + Gtk::Frame *p2Frame; + // Vertical box container for the content of the Process 1 frame + Gtk::VBox *p2VBox; + + p2Frame = Gtk::manage (new Gtk::Frame(M("TP_COLORAPP_LABEL_CAM02")) ); + p2Frame->set_border_width(0); + p2Frame->set_label_align(0.025, 0.5); + + p2VBox = Gtk::manage ( new Gtk::VBox()); + p2VBox->set_border_width(4); + p2VBox->set_spacing(2); + + Gtk::HBox* alHBox = Gtk::manage (new Gtk::HBox ()); + alHBox->set_border_width (0); + alHBox->set_spacing (2); + alHBox->set_tooltip_markup (M("TP_COLORAPP_ALGO_TOOLTIP")); + Gtk::Label* alLabel = Gtk::manage (new Gtk::Label (M("TP_COLORAPP_ALGO")+":")); + alHBox->pack_start (*alLabel, Gtk::PACK_SHRINK); + algo = Gtk::manage (new MyComboBoxText ()); + algo->append_text (M("TP_COLORAPP_ALGO_JC")); + algo->append_text (M("TP_COLORAPP_ALGO_JS")); + algo->append_text (M("TP_COLORAPP_ALGO_QM")); + algo->append_text (M("TP_COLORAPP_ALGO_ALL")); + algo->set_active (0); + alHBox->pack_start (*algo); + p2VBox->pack_start (*alHBox); + + p2VBox->pack_start (*Gtk::manage (new Gtk::HSeparator()), Gtk::PACK_EXPAND_WIDGET, 4); + + jlight = Gtk::manage (new Adjuster (M("TP_COLORAPP_LIGHT"), -100.0, 100.0, 0.1, 0.)); + if (jlight->delay < 1000) jlight->delay = 1000; + jlight->throwOnButtonRelease(); + jlight->set_tooltip_markup (M("TP_COLORAPP_LIGHT_TOOLTIP")); + p2VBox->pack_start (*jlight); + + qbright = Gtk::manage (new Adjuster (M("TP_COLORAPP_BRIGHT"), -100.0, 100.0, 0.1, 0.)); + if (qbright->delay < 1000) qbright->delay = 1000; + qbright->throwOnButtonRelease(); + qbright->set_tooltip_markup (M("TP_COLORAPP_BRIGHT_TOOLTIP")); + p2VBox->pack_start (*qbright); + + chroma = Gtk::manage (new Adjuster (M("TP_COLORAPP_CHROMA"), -100.0, 100.0, 0.1, 0.)); + if (chroma->delay < 1000) chroma->delay = 1000; + chroma->throwOnButtonRelease(); + chroma->set_tooltip_markup (M("TP_COLORAPP_CHROMA_TOOLTIP")); + p2VBox->pack_start (*chroma); + + rstprotection = Gtk::manage ( new Adjuster (M("TP_COLORAPP_RSTPRO"), 0., 100., 0.1, 0.) ); + if (rstprotection->delay < 1000) rstprotection->delay = 1000; + rstprotection->throwOnButtonRelease(); + rstprotection->set_tooltip_markup (M("TP_COLORAPP_RSTPRO_TOOLTIP")); + p2VBox->pack_start (*rstprotection); + + schroma = Gtk::manage (new Adjuster (M("TP_COLORAPP_CHROMA_S"), -100.0, 100.0, 0.1, 0.)); + if (schroma->delay < 1000) schroma->delay = 1000; + schroma->throwOnButtonRelease(); + schroma->set_tooltip_markup (M("TP_COLORAPP_CHROMA_S_TOOLTIP")); + p2VBox->pack_start (*schroma); + + mchroma = Gtk::manage (new Adjuster (M("TP_COLORAPP_CHROMA_M"), -100.0, 100.0, 0.1, 0.)); + if (mchroma->delay < 1000) mchroma->delay = 1000; + mchroma->throwOnButtonRelease(); + mchroma->set_tooltip_markup (M("TP_COLORAPP_CHROMA_M_TOOLTIP")); + p2VBox->pack_start (*mchroma); + + contrast = Gtk::manage (new Adjuster (M("TP_COLORAPP_CONTRAST"), -100.0, 100.0, 0.1, 0.)); + if (contrast->delay < 1000) contrast->delay = 1000; + contrast->throwOnButtonRelease(); + contrast->set_tooltip_markup (M("TP_COLORAPP_CONTRAST_TOOLTIP")); + p2VBox->pack_start (*contrast); + + qcontrast = Gtk::manage (new Adjuster (M("TP_COLORAPP_CONTRAST_Q"), -100.0, 100.0, 0.1, 0.)); + if (qcontrast->delay < 1000) qcontrast->delay = 1000; + qcontrast->throwOnButtonRelease(); + qcontrast->set_tooltip_markup (M("TP_COLORAPP_CONTRAST_Q_TOOLTIP")); + p2VBox->pack_start (*qcontrast); + + colorh = Gtk::manage (new Adjuster (M("TP_COLORAPP_HUE"), -100.0, 100.0, 0.1, 0.)); + if (colorh->delay < 1000) colorh->delay = 1000; + colorh->throwOnButtonRelease(); + colorh->set_tooltip_markup (M("TP_COLORAPP_HUE_TOOLTIP")); + p2VBox->pack_start (*colorh); + + p2Frame->add(*p2VBox); + pack_start (*p2Frame, Gtk::PACK_EXPAND_WIDGET, 4); + + + // ------------------------ Process #3: Converting back to Lab/RGB + + + // Process 3 frame + Gtk::Frame *p3Frame; + // Vertical box container for the content of the Process 3 frame + Gtk::VBox *p3VBox; + + p3Frame = Gtk::manage (new Gtk::Frame(M("TP_COLORAPP_LABEL_VIEWING")) ); // "Editing viewing conditions" ??? + p3Frame->set_border_width(0); + p3Frame->set_label_align(0.025, 0.5); + + p3VBox = Gtk::manage ( new Gtk::VBox()); + p3VBox->set_border_width(4); + p3VBox->set_spacing(2); + + adaplum = Gtk::manage (new Adjuster (M("TP_COLORAPP_ADAPTVIEWING"), 0.1, 1000., 0.1, 16.)); + if (adaplum->delay < 1000) adaplum->delay = 1000; + adaplum->throwOnButtonRelease(); + adaplum->set_tooltip_markup (M("TP_COLORAPP_ADAPTVIEWING_TOOLTIP")); + p3VBox->pack_start (*adaplum); + + Gtk::HBox* surrHBox = Gtk::manage (new Gtk::HBox ()); + surrHBox->set_border_width (0); + surrHBox->set_spacing (2); + surrHBox->set_tooltip_markup(M("TP_COLORAPP_SURROUND_TOOLTIP")); + Gtk::Label* surrLabel = Gtk::manage (new Gtk::Label (M("TP_COLORAPP_SURROUND")+":")); + surrHBox->pack_start (*surrLabel, Gtk::PACK_SHRINK); + surround = Gtk::manage (new MyComboBoxText ()); + surround->append_text (M("TP_COLORAPP_SURROUND_AVER")); + surround->append_text (M("TP_COLORAPP_SURROUND_DIM")); + surround->append_text (M("TP_COLORAPP_SURROUND_DARK")); + surround->append_text (M("TP_COLORAPP_SURROUND_EXDARK")); + surround->set_active (1); + surrHBox->pack_start (*surround); + p3VBox->pack_start (*surrHBox); + + p3Frame->add(*p3VBox); + pack_start (*p3Frame, Gtk::PACK_EXPAND_WIDGET, 4); + + + // ------------------------ Lab Gamut control + + + gamut = Gtk::manage (new Gtk::CheckButton (M("TP_COLORAPP_GAMUT"))); + gamut->set_tooltip_markup (M("TP_COLORAPP_GAMUT_TOOLTIP")); + gamutconn = gamut->signal_toggled().connect( sigc::mem_fun(*this, &Colorappearance::gamut_toggled) ); + pack_start (*gamut, Gtk::PACK_SHRINK); + + + // ------------------------ Listening events + + + surrconn = surrsource->signal_toggled().connect( sigc::mem_fun(*this, &Colorappearance::surrsource_toggled) ); + enaConn = enabled->signal_toggled().connect( sigc::mem_fun(*this, &Colorappearance::enabledChanged) ); + wbmodelconn = wbmodel->signal_changed().connect ( sigc::mem_fun(*this, &Colorappearance::wbmodelChanged) ); + algoconn = algo->signal_changed().connect ( sigc::mem_fun(*this, &Colorappearance::algoChanged) ); + surroundconn = surround->signal_changed().connect ( sigc::mem_fun(*this, &Colorappearance::surroundChanged) ); + + degree->setAdjusterListener (this); + adapscen->setAdjusterListener (this); + adaplum->setAdjusterListener (this); + jlight->setAdjusterListener (this); + qbright->setAdjusterListener (this); + colorh->setAdjusterListener (this); + chroma->setAdjusterListener (this); + schroma->setAdjusterListener (this); + mchroma->setAdjusterListener (this); + contrast->setAdjusterListener (this); + qcontrast->setAdjusterListener (this); + rstprotection->setAdjusterListener (this); + + show_all(); +} + +bool Colorappearance::bgTTipQuery(int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip) { + return true; +} + +bool Colorappearance::srTTipQuery(int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip) { + return true; +} + +void Colorappearance::read (const ProcParams* pp, const ParamsEdited* pedited) { + + disableListener (); + + if (pedited) { + degree->setEditedState (pedited->colorappearance.degree ? Edited : UnEdited); + adapscen->setEditedState (pedited->colorappearance.adapscen ? Edited : UnEdited); + adaplum->setEditedState (pedited->colorappearance.adaplum ? Edited : UnEdited); + jlight->setEditedState (pedited->colorappearance.jlight ? Edited : UnEdited); + qbright->setEditedState (pedited->colorappearance.qbright ? Edited : UnEdited); + chroma->setEditedState (pedited->colorappearance.chroma ? Edited : UnEdited); + schroma->setEditedState (pedited->colorappearance.schroma ? Edited : UnEdited); + mchroma->setEditedState (pedited->colorappearance.mchroma ? Edited : UnEdited); + rstprotection->setEditedState (pedited->colorappearance.rstprotection ? Edited : UnEdited); + contrast->setEditedState (pedited->colorappearance.contrast ? Edited : UnEdited); + qcontrast->setEditedState (pedited->colorappearance.qcontrast ? Edited : UnEdited); + colorh->setEditedState (pedited->colorappearance.colorh ? Edited : UnEdited); + surrsource->set_inconsistent (!pedited->colorappearance.surrsource); + gamut->set_inconsistent (!pedited->colorappearance.gamut); + + degree->setAutoInconsistent (multiImage && !pedited->colorappearance.autodegree); + enabled->set_inconsistent (multiImage && !pedited->colorappearance.enabled); + } + + enaConn.block (true); + enabled->set_active (pp->colorappearance.enabled); + enaConn.block (false); + + surroundconn.block(true); + if (pedited && !pedited->colorappearance.surround) + surround->set_active (4); + else if (pp->colorappearance.surround=="Average") + surround->set_active (0); + else if (pp->colorappearance.surround=="Dim") + surround->set_active (1); + else if (pp->colorappearance.surround=="Dark") + surround->set_active (2); + else if (pp->colorappearance.surround=="ExtremelyDark") + surround->set_active (3); + surroundconn.block(false); + // Have to be manually called to handle initial state update + surroundChanged(); + + wbmodelconn.block(true); + if (pedited && !pedited->colorappearance.wbmodel) + wbmodel->set_active (2); +// else if (pp->colorappearance.wbmodel=="Equal") +// wbmodel->set_active (0); + else if (pp->colorappearance.wbmodel=="RawT") + wbmodel->set_active (0); + else if (pp->colorappearance.wbmodel=="RawTCAT02") + wbmodel->set_active (1); + wbmodelconn.block(false); + // Have to be manually called to handle initial state update + wbmodelChanged(); + + algoconn.block(true); + if (pedited && !pedited->colorappearance.algo) + algo->set_active (4); + else if (pp->colorappearance.algo=="JC") + algo->set_active (0); + else if (pp->colorappearance.algo=="JS") + algo->set_active (1); + else if (pp->colorappearance.algo=="QM") + algo->set_active (2); + else if (pp->colorappearance.algo=="ALL") + algo->set_active (3); + algoconn.block(false); + // Have to be manually called to handle initial state update + algoChanged(); + + surrconn.block (true); + surrsource->set_active (pp->colorappearance.surrsource); + surrconn.block (false); + gamutconn.block (true); + gamut->set_active (pp->colorappearance.gamut); + gamutconn.block (false); + + lastsurr=pp->colorappearance.surrsource; + lastgamut=pp->colorappearance.gamut; + + lastEnabled = pp->colorappearance.enabled; + lastAutoDegree = pp->colorappearance.autodegree; + + degree->setValue (pp->colorappearance.degree); + degree->setAutoValue(pp->colorappearance.autodegree); + adapscen->setValue (pp->colorappearance.adapscen); + adaplum->setValue (pp->colorappearance.adaplum); + jlight->setValue (pp->colorappearance.jlight); + qbright->setValue (pp->colorappearance.qbright); + chroma->setValue (pp->colorappearance.chroma); + schroma->setValue (pp->colorappearance.schroma); + mchroma->setValue (pp->colorappearance.mchroma); + rstprotection->setValue (pp->colorappearance.rstprotection); + contrast->setValue (pp->colorappearance.contrast); + qcontrast->setValue (pp->colorappearance.qcontrast); + colorh->setValue (pp->colorappearance.colorh); + + enableListener (); +} + +void Colorappearance::write (ProcParams* pp, ParamsEdited* pedited) { + + pp->colorappearance.degree = degree->getValue (); + pp->colorappearance.autodegree = degree->getAutoValue (); + pp->colorappearance.enabled = enabled->get_active(); + pp->colorappearance.adapscen = adapscen->getValue (); + pp->colorappearance.adaplum = adaplum->getValue (); + pp->colorappearance.jlight = jlight->getValue (); + pp->colorappearance.qbright = qbright->getValue (); + pp->colorappearance.chroma = chroma->getValue (); + pp->colorappearance.schroma = schroma->getValue (); + pp->colorappearance.mchroma = mchroma->getValue (); + pp->colorappearance.contrast = contrast->getValue (); + pp->colorappearance.qcontrast = qcontrast->getValue (); + pp->colorappearance.colorh = colorh->getValue (); + + pp->colorappearance.rstprotection = rstprotection->getValue (); + pp->colorappearance.surrsource = surrsource->get_active(); + pp->colorappearance.gamut = gamut->get_active(); + + if (pedited) { + pedited->colorappearance.degree = degree->getEditedState (); + pedited->colorappearance.adapscen = adapscen->getEditedState (); + pedited->colorappearance.adaplum = adaplum->getEditedState (); + pedited->colorappearance.jlight = jlight->getEditedState (); + pedited->colorappearance.qbright = qbright->getEditedState (); + pedited->colorappearance.chroma = chroma->getEditedState (); + pedited->colorappearance.schroma = schroma->getEditedState (); + pedited->colorappearance.mchroma = mchroma->getEditedState (); + pedited->colorappearance.contrast = contrast->getEditedState (); + pedited->colorappearance.qcontrast = qcontrast->getEditedState (); + pedited->colorappearance.colorh = colorh->getEditedState (); + pedited->colorappearance.rstprotection = rstprotection->getEditedState (); + pedited->colorappearance.autodegree = !degree->getAutoInconsistent(); + pedited->colorappearance.enabled = !enabled->get_inconsistent(); + pedited->colorappearance.surround = surround->get_active_text()!=M("GENERAL_UNCHANGED"); + pedited->colorappearance.wbmodel = wbmodel->get_active_text()!=M("GENERAL_UNCHANGED"); + pedited->colorappearance.algo = algo->get_active_text()!=M("GENERAL_UNCHANGED"); + pedited->colorappearance.surrsource = !surrsource->get_inconsistent(); + pedited->colorappearance.gamut = !gamut->get_inconsistent(); + } + if (surround->get_active_row_number()==0) + pp->colorappearance.surround = "Average"; + else if (surround->get_active_row_number()==1) + pp->colorappearance.surround = "Dim"; + else if (surround->get_active_row_number()==2) + pp->colorappearance.surround = "Dark"; + else if (surround->get_active_row_number()==3) + pp->colorappearance.surround = "ExtremelyDark"; + +// if (wbmodel->get_active_row_number()==0) +// pp->colorappearance.wbmodel = "Equal"; + if (wbmodel->get_active_row_number()==0) + pp->colorappearance.wbmodel = "RawT"; + else if (wbmodel->get_active_row_number()==1) + pp->colorappearance.wbmodel = "RawTCAT02"; + + if (algo->get_active_row_number()==0) + pp->colorappearance.algo = "JC"; + else if (algo->get_active_row_number()==1) + pp->colorappearance.algo = "JS"; + else if (algo->get_active_row_number()==2) + pp->colorappearance.algo = "QM"; + else if (algo->get_active_row_number()==3) + pp->colorappearance.algo = "ALL"; + +} + +void Colorappearance::surrsource_toggled () { + + if (batchMode) { + if (surrsource->get_inconsistent()) { + surrsource->set_inconsistent (false); + surrconn.block (true); + surrsource->set_active (false); + surrconn.block (false); + } + else if (lastsurr) + surrsource->set_inconsistent (true); + + lastsurr = surrsource->get_active (); + } + + if (listener) { + if (surrsource->get_active ()) + listener->panelChanged (EvCATsurr, M("GENERAL_ENABLED")); + else + listener->panelChanged (EvCATsurr, M("GENERAL_DISABLED")); + } +} + +void Colorappearance::gamut_toggled () { + + if (batchMode) { + if (gamut->get_inconsistent()) { + gamut->set_inconsistent (false); + gamutconn.block (true); + gamut->set_active (false); + gamutconn.block (false); + } + else if (lastgamut) + gamut->set_inconsistent (true); + + lastgamut = gamut->get_active (); + } + + if (listener) { + if (gamut->get_active ()) + listener->panelChanged (EvCATgamut, M("GENERAL_ENABLED")); + else + listener->panelChanged (EvCATgamut, M("GENERAL_DISABLED")); + } +} + + +void Colorappearance::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) { + + degree->setDefault (defParams->colorappearance.degree); + adapscen->setDefault (defParams->colorappearance.adapscen); + adaplum->setDefault (defParams->colorappearance.adaplum); + jlight->setDefault (defParams->colorappearance.jlight); + qbright->setDefault (defParams->colorappearance.qbright); + chroma->setDefault (defParams->colorappearance.chroma); + schroma->setDefault (defParams->colorappearance.schroma); + mchroma->setDefault (defParams->colorappearance.mchroma); + rstprotection->setDefault (defParams->colorappearance.rstprotection); + contrast->setDefault (defParams->colorappearance.contrast); + qcontrast->setDefault (defParams->colorappearance.qcontrast); + colorh->setDefault (defParams->colorappearance.colorh); + + if (pedited) { + degree->setDefaultEditedState (pedited->colorappearance.degree ? Edited : UnEdited); + adapscen->setDefaultEditedState (pedited->colorappearance.adapscen ? Edited : UnEdited); + adaplum->setDefaultEditedState (pedited->colorappearance.adaplum ? Edited : UnEdited); + jlight->setDefaultEditedState (pedited->colorappearance.jlight ? Edited : UnEdited); + qbright->setDefaultEditedState (pedited->colorappearance.qbright ? Edited : UnEdited); + chroma->setDefaultEditedState (pedited->colorappearance.chroma ? Edited : UnEdited); + schroma->setDefaultEditedState (pedited->colorappearance.schroma ? Edited : UnEdited); + mchroma->setDefaultEditedState (pedited->colorappearance.mchroma ? Edited : UnEdited); + rstprotection->setDefaultEditedState (pedited->colorappearance.rstprotection ? Edited : UnEdited); + contrast->setDefaultEditedState (pedited->colorappearance.contrast ? Edited : UnEdited); + qcontrast->setDefaultEditedState (pedited->colorappearance.qcontrast ? Edited : UnEdited); + colorh->setDefaultEditedState (pedited->colorappearance.colorh ? Edited : UnEdited); + + } + else { + degree->setDefaultEditedState (Irrelevant); + adapscen->setDefaultEditedState (Irrelevant); + adaplum->setDefaultEditedState (Irrelevant); + jlight->setDefaultEditedState (Irrelevant); + qbright->setDefaultEditedState (Irrelevant); + chroma->setDefaultEditedState (Irrelevant); + schroma->setDefaultEditedState (Irrelevant); + mchroma->setDefaultEditedState (Irrelevant); + contrast->setDefaultEditedState (Irrelevant); + qcontrast->setDefaultEditedState (Irrelevant); + rstprotection->setDefaultEditedState (Irrelevant); + colorh->setDefaultEditedState (Irrelevant); + + } +} + +void Colorappearance::adjusterChanged (Adjuster* a, double newval) { + + if (listener && (multiImage||enabled->get_active()) ) { + if(a==degree) + listener->panelChanged (EvCATDegree, a->getTextValue()); + else if(a==adapscen) + listener->panelChanged (EvCATAdapscen, a->getTextValue()); + else if(a==adaplum) + listener->panelChanged (EvCATAdapLum, a->getTextValue()); + else if(a==jlight) + listener->panelChanged (EvCATJLight, a->getTextValue()); + else if(a==qbright) + listener->panelChanged (EvCATQbright, a->getTextValue()); + else if(a==chroma) + listener->panelChanged (EvCATChroma, a->getTextValue()); + else if(a==schroma) + listener->panelChanged (EvCATSChroma, a->getTextValue()); + else if(a==mchroma) + listener->panelChanged (EvCATMChroma, a->getTextValue()); + else if(a==rstprotection) + listener->panelChanged (EvCATRstpro, a->getTextValue()); + else if(a==contrast) + listener->panelChanged (EvCATContrast, a->getTextValue()); + else if(a==colorh) + listener->panelChanged (EvCAThue, a->getTextValue()); + else if(a==qcontrast) + listener->panelChanged (EvCATQContrast, a->getTextValue()); + + } +} + +void Colorappearance::adjusterAutoToggled (Adjuster* a, bool newval) { + + if (multiImage) { + if (degree->getAutoInconsistent()) { + degree->setAutoInconsistent(false); + degree->setAutoValue(false); + } + else if (lastAutoDegree) + degree->setAutoInconsistent(true); + + lastAutoDegree = degree->getAutoValue(); + } + + if (listener && (multiImage||enabled->get_active()) ) { + if(a==degree) { + if (degree->getAutoInconsistent()) + listener->panelChanged (EvCATAutoDegree, M("GENERAL_UNCHANGED")); + else if (degree->getAutoValue()) + listener->panelChanged (EvCATAutoDegree, M("GENERAL_ENABLED")); + else + listener->panelChanged (EvCATAutoDegree, M("GENERAL_DISABLED")); + } + } +} + +void Colorappearance::enabledChanged () { + + if (multiImage) { + if (enabled->get_inconsistent()) { + enabled->set_inconsistent (false); + enaConn.block (true); + enabled->set_active (false); + enaConn.block (false); + } + else if (lastEnabled) + enabled->set_inconsistent (true); + + lastEnabled = enabled->get_active (); + } + + if (listener) { + if (enabled->get_inconsistent()) + listener->panelChanged (EvCATEnabled, M("GENERAL_UNCHANGED")); + else if (enabled->get_active ()) + listener->panelChanged (EvCATEnabled, M("GENERAL_ENABLED")); + else + listener->panelChanged (EvCATEnabled, M("GENERAL_DISABLED")); + } +} + +void Colorappearance::surroundChanged () { + + if (listener && (multiImage||enabled->get_active()) ) { + listener->panelChanged (EvCATMethodsur, surround->get_active_text ()); + } +} + +void Colorappearance::wbmodelChanged () { + + if (listener && (multiImage||enabled->get_active()) ) { + listener->panelChanged (EvCATMethodWB, wbmodel->get_active_text ()); + } +} + +void Colorappearance::algoChanged () { + + if ( algo->get_active_row_number()==0 ) { + contrast->show(); + rstprotection->show(); + qcontrast->hide(); + jlight->show(); + mchroma->hide(); + chroma->show(); + schroma->hide(); + qbright->hide(); + colorh->hide(); + } + else if ( algo->get_active_row_number()==1 ) { + rstprotection->hide(); + contrast->show(); + qcontrast->hide(); + jlight->show(); + mchroma->hide(); + chroma->hide(); + schroma->show(); + qbright->hide(); + colorh->hide(); + } + else if ( algo->get_active_row_number()==2 ) { + contrast->hide(); + rstprotection->hide(); + qcontrast->show(); + jlight->hide(); + mchroma->show(); + chroma->hide(); + schroma->hide(); + qbright->show(); + colorh->hide(); + } + else if ( algo->get_active_row_number()>=3 ) { // ">=3" because everything has to be visible with the "(unchanged)" option too + contrast->show(); + rstprotection->show(); + qcontrast->show(); + jlight->show(); + mchroma->show(); + chroma->show(); + schroma->show(); + qbright->show(); + colorh->show(); + } + + if (listener && (multiImage||enabled->get_active()) ) { + listener->panelChanged (EvCATMethodalg, algo->get_active_text ()); + } +} + +void Colorappearance::setBatchMode (bool batchMode) { + + ToolPanel::setBatchMode (batchMode); + + degree->showEditedCB (); + adapscen->showEditedCB (); + adaplum->showEditedCB (); + jlight->showEditedCB (); + qbright->showEditedCB (); + chroma->showEditedCB (); + schroma->showEditedCB (); + mchroma->showEditedCB (); + rstprotection->showEditedCB (); + contrast->showEditedCB (); + qcontrast->showEditedCB (); + colorh->showEditedCB (); + + surround->append_text (M("GENERAL_UNCHANGED")); + wbmodel->append_text (M("GENERAL_UNCHANGED")); + algo->append_text (M("GENERAL_UNCHANGED")); + +} + +void Colorappearance::setAdjusterBehavior (bool degreeadd, bool adapscenadd, bool adaplumadd, bool jlightadd, bool chromaadd, bool contrastadd, bool rstprotectionadd, bool qbrightadd, bool qcontrastadd, bool schromaadd, bool mchromaadd, bool colorhadd) { + + degree->setAddMode(degreeadd); + adapscen->setAddMode(adapscenadd); + adaplum->setAddMode(adaplumadd); + jlight->setAddMode(jlightadd); + qbright->setAddMode(qbrightadd); + chroma->setAddMode(chromaadd); + schroma->setAddMode(schromaadd); + mchroma->setAddMode(mchromaadd); + rstprotection->setAddMode(rstprotectionadd); + contrast->setAddMode(contrastadd); + qcontrast->setAddMode(qcontrastadd); + colorh->setAddMode(colorhadd); + +} + +void Colorappearance::trimValues (rtengine::procparams::ProcParams* pp) { + + degree->trimValue(pp->colorappearance.degree); + adapscen->trimValue(pp->colorappearance.adapscen); + adaplum->trimValue(pp->colorappearance.adaplum); + jlight->trimValue(pp->colorappearance.jlight); + qbright->trimValue(pp->colorappearance.qbright); + chroma->trimValue(pp->colorappearance.chroma); + schroma->trimValue(pp->colorappearance.schroma); + mchroma->trimValue(pp->colorappearance.mchroma); + rstprotection->trimValue(pp->colorappearance.rstprotection); + contrast->trimValue(pp->colorappearance.contrast); + qcontrast->trimValue(pp->colorappearance.qcontrast); + colorh->trimValue(pp->colorappearance.colorh); + +} diff --git a/rtgui/colorappearance.h b/rtgui/colorappearance.h new file mode 100644 index 000000000..c49103554 --- /dev/null +++ b/rtgui/colorappearance.h @@ -0,0 +1,90 @@ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _COLORAPPEARANCE_H_ +#define _COLORAPPEARANCE_H_ + +#include +#include "adjuster.h" +#include "toolpanel.h" + +class Colorappearance : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { + + protected: + Glib::RefPtr bgTTips; + Glib::RefPtr srTTips; + Glib::RefPtr bgPixbuf; + Glib::RefPtr srPixbuf; + + Adjuster* degree; + Adjuster* adapscen; + Adjuster* adaplum; + Adjuster* jlight; + Adjuster* qbright; + Adjuster* chroma; + Adjuster* schroma; + Adjuster* mchroma; + Adjuster* rstprotection; + Adjuster* contrast; + Adjuster* qcontrast; + Adjuster* colorh; + + //Adjuster* edge; + Gtk::CheckButton* surrsource; + Gtk::CheckButton* gamut; + + Gtk::CheckButton* enabled; + MyComboBoxText* surround; + sigc::connection surroundconn; + MyComboBoxText* wbmodel; + sigc::connection wbmodelconn; + MyComboBoxText* algo; + sigc::connection algoconn; + sigc::connection surrconn; + sigc::connection gamutconn; + + bool lastEnabled; + bool lastAutoDegree; + sigc::connection enaConn; + bool lastsurr; + bool lastgamut; + bool bgTTipQuery(int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip); + bool srTTipQuery(int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip); + + public: + + Colorappearance (); + + void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL); + void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL); + void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL); + void setBatchMode (bool batchMode); + + void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled (Adjuster* a, bool newval); + void enabledChanged (); + void surroundChanged (); + void wbmodelChanged (); + void algoChanged (); + void surrsource_toggled (); + void gamut_toggled (); + void setAdjusterBehavior (bool degreeadd, bool adapscenadd, bool adaplumadd, bool jlightadd, bool chromaadd, bool contrastadd, bool rstprotectionadd, bool qbrightadd, bool qcontrastadd, bool schromaadd, bool mchromaadd, bool colorhadd); + void trimValues (rtengine::procparams::ProcParams* pp); +}; + +#endif diff --git a/rtgui/crop.cc b/rtgui/crop.cc index bf8f1d313..3fbdfed3e 100644 --- a/rtgui/crop.cc +++ b/rtgui/crop.cc @@ -37,6 +37,8 @@ class RefreshSpinHelper { Crop::Crop (): Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + clistener = NULL; maxw = 3000; @@ -46,7 +48,7 @@ Crop::Crop (): Gtk::VBox(), FoldableToolPanel(this) { enabled->set_active (false); pack_start(*enabled); - pack_start(*Gtk::manage (new Gtk::HSeparator())); + pack_start(*Gtk::manage (new Gtk::HSeparator()), Gtk::PACK_EXPAND_WIDGET, 4); Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); diff --git a/rtgui/darkframe.cc b/rtgui/darkframe.cc index 193bc1c80..dfea06da1 100644 --- a/rtgui/darkframe.cc +++ b/rtgui/darkframe.cc @@ -28,6 +28,8 @@ using namespace rtengine::procparams; DarkFrame::DarkFrame () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + hbdf = Gtk::manage(new Gtk::HBox()); darkFrameFile = Gtk::manage(new MyFileChooserButton(M("TP_DARKFRAME_LABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); darkFrameFilePersister.reset(new FileChooserLastFolderPersister(darkFrameFile, options.lastDarkframeDir)); diff --git a/rtgui/defringe.cc b/rtgui/defringe.cc index ba09b7dd3..0a4142299 100644 --- a/rtgui/defringe.cc +++ b/rtgui/defringe.cc @@ -25,6 +25,8 @@ using namespace rtengine::procparams; Defringe::Defringe () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (false); enabled->show (); diff --git a/rtgui/dirpyrdenoise.cc b/rtgui/dirpyrdenoise.cc index 0da2f8a11..e484a2c90 100644 --- a/rtgui/dirpyrdenoise.cc +++ b/rtgui/dirpyrdenoise.cc @@ -25,6 +25,8 @@ using namespace rtengine::procparams; DirPyrDenoise::DirPyrDenoise () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (false); enabled->show (); diff --git a/rtgui/dirpyrequalizer.cc b/rtgui/dirpyrequalizer.cc index 7b8bc7e61..57ca3b8bb 100644 --- a/rtgui/dirpyrequalizer.cc +++ b/rtgui/dirpyrequalizer.cc @@ -24,6 +24,8 @@ using namespace rtengine::procparams; DirPyrEqualizer::DirPyrEqualizer () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (true); pack_start(*enabled); diff --git a/rtgui/distortion.cc b/rtgui/distortion.cc index a4e87cd07..3b909f605 100644 --- a/rtgui/distortion.cc +++ b/rtgui/distortion.cc @@ -27,6 +27,8 @@ using namespace rtengine::procparams; Distortion::Distortion (): Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + rlistener = NULL; autoDistor = Gtk::manage (new Gtk::Button (M("TP_DISTORTION_AUTO"))); autoDistor->set_image (*Gtk::manage (new RTImage ("distortion-auto.png"))); diff --git a/rtgui/epd.cc b/rtgui/epd.cc index 20c9c510a..cd8b8956d 100644 --- a/rtgui/epd.cc +++ b/rtgui/epd.cc @@ -24,6 +24,9 @@ using namespace rtengine; using namespace rtengine::procparams; EdgePreservingDecompositionUI::EdgePreservingDecompositionUI () : Gtk::VBox(), FoldableToolPanel(this){ + + set_border_width(4); + enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (false); enabled->show (); diff --git a/rtgui/flatfield.cc b/rtgui/flatfield.cc index 7e9e2ff43..65b10df17 100644 --- a/rtgui/flatfield.cc +++ b/rtgui/flatfield.cc @@ -28,6 +28,8 @@ using namespace rtengine::procparams; FlatField::FlatField () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + hbff = Gtk::manage(new Gtk::HBox()); flatFieldFile = Gtk::manage(new MyFileChooserButton(M("TP_FLATFIELD_LABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); flatFieldFilePersister.reset(new FileChooserLastFolderPersister(flatFieldFile, options.lastFlatfieldDir)); diff --git a/rtgui/hlrec.cc b/rtgui/hlrec.cc index 8141261dc..4c5ccc7a8 100644 --- a/rtgui/hlrec.cc +++ b/rtgui/hlrec.cc @@ -24,6 +24,8 @@ using namespace rtengine::procparams; HLRecovery::HLRecovery () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLE"))); enabled->set_active (false); pack_start (*enabled); diff --git a/rtgui/hsvequalizer.cc b/rtgui/hsvequalizer.cc index 89916e344..5af1fae39 100644 --- a/rtgui/hsvequalizer.cc +++ b/rtgui/hsvequalizer.cc @@ -27,6 +27,8 @@ using namespace rtengine::procparams; HSVEqualizer::HSVEqualizer () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + std::vector bottomMilestones; float R, G, B; // -0.1 rad < Hue < 1.6 rad diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index ae46a6217..1b84d623c 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -32,32 +32,39 @@ extern Options options; ICMPanel::ICMPanel () : Gtk::VBox(), FoldableToolPanel(this), iunchanged(NULL), icmplistener(NULL), lastRefFilename("") { -// set_border_width (4); + set_border_width(4); ipDialog = Gtk::manage (new MyFileChooserButton (M("TP_ICM_INPUTDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); ipDialog->set_tooltip_text (M("TP_ICM_INPUTCUSTOM_TOOLTIP")); ipDialogPersister.reset(new FileChooserLastFolderPersister(ipDialog, options.lastIccDir)); - Gtk::Label* ilab = Gtk::manage (new Gtk::Label ()); - ilab->set_alignment (0.0, 0.5); - ilab->set_markup (Glib::ustring("") + M("TP_ICM_INPUTPROFILE") + ""); - pack_start (*ilab, Gtk::PACK_SHRINK, 4); - + + // ------------------------------- Input profile + + + Gtk::Frame *iFrame = Gtk::manage (new Gtk::Frame(M("TP_ICM_INPUTPROFILE")) ); + iFrame->set_border_width(0); + iFrame->set_label_align(0.025, 0.5); + + iVBox = Gtk::manage ( new Gtk::VBox()); + iVBox->set_border_width(4); + iVBox->set_spacing(2); + inone = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTNONE"))); inone->set_tooltip_text (M("TP_ICM_INPUTNONE_TOOLTIP")); - pack_start (*inone, Gtk::PACK_SHRINK, 4); + iVBox->pack_start (*inone, Gtk::PACK_SHRINK, 2); iembedded = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTEMBEDDED"))); iembedded->set_tooltip_text (M("TP_ICM_INPUTEMBEDDED_TOOLTIP")); - pack_start (*iembedded, Gtk::PACK_SHRINK, 4); + iVBox->pack_start (*iembedded, Gtk::PACK_SHRINK, 2); icamera = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTCAMERA"))); icamera->set_tooltip_text (M("TP_ICM_INPUTCAMERA_TOOLTIP")); - pack_start (*icamera, Gtk::PACK_SHRINK, 4); + iVBox->pack_start (*icamera, Gtk::PACK_SHRINK, 2); icameraICC = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTCAMERAICC"))); icameraICC->set_tooltip_text (M("TP_ICM_INPUTCAMERAICC_TOOLTIP")); - pack_start (*icameraICC, Gtk::PACK_SHRINK, 4); + iVBox->pack_start (*icameraICC, Gtk::PACK_SHRINK, 2); ifromfile = Gtk::manage (new Gtk::RadioButton (M("TP_ICM_INPUTCUSTOM")+":")); Gtk::HBox* ffbox = Gtk::manage (new Gtk::HBox ()); @@ -65,7 +72,7 @@ ICMPanel::ICMPanel () : Gtk::VBox(), FoldableToolPanel(this), iunchanged(NULL), ffbox->pack_start (*ifromfile, Gtk::PACK_SHRINK); ffbox->pack_start (*ipDialog); - pack_start (*ffbox, Gtk::PACK_SHRINK, 4); + iVBox->pack_start (*ffbox, Gtk::PACK_SHRINK, 2); opts = icamera->get_group(); icameraICC->set_group (opts); @@ -84,68 +91,100 @@ ICMPanel::ICMPanel () : Gtk::VBox(), FoldableToolPanel(this), iunchanged(NULL), prefprof->append_text (M("TP_ICM_PREFERREDPROFILE_4")); prefprof->show (); hb->pack_start(*ppl, Gtk::PACK_SHRINK, 4); - hb->pack_start(*prefprof); - pack_start (*hb, Gtk::PACK_SHRINK, 4); + hb->pack_start(*prefprof); + iVBox->pack_start (*hb, Gtk::PACK_SHRINK, 2); ckbToneCurve = Gtk::manage (new Gtk::CheckButton (M("TP_ICM_TONECURVE"))); ckbToneCurve->set_sensitive (false); ckbToneCurve->set_tooltip_text (M("TP_ICM_TONECURVE_TOOLTIP")); - pack_start (*ckbToneCurve, Gtk::PACK_SHRINK, 4); + iVBox->pack_start (*ckbToneCurve, Gtk::PACK_SHRINK, 2); ckbBlendCMSMatrix = Gtk::manage (new Gtk::CheckButton (M("TP_ICM_BLENDCMSMATRIX"))); ckbBlendCMSMatrix->set_sensitive (false); ckbBlendCMSMatrix->set_tooltip_text (M("TP_ICM_BLENDCMSMATRIX_TOOLTIP")); - pack_start (*ckbBlendCMSMatrix, Gtk::PACK_SHRINK, 4); + iVBox->pack_start (*ckbBlendCMSMatrix, Gtk::PACK_SHRINK, 2); saveRef = Gtk::manage (new Gtk::Button (M("TP_ICM_SAVEREFERENCE"))); saveRef->set_image (*Gtk::manage (new RTImage ("gtk-save-large.png"))); - pack_start (*saveRef, Gtk::PACK_SHRINK, 4); + iVBox->pack_start (*saveRef, Gtk::PACK_SHRINK, 2); + + iFrame->add(*iVBox); + pack_start (*iFrame, Gtk::PACK_EXPAND_WIDGET, 4); - Gtk::HSeparator* hsep1 = Gtk::manage (new Gtk::HSeparator ()); - pack_start (*hsep1, Gtk::PACK_SHRINK, 2); + // ---------------------------- Working profile - Gtk::Label* wlab = Gtk::manage (new Gtk::Label ()); - wlab->set_alignment (0.0, 0.5); - wlab->set_markup (Glib::ustring("") + M("TP_ICM_WORKINGPROFILE") + ""); - pack_start (*wlab, Gtk::PACK_SHRINK, 4); + Gtk::Frame *wFrame = Gtk::manage (new Gtk::Frame(M("TP_ICM_WORKINGPROFILE")) ); + wFrame->set_border_width(0); + wFrame->set_label_align(0.025, 0.5); + + Gtk::VBox *wVBox = Gtk::manage ( new Gtk::VBox()); + wVBox->set_border_width(4); + wnames = Gtk::manage (new MyComboBoxText ()); - pack_start (*wnames, Gtk::PACK_SHRINK, 4); - - Gtk::HSeparator* hsep2 = Gtk::manage (new Gtk::HSeparator ()); - pack_start (*hsep2, Gtk::PACK_SHRINK, 2); - - Gtk::Label* olab = Gtk::manage (new Gtk::Label ()); - olab->set_alignment (0.0, 0.5); - olab->set_markup (Glib::ustring("") + M("TP_ICM_OUTPUTPROFILE") + ""); - - pack_start (*olab, Gtk::PACK_SHRINK, 4); - onames = Gtk::manage (new MyComboBoxText ()); - pack_start (*onames, Gtk::PACK_SHRINK, 4); + wVBox->pack_start (*wnames, Gtk::PACK_SHRINK); std::vector wpnames = rtengine::getWorkingProfiles (); for (size_t i=0; iappend_text (wpnames[i]); + wnames->set_active (0); - Gtk::HSeparator* hsep22 = Gtk::manage (new Gtk::HSeparator ()); - pack_start (*hsep22, Gtk::PACK_SHRINK, 2); + wFrame->add(*wVBox); + pack_start (*wFrame, Gtk::PACK_EXPAND_WIDGET, 4); - Gtk::Label* galab = Gtk::manage (new Gtk::Label ()); - galab->set_alignment (0.0, 0.5); - galab->set_markup (Glib::ustring("") + M("TP_GAMMA_OUTPUT") + ""); - pack_start (*galab, Gtk::PACK_SHRINK, 4); + // ---------------------------- Output profile + + + Gtk::Frame *oFrame = Gtk::manage (new Gtk::Frame(M("TP_ICM_OUTPUTPROFILE")) ); + oFrame->set_border_width(0); + oFrame->set_label_align(0.025, 0.5); + + Gtk::VBox *oVBox = Gtk::manage ( new Gtk::VBox()); + oVBox->set_border_width(4); + oVBox->set_spacing(2); + + onames = Gtk::manage (new MyComboBoxText ()); + oVBox->pack_start (*onames, Gtk::PACK_SHRINK); + + onames->append_text (M("TP_ICM_NOICM")); + onames->set_active (0); + + std::vector opnames = iccStore->getOutputProfiles (); + for (size_t i=0; iappend_text (opnames[i]); + + onames->set_active (0); + + // Output gamma + + Gtk::HBox* gaHBox = Gtk::manage (new Gtk::HBox ()); + Gtk::Label* galab = Gtk::manage (new Gtk::Label (M("TP_GAMMA_OUTPUT")+":")); + //galab->set_alignment (0.0, 0.5); + + gaHBox->pack_start (*galab, Gtk::PACK_SHRINK, 4); wgamma = Gtk::manage (new MyComboBoxText ()); - pack_start (*wgamma, Gtk::PACK_SHRINK, 4); + gaHBox->pack_start (*wgamma, Gtk::PACK_EXPAND_WIDGET); - Gtk::HSeparator* hsep23 = Gtk::manage (new Gtk::HSeparator ()); - pack_start (*hsep23, Gtk::PACK_SHRINK, 2); + oVBox->pack_start(*gaHBox, Gtk::PACK_EXPAND_WIDGET,2); + + std::vector wpgamma = rtengine::getGamma (); + for (size_t i=0; iappend_text (wpgamma[i]); + + wgamma->set_active (0); + + Gtk::Frame* fgFrame = Gtk::manage (new Gtk::Frame ()); + + Gtk::VBox *fgVBox = Gtk::manage ( new Gtk::VBox()); + fgVBox->set_border_width(4); + fgVBox->set_spacing(0); freegamma = Gtk::manage(new Gtk::CheckButton((M("TP_GAMMA_FREE")))); freegamma->set_active (false); - pack_start( *freegamma); + fgFrame->set_label_widget(*freegamma); gampos = Gtk::manage(new Adjuster (M("TP_GAMMA_CURV"),1,3.5,0.01,2.22)); gampos->setAdjusterListener (this); @@ -155,25 +194,18 @@ ICMPanel::ICMPanel () : Gtk::VBox(), FoldableToolPanel(this), iunchanged(NULL), slpos->setAdjusterListener (this); if (slpos->delay < 1000) slpos->delay = 1000; slpos->show(); - pack_start( *gampos, Gtk::PACK_SHRINK, 4);//gamma - pack_start( *slpos, Gtk::PACK_SHRINK, 4);//slope + fgVBox->pack_start( *gampos, Gtk::PACK_SHRINK);//gamma + fgVBox->pack_start( *slpos, Gtk::PACK_SHRINK);//slope + + fgFrame->add(*fgVBox); + oVBox->pack_start(*fgFrame, Gtk::PACK_EXPAND_WIDGET,2); + + oFrame->add(*oVBox); + pack_start (*oFrame, Gtk::PACK_EXPAND_WIDGET, 4); + // ---------------------------- Output gamma list entries - std::vector wpgamma = rtengine::getGamma (); - for (size_t i=0; iappend_text (wpgamma[i]); - - onames->append_text (M("TP_ICM_NOICM")); - onames->set_active (0); - - std::vector opnames = iccStore->getOutputProfiles (); - for (size_t i=0; iappend_text (opnames[i]); - - wnames->set_active (0); - onames->set_active (0); - wgamma->set_active (0); Gtk::FileFilter filter_icc; filter_icc.set_name(M("TP_ICM_FILEDLGFILTERICM")); @@ -575,8 +607,8 @@ void ICMPanel::setBatchMode (bool batchMode) { ToolPanel::setBatchMode (batchMode); iunchanged = Gtk::manage (new Gtk::RadioButton (M("GENERAL_UNCHANGED"))); iunchanged->set_group (opts); - pack_start (*iunchanged, Gtk::PACK_SHRINK, 4); - reorder_child (*iunchanged, 5); + iVBox->pack_start (*iunchanged, Gtk::PACK_SHRINK, 4); + iVBox->reorder_child (*iunchanged, 5); removeIfThere (this, saveRef); onames->append_text (M("GENERAL_UNCHANGED")); wnames->append_text (M("GENERAL_UNCHANGED")); diff --git a/rtgui/icmpanel.h b/rtgui/icmpanel.h index 4c3838dac..395a7bafa 100644 --- a/rtgui/icmpanel.h +++ b/rtgui/icmpanel.h @@ -31,6 +31,7 @@ class ICMPanelListener { public: + virtual ~ICMPanelListener() {} virtual void saveInputICCReference (Glib::ustring fname) {} }; @@ -48,6 +49,8 @@ class ICMPanel : public Gtk::VBox, public AdjusterListener, public FoldableToolP sigc::connection blendcmsconn; private: + Gtk::VBox * iVBox; + Gtk::CheckButton* freegamma; Gtk::RadioButton* inone; diff --git a/rtgui/impulsedenoise.cc b/rtgui/impulsedenoise.cc index 70ab7315d..379945581 100644 --- a/rtgui/impulsedenoise.cc +++ b/rtgui/impulsedenoise.cc @@ -26,6 +26,8 @@ using namespace rtengine::procparams; ImpulseDenoise::ImpulseDenoise () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (false); diff --git a/rtgui/labcurve.cc b/rtgui/labcurve.cc index e45e13cc3..7167b705f 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -25,6 +25,8 @@ using namespace rtengine::procparams; LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + std::vector milestones; brightness = Gtk::manage (new Adjuster (M("TP_LABCURVE_BRIGHTNESS"), -100., 100., 1., 0.)); @@ -45,7 +47,9 @@ LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this) { chromaticity->setAdjusterListener (this); //%%%%%%%%%%%%%%%%%% - pack_start (*Gtk::manage (new Gtk::HSeparator())); + Gtk::HSeparator *hsep2 = Gtk::manage (new Gtk::HSeparator()); + hsep2->show (); + pack_start (*hsep2, Gtk::PACK_EXPAND_WIDGET, 4); bwtoning = Gtk::manage (new Gtk::CheckButton (M("TP_LABCURVE_BWTONING"))); bwtoning->set_tooltip_markup (M("TP_LABCURVE_BWTONING_TIP")); @@ -74,7 +78,7 @@ LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this) { Gtk::HSeparator *hsep3 = Gtk::manage (new Gtk::HSeparator()); hsep3->show (); - pack_start (*hsep3); + pack_start (*hsep3, Gtk::PACK_EXPAND_WIDGET, 4); curveEditorG = new CurveEditorGroup (options.lastLabCurvesDir); curveEditorG->setCurveListener (this); diff --git a/rtgui/lensgeom.cc b/rtgui/lensgeom.cc index abeb469f0..e5a0b6304 100644 --- a/rtgui/lensgeom.cc +++ b/rtgui/lensgeom.cc @@ -20,13 +20,13 @@ #include "guiutils.h" #include "rtimage.h" -extern Glib::ustring argv0; - using namespace rtengine; using namespace rtengine::procparams; LensGeometry::LensGeometry () : Gtk::VBox(), FoldableToolPanel(this), rlistener(NULL) { + set_border_width(4); + fill = Gtk::manage (new Gtk::CheckButton (M("TP_LENSGEOM_FILL"))); pack_start (*fill); diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index 5a3c4bbbf..58f4fa339 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -29,6 +29,8 @@ using namespace rtengine::procparams; LensProfilePanel::LensProfilePanel () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + hbLCPFile = Gtk::manage(new Gtk::HBox()); lLCPFileHead = Gtk::manage(new Gtk::Label(M("GENERAL_FILE"))); diff --git a/rtgui/options.cc b/rtgui/options.cc index f84dcf54c..7d5116dd5 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -396,7 +396,13 @@ void Options::setDefaults () { 0, // ADDSET_VIBRANCE_SATURATED 0, // ADDSET_FREE_OUPUT_GAMMA 0, // ADDSET_FREE_OUTPUT_SLOPE - + 0, // ADDSET_CAT_DEGREE + 0, // ADDSET_CAT_ADAPSCEN + 0, // ADDSET_CAT_ADAPLUM + 0, // ADDSET_CAT_JLIGHT + 0, // ADDSET_CAT_CHROMA + 0, // ADDSET_CAT_CONTRAST + }; baBehav = std::vector (babehav, babehav+ADDSET_PARAM_NUM); @@ -414,6 +420,9 @@ void Options::setDefaults () { rtSettings.iccDirectory = "/usr/share/color/icc"; #endif rtSettings.colorimetricIntent = 1; + rtSettings.viewingdevice=0; + rtSettings.viewingdevicegrey=3; + rtSettings.monitorProfile = ""; rtSettings.autoMonitorProfile = false; rtSettings.adobe = "RT_Medium_gsRGB"; // put the name of yours profiles (here windows) @@ -430,6 +439,7 @@ void Options::setDefaults () { rtSettings.gamutLch = true; rtSettings.protectred = 60; rtSettings.protectredh = 0.3; + rtSettings.CRI_color =0; lastIccDir = rtSettings.iccDirectory; lastDarkframeDir = rtSettings.darkFramesPath; @@ -638,6 +648,9 @@ if (keyFile.has_group ("Color Management")) { if (keyFile.has_key ("Color Management", "AutoMonitorProfile")) rtSettings.autoMonitorProfile = keyFile.get_boolean ("Color Management", "AutoMonitorProfile"); if (keyFile.has_key ("Color Management", "Intent")) rtSettings.colorimetricIntent = keyFile.get_integer("Color Management", "Intent"); + if (keyFile.has_key ("Color Management", "CRI")) rtSettings.CRI_color = keyFile.get_integer("Color Management", "CRI"); + if (keyFile.has_key ("Color Management", "view")) rtSettings.viewingdevice = keyFile.get_integer("Color Management", "view"); + if (keyFile.has_key ("Color Management", "grey")) rtSettings.viewingdevice = keyFile.get_integer("Color Management", "grey"); if (keyFile.has_key ("Color Management", "WhiteBalanceSpotSize")) whiteBalanceSpotSize = keyFile.get_integer("Color Management", "WhiteBalanceSpotSize"); if( keyFile.has_key ("Color Management", "GamutICC")) rtSettings.gamutICC = keyFile.get_boolean("Color Management", "GamutICC"); @@ -881,6 +894,9 @@ int Options::saveToFile (Glib::ustring fname) { keyFile.set_string ("Color Management", "MonitorProfile", rtSettings.monitorProfile); keyFile.set_boolean ("Color Management", "AutoMonitorProfile", rtSettings.autoMonitorProfile); keyFile.set_integer ("Color Management", "Intent", rtSettings.colorimetricIntent); + keyFile.set_integer ("Color Management", "view", rtSettings.viewingdevice); + keyFile.set_integer ("Color Management", "grey", rtSettings.viewingdevice); + keyFile.set_string ("Color Management", "AdobeRGB", rtSettings.adobe); keyFile.set_string ("Color Management", "ProPhoto", rtSettings.prophoto); keyFile.set_string ("Color Management", "ProPhoto10", rtSettings.prophoto10); @@ -895,6 +911,7 @@ int Options::saveToFile (Glib::ustring fname) { keyFile.set_boolean ("Color Management", "GamutLch", rtSettings.gamutLch); keyFile.set_integer ("Color Management", "ProtectRed", rtSettings.protectred); keyFile.set_double ("Color Management", "ProtectRedH", rtSettings.protectredh); + keyFile.set_integer ("Color Management", "CRI", rtSettings.CRI_color); Glib::ArrayHandle bab = baBehav; keyFile.set_integer_list ("Batch Processing", "AdjusterBehavior", bab); diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index fca23965c..41871b2c6 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -92,6 +92,27 @@ void ParamsEdited::set (bool v) { vibrance.avoidcolorshift = v; vibrance.pastsattog = v; vibrance.skintonescurve = v; + colorappearance.enabled = v; + colorappearance.degree = v; + colorappearance.autodegree = v; + colorappearance.surround = v; + colorappearance.adapscen = v; + colorappearance.adaplum = v; + colorappearance.wbmodel = v; + colorappearance.algo = v; + + colorappearance.jlight = v; + colorappearance.qbright = v; + colorappearance.chroma = v; + colorappearance.schroma = v; + colorappearance.mchroma = v; + colorappearance.contrast = v; + colorappearance.qcontrast = v; + colorappearance.colorh = v; + colorappearance.rstprotection = v; + colorappearance.surrsource = v; + colorappearance.gamut = v; + //colorBoost.amount = v; //colorBoost.avoidclip = v; //colorBoost.enable_saturationlimiter = v; @@ -294,6 +315,27 @@ void ParamsEdited::initFrom (const std::vector vibrance.avoidcolorshift = vibrance.avoidcolorshift && p.vibrance.avoidcolorshift == other.vibrance.avoidcolorshift; vibrance.pastsattog = vibrance.pastsattog && p.vibrance.pastsattog == other.vibrance.pastsattog; vibrance.skintonescurve = vibrance.skintonescurve && p.vibrance.skintonescurve == other.vibrance.skintonescurve; + + colorappearance.enabled = colorappearance.enabled && p.colorappearance.enabled == other.colorappearance.enabled; + colorappearance.degree = colorappearance.degree && p.colorappearance.degree == other.colorappearance.degree; + colorappearance.autodegree = colorappearance.autodegree && p.colorappearance.autodegree == other.colorappearance.autodegree; + colorappearance.surround = colorappearance.surround && p.colorappearance.surround == other.colorappearance.surround; + colorappearance.adapscen = colorappearance.adapscen && p.colorappearance.adapscen == other.colorappearance.adapscen; + colorappearance.adaplum = colorappearance.adaplum && p.colorappearance.adaplum == other.colorappearance.adaplum; + colorappearance.wbmodel = colorappearance.wbmodel && p.colorappearance.wbmodel == other.colorappearance.wbmodel; + colorappearance.algo = colorappearance.algo && p.colorappearance.algo == other.colorappearance.algo; + colorappearance.jlight = colorappearance.jlight && p.colorappearance.jlight == other.colorappearance.jlight; + colorappearance.qbright = colorappearance.qbright && p.colorappearance.qbright == other.colorappearance.qbright; + colorappearance.chroma = colorappearance.chroma && p.colorappearance.chroma == other.colorappearance.chroma; + colorappearance.schroma = colorappearance.schroma && p.colorappearance.schroma == other.colorappearance.schroma; + colorappearance.mchroma = colorappearance.mchroma && p.colorappearance.mchroma == other.colorappearance.mchroma; + colorappearance.rstprotection = colorappearance.rstprotection && p.colorappearance.rstprotection == other.colorappearance.rstprotection; + colorappearance.contrast = colorappearance.contrast && p.colorappearance.contrast == other.colorappearance.contrast; + colorappearance.qcontrast = colorappearance.qcontrast && p.colorappearance.qcontrast == other.colorappearance.qcontrast; + colorappearance.colorh = colorappearance.colorh && p.colorappearance.colorh == other.colorappearance.colorh; + colorappearance.surrsource = colorappearance.surrsource && p.colorappearance.surrsource == other.colorappearance.surrsource; + colorappearance.gamut = colorappearance.gamut && p.colorappearance.gamut == other.colorappearance.gamut; + //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; @@ -437,8 +479,8 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (toneCurve.curve) toEdit.toneCurve.curve = mods.toneCurve.curve; if (toneCurve.curve2) toEdit.toneCurve.curve2 = mods.toneCurve.curve2; - if (toneCurve.curveMode) toEdit.toneCurve.curveMode = mods.toneCurve.curveMode; - if (toneCurve.curveMode2) toEdit.toneCurve.curveMode2 = mods.toneCurve.curveMode2; + if (toneCurve.curveMode) toEdit.toneCurve.curveMode = mods.toneCurve.curveMode; + if (toneCurve.curveMode2) toEdit.toneCurve.curveMode2 = mods.toneCurve.curveMode2; if (toneCurve.brightness) toEdit.toneCurve.brightness = dontforceSet && options.baBehav[ADDSET_TC_BRIGHTNESS] ? toEdit.toneCurve.brightness + mods.toneCurve.brightness : mods.toneCurve.brightness; if (toneCurve.black) toEdit.toneCurve.black = dontforceSet && options.baBehav[ADDSET_TC_BLACKLEVEL] ? toEdit.toneCurve.black + mods.toneCurve.black : mods.toneCurve.black; if (toneCurve.contrast) toEdit.toneCurve.contrast = dontforceSet && options.baBehav[ADDSET_TC_CONTRAST] ? toEdit.toneCurve.contrast + mods.toneCurve.contrast : mods.toneCurve.contrast; @@ -525,6 +567,26 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (defringe.radius) toEdit.defringe.radius = mods.defringe.radius; if (defringe.threshold) toEdit.defringe.threshold = mods.defringe.threshold; + if (colorappearance.enabled) toEdit.colorappearance.enabled = mods.colorappearance.enabled; + if (colorappearance.degree) toEdit.colorappearance.degree = dontforceSet && options.baBehav[ADDSET_CAT_DEGREE] ? toEdit.colorappearance.degree + mods.colorappearance.degree : mods.colorappearance.degree; + if (colorappearance.autodegree) toEdit.colorappearance.autodegree = mods.colorappearance.autodegree; + if (colorappearance.surround) toEdit.colorappearance.surround = mods.colorappearance.surround; + if (colorappearance.adapscen) toEdit.colorappearance.adapscen = mods.colorappearance.adapscen; + if (colorappearance.adaplum) toEdit.colorappearance.adaplum = dontforceSet && options.baBehav[ADDSET_CAT_ADAPTVIEWING] ? toEdit.colorappearance.adaplum + mods.colorappearance.adaplum : mods.colorappearance.adaplum; + if (colorappearance.wbmodel) toEdit.colorappearance.wbmodel = mods.colorappearance.wbmodel; + if (colorappearance.algo) toEdit.colorappearance.algo = mods.colorappearance.algo; + + if (colorappearance.jlight) toEdit.colorappearance.jlight = dontforceSet && options.baBehav[ADDSET_CAT_LIGHT] ? toEdit.colorappearance.jlight + mods.colorappearance.jlight : mods.colorappearance.jlight; + if (colorappearance.qbright) toEdit.colorappearance.qbright = dontforceSet && options.baBehav[ADDSET_CAT_BRIGHT] ? toEdit.colorappearance.qbright + mods.colorappearance.qbright : mods.colorappearance.qbright; + if (colorappearance.chroma) toEdit.colorappearance.chroma = dontforceSet && options.baBehav[ADDSET_CAT_CHROMA] ? toEdit.colorappearance.chroma + mods.colorappearance.chroma : mods.colorappearance.chroma; + if (colorappearance.schroma) toEdit.colorappearance.schroma = dontforceSet && options.baBehav[ADDSET_CAT_CHROMA_S] ? toEdit.colorappearance.schroma + mods.colorappearance.schroma : mods.colorappearance.schroma; + if (colorappearance.mchroma) toEdit.colorappearance.mchroma = dontforceSet && options.baBehav[ADDSET_CAT_CHROMA_M] ? toEdit.colorappearance.mchroma + mods.colorappearance.mchroma : mods.colorappearance.mchroma; + if (colorappearance.contrast) toEdit.colorappearance.contrast = dontforceSet && options.baBehav[ADDSET_CAT_CONTRAST] ? toEdit.colorappearance.contrast + mods.colorappearance.contrast : mods.colorappearance.contrast; + if (colorappearance.qcontrast) toEdit.colorappearance.qcontrast = dontforceSet && options.baBehav[ADDSET_CAT_CONTRAST_Q] ? toEdit.colorappearance.qcontrast + mods.colorappearance.qcontrast : mods.colorappearance.qcontrast; + if (colorappearance.colorh) toEdit.colorappearance.colorh = dontforceSet && options.baBehav[ADDSET_CAT_HUE] ? toEdit.colorappearance.colorh + mods.colorappearance.colorh : mods.colorappearance.colorh; + if (colorappearance.rstprotection) toEdit.colorappearance.rstprotection= dontforceSet && options.baBehav[ADDSET_CAT_RSTPRO] ? toEdit.colorappearance.rstprotection + mods.colorappearance.rstprotection : mods.colorappearance.rstprotection; + if (colorappearance.surrsource) toEdit.colorappearance.surrsource = mods.colorappearance.surrsource; + if (colorappearance.gamut) toEdit.colorappearance.gamut = mods.colorappearance.gamut; if (impulseDenoise.enabled) toEdit.impulseDenoise.enabled = mods.impulseDenoise.enabled; if (impulseDenoise.thresh) toEdit.impulseDenoise.thresh = mods.impulseDenoise.thresh; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 86b509ae9..5caed7a3b 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -169,36 +169,60 @@ class WBParamsEdited { class DefringeParamsEdited { public: - bool enabled; - bool radius; - bool threshold; + bool enabled; + bool radius; + bool threshold; }; class ImpulseDenoiseParamsEdited { - -public: - bool enabled; - bool thresh; +public: + bool enabled; + bool thresh; }; -class DirPyrDenoiseParamsEdited { - +class ColorappearanceParamsEdited { + public: - bool enabled; - bool Ldetail; - bool luma; - bool chroma; - bool gamma; + bool enabled; + bool degree; + bool autodegree; + bool surround; + bool adapscen; + bool adaplum; + bool wbmodel; + bool algo; + bool jlight; + bool qbright; + bool chroma; + bool schroma; + bool mchroma; + bool contrast; + bool qcontrast; + bool colorh; + bool rstprotection; + bool surrsource; + bool gamut; +}; + + +class DirPyrDenoiseParamsEdited { + +public: + bool enabled; + bool Ldetail; + bool luma; + bool chroma; + bool gamma; }; class EPDParamsEdited{ public: - bool enabled; - bool Strength; - bool EdgeStopping; - bool Scale; - bool ReweightingIterates; + bool enabled; + bool Strength; + bool EdgeStopping; + bool Scale; + bool ReweightingIterates; }; @@ -387,6 +411,7 @@ class ParamsEdited { SharpenEdgeParamsEdited sharpenEdge; SharpenMicroParamsEdited sharpenMicro; VibranceParamsEdited vibrance; + ColorappearanceParamsEdited colorappearance; //ColorBoostParamsEdited colorBoost; WBParamsEdited wb; //ColorShiftParamsEdited colorShift; diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index 004ab563e..f5792f5ac 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -50,7 +50,7 @@ PartialPasteDlg::PartialPasteDlg (Glib::ustring title) { 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"))); - + colorappearance= Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_COLORAPP"))); // options in detail: sharpen = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_SHARPENING"))); sharpenedge = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_SHARPENEDGE"))); @@ -126,6 +126,7 @@ PartialPasteDlg::PartialPasteDlg (Glib::ustring title) { 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[0]->pack_start (*colorappearance, Gtk::PACK_SHRINK, 2); vboxes[1]->pack_start (*detail, Gtk::PACK_SHRINK, 2); vboxes[1]->pack_start (*hseps[1], Gtk::PACK_SHRINK, 2); @@ -244,6 +245,7 @@ PartialPasteDlg::PartialPasteDlg (Glib::ustring title) { 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)); + colorappearanceConn=colorappearance->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)); gradsharpenConn = sharpenedge->signal_toggled().connect (sigc::bind (sigc::mem_fun(*detail, &Gtk::CheckButton::set_inconsistent), true)); @@ -420,6 +422,7 @@ void PartialPasteDlg::basicToggled () { shConn.block (true); epdConn.block(true); labcurveConn.block (true); + colorappearanceConn.block (true); basic->set_inconsistent (false); @@ -429,6 +432,7 @@ void PartialPasteDlg::basicToggled () { sh->set_active (basic->get_active ()); epd->set_active (basic->get_active ()); labcurve->set_active (basic->get_active ()); + colorappearance->set_active (basic->get_active ()); wbConn.block (false); exposureConn.block (false); @@ -436,6 +440,7 @@ void PartialPasteDlg::basicToggled () { shConn.block (false); epdConn.block (false); labcurveConn.block (false); + colorappearanceConn.block (false); } void PartialPasteDlg::detailToggled () { @@ -588,6 +593,7 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param 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 (!colorappearance->get_active ()) filterPE.colorappearance= falsePE.colorappearance; if (!sharpen->get_active ()) filterPE.sharpening = falsePE.sharpening; if (!sharpenedge->get_active ()) filterPE.sharpenEdge = falsePE.sharpenEdge; diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index a25b57dd5..252590522 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -44,6 +44,7 @@ class PartialPasteDlg : public Gtk::Dialog { Gtk::CheckButton* sh; Gtk::CheckButton* epd; Gtk::CheckButton* labcurve; + Gtk::CheckButton* colorappearance; // options in detail: Gtk::CheckButton* sharpen; @@ -107,7 +108,7 @@ class PartialPasteDlg : public Gtk::Dialog { sigc::connection everythingConn, basicConn, detailConn, colorConn, lensConn, compositionConn, metaicmConn, rawConn; - sigc::connection wbConn, exposureConn, hlrecConn, shConn, labcurveConn; + sigc::connection wbConn, exposureConn, hlrecConn, shConn, labcurveConn, colorappearanceConn; sigc::connection sharpenConn, gradsharpenConn, microcontrastConn, impdenConn, dirpyrdenConn, waveqConn, defringeConn, epdConn, dirpyreqConn; sigc::connection vibranceConn, chmixerConn, hsveqConn, rgbcurvesConn; sigc::connection distortionConn, cacorrConn, vignettingConn, lcpConn; diff --git a/rtgui/perspective.cc b/rtgui/perspective.cc index 7882d69fa..3fb096ae9 100644 --- a/rtgui/perspective.cc +++ b/rtgui/perspective.cc @@ -23,6 +23,8 @@ using namespace rtengine::procparams; PerspCorrection::PerspCorrection () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + horiz = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_HORIZONTAL"), -100, 100, 1, 0)); horiz->setAdjusterListener (this); diff --git a/rtgui/ppversion.h b/rtgui/ppversion.h index 5f104071b..3ec84e754 100644 --- a/rtgui/ppversion.h +++ b/rtgui/ppversion.h @@ -2,7 +2,7 @@ #define _PPVERSION_ // This number have to be incremented whenever the PP3 file format is modified -#define PPVERSION 305 +#define PPVERSION 306 #define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified #endif diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index b2f60c425..f64a2a8c1 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -191,6 +191,21 @@ Gtk::Widget* Preferences::getBatchProcPanel () { appendBehavList (mi, M("TP_WBALANCE_TEMPERATURE"), ADDSET_WB_TEMPERATURE, true); appendBehavList (mi, M("TP_WBALANCE_GREEN"), ADDSET_WB_GREEN, true); + mi = behModel->append (); + mi->set_value (behavColumns.label, M("TP_COLORAPP_LABEL")); + appendBehavList (mi, M("TP_COLORAPP_CIECAT_DEGREE"),ADDSET_CAT_DEGREE, true); + appendBehavList (mi, M("TP_COLORAPP_ADAPTSCENE"),ADDSET_CAT_ADAPTSCENE, true); + appendBehavList (mi, M("TP_COLORAPP_ADAPTVIEWING"),ADDSET_CAT_ADAPTVIEWING, true); + appendBehavList (mi, M("TP_COLORAPP_LIGHT"),ADDSET_CAT_LIGHT, true); + appendBehavList (mi, M("TP_COLORAPP_BRIGHT"),ADDSET_CAT_BRIGHT, true); + appendBehavList (mi, M("TP_COLORAPP_CHROMA"),ADDSET_CAT_CHROMA, true); + appendBehavList (mi, M("TP_COLORAPP_RSTPRO"),ADDSET_CAT_RSTPRO, true); + appendBehavList (mi, M("TP_COLORAPP_CONTRAST"),ADDSET_CAT_CONTRAST, true); + appendBehavList (mi, M("TP_COLORAPP_CONTRAST_Q"),ADDSET_CAT_CONTRAST_Q, true); + appendBehavList (mi, M("TP_COLORAPP_CHROMA_S"),ADDSET_CAT_CHROMA_S, true); + appendBehavList (mi, M("TP_COLORAPP_CHROMA_M"),ADDSET_CAT_CHROMA_M, true); + appendBehavList (mi, M("TP_COLORAPP_HUE"),ADDSET_CAT_HUE, true); + mi = behModel->append (); mi->set_value (behavColumns.label, M("TP_VIBRANCE_LABEL")); appendBehavList (mi, M("TP_VIBRANCE_PASTELS"), ADDSET_VIBRANCE_PASTELS, false); @@ -200,8 +215,7 @@ Gtk::Widget* Preferences::getBatchProcPanel () { mi->set_value (behavColumns.label, M("TP_GAMMA_OUTPUT")); appendBehavList (mi, M("TP_GAMMA_CURV"), ADDSET_FREE_OUPUT_GAMMA, false); appendBehavList (mi, M("TP_GAMMA_SLOP"), ADDSET_FREE_OUTPUT_SLOPE, false); - - + mi = behModel->append (); mi->set_value (behavColumns.label, M("TP_CHMIXER_LABEL")); appendBehavList (mi, M("TP_CHMIXER_RED")+", "+M("TP_CHMIXER_GREEN")+", "+M("TP_CHMIXER_BLUE"), ADDSET_CHMIXER, false); @@ -363,7 +377,7 @@ Gtk::Widget* Preferences::getProcParamsPanel () { std::vector pnames; parseDir (options.getUserProfilePath(), pnames, paramFileExtension); parseDir (options.getGlobalProfilePath(), pnames, paramFileExtension); - for (size_t i=0; iappend_text (pnames[i]); iprofiles->append_text (pnames[i]); } @@ -410,6 +424,41 @@ Gtk::Widget* Preferences::getColorManagementPanel () { mvbcm->pack_start (*colt, Gtk::PACK_SHRINK, 4); autoMonProfileToggled(); + //Gtk::Frame* fdp = Gtk::manage (new Gtk::Frame (M("PREFERENCES_OUTPUTDEVICE"))); + Gtk::VBox* vbdp = Gtk::manage (new Gtk::VBox ()); + vbdp->set_border_width (4); + //Gtk::Label* viewlab = Gtk::manage (new Gtk::Label (M("PREFERENCES_VIEW")+":")); + Gtk::Label* viewlab = Gtk::manage (new Gtk::Label (M("PREFERENCES_VIEW")+":", Gtk::ALIGN_LEFT)); + + view = Gtk::manage (new Gtk::ComboBoxText ()); + view->append_text (M("PREFERENCES_D50")); + view->append_text (M("PREFERENCES_D55")); + view->append_text (M("PREFERENCES_D60")); + view->append_text (M("PREFERENCES_D65")); + view->append_text (M("PREFERENCES_BLACKBODY")); + + Gtk::Label* greylab = Gtk::manage (new Gtk::Label (M("PREFERENCES_GREY")+":", Gtk::ALIGN_LEFT)); + grey = Gtk::manage (new Gtk::ComboBoxText ()); + grey->append_text (M("PREFERENCES_GREY05")); + grey->append_text (M("PREFERENCES_GREY10")); + grey->append_text (M("PREFERENCES_GREY15")); + grey->append_text (M("PREFERENCES_GREY18")); + grey->append_text (M("PREFERENCES_GREY23")); + grey->append_text (M("PREFERENCES_GREY30")); + grey->append_text (M("PREFERENCES_GREY40")); + + Gtk::Label* restartNeeded1 = Gtk::manage( new Gtk::Label (Glib::ustring(" (") + M("PREFERENCES_APPLNEXTSTARTUP") + ")") ); + Gtk::Label* restartNeeded2 = Gtk::manage( new Gtk::Label (Glib::ustring(" (") + M("PREFERENCES_APPLNEXTSTARTUP") + ")") ); + + Gtk::Table* colo = Gtk::manage (new Gtk::Table (2, 3)); + colo->attach (*viewlab, 0, 1, 0, 1, Gtk::FILL, Gtk::SHRINK, 2, 2); + colo->attach (*view, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL | Gtk::SHRINK, Gtk::SHRINK, 2, 2); + colo->attach (*restartNeeded1, 2, 3, 0, 1, Gtk::FILL, Gtk::SHRINK, 2, 2); + colo->attach (*greylab, 0, 1, 1, 2, Gtk::FILL, Gtk::SHRINK, 2, 2); + colo->attach (*grey, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL | Gtk::SHRINK, Gtk::SHRINK, 2, 2); + colo->attach (*restartNeeded2, 2, 3, 1, 2, Gtk::FILL, Gtk::SHRINK, 2, 2); + + mvbcm->pack_start (*colo, Gtk::PACK_SHRINK, 4); return mvbcm; } @@ -482,10 +531,10 @@ Gtk::Widget* Preferences::getGeneralPanel () { std::vector langs; parseDir (argv0 + "/languages", langs, ""); - for (size_t i=0; iappend_text (langs[i]); - } + for (size_t i=0; iappend_text (langs[i]); + } } Gtk::Label* langw = Gtk::manage( new Gtk::Label (Glib::ustring(" (") + M("PREFERENCES_APPLNEXTSTARTUP") + ")") ); @@ -526,7 +575,7 @@ Gtk::Widget* Preferences::getGeneralPanel () { theme->set_active (0); std::vector themes; parseDir (argv0 + "/themes", themes, ".gtkrc"); - for (size_t i=0; iappend_text (themes[i]); Gtk::Label* fontlab = Gtk::manage( new Gtk::Label (M("PREFERENCES_SELECTFONT")+":") ); @@ -1003,7 +1052,7 @@ void Preferences::storePreferences () { moptions.psDir = psDir->get_filename (); #elif defined __APPLE__ moptions.psDir = psDir->get_filename (); -#endif +#endif moptions.customEditorProg = editorToSendTo->get_text (); if (edGimp->get_active ()) moptions.editorToSendTo = 1; @@ -1013,7 +1062,7 @@ void Preferences::storePreferences () { #elif defined __APPLE__ else if (edPS->get_active ()) moptions.editorToSendTo = 2; -#endif +#endif else if (edOther->get_active ()) moptions.editorToSendTo = 3; @@ -1023,6 +1072,8 @@ void Preferences::storePreferences () { moptions.rtSettings.autoMonitorProfile = cbAutoMonProfile->get_active (); moptions.rtSettings.iccDirectory = iccDir->get_filename (); moptions.rtSettings.colorimetricIntent = intent->get_active_row_number (); + moptions.rtSettings.viewingdevice = view->get_active_row_number (); + moptions.rtSettings.viewingdevicegrey = grey->get_active_row_number (); if (sdcurrent->get_active ()) moptions.startupDir = STARTUPDIR_CURRENT; @@ -1038,7 +1089,7 @@ void Preferences::storePreferences () { moptions.parseExtensions.clear (); moptions.parseExtensionsEnabled.clear (); Gtk::TreeNodeChildren c = extensionModel->children (); - for (size_t i=0; iset_filename (moptions.rtSettings.monitorProfile); if (moptions.rtSettings.monitorProfile.empty()) - monProfile->set_current_folder (moptions.rtSettings.iccDirectory); - cbAutoMonProfile->set_active(moptions.rtSettings.autoMonitorProfile); + monProfile->set_current_folder (moptions.rtSettings.iccDirectory); + cbAutoMonProfile->set_active(moptions.rtSettings.autoMonitorProfile); if (Glib::file_test (moptions.rtSettings.iccDirectory, Glib::FILE_TEST_IS_DIR)) iccDir->set_current_folder (moptions.rtSettings.iccDirectory); - intent->set_active (moptions.rtSettings.colorimetricIntent); + intent->set_active (moptions.rtSettings.colorimetricIntent); + view->set_active (moptions.rtSettings.viewingdevice); + grey->set_active (moptions.rtSettings.viewingdevicegrey); + languages->set_active_text (moptions.language); ckbLangAutoDetect->set_active (moptions.languageAutoDetect); theme->set_active_text (moptions.theme); @@ -1146,7 +1200,7 @@ void Preferences::fillPreferences () { edPS->set_active (moptions.editorToSendTo==2); if (safe_file_test (moptions.psDir, Glib::FILE_TEST_IS_DIR)) psDir->set_filename (moptions.psDir); -#endif +#endif editorToSendTo->set_text (moptions.customEditorProg); txtCustProfBuilderPath->set_text(moptions.customProfileBuilder); @@ -1163,7 +1217,7 @@ void Preferences::fillPreferences () { } extensionModel->clear (); - for (size_t i=0; iappend()); row[extensionColumns.enabled] = moptions.parseExtensionsEnabled[i]; row[extensionColumns.ext] = moptions.parseExtensions[i]; @@ -1212,14 +1266,14 @@ void Preferences::fillPreferences () { addc.block (true); setc.block (true); if (moptions.baBehav.size() == ADDSET_PARAM_NUM) { - for (size_t i=0; ichildren().begin(); sections!=behModel->children().end(); sections++) - for (Gtk::TreeIter adjs=sections->children().begin(); adjs!=sections->children().end(); adjs++) - if (adjs->get_value (behavColumns.addsetid) == i) { - adjs->set_value (behavColumns.badd, moptions.baBehav[i]==1); - adjs->set_value (behavColumns.bset, moptions.baBehav[i]!=1); - break; - } + for (size_t i=0; ichildren().begin(); sections!=behModel->children().end(); sections++) + for (Gtk::TreeIter adjs=sections->children().begin(); adjs!=sections->children().end(); adjs++) + if (adjs->get_value (behavColumns.addsetid) == i) { + adjs->set_value (behavColumns.badd, moptions.baBehav[i]==1); + adjs->set_value (behavColumns.bset, moptions.baBehav[i]!=1); + break; + } } addc.block (false); setc.block (false); @@ -1425,7 +1479,7 @@ void Preferences::useThemeChanged(){ void Preferences::addExtPressed () { Gtk::TreeNodeChildren c = extensionModel->children (); - for (size_t i=0; iget_text ()) return; diff --git a/rtgui/preferences.h b/rtgui/preferences.h index 4047c812c..3ee715847 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -88,6 +88,8 @@ class Preferences : public Gtk::Dialog { Gtk::SpinButton* panFactor; Gtk::ComboBoxText* intent; + Gtk::ComboBoxText* view; + Gtk::ComboBoxText* grey; Gtk::ComboBoxText* theme; Gtk::CheckButton* slimUI; diff --git a/rtgui/preprocess.cc b/rtgui/preprocess.cc index c6424e5de..46cb6ad83 100644 --- a/rtgui/preprocess.cc +++ b/rtgui/preprocess.cc @@ -26,6 +26,8 @@ using namespace rtengine::procparams; PreProcess::PreProcess () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + hotDeadPixel = Gtk::manage(new Gtk::CheckButton((M("TP_PREPROCESS_HOTDEADPIXFILT")))); lineDenoise = Gtk::manage(new Adjuster (M("TP_PREPROCESS_LINEDENOISE"),0,1000,1,0)); diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index ea942336d..af0c9eabd 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -26,6 +26,8 @@ using namespace rtengine::procparams; RAWCACorr::RAWCACorr () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + caAutocorrect = Gtk::manage(new Gtk::CheckButton((M("TP_RAWCACORR_AUTO")))); caRed = Gtk::manage(new Adjuster (M("TP_RAWCACORR_CARED"),-4.0,4.0,0.1,0)); caRed->setAdjusterListener (this); diff --git a/rtgui/rawexposure.cc b/rtgui/rawexposure.cc index 91b31dcf4..719146517 100644 --- a/rtgui/rawexposure.cc +++ b/rtgui/rawexposure.cc @@ -26,6 +26,8 @@ using namespace rtengine::procparams; RAWExposure::RAWExposure () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + PexPos = Gtk::manage(new Adjuster (M("TP_RAWEXPOS_LINEAR"),0.1,16.0,0.01,1)); PexPos->setAdjusterListener (this); if (PexPos->delay < 1000) PexPos->delay = 1000; diff --git a/rtgui/rawprocess.cc b/rtgui/rawprocess.cc index e0b83b1d8..6ad736685 100644 --- a/rtgui/rawprocess.cc +++ b/rtgui/rawprocess.cc @@ -24,6 +24,8 @@ using namespace rtengine::procparams; RawProcess::RawProcess () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_DMETHOD") +": ")),Gtk::PACK_SHRINK, 4); dmethod = Gtk::manage (new MyComboBoxText ()); diff --git a/rtgui/resize.cc b/rtgui/resize.cc index c48ac032b..6819b6ebf 100644 --- a/rtgui/resize.cc +++ b/rtgui/resize.cc @@ -25,6 +25,8 @@ using namespace rtengine::procparams; Resize::Resize () : Gtk::VBox(), FoldableToolPanel(this), maxw(100000), maxh(100000) { + set_border_width(4); + cropw = 0; croph = 0; diff --git a/rtgui/rgbcurves.cc b/rtgui/rgbcurves.cc index c9a4645e2..4fd0709bc 100644 --- a/rtgui/rgbcurves.cc +++ b/rtgui/rgbcurves.cc @@ -24,6 +24,8 @@ using namespace rtengine::procparams; RGBCurves::RGBCurves () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + std::vector milestones; curveEditorG = new CurveEditorGroup (options.lastRgbCurvesDir, M("TP_RGBCURVES_CHANNEL")); diff --git a/rtgui/rotate.cc b/rtgui/rotate.cc index 30ca9b0f9..16487f246 100644 --- a/rtgui/rotate.cc +++ b/rtgui/rotate.cc @@ -28,6 +28,8 @@ using namespace rtengine::procparams; Rotate::Rotate () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + rlistener = NULL; degree = Gtk::manage (new Adjuster (M("TP_ROTATE_DEGREE"), -45, 45, 0.01, 0)); diff --git a/rtgui/shadowshighlights.cc b/rtgui/shadowshighlights.cc index 3d6966780..14f2dff4a 100644 --- a/rtgui/shadowshighlights.cc +++ b/rtgui/shadowshighlights.cc @@ -23,6 +23,8 @@ using namespace rtengine::procparams; ShadowsHighlights::ShadowsHighlights () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (false); pack_start (*enabled); diff --git a/rtgui/sharpenedge.cc b/rtgui/sharpenedge.cc index 5f8d3387b..0ab5fac1f 100644 --- a/rtgui/sharpenedge.cc +++ b/rtgui/sharpenedge.cc @@ -28,10 +28,17 @@ using namespace rtengine::procparams; SharpenEdge::SharpenEdge () : Gtk::VBox(), FoldableToolPanel(this) { + + set_border_width(4); + enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (true); pack_start(*enabled, Gtk::PACK_SHRINK, 0); + Gtk::HSeparator *hsep1 = Gtk::manage (new Gtk::HSeparator()); + hsep1->show (); + pack_start (*hsep1); + passes = Gtk::manage(new Adjuster (M("TP_SHARPENEDGE_PASSES"),1,4,1,2)); passes->setAdjusterListener (this); if (passes->delay < 1000) passes->delay = 1000; diff --git a/rtgui/sharpening.cc b/rtgui/sharpening.cc index ee8328426..0d257f074 100644 --- a/rtgui/sharpening.cc +++ b/rtgui/sharpening.cc @@ -26,6 +26,8 @@ using namespace rtengine::procparams; Sharpening::Sharpening () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + std::vector milestones; milestones.push_back( GradientMilestone(0.0, 0.0, 0.0, 0.0) ); milestones.push_back( GradientMilestone(1.0, 1.0, 1.0, 1.0) ); @@ -168,12 +170,12 @@ void Sharpening::read (const ProcParams* pp, const ParamsEdited* pedited) { dradius->setEditedState (pedited->sharpening.deconvradius ? Edited : UnEdited); diter->setEditedState (pedited->sharpening.deconviter ? Edited : UnEdited); ddamping->setEditedState (pedited->sharpening.deconvdamping ? Edited : UnEdited); - - enabled->set_inconsistent (!pedited->sharpening.enabled); - halocontrol->set_inconsistent (!pedited->sharpening.halocontrol); - edgesonly->set_inconsistent (!pedited->sharpening.edgesonly); - } - + + enabled->set_inconsistent (multiImage && !pedited->sharpening.enabled); + halocontrol->set_inconsistent (multiImage && !pedited->sharpening.halocontrol); + edgesonly->set_inconsistent (multiImage && !pedited->sharpening.edgesonly); + } + enaConn.block (true); enabled->set_active (pp->sharpening.enabled); enaConn.block (false); @@ -301,7 +303,7 @@ void Sharpening::setDefaults (const ProcParams* defParams, const ParamsEdited* p void Sharpening::adjusterChanged (Adjuster* a, double newval) { - if (listener && enabled->get_active()) { + if (listener && (multiImage||enabled->get_active()) ) { Glib::ustring costr; if (a==radius || a==dradius) @@ -334,14 +336,14 @@ void Sharpening::adjusterChanged (Adjuster* a, double newval) { //void Sharpening::adjusterChanged (ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) { void Sharpening::adjusterChanged (ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) { - if (listener && enabled->get_active()) { + if (listener && (multiImage||enabled->get_active()) ) { listener->panelChanged (EvShrThresh, threshold->getHistoryString()); } } void Sharpening::enabled_toggled () { - if (batchMode) { + if (multiImage) { if (enabled->get_inconsistent()) { enabled->set_inconsistent (false); enaConn.block (true); @@ -355,7 +357,9 @@ void Sharpening::enabled_toggled () { } if (listener) { - if (enabled->get_active ()) + if (enabled->get_inconsistent()) + listener->panelChanged (EvShrEnabled, M("GENERAL_UNCHANGED")); + else if (enabled->get_active ()) listener->panelChanged (EvShrEnabled, M("GENERAL_ENABLED")); else listener->panelChanged (EvShrEnabled, M("GENERAL_DISABLED")); @@ -364,7 +368,7 @@ void Sharpening::enabled_toggled () { void Sharpening::edgesonly_toggled () { - if (batchMode) { + if (multiImage) { if (edgesonly->get_inconsistent()) { edgesonly->set_inconsistent (false); eonlyConn.block (true); @@ -377,14 +381,16 @@ void Sharpening::edgesonly_toggled () { lastEdgesOnly = edgesonly->get_active (); } - if (!batchMode) { - removeIfThere (edgebin, edgebox, false); - if (edgesonly->get_active ()) - edgebin->pack_start (*edgebox); - } - - if (listener && enabled->get_active()) { + if (!batchMode) { + removeIfThere (edgebin, edgebox, false); if (edgesonly->get_active ()) + edgebin->pack_start (*edgebox); + } + + if (listener && (multiImage||enabled->get_active()) ) { + if (edgesonly->get_inconsistent()) + listener->panelChanged (EvShrEdgeOnly, M("GENERAL_INITIALVALUES")); + else if (edgesonly->get_active ()) listener->panelChanged (EvShrEdgeOnly, M("GENERAL_ENABLED")); else listener->panelChanged (EvShrEdgeOnly, M("GENERAL_DISABLED")); @@ -393,7 +399,7 @@ void Sharpening::edgesonly_toggled () { void Sharpening::halocontrol_toggled () { - if (batchMode) { + if (multiImage) { if (halocontrol->get_inconsistent()) { halocontrol->set_inconsistent (false); hcConn.block (true); @@ -406,14 +412,16 @@ void Sharpening::halocontrol_toggled () { lastHaloControl = halocontrol->get_active (); } - if (!batchMode) { - removeIfThere (hcbin, hcbox, false); - if (halocontrol->get_active ()) - hcbin->pack_start (*hcbox); - } - - if (listener && enabled->get_active()) { + if (!batchMode) { + removeIfThere (hcbin, hcbox, false); if (halocontrol->get_active ()) + hcbin->pack_start (*hcbox); + } + + if (listener && (multiImage||enabled->get_active()) ) { + if (halocontrol->get_inconsistent()) + listener->panelChanged (EvShrHaloControl, M("GENERAL_INITIALVALUES")); + else if (halocontrol->get_active ()) listener->panelChanged (EvShrHaloControl, M("GENERAL_ENABLED")); else listener->panelChanged (EvShrHaloControl, M("GENERAL_DISABLED")); @@ -429,8 +437,8 @@ void Sharpening::method_changed () { pack_start (*usm); else if (method->get_active_row_number()==1) pack_start (*rld); - - if (listener && enabled->get_active ()) + + if (listener && (multiImage||enabled->get_active()) ) listener->panelChanged (EvShrMethod, method->get_active_text ()); } @@ -439,10 +447,10 @@ void Sharpening::setBatchMode (bool batchMode) { ToolPanel::setBatchMode (batchMode); - removeIfThere (hcbin, hcbox, false); - hcbin->pack_start (*hcbox); - removeIfThere (edgebin, edgebox, false); - edgebin->pack_start (*edgebox); + removeIfThere (hcbin, hcbox, false); + hcbin->pack_start (*hcbox); + removeIfThere (edgebin, edgebox, false); + edgebin->pack_start (*edgebox); radius->showEditedCB (); amount->showEditedCB (); @@ -459,12 +467,12 @@ void Sharpening::setBatchMode (bool batchMode) { void Sharpening::setAdjusterBehavior (bool amountadd) { - amount->setAddMode(amountadd); - damount->setAddMode(amountadd); + amount->setAddMode(amountadd); + damount->setAddMode(amountadd); } void Sharpening::trimValues (rtengine::procparams::ProcParams* pp) { - amount->trimValue(pp->sharpening.amount); - damount->trimValue(pp->sharpening.deconvamount); + amount->trimValue(pp->sharpening.amount); + damount->trimValue(pp->sharpening.deconvamount); } diff --git a/rtgui/sharpenmicro.cc b/rtgui/sharpenmicro.cc index ccab3a638..9e9978abd 100644 --- a/rtgui/sharpenmicro.cc +++ b/rtgui/sharpenmicro.cc @@ -28,11 +28,18 @@ using namespace rtengine::procparams; SharpenMicro::SharpenMicro () : Gtk::VBox(), FoldableToolPanel(this) { + + set_border_width(4); + enabled = Gtk::manage (new Gtk::CheckButton (M("GENERAL_ENABLED"))); enabled->set_active (true); pack_start(*enabled, Gtk::PACK_SHRINK, 0); enabled->show (); + Gtk::HSeparator *hsep1 = Gtk::manage (new Gtk::HSeparator()); + hsep1->show (); + pack_start (*hsep1); + amount= Gtk::manage(new Adjuster (M("TP_SHARPENMICRO_AMOUNT"),0,100,1,20)); amount->setAdjusterListener (this); if (amount->delay < 1000) amount->delay = 1000; diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 4ff47a3d0..ea89c653a 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -27,6 +27,8 @@ using namespace rtengine::procparams; ToneCurve::ToneCurve () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + CurveListener::setMulti(true); std::vector bottomMilestones; diff --git a/rtgui/toolpanel.h b/rtgui/toolpanel.h index ad268b074..749c5217f 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -42,15 +42,17 @@ class ToolPanel { protected: ToolPanelListener* listener; ToolPanelListener* tmp; - bool batchMode; + bool batchMode; // True if the ToolPanel is used in Batch mode + bool multiImage; // True if more than one image are being edited at the same time (also imply that batchMode=true), false otherwise public: - ToolPanel () : listener(NULL), tmp(NULL), batchMode(false) {} + ToolPanel () : listener(NULL), tmp(NULL), batchMode(false), multiImage(false) {} virtual ~ToolPanel() {} void setParent (Gtk::Box* parent) {} Gtk::Box* getParent () { return NULL; } + void setMultiImage (bool m) { multiImage = m; } void setListener (ToolPanelListener* tpl) { listener = tpl; } virtual void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited=NULL) {} virtual void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL) {} @@ -71,10 +73,10 @@ class FoldableToolPanel : public ToolPanel { Gtk::Box* parentContainer; void foldThemAll (GdkEventButton* event); - public: - Gtk::Expander* exp; + public: + Gtk::Expander* exp; - FoldableToolPanel(Gtk::Box* content); + FoldableToolPanel(Gtk::Box* content); void setParent (Gtk::Box* parent) { parentContainer = parent; } Gtk::Box* getParent () { return parentContainer; } diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index cec48dd0e..c5eeae589 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -56,6 +56,7 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc(NULL) { distortion = Gtk::manage (new Distortion ()); rotate = Gtk::manage (new Rotate ()); vibrance = Gtk::manage (new Vibrance ()); + colorappearance = Gtk::manage (new Colorappearance ()); whitebalance = Gtk::manage (new WhiteBalance ()); vignetting = Gtk::manage (new Vignetting ()); perspective = Gtk::manage (new PerspCorrection ()); @@ -89,6 +90,7 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc(NULL) { 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 (exposurePanel, colorappearance, M("TP_COLORAPP_LABEL")); toolPanels.push_back (colorappearance); addPanel (detailsPanel, impulsedenoise, M("TP_IMPULSEDENOISE_LABEL")); toolPanels.push_back (impulsedenoise); addPanel (detailsPanel, dirpyrdenoise, M("TP_DIRPYRDENOISE_LABEL")); toolPanels.push_back (dirpyrdenoise); addPanel (detailsPanel, defringe, M("TP_DEFRINGE_LABEL")); toolPanels.push_back (defringe); diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index e3ed8c263..31f0fe168 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -30,6 +30,7 @@ #include "coarsepanel.h" #include "tonecurve.h" #include "vibrance.h" +#include "colorappearance.h" #include "shadowshighlights.h" #include "impulsedenoise.h" #include "defringe.h" @@ -90,6 +91,7 @@ class ToolPanelCoordinator : public ToolPanelListener, PerspCorrection* perspective; CACorrection* cacorrection; HLRecovery* hlrecovery; + Colorappearance* colorappearance; Vibrance* vibrance; ChMixer* chmixer; Resize* resize; diff --git a/rtgui/vibrance.cc b/rtgui/vibrance.cc index b8543d5dd..d5ecda832 100644 --- a/rtgui/vibrance.cc +++ b/rtgui/vibrance.cc @@ -26,6 +26,8 @@ using namespace rtengine::procparams; Vibrance::Vibrance () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + std::vector milestones; float R, G, B; // -0.1 rad < Hue < 1.6 rad diff --git a/rtgui/vignetting.cc b/rtgui/vignetting.cc index 2e0b79e8e..546a82504 100644 --- a/rtgui/vignetting.cc +++ b/rtgui/vignetting.cc @@ -24,6 +24,8 @@ using namespace rtengine::procparams; Vignetting::Vignetting () : Gtk::VBox(), FoldableToolPanel(this) { + set_border_width(4); + amount = Gtk::manage (new Adjuster (M("TP_VIGNETTING_AMOUNT"), -100, 100, 1, 0)); amount->setAdjusterListener (this); diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index 55207c47c..64e8fa61a 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -61,6 +61,8 @@ void WhiteBalance::cleanup () { WhiteBalance::WhiteBalance () : Gtk::VBox(), FoldableToolPanel(this), wbp(NULL), wblistener(NULL) { + set_border_width(4); + Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); hbox->show (); Gtk::Label* lab = Gtk::manage (new Gtk::Label (M("TP_WBALANCE_METHOD")));