summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a554703)
raw | patch | inline | side by side (parent: a554703)
author | joncruz <joncruz@users.sourceforge.net> | |
Thu, 4 Oct 2007 05:58:08 +0000 (05:58 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Thu, 4 Oct 2007 05:58:08 +0000 (05:58 +0000) |
diff --git a/src/color-profile.cpp b/src/color-profile.cpp
index 75757068fdfb13b7faaf741d4df58f19a42b34e4..609c14cc1c72b33fe6741566d59e271af330bae5 100644 (file)
--- a/src/color-profile.cpp
+++ b/src/color-profile.cpp
}
static bool gamutWarn = false;
+static bool lastBPC = false;
+static bool lastPreserveBlack = false;
static int lastIntent = INTENT_PERCEPTUAL;
static int lastProofIntent = INTENT_PERCEPTUAL;
static cmsHTRANSFORM transf = 0;
bool warn = prefs_get_int_attribute_limited( "options.softproof", "gamutwarn", 0, 0, 1 );
int intent = prefs_get_int_attribute_limited( "options.displayprofile", "intent", 0, 0, 3 );
int proofIntent = prefs_get_int_attribute_limited( "options.softproof", "intent", 0, 0, 3 );
-
- if ( (warn != gamutWarn) || (lastIntent != intent) || (lastProofIntent != proofIntent)) {
+ bool bpc = prefs_get_int_attribute_limited( "options.softproof", "bpc", 0, 0, 1 );
+ bool preserveBlack = prefs_get_int_attribute_limited( "options.softproof", "preserveblack", 0, 0, 1 );
+
+ if ( (warn != gamutWarn)
+ || (lastIntent != intent)
+ || (lastProofIntent != proofIntent)
+ || (bpc != lastBPC)
+ || (preserveBlack != lastPreserveBlack)
+ ) {
gamutWarn = warn;
if ( transf ) {
cmsDeleteTransform(transf);
}
lastIntent = intent;
lastProofIntent = proofIntent;
+ lastBPC = bpc;
+ lastPreserveBlack = preserveBlack;
}
// Fecth these now, as they might clear the transform as a side effect.
DWORD dwFlags = cmsFLAGS_SOFTPROOFING;
if ( gamutWarn ) {
dwFlags |= cmsFLAGS_GAMUTCHECK;
+ cmsSetAlarmCodes(0, 255, 0);
+ }
+ if ( bpc ) {
+ dwFlags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
+ }
+ if ( preserveBlack ) {
+ dwFlags |= cmsFLAGS_PRESERVEBLACK;
}
- cmsSetAlarmCodes(0, 255, 0);
transf = cmsCreateProofingTransform( srcprof, TYPE_RGB_8, hprof, TYPE_RGB_8, proofProf, intent, proofIntent, dwFlags );
} else if ( hprof ) {
transf = cmsCreateTransform( srcprof, TYPE_RGB_8, hprof, TYPE_RGB_8, intent, 0 );
index b01d5a3de0cb47243a4b1783ab264d54307e6c91..242a9d919a20f0eb40b33fb5d02285dcbe0dcca2 100644 (file)
" enable=\"0\"\n"
" intent=\"0\"\n"
" gamutwarn=\"0\"\n"
+" bpc=\"0\"\n"
+" preserveblack=\"0\"\n"
" uri=\"\" />\n"
" <group id=\"savewindowgeometry\" value=\"1\"/>\n"
" <group id=\"defaultoffsetwidth\" value=\"2\"/>\n"
index e3d0de1f9a9f7cb0835fd2965f26402d910cf6b2..a747e004577346a36cc1584c8c822220ddfe4b24 100644 (file)
void InkscapePreferences::initPageCMS()
{
+ int const numIntents = 4;
+ Glib::ustring intentLabels[numIntents] = {_("Perceptual"), _("Relative Colorimetric"), _("Saturation"), _("Absolute Colorimetric")};
+ int intentValues[numIntents] = {0, 1, 2, 3};
+
+ _page_cms.add_group_header( _("Disply Calibration"));
+
_cms_display.init( _("Enable display calibration"), "options.displayprofile", "enable", false);
_page_cms.add_line( false, "", _cms_display, "",
_("Enables application of the display using an ICC profile."), false);
- int const numIntents = 4;
- Glib::ustring intentLabels[numIntents] = {_("Perceptual"), _("Relative Colorimetric"), _("Saturation"), _("Absolute Colorimetric")};
- int intentValues[numIntents] = {0, 1, 2, 3};
+ _page_cms.add_line( false, _("Display profile:"), _cms_display_profile, "",
+ _("The ICC profile to use to calibrate display output."), false);
_cms_intent.init("options.displayprofile", "intent", intentLabels, intentValues, numIntents, 0);
_page_cms.add_line( false, _("Display intent:"), _cms_intent, "",
_("The rendering intent to use to calibrate display output."), false);
- _page_cms.add_line( false, _("Display profile:"), _cms_display_profile, "",
- _("The ICC profile to use to calibrate display output."), false);
-
+ _page_cms.add_group_header( _("Proofing"));
_cms_softproof.init( _("Simulate output on screen."), "options.softproof", "enable", false);
_page_cms.add_line( false, "", _cms_softproof, "",
_page_cms.add_line( false, "", _cms_gamutwarn, "",
_("Highlights colors that are out of gamut for the target device."), false);
+ Gdk::Color tmpColor("#00ff00");
+ _cms_gamutcolor.set_color( tmpColor );
+ _cms_gamutcolor.set_sensitive( false );
+ _page_cms.add_line( true, "Out of gamut warning color:", _cms_gamutcolor, "",
+ _("Selects the color used for out of gamut warning."), false);
+
+ _page_cms.add_line( false, _("Device profile:"), _cms_proof_profile, "",
+ _("The ICC profile to use to simulate device output."), false);
+
_cms_proof_intent.init("options.softproof", "intent", intentLabels, intentValues, numIntents, 0);
_page_cms.add_line( false, _("Device intent:"), _cms_proof_intent, "",
_("The rendering intent to use to calibrate display output."), false);
- _page_cms.add_line( false, _("Device profile:"), _cms_proof_profile, "",
- _("The ICC profile to use to simulate device output."), false);
+ _cms_proof_blackpoint.init( _("Black Point Compensation."), "options.softproof", "bpc", false);
+ _page_cms.add_line( false, "", _cms_proof_blackpoint, "",
+ _("Enables black point compensation."), false);
+
+ _cms_proof_preserveblack.init( _("Preserve black."), "options.softproof", "preserveblack", false);
+ _page_cms.add_line( false, "", _cms_proof_preserveblack, "",
+ "", false);
#if ENABLE_LCMS
{
_cms_display.signal_toggled().connect( sigc::ptr_fun(forceUpdates) );
_cms_softproof.signal_toggled().connect( sigc::ptr_fun(forceUpdates) );
_cms_gamutwarn.signal_toggled().connect( sigc::ptr_fun(forceUpdates) );
+ _cms_proof_blackpoint.signal_toggled().connect( sigc::ptr_fun(forceUpdates) );
+ _cms_proof_preserveblack.signal_toggled().connect( sigc::ptr_fun(forceUpdates) );
_cms_intent.signal_changed().connect( sigc::ptr_fun(forceUpdates) );
_cms_proof_intent.signal_changed().connect( sigc::ptr_fun(forceUpdates) );
_cms_display_profile.set_sensitive( false );
_cms_softproof.set_sensitive( false );
_cms_gamutwarn.set_sensitive( false );
+ _cms_gamutcolor.set_sensitive( false );
_cms_proof_intent.set_sensitive( false );
_cms_proof_profile.set_sensitive( false );
+ _cms_proof_blackpoint.set_sensitive( false );
+ _cms_proof_preserveblack_sensitive( false );
#endif // ENABLE_LCMS
this->AddPage(_page_cms, _("Color Management"), PREFS_PAGE_CMS);
index c41971fddfa264bbc43afda69c3db41280ee34ad..823de92deba3046f37fccdf895af9e07a3a35fc3 100644 (file)
#include <iostream>
#include <vector>
#include <gtkmm/table.h>
+#include <gtkmm/colorbutton.h>
#include <gtkmm/comboboxtext.h>
#include <gtkmm/spinbutton.h>
#include <gtkmm/treestore.h>
PrefCombo _misc_overs_bitmap;
PrefCheckButton _cms_display;
- PrefCombo _cms_intent;
Gtk::ComboBoxText _cms_display_profile;
+ PrefCombo _cms_intent;
PrefCheckButton _cms_softproof;
PrefCheckButton _cms_gamutwarn;
- PrefCombo _cms_proof_intent;
+ Gtk::ColorButton _cms_gamutcolor;
Gtk::ComboBoxText _cms_proof_profile;
+ PrefCombo _cms_proof_intent;
+ PrefCheckButton _cms_proof_blackpoint;
+ PrefCheckButton _cms_proof_preserveblack;
PrefEntryButtonHBox _importexport_ocal_url;
PrefEntry _importexport_ocal_username;