Commit 169c7dbc authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

added settings for marking out-of-gamut colors in the Print Simulation

2007-10-05  Sven Neumann  <sven@gimp.org>

        * libgimpconfig/gimpcolorconfig.[ch]: added settings for marking
        out-of-gamut colors in the Print Simulation (bug #476824).

        * app/dialogs/preferences-dialog.c: added a check-button for the
        out-of-gamut warning and tweaked the layout of the Color Management
        page to make the relationship of the settings more obvious.

        * modules/cdisplay_lcms.c: mark out-of-gamut colors.


svn path=/trunk/; revision=23729
parent c7a6bf22
2007-10-05 Sven Neumann <sven@gimp.org>
* libgimpconfig/gimpcolorconfig.[ch]: added settings for marking
out-of-gamut colors in the Print Simulation (bug #476824).
* app/dialogs/preferences-dialog.c: added a check-button for the
out-of-gamut warning and tweaked the layout of the Color Management
page to make the relationship of the settings more obvious.
* modules/cdisplay_lcms.c: mark out-of-gamut colors.
2007-10-04 Sven Neumann <sven@gimp.org>
* modules/cdisplay_lcms.c
......@@ -2397,7 +2397,7 @@ prefs_dialog_new (Gimp *gimp,
&top_iter,
page_index++);
table = prefs_table_new (9, GTK_CONTAINER (vbox));
table = prefs_table_new (10, GTK_CONTAINER (vbox));
{
static const struct
......@@ -2451,15 +2451,16 @@ prefs_dialog_new (Gimp *gimp,
if (i == 2) /* display profile */
{
gtk_table_set_row_spacing (GTK_TABLE (table), row - 2, 12);
button =
gimp_prop_check_button_new (color_config,
"display-profile-from-gdk",
_("_Try to obtain the monitor "
"profile from the windowing "
"system"));
_("_Try to use the system monitor "
"profile"));
gtk_table_attach_defaults (GTK_TABLE (table),
button, 0, 2, row, row + 1);
button, 1, 2, row, row + 1);
gtk_widget_show (button);
row++;
......@@ -2479,14 +2480,22 @@ prefs_dialog_new (Gimp *gimp,
}
}
gtk_table_set_row_spacing (GTK_TABLE (table), row - 1, 12);
g_object_unref (store);
g_object_unref (color_config);
button = gimp_prop_check_button_new (color_config, "simulation-gamut-check",
_("Mark out of gamut colors"));
gtk_table_attach_defaults (GTK_TABLE (table),
button, 1, 2, row, row + 1);
gtk_widget_show (button);
row++;
gtk_table_set_row_spacing (GTK_TABLE (table), row - 1, 12);
button = prefs_enum_combo_box_add (object, "color-profile-policy", 0, 0,
_("File Open behaviour:"),
GTK_TABLE (table), row++, NULL);
g_object_unref (color_config);
}
......
......@@ -53,6 +53,11 @@ GimpColorConfig
</para>
<!-- ##### ARG GimpColorConfig:out-of-gamut-color ##### -->
<para>
</para>
<!-- ##### ARG GimpColorConfig:printer-profile ##### -->
<para>
......@@ -63,6 +68,11 @@ GimpColorConfig
</para>
<!-- ##### ARG GimpColorConfig:simulation-gamut-check ##### -->
<para>
</para>
<!-- ##### ARG GimpColorConfig:simulation-rendering-intent ##### -->
<para>
......
......@@ -24,6 +24,8 @@
#include <glib-object.h>
#include "libgimpcolor/gimpcolor.h"
#include "gimpconfigtypes.h"
#include "gimpcolorconfig-enums.h"
......@@ -55,6 +57,11 @@
#define SIMULATION_RENDERING_INTENT_BLURB \
N_("Sets how colors are converted from RGB working space to the " \
"print simulation device.")
#define SIMULATION_GAMUT_CHECK_BLURB \
N_("When enabled, the print simulation will mark colors which can not be " \
"represented in the target color space.")
#define OUT_OF_GAMUT_COLOR_BLURB \
N_("The color to use for marking colors which are out of gamut.")
enum
......@@ -68,6 +75,8 @@ enum
PROP_PRINTER_PROFILE,
PROP_DISPLAY_RENDERING_INTENT,
PROP_SIMULATION_RENDERING_INTENT,
PROP_SIMULATION_GAMUT_CHECK,
PROP_OUT_OF_GAMUT_COLOR,
PROP_DISPLAY_MODULE
};
......@@ -95,6 +104,9 @@ static void
gimp_color_config_class_init (GimpColorConfigClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpRGB color;
gimp_rgba_set_uchar (&color, 0xff, 0x00, 0xff, 0xff);
object_class->finalize = gimp_color_config_finalize;
object_class->set_property = gimp_color_config_set_property;
......@@ -138,6 +150,17 @@ gimp_color_config_class_init (GimpColorConfigClass *klass)
GIMP_TYPE_COLOR_RENDERING_INTENT,
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SIMULATION_GAMUT_CHECK,
"simulation-gamut-check",
SIMULATION_GAMUT_CHECK_BLURB,
FALSE,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_RGB (object_class, PROP_OUT_OF_GAMUT_COLOR,
"out-of-gamut-color",
OUT_OF_GAMUT_COLOR_BLURB,
FALSE, &color,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DISPLAY_MODULE,
"display-module", NULL,
"CdisplayLcms",
......@@ -210,6 +233,12 @@ gimp_color_config_set_property (GObject *object,
case PROP_SIMULATION_RENDERING_INTENT:
color_config->simulation_intent = g_value_get_enum (value);
break;
case PROP_SIMULATION_GAMUT_CHECK:
color_config->simulation_gamut_check = g_value_get_boolean (value);
break;
case PROP_OUT_OF_GAMUT_COLOR:
color_config->out_of_gamut_color = *(GimpRGB *) g_value_get_boxed (value);
break;
case PROP_DISPLAY_MODULE:
g_free (color_config->display_module);
color_config->display_module = g_value_dup_string (value);
......@@ -255,6 +284,12 @@ gimp_color_config_get_property (GObject *object,
case PROP_SIMULATION_RENDERING_INTENT:
g_value_set_enum (value, color_config->simulation_intent);
break;
case PROP_SIMULATION_GAMUT_CHECK:
g_value_set_boolean (value, color_config->simulation_gamut_check);
break;
case PROP_OUT_OF_GAMUT_COLOR:
g_value_set_boxed (value, &color_config->out_of_gamut_color);
break;
case PROP_DISPLAY_MODULE:
g_value_set_string (value, color_config->display_module);
break;
......
......@@ -47,6 +47,19 @@ struct _GimpColorConfig
GimpColorRenderingIntent simulation_intent;
gchar *display_module;
gboolean simulation_gamut_check;
GimpRGB out_of_gamut_color;
/* Padding for future expansion */
void (* _gimp_reserved1) (void);
void (* _gimp_reserved2) (void);
void (* _gimp_reserved3) (void);
void (* _gimp_reserved4) (void);
void (* _gimp_reserved5) (void);
void (* _gimp_reserved6) (void);
void (* _gimp_reserved7) (void);
void (* _gimp_reserved8) (void);
};
struct _GimpColorConfigClass
......
......@@ -350,6 +350,17 @@ cdisplay_lcms_changed (GimpColorDisplay *display)
flags |= cmsFLAGS_SOFTPROOFING;
if (config->simulation_gamut_check)
{
guchar r, g, b;
flags |= cmsFLAGS_GAMUTCHECK;
gimp_rgb_get_uchar (&config->out_of_gamut_color, &r, &g, &b);
cmsSetAlarmCodes (r, g, b);
}
lcms->transform = cmsCreateProofingTransform (src_profile, TYPE_RGB_8,
dest_profile, TYPE_RGB_8,
proof_profile,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment