Cleaning up the GUI for the monitor profile and rendering intent +

output profile rendering intent + soft-proof button.

DCP profile GUI switched from 2x2 array to a single column.
This commit is contained in:
Hombre
2015-12-18 01:45:59 +01:00
parent 32eb6b996c
commit e9141dd98c
8 changed files with 75 additions and 58 deletions

View File

@@ -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) {

View File

@@ -86,7 +86,7 @@ protected:
Gtk::Button* navNext;
Gtk::Button* navPrev;
MonitorProfileSelector* monitorProfile;
std::auto_ptr<MonitorProfileSelector> monitorProfile;
ImageAreaPanel* iareapanel;
PreviewHandler* previewHandler;

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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