diff --git a/rtdata/iccprofiles/output/RTv2_ACES-AP0.icc b/rtdata/iccprofiles/output/RTv2_ACES-AP0.icc index 34363781f..dce81742c 100644 Binary files a/rtdata/iccprofiles/output/RTv2_ACES-AP0.icc and b/rtdata/iccprofiles/output/RTv2_ACES-AP0.icc differ diff --git a/rtdata/iccprofiles/output/RTv2_ACES-AP1.icc b/rtdata/iccprofiles/output/RTv2_ACES-AP1.icc index 413360817..65af92f1c 100644 Binary files a/rtdata/iccprofiles/output/RTv2_ACES-AP1.icc and b/rtdata/iccprofiles/output/RTv2_ACES-AP1.icc differ diff --git a/rtdata/iccprofiles/output/RTv2_Best.icc b/rtdata/iccprofiles/output/RTv2_Best.icc index 3f9db89e0..6390b1f34 100644 Binary files a/rtdata/iccprofiles/output/RTv2_Best.icc and b/rtdata/iccprofiles/output/RTv2_Best.icc differ diff --git a/rtdata/iccprofiles/output/RTv2_Beta.icc b/rtdata/iccprofiles/output/RTv2_Beta.icc index ebd5005e2..13907b35a 100644 Binary files a/rtdata/iccprofiles/output/RTv2_Beta.icc and b/rtdata/iccprofiles/output/RTv2_Beta.icc differ diff --git a/rtdata/iccprofiles/output/RTv2_Bruce.icc b/rtdata/iccprofiles/output/RTv2_Bruce.icc index c795da140..7dd7f383c 100644 Binary files a/rtdata/iccprofiles/output/RTv2_Bruce.icc and b/rtdata/iccprofiles/output/RTv2_Bruce.icc differ diff --git a/rtdata/iccprofiles/output/RTv2_Large.icc b/rtdata/iccprofiles/output/RTv2_Large.icc index 40f86fcf1..9d2c3fc01 100644 Binary files a/rtdata/iccprofiles/output/RTv2_Large.icc and b/rtdata/iccprofiles/output/RTv2_Large.icc differ diff --git a/rtdata/iccprofiles/output/RTv2_Medium.icc b/rtdata/iccprofiles/output/RTv2_Medium.icc index 59bdf6706..ebaf4d133 100644 Binary files a/rtdata/iccprofiles/output/RTv2_Medium.icc and b/rtdata/iccprofiles/output/RTv2_Medium.icc differ diff --git a/rtdata/iccprofiles/output/RTv2_Rec2020.icc b/rtdata/iccprofiles/output/RTv2_Rec2020.icc index b6969a6f1..5a1614bed 100644 Binary files a/rtdata/iccprofiles/output/RTv2_Rec2020.icc and b/rtdata/iccprofiles/output/RTv2_Rec2020.icc differ diff --git a/rtdata/iccprofiles/output/RTv2_Wide.icc b/rtdata/iccprofiles/output/RTv2_Wide.icc index 32ce13c7d..e17668966 100644 Binary files a/rtdata/iccprofiles/output/RTv2_Wide.icc and b/rtdata/iccprofiles/output/RTv2_Wide.icc differ diff --git a/rtdata/iccprofiles/output/RTv2_sRGB.icc b/rtdata/iccprofiles/output/RTv2_sRGB.icc index 5efc365f8..eb841129e 100644 Binary files a/rtdata/iccprofiles/output/RTv2_sRGB.icc and b/rtdata/iccprofiles/output/RTv2_sRGB.icc differ diff --git a/rtdata/iccprofiles/output/RTv4_ACES-AP0.icc b/rtdata/iccprofiles/output/RTv4_ACES-AP0.icc index 30df95eac..e07da6e04 100644 Binary files a/rtdata/iccprofiles/output/RTv4_ACES-AP0.icc and b/rtdata/iccprofiles/output/RTv4_ACES-AP0.icc differ diff --git a/rtdata/iccprofiles/output/RTv4_ACES-AP1.icc b/rtdata/iccprofiles/output/RTv4_ACES-AP1.icc index 5dfb4cb0d..7194ff6da 100644 Binary files a/rtdata/iccprofiles/output/RTv4_ACES-AP1.icc and b/rtdata/iccprofiles/output/RTv4_ACES-AP1.icc differ diff --git a/rtdata/iccprofiles/output/RTv4_Best.icc b/rtdata/iccprofiles/output/RTv4_Best.icc index c67688686..8d40518ad 100644 Binary files a/rtdata/iccprofiles/output/RTv4_Best.icc and b/rtdata/iccprofiles/output/RTv4_Best.icc differ diff --git a/rtdata/iccprofiles/output/RTv4_Beta.icc b/rtdata/iccprofiles/output/RTv4_Beta.icc index 86825164a..118615326 100644 Binary files a/rtdata/iccprofiles/output/RTv4_Beta.icc and b/rtdata/iccprofiles/output/RTv4_Beta.icc differ diff --git a/rtdata/iccprofiles/output/RTv4_Bruce.icc b/rtdata/iccprofiles/output/RTv4_Bruce.icc index c3a01b116..d61767305 100644 Binary files a/rtdata/iccprofiles/output/RTv4_Bruce.icc and b/rtdata/iccprofiles/output/RTv4_Bruce.icc differ diff --git a/rtdata/iccprofiles/output/RTv4_Large.icc b/rtdata/iccprofiles/output/RTv4_Large.icc index 176bff9a7..9aef72934 100644 Binary files a/rtdata/iccprofiles/output/RTv4_Large.icc and b/rtdata/iccprofiles/output/RTv4_Large.icc differ diff --git a/rtdata/iccprofiles/output/RTv4_Medium.icc b/rtdata/iccprofiles/output/RTv4_Medium.icc index d63965fa5..075e9637c 100644 Binary files a/rtdata/iccprofiles/output/RTv4_Medium.icc and b/rtdata/iccprofiles/output/RTv4_Medium.icc differ diff --git a/rtdata/iccprofiles/output/RTv4_Rec2020.icc b/rtdata/iccprofiles/output/RTv4_Rec2020.icc index 27b1f8c49..9fcb5d263 100644 Binary files a/rtdata/iccprofiles/output/RTv4_Rec2020.icc and b/rtdata/iccprofiles/output/RTv4_Rec2020.icc differ diff --git a/rtdata/iccprofiles/output/RTv4_Wide.icc b/rtdata/iccprofiles/output/RTv4_Wide.icc index f95587797..6dca43823 100644 Binary files a/rtdata/iccprofiles/output/RTv4_Wide.icc and b/rtdata/iccprofiles/output/RTv4_Wide.icc differ diff --git a/rtdata/iccprofiles/output/RTv4_sRGB.icc b/rtdata/iccprofiles/output/RTv4_sRGB.icc index af95e0fd4..60607da55 100644 Binary files a/rtdata/iccprofiles/output/RTv4_sRGB.icc and b/rtdata/iccprofiles/output/RTv4_sRGB.icc differ diff --git a/rtdata/images/themed/png/dark/color-picker-small.png b/rtdata/images/themed/png/dark/color-picker-small.png new file mode 100644 index 000000000..5976b6e11 Binary files /dev/null and b/rtdata/images/themed/png/dark/color-picker-small.png differ diff --git a/rtdata/images/themed/png/light/color-picker-small.png b/rtdata/images/themed/png/light/color-picker-small.png new file mode 100644 index 000000000..109f8fda4 Binary files /dev/null and b/rtdata/images/themed/png/light/color-picker-small.png differ diff --git a/rtdata/images/themed/svg/color-picker-small.svg b/rtdata/images/themed/svg/color-picker-small.svg new file mode 100644 index 000000000..d83400653 --- /dev/null +++ b/rtdata/images/themed/svg/color-picker-small.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + image/svg+xml + + + + + Maciej Dworak + + + + + + + + RawTherapee icon. + + + + + + + + + + + + + + + + + + + + + diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index adc0528ea..34c74ea67 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -5,6 +5,7 @@ ABOUT_TAB_CREDITS;Crédits ABOUT_TAB_LICENSE;Licence ABOUT_TAB_RELEASENOTES;Notes de version ABOUT_TAB_SPLASH;Splash +ADJUSTER_RESET_TO_DEFAULT;Clic - réinitialise à la valeur par défaut.\nCtrl+clic - réinitialise à la valeur initiale. BATCHQUEUE_AUTOSTART;Démarrage auto BATCHQUEUE_AUTOSTARTHINT;Démarrer automatiquement le traitement à l'arrivée d'une nouvelle tâche BATCHQUEUE_DESTFILENAME;Chemin et nom de fichier @@ -40,6 +41,10 @@ DYNPROFILEEDITOR_DELETE;Supprimer DYNPROFILEEDITOR_EDIT;Modifier DYNPROFILEEDITOR_EDIT_RULE;Modifier une règle de Profil Dynamique DYNPROFILEEDITOR_ENTRY_TOOLTIP;La correspondance est insensible à la casse.\nUtilisez le préfix "re:" pour entrer\nune expression régulière. +DYNPROFILEEDITOR_IMGTYPE_ANY;Tout +DYNPROFILEEDITOR_IMGTYPE_HDR;HDR +DYNPROFILEEDITOR_IMGTYPE_PS;Pixel Shift +DYNPROFILEEDITOR_IMGTYPE_STD;Standard DYNPROFILEEDITOR_MOVE_DOWN;Déplacer vers le bas DYNPROFILEEDITOR_MOVE_UP;Déplacer vers le haut DYNPROFILEEDITOR_NEW;Nouveau @@ -53,6 +58,7 @@ EXIFFILTER_CAMERA;Appareil photo EXIFFILTER_EXPOSURECOMPENSATION;Compensation d'exposition (EV) EXIFFILTER_FILETYPE;Type de fichier EXIFFILTER_FOCALLEN;Longueur focale +EXIFFILTER_IMAGETYPE;Type d'image EXIFFILTER_ISO;ISO EXIFFILTER_LENS;Objectif EXIFFILTER_METADATAFILTER;Activer les filtres sur les Métadonnées @@ -111,6 +117,8 @@ FILEBROWSER_AUTOFLATFIELD;Champ Uniforme auto FILEBROWSER_BROWSEPATHBUTTONHINT;Cliquez pour parcourir le chemin saisi FILEBROWSER_BROWSEPATHHINT;Saisissez le chemin à parcourir\nCtrl-O pour placer le focus sur le champ de saisie.\nEntrée / Ctrl-Entrée pour y naviguer;\nEsc pour effacer les modifications.\nShift-Esc pour enlever le focus.\n\n\nRaccourcis pour les chemins:\n ~ - le dossier utilisateur\n ! - le dossier Images de l'utilisateur FILEBROWSER_CACHE;Cache +FILEBROWSER_CACHECLEARFROMFULL;Vider tout y compris les profils mis en cache +FILEBROWSER_CACHECLEARFROMPARTIAL;Vider tout sauf les profils mis en cache FILEBROWSER_CLEARPROFILE;Remettre le profil à zéro FILEBROWSER_COLORLABEL_TOOLTIP;Label couleur\n\nUtilisez le menu déroulant ou le raccourci clavier:\nShift-Ctrl-0 Pas de couleur\nShift-Ctrl-1 Rouge\nShift-Ctrl-2 Jaune\nShift-Ctrl-3 Vert\nShift-Ctrl-4 Bleu\nShift-Ctrl-5 Pourpre FILEBROWSER_COPYPROFILE;Copier le profil @@ -225,6 +233,7 @@ GENERAL_NONE;Aucun GENERAL_OK;OK GENERAL_OPEN;Ouvrir GENERAL_PORTRAIT;Portrait +GENERAL_RESET;Réinitialiser GENERAL_SAVE;Enregistrer GENERAL_SAVE_AS;Enregistrer sous... GENERAL_SLIDER;Curseur @@ -237,6 +246,7 @@ HISTOGRAM_TOOLTIP_CHRO;Montrer/Cacher l'histogramme de Chromaticité HISTOGRAM_TOOLTIP_FULL;Basculer la vue de l'histogramme : complet (activé) / zoomé (désactivé) HISTOGRAM_TOOLTIP_G;Montrer/cacher l'histogramme VERT HISTOGRAM_TOOLTIP_L;Montrer/cacher l'histogramme Luminance CIELAB +HISTOGRAM_TOOLTIP_MODE;Bascule entre une échelle linéaire, linéaire-log et log-log de l'histogramme. HISTOGRAM_TOOLTIP_R;Montrer/cacher l'histogramme ROUGE HISTOGRAM_TOOLTIP_RAW;Montrer/Cacher l'histogramme des données RAW HISTORY_CHANGED;Changé @@ -476,7 +486,9 @@ HISTORY_MSG_231;N&B - Courbe 'Avant' HISTORY_MSG_232;N&B - Type de courbe 'Avant' HISTORY_MSG_233;N&B - Courbe 'Après' HISTORY_MSG_234;N&B - Type de courbe 'Après' +HISTORY_MSG_235;N&B - Mixeur de Canaux - Auto HISTORY_MSG_236;--inutilisé-- +HISTORY_MSG_237;N&B - Mixeur de Canaux HISTORY_MSG_238;FD - Étendu HISTORY_MSG_239;FD - Force HISTORY_MSG_240;FD - Centre @@ -512,6 +524,7 @@ HISTORY_MSG_269;Virage Partiel - HL - Rouge HISTORY_MSG_270;Virage Partiel - HL - Vert HISTORY_MSG_271;Virage Partiel - HL - Bleu HISTORY_MSG_272;Virage Partiel - Balance +HISTORY_MSG_273;Virage Partiel - Balance Couleur O/TM/HL HISTORY_MSG_274;Virage Partiel - Saturation des ombres HISTORY_MSG_275;Virage Partiel - Saturation des HL HISTORY_MSG_276;Virage Partiel - Opacité @@ -630,6 +643,7 @@ HISTORY_MSG_388;O - Résiduel - BC vert moyen HISTORY_MSG_389;O - Résiduel - BC bleu moyen HISTORY_MSG_390;O - Résiduel - BC vert bas HISTORY_MSG_391;O - Résiduel - BC bleu bas +HISTORY_MSG_392;O - Résiduel - Balance Couleur HISTORY_MSG_393;DCP - Table de corresp. (LUT) HISTORY_MSG_394;DCP - Exposition de base HISTORY_MSG_395;DCP - Table de base @@ -709,25 +723,65 @@ HISTORY_MSG_484;CAM02 - Yb auto scène HISTORY_MSG_485;Correction d'Objectif HISTORY_MSG_486;Corr. d'Obj. - Appareil HISTORY_MSG_487;Corr. d'Obj. - Objectif +HISTORY_MSG_488;Compression de Plage Dymanique +HISTORY_MSG_489;CPD - Détail +HISTORY_MSG_490;CPD - Quantité HISTORY_MSG_491;Balances des Blancs HISTORY_MSG_492;Courbes RVB HISTORY_MSG_493;Ajustements L*a*b* +HISTORY_MSG_CLAMPOOG;Tronquer les couleurs hors gamut HISTORY_MSG_COLORTONING_LABGRID_VALUE;Virage Partiel - Correction couleur +HISTORY_MSG_COLORTONING_LABREGION_AB;Virage Partiel - Correction couleur +HISTORY_MSG_COLORTONING_LABREGION_CHROMATICITYMASK;Virage Partiel - Masque C +HISTORY_MSG_COLORTONING_LABREGION_HUEMASK;Virage Partiel - Masque T +HISTORY_MSG_COLORTONING_LABREGION_LIGHTNESS;Virage Partiel - Luminosité +HISTORY_MSG_COLORTONING_LABREGION_LIGHTNESSMASK;Virage Partiel - Masque L +HISTORY_MSG_COLORTONING_LABREGION_LIST;Virage Partiel - Liste +HISTORY_MSG_COLORTONING_LABREGION_SATURATION;Virage Partiel - Saturation +HISTORY_MSG_COLORTONING_LABREGION_SHOWMASK;Virage Partiel - Montrer le masque +HISTORY_MSG_DEHAZE_DEPTH;EB - Profondeur +HISTORY_MSG_DEHAZE_ENABLED;Élimination de la Brume +HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP;EB - Montrer carte de profondeur +HISTORY_MSG_DEHAZE_STRENGTH;EB - Force +HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;Double dématriçage - Seuil auto +HISTORY_MSG_DUALDEMOSAIC_CONTRAST;Double dématriçage - Seuil de contraste HISTORY_MSG_HISTMATCHING;Calcul Courbe Tonale svt Aperçu +HISTORY_MSG_ICM_OUTPUT_PRIMARIES;Sortie - Primaires +HISTORY_MSG_ICM_OUTPUT_TEMP;Sortie - ICC-v4 illuminant D +HISTORY_MSG_ICM_OUTPUT_TYPE;Sortie - Type +HISTORY_MSG_ICM_WORKING_GAMMA;Travail - Gamma +HISTORY_MSG_ICM_WORKING_SLOPE;Travail - Pente +HISTORY_MSG_ICM_WORKING_TRC_METHOD;Travail - Méthode TRC HISTORY_MSG_LOCALCONTRAST_AMOUNT;Contraste Local - Quantité HISTORY_MSG_LOCALCONTRAST_DARKNESS;Contraste Local - Ombres HISTORY_MSG_LOCALCONTRAST_ENABLED;Contraste Local HISTORY_MSG_LOCALCONTRAST_LIGHTNESS;Contraste Local - H.L. HISTORY_MSG_LOCALCONTRAST_RADIUS;Contraste Local - Rayon HISTORY_MSG_METADATA_MODE;Mode de copie des métadonnées +HISTORY_MSG_MICROCONTRAST_CONTRAST;Microcontraste - Seuil de contraste +HISTORY_MSG_PIXELSHIFT_DEMOSAIC;PS - Méthode de dématriçage pour les mouvements +HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Direction du filtre de bruit de ligne +HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;Filtre de ligne PDAF +HISTORY_MSG_PRSHARPEN_CONTRAST;NPR - Seuil de contraste +HISTORY_MSG_RAWCACORR_AUTOIT;A.C. Raw - Itérations +HISTORY_MSG_RAWCACORR_COLORSHIFT;A.C. Raw - Éviter les dérives de teinte +HISTORY_MSG_RAW_BORDER;Bord Raw +HISTORY_MSG_RESIZE_ALLOWUPSCALING;Redim. - Autoriser l'agrandissement +HISTORY_MSG_SHARPENING_CONTRAST;Netteté - Seuil de contraste +HISTORY_MSG_SH_COLORSPACE;O/HL - Espace couleur +HISTORY_MSG_SOFTLIGHT_ENABLED;Lumière douce +HISTORY_MSG_SOFTLIGHT_STRENGTH;Lumière douce - Force +HISTORY_MSG_TM_FATTAL_ANCHOR;CPD - Ancre HISTORY_NEWSNAPSHOT;Ajouter HISTORY_NEWSNAPSHOT_TOOLTIP;Raccourci: Alt-s HISTORY_SNAPSHOT;Capture HISTORY_SNAPSHOTS;Captures ICCPROFCREATOR_ADD_PARAM_IN_DESC;Ajoute le paramètre Gamma et Pente (Slope) à la fin de la description ICCPROFCREATOR_COPYRIGHT;Copyright: +ICCPROFCREATOR_COPYRIGHT_RESET_TOOLTIP;Réinitialise au copyright par défaut, attribué à "RawTherapee, CC0" ICCPROFCREATOR_CUSTOM;Personnalisé ICCPROFCREATOR_DESCRIPTION;Description: +ICCPROFCREATOR_DESCRIPTION_ADDPARAM;Ajouter les valeurs gamma et pente à la description ICCPROFCREATOR_DESCRIPTION_TOOLTIP;Laisser vide pour que mettre la description par défaut ICCPROFCREATOR_GAMMA;Gamma ICCPROFCREATOR_ICCVERSION;Version du profil généré: @@ -881,6 +935,7 @@ MAIN_TOOLTIP_PREVIEWFOCUSMASK;Affichage du Masque du focus\nRaccourci: canal Vert\nRaccourci: g MAIN_TOOLTIP_PREVIEWL;Affichage de la Luminosité\nRaccourci: v\n\n0.299*R + 0.587*V + 0.114*B MAIN_TOOLTIP_PREVIEWR;Affichage du canal Rouge\nRaccourci: r +MAIN_TOOLTIP_PREVIEWSHARPMASK;Prévisualiser le masque de contraste de netteté.\nRaccourci: Aucun\n\nNe fonctionne que si l'outil Netteté est activé et pour un zomm >= 100%. MAIN_TOOLTIP_QINFO;Informations rapide sur l'image\nRaccourci: i MAIN_TOOLTIP_SHOWHIDELP1;Montrer/Cacher le panneau gauche\nRaccourci: l MAIN_TOOLTIP_SHOWHIDERP1;Afficher/Cacher le panneau droit\nRaccourci: Alt-l @@ -918,6 +973,7 @@ PARTIALPASTE_CROP;Recadrage PARTIALPASTE_DARKFRAMEAUTOSELECT;Sélection auto de la Trame Noire PARTIALPASTE_DARKFRAMEFILE;Fichier de Trame Noire PARTIALPASTE_DEFRINGE;Aberration chromatique +PARTIALPASTE_DEHAZE;Élimination de la Brume PARTIALPASTE_DETAILGROUP;Détail PARTIALPASTE_DIALOGLABEL;Collage partiel de profil de traitement PARTIALPASTE_DIRPYRDENOISE;Réduction du bruit @@ -951,13 +1007,16 @@ PARTIALPASTE_PREPROCESS_DEADPIXFILT;Filtrage des pixels morts PARTIALPASTE_PREPROCESS_GREENEQUIL;Équilibrage du vert PARTIALPASTE_PREPROCESS_HOTPIXFILT;Filtrage des pixels chauds PARTIALPASTE_PREPROCESS_LINEDENOISE;Filtre de bruit de ligne +PARTIALPASTE_PREPROCESS_PDAFLINESFILTER;Filtre de ligne PDAF PARTIALPASTE_PRSHARPENING;Netteté post-redim. PARTIALPASTE_RAWCACORR_AUTO;Corr. auto. de l'aberr. chromatique -PARTIALPASTE_RAWCACORR_CAREDBLUE;Aberr. chromatique rouge et bleu +PARTIALPASTE_RAWCACORR_AVOIDCOLORSHIFT;A.C. Raw - Éviter les dérives couleurs +PARTIALPASTE_RAWCACORR_CAREDBLUE;A.C. Raw - Rouge et bleu PARTIALPASTE_RAWEXPOS_BLACK;Niveaux de noir PARTIALPASTE_RAWEXPOS_LINEAR;Correction du point blanc PARTIALPASTE_RAWEXPOS_PRESER;Préservation des hautes humières PARTIALPASTE_RAWGROUP;Réglages RAW +PARTIALPASTE_RAW_BORDER;Bord Raw PARTIALPASTE_RAW_DCBENHANCE;Amélioration de DCB PARTIALPASTE_RAW_DCBITERATIONS;Nombre d'itération de DCB PARTIALPASTE_RAW_DMETHOD;Algorithme de dématriçage @@ -973,6 +1032,8 @@ PARTIALPASTE_SHADOWSHIGHLIGHTS;Ombres/Hautes lumières PARTIALPASTE_SHARPENEDGE;Bords PARTIALPASTE_SHARPENING;Netteté PARTIALPASTE_SHARPENMICRO;Microcontraste +PARTIALPASTE_SOFTLIGHT;Lumière douce +PARTIALPASTE_TM_FATTAL;Compression de plage dynamique PARTIALPASTE_VIBRANCE;Vibrance PARTIALPASTE_VIGNETTING;Correction du vignettage PARTIALPASTE_WAVELETGROUP;Niveaux d'ondelette @@ -988,6 +1049,11 @@ PREFERENCES_BEHAVIOR;Comportement PREFERENCES_BEHSETALL;Tout à 'Remplace' PREFERENCES_BEHSETALLHINT;Règle tous les paramètres sur le mode Remplace.\nLa modification des paramètres dans le panneau d'édition en par lot sera absolue, les valeurs réelles seront affichées PREFERENCES_BLACKBODY;Tungstène +PREFERENCES_CACHECLEAR;Vider +PREFERENCES_CACHECLEAR_ALL;Vider tous les fichiers mis en cache : +PREFERENCES_CACHECLEAR_ALLBUTPROFILES;Vider tous les fichiers mis en cache excepté les profils de traitement : +PREFERENCES_CACHECLEAR_ONLYPROFILES;Vider seulement les profils de traitement mis en cache : +PREFERENCES_CACHECLEAR_SAFETY;Seuls les fichiers mis en cache sont effacés. Les profils de traitement enregitrés à côté des images sources ne sont pas touchés. PREFERENCES_CACHEMAXENTRIES;Nombre maximal d'éléments dans le Cache PREFERENCES_CACHEOPTS;Options du Cache PREFERENCES_CACHETHUMBHEIGHT;Hauteur maximale des vignettes @@ -1001,7 +1067,7 @@ PREFERENCES_CLUTSCACHE_LABEL;Nombre maximum de chache CLUT PREFERENCES_CLUTSDIR;Dossier HaldCLUT PREFERENCES_CMMBPC;Compensation du point noir PREFERENCES_CROP;Édition du recadrage -PREFERENCES_CROP_AUTO_FIT;Zommer automatiquement sur la zone recadrée +PREFERENCES_CROP_AUTO_FIT;Zoomer automatiquement sur la zone recadrée lorsque vous double-cliquez sur l'image de prévisualisation PREFERENCES_CROP_GUIDES;Guides affichés en dehors de l'édition du recadrage PREFERENCES_CROP_GUIDES_FRAME;Cadre PREFERENCES_CROP_GUIDES_FULL;Original @@ -1066,8 +1132,8 @@ PREFERENCES_GREYSC;Luminance Yb de la scène (%) PREFERENCES_GREYSC18;Yb=18 CIE L#50 PREFERENCES_GREYSCA;Automatique PREFERENCES_HISTOGRAMPOSITIONLEFT;Histogramme dans le panneau de gauche -PREFERENCES_HISTOGRAMWORKING;Utiliser le profil de travail pour l'histograme principal et le Navigateur -PREFERENCES_HISTOGRAM_TOOLTIP;Si activé, le profil couleur de travail est utilisé pour les données d'histograme et le panneau Navigateur, sinon le profil de travail de sortie "gamma-corrigé" est utilisé. +PREFERENCES_HISTOGRAMWORKING;Utiliser le profil de travail pour l'histogramme principal et le Navigateur +PREFERENCES_HISTOGRAM_TOOLTIP;Si activé, le profil couleur de travail est utilisé pour les données d'histogramme et le panneau Navigateur, sinon le profil de travail de sortie "gamma-corrigé" est utilisé. PREFERENCES_HLTHRESHOLD;Seuil pour le dépassement de domaine supérieur PREFERENCES_ICCDIR;Dossier des profils ICC PREFERENCES_IMG_RELOAD_NEEDED;Ces changements nécessitent un rechargement de l'image (ou l'ouverture d'une autre image) pour prendre effet. @@ -1113,6 +1179,8 @@ PREFERENCES_PARSEDEXTADDHINT;Tapez une extension et cliquez ce bouton pour l'ajo PREFERENCES_PARSEDEXTDELHINT;Supprime de la liste les extensions sélectionnées PREFERENCES_PARSEDEXTDOWNHINT;Déplacer l'extension sélectionnée plus bas dans la liste. PREFERENCES_PARSEDEXTUPHINT;Déplacer l'extension sélectionnée plus haut dans la liste. +PREFERENCES_PERFORMANCE_THREADS;Unités d'exécution (Threads) +PREFERENCES_PERFORMANCE_THREADS_LABEL;Nombre maximum d'unité d'exécution pour la Réduction de Bruit et les Niveaux d'Ondelettes (0 = Automatique) PREFERENCES_PREVDEMO;Méthode de Dématriçage de l'Aperçu PREFERENCES_PREVDEMO_FAST;Rapide PREFERENCES_PREVDEMO_LABEL;Méthode de dématriçage utilisé pour l'aperçu à un zoom <100%: @@ -1159,8 +1227,13 @@ PREFERENCES_TAB_COLORMGR;Gestion des couleurs PREFERENCES_TAB_DYNAMICPROFILE;Règles de Profil Dynamique PREFERENCES_TAB_GENERAL;Général PREFERENCES_TAB_IMPROC;Traitement de l'image +PREFERENCES_TAB_PERFORMANCE;Performance PREFERENCES_TAB_SOUND;Sons PREFERENCES_THEME;Thème +PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Prévisualisation JPEG incluse +PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image à montrer +PREFERENCES_THUMBNAIL_INSPECTOR_RAW;Rendu Neutre des données Raw +PREFERENCES_THUMBNAIL_INSPECTOR_RAW_IF_NO_JPEG_FULLSIZE;JPEG inclus si pleine taille, rendu Neutre des données Raw sinon PREFERENCES_TP_LABEL;Panneau des outils: PREFERENCES_TP_VSCROLLBAR;Cacher la barre de défilement verticale PREFERENCES_TUNNELMETADATA;Copier les données Exif/IPTC/XMP tel quel dans le fichier de sortie @@ -1277,6 +1350,8 @@ TP_BWMIX_MET;Méthode TP_BWMIX_MET_CHANMIX;Mixeur de Canaux TP_BWMIX_MET_DESAT;Désaturation TP_BWMIX_MET_LUMEQUAL;Égaliseur de Luminance +TP_BWMIX_MIXC;Mixeur de cannaux +TP_BWMIX_NEUTRAL;Réinitialiser TP_BWMIX_RGBLABEL;R: %1%% V: %2%% B: %3%% Total: %4%% TP_BWMIX_RGBLABEL_HINT;Coefficients RVB finaux qui tiennent compte de toutes les options du mixeur\nTotal affiche la somme des valeurs RVB actuellement appliqué:\n- toujours 100% en mode relatif\n- supérieur (plus clair) ou inférieur (plus sombre) à 100% en mode absolu. TP_BWMIX_RGB_TOOLTIP;Mixe les canaux RVB. Utilisez les Préréglages pour vous guider.\nAttention aux valeurs négatives qui peuvent causer des artefacts ou un comportement erratique. @@ -1410,6 +1485,16 @@ TP_COLORTONING_LAB;Mixage Lab TP_COLORTONING_LABEL;Virage Partiel TP_COLORTONING_LABGRID;Grille de correction L*a*b* TP_COLORTONING_LABGRID_VALUES;HL: a=%1 b=%2\nO: a=%3 b=%4 +TP_COLORTONING_LABREGIONS;Régions de correction L*a*b* +TP_COLORTONING_LABREGION_ABVALUES;a=%1 b=%2 +TP_COLORTONING_LABREGION_CHROMATICITYMASK;C +TP_COLORTONING_LABREGION_HUEMASK;T +TP_COLORTONING_LABREGION_LIGHTNESS;Luminosité +TP_COLORTONING_LABREGION_LIGHTNESSMASK;L +TP_COLORTONING_LABREGION_LIST_TITLE;Correction +TP_COLORTONING_LABREGION_MASK;Masque +TP_COLORTONING_LABREGION_SATURATION;Saturation +TP_COLORTONING_LABREGION_SHOWMASK;Montrer le masque TP_COLORTONING_LUMA;Luminance TP_COLORTONING_LUMAMODE;Préserver la luminance TP_COLORTONING_LUMAMODE_TOOLTIP;Si activé, lorsque vous changez la couleur (rouge, vert, cyan, bleu, etc.), la luminance de chaque pixel est préservé @@ -1458,6 +1543,10 @@ TP_DARKFRAME_LABEL;Trame Noire TP_DEFRINGE_LABEL;Aberration chromatique TP_DEFRINGE_RADIUS;Rayon TP_DEFRINGE_THRESHOLD;Seuil +TP_DEHAZE_DEPTH;Profondeur +TP_DEHAZE_LABEL;Élimination de la Brume +TP_DEHAZE_SHOW_DEPTH_MAP;Montrer la Carte de Profondeur +TP_DEHAZE_STRENGTH;Force TP_DIRPYRDENOISE_CHROMINANCE_AMZ;Multi-zones auto TP_DIRPYRDENOISE_CHROMINANCE_AUTOGLOBAL;Global automatique TP_DIRPYRDENOISE_CHROMINANCE_AUTOGLOBAL_TOOLTIP;Essaie d'évaluer le bruit chroma\nFaites attention, cela calcul une moyenne, et est très subjectif ! @@ -1546,6 +1635,7 @@ TP_EXPOSURE_AUTOLEVELS;Niveaux Auto TP_EXPOSURE_AUTOLEVELS_TIP;Bascule l'usage de Niveaux automatiques afin de régler automatiquement les valeurs basé sur l'analyse de l'image\nActive la Reconstruction des Hautes Lumières si nécessaire. TP_EXPOSURE_BLACKLEVEL;Noir TP_EXPOSURE_BRIGHTNESS;Luminosité +TP_EXPOSURE_CLAMPOOG;Tronquer les couleurs hors gamut TP_EXPOSURE_CLIP;Rognage % TP_EXPOSURE_CLIP_TIP;La fraction de pixels que l'outil Niveaux Auto passera en dehors du domaine TP_EXPOSURE_COMPRHIGHLIGHTS;Compression hautes lumières @@ -1730,10 +1820,19 @@ TP_PREPROCESS_HOTPIXFILT;Filtrer les pixels chauds TP_PREPROCESS_HOTPIXFILT_TOOLTIP;Essaie de supprimer les pixels chauds TP_PREPROCESS_LABEL;Traitement pre-dématriçage TP_PREPROCESS_LINEDENOISE;Filtre de bruit de ligne +TP_PREPROCESS_LINEDENOISE_DIRECTION;Direction +TP_PREPROCESS_LINEDENOISE_DIRECTION_BOTH;Toutes +TP_PREPROCESS_LINEDENOISE_DIRECTION_HORIZONTAL;Horizontale +TP_PREPROCESS_LINEDENOISE_DIRECTION_PDAF_LINES;Horizontale seulement sur les lignes PDAF +TP_PREPROCESS_LINEDENOISE_DIRECTION_VERTICAL;Verticale TP_PREPROCESS_NO_FOUND;Aucun trouvé +TP_PREPROCESS_PDAFLINESFILTER;Filtre de ligne PDAF +TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Essaie de supprimer les bandes de bruit causées par les pixel PDAF sur le capteur, arrivant sur certains mirrorless Sony cameras avec des scènes en contre-jour avec un flare visible. TP_PRSHARPENING_LABEL;Netteté post-redimensionnement TP_PRSHARPENING_TOOLTIP;Augmente la netteté de l'image après le redimentionnement. Ne fonctionne que si la méthode de redimensionnement "Lanczos" est utilisé. Il est impossible de prévisualiser les effets de cet outil. Cf. RawPedia pour les instructions d'utilisation. TP_RAWCACORR_AUTO;Correction automatique +TP_RAWCACORR_AUTOIT;Itérations +TP_RAWCACORR_AVOIDCOLORSHIFT;Éviter les dérives couleurs TP_RAWCACORR_CABLUE;Bleu TP_RAWCACORR_CARED;Rouge TP_RAWCACORR_CASTR;Force @@ -1750,16 +1849,24 @@ TP_RAWEXPOS_PRESER;Préservation des HL TP_RAWEXPOS_RGB;Rouge, Vert, Bleu TP_RAWEXPOS_TWOGREEN;Lier les verts TP_RAW_1PASSMEDIUM;1-Passe (Medium) +TP_RAW_2PASS;1-passe+Fast TP_RAW_3PASSBEST;3-Passes (Meilleur) +TP_RAW_4PASS;3-passes+Fast TP_RAW_AHD;AHD TP_RAW_AMAZE;AMaZE +TP_RAW_AMAZEVNG4;AMaZE+VNG4 +TP_RAW_BORDER;Bord TP_RAW_DCB;DCB TP_RAW_DCBENHANCE;Amélioration de DCB TP_RAW_DCBITERATIONS;Nombre d'itération de DCB +TP_RAW_DCBVNG4;DCB+VNG4 TP_RAW_DMETHOD;Méthode TP_RAW_DMETHOD_PROGRESSBAR;Dématriçage %1... TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Affinage du dématriçage... TP_RAW_DMETHOD_TOOLTIP;Note: IGV et LMMSE sont dédiés aux images à haut ISO +TP_RAW_DUALDEMOSAICAUTOCONTRAST;Seuil auto +TP_RAW_DUALDEMOSAICAUTOCONTRAST_TOOLTIP;Si la case est cochée (recommandé), RawTherapee calcul une valeur optimum basée sur les régions de "couleur unie" de l'image.\nS'il n'y en a pas ou que l'image est trop bruité, la valeur sera réglée à 0.\nPour régler la valeur manuellement, décochez la case d'abord (les valeurs raisonables dépendent de l'image). +TP_RAW_DUALDEMOSAICCONTRAST;Seuil de contraste TP_RAW_EAHD;EAHD TP_RAW_FALSECOLOR;Itérations pour la suppression\ndes fausses couleurs TP_RAW_FAST;Fast @@ -1778,6 +1885,9 @@ TP_RAW_NONE;Aucun (montre ce que voit le capteur) TP_RAW_PIXELSHIFT;Pixel Shift TP_RAW_PIXELSHIFTADAPTIVE;Détection adaptative TP_RAW_PIXELSHIFTBLUR;Flouter le masque de mouvement +TP_RAW_PIXELSHIFTDMETHOD;Méthode de dématriçage pour les mouvements +TP_RAW_PIXELSHIFTEPERISO;Sensibilité +TP_RAW_PIXELSHIFTEPERISO_TOOLTIP;La valeur par défaut de 0 devrait bien fonctionner pour l'ISO de base.\nLes valeurs plus hautes augmentent la sensibilité de la détection de mouvement.\nChangez par petits incréments et observez le masque de mouvement se mettre à jour pendant votre ajustement.\nAugmentez la sensibilité pour les images sous-exposées ou à haut ISO. TP_RAW_PIXELSHIFTEQUALBRIGHT;Égaliser la luminosité des sous-images TP_RAW_PIXELSHIFTEQUALBRIGHTCHANNEL;Égaliser par canal TP_RAW_PIXELSHIFTEQUALBRIGHTCHANNEL_TOOLTIP;Activé: Égalise les canaux RVB individuellement.\nDésactivé: Utilise le même facteur d'égalisation pour tous les canaux. @@ -1813,6 +1923,7 @@ TP_RAW_PIXELSHIFTREDBLUEWEIGHT;Poid Rouge&Bleu TP_RAW_PIXELSHIFTSHOWMOTION;Voir le masque de mouvement TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY;Voir uniquement le masque TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY_TOOLTIP;Affiche le masque sans l'image. +TP_RAW_PIXELSHIFTSHOWMOTION_TOOLTIP;Applique un masque vert montrant les régions contenant du mouvement. TP_RAW_PIXELSHIFTSIGMA;Rayon de floutage TP_RAW_PIXELSHIFTSIGMA_TOOLTIP;Le rayon par défaut de 1.0 fonctionne généralement bien pour l'ISO de base.\nAugmentez cette valeur pour les images de haut ISO, 5.0 est un bon point de départ.\nContrôlez le masque de mouvement à chaque nouvelle valeur. TP_RAW_PIXELSHIFTSMOOTH;Adoucir les transitions @@ -1821,10 +1932,12 @@ TP_RAW_PIXELSHIFTSTDDEVFACTORBLUE;Facteur DevStd Bleu TP_RAW_PIXELSHIFTSTDDEVFACTORGREEN;Facteur DevStd Vert TP_RAW_PIXELSHIFTSTDDEVFACTORRED;Facteur DevStd Rouge TP_RAW_RCD;RCD +TP_RAW_RCDVNG4;RCD+VNG4 TP_RAW_SENSOR_BAYER_LABEL;Capteur à matrice de Bayer TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-passes donne les meilleurs résultats (recommendé pour les images de faible ISO).\n1-passe est presque indifférentiable de 3-passes pour les images à haut ISO et est plus rapide. TP_RAW_SENSOR_XTRANS_LABEL;Capteur à matrice X-Trans TP_RAW_VNG4;VNG4 +TP_RESIZE_ALLOW_UPSCALING;Autoriser l'Agrandissement TP_RESIZE_APPLIESTO;S'applique à: TP_RESIZE_CROPPEDAREA;La zone recadrée TP_RESIZE_FITBOX;Boîte englobante @@ -1943,6 +2056,7 @@ TP_SHARPENEDGE_LABEL;Bords TP_SHARPENEDGE_PASSES;Itérations TP_SHARPENEDGE_THREE;Luminance uniquement TP_SHARPENING_AMOUNT;Quantité +TP_SHARPENING_CONTRAST;Seuil de contraste TP_SHARPENING_EDRADIUS;Rayon TP_SHARPENING_EDTOLERANCE;Tolérance des bords TP_SHARPENING_HALOCONTROL;Contrôle du halo @@ -1958,9 +2072,16 @@ TP_SHARPENING_RLD_ITERATIONS;Itérations TP_SHARPENING_THRESHOLD;Seuil TP_SHARPENING_USM;Masque flou (USM) TP_SHARPENMICRO_AMOUNT;Quantité +TP_SHARPENMICRO_CONTRAST;Seuil de contraste TP_SHARPENMICRO_LABEL;Microcontraste TP_SHARPENMICRO_MATRIX;Matrice 3×3 au lieu de 5×5 TP_SHARPENMICRO_UNIFORMITY;Uniformité +TP_SOFTLIGHT_LABEL;Lumière douce +TP_SOFTLIGHT_STRENGTH;Force +TP_TM_FATTAL_AMOUNT;Quantité +TP_TM_FATTAL_ANCHOR;Ancre +TP_TM_FATTAL_LABEL;Compression de Plage Dynamique +TP_TM_FATTAL_THRESHOLD;Détail TP_VIBRANCE_AVOIDCOLORSHIFT;Éviter les dérives de teinte TP_VIBRANCE_CURVEEDITOR_SKINTONES;TT TP_VIBRANCE_CURVEEDITOR_SKINTONES_LABEL;Tons chair @@ -2024,7 +2145,7 @@ TP_WAVELET_CHTYPE;Méthode de chrominance TP_WAVELET_COLORT;Opacité Rouge-Vert TP_WAVELET_COMPCONT;Contraste TP_WAVELET_COMPGAMMA;Compression gamma -TP_WAVELET_COMPGAMMA_TOOLTIP;Ajuster le gamma de l'image résiduelle vous permet d'équiilibrer les données de l'histograme. +TP_WAVELET_COMPGAMMA_TOOLTIP;Ajuster le gamma de l'image résiduelle vous permet d'équiilibrer les données de l'histogramme. TP_WAVELET_COMPTM;Compression tonale TP_WAVELET_CONTEDIT;Courbe de contraste 'Après' TP_WAVELET_CONTR;Gamut @@ -2204,128 +2325,3 @@ ZOOMPANEL_ZOOMFITSCREEN;Affiche l'image entière\nRaccourci: Alt-f ZOOMPANEL_ZOOMIN;Zoom Avant\nRaccourci: + ZOOMPANEL_ZOOMOUT;Zoom Arrière\nRaccourci: - -!!!!!!!!!!!!!!!!!!!!!!!!! -! Untranslated keys follow; remove the ! prefix after an entry is translated. -!!!!!!!!!!!!!!!!!!!!!!!!! - -!ADJUSTER_RESET_TO_DEFAULT;Click - reset to default value.\nCtrl+click - reset to initial value. -!DYNPROFILEEDITOR_IMGTYPE_ANY;Any -!DYNPROFILEEDITOR_IMGTYPE_HDR;HDR -!DYNPROFILEEDITOR_IMGTYPE_PS;Pixel Shift -!DYNPROFILEEDITOR_IMGTYPE_STD;Standard -!EXIFFILTER_IMAGETYPE;Image type -!FILEBROWSER_CACHECLEARFROMFULL;Clear all including cached profiles -!FILEBROWSER_CACHECLEARFROMPARTIAL;Clear all except cached profiles -!GENERAL_RESET;Reset -!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. -!HISTORY_MSG_235;B&W - CM - Auto -!HISTORY_MSG_237;B&W - CM -!HISTORY_MSG_273;CT - Color Balance SMH -!HISTORY_MSG_392;W - Residual - Color Balance -!HISTORY_MSG_488;Dynamic Range Compression -!HISTORY_MSG_489;DRC - Detail -!HISTORY_MSG_490;DRC - Amount -!HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors -!HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction -!HISTORY_MSG_COLORTONING_LABREGION_CHROMATICITYMASK;CT - C mask -!HISTORY_MSG_COLORTONING_LABREGION_HUEMASK;CT - H mask -!HISTORY_MSG_COLORTONING_LABREGION_LIGHTNESS;CT - Lightness -!HISTORY_MSG_COLORTONING_LABREGION_LIGHTNESSMASK;CT - L mask -!HISTORY_MSG_COLORTONING_LABREGION_LIST;CT - List -!HISTORY_MSG_COLORTONING_LABREGION_SATURATION;CT - Saturation -!HISTORY_MSG_COLORTONING_LABREGION_SHOWMASK;CT - Show mask -!HISTORY_MSG_DEHAZE_DEPTH;Dehaze - Depth -!HISTORY_MSG_DEHAZE_ENABLED;Haze Removal -!HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP;Dehaze - Show depth map -!HISTORY_MSG_DEHAZE_STRENGTH;Dehaze - Strength -!HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;Dual demosaic - Auto threshold -!HISTORY_MSG_DUALDEMOSAIC_CONTRAST;Dual demosaic - Contrast threshold -!HISTORY_MSG_ICM_OUTPUT_PRIMARIES;Output - Primaries -!HISTORY_MSG_ICM_OUTPUT_TEMP;Output - ICC-v4 illuminant D -!HISTORY_MSG_ICM_OUTPUT_TYPE;Output - Type -!HISTORY_MSG_ICM_WORKING_GAMMA;Working - Gamma -!HISTORY_MSG_ICM_WORKING_SLOPE;Working - Slope -!HISTORY_MSG_ICM_WORKING_TRC_METHOD;Working - TRC method -!HISTORY_MSG_MICROCONTRAST_CONTRAST;Microcontrast - Contrast threshold -!HISTORY_MSG_PIXELSHIFT_DEMOSAIC;PS - Demosaic method for motion -!HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;Line noise filter direction -!HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF lines filter -!HISTORY_MSG_PRSHARPEN_CONTRAST;PRS - Contrast threshold -!HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations -!HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift -!HISTORY_MSG_RAW_BORDER;Raw border -!HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling -!HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold -!HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace -!HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light -!HISTORY_MSG_SOFTLIGHT_STRENGTH;Soft light - Strength -!HISTORY_MSG_TM_FATTAL_ANCHOR;DRC - Anchor -!ICCPROFCREATOR_COPYRIGHT_RESET_TOOLTIP;Reset to the default copyright, granted to "RawTherapee, CC0" -!ICCPROFCREATOR_DESCRIPTION_ADDPARAM;Append gamma and slope values to the description -!MAIN_TOOLTIP_PREVIEWSHARPMASK;Preview the Sharpening Contrast Mask.\nShortcut: None\n\nOnly works when sharpening is enabled and zoom >= 100%. -!PARTIALPASTE_DEHAZE;Haze removal -!PARTIALPASTE_PREPROCESS_PDAFLINESFILTER;PDAF lines filter -!PARTIALPASTE_RAWCACORR_AVOIDCOLORSHIFT;CA avoid color shift -!PARTIALPASTE_RAW_BORDER;Raw border -!PARTIALPASTE_SOFTLIGHT;Soft light -!PARTIALPASTE_TM_FATTAL;Dynamic range compression -!PREFERENCES_CACHECLEAR;Clear -!PREFERENCES_CACHECLEAR_ALL;Clear all cached files: -!PREFERENCES_CACHECLEAR_ALLBUTPROFILES;Clear all cached files except for cached processing profiles: -!PREFERENCES_CACHECLEAR_ONLYPROFILES;Clear only cached processing profiles: -!PREFERENCES_CACHECLEAR_SAFETY;Only files in the cache are cleared. Processing profiles stored alongside the source images are not touched. -!PREFERENCES_PERFORMANCE_THREADS;Threads -!PREFERENCES_PERFORMANCE_THREADS_LABEL;Maximum number of threads for Noise Reduction and Wavelet Levels (0 = Automatic) -!PREFERENCES_TAB_PERFORMANCE;Performance -!PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Embedded JPEG preview -!PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show -!PREFERENCES_THUMBNAIL_INSPECTOR_RAW;Neutral raw rendering -!PREFERENCES_THUMBNAIL_INSPECTOR_RAW_IF_NO_JPEG_FULLSIZE;Embedded JPEG if fullsize, neutral raw otherwise -!TP_BWMIX_MIXC;Channel Mixer -!TP_BWMIX_NEUTRAL;Reset -!TP_COLORTONING_LABREGIONS;L*a*b* correction regions -!TP_COLORTONING_LABREGION_ABVALUES;a=%1 b=%2 -!TP_COLORTONING_LABREGION_CHROMATICITYMASK;C -!TP_COLORTONING_LABREGION_HUEMASK;H -!TP_COLORTONING_LABREGION_LIGHTNESS;Lightness -!TP_COLORTONING_LABREGION_LIGHTNESSMASK;L -!TP_COLORTONING_LABREGION_LIST_TITLE;Correction -!TP_COLORTONING_LABREGION_MASK;Mask -!TP_COLORTONING_LABREGION_SATURATION;Saturation -!TP_COLORTONING_LABREGION_SHOWMASK;Show mask -!TP_DEHAZE_DEPTH;Depth -!TP_DEHAZE_LABEL;Haze Removal -!TP_DEHAZE_SHOW_DEPTH_MAP;Show Depth Map -!TP_DEHAZE_STRENGTH;Strength -!TP_EXPOSURE_CLAMPOOG;Clip out-of-gamut colors -!TP_PREPROCESS_LINEDENOISE_DIRECTION;Direction -!TP_PREPROCESS_LINEDENOISE_DIRECTION_BOTH;Both -!TP_PREPROCESS_LINEDENOISE_DIRECTION_HORIZONTAL;Horizontal -!TP_PREPROCESS_LINEDENOISE_DIRECTION_PDAF_LINES;Horizontal only on PDAF rows -!TP_PREPROCESS_LINEDENOISE_DIRECTION_VERTICAL;Vertical -!TP_PREPROCESS_PDAFLINESFILTER;PDAF lines filter -!TP_PREPROCESS_PDAFLINESFILTER_TOOLTIP;Tries to suppress stripe noise caused by on-sensor PDAF pixels, occurring with some Sony mirrorless cameras on some backlit scenes with visible flare. -!TP_RAWCACORR_AUTOIT;Iterations -!TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift -!TP_RAW_2PASS;1-pass+fast -!TP_RAW_4PASS;3-pass+fast -!TP_RAW_AMAZEVNG4;AMaZE+VNG4 -!TP_RAW_BORDER;Border -!TP_RAW_DCBVNG4;DCB+VNG4 -!TP_RAW_DUALDEMOSAICAUTOCONTRAST;Auto threshold -!TP_RAW_DUALDEMOSAICAUTOCONTRAST_TOOLTIP;If the check-box is checked (recommended), RawTherapee calculates an optimum value based on flat regions in the image.\nIf there is no flat region in the image or the image is too noisy, the value will be set to 0.\nTo set the value manually, uncheck the check-box first (reasonable values depend on the image). -!TP_RAW_DUALDEMOSAICCONTRAST;Contrast threshold -!TP_RAW_PIXELSHIFTDMETHOD;Demosaic method for motion -!TP_RAW_PIXELSHIFTEPERISO;Sensitivity -!TP_RAW_PIXELSHIFTEPERISO_TOOLTIP;The default value of 0 should work fine for base ISO.\nHigher values increase sensitivity of motion detection.\nChange in small steps and watch the motion mask while changing.\nIncrease sensitivity for underexposed or high ISO images. -!TP_RAW_PIXELSHIFTSHOWMOTION_TOOLTIP;Overlays the image with a green mask showing the regions with motion. -!TP_RAW_RCDVNG4;RCD+VNG4 -!TP_RESIZE_ALLOW_UPSCALING;Allow Upscaling -!TP_SHARPENING_CONTRAST;Contrast threshold -!TP_SHARPENMICRO_CONTRAST;Contrast threshold -!TP_SOFTLIGHT_LABEL;Soft Light -!TP_SOFTLIGHT_STRENGTH;Strength -!TP_TM_FATTAL_AMOUNT;Amount -!TP_TM_FATTAL_ANCHOR;Anchor -!TP_TM_FATTAL_LABEL;Dynamic Range Compression -!TP_TM_FATTAL_THRESHOLD;Detail diff --git a/rtdata/languages/Japanese b/rtdata/languages/Japanese index 8a2f90dfd..e36e77efb 100644 --- a/rtdata/languages/Japanese +++ b/rtdata/languages/Japanese @@ -74,6 +74,10 @@ DYNPROFILEEDITOR_DELETE;削除 DYNPROFILEEDITOR_EDIT;編集 DYNPROFILEEDITOR_EDIT_RULE;ダイナミックプロファイルの規定を変更 DYNPROFILEEDITOR_ENTRY_TOOLTIP;既定の符号は鈍いので\n入力する際に"re:"という接頭語を付けます\n通常の表現を使います +DYNPROFILEEDITOR_IMGTYPE_ANY;任意 +DYNPROFILEEDITOR_IMGTYPE_HDR;HDR +DYNPROFILEEDITOR_IMGTYPE_PS;ピクセルシフト +DYNPROFILEEDITOR_IMGTYPE_STD;標準え DYNPROFILEEDITOR_MOVE_DOWN;下に移動 DYNPROFILEEDITOR_MOVE_UP;上に移動 DYNPROFILEEDITOR_NEW;新規 @@ -146,6 +150,8 @@ FILEBROWSER_AUTOFLATFIELD;オート・フラットフィールド FILEBROWSER_BROWSEPATHBUTTONHINT;クリックで選択したパスをブラウズ FILEBROWSER_BROWSEPATHHINT;参照するパスを入力します\nCtrl-O パスのテキストボックスにフォーカス\nEnter / Ctrl-Enterその場所をブラウズします\nEsc 変更をクリア\nShift-Escフォーカスを削除\nパスのショートカット:\n ~ - ユーザーのホームディレクトリ\n ! - ユーザーの画像ディレクトリ FILEBROWSER_CACHE;cache +FILEBROWSER_CACHECLEARFROMFULL;プロファイルを含めcache内をクリアにする +FILEBROWSER_CACHECLEARFROMPARTIAL;プロファイルを除き、cache内をクリアにする FILEBROWSER_CLEARPROFILE;プロファイルのクリア FILEBROWSER_COLORLABEL_TOOLTIP;カラー・ラベル\n\nドロップダウン・メニューからか、ショートカット:\nShift-Ctrl-1 レッド\nShift-Ctrl-2 イエロー\nShift-Ctrl-3 グリーン\nShift-Ctrl-4 ブルー\nShift-Ctrl-5 パープル FILEBROWSER_COPYPROFILE;プロファイルをコピー @@ -751,12 +757,26 @@ HISTORY_MSG_485;レンズ補正 HISTORY_MSG_486;レンズ補正 - カメラ HISTORY_MSG_487;レンズ補正 - レンズ HISTORY_MSG_488;ダイナミックレンジ圧縮 +HISTORY_MSG_489;DRC - 細部 HISTORY_MSG_490;DRC - 量 HISTORY_MSG_491;ホワイトバランス HISTORY_MSG_492;RGBカーブ HISTORY_MSG_493;L*a*b*調整 HISTORY_MSG_CLAMPOOG;色域外の色を切り取る HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - カラー補正 +HISTORY_MSG_COLORTONING_LABREGION_AB;CT - 色の補正 +HISTORY_MSG_COLORTONING_LABREGION_CHROMATICITYMASK;CT - 色度のマスク +HISTORY_MSG_COLORTONING_LABREGION_HUEMASK;CT - 色相のマスク +HISTORY_MSG_COLORTONING_LABREGION_LIGHTNESS;CT - 明度 +HISTORY_MSG_COLORTONING_LABREGION_LIGHTNESSMASK;CT - 輝度のマスク +HISTORY_MSG_COLORTONING_LABREGION_LIST;CT - リスト +HISTORY_MSG_COLORTONING_LABREGION_SATURATION;CT - 彩度 +HISTORY_MSG_COLORTONING_LABREGION_SHOWMASK;CT - マスクの表示 +HISTORY_MSG_DEHAZE_DEPTH;霞除去 - 深度 +HISTORY_MSG_DEHAZE_ENABLED;霞除去 +HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP;霞除去 - 深度マップの表示 +HISTORY_MSG_DEHAZE_STRENGTH;霞除去 - 強さ +HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;デュアルデモザイク - 自動しきい値 HISTORY_MSG_DUALDEMOSAIC_CONTRAST;AMaZE+VNG4 - コントラストのしきい値 HISTORY_MSG_HISTMATCHING;トーンカーブの自動調節 HISTORY_MSG_ICM_OUTPUT_PRIMARIES;出力 - プライマリ @@ -781,6 +801,7 @@ HISTORY_MSG_RAWCACORR_COLORSHIFT;Rawの色収差補正 - 色ずれを回避 HISTORY_MSG_RAW_BORDER;Rawの境界 HISTORY_MSG_RESIZE_ALLOWUPSCALING;リサイズ - アップスケーリングを可能にする HISTORY_MSG_SHARPENING_CONTRAST;シャープ化 - コントラストのしきい値 +HISTORY_MSG_SH_COLORSPACE;S/H - 色空間 HISTORY_MSG_SOFTLIGHT_ENABLED;ソフトライト HISTORY_MSG_SOFTLIGHT_STRENGTH;ソフトライト - 強さ HISTORY_MSG_TM_FATTAL_ANCHOR;DRC - アンカー @@ -982,6 +1003,7 @@ PARTIALPASTE_CROP;切り抜き PARTIALPASTE_DARKFRAMEAUTOSELECT;ダークフレーム自動選択 PARTIALPASTE_DARKFRAMEFILE;ダークフレーム・ファイル PARTIALPASTE_DEFRINGE;フリンジ低減 +PARTIALPASTE_DEHAZE;霞除去 PARTIALPASTE_DETAILGROUP;ディテールの設定 PARTIALPASTE_DIALOGLABEL;処理プロファイルの部分ペースト PARTIALPASTE_DIRPYRDENOISE;ノイズ低減 @@ -1018,6 +1040,7 @@ PARTIALPASTE_PREPROCESS_LINEDENOISE;ラインノイズ フィルタ PARTIALPASTE_PREPROCESS_PDAFLINESFILTER;PDAF ラインフィルタ PARTIALPASTE_PRSHARPENING;リサイズ後のシャープ化 PARTIALPASTE_RAWCACORR_AUTO;自動色収差補正 +PARTIALPASTE_RAWCACORR_AVOIDCOLORSHIFT;CA 色ずれを回避 PARTIALPASTE_RAWCACORR_CAREDBLUE;色収差 レッドとブルー PARTIALPASTE_RAWEXPOS_BLACK;黒レベル PARTIALPASTE_RAWEXPOS_LINEAR;raw ホワイトポイント リニア補正係数 @@ -1055,6 +1078,11 @@ PREFERENCES_BEHAVIOR;ビヘイビア PREFERENCES_BEHSETALL;すべて '設定' PREFERENCES_BEHSETALLHINT;すべてのパラメータを 設定モードにします\nバッチツールパネルで設定される調整値が、各画像の既定値に取って代わり同一になります PREFERENCES_BLACKBODY;タングステン +PREFERENCES_CACHECLEAR;クリア +PREFERENCES_CACHECLEAR_ALL;cacheに入れられたファイルを全てクリア: +PREFERENCES_CACHECLEAR_ALLBUTPROFILES;cacheに入れた処理プロファイル以外をクリア: +PREFERENCES_CACHECLEAR_ONLYPROFILES;cacheに入れた処理プロファイルだけをクリア: +PREFERENCES_CACHECLEAR_SAFETY;casheに入れたファイルだけをクリア。元画像に付随した処理プロファイルはそのまま PREFERENCES_CACHEMAXENTRIES;キャッシュエントリーの最大数 PREFERENCES_CACHEOPTS;cache オプション PREFERENCES_CACHETHUMBHEIGHT;サムネイル縦の最大値 @@ -1481,6 +1509,16 @@ TP_COLORTONING_LAB;L*a*b*モデルでブレンド TP_COLORTONING_LABEL;カラートーン調整 TP_COLORTONING_LABGRID;L*a*b*カラー補正グリッド TP_COLORTONING_LABGRID_VALUES;HL: a=%1 b=%2\nS: a=%3 b=%4 +TP_COLORTONING_LABREGIONS;L*a*b*の補正領域 +TP_COLORTONING_LABREGION_ABVALUES;a=%1 b=%2 +TP_COLORTONING_LABREGION_CHROMATICITYMASK;色度 +TP_COLORTONING_LABREGION_HUEMASK;色相 +TP_COLORTONING_LABREGION_LIGHTNESS;明度 +TP_COLORTONING_LABREGION_LIGHTNESSMASK;明度 +TP_COLORTONING_LABREGION_LIST_TITLE;補正 +TP_COLORTONING_LABREGION_MASK;マスク +TP_COLORTONING_LABREGION_SATURATION;彩度 +TP_COLORTONING_LABREGION_SHOWMASK;マスクの表示 TP_COLORTONING_LUMA;明度 TP_COLORTONING_LUMAMODE;明度を維持 TP_COLORTONING_LUMAMODE_TOOLTIP;カラー(レッド、グリーン、シアン、ブルーなど)を変える際に、これを有効にすると、各ピクセルの明度は維持されます。 @@ -1529,6 +1567,10 @@ TP_DARKFRAME_LABEL;ダークフレーム TP_DEFRINGE_LABEL;フリンジ低減 TP_DEFRINGE_RADIUS;半径 TP_DEFRINGE_THRESHOLD;しきい値 +TP_DEHAZE_DEPTH;深度 +TP_DEHAZE_LABEL;霞除去 +TP_DEHAZE_SHOW_DEPTH_MAP;深度マップの表示 +TP_DEHAZE_STRENGTH;強さ TP_DIRPYRDENOISE_CHROMINANCE_AMZ;自動(多分割方式) TP_DIRPYRDENOISE_CHROMINANCE_AUTOGLOBAL;自動(分割方式) TP_DIRPYRDENOISE_CHROMINANCE_AUTOGLOBAL_TOOLTIP;色ノイズ低減の効果を確認して下さい\n注意:設定値の計算はあくまで平均的なもので、かなり主観的でです @@ -1840,6 +1882,8 @@ TP_RAW_DMETHOD;方式 TP_RAW_DMETHOD_PROGRESSBAR;%1 デモザイク中... TP_RAW_DMETHOD_PROGRESSBAR_REFINE;デモザイク・リファイン中... TP_RAW_DMETHOD_TOOLTIP;注: IGVとLMMSEは高ISO画像に適しています +TP_RAW_DUALDEMOSAICAUTOCONTRAST;自動しきい値 +TP_RAW_DUALDEMOSAICAUTOCONTRAST_TOOLTIP;チェックボックスを有効にすると(推奨), RawTherapeeは画像の滑らかな部分をベースに最適値を計算します。\n画像に滑らかな部分がない、或いはノイズが非常に多い画像の場合、最適値は0に設定されます。\n最適値を手動で設定する場合は、チェックボックスを無効にします(画像に次第で最適値は異なります)。 TP_RAW_DUALDEMOSAICCONTRAST;コントラストのしきい値 TP_RAW_EAHD;EAHD TP_RAW_FALSECOLOR;偽色抑制処理の回数 @@ -1902,7 +1946,7 @@ TP_RESIZE_HEIGHT;高さ TP_RESIZE_LABEL;リサイズ TP_RESIZE_LANCZOS;ランチョス TP_RESIZE_METHOD;方式: -TP_RESIZE_NEAREST;ニアリスト +TP_RESIZE_NEAREST;ニアレスト TP_RESIZE_SCALE;スケール TP_RESIZE_SPECIFY;条件指定: TP_RESIZE_W;幅: @@ -2036,6 +2080,7 @@ TP_SOFTLIGHT_STRENGTH;強さ TP_TM_FATTAL_AMOUNT;量 TP_TM_FATTAL_ANCHOR;アンカー TP_TM_FATTAL_LABEL;ダイナミックレンジ圧縮 +TP_TM_FATTAL_THRESHOLD;細部 TP_VIBRANCE_AVOIDCOLORSHIFT;色ずれを回避 TP_VIBRANCE_CURVEEDITOR_SKINTONES;HH TP_VIBRANCE_CURVEEDITOR_SKINTONES_LABEL;肌色トーン @@ -2283,48 +2328,3 @@ ZOOMPANEL_ZOOMOUT;ズームアウト\nショートカット: - ! Untranslated keys follow; remove the ! prefix after an entry is translated. !!!!!!!!!!!!!!!!!!!!!!!!! -!DYNPROFILEEDITOR_IMGTYPE_ANY;Any -!DYNPROFILEEDITOR_IMGTYPE_HDR;HDR -!DYNPROFILEEDITOR_IMGTYPE_PS;Pixel Shift -!DYNPROFILEEDITOR_IMGTYPE_STD;Standard -!FILEBROWSER_CACHECLEARFROMFULL;Clear all including cached profiles -!FILEBROWSER_CACHECLEARFROMPARTIAL;Clear all except cached profiles -!HISTORY_MSG_489;DRC - Detail -!HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction -!HISTORY_MSG_COLORTONING_LABREGION_CHROMATICITYMASK;CT - C mask -!HISTORY_MSG_COLORTONING_LABREGION_HUEMASK;CT - H mask -!HISTORY_MSG_COLORTONING_LABREGION_LIGHTNESS;CT - Lightness -!HISTORY_MSG_COLORTONING_LABREGION_LIGHTNESSMASK;CT - L mask -!HISTORY_MSG_COLORTONING_LABREGION_LIST;CT - List -!HISTORY_MSG_COLORTONING_LABREGION_SATURATION;CT - Saturation -!HISTORY_MSG_COLORTONING_LABREGION_SHOWMASK;CT - Show mask -!HISTORY_MSG_DEHAZE_DEPTH;Dehaze - Depth -!HISTORY_MSG_DEHAZE_ENABLED;Haze Removal -!HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP;Dehaze - Show depth map -!HISTORY_MSG_DEHAZE_STRENGTH;Dehaze - Strength -!HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;Dual demosaic - Auto threshold -!HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace -!PARTIALPASTE_DEHAZE;Haze removal -!PARTIALPASTE_RAWCACORR_AVOIDCOLORSHIFT;CA avoid color shift -!PREFERENCES_CACHECLEAR;Clear -!PREFERENCES_CACHECLEAR_ALL;Clear all cached files: -!PREFERENCES_CACHECLEAR_ALLBUTPROFILES;Clear all cached files except for cached processing profiles: -!PREFERENCES_CACHECLEAR_ONLYPROFILES;Clear only cached processing profiles: -!PREFERENCES_CACHECLEAR_SAFETY;Only files in the cache are cleared. Processing profiles stored alongside the source images are not touched. -!TP_COLORTONING_LABREGIONS;L*a*b* correction regions -!TP_COLORTONING_LABREGION_ABVALUES;a=%1 b=%2 -!TP_COLORTONING_LABREGION_CHROMATICITYMASK;C -!TP_COLORTONING_LABREGION_HUEMASK;H -!TP_COLORTONING_LABREGION_LIGHTNESS;Lightness -!TP_COLORTONING_LABREGION_LIGHTNESSMASK;L -!TP_COLORTONING_LABREGION_LIST_TITLE;Correction -!TP_COLORTONING_LABREGION_MASK;Mask -!TP_COLORTONING_LABREGION_SATURATION;Saturation -!TP_COLORTONING_LABREGION_SHOWMASK;Show mask -!TP_DEHAZE_DEPTH;Depth -!TP_DEHAZE_LABEL;Haze Removal -!TP_DEHAZE_SHOW_DEPTH_MAP;Show Depth Map -!TP_DEHAZE_STRENGTH;Strength -!TP_RAW_DUALDEMOSAICAUTOCONTRAST;Auto threshold -!TP_RAW_DUALDEMOSAICAUTOCONTRAST_TOOLTIP;If the check-box is checked (recommended), RawTherapee calculates an optimum value based on flat regions in the image.\nIf there is no flat region in the image or the image is too noisy, the value will be set to 0.\nTo set the value manually, uncheck the check-box first (reasonable values depend on the image). -!TP_TM_FATTAL_THRESHOLD;Detail diff --git a/rtdata/languages/default b/rtdata/languages/default index 00bd589fb..a642133a6 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1178,7 +1178,7 @@ PREFERENCES_CLUTSCACHE_LABEL;Maximum number of cached CLUTs PREFERENCES_CLUTSDIR;HaldCLUT directory PREFERENCES_CMMBPC;Black point compensation PREFERENCES_CROP;Crop editing -PREFERENCES_CROP_AUTO_FIT;Automatically zoom to fit the crop area +PREFERENCES_CROP_AUTO_FIT;Automatically zoom to fit the crop area when double clicking in the preview image PREFERENCES_CROP_GUIDES;Guides shown when not editing the crop PREFERENCES_CROP_GUIDES_FRAME;Frame PREFERENCES_CROP_GUIDES_FULL;Original @@ -2050,6 +2050,7 @@ TP_PRSHARPENING_LABEL;Post-Resize Sharpening TP_PRSHARPENING_TOOLTIP;Sharpens the image after resizing. Only works when the "Lanczos" resizing method is used. It is impossible to preview the effects of this tool. See RawPedia for usage instructions. TP_RAWCACORR_AUTO;Auto-correction TP_RAWCACORR_AUTOIT;Iterations +TP_RAWCACORR_AUTOIT_TOOLTIP;This setting is available if "Auto-correction" is checked.\nAuto-correction is conservative, means it often does not correct all Chromatic Aberration.\nTo correct the remaining Chromatic Aberration, you can use up to 5 iterations of automatic Chromatic Aberration correction.\nEach iteration will reduce the remaining Chromatic Aberration from the last iteration at the cost of additional processing time. TP_RAWCACORR_AVOIDCOLORSHIFT;Avoid color shift TP_RAWCACORR_CABLUE;Blue TP_RAWCACORR_CARED;Red diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index d9408f17a..caf01c988 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -807,8 +807,8 @@ BENCHFUN #endif const std::size_t blox_array_size = denoiseNestedLevels * numthreads; - float *LbloxArray[blox_array_size]; - float *fLbloxArray[blox_array_size]; + float *LbloxArray[blox_array_size] = {}; + float *fLbloxArray[blox_array_size] = {}; for (std::size_t i = 0; i < blox_array_size; ++i) { LbloxArray[i] = nullptr; diff --git a/rtengine/boxblur.h b/rtengine/boxblur.h index 71452ceae..d686ad43e 100644 --- a/rtengine/boxblur.h +++ b/rtengine/boxblur.h @@ -19,6 +19,7 @@ #ifndef _BOXBLUR_H_ #define _BOXBLUR_H_ +#include #include #include #include diff --git a/rtengine/camconst.json b/rtengine/camconst.json index eb4174577..2113c5532 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -1589,6 +1589,13 @@ Camera constants: "pdaf_pattern" : [0, 12], "pdaf_offset" : 29 }, + + { // Quality C, only colour matrix and PDAF lines info + "make_model" : "Nikon Z 6", + "dcraw_matrix" : [8210, -2534, -683, -5355, 13338, 2212, -1143, 1929, 6464], // Adobe DNG Converter 11.1 Beta ColorMatrix2 + "pdaf_pattern" : [0, 12], + "pdaf_offset" : 32 + }, { // Quality B, 16Mp and 64Mp raw frames "make_model": "OLYMPUS E-M5MarkII", diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index c9bc8ccad..0d5870b6a 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -1147,11 +1147,11 @@ void CLASS lossless_dnglj92_load_raw() } else { dataOffset[0] = ifp->pos; } - uint8_t *data = (uint8_t*)malloc(ifp->size); + const int data_length = ifp->size; + const std::unique_ptr data(new uint8_t[data_length]); fseek(ifp, 0, SEEK_SET); // read whole file - int data_length = ifp->size; - fread(data, 1, data_length, ifp); + fread(data.get(), 1, data_length, ifp); lj92 lj; int newwidth, newheight, newbps; lj92_open(&lj, &data[dataOffset[0]], data_length, &newwidth, &newheight, &newbps); @@ -1159,7 +1159,6 @@ void CLASS lossless_dnglj92_load_raw() if (newwidth * newheight * tileCount != raw_width * raw_height) { // not a lj92 file fseek(ifp, save, SEEK_SET); - free(data); lossless_dng_load_raw(); return; } @@ -1173,17 +1172,15 @@ void CLASS lossless_dnglj92_load_raw() int newwidth, newheight, newbps; lj92_open(&lj, &data[dataOffset[t]], data_length, &newwidth, &newheight, &newbps); - uint16_t *target = (uint16_t*)malloc(newwidth * newheight * sizeof *target); - lj92_decode(lj, target, tile_width, 0, lincurve, 0x1000); + const std::unique_ptr target(new uint16_t[newwidth * newheight]); + lj92_decode(lj, target.get(), tile_width, 0, lincurve, 0x1000); for (int y = 0; y < height; ++y) { for(int x = 0; x < tile_width; ++x) { RAW(y, x + tcol) = target[y * tile_width + x]; } } lj92_close(lj); - free(target); } - free(data); } void CLASS lossless_dng_load_raw() @@ -1306,10 +1303,10 @@ void CLASS nikon_load_raw() if (ver0 == 0x46) tree = 2; if (tiff_bps == 14) tree += 3; read_shorts (vpred[0], 4); - max = 1 << tiff_bps & 0x7fff; + max = 1 << (tiff_bps - (ver0 == 0x44 && ver1 == 0x40 ? 2 : 0)) & 0x7fff; if ((csize = get2()) > 1) step = max / (csize-1); - if (ver0 == 0x44 && ver1 == 0x20 && step > 0) { + if (ver0 == 0x44 && (ver1 == 0x20 || ver1 == 0x40) && step > 0) { for (int i=0; i < csize; i++) curve[i*step] = get2(); for (int i=0; i < max; i++) @@ -2565,6 +2562,7 @@ void CLASS packed_load_raw() bwide = raw_width * tiff_bps / 8; bwide += bwide & load_flags >> 9; + bwide += row_padding; rbits = bwide * 8 - raw_width * tiff_bps; if (load_flags & 1) bwide = bwide * 16 / 15; bite = 8 + (load_flags & 56); @@ -6762,8 +6760,13 @@ void CLASS apply_tiff() load_raw = &CLASS packed_load_raw; } else if ((raw_width * 2 * tiff_bps / 16 + 8) * raw_height == tiff_ifd[raw].bytes) { // 14 bit uncompressed from Nikon Z7, still wrong - // each line has 8 padding byte. To inform 'packed_load_raw' about his padding, we have to set load_flags = padding << 9 - load_flags = 8 << 9; + // each line has 8 padding byte. + row_padding = 8; + load_raw = &CLASS packed_load_raw; + } else if ((raw_width * 2 * tiff_bps / 16 + 12) * raw_height == tiff_ifd[raw].bytes) { + // 14 bit uncompressed from Nikon Z6, still wrong + // each line has 12 padding byte. + row_padding = 12; load_raw = &CLASS packed_load_raw; } else load_raw = &CLASS nikon_load_raw; break; @@ -9138,7 +9141,7 @@ void CLASS identify() parse_fuji (get4()); if (thumb_offset > 120) { fseek (ifp, 120, SEEK_SET); - is_raw += (i = get4()) && 1; + is_raw += (i = get4()) != 0 ? 1 : 0; if (is_raw == 2 && shot_select) parse_fuji (i); } diff --git a/rtengine/dcraw.h b/rtengine/dcraw.h index f9591b640..dd4831625 100644 --- a/rtengine/dcraw.h +++ b/rtengine/dcraw.h @@ -47,7 +47,9 @@ public: ,order(0x4949) ,ifname(nullptr) ,meta_data(nullptr) - ,shot_select(0),multi_out(0) + ,shot_select(0) + ,multi_out(0) + ,row_padding(0) ,float_raw_image(nullptr) ,image(nullptr) ,bright(1.) @@ -88,7 +90,7 @@ protected: unsigned tiff_nifds, tiff_samples, tiff_bps, tiff_compress; unsigned black, cblack[4102], maximum, mix_green, raw_color, zero_is_bad; unsigned zero_after_ff, is_raw, dng_version, is_foveon, data_error; - unsigned tile_width, tile_length, gpsdata[32], load_flags; + unsigned tile_width, tile_length, gpsdata[32], load_flags, row_padding; bool xtransCompressed = false; struct fuji_compressed_params { diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 4bc4f3857..7578f2761 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -1187,10 +1187,6 @@ void Crop::update(int todo) void Crop::freeAll() { - if (settings->verbose) { - printf("freeallcrop starts %d\n", (int)cropAllocated); - } - if (cropAllocated) { if (origCrop) { delete origCrop; @@ -1267,10 +1263,6 @@ bool check_need_larger_crop_for_lcp_distortion(int fw, int fh, int x, int y, int bool Crop::setCropSizes(int rcx, int rcy, int rcw, int rch, int skip, bool internal) { - if (settings->verbose) { - printf("setcropsizes before lock\n"); - } - if (!internal) { cropMutex.lock(); } @@ -1362,10 +1354,6 @@ bool Crop::setCropSizes(int rcx, int rcy, int rcw, int rch, int skip, bool inter int cw = skips(bw, skip); int ch = skips(bh, skip); - if (settings->verbose) { - printf("setsizes starts (%d, %d, %d, %d, %d, %d)\n", orW, orH, trafw, trafh, cw, ch); - } - EditType editType = ET_PIPETTE; if (const auto editProvider = PipetteBuffer::getDataProvider()) { @@ -1460,10 +1448,6 @@ bool Crop::setCropSizes(int rcx, int rcy, int rcw, int rch, int skip, bool inter cropx = bx1; cropy = by1; - if (settings->verbose) { - printf("setsizes ends\n"); - } - if (!internal) { cropMutex.unlock(); } diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index 2bad2fbb2..ea784da5a 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -46,10 +46,6 @@ void ImProcFunctions :: dirpyr_equalizer(float ** src, float ** dst, int srcwidt { int lastlevel = maxlevel; - if (settings->verbose) { - printf("Dirpyr scaleprev=%i\n", scaleprev); - } - float atten123 = (float) settings->level123_cbdl; if (atten123 > 50.f) { @@ -107,10 +103,6 @@ void ImProcFunctions :: dirpyr_equalizer(float ** src, float ** dst, int srcwidt } - if (settings->verbose) { - printf("CbDL mult0=%f 1=%f 2=%f 3=%f 4=%f 5=%f\n", multi[0], multi[1], multi[2], multi[3], multi[4], multi[5]); - } - multi_array2D dirpyrlo(srcwidth, srcheight); level = 0; diff --git a/rtengine/eahd_demosaic.cc b/rtengine/eahd_demosaic.cc index aef016386..4ebeb2d66 100644 --- a/rtengine/eahd_demosaic.cc +++ b/rtengine/eahd_demosaic.cc @@ -206,7 +206,7 @@ inline void RawImageSource::interpolate_row_rb (float* ar, float* ab, float* pg, n++; } - nonGreen2[j] = cg[j] + nonGreen / n; + nonGreen2[j] = cg[j] + nonGreen / std::max(n, 1); } } diff --git a/rtengine/histmatching.cc b/rtengine/histmatching.cc index b2fe436fd..2bc0e940e 100644 --- a/rtengine/histmatching.cc +++ b/rtengine/histmatching.cc @@ -216,6 +216,45 @@ void mappingToCurve(const std::vector &mapping, std::vector &curve) curve.push_back(1.0); curve.push_back(1.0); + + // we assume we are matching an S-shaped curve, so try to avoid + // concavities in the upper part of the S + const auto getpos = + [](float x, float xa, float ya, float xb, float yb) + { + // line equation: + // (x - xa) / (xb - xa) = (y - ya) / (yb - ya) + return (x - xa) / (xb - xa) * (yb - ya) + ya; + }; + idx = -1; + for (size_t i = curve.size()-1; i > 0; i -= 2) { + if (curve[i] <= 0.f) { + idx = i+1; + break; + } + } + if (idx >= 0 && size_t(idx) < curve.size()) { + // idx is the position of the first point in the upper part of the S + // for each 3 consecutive points (xa, ya), (x, y), (xb, yb) we check + // that y is above the point at x of the line between the other two + // if this is not the case, we remove (x, y) from the curve + while (size_t(idx+5) < curve.size()) { + float xa = curve[idx]; + float ya = curve[idx+1]; + float x = curve[idx+2]; + float y = curve[idx+3]; + float xb = curve[idx+4]; + float yb = curve[idx+5]; + float yy = getpos(x, xa, ya, xb, yb); + if (yy > y) { + // we have to remove (x, y) from the curve + curve.erase(curve.begin()+(idx+2), curve.begin()+(idx+4)); + } else { + // move on to the next point + idx += 2; + } + } + } if (curve.size() < 4) { curve = { DCT_Linear }; // not enough points, fall back to linear diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index 4d490c0a0..1f24852d0 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -1058,8 +1058,8 @@ cmsHPROFILE rtengine::ICCStore::makeStdGammaProfile(cmsHPROFILE iprof) uint32_t size; } tags[tag_count]; - const uint32_t gamma = 0x239; - int gamma_size = 14; + constexpr uint32_t gamma = 0x239; + constexpr int gamma_size = 14; int data_size = (gamma_size + 3) & ~3; for (uint32_t i = 0; i < tag_count; i++) { @@ -1096,13 +1096,13 @@ cmsHPROFILE rtengine::ICCStore::makeStdGammaProfile(cmsHPROFILE iprof) tags[i].sig == 0x6B545243) { // kTRC if (gamma_offset == 0) { gamma_offset = offset; - uint32_t pcurve[] = { htonl(0x63757276), htonl(0), htonl(gamma_size == 12 ? 0U : 1U) }; + uint32_t pcurve[] = { htonl(0x63757276), htonl(0), htonl(/*gamma_size == 12 ? 0U : */1U) }; memcpy(&nd[offset], pcurve, 12); - if (gamma_size == 14) { - uint16_t gm = htons(gamma); - memcpy(&nd[offset + 12], &gm, 2); - } + //if (gamma_size == 14) { + uint16_t gm = htons(gamma); + memcpy(&nd[offset + 12], &gm, 2); + //} offset += (gamma_size + 3) & ~3; } diff --git a/rtengine/iimage.h b/rtengine/iimage.h index af2969581..c25425b7d 100644 --- a/rtengine/iimage.h +++ b/rtengine/iimage.h @@ -82,22 +82,18 @@ public: // Read the raw dump of the data void readData (FILE *fh) {} // Write a raw dump of the data - void writeData (FILE *fh) {} + void writeData (FILE *fh) const {} virtual void normalizeInt (int srcMinVal, int srcMaxVal) {}; virtual void normalizeFloat (float srcMinVal, float srcMaxVal) {}; - virtual void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, int compression) {} + virtual void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, int compression) const {} virtual void getSpotWBData (double &reds, double &greens, double &blues, int &rn, int &gn, int &bn, std::vector &red, std::vector &green, std::vector &blue, - int tran) {} - virtual void getAutoWBMultipliers (double &rm, double &gm, double &bm) + int tran) const {} + virtual void getAutoWBMultipliers (double &rm, double &gm, double &bm) const { rm = gm = bm = 1.0; } - virtual const char* getType () const - { - return "unknown"; - } }; @@ -232,7 +228,7 @@ public: } // Send back the row stride. WARNING: unit = byte, not element! - int getRowStride () + int getRowStride () const { return rowstride; } @@ -316,7 +312,7 @@ public: } /** Copy the data to another PlanarWhateverData */ - void copyData(PlanarWhateverData *dest) + void copyData(PlanarWhateverData *dest) const { assert (dest != NULL); // Make sure that the size is the same, reallocate if necessary @@ -389,7 +385,7 @@ public: } template - void resizeImgTo (int nw, int nh, TypeInterpolation interp, PlanarWhateverData *imgPtr) + void resizeImgTo (int nw, int nh, TypeInterpolation interp, PlanarWhateverData *imgPtr) const { //printf("resizeImgTo: resizing %s image data (%d x %d) to %s (%d x %d)\n", getType(), width, height, imgPtr->getType(), imgPtr->width, imgPtr->height); if (width == nw && height == nh) { @@ -499,17 +495,7 @@ public: #endif } - void calcHist(unsigned int *hist16) - { - for (int row = 0; row < height; row++) - for (int col = 0; col < width; col++) { - unsigned short idx; - convertTo(v(row, col), idx); - hist16[idx]++; - } - } - - void transformPixel (int x, int y, int tran, int& tx, int& ty) + void transformPixel (int x, int y, int tran, int& tx, int& ty) const { if (!tran) { @@ -552,7 +538,7 @@ public: } } - void getPipetteData (T &value, int posX, int posY, int squareSize, int tran) + void getPipetteData (T &value, int posX, int posY, int squareSize, int tran) const { int x; int y; @@ -573,14 +559,14 @@ public: value = n ? T(accumulator / float(n)) : T(0); } - void readData (FILE *f) + void readData (FILE *f) { for (int i = 0; i < height; i++) { fread (v(i), sizeof(T), width, f); } } - void writeData (FILE *f) + void writeData (FILE *f) const { for (int i = 0; i < height; i++) { fwrite (v(i), sizeof(T), width, f); @@ -622,12 +608,12 @@ public: } // Send back the row stride. WARNING: unit = byte, not element! - int getRowStride () + int getRowStride () const { return rowstride; } // Send back the plane stride. WARNING: unit = byte, not element! - int getPlaneStride () + int getPlaneStride () const { return planestride; } @@ -732,7 +718,7 @@ public: } /** Copy the data to another PlanarRGBData */ - void copyData(PlanarRGBData *dest) + void copyData(PlanarRGBData *dest) const { assert (dest != nullptr); // Make sure that the size is the same, reallocate if necessary @@ -820,7 +806,7 @@ public: } template - void resizeImgTo (int nw, int nh, TypeInterpolation interp, IC *imgPtr) + void resizeImgTo (int nw, int nh, TypeInterpolation interp, IC *imgPtr) const { //printf("resizeImgTo: resizing %s image data (%d x %d) to %s (%d x %d)\n", getType(), width, height, imgPtr->getType(), imgPtr->width, imgPtr->height); if (width == nw && height == nh) { @@ -869,9 +855,9 @@ public: // This case should never occur! for (int i = 0; i < nh; i++) { for (int j = 0; j < nw; j++) { - r(i, j) = 0; - g(i, j) = 0; - b(i, j) = 0; + imgPtr->r(i, j) = 0; + imgPtr->g(i, j) = 0; + imgPtr->b(i, j) = 0; } } } @@ -942,7 +928,7 @@ public: #endif } - void calcGrayscaleHist(unsigned int *hist16) + void calcGrayscaleHist(unsigned int *hist16) const { for (int row = 0; row < height; row++) for (int col = 0; col < width; col++) { @@ -956,7 +942,7 @@ public: } } - void computeAutoHistogram (LUTu & histogram, int& histcompr) + void computeAutoHistogram (LUTu & histogram, int& histcompr) const { histcompr = 3; @@ -975,7 +961,7 @@ public: } } - void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, const int compression) + void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, const int compression) const { histogram.clear(); avg_r = avg_g = avg_b = 0.; @@ -1007,7 +993,7 @@ public: } } - void getAutoWBMultipliers (double &rm, double &gm, double &bm) + void getAutoWBMultipliers (double &rm, double &gm, double &bm) const { double avg_r = 0.; @@ -1038,7 +1024,7 @@ public: bm = avg_b / double(n); } - void transformPixel (int x, int y, int tran, int& tx, int& ty) + void transformPixel (int x, int y, int tran, int& tx, int& ty) const { if (!tran) { @@ -1083,7 +1069,7 @@ public: virtual void getSpotWBData (double &reds, double &greens, double &blues, int &rn, int &gn, int &bn, std::vector &red, std::vector &green, std::vector &blue, - int tran) + int tran) const { int x; int y; @@ -1120,7 +1106,7 @@ public: } } - void getPipetteData (T &valueR, T &valueG, T &valueB, int posX, int posY, int squareSize, int tran) + void getPipetteData (T &valueR, T &valueG, T &valueB, int posX, int posY, int squareSize, int tran) const { int x; int y; @@ -1147,22 +1133,28 @@ public: valueB = n ? T(accumulatorB / float(n)) : T(0); } - void readData (FILE *f) + void readData (FILE *f) { for (int i = 0; i < height; i++) { - fread (r(i), sizeof(T), width, f); + if (fread(r(i), sizeof(T), width, f) < width) { + break; + } } for (int i = 0; i < height; i++) { - fread (g(i), sizeof(T), width, f); + if (fread(g(i), sizeof(T), width, f) < width) { + break; + } } for (int i = 0; i < height; i++) { - fread (b(i), sizeof(T), width, f); + if (fread(b(i), sizeof(T), width, f) < width) { + break; + } } } - void writeData (FILE *f) + void writeData (FILE *f) const { for (int i = 0; i < height; i++) { fwrite (r(i), sizeof(T), width, f); @@ -1345,7 +1337,7 @@ public: } /** Copy the data to another ChunkyRGBData */ - void copyData(ChunkyRGBData *dest) + void copyData(ChunkyRGBData *dest) const { assert (dest != nullptr); // Make sure that the size is the same, reallocate if necessary @@ -1421,7 +1413,7 @@ public: } template - void resizeImgTo (int nw, int nh, TypeInterpolation interp, IC *imgPtr) + void resizeImgTo (int nw, int nh, TypeInterpolation interp, IC *imgPtr) const { //printf("resizeImgTo: resizing %s image data (%d x %d) to %s (%d x %d)\n", getType(), width, height, imgPtr->getType(), imgPtr->width, imgPtr->height); if (width == nw && height == nh) { @@ -1485,9 +1477,9 @@ public: // This case should never occur! for (int i = 0; i < nh; i++) { for (int j = 0; j < nw; j++) { - r(i, j) = 0; - g(i, j) = 0; - b(i, j) = 0; + imgPtr->r(i, j) = 0; + imgPtr->g(i, j) = 0; + imgPtr->b(i, j) = 0; } } } @@ -1545,7 +1537,7 @@ public: } } - void calcGrayscaleHist(unsigned int *hist16) + void calcGrayscaleHist(unsigned int *hist16) const { for (int row = 0; row < height; row++) for (int col = 0; col < width; col++) { @@ -1559,7 +1551,7 @@ public: } } - void computeAutoHistogram (LUTu & histogram, int& histcompr) + void computeAutoHistogram (LUTu & histogram, int& histcompr) const { histcompr = 3; @@ -1578,7 +1570,7 @@ public: } } - void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, const int compression) + void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, const int compression) const { histogram.clear(); avg_r = avg_g = avg_b = 0.; @@ -1610,7 +1602,7 @@ public: } } - void getAutoWBMultipliers (double &rm, double &gm, double &bm) + void getAutoWBMultipliers (double &rm, double &gm, double &bm) const { double avg_r = 0.; @@ -1641,7 +1633,7 @@ public: bm = avg_b / double(n); } - void transformPixel (int x, int y, int tran, int& tx, int& ty) + void transformPixel (int x, int y, int tran, int& tx, int& ty) const { if (!tran) { @@ -1686,7 +1678,7 @@ public: virtual void getSpotWBData (double &reds, double &greens, double &blues, int &rn, int &gn, int &bn, std::vector &red, std::vector &green, std::vector &blue, - int tran) + int tran) const { int x; int y; @@ -1723,14 +1715,16 @@ public: } } - void readData (FILE *f) + void readData (FILE *f) { for (int i = 0; i < height; i++) { - fread (r(i), sizeof(T), 3 * width, f); + if (fread(r(i), sizeof(T), 3 * width, f) < 3 * width) { + break; + } } } - void writeData (FILE *f) + void writeData (FILE *f) const { for (int i = 0; i < height; i++) { fwrite (r(i), sizeof(T), 3 * width, f); @@ -1751,31 +1745,31 @@ public: /** @brief Returns a mutex that can is useful in many situations. No image operations shuold be performed without locking this mutex. * @return The mutex */ virtual MyMutex& getMutex () = 0; - virtual cmsHPROFILE getProfile () = 0; + virtual cmsHPROFILE getProfile () const = 0; /** @brief Returns the bits per pixel of the image. * @return The bits per pixel of the image */ - virtual int getBitsPerPixel () = 0; + virtual int getBitsPerPixel () const = 0; /** @brief Saves the image to file. It autodetects the format (jpg, tif, png are supported). * @param fname is the name of the file @return the error code, 0 if none */ - virtual int saveToFile (Glib::ustring fname) = 0; + virtual int saveToFile (const Glib::ustring &fname) const = 0; /** @brief Saves the image to file in a png format. * @param fname is the name of the file * @param compression is the amount of compression (0-6), -1 corresponds to the default * @param bps can be 8 or 16 depending on the bits per pixels the output file will have @return the error code, 0 if none */ - virtual int saveAsPNG (Glib::ustring fname, int bps = -1) = 0; + virtual int saveAsPNG (const Glib::ustring &fname, int bps = -1) const = 0; /** @brief Saves the image to file in a jpg format. * @param fname is the name of the file * @param quality is the quality of the jpeg (0...100), set it to -1 to use default @return the error code, 0 if none */ - virtual int saveAsJPEG (Glib::ustring fname, int quality = 100, int subSamp = 3 ) = 0; + virtual int saveAsJPEG (const Glib::ustring &fname, int quality = 100, int subSamp = 3 ) const = 0; /** @brief Saves the image to file in a tif format. * @param fname is the name of the file * @param bps can be 8 or 16 depending on the bits per pixels the output file will have * @param isFloat is true for saving float images. Will be ignored by file format not supporting float data @return the error code, 0 if none */ - virtual int saveAsTIFF (Glib::ustring fname, int bps = -1, float isFloat = false, bool uncompressed = false) = 0; + virtual int saveAsTIFF (const Glib::ustring &fname, int bps = -1, bool isFloat = false, bool uncompressed = false) const = 0; /** @brief Sets the progress listener if you want to follow the progress of the image saving operations (optional). * @param pl is the pointer to the class implementing the ProgressListener interface */ virtual void setSaveProgressListener (ProgressListener* pl) = 0; diff --git a/rtengine/image16.cc b/rtengine/image16.cc index c014d1c06..618d31641 100644 --- a/rtengine/image16.cc +++ b/rtengine/image16.cc @@ -60,7 +60,7 @@ Image16::~Image16() { } -void Image16::getScanline(int row, unsigned char* buffer, int bps, bool isFloat) +void Image16::getScanline(int row, unsigned char* buffer, int bps, bool isFloat) const { if (data == nullptr) { @@ -124,7 +124,7 @@ void Image16::setScanline(int row, unsigned char* buffer, int bps, unsigned int */ } -Image16* Image16::copy() +Image16* Image16::copy() const { Image16* cp = new Image16(width, height); @@ -132,7 +132,7 @@ Image16* Image16::copy() return cp; } -void Image16::getStdImage(ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp) +void Image16::getStdImage(const ColorTemp &ctemp, int tran, Imagefloat* image, PreviewProps pp) const { // compute channel multipliers @@ -295,8 +295,7 @@ void Image16::getStdImage(ColorTemp ctemp, int tran, Imagefloat* image, PreviewP #undef GCLIP } -Image8* -Image16::to8() +Image8* Image16::to8() const { Image8* img8 = new Image8(width, height); @@ -311,8 +310,7 @@ Image16::to8() return img8; } -Imagefloat* -Image16::tofloat() +Imagefloat* Image16::tofloat() const { Imagefloat* imgfloat = new Imagefloat(width, height); diff --git a/rtengine/image16.h b/rtengine/image16.h index 1c5504bd9..940416254 100644 --- a/rtengine/image16.h +++ b/rtengine/image16.h @@ -40,62 +40,71 @@ public: Image16(int width, int height); ~Image16(); - Image16* copy(); + Image16* copy() const; - Image8* to8(); - Imagefloat* tofloat(); + Image8* to8() const; + Imagefloat* tofloat() const; - virtual void getStdImage(ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp); + void getStdImage(const ColorTemp &ctemp, int tran, Imagefloat* image, PreviewProps pp) const override; - virtual const char* getType() const + const char* getType() const override { return sImage16; } - virtual int getBPS() + int getBPS() const override { return 8 * sizeof(unsigned short); } - virtual void getScanline(int row, unsigned char* buffer, int bps, bool isFloat = false); - virtual void setScanline(int row, unsigned char* buffer, int bps, unsigned int numSamples); + + void getScanline(int row, unsigned char* buffer, int bps, bool isFloat = false) const override; + void setScanline(int row, unsigned char* buffer, int bps, unsigned int numSamples) override; // functions inherited from IImage16: - virtual MyMutex& getMutex() + MyMutex& getMutex() override { return mutex(); } - virtual cmsHPROFILE getProfile() + + cmsHPROFILE getProfile() const override { return getEmbeddedProfile(); } - virtual int getBitsPerPixel() + + int getBitsPerPixel() const override { return 8 * sizeof(unsigned short); } - virtual int saveToFile(Glib::ustring fname) + + int saveToFile(const Glib::ustring &fname) const override { return save(fname); } - virtual int saveAsPNG(Glib::ustring fname, int bps = -1) + + int saveAsPNG(const Glib::ustring &fname, int bps = -1) const override { return savePNG(fname, bps); } - virtual int saveAsJPEG(Glib::ustring fname, int quality = 100, int subSamp = 3) + + int saveAsJPEG(const Glib::ustring &fname, int quality = 100, int subSamp = 3) const override { return saveJPEG(fname, quality, subSamp); } - virtual int saveAsTIFF(Glib::ustring fname, int bps = -1, float isFloat = false, bool uncompressed = false) + + int saveAsTIFF(const Glib::ustring &fname, int bps = -1, bool isFloat = false, bool uncompressed = false) const override { return saveTIFF(fname, bps, isFloat, uncompressed); } - virtual void setSaveProgressListener(ProgressListener* pl) + + void setSaveProgressListener(ProgressListener* pl) override { setProgressListener(pl); } - virtual void free() + + void free() override { delete this; } - void ExecCMSTransform(cmsHTRANSFORM hTransform); + void ExecCMSTransform(cmsHTRANSFORM hTransform); /* void ExecCMSTransform(cmsHTRANSFORM hTransform, const LabImage &labImage, int cx, int cy); */ }; diff --git a/rtengine/image8.cc b/rtengine/image8.cc index ab7393100..edced2fe5 100644 --- a/rtengine/image8.cc +++ b/rtengine/image8.cc @@ -37,7 +37,7 @@ Image8::~Image8 () { } -void Image8::getScanline (int row, unsigned char* buffer, int bps, bool isFloat) +void Image8::getScanline (int row, unsigned char* buffer, int bps, bool isFloat) const { if (data == nullptr) { @@ -89,7 +89,7 @@ void Image8::setScanline (int row, unsigned char* buffer, int bps, unsigned int } } -Image8* Image8::copy () +Image8* Image8::copy () const { Image8* cp = new Image8 (width, height); @@ -97,7 +97,7 @@ Image8* Image8::copy () return cp; } -void Image8::getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp) +void Image8::getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, PreviewProps pp) const { // compute channel multipliers float rm = 1.f, gm = 1.f, bm = 1.f; diff --git a/rtengine/image8.h b/rtengine/image8.h index 59d13c298..2cc670a4a 100644 --- a/rtengine/image8.h +++ b/rtengine/image8.h @@ -38,55 +38,65 @@ public: Image8 (int width, int height); ~Image8 (); - Image8* copy (); + Image8* copy () const; - virtual void getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp); + void getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, PreviewProps pp) const override; - virtual const char* getType () const + const char* getType () const override { return sImage8; } - virtual int getBPS () + + int getBPS () const override { return 8 * sizeof(unsigned char); } - virtual void getScanline (int row, unsigned char* buffer, int bps, bool isFloat = false); - virtual void setScanline (int row, unsigned char* buffer, int bps, unsigned int numSamples); + + void getScanline (int row, unsigned char* buffer, int bps, bool isFloat = false) const override; + void setScanline (int row, unsigned char* buffer, int bps, unsigned int numSamples) override; // functions inherited from IImage*: - virtual MyMutex& getMutex () + MyMutex& getMutex () override { return mutex (); } - virtual cmsHPROFILE getProfile () + + cmsHPROFILE getProfile () const override { return getEmbeddedProfile (); } - virtual int getBitsPerPixel () + + int getBitsPerPixel () const override { return 8 * sizeof(unsigned char); } - virtual int saveToFile (Glib::ustring fname) + + int saveToFile (const Glib::ustring &fname) const override { return save (fname); } - virtual int saveAsPNG (Glib::ustring fname, int bps = -1) + + int saveAsPNG (const Glib::ustring &fname, int bps = -1) const override { return savePNG (fname, bps); } - virtual int saveAsJPEG (Glib::ustring fname, int quality = 100, int subSamp = 3) + + int saveAsJPEG (const Glib::ustring &fname, int quality = 100, int subSamp = 3) const override { return saveJPEG (fname, quality, subSamp); } - virtual int saveAsTIFF (Glib::ustring fname, int bps = -1, float isFloat = false, bool uncompressed = false) + + int saveAsTIFF (const Glib::ustring &fname, int bps = -1, bool isFloat = false, bool uncompressed = false) const override { return saveTIFF (fname, bps, isFloat, uncompressed); } - virtual void setSaveProgressListener (ProgressListener* pl) + + void setSaveProgressListener (ProgressListener* pl) override { setProgressListener (pl); } - virtual void free () + + void free () override { delete this; } diff --git a/rtengine/imagefloat.cc b/rtengine/imagefloat.cc index 2cf73204d..63c521040 100644 --- a/rtengine/imagefloat.cc +++ b/rtengine/imagefloat.cc @@ -110,7 +110,7 @@ void Imagefloat::setScanline (int row, unsigned char* buffer, int bps, unsigned namespace rtengine { extern void filmlike_clip(float *r, float *g, float *b); } -void Imagefloat::getScanline (int row, unsigned char* buffer, int bps, bool isFloat) +void Imagefloat::getScanline (int row, unsigned char* buffer, int bps, bool isFloat) const { if (data == nullptr) { @@ -159,7 +159,7 @@ void Imagefloat::getScanline (int row, unsigned char* buffer, int bps, bool isFl } } -Imagefloat* Imagefloat::copy () +Imagefloat* Imagefloat::copy () const { Imagefloat* cp = new Imagefloat (width, height); @@ -168,7 +168,7 @@ Imagefloat* Imagefloat::copy () } // This is called by the StdImageSource class. We assume that fp images from StdImageSource don't have to deal with gamma -void Imagefloat::getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp) +void Imagefloat::getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, PreviewProps pp) const { // compute channel multipliers @@ -330,7 +330,7 @@ void Imagefloat::getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, Prev } Image8* -Imagefloat::to8() +Imagefloat::to8() const { Image8* img8 = new Image8(width, height); #ifdef _OPENMP @@ -349,7 +349,7 @@ Imagefloat::to8() } Image16* -Imagefloat::to16() +Imagefloat::to16() const { Image16* img16 = new Image16(width, height); #ifdef _OPENMP diff --git a/rtengine/imagefloat.h b/rtengine/imagefloat.h index 65c291775..bd7ae2a46 100644 --- a/rtengine/imagefloat.h +++ b/rtengine/imagefloat.h @@ -44,63 +44,65 @@ public: Imagefloat (int width, int height); ~Imagefloat (); - Imagefloat* copy (); + Imagefloat* copy () const; - Image8* to8(); - Image16* to16(); + Image8* to8() const; + Image16* to16() const; - virtual void getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp); + void getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, PreviewProps pp) const override; - virtual const char* getType () const + const char* getType () const override { return sImagefloat; } - virtual int getBPS () + + int getBPS () const override { return 8 * sizeof(float); } - virtual void getScanline (int row, unsigned char* buffer, int bps, bool isFloat = false); - virtual void setScanline (int row, unsigned char* buffer, int bps, unsigned int numSamples); + + void getScanline (int row, unsigned char* buffer, int bps, bool isFloat = false) const override; + void setScanline (int row, unsigned char* buffer, int bps, unsigned int numSamples) override; // functions inherited from IImagefloat: - virtual MyMutex& getMutex () + MyMutex& getMutex () override { return mutex (); } - virtual cmsHPROFILE getProfile () + cmsHPROFILE getProfile () const override { return getEmbeddedProfile (); } - virtual int getBitsPerPixel () + int getBitsPerPixel () const override { return 8 * sizeof(float); } - virtual int saveToFile (Glib::ustring fname) + int saveToFile (const Glib::ustring &fname) const override { return save (fname); } - virtual int saveAsPNG (Glib::ustring fname, int bps = -1) + int saveAsPNG (const Glib::ustring &fname, int bps = -1) const override { return savePNG (fname, bps); } - virtual int saveAsJPEG (Glib::ustring fname, int quality = 100, int subSamp = 3) + int saveAsJPEG (const Glib::ustring &fname, int quality = 100, int subSamp = 3) const override { return saveJPEG (fname, quality, subSamp); } - virtual int saveAsTIFF (Glib::ustring fname, int bps = -1, float isFloat = false, bool uncompressed = false) + int saveAsTIFF (const Glib::ustring &fname, int bps = -1, bool isFloat = false, bool uncompressed = false) const override { return saveTIFF (fname, bps, isFloat, uncompressed); } - virtual void setSaveProgressListener (ProgressListener* pl) + void setSaveProgressListener (ProgressListener* pl) override { setProgressListener (pl); } - virtual void free () + void free () override { delete this; } - inline uint16_t DNG_FloatToHalf(float f) + inline uint16_t DNG_FloatToHalf(float f) const { union { float f; diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 802365d74..76a6417ff 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -201,7 +201,7 @@ void png_read_data(png_struct_def *png_ptr, unsigned char *data, size_t length) void png_write_data(png_struct_def *png_ptr, unsigned char *data, size_t length); void png_flush(png_struct_def *png_ptr); -int ImageIO::getPNGSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, IIOSampleArrangement &sArrangement) +int ImageIO::getPNGSampleFormat (const Glib::ustring &fname, IIOSampleFormat &sFormat, IIOSampleArrangement &sArrangement) { FILE *file = g_fopen (fname.c_str (), "rb"); @@ -273,7 +273,7 @@ int ImageIO::getPNGSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, } } -int ImageIO::loadPNG (Glib::ustring fname) +int ImageIO::loadPNG (const Glib::ustring &fname) { FILE *file = g_fopen (fname.c_str (), "rb"); @@ -447,7 +447,7 @@ void my_error_exit (j_common_ptr cinfo) (*cinfo->err->output_message) (cinfo); /* Return control to the setjmp point */ -#if defined( WIN32 ) && defined( __x86_64__ ) +#if defined( WIN32 ) && defined( __x86_64__ ) && !defined(__clang__) __builtin_longjmp(myerr->setjmp_buffer, 1); #else longjmp(myerr->setjmp_buffer, 1); @@ -471,7 +471,7 @@ int ImageIO::loadJPEGFromMemory (const char* buffer, int bufsize) jerr.pub.error_exit = my_error_exit; /* Establish the setjmp return context for my_error_exit to use. */ -#if defined( WIN32 ) && defined( __x86_64__ ) +#if defined( WIN32 ) && defined( __x86_64__ ) && !defined(__clang__) if (__builtin_setjmp(jerr.setjmp_buffer)) { #else @@ -543,7 +543,7 @@ int ImageIO::loadJPEGFromMemory (const char* buffer, int bufsize) return IMIO_SUCCESS; } -int ImageIO::loadJPEG (Glib::ustring fname) +int ImageIO::loadJPEG (const Glib::ustring &fname) { FILE *file = g_fopen(fname.c_str (), "rb"); @@ -629,7 +629,7 @@ int ImageIO::loadJPEG (Glib::ustring fname) } } -int ImageIO::getTIFFSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, IIOSampleArrangement &sArrangement) +int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &sFormat, IIOSampleArrangement &sArrangement) { #ifdef WIN32 wchar_t *wfilename = (wchar_t*)g_utf8_to_utf16 (fname.c_str(), -1, NULL, NULL, NULL); @@ -731,7 +731,7 @@ int ImageIO::getTIFFSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, return IMIO_VARIANTNOTSUPPORTED; } -int ImageIO::loadTIFF (Glib::ustring fname) +int ImageIO::loadTIFF (const Glib::ustring &fname) { static MyMutex thumbMutex; @@ -972,7 +972,7 @@ void PNGwriteRawProfile(png_struct *ping, png_info *ping_info, const char *profi } // namespace -int ImageIO::savePNG (Glib::ustring fname, volatile int bps) +int ImageIO::savePNG (const Glib::ustring &fname, int bps) const { if (getWidth() < 1 || getHeight() < 1) { return IMIO_HEADERERROR; @@ -1111,7 +1111,7 @@ int ImageIO::savePNG (Glib::ustring fname, volatile int bps) // Quality 0..100, subsampling: 1=low quality, 2=medium, 3=high -int ImageIO::saveJPEG (Glib::ustring fname, int quality, int subSamp) +int ImageIO::saveJPEG (const Glib::ustring &fname, int quality, int subSamp) const { if (getWidth() < 1 || getHeight() < 1) { return IMIO_HEADERERROR; @@ -1134,7 +1134,7 @@ int ImageIO::saveJPEG (Glib::ustring fname, int quality, int subSamp) jerr.pub.error_exit = my_error_exit; /* Establish the setjmp return context for my_error_exit to use. */ -#if defined( WIN32 ) && defined( __x86_64__ ) +#if defined( WIN32 ) && defined( __x86_64__ ) && !defined(__clang__) if (__builtin_setjmp(jerr.setjmp_buffer)) { #else @@ -1252,7 +1252,7 @@ int ImageIO::saveJPEG (Glib::ustring fname, int quality, int subSamp) unsigned char *row = new unsigned char [rowlen]; /* To avoid memory leaks we establish a new setjmp return context for my_error_exit to use. */ -#if defined( WIN32 ) && defined( __x86_64__ ) +#if defined( WIN32 ) && defined( __x86_64__ ) && !defined(__clang__) if (__builtin_setjmp(jerr.setjmp_buffer)) { #else @@ -1301,7 +1301,7 @@ int ImageIO::saveJPEG (Glib::ustring fname, int quality, int subSamp) return IMIO_SUCCESS; } -int ImageIO::saveTIFF (Glib::ustring fname, int bps, float isFloat, bool uncompressed) +int ImageIO::saveTIFF (const Glib::ustring &fname, int bps, bool isFloat, bool uncompressed) const { if (getWidth() < 1 || getHeight() < 1) { return IMIO_HEADERERROR; @@ -1595,7 +1595,7 @@ void png_flush(png_structp png_ptr) } } -int ImageIO::load (Glib::ustring fname) +int ImageIO::load (const Glib::ustring &fname) { if (hasPngExtension(fname)) { @@ -1609,7 +1609,7 @@ int ImageIO::load (Glib::ustring fname) } } -int ImageIO::save (Glib::ustring fname) +int ImageIO::save (const Glib::ustring &fname) const { if (hasPngExtension(fname)) { return savePNG (fname); @@ -1621,3 +1621,57 @@ int ImageIO::save (Glib::ustring fname) return IMIO_FILETYPENOTSUPPORTED; } } + +void ImageIO::setProgressListener (ProgressListener* l) +{ + pl = l; +} + +void ImageIO::setSampleFormat(IIOSampleFormat sFormat) +{ + sampleFormat = sFormat; +} + +IIOSampleFormat ImageIO::getSampleFormat() const +{ + return sampleFormat; +} + +void ImageIO::setSampleArrangement(IIOSampleArrangement sArrangement) +{ + sampleArrangement = sArrangement; +} + +IIOSampleArrangement ImageIO::getSampleArrangement() const +{ + return sampleArrangement; +} + +cmsHPROFILE ImageIO::getEmbeddedProfile () const +{ + return embProfile; +} + +void ImageIO::getEmbeddedProfileData (int& length, unsigned char*& pdata) const +{ + length = loadedProfileLength; + pdata = (unsigned char*)loadedProfileData; +} + +MyMutex& ImageIO::mutex () +{ + return imutex; +} + +void ImageIO::deleteLoadedProfileData( ) +{ + if(loadedProfileData) { + if(loadedProfileDataJpg) { + free(loadedProfileData); + } else { + delete[] loadedProfileData; + } + } + + loadedProfileData = nullptr; +} diff --git a/rtengine/imageio.h b/rtengine/imageio.h index cbf245291..5970866f0 100644 --- a/rtengine/imageio.h +++ b/rtengine/imageio.h @@ -28,11 +28,11 @@ #define IMIO_FILETYPENOTSUPPORTED 6 #define IMIO_CANNOTWRITEFILE 7 +#include +#include #include "rtengine.h" #include "imageformat.h" -#include #include "procparams.h" -#include #include "../rtexif/rtexif.h" #include "imagedimensions.h" #include "iimage.h" @@ -63,18 +63,8 @@ protected: IIOSampleArrangement sampleArrangement; private: - void deleteLoadedProfileData( ) - { - if(loadedProfileData) { - if(loadedProfileDataJpg) { - free(loadedProfileData); - } else { - delete[] loadedProfileData; - } - } + void deleteLoadedProfileData( ); - loadedProfileData = nullptr; - } public: static Glib::ustring errorMsg[6]; @@ -84,79 +74,42 @@ public: virtual ~ImageIO (); - void setProgressListener (ProgressListener* l) - { - pl = l; - } + void setProgressListener (ProgressListener* l); + void setSampleFormat(IIOSampleFormat sFormat); + IIOSampleFormat getSampleFormat() const; + void setSampleArrangement(IIOSampleArrangement sArrangement); + IIOSampleArrangement getSampleArrangement() const; - void setSampleFormat(IIOSampleFormat sFormat) - { - sampleFormat = sFormat; - } - IIOSampleFormat getSampleFormat() - { - return sampleFormat; - } - void setSampleArrangement(IIOSampleArrangement sArrangement) - { - sampleArrangement = sArrangement; - } - IIOSampleArrangement getSampleArrangement() - { - return sampleArrangement; - } + virtual void getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, PreviewProps pp) const = 0; + virtual int getBPS () const = 0; + virtual void getScanline (int row, unsigned char* buffer, int bps, bool isFloat = false) const = 0; + virtual void setScanline (int row, unsigned char* buffer, int bps, unsigned int numSamples = 3) = 0; + virtual const char* getType () const = 0; - virtual void getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp) - { - printf("getStdImage NULL!\n"); - } + int load (const Glib::ustring &fname); + int save (const Glib::ustring &fname) const; - virtual int getBPS () = 0; - virtual void getScanline (int row, unsigned char* buffer, int bps, bool isFloat = false) {} - virtual void setScanline (int row, unsigned char* buffer, int bps, unsigned int numSamples = 3) {} - - virtual bool readImage (Glib::ustring &fname, FILE *fh) - { - return false; - }; - virtual bool writeImage (Glib::ustring &fname, FILE *fh) - { - return false; - }; - - int load (Glib::ustring fname); - int save (Glib::ustring fname); - - int loadPNG (Glib::ustring fname); - int loadJPEG (Glib::ustring fname); - int loadTIFF (Glib::ustring fname); - static int getPNGSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, IIOSampleArrangement &sArrangement); - static int getTIFFSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, IIOSampleArrangement &sArrangement); + int loadPNG (const Glib::ustring &fname); + int loadJPEG (const Glib::ustring &fname); + int loadTIFF (const Glib::ustring &fname); + static int getPNGSampleFormat (const Glib::ustring &fname, IIOSampleFormat &sFormat, IIOSampleArrangement &sArrangement); + static int getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &sFormat, IIOSampleArrangement &sArrangement); int loadJPEGFromMemory (const char* buffer, int bufsize); int loadPPMFromMemory(const char* buffer, int width, int height, bool swap, int bps); - int savePNG (Glib::ustring fname, volatile int bps = -1); - int saveJPEG (Glib::ustring fname, int quality = 100, int subSamp = 3); - int saveTIFF (Glib::ustring fname, int bps = -1, float isFloat = false, bool uncompressed = false); + int savePNG (const Glib::ustring &fname, int bps = -1) const; + int saveJPEG (const Glib::ustring &fname, int quality = 100, int subSamp = 3) const; + int saveTIFF (const Glib::ustring &fname, int bps = -1, bool isFloat = false, bool uncompressed = false) const; - cmsHPROFILE getEmbeddedProfile () - { - return embProfile; - } - void getEmbeddedProfileData (int& length, unsigned char*& pdata) - { - length = loadedProfileLength; - pdata = (unsigned char*)loadedProfileData; - } + cmsHPROFILE getEmbeddedProfile () const; + void getEmbeddedProfileData (int& length, unsigned char*& pdata) const; void setMetadata (const rtexif::TagDirectory* eroot); void setMetadata (const rtexif::TagDirectory* eroot, const rtengine::procparams::ExifPairs& exif, const rtengine::procparams::IPTCPairs& iptcc); - void setOutputProfile (const char* pdata, int plen); - MyMutex& mutex () - { - return imutex; - } + void setOutputProfile (const char* pdata, int plen); + + MyMutex& mutex (); }; } diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index c1bd8fd64..2c7ded588 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -74,7 +74,7 @@ public: virtual void retinexPrepareBuffers (const ColorManagementParams& cmp, const RetinexParams &retinexParams, multi_array2D &conversionBuffer, LUTu &lhist16RETI) {}; virtual void flushRawData () {}; virtual void flushRGB () {}; - virtual void HLRecovery_Global (ToneCurveParams hrp) {}; + virtual void HLRecovery_Global (const ToneCurveParams &hrp) {}; virtual void HLRecovery_inpaint (float** red, float** green, float** blue) {}; virtual void MSR (LabImage* lab, LUTf & mapcurve, bool &mapcontlutili, int width, int height, int skip, RetinexParams deh, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax) {}; diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index d905bab29..53845e9ba 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -682,10 +682,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } if (params.colorToning.enabled && params.colorToning.autosat && actListener) { - if (settings->verbose) { - printf("ImProcCoordinator / Auto CT: indi=%d satH=%d satPR=%d\n", indi, (int)colourToningSatLimit, (int) colourToningSatLimitOpacity); - } - actListener->autoColorTonChanged(indi, (int) colourToningSatLimit, (int)colourToningSatLimitOpacity); //change sliders autosat } @@ -1091,10 +1087,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) void ImProcCoordinator::freeAll() { - if (settings->verbose) { - printf("freeall starts %d\n", (int)allocated); - } - if (allocated) { if (orig_prev != oprevi) { delete oprevi; @@ -1138,10 +1130,6 @@ void ImProcCoordinator::freeAll() void ImProcCoordinator::setScale(int prevscale) { - if (settings->verbose) { - printf("setscale before lock\n"); - } - tr = getCoarseBitMask(params.coarse); int nW, nH; @@ -1155,10 +1143,6 @@ void ImProcCoordinator::setScale(int prevscale) imgsrc->getSize(pp, nW, nH); } while (nH < 400 && prevscale > 1 && (nW * nH < 1000000)); // sctually hardcoded values, perhaps a better choice is possible - if (settings->verbose) { - printf("setscale starts (%d, %d)\n", nW, nH); - } - if (nW != pW || nH != pH) { freeAll(); @@ -1185,19 +1169,10 @@ void ImProcCoordinator::setScale(int prevscale) fullw = fw; fullh = fh; - if (settings->verbose) { - printf("setscale ends\n"); - } - if (!sizeListeners.empty()) for (size_t i = 0; i < sizeListeners.size(); i++) { sizeListeners[i]->sizeChanged(fullw, fullh, fw, fh); } - - if (settings->verbose) { - printf("setscale ends2\n"); - } - } diff --git a/rtengine/ipdehaze.cc b/rtengine/ipdehaze.cc index 5522107e0..97c1883c9 100644 --- a/rtengine/ipdehaze.cc +++ b/rtengine/ipdehaze.cc @@ -183,6 +183,7 @@ float estimate_ambient_light(const array2D &R, const array2D &G, c } } } + n = std::max(n, 1); ambient[0] = rr / n; ambient[1] = gg / n; ambient[2] = bb / n; diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index c4707f16f..da8e687ed 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -335,8 +335,6 @@ Imagefloat* ImProcFunctions::lab2rgbOut(LabImage* lab, int cx, int cy, int cw, i #endif delete [] buffer; if (!modelDesc.empty()) { - printf("dmdd=%s\n", modelDesc.c_str()); - std::size_t pos = modelDesc.find("g"); std::size_t posmid = modelDesc.find("s"); std::size_t posend = modelDesc.find("!"); @@ -369,8 +367,13 @@ Imagefloat* ImProcFunctions::lab2rgbOut(LabImage* lab, int cx, int cy, int cw, i gammaParams[6] = 0.0; cmsToneCurve* GammaTRC[3]; - - GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildParametricToneCurve(nullptr, 5, gammaParams); //5 = smoother than 4 + if(slopetag == 0.) { + //printf("gammatag=%f\n", gammatag); + GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildGamma(NULL, gammatag); + } + else { + GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildParametricToneCurve(nullptr, 5, gammaParams); //5 = smoother than 4 + } cmsWriteTag(oprof, cmsSigRedTRCTag, GammaTRC[0]); cmsWriteTag(oprof, cmsSigGreenTRCTag, GammaTRC[1]); cmsWriteTag(oprof, cmsSigBlueTRCTag, GammaTRC[2]); diff --git a/rtengine/ipresize.cc b/rtengine/ipresize.cc index b3275b2e4..f33b8f0c9 100644 --- a/rtengine/ipresize.cc +++ b/rtengine/ipresize.cc @@ -231,7 +231,7 @@ void ImProcFunctions::Lanczos (const LabImage* src, LabImage* dst, float scale) float* const la = aligned_buffer_la.data; float* const lb = aligned_buffer_lb.data; // weights for interpolation in y direction - float w[support] ALIGNED64; + float w[support] ALIGNED64 = {}; // Phase 2: do actual interpolation #ifdef _OPENMP diff --git a/rtengine/ipvibrance.cc b/rtengine/ipvibrance.cc index f7a938c33..86c942731 100644 --- a/rtengine/ipvibrance.cc +++ b/rtengine/ipvibrance.cc @@ -170,12 +170,6 @@ void ImProcFunctions::vibrance (LabImage* lab) {static_cast(wiprof[2][0]), static_cast(wiprof[2][1]), static_cast(wiprof[2][2])} }; - - if (settings->verbose) { - printf ("vibrance: p0=%1.2f p1=%1.2f p2=%1.2f s0=%1.2f s1=%1.2f s2=%1.2f\n", p0, p1, p2, s0, s1, s2); - printf (" pastel=%f satur=%f limit= %1.2f chromamean=%0.5f\n", 1.0f + chromaPastel, 1.0f + chromaSatur, limitpastelsatur, chromamean); - } - #pragma omp parallel if (multiThread) { diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index a1484cdf6..34ad7a545 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -760,12 +760,13 @@ void XMLCALL rtengine::LCPProfile::XmlStartHandler(void* pLCPProfile, const char ++src; } - strcpy(pProf->lastTag, src); - + strncpy(pProf->lastTag, src, sizeof(pProf->lastTag) - 1); + pProf->lastTag[sizeof(pProf->lastTag) - 1] = 0; const std::string src_str = src; if (src_str == "VignetteModelPiecewiseParam") { - strcpy(pProf->inInvalidTag, src); + strncpy(pProf->inInvalidTag, src, sizeof(pProf->inInvalidTag) - 1); + pProf->inInvalidTag[sizeof(pProf->inInvalidTag) - 1] = 0; } if (src_str == "CameraProfiles") { @@ -931,7 +932,12 @@ std::shared_ptr rtengine::LCPStore::getProfile(const Glib: std::shared_ptr res; if (!cache.get(filename, res)) { - res.reset(new LCPProfile(filename)); + try { + res.reset(new LCPProfile(filename)); + } catch (...) { + return nullptr; + } + cache.set(filename, res); } diff --git a/rtengine/lcp.h b/rtengine/lcp.h index b50fd335e..d588ac381 100644 --- a/rtengine/lcp.h +++ b/rtengine/lcp.h @@ -131,8 +131,8 @@ private: bool inPerspect; bool inAlternateLensID; bool inAlternateLensNames; - char lastTag[256]; - char inInvalidTag[256]; + char lastTag[257]; + char inInvalidTag[257]; LCPPersModel* pCurPersModel; LCPModelCommon* pCurCommon; diff --git a/rtengine/lj92.c b/rtengine/lj92.c index cfdae6bf9..c4f1cc15c 100644 --- a/rtengine/lj92.c +++ b/rtengine/lj92.c @@ -89,7 +89,7 @@ static int parseHuff(ljp* self) { u8* huffhead = &self->data[self->ix]; // xstruct.unpack('>HB16B',self.data[self.ix:self.ix+19]) u8* bits = &huffhead[2]; bits[0] = 0; // Because table starts from 1 - int hufflen = BEH(huffhead[0]); + unsigned int hufflen = BEH(huffhead[0]); if ((self->ix + hufflen) >= self->datalen) return ret; #ifdef SLOW_HUFF u8* huffval = calloc(hufflen - 19,sizeof(u8)); @@ -546,8 +546,10 @@ static int parseScan(ljp* self) { Px = left + lastrow[col] - lastrow[col-1];break; case 5: Px = left + ((lastrow[col] - lastrow[col-1])>>1);break; + /* case 6 has a shortcut above case 6: Px = lastrow[col] + ((left - lastrow[col-1])>>1);break; + */ case 7: Px = (left + lastrow[col])>>1;break; } diff --git a/rtengine/pdaflinesfilter.cc b/rtengine/pdaflinesfilter.cc index 92fd68b41..86c6f2d4c 100644 --- a/rtengine/pdaflinesfilter.cc +++ b/rtengine/pdaflinesfilter.cc @@ -151,12 +151,10 @@ public: if (it > pattern_.begin()) { int b2 = *(it-1); int d2 = key - b2; - float f = BORDER[std::min(std::min(d, d2), BORDER_WIDTH)]; - return f; - } else { - float f = BORDER[std::min(d, BORDER_WIDTH)]; - return f; + d = std::min(d, d2); } + float f = (d <= BORDER_WIDTH) ? BORDER[d] : 0.f; + return f; } return 0.f; } @@ -173,7 +171,8 @@ private: PDAFLinesFilter::PDAFLinesFilter(RawImage *ri): ri_(ri), W_(ri->get_width()), - H_(ri->get_height()) + H_(ri->get_height()), + offset_(0) { gthresh_ = new PDAFGreenEqulibrateThreshold(W_, H_); diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index 3c982c8b1..7ab2e5e7b 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -480,13 +480,13 @@ int RawImage::loadRaw(bool loadData, unsigned int imageNum, bool closeFile, Prog iwidth = width; if (filters || colors == 1) { - raw_image = (ushort *) calloc((raw_height + 7) * raw_width, 2); + raw_image = (ushort *) calloc ((static_cast(raw_height) + 7u) * static_cast(raw_width), 2); merror(raw_image, "main()"); } // dcraw needs this global variable to hold pixel data - image = (dcrawImage_t)calloc(height * width * sizeof * image + meta_length, 1); - meta_data = (char *)(image + height * width); + image = (dcrawImage_t)calloc (static_cast(height) * static_cast(width) * sizeof * image + meta_length, 1); + meta_data = (char *) (image + static_cast(height) * static_cast(width)); if (!image) { return 200; @@ -675,7 +675,7 @@ int RawImage::loadRaw(bool loadData, unsigned int imageNum, bool closeFile, Prog return 0; } -float** RawImage::compress_image(int frameNum, bool freeImage) +float** RawImage::compress_image(unsigned int frameNum, bool freeImage) { if (!image) { return nullptr; @@ -684,7 +684,7 @@ float** RawImage::compress_image(int frameNum, bool freeImage) if (isBayer() || isXtrans()) { if (!allocation) { // shift the beginning of all frames but the first by 32 floats to avoid cache miss conflicts on CPUs which have <= 4-way associative L1-Cache - allocation = new float[height * width + frameNum * 32]; + allocation = new float[static_cast(height) * static_cast(width) + frameNum * 32u]; data = new float*[height]; for (int i = 0; i < height; i++) { diff --git a/rtengine/rawimage.h b/rtengine/rawimage.h index 7d654359f..2cd406fec 100644 --- a/rtengine/rawimage.h +++ b/rtengine/rawimage.h @@ -121,7 +121,7 @@ public: { return image; } - float** compress_image(int frameNum, bool freeImage = true); // revert to compressed pixels format and release image data + float** compress_image(unsigned int frameNum, bool freeImage = true); // revert to compressed pixels format and release image data float** data; // holds pixel values, data[i][j] corresponds to the ith row and jth column unsigned prefilters; // original filters saved ( used for 4 color processing ) unsigned int getFrameCount() const diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index f0e5f1880..4db368b7b 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -895,6 +895,10 @@ void RawImageSource::getImage(const ColorTemp &ctemp, int tran, Imagefloat* imag DCPProfile *RawImageSource::getDCP(const ColorManagementParams &cmp, DCPProfile::ApplyState &as) { + if (cmp.inputProfile == "(camera)" || cmp.inputProfile == "(none)") { + return nullptr; + } + DCPProfile *dcpProf = nullptr; cmsHPROFILE dummy; findInputProfile(cmp.inputProfile, nullptr, (static_cast(getMetaData()))->getCamera(), &dcpProf, dummy); @@ -2832,7 +2836,7 @@ void RawImageSource::flushRGB() } } -void RawImageSource::HLRecovery_Global(ToneCurveParams hrp) +void RawImageSource::HLRecovery_Global(const ToneCurveParams &hrp) { if (hrp.hrenabled && hrp.method == "Color") { if (!rgbSourceModified) { @@ -3243,10 +3247,10 @@ void RawImageSource::copyOriginalPixels(const RAWParams &raw, RawImage *src, Raw } } -void RawImageSource::cfaboxblur(RawImage *riFlatFile, float* cfablur, const int boxH, const int boxW) +void RawImageSource::cfaboxblur(RawImage *riFlatFile, float* cfablur, int boxH, int boxW) { - if (boxW == 0 && boxH == 0) { // nothing to blur + if (boxW < 0 || boxH < 0 || (boxW == 0 && boxH == 0)) { // nothing to blur or negative values memcpy(cfablur, riFlatFile->data[0], W * H * sizeof(float)); return; } diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index df6cd7a9d..2e96c97ae 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -122,7 +122,7 @@ public: void retinexPrepareBuffers(const ColorManagementParams& cmp, const RetinexParams &retinexParams, multi_array2D &conversionBuffer, LUTu &lhist16RETI); void flushRawData(); void flushRGB(); - void HLRecovery_Global(ToneCurveParams hrp); + void HLRecovery_Global (const ToneCurveParams &hrp); void refinement_lassus(int PassCount); void refinement(int PassCount); void setBorder(unsigned int rawBorder) {border = rawBorder;} diff --git a/rtengine/rtlensfun.cc b/rtengine/rtlensfun.cc index 50b3c8a66..4856909f7 100644 --- a/rtengine/rtlensfun.cc +++ b/rtengine/rtlensfun.cc @@ -501,7 +501,6 @@ std::unique_ptr LFDatabase::getModifier(const LFCamera &camera, cons std::unique_ptr LFDatabase::findModifier(const LensProfParams &lensProf, const FramesMetaData *idata, int width, int height, const CoarseTransformParams &coarse, int rawRotationDeg) { - const LFDatabase *db = getInstance(); Glib::ustring make, model, lens; float focallen = idata->getFocalLen(); if (lensProf.lfAutoMatch()) { @@ -516,6 +515,11 @@ std::unique_ptr LFDatabase::findModifier(const LensProfParams &lensP model = lensProf.lfCameraModel; lens = lensProf.lfLens; } + if (make.empty() || model.empty() || lens.empty()) { + return nullptr; + } + + const LFDatabase *db = getInstance(); LFCamera c = db->findCamera(make, model); LFLens l = db->findLens(lensProf.lfAutoMatch() ? c : LFCamera(), lens); if (focallen <= 0 && l.data_ && l.data_->MinFocal == l.data_->MaxFocal) { diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 16c1180d4..546a61078 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -421,7 +421,9 @@ Thumbnail* Thumbnail::loadQuickFromRaw (const Glib::ustring& fname, RawMetaDataL // did we succeed? if ( err ) { - printf ("Could not extract thumb from %s\n", fname.data()); + if (options.rtSettings.verbose) { + std::cout << "Could not extract thumb from " << fname.c_str() << std::endl; + } delete tpp; delete img; delete ri; @@ -1933,46 +1935,53 @@ bool Thumbnail::readImage (const Glib::ustring& fname) Glib::ustring fullFName = fname + ".rtti"; - if (!Glib::file_test (fullFName, Glib::FILE_TEST_EXISTS)) { + if (!Glib::file_test(fullFName, Glib::FILE_TEST_EXISTS)) { return false; } - FILE* f = g_fopen (fullFName.c_str (), "rb"); + FILE* f = g_fopen(fullFName.c_str (), "rb"); if (!f) { return false; } char imgType[31]; // 30 -> arbitrary size, but should be enough for all image type's name - fgets (imgType, 30, f); - imgType[strlen (imgType) - 1] = '\0'; // imgType has a \n trailing character, so we overwrite it by the \0 char + fgets(imgType, 30, f); + imgType[strlen(imgType) - 1] = '\0'; // imgType has a \n trailing character, so we overwrite it by the \0 char guint32 width, height; - fread (&width, 1, sizeof (guint32), f); - fread (&height, 1, sizeof (guint32), f); + + if (fread(&width, 1, sizeof(guint32), f) < sizeof(guint32)) { + width = 0; + } + + if (fread(&height, 1, sizeof(guint32), f) < sizeof(guint32)) { + height = 0; + } bool success = false; - if (!strcmp (imgType, sImage8)) { - Image8 *image = new Image8 (width, height); - image->readData (f); - thumbImg = image; - success = true; - } else if (!strcmp (imgType, sImage16)) { - Image16 *image = new Image16 (width, height); - image->readData (f); - thumbImg = image; - success = true; - } else if (!strcmp (imgType, sImagefloat)) { - Imagefloat *image = new Imagefloat (width, height); - image->readData (f); - thumbImg = image; - success = true; - } else { - printf ("readImage: Unsupported image type \"%s\"!\n", imgType); + if (std::min(width , height) > 0) { + if (!strcmp(imgType, sImage8)) { + Image8 *image = new Image8(width, height); + image->readData(f); + thumbImg = image; + success = true; + } else if (!strcmp(imgType, sImage16)) { + Image16 *image = new Image16(width, height); + image->readData(f); + thumbImg = image; + success = true; + } else if (!strcmp(imgType, sImagefloat)) { + Imagefloat *image = new Imagefloat(width, height); + image->readData(f); + thumbImg = image; + success = true; + } else { + printf ("readImage: Unsupported image type \"%s\"!\n", imgType); + } } - - fclose (f); + fclose(f); return success; } @@ -2190,7 +2199,7 @@ bool Thumbnail::readEmbProfile (const Glib::ustring& fname) if (!fseek (f, 0, SEEK_SET)) { embProfileData = new unsigned char[embProfileLength]; - fread (embProfileData, 1, embProfileLength, f); + embProfileLength = fread (embProfileData, 1, embProfileLength, f); embProfile = cmsOpenProfileFromMem (embProfileData, embProfileLength); } } @@ -2222,14 +2231,19 @@ bool Thumbnail::writeEmbProfile (const Glib::ustring& fname) bool Thumbnail::readAEHistogram (const Glib::ustring& fname) { - FILE* f = g_fopen (fname.c_str (), "rb"); + FILE* f = g_fopen(fname.c_str(), "rb"); if (!f) { aeHistogram.reset(); } else { - aeHistogram (65536 >> aeHistCompression); - fread (&aeHistogram[0], 1, (65536 >> aeHistCompression)*sizeof (aeHistogram[0]), f); + aeHistogram(65536 >> aeHistCompression); + const size_t histoBytes = (65536 >> aeHistCompression) * sizeof(aeHistogram[0]); + const int bytesRead = fread(&aeHistogram[0], 1, histoBytes, f); fclose (f); + if (bytesRead != histoBytes) { + aeHistogram.reset(); + return false; + } return true; } diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 819e30a5d..0262af472 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1378,8 +1378,8 @@ private: Imagefloat* readyImg = nullptr; cmsHPROFILE jprof = nullptr; - bool customGamma = false; - bool useLCMS = false; + constexpr bool customGamma = false; + constexpr bool useLCMS = false; bool bwonly = params.blackwhite.enabled && !params.colorToning.enabled && !autili && !butili ; ///////////// Custom output gamma has been removed, the user now has to create diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index c75995b25..37d438863 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -194,7 +194,7 @@ void StdImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima // the code will use OpenMP as of now. - img->getStdImage(ctemp, tran, image, pp, true, hrp); + img->getStdImage(ctemp, tran, image, pp); // Hombre: we could have rotated the image here too, with just few line of code, but: // 1. it would require other modifications in the engine, so "do not touch that little plonker!" diff --git a/rtexif/canonattribs.cc b/rtexif/canonattribs.cc index 2e2eea676..17ce4f343 100644 --- a/rtexif/canonattribs.cc +++ b/rtexif/canonattribs.cc @@ -567,6 +567,7 @@ public: {6, "Sigma 18-125mm f/3.5-5.6 DC IF ASP"}, {6, "Tokina AF 193-2 19-35mm f/3.5-4.5"}, {6, "Sigma 28-80mm f/3.5-5.6 II Macro"}, + {6, "Sigma 28-300mm f/3.5-6.3 DG Macro"}, {7, "Canon EF 100-300mm f/5.6L"}, {8, "Canon EF 100-300mm f/5.6 or Sigma or Tokina Lens"}, {8, "Sigma 70-300mm f/4-5.6 [APO] DG Macro"}, @@ -656,7 +657,9 @@ public: {82, "Canon TS-E 135mm f/4L Macro"}, {94, "Canon TS-E 17mm f/4L"}, {95, "Canon TS-E 24mm f/3.5L II"}, - {103, "Samyang AF 14mm f/2.8 EF"}, + {103, "Samyang AF 14mm f/2.8 EF or Rokinon Lens"}, + {103, "Rokinon SP 14mm f/2.4"}, + {103, "Rokinon AF 14mm f/2.8 EF"}, {124, "Canon MP-E 65mm f/2.8 1-5x Macro Photo"}, {125, "Canon TS-E 24mm f/3.5L"}, {126, "Canon TS-E 45mm f/2.8"}, @@ -733,7 +736,7 @@ public: {160, "Tokina AT-X 107 AF DX 10-17mm f/3.5-4.5 Fisheye"}, {160, "Tokina AT-X 116 AF Pro DX 11-16mm f/2.8"}, {160, "Tokina AT-X 11-20 F2.8 PRO DX Aspherical 11-20mm f/2.8"}, - {161, "Canon EF 28-70mm f/2.8L USM or Sigma or Tamron Lens"}, + {161, "Canon EF 28-70mm f/2.8L USM or Other Lens"}, {161, "Sigma 24-70mm f/2.8 EX"}, {161, "Sigma 28-70mm f/2.8 EX"}, {161, "Sigma 24-60mm f/2.8 EX DG"}, @@ -741,6 +744,7 @@ public: {161, "Tamron 90mm f/2.8"}, {161, "Tamron SP AF 17-35mm f/2.8-4 Di LD Aspherical IF"}, {161, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical [IF] Macro"}, + {161, "Tokina AT-X 24-70mm f/2.8 PRO FX (IF)"}, {162, "Canon EF 200mm f/2.8L USM"}, {163, "Canon EF 300mm f/4L"}, {164, "Canon EF 400mm f/5.6L"}, @@ -757,6 +761,7 @@ public: {169, "Sigma 85mm f/1.4 EX DG HSM"}, {169, "Sigma 30mm f/1.4 EX DC HSM"}, {169, "Sigma 35mm f/1.4 DG HSM"}, + {169, "Sigma 35mm f/1.5 FF High-Speed Prime | 017"}, {170, "Canon EF 200mm f/2.8L II USM"}, {171, "Canon EF 300mm f/4L USM"}, {172, "Canon EF 400mm f/5.6L USM or Sigma Lens"}, @@ -780,6 +785,9 @@ public: {180, "Zeiss Milvus 50mm f/1.4"}, {180, "Zeiss Milvus 85mm f/1.4"}, {180, "Zeiss Otus 28mm f/1.4 ZE"}, + {180, "Sigma 24mm f/1.5 FF High-Speed Prime | 017"}, + {180, "Sigma 50mm f/1.5 FF High-Speed Prime | 017"}, + {180, "Sigma 85mm f/1.5 FF High-Speed Prime | 017"}, {181, "Canon EF 100-400mm f/4.5-5.6L IS USM + 1.4x or Sigma Lens"}, {181, "Sigma 150-600mm f/5-6.3 DG OS HSM | S + 1.4x"}, {182, "Canon EF 100-400mm f/4.5-5.6L IS USM + 2x or Sigma Lens"}, @@ -791,6 +799,7 @@ public: {183, "Sigma 150-600mm f/5-6.3 DG OS HSM | C"}, {183, "Sigma 150-600mm f/5-6.3 DG OS HSM | S"}, {183, "Sigma 100-400mm f/5-6.3 DG OS HSM"}, + {183, "Sigma 180mm f/3.5 APO Macro EX DG IF HSM"}, {184, "Canon EF 400mm f/2.8L USM + 2x"}, {185, "Canon EF 600mm f/4L IS USM"}, {186, "Canon EF 70-200mm f/4L USM"}, @@ -798,7 +807,8 @@ public: {188, "Canon EF 70-200mm f/4L USM + 2x"}, {189, "Canon EF 70-200mm f/4L USM + 2.8x"}, {190, "Canon EF 100mm f/2.8 Macro USM"}, - {191, "Canon EF 400mm f/4 DO IS"}, + {191, "Canon EF 400mm f/4 DO IS or Sigma Lens"}, + {191, "Sigma 500mm f/4 DG OS HSM"}, {193, "Canon EF 35-80mm f/4-5.6 USM"}, {194, "Canon EF 80-200mm f/4.5-5.6 USM"}, {195, "Canon EF 35-105mm f/4.5-5.6 USM"}, @@ -808,6 +818,7 @@ public: {198, "Canon EF 50mm f/1.4 USM or Zeiss Lens"}, {198, "Zeiss Otus 55mm f/1.4 ZE"}, {198, "Zeiss Otus 85mm f/1.4 ZE"}, + {198, "Zeiss Milvus 25mm f/1.4"}, {199, "Canon EF 28-80mm f/3.5-5.6 USM"}, {200, "Canon EF 75-300mm f/4-5.6 USM"}, {201, "Canon EF 28-80mm f/3.5-5.6 USM"}, @@ -841,8 +852,10 @@ public: {236, "Canon EF-S 60mm f/2.8 Macro USM"}, {237, "Canon EF 24-105mm f/4L IS USM"}, {238, "Canon EF 70-300mm f/4-5.6 IS USM"}, - {239, "Canon EF 85mm f/1.2L II USM"}, - {240, "Canon EF-S 17-55mm f/2.8 IS USM"}, + {239, "Canon EF 85mm f/1.2L II USM or Rokinon Lens"}, + {239, "Rokinon SP 85mm f/1.2"}, + {240, "Canon EF-S 17-55mm f/2.8 IS USM or Sigma Lens"}, + {240, "Sigma 17-50mm f/2.8 EX DC OS HSM"}, {241, "Canon EF 50mm f/1.2L USM"}, {242, "Canon EF 70-200mm f/4L IS USM"}, {243, "Canon EF 70-200mm f/4L IS USM + 1.4x"}, @@ -852,16 +865,23 @@ public: {247, "Canon EF 14mm f/2.8L II USM"}, {248, "Canon EF 200mm f/2L IS USM or Sigma Lens"}, {248, "Sigma 24-35mm f/2 DG HSM | A"}, + {248, "Sigma 135mm f/2 FF High-Speed Prime | 017"}, + {248, "Sigma 24-35mm f/2.2 FF Zoom | 017"}, {249, "Canon EF 800mm f/5.6L IS USM"}, {250, "Canon EF 24mm f/1.4L II USM or Sigma Lens"}, {250, "Sigma 20mm f/1.4 DG HSM | A"}, + {250, "Sigma 20mm f/1.5 FF High-Speed Prime | 017"}, {251, "Canon EF 70-200mm f/2.8L IS II USM"}, {252, "Canon EF 70-200mm f/2.8L IS II USM + 1.4x"}, {253, "Canon EF 70-200mm f/2.8L IS II USM + 2x"}, {254, "Canon EF 100mm f/2.8L Macro IS USM"}, {255, "Sigma 24-105mm f/4 DG OS HSM | A or Other Sigma Lens"}, {255, "Sigma 180mm f/2.8 EX DG OS HSM APO Macro"}, - {368, "Sigma 14-24mm f/2.8 DG HSM | A"}, + {368, "Sigma 14-24mm f/2.8 DG HSM | A or other Sigma Lens"}, + {368, "Sigma 20mm f/1.4 DG HSM | A"}, + {368, "Sigma 50mm f/1.4 DG HSM | A"}, + {368, "Sigma 40mm f/1.4 DG HSM | A"}, + {368, "Sigma 60-600mm f/4.5-6.3 DG OS HSM | S"}, {488, "Canon EF-S 15-85mm f/3.5-5.6 IS USM"}, {489, "Canon EF 70-300mm f/4-5.6L IS USM"}, {490, "Canon EF 8-15mm f/4L Fisheye USM"}, @@ -869,6 +889,9 @@ public: {491, "Tamron SP 70-200mm f/2.8 Di VC USD G2 (A025)"}, {491, "Tamron 18-400mm f/3.5-6.3 Di II VC HLD (B028)"}, {491, "Tamron 100-400mm f/4.5-6.3 Di VC USD (A035)"}, + {491, "Tamron 70-210mm f/4 Di VC USD (A034)"}, + {491, "Tamron 70-210mm f/4 Di VC USD (A034) + 1.4x"}, + {491, "Tamron SP 24-70mm f/2.8 Di VC USD G2 (A032)"}, {492, "Canon EF 400mm f/2.8L IS II USM"}, {493, "Canon EF 500mm f/4L IS II USM or EF 24-105mm f4L IS USM"}, {493, "Canon EF 24-105mm f/4L IS USM"}, @@ -887,11 +910,18 @@ public: {508, "Tamron 10-24mm f/3.5-4.5 Di II VC HLD"}, {747, "Canon EF 100-400mm f/4.5-5.6L IS II USM or Tamron Lens"}, {747, "Tamron SP 150-600mm f/5-6.3 Di VC USD G2"}, - {748, "Canon EF 100-400mm f/4.5-5.6L IS II USM + 1.4x"}, + {748, "Canon EF 100-400mm f/4.5-5.6L IS II USM + 1.4x or Tamron Lens"}, + {748, "Tamron 100-400mm f/4.5-6.3 Di VC USD A035E + 1.4x"}, + {748, "Tamron 70-210mm f/4 Di VC USD (A034) + 2x"}, + {749, "Tamron 100-400mm f/4.5-6.3 Di VC USD A035E + 2x"}, {750, "Canon EF 35mm f/1.4L II USM"}, {751, "Canon EF 16-35mm f/2.8L III USM"}, {752, "Canon EF 24-105mm f/4L IS II USM"}, {753, "Canon EF 85mm f/1.4L IS USM"}, + {754, "Canon EF 70-200mm f/4L IS II USM"}, + {757, "Canon EF 400mm f/2.8L IS III USM"}, + {758, "Canon EF 600mm f/4L IS III USM"}, + {1136, "Sigma 24-70mm f/2.8 DG OS HSM | Art 017"}, {4142, "Canon EF-S 18-135mm f/3.5-5.6 IS STM"}, {4143, "Canon EF-M 18-55mm f/3.5-5.6 IS STM or Tamron Lens"}, {4143, "Tamron 18-200mm f/3.5-6.3 Di III VC"}, @@ -909,9 +939,14 @@ public: {4156, "Canon EF 50mm f/1.8 STM"}, {4157, "Canon EF-M 18-150mm 1:3.5-6.3 IS STM"}, {4158, "Canon EF-S 18-55mm f/4-5.6 IS STM"}, + {4159, "Canon EF-M 32mm f/1.4 STM"}, {4160, "Canon EF-S 35mm f/2.8 Macro IS STM"}, {36910, "Canon EF 70-300mm f/4-5.6 IS II USM"}, {36912, "Canon EF-S 18-135mm f/3.5-5.6 IS USM"}, + {61182, "Canon RF 35mm F1.8 Macro IS STM or other Canon RF Lens"}, + {61182, "Canon RF 50mm F1.2 L USM"}, + {61182, "Canon RF 24-105mm F4 L IS USM"}, + {61182, "Canon RF 28-70mm F2 L USM"}, {61491, "Canon CN-E 14mm T3.1 L F"}, {61492, "Canon CN-E 24mm T1.5 L F"}, {61494, "Canon CN-E 85mm T1.3 L F"}, @@ -1477,6 +1512,8 @@ public: CAModelIDInterpreter () { choices[1042] = "EOS M50 / Kiss M"; + choices[2049] = "PowerShot SX740 HS"; + choices[2053] = "PowerShot SX70 HS"; choices[16842752] = "PowerShot A30"; choices[17039360] = "PowerShot S300 / Digital IXUS 300 / IXY Digital 300"; choices[17170432] = "PowerShot A20"; @@ -1799,6 +1836,7 @@ public: choices[2147484680] = "EOS 77D / 9000D"; choices[2147484695] = "EOS Rebel SL2 / 200D / Kiss X9"; choices[2147484706] = "EOS Rebel T100 / 4000D / 3000D"; + choices[2147484708] = "EOR R"; choices[2147484722] = "EOS Rebel T7 / 2000D / 1500D / Kiss X90"; } }; diff --git a/rtexif/kodakattribs.cc b/rtexif/kodakattribs.cc index 1b6e522c5..a9c168a70 100644 --- a/rtexif/kodakattribs.cc +++ b/rtexif/kodakattribs.cc @@ -104,12 +104,11 @@ void parseKodakIfdTextualInfo (Tag *textualInfo, Tag* exif_) a = atoi (val.c_str()); b = atoi (&p1[1]); } - t = new Tag (exif, lookupAttrib (exifAttribs, "ExposureTime")); t->initRational (a, b); exif->replaceTag (t); - float ssv = -log2 ((float)a / (float)b); // convert to APEX value + const float ssv = -log2 ((float)a / std::max((float)b, 0.0001f)); // convert to APEX value, avoid division by zero t = new Tag (exif, lookupAttrib (exifAttribs, "ShutterSpeedValue")); t->initRational (1000000 * ssv, 1000000); exif->replaceTag (t); diff --git a/rtexif/nikonattribs.cc b/rtexif/nikonattribs.cc index fc0fc22db..e534f8123 100644 --- a/rtexif/nikonattribs.cc +++ b/rtexif/nikonattribs.cc @@ -850,7 +850,9 @@ const std::map NALensDataInterpreter::lenses = { {"49 3C A6 A6 30 30 F2 02", "AF-S Nikkor 600mm f/4D IF-ED + TC-20E"}, {"4A 40 11 11 2C 0C 4D 02", "Samyang 8mm f/3.5 Fish-Eye CS"}, {"4A 48 1E 1E 24 0C 4D 02", "Samyang 12mm f/2.8 ED AS NCS Fish-Eye"}, + {"4A 48 24 24 24 0C 4D 02", "Samyang 10mm f/2.8 ED AS NCS CS"}, {"4A 48 24 24 24 0C 4D 02", "Samyang AE 14mm f/2.8 ED AS IF UMC"}, + {"4A 4C 24 24 1E 6C 4D 06", "Samyang 14mm f/2.4 Premium"}, {"4A 54 29 29 18 0C 4D 02", "Samyang 16mm f/2.0 ED AS UMC CS"}, {"4A 54 62 62 0C 0C 4D 02", "AF Nikkor 85mm f/1.4D IF"}, {"4A 60 36 36 0C 0C 4D 02", "Samyang 24mm f/1.4 ED AS UMC"}, @@ -910,7 +912,7 @@ const std::map NALensDataInterpreter::lenses = { {"74 40 37 62 2C 34 78 06", "AF-S Zoom-Nikkor 24-85mm f/3.5-4.5G IF-ED"}, {"75 40 3C 68 2C 3C 79 06", "AF Zoom-Nikkor 28-100mm f/3.5-5.6G"}, {"76 58 50 50 14 14 7A 02", "AF Nikkor 50mm f/1.8D"}, - {"77 44 60 98 34 3C 7B 0E", "Sigma 80-400mm f4.5-5.6 APO DG D OS"}, + {"77 44 60 98 34 3C 7B 0E", "Sigma 80-400mm f/4.5-5.6 APO DG D OS"}, {"77 44 61 98 34 3C 7B 0E", "Sigma 80-400mm f/4.5-5.6 EX OS"}, {"77 48 5C 80 24 24 7B 0E", "AF-S VR Zoom-Nikkor 70-200mm f/2.8G IF-ED"}, {"78 40 37 6E 2C 3C 7C 0E", "AF-S VR Zoom-Nikkor 24-120mm f/3.5-5.6G IF-ED"}, @@ -953,6 +955,7 @@ const std::map NALensDataInterpreter::lenses = { {"8B 4C 2D 44 14 14 4B 06", "Sigma 18-35mm f/1.8 DC HSM"}, {"8C 40 2D 53 2C 3C 8E 06", "AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G ED"}, {"8D 44 5C 8E 34 3C 8F 0E", "AF-S VR Zoom-Nikkor 70-300mm f/4.5-5.6G IF-ED"}, + {"8D 48 6E 8E 24 24 4B 0E", "Sigma 120-300mm f/2.8 DG OS HSM Sports"}, {"8E 3C 2B 5C 24 30 4B 0E", "Sigma 17-70mm f/2.8-4 DC Macro OS HSM | C"}, {"8F 40 2D 72 2C 3C 91 06", "AF-S DX Zoom-Nikkor 18-135mm f/3.5-5.6G IF-ED"}, {"8F 48 2B 50 24 24 4B 0E", "Sigma 17-50mm f/2.8 EX DC OS HSM"}, @@ -963,7 +966,7 @@ const std::map NALensDataInterpreter::lenses = { {"92 48 24 37 24 24 94 06", "AF-S Zoom-Nikkor 14-24mm f/2.8G ED"}, {"93 48 37 5C 24 24 95 06", "AF-S Zoom-Nikkor 24-70mm f/2.8G ED"}, {"94 40 2D 53 2C 3C 96 06", "AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G ED II"}, - {"94 48 7C 7C 24 24 4B 0E", "Sigma 180mm f/2.8 APO Macro EX DG OS"}, + {"94 48 7C 7C 24 24 4B 0E", "Sigma APO Macro 180mm f/2.8 EX DG OS HSM"}, {"95 00 37 37 2C 2C 97 06", "PC-E Nikkor 24mm f/3.5D ED"}, {"95 4C 37 37 2C 2C 97 02", "PC-E Nikkor 24mm f/3.5D ED"}, {"96 38 1F 37 34 3C 4B 06", "Sigma 12-24mm f/4.5-5.6 II DG HSM"}, @@ -975,6 +978,7 @@ const std::map NALensDataInterpreter::lenses = { {"99 40 29 62 2C 3C 9B 0E", "AF-S DX VR Zoom-Nikkor 16-85mm f/3.5-5.6G ED"}, {"99 48 76 76 24 24 4B 0E", "Sigma APO Macro 150mm f/2.8 EX DG OS HSM"}, {"9A 40 2D 53 2C 3C 9C 0E", "AF-S DX VR Zoom-Nikkor 18-55mm f/3.5-5.6G"}, + {"9A 4C 50 50 14 14 9C 06", "Yongnuo YN50mm f/1.8N"}, {"9B 00 4C 4C 24 24 9D 06", "PC-E Micro Nikkor 45mm f/2.8D ED"}, {"9B 54 4C 4C 24 24 9D 02", "PC-E Micro Nikkor 45mm f/2.8D ED"}, {"9B 54 62 62 0C 0C 4B 06", "Sigma 85mm f/1.4 EX DG HSM"}, @@ -997,37 +1001,54 @@ const std::map NALensDataInterpreter::lenses = { {"A1 54 55 55 0C 0C BC 06", "AF-S Nikkor 58mm f/1.4G"}, {"A2 40 2D 53 2C 3C BD 0E", "AF-S DX Nikkor 18-55mm f/3.5-5.6G VR II"}, {"A2 48 5C 80 24 24 A4 0E", "AF-S Nikkor 70-200mm f/2.8G ED VR II"}, + {"A3 38 5C 8E 34 40 CE 0E", "AF-P DX Nikkor 70-300mm f/4.5-6.3G ED"}, + {"A3 38 5C 8E 34 40 CE 8E", "AF-P DX Nikkor 70-300mm f/4.5-6.3G ED VR"}, {"A3 3C 29 44 30 30 A5 0E", "AF-S Nikkor 16-35mm f/4G ED VR"}, {"A3 3C 5C 8E 30 3C 4B 0E", "Sigma 70-300mm f/4-5.6 DG OS"}, {"A4 40 2D 8E 2C 40 BF 0E", "AF-S DX Nikkor 18-300mm f/3.5-6.3G ED VR"}, {"A4 47 2D 50 24 34 4B 0E", "Sigma 18-50mm f/2.8-4.5 DC OS HSM"}, {"A4 48 5C 80 24 24 CF 0E", "AF-S Nikkor 70-200mm f/2.8E FL ED VR"}, + {"A4 48 5C 80 24 24 CF 4E", "AF-S Nikkor 70-200mm f/2.8E FL ED VR"}, {"A4 54 37 37 0C 0C A6 06", "AF-S Nikkor 24mm f/1.4G ED"}, {"A5 40 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC OS HSM"}, {"A5 40 3C 8E 2C 3C A7 0E", "AF-S Nikkor 28-300mm f/3.5-5.6G ED VR"}, {"A5 4C 44 44 14 14 C0 06", "AF-S Nikkor 35mm f/1.8G ED"}, {"A5 54 6A 6A 0C 0C D0 06", "AF-S Nikkor 105mm f/1.4E ED"}, {"A5 54 6A 6A 0C 0C D0 46", "AF-S Nikkor 105mm f/1.4E ED"}, + {"A6 48 2F 2F 30 30 D1 06", "PC Nikkor 19mm f/4E ED"}, + {"A6 48 2F 2F 30 30 D1 46", "PC Nikkor 19mm f/4E ED"}, {"A6 48 37 5C 24 24 4B 06", "Sigma 24-70mm f/2.8 IF EX DG HSM"}, - {"A6 48 8E 8E 24 24 A8 0E", "AF-S VR Nikkor 300mm f/2.8G IF-ED II"}, + {"A6 48 8E 8E 24 24 A8 0E", "AF-S Nikkor 300mm f/2.8G IF-ED VR II"}, {"A6 48 98 98 24 24 C1 0E", "AF-S Nikkor 400mm f/2.8E FL ED VR"}, {"A7 3C 53 80 30 3C C2 0E", "AF-S DX Nikkor 55-200mm f/4-5.6G ED VR II"}, + {"A7 40 11 26 2C 34 D2 06", "AF-S Fisheye Nikkor 8-15mm f/3.5-4.5E ED"}, + {"A7 40 11 26 2C 34 D2 46", "AF-S Fisheye Nikkor 8-15mm f/3.5-4.5E ED"}, {"A7 49 80 A0 24 24 4B 06", "Sigma APO 200-500mm f/2.8 EX DG"}, {"A7 4B 62 62 2C 2C A9 0E", "AF-S DX Micro Nikkor 85mm f/3.5G ED VR"}, + {"A8 38 18 30 34 3C D3 0E", "AF-P DX Nikkor 10-20mm f/4.5-5.6G VR"}, {"A8 38 18 30 34 3C D3 8E", "AF-P DX Nikkor 10-20mm f/4.5-5.6G VR"}, - {"A8 48 80 98 30 30 AA 0E", "AF-S VR Zoom-Nikkor 200-400mm f/4G IF-ED II"}, + {"A8 48 80 98 30 30 AA 0E", "AF-S Zoom-Nikkor 200-400mm f/4G IF-ED VR II"}, {"A8 48 8E 8E 30 30 C3 0E", "AF-S Nikkor 300mm f/4E PF ED VR"}, {"A8 48 8E 8E 30 30 C3 4E", "AF-S Nikkor 300mm f/4E PF ED VR"}, + {"A9 48 7C 98 30 30 D4 0E", "AF-S Nikkor 180-400mm f/4E TC1.4 FL ED VR"}, {"A9 48 7C 98 30 30 D4 4E", "AF-S Nikkor 180-400mm f/4E TC1.4 FL ED VR"}, {"A9 4C 31 31 14 14 C4 06", "AF-S Nikkor 20mm f/1.8G ED"}, {"A9 54 80 80 18 18 AB 0E", "AF-S Nikkor 200mm f/2G ED VR II"}, {"AA 3C 37 6E 30 30 AC 0E", "AF-S Nikkor 24-120mm f/4G ED VR"}, + {"AA 48 37 5C 24 24 C5 0E", "AF-S Nikkor 24-70mm f/2.8E ED VR"}, {"AA 48 37 5C 24 24 C5 4E", "AF-S Nikkor 24-70mm f/2.8E ED VR"}, + {"AA 48 88 A4 3C 3C D5 0E", "AF-S Nikkor 180-400mm f/4E TC1.4 FL ED VR + 1.4x TC"}, {"AA 48 88 A4 3C 3C D5 4E", "AF-S Nikkor 180-400mm f/4E TC1.4 FL ED VR + 1.4x TC"}, {"AB 3C A0 A0 30 30 C6 4E", "AF-S Nikkor 500mm f/4E FL ED VR"}, - {"AC 38 53 8E 34 3C AE 0E", "AF-S DX VR Nikkor 55-300mm f/4.5-5.6G ED"}, + {"AB 44 5C 8E 34 3C D6 0E", "AF-P Nikkor 70-300mm f/4.5-5.6E ED VR"}, + {"AB 44 5C 8E 34 3C D6 CE", "AF-P Nikkor 70-300mm f/4.5-5.6E ED VR"}, + {"AC 38 53 8E 34 3C AE 0E", "AF-S DX Nikkor 55-300mm f/4.5-5.6G ED VR"}, {"AC 3C A6 A6 30 30 C7 4E", "AF-S Nikkor 600mm f/4E FL ED VR"}, + {"AC 54 3C 3C 0C 0C D7 06", "AF-S Nikkor 28mm f/1.4E ED"}, + {"AC 54 3C 3C 0C 0C D7 46", "AF-S Nikkor 28mm f/1.4E ED"}, {"AD 3C 2D 8E 2C 3C AF 0E", "AF-S DX Nikkor 18-300mm f/3.5-5.6G ED VR"}, + {"AD 3C A0 A0 3C 3C D8 0E", "AF-S Nikkor 500mm f/5.6E PF ED VR"}, + {"AD 3C A0 A0 3C 3C D8 4E", "AF-S Nikkor 500mm f/5.6E PF ED VR"}, {"AD 48 28 60 24 30 C8 0E", "AF-S DX Nikkor 16-80mm f/2.8-4E ED VR"}, {"AD 48 28 60 24 30 C8 4E", "AF-S DX Nikkor 16-80mm f/2.8-4E ED VR"}, {"AE 3C 80 A0 3C 3C C9 0E", "AF-S Nikkor 200-500mm f/5.6E ED VR"}, @@ -1039,7 +1060,7 @@ const std::map NALensDataInterpreter::lenses = { {"B1 48 48 48 24 24 B3 06", "AF-S DX Micro Nikkor 40mm f/2.8G"}, {"B2 48 5C 80 30 30 B4 0E", "AF-S Nikkor 70-200mm f/4G ED VR"}, {"B3 4C 62 62 14 14 B5 06", "AF-S Nikkor 85mm f/1.8G"}, - {"B4 40 37 62 2C 34 B6 0E", "AF-S VR Zoom-Nikkor 24-85mm f/3.5-4.5G IF-ED"}, + {"B4 40 37 62 2C 34 B6 0E", "AF-S Zoom-Nikkor 24-85mm f/3.5-4.5G IF-ED VR"}, {"B5 4C 3C 3C 14 14 B7 06", "AF-S Nikkor 28mm f/1.8G"}, {"B6 3C B0 B0 3C 3C B8 0E", "AF-S VR Nikkor 800mm f/5.6E FL ED"}, {"B6 3C B0 B0 3C 3C B8 4E", "AF-S VR Nikkor 800mm f/5.6E FL ED"}, @@ -1048,8 +1069,11 @@ const std::map NALensDataInterpreter::lenses = { {"B8 40 2D 44 2C 34 BA 06", "AF-S Nikkor 18-35mm f/3.5-4.5G ED"}, {"BF 3C 1B 1B 30 30 01 04", "Irix 11mm f/4 Firefly"}, {"BF 4E 26 26 1E 1E 01 04", "Irix 15mm f/2.4 Firefly"}, + {"C1 48 24 37 24 24 4B 46", "Sigma 14-24mm f/2.8 DG HSM | A"}, + {"C2 4C 24 24 14 14 4B 06", "Sigma 14mm f/1.8 DG HSM | A"}, {"C3 34 68 98 38 40 4B 4E", "Sigma 100-400mm f/5-6.3 DG OS HSM | C"}, {"C8 54 62 62 0C 0C 4B 46", "Sigma 85mm f/1.4 DG HSM | A"}, + {"C9 48 37 5C 24 24 4B 4E", "Sigma 24-70mm f/2.8 DG OS HSM | A"}, {"CC 4C 50 68 14 14 4B 06", "Sigma 50-100mm f/1.8 DC HSM | A"}, {"CD 3D 2D 70 2E 3C 4B 0E", "Sigma 18-125mm f/3.8-5.6 DC OS HSM"}, {"CE 34 76 A0 38 40 4B 0E", "Sigma 150-500mm f/5-6.3 DG OS APO HSM"}, @@ -1058,7 +1082,10 @@ const std::map NALensDataInterpreter::lenses = { {"DC 48 19 19 24 24 4B 06", "Sigma 10mm f/2.8 EX DC HSM Fisheye"}, {"DE 54 50 50 0C 0C 4B 06", "Sigma 50mm f/1.4 EX DG HSM"}, {"E0 3C 5C 8E 30 3C 4B 06", "Sigma 70-300mm f/4-5.6 APO DG Macro HSM"}, + {"E0 40 2D 98 2C 41 DF 4E", "Tamron AF 18-400mm f/3.5-6.3 Di II VC HLD (B028)"}, + {"E1 40 19 36 2C 35 DF 4E", "Tamron 10-24mm f/3.5-4.5 Di II VC HLD (B023)"}, {"E1 58 37 37 14 14 1C 02", "Sigma 24mm f/1.8 EX DG Aspherical Macro"}, + {"E2 47 5C 80 24 24 DF 4E", "Tamron SP 70-200mm f/2.8 Di VC USD G2 (A025)"}, {"E3 40 76 A6 38 40 DF 4E", "Tamron SP 150-600mm f/5-6.3 Di VC USD G2"}, {"E3 54 50 50 24 24 35 02", "Sigma Macro 50mm f/2.8 EX DG"}, {"E4 54 64 64 24 24 DF 0E", "Tamron SP 90mm f/2.8 Di VC USD Macro 1:1 (F017)"}, diff --git a/rtexif/pentaxattribs.cc b/rtexif/pentaxattribs.cc index 4d9a31b6f..0968271e5 100644 --- a/rtexif/pentaxattribs.cc +++ b/rtexif/pentaxattribs.cc @@ -937,6 +937,7 @@ public: choices.insert (p_t (256 * 8 + 61, "HD PENTAX-D FA 28-105mm f/3.5-5.6 ED DC WR")); choices.insert (p_t (256 * 8 + 62, "HD PENTAX-D FA 24-70mm f/2.8 ED SDM WR")); choices.insert (p_t (256 * 8 + 63, "HD PENTAX-D FA 15-30mm f/2.8 ED SDM WR")); + choices.insert (p_t (256 * 8 + 64, "HD PENTAX-D FA* 50mm f/1.4 SDM AW")); choices.insert (p_t (256 * 8 + 197, "HD PENTAX-DA 55-300mm f/4.5-6.3 ED PLM WR RE")); choices.insert (p_t (256 * 8 + 198, "smc PENTAX-DA L 18-50mm f/4-5.6 DC WR RE")); choices.insert (p_t (256 * 8 + 199, "HD PENTAX-DA 18-50mm f/4-5.6 DC WR RE")); diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index c35ba7e0b..947795c20 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -976,16 +976,19 @@ Tag::Tag (TagDirectory* p, FILE* f, int base) if (tag == 0x002e) { // location of the embedded preview image in raw files of Panasonic cameras ExifManager eManager(f, nullptr, true); - eManager.parseJPEG(ftell(f)); // try to parse the exif data from the preview image + const auto fpos = ftell(f); + if (fpos >= 0) { + eManager.parseJPEG(fpos); // try to parse the exif data from the preview image - if (eManager.roots.size()) { - const TagDirectory* const previewdir = eManager.roots.at(0); - if (previewdir->getTag ("Exif")) { - if (previewdir->getTag ("Make")) { - if (previewdir->getTag ("Make")->valueToString() == "Panasonic") { // "make" is not yet available here, so get it from the preview tags to assure we're doing the right thing - Tag* t = new Tag (parent->getRoot(), lookupAttrib (ifdAttribs, "Exif")); // replace raw exif with preview exif assuming there are the same - t->initSubDir (previewdir->getTag ("Exif")->getDirectory()); - parent->getRoot()->addTag (t); + if (eManager.roots.size()) { + const TagDirectory* const previewdir = eManager.roots.at(0); + if (previewdir->getTag ("Exif")) { + if (previewdir->getTag ("Make")) { + if (previewdir->getTag ("Make")->valueToString() == "Panasonic") { // "make" is not yet available here, so get it from the preview tags to assure we're doing the right thing + Tag* t = new Tag (parent->getRoot(), lookupAttrib (ifdAttribs, "Exif")); // replace raw exif with preview exif assuming there are the same + t->initSubDir (previewdir->getTag ("Exif")->getDirectory()); + parent->getRoot()->addTag (t); + } } } } @@ -2474,7 +2477,7 @@ parse_leafdata (TagDirectory* root, ByteOrder order) char *val = (char *)&value[pos]; if (strncmp (&hdr[8], "CameraObj_ISO_speed", 19) == 0) { - iso_speed = 25 * (1 << (atoi (val) - 1)); + iso_speed = 25 * (1 << std::max((atoi (val) - 1), 0)); found_count++; } else if (strncmp (&hdr[8], "ImgProf_rotation_angle", 22) == 0) { rotation_angle = atoi (val); diff --git a/rtexif/sonyminoltaattribs.cc b/rtexif/sonyminoltaattribs.cc index 834d436f9..76ed788c2 100644 --- a/rtexif/sonyminoltaattribs.cc +++ b/rtexif/sonyminoltaattribs.cc @@ -818,6 +818,7 @@ public: {2672, "Minolta AF 24-105mm f/3.5-4.5 (D)"}, {3046, "Metabones Canon EF Speed Booster"}, {4567, "Tokina 70-210mm f/4-5.6"}, + {4570, "Tamron AF 35-135mm f/3.5-4.5"}, {4571, "Vivitar 70-210mm f/4.5-5.6"}, {4574, "2x Teleconverter or Tamron or Tokina Lens"}, {4574, "Tamron SP AF 90mm f/2.5"}, @@ -851,6 +852,7 @@ public: {6553, "Sony FE 12-24mm f/4 G"}, {6553, "Sony FE 90mm f/2.8 Macro G OSS"}, {6553, "Sony E 18-50mm f/4-5.6"}, + {6553, "Sony FE 24mm f/1.4 GM"}, {6553, "Sony FE 24-105mm f/4 G OSS"}, {6553, "Sony E PZ 18-200mm f/3.5-6.3 OSS"}, {6553, "Sony FE 55mm f/1.8 ZA"}, @@ -874,20 +876,26 @@ public: {6553, "Sony FE 100-400mm f/4.5-5.6 GM OSS"}, {6553, "Sony FE 70-200mm f/2.8 GM OSS"}, {6553, "Sony FE 16-35mm f/2.8 GM"}, + {6553, "Sony FE 400mm f/2.8 GM OSS"}, {6553, "Sony E 18-135mm f/3.5-5.6 OSS"}, {6553, "Sony FE 70-200mm f/2.8 GM OSS + 1.4X Teleconverter"}, {6553, "Sony FE 70-200mm f/2.8 GM OSS + 2X Teleconverter"}, {6553, "Sony FE 100-400mm f/4.5-5.6 GM OSS + 1.4X Teleconverter"}, {6553, "Sony FE 100-400mm f/4.5-5.6 GM OSS + 2X Teleconverter"}, + {6553, "Sony FE 400mm f/2.8 GM OSS + 1.4X Teleconverter"}, + {6553, "Sony FE 400mm f/2.8 GM OSS + 2X Teleconverter"}, {6553, "Samyang AF 50mm f/1.4 FE"}, {6553, "Samyang AF 14mm f/2.8 FE"}, + {6553, "Samyang AF 24mm f/2.8"}, {6553, "Samyang AF 35mm f/2.8 FE"}, {6553, "Samyang AF 35mm f/1.4"}, {6553, "Sigma 19mm f/2.8 [EX] DN"}, {6553, "Sigma 30mm f/2.8 [EX] DN"}, {6553, "Sigma 60mm f/2.8 DN"}, {6553, "Sigma 30mm f/1.4 DC DN | C"}, + {6553, "Sigma 85mm f/1.4 DG HSM | A"}, {6553, "Sigma 16mm f/1.4 DC DN | C"}, + {6553, "Sigma 70mm f/2.8 DG MACRO | A"}, {6553, "Tamron 18-200mm f/3.5-6.3 Di III VC"}, {6553, "Tamron 28-75mm f/2.8 Di III RXD"}, {6553, "Tokina Firin 20mm f/2 FE MF"}, @@ -897,6 +905,7 @@ public: {6553, "Voigtlander MACRO APO-LANTHAR 65mm f/2 Aspherical"}, {6553, "Voigtlander NOKTON 40mm f/1.2 Aspherical"}, {6553, "Voigtlander NOKTON classic 35mm f/1.4"}, + {6553, "Voigtlander COLOR-SKOPAR 21mm f/3.5 Aspherical"}, {6553, "Zeiss Touit 12mm f/2.8"}, {6553, "Zeiss Touit 32mm f/1.8"}, {6553, "Zeiss Touit 50mm f/2.8 Macro"}, @@ -904,6 +913,7 @@ public: {6553, "Zeiss Batis 85mm f/1.8"}, {6553, "Zeiss Batis 18mm f/2.8"}, {6553, "Zeiss Batis 135mm f/2.8"}, + {6553, "Zeiss Batis 40mm f/2 CF"}, {6553, "Zeiss Loxia 50mm f/2"}, {6553, "Zeiss Loxia 35mm f/2"}, {6553, "Zeiss Loxia 21mm f/2.8"}, @@ -1029,6 +1039,7 @@ public: {26721, "Minolta AF 24-105mm f/3.5-4.5 (D)"}, {30464, "Metabones Canon EF Speed Booster"}, {45671, "Tokina 70-210mm f/4-5.6"}, + {45701, "Tamron AF 35-135mm f/3.5-4.5"}, {45711, "Vivitar 70-210mm f/4.5-5.6"}, {45741, "2x Teleconverter or Tamron or Tokina Lens"}, {45741, "Tamron SP AF 90mm f/2.5"}, @@ -1062,6 +1073,7 @@ public: {65535, "Sony FE 12-24mm f/4 G"}, {65535, "Sony FE 90mm f/2.8 Macro G OSS"}, {65535, "Sony E 18-50mm f/4-5.6"}, + {65535, "Sony FE 24mm f/1.4 GM"}, {65535, "Sony FE 24-105mm f/4 G OSS"}, {65535, "Sony E PZ 18-200mm f/3.5-6.3 OSS"}, {65535, "Sony FE 55mm f/1.8 ZA"}, @@ -1085,20 +1097,26 @@ public: {65535, "Sony FE 100-400mm f/4.5-5.6 GM OSS"}, {65535, "Sony FE 70-200mm f/2.8 GM OSS"}, {65535, "Sony FE 16-35mm f/2.8 GM"}, + {65535, "Sony FE 400mm f/2.8 GM OSS"}, {65535, "Sony E 18-135mm f/3.5-5.6 OSS"}, {65535, "Sony FE 70-200mm f/2.8 GM OSS + 1.4X Teleconverter"}, {65535, "Sony FE 70-200mm f/2.8 GM OSS + 2X Teleconverter"}, {65535, "Sony FE 100-400mm f/4.5-5.6 GM OSS + 1.4X Teleconverter"}, {65535, "Sony FE 100-400mm f/4.5-5.6 GM OSS + 2X Teleconverter"}, + {65535, "Sony FE 400mm f/2.8 GM OSS + 1.4X Teleconverter"}, + {65535, "Sony FE 400mm f/2.8 GM OSS + 2X Teleconverter"}, {65535, "Samyang AF 50mm f/1.4 FE"}, {65535, "Samyang AF 14mm f/2.8 FE"}, + {65535, "Samyang AF 24mm f/2.8"}, {65535, "Samyang AF 35mm f/2.8 FE"}, {65535, "Samyang AF 35mm f/1.4"}, {65535, "Sigma 19mm f/2.8 [EX] DN"}, {65535, "Sigma 30mm f/2.8 [EX] DN"}, {65535, "Sigma 60mm f/2.8 DN"}, {65535, "Sigma 30mm f/1.4 DC DN | C"}, + {65535, "Sigma 85mm f/1.4 DG HSM | A"}, {65535, "Sigma 16mm f/1.4 DC DN | C"}, + {65535, "Sigma 70mm f/2.8 DG MACRO | A"}, {65535, "Tamron 18-200mm f/3.5-6.3 Di III VC"}, {65535, "Tamron 28-75mm f/2.8 Di III RXD"}, {65535, "Tokina Firin 20mm f/2 FE MF"}, @@ -1108,6 +1126,7 @@ public: {65535, "Voigtlander MACRO APO-LANTHAR 65mm f/2 Aspherical"}, {65535, "Voigtlander NOKTON 40mm f/1.2 Aspherical"}, {65535, "Voigtlander NOKTON classic 35mm f/1.4"}, + {65535, "Voigtlander COLOR-SKOPAR 21mm f/3.5 Aspherical"}, {65535, "Zeiss Touit 12mm f/2.8"}, {65535, "Zeiss Touit 32mm f/1.8"}, {65535, "Zeiss Touit 50mm f/2.8 Macro"}, @@ -1115,6 +1134,7 @@ public: {65535, "Zeiss Batis 85mm f/1.8"}, {65535, "Zeiss Batis 18mm f/2.8"}, {65535, "Zeiss Batis 135mm f/2.8"}, + {65535, "Zeiss Batis 40mm f/2 CF"}, {65535, "Zeiss Loxia 50mm f/2"}, {65535, "Zeiss Loxia 35mm f/2"}, {65535, "Zeiss Loxia 21mm f/2.8"}, @@ -1190,7 +1210,8 @@ public: choices.insert (p_t (32791, "Sony E 16-70mm f/4 ZA OSS")); choices.insert (p_t (32792, "Sony E 10-18mm f/4 OSS")); choices.insert (p_t (32793, "Sony E PZ 16-50mm f/3.5-5.6 OSS")); - choices.insert (p_t (32794, "Sony FE 35mm f/2.8 ZA")); + choices.insert (p_t (32794, "Sony FE 35mm f/2.8 ZA or Samyang AF 24mm f/2.8 FE")); + choices.insert (p_t (32794, "Samyang AF 24mm f/2.8 FE")); choices.insert (p_t (32795, "Sony FE 24-70mm f/4 ZA OSS")); choices.insert (p_t (32796, "Sony FE 85mm f/1.8")); choices.insert (p_t (32797, "Sony E 18-200mm f/3.5-6.3 OSS LE")); @@ -1200,6 +1221,7 @@ public: choices.insert (p_t (32801, "Sony FE 12-24mm f/4 G")); choices.insert (p_t (32802, "Sony FE 90mm f/2.8 Macro G OSS")); choices.insert (p_t (32803, "Sony E 18-50mm f/4-5.6")); + choices.insert (p_t (32804, "Sony FE 24mm f/1.4 GM")); choices.insert (p_t (32805, "Sony FE 24-105mm f/4 G OSS")); choices.insert (p_t (32807, "Sony E PZ 18-200mm f/3.5-6.3 OSS")); choices.insert (p_t (32808, "Sony FE 55mm f/1.8 ZA")); @@ -1223,12 +1245,15 @@ public: choices.insert (p_t (32829, "Sony FE 100-400mm f/4.5-5.6 GM OSS")); choices.insert (p_t (32830, "Sony FE 70-200mm f/2.8 GM OSS")); choices.insert (p_t (32831, "Sony FE 16-35mm f/2.8 GM")); + choices.insert (p_t (32848, "Sony FE 400mm f/2.8 GM OSS")); choices.insert (p_t (32849, "Sony E 18-135mm f/3.5-5.6 OSS")); choices.insert (p_t (33072, "Sony FE 70-200mm f/2.8 GM OSS + 1.4X Teleconverter")); choices.insert (p_t (33073, "Sony FE 70-200mm f/2.8 GM OSS + 2X Teleconverter")); choices.insert (p_t (33076, "Sony FE 100mm f/2.8 STF GM OSS (macro mode)")); choices.insert (p_t (33077, "Sony FE 100-400mm f/4.5-5.6 GM OSS + 1.4X Teleconverter")); choices.insert (p_t (33078, "Sony FE 100-400mm f/4.5-5.6 GM OSS + 2X Teleconverter")); + choices.insert (p_t (33079, "Sony FE 400mm f/2.8 GM OSS + 1.4X Teleconverter")); + choices.insert (p_t (33080, "Sony FE 400mm f/2.8 GM OSS + 2X Teleconverter")); choices.insert (p_t (49201, "Zeiss Touit 12mm f/2.8")); choices.insert (p_t (49202, "Zeiss Touit 32mm f/1.8")); choices.insert (p_t (49203, "Zeiss Touit 50mm f/2.8 Macro")); @@ -1236,6 +1261,7 @@ public: choices.insert (p_t (49217, "Zeiss Batis 85mm f/1.8")); choices.insert (p_t (49218, "Zeiss Batis 18mm f/2.8")); choices.insert (p_t (49219, "Zeiss Batis 135mm f/2.8")); + choices.insert (p_t (49220, "Zeiss Batis 40mm f/2 CF")); choices.insert (p_t (49232, "Zeiss Loxia 50mm f/2")); choices.insert (p_t (49233, "Zeiss Loxia 35mm f/2")); choices.insert (p_t (49234, "Zeiss Loxia 21mm f/2.8")); @@ -1255,14 +1281,17 @@ public: choices.insert (p_t (50492, "Sigma 24-105mm f/4 DG OS HSM | A + MC-11")); choices.insert (p_t (50493, "Sigma 17-70mm f/2.8-4 DC MACRO OS HSM | C + MC-11")); choices.insert (p_t (50495, "Sigma 50-100mm f/1.8 DC HSM | A + MC-11")); + choices.insert (p_t (50499, "Sigma 85mm f/1.4 DG HSM | A")); choices.insert (p_t (50501, "Sigma 100-400mm f/5-6.3 DG OS HSM | C + MC-11")); choices.insert (p_t (50503, "Sigma 16mm f/1.4 DC DN | C")); + choices.insert (p_t (50513, "Sigma 70mm f/2.8 DG MACRO | A")); choices.insert (p_t (50992, "Voigtlander SUPER WIDE-HELIAR 15mm f/4.5 III")); choices.insert (p_t (50993, "Voigtlander HELIAR-HYPER WIDE 10mm f/5.6")); choices.insert (p_t (50994, "Voigtlander ULTRA WIDE-HELIAR 12mm f/5.6 III")); choices.insert (p_t (50995, "Voigtlander MACRO APO-LANTHAR 65mm f/2 Aspherical")); choices.insert (p_t (50996, "Voigtlander NOKTON 40mm f/1.2 Aspherical")); choices.insert (p_t (50997, "Voigtlander NOKTON classic 35mm f/1.4")); + choices.insert (p_t (50999, "Voigtlander COLOR-SKOPAR 21mm f/3.5 Aspherical")); choices.insert (p_t (51505, "Samyang AF 14mm f/2.8 FE or Samyang AF 35mm f/2.8 FE")); choices.insert (p_t (51505, "Samyang AF 35mm f/2.8 FE")); choices.insert (p_t (51507, "Samyang AF 35mm f/1.4")); diff --git a/rtgui/coordinateadjuster.cc b/rtgui/coordinateadjuster.cc index 209ef0902..2525a07e5 100644 --- a/rtgui/coordinateadjuster.cc +++ b/rtgui/coordinateadjuster.cc @@ -127,7 +127,6 @@ void CoordinateAdjuster::createWidgets(const std::vector &axis) Gtk::Grid *box = Gtk::manage (new Gtk::Grid()); box->set_orientation(Gtk::ORIENTATION_HORIZONTAL); - box->set_column_spacing(3); setExpandAlignProperties(currAdjuster->label, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); setExpandAlignProperties(currAdjuster->spinButton, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); diff --git a/rtgui/diagonalcurveeditorsubgroup.cc b/rtgui/diagonalcurveeditorsubgroup.cc index c23b25f9a..4cbde55cc 100644 --- a/rtgui/diagonalcurveeditorsubgroup.cc +++ b/rtgui/diagonalcurveeditorsubgroup.cc @@ -52,20 +52,34 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, // custom curve customCurveGrid = new Gtk::Grid (); customCurveGrid->set_orientation(Gtk::ORIENTATION_VERTICAL); - customCurveGrid->set_row_spacing(2); - customCurveGrid->set_column_spacing(2); + customCurveGrid->get_style_context()->add_class("curve-mainbox"); customCurve = Gtk::manage (new MyDiagonalCurve ()); customCurve->setType (DCT_Spline); + + Gtk::Grid* customCurveBox= Gtk::manage (new Gtk::Grid ()); + customCurveBox->get_style_context()->add_class("curve-curvebox"); + customCurveBox->add(*customCurve); Gtk::Grid* custombbox = Gtk::manage (new Gtk::Grid ()); // curvebboxpos 0=above, 1=right, 2=below, 3=left + custombbox->get_style_context()->add_class("curve-buttonbox"); - if (options.curvebboxpos == 0 || options.curvebboxpos == 2) { + if (options.curvebboxpos == 0) { custombbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL); setExpandAlignProperties(custombbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - } else { + customCurveGrid->get_style_context()->add_class("top"); + } else if (options.curvebboxpos == 2) { + custombbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL); + setExpandAlignProperties(custombbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + customCurveGrid->get_style_context()->add_class("bottom"); + } else if (options.curvebboxpos == 1) { custombbox->set_orientation(Gtk::ORIENTATION_VERTICAL); setExpandAlignProperties(custombbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); + customCurveGrid->get_style_context()->add_class("right"); + } else if (options.curvebboxpos == 3){ + custombbox->set_orientation(Gtk::ORIENTATION_VERTICAL); + setExpandAlignProperties(custombbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); + customCurveGrid->get_style_context()->add_class("left"); } editPointCustom = Gtk::manage (new Gtk::ToggleButton ()); @@ -90,22 +104,23 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, custombbox->attach_next_to(*saveCustom, sideEnd, 1, 1); customCoordAdjuster = Gtk::manage (new CoordinateAdjuster(customCurve, this)); + customCoordAdjuster->get_style_context()->add_class("curve-spinbuttonbox"); // Button box position: 0=above, 1=right, 2=below, 3=left - customCurveGrid->add(*customCurve); + customCurveGrid->add(*customCurveBox); customCurve->set_hexpand(true); if (options.curvebboxpos == 0) { - customCurveGrid->attach_next_to(*custombbox, *customCurve, Gtk::POS_TOP, 1, 1); - customCurveGrid->attach_next_to(*customCoordAdjuster, *customCurve, Gtk::POS_BOTTOM, 1, 1); + customCurveGrid->attach_next_to(*custombbox, *customCurveBox, Gtk::POS_TOP, 1, 1); + customCurveGrid->attach_next_to(*customCoordAdjuster, *customCurveBox, Gtk::POS_BOTTOM, 1, 1); } else if (options.curvebboxpos == 1) { - customCurveGrid->attach_next_to(*custombbox, *customCurve, Gtk::POS_RIGHT, 1, 1); - customCurveGrid->attach_next_to(*customCoordAdjuster, *customCurve, Gtk::POS_BOTTOM, 2, 1); + customCurveGrid->attach_next_to(*custombbox, *customCurveBox, Gtk::POS_RIGHT, 1, 1); + customCurveGrid->attach_next_to(*customCoordAdjuster, *customCurveBox, Gtk::POS_BOTTOM, 2, 1); } else if (options.curvebboxpos == 2) { - customCurveGrid->attach_next_to(*customCoordAdjuster, *customCurve, Gtk::POS_BOTTOM, 1, 1); + customCurveGrid->attach_next_to(*customCoordAdjuster, *customCurveBox, Gtk::POS_BOTTOM, 1, 1); customCurveGrid->attach_next_to(*custombbox, *customCoordAdjuster, Gtk::POS_BOTTOM, 1, 1); } else if (options.curvebboxpos == 3) { - customCurveGrid->attach_next_to(*custombbox, *customCurve, Gtk::POS_LEFT, 1, 1); + customCurveGrid->attach_next_to(*custombbox, *customCurveBox, Gtk::POS_LEFT, 1, 1); customCurveGrid->attach_next_to(*customCoordAdjuster, *custombbox, Gtk::POS_BOTTOM, 2, 1); } @@ -128,21 +143,35 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, // NURBS curve NURBSCurveGrid = new Gtk::Grid (); - NURBSCurveGrid->set_row_spacing(4); - NURBSCurveGrid->set_column_spacing(4); NURBSCurveGrid->set_orientation(Gtk::ORIENTATION_VERTICAL); + NURBSCurveGrid->get_style_context()->add_class("curve-mainbox"); NURBSCurve = Gtk::manage (new MyDiagonalCurve ()); NURBSCurve->setType (DCT_NURBS); + + Gtk::Grid* NURBSCurveBox= Gtk::manage (new Gtk::Grid ()); + NURBSCurveBox->get_style_context()->add_class("curve-curvebox"); + NURBSCurveBox->add(*NURBSCurve); Gtk::Grid* NURBSbbox = Gtk::manage (new Gtk::Grid ()); + NURBSbbox->get_style_context()->add_class("curve-buttonbox"); - if (options.curvebboxpos == 0 || options.curvebboxpos == 2) { + if (options.curvebboxpos == 0) { NURBSbbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL); setExpandAlignProperties(NURBSbbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - } else { + NURBSCurveGrid->get_style_context()->add_class("top"); + } else if (options.curvebboxpos == 2) { + NURBSbbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL); + setExpandAlignProperties(NURBSbbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + NURBSCurveGrid->get_style_context()->add_class("bottom"); + } else if (options.curvebboxpos == 1) { NURBSbbox->set_orientation(Gtk::ORIENTATION_VERTICAL); setExpandAlignProperties(NURBSbbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); + NURBSCurveGrid->get_style_context()->add_class("right"); + } else if (options.curvebboxpos == 3){ + NURBSbbox->set_orientation(Gtk::ORIENTATION_VERTICAL); + setExpandAlignProperties(NURBSbbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); + NURBSCurveGrid->get_style_context()->add_class("left"); } editPointNURBS = Gtk::manage (new Gtk::ToggleButton ()); @@ -167,22 +196,23 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, NURBSbbox->attach_next_to(*saveNURBS, sideEnd, 1, 1); NURBSCoordAdjuster = Gtk::manage (new CoordinateAdjuster(NURBSCurve, this)); + NURBSCoordAdjuster->get_style_context()->add_class("curve-spinbuttonbox"); // Button box position: 0=above, 1=right, 2=below, 3=left - NURBSCurveGrid->add(*NURBSCurve); + NURBSCurveGrid->add(*NURBSCurveBox); NURBSCurve->set_hexpand(true); if (options.curvebboxpos == 0) { - NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCurve, Gtk::POS_TOP, 1, 1); - NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSCurve, Gtk::POS_BOTTOM, 1, 1); + NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCurveBox, Gtk::POS_TOP, 1, 1); + NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSCurveBox, Gtk::POS_BOTTOM, 1, 1); } else if (options.curvebboxpos == 1) { - NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCurve, Gtk::POS_RIGHT, 1, 1); - NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSCurve, Gtk::POS_BOTTOM, 2, 1); + NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCurveBox, Gtk::POS_RIGHT, 1, 1); + NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSCurveBox, Gtk::POS_BOTTOM, 2, 1); } else if (options.curvebboxpos == 2) { - NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSCurve, Gtk::POS_BOTTOM, 1, 1); + NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSCurveBox, Gtk::POS_BOTTOM, 1, 1); NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCoordAdjuster, Gtk::POS_BOTTOM, 1, 1); } else if (options.curvebboxpos == 3) { - NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCurve, Gtk::POS_LEFT, 1, 1); + NURBSCurveGrid->attach_next_to(*NURBSbbox, *NURBSCurveBox, Gtk::POS_LEFT, 1, 1); NURBSCurveGrid->attach_next_to(*NURBSCoordAdjuster, *NURBSbbox, Gtk::POS_BOTTOM, 2, 1); } @@ -205,25 +235,40 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, // parametric curve paramCurveGrid = new Gtk::Grid (); - paramCurveGrid->set_row_spacing(4); - paramCurveGrid->set_column_spacing(4); paramCurveGrid->set_orientation(Gtk::ORIENTATION_VERTICAL); + paramCurveGrid->get_style_context()->add_class("curve-mainbox"); paramCurve = Gtk::manage (new MyDiagonalCurve ()); paramCurve->setType (DCT_Parametric); + + Gtk::Grid* paramCurveBox= Gtk::manage (new Gtk::Grid ()); + paramCurveBox->get_style_context()->add_class("curve-curvebox"); + paramCurveBox->add(*paramCurve); Gtk::Grid* parambbox = Gtk::manage (new Gtk::Grid ()); + parambbox->get_style_context()->add_class("curve-buttonbox"); - if (options.curvebboxpos == 0 || options.curvebboxpos == 2) { + if (options.curvebboxpos == 0) { parambbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL); setExpandAlignProperties(parambbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - } else { + paramCurveGrid->get_style_context()->add_class("top"); + } else if (options.curvebboxpos == 2) { + parambbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL); + setExpandAlignProperties(parambbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + paramCurveGrid->get_style_context()->add_class("bottom"); + } else if (options.curvebboxpos == 1) { parambbox->set_orientation(Gtk::ORIENTATION_VERTICAL); setExpandAlignProperties(parambbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); + paramCurveGrid->get_style_context()->add_class("right"); + } else if (options.curvebboxpos == 3){ + parambbox->set_orientation(Gtk::ORIENTATION_VERTICAL); + setExpandAlignProperties(parambbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); + paramCurveGrid->get_style_context()->add_class("left"); } shcSelector = Gtk::manage (new SHCSelector ()); - shcSelector->set_name("CurveSHCSelector"); // To handle the 4px gap between the SHCSelector and the curve through CSS + shcSelector->set_name("CurveSHCSelector"); + paramCurveBox->attach_next_to(*shcSelector, *paramCurve, Gtk::POS_BOTTOM, 1, 1); editParam = Gtk::manage (new Gtk::ToggleButton()); initButton(*editParam, Glib::ustring("crosshair-node-curve.png"), Gtk::ALIGN_START, false, "EDIT_PIPETTE_TOOLTIP"); @@ -272,8 +317,7 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, // paramCurveSliderBox needed to set vspacing(4) between curve+shc and sliders without vspacing between each slider Gtk::Grid* paramCurveSliderBox = Gtk::manage (new Gtk::Grid()); paramCurveSliderBox->set_orientation(Gtk::ORIENTATION_VERTICAL); - paramCurveSliderBox->set_column_spacing(2); - paramCurveSliderBox->set_row_spacing(2); + paramCurveSliderBox->get_style_context()->add_class("curve-sliderbox"); paramCurveSliderBox->attach_next_to(*evhighlights, Gtk::POS_TOP, 1, 1); paramCurveSliderBox->attach_next_to(*evlights, Gtk::POS_TOP, 1, 1); @@ -283,24 +327,20 @@ DiagonalCurveEditorSubGroup::DiagonalCurveEditorSubGroup (CurveEditorGroup* prt, paramCurveGrid->show_all (); // Button box position: 0=above, 1=right, 2=below, 3=left - paramCurveGrid->add(*paramCurve); + paramCurveGrid->add(*paramCurveBox); paramCurve->set_hexpand(true); if (options.curvebboxpos == 0) { - paramCurveGrid->attach_next_to(*parambbox, *paramCurve, Gtk::POS_TOP, 1, 1); - paramCurveGrid->attach_next_to(*shcSelector, *paramCurve, Gtk::POS_BOTTOM, 1, 1); - paramCurveGrid->attach_next_to(*paramCurveSliderBox, *shcSelector, Gtk::POS_BOTTOM, 1, 1); + paramCurveGrid->attach_next_to(*parambbox, *paramCurveBox, Gtk::POS_TOP, 1, 1); + paramCurveGrid->attach_next_to(*paramCurveSliderBox, *paramCurveBox, Gtk::POS_BOTTOM, 1, 1); } else if (options.curvebboxpos == 1) { - paramCurveGrid->attach_next_to(*shcSelector, *paramCurve, Gtk::POS_BOTTOM, 1, 1); - paramCurveGrid->attach_next_to(*parambbox, *paramCurve, Gtk::POS_RIGHT, 1, 2); - paramCurveGrid->attach_next_to(*paramCurveSliderBox, *shcSelector, Gtk::POS_BOTTOM, 2, 1); + paramCurveGrid->attach_next_to(*parambbox, *paramCurveBox, Gtk::POS_RIGHT, 1, 1); + paramCurveGrid->attach_next_to(*paramCurveSliderBox, *paramCurveBox, Gtk::POS_BOTTOM, 2, 1); } else if (options.curvebboxpos == 2) { - paramCurveGrid->attach_next_to(*shcSelector, *paramCurve, Gtk::POS_BOTTOM, 1, 1); - paramCurveGrid->attach_next_to(*parambbox, *shcSelector, Gtk::POS_BOTTOM, 1, 1); + paramCurveGrid->attach_next_to(*parambbox, *paramCurveBox, Gtk::POS_BOTTOM, 1, 1); paramCurveGrid->attach_next_to(*paramCurveSliderBox, *parambbox, Gtk::POS_BOTTOM, 1, 1); } else if (options.curvebboxpos == 3) { - paramCurveGrid->attach_next_to(*shcSelector, *paramCurve, Gtk::POS_BOTTOM, 1, 1); - paramCurveGrid->attach_next_to(*parambbox, *paramCurve, Gtk::POS_LEFT, 1, 2); + paramCurveGrid->attach_next_to(*parambbox, *paramCurveBox, Gtk::POS_LEFT, 1, 1); paramCurveGrid->attach_next_to(*paramCurveSliderBox, *parambbox, Gtk::POS_BOTTOM, 2, 1); } diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index f83e39146..8a508c747 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -127,9 +127,7 @@ void findOriginalEntries (const std::vector& entries) FileBrowser::FileBrowser () : menuLabel(nullptr), -#ifdef WIN32 miOpenDefaultViewer(nullptr), -#endif selectDF(nullptr), thisIsDF(nullptr), autoDF(nullptr), diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 55e293718..0b45d3e3d 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -1623,26 +1623,6 @@ BrowserFilter FileCatalog::getFilter () anyRankFilterActive || anyCLabelFilterActive || anyEditedFilterActive; } - if( options.rtSettings.verbose ) { - printf ("\n**************** FileCatalog::getFilter *** AFTER STEP 1 \n"); - - for (int i = 0; i <= 5; i++) { - printf ("filter.showRanked[%i] = %i\n", i, filter.showRanked[i]); - } - - for (int i = 0; i <= 5; i++) { - printf ("filter.showCLabeled[%i] = %i\n", i, filter.showCLabeled[i]); - } - - for (int i = 0; i < 2; i++) { - printf ("filter.showEdited[%i] = %i\n", i, filter.showEdited[i]); - } - - for (int i = 0; i < 2; i++) { - printf ("filter.showRecentlySaved[%i] = %i\n", i, filter.showRecentlySaved[i]); - } - } - filter.multiselect = false; /* @@ -1672,28 +1652,6 @@ BrowserFilter FileCatalog::getFilter () filter.showEdited[i] = anyEditedFilterActive ? bEdited[i]->get_active() : true; filter.showRecentlySaved[i] = anyRecentlySavedFilterActive ? bRecentlySaved[i]->get_active() : true; } - - if( options.rtSettings.verbose ) { - printf ("\n**************** FileCatalog::getFilter *** AFTER STEP 2 \n"); - - for (int i = 0; i <= 5; i++) { - printf ("filter.showRanked[%i] = %i\n", i, filter.showRanked[i]); - } - - for (int i = 0; i <= 5; i++) { - printf ("filter.showCLabeled[%i] = %i\n", i, filter.showCLabeled[i]); - } - - for (int i = 0; i < 2; i++) { - printf ("filter.showEdited[%i] = %i\n", i, filter.showEdited[i]); - } - - for (int i = 0; i < 2; i++) { - printf ("filter.showRecentlySaved[%i] = %i\n", i, filter.showRecentlySaved[i]); - } - - printf ("filter.multiselect = %i\n", filter.multiselect); - } } diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index f75983ac0..23b7c3983 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -384,16 +384,6 @@ void FilePanel::optionsChanged () bool FilePanel::handleShortcutKey (GdkEventKey* event) { - bool ctrl = event->state & GDK_CONTROL_MASK; - - if (!ctrl) { - switch(event->keyval) { - } - } else { - switch (event->keyval) { - } - } - if(tpc->getToolBar() && tpc->getToolBar()->handleShortcutKey(event)) { return true; } diff --git a/rtgui/flatcurveeditorsubgroup.cc b/rtgui/flatcurveeditorsubgroup.cc index 27b7ac940..376bb55c2 100644 --- a/rtgui/flatcurveeditorsubgroup.cc +++ b/rtgui/flatcurveeditorsubgroup.cc @@ -47,21 +47,35 @@ FlatCurveEditorSubGroup::FlatCurveEditorSubGroup (CurveEditorGroup* prt, Glib::u // ControlPoints curve CPointsCurveGrid = new Gtk::Grid (); - CPointsCurveGrid->set_row_spacing(2); - CPointsCurveGrid->set_column_spacing(2); CPointsCurveGrid->set_orientation(Gtk::ORIENTATION_VERTICAL); + CPointsCurveGrid->get_style_context()->add_class("curve-mainbox"); CPointsCurve = Gtk::manage (new MyFlatCurve ()); CPointsCurve->setType (FCT_MinMaxCPoints); + + Gtk::Grid* CPointsCurveBox = Gtk::manage (new Gtk::Grid ()); + CPointsCurveBox->get_style_context()->add_class("curve-curvebox"); + CPointsCurveBox->add(*CPointsCurve); Gtk::Grid* CPointsbbox = Gtk::manage (new Gtk::Grid ()); // curvebboxpos 0=above, 1=right, 2=below, 3=left + CPointsbbox->get_style_context()->add_class("curve-buttonbox"); - if (options.curvebboxpos == 0 || options.curvebboxpos == 2) { + if (options.curvebboxpos == 0) { CPointsbbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL); setExpandAlignProperties(CPointsbbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - } else { + CPointsCurveGrid->get_style_context()->add_class("top"); + } else if (options.curvebboxpos == 2) { + CPointsbbox->set_orientation(Gtk::ORIENTATION_HORIZONTAL); + setExpandAlignProperties(CPointsbbox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + CPointsCurveGrid->get_style_context()->add_class("bottom"); + } else if (options.curvebboxpos == 1) { CPointsbbox->set_orientation(Gtk::ORIENTATION_VERTICAL); setExpandAlignProperties(CPointsbbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); + CPointsCurveGrid->get_style_context()->add_class("right"); + } else if (options.curvebboxpos == 3){ + CPointsbbox->set_orientation(Gtk::ORIENTATION_VERTICAL); + setExpandAlignProperties(CPointsbbox, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); + CPointsCurveGrid->get_style_context()->add_class("left"); } editCPoints = Gtk::manage (new Gtk::ToggleButton()); @@ -92,23 +106,24 @@ FlatCurveEditorSubGroup::FlatCurveEditorSubGroup (CurveEditorGroup* prt, Glib::u axis.at(2).setValues(M("CURVEEDITOR_AXIS_LEFT_TAN"), 5, 0.01, 0.1, 0., 1.); axis.at(3).setValues(M("CURVEEDITOR_AXIS_RIGHT_TAN"), 5, 0.01, 0.1, 0., 1.); CPointsCoordAdjuster = Gtk::manage (new CoordinateAdjuster(CPointsCurve, this, axis)); + CPointsCoordAdjuster->get_style_context()->add_class("curve-spinbuttonbox"); } // Button box position: 0=above, 1=right, 2=below, 3=left - CPointsCurveGrid->add(*CPointsCurve); + CPointsCurveGrid->add(*CPointsCurveBox); CPointsCurve->set_hexpand(true); if (options.curvebboxpos == 0) { - CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCurve, Gtk::POS_TOP, 1, 1); - CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsCurve, Gtk::POS_BOTTOM, 1, 1); + CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCurveBox, Gtk::POS_TOP, 1, 1); + CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsCurveBox, Gtk::POS_BOTTOM, 1, 1); } else if (options.curvebboxpos == 1) { - CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCurve, Gtk::POS_RIGHT, 1, 1); - CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsCurve, Gtk::POS_BOTTOM, 2, 1); + CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCurveBox, Gtk::POS_RIGHT, 1, 1); + CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsCurveBox, Gtk::POS_BOTTOM, 2, 1); } else if (options.curvebboxpos == 2) { - CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsCurve, Gtk::POS_BOTTOM, 1, 1); + CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsCurveBox, Gtk::POS_BOTTOM, 1, 1); CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCoordAdjuster, Gtk::POS_BOTTOM, 1, 1); } else if (options.curvebboxpos == 3) { - CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCurve, Gtk::POS_LEFT, 1, 1); + CPointsCurveGrid->attach_next_to(*CPointsbbox, *CPointsCurveBox, Gtk::POS_LEFT, 1, 1); CPointsCurveGrid->attach_next_to(*CPointsCoordAdjuster, *CPointsbbox, Gtk::POS_BOTTOM, 2, 1); } diff --git a/rtgui/iccprofilecreator.cc b/rtgui/iccprofilecreator.cc index 8d6e09553..60b45519a 100644 --- a/rtgui/iccprofilecreator.cc +++ b/rtgui/iccprofilecreator.cc @@ -1,1037 +1,1493 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2018 Jacques DESMIS - * Copyright (c) 2018 Jean-Christophe FRISCH - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include -#include "iccprofilecreator.h" -#include "multilangmgr.h" -#include "cachemanager.h" -#include "addsetids.h" -#include "../rtengine/icons.h" -#include "../rtengine/color.h" -#include "rtimage.h" -#ifdef _OPENMP -#include -#endif - -extern Options options; - -namespace rtengine -{ - -extern const Settings* settings; - -} - -const char* sTRCPreset[] = {"BT709_g2.2_s4.5", "sRGB_g2.4_s12.92", "linear_g1.0", "standard_g2.2", "standard_g1.8", "High_g1.3_s3.35", "Low_g2.6_s6.9", "Lab_g3.0s9.03296"}; //gamma free - -ICCProfileCreator::ICCProfileCreator(RTWindow *rtwindow) - : Gtk::Dialog (M ("MAIN_BUTTON_ICCPROFCREATOR"), *rtwindow, true) - , primariesPreset(options.ICCPC_primariesPreset) - , redPrimaryX(options.ICCPC_redPrimaryX) - , redPrimaryY(options.ICCPC_redPrimaryY) - , greenPrimaryX(options.ICCPC_greenPrimaryX) - , greenPrimaryY(options.ICCPC_greenPrimaryY) - , bluePrimaryX(options.ICCPC_bluePrimaryX) - , bluePrimaryY(options.ICCPC_bluePrimaryY) - , gammaPreset(options.ICCPC_gammaPreset) - , gamma(options.ICCPC_gamma) - , slope(options.ICCPC_slope) - , appendParamsToDesc(options.ICCPC_appendParamsToDesc) - , profileVersion(options.ICCPC_profileVersion) - , illuminant(options.ICCPC_illuminant) - , description(options.ICCPC_description) - , copyright(options.ICCPC_copyright) - , parent(rtwindow) -{ - - set_default_size(600, -1); - - Gtk::Grid* mainGrid = Gtk::manage(new Gtk::Grid()); - mainGrid->set_column_spacing(3); - mainGrid->set_row_spacing(3); - - //--------------------------------- primaries - - Gtk::Label* prilab = Gtk::manage(new Gtk::Label(M("ICCPROFCREATOR_PRIMARIES"))); - setExpandAlignProperties(prilab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); - mainGrid->attach(*prilab, 0, 0, 1, 1); - - primaries = Gtk::manage(new MyComboBoxText()); - setExpandAlignProperties(primaries, false, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); - primaries->append(M("ICCPROFCREATOR_CUSTOM")); - primaries->append(M("ICCPROFCREATOR_PRIM_ACESP0")); - primaries->append(M("ICCPROFCREATOR_PRIM_ACESP1")); - primaries->append(M("ICCPROFCREATOR_PRIM_ADOBE")); - primaries->append(M("ICCPROFCREATOR_PRIM_PROPH")); - primaries->append(M("ICCPROFCREATOR_PRIM_REC2020")); - primaries->append(M("ICCPROFCREATOR_PRIM_SRGB")); - primaries->append(M("ICCPROFCREATOR_PRIM_WIDEG")); - primaries->append(M("ICCPROFCREATOR_PRIM_BEST")); - primaries->append(M("ICCPROFCREATOR_PRIM_BETA")); - primaries->append(M("ICCPROFCREATOR_PRIM_BRUCE")); - primaries->set_tooltip_text(M("ICCPROFCREATOR_PRIM_TOOLTIP")); - mainGrid->attach(*primaries, 1, 0, 1, 1); - - primariesGrid = Gtk::manage(new Gtk::Grid()); - setExpandAlignProperties(primariesGrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - primariesGrid->set_column_spacing(5); - - /* - Gtk::Image* gamuts0 = Gtk::manage(new RTImage("rt-logo-tiny.png")); - Gtk::Image* gamutl0 = Gtk::manage(new RTImage("rt-logo-small.png")); - Gtk::Image* gamuts1 = Gtk::manage(new RTImage("rt-logo-tiny.png")); - Gtk::Image* gamutl1 = Gtk::manage(new RTImage("rt-logo-small.png")); - Gtk::Image* gamuts2 = Gtk::manage(new RTImage("rt-logo-tiny.png")); - Gtk::Image* gamutl2 = Gtk::manage(new RTImage("rt-logo-small.png")); - Gtk::Image* gamuts3 = Gtk::manage(new RTImage("rt-logo-tiny.png")); - Gtk::Image* gamutl3 = Gtk::manage(new RTImage("rt-logo-small.png")); - Gtk::Image* gamuts4 = Gtk::manage(new RTImage("rt-logo-tiny.png")); - Gtk::Image* gamutl4 = Gtk::manage(new RTImage("rt-logo-small.png")); - Gtk::Image* gamuts5 = Gtk::manage(new RTImage("rt-logo-tiny.png")); - Gtk::Image* gamutl5 = Gtk::manage(new RTImage("rt-logo-small.png")); - */ - - aPrimariesRedX = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_PRIM_REDX"), 0.6300, 0.7350, 0.0001, 0.6400/*, gamuts0, gamutl0*/)); - setExpandAlignProperties(aPrimariesRedX, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - aPrimariesRedY = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_PRIM_REDY"), 0.2650, 0.3350, 0.0001, 0.3300/*, gamutl1, gamuts1*/)); - setExpandAlignProperties(aPrimariesRedY, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - aPrimariesGreenX = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_PRIM_GREX"), 0.0000, 0.3100, 0.0001, 0.3000/*, gamutl2, gamuts2*/)); - setExpandAlignProperties(aPrimariesGreenX, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - aPrimariesGreenY = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_PRIM_GREY"), 0.5900, 1.0000, 0.0001, 0.6000/*, gamuts3, gamutl3*/)); - setExpandAlignProperties(aPrimariesGreenY, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - aPrimariesBlueX = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_PRIM_BLUX"), 0.0001, 0.1600, 0.0001, 0.1500/*, gamutl4, gamuts4*/)); - setExpandAlignProperties(aPrimariesBlueX, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - aPrimariesBlueY = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_PRIM_BLUY"), -0.0800, 0.0700, 0.0001, 0.060/*, gamutl5, gamuts5*/)); - setExpandAlignProperties(aPrimariesBlueY, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - - primariesGrid->attach(*aPrimariesRedX, 0, 0, 1, 1); - primariesGrid->attach(*aPrimariesRedY, 1, 0, 1, 1); - - primariesGrid->attach(*aPrimariesGreenX, 0, 1, 1, 1); - primariesGrid->attach(*aPrimariesGreenY, 1, 1, 1, 1); - - primariesGrid->attach(*aPrimariesBlueX, 0, 2, 1, 1); - primariesGrid->attach(*aPrimariesBlueY, 1, 2, 1, 1); - - mainGrid->attach(*primariesGrid, 1, 1, 1, 1); - - //--------------------------------- output gamma - - Gtk::Label* galab = Gtk::manage(new Gtk::Label(M("ICCPROFCREATOR_TRC_PRESET"))); - setExpandAlignProperties(galab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); - mainGrid->attach(*galab, 0, 2, 1, 1); - - trcPresets = Gtk::manage(new MyComboBoxText()); - setExpandAlignProperties(trcPresets, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); - std::vector outputTRCPresets; - outputTRCPresets.push_back(M("ICCPROFCREATOR_CUSTOM")); - for (unsigned int i = 0; i < sizeof(sTRCPreset) / sizeof(sTRCPreset[0]); i++) { - outputTRCPresets.push_back(sTRCPreset[i]); - } - for (size_t i = 0; i < outputTRCPresets.size(); i++) { - trcPresets->append(outputTRCPresets[i]); - } - mainGrid->attach(*trcPresets, 1, 2, 1, 1); - - //--------------------------------- sliders gampos and slpos - - aGamma = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_GAMMA"), 1, 3.5, 0.01, 2.4)); - setExpandAlignProperties(aGamma, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); - - if (aGamma->delay < options.adjusterMaxDelay) { - aGamma->delay = options.adjusterMaxDelay; - } - aGamma->show(); - mainGrid->attach(*aGamma, 1, 3, 1, 1); //gamma - - aSlope = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_SLOPE"), 0, 15, 0.00001, 12.92310)); - setExpandAlignProperties(aSlope, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); - - if (aSlope->delay < options.adjusterMaxDelay) { - aSlope->delay = options.adjusterMaxDelay; - } - aSlope->show(); - mainGrid->attach(*aSlope, 1, 4, 1, 1); //slope - - //--------------------------------- temperature - - Gtk::Label* illlab = Gtk::manage(new Gtk::Label(M("ICCPROFCREATOR_ILL"))); - setExpandAlignProperties(illlab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); - mainGrid->attach(*illlab, 0, 5, 1, 1); //slope - cIlluminant = Gtk::manage(new MyComboBoxText()); - setExpandAlignProperties(cIlluminant, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); - cIlluminant->append(M("ICCPROFCREATOR_ILL_DEF")); - cIlluminant->append(M("ICCPROFCREATOR_ILL_41")); - cIlluminant->append(M("ICCPROFCREATOR_ILL_50")); - cIlluminant->append(M("ICCPROFCREATOR_ILL_55")); - cIlluminant->append(M("ICCPROFCREATOR_ILL_60")); - cIlluminant->append(M("ICCPROFCREATOR_ILL_65")); - cIlluminant->append(M("ICCPROFCREATOR_ILL_80")); - cIlluminant->append(M("ICCPROFCREATOR_ILL_INC")); - cIlluminant->set_tooltip_text(M("ICCPROFCREATOR_ILL_TOOLTIP")); - mainGrid->attach(*cIlluminant, 1, 5, 1, 1); - - //--------------------------------- V2 or V4 profiles - - Gtk::Label* proflab = Gtk::manage(new Gtk::Label(M("ICCPROFCREATOR_ICCVERSION"))); - setExpandAlignProperties(proflab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); - mainGrid->attach(*proflab, 0, 6, 1, 1); - iccVersion = Gtk::manage(new MyComboBoxText()); - setExpandAlignProperties(iccVersion, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); - iccVersion->append(M("ICCPROFCREATOR_PROF_V4")); - iccVersion->append(M("ICCPROFCREATOR_PROF_V2")); - mainGrid->attach(*iccVersion, 1, 6, 1, 1); - - //--------------------------------- Description - - Gtk::Label* desclab = Gtk::manage(new Gtk::Label(M("ICCPROFCREATOR_DESCRIPTION"))); - setExpandAlignProperties(desclab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_START); - mainGrid->attach(*desclab, 0, 7, 1, 2); - eDescription = Gtk::manage(new Gtk::Entry()); - setExpandAlignProperties(eDescription, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - eDescription->set_tooltip_text(M("ICCPROFCREATOR_DESCRIPTION_TOOLTIP")); - mainGrid->attach(*eDescription, 1, 7, 1, 1); - cAppendParamsToDesc = Gtk::manage(new Gtk::CheckButton(M("ICCPROFCREATOR_DESCRIPTION_ADDPARAM"))); - setExpandAlignProperties(cAppendParamsToDesc, true, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); - mainGrid->attach(*cAppendParamsToDesc, 1, 8, 1, 1); - - //--------------------------------- Copyright - - Gtk::Label* copylab = Gtk::manage(new Gtk::Label(M("ICCPROFCREATOR_COPYRIGHT"))); - setExpandAlignProperties(copylab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); - mainGrid->attach(*copylab, 0, 9, 1, 1); - Gtk::Grid* copygrid = Gtk::manage(new Gtk::Grid()); - setExpandAlignProperties(copygrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - eCopyright = Gtk::manage(new Gtk::Entry()); - setExpandAlignProperties(eCopyright, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - copygrid->attach(*eCopyright, 0, 0, 1, 1); - resetCopyright = Gtk::manage(new Gtk::Button()); - resetCopyright->add (*Gtk::manage (new RTImage ("undo-small.png", "redo-small.png"))); - setExpandAlignProperties(resetCopyright, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); - resetCopyright->set_relief (Gtk::RELIEF_NONE); - resetCopyright->set_tooltip_markup (M("ICCPROFCREATOR_COPYRIGHT_RESET_TOOLTIP")); - resetCopyright->get_style_context()->add_class(GTK_STYLE_CLASS_FLAT); - resetCopyright->set_can_focus(false); - copygrid->attach(*resetCopyright, 1, 0, 1, 1); - mainGrid->attach(*copygrid, 1, 9, 1, 1); - - //--------------------------------- Adding the mainGrid - - get_content_area()->add(*mainGrid); - - //--------------------------------- Setting default values for Adjusters - - aGamma->setDefault(gamma); - aSlope->setDefault(slope); - aPrimariesRedX->setDefault(redPrimaryX); - aPrimariesRedY->setDefault(redPrimaryY); - aPrimariesGreenX->setDefault(greenPrimaryX); - aPrimariesGreenY->setDefault(greenPrimaryY); - aPrimariesBlueX->setDefault(bluePrimaryX); - aPrimariesBlueY->setDefault(bluePrimaryY); - - //--------------- Updating widgets with actual values (from options) - - if (primariesPreset == "custom") { - primaries->set_active_text(M("ICCPROFCREATOR_CUSTOM")); - } else if (primariesPreset == "ACES-AP0") { - primaries->set_active_text(M("ICCPROFCREATOR_PRIM_ACESP0")); - } else if (primariesPreset == "ACES-AP1") { - primaries->set_active_text(M("ICCPROFCREATOR_PRIM_ACESP1")); - } else if (primariesPreset == "Adobe") { - primaries->set_active_text(M("ICCPROFCREATOR_PRIM_ADOBE")); - } else if (primariesPreset == "ProPhoto") { - primaries->set_active_text(M("ICCPROFCREATOR_PRIM_PROPH")); - } else if (primariesPreset == "Rec2020") { - primaries->set_active_text(M("ICCPROFCREATOR_PRIM_REC2020")); - } else if (primariesPreset == "sRGB") { - primaries->set_active_text(M("ICCPROFCREATOR_PRIM_SRGB")); - } else if (primariesPreset == "Widegamut") { - primaries->set_active_text(M("ICCPROFCREATOR_PRIM_WIDEG")); - } else if (primariesPreset == "BestRGB") { - primaries->set_active_text(M("ICCPROFCREATOR_PRIM_BEST")); - } else if (primariesPreset == "BetaRGB") { - primaries->set_active_text(M("ICCPROFCREATOR_PRIM_BETA")); - } else if (primariesPreset == "BruceRGB") { - primaries->set_active_text(M("ICCPROFCREATOR_PRIM_BRUCE")); - } - - trcPresets->set_active(0); - if (gammaPreset != "Custom") { - trcPresets->set_active_text(gammaPreset); - } - - aGamma->setValue(gamma); - aSlope->setValue(slope); - aPrimariesRedX->setValue(redPrimaryX); - aPrimariesRedY->setValue(redPrimaryY); - aPrimariesGreenX->setValue(greenPrimaryX); - aPrimariesGreenY->setValue(greenPrimaryY); - aPrimariesBlueX->setValue(bluePrimaryX); - aPrimariesBlueY->setValue(bluePrimaryY); - - eDescription->set_text(description); - eCopyright->set_text(copyright); - cAppendParamsToDesc->set_active(appendParamsToDesc); - - if (illuminant == "DEF") { - cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_DEF")); - } else if (illuminant == "D41") { - cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_41")); - } else if (illuminant == "D50") { - cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_50")); - } else if (illuminant == "D55") { - cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_55")); - } else if (illuminant == "D60") { - cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_60")); - } else if (illuminant == "D65") { - cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_65")); - } else if (illuminant == "D80") { - cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_80")); - } else if (illuminant == "stdA") { - cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_INC")); - } - - iccVersion->set_active(0); - if (profileVersion == "v2") { - iccVersion->set_active(1); - } - - trcPresetsChanged(); - illuminantChanged(); - primariesChanged(); - - //--------------- Action area button - - Gtk::Button* save = Gtk::manage (new Gtk::Button (M ("GENERAL_SAVE_AS"))); - save->signal_clicked().connect ( sigc::mem_fun (*this, &ICCProfileCreator::savePressed) ); - get_action_area()->pack_start (*save); - - Gtk::Button* close = Gtk::manage (new Gtk::Button (M ("GENERAL_CLOSE"))); - close->signal_clicked().connect ( sigc::mem_fun (*this, &ICCProfileCreator::closePressed) ); - get_action_area()->pack_start (*close); - - //--------------- Show childrens - - show_all_children (); - - //--------------- Connecting the signals - - aPrimariesRedX->setAdjusterListener(this); - aPrimariesRedY->setAdjusterListener(this); - aPrimariesGreenX->setAdjusterListener(this); - aPrimariesGreenY->setAdjusterListener(this); - aPrimariesBlueX->setAdjusterListener(this); - aPrimariesBlueY->setAdjusterListener(this); - aGamma->setAdjusterListener(this); - aSlope->setAdjusterListener(this); - primariesconn = primaries->signal_changed().connect(sigc::mem_fun(*this, &ICCProfileCreator::primariesChanged)); - trcpresetsconn = trcPresets->signal_changed().connect(sigc::mem_fun(*this, &ICCProfileCreator::trcPresetsChanged)); - illconn = cIlluminant->signal_changed().connect(sigc::mem_fun(*this, &ICCProfileCreator::illuminantChanged)); - resetCopyright->signal_clicked().connect(sigc::mem_fun(*this, &ICCProfileCreator::onResetCopyright)); -} - -void ICCProfileCreator::closePressed() -{ - storeValues(); - hide(); -} - -void ICCProfileCreator::updateICCVersion() -{ - if (cIlluminant->get_active_text() != M("ICCPROFCREATOR_ILL_DEF") || primaries->get_active_text() == M("ICCPROFCREATOR_CUSTOM")) { - iccVersion->set_active_text(M("ICCPROFCREATOR_PROF_V4")); - iccVersion->set_sensitive(false); - } else { - iccVersion->set_sensitive(true); - } -} - -void ICCProfileCreator::adjusterChanged(Adjuster* a, double newval) -{ - if (a == aPrimariesRedX || a == aPrimariesRedY || - a == aPrimariesGreenX || a == aPrimariesGreenY || - a == aPrimariesBlueX || a == aPrimariesBlueY) - { - if (primaries->get_active_row_number() > 0) { - ConnectionBlocker blocker(primariesconn); - primaries->set_active(0); - updateICCVersion(); - } - } else if (a == aGamma || a == aSlope) { - if (trcPresets->get_active_row_number() > 0) { - ConnectionBlocker blocker(trcpresetsconn); - trcPresets->set_active(0); - } - } -} - -void ICCProfileCreator::adjusterAutoToggled(Adjuster* a, bool newval) -{ -} - -void ICCProfileCreator::primariesChanged() -{ - if (primaries->get_active_row_number() > 0) { - float p[6]; - ColorTemp temp; - Glib::ustring activeValue = primaries->get_active_text(); - Glib::ustring primPresetName = getPrimariesPresetName(activeValue); - getPrimaries(primPresetName, p, temp); - aPrimariesRedX->setValue(p[0]); - aPrimariesRedY->setValue(p[1]); - aPrimariesGreenX->setValue(p[2]); - aPrimariesGreenY->setValue(p[3]); - aPrimariesBlueX->setValue(p[4]); - aPrimariesBlueY->setValue(p[5]); - } - updateICCVersion(); -} - -void ICCProfileCreator::illuminantChanged() -{ - updateICCVersion(); -} - -void ICCProfileCreator::trcPresetsChanged() -{ - aGamma->block(true); - aSlope->block(true); - - double gamma; - double slope; - getGamma(getGammaPresetName(trcPresets->get_active_text()), gamma, slope); - aGamma->setValue(gamma); - aSlope->setValue(slope); - - aGamma->block(false); - aSlope->block(false); -} - -void ICCProfileCreator::storeValues() -{ - if (iccVersion->get_active_text() == M("ICCPROFCREATOR_PROF_V4")) { - options.ICCPC_profileVersion = profileVersion = "v4"; - } else if (iccVersion->get_active_text() == M("ICCPROFCREATOR_PROF_V2")) { - options.ICCPC_profileVersion = profileVersion = "v2"; - } - - if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_DEF")) { - options.ICCPC_illuminant = illuminant = "DEF"; - } else if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_41")) { - options.ICCPC_illuminant = illuminant = "D41"; - } else if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_50")) { - options.ICCPC_illuminant = illuminant = "D50"; - } else if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_55")) { - options.ICCPC_illuminant = illuminant = "D55"; - } else if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_60")) { - options.ICCPC_illuminant = illuminant = "D60"; - } else if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_65")) { - options.ICCPC_illuminant = illuminant = "D65"; - } else if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_80")) { - options.ICCPC_illuminant = illuminant = "D80"; - } else if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_INC")) { - options.ICCPC_illuminant = illuminant = "stdA"; - } - - options.ICCPC_primariesPreset = primariesPreset = getPrimariesPresetName(primaries->get_active_text()); - options.ICCPC_gammaPreset = gammaPreset = getGammaPresetName(trcPresets->get_active_text()); - options.ICCPC_gamma = gamma = aGamma->getValue(); - options.ICCPC_slope = slope = aSlope->getValue(); - options.ICCPC_redPrimaryX = redPrimaryX = aPrimariesRedX->getValue(); - options.ICCPC_redPrimaryY = redPrimaryY = aPrimariesRedY->getValue(); - options.ICCPC_greenPrimaryX = greenPrimaryX = aPrimariesGreenX->getValue(); - options.ICCPC_greenPrimaryY = greenPrimaryY = aPrimariesGreenY->getValue(); - options.ICCPC_bluePrimaryX = bluePrimaryX = aPrimariesBlueX->getValue(); - options.ICCPC_bluePrimaryY = bluePrimaryY = aPrimariesBlueY->getValue(); - options.ICCPC_description = description = eDescription->get_text(); - options.ICCPC_copyright = copyright = eCopyright->get_text(); - options.ICCPC_appendParamsToDesc = appendParamsToDesc = cAppendParamsToDesc->get_active(); -} - -Glib::ustring ICCProfileCreator::getPrimariesPresetName(const Glib::ustring &preset) -{ - if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_ACESP0")) { - return Glib::ustring("ACES-AP0"); - } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_ACESP1")) { - return Glib::ustring("ACES-AP1"); - } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_ADOBE")) { - return Glib::ustring("Adobe"); - } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_PROPH")) { - return Glib::ustring("ProPhoto"); - } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_REC2020")) { - return Glib::ustring("Rec2020"); - } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_SRGB")) { - return Glib::ustring("sRGB"); - } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_WIDEG")) { - return Glib::ustring("Widegamut"); - } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_BEST")) { - return Glib::ustring("BestRGB"); - } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_BETA")) { - return Glib::ustring("BetaRGB"); - } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_BRUCE")) { - return Glib::ustring("BruceRGB"); - } else if (primaries->get_active_text() == M("ICCPROFCREATOR_CUSTOM")) { - return Glib::ustring("custom"); - } else { - return Glib::ustring(); - } -} - -void ICCProfileCreator::getPrimaries(const Glib::ustring &preset, float *p, ColorTemp &temp) -{ - temp = ColorTemp::D50; - if (preset == "Widegamut") { - p[0] = 0.7350; //Widegamut primaries - p[1] = 0.2650; - p[2] = 0.1150; - p[3] = 0.8260; - p[4] = 0.1570; - p[5] = 0.0180; - - } else if (preset == "Adobe") { - p[0] = 0.6400; //Adobe primaries - p[1] = 0.3300; - p[2] = 0.2100; - p[3] = 0.7100; - p[4] = 0.1500; - p[5] = 0.0600; - temp = ColorTemp::D65; - } else if (preset == "sRGB") { - p[0] = 0.6400; // sRGB primaries - p[1] = 0.3300; - p[2] = 0.3000; - p[3] = 0.6000; - p[4] = 0.1500; - p[5] = 0.0600; - temp = ColorTemp::D65; - } else if (preset == "BruceRGB") { - p[0] = 0.6400; // Bruce primaries - p[1] = 0.3300; - p[2] = 0.2800; - p[3] = 0.6500; - p[4] = 0.1500; - p[5] = 0.0600; - temp = ColorTemp::D65; - } else if (preset == "BetaRGB") { - p[0] = 0.6888; // Beta primaries - p[1] = 0.3112; - p[2] = 0.1986; - p[3] = 0.7551; - p[4] = 0.1265; - p[5] = 0.0352; - } else if (preset == "BestRGB") { - p[0] = 0.7347; // Best primaries - p[1] = 0.2653; - p[2] = 0.2150; - p[3] = 0.7750; - p[4] = 0.1300; - p[5] = 0.0350; - } else if (preset == "Rec2020") { - p[0] = 0.7080; // Rec2020 primaries - p[1] = 0.2920; - p[2] = 0.1700; - p[3] = 0.7970; - p[4] = 0.1310; - p[5] = 0.0460; - temp = ColorTemp::D65; - } else if (preset == "ACES-AP0") { - p[0] = 0.7347; // ACES P0 primaries - p[1] = 0.2653; - p[2] = 0.0000; - p[3] = 1.0; - p[4] = 0.0001; - p[5] = -0.0770; - temp = ColorTemp::D60; - } else if (preset == "ACES-AP1") { - p[0] = 0.713; // ACES P1 primaries - p[1] = 0.293; - p[2] = 0.165; - p[3] = 0.830; - p[4] = 0.128; - p[5] = 0.044; - temp = ColorTemp::D60; - } else if (preset == "ProPhoto") { - p[0] = 0.7347; // ProPhoto and default primaries - p[1] = 0.2653; - p[2] = 0.1596; - p[3] = 0.8404; - p[4] = 0.0366; - p[5] = 0.0001; - } else if (preset == "custom") { - p[0] = redPrimaryX; - p[1] = redPrimaryY; - p[2] = greenPrimaryX; - p[3] = greenPrimaryY; - p[4] = bluePrimaryX; - p[5] = bluePrimaryY; - - } else { - p[0] = 0.7347; //default primaries - p[1] = 0.2653; - p[2] = 0.1596; - p[3] = 0.8404; - p[4] = 0.0366; - p[5] = 0.0001; - } -} - -Glib::ustring ICCProfileCreator::getGammaPresetName(const Glib::ustring &preset) -{ - Glib::ustring name(trcPresets->get_active_text()); - if (name == M("ICCPROFCREATOR_CUSTOM")) { - name = "Custom"; - } - return name; -} - -void ICCProfileCreator::getGamma(const Glib::ustring &preset, double &presetGamma, double &presetSlope) -{ - if (preset == "High_g1.3_s3.35") { - presetGamma = 1.3; - presetSlope = 3.35; - } else if (preset == "Low_g2.6_s6.9") { - presetGamma = 2.6; - presetSlope = 6.9; - } else if (preset == "sRGB_g2.4_s12.92") { - presetGamma = 2.4; - presetSlope = 12.92310; - } else if (preset == "BT709_g2.2_s4.5") { - presetGamma = 2.22; - presetSlope = 4.5; - } else if (preset == "linear_g1.0") { - presetGamma = 1.; - presetSlope = 0.; - } else if (preset == "standard_g2.2") { - presetGamma = 2.2; - presetSlope = 0.; - } else if (preset == "standard_g1.8") { - presetGamma = 1.8; - presetSlope = 0.; - } else if (preset == "Lab_g3.0s9.03296") { - presetGamma = 3.0; - presetSlope = 9.03296; - } else if (preset == "Custom") { - presetGamma = gamma; - presetSlope = slope; - } else { - presetGamma = 2.4; - presetSlope = 12.92310; - } -} - -void ICCProfileCreator::onResetCopyright() -{ - eCopyright->set_text(Options::getICCProfileCopyright()); -} - -// Copyright (c) 2018 Jacques DESMIS -// WARNING: the caller must lock lcmsMutex -void ICCProfileCreator::savePressed() -{ - cmsHPROFILE newProfile = nullptr; - Glib::ustring sNewProfile; - Glib::ustring sPrimariesPreset; - Glib::ustring sGammaPreset; - - storeValues(); - - // -------------------------------------------- Compute the default file name - - //necessary for V2 profile - if (primariesPreset == "ACES-AP0" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESp0)) { - sNewProfile = options.rtSettings.ACESp0; - sPrimariesPreset = "ACES-AP0"; - } else if (primariesPreset == "ACES-AP1" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESp1)) { - sNewProfile = options.rtSettings.ACESp1; - sPrimariesPreset = "ACES-AP1"; - } else if (primariesPreset == "Adobe" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.adobe)) { - sNewProfile = options.rtSettings.adobe; - sPrimariesPreset = "Medium"; - } else if (primariesPreset == "ProPhoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto)) { - sNewProfile = options.rtSettings.prophoto; - sPrimariesPreset = "Large"; - } else if (primariesPreset == "Rec2020" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.rec2020)) { - sNewProfile = options.rtSettings.rec2020; - sPrimariesPreset = "Rec2020"; - } else if (primariesPreset == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb)) { - sNewProfile = options.rtSettings.srgb; - sPrimariesPreset = "sRGB"; - } else if (primariesPreset == "Widegamut" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.widegamut)) { - sNewProfile = options.rtSettings.widegamut; - sPrimariesPreset = "Wide"; - } else if (primariesPreset == "BestRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.best)) { - sNewProfile = options.rtSettings.best; - sPrimariesPreset = "Best"; - } else if (primariesPreset == "BetaRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.beta)) { - sNewProfile = options.rtSettings.beta; - sPrimariesPreset = "Beta"; - } else if (primariesPreset == "BruceRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.bruce)) { - sNewProfile = options.rtSettings.bruce; - sPrimariesPreset = "Bruce"; - } else if (primariesPreset == "custom") { - sNewProfile = options.rtSettings.srgb; - sPrimariesPreset = "Custom"; - } else { - // Should not occurs - if (rtengine::settings->verbose) { - printf("\"%s\": unknown working profile! - use LCMS2 substitution\n", primariesPreset.c_str()); - } - return; - } - - //begin adaptation rTRC gTRC bTRC - //"newProfile" profile has the same characteristics than RGB values, but TRC are adapted... for applying profile - if (rtengine::settings->verbose) { - printf("Output Gamma - profile Primaries as RT profile: \"%s\"\n", sNewProfile.c_str()); - } - - newProfile = rtengine::ICCStore::getInstance()->getProfile(sNewProfile); //get output profile - - if (newProfile == nullptr) { - - if (rtengine::settings->verbose) { - printf("\"%s\" ICC output profile not found!\n", sNewProfile.c_str()); - } - return; - } - - //change desc Tag , to "free gamma", or "BT709", etc. - Glib::ustring fName; - Glib::ustring sPrimariesAndIlluminant; - double presetGamma = 2.4; - double presetSlope = 12.92310; - const double eps = 0.000000001; // not divide by zero - getGamma(gammaPreset, presetGamma, presetSlope); - if (gammaPreset == "High_g1.3_s3.35") { - sGammaPreset = "High_g=1.3_s=3.35"; - ga[0] = 1.3 ; //for high dynamic images - ga[1] = 0.998279; - ga[2] = 0.001721; - ga[3] = 0.298507; - ga[4] = 0.005746; - } else if (gammaPreset == "Low_g2.6_s6.9") { - sGammaPreset = "Low_g=2.6_s=6.9"; - ga[0] = 2.6 ; //gamma 2.6 variable : for low contrast images - ga[1] = 0.891161; - ga[2] = 0.108839; - ga[3] = 0.144928; - ga[4] = 0.076332; - } else if (gammaPreset == "sRGB_g2.4_s12.92") { - sGammaPreset = "sRGB_g=2.4_s=12.92310"; - ga[0] = 2.40; //sRGB 2.4 12.92 - RT default as Lightroom - ga[1] = 0.947858; - ga[2] = 0.052142; - ga[3] = 0.077399; - ga[4] = 0.039293; - } else if (gammaPreset == "BT709_g2.2_s4.5") { - sGammaPreset = "BT709_g=2.2_s=4.5"; - ga[0] = 2.22; //BT709 2.2 4.5 - my preferred as D.Coffin - ga[1] = 0.909995; - ga[2] = 0.090005; - ga[3] = 0.222222; - ga[4] = 0.081071; - } else if (gammaPreset == "linear_g1.0") { - sGammaPreset = "Linear_g=1.0"; - ga[0] = 1.0; //gamma=1 linear : for high dynamic images (cf D.Coffin...) - ga[1] = 1.; - ga[2] = 0.; - ga[3] = 1. / eps; - ga[4] = 0.; - } else if (gammaPreset == "standard_g2.2") { - sGammaPreset = "g=2.2"; - ga[0] = 2.2; //gamma=2.2(as gamma of Adobe, Widegamut...) - ga[1] = 1.; - ga[2] = 0.; - ga[3] = 1. / eps; - ga[4] = 0.; - } else if (gammaPreset == "standard_g1.8") { - sGammaPreset = "g=1.8"; - ga[0] = 1.8; //gamma=1.8(as gamma of Prophoto) - ga[1] = 1.; - ga[2] = 0.; - ga[3] = 1. / eps; - ga[4] = 0.; - } else if (gammaPreset == "Lab_g3.0s9.03296") { - sGammaPreset = "LAB_g3.0_s9.03296"; - ga[0] = 3.0; //Lab gamma =3 slope=9.03296 - ga[1] = 0.8621; - ga[2] = 0.1379; - ga[3] = 0.1107; - ga[4] = 0.08; - } else if (gammaPreset == "Custom") { - rtengine::GammaValues g_a; //gamma parameters - double pwr = 1.0 / gamma; - double ts = slope; - double slope2 = slope == 0 ? eps : slope; - - int mode = 0; - rtengine::Color::calcGamma(pwr, ts, mode, g_a); // call to calcGamma with selected gamma and slope : return parameters for LCMS2 - ga[4] = g_a[3] * ts; - //printf("g_a.gamma0=%f g_a.gamma1=%f g_a.gamma2=%f g_a.gamma3=%f g_a.gamma4=%f\n", g_a.gamma0,g_a.gamma1,g_a.gamma2,g_a.gamma3,g_a.gamma4); - ga[0] = gamma; - ga[1] = 1. /(1.0 + g_a[4]); - ga[2] = g_a[4] /(1.0 + g_a[4]); - ga[3] = 1. / slope2; - //printf("ga[0]=%f ga[1]=%f ga[2]=%f ga[3]=%f ga[4]=%f\n", ga[0],ga[1],ga[2],ga[3],ga[4]); - - sGammaPreset = Glib::ustring::compose("g%1_s%2", - Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), gamma), - Glib::ustring::format (std::setw(6), std::fixed, std::setprecision(5), slope)); - presetGamma = gamma; - presetSlope = slope; - } - ga[5] = 0.0; - ga[6] = 0.0; - - - sPrimariesAndIlluminant = sPrimariesPreset; - - if (profileVersion == "v4" && illuminant != "DEF") { - sPrimariesPreset += "-" + illuminant; - // printf("outpr=%s \n",outPr.c_str()); - } - - Glib::ustring profileDesc; - Glib::ustring sGammaSlopeParam;//to save gamma and slope in a dmdd - Glib::ustring sGammaSlopeDesc; //to save gamma and slope in a desc - Glib::ustring sGamma; - Glib::ustring sSlope; - - if (gammaPreset == "Custom") { - sGamma = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), gamma); - sSlope = Glib::ustring::format (std::setw(6), std::fixed, std::setprecision(5), slope); - fName = Glib::ustring::compose("RT%1_%2_g%3_s%4.icc", profileVersion, sPrimariesAndIlluminant, sGamma, sSlope); - profileDesc = sPrimariesPreset; - } else { - sGamma = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), presetGamma); - sSlope = Glib::ustring::format (std::setw(6), std::fixed, std::setprecision(5), presetSlope); - fName = Glib::ustring::compose("RT%1_%2_%3.icc", profileVersion, sPrimariesAndIlluminant, sGammaPreset); - profileDesc == sPrimariesPreset + sGammaPreset; - } - sGammaSlopeParam = Glib::ustring::compose("g%1s%2!", sGamma, sSlope); - sGammaSlopeDesc = Glib::ustring::compose("g=%1 s=%2", sGamma, sSlope); - - // -------------------------------------------- Asking the file name - - Gtk::FileChooserDialog dialog(getToplevelWindow(this), M("ICCPROFCREATOR_SAVEDIALOG_TITLE"), Gtk::FILE_CHOOSER_ACTION_SAVE); - bindCurrentFolder(dialog, options.lastICCProfCreatorDir); - dialog.set_current_name(fName); - //dialog.set_current_folder(lastPath); - - dialog.add_button(M("GENERAL_CANCEL"), Gtk::RESPONSE_CANCEL); - dialog.add_button(M("GENERAL_SAVE"), Gtk::RESPONSE_OK); - - Glib::RefPtr filter_icc = Gtk::FileFilter::create(); - filter_icc->set_name(M("FILECHOOSER_FILTER_COLPROF")); - filter_icc->add_pattern("*.icc"); - dialog.add_filter(filter_icc); - - /* - Glib::RefPtr filter_any = Gtk::FileFilter::create(); - filter_any->set_name(M("FILECHOOSER_FILTER_ANY")); - filter_any->add_pattern("*"); - dialog.add_filter(filter_any); - */ - - dialog.show_all_children(); - //dialog.set_do_overwrite_confirmation (true); - - Glib::ustring absoluteFName; - - do { - int result = dialog.run(); - - if (result != Gtk::RESPONSE_OK) { - return; - } else { - absoluteFName = dialog.get_filename(); - Glib::ustring ext = getExtension(absoluteFName); - - if (ext != "icc") { - absoluteFName += ".icc"; - } - - if (confirmOverwrite(dialog, absoluteFName)) { - //lastPath = Glib::path_get_dirname(absoluteFName); - break; - } - } - } while (1); - - // --------------- main tags ------------------ - - if (profileVersion == "v4") { - cmsSetProfileVersion(newProfile, 4.3); - } else { - cmsSetProfileVersion(newProfile, 2.0); - } - -//change - float p[6]; //primaries - ga[6] = 0.0; - - ColorTemp temp; - getPrimaries(primariesPreset, p, temp); - - cmsCIExyY xyD; - cmsCIExyYTRIPLE Primaries = { - {p[0], p[1], 1.0}, // red - {p[2], p[3], 1.0}, // green - {p[4], p[5], 1.0} // blue - }; - - if (profileVersion == "v4" && illuminant != "DEF") { - double tempv4 = 5000.; - if (illuminant == "D41") { - tempv4 = 4100.; - } else if (illuminant == "D50") { - tempv4 = 5003.; - } else if (illuminant == "D55") { - tempv4 = 5500.; - } else if (illuminant == "D60") { - tempv4 = 6004.; - } else if (illuminant == "D65") { - tempv4 = 6504.; - } else if (illuminant == "D80") { - tempv4 = 8000.; - } else if (illuminant == "stdA") { - tempv4 = 5003.; - } - cmsWhitePointFromTemp(&xyD, tempv4); - } else { - cmsWhitePointFromTemp(&xyD, (double)temp); - } - - if (illuminant == "stdA") { - xyD = {0.447573, 0.407440, 1.0}; - } - - // Calculate output profile's rTRC gTRC bTRC - cmsToneCurve* GammaTRC[3]; - GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildParametricToneCurve(nullptr, 5, ga); - - if (profileVersion == "v4") { - newProfile = cmsCreateRGBProfile(&xyD, &Primaries, GammaTRC); - } - - cmsWriteTag(newProfile, cmsSigRedTRCTag, GammaTRC[0]); - cmsWriteTag(newProfile, cmsSigGreenTRCTag, GammaTRC[1]); - cmsWriteTag(newProfile, cmsSigBlueTRCTag, GammaTRC[2]); - - // --------------- set dmnd tag ------------------ - - cmsMLU *dmnd; - dmnd = cmsMLUalloc(nullptr, 1); - cmsMLUsetASCII(dmnd, "en", "US", "RawTherapee"); - cmsWriteTag(newProfile, cmsSigDeviceMfgDescTag, dmnd); - cmsMLUfree(dmnd); - - // --------------- set dmdd tag ------------------ - - if (profileVersion == "v2") { - //write in tag 'dmdd' values of current gamma and slope to retrieve after in Output profile - std::wostringstream wGammaSlopeParam; - wGammaSlopeParam << sGammaSlopeParam; - - cmsMLU *dmdd = cmsMLUalloc(nullptr, 1); - // Language code (2 letters code) : https://www.iso.org/obp/ui/ - // Country code (2 letters code) : http://www.loc.gov/standards/iso639-2/php/code_list.php - if (sGammaSlopeParam.is_ascii()) { - if (cmsMLUsetASCII(dmdd, "en", "US", sGammaSlopeParam.c_str())) { - if (!cmsWriteTag(newProfile, cmsSigProfileDescriptionTag, dmdd)) { - printf("Error: Can't write cmsSigProfileDescriptionTag!\n"); - } - } - } else if (cmsMLUsetWide(dmdd, "en", "US", wGammaSlopeParam.str().c_str())) { - if (!cmsWriteTag(newProfile, cmsSigDeviceModelDescTag, dmdd)) { - printf("Error: Can't write cmsSigDeviceModelDescTag!\n"); - } - } else { - printf("Error: cmsMLUsetWide failed for dmdd \"%s\" !\n", sGammaSlopeParam.c_str()); - } - cmsMLUfree(dmdd); - } - - // --------------- set desc tag ------------------ - - Glib::ustring sDescription; - if (!description.empty()) { - if (cAppendParamsToDesc->get_active()) { - sDescription = description + " / " + sGammaSlopeDesc; - } else { - sDescription = description; - } - } else { - if (cAppendParamsToDesc->get_active()) { - sDescription = profileDesc + " / " + sGammaSlopeDesc; - } else { - sDescription = profileDesc; - } - } - - //write in tag 'dmdd' values of current gamma and slope to retrieve after in Output profile - std::wostringstream wDescription; - wDescription << sDescription; - - cmsMLU *descMLU = cmsMLUalloc(nullptr, 1); - // Language code (2 letters code) : https://www.iso.org/obp/ui/ - // Country code (2 letters code) : http://www.loc.gov/standards/iso639-2/php/code_list.php - if (sDescription.is_ascii()) { - if (cmsMLUsetASCII(descMLU, "en", "US", sDescription.c_str())) { - if (!cmsWriteTag(newProfile, cmsSigProfileDescriptionTag, descMLU)) { - printf("Error: Can't write cmsSigProfileDescriptionTag!\n"); - } - } - } else if (cmsMLUsetWide(descMLU, "en", "US", wDescription.str().c_str())) { - if (!cmsWriteTag(newProfile, cmsSigProfileDescriptionTag, descMLU)) { - printf("Error: Can't write cmsSigProfileDescriptionTag!\n"); - } - } else { - printf("Error: cmsMLUsetWide failed for desc \"%s\" !\n", sDescription.c_str()); - } - cmsMLUfree(descMLU); - - // --------------- set cprt tag ------------------ - - std::wostringstream wCopyright; - wCopyright << copyright; - - cmsMLU *copyMLU = cmsMLUalloc(nullptr, 1); - if (cmsMLUsetWide(copyMLU, "en", "US", wCopyright.str().c_str())) { - if (!cmsWriteTag(newProfile, cmsSigCopyrightTag, copyMLU)) { - printf("Error: Can't write cmsSigCopyrightTag!\n"); - } - } else { - printf("Error: cmsMLUsetWide failed for cprt \"%s\" !\n", copyright.c_str()); - } - cmsMLUfree(copyMLU); - - - /* //to read XYZ values - cmsCIEXYZ *redT = static_cast(cmsReadTag(newProfile, cmsSigRedMatrixColumnTag)); - cmsCIEXYZ *greenT = static_cast(cmsReadTag(newProfile, cmsSigGreenMatrixColumnTag)); - cmsCIEXYZ *blueT = static_cast(cmsReadTag(newProfile, cmsSigBlueMatrixColumnTag)); - printf("rx=%f gx=%f bx=%f ry=%f gy=%f by=%f rz=%f gz=%f bz=%f\n", redT->X, greenT->X, blueT->X, redT->Y, greenT->Y, blueT->Y, redT->Z, greenT->Z, blueT->Z); - */ - - cmsSaveProfileToFile(newProfile, absoluteFName.c_str()); - - cmsFreeToneCurve(GammaTRC[0]); -} +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2018 Jacques DESMIS + * Copyright (c) 2018 Jean-Christophe FRISCH + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#include +#include "iccprofilecreator.h" +#include "multilangmgr.h" +#include "cachemanager.h" +#include "addsetids.h" +#include "../rtengine/icons.h" +#include "../rtengine/color.h" +#include "rtimage.h" +#ifdef _OPENMP +#include +#endif + +extern Options options; + +namespace rtengine +{ + +extern const Settings* settings; + +} + +const char* sTRCPreset[] = {"BT709_g2.2_s4.5", "sRGB_g2.4_s12.92", "linear_g1.0", "standard_g2.2", "standard_g1.8", "High_g1.3_s3.35", "Low_g2.6_s6.9", "Lab_g3.0s9.03296"}; //gamma free + +ICCProfileCreator::ICCProfileCreator(RTWindow *rtwindow) + : Gtk::Dialog(M("MAIN_BUTTON_ICCPROFCREATOR"), *rtwindow, true) + , primariesPreset(options.ICCPC_primariesPreset) + , redPrimaryX(options.ICCPC_redPrimaryX) + , redPrimaryY(options.ICCPC_redPrimaryY) + , greenPrimaryX(options.ICCPC_greenPrimaryX) + , greenPrimaryY(options.ICCPC_greenPrimaryY) + , bluePrimaryX(options.ICCPC_bluePrimaryX) + , bluePrimaryY(options.ICCPC_bluePrimaryY) + , gammaPreset(options.ICCPC_gammaPreset) + , gamma(options.ICCPC_gamma) + , slope(options.ICCPC_slope) + , appendParamsToDesc(options.ICCPC_appendParamsToDesc) + , profileVersion(options.ICCPC_profileVersion) + , illuminant(options.ICCPC_illuminant) + , description(options.ICCPC_description) + , copyright(options.ICCPC_copyright) + , parent(rtwindow) +{ + + set_default_size(600, -1); + + Gtk::Grid* mainGrid = Gtk::manage(new Gtk::Grid()); + mainGrid->set_column_spacing(3); + mainGrid->set_row_spacing(3); + + //--------------------------------- primaries + + Gtk::Label* prilab = Gtk::manage(new Gtk::Label(M("ICCPROFCREATOR_PRIMARIES"))); + setExpandAlignProperties(prilab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); + mainGrid->attach(*prilab, 0, 0, 1, 1); + + primaries = Gtk::manage(new MyComboBoxText()); + setExpandAlignProperties(primaries, false, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); + primaries->append(M("ICCPROFCREATOR_CUSTOM")); + primaries->append(M("ICCPROFCREATOR_PRIM_ACESP0")); + primaries->append(M("ICCPROFCREATOR_PRIM_ACESP1")); + primaries->append(M("ICCPROFCREATOR_PRIM_ADOBE")); + primaries->append(M("ICCPROFCREATOR_PRIM_PROPH")); + primaries->append(M("ICCPROFCREATOR_PRIM_REC2020")); + primaries->append(M("ICCPROFCREATOR_PRIM_SRGB")); + primaries->append(M("ICCPROFCREATOR_PRIM_WIDEG")); + primaries->append(M("ICCPROFCREATOR_PRIM_BEST")); + primaries->append(M("ICCPROFCREATOR_PRIM_BETA")); + primaries->append(M("ICCPROFCREATOR_PRIM_BRUCE")); + primaries->set_tooltip_text(M("ICCPROFCREATOR_PRIM_TOOLTIP")); + mainGrid->attach(*primaries, 1, 0, 1, 1); + + primariesGrid = Gtk::manage(new Gtk::Grid()); + setExpandAlignProperties(primariesGrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + primariesGrid->set_column_spacing(5); + + /* + Gtk::Image* gamuts0 = Gtk::manage(new RTImage("rt-logo-tiny.png")); + Gtk::Image* gamutl0 = Gtk::manage(new RTImage("rt-logo-small.png")); + Gtk::Image* gamuts1 = Gtk::manage(new RTImage("rt-logo-tiny.png")); + Gtk::Image* gamutl1 = Gtk::manage(new RTImage("rt-logo-small.png")); + Gtk::Image* gamuts2 = Gtk::manage(new RTImage("rt-logo-tiny.png")); + Gtk::Image* gamutl2 = Gtk::manage(new RTImage("rt-logo-small.png")); + Gtk::Image* gamuts3 = Gtk::manage(new RTImage("rt-logo-tiny.png")); + Gtk::Image* gamutl3 = Gtk::manage(new RTImage("rt-logo-small.png")); + Gtk::Image* gamuts4 = Gtk::manage(new RTImage("rt-logo-tiny.png")); + Gtk::Image* gamutl4 = Gtk::manage(new RTImage("rt-logo-small.png")); + Gtk::Image* gamuts5 = Gtk::manage(new RTImage("rt-logo-tiny.png")); + Gtk::Image* gamutl5 = Gtk::manage(new RTImage("rt-logo-small.png")); + */ + + aPrimariesRedX = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_PRIM_REDX"), 0.6300, 0.7350, 0.0001, 0.6400/*, gamuts0, gamutl0*/)); + setExpandAlignProperties(aPrimariesRedX, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + aPrimariesRedY = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_PRIM_REDY"), 0.2650, 0.3350, 0.0001, 0.3300/*, gamutl1, gamuts1*/)); + setExpandAlignProperties(aPrimariesRedY, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + aPrimariesGreenX = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_PRIM_GREX"), 0.0000, 0.3100, 0.0001, 0.3000/*, gamutl2, gamuts2*/)); + setExpandAlignProperties(aPrimariesGreenX, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + aPrimariesGreenY = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_PRIM_GREY"), 0.5900, 1.0000, 0.0001, 0.6000/*, gamuts3, gamutl3*/)); + setExpandAlignProperties(aPrimariesGreenY, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + aPrimariesBlueX = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_PRIM_BLUX"), 0.0001, 0.1600, 0.0001, 0.1500/*, gamutl4, gamuts4*/)); + setExpandAlignProperties(aPrimariesBlueX, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + aPrimariesBlueY = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_PRIM_BLUY"), -0.0800, 0.0700, 0.0001, 0.060/*, gamutl5, gamuts5*/)); + setExpandAlignProperties(aPrimariesBlueY, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + + primariesGrid->attach(*aPrimariesRedX, 0, 0, 1, 1); + primariesGrid->attach(*aPrimariesRedY, 1, 0, 1, 1); + + primariesGrid->attach(*aPrimariesGreenX, 0, 1, 1, 1); + primariesGrid->attach(*aPrimariesGreenY, 1, 1, 1, 1); + + primariesGrid->attach(*aPrimariesBlueX, 0, 2, 1, 1); + primariesGrid->attach(*aPrimariesBlueY, 1, 2, 1, 1); + + mainGrid->attach(*primariesGrid, 1, 1, 1, 1); + + //--------------------------------- output gamma + + Gtk::Label* galab = Gtk::manage(new Gtk::Label(M("ICCPROFCREATOR_TRC_PRESET"))); + setExpandAlignProperties(galab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); + mainGrid->attach(*galab, 0, 2, 1, 1); + + trcPresets = Gtk::manage(new MyComboBoxText()); + setExpandAlignProperties(trcPresets, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); + std::vector outputTRCPresets; + outputTRCPresets.push_back(M("ICCPROFCREATOR_CUSTOM")); + + for (unsigned int i = 0; i < sizeof(sTRCPreset) / sizeof(sTRCPreset[0]); i++) { + outputTRCPresets.push_back(sTRCPreset[i]); + } + + for (size_t i = 0; i < outputTRCPresets.size(); i++) { + trcPresets->append(outputTRCPresets[i]); + } + + mainGrid->attach(*trcPresets, 1, 2, 1, 1); + + //--------------------------------- sliders gampos and slpos + + aGamma = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_GAMMA"), 1, 3.5, 0.00001, 2.4)); + setExpandAlignProperties(aGamma, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); + + if (aGamma->delay < options.adjusterMaxDelay) { + aGamma->delay = options.adjusterMaxDelay; + } + + aGamma->show(); + mainGrid->attach(*aGamma, 1, 3, 1, 1); //gamma + + aSlope = Gtk::manage(new Adjuster(M("ICCPROFCREATOR_SLOPE"), 0, 15, 0.00001, 12.92310)); + setExpandAlignProperties(aSlope, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); + + if (aSlope->delay < options.adjusterMaxDelay) { + aSlope->delay = options.adjusterMaxDelay; + } + + aSlope->show(); + mainGrid->attach(*aSlope, 1, 4, 1, 1); //slope + + //--------------------------------- temperature + + Gtk::Label* illlab = Gtk::manage(new Gtk::Label(M("ICCPROFCREATOR_ILL"))); + setExpandAlignProperties(illlab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); + mainGrid->attach(*illlab, 0, 5, 1, 1); //slope + cIlluminant = Gtk::manage(new MyComboBoxText()); + setExpandAlignProperties(cIlluminant, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); + cIlluminant->append(M("ICCPROFCREATOR_ILL_DEF")); + cIlluminant->append(M("ICCPROFCREATOR_ILL_41")); + cIlluminant->append(M("ICCPROFCREATOR_ILL_50")); + cIlluminant->append(M("ICCPROFCREATOR_ILL_55")); + cIlluminant->append(M("ICCPROFCREATOR_ILL_60")); + cIlluminant->append(M("ICCPROFCREATOR_ILL_65")); + cIlluminant->append(M("ICCPROFCREATOR_ILL_80")); + cIlluminant->append(M("ICCPROFCREATOR_ILL_INC")); + cIlluminant->set_tooltip_text(M("ICCPROFCREATOR_ILL_TOOLTIP")); + mainGrid->attach(*cIlluminant, 1, 5, 1, 1); + + //--------------------------------- V2 or V4 profiles + + Gtk::Label* proflab = Gtk::manage(new Gtk::Label(M("ICCPROFCREATOR_ICCVERSION"))); + setExpandAlignProperties(proflab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); + mainGrid->attach(*proflab, 0, 6, 1, 1); + iccVersion = Gtk::manage(new MyComboBoxText()); + setExpandAlignProperties(iccVersion, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); + iccVersion->append(M("ICCPROFCREATOR_PROF_V4")); + iccVersion->append(M("ICCPROFCREATOR_PROF_V2")); + mainGrid->attach(*iccVersion, 1, 6, 1, 1); + + //--------------------------------- Description + + Gtk::Label* desclab = Gtk::manage(new Gtk::Label(M("ICCPROFCREATOR_DESCRIPTION"))); + setExpandAlignProperties(desclab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_START); + mainGrid->attach(*desclab, 0, 7, 1, 2); + eDescription = Gtk::manage(new Gtk::Entry()); + setExpandAlignProperties(eDescription, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + eDescription->set_tooltip_text(M("ICCPROFCREATOR_DESCRIPTION_TOOLTIP")); + mainGrid->attach(*eDescription, 1, 7, 1, 1); + cAppendParamsToDesc = Gtk::manage(new Gtk::CheckButton(M("ICCPROFCREATOR_DESCRIPTION_ADDPARAM"))); + setExpandAlignProperties(cAppendParamsToDesc, true, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); + mainGrid->attach(*cAppendParamsToDesc, 1, 8, 1, 1); + + //--------------------------------- Copyright + + Gtk::Label* copylab = Gtk::manage(new Gtk::Label(M("ICCPROFCREATOR_COPYRIGHT"))); + setExpandAlignProperties(copylab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); + mainGrid->attach(*copylab, 0, 9, 1, 1); + Gtk::Grid* copygrid = Gtk::manage(new Gtk::Grid()); + setExpandAlignProperties(copygrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + eCopyright = Gtk::manage(new Gtk::Entry()); + setExpandAlignProperties(eCopyright, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + copygrid->attach(*eCopyright, 0, 0, 1, 1); + resetCopyright = Gtk::manage(new Gtk::Button()); + resetCopyright->add(*Gtk::manage(new RTImage("undo-small.png", "redo-small.png"))); + setExpandAlignProperties(resetCopyright, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); + resetCopyright->set_relief(Gtk::RELIEF_NONE); + resetCopyright->set_tooltip_markup(M("ICCPROFCREATOR_COPYRIGHT_RESET_TOOLTIP")); + resetCopyright->get_style_context()->add_class(GTK_STYLE_CLASS_FLAT); + resetCopyright->set_can_focus(false); + copygrid->attach(*resetCopyright, 1, 0, 1, 1); + mainGrid->attach(*copygrid, 1, 9, 1, 1); + + //--------------------------------- Adding the mainGrid + + get_content_area()->add(*mainGrid); + + //--------------------------------- Setting default values for Adjusters + + aGamma->setDefault(gamma); + aSlope->setDefault(slope); + aPrimariesRedX->setDefault(redPrimaryX); + aPrimariesRedY->setDefault(redPrimaryY); + aPrimariesGreenX->setDefault(greenPrimaryX); + aPrimariesGreenY->setDefault(greenPrimaryY); + aPrimariesBlueX->setDefault(bluePrimaryX); + aPrimariesBlueY->setDefault(bluePrimaryY); + + //--------------- Updating widgets with actual values (from options) + + if (primariesPreset == "custom") { + primaries->set_active_text(M("ICCPROFCREATOR_CUSTOM")); + } else if (primariesPreset == "ACES-AP0") { + primaries->set_active_text(M("ICCPROFCREATOR_PRIM_ACESP0")); + } else if (primariesPreset == "ACES-AP1") { + primaries->set_active_text(M("ICCPROFCREATOR_PRIM_ACESP1")); + } else if (primariesPreset == "Adobe") { + primaries->set_active_text(M("ICCPROFCREATOR_PRIM_ADOBE")); + } else if (primariesPreset == "ProPhoto") { + primaries->set_active_text(M("ICCPROFCREATOR_PRIM_PROPH")); + } else if (primariesPreset == "Rec2020") { + primaries->set_active_text(M("ICCPROFCREATOR_PRIM_REC2020")); + } else if (primariesPreset == "sRGB") { + primaries->set_active_text(M("ICCPROFCREATOR_PRIM_SRGB")); + } else if (primariesPreset == "Widegamut") { + primaries->set_active_text(M("ICCPROFCREATOR_PRIM_WIDEG")); + } else if (primariesPreset == "BestRGB") { + primaries->set_active_text(M("ICCPROFCREATOR_PRIM_BEST")); + } else if (primariesPreset == "BetaRGB") { + primaries->set_active_text(M("ICCPROFCREATOR_PRIM_BETA")); + } else if (primariesPreset == "BruceRGB") { + primaries->set_active_text(M("ICCPROFCREATOR_PRIM_BRUCE")); + } + + trcPresets->set_active(0); + + if (gammaPreset != "Custom") { + trcPresets->set_active_text(gammaPreset); + } + + aGamma->setValue(gamma); + aSlope->setValue(slope); + aPrimariesRedX->setValue(redPrimaryX); + aPrimariesRedY->setValue(redPrimaryY); + aPrimariesGreenX->setValue(greenPrimaryX); + aPrimariesGreenY->setValue(greenPrimaryY); + aPrimariesBlueX->setValue(bluePrimaryX); + aPrimariesBlueY->setValue(bluePrimaryY); + + eDescription->set_text(description); + eCopyright->set_text(copyright); + cAppendParamsToDesc->set_active(appendParamsToDesc); + + if (illuminant == "DEF") { + cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_DEF")); + } else if (illuminant == "D41") { + cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_41")); + } else if (illuminant == "D50") { + cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_50")); + } else if (illuminant == "D55") { + cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_55")); + } else if (illuminant == "D60") { + cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_60")); + } else if (illuminant == "D65") { + cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_65")); + } else if (illuminant == "D80") { + cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_80")); + } else if (illuminant == "stdA") { + cIlluminant->set_active_text(M("ICCPROFCREATOR_ILL_INC")); + } + + iccVersion->set_active(0); + + if (profileVersion == "v2") { + iccVersion->set_active(1); + } + + trcPresetsChanged(); + illuminantChanged(); + primariesChanged(); + + //--------------- Action area button + + Gtk::Button* save = Gtk::manage(new Gtk::Button(M("GENERAL_SAVE_AS"))); + save->signal_clicked().connect(sigc::mem_fun(*this, &ICCProfileCreator::savePressed)); + get_action_area()->pack_start(*save); + + Gtk::Button* close = Gtk::manage(new Gtk::Button(M("GENERAL_CLOSE"))); + close->signal_clicked().connect(sigc::mem_fun(*this, &ICCProfileCreator::closePressed)); + get_action_area()->pack_start(*close); + + //--------------- Show childrens + + show_all_children(); + + //--------------- Connecting the signals + + aPrimariesRedX->setAdjusterListener(this); + aPrimariesRedY->setAdjusterListener(this); + aPrimariesGreenX->setAdjusterListener(this); + aPrimariesGreenY->setAdjusterListener(this); + aPrimariesBlueX->setAdjusterListener(this); + aPrimariesBlueY->setAdjusterListener(this); + aGamma->setAdjusterListener(this); + aSlope->setAdjusterListener(this); + primariesconn = primaries->signal_changed().connect(sigc::mem_fun(*this, &ICCProfileCreator::primariesChanged)); + trcpresetsconn = trcPresets->signal_changed().connect(sigc::mem_fun(*this, &ICCProfileCreator::trcPresetsChanged)); + illconn = cIlluminant->signal_changed().connect(sigc::mem_fun(*this, &ICCProfileCreator::illuminantChanged)); + resetCopyright->signal_clicked().connect(sigc::mem_fun(*this, &ICCProfileCreator::onResetCopyright)); +} + +void ICCProfileCreator::closePressed() +{ + storeValues(); + hide(); +} + +void ICCProfileCreator::updateICCVersion() +{ +// if (cIlluminant->get_active_text() != M("ICCPROFCREATOR_ILL_DEF") || primaries->get_active_text() == M("ICCPROFCREATOR_CUSTOM")) { + // iccVersion->set_active_text(M("ICCPROFCREATOR_PROF_V4")); + // iccVersion->set_sensitive(false); +// } else { + // iccVersion->set_sensitive(true); +// } + + iccVersion->set_sensitive(true); +} + +void ICCProfileCreator::adjusterChanged(Adjuster* a, double newval) +{ + if (a == aPrimariesRedX || a == aPrimariesRedY || + a == aPrimariesGreenX || a == aPrimariesGreenY || + a == aPrimariesBlueX || a == aPrimariesBlueY) { + if (primaries->get_active_row_number() > 0) { + ConnectionBlocker blocker(primariesconn); + primaries->set_active(0); + updateICCVersion(); + } + } else if (a == aGamma || a == aSlope) { + if (trcPresets->get_active_row_number() > 0) { + ConnectionBlocker blocker(trcpresetsconn); + trcPresets->set_active(0); + } + } +} + +void ICCProfileCreator::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + +void ICCProfileCreator::primariesChanged() +{ + if (primaries->get_active_row_number() > 0) { + double p[6]; + ColorTemp temp; + Glib::ustring activeValue = primaries->get_active_text(); + Glib::ustring primPresetName = getPrimariesPresetName(activeValue); + getPrimaries(primPresetName, p, temp); + aPrimariesRedX->setValue(p[0]); + aPrimariesRedY->setValue(p[1]); + aPrimariesGreenX->setValue(p[2]); + aPrimariesGreenY->setValue(p[3]); + aPrimariesBlueX->setValue(p[4]); + aPrimariesBlueY->setValue(p[5]); + } + + updateICCVersion(); +} + +void ICCProfileCreator::illuminantChanged() +{ + updateICCVersion(); +} + +void ICCProfileCreator::trcPresetsChanged() +{ + aGamma->block(true); + aSlope->block(true); + + double gamma; + double slope; + getGamma(getGammaPresetName(trcPresets->get_active_text()), gamma, slope); + aGamma->setValue(gamma); + aSlope->setValue(slope); + + aGamma->block(false); + aSlope->block(false); +} + +void ICCProfileCreator::storeValues() +{ + if (iccVersion->get_active_text() == M("ICCPROFCREATOR_PROF_V4")) { + options.ICCPC_profileVersion = profileVersion = "v4"; + } else if (iccVersion->get_active_text() == M("ICCPROFCREATOR_PROF_V2")) { + options.ICCPC_profileVersion = profileVersion = "v2"; + } + + if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_DEF")) { + options.ICCPC_illuminant = illuminant = "DEF"; + } else if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_41")) { + options.ICCPC_illuminant = illuminant = "D41"; + } else if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_50")) { + options.ICCPC_illuminant = illuminant = "D50"; + } else if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_55")) { + options.ICCPC_illuminant = illuminant = "D55"; + } else if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_60")) { + options.ICCPC_illuminant = illuminant = "D60"; + } else if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_65")) { + options.ICCPC_illuminant = illuminant = "D65"; + } else if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_80")) { + options.ICCPC_illuminant = illuminant = "D80"; + } else if (cIlluminant->get_active_text() == M("ICCPROFCREATOR_ILL_INC")) { + options.ICCPC_illuminant = illuminant = "stdA"; + } + + options.ICCPC_primariesPreset = primariesPreset = getPrimariesPresetName(primaries->get_active_text()); + options.ICCPC_gammaPreset = gammaPreset = getGammaPresetName(trcPresets->get_active_text()); + options.ICCPC_gamma = gamma = aGamma->getValue(); + options.ICCPC_slope = slope = aSlope->getValue(); + options.ICCPC_redPrimaryX = redPrimaryX = aPrimariesRedX->getValue(); + options.ICCPC_redPrimaryY = redPrimaryY = aPrimariesRedY->getValue(); + options.ICCPC_greenPrimaryX = greenPrimaryX = aPrimariesGreenX->getValue(); + options.ICCPC_greenPrimaryY = greenPrimaryY = aPrimariesGreenY->getValue(); + options.ICCPC_bluePrimaryX = bluePrimaryX = aPrimariesBlueX->getValue(); + options.ICCPC_bluePrimaryY = bluePrimaryY = aPrimariesBlueY->getValue(); + options.ICCPC_description = description = eDescription->get_text(); + options.ICCPC_copyright = copyright = eCopyright->get_text(); + options.ICCPC_appendParamsToDesc = appendParamsToDesc = cAppendParamsToDesc->get_active(); +} + +Glib::ustring ICCProfileCreator::getPrimariesPresetName(const Glib::ustring &preset) +{ + if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_ACESP0")) { + return Glib::ustring("ACES-AP0"); + } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_ACESP1")) { + return Glib::ustring("ACES-AP1"); + } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_ADOBE")) { + return Glib::ustring("Adobe"); + } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_PROPH")) { + return Glib::ustring("ProPhoto"); + } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_REC2020")) { + return Glib::ustring("Rec2020"); + } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_SRGB")) { + return Glib::ustring("sRGB"); + } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_WIDEG")) { + return Glib::ustring("Widegamut"); + } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_BEST")) { + return Glib::ustring("BestRGB"); + } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_BETA")) { + return Glib::ustring("BetaRGB"); + } else if (primaries->get_active_text() == M("ICCPROFCREATOR_PRIM_BRUCE")) { + return Glib::ustring("BruceRGB"); + } else if (primaries->get_active_text() == M("ICCPROFCREATOR_CUSTOM")) { + return Glib::ustring("custom"); + } else { + return Glib::ustring(); + } +} + +void ICCProfileCreator::getPrimaries(const Glib::ustring &preset, double *p, ColorTemp &temp) +{ + temp = ColorTemp::D50; + + if (preset == "Widegamut") { + p[0] = 0.7350; //Widegamut primaries + p[1] = 0.2650; + p[2] = 0.1150; + p[3] = 0.8260; + p[4] = 0.1570; + p[5] = 0.0180; + + } else if (preset == "Adobe") { + p[0] = 0.6400; //Adobe primaries + p[1] = 0.3300; + p[2] = 0.2100; + p[3] = 0.7100; + p[4] = 0.1500; + p[5] = 0.0600; + temp = ColorTemp::D65; + } else if (preset == "sRGB") { + p[0] = 0.6400; // sRGB primaries + p[1] = 0.3300; + p[2] = 0.3000; + p[3] = 0.6000; + p[4] = 0.1500; + p[5] = 0.0600; + temp = ColorTemp::D65; + } else if (preset == "BruceRGB") { + p[0] = 0.6400; // Bruce primaries + p[1] = 0.3300; + p[2] = 0.2800; + p[3] = 0.6500; + p[4] = 0.1500; + p[5] = 0.0600; + temp = ColorTemp::D65; + } else if (preset == "BetaRGB") { + p[0] = 0.6888; // Beta primaries + p[1] = 0.3112; + p[2] = 0.1986; + p[3] = 0.7551; + p[4] = 0.1265; + p[5] = 0.0352; + } else if (preset == "BestRGB") { + p[0] = 0.7347; // Best primaries + p[1] = 0.2653; + p[2] = 0.2150; + p[3] = 0.7750; + p[4] = 0.1300; + p[5] = 0.0350; + } else if (preset == "Rec2020") { + p[0] = 0.7080; // Rec2020 primaries + p[1] = 0.2920; + p[2] = 0.1700; + p[3] = 0.7970; + p[4] = 0.1310; + p[5] = 0.0460; + temp = ColorTemp::D65; + } else if (preset == "ACES-AP0") { + p[0] = 0.7347; // ACES P0 primaries + p[1] = 0.2653; + p[2] = 0.0000; + p[3] = 1.0; + p[4] = 0.0001; + p[5] = -0.0770; + temp = ColorTemp::D60; + } else if (preset == "ACES-AP1") { + p[0] = 0.713; // ACES P1 primaries + p[1] = 0.293; + p[2] = 0.165; + p[3] = 0.830; + p[4] = 0.128; + p[5] = 0.044; + temp = ColorTemp::D60; + } else if (preset == "ProPhoto") { + p[0] = 0.7347; // ProPhoto and default primaries + p[1] = 0.2653; + p[2] = 0.1596; + p[3] = 0.8404; + p[4] = 0.0366; + p[5] = 0.0001; + } else if (preset == "custom") { + p[0] = redPrimaryX; + p[1] = redPrimaryY; + p[2] = greenPrimaryX; + p[3] = greenPrimaryY; + p[4] = bluePrimaryX; + p[5] = bluePrimaryY; + + } else { + p[0] = 0.7347; //default primaries + p[1] = 0.2653; + p[2] = 0.1596; + p[3] = 0.8404; + p[4] = 0.0366; + p[5] = 0.0001; + } +} + +Glib::ustring ICCProfileCreator::getGammaPresetName(const Glib::ustring &preset) +{ + Glib::ustring name(trcPresets->get_active_text()); + + if (name == M("ICCPROFCREATOR_CUSTOM")) { + name = "Custom"; + } + + return name; +} + +void ICCProfileCreator::getGamma(const Glib::ustring &preset, double &presetGamma, double &presetSlope) +{ + if (preset == "High_g1.3_s3.35") { + presetGamma = 1.3; + presetSlope = 3.35; + } else if (preset == "Low_g2.6_s6.9") { + presetGamma = 2.6; + presetSlope = 6.9; + } else if (preset == "sRGB_g2.4_s12.92") { + presetGamma = 2.4; + presetSlope = 12.92310; + } else if (preset == "BT709_g2.2_s4.5") { + presetGamma = 2.22; + presetSlope = 4.5; + } else if (preset == "linear_g1.0") { + presetGamma = 1.; + presetSlope = 0.; + } else if (preset == "standard_g2.2") { + presetGamma = 2.2; + presetSlope = 0.; + } else if (preset == "standard_g1.8") { + presetGamma = 1.8; + presetSlope = 0.; + } else if (preset == "Lab_g3.0s9.03296") { + presetGamma = 3.0; + presetSlope = 9.03296; + } else if (preset == "Custom") { + presetGamma = gamma; + presetSlope = slope; + } else { + presetGamma = 2.4; + presetSlope = 12.92310; + } +} + +void ICCProfileCreator::onResetCopyright() +{ + eCopyright->set_text(Options::getICCProfileCopyright()); +} + +// Copyright (c) 2018 Jacques DESMIS +// WARNING: the caller must lock lcmsMutex +void ICCProfileCreator::savePressed() +{ + cmsHPROFILE newProfile = nullptr; + cmsHPROFILE profile_v2_except = nullptr; + + Glib::ustring sNewProfile; + Glib::ustring sPrimariesPreset; + Glib::ustring sGammaPreset; + + storeValues(); + + // -------------------------------------------- Compute the default file name + // -----------------setmedia white point for monitor profile sRGB or AdobeRGB in case of profile used for monitor--------------------- + //instead of calculations made by LCMS..small differences + bool isD65 = (primariesPreset == "sRGB" || primariesPreset == "Adobe" || primariesPreset == "Rec2020" || primariesPreset == "BruceRGB"); + bool isD60 = (primariesPreset == "ACES-AP1" || primariesPreset == "ACES-AP0"); + bool isD50 = (primariesPreset == "ProPhoto" || primariesPreset == "Widegamut" || primariesPreset == "BestRGB" || primariesPreset == "BetaRGB"); + // v2except = (profileVersion == "v2" && (primariesPreset == "sRGB" || primariesPreset == "Adobe" || primariesPreset == "Rec2020" || primariesPreset == "BruceRGB" || primariesPreset == "ACES-AP1" || primariesPreset == "ACES-AP0") && illuminant == "DEF"); + // v2except = (profileVersion == "v2" && (isD65 || isD60 || isD50) && illuminant == "DEF"); + v2except = (profileVersion == "v2");// && (isD65 || isD60 || isD50)); + + //necessary for V2 profile + + if (!v2except) { + std::string is_RTv4 = ""; + + //used partially for v4, and in case of if we want to back to old manner for v2 + if (primariesPreset == "ACES-AP0" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESp0)) { + sNewProfile = options.rtSettings.ACESp0; + sPrimariesPreset = "ACES-AP0"; + } else if (primariesPreset == "ACES-AP1" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.ACESp1)) { + sNewProfile = options.rtSettings.ACESp1; + sPrimariesPreset = "ACES-AP1"; + } else if (primariesPreset == "Adobe" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.adobe)) { + sNewProfile = options.rtSettings.adobe; + sPrimariesPreset = "Medium"; + } else if (primariesPreset == "ProPhoto" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.prophoto)) { + is_RTv4 = options.rtSettings.prophoto.substr(0, 4); + + if (is_RTv4 == "RTv4") { + options.rtSettings.prophoto = "RTv2_Large"; + }; + + sNewProfile = options.rtSettings.prophoto; + + sPrimariesPreset = "Large"; + } else if (primariesPreset == "Rec2020" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.rec2020)) { + sNewProfile = options.rtSettings.rec2020; + sPrimariesPreset = "Rec2020"; + } else if (primariesPreset == "sRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.srgb)) { + sNewProfile = options.rtSettings.srgb; + sPrimariesPreset = "sRGB"; + } else if (primariesPreset == "Widegamut" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.widegamut)) { + is_RTv4 = options.rtSettings.widegamut.substr(0, 4); + + if (is_RTv4 == "RTv4") { + options.rtSettings.widegamut = "RTv2_Wide"; + }; + + sNewProfile = options.rtSettings.widegamut; + + sPrimariesPreset = "Wide"; + } else if (primariesPreset == "BestRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.best)) { + is_RTv4 = options.rtSettings.best.substr(0, 4); + + if (is_RTv4 == "RTv4") { + options.rtSettings.best = "RTv2_Best"; + }; + + sNewProfile = options.rtSettings.best; + + sPrimariesPreset = "Best"; + } else if (primariesPreset == "BetaRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.beta)) { + sNewProfile = options.rtSettings.beta; + is_RTv4 = options.rtSettings.beta.substr(0, 4); + + if (is_RTv4 == "RTv4") { + options.rtSettings.widegamut = "RTv2_Beta"; + }; + + sPrimariesPreset = "Beta"; + } else if (primariesPreset == "BruceRGB" && rtengine::ICCStore::getInstance()->outputProfileExist(options.rtSettings.bruce)) { + sNewProfile = options.rtSettings.bruce; + sPrimariesPreset = "Bruce"; + } else if (primariesPreset == "custom") { + sNewProfile = options.rtSettings.srgb; + sPrimariesPreset = "Custom"; + } else { + // Should not occurs + if (rtengine::settings->verbose) { + printf("\"%s\": unknown working profile! - use LCMS2 substitution\n", primariesPreset.c_str()); + } + + return; + } + } else { + //new model for v2 profile different from D50 by entering directly XYZ values and media white point + sNewProfile = "RTv2_Beta";//for copy generate others v2 profile. To change date of new profile, I used "ICC profile inspector" and "save as" + + if (primariesPreset == "ACES-AP0") { + sPrimariesPreset = "ACES-AP0"; + } else if (primariesPreset == "ACES-AP1") { + sPrimariesPreset = "ACES-AP1"; + } else if (primariesPreset == "Adobe") { + sPrimariesPreset = "Medium"; + } else if (primariesPreset == "Rec2020") { + sPrimariesPreset = "Rec2020"; + } else if (primariesPreset == "BruceRGB") { + sPrimariesPreset = "Bruce"; + } else if (primariesPreset == "sRGB") { + sPrimariesPreset = "sRGB"; + } else if (primariesPreset == "ProPhoto") { + sPrimariesPreset = "Large"; + } else if (primariesPreset == "Widegamut") { + sPrimariesPreset = "Wide"; + } else if (primariesPreset == "BestRGB") { + sPrimariesPreset = "Best"; + } else if (primariesPreset == "BetaRGB") { + sPrimariesPreset = "Beta"; + } else if (primariesPreset == "custom") { + sPrimariesPreset = "Custom"; + } + } + + //begin adaptation rTRC gTRC bTRC + //"newProfile" profile has the same characteristics than RGB values, but TRC are adapted... for applying profile + if (rtengine::settings->verbose) { + printf("Output Gamma - profile Primaries as RT profile: \"%s\"\n", sNewProfile.c_str()); + } + + if (!v2except) { + newProfile = rtengine::ICCStore::getInstance()->getProfile(sNewProfile); //get output profile + } else { + profile_v2_except = rtengine::ICCStore::getInstance()->getProfile(sNewProfile); //get output profile + + } + + /* + if (newProfile == nullptr ) { + + if (rtengine::settings->verbose) { + printf("\"%s\" ICC output profile not found!\n", sNewProfile.c_str()); + } + + return; + } + */ + //change desc Tag , to "free gamma", or "BT709", etc. + Glib::ustring fName; + Glib::ustring sPrimariesAndIlluminant; + double presetGamma = 2.4; + double presetSlope = 12.92310; + const double eps = 0.000000001; // not divide by zero + getGamma(gammaPreset, presetGamma, presetSlope); + + if (gammaPreset == "High_g1.3_s3.35") { + sGammaPreset = "High_g=1.3_s=3.35"; + ga[0] = 1.3 ; //for high dynamic images + ga[1] = 0.998279; + ga[2] = 0.001721; + ga[3] = 0.298507; + ga[4] = 0.005746; + presetGamma = 1.3; + presetSlope = 3.35; + + } else if (gammaPreset == "Low_g2.6_s6.9") { + sGammaPreset = "Low_g=2.6_s=6.9"; + ga[0] = 2.6 ; //gamma 2.6 variable : for low contrast images + ga[1] = 0.891161; + ga[2] = 0.108839; + ga[3] = 0.144928; + ga[4] = 0.076332; + presetGamma = 2.6; + presetSlope = 6.9; + + } else if (gammaPreset == "sRGB_g2.4_s12.92") { + sGammaPreset = "sRGB_g=2.4_s=12.92310"; + ga[0] = 2.40; //sRGB 2.4 12.92 - RT default as Lightroom + ga[1] = 0.947858; + ga[2] = 0.052142; + ga[3] = 0.077399; + ga[4] = 0.039293; + presetGamma = 2.4; + presetSlope = 12.92310; + + } else if (gammaPreset == "BT709_g2.2_s4.5") { + sGammaPreset = "BT709_g=2.2_s=4.5"; + ga[0] = 2.22; //BT709 2.2 4.5 - my preferred as D.Coffin + ga[1] = 0.909995; + ga[2] = 0.090005; + ga[3] = 0.222222; + ga[4] = 0.081071; + presetGamma = 2.2; + presetSlope = 4.5; + + } else if (gammaPreset == "linear_g1.0") { + sGammaPreset = "Linear_g=1.0"; + ga[0] = 1.0; //gamma=1 linear : for high dynamic images (cf D.Coffin...) + ga[1] = 1.; + ga[2] = 0.; + ga[3] = 1. / eps; + ga[4] = 0.; + presetGamma = 1.0; + presetSlope = 0.0; + + } else if (gammaPreset == "standard_g2.2") { + sGammaPreset = "g=2.2"; + ga[0] = 2.2; //gamma=2.2(as gamma of Adobe, Widegamut...) + ga[1] = 1.; + ga[2] = 0.; + ga[3] = 1. / eps; + ga[4] = 0.; + presetGamma = 2.19921875; + presetSlope = 0.0; + } else if (gammaPreset == "standard_g1.8") { + sGammaPreset = "g=1.8"; + ga[0] = 1.8; //gamma=1.8(as gamma of Prophoto) + ga[1] = 1.; + ga[2] = 0.; + ga[3] = 1. / eps; + ga[4] = 0.; + presetGamma = 1.80078125; + presetSlope = 0.0; + + } else if (gammaPreset == "Lab_g3.0s9.03296") { + sGammaPreset = "LAB_g3.0_s9.03296"; + ga[0] = 3.0; //Lab gamma =3 slope=9.03296 + ga[1] = 0.8621; + ga[2] = 0.1379; + ga[3] = 0.1107; + ga[4] = 0.08; + presetGamma = 3.0; + presetSlope = 9.03926; + + } else if (gammaPreset == "Custom") { + rtengine::GammaValues g_a; //gamma parameters + double pwr = 1.0 / gamma; + double ts = slope; + double slope2 = slope == 0 ? eps : slope; + + int mode = 0; + rtengine::Color::calcGamma(pwr, ts, mode, g_a); // call to calcGamma with selected gamma and slope : return parameters for LCMS2 + ga[4] = g_a[3] * ts; + //printf("g_a.gamma0=%f g_a.gamma1=%f g_a.gamma2=%f g_a.gamma3=%f g_a.gamma4=%f\n", g_a.gamma0,g_a.gamma1,g_a.gamma2,g_a.gamma3,g_a.gamma4); + ga[0] = gamma; + ga[1] = 1. / (1.0 + g_a[4]); + ga[2] = g_a[4] / (1.0 + g_a[4]); + ga[3] = 1. / slope2; + //printf("ga[0]=%f ga[1]=%f ga[2]=%f ga[3]=%f ga[4]=%f\n", ga[0],ga[1],ga[2],ga[3],ga[4]); + + sGammaPreset = Glib::ustring::compose("g%1_s%2", + Glib::ustring::format(std::setw(6), std::fixed, std::setprecision(6), gamma), + Glib::ustring::format(std::setw(6), std::fixed, std::setprecision(5), slope)); + presetGamma = gamma; + presetSlope = slope; + } + + ga[5] = 0.0; + ga[6] = 0.0; + + + sPrimariesAndIlluminant = sPrimariesPreset; + + if (profileVersion == "v4" && illuminant != "DEF") { + sPrimariesPreset += "-" + illuminant; + } + + Glib::ustring profileDesc; + Glib::ustring sGammaSlopeParam;//to save gamma and slope in a dmdd + Glib::ustring sGammaSlopeDesc; //to save gamma and slope in a desc + Glib::ustring sGamma; + Glib::ustring sSlope; + + if (gammaPreset == "Custom") { + sGamma = Glib::ustring::format(std::setw(6), std::fixed, std::setprecision(6), gamma); + sSlope = Glib::ustring::format(std::setw(6), std::fixed, std::setprecision(5), slope); + fName = Glib::ustring::compose("RT%1_%2_g%3_s%4.icc", profileVersion, sPrimariesAndIlluminant, sGamma, sSlope); + profileDesc = sPrimariesPreset; + } else { + sGamma = Glib::ustring::format(std::setw(6), std::fixed, std::setprecision(6), presetGamma); + sSlope = Glib::ustring::format(std::setw(6), std::fixed, std::setprecision(5), presetSlope); + fName = Glib::ustring::compose("RT%1_%2_%3.icc", profileVersion, sPrimariesAndIlluminant, sGammaPreset); + profileDesc = sPrimariesPreset + sGammaPreset; + } + + sGammaSlopeParam = Glib::ustring::compose("g%1s%2!", sGamma, sSlope); + sGammaSlopeDesc = Glib::ustring::compose("g=%1 s=%2", sGamma, sSlope); + + // -------------------------------------------- Asking the file name + + Gtk::FileChooserDialog dialog(getToplevelWindow(this), M("ICCPROFCREATOR_SAVEDIALOG_TITLE"), Gtk::FILE_CHOOSER_ACTION_SAVE); + bindCurrentFolder(dialog, options.lastICCProfCreatorDir); + dialog.set_current_name(fName); + //dialog.set_current_folder(lastPath); + + dialog.add_button(M("GENERAL_CANCEL"), Gtk::RESPONSE_CANCEL); + dialog.add_button(M("GENERAL_SAVE"), Gtk::RESPONSE_OK); + + Glib::RefPtr filter_icc = Gtk::FileFilter::create(); + filter_icc->set_name(M("FILECHOOSER_FILTER_COLPROF")); + filter_icc->add_pattern("*.icc"); + dialog.add_filter(filter_icc); + + /* + Glib::RefPtr filter_any = Gtk::FileFilter::create(); + filter_any->set_name(M("FILECHOOSER_FILTER_ANY")); + filter_any->add_pattern("*"); + dialog.add_filter(filter_any); + */ + + dialog.show_all_children(); + //dialog.set_do_overwrite_confirmation (true); + + Glib::ustring absoluteFName; + + do { + int result = dialog.run(); + + if (result != Gtk::RESPONSE_OK) { + return; + } else { + absoluteFName = dialog.get_filename(); + Glib::ustring ext = getExtension(absoluteFName); + + if (ext != "icc") { + absoluteFName += ".icc"; + } + + if (confirmOverwrite(dialog, absoluteFName)) { + //lastPath = Glib::path_get_dirname(absoluteFName); + break; + } + } + } while (1); + + // --------------- main tags ------------------ + /* + if (profileVersion == "v4") { + cmsSetProfileVersion(newProfile, 4.3); + } else { + cmsSetProfileVersion(newProfile, 2.0); + } + */ + +//change + double p[6]; //primaries + ga[6] = 0.0; + + ColorTemp temp; + getPrimaries(primariesPreset, p, temp); + + cmsCIExyY xyD; + cmsCIExyYTRIPLE Primaries = { + {p[0], p[1], 1.0}, // red + {p[2], p[3], 1.0}, // green + {p[4], p[5], 1.0} // blue + }; + + if (v2except) { + cmsSetDeviceClass(profile_v2_except, cmsSigDisplayClass); + cmsSetPCS(profile_v2_except, cmsSigXYZData); + cmsSetHeaderRenderingIntent(profile_v2_except, 0); + } + + + if (profileVersion == "v4" && illuminant != "DEF") { + double tempv4 = 5000.; + + if (illuminant == "D41") { + tempv4 = 4100.; + } else if (illuminant == "D50") { + tempv4 = 5003.; + } else if (illuminant == "D55") { + tempv4 = 5500.; + } else if (illuminant == "D60") { + tempv4 = 6004.; + } else if (illuminant == "D65") { + tempv4 = 6504.; + } else if (illuminant == "D80") { + tempv4 = 8000.; + } else if (illuminant == "stdA") { + tempv4 = 5003.; + } + + cmsWhitePointFromTemp(&xyD, tempv4); + + if (illuminant == "D65") { + xyD = {0.312700492, 0.329000939, 1.0}; + } + + if (illuminant == "D60") { + xyD = {0.32168, 0.33767, 1.0}; + } + + if (illuminant == "D50") { + xyD = {0.3457, 0.3585, 1.0};//white D50 near LCMS values but not perfect...it's a compromise!! + } + + if (illuminant == "stdA") { + xyD = {0.447573, 0.407440, 1.0}; + } + + } else { + if (v2except) { + + cmsCIEXYZ XYZ; + double Wx = 1.0; + double Wy = 1.0; + double Wz = 1.0; + + if (illuminant == "DEF") { + { + Wx = 0.95045471; + Wz = 1.08905029; + XYZ = {Wx, 1.0, Wz};//white D65 + } + + if (primariesPreset == "ACES-AP1" || primariesPreset == "ACES-AP0") { + Wx = 0.952646075; + Wz = 1.008825184; + XYZ = {Wx, 1.0, Wz};//white D60 + } + + if (isD50) { + Wx = 0.964295676; + Wz = 0.825104603; + XYZ = {Wx, 1.0, Wz};//white D50 room (prophoto) near LCMS values but not perfect...it's a compromise!! + } + } else { + if (illuminant == "D65") { + Wx = 0.95045471; + Wz = 1.08905029; + } else if (illuminant == "D50") { + Wx = 0.964295676; + Wz = 0.825104603; + } else if (illuminant == "D55") { + Wx = 0.956565934; + Wz = 0.920253249; + } else if (illuminant == "D60") { + Wx = 0.952646075; + Wz = 1.008825184; + } else if (illuminant == "D41") { + Wx = 0.991488263; + Wz = 0.631604625; + } else if (illuminant == "D80") { + Wx = 0.950095542; + Wz = 1.284213976; + } else if (illuminant == "stdA") { + Wx = 1.098500393; + Wz = 0.355848714; + } + + XYZ = {Wx, 1.0, Wz}; + + } + + cmsCIExyY blackpoint; + + { + blackpoint = {0., 0., 0.}; + } + + cmsWriteTag(profile_v2_except, cmsSigMediaBlackPointTag, &blackpoint); + cmsWriteTag(profile_v2_except, cmsSigMediaWhitePointTag, &XYZ); + cmsCIEXYZ rt; + cmsCIEXYZ bt; + cmsCIEXYZ gt; + + //calculate XYZ matrix for each primaries and each temp (D50, D65...) + + // reduce coordonate of primaries + //printf("p0=%f p1=%f p2=%f p3=%f p4=%f p5=%f \n", p[0], p[1], p[2], p[3],p[4], p[5]); + double Xr = p[0] / p[1]; + double Yr = 1.0; + double Zr = (1.0 - p[0] - p[1]) / p[1]; + double Xg = p[2] / p[3]; + double Yg = 1.0; + double Zg = (1.0 - p[2] - p[3]) / p[3]; + double Xb = p[4] / p[5]; + double Yb = 1.0; + double Zb = (1.0 - p[4] - p[5]) / p[5]; + + using Triple = std::array; + + using Matrix = std::array; + + Matrix input_prim; + Matrix inv_input_prim = {}; + + input_prim[0][0] = Xr; + input_prim[0][1] = Yr; + input_prim[0][2] = Zr; + input_prim[1][0] = Xg; + input_prim[1][1] = Yg; + input_prim[1][2] = Zg; + input_prim[2][0] = Xb; + input_prim[2][1] = Yb; + input_prim[2][2] = Zb; + + //printf("in=%f in01=%f in22=%f\n", input_prim[0][0], input_prim[0][1], input_prim[2][2]); + if (!rtengine::invertMatrix(input_prim, inv_input_prim)) { + std::cout << "Matrix is not invertible, skipping" << std::endl; + } + + //printf("inv=%f inv01=%f inv22=%f\n", inv_input_prim[0][0], inv_input_prim[0][1], inv_input_prim[2][2]); + + //white point D50 used by LCMS + double Wdx = 0.96420; + double Wdy = 1.0; + double Wdz = 0.82490; + + double Sr = Wx * inv_input_prim [0][0] + Wy * inv_input_prim [1][0] + Wz * inv_input_prim [2][0]; + double Sg = Wx * inv_input_prim [0][1] + Wy * inv_input_prim [1][1] + Wz * inv_input_prim [2][1]; + double Sb = Wx * inv_input_prim [0][2] + Wy * inv_input_prim [1][2] + Wz * inv_input_prim [2][2]; + //printf("sr=%f sg=%f sb=%f\n", Sr, Sg, Sb); + + //XYZ matrix for primaries and temp + Matrix mat_xyz = {}; + mat_xyz[0][0] = Sr * Xr; + mat_xyz[0][1] = Sr * Yr; + mat_xyz[0][2] = Sr * Zr; + mat_xyz[1][0] = Sg * Xg; + mat_xyz[1][1] = Sg * Yg; + mat_xyz[1][2] = Sg * Zg; + mat_xyz[2][0] = Sb * Xb; + mat_xyz[2][1] = Sb * Yb; + mat_xyz[2][2] = Sb * Zb; + //printf("mat0=%f mat22=%f\n", mat_xyz[0][0], mat_xyz[2][2]); + + //chromatic adaptation Bradford + Matrix MaBradford = {}; + MaBradford[0][0] = 0.8951; + MaBradford[0][1] = -0.7502; + MaBradford[0][2] = 0.0389; + MaBradford[1][0] = 0.2664; + MaBradford[1][1] = 1.7135; + MaBradford[1][2] = -0.0685; + MaBradford[2][0] = -0.1614; + MaBradford[2][1] = 0.0367; + MaBradford[2][2] = 1.0296; + + Matrix Ma_oneBradford = {}; + Ma_oneBradford[0][0] = 0.9869929; + Ma_oneBradford[0][1] = 0.4323053; + Ma_oneBradford[0][2] = -0.0085287; + Ma_oneBradford[1][0] = -0.1470543; + Ma_oneBradford[1][1] = 0.5183603; + Ma_oneBradford[1][2] = 0.0400428; + Ma_oneBradford[2][0] = 0.1599627; + Ma_oneBradford[2][1] = 0.0492912; + Ma_oneBradford[2][2] = 0.9684867; + + //R G B source + double Rs = Wx * MaBradford[0][0] + Wy * MaBradford[1][0] + Wz * MaBradford[2][0]; + double Gs = Wx * MaBradford[0][1] + Wy * MaBradford[1][1] + Wz * MaBradford[2][1]; + double Bs = Wx * MaBradford[0][2] + Wy * MaBradford[1][2] + Wz * MaBradford[2][2]; + + // R G B destination + double Rd = Wdx * MaBradford[0][0] + Wdy * MaBradford[1][0] + Wdz * MaBradford[2][0]; + double Gd = Wdx * MaBradford[0][1] + Wdy * MaBradford[1][1] + Wdz * MaBradford[2][1]; + double Bd = Wdx * MaBradford[0][2] + Wdy * MaBradford[1][2] + Wdz * MaBradford[2][2]; + + //cone destination + Matrix cone_dest_sourc = {}; + cone_dest_sourc [0][0] = Rd / Rs; + cone_dest_sourc [0][1] = 0.; + cone_dest_sourc [0][2] = 0.; + cone_dest_sourc [1][0] = 0.; + cone_dest_sourc [1][1] = Gd / Gs; + cone_dest_sourc [1][2] = 0.; + cone_dest_sourc [2][0] = 0.; + cone_dest_sourc [2][1] = 0.; + cone_dest_sourc [2][2] = Bd / Bs; + + Matrix cone_ma_one = {}; + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + cone_ma_one[i][j] = 0; + + for (int k = 0; k < 3; ++k) { + cone_ma_one[i][j] += cone_dest_sourc [i][k] * Ma_oneBradford[k][j]; + } + } + } + + //generate adaptation bradford matrix + Matrix adapt_chroma = {}; + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + adapt_chroma [i][j] = 0; + + for (int k = 0; k < 3; ++k) { + adapt_chroma[i][j] += MaBradford[i][k] * cone_ma_one[k][j]; + } + } + } + + //real matrix XYZ for primaries, temp, Bradford + Matrix mat_xyz_brad = {}; + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + mat_xyz_brad[i][j] = 0; + + for (int k = 0; k < 3; ++k) { + mat_xyz_brad[i][j] += mat_xyz[i][k] * adapt_chroma[k][j]; + } + } + } + + +// printf("adc=%1.10f ad2=%1.10f ad22=%1.10f\n", mat_xyz_brad[0][0], mat_xyz_brad[1][0], mat_xyz_brad[2][2]); + //end generate XYZ matrix + + //write tags + rt = {mat_xyz_brad[0][0], mat_xyz_brad[0][1], mat_xyz_brad[0][2]}; + cmsWriteTag(profile_v2_except, cmsSigRedColorantTag, &rt); + gt = {mat_xyz_brad[1][0], mat_xyz_brad[1][1], mat_xyz_brad[1][2]}; + cmsWriteTag(profile_v2_except, cmsSigGreenColorantTag, >); + bt = {mat_xyz_brad[2][0], mat_xyz_brad[2][1], mat_xyz_brad[2][2]}; + cmsWriteTag(profile_v2_except, cmsSigBlueColorantTag, &bt); + + + } else { + cmsWhitePointFromTemp(&xyD, (double)temp); + } + } + + + if (isD65 && illuminant == "DEF") { + xyD = {0.312700492, 0.329000939, 1.0}; + } + + if (isD60 && illuminant == "DEF") { + xyD = {0.32168, 0.33767, 1.0}; + } + + if (isD50 && illuminant == "DEF") { + xyD = {0.3457, 0.3585, 1.0}; + } + + // Calculate output profile's rTRC gTRC bTRC + + + cmsToneCurve* GammaTRC[3]; + + if (gammaPreset == "standard_g2.2") { + GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildGamma(NULL, 2.19921875);//spec Adobe + } else if (gammaPreset == "standard_g1.8") { + GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildGamma(NULL, 1.80078125); + } else if (gammaPreset == "linear_g1.0") { + GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildGamma(NULL, 1.0); + } else if(gammaPreset == "Custom" && slope == 0.0) { + GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildGamma(NULL, gamma); + } else { + GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildParametricToneCurve(nullptr, 5, ga); + } + + + + if (profileVersion == "v4") { + newProfile = cmsCreateRGBProfile(&xyD, &Primaries, GammaTRC); + } else if (profileVersion == "v2") { + if (v2except) { + cmsSetProfileVersion(profile_v2_except, 2.2); + } else { + cmsSetProfileVersion(newProfile, 2.2); + } + } + + if (!v2except) { + cmsWriteTag(newProfile, cmsSigRedTRCTag, GammaTRC[0]); + cmsWriteTag(newProfile, cmsSigGreenTRCTag, GammaTRC[1]); + cmsWriteTag(newProfile, cmsSigBlueTRCTag, GammaTRC[2]); + } else { + cmsWriteTag(profile_v2_except, cmsSigRedTRCTag, GammaTRC[0]); + cmsWriteTag(profile_v2_except, cmsSigGreenTRCTag, GammaTRC[1]); + cmsWriteTag(profile_v2_except, cmsSigBlueTRCTag, GammaTRC[2]); + } + + // --------------- set dmnd tag ------------------ + + cmsMLU *dmnd; + dmnd = cmsMLUalloc(nullptr, 1); + cmsMLUsetASCII(dmnd, "en", "US", "RawTherapee"); + + if (!v2except) { + cmsWriteTag(newProfile, cmsSigDeviceMfgDescTag, dmnd); + } else { + cmsWriteTag(profile_v2_except, cmsSigDeviceMfgDescTag, dmnd); + } + + cmsMLUfree(dmnd); + + + +// --------------- set dmdd tag ------------------ + + if (profileVersion == "v2") { + //write in tag 'dmdd' values of current gamma and slope to retrieve after in Output profile + std::wostringstream wGammaSlopeParam; + wGammaSlopeParam << sGammaSlopeParam; + + cmsMLU *dmdd = cmsMLUalloc(nullptr, 1); + + // Language code (2 letters code) : https://www.iso.org/obp/ui/ + // Country code (2 letters code) : http://www.loc.gov/standards/iso639-2/php/code_list.php + if (sGammaSlopeParam.is_ascii()) { + if (cmsMLUsetASCII(dmdd, "en", "US", sGammaSlopeParam.c_str())) { + if (!v2except) { + if (!cmsWriteTag(newProfile, cmsSigProfileDescriptionTag, dmdd)) { + printf("Error: Can't write cmsSigProfileDescriptionTag!\n"); + } + } else { + if (!cmsWriteTag(profile_v2_except, cmsSigDeviceModelDescTag, dmdd)) { + printf("Error: Can't write cmsSigProfileDescriptionTag!\n"); + } + + } + } + } else if (cmsMLUsetWide(dmdd, "en", "US", wGammaSlopeParam.str().c_str())) { + if (!v2except) { + if (!cmsWriteTag(newProfile, cmsSigDeviceModelDescTag, dmdd)) { + printf("Error: Can't write cmsSigDeviceModelDescTag!\n"); + } + } else { + if (!cmsWriteTag(profile_v2_except, cmsSigDeviceModelDescTag, dmdd)) { + printf("Error: Can't write cmsSigDeviceModelDescTag!\n"); + } + } + } else { + printf("Error: cmsMLUsetWide failed for dmdd \"%s\" !\n", sGammaSlopeParam.c_str()); + } + + cmsMLUfree(dmdd); + } + +// --------------- set desc tag ------------------ + + Glib::ustring sDescription; + + if (!description.empty()) { + if (cAppendParamsToDesc->get_active()) { + sDescription = description + " / " + sGammaSlopeDesc; + } else { + sDescription = description; + } + } else { + if (cAppendParamsToDesc->get_active()) { + sDescription = profileDesc + " / " + sGammaSlopeDesc; + } else { + sDescription = profileDesc; + } + } + +//write in tag 'dmdd' values of current gamma and slope to retrieve after in Output profile + std::wostringstream wDescription; + wDescription << sDescription; + + cmsMLU *descMLU = cmsMLUalloc(nullptr, 1); + +// Language code (2 letters code) : https://www.iso.org/obp/ui/ +// Country code (2 letters code) : http://www.loc.gov/standards/iso639-2/php/code_list.php + if (sDescription.is_ascii()) { + if (cmsMLUsetASCII(descMLU, "en", "US", sDescription.c_str())) { + if (!v2except) { + if (!cmsWriteTag(newProfile, cmsSigProfileDescriptionTag, descMLU)) { + printf("Error: Can't write cmsSigProfileDescriptionTag!\n"); + } + } else { + if (!cmsWriteTag(profile_v2_except, cmsSigProfileDescriptionTag, descMLU)) { + printf("Error: Can't write cmsSigProfileDescriptionTag!\n"); + } + } + } + + } else if (cmsMLUsetWide(descMLU, "en", "US", wDescription.str().c_str())) { + if (!v2except) { + + if (!cmsWriteTag(newProfile, cmsSigProfileDescriptionTag, descMLU)) { + printf("Error: Can't write cmsSigProfileDescriptionTag!\n"); + } + } else { + if (!cmsWriteTag(profile_v2_except, cmsSigProfileDescriptionTag, descMLU)) { + printf("Error: Can't write cmsSigProfileDescriptionTag!\n"); + } + } + } else { + printf("Error: cmsMLUsetWide failed for desc \"%s\" !\n", sDescription.c_str()); + } + + cmsMLUfree(descMLU); + +// --------------- set cprt tag ------------------ + + std::wostringstream wCopyright; + wCopyright << copyright; + + cmsMLU *copyMLU = cmsMLUalloc(nullptr, 1); + + if (cmsMLUsetWide(copyMLU, "en", "US", wCopyright.str().c_str())) { + if (!v2except) { + + if (!cmsWriteTag(newProfile, cmsSigCopyrightTag, copyMLU)) { + printf("Error: Can't write cmsSigCopyrightTag!\n"); + } + } else { + if (!cmsWriteTag(profile_v2_except, cmsSigCopyrightTag, copyMLU)) { + printf("Error: Can't write cmsSigCopyrightTag!\n"); + } + + } + } else { + printf("Error: cmsMLUsetWide failed for cprt \"%s\" !\n", copyright.c_str()); + } + + cmsMLUfree(copyMLU); + + + /* //to read XYZ values + cmsCIEXYZ *redT = static_cast(cmsReadTag(newProfile, cmsSigRedMatrixColumnTag)); + cmsCIEXYZ *greenT = static_cast(cmsReadTag(newProfile, cmsSigGreenMatrixColumnTag)); + cmsCIEXYZ *blueT = static_cast(cmsReadTag(newProfile, cmsSigBlueMatrixColumnTag)); + printf("rx=%f gx=%f bx=%f ry=%f gy=%f by=%f rz=%f gz=%f bz=%f\n", redT->X, greenT->X, blueT->X, redT->Y, greenT->Y, blueT->Y, redT->Z, greenT->Z, blueT->Z); + */ + if (!v2except) { + cmsSaveProfileToFile(newProfile, absoluteFName.c_str()); + } else { + cmsSaveProfileToFile(profile_v2_except, absoluteFName.c_str()); + + } + + cmsFreeToneCurve(GammaTRC[0]); +} diff --git a/rtgui/iccprofilecreator.h b/rtgui/iccprofilecreator.h index 4ec73ff5c..74fa4bc54 100644 --- a/rtgui/iccprofilecreator.h +++ b/rtgui/iccprofilecreator.h @@ -1,107 +1,107 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2018 Jacques DESMIS - * Copyright (c) 2018 Jean-Christophe FRISCH - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#pragma once - -#include -#include "adjuster.h" -#include "options.h" -#include -#include "rtwindow.h" - -class ICCProfileCreator : public Gtk::Dialog, public AdjusterListener -{ - -private: - - enum class ColorTemp { - D50 = 5003, // for Widegamut, Prophoto Best, Beta -> D50 - D60 = 6005, // for ACESc -> D60 - D65 = 6504 // for sRGB, AdobeRGB, Bruce Rec2020 -> D65 - }; - - cmsFloat64Number ga[7]; // 7 parameters for smoother curves - - //------------------------ Params ----------------------- - Glib::ustring primariesPreset; - double redPrimaryX; - double redPrimaryY; - double greenPrimaryX; - double greenPrimaryY; - double bluePrimaryX; - double bluePrimaryY; - Glib::ustring gammaPreset; - double gamma; - double slope; - bool appendParamsToDesc; - - Glib::ustring profileVersion; - Glib::ustring illuminant; - Glib::ustring description; - Glib::ustring copyright; - //------------------------------------------------------- - - RTWindow *parent; - - Adjuster* aGamma; - Adjuster* aSlope; - Adjuster* aPrimariesRedX; - Adjuster* aPrimariesRedY; - Adjuster* aPrimariesGreenX; - Adjuster* aPrimariesGreenY; - Adjuster* aPrimariesBlueX; - Adjuster* aPrimariesBlueY; - - Gtk::Grid* primariesGrid; - MyComboBoxText* iccVersion; - MyComboBoxText* trcPresets; - sigc::connection trcpresetsconn; - MyComboBoxText* primaries; - sigc::connection primariesconn; - MyComboBoxText* cIlluminant; - sigc::connection illconn; - Gtk::Entry* eDescription; - Gtk::Entry* eCopyright; - Gtk::Button* resetCopyright; - Gtk::CheckButton *cAppendParamsToDesc; - - //Glib::ustring lastPath; - - void initWithDefaults (); - void storeDefaults (); - void storeValues(); - - void updateICCVersion(); - void primariesChanged(); - void illuminantChanged(); - void trcPresetsChanged(); - void adjusterChanged(Adjuster* a, double newval); - void adjusterAutoToggled(Adjuster* a, bool newval); - static std::vector getGamma(); - Glib::ustring getPrimariesPresetName(const Glib::ustring &preset); - void getPrimaries(const Glib::ustring &preset, float *p, ColorTemp &temp); - Glib::ustring getGammaPresetName(const Glib::ustring &preset); - void getGamma(const Glib::ustring &preset, double &gamma, double &slope); - void savePressed(); - void closePressed(); - void onResetCopyright(); - -public: - explicit ICCProfileCreator (RTWindow *rtwindow); -}; +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2018 Jacques DESMIS + * Copyright (c) 2018 Jean-Christophe FRISCH + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#pragma once + +#include +#include "adjuster.h" +#include "options.h" +#include +#include "rtwindow.h" + +class ICCProfileCreator : public Gtk::Dialog, public AdjusterListener +{ + +private: + + enum class ColorTemp { + D50 = 5003, // for Widegamut, Prophoto Best, Beta -> D50 + D60 = 6005, // for ACESc -> D60 + D65 = 6504 // for sRGB, AdobeRGB, Bruce Rec2020 -> D65 + }; + + cmsFloat64Number ga[7]; // 7 parameters for smoother curves + + //------------------------ Params ----------------------- + Glib::ustring primariesPreset; + double redPrimaryX; + double redPrimaryY; + double greenPrimaryX; + double greenPrimaryY; + double bluePrimaryX; + double bluePrimaryY; + Glib::ustring gammaPreset; + double gamma; + double slope; + bool appendParamsToDesc; + bool v2except; + Glib::ustring profileVersion; + Glib::ustring illuminant; + Glib::ustring description; + Glib::ustring copyright; + //------------------------------------------------------- + + RTWindow *parent; + + Adjuster* aGamma; + Adjuster* aSlope; + Adjuster* aPrimariesRedX; + Adjuster* aPrimariesRedY; + Adjuster* aPrimariesGreenX; + Adjuster* aPrimariesGreenY; + Adjuster* aPrimariesBlueX; + Adjuster* aPrimariesBlueY; + + Gtk::Grid* primariesGrid; + MyComboBoxText* iccVersion; + MyComboBoxText* trcPresets; + sigc::connection trcpresetsconn; + MyComboBoxText* primaries; + sigc::connection primariesconn; + MyComboBoxText* cIlluminant; + sigc::connection illconn; + Gtk::Entry* eDescription; + Gtk::Entry* eCopyright; + Gtk::Button* resetCopyright; + Gtk::CheckButton *cAppendParamsToDesc; + + //Glib::ustring lastPath; + + void initWithDefaults (); + void storeDefaults (); + void storeValues(); + + void updateICCVersion(); + void primariesChanged(); + void illuminantChanged(); + void trcPresetsChanged(); + void adjusterChanged(Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); + static std::vector getGamma(); + Glib::ustring getPrimariesPresetName(const Glib::ustring &preset); + void getPrimaries(const Glib::ustring &preset, double *p, ColorTemp &temp); + Glib::ustring getGammaPresetName(const Glib::ustring &preset); + void getGamma(const Glib::ustring &preset, double &gamma, double &slope); + void savePressed(); + void closePressed(); + void onResetCopyright(); + +public: + explicit ICCProfileCreator (RTWindow *rtwindow); +}; diff --git a/rtgui/labgrid.h b/rtgui/labgrid.h index 35e259996..30f6e76e5 100644 --- a/rtgui/labgrid.h +++ b/rtgui/labgrid.h @@ -66,7 +66,6 @@ private: sigc::connection delayconn; static const int inset = 2; - bool grid_visible; bool low_enabled; bool notifyListener(); diff --git a/rtgui/options.cc b/rtgui/options.cc index 797f50193..3845245af 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -556,16 +556,16 @@ void Options::setDefaults() rtSettings.monitorIntent = rtengine::RI_RELATIVE; rtSettings.monitorBPC = true; rtSettings.autoMonitorProfile = false; - rtSettings.adobe = "RTv4_Medium"; // put the name of yours profiles (here windows) - rtSettings.prophoto = "RTv4_Large"; // these names appear in the menu "output profile" - rtSettings.widegamut = "RTv4_Wide"; - rtSettings.srgb = "RTv4_sRGB"; - rtSettings.bruce = "RTv4_Bruce"; - rtSettings.beta = "RTv4_Beta"; - rtSettings.best = "RTv4_Best"; - rtSettings.rec2020 = "RTv4_Rec2020"; - rtSettings.ACESp0 = "RTv4_ACES-AP0"; - rtSettings.ACESp1 = "RTv4_ACES-AP1"; + rtSettings.adobe = "RTv2_Medium"; // put the name of yours profiles (here windows) + rtSettings.prophoto = "RTv2_Large"; // these names appear in the menu "output profile" + rtSettings.widegamut = "RTv2_Wide"; + rtSettings.srgb = "RTv2_sRGB"; + rtSettings.bruce = "RTv2_Bruce"; + rtSettings.beta = "RTv2_Beta"; + rtSettings.best = "RTv2_Best"; + rtSettings.rec2020 = "RTv2_Rec2020"; + rtSettings.ACESp0 = "RTv2_ACES-AP0"; + rtSettings.ACESp1 = "RTv2_ACES-AP1"; rtSettings.verbose = false; rtSettings.gamutICC = true; rtSettings.gamutLch = true; @@ -1471,74 +1471,74 @@ void Options::readFromFile(Glib::ustring fname) if (keyFile.has_key("Color Management", "AdobeRGB")) { rtSettings.adobe = keyFile.get_string("Color Management", "AdobeRGB"); - - if (rtSettings.adobe == "RT_Medium_gsRGB") { - rtSettings.adobe = "RTv4_Medium"; + if (rtSettings.adobe == "RT_Medium_gsRGB" || rtSettings.adobe == "RTv4_Medium") { + rtSettings.adobe = "RTv2_Medium"; } } if (keyFile.has_key("Color Management", "ProPhoto")) { rtSettings.prophoto = keyFile.get_string("Color Management", "ProPhoto"); - - if (rtSettings.prophoto == "RT_Large_gBT709") { - rtSettings.prophoto = "RTv4_Large"; + if (rtSettings.prophoto == "RT_Large_gBT709" || rtSettings.prophoto == "RTv4_Large") { + rtSettings.prophoto = "RTv2_Large"; } } if (keyFile.has_key("Color Management", "WideGamut")) { rtSettings.widegamut = keyFile.get_string("Color Management", "WideGamut"); - - if (rtSettings.widegamut == "WideGamutRGB") { - rtSettings.widegamut = "RTv4_Wide"; + if (rtSettings.widegamut == "WideGamutRGB" || rtSettings.widegamut == "RTv4_Wide") { + rtSettings.widegamut = "RTv2_Wide"; } } if (keyFile.has_key("Color Management", "sRGB")) { rtSettings.srgb = keyFile.get_string("Color Management", "sRGB"); - - if (rtSettings.srgb == "RT_sRGB") { - rtSettings.srgb = "RTv4_sRGB"; + if (rtSettings.srgb == "RT_sRGB" || rtSettings.srgb == "RTv4_sRGB") { + rtSettings.srgb = "RTv2_sRGB"; } } if (keyFile.has_key("Color Management", "Beta")) { rtSettings.beta = keyFile.get_string("Color Management", "Beta"); - - if (rtSettings.beta == "BetaRGB") { - rtSettings.beta = "RTv4_Beta"; + if (rtSettings.beta == "BetaRGB" || rtSettings.beta == "RTv4_Beta") { + rtSettings.beta = "RTv2_Beta"; } } if (keyFile.has_key("Color Management", "Best")) { rtSettings.best = keyFile.get_string("Color Management", "Best"); - - if (rtSettings.best == "BestRGB") { - rtSettings.best = "RTv4_Best"; + if (rtSettings.best == "BestRGB" || rtSettings.best == "RTv4_Best") { + rtSettings.best = "RTv2_Best"; } } if (keyFile.has_key("Color Management", "Rec2020")) { rtSettings.rec2020 = keyFile.get_string("Color Management", "Rec2020"); - - if (rtSettings.rec2020 == "Rec2020") { - rtSettings.rec2020 = "RTv4_Rec2020"; + if (rtSettings.rec2020 == "Rec2020" || rtSettings.rec2020 == "RTv4_Rec2020") { + rtSettings.rec2020 = "RTv2_Rec2020"; } } if (keyFile.has_key("Color Management", "Bruce")) { rtSettings.bruce = keyFile.get_string("Color Management", "Bruce"); - - if (rtSettings.bruce == "Bruce") { - rtSettings.bruce = "RTv4_Bruce"; + if (rtSettings.bruce == "Bruce" || rtSettings.bruce == "RTv4_Bruce") { + rtSettings.bruce = "RTv2_Bruce"; } } if (keyFile.has_key("Color Management", "ACES-AP0")) { rtSettings.ACESp0 = keyFile.get_string("Color Management", "ACES-AP0"); + if (rtSettings.ACESp0 == "RTv4_ACES-AP0") { + rtSettings.ACESp0 = "RTv2_ACES-AP0"; + } + } if (keyFile.has_key("Color Management", "ACES-AP1")) { rtSettings.ACESp1 = keyFile.get_string("Color Management", "ACES-AP1"); + if (rtSettings.ACESp1 == "RTv4_ACES-AP1") { + rtSettings.ACESp1 = "RTv2_ACES-AP1"; + } + } if (keyFile.has_key("Color Management", "GamutLch")) { diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 8b9b75c8e..597ad3251 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -612,7 +612,12 @@ Gtk::Widget* Preferences::getImageProcessingPanel () crophb->pack_start(*Gtk::manage(new Gtk::Label(M("PREFERENCES_CROP_GUIDES") + ": ")), Gtk::PACK_SHRINK, 4); crophb->pack_start(*cropGuides); cropvb->pack_start(*crophb); - cropAutoFit = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_CROP_AUTO_FIT"))); + Gtk::Label *cropAutoFitLabel = Gtk::manage(new Gtk::Label(M("PREFERENCES_CROP_AUTO_FIT"))); + cropAutoFitLabel->set_line_wrap(true); + setExpandAlignProperties(cropAutoFitLabel, false, false, Gtk::ALIGN_START, Gtk::ALIGN_START); + cropAutoFit = Gtk::manage(new Gtk::CheckButton()); + setExpandAlignProperties(cropAutoFit, false, true, Gtk::ALIGN_START, Gtk::ALIGN_START); + cropAutoFit->add(*cropAutoFitLabel); cropvb->pack_start(*cropAutoFit); cropframe->add(*cropvb); vbImageProcessing->pack_start(*cropframe, Gtk::PACK_SHRINK, 4); @@ -774,7 +779,12 @@ Gtk::Widget* Preferences::getColorManPanel () for (const auto profile : profiles) { if (profile.find("file:") != 0) { - monProfile->append(profile); + std::string fileis_RTv4 = profile.substr(0, 4); + + if (fileis_RTv4 != "RTv4") { + // printf("pro=%s \n", profile.c_str()); + monProfile->append(profile); + } } } @@ -1400,7 +1410,7 @@ Gtk::Widget* Preferences::getFileBrowserPanel() vbc->pack_start (*cacheGrid, Gtk::PACK_SHRINK, 4); Gtk::Label* clearSafetyLbl = Gtk::manage (new Gtk::Label(M("PREFERENCES_CACHECLEAR_SAFETY"))); - setExpandAlignProperties(clearSafetyLbl, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); + setExpandAlignProperties(clearSafetyLbl, false, false, Gtk::ALIGN_START, Gtk::ALIGN_START); clearSafetyLbl->set_line_wrap(true); vbc->pack_start(*clearSafetyLbl, Gtk::PACK_SHRINK, 4); diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index b208f5509..2daeb102f 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -41,6 +41,7 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM caAutoiterations = Gtk::manage(new Adjuster (M("TP_RAWCACORR_AUTOIT"), 1, 5, 1, 2)); caAutoiterations->setAdjusterListener (this); + caAutoiterations->set_tooltip_markup(M("TP_RAWCACORR_AUTOIT_TOOLTIP")); if (caAutoiterations->delay < options.adjusterMaxDelay) { caAutoiterations->delay = options.adjusterMaxDelay;