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);
......
......@@ -497,110 +497,62 @@ gimp_image_import_color_profile (GimpImage *image,
}
}
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_to_srgb_u8 (GimpImage *image)
{
GimpImagePrivate *private;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (pixel_format != NULL, NULL);
g_return_val_if_fail (srgb_u8_format != NULL, NULL);
private = GIMP_IMAGE_GET_PRIVATE (image);
if (private->is_color_managed)
{
*pixel_format = private->transform_layer_format;
*srgb_u8_format = private->transform_srgb_u8_format;
return private->transform_to_srgb_u8;
}
*pixel_format = NULL;
*srgb_u8_format = NULL;
return private->transform_to_srgb_u8;
return NULL;
}
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_from_srgb_u8 (GimpImage *image)
{
GimpImagePrivate *private;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (pixel_format != NULL, NULL);
g_return_val_if_fail (srgb_u8_format != NULL, NULL);
private = GIMP_IMAGE_GET_PRIVATE (image);
if (private->is_color_managed)
{
*pixel_format = private->transform_layer_format;
*srgb_u8_format = private->transform_srgb_u8_format;
return private->transform_from_srgb_u8;
}
*pixel_format = NULL;
*srgb_u8_format = NULL;
return private->transform_from_srgb_u8;
return NULL;
}
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_to_srgb_double (GimpImage *image)
{
GimpImagePrivate *private;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (pixel_format != NULL, NULL);
g_return_val_if_fail (srgb_double_format != NULL, NULL);
private = GIMP_IMAGE_GET_PRIVATE (image);
if (private->is_color_managed)
{
*pixel_format = private->transform_layer_format;
*srgb_double_format = private->transform_srgb_double_format;
return private->transform_to_srgb_double;
}
*pixel_format = NULL;
*srgb_double_format = NULL;
return private->transform_to_srgb_double;
return NULL;
}
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_from_srgb_double (GimpImage *image)
{
GimpImagePrivate *private;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (pixel_format != NULL, NULL);
g_return_val_if_fail (srgb_double_format != NULL, NULL);
private = GIMP_IMAGE_GET_PRIVATE (image);
if (private->is_color_managed)
{
*pixel_format = private->transform_layer_format;
*srgb_double_format = private->transform_srgb_double_format;
return private->transform_from_srgb_double;
}
*pixel_format = NULL;
*srgb_double_format = NULL;
return private->transform_from_srgb_double;
return NULL;
}
......@@ -616,30 +568,12 @@ gimp_image_color_profile_pixel_to_srgb (GimpImage *image,
if (private->is_color_managed &&
private->transform_to_srgb_double)
{
guchar srgb_pixel[32];
/* for the alpha channel */
gimp_rgba_set_pixel (color, pixel_format, pixel);
if (pixel_format == private->transform_layer_format)
{
cmsDoTransform (private->transform_to_srgb_double,
pixel, srgb_pixel, 1);
}
else
{
guchar src_pixel[32];
babl_process (babl_fish (pixel_format,
private->transform_layer_format),
pixel, src_pixel, 1);
cmsDoTransform (private->transform_to_srgb_double,
src_pixel, srgb_pixel, 1);
}
gimp_rgb_set_pixel (color, private->transform_srgb_double_format,
srgb_pixel);
gimp_color_transform_process_pixels (private->transform_to_srgb_double,
pixel_format,
pixel,
babl_format ("R'G'B'A double"),
color,
1);
}
else
{
......@@ -658,34 +592,15 @@ gimp_image_color_profile_srgb_to_pixel (GimpImage *image,
if (private->is_color_managed &&
private->transform_from_srgb_double)
{
guchar srgb_pixel[32];
gimp_rgb_get_pixel (color, private->transform_srgb_double_format,
srgb_pixel);
if (pixel_format == private->transform_layer_format)
{
/* for the alpha channel */
gimp_rgba_get_pixel (color, pixel_format, pixel);
cmsDoTransform (private->transform_from_srgb_double,
srgb_pixel, pixel, 1);
}
else
{
guchar dest_pixel[32];
/* for the alpha channel */
gimp_rgba_get_pixel (color, private->transform_layer_format,
dest_pixel);
cmsDoTransform (private->transform_from_srgb_double,
srgb_pixel, dest_pixel, 1);
/* for the alpha channel */
gimp_rgba_get_pixel (color, pixel_format, pixel);
babl_process (babl_fish (private->transform_layer_format,
pixel_format),
dest_pixel, pixel, 1);
}
gimp_color_transform_process_pixels (private->transform_from_srgb_double,
babl_format ("R'G'B'A double"),
color,
pixel_format,
pixel,
1);
}
else
{
......@@ -709,31 +624,27 @@ _gimp_image_free_color_profile (GimpImage *image)
if (private->transform_to_srgb_u8)
{
cmsDeleteTransform (private->transform_to_srgb_u8);
g_object_unref (private->transform_to_srgb_u8);
private->transform_to_srgb_u8 = NULL;
}
if (private->transform_from_srgb_u8)
{
cmsDeleteTransform (private->transform_from_srgb_u8);
g_object_unref (private->transform_from_srgb_u8);
private->transform_from_srgb_u8 = NULL;
}
if (private->transform_to_srgb_double)
{
cmsDeleteTransform (private->transform_to_srgb_double);
g_object_unref (private->transform_to_srgb_double);
private->transform_to_srgb_double = NULL;
}
if (private->transform_from_srgb_double)
{
cmsDeleteTransform (private->transform_from_srgb_double);
g_object_unref (private->transform_from_srgb_double);
private->transform_from_srgb_double = NULL;
}
private->transform_layer_format = NULL;
private->transform_srgb_u8_format = NULL;
private->transform_srgb_double_format = NULL;
}
void
......@@ -754,61 +665,44 @@ _gimp_image_update_color_profile (GimpImage *image,
if (private->color_profile)
{
GimpColorProfile *srgb_profile;
cmsHPROFILE image_lcms;
cmsHPROFILE srgb_lcms;
cmsUInt32Number image_lcms_format;
cmsUInt32Number srgb_u8_lcms_format;
cmsUInt32Number srgb_double_lcms_format;
cmsUInt32Number flags;
srgb_profile = gimp_color_profile_new_rgb_srgb ();
image_lcms = gimp_color_profile_get_lcms_profile (private->color_profile);
srgb_lcms = gimp_color_profile_get_lcms_profile (srgb_profile);
private->transform_layer_format = gimp_image_get_layer_format (image,
TRUE);
private->transform_srgb_u8_format = babl_format ("R'G'B'A u8");
private->transform_srgb_double_format = babl_format ("R'G'B'A double");
private->transform_layer_format =
gimp_color_profile_get_format (private->transform_layer_format,
&image_lcms_format);
private->transform_srgb_u8_format =
gimp_color_profile_get_format (private->transform_srgb_u8_format,
&srgb_u8_lcms_format);
private->transform_srgb_double_format =
gimp_color_profile_get_format (private->transform_srgb_double_format,
&srgb_double_lcms_format);
flags = cmsFLAGS_NOOPTIMIZE;
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
private->transform_to_srgb_u8 =
cmsCreateTransform (image_lcms, image_lcms_format,
srgb_lcms, srgb_u8_lcms_format,
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
flags);
gimp_color_transform_new (private->color_profile,
gimp_image_get_layer_format (image, TRUE),
srgb_profile,
babl_format ("R'G'B'A u8"),
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
flags);
private->transform_from_srgb_u8 =
cmsCreateTransform (srgb_lcms, srgb_u8_lcms_format,
image_lcms, image_lcms_format,
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
flags);
gimp_color_transform_new (srgb_profile,
babl_format ("R'G'B'A u8"),
private->color_profile,
gimp_image_get_layer_format (image, TRUE),
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
flags);
private->transform_to_srgb_double =
cmsCreateTransform (image_lcms, image_lcms_format,
srgb_lcms, srgb_double_lcms_format,
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
flags);
gimp_color_transform_new (private->color_profile,
gimp_image_get_layer_format (image, TRUE),
srgb_profile,
babl_format ("R'G'B'A double"),
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
flags);
private->transform_from_srgb_double =
cmsCreateTransform (srgb_lcms, srgb_double_lcms_format,
image_lcms, image_lcms_format,
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
flags);
gimp_color_transform_new (srgb_profile,
babl_format ("R'G'B'A double"),
private->color_profile,
gimp_image_get_layer_format (image, TRUE),
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
flags);
g_object_unref (srgb_profile);
}
......@@ -891,28 +785,28 @@ gimp_image_convert_profile_colormap (GimpImage *image,
gboolean bpc,
GimpProgress *progress)
{
cmsHPROFILE src_lcms;
cmsHPROFILE dest_lcms;
GimpColorTransform *transform;
guchar *cmap;
gint n_colors;
GimpColorTransform transform;
src_lcms = gimp_color_profile_get_lcms_profile (src_profile);
dest_lcms = gimp_color_profile_get_lcms_profile (dest_profile);
n_colors = gimp_image_get_colormap_size (image);
cmap = g_memdup (gimp_image_get_colormap (image), n_colors * 3);
transform = cmsCreateTransform (src_lcms, TYPE_RGB_8,
dest_lcms, TYPE_RGB_8,
intent,
cmsFLAGS_NOOPTIMIZE |
(bpc ? cmsFLAGS_BLACKPOINTCOMPENSATION : 0));
transform = gimp_color_transform_new (src_profile,
babl_format ("R'G'B' u8"),
dest_profile,
babl_format ("R'G'B' u8"),
intent,
cmsFLAGS_NOOPTIMIZE |
(bpc ? cmsFLAGS_BLACKPOINTCOMPENSATION : 0));
if (transform)
{
cmsDoTransform (transform, cmap, cmap, n_colors);
cmsDeleteTransform (transform);
gimp_color_transform_process_pixels (transform,
babl_format ("R'G'B' u8"), cmap,
babl_format ("R'G'B' u8"), cmap,
n_colors);
g_object_unref (transform);
gimp_image_set_colormap (image, cmap, n_colors, TRUE);
}
......
......@@ -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;