Commit cc928879 authored by Michael Natterer's avatar Michael Natterer

libgimpcolor: add new object GimpColorTransform

which encapsulates a cmsHTRANSFORM and does all the pixel format
conversion magic. It has API to create transforms and proofing
transforms, and to convert pixels arrays and GeglBuffers.

Before, each place which has a transform had to keep around the
transform and its input and output Babl formats, and had to implement
lots of stuff itself. Now all that lives in GimpColorTransform,
removing lots of logic from many places, and pretty much removing lcms
from the public API entirely.

This removes including <lcms2.h>, LCMS_LIBS and LCMS_CFLAGS from
almost all directories and potentially allows to replace lcms by
something else.
parent 97d16bd1
......@@ -192,9 +192,7 @@ gimp_drawable_get_sub_pixbuf (GimpDrawable *drawable,
gdouble scale;
gint scaled_x;
gint scaled_y;
GimpColorTransform transform;
const Babl *src_format;
const Babl *dest_format;
GimpColorTransform *transform;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (src_x >= 0, NULL);
......@@ -225,9 +223,7 @@ gimp_drawable_get_sub_pixbuf (GimpDrawable *drawable,
scaled_x = RINT ((gdouble) src_x * scale);
scaled_y = RINT ((gdouble) src_y * scale);
transform = gimp_image_get_color_transform_to_srgb_u8 (image,
&src_format,
&dest_format);
transform = gimp_image_get_color_transform_to_srgb_u8 (image);
if (transform)
{
......@@ -235,7 +231,8 @@ gimp_drawable_get_sub_pixbuf (GimpDrawable *drawable,
GeglBuffer *src_buf;
GeglBuffer *dest_buf;
temp_buf = gimp_temp_buf_new (dest_width, dest_height, src_format);
temp_buf = gimp_temp_buf_new (dest_width, dest_height,
gimp_drawable_get_format (drawable));
gegl_buffer_get (buffer,
GEGL_RECTANGLE (scaled_x, scaled_y,
......@@ -250,15 +247,12 @@ gimp_drawable_get_sub_pixbuf (GimpDrawable *drawable,
gimp_temp_buf_unref (temp_buf);
gimp_gegl_convert_color_transform (src_buf,
GEGL_RECTANGLE (0, 0,
dest_width, dest_height),
src_format,
dest_buf,
GEGL_RECTANGLE (0, 0, 0, 0),
dest_format,
transform,
NULL);
gimp_color_transform_process_buffer (transform,
src_buf,
GEGL_RECTANGLE (0, 0,
dest_width, dest_height),
dest_buf,
GEGL_RECTANGLE (0, 0, 0, 0));
g_object_unref (src_buf);
g_object_unref (dest_buf);
......
This diff is collapsed.
......@@ -80,23 +80,15 @@ void gimp_image_import_color_profile (GimpImage *ima
GimpProgress *progress,
gboolean interactive);
GimpColorTransform gimp_image_get_color_transform_to_srgb_u8
(GimpImage *image,
const Babl **pixel_format,
const Babl **srgb_u8_format);
GimpColorTransform gimp_image_get_color_transform_from_srgb_u8
(GimpImage *image,
const Babl **pixel_format,
const Babl **srgb_u8_format);
GimpColorTransform * gimp_image_get_color_transform_to_srgb_u8
(GimpImage *image);
GimpColorTransform * gimp_image_get_color_transform_from_srgb_u8
(GimpImage *image);
GimpColorTransform gimp_image_get_color_transform_to_srgb_double
(GimpImage *image,
const Babl **pixel_format,
const Babl **srgb_double_format);
GimpColorTransform gimp_image_get_color_transform_from_srgb_double
(GimpImage *image,
const Babl **pixel_format,
const Babl **srgb_double_format);
GimpColorTransform * gimp_image_get_color_transform_to_srgb_double
(GimpImage *image);
GimpColorTransform * gimp_image_get_color_transform_from_srgb_double
(GimpImage *image);
void gimp_image_color_profile_pixel_to_srgb
(GimpImage *image,
......
......@@ -145,9 +145,7 @@ gimp_image_get_new_pixbuf (GimpViewable *viewable,
GdkPixbuf *pixbuf;
gdouble scale_x;
gdouble scale_y;
GimpColorTransform transform;
const Babl *src_format;
const Babl *dest_format;
GimpColorTransform *transform;
scale_x = (gdouble) width / (gdouble) gimp_image_get_width (image);
scale_y = (gdouble) height / (gdouble) gimp_image_get_height (image);
......@@ -155,9 +153,7 @@ gimp_image_get_new_pixbuf (GimpViewable *viewable,
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
width, height);
transform = gimp_image_get_color_transform_to_srgb_u8 (image,
&src_format,
&dest_format);
transform = gimp_image_get_color_transform_to_srgb_u8 (image);
if (transform)
{
......@@ -165,7 +161,8 @@ gimp_image_get_new_pixbuf (GimpViewable *viewable,
GeglBuffer *src_buf;
GeglBuffer *dest_buf;
temp_buf = gimp_temp_buf_new (width, height, src_format);
temp_buf = gimp_temp_buf_new (width, height,
gimp_pickable_get_format (GIMP_PICKABLE (image)));
gegl_buffer_get (gimp_pickable_get_buffer (GIMP_PICKABLE (image)),
GEGL_RECTANGLE (0, 0, width, height),
......@@ -179,15 +176,12 @@ gimp_image_get_new_pixbuf (GimpViewable *viewable,
gimp_temp_buf_unref (temp_buf);
gimp_gegl_convert_color_transform (src_buf,
GEGL_RECTANGLE (0, 0,
width, height),
src_format,
dest_buf,
GEGL_RECTANGLE (0, 0, 0, 0),
dest_format,
transform,
NULL);
gimp_color_transform_process_buffer (transform,
src_buf,
GEGL_RECTANGLE (0, 0,
width, height),
dest_buf,
GEGL_RECTANGLE (0, 0, 0, 0));
g_object_unref (src_buf);
g_object_unref (dest_buf);
......
......@@ -60,15 +60,10 @@ struct _GimpImagePrivate
GimpColorProfile *color_profile; /* image's color profile */
/* Cached color transforms: from layer to sRGB u8 and double, and back */
GimpColorTransform transform_to_srgb_u8;
GimpColorTransform transform_from_srgb_u8;
GimpColorTransform transform_to_srgb_double;
GimpColorTransform transform_from_srgb_double;
/* Babl formats for above transforms: layer, sRGB u8, sRGB double */
const Babl *transform_layer_format;
const Babl *transform_srgb_u8_format;
const Babl *transform_srgb_double_format;
GimpColorTransform *transform_to_srgb_u8;
GimpColorTransform *transform_from_srgb_u8;
GimpColorTransform *transform_to_srgb_double;
GimpColorTransform *transform_from_srgb_double;
GimpMetadata *metadata; /* image's metadata */
......
......@@ -129,17 +129,14 @@ gimp_display_shell_profile_update (GimpDisplayShell *shell)
gimp_widget_get_color_transform (gtk_widget_get_toplevel (GTK_WIDGET (shell)),
gimp_display_shell_get_color_config (shell),
src_profile,
&src_format,
&dest_format);
src_format,
dest_format);
if (shell->profile_transform)
{
gint w = GIMP_DISPLAY_RENDER_BUF_WIDTH * GIMP_DISPLAY_RENDER_MAX_SCALE;
gint h = GIMP_DISPLAY_RENDER_BUF_HEIGHT * GIMP_DISPLAY_RENDER_MAX_SCALE;
shell->profile_src_format = src_format;
shell->profile_dest_format = dest_format;
shell->profile_data =
gegl_malloc (w * h * babl_format_get_bytes_per_pixel (src_format));
......@@ -192,34 +189,10 @@ gimp_display_shell_profile_convert_buffer (GimpDisplayShell *shell,
GeglBuffer *dest_buffer,
GeglRectangle *dest_area)
{
GeglBufferIterator *iter;
const Babl *fish;
if (! shell->profile_transform)
return;
iter = gegl_buffer_iterator_new (src_buffer, src_area, 0,
shell->profile_src_format,
GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
gegl_buffer_iterator_add (iter, dest_buffer, dest_area, 0,
shell->profile_dest_format,
GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE);
fish = babl_fish (shell->profile_src_format,
shell->profile_dest_format);
while (gegl_buffer_iterator_next (iter))
{
gpointer src_data = iter->data[0];
gpointer dest_data = iter->data[1];
babl_process (fish, src_data, dest_data, iter->length);
cmsDoTransform (shell->profile_transform,
src_data, dest_data,
iter->length);
}
if (shell->profile_transform)
gimp_color_transform_process_buffer (shell->profile_transform,
src_buffer, src_area,
dest_buffer, dest_area);
}
......@@ -230,10 +203,8 @@ gimp_display_shell_profile_free (GimpDisplayShell *shell)
{
if (shell->profile_transform)
{
cmsDeleteTransform (shell->profile_transform);
shell->profile_transform = NULL;
shell->profile_src_format = NULL;
shell->profile_dest_format = NULL;
g_object_unref (shell->profile_transform);
shell->profile_transform = NULL;
}
if (shell->profile_buffer)
......
......@@ -33,9 +33,7 @@
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimppickable.h"
#ifdef USE_NODE_BLIT
#include "core/gimpprojectable.h"
#endif
#include "gimpdisplay.h"
#include "gimpdisplayshell.h"
......@@ -204,7 +202,7 @@ gimp_display_shell_render (GimpDisplayShell *shell,
GEGL_RECTANGLE (scaled_x, scaled_y,
scaled_width, scaled_height),
buffer_scale,
shell->profile_src_format,
gimp_projectable_get_format (GIMP_PROJECTABLE (image)),
shell->profile_data, shell->profile_stride,
GEGL_ABYSS_CLAMP);
#else
......@@ -212,7 +210,7 @@ gimp_display_shell_render (GimpDisplayShell *shell,
buffer_scale,
GEGL_RECTANGLE (scaled_x, scaled_y,
scaled_width, scaled_height),
shell->profile_src_format,
gimp_projectable_get_format (GIMP_PROJECTABLE (image)),
shell->profile_data, shell->profile_stride,
GEGL_BLIT_CACHE);
#endif
......
......@@ -153,13 +153,10 @@ struct _GimpDisplayShell
GimpColorConfig *color_config; /* color management settings */
gboolean color_config_set; /* settings changed from defaults */
GimpColorTransform profile_transform;
const Babl *profile_src_format;
const Babl *profile_dest_format;
GeglBuffer *profile_buffer; /* buffer for profile transform */
guchar *profile_data; /* profile_buffer's pixels */
gint profile_stride; /* profile_buffer's stride */
GimpColorTransform *profile_transform;
GeglBuffer *profile_buffer; /* buffer for profile transform */
guchar *profile_data; /* profile_buffer's pixels */
gint profile_stride; /* profile_buffer's stride */
GimpColorDisplayStack *filter_stack; /* color display conversion stuff */
guint filter_idle_id;
......
......@@ -710,14 +710,10 @@ gimp_gegl_convert_color_profile (GeglBuffer *src_buffer,
gboolean bpc,
GimpProgress *progress)
{
const Babl *src_format;
const Babl *dest_format;
cmsHPROFILE src_lcms;
cmsHPROFILE dest_lcms;
cmsUInt32Number lcms_src_format;
cmsUInt32Number lcms_dest_format;
cmsUInt32Number flags;
cmsHTRANSFORM transform;
GimpColorTransform *transform;
const Babl *src_format;
const Babl *dest_format;
cmsUInt32Number flags;
src_format = gegl_buffer_get_format (src_buffer);
dest_format = gegl_buffer_get_format (dest_buffer);
......@@ -729,28 +725,27 @@ gimp_gegl_convert_color_profile (GeglBuffer *src_buffer,
return;
}
src_lcms = gimp_color_profile_get_lcms_profile (src_profile);
dest_lcms = gimp_color_profile_get_lcms_profile (dest_profile);
src_format = gimp_color_profile_get_format (src_format, &lcms_src_format);
dest_format = gimp_color_profile_get_format (dest_format, &lcms_dest_format);
flags = cmsFLAGS_NOOPTIMIZE;
if (bpc)
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
transform = cmsCreateTransform (src_lcms, lcms_src_format,
dest_lcms, lcms_dest_format,
intent, flags);
transform = gimp_color_transform_new (src_profile, src_format,
dest_profile, dest_format,
intent, flags);
if (transform)
{
gimp_gegl_convert_color_transform (src_buffer, src_rect, src_format,
dest_buffer, dest_rect, dest_format,
transform, progress);
if (progress)
g_signal_connect_swapped (transform, "progress",
G_CALLBACK (gimp_progress_set_value),
progress);
gimp_color_transform_process_buffer (transform,
src_buffer, src_rect,
dest_buffer, dest_rect);
cmsDeleteTransform (transform);
g_object_unref (transform);
}
else
{
......@@ -762,67 +757,3 @@ gimp_gegl_convert_color_profile (GeglBuffer *src_buffer,
gimp_progress_set_value (progress, 1.0);
}
}
void
gimp_gegl_convert_color_transform (GeglBuffer *src_buffer,
const GeglRectangle *src_rect,
const Babl *src_format,
GeglBuffer *dest_buffer,
const GeglRectangle *dest_rect,
const Babl *dest_format,
GimpColorTransform transform,
GimpProgress *progress)
{
GeglBufferIterator *iter;
gboolean has_alpha;
gint total_pixels;
gint done_pixels = 0;
if (src_rect)
{
total_pixels = src_rect->width * src_rect->height;
}
else
{
total_pixels = (gegl_buffer_get_width (src_buffer) *
gegl_buffer_get_height (src_buffer));
}
has_alpha = babl_format_has_alpha (dest_format);
/* make sure the alpha channel is copied too, lcms doesn't copy it */
if (has_alpha)
gegl_buffer_copy (src_buffer, src_rect, GEGL_ABYSS_NONE,
dest_buffer, dest_rect);
iter = gegl_buffer_iterator_new (src_buffer, src_rect, 0,
src_format,
GEGL_ACCESS_READ,
GEGL_ABYSS_NONE);
gegl_buffer_iterator_add (iter, dest_buffer, dest_rect, 0,
dest_format,
/* use READWRITE for alpha surfaces
* because we must use the alpha channel
* that is already copied, see above
*/
has_alpha ?
GEGL_ACCESS_READWRITE: GEGL_ACCESS_WRITE,
GEGL_ABYSS_NONE);
while (gegl_buffer_iterator_next (iter))
{
cmsDoTransform (transform,
iter->data[0], iter->data[1], iter->length);
done_pixels += iter->roi[0].width * iter->roi[0].height;
if (progress)
gimp_progress_set_value (progress,
(gdouble) done_pixels /
(gdouble) total_pixels);
}
if (progress)
gimp_progress_set_value (progress, 1.0);
}
......@@ -98,15 +98,5 @@ void gimp_gegl_convert_color_profile (GeglBuffer *src_buffer,
gboolean bpc,
GimpProgress *progress);
void gimp_gegl_convert_color_transform
(GeglBuffer *src_buffer,
const GeglRectangle *src_rect,
const Babl *src_format,
GeglBuffer *dest_buffer,
const GeglRectangle *dest_rect,
const Babl *dest_format,
GimpColorTransform transform,
GimpProgress *progress);
#endif /* __GIMP_GEGL_LOOPS_H__ */
......@@ -153,7 +153,7 @@ gimp_operation_profile_transform_finalize (GObject *object)
if (self->transform)
{
cmsDeleteTransform (self->transform);
g_object_unref (self->transform);
self->transform = NULL;
}
......@@ -241,7 +241,7 @@ gimp_operation_profile_transform_prepare (GeglOperation *operation)
if (self->transform)
{
cmsDeleteTransform (self->transform);
g_object_unref (self->transform);
self->transform = NULL;
}
......@@ -250,28 +250,14 @@ gimp_operation_profile_transform_prepare (GeglOperation *operation)
if (self->src_profile && self->dest_profile)
{
cmsHPROFILE src_lcms;
cmsHPROFILE dest_lcms;
cmsUInt32Number lcms_src_format;
cmsUInt32Number lcms_dest_format;
cmsUInt32Number flags;
src_lcms = gimp_color_profile_get_lcms_profile (self->src_profile);
dest_lcms = gimp_color_profile_get_lcms_profile (self->dest_profile);
self->src_format = gimp_color_profile_get_format (format,
&lcms_src_format);
self->dest_format = gimp_color_profile_get_format (format,
&lcms_dest_format);
flags = cmsFLAGS_NOOPTIMIZE;
cmsUInt32Number flags = cmsFLAGS_NOOPTIMIZE;
if (self->bpc)
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
self->transform = cmsCreateTransform (src_lcms, lcms_src_format,
dest_lcms, lcms_dest_format,
self->intent, flags);
self->transform = gimp_color_transform_new (self->src_profile, format,
self->dest_profile, format,
self->intent, flags);
}
gegl_operation_set_format (operation, "input", self->src_format);
......@@ -298,7 +284,12 @@ gimp_operation_profile_transform_process (GeglOperation *operation,
self->dest_format),
src, dest, samples);
cmsDoTransform (self->transform, src, dest, samples);
gimp_color_transform_process_pixels (self->transform,
self->src_format,
src,
self->dest_format,
dest,
samples);
}
else
{
......
......@@ -50,7 +50,7 @@ struct _GimpOperationProfileTransform
GimpColorRenderingIntent intent;
gboolean bpc;
GimpColorTransform transform;
GimpColorTransform *transform;
};
struct _GimpOperationProfileTransformClass
......
......@@ -69,9 +69,7 @@ struct _GimpViewRendererPrivate
gchar *bg_icon_name;
GimpColorConfig *color_config;
GimpColorTransform profile_transform;
const Babl *profile_src_format;
const Babl *profile_dest_format;
GimpColorTransform *profile_transform;
gboolean needs_render;
guint idle_id;
......@@ -1119,16 +1117,13 @@ gimp_view_render_temp_buf_to_surface (GimpViewRenderer *renderer,
if (renderer->priv->profile_transform)
{
gimp_gegl_convert_color_transform (src_buffer,
GEGL_RECTANGLE (x - temp_buf_x,
y - temp_buf_y,
width, height),
renderer->priv->profile_src_format,
dest_buffer,
GEGL_RECTANGLE (0, 0, 0, 0),
renderer->priv->profile_dest_format,
renderer->priv->profile_transform,
NULL);
gimp_color_transform_process_buffer (renderer->priv->profile_transform,
src_buffer,
GEGL_RECTANGLE (x - temp_buf_x,
y - temp_buf_y,
width, height),
dest_buffer,
GEGL_RECTANGLE (0, 0, 0, 0));
}
else
{
......@@ -1169,16 +1164,13 @@ gimp_view_render_temp_buf_to_surface (GimpViewRenderer *renderer,
if (renderer->priv->profile_transform)
{
gimp_gegl_convert_color_transform (src_buffer,
GEGL_RECTANGLE (x - temp_buf_x,
y - temp_buf_y,
width, height),
renderer->priv->profile_src_format,
dest_buffer,
GEGL_RECTANGLE (x, y, 0, 0),
renderer->priv->profile_dest_format,
renderer->priv->profile_transform,
NULL);
gimp_color_transform_process_buffer (renderer->priv->profile_transform,
src_buffer,
GEGL_RECTANGLE (x - temp_buf_x,
y - temp_buf_y,
width, height),
dest_buffer,
GEGL_RECTANGLE (x, y, 0, 0));
}
else
{
......@@ -1313,15 +1305,11 @@ gimp_view_renderer_transform_create (GimpViewRenderer *renderer,
if (! config)
config = renderer->context->gimp->config->color_management;
renderer->priv->profile_src_format = gegl_buffer_get_format (src_buffer);
renderer->priv->profile_dest_format = gegl_buffer_get_format (dest_buffer);
renderer->priv->profile_transform =
gimp_widget_get_color_transform (widget, config,
profile,
&renderer->priv->profile_src_format,
&renderer->priv->profile_dest_format);
gegl_buffer_get_format (src_buffer),
gegl_buffer_get_format (dest_buffer));
}
}
}
......@@ -1331,9 +1319,7 @@ gimp_view_renderer_transform_free (GimpViewRenderer *renderer)
{
if (renderer->priv->profile_transform)
{
cmsDeleteTransform (renderer->priv->profile_transform);
renderer->priv->profile_transform = NULL;
renderer->priv->profile_src_format = NULL;
renderer->priv->profile_dest_format = NULL;
g_object_unref (renderer->priv->profile_transform);
renderer->priv->profile_transform = NULL;
}
}
......@@ -78,6 +78,8 @@ libgimpcolor_@GIMP_API_VERSION@_la_SOURCES = \
gimpcolorprofile.h \
gimpcolorspace.c \
gimpcolorspace.h \
gimpcolortransform.c \
gimpcolortransform.h \
gimphsl.c \
gimphsl.h \
gimphsv.c \
......@@ -98,6 +100,7 @@ libgimpcolorinclude_HEADERS = \
gimpcolormanaged.h \
gimpcolorprofile.h \
gimpcolorspace.h \
gimpcolortransform.h \
gimphsl.h \
gimphsv.h \
gimppixbuf.h \
......
......@@ -52,6 +52,11 @@ EXPORTS
gimp_color_profile_new_rgb_srgb_linear
gimp_color_profile_new_srgb_trc_from_color_profile
gimp_color_profile_save_to_file
gimp_color_transform_get_type
gimp_color_transform_new
gimp_color_transform_new_proofing
gimp_color_transform_process_buffer
gimp_color_transform_process_pixels
gimp_hsl_get_type
gimp_hsl_set
gimp_hsl_set_alpha
......
......@@ -29,6 +29,7 @@
#include <libgimpcolor/gimpcolormanaged.h>
#include <libgimpcolor/gimpcolorprofile.h>
#include <libgimpcolor/gimpcolorspace.h>
#include <libgimpcolor/gimpcolortransform.h>
#include <libgimpcolor/gimpcmyk.h>
#include <libgimpcolor/gimphsl.h>
#include <libgimpcolor/gimphsv.h>
......
This diff is collapsed.
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
*
* gimpcolortransform.h
* Copyright (C) 2014 Michael Natterer <mitch@gimp.org>
* Elle Stone <ellestone@ninedegreesbelow.com>
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#if !defined (__GIMP_COLOR_H_INSIDE__) && !defined (GIMP_COLOR_COMPILATION)
#error "Only <libgimpcolor/gimpcolor.h> can be included directly."
#endif
#ifndef __GIMP_COLOR_TRANSFORM_H__
#define __GIMP_COLOR_TRANSFORM_H__
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#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_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_COLOR_TRANSFORM, GimpColorTransformClass))
#define GIMP_IS_COLOR_TRANSFORM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_COLOR_TRANSFORM))
#define GIMP_IS_COLOR_TRANSFORM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_COLOR_TRANSFORM))
#define GIMP_COLOR_TRANSFORM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_COLOR_TRANSFORM, GimpColorTransformClass))
typedef struct _GimpColorTransformClass GimpColorTransformClass;
typedef struct _GimpColorTransformPrivate GimpColorTransformPrivate;
struct _GimpColorTransform
{
GObject parent_instance;
GimpColorTransformPrivate *priv;
};
struct _GimpColorTransformClass
{
GObjectClass parent_class;
/* signals */
void (* progress) (GimpColorTransform *transform,
gdouble fraction);
/* Padding for future expansion */
void (* _gimp_reserved1) (void);
void (* _gimp_reserved2) (void);
void (* _gimp_reserved3) (void);
void (* _gimp_reserved4) (void);
};
GType gimp_color_transform_get_type (void) G_GNUC_CONST;
GimpColorTransform *
gimp_color_transform_new (GimpColorProfile *src_profile,
const Babl *src_format,
GimpColorProfile *dest_profile,
const Babl *dest_format,
GimpColorRenderingIntent rendering_intent,
guint32 flags);
GimpColorTransform *
gimp_color_transform_new_proofing (GimpColorProfile *src_profile,
const Babl *src_format,
GimpColorProfile *dest_profile,
const Babl *dest_format,
GimpColorProfile *proof_profile,
GimpColorRenderingIntent proof_intent,
GimpColorRenderingIntent display_intent,
guint32 flags);
void gimp_color_transform_process_pixels (GimpColorTransform *transform,
const Babl *src_format,
gconstpointer src,
const Babl *dest_format,
gpointer dest,
gsize length);
void gimp_color_transform_process_buffer (GimpColorTransform *transform,
GeglBuffer *src_buffer,
const GeglRectangle *src_rect,
GeglBuffer *dest_buffer,
const GeglRectangle *dest_rect);