summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f08603d)
raw | patch | inline | side by side (parent: f08603d)
author | joncruz <joncruz@users.sourceforge.net> | |
Fri, 5 Oct 2007 03:45:35 +0000 (03:45 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Fri, 5 Oct 2007 03:45:35 +0000 (03:45 +0000) |
src/color-profile.cpp | patch | blob | history | |
src/preferences-skeleton.h | patch | blob | history | |
src/ui/dialog/inkscape-preferences.cpp | patch | blob | history |
diff --git a/src/color-profile.cpp b/src/color-profile.cpp
index 609c14cc1c72b33fe6741566d59e271af330bae5..eb8f7754ccafd8ba125e0ca0e35cad2c8f94004b 100644 (file)
--- a/src/color-profile.cpp
+++ b/src/color-profile.cpp
#include <glib/gstdio.h>
#include <sys/fcntl.h>
+#include <gdkmm/color.h>
#ifdef DEBUG_LCMS
#include <gtk/gtkmessagedialog.h>
}
static bool gamutWarn = false;
+static Gdk::Color lastGamutColor("#00ff00");
static bool lastBPC = false;
static bool lastPreserveBlack = false;
static int lastIntent = INTENT_PERCEPTUAL;
icColorSpaceSignature space = cmsGetColorSpace(theOne);
icProfileClassSignature profClass = cmsGetDeviceClass(theOne);
+ (void)space;
+ (void)profClass;
/*
if ( profClass != icSigDisplayClass ) {
g_warning("Not a display profile");
int proofIntent = prefs_get_int_attribute_limited( "options.softproof", "intent", 0, 0, 3 );
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 );
+ gchar const* colorStr = prefs_get_string_attribute("options.softproof", "gamutcolor");
+ Gdk::Color gamutColor( (colorStr && colorStr[0]) ? colorStr : "#00ff00");
if ( (warn != gamutWarn)
|| (lastIntent != intent)
|| (lastProofIntent != proofIntent)
|| (bpc != lastBPC)
|| (preserveBlack != lastPreserveBlack)
+ || (gamutColor != lastGamutColor)
) {
gamutWarn = warn;
if ( transf ) {
lastProofIntent = proofIntent;
lastBPC = bpc;
lastPreserveBlack = preserveBlack;
+ lastGamutColor = gamutColor;
}
// 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);
+ cmsSetAlarmCodes(gamutColor.get_red() >> 8, gamutColor.get_green() >> 8, gamutColor.get_blue() >> 8);
}
if ( bpc ) {
dwFlags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
index 242a9d919a20f0eb40b33fb5d02285dcbe0dcca2..ab40f4c00f3a2c158425c2d96ab92d0260221872 100644 (file)
" id=\"softproof\"\n"
" enable=\"0\"\n"
" intent=\"0\"\n"
+" gamutcolor=\"#00FF00\"\n"
" gamutwarn=\"0\"\n"
" bpc=\"0\"\n"
" preserveblack=\"0\"\n"
index 9a312538129db884b84755d5bb26a4fbbaaf3e10..9ca4b54cb2e15693e0890e762f2a788f6f30c2a0 100644 (file)
forceUpdates();
}
}
+
+static void gamutColorChanged( Gtk::ColorButton* btn ) {
+ Gdk::Color color = btn->get_color();
+ gushort r = color.get_red();
+ gushort g = color.get_green();
+ gushort b = color.get_blue();
+
+ gchar* tmp = g_strdup_printf("#%02x%02x%02x", (r >> 8), (g >> 8), (b >> 8) );
+
+ prefs_set_string_attribute( "options.softproof", "gamutcolor", tmp );
+ g_free(tmp);
+ forceUpdates();
+}
#endif // ENABLE_LCMS
void InkscapePreferences::initPageCMS()
_page_cms.add_line( false, "", _cms_gamutwarn, "",
_("Highlights colors that are out of gamut for the target device."), false);
- Gdk::Color tmpColor("#00ff00");
+ gchar const* colorStr = prefs_get_string_attribute("options.softproof", "gamutcolor");
+ Gdk::Color tmpColor( (colorStr && colorStr[0]) ? colorStr : "#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);
_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_gamutcolor.signal_color_set().connect( sigc::bind( sigc::ptr_fun(gamutColorChanged), &_cms_gamutcolor) );
_cms_proof_blackpoint.signal_toggled().connect( sigc::ptr_fun(forceUpdates) );
_cms_proof_preserveblack.signal_toggled().connect( sigc::ptr_fun(forceUpdates) );