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:
Hombre
2016-09-02 16:23:21 +02:00
parent d31de41f68
commit c96c7dc8f3
5 changed files with 42 additions and 23 deletions

View File

@@ -40,7 +40,7 @@ void loadProfiles (const Glib::ustring& dirName,
std::map<Glib::ustring, cmsHPROFILE>* profiles, std::map<Glib::ustring, cmsHPROFILE>* profiles,
std::map<Glib::ustring, ProfileContent>* profileContents, std::map<Glib::ustring, ProfileContent>* profileContents,
std::map<Glib::ustring, Glib::ustring>* profileNames, std::map<Glib::ustring, Glib::ustring>* profileNames,
bool nameUpper, bool onlyRgb) bool nameUpper)
{ {
if (dirName.empty ()) { if (dirName.empty ()) {
return; return;
@@ -80,7 +80,7 @@ void loadProfiles (const Glib::ustring& dirName,
const ProfileContent content (filePath); const ProfileContent content (filePath);
const cmsHPROFILE profile = content.toProfile (); const cmsHPROFILE profile = content.toProfile ();
if (profile && (!onlyRgb || cmsGetColorSpace (profile) == cmsSigRgbData)) { if (profile) {
profiles->insert (std::make_pair (name, profile)); profiles->insert (std::make_pair (name, profile));
if (profileContents) { if (profileContents) {
@@ -165,7 +165,7 @@ std::vector<Glib::ustring> getWorkingProfiles ()
return res; return res;
} }
std::vector<Glib::ustring> ICCStore::getProfiles () const std::vector<Glib::ustring> ICCStore::getProfiles (const bool onlyRgb) const
{ {
MyMutex::MyLock lock(mutex_); MyMutex::MyLock lock(mutex_);
@@ -173,6 +173,7 @@ std::vector<Glib::ustring> ICCStore::getProfiles () const
std::vector<Glib::ustring> res; std::vector<Glib::ustring> res;
for (ProfileMap::const_iterator profile = fileProfiles.begin (); profile != fileProfiles.end (); ++profile) { for (ProfileMap::const_iterator profile = fileProfiles.begin (); profile != fileProfiles.end (); ++profile) {
if (!onlyRgb || (onlyRgb && cmsGetColorSpace (profile->second) == cmsSigRgbData))
res.push_back (profile->first); res.push_back (profile->first);
} }
@@ -188,8 +189,8 @@ std::vector<Glib::ustring> ICCStore::getProfilesFromDir (const Glib::ustring& di
ProfileMap profiles; ProfileMap profiles;
loadProfiles (profilesDir, &profiles, nullptr, nullptr, false, true); loadProfiles (profilesDir, &profiles, nullptr, nullptr, false);
loadProfiles (dirName, &profiles, nullptr, nullptr, false, true); loadProfiles (dirName, &profiles, nullptr, nullptr, false);
for (ProfileMap::const_iterator profile = profiles.begin (); profile != profiles.end (); ++profile) { for (ProfileMap::const_iterator profile = profiles.begin (); profile != profiles.end (); ++profile) {
res.push_back (profile->first); 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"); profilesDir = Glib::build_filename (rtICCDir, "output");
fileProfiles.clear(); fileProfiles.clear();
fileProfileContents.clear(); fileProfileContents.clear();
loadProfiles (profilesDir, &fileProfiles, &fileProfileContents, nullptr, false, true); loadProfiles (profilesDir, &fileProfiles, &fileProfileContents, nullptr, false);
loadProfiles (usrICCDir, &fileProfiles, &fileProfileContents, nullptr, false, true); loadProfiles (usrICCDir, &fileProfiles, &fileProfileContents, nullptr, false);
// Input profiles // Input profiles
// Load these to different areas, since the short name (e.g. "NIKON D700" may overlap between system/user and RT dir) // 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"); stdProfilesDir = Glib::build_filename (rtICCDir, "input");
fileStdProfiles.clear(); fileStdProfiles.clear();
fileStdProfilesFileNames.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 // Determine the first monitor default profile of operating system, if selected

View File

@@ -112,7 +112,7 @@ public:
cmsHPROFILE getXYZProfile () const; cmsHPROFILE getXYZProfile () const;
cmsHPROFILE getsRGBProfile () 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; std::vector<Glib::ustring> getProfilesFromDir (const Glib::ustring& dirName) const;
uint8_t getInputIntents (cmsHPROFILE profile) const; uint8_t getInputIntents (cmsHPROFILE profile) const;

View File

@@ -779,11 +779,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
// Update the monitor color transform if necessary // Update the monitor color transform if necessary
if ((todo & M_MONITOR) || (lastOutputProfile!=params.icm.output) || lastOutputIntent!=params.icm.outputIntent || lastOutputBPC!=params.icm.outputBPC) { 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; lastOutputProfile = params.icm.output;
lastOutputIntent = params.icm.outputIntent; lastOutputIntent = params.icm.outputIntent;
lastOutputBPC = params.icm.outputBPC; lastOutputBPC = params.icm.outputBPC;

View File

@@ -59,7 +59,7 @@ private:
profileBox.set_active (0); profileBox.set_active (0);
#endif #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) { for (std::vector<Glib::ustring>::const_iterator iterator = profiles.begin (); iterator != profiles.end (); ++iterator) {
profileBox.append_text (*iterator); profileBox.append_text (*iterator);
} }
@@ -119,7 +119,7 @@ private:
updateSoftProofParameters (); updateSoftProofParameters ();
} }
void updateParameters () void updateParameters (bool noEvent = false)
{ {
ConnectionBlocker profileBlocker (profileConn); ConnectionBlocker profileBlocker (profileConn);
ConnectionBlocker intentBlocker (intentConn); ConnectionBlocker intentBlocker (intentConn);
@@ -148,6 +148,8 @@ private:
intentBox.set_sensitive (false); intentBox.set_sensitive (false);
intentBox.setSelected (1); intentBox.setSelected (1);
softProof.set_sensitive(false);
spGamutCheck.set_sensitive(false);
profileBox.set_tooltip_text (""); profileBox.set_tooltip_text ("");
@@ -162,12 +164,16 @@ private:
intentBox.setItemSensitivity(0, supportsPerceptual); intentBox.setItemSensitivity(0, supportsPerceptual);
intentBox.setItemSensitivity(1, supportsRelativeColorimetric); intentBox.setItemSensitivity(1, supportsRelativeColorimetric);
intentBox.setItemSensitivity(2, supportsAbsoluteColorimetric); intentBox.setItemSensitivity(2, supportsAbsoluteColorimetric);
softProof.set_sensitive(true);
spGamutCheck.set_sensitive(true);
} else { } else {
intentBox.setItemSensitivity(0, true); intentBox.setItemSensitivity(0, true);
intentBox.setItemSensitivity(1, true); intentBox.setItemSensitivity(1, true);
intentBox.setItemSensitivity(2, true); intentBox.setItemSensitivity(2, true);
intentBox.set_sensitive (false); intentBox.set_sensitive (false);
intentBox.setSelected (1); intentBox.setSelected (1);
softProof.set_sensitive(false);
spGamutCheck.set_sensitive(false);
} }
profileBox.set_tooltip_text (profileBox.get_active_text ()); profileBox.set_tooltip_text (profileBox.get_active_text ());
@@ -191,21 +197,30 @@ private:
return; return;
} }
if (!noEvent) {
processor->beginUpdateParams (); processor->beginUpdateParams ();
}
processor->setMonitorProfile (profile, intent); processor->setMonitorProfile (profile, intent);
processor->setSoftProofing (softProof.get_sensitive() && softProof.get_active(), spGamutCheck.get_sensitive() && spGamutCheck.get_active());
if (!noEvent) {
processor->endUpdateParams (rtengine::EvMonitorTransform); processor->endUpdateParams (rtengine::EvMonitorTransform);
} }
}
void updateSoftProofParameters () void updateSoftProofParameters (bool noEvent = false)
{ {
spGamutCheck.set_sensitive(softProof.get_active()); spGamutCheck.set_sensitive(softProof.get_active());
if (profileBox.get_active_row_number () > 0) { if (profileBox.get_active_row_number () > 0) {
if (!noEvent) {
processor->beginUpdateParams (); 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); processor->endUpdateParams (rtengine::EvMonitorTransform);
} }
} }
}
public: public:
ColorManagementToolbar (rtengine::StagedImageProcessor* const& ipc) : ColorManagementToolbar (rtengine::StagedImageProcessor* const& ipc) :
@@ -232,6 +247,13 @@ public:
box->pack_end (profileBox, Gtk::PACK_SHRINK, 0); box->pack_end (profileBox, Gtk::PACK_SHRINK, 0);
} }
void updateProcessor()
{
if (processor) {
updateParameters(true);
}
}
void reset () void reset ()
{ {
ConnectionBlocker profileBlocker (profileConn); ConnectionBlocker profileBlocker (profileConn);
@@ -762,6 +784,7 @@ void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc)
this->isrc = isrc; this->isrc = isrc;
ipc = rtengine::StagedImageProcessor::create (isrc); ipc = rtengine::StagedImageProcessor::create (isrc);
ipc->setProgressListener (this); ipc->setProgressListener (this);
colorMgmtToolBar->updateProcessor();
ipc->setPreviewImageListener (previewHandler); ipc->setPreviewImageListener (previewHandler);
ipc->setPreviewScale (10); // Important ipc->setPreviewScale (10); // Important
tpc->initImage (ipc, tmb->getType() == FT_Raw); tpc->initImage (ipc, tmb->getType() == FT_Raw);

View File

@@ -698,7 +698,7 @@ Gtk::Widget* Preferences::getColorManagementPanel ()
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 (); 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) for (std::vector<Glib::ustring>::const_iterator profile = profiles.begin (); profile != profiles.end (); ++profile)
monProfile->append_text (*profile); monProfile->append_text (*profile);