Soft-proofing ang GamutCheck buttons are now disabled if Monitor profile
== NONE of is no suported intent for the selected profile. The Monitor profile list (in the Editor and in Preferences) shows RGB profiles only, whereas the output profile list shows all profiles (RGB, CMYK, ... anything!) Bugfix: When switching to a new image, the image now use the selected profile and intent.
This commit is contained in:
@@ -40,7 +40,7 @@ void loadProfiles (const Glib::ustring& dirName,
|
||||
std::map<Glib::ustring, cmsHPROFILE>* profiles,
|
||||
std::map<Glib::ustring, ProfileContent>* profileContents,
|
||||
std::map<Glib::ustring, Glib::ustring>* profileNames,
|
||||
bool nameUpper, bool onlyRgb)
|
||||
bool nameUpper)
|
||||
{
|
||||
if (dirName.empty ()) {
|
||||
return;
|
||||
@@ -80,7 +80,7 @@ void loadProfiles (const Glib::ustring& dirName,
|
||||
const ProfileContent content (filePath);
|
||||
const cmsHPROFILE profile = content.toProfile ();
|
||||
|
||||
if (profile && (!onlyRgb || cmsGetColorSpace (profile) == cmsSigRgbData)) {
|
||||
if (profile) {
|
||||
profiles->insert (std::make_pair (name, profile));
|
||||
|
||||
if (profileContents) {
|
||||
@@ -165,7 +165,7 @@ std::vector<Glib::ustring> getWorkingProfiles ()
|
||||
return res;
|
||||
}
|
||||
|
||||
std::vector<Glib::ustring> ICCStore::getProfiles () const
|
||||
std::vector<Glib::ustring> ICCStore::getProfiles (const bool onlyRgb) const
|
||||
{
|
||||
|
||||
MyMutex::MyLock lock(mutex_);
|
||||
@@ -173,6 +173,7 @@ std::vector<Glib::ustring> ICCStore::getProfiles () const
|
||||
std::vector<Glib::ustring> res;
|
||||
|
||||
for (ProfileMap::const_iterator profile = fileProfiles.begin (); profile != fileProfiles.end (); ++profile) {
|
||||
if (!onlyRgb || (onlyRgb && cmsGetColorSpace (profile->second) == cmsSigRgbData))
|
||||
res.push_back (profile->first);
|
||||
}
|
||||
|
||||
@@ -188,8 +189,8 @@ std::vector<Glib::ustring> ICCStore::getProfilesFromDir (const Glib::ustring& di
|
||||
|
||||
ProfileMap profiles;
|
||||
|
||||
loadProfiles (profilesDir, &profiles, nullptr, nullptr, false, true);
|
||||
loadProfiles (dirName, &profiles, nullptr, nullptr, false, true);
|
||||
loadProfiles (profilesDir, &profiles, nullptr, nullptr, false);
|
||||
loadProfiles (dirName, &profiles, nullptr, nullptr, false);
|
||||
|
||||
for (ProfileMap::const_iterator profile = profiles.begin (); profile != profiles.end (); ++profile) {
|
||||
res.push_back (profile->first);
|
||||
@@ -768,15 +769,15 @@ void ICCStore::init (const Glib::ustring& usrICCDir, const Glib::ustring& rtICCD
|
||||
profilesDir = Glib::build_filename (rtICCDir, "output");
|
||||
fileProfiles.clear();
|
||||
fileProfileContents.clear();
|
||||
loadProfiles (profilesDir, &fileProfiles, &fileProfileContents, nullptr, false, true);
|
||||
loadProfiles (usrICCDir, &fileProfiles, &fileProfileContents, nullptr, false, true);
|
||||
loadProfiles (profilesDir, &fileProfiles, &fileProfileContents, nullptr, false);
|
||||
loadProfiles (usrICCDir, &fileProfiles, &fileProfileContents, nullptr, false);
|
||||
|
||||
// Input profiles
|
||||
// Load these to different areas, since the short name (e.g. "NIKON D700" may overlap between system/user and RT dir)
|
||||
stdProfilesDir = Glib::build_filename (rtICCDir, "input");
|
||||
fileStdProfiles.clear();
|
||||
fileStdProfilesFileNames.clear();
|
||||
loadProfiles (stdProfilesDir, nullptr, nullptr, &fileStdProfilesFileNames, true, false);
|
||||
loadProfiles (stdProfilesDir, nullptr, nullptr, &fileStdProfilesFileNames, true);
|
||||
}
|
||||
|
||||
// Determine the first monitor default profile of operating system, if selected
|
||||
|
@@ -112,7 +112,7 @@ public:
|
||||
cmsHPROFILE getXYZProfile () const;
|
||||
cmsHPROFILE getsRGBProfile () const;
|
||||
|
||||
std::vector<Glib::ustring> getProfiles () const;
|
||||
std::vector<Glib::ustring> getProfiles (const bool onlyRgb = false) const;
|
||||
std::vector<Glib::ustring> getProfilesFromDir (const Glib::ustring& dirName) const;
|
||||
|
||||
uint8_t getInputIntents (cmsHPROFILE profile) const;
|
||||
|
@@ -779,11 +779,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
|
||||
|
||||
// Update the monitor color transform if necessary
|
||||
if ((todo & M_MONITOR) || (lastOutputProfile!=params.icm.output) || lastOutputIntent!=params.icm.outputIntent || lastOutputBPC!=params.icm.outputBPC) {
|
||||
if (lastOutputIntent == RI__COUNT) {
|
||||
// initializing...
|
||||
monitorProfile = options.rtSettings.monitorProfile;
|
||||
monitorIntent = options.rtSettings.monitorIntent;
|
||||
}
|
||||
lastOutputProfile = params.icm.output;
|
||||
lastOutputIntent = params.icm.outputIntent;
|
||||
lastOutputBPC = params.icm.outputBPC;
|
||||
|
@@ -59,7 +59,7 @@ private:
|
||||
profileBox.set_active (0);
|
||||
#endif
|
||||
|
||||
const std::vector<Glib::ustring> profiles = rtengine::iccStore->getProfiles ();
|
||||
const std::vector<Glib::ustring> profiles = rtengine::iccStore->getProfiles (true);
|
||||
for (std::vector<Glib::ustring>::const_iterator iterator = profiles.begin (); iterator != profiles.end (); ++iterator) {
|
||||
profileBox.append_text (*iterator);
|
||||
}
|
||||
@@ -119,7 +119,7 @@ private:
|
||||
updateSoftProofParameters ();
|
||||
}
|
||||
|
||||
void updateParameters ()
|
||||
void updateParameters (bool noEvent = false)
|
||||
{
|
||||
ConnectionBlocker profileBlocker (profileConn);
|
||||
ConnectionBlocker intentBlocker (intentConn);
|
||||
@@ -148,6 +148,8 @@ private:
|
||||
|
||||
intentBox.set_sensitive (false);
|
||||
intentBox.setSelected (1);
|
||||
softProof.set_sensitive(false);
|
||||
spGamutCheck.set_sensitive(false);
|
||||
|
||||
profileBox.set_tooltip_text ("");
|
||||
|
||||
@@ -162,12 +164,16 @@ private:
|
||||
intentBox.setItemSensitivity(0, supportsPerceptual);
|
||||
intentBox.setItemSensitivity(1, supportsRelativeColorimetric);
|
||||
intentBox.setItemSensitivity(2, supportsAbsoluteColorimetric);
|
||||
softProof.set_sensitive(true);
|
||||
spGamutCheck.set_sensitive(true);
|
||||
} else {
|
||||
intentBox.setItemSensitivity(0, true);
|
||||
intentBox.setItemSensitivity(1, true);
|
||||
intentBox.setItemSensitivity(2, true);
|
||||
intentBox.set_sensitive (false);
|
||||
intentBox.setSelected (1);
|
||||
softProof.set_sensitive(false);
|
||||
spGamutCheck.set_sensitive(false);
|
||||
}
|
||||
|
||||
profileBox.set_tooltip_text (profileBox.get_active_text ());
|
||||
@@ -191,21 +197,30 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
if (!noEvent) {
|
||||
processor->beginUpdateParams ();
|
||||
}
|
||||
processor->setMonitorProfile (profile, intent);
|
||||
processor->setSoftProofing (softProof.get_sensitive() && softProof.get_active(), spGamutCheck.get_sensitive() && spGamutCheck.get_active());
|
||||
if (!noEvent) {
|
||||
processor->endUpdateParams (rtengine::EvMonitorTransform);
|
||||
}
|
||||
}
|
||||
|
||||
void updateSoftProofParameters ()
|
||||
void updateSoftProofParameters (bool noEvent = false)
|
||||
{
|
||||
spGamutCheck.set_sensitive(softProof.get_active());
|
||||
|
||||
if (profileBox.get_active_row_number () > 0) {
|
||||
if (!noEvent) {
|
||||
processor->beginUpdateParams ();
|
||||
processor->setSoftProofing (softProof.get_active(), spGamutCheck.get_active());
|
||||
}
|
||||
processor->setSoftProofing (softProof.get_sensitive() && softProof.get_active(), spGamutCheck.get_sensitive() && spGamutCheck.get_active());
|
||||
if (!noEvent) {
|
||||
processor->endUpdateParams (rtengine::EvMonitorTransform);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
ColorManagementToolbar (rtengine::StagedImageProcessor* const& ipc) :
|
||||
@@ -232,6 +247,13 @@ public:
|
||||
box->pack_end (profileBox, Gtk::PACK_SHRINK, 0);
|
||||
}
|
||||
|
||||
void updateProcessor()
|
||||
{
|
||||
if (processor) {
|
||||
updateParameters(true);
|
||||
}
|
||||
}
|
||||
|
||||
void reset ()
|
||||
{
|
||||
ConnectionBlocker profileBlocker (profileConn);
|
||||
@@ -762,6 +784,7 @@ void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc)
|
||||
this->isrc = isrc;
|
||||
ipc = rtengine::StagedImageProcessor::create (isrc);
|
||||
ipc->setProgressListener (this);
|
||||
colorMgmtToolBar->updateProcessor();
|
||||
ipc->setPreviewImageListener (previewHandler);
|
||||
ipc->setPreviewScale (10); // Important
|
||||
tpc->initImage (ipc, tmb->getType() == FT_Raw);
|
||||
|
@@ -698,7 +698,7 @@ Gtk::Widget* Preferences::getColorManagementPanel ()
|
||||
monProfile->append_text (M("PREFERENCES_PROFILE_NONE"));
|
||||
monProfile->set_active (0);
|
||||
|
||||
const std::vector<Glib::ustring> profiles = rtengine::ICCStore::getInstance ()->getProfiles ();
|
||||
const std::vector<Glib::ustring> profiles = rtengine::ICCStore::getInstance ()->getProfiles (true);
|
||||
for (std::vector<Glib::ustring>::const_iterator profile = profiles.begin (); profile != profiles.end (); ++profile)
|
||||
monProfile->append_text (*profile);
|
||||
|
||||
|
Reference in New Issue
Block a user