diff --git a/rtdata/languages/default b/rtdata/languages/default
index ad30fbff2..a5e4611c6 100644
--- a/rtdata/languages/default
+++ b/rtdata/languages/default
@@ -773,6 +773,7 @@ MAIN_TOOLTIP_SHOWHIDERP1;Show/Hide the right panel.\nShortcut: Alt-l
MAIN_TOOLTIP_SHOWHIDETP1;Show/Hide the top panel.\nShortcut: Shift-l
MAIN_TOOLTIP_THRESHOLD;Threshold
MAIN_TOOLTIP_TOGGLE;Toggle the Before/After view.\nShortcut: Shift-b
+MONITOR_SOFTPROOF;Soft-proof
MONITOR_PROFILE_SYSTEM;System default
NAVIGATOR_B;B:
NAVIGATOR_G;G:
@@ -1513,7 +1514,7 @@ TP_ICM_INPUTPROFILE;Input Profile
TP_ICM_LABEL;Color Management
TP_ICM_NOICM;No ICM: sRGB Output
TP_ICM_OUTPUTPROFILE;Output Profile
-TP_ICM_OUTPUTPROFILEINTENT;Output Rendering Intent
+TP_ICM_PROFILEINTENT;Rendering Intent
TP_ICM_SAVEREFERENCE;Save Reference Image for Profiling
TP_ICM_SAVEREFERENCE_APPLYWB;Apply white balance
TP_ICM_SAVEREFERENCE_APPLYWB_TOOLTIP;Generally, apply the white balance when saving images to create ICC profiles, and do not apply the white balance to create DCP profiles.
diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc
index 24f2bb936..b77da03dd 100644
--- a/rtengine/iccstore.cc
+++ b/rtengine/iccstore.cc
@@ -478,6 +478,11 @@ void ICCStore::findDefaultMonitorProfile ()
if (GetICMProfileA(hDC, &profileLength, profileName)) {
defaultMonitorProfile = Glib::ustring(profileName);
+ defaultMonitorProfile = Glib::path_get_basename(defaultMonitorProfile);
+ size_t pos = defaultMonitorProfile.rfind(".");
+ if (pos != Glib::ustring::npos) {
+ defaultMonitorProfile = defaultMonitorProfile.substr(0, pos);
+ }
}
// might fail if e.g. the monitor has no profile
diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc
index e99daa79a..8866cd398 100644
--- a/rtengine/improcfun.cc
+++ b/rtengine/improcfun.cc
@@ -211,11 +211,9 @@ void ImProcFunctions::updateColorProfiles (const ColorManagementParams &icm, Gli
cmsHPROFILE monitor = iccStore->getProfile (monitorProfile);
- printf("ImProcFunctions::updateColorProfiles / monitor profile = %s / intent = %d\n", monitorProfile.c_str(), monitorIntent);
if (monitor) {
MyMutex::MyLock lcmsLock (*lcmsMutex);
cmsHPROFILE iprof = cmsCreateLab4Profile(NULL);
- printf(" - monitorTransform = cmsCreateTransform / intent=%d\n", monitorIntent);
monitorTransform = cmsCreateTransform (iprof, TYPE_Lab_FLT, monitor, TYPE_RGB_8, monitorIntent,
cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE ); // NOCACHE is for thread safety, NOOPTIMIZE for precision
@@ -229,9 +227,7 @@ void ImProcFunctions::updateColorProfiles (const ColorManagementParams &icm, Gli
//TODO: Create a dedicated softproof transformation (line below to be finished)
//lab2outputTransform = cmsCreateProofingTransform(iprof, TYPE_Lab_FLT, jprof, TYPE_RGB_FLT, monitor, icm.outputIntent, monitorIntent, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE | cmsFLAGS_SOFTPROOFING );
- printf(" - lab2outputTransform = cmsCreateTransform / intent=%d\n", icm.outputIntent);
lab2outputTransform = cmsCreateTransform (iprof, TYPE_Lab_FLT, jprof, TYPE_RGB_FLT, icm.outputIntent, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE );
- printf(" - output2monitorTransform = cmsCreateTransform / intent=%d\n", monitorIntent);
output2monitorTransform = cmsCreateTransform (jprof, TYPE_RGB_FLT, monitor, TYPE_RGB_8, monitorIntent, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE );
}
}
diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc
index a762fc95b..74fa2f937 100644
--- a/rtgui/editorpanel.cc
+++ b/rtgui/editorpanel.cc
@@ -37,9 +37,8 @@ class MonitorProfileSelector
private:
Gtk::ToggleButton* softProof;
MyComboBoxText* profileBox;
- //PopUpButton* intentBox;
- MyComboBoxText* intentBox;
- sigc::connection profileConn, intentConn;
+ PopUpButton* intentBox;
+ sigc::connection profileConn, intentConn, softProofConn;
rtengine::StagedImageProcessor* processor;
@@ -51,7 +50,8 @@ private:
softProof = Gtk::manage(new Gtk::ToggleButton());
softProof->add(*softProofImg);
softProof->set_relief(Gtk::RELIEF_NONE);
- softProof->signal_toggled().connect (sigc::mem_fun (this, &MonitorProfileSelector::softProofToggled));
+ softProof->set_tooltip_text(M("MONITOR_SOFTPROOF"));
+ softProofConn = softProof->signal_toggled().connect (sigc::mem_fun (this, &MonitorProfileSelector::softProofToggled));
}
void prepareProfileBox ()
@@ -76,17 +76,13 @@ private:
void prepareIntentBox ()
{
- intentBox = Gtk::manage(new MyComboBoxText());
- intentBox->set_size_request(-1,-1);
- //intentBox = Gtk::manage(new PopUpButton());
-
- intentBox->append_text (M("PREFERENCES_INTENT_PERCEPTUAL"));
- intentBox->append_text (M("PREFERENCES_INTENT_RELATIVE"));
- //intentBox->addEntry("intent-relative.png", M("PREFERENCES_INTENT_RELATIVE"));
- //intentBox->addEntry("intent-perceptual.png", M("PREFERENCES_INTENT_PERCEPTUAL"));
- //intentBox->setSelected(0);
- intentConn = intentBox->signal_changed().connect (sigc::mem_fun (this, &MonitorProfileSelector::updateParameters));
- //intentConn = intentBox->signal_changed().connect (sigc::mem_fun (this, &MonitorProfileSelector::updateIntent));
+ PopUpButton *bt = new PopUpButton();
+ intentBox = Gtk::manage(bt);
+ intentBox->addEntry("intent-relative.png", M("PREFERENCES_INTENT_RELATIVE"));
+ intentBox->addEntry("intent-perceptual.png", M("PREFERENCES_INTENT_PERCEPTUAL"));
+ intentBox->setSelected(0);
+ intentConn = intentBox->signal_changed().connect (sigc::mem_fun (this, &MonitorProfileSelector::updateIntent));
+ intentBox->show();
}
void softProofToggled ()
@@ -105,6 +101,7 @@ private:
void updateParameters ()
{
Glib::ustring profile;
+ profileBox->set_tooltip_text(profileBox->get_active_text ());
#ifdef WIN32
if (profileBox->get_active_row_number () == 1) {
profile = rtengine::iccStore->getDefaultMonitorProfileStr ();
@@ -121,23 +118,36 @@ private:
profile = profileBox->get_active_row_number () > 0 ? profileBox->get_active_text () : Glib::ustring();
#endif
- std::uint8_t supportedIntents = rtengine::iccStore->getProofIntents (profile);
- const bool supportsPerceptual = supportedIntents & 1 << INTENT_PERCEPTUAL;
- const bool supportsRelativeColorimetric = supportedIntents & 1 << INTENT_RELATIVE_COLORIMETRIC;
-
- if (supportsPerceptual && supportsRelativeColorimetric) {
- intentBox->set_sensitive (true);
- }
- else {
+ // MonitorProfile = None , disabling everything
+ if (profileBox->get_active_row_number () == 0) {
+ profile.clear();
bool wasBlocked = intentConn.block(true);
- intentBox->set_active(supportsPerceptual ? 0 : 1);
- //intentBox->setSelected(supportsPerceptual ? 0 : 1);
+ intentBox->setSelected(1);
intentBox->set_sensitive (false);
intentConn.block(wasBlocked);
+ softProof->set_active(false);
+ softProof->set_sensitive(false);
+ wasBlocked = softProofConn.block(true);
+ softProofConn.block(wasBlocked);
+
+ } else {
+ std::uint8_t supportedIntents = rtengine::iccStore->getProofIntents (profile);
+ const bool supportsPerceptual = supportedIntents & 1 << INTENT_PERCEPTUAL;
+ const bool supportsRelativeColorimetric = supportedIntents & 1 << INTENT_RELATIVE_COLORIMETRIC;
+
+ if (supportsPerceptual && supportsRelativeColorimetric) {
+ intentBox->set_sensitive (true);
+ }
+ else {
+ bool wasBlocked = intentConn.block(true);
+ intentBox->setSelected(supportsPerceptual ? 0 : 1);
+ intentBox->set_sensitive (false);
+ intentConn.block(wasBlocked);
+ }
+ softProof->set_sensitive(true);
}
- //rtengine::eRenderingIntent intent = intentBox->getSelected() > 0 ? rtengine::RI_PERCEPTUAL : rtengine::RI_RELATIVE;
- rtengine::eRenderingIntent intent = intentBox->get_active_row_number() > 0 ? rtengine::RI_RELATIVE : rtengine::RI_PERCEPTUAL;
+ rtengine::eRenderingIntent intent = intentBox->getSelected() > 0 ? rtengine::RI_PERCEPTUAL : rtengine::RI_RELATIVE;
if (!processor) {
return;
@@ -148,9 +158,14 @@ private:
//options.rtSettings.monitorIntent = intent;
// ...or store them locally
- printf("Appel de processor->setMonitorProfile(%s, %d)\n", profile.c_str(), intent);
+ processor->beginUpdateParams ();
+ if (options.rtSettings.verbose) {
+ printf("Monitor profile: %s, Intent: %s)\n",
+ profile.empty() ? "None" : profile.c_str(),
+ intent > 0 ? M("PREFERENCES_INTENT_PERCEPTUAL").c_str() : M("PREFERENCES_INTENT_RELATIVE").c_str()
+ );
+ }
processor->setMonitorProfile(profile, intent);
- printf("Appel de processor->endUpdateParams(%d)\n", rtengine::EvMonitorTransform);
processor->endUpdateParams (rtengine::EvMonitorTransform);
}
@@ -169,8 +184,8 @@ public:
void pack_end_in (Gtk::Box* box)
{
box->pack_end (*softProof, Gtk::PACK_SHRINK, 0);
- box->pack_end (*intentBox, Gtk::PACK_SHRINK, 0);
- box->pack_end (*profileBox, Gtk::PACK_EXPAND_WIDGET, 0);
+ box->pack_end (*intentBox->buttonGroup, Gtk::PACK_SHRINK, 0);
+ box->pack_end (*profileBox, Gtk::PACK_SHRINK, 0);
}
void reset ()
@@ -190,12 +205,10 @@ public:
profileConn.block(wasBlocked);
#endif
wasBlocked = intentConn.block(true);
- intentBox->set_active (options.rtSettings.monitorIntent == rtengine::RI_PERCEPTUAL ? 0 : 1);
- //intentBox->setSelected(options.rtSettings.monitorIntent == rtengine::RI_PERCEPTUAL ? 0 : 1);
+ intentBox->setSelected(options.rtSettings.monitorIntent == rtengine::RI_PERCEPTUAL ? 0 : 1);
intentConn.block(wasBlocked);
- // useless, set_active will trigger the signal_changed event
- //updateParameters ();
+ updateParameters();
}
void setImageProcessor (rtengine::StagedImageProcessor* imageProc) {
@@ -205,7 +218,7 @@ public:
};
EditorPanel::EditorPanel (FilePanel* filePanel)
- : realized(false), iHistoryShow(NULL), iHistoryHide(NULL), iTopPanel_1_Show(NULL), iTopPanel_1_Hide(NULL), iRightPanel_1_Show(NULL), iRightPanel_1_Hide(NULL), iBeforeLockON(NULL), iBeforeLockOFF(NULL), beforePreviewHandler(NULL), beforeIarea(NULL), beforeBox(NULL), afterBox(NULL), afterHeaderBox(NULL), parent(NULL), openThm(NULL), ipc(NULL), beforeIpc(NULL), isProcessing(false), catalogPane(NULL)
+ : realized(false), iHistoryShow(NULL), iHistoryHide(NULL), iTopPanel_1_Show(NULL), iTopPanel_1_Hide(NULL), iRightPanel_1_Show(NULL), iRightPanel_1_Hide(NULL), iBeforeLockON(NULL), iBeforeLockOFF(NULL), beforePreviewHandler(NULL), monitorProfile(new MonitorProfileSelector ()), beforeIarea(NULL), beforeBox(NULL), afterBox(NULL), afterHeaderBox(NULL), parent(NULL), openThm(NULL), ipc(NULL), beforeIpc(NULL), isProcessing(false), catalogPane(NULL)
{
epih = new EditorPanelIdleHelper;
@@ -438,7 +451,6 @@ EditorPanel::EditorPanel (FilePanel* filePanel)
// Monitor profile buttons
iops->pack_end (*Gtk::manage(new Gtk::VSeparator()), Gtk::PACK_SHRINK, 0);
- monitorProfile = new MonitorProfileSelector ();
monitorProfile->pack_end_in (iops);
editbox->pack_start (*Gtk::manage(new Gtk::HSeparator()), Gtk::PACK_SHRINK, 0);
@@ -577,7 +589,6 @@ EditorPanel::~EditorPanel ()
delete ppframe;
delete leftbox;
delete vboxright;
- delete monitorProfile;
//delete saveAsDialog;
if(catalogPane) {
diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h
index 0575b7f92..ffb8a93a4 100644
--- a/rtgui/editorpanel.h
+++ b/rtgui/editorpanel.h
@@ -86,7 +86,7 @@ protected:
Gtk::Button* navNext;
Gtk::Button* navPrev;
- MonitorProfileSelector* monitorProfile;
+ std::auto_ptr monitorProfile;
ImageAreaPanel* iareapanel;
PreviewHandler* previewHandler;
diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc
index 55e8e1a6e..8b2965cab 100644
--- a/rtgui/icmpanel.cc
+++ b/rtgui/icmpanel.cc
@@ -83,7 +83,8 @@ ICMPanel::ICMPanel () : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunch
dcpFrame = Gtk::manage (new Gtk::Frame ("DCP"));
Gtk::VBox* dcpFrameVBox = Gtk::manage (new Gtk::VBox ());
- dcpFrameVBox->set_border_width(4);
+ dcpFrameVBox->set_border_width(0);
+ dcpFrameVBox->set_spacing(2);
Gtk::HBox* dcpIllHBox = Gtk::manage (new Gtk::HBox ());
dcpIllLabel = Gtk::manage (new Gtk::Label (M("TP_ICM_DCPILLUMINANT") + ":"));
@@ -101,29 +102,25 @@ ICMPanel::ICMPanel () : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunch
dcpIllHBox->pack_start(*dcpIllLabel, Gtk::PACK_SHRINK, 4);
dcpIllHBox->pack_start(*dcpIll);
- Gtk::HBox* c1HBox = Gtk::manage ( new Gtk::HBox(true, 4));
ckbToneCurve = Gtk::manage (new Gtk::CheckButton (M("TP_ICM_TONECURVE")));
ckbToneCurve->set_sensitive (false);
ckbToneCurve->set_tooltip_text (M("TP_ICM_TONECURVE_TOOLTIP"));
ckbApplyHueSatMap = Gtk::manage (new Gtk::CheckButton (M("TP_ICM_APPLYHUESATMAP")));
ckbApplyHueSatMap->set_sensitive (false);
ckbApplyHueSatMap->set_tooltip_text (M("TP_ICM_APPLYHUESATMAP_TOOLTIP"));
- c1HBox->pack_start (*ckbToneCurve);
- c1HBox->pack_start (*ckbApplyHueSatMap);
- Gtk::HBox* c2HBox = Gtk::manage ( new Gtk::HBox(true, 4));
ckbApplyLookTable = Gtk::manage (new Gtk::CheckButton (M("TP_ICM_APPLYLOOKTABLE")));
ckbApplyLookTable->set_sensitive (false);
ckbApplyLookTable->set_tooltip_text (M("TP_ICM_APPLYLOOKTABLE_TOOLTIP"));
ckbApplyBaselineExposureOffset = Gtk::manage (new Gtk::CheckButton (M("TP_ICM_APPLYBASELINEEXPOSUREOFFSET")));
ckbApplyBaselineExposureOffset->set_sensitive (false);
ckbApplyBaselineExposureOffset->set_tooltip_text (M("TP_ICM_APPLYBASELINEEXPOSUREOFFSET_TOOLTIP"));
- c2HBox->pack_start (*ckbApplyLookTable);
- c2HBox->pack_start (*ckbApplyBaselineExposureOffset);
- dcpFrameVBox->pack_start(*dcpIllHBox);
- dcpFrameVBox->pack_start(*c1HBox);
- dcpFrameVBox->pack_start(*c2HBox);
+ dcpFrameVBox->pack_start(*dcpIllHBox, Gtk::PACK_SHRINK, 0);
+ dcpFrameVBox->pack_start(*ckbToneCurve, Gtk::PACK_SHRINK,0);
+ dcpFrameVBox->pack_start(*ckbApplyHueSatMap, Gtk::PACK_SHRINK,0);
+ dcpFrameVBox->pack_start(*ckbApplyLookTable, Gtk::PACK_SHRINK,0);
+ dcpFrameVBox->pack_start(*ckbApplyBaselineExposureOffset, Gtk::PACK_SHRINK,0);
dcpFrame->add(*dcpFrameVBox);
dcpFrame->set_sensitive(false);
iVBox->pack_start (*dcpFrame);
@@ -194,16 +191,17 @@ ICMPanel::ICMPanel () : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunch
onames->set_active (0);
// Rendering intent
-
- Gtk::Label* outputIntentLbl = Gtk::manage (new Gtk::Label(M("TP_ICM_OUTPUTPROFILEINTENT")));
- oVBox->pack_start (*outputIntentLbl, Gtk::PACK_SHRINK);
+ Gtk::HBox *riHBox = Gtk::manage ( new Gtk::HBox());
+ Gtk::Label* outputIntentLbl = Gtk::manage (new Gtk::Label(M("TP_ICM_PROFILEINTENT")+":"));
+ riHBox->pack_start (*outputIntentLbl, Gtk::PACK_SHRINK);
ointent = Gtk::manage (new MyComboBoxText ());
- oVBox->pack_start (*ointent, Gtk::PACK_EXPAND_WIDGET);
+ riHBox->pack_start (*ointent, Gtk::PACK_EXPAND_WIDGET);
ointent->append_text (M("PREFERENCES_INTENT_PERCEPTUAL"));
ointent->append_text (M("PREFERENCES_INTENT_RELATIVE"));
ointent->append_text (M("PREFERENCES_INTENT_SATURATION"));
ointent->append_text (M("PREFERENCES_INTENT_ABSOLUTE"));
ointent->set_active(0);
+ oVBox->pack_start(*riHBox, Gtk::PACK_SHRINK);
// Output gamma
diff --git a/rtgui/popupbutton.cc b/rtgui/popupbutton.cc
index 440d7b420..e0cca8bd0 100644
--- a/rtgui/popupbutton.cc
+++ b/rtgui/popupbutton.cc
@@ -39,3 +39,8 @@ void PopUpButton::set_tooltip_text (const Glib::ustring &text)
{
PopUpCommon::set_tooltip_text (text);
}
+
+void PopUpButton::set_sensitive (bool isSensitive)
+{
+ buttonGroup->set_sensitive(isSensitive);
+}
diff --git a/rtgui/popupbutton.h b/rtgui/popupbutton.h
index 23a9211a8..dec848b14 100644
--- a/rtgui/popupbutton.h
+++ b/rtgui/popupbutton.h
@@ -31,6 +31,7 @@ public:
PopUpButton (const Glib::ustring& label = "");
void show ();
void set_tooltip_text (const Glib::ustring &text);
+ void set_sensitive (bool isSensitive=true);
};
#endif