Argh, this was meant to be squashed into the previous commit...
This commit is contained in:
@ -164,7 +164,6 @@ gimpconsoleldadd = \
|
|||||||
$(GEGL_LIBS) \
|
$(GEGL_LIBS) \
|
||||||
$(GLIB_LIBS) \
|
$(GLIB_LIBS) \
|
||||||
$(GEXIV2_LIBS) \
|
$(GEXIV2_LIBS) \
|
||||||
$(LCMS_LIBS) \
|
|
||||||
$(Z_LIBS) \
|
$(Z_LIBS) \
|
||||||
$(JSON_C_LIBS) \
|
$(JSON_C_LIBS) \
|
||||||
$(LIBMYPAINT_LIBS) \
|
$(LIBMYPAINT_LIBS) \
|
||||||
|
@ -110,7 +110,6 @@ test_config_LDADD = \
|
|||||||
$(libgimpmath) \
|
$(libgimpmath) \
|
||||||
$(libgimpconfig) \
|
$(libgimpconfig) \
|
||||||
$(libgimpbase) \
|
$(libgimpbase) \
|
||||||
$(LCMS_LIBS) \
|
|
||||||
$(PANGOCAIRO_LIBS) \
|
$(PANGOCAIRO_LIBS) \
|
||||||
$(HARFBUZZ_LIBS) \
|
$(HARFBUZZ_LIBS) \
|
||||||
$(GDK_PIXBUF_LIBS) \
|
$(GDK_PIXBUF_LIBS) \
|
||||||
|
@ -16,9 +16,8 @@ AM_CPPFLAGS = \
|
|||||||
$(CAIRO_CFLAGS) \
|
$(CAIRO_CFLAGS) \
|
||||||
$(GEGL_CFLAGS) \
|
$(GEGL_CFLAGS) \
|
||||||
$(GDK_PIXBUF_CFLAGS) \
|
$(GDK_PIXBUF_CFLAGS) \
|
||||||
$(LIBMYPAINT_CFLAGS) \
|
$(LIBMYPAINT_CFLAGS) \
|
||||||
$(GEXIV2_CFLAGS) \
|
$(GEXIV2_CFLAGS) \
|
||||||
$(LCMS_CFLAGS) \
|
|
||||||
-I$(includedir) \
|
-I$(includedir) \
|
||||||
$(xobjective_c)
|
$(xobjective_c)
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <lcms2.h>
|
|
||||||
|
|
||||||
#include <cairo.h>
|
#include <cairo.h>
|
||||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||||
@ -664,13 +663,12 @@ _gimp_image_update_color_profile (GimpImage *image,
|
|||||||
|
|
||||||
if (private->color_profile)
|
if (private->color_profile)
|
||||||
{
|
{
|
||||||
GimpColorProfile *srgb_profile;
|
GimpColorProfile *srgb_profile;
|
||||||
cmsUInt32Number flags;
|
GimpColorTransformFlags flags = 0;
|
||||||
|
|
||||||
srgb_profile = gimp_color_profile_new_rgb_srgb ();
|
srgb_profile = gimp_color_profile_new_rgb_srgb ();
|
||||||
|
|
||||||
flags = cmsFLAGS_NOOPTIMIZE;
|
flags |= GIMP_COLOR_TRANSFORM_FLAGS_BLACK_POINT_COMPENSATION;
|
||||||
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
|
|
||||||
|
|
||||||
private->transform_to_srgb_u8 =
|
private->transform_to_srgb_u8 =
|
||||||
gimp_color_transform_new (private->color_profile,
|
gimp_color_transform_new (private->color_profile,
|
||||||
@ -785,20 +783,22 @@ gimp_image_convert_profile_colormap (GimpImage *image,
|
|||||||
gboolean bpc,
|
gboolean bpc,
|
||||||
GimpProgress *progress)
|
GimpProgress *progress)
|
||||||
{
|
{
|
||||||
GimpColorTransform *transform;
|
GimpColorTransform *transform;
|
||||||
guchar *cmap;
|
GimpColorTransformFlags flags = 0;
|
||||||
gint n_colors;
|
guchar *cmap;
|
||||||
|
gint n_colors;
|
||||||
|
|
||||||
n_colors = gimp_image_get_colormap_size (image);
|
n_colors = gimp_image_get_colormap_size (image);
|
||||||
cmap = g_memdup (gimp_image_get_colormap (image), n_colors * 3);
|
cmap = g_memdup (gimp_image_get_colormap (image), n_colors * 3);
|
||||||
|
|
||||||
|
if (bpc)
|
||||||
|
flags |= GIMP_COLOR_TRANSFORM_FLAGS_BLACK_POINT_COMPENSATION;
|
||||||
|
|
||||||
transform = gimp_color_transform_new (src_profile,
|
transform = gimp_color_transform_new (src_profile,
|
||||||
babl_format ("R'G'B' u8"),
|
babl_format ("R'G'B' u8"),
|
||||||
dest_profile,
|
dest_profile,
|
||||||
babl_format ("R'G'B' u8"),
|
babl_format ("R'G'B' u8"),
|
||||||
intent,
|
intent, flags);
|
||||||
cmsFLAGS_NOOPTIMIZE |
|
|
||||||
(bpc ? cmsFLAGS_BLACKPOINTCOMPENSATION : 0));
|
|
||||||
|
|
||||||
if (transform)
|
if (transform)
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,6 @@ AM_CPPFLAGS = \
|
|||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_builddir)/app \
|
-I$(top_builddir)/app \
|
||||||
-I$(top_srcdir)/app \
|
-I$(top_srcdir)/app \
|
||||||
$(LCMS_CFLAGS) \
|
|
||||||
$(GEGL_CFLAGS) \
|
$(GEGL_CFLAGS) \
|
||||||
$(GTK_CFLAGS) \
|
$(GTK_CFLAGS) \
|
||||||
-I$(includedir)
|
-I$(includedir)
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <lcms2.h>
|
|
||||||
|
|
||||||
#include <gegl.h>
|
#include <gegl.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ AM_CPPFLAGS = \
|
|||||||
$(CAIRO_CFLAGS) \
|
$(CAIRO_CFLAGS) \
|
||||||
$(GEGL_CFLAGS) \
|
$(GEGL_CFLAGS) \
|
||||||
$(GDK_PIXBUF_CFLAGS) \
|
$(GDK_PIXBUF_CFLAGS) \
|
||||||
$(LCMS_CFLAGS) \
|
|
||||||
-I$(includedir)
|
-I$(includedir)
|
||||||
|
|
||||||
noinst_LIBRARIES = libappgegl.a
|
noinst_LIBRARIES = libappgegl.a
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <lcms2.h>
|
|
||||||
|
|
||||||
#include <cairo.h>
|
#include <cairo.h>
|
||||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||||
#include <gegl.h>
|
#include <gegl.h>
|
||||||
@ -710,10 +708,10 @@ gimp_gegl_convert_color_profile (GeglBuffer *src_buffer,
|
|||||||
gboolean bpc,
|
gboolean bpc,
|
||||||
GimpProgress *progress)
|
GimpProgress *progress)
|
||||||
{
|
{
|
||||||
GimpColorTransform *transform;
|
GimpColorTransform *transform;
|
||||||
const Babl *src_format;
|
GimpColorTransformFlags flags = 0;
|
||||||
const Babl *dest_format;
|
const Babl *src_format;
|
||||||
cmsUInt32Number flags;
|
const Babl *dest_format;
|
||||||
|
|
||||||
src_format = gegl_buffer_get_format (src_buffer);
|
src_format = gegl_buffer_get_format (src_buffer);
|
||||||
dest_format = gegl_buffer_get_format (dest_buffer);
|
dest_format = gegl_buffer_get_format (dest_buffer);
|
||||||
@ -725,10 +723,8 @@ gimp_gegl_convert_color_profile (GeglBuffer *src_buffer,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
flags = cmsFLAGS_NOOPTIMIZE;
|
|
||||||
|
|
||||||
if (bpc)
|
if (bpc)
|
||||||
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
|
flags |= GIMP_COLOR_TRANSFORM_FLAGS_BLACK_POINT_COMPENSATION;
|
||||||
|
|
||||||
transform = gimp_color_transform_new (src_profile, src_format,
|
transform = gimp_color_transform_new (src_profile, src_format,
|
||||||
dest_profile, dest_format,
|
dest_profile, dest_format,
|
||||||
|
@ -10,7 +10,6 @@ AM_CPPFLAGS = \
|
|||||||
$(CAIRO_CFLAGS) \
|
$(CAIRO_CFLAGS) \
|
||||||
$(GEGL_CFLAGS) \
|
$(GEGL_CFLAGS) \
|
||||||
$(GDK_PIXBUF_CFLAGS) \
|
$(GDK_PIXBUF_CFLAGS) \
|
||||||
$(LCMS_CFLAGS) \
|
|
||||||
-I$(includedir)
|
-I$(includedir)
|
||||||
|
|
||||||
noinst_LIBRARIES = \
|
noinst_LIBRARIES = \
|
||||||
|
@ -16,18 +16,13 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
|
||||||
* Ported from the threshold-alpha plug-in
|
|
||||||
* Copyright (C) 1997 Shuji Narazaki <narazaki@InetQ.or.jp>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <cairo.h>
|
#include <cairo.h>
|
||||||
#include <gio/gio.h>
|
|
||||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||||
#include <gegl.h>
|
#include <gegl.h>
|
||||||
#include <lcms2.h>
|
|
||||||
|
|
||||||
#include "libgimpconfig/gimpconfig.h"
|
#include "libgimpconfig/gimpconfig.h"
|
||||||
#include "libgimpcolor/gimpcolor.h"
|
#include "libgimpcolor/gimpcolor.h"
|
||||||
@ -250,10 +245,10 @@ gimp_operation_profile_transform_prepare (GeglOperation *operation)
|
|||||||
|
|
||||||
if (self->src_profile && self->dest_profile)
|
if (self->src_profile && self->dest_profile)
|
||||||
{
|
{
|
||||||
cmsUInt32Number flags = cmsFLAGS_NOOPTIMIZE;
|
GimpColorTransformFlags flags = 0;
|
||||||
|
|
||||||
if (self->bpc)
|
if (self->bpc)
|
||||||
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
|
flags |= GIMP_COLOR_TRANSFORM_FLAGS_BLACK_POINT_COMPENSATION;
|
||||||
|
|
||||||
self->transform = gimp_color_transform_new (self->src_profile, format,
|
self->transform = gimp_color_transform_new (self->src_profile, format,
|
||||||
self->dest_profile, format,
|
self->dest_profile, format,
|
||||||
|
@ -122,7 +122,6 @@ LDADD = \
|
|||||||
$(GEGL_LIBS) \
|
$(GEGL_LIBS) \
|
||||||
$(GIO_LIBS) \
|
$(GIO_LIBS) \
|
||||||
$(GEXIV2_LIBS) \
|
$(GEXIV2_LIBS) \
|
||||||
$(LCMS_LIBS) \
|
|
||||||
$(Z_LIBS) \
|
$(Z_LIBS) \
|
||||||
$(JSON_C_LIBS) \
|
$(JSON_C_LIBS) \
|
||||||
$(LIBMYPAINT_LIBS) \
|
$(LIBMYPAINT_LIBS) \
|
||||||
|
@ -8,7 +8,6 @@ AM_CPPFLAGS = \
|
|||||||
-I$(top_srcdir) \
|
-I$(top_srcdir) \
|
||||||
-I$(top_builddir)/app \
|
-I$(top_builddir)/app \
|
||||||
-I$(top_srcdir)/app \
|
-I$(top_srcdir)/app \
|
||||||
$(LCMS_CFLAGS) \
|
|
||||||
$(GEGL_CFLAGS) \
|
$(GEGL_CFLAGS) \
|
||||||
$(GTK_CFLAGS) \
|
$(GTK_CFLAGS) \
|
||||||
-I$(includedir)
|
-I$(includedir)
|
||||||
|
@ -23,8 +23,6 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <lcms2.h>
|
|
||||||
|
|
||||||
#include <gegl.h>
|
#include <gegl.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ gimp_color_transform_new (GimpColorProfile *src_profile,
|
|||||||
GimpColorProfile *dest_profile,
|
GimpColorProfile *dest_profile,
|
||||||
const Babl *dest_format,
|
const Babl *dest_format,
|
||||||
GimpColorRenderingIntent rendering_intent,
|
GimpColorRenderingIntent rendering_intent,
|
||||||
guint32 flags)
|
GimpColorTransformFlags flags)
|
||||||
{
|
{
|
||||||
GimpColorTransform *transform;
|
GimpColorTransform *transform;
|
||||||
GimpColorTransformPrivate *priv;
|
GimpColorTransformPrivate *priv;
|
||||||
@ -194,7 +194,7 @@ gimp_color_transform_new (GimpColorProfile *src_profile,
|
|||||||
priv->transform = cmsCreateTransform (src_lcms, lcms_src_format,
|
priv->transform = cmsCreateTransform (src_lcms, lcms_src_format,
|
||||||
dest_lcms, lcms_dest_format,
|
dest_lcms, lcms_dest_format,
|
||||||
rendering_intent,
|
rendering_intent,
|
||||||
flags);
|
flags | cmsFLAGS_NOOPTIMIZE);
|
||||||
|
|
||||||
return transform;
|
return transform;
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ gimp_color_transform_new_proofing (GimpColorProfile *src_profile,
|
|||||||
GimpColorProfile *proof_profile,
|
GimpColorProfile *proof_profile,
|
||||||
GimpColorRenderingIntent proof_intent,
|
GimpColorRenderingIntent proof_intent,
|
||||||
GimpColorRenderingIntent display_intent,
|
GimpColorRenderingIntent display_intent,
|
||||||
guint32 flags)
|
GimpColorTransformFlags flags)
|
||||||
{
|
{
|
||||||
GimpColorTransform *transform;
|
GimpColorTransform *transform;
|
||||||
GimpColorTransformPrivate *priv;
|
GimpColorTransformPrivate *priv;
|
||||||
|
@ -32,6 +32,13 @@ G_BEGIN_DECLS
|
|||||||
/* For information look into the C source or the html documentation */
|
/* For information look into the C source or the html documentation */
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
GIMP_COLOR_TRANSFORM_FLAGS_GAMUT_CHECK = 0x1000,
|
||||||
|
GIMP_COLOR_TRANSFORM_FLAGS_BLACK_POINT_COMPENSATION = 0x2000,
|
||||||
|
} GimpColorTransformFlags;
|
||||||
|
|
||||||
|
|
||||||
#define GIMP_TYPE_COLOR_TRANSFORM (gimp_color_transform_get_type ())
|
#define GIMP_TYPE_COLOR_TRANSFORM (gimp_color_transform_get_type ())
|
||||||
#define GIMP_COLOR_TRANSFORM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_COLOR_TRANSFORM, GimpColorTransform))
|
#define GIMP_COLOR_TRANSFORM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_COLOR_TRANSFORM, GimpColorTransform))
|
||||||
#define GIMP_COLOR_TRANSFORM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_COLOR_TRANSFORM, GimpColorTransformClass))
|
#define GIMP_COLOR_TRANSFORM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_COLOR_TRANSFORM, GimpColorTransformClass))
|
||||||
@ -74,7 +81,7 @@ GimpColorTransform *
|
|||||||
GimpColorProfile *dest_profile,
|
GimpColorProfile *dest_profile,
|
||||||
const Babl *dest_format,
|
const Babl *dest_format,
|
||||||
GimpColorRenderingIntent rendering_intent,
|
GimpColorRenderingIntent rendering_intent,
|
||||||
guint32 flags);
|
GimpColorTransformFlags flags);
|
||||||
|
|
||||||
GimpColorTransform *
|
GimpColorTransform *
|
||||||
gimp_color_transform_new_proofing (GimpColorProfile *src_profile,
|
gimp_color_transform_new_proofing (GimpColorProfile *src_profile,
|
||||||
@ -84,7 +91,7 @@ GimpColorTransform *
|
|||||||
GimpColorProfile *proof_profile,
|
GimpColorProfile *proof_profile,
|
||||||
GimpColorRenderingIntent proof_intent,
|
GimpColorRenderingIntent proof_intent,
|
||||||
GimpColorRenderingIntent display_intent,
|
GimpColorRenderingIntent display_intent,
|
||||||
guint32 flags);
|
GimpColorTransformFlags flags);
|
||||||
|
|
||||||
void gimp_color_transform_process_pixels (GimpColorTransform *transform,
|
void gimp_color_transform_process_pixels (GimpColorTransform *transform,
|
||||||
const Babl *src_format,
|
const Babl *src_format,
|
||||||
|
@ -21,8 +21,6 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <lcms2.h>
|
|
||||||
|
|
||||||
#include <gegl.h>
|
#include <gegl.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <lcms2.h>
|
|
||||||
|
|
||||||
#include <gegl.h>
|
#include <gegl.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
@ -513,18 +513,18 @@ gimp_widget_get_color_transform (GtkWidget *widget,
|
|||||||
|
|
||||||
if (proof_profile)
|
if (proof_profile)
|
||||||
{
|
{
|
||||||
cmsUInt32Number softproof_flags = cmsFLAGS_SOFTPROOFING;
|
GimpColorTransformFlags flags = 0;
|
||||||
|
|
||||||
if (config->simulation_use_black_point_compensation)
|
if (config->simulation_use_black_point_compensation)
|
||||||
{
|
{
|
||||||
softproof_flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
|
flags |= GIMP_COLOR_TRANSFORM_FLAGS_BLACK_POINT_COMPENSATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config->simulation_gamut_check)
|
if (config->simulation_gamut_check)
|
||||||
{
|
{
|
||||||
guchar r, g, b;
|
guchar r, g, b;
|
||||||
|
|
||||||
softproof_flags |= cmsFLAGS_GAMUTCHECK;
|
flags |= GIMP_COLOR_TRANSFORM_FLAGS_GAMUT_CHECK;
|
||||||
|
|
||||||
gimp_rgb_get_uchar (&config->out_of_gamut_color, &r, &g, &b);
|
gimp_rgb_get_uchar (&config->out_of_gamut_color, &r, &g, &b);
|
||||||
|
|
||||||
@ -540,23 +540,23 @@ gimp_widget_get_color_transform (GtkWidget *widget,
|
|||||||
proof_profile,
|
proof_profile,
|
||||||
config->simulation_intent,
|
config->simulation_intent,
|
||||||
config->display_intent,
|
config->display_intent,
|
||||||
softproof_flags);
|
flags);
|
||||||
|
|
||||||
g_object_unref (proof_profile);
|
g_object_unref (proof_profile);
|
||||||
}
|
}
|
||||||
else if (! gimp_color_profile_is_equal (src_profile, dest_profile))
|
else if (! gimp_color_profile_is_equal (src_profile, dest_profile))
|
||||||
{
|
{
|
||||||
guint32 display_flags = 0;
|
GimpColorTransformFlags flags = 0;
|
||||||
|
|
||||||
if (config->display_use_black_point_compensation)
|
if (config->display_use_black_point_compensation)
|
||||||
{
|
{
|
||||||
display_flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
|
flags |= GIMP_COLOR_TRANSFORM_FLAGS_BLACK_POINT_COMPENSATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
transform = gimp_color_transform_new (src_profile, src_format,
|
transform = gimp_color_transform_new (src_profile, src_format,
|
||||||
dest_profile, dest_format,
|
dest_profile, dest_format,
|
||||||
config->display_intent,
|
config->display_intent,
|
||||||
display_flags);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_object_unref (dest_profile);
|
g_object_unref (dest_profile);
|
||||||
|
@ -53,8 +53,7 @@ controller_libadd = $(modules_libadd)
|
|||||||
|
|
||||||
libcolor_selector_cmyk_la_SOURCES = color-selector-cmyk.c
|
libcolor_selector_cmyk_la_SOURCES = color-selector-cmyk.c
|
||||||
libcolor_selector_cmyk_la_LDFLAGS = -avoid-version -module $(no_undefined)
|
libcolor_selector_cmyk_la_LDFLAGS = -avoid-version -module $(no_undefined)
|
||||||
libcolor_selector_cmyk_la_CFLAGS = $(LCMS_CFLAGS)
|
libcolor_selector_cmyk_la_LIBADD = $(libgimpconfig) $(color_selector_libadd)
|
||||||
libcolor_selector_cmyk_la_LIBADD = $(libgimpconfig) $(color_selector_libadd) $(LCMS_LIBS)
|
|
||||||
|
|
||||||
libcolor_selector_water_la_SOURCES = color-selector-water.c
|
libcolor_selector_water_la_SOURCES = color-selector-water.c
|
||||||
libcolor_selector_water_la_LDFLAGS = -avoid-version -module $(no_undefined)
|
libcolor_selector_water_la_LDFLAGS = -avoid-version -module $(no_undefined)
|
||||||
@ -77,18 +76,12 @@ libdisplay_filter_high_contrast_la_LDFLAGS = -avoid-version -module $(no_undefin
|
|||||||
libdisplay_filter_high_contrast_la_LIBADD = $(display_filter_libadd)
|
libdisplay_filter_high_contrast_la_LIBADD = $(display_filter_libadd)
|
||||||
|
|
||||||
libdisplay_filter_lcms_la_SOURCES = display-filter-lcms.c
|
libdisplay_filter_lcms_la_SOURCES = display-filter-lcms.c
|
||||||
libdisplay_filter_lcms_la_CFLAGS = $(LCMS_CFLAGS)
|
|
||||||
libdisplay_filter_lcms_la_LDFLAGS = -avoid-version -module $(no_undefined)
|
libdisplay_filter_lcms_la_LDFLAGS = -avoid-version -module $(no_undefined)
|
||||||
libdisplay_filter_lcms_la_LIBADD = $(display_filter_libadd) $(LCMS_LIBS)
|
libdisplay_filter_lcms_la_LIBADD = $(display_filter_libadd)
|
||||||
|
|
||||||
if PLATFORM_WIN32
|
|
||||||
libdisplay_filter_lcms_la_LIBADD += -lgdi32
|
|
||||||
endif
|
|
||||||
|
|
||||||
libdisplay_filter_proof_la_SOURCES = display-filter-proof.c
|
libdisplay_filter_proof_la_SOURCES = display-filter-proof.c
|
||||||
libdisplay_filter_proof_la_CFLAGS = $(LCMS_CFLAGS)
|
|
||||||
libdisplay_filter_proof_la_LDFLAGS = -avoid-version -module $(no_undefined)
|
libdisplay_filter_proof_la_LDFLAGS = -avoid-version -module $(no_undefined)
|
||||||
libdisplay_filter_proof_la_LIBADD = $(display_filter_libadd) $(LCMS_LIBS)
|
libdisplay_filter_proof_la_LIBADD = $(display_filter_libadd)
|
||||||
|
|
||||||
libcontroller_linux_input_la_SOURCES = \
|
libcontroller_linux_input_la_SOURCES = \
|
||||||
gimpinputdevicestore-gudev.c \
|
gimpinputdevicestore-gudev.c \
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <lcms2.h>
|
|
||||||
|
|
||||||
#include <gegl.h>
|
#include <gegl.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
@ -44,17 +42,17 @@ typedef struct _ColorselCmykClass ColorselCmykClass;
|
|||||||
|
|
||||||
struct _ColorselCmyk
|
struct _ColorselCmyk
|
||||||
{
|
{
|
||||||
GimpColorSelector parent_instance;
|
GimpColorSelector parent_instance;
|
||||||
|
|
||||||
GimpColorConfig *config;
|
GimpColorConfig *config;
|
||||||
cmsHTRANSFORM rgb2cmyk;
|
GimpColorTransform *rgb2cmyk;
|
||||||
cmsHTRANSFORM cmyk2rgb;
|
GimpColorTransform *cmyk2rgb;
|
||||||
|
|
||||||
GimpCMYK cmyk;
|
GimpCMYK cmyk;
|
||||||
GtkAdjustment *adj[4];
|
GtkAdjustment *adj[4];
|
||||||
GtkWidget *name_label;
|
GtkWidget *name_label;
|
||||||
|
|
||||||
gboolean in_destruction;
|
gboolean in_destruction;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _ColorselCmykClass
|
struct _ColorselCmykClass
|
||||||
@ -228,7 +226,12 @@ colorsel_cmyk_set_color (GimpColorSelector *selector,
|
|||||||
rgb_values[1] = rgb->g;
|
rgb_values[1] = rgb->g;
|
||||||
rgb_values[2] = rgb->b;
|
rgb_values[2] = rgb->b;
|
||||||
|
|
||||||
cmsDoTransform (module->rgb2cmyk, rgb_values, cmyk_values, 1);
|
gimp_color_transform_process_pixels (module->rgb2cmyk,
|
||||||
|
babl_format ("R'G'B' double"),
|
||||||
|
rgb_values,
|
||||||
|
babl_format ("CMYK double"),
|
||||||
|
cmyk_values,
|
||||||
|
1);
|
||||||
|
|
||||||
module->cmyk.c = cmyk_values[0] / 100.0;
|
module->cmyk.c = cmyk_values[0] / 100.0;
|
||||||
module->cmyk.m = cmyk_values[1] / 100.0;
|
module->cmyk.m = cmyk_values[1] / 100.0;
|
||||||
@ -331,7 +334,12 @@ colorsel_cmyk_adj_update (GtkAdjustment *adj,
|
|||||||
cmyk_values[2] = module->cmyk.y * 100.0;
|
cmyk_values[2] = module->cmyk.y * 100.0;
|
||||||
cmyk_values[3] = module->cmyk.k * 100.0;
|
cmyk_values[3] = module->cmyk.k * 100.0;
|
||||||
|
|
||||||
cmsDoTransform (module->cmyk2rgb, cmyk_values, rgb_values, 1);
|
gimp_color_transform_process_pixels (module->rgb2cmyk,
|
||||||
|
babl_format ("CMYK double"),
|
||||||
|
cmyk_values,
|
||||||
|
babl_format ("R'G'B' double"),
|
||||||
|
rgb_values,
|
||||||
|
1);
|
||||||
|
|
||||||
selector->rgb.r = rgb_values[0];
|
selector->rgb.r = rgb_values[0];
|
||||||
selector->rgb.g = rgb_values[1];
|
selector->rgb.g = rgb_values[1];
|
||||||
@ -350,24 +358,22 @@ colorsel_cmyk_adj_update (GtkAdjustment *adj,
|
|||||||
static void
|
static void
|
||||||
colorsel_cmyk_config_changed (ColorselCmyk *module)
|
colorsel_cmyk_config_changed (ColorselCmyk *module)
|
||||||
{
|
{
|
||||||
GimpColorSelector *selector = GIMP_COLOR_SELECTOR (module);
|
GimpColorSelector *selector = GIMP_COLOR_SELECTOR (module);
|
||||||
GimpColorConfig *config = module->config;
|
GimpColorConfig *config = module->config;
|
||||||
cmsUInt32Number flags = 0;
|
GimpColorTransformFlags flags = 0;
|
||||||
GimpColorProfile *rgb_profile = NULL;
|
GimpColorProfile *rgb_profile = NULL;
|
||||||
GimpColorProfile *cmyk_profile = NULL;
|
GimpColorProfile *cmyk_profile = NULL;
|
||||||
cmsHPROFILE rgb_lcms;
|
gchar *text;
|
||||||
cmsHPROFILE cmyk_lcms;
|
|
||||||
gchar *text;
|
|
||||||
|
|
||||||
if (module->rgb2cmyk)
|
if (module->rgb2cmyk)
|
||||||
{
|
{
|
||||||
cmsDeleteTransform (module->rgb2cmyk);
|
g_object_unref (module->rgb2cmyk);
|
||||||
module->rgb2cmyk = NULL;
|
module->rgb2cmyk = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (module->cmyk2rgb)
|
if (module->cmyk2rgb)
|
||||||
{
|
{
|
||||||
cmsDeleteTransform (module->cmyk2rgb);
|
g_object_unref (module->cmyk2rgb);
|
||||||
module->cmyk2rgb = NULL;
|
module->cmyk2rgb = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,23 +398,24 @@ colorsel_cmyk_config_changed (ColorselCmyk *module)
|
|||||||
gimp_color_profile_get_summary (cmyk_profile),
|
gimp_color_profile_get_summary (cmyk_profile),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
rgb_lcms = gimp_color_profile_get_lcms_profile (rgb_profile);
|
|
||||||
cmyk_lcms = gimp_color_profile_get_lcms_profile (cmyk_profile);
|
|
||||||
|
|
||||||
if (config->display_intent ==
|
if (config->display_intent ==
|
||||||
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC)
|
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC)
|
||||||
{
|
{
|
||||||
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
|
flags |= GIMP_COLOR_TRANSFORM_FLAGS_BLACK_POINT_COMPENSATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
module->rgb2cmyk = cmsCreateTransform (rgb_lcms, TYPE_RGB_DBL,
|
module->rgb2cmyk = gimp_color_transform_new (rgb_profile,
|
||||||
cmyk_lcms, TYPE_CMYK_DBL,
|
babl_format ("R'G'B' double"),
|
||||||
config->display_intent,
|
cmyk_profile,
|
||||||
flags);
|
babl_format ("CMYK double"),
|
||||||
module->cmyk2rgb = cmsCreateTransform (cmyk_lcms, TYPE_CMYK_DBL,
|
config->display_intent,
|
||||||
rgb_lcms, TYPE_RGB_DBL,
|
flags);
|
||||||
config->display_intent,
|
module->cmyk2rgb = gimp_color_transform_new (cmyk_profile,
|
||||||
flags);
|
babl_format ("CMYK double"),
|
||||||
|
rgb_profile,
|
||||||
|
babl_format ("R'G'B' double"),
|
||||||
|
config->display_intent,
|
||||||
|
flags);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
||||||
|
@ -21,14 +21,6 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
|
||||||
#define STRICT
|
|
||||||
#include <windows.h>
|
|
||||||
#define LCMS_WIN_TYPES_ALREADY_DEFINED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <lcms2.h>
|
|
||||||
|
|
||||||
#include <gegl.h>
|
#include <gegl.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <lcms2.h>
|
|
||||||
|
|
||||||
#include <gegl.h>
|
#include <gegl.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
@ -43,13 +41,13 @@ typedef struct _CdisplayProofClass CdisplayProofClass;
|
|||||||
|
|
||||||
struct _CdisplayProof
|
struct _CdisplayProof
|
||||||
{
|
{
|
||||||
GimpColorDisplay parent_instance;
|
GimpColorDisplay parent_instance;
|
||||||
|
|
||||||
gint intent;
|
gint intent;
|
||||||
gboolean bpc;
|
gboolean bpc;
|
||||||
gchar *profile;
|
gchar *profile;
|
||||||
|
|
||||||
cmsHTRANSFORM transform;
|
GimpColorTransform *transform;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _CdisplayProofClass
|
struct _CdisplayProofClass
|
||||||
@ -182,7 +180,7 @@ cdisplay_proof_finalize (GObject *object)
|
|||||||
|
|
||||||
if (proof->transform)
|
if (proof->transform)
|
||||||
{
|
{
|
||||||
cmsDeleteTransform (proof->transform);
|
g_object_unref (proof->transform);
|
||||||
proof->transform = NULL;
|
proof->transform = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,22 +245,12 @@ cdisplay_proof_convert_buffer (GimpColorDisplay *display,
|
|||||||
GeglBuffer *buffer,
|
GeglBuffer *buffer,
|
||||||
GeglRectangle *area)
|
GeglRectangle *area)
|
||||||
{
|
{
|
||||||
CdisplayProof *proof = CDISPLAY_PROOF (display);
|
CdisplayProof *proof = CDISPLAY_PROOF (display);
|
||||||
GeglBufferIterator *iter;
|
|
||||||
|
|
||||||
if (! proof->transform)
|
if (proof->transform)
|
||||||
return;
|
gimp_color_transform_process_buffer (proof->transform,
|
||||||
|
buffer, area,
|
||||||
iter = gegl_buffer_iterator_new (buffer, area, 0,
|
buffer, area);
|
||||||
babl_format ("R'G'B'A float"),
|
|
||||||
GEGL_ACCESS_READWRITE, GEGL_ABYSS_NONE);
|
|
||||||
|
|
||||||
while (gegl_buffer_iterator_next (iter))
|
|
||||||
{
|
|
||||||
gfloat *data = iter->data[0];
|
|
||||||
|
|
||||||
cmsDoTransform (proof->transform, data, data, iter->length);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -351,7 +339,7 @@ cdisplay_proof_changed (GimpColorDisplay *display)
|
|||||||
|
|
||||||
if (proof->transform)
|
if (proof->transform)
|
||||||
{
|
{
|
||||||
cmsDeleteTransform (proof->transform);
|
g_object_unref (proof->transform);
|
||||||
proof->transform = NULL;
|
proof->transform = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,22 +354,20 @@ cdisplay_proof_changed (GimpColorDisplay *display)
|
|||||||
|
|
||||||
if (proof_profile)
|
if (proof_profile)
|
||||||
{
|
{
|
||||||
cmsHPROFILE rgb_lcms;
|
GimpColorTransformFlags flags = 0;
|
||||||
cmsHPROFILE proof_lcms;
|
|
||||||
cmsUInt32Number flags = cmsFLAGS_SOFTPROOFING;
|
|
||||||
|
|
||||||
rgb_lcms = gimp_color_profile_get_lcms_profile (rgb_profile);
|
|
||||||
proof_lcms = gimp_color_profile_get_lcms_profile (proof_profile);
|
|
||||||
|
|
||||||
if (proof->bpc)
|
if (proof->bpc)
|
||||||
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
|
flags |= GIMP_COLOR_TRANSFORM_FLAGS_BLACK_POINT_COMPENSATION;
|
||||||
|
|
||||||
proof->transform = cmsCreateProofingTransform (rgb_lcms, TYPE_RGBA_FLT,
|
proof->transform =
|
||||||
rgb_lcms, TYPE_RGBA_FLT,
|
gimp_color_transform_new_proofing (rgb_profile,
|
||||||
proof_lcms,
|
babl_format ("R'G'B'A float"),
|
||||||
proof->intent,
|
rgb_profile,
|
||||||
proof->intent,
|
babl_format ("R'G'B'A float"),
|
||||||
flags);
|
proof_profile,
|
||||||
|
proof->intent,
|
||||||
|
proof->intent,
|
||||||
|
flags);
|
||||||
|
|
||||||
g_object_unref (proof_profile);
|
g_object_unref (proof_profile);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user