Soft-proofing: fall back to using the current output profile if no printer profile is specified

Implements #4361
This commit is contained in:
Alberto Griggio 2018-02-03 21:49:41 +01:00
parent 42e9e37ad8
commit dc44212691
4 changed files with 23 additions and 27 deletions

View File

@ -1229,8 +1229,8 @@ SAVEDLG_SUBSAMP_TOOLTIP;Best compression:\nJ:a:b 4:2:0\nh/v 2/2\nChroma halved h
SAVEDLG_TIFFUNCOMPRESSED;Uncompressed TIFF SAVEDLG_TIFFUNCOMPRESSED;Uncompressed TIFF
SAVEDLG_WARNFILENAME;File will be named SAVEDLG_WARNFILENAME;File will be named
SHCSELECTOR_TOOLTIP;Click right mouse button to reset the position of those 3 sliders. SHCSELECTOR_TOOLTIP;Click right mouse button to reset the position of those 3 sliders.
SOFTPROOF_GAMUTCHECK_TOOLTIP;If active, indicates in grey the pixels which have out of gamut colors from the Printer profile. SOFTPROOF_GAMUTCHECK_TOOLTIP;If active, indicates in bright green the pixels which have out of gamut colors from the Printer/Output profile.
SOFTPROOF_TOOLTIP;Soft-proofing\nIf active, let you simulate the printer's output by using the Printer profile set in Preferences > Color Management. SOFTPROOF_TOOLTIP;Soft-proofing\nIf active, lets you simulate the appearance of the image when printed (if a Printer profile set in Preferences > Color Management) or when viewed on a display that uses the current output profile (if no printer profile is selected).
THRESHOLDSELECTOR_B;Bottom THRESHOLDSELECTOR_B;Bottom
THRESHOLDSELECTOR_BL;Bottom-left THRESHOLDSELECTOR_BL;Bottom-left
THRESHOLDSELECTOR_BR;Bottom-right THRESHOLDSELECTOR_BR;Bottom-right

View File

@ -333,6 +333,10 @@ public:
} }
defaultMonitorProfile = settings->monitorProfile; defaultMonitorProfile = settings->monitorProfile;
// initialize the alarm colours for lcms gamut checking -- we use bright green
cmsUInt16Number cms_alarm_codes[cmsMAXCHANNELS] = { 0, 65535, 0 };
cmsSetAlarmCodes(cms_alarm_codes);
} }
cmsHPROFILE workingSpace(const Glib::ustring& name) const cmsHPROFILE workingSpace(const Glib::ustring& name) const

View File

@ -300,18 +300,26 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile,
if (softProof) { if (softProof) {
cmsHPROFILE oprof = nullptr; cmsHPROFILE oprof = nullptr;
RenderingIntent outIntent;
flags = cmsFLAGS_SOFTPROOFING | cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE;
if (!settings->printerProfile.empty()) { if (!settings->printerProfile.empty()) {
oprof = ICCStore::getInstance()->getProfile (settings->printerProfile); oprof = ICCStore::getInstance()->getProfile (settings->printerProfile);
if (settings->printerBPC) {
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
}
outIntent = settings->printerIntent;
} else {
oprof = ICCStore::getInstance()->getProfile(params->icm.output);
if (params->icm.outputBPC) {
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
}
outIntent = params->icm.outputIntent;
} }
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;
if (settings->printerBPC) {
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
}
if (gamutCheck) { if (gamutCheck) {
flags |= cmsFLAGS_GAMUTCHECK; flags |= cmsFLAGS_GAMUTCHECK;
@ -321,7 +329,7 @@ void ImProcFunctions::updateColorProfiles (const Glib::ustring& monitorProfile,
iprof, TYPE_Lab_FLT, iprof, TYPE_Lab_FLT,
monitor, TYPE_RGB_8, monitor, TYPE_RGB_8,
oprof, oprof,
monitorIntent, settings->printerIntent, monitorIntent, outIntent,
flags flags
); );

View File

@ -153,7 +153,6 @@ private:
Gtk::ToggleButton softProof; Gtk::ToggleButton softProof;
Gtk::ToggleButton spGamutCheck; Gtk::ToggleButton spGamutCheck;
sigc::connection profileConn, intentConn, softproofConn; sigc::connection profileConn, intentConn, softproofConn;
bool canSProof;
Glib::ustring defprof; Glib::ustring defprof;
rtengine::StagedImageProcessor* const& processor; rtengine::StagedImageProcessor* const& processor;
@ -212,7 +211,6 @@ private:
softProof.set_tooltip_markup (M ("SOFTPROOF_TOOLTIP")); softProof.set_tooltip_markup (M ("SOFTPROOF_TOOLTIP"));
softProof.set_active (false); softProof.set_active (false);
softProof.set_sensitive (canSProof);
softProof.show (); softProof.show ();
Gtk::Image *spGamutCheckImage = Gtk::manage (new RTImage ("spGamutCheck.png")); Gtk::Image *spGamutCheckImage = Gtk::manage (new RTImage ("spGamutCheck.png"));
@ -301,8 +299,8 @@ 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 (canSProof); softProof.set_sensitive (true);
spGamutCheck.set_sensitive (canSProof); spGamutCheck.set_sensitive (softProof.get_active());
} else { } else {
intentBox.setItemSensitivity (0, true); intentBox.setItemSensitivity (0, true);
intentBox.setItemSensitivity (1, true); intentBox.setItemSensitivity (1, true);
@ -352,15 +350,9 @@ private:
void updateSoftProofParameters (bool noEvent = false) void updateSoftProofParameters (bool noEvent = false)
{ {
if (!canSProof) {
ConnectionBlocker profileBlocker (softproofConn);
softProof.set_active (false);
softProof.set_sensitive (false);
#if !defined(__APPLE__) // monitor profile not supported on apple #if !defined(__APPLE__) // monitor profile not supported on apple
} else {
softProof.set_sensitive (profileBox.get_active_row_number () > 0); softProof.set_sensitive (profileBox.get_active_row_number () > 0);
#endif #endif
}
spGamutCheck.set_sensitive (softProof.get_sensitive() && softProof.get_active()); spGamutCheck.set_sensitive (softProof.get_sensitive() && softProof.get_active());
@ -390,7 +382,6 @@ private:
public: public:
explicit ColorManagementToolbar (rtengine::StagedImageProcessor* const& ipc) : explicit ColorManagementToolbar (rtengine::StagedImageProcessor* const& ipc) :
intentBox (Glib::ustring (), true), intentBox (Glib::ustring (), true),
canSProof (!options.rtSettings.printerProfile.empty() && options.rtSettings.printerProfile != "None"), // assuming the printer profile exist!
processor (ipc) processor (ipc)
{ {
#if !defined(__APPLE__) // monitor profile not supported on apple #if !defined(__APPLE__) // monitor profile not supported on apple
@ -419,12 +410,6 @@ public:
grid->attach_next_to (spGamutCheck, Gtk::POS_RIGHT, 1, 1); grid->attach_next_to (spGamutCheck, Gtk::POS_RIGHT, 1, 1);
} }
void canSoftProof (bool canSP)
{
canSProof = canSP;
updateSoftProofParameters();
}
void updateProcessor() void updateProcessor()
{ {
if (processor) { if (processor) {
@ -2305,7 +2290,6 @@ void EditorPanel::tbShowHideSidePanels_managestate()
void EditorPanel::updateProfiles (const Glib::ustring &printerProfile, rtengine::RenderingIntent printerIntent, bool printerBPC) void EditorPanel::updateProfiles (const Glib::ustring &printerProfile, rtengine::RenderingIntent printerIntent, bool printerBPC)
{ {
colorMgmtToolBar->canSoftProof (!printerProfile.empty() && printerProfile != "None");
} }
void EditorPanel::updateTPVScrollbar (bool hide) void EditorPanel::updateTPVScrollbar (bool hide)