automatically select the system monitor profile if the preferences say so

Fix for issue #3821
This commit is contained in:
Alberto Griggio
2017-04-12 16:20:03 +02:00
parent 239476cc3a
commit ecae94f17c
7 changed files with 70 additions and 4 deletions

View File

@@ -302,6 +302,8 @@ public:
if (loadAll) {
loadProfiles(stdProfilesDir, nullptr, nullptr, &fileStdProfilesFileNames, true);
}
defaultMonitorProfile = settings->monitorProfile;
}
cmsHPROFILE workingSpace(const Glib::ustring& name) const
@@ -534,6 +536,16 @@ public:
return getProofIntents(getProfile(name));
}
Glib::ustring getDefaultMonitorProfileName() const
{
return defaultMonitorProfile;
}
void setDefaultMonitorProfileName(const Glib::ustring &name)
{
defaultMonitorProfile = name;
}
private:
using ProfileMap = std::map<Glib::ustring, cmsHPROFILE>;
using MatrixMap = std::map<Glib::ustring, TMatrix>;
@@ -617,6 +629,18 @@ rtengine::ProfileContent rtengine::ICCStore::getContent(const Glib::ustring& nam
return implementation->getContent(name);
}
Glib::ustring rtengine::ICCStore::getDefaultMonitorProfileName() const
{
return implementation->getDefaultMonitorProfileName();
}
void rtengine::ICCStore::setDefaultMonitorProfileName(const Glib::ustring &name)
{
implementation->setDefaultMonitorProfileName(name);
}
cmsHPROFILE rtengine::ICCStore::getXYZProfile() const
{
return implementation->getXYZProfile();

View File

@@ -78,6 +78,9 @@ public:
cmsHPROFILE getStdProfile(const Glib::ustring& name) const;
ProfileContent getContent(const Glib::ustring& name) const;
Glib::ustring getDefaultMonitorProfileName() const;
void setDefaultMonitorProfileName(const Glib::ustring &name);
cmsHPROFILE getXYZProfile() const;
cmsHPROFILE getsRGBProfile() const;

View File

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