Printer profile added in Preferences for soft-proofing

The output profiles now retain only 'Display' device class as well as
the Monitor profile - and they both have to have rgb color space, the
printer profile retain only 'Output' device class.

MacOS can use soft-proofing but due to undocumented feature of OSX, and
since Cairo assume that the image data are sRGB, the monitor profile is
forced to 'RT_sRGB'. A warning message replace the combobox for this OS.
This commit is contained in:
Hombre 2016-12-30 03:59:18 +01:00
parent cc8dae26ff
commit 23863aceca
15 changed files with 238 additions and 60 deletions

View File

@ -955,7 +955,9 @@ PREFERENCES_MENUGROUPRANK;Classement
PREFERENCES_MENUOPTIONS;Options du menu PREFERENCES_MENUOPTIONS;Options du menu
PREFERENCES_METADATA;Metadonnées PREFERENCES_METADATA;Metadonnées
PREFERENCES_MIN;Mini (100x115) PREFERENCES_MIN;Mini (100x115)
PREFERENCES_MONBPC;Compensation du Point Noir pour la transformation L*a*b*->Moniteur PREFERENCES_MONBPC;Compensation du Point Noir
PREFERENCES_MONITOR;Moniteur
PREFERENCES_MONPROFILE_WARNOSX;Due à des limitations de MacOS, seul sRGB est supporté.
PREFERENCES_MULTITAB;Éditeurs multiple PREFERENCES_MULTITAB;Éditeurs multiple
PREFERENCES_MULTITABDUALMON;Éditeurs multiple, si possible sur un second moniteur PREFERENCES_MULTITABDUALMON;Éditeurs multiple, si possible sur un second moniteur
PREFERENCES_NAVGUIDEBRUSH;Couleur du cadre dans le Navigateur PREFERENCES_NAVGUIDEBRUSH;Couleur du cadre dans le Navigateur
@ -978,6 +980,7 @@ PREFERENCES_PREVDEMO;Méthode de Dématriçage de l'Aperçu
PREFERENCES_PREVDEMO_FAST;Rapide PREFERENCES_PREVDEMO_FAST;Rapide
PREFERENCES_PREVDEMO_LABEL;Méthode de dématriçage utilisé pour l'aperçu à un zoom <100%: PREFERENCES_PREVDEMO_LABEL;Méthode de dématriçage utilisé pour l'aperçu à un zoom <100%:
PREFERENCES_PREVDEMO_SIDECAR;Idem PP3 PREFERENCES_PREVDEMO_SIDECAR;Idem PP3
PREFERENCES_PRINTER;Imprimante (épreuvage écran)
PREFERENCES_PROFILEHANDLING;Gestionnaire des profils de traitement PREFERENCES_PROFILEHANDLING;Gestionnaire des profils de traitement
PREFERENCES_PROFILELOADPR;Priorité de chargement des profils PREFERENCES_PROFILELOADPR;Priorité de chargement des profils
PREFERENCES_PROFILEPRCACHE;Profil dans le Cache PREFERENCES_PROFILEPRCACHE;Profil dans le Cache
@ -985,6 +988,9 @@ PREFERENCES_PROFILEPRFILE;Profil accolé au fichier d'entrée
PREFERENCES_PROFILESAVECACHE;Enregistrer la paramètres de traitement dans le Cache PREFERENCES_PROFILESAVECACHE;Enregistrer la paramètres de traitement dans le Cache
PREFERENCES_PROFILESAVEINPUT;Enregistrer la paramètres de traitement accolé au fichier d'entrée PREFERENCES_PROFILESAVEINPUT;Enregistrer la paramètres de traitement accolé au fichier d'entrée
PREFERENCES_PROPERTY;Propriété PREFERENCES_PROPERTY;Propriété
PREFERENCES_PRTBPC;Compensation du Point Noir
PREFERENCES_PRTINTENT;Intention de rendu
PREFERENCES_PRTPROFILE;Profile couleur
PREFERENCES_PSPATH;Dossier d'installation d'Adobe Photoshop PREFERENCES_PSPATH;Dossier d'installation d'Adobe Photoshop
PREFERENCES_REMEMBERZOOMPAN;Se souvenir de niveau de zoom et de la position de l'image PREFERENCES_REMEMBERZOOMPAN;Se souvenir de niveau de zoom et de la position de l'image
PREFERENCES_REMEMBERZOOMPAN_TOOLTIP;Retient le niveau de zoom et la position de l'image courante lors de l'ouverture d'une nouvelle image.\n\nCette option ne fonctionne que dans le mode "Éditeur unique" et quand "Méthode de dématriçage utilisé pour l'aperçu à un zoom <100%" is set to "Idem PP3". PREFERENCES_REMEMBERZOOMPAN_TOOLTIP;Retient le niveau de zoom et la position de l'image courante lors de l'ouverture d'une nouvelle image.\n\nCette option ne fonctionne que dans le mode "Éditeur unique" et quand "Méthode de dématriçage utilisé pour l'aperçu à un zoom <100%" is set to "Idem PP3".

View File

@ -1001,9 +1001,11 @@ PREFERENCES_MENUGROUPRANK;Group "Rank"
PREFERENCES_MENUOPTIONS;Context Menu Options PREFERENCES_MENUOPTIONS;Context Menu Options
PREFERENCES_METADATA;Metadata PREFERENCES_METADATA;Metadata
PREFERENCES_MIN;Mini (100x115) PREFERENCES_MIN;Mini (100x115)
PREFERENCES_MONBPC;Black Point Compensation for the L*a*b*->Monitor transform PREFERENCES_MONBPC;Black Point Compensation
PREFERENCES_MONINTENT;Default monitor intent PREFERENCES_MONITOR;Monitor
PREFERENCES_MONPROFILE;Default monitor profile PREFERENCES_MONINTENT;Default rendering intent
PREFERENCES_MONPROFILE;Default profile
PREFERENCES_MONPROFILE_WARNOSX;Due to MacOS limitations, only sRGB is supported.
PREFERENCES_MULTITAB;Multiple Editor Tabs Mode PREFERENCES_MULTITAB;Multiple Editor Tabs Mode
PREFERENCES_MULTITABDUALMON;Multiple Editor Tabs In Own Window Mode PREFERENCES_MULTITABDUALMON;Multiple Editor Tabs In Own Window Mode
PREFERENCES_NAVGUIDEBRUSH;Navigator guide color PREFERENCES_NAVGUIDEBRUSH;Navigator guide color
@ -1028,6 +1030,7 @@ PREFERENCES_PREVDEMO;Preview Demosaic Method
PREFERENCES_PREVDEMO_FAST;Fast PREFERENCES_PREVDEMO_FAST;Fast
PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom: PREFERENCES_PREVDEMO_LABEL;Demosaicing method used for the preview at <100% zoom:
PREFERENCES_PREVDEMO_SIDECAR;As in PP3 PREFERENCES_PREVDEMO_SIDECAR;As in PP3
PREFERENCES_PRINTER;Printer (soft-proofing)
PREFERENCES_PROFILEHANDLING;Processing Profile Handling PREFERENCES_PROFILEHANDLING;Processing Profile Handling
PREFERENCES_PROFILELOADPR;Processing profile loading priority PREFERENCES_PROFILELOADPR;Processing profile loading priority
PREFERENCES_PROFILEPRCACHE;Profile in cache PREFERENCES_PROFILEPRCACHE;Profile in cache
@ -1036,6 +1039,9 @@ PREFERENCES_PROFILESAVECACHE;Save processing profile to the cache
PREFERENCES_PROFILESAVEINPUT;Save processing profile next to the input file PREFERENCES_PROFILESAVEINPUT;Save processing profile next to the input file
PREFERENCES_PROFILE_NONE;None PREFERENCES_PROFILE_NONE;None
PREFERENCES_PROPERTY;Property PREFERENCES_PROPERTY;Property
PREFERENCES_PRTBPC;Black Point Compensation
PREFERENCES_PRTINTENT;Rendering intent
PREFERENCES_PRTPROFILE;Color profile
PREFERENCES_PSPATH;Adobe Photoshop installation directory PREFERENCES_PSPATH;Adobe Photoshop installation directory
PREFERENCES_REMEMBERZOOMPAN;Remember zoom % and pan offset PREFERENCES_REMEMBERZOOMPAN;Remember zoom % and pan offset
PREFERENCES_REMEMBERZOOMPAN_TOOLTIP;Remember the zoom % and pan offset of the current image when opening a new image.\n\nThis option only works in "Single Editor Tab Mode" and when "Demosaicing method used for the preview at <100% zoom" is set to "As in PP3". PREFERENCES_REMEMBERZOOMPAN_TOOLTIP;Remember the zoom % and pan offset of the current image when opening a new image.\n\nThis option only works in "Single Editor Tab Mode" and when "Demosaicing method used for the preview at <100% zoom" is set to "As in PP3".

View File

@ -165,16 +165,20 @@ std::vector<Glib::ustring> getWorkingProfiles ()
return res; return res;
} }
std::vector<Glib::ustring> ICCStore::getProfiles (const bool onlyRgb) const std::vector<Glib::ustring> ICCStore::getProfiles (const ProfileType type) const
{ {
MyMutex::MyLock lock(mutex_); MyMutex::MyLock lock(mutex_);
std::vector<Glib::ustring> res; std::vector<Glib::ustring> res;
for (ProfileMap::const_iterator profile = fileProfiles.begin (); profile != fileProfiles.end (); ++profile) { for (const auto profile : fileProfiles) {
if (!onlyRgb || (onlyRgb && cmsGetColorSpace (profile->second) == cmsSigRgbData)) if ( (type==ICCStore::ProfileType::MONITOR && cmsGetDeviceClass(profile.second) == cmsSigDisplayClass && cmsGetColorSpace (profile.second) == cmsSigRgbData)
res.push_back (profile->first); || (type==ICCStore::ProfileType::PRINTER && cmsGetDeviceClass(profile.second) == cmsSigOutputClass)
|| (type==ICCStore::ProfileType::OUTPUT && cmsGetDeviceClass(profile.second) == cmsSigDisplayClass && cmsGetColorSpace (profile.second) == cmsSigRgbData) )
{
res.push_back (profile.first);
}
} }
return res; return res;

View File

@ -84,6 +84,12 @@ class ICCStore
public: public:
enum class ProfileType {
MONITOR,
PRINTER,
OUTPUT // (actually correspond to the same profiles than with MONITOR)
};
static ICCStore* getInstance (); static ICCStore* getInstance ();
void init (const Glib::ustring& usrICCDir, const Glib::ustring& stdICCDir); void init (const Glib::ustring& usrICCDir, const Glib::ustring& stdICCDir);
@ -112,7 +118,7 @@ public:
cmsHPROFILE getXYZProfile () const; cmsHPROFILE getXYZProfile () const;
cmsHPROFILE getsRGBProfile () const; cmsHPROFILE getsRGBProfile () const;
std::vector<Glib::ustring> getProfiles (const bool onlyRgb = false) const; std::vector<Glib::ustring> getProfiles (const ProfileType type = ProfileType::MONITOR) const;
std::vector<Glib::ustring> getProfilesFromDir (const Glib::ustring& dirName) const; std::vector<Glib::ustring> getProfilesFromDir (const Glib::ustring& dirName) const;
uint8_t getInputIntents (cmsHPROFILE profile) const; uint8_t getInputIntents (cmsHPROFILE profile) const;

View File

@ -781,7 +781,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
lastOutputProfile = params.icm.output; lastOutputProfile = params.icm.output;
lastOutputIntent = params.icm.outputIntent; lastOutputIntent = params.icm.outputIntent;
lastOutputBPC = params.icm.outputBPC; lastOutputBPC = params.icm.outputBPC;
ipf.updateColorProfiles(params.icm, monitorProfile, monitorIntent, softProof, gamutCheck); ipf.updateColorProfiles(monitorProfile, monitorIntent, softProof, gamutCheck);
} }
// process crop, if needed // process crop, if needed

View File

@ -68,7 +68,7 @@ void ImProcFunctions::setScale (double iscale)
scale = iscale; scale = iscale;
} }
void ImProcFunctions::updateColorProfiles (const ColorManagementParams& icm, const Glib::ustring& monitorProfile, RenderingIntent monitorIntent, bool softProof, bool gamutCheck) void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile, RenderingIntent monitorIntent, bool softProof, bool gamutCheck)
{ {
// set up monitor transform // set up monitor transform
if (monitorTransform) { if (monitorTransform) {
@ -77,9 +77,14 @@ void ImProcFunctions::updateColorProfiles (const ColorManagementParams& icm, con
monitorTransform = nullptr; monitorTransform = nullptr;
cmsHPROFILE monitor = nullptr;
if (!monitorProfile.empty()) {
#if !defined(__APPLE__) // No support for monitor profiles on OS X, all data is sRGB #if !defined(__APPLE__) // No support for monitor profiles on OS X, all data is sRGB
monitor = iccStore->getProfile (monitorProfile);
cmsHPROFILE monitor = iccStore->getProfile (monitorProfile); #else
monitor = iccStore->getProfile ("RT_sRGB");
#endif
}
if (monitor) { if (monitor) {
MyMutex::MyLock lcmsLock (*lcmsMutex); MyMutex::MyLock lcmsLock (*lcmsMutex);
@ -91,25 +96,14 @@ void ImProcFunctions::updateColorProfiles (const ColorManagementParams& icm, con
if (softProof) { if (softProof) {
cmsHPROFILE oprof = nullptr; cmsHPROFILE oprof = nullptr;
if(icm.gamma != "default" || icm.freegamma) { // if select gamma output between BT709, sRGB, linear, low, high, 2.2 , 1.8 if (!settings->printerProfile.empty()) {
GammaValues ga; oprof = iccStore->getProfile(settings->printerProfile);
iccStore->getGammaArray(icm, ga);
oprof = iccStore->createGammaProfile (icm, ga);
}
else if (!icm.output.empty() && icm.output != ColorManagementParams::NoICMString) {
if(icm.gamma != "default" || icm.freegamma) { // if select gamma output between BT709, sRGB, linear, low, high, 2.2 , 1.8
GammaValues ga;
iccStore->getGammaArray(icm, ga);
oprof = iccStore->createCustomGammaOutputProfile (icm, ga);
} else {
oprof = iccStore->getProfile(icm.output);
}
} }
if (oprof) { if (oprof) {
// NOCACHE is for thread safety, NOOPTIMIZE for precision // NOCACHE is for thread safety, NOOPTIMIZE for precision
flags = cmsFLAGS_SOFTPROOFING | cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE; flags = cmsFLAGS_SOFTPROOFING | cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE;
if (icm.outputBPC) { if (settings->printerBPC) {
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION; flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
} }
if (gamutCheck) { if (gamutCheck) {
@ -119,7 +113,7 @@ void ImProcFunctions::updateColorProfiles (const ColorManagementParams& icm, con
iprof, TYPE_Lab_FLT, iprof, TYPE_Lab_FLT,
monitor, TYPE_RGB_8, monitor, TYPE_RGB_8,
oprof, oprof,
monitorIntent, icm.outputIntent, monitorIntent, settings->printerIntent,
flags flags
); );
if (monitorTransform) { if (monitorTransform) {
@ -138,8 +132,6 @@ void ImProcFunctions::updateColorProfiles (const ColorManagementParams& icm, con
cmsCloseProfile(iprof); cmsCloseProfile(iprof);
} }
#endif
} }
void ImProcFunctions::firstAnalysis (const Imagefloat* const original, const ProcParams &params, LUTu & histogram) void ImProcFunctions::firstAnalysis (const Imagefloat* const original, const ProcParams &params, LUTu & histogram)

View File

@ -205,7 +205,7 @@ public:
bool needsPCVignetting (); bool needsPCVignetting ();
void firstAnalysis (const Imagefloat* const working, const ProcParams &params, LUTu & vhist16); void firstAnalysis (const Imagefloat* const working, const ProcParams &params, LUTu & vhist16);
void updateColorProfiles (const ColorManagementParams& icm, const Glib::ustring& monitorProfile, RenderingIntent monitorIntent, bool softProof, bool gamutCheck); void updateColorProfiles (const Glib::ustring& monitorProfile, RenderingIntent monitorIntent, bool softProof, bool gamutCheck);
void rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, void rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve,
SHMap* shmap, int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit , float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clcurve, LUTf & cl2curve, const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, SHMap* shmap, int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit , float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clcurve, LUTf & cl2curve, const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2,
const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfile::ApplyState &asIn, LUTu &histToneCurve ); const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfile::ApplyState &asIn, LUTu &histToneCurve );

View File

@ -942,7 +942,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei
ImProcFunctions ipf (&params, false); ImProcFunctions ipf (&params, false);
ipf.setScale (sqrt(double(fw * fw + fh * fh)) / sqrt(double(thumbImg->width * thumbImg->width + thumbImg->height * thumbImg->height))*scale); ipf.setScale (sqrt(double(fw * fw + fh * fh)) / sqrt(double(thumbImg->width * thumbImg->width + thumbImg->height * thumbImg->height))*scale);
ipf.updateColorProfiles (params.icm, options.rtSettings.monitorProfile, options.rtSettings.monitorIntent, false, false); ipf.updateColorProfiles (options.rtSettings.monitorProfile, options.rtSettings.monitorIntent, false, false);
LUTu hist16 (65536); LUTu hist16 (65536);

View File

@ -38,6 +38,9 @@ public:
int leveldnliss; // level of auto multi zone int leveldnliss; // level of auto multi zone
int leveldnautsimpl; // STD or EXPERT int leveldnautsimpl; // STD or EXPERT
Glib::ustring printerProfile; ///< ICC profile name used for soft-proofing a printer output
RenderingIntent printerIntent; ///< Colorimetric intent used with the above profile
bool printerBPC; ///< Black Point Compensation for the Labimage->Printer->Monitor transform
Glib::ustring monitorProfile; ///< ICC profile name used for the monitor Glib::ustring monitorProfile; ///< ICC profile name used for the monitor
RenderingIntent monitorIntent; ///< Colorimetric intent used with the above profile RenderingIntent monitorIntent; ///< Colorimetric intent used with the above profile
bool monitorBPC; ///< Black Point Compensation for the Labimage->Monitor transform (directly, i.e. not soft-proofing and no WCS in between) bool monitorBPC; ///< Black Point Compensation for the Labimage->Monitor transform (directly, i.e. not soft-proofing and no WCS in between)

View File

@ -38,7 +38,9 @@ using namespace rtengine::procparams;
class EditorPanel::ColorManagementToolbar class EditorPanel::ColorManagementToolbar
{ {
private: private:
#if !defined(__APPLE__) // monitor profile not supported on apple
MyComboBoxText profileBox; MyComboBoxText profileBox;
#endif
PopUpButton intentBox; PopUpButton intentBox;
Gtk::ToggleButton softProof; Gtk::ToggleButton softProof;
Gtk::ToggleButton spGamutCheck; Gtk::ToggleButton spGamutCheck;
@ -47,6 +49,7 @@ private:
rtengine::StagedImageProcessor* const& processor; rtengine::StagedImageProcessor* const& processor;
private: private:
#if !defined(__APPLE__) // monitor profile not supported on apple
void prepareProfileBox () void prepareProfileBox ()
{ {
profileBox.set_size_request (100, -1); profileBox.set_size_request (100, -1);
@ -58,13 +61,13 @@ private:
#else #else
profileBox.set_active (0); profileBox.set_active (0);
#endif #endif
const std::vector<Glib::ustring> profiles = rtengine::iccStore->getProfiles (rtengine::ICCStore::ProfileType::MONITOR);
const std::vector<Glib::ustring> profiles = rtengine::iccStore->getProfiles (true); for (const auto profile: profiles) {
for (std::vector<Glib::ustring>::const_iterator iterator = profiles.begin (); iterator != profiles.end (); ++iterator) { profileBox.append_text (profile);
profileBox.append_text (*iterator);
} }
profileBox.set_tooltip_text (profileBox.get_active_text ()); profileBox.set_tooltip_text (profileBox.get_active_text ());
} }
#endif
void prepareIntentBox () void prepareIntentBox ()
{ {
@ -121,12 +124,15 @@ private:
void updateParameters (bool noEvent = false) void updateParameters (bool noEvent = false)
{ {
#if !defined(__APPLE__) // monitor profile not supported on apple
ConnectionBlocker profileBlocker (profileConn); ConnectionBlocker profileBlocker (profileConn);
#endif
ConnectionBlocker intentBlocker (intentConn); ConnectionBlocker intentBlocker (intentConn);
Glib::ustring profile; Glib::ustring profile;
#ifdef WIN32 #if !defined(__APPLE__) // monitor profile not supported on apple
#ifdef WIN32
if (profileBox.get_active_row_number () == 1) { if (profileBox.get_active_row_number () == 1) {
profile = rtengine::iccStore->getDefaultMonitorProfileName (); profile = rtengine::iccStore->getDefaultMonitorProfileName ();
if (profile.empty ()) { if (profile.empty ()) {
@ -138,10 +144,14 @@ private:
} else if (profileBox.get_active_row_number () > 1) { } else if (profileBox.get_active_row_number () > 1) {
profile = profileBox.get_active_text (); profile = profileBox.get_active_text ();
} }
#else #else
profile = profileBox.get_active_row_number () > 0 ? profileBox.get_active_text () : Glib::ustring (); profile = profileBox.get_active_row_number () > 0 ? profileBox.get_active_text () : Glib::ustring ();
#endif
#else
profile = "RT_sRGB";
#endif #endif
#if !defined(__APPLE__) // monitor profile not supported on apple
if (profileBox.get_active_row_number () == 0) { if (profileBox.get_active_row_number () == 0) {
profile.clear(); profile.clear();
@ -178,7 +188,7 @@ private:
profileBox.set_tooltip_text (profileBox.get_active_text ()); profileBox.set_tooltip_text (profileBox.get_active_text ());
} }
#endif
rtengine::RenderingIntent intent; rtengine::RenderingIntent intent;
switch (intentBox.getSelected ()) { switch (intentBox.getSelected ()) {
default: default:
@ -211,7 +221,9 @@ private:
{ {
spGamutCheck.set_sensitive(softProof.get_active()); spGamutCheck.set_sensitive(softProof.get_active());
#if !defined(__APPLE__) // monitor profile not supported on apple
if (profileBox.get_active_row_number () > 0) { if (profileBox.get_active_row_number () > 0) {
#endif
if (!noEvent) { if (!noEvent) {
processor->beginUpdateParams (); processor->beginUpdateParams ();
} }
@ -219,7 +231,9 @@ private:
if (!noEvent) { if (!noEvent) {
processor->endUpdateParams (rtengine::EvMonitorTransform); processor->endUpdateParams (rtengine::EvMonitorTransform);
} }
#if !defined(__APPLE__) // monitor profile not supported on apple
} }
#endif
} }
public: public:
@ -227,7 +241,9 @@ public:
intentBox (Glib::ustring (), true), intentBox (Glib::ustring (), true),
processor (ipc) processor (ipc)
{ {
#if !defined(__APPLE__) // monitor profile not supported on apple
prepareProfileBox (); prepareProfileBox ();
#endif
prepareIntentBox (); prepareIntentBox ();
prepareSoftProofingBox (); prepareSoftProofingBox ();
@ -235,7 +251,9 @@ public:
softProof.signal_toggled().connect(sigc::mem_fun (this, &ColorManagementToolbar::softProofToggled)); softProof.signal_toggled().connect(sigc::mem_fun (this, &ColorManagementToolbar::softProofToggled));
spGamutCheck.signal_toggled().connect(sigc::mem_fun (this, &ColorManagementToolbar::spGamutCheckToggled));; spGamutCheck.signal_toggled().connect(sigc::mem_fun (this, &ColorManagementToolbar::spGamutCheckToggled));;
#if !defined(__APPLE__) // monitor profile not supported on apple
profileConn = profileBox.signal_changed ().connect (sigc::mem_fun (this, &ColorManagementToolbar::profileBoxChanged)); profileConn = profileBox.signal_changed ().connect (sigc::mem_fun (this, &ColorManagementToolbar::profileBoxChanged));
#endif
intentConn = intentBox.signal_changed ().connect (sigc::mem_fun (this, &ColorManagementToolbar::intentBoxChanged)); intentConn = intentBox.signal_changed ().connect (sigc::mem_fun (this, &ColorManagementToolbar::intentBoxChanged));
} }
@ -244,7 +262,9 @@ public:
box->pack_end (spGamutCheck, Gtk::PACK_SHRINK, 0); box->pack_end (spGamutCheck, Gtk::PACK_SHRINK, 0);
box->pack_end (softProof, Gtk::PACK_SHRINK, 0); box->pack_end (softProof, Gtk::PACK_SHRINK, 0);
box->pack_end (*intentBox.buttonGroup, Gtk::PACK_SHRINK, 0); box->pack_end (*intentBox.buttonGroup, Gtk::PACK_SHRINK, 0);
#if !defined(__APPLE__) // monitor profile not supported on apple
box->pack_end (profileBox, Gtk::PACK_SHRINK, 0); box->pack_end (profileBox, Gtk::PACK_SHRINK, 0);
#endif
} }
void updateProcessor() void updateProcessor()
@ -256,17 +276,19 @@ public:
void reset () void reset ()
{ {
ConnectionBlocker profileBlocker (profileConn);
ConnectionBlocker intentBlocker (intentConn); ConnectionBlocker intentBlocker (intentConn);
#if !defined(__APPLE__) // monitor profile not supported on apple
ConnectionBlocker profileBlocker (profileConn);
#ifdef WIN32 #ifdef WIN32
if (options.rtSettings.autoMonitorProfile) { if (options.rtSettings.autoMonitorProfile) {
setActiveTextOrIndex (profileBox, options.rtSettings.monitorProfile, 1); setActiveTextOrIndex (profileBox, options.rtSettings.monitorProfile, 1);
} else { } else {
setActiveTextOrIndex (profileBox, options.rtSettings.monitorProfile, 0); setActiveTextOrIndex (profileBox, options.rtSettings.monitorProfile, 0);
} }
#else #else
setActiveTextOrIndex (profileBox, options.rtSettings.monitorProfile, 0); setActiveTextOrIndex (profileBox, options.rtSettings.monitorProfile, 0);
#endif
#endif #endif
switch (options.rtSettings.monitorIntent) switch (options.rtSettings.monitorIntent)

View File

@ -472,9 +472,13 @@ public:
inline void setActiveTextOrIndex (Gtk::ComboBoxText& comboBox, const Glib::ustring& text, int index) inline void setActiveTextOrIndex (Gtk::ComboBoxText& comboBox, const Glib::ustring& text, int index)
{ {
comboBox.set_active_text (text); bool valueSet = false;
if (!text.empty()) {
comboBox.set_active_text (text);
valueSet = true;
}
if (comboBox.get_active_row_number () < 0) if (!valueSet || comboBox.get_active_row_number () < 0)
comboBox.set_active (index); comboBox.set_active (index);
} }

View File

@ -181,7 +181,7 @@ ICMPanel::ICMPanel () : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunch
onames->append_text (M("TP_ICM_NOICM")); onames->append_text (M("TP_ICM_NOICM"));
onames->set_active (0); onames->set_active (0);
std::vector<Glib::ustring> opnames = iccStore->getProfiles (); std::vector<Glib::ustring> opnames = iccStore->getProfiles (rtengine::ICCStore::ProfileType::OUTPUT);
for (size_t i = 0; i < opnames.size(); i++) { for (size_t i = 0; i < opnames.size(); i++) {
onames->append_text (opnames[i]); onames->append_text (opnames[i]);

View File

@ -632,6 +632,9 @@ void Options::setDefaults ()
rtSettings.leveldnliss = 0; rtSettings.leveldnliss = 0;
rtSettings.leveldnautsimpl = 0; rtSettings.leveldnautsimpl = 0;
rtSettings.printerProfile = Glib::ustring();
rtSettings.printerIntent = rtengine::RI_RELATIVE;
rtSettings.printerBPC = true;
rtSettings.monitorProfile = Glib::ustring(); rtSettings.monitorProfile = Glib::ustring();
rtSettings.monitorIntent = rtengine::RI_RELATIVE; rtSettings.monitorIntent = rtengine::RI_RELATIVE;
rtSettings.monitorBPC = true; rtSettings.monitorBPC = true;
@ -1450,6 +1453,18 @@ int Options::readFromFile (Glib::ustring fname)
rtSettings.iccDirectory = keyFile.get_string ("Color Management", "ICCDirectory"); rtSettings.iccDirectory = keyFile.get_string ("Color Management", "ICCDirectory");
} }
if (keyFile.has_key ("Color Management", "PrinterIntent")) {
rtSettings.printerIntent = static_cast<rtengine::RenderingIntent>(keyFile.get_integer("Color Management", "PrinterIntent"));
}
if (keyFile.has_key ("Color Management", "PrinterBPC")) {
rtSettings.printerBPC = keyFile.get_boolean("Color Management", "PrinterBPC");
}
if (keyFile.has_key ("Color Management", "PrinterProfile")) {
rtSettings.printerProfile = keyFile.get_string ("Color Management", "PrinterProfile");
}
if (keyFile.has_key ("Color Management", "MonitorProfile")) { if (keyFile.has_key ("Color Management", "MonitorProfile")) {
rtSettings.monitorProfile = keyFile.get_string ("Color Management", "MonitorProfile"); rtSettings.monitorProfile = keyFile.get_string ("Color Management", "MonitorProfile");
} }
@ -2031,6 +2046,10 @@ int Options::saveToFile (Glib::ustring fname)
keyFile.set_integer ("Crop Settings", "PPI", cropPPI); keyFile.set_integer ("Crop Settings", "PPI", cropPPI);
keyFile.set_string ("Color Management", "PrinterProfile", rtSettings.printerProfile);
keyFile.set_integer ("Color Management", "PrinterIntent", rtSettings.printerIntent);
keyFile.set_boolean ("Color Management", "PrinterBPC", rtSettings.printerBPC);
keyFile.set_string ("Color Management", "ICCDirectory", rtSettings.iccDirectory); keyFile.set_string ("Color Management", "ICCDirectory", rtSettings.iccDirectory);
keyFile.set_string ("Color Management", "MonitorProfile", rtSettings.monitorProfile); keyFile.set_string ("Color Management", "MonitorProfile", rtSettings.monitorProfile);
keyFile.set_boolean ("Color Management", "AutoMonitorProfile", rtSettings.autoMonitorProfile); keyFile.set_boolean ("Color Management", "AutoMonitorProfile", rtSettings.autoMonitorProfile);

View File

@ -685,63 +685,138 @@ Gtk::Widget* Preferences::getColorManagementPanel ()
Gtk::VBox* mvbcm = Gtk::manage (new Gtk::VBox ()); Gtk::VBox* mvbcm = Gtk::manage (new Gtk::VBox ());
mvbcm->set_border_width (4); mvbcm->set_border_width (4);
mvbcm->set_spacing (4);
iccDir = Gtk::manage (new Gtk::FileChooserButton (M("PREFERENCES_ICCDIR"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER)); iccDir = Gtk::manage (new Gtk::FileChooserButton (M("PREFERENCES_ICCDIR"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER));
Gtk::Label* pdlabel = Gtk::manage (new Gtk::Label (M("PREFERENCES_ICCDIR") + ":", Gtk::ALIGN_LEFT)); Gtk::Label* pdlabel = Gtk::manage (new Gtk::Label (M("PREFERENCES_ICCDIR") + ":", Gtk::ALIGN_LEFT));
Gtk::HBox* iccdhb = Gtk::manage (new Gtk::HBox ());
iccdhb->set_spacing(4);
iccdhb->pack_start(*pdlabel, Gtk::PACK_SHRINK);
iccdhb->pack_start(*iccDir, Gtk::PACK_EXPAND_WIDGET);
iccDir->signal_selection_changed ().connect (sigc::mem_fun (this, &Preferences::iccDirChanged));
mvbcm->pack_start(*iccdhb, Gtk::PACK_SHRINK);
//------------------------- MONITOR ----------------------
Gtk::Frame* fmonitor = Gtk::manage( new Gtk::Frame (M("PREFERENCES_MONITOR")) );
Gtk::VBox* vbmonitor = Gtk::manage( new Gtk::VBox () );
vbmonitor->set_border_width (4);
monProfile = Gtk::manage (new Gtk::ComboBoxText ()); monProfile = Gtk::manage (new Gtk::ComboBoxText ());
Gtk::Label* mplabel = Gtk::manage (new Gtk::Label (M("PREFERENCES_MONPROFILE") + ":", Gtk::ALIGN_LEFT)); Gtk::Label* mplabel = Gtk::manage (new Gtk::Label (M("PREFERENCES_MONPROFILE") + ":", Gtk::ALIGN_LEFT));
monIntent = Gtk::manage (new Gtk::ComboBoxText ()); monIntent = Gtk::manage (new Gtk::ComboBoxText ());
Gtk::Label* milabel = Gtk::manage (new Gtk::Label (M("PREFERENCES_MONINTENT")+":", Gtk::ALIGN_LEFT)); Gtk::Label* milabel = Gtk::manage (new Gtk::Label (M("PREFERENCES_MONINTENT")+":", Gtk::ALIGN_LEFT));
monProfile->set_size_request(80, -1);
monProfile->append_text (M("PREFERENCES_PROFILE_NONE")); monProfile->append_text (M("PREFERENCES_PROFILE_NONE"));
monProfile->set_active (0); monProfile->set_active (0);
const std::vector<Glib::ustring> profiles = rtengine::ICCStore::getInstance ()->getProfiles (true); const std::vector<Glib::ustring> profiles = rtengine::ICCStore::getInstance ()->getProfiles (rtengine::ICCStore::ProfileType::MONITOR);
for (std::vector<Glib::ustring>::const_iterator profile = profiles.begin (); profile != profiles.end (); ++profile) for (const auto profile : profiles) {
monProfile->append_text (*profile); monProfile->append_text (profile);
}
// same order as the enum // same order as the enum
monIntent->append_text (M("PREFERENCES_INTENT_PERCEPTUAL")); monIntent->append_text (M("PREFERENCES_INTENT_PERCEPTUAL"));
monIntent->append_text (M("PREFERENCES_INTENT_RELATIVE")); monIntent->append_text (M("PREFERENCES_INTENT_RELATIVE"));
monIntent->append_text (M("PREFERENCES_INTENT_ABSOLUTE")); monIntent->append_text (M("PREFERENCES_INTENT_ABSOLUTE"));
monIntent->set_active (1); monIntent->set_active (1);
monIntent->set_size_request(80, -1);
monBPC = Gtk::manage (new Gtk::CheckButton (M("PREFERENCES_MONBPC"))); monBPC = Gtk::manage (new Gtk::CheckButton (M("PREFERENCES_MONBPC")));
monBPC->set_active (true); monBPC->set_active (true);
iccDir->signal_selection_changed ().connect (sigc::mem_fun (this, &Preferences::iccDirChanged));
#if defined(WIN32) // Auto-detection not implemented for Linux, see issue 851 #if defined(WIN32) // Auto-detection not implemented for Linux, see issue 851
cbAutoMonProfile = Gtk::manage (new Gtk::CheckButton (M("PREFERENCES_AUTOMONPROFILE"))); cbAutoMonProfile = Gtk::manage (new Gtk::CheckButton (M("PREFERENCES_AUTOMONPROFILE")));
autoMonProfileConn = cbAutoMonProfile->signal_toggled().connect (sigc::mem_fun(*this, &Preferences::autoMonProfileToggled)); autoMonProfileConn = cbAutoMonProfile->signal_toggled().connect (sigc::mem_fun(*this, &Preferences::autoMonProfileToggled));
#endif
Gtk::Table* colt = Gtk::manage (new Gtk::Table (3, 2)); Gtk::Table* colt = Gtk::manage (new Gtk::Table (3, 2));
#else
Gtk::Table* colt = Gtk::manage (new Gtk::Table (2, 2));
#endif
int row = 0; int row = 0;
colt->attach (*pdlabel, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK, 2, 2);
colt->attach (*iccDir, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2);
#if !defined(__APPLE__) // monitor profile not supported on apple
++row;
colt->attach (*mplabel, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK, 2, 2); colt->attach (*mplabel, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK, 2, 2);
#if defined(__APPLE__) // monitor profile not supported on apple
colt->attach (*Gtk::manage (new Gtk::Label (M("PREFERENCES_MONPROFILE_WARNOSX"), Gtk::ALIGN_LEFT)), 1, 2, row, row + 1, Gtk::FILL, Gtk::SHRINK, 2, 2);
#else
colt->attach (*monProfile, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); colt->attach (*monProfile, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2);
#endif
#if defined(WIN32) #if defined(WIN32)
++row; ++row;
colt->attach (*cbAutoMonProfile, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); colt->attach (*cbAutoMonProfile, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2);
#endif
#endif #endif
++row; ++row;
colt->attach (*milabel, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK, 2, 2); colt->attach (*milabel, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK, 2, 2);
colt->attach (*monIntent, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); colt->attach (*monIntent, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2);
mvbcm->pack_start (*colt, Gtk::PACK_SHRINK, 4); vbmonitor->pack_start (*colt, Gtk::PACK_SHRINK, 4);
mvbcm->pack_start (*monBPC, Gtk::PACK_SHRINK, 4); vbmonitor->pack_start (*monBPC, Gtk::PACK_SHRINK, 4);
#if defined(WIN32) #if defined(WIN32)
autoMonProfileToggled(); autoMonProfileToggled();
#endif #endif
fmonitor->add(*vbmonitor);
mvbcm->pack_start(*fmonitor, Gtk::PACK_SHRINK);
//------------------------- PRINTER ----------------------
Gtk::Frame* fprinter = Gtk::manage( new Gtk::Frame (M("PREFERENCES_PRINTER")) );
Gtk::VBox* vbprinter = Gtk::manage( new Gtk::VBox () );
vbprinter->set_border_width (4);
prtProfile = Gtk::manage (new Gtk::ComboBoxText ());
Gtk::Label* pplabel = Gtk::manage (new Gtk::Label (M("PREFERENCES_PRTPROFILE") + ":", Gtk::ALIGN_LEFT));
prtIntent = Gtk::manage (new Gtk::ComboBoxText ());
Gtk::Label* pilabel = Gtk::manage (new Gtk::Label (M("PREFERENCES_PRTINTENT")+":", Gtk::ALIGN_LEFT));
prtProfile->set_size_request(80, -1);
prtProfile->append_text (M("PREFERENCES_PROFILE_NONE"));
prtProfile->set_active (0);
const std::vector<Glib::ustring> prtprofiles = rtengine::ICCStore::getInstance ()->getProfiles (rtengine::ICCStore::ProfileType::PRINTER);
for (const auto prtprofile : prtprofiles)
prtProfile->append_text (prtprofile);
// same order as the enum
prtIntent->append_text (M("PREFERENCES_INTENT_PERCEPTUAL"));
prtIntent->append_text (M("PREFERENCES_INTENT_RELATIVE"));
prtIntent->append_text (M("PREFERENCES_INTENT_ABSOLUTE"));
prtIntent->set_active (1);
prtIntent->set_size_request(80, -1);
prtBPC = Gtk::manage (new Gtk::CheckButton (M("PREFERENCES_PRTBPC")));
prtBPC->set_active (true);
Gtk::Table* coltp = Gtk::manage (new Gtk::Table (2, 2));
row = 0;
#if !defined(__APPLE__) // monitor profile not supported on apple
coltp->attach (*pplabel, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK, 2, 2);
coltp->attach (*prtProfile, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2);
#endif
++row;
coltp->attach (*pilabel, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK, 2, 2);
coltp->attach (*prtIntent, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2);
vbprinter->pack_start (*coltp, Gtk::PACK_SHRINK, 4);
vbprinter->pack_start (*prtBPC, Gtk::PACK_SHRINK, 4);
#if defined(WIN32)
autoMonProfileToggled();
#endif
fprinter->add(*vbprinter);
mvbcm->pack_start(*fprinter, Gtk::PACK_SHRINK);
//------------------------- CIECAM ----------------------
Gtk::VBox* vbdp = Gtk::manage (new Gtk::VBox ()); Gtk::VBox* vbdp = Gtk::manage (new Gtk::VBox ());
vbdp->set_border_width (4); vbdp->set_border_width (4);
Gtk::Label* viewlab = Gtk::manage (new Gtk::Label (M("PREFERENCES_VIEW") + ":", Gtk::ALIGN_LEFT)); Gtk::Label* viewlab = Gtk::manage (new Gtk::Label (M("PREFERENCES_VIEW") + ":", Gtk::ALIGN_LEFT));
@ -790,7 +865,7 @@ Gtk::Widget* Preferences::getColorManagementPanel ()
vbcielab->pack_start (*colo, Gtk::PACK_EXPAND_WIDGET, 4); vbcielab->pack_start (*colo, Gtk::PACK_EXPAND_WIDGET, 4);
fcielab->add (*vbcielab); fcielab->add (*vbcielab);
mvbcm->pack_start (*fcielab, Gtk::PACK_SHRINK, 4); mvbcm->pack_start (*fcielab, Gtk::PACK_SHRINK);
return mvbcm; return mvbcm;
} }
@ -1457,8 +1532,31 @@ void Preferences::storePreferences ()
moptions.CPBPath = txtCustProfBuilderPath->get_text(); moptions.CPBPath = txtCustProfBuilderPath->get_text();
moptions.CPBKeys = CPBKeyType(custProfBuilderLabelType->get_active_row_number()); moptions.CPBKeys = CPBKeyType(custProfBuilderLabelType->get_active_row_number());
if (!prtProfile->get_active_row_number()) {
moptions.rtSettings.printerProfile = "";
} else {
moptions.rtSettings.printerProfile = prtProfile->get_active_text ();
}
switch (prtIntent->get_active_row_number ()) {
default:
case 0:
moptions.rtSettings.printerIntent = rtengine::RI_PERCEPTUAL;
break;
case 1:
moptions.rtSettings.printerIntent = rtengine::RI_RELATIVE;
break;
case 2:
moptions.rtSettings.printerIntent = rtengine::RI_ABSOLUTE;
break;
}
moptions.rtSettings.printerBPC = prtBPC->get_active ();
#if !defined(__APPLE__) // monitor profile not supported on apple #if !defined(__APPLE__) // monitor profile not supported on apple
moptions.rtSettings.monitorProfile = monProfile->get_active_text (); if (!monProfile->get_active_row_number()) {
moptions.rtSettings.monitorProfile = "";
} else {
moptions.rtSettings.monitorProfile = monProfile->get_active_text ();
}
switch (monIntent->get_active_row_number ()) { switch (monIntent->get_active_row_number ()) {
default: default:
case 0: case 0:
@ -1588,6 +1686,21 @@ void Preferences::fillPreferences ()
rememberZoomPanCheckbutton->set_active (moptions.rememberZoomAndPan); rememberZoomPanCheckbutton->set_active (moptions.rememberZoomAndPan);
ctiffserialize->set_active(moptions.serializeTiffRead); ctiffserialize->set_active(moptions.serializeTiffRead);
setActiveTextOrIndex (*prtProfile, moptions.rtSettings.printerProfile, 0);
switch (moptions.rtSettings.printerIntent) {
default:
case rtengine::RI_PERCEPTUAL:
prtIntent->set_active (0);
break;
case rtengine::RI_RELATIVE:
prtIntent->set_active (1);
break;
case rtengine::RI_ABSOLUTE:
prtIntent->set_active (2);
break;
}
prtBPC->set_active (moptions.rtSettings.printerBPC);
#if !defined(__APPLE__) // monitor profile not supported on apple #if !defined(__APPLE__) // monitor profile not supported on apple
setActiveTextOrIndex (*monProfile, moptions.rtSettings.monitorProfile, 0); setActiveTextOrIndex (*monProfile, moptions.rtSettings.monitorProfile, 0);
switch (moptions.rtSettings.monitorIntent) { switch (moptions.rtSettings.monitorIntent) {

View File

@ -95,6 +95,9 @@ protected:
Gtk::CheckButton* showExpComp; Gtk::CheckButton* showExpComp;
Gtk::FileChooserButton* iccDir; Gtk::FileChooserButton* iccDir;
Gtk::ComboBoxText* prtProfile;
Gtk::ComboBoxText* prtIntent;
Gtk::CheckButton* prtBPC;
Gtk::ComboBoxText* monProfile; Gtk::ComboBoxText* monProfile;
Gtk::ComboBoxText* monIntent; Gtk::ComboBoxText* monIntent;
Gtk::CheckButton* monBPC; Gtk::CheckButton* monBPC;