2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2003-11-21 22:44:00 +08:00
|
|
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2003-11-21 22:44:00 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2003-11-21 22:44:00 +08:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2003-11-21 22:44:00 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2006-05-30 09:55:42 +08:00
|
|
|
#include <glib.h> /* lcms.h uses the "inline" keyword */
|
|
|
|
|
2003-11-21 22:44:00 +08:00
|
|
|
#include <lcms.h>
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2007-09-17 21:37:47 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2005-02-05 22:10:20 +08:00
|
|
|
#include "libgimpconfig/gimpconfig.h"
|
|
|
|
#include "libgimpmath/gimpmath.h"
|
2003-11-21 22:44:00 +08:00
|
|
|
#include "libgimpmodule/gimpmodule.h"
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
|
|
|
#include "libgimp/libgimp-intl.h"
|
|
|
|
|
2008-01-10 06:22:10 +08:00
|
|
|
#define CDISPLAY_TYPE_PROOF (cdisplay_proof_get_type ())
|
2003-11-21 22:44:00 +08:00
|
|
|
#define CDISPLAY_PROOF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CDISPLAY_TYPE_PROOF, CdisplayProof))
|
|
|
|
#define CDISPLAY_PROOF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CDISPLAY_TYPE_PROOF, CdisplayProofClass))
|
|
|
|
#define CDISPLAY_IS_PROOF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CDISPLAY_TYPE_PROOF))
|
|
|
|
#define CDISPLAY_IS_PROOF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CDISPLAY_TYPE_PROOF))
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _CdisplayProof CdisplayProof;
|
|
|
|
typedef struct _CdisplayProofClass CdisplayProofClass;
|
|
|
|
|
|
|
|
struct _CdisplayProof
|
|
|
|
{
|
|
|
|
GimpColorDisplay parent_instance;
|
|
|
|
|
|
|
|
gint intent;
|
|
|
|
gboolean bpc;
|
2004-07-05 19:26:30 +08:00
|
|
|
gchar *profile;
|
2003-11-21 22:44:00 +08:00
|
|
|
|
|
|
|
cmsHTRANSFORM transform;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _CdisplayProofClass
|
|
|
|
{
|
|
|
|
GimpColorDisplayClass parent_instance;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-07-05 19:26:30 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_INTENT,
|
|
|
|
PROP_BPC,
|
|
|
|
PROP_PROFILE
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-01-10 06:22:10 +08:00
|
|
|
GType cdisplay_proof_get_type (void);
|
2003-11-21 22:44:00 +08:00
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
static void cdisplay_proof_finalize (GObject *object);
|
|
|
|
static void cdisplay_proof_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void cdisplay_proof_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
2004-07-05 19:26:30 +08:00
|
|
|
|
2003-11-21 22:44:00 +08:00
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
static void cdisplay_proof_convert (GimpColorDisplay *display,
|
|
|
|
guchar *buf,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gint bpp,
|
|
|
|
gint bpl);
|
|
|
|
static GtkWidget * cdisplay_proof_configure (GimpColorDisplay *display);
|
|
|
|
static void cdisplay_proof_changed (GimpColorDisplay *display);
|
2003-11-21 22:44:00 +08:00
|
|
|
|
|
|
|
|
|
|
|
static const GimpModuleInfo cdisplay_proof_info =
|
|
|
|
{
|
|
|
|
GIMP_MODULE_ABI_VERSION,
|
|
|
|
N_("Color proof filter using ICC color profile"),
|
|
|
|
"Banlu Kemiyatorn <id@project-ile.net>",
|
|
|
|
"v0.1",
|
|
|
|
"(c) 2002-2003, released under the GPL",
|
|
|
|
"November 14, 2003"
|
|
|
|
};
|
|
|
|
|
2008-01-10 06:22:10 +08:00
|
|
|
G_DEFINE_DYNAMIC_TYPE (CdisplayProof, cdisplay_proof,
|
|
|
|
GIMP_TYPE_COLOR_DISPLAY)
|
2003-11-21 22:44:00 +08:00
|
|
|
|
|
|
|
G_MODULE_EXPORT const GimpModuleInfo *
|
|
|
|
gimp_module_query (GTypeModule *module)
|
|
|
|
{
|
|
|
|
return &cdisplay_proof_info;
|
|
|
|
}
|
|
|
|
|
|
|
|
G_MODULE_EXPORT gboolean
|
|
|
|
gimp_module_register (GTypeModule *module)
|
|
|
|
{
|
2008-01-10 06:22:10 +08:00
|
|
|
cdisplay_proof_register_type (module);
|
2003-11-21 22:44:00 +08:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
cdisplay_proof_class_init (CdisplayProofClass *klass)
|
|
|
|
{
|
2004-07-04 08:21:03 +08:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
GimpColorDisplayClass *display_class = GIMP_COLOR_DISPLAY_CLASS (klass);
|
2003-11-21 22:44:00 +08:00
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
object_class->finalize = cdisplay_proof_finalize;
|
|
|
|
object_class->get_property = cdisplay_proof_get_property;
|
|
|
|
object_class->set_property = cdisplay_proof_set_property;
|
2004-07-05 19:26:30 +08:00
|
|
|
|
2005-02-05 22:10:20 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_INTENT,
|
|
|
|
"intent", NULL,
|
2006-06-28 04:00:03 +08:00
|
|
|
GIMP_TYPE_COLOR_RENDERING_INTENT,
|
|
|
|
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
|
2006-01-31 00:58:42 +08:00
|
|
|
0);
|
2005-02-05 22:10:20 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_BPC,
|
|
|
|
"black-point-compensation", NULL,
|
|
|
|
FALSE,
|
2006-01-31 00:58:42 +08:00
|
|
|
0);
|
2005-02-05 22:10:20 +08:00
|
|
|
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PROFILE,
|
|
|
|
"profile", NULL,
|
|
|
|
GIMP_CONFIG_PATH_FILE, NULL,
|
2006-01-31 00:58:42 +08:00
|
|
|
0);
|
2003-11-21 22:44:00 +08:00
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
display_class->name = _("Color Proof");
|
|
|
|
display_class->help_id = "gimp-colordisplay-proof";
|
2006-10-02 01:31:42 +08:00
|
|
|
display_class->stock_id = GIMP_STOCK_DISPLAY_FILTER_PROOF;
|
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
display_class->convert = cdisplay_proof_convert;
|
|
|
|
display_class->configure = cdisplay_proof_configure;
|
|
|
|
display_class->changed = cdisplay_proof_changed;
|
2003-11-21 22:44:00 +08:00
|
|
|
|
|
|
|
cmsErrorAction (LCMS_ERROR_IGNORE);
|
|
|
|
}
|
|
|
|
|
2008-01-10 06:22:10 +08:00
|
|
|
static void
|
|
|
|
cdisplay_proof_class_finalize (CdisplayProofClass *klass)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2003-11-21 22:44:00 +08:00
|
|
|
static void
|
|
|
|
cdisplay_proof_init (CdisplayProof *proof)
|
|
|
|
{
|
|
|
|
proof->transform = NULL;
|
2004-07-05 19:26:30 +08:00
|
|
|
proof->profile = NULL;
|
2004-07-04 08:21:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
cdisplay_proof_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
CdisplayProof *proof = CDISPLAY_PROOF (object);
|
|
|
|
|
2004-07-05 19:26:30 +08:00
|
|
|
if (proof->profile)
|
2003-11-21 22:44:00 +08:00
|
|
|
{
|
2004-07-05 19:26:30 +08:00
|
|
|
g_free (proof->profile);
|
|
|
|
proof->profile = NULL;
|
2003-11-21 22:44:00 +08:00
|
|
|
}
|
2008-01-10 06:22:10 +08:00
|
|
|
|
2003-11-21 22:44:00 +08:00
|
|
|
if (proof->transform)
|
|
|
|
{
|
|
|
|
cmsDeleteTransform (proof->transform);
|
|
|
|
proof->transform = NULL;
|
|
|
|
}
|
|
|
|
|
2008-01-10 06:22:10 +08:00
|
|
|
G_OBJECT_CLASS (cdisplay_proof_parent_class)->finalize (object);
|
2003-11-21 22:44:00 +08:00
|
|
|
}
|
|
|
|
|
2004-07-05 19:26:30 +08:00
|
|
|
static void
|
|
|
|
cdisplay_proof_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
CdisplayProof *proof = CDISPLAY_PROOF (object);
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
|
|
|
case PROP_INTENT:
|
|
|
|
g_value_set_enum (value, proof->intent);
|
|
|
|
break;
|
|
|
|
case PROP_BPC:
|
|
|
|
g_value_set_boolean (value, proof->bpc);
|
|
|
|
break;
|
|
|
|
case PROP_PROFILE:
|
|
|
|
g_value_set_string (value, proof->profile);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
cdisplay_proof_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
CdisplayProof *proof = CDISPLAY_PROOF (object);
|
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
|
|
|
case PROP_INTENT:
|
|
|
|
proof->intent = g_value_get_enum (value);
|
|
|
|
break;
|
|
|
|
case PROP_BPC:
|
|
|
|
proof->bpc = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
case PROP_PROFILE:
|
|
|
|
g_free (proof->profile);
|
|
|
|
proof->profile = g_value_dup_string (value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_color_display_changed (GIMP_COLOR_DISPLAY (proof));
|
|
|
|
}
|
|
|
|
|
2003-11-21 22:44:00 +08:00
|
|
|
static void
|
|
|
|
cdisplay_proof_convert (GimpColorDisplay *display,
|
2006-11-25 00:15:50 +08:00
|
|
|
guchar *buf,
|
|
|
|
gint width,
|
2003-11-21 22:44:00 +08:00
|
|
|
gint height,
|
|
|
|
gint bpp,
|
|
|
|
gint bpl)
|
|
|
|
{
|
|
|
|
CdisplayProof *proof = CDISPLAY_PROOF (display);
|
|
|
|
gint y;
|
|
|
|
|
|
|
|
if (bpp != 3)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (! proof->transform)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (y = 0; y < height; y++, buf += bpl)
|
|
|
|
cmsDoTransform (proof->transform, buf, buf, width);
|
|
|
|
}
|
|
|
|
|
2007-09-17 21:37:47 +08:00
|
|
|
static void
|
|
|
|
cdisplay_proof_combo_box_set_active (GimpColorProfileComboBox *combo,
|
|
|
|
const gchar *filename)
|
|
|
|
{
|
|
|
|
cmsHPROFILE profile = NULL;
|
|
|
|
gchar *label = NULL;
|
|
|
|
|
|
|
|
if (filename)
|
|
|
|
profile = cmsOpenProfileFromFile (filename, "r");
|
|
|
|
|
|
|
|
if (profile)
|
|
|
|
{
|
|
|
|
label = gimp_any_to_utf8 (cmsTakeProductDesc (profile), -1, NULL);
|
|
|
|
if (! label)
|
|
|
|
label = gimp_any_to_utf8 (cmsTakeProductName (profile), -1, NULL);
|
|
|
|
|
|
|
|
cmsCloseProfile (profile);
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_color_profile_combo_box_set_active (combo, filename, label);
|
|
|
|
g_free (label);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
cdisplay_proof_file_chooser_dialog_response (GtkFileChooser *dialog,
|
|
|
|
gint response,
|
|
|
|
GimpColorProfileComboBox *combo)
|
|
|
|
{
|
|
|
|
if (response == GTK_RESPONSE_ACCEPT)
|
|
|
|
{
|
|
|
|
gchar *filename = gtk_file_chooser_get_filename (dialog);
|
|
|
|
|
|
|
|
if (filename)
|
|
|
|
{
|
|
|
|
cdisplay_proof_combo_box_set_active (combo, filename);
|
|
|
|
|
|
|
|
g_free (filename);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_widget_hide (GTK_WIDGET (dialog));
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget *
|
|
|
|
cdisplay_proof_file_chooser_dialog_new (void)
|
|
|
|
{
|
|
|
|
GtkWidget *dialog;
|
|
|
|
GtkFileFilter *filter;
|
|
|
|
|
|
|
|
dialog = gtk_file_chooser_dialog_new (_("Choose an ICC Color Profile"),
|
|
|
|
NULL,
|
|
|
|
GTK_FILE_CHOOSER_ACTION_OPEN,
|
|
|
|
|
|
|
|
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
|
|
|
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
|
|
|
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
|
|
|
|
GTK_RESPONSE_ACCEPT,
|
|
|
|
GTK_RESPONSE_CANCEL,
|
|
|
|
-1);
|
|
|
|
|
|
|
|
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
|
|
|
|
|
|
|
|
#ifndef G_OS_WIN32
|
|
|
|
{
|
|
|
|
const gchar folder[] = "/usr/share/color/icc";
|
|
|
|
|
|
|
|
if (g_file_test (folder, G_FILE_TEST_IS_DIR))
|
|
|
|
gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (dialog),
|
|
|
|
folder, NULL);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
filter = gtk_file_filter_new ();
|
|
|
|
gtk_file_filter_set_name (filter, _("All files (*.*)"));
|
|
|
|
gtk_file_filter_add_pattern (filter, "*");
|
|
|
|
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
|
|
|
|
|
|
|
|
filter = gtk_file_filter_new ();
|
|
|
|
gtk_file_filter_set_name (filter, _("ICC color profile (*.icc, *.icm)"));
|
|
|
|
gtk_file_filter_add_pattern (filter, "*.[Ii][Cc][Cc]");
|
|
|
|
gtk_file_filter_add_pattern (filter, "*.[Ii][Cc][Mm]");
|
|
|
|
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
|
|
|
|
|
|
|
|
gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter);
|
|
|
|
|
|
|
|
return dialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
cdisplay_proof_profile_changed (GtkWidget *combo,
|
|
|
|
CdisplayProof *proof)
|
|
|
|
{
|
|
|
|
gchar *profile;
|
|
|
|
|
|
|
|
profile = gimp_color_profile_combo_box_get_active (GIMP_COLOR_PROFILE_COMBO_BOX (combo));
|
|
|
|
|
|
|
|
g_object_set (proof,
|
|
|
|
"profile", profile,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_free (profile);
|
|
|
|
}
|
|
|
|
|
2003-11-21 22:44:00 +08:00
|
|
|
static GtkWidget *
|
|
|
|
cdisplay_proof_configure (GimpColorDisplay *display)
|
|
|
|
{
|
2003-11-22 00:41:13 +08:00
|
|
|
CdisplayProof *proof = CDISPLAY_PROOF (display);
|
2005-02-06 05:51:47 +08:00
|
|
|
GtkWidget *table;
|
2005-02-05 22:10:20 +08:00
|
|
|
GtkWidget *combo;
|
|
|
|
GtkWidget *toggle;
|
2007-09-17 21:37:47 +08:00
|
|
|
GtkWidget *dialog;
|
|
|
|
gchar *history;
|
2003-11-21 22:44:00 +08:00
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
table = gtk_table_new (3, 2, FALSE);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
|
2003-11-21 22:44:00 +08:00
|
|
|
|
2007-09-17 21:37:47 +08:00
|
|
|
dialog = cdisplay_proof_file_chooser_dialog_new ();
|
|
|
|
|
|
|
|
history = gimp_personal_rc_file ("profilerc");
|
|
|
|
combo = gimp_color_profile_combo_box_new (dialog, history);
|
|
|
|
g_free (history);
|
|
|
|
|
|
|
|
g_signal_connect (dialog, "response",
|
|
|
|
G_CALLBACK (cdisplay_proof_file_chooser_dialog_response),
|
|
|
|
combo);
|
|
|
|
|
|
|
|
g_signal_connect (combo, "changed",
|
|
|
|
G_CALLBACK (cdisplay_proof_profile_changed),
|
|
|
|
proof);
|
|
|
|
|
|
|
|
if (proof->profile)
|
|
|
|
cdisplay_proof_combo_box_set_active (GIMP_COLOR_PROFILE_COMBO_BOX (combo),
|
|
|
|
proof->profile);
|
2003-11-21 22:44:00 +08:00
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
2007-09-17 21:37:47 +08:00
|
|
|
_("_Profile:"), 0.0, 0.5,
|
2005-02-05 22:10:20 +08:00
|
|
|
combo, 1, FALSE);
|
2003-11-22 03:27:06 +08:00
|
|
|
|
2007-09-17 21:37:47 +08:00
|
|
|
combo = gimp_prop_enum_combo_box_new (G_OBJECT (proof), "intent", 0, 0);
|
|
|
|
|
2005-02-06 05:51:47 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
2007-09-17 21:37:47 +08:00
|
|
|
_("_Intent:"), 0.0, 0.5,
|
|
|
|
combo, 1, FALSE);
|
2003-11-21 22:44:00 +08:00
|
|
|
|
2005-02-05 22:10:20 +08:00
|
|
|
toggle = gimp_prop_check_button_new (G_OBJECT (proof),
|
|
|
|
"black-point-compensation",
|
|
|
|
_("_Black Point Compensation"));
|
2005-02-06 05:51:47 +08:00
|
|
|
gtk_table_attach_defaults (GTK_TABLE (table), toggle, 1, 2, 2, 3);
|
2005-02-05 22:10:20 +08:00
|
|
|
gtk_widget_show (toggle);
|
2003-11-21 22:44:00 +08:00
|
|
|
|
2005-02-06 06:04:40 +08:00
|
|
|
return table;
|
2003-11-21 22:44:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
cdisplay_proof_changed (GimpColorDisplay *display)
|
|
|
|
{
|
2003-11-22 00:41:13 +08:00
|
|
|
CdisplayProof *proof = CDISPLAY_PROOF (display);
|
|
|
|
cmsHPROFILE rgbProfile;
|
|
|
|
cmsHPROFILE proofProfile;
|
2003-11-21 22:44:00 +08:00
|
|
|
|
|
|
|
if (proof->transform)
|
|
|
|
{
|
|
|
|
cmsDeleteTransform (proof->transform);
|
|
|
|
proof->transform = NULL;
|
|
|
|
}
|
|
|
|
|
2004-07-05 19:26:30 +08:00
|
|
|
if (! proof->profile)
|
2003-11-22 00:41:13 +08:00
|
|
|
return;
|
|
|
|
|
2003-11-21 22:44:00 +08:00
|
|
|
rgbProfile = cmsCreate_sRGBProfile ();
|
|
|
|
|
2004-07-05 19:26:30 +08:00
|
|
|
proofProfile = cmsOpenProfileFromFile (proof->profile, "r");
|
2003-11-21 22:44:00 +08:00
|
|
|
|
|
|
|
if (proofProfile)
|
|
|
|
{
|
2007-10-04 22:21:55 +08:00
|
|
|
DWORD flags = cmsFLAGS_SOFTPROOFING;
|
|
|
|
|
|
|
|
if (proof->bpc)
|
|
|
|
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
|
|
|
|
|
2003-11-21 22:44:00 +08:00
|
|
|
proof->transform = cmsCreateProofingTransform (rgbProfile,
|
|
|
|
TYPE_RGB_8,
|
|
|
|
rgbProfile, TYPE_RGB_8,
|
|
|
|
proofProfile,
|
|
|
|
proof->intent,
|
|
|
|
proof->intent,
|
2007-10-04 22:21:55 +08:00
|
|
|
flags);
|
2003-11-21 22:44:00 +08:00
|
|
|
|
|
|
|
cmsCloseProfile (proofProfile);
|
|
|
|
}
|
|
|
|
|
|
|
|
cmsCloseProfile (rgbProfile);
|
|
|
|
}
|