Commit dd6f5d71 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

changed GimpDrawable parameter to "GimpImageType dest_type".

2006-10-26  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage.[ch]
	(gimp_image_transform_rgb)
	(gimp_image_transform_color)
	(gimp_image_transform_temp_buf): changed GimpDrawable parameter to
	"GimpImageType dest_type".

	(gimp_image_get_foreground)
	(gimp_image_get_background): ditto and reordered parameters.

	* app/core/gimp-edit.c
	* app/core/gimpdrawable-bucket-fill.c
	* app/core/gimpdrawable-stroke.c
	* app/core/gimpdrawable-transform.c
	* app/core/gimpdrawable.c
	* app/core/gimpimage-merge.c
	* app/core/gimplayer.c
	* app/core/gimpselection.c
	* app/paint/gimpbrushcore.c
	* app/paint/gimpclone.c
	* app/paint/gimperaser.c
	* app/paint/gimpheal.c
	* app/paint/gimpink.c
	* app/paint/gimppaintbrush.c: changed accordingly.

	* app/core/gimpdrawable-transform.c
	(gimp_drawable_transform_tiles_affine): set the progress to 1.0
	when done, some tiny cleanups around lanczos.
parent 7c8a68b1
2006-10-26 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.[ch]
(gimp_image_transform_rgb)
(gimp_image_transform_color)
(gimp_image_transform_temp_buf): changed GimpDrawable parameter to
"GimpImageType dest_type".
(gimp_image_get_foreground)
(gimp_image_get_background): ditto and reordered parameters.
* app/core/gimp-edit.c
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpdrawable-stroke.c
* app/core/gimpdrawable-transform.c
* app/core/gimpdrawable.c
* app/core/gimpimage-merge.c
* app/core/gimplayer.c
* app/core/gimpselection.c
* app/paint/gimpbrushcore.c
* app/paint/gimpclone.c
* app/paint/gimperaser.c
* app/paint/gimpheal.c
* app/paint/gimpink.c
* app/paint/gimppaintbrush.c: changed accordingly.
* app/core/gimpdrawable-transform.c
(gimp_drawable_transform_tiles_affine): set the progress to 1.0
when done, some tiny cleanups around lanczos.
2006-10-25 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable-transform.c
......
......@@ -606,28 +606,30 @@ gimp_edit_fill_internal (GimpImage *image,
GimpLayerModeEffects paint_mode,
const gchar *undo_desc)
{
TileManager *buf_tiles;
PixelRegion bufPR;
gint x, y, width, height;
gint tiles_bytes;
guchar col[MAX_CHANNELS];
TempBuf *pat_buf = NULL;
gboolean new_buf;
TileManager *buf_tiles;
PixelRegion bufPR;
gint x, y, width, height;
GimpImageType drawable_type;
gint tiles_bytes;
guchar col[MAX_CHANNELS];
TempBuf *pat_buf = NULL;
gboolean new_buf;
if (! gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
return TRUE; /* nothing to do, but the fill succeded */
tiles_bytes = gimp_drawable_bytes (drawable);
drawable_type = gimp_drawable_type (drawable);
tiles_bytes = gimp_drawable_bytes (drawable);
switch (fill_type)
{
case GIMP_FOREGROUND_FILL:
gimp_image_get_foreground (image, drawable, context, col);
gimp_image_get_foreground (image, context, drawable_type, col);
break;
case GIMP_BACKGROUND_FILL:
case GIMP_TRANSPARENT_FILL:
gimp_image_get_background (image, drawable, context, col);
gimp_image_get_background (image, context, drawable_type, col);
break;
case GIMP_WHITE_FILL:
......@@ -637,7 +639,8 @@ gimp_edit_fill_internal (GimpImage *image,
tmp_col[RED_PIX] = 255;
tmp_col[GREEN_PIX] = 255;
tmp_col[BLUE_PIX] = 255;
gimp_image_transform_color (image, drawable, col, GIMP_RGB, tmp_col);
gimp_image_transform_color (image, drawable_type, col,
GIMP_RGB, tmp_col);
}
break;
......@@ -645,7 +648,7 @@ gimp_edit_fill_internal (GimpImage *image,
{
GimpPattern *pattern = gimp_context_get_pattern (context);
pat_buf = gimp_image_transform_temp_buf (image, drawable,
pat_buf = gimp_image_transform_temp_buf (image, drawable_type,
pattern->mask, &new_buf);
if (! gimp_drawable_has_alpha (drawable) &&
......
......@@ -195,7 +195,8 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Get the background color */
gimp_image_get_background (image, drawable, context, bg_color);
gimp_image_get_background (image, context, gimp_drawable_type (drawable),
bg_color);
switch (GIMP_IMAGE_TYPE_BASE_TYPE (gimp_drawable_type (drawable)))
{
......@@ -324,12 +325,6 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
dest = g_new (guchar, tile_manager_width (new_tiles) * bytes);
uinc = m.coeff[0][0];
vinc = m.coeff[1][0];
winc = m.coeff[2][0];
coords = (interpolation_type != GIMP_INTERPOLATION_NONE) ? 5 : 1;
/* these loops could be rearranged, depending on which bit of code
* you'd most like to write more than once.
*/
......@@ -473,11 +468,16 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
}
g_free (lanczos);
g_free (dest);
return new_tiles;
goto done;
}
uinc = m.coeff[0][0];
vinc = m.coeff[1][0];
winc = m.coeff[2][0];
coords = (interpolation_type != GIMP_INTERPOLATION_NONE) ? 5 : 1;
for (y = y1; y < y2; y++)
{
if (progress && !(y & 0xf))
......@@ -637,6 +637,11 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
pixel_region_set_row (&destPR, 0, (y - y1), width, dest);
}
done:
if (progress)
gimp_progress_set_value (progress, 1.0);
switch (interpolation_type)
{
case GIMP_INTERPOLATION_NONE:
......@@ -715,7 +720,8 @@ gimp_drawable_transform_tiles_flip (GimpDrawable *drawable,
tile_manager_set_offsets (new_tiles, orig_x, orig_y);
gimp_image_get_background (image, drawable, context, bg_color);
gimp_image_get_background (image, context, gimp_drawable_type (drawable),
bg_color);
/* "Outside" a channel is transparency, not the bg color */
if (GIMP_IS_CHANNEL (drawable))
......@@ -892,7 +898,8 @@ gimp_drawable_transform_tiles_rotate (GimpDrawable *drawable,
tile_manager_set_offsets (new_tiles, orig_x, orig_y);
gimp_image_get_background (image, drawable, context, bg_color);
gimp_image_get_background (image, context, gimp_drawable_type (drawable),
bg_color);
/* "Outside" a channel is transparency, not the bg color */
if (GIMP_IS_CHANNEL (drawable))
......@@ -1831,4 +1838,3 @@ sample_cubic (PixelSurround *surround,
pixel_surround_release (surround);
}
......@@ -155,12 +155,14 @@ gimp_drawable_bucket_fill_full (GimpDrawable *drawable,
&tmp_col[GREEN_PIX],
&tmp_col[BLUE_PIX]);
gimp_image_transform_color (image, drawable, col, GIMP_RGB, tmp_col);
gimp_image_transform_color (image, gimp_drawable_type (drawable), col,
GIMP_RGB, tmp_col);
col[gimp_drawable_bytes_with_alpha (drawable) - 1] = OPAQUE_OPACITY;
}
else if (fill_mode == GIMP_PATTERN_BUCKET_FILL)
{
pat_buf = gimp_image_transform_temp_buf (image, drawable,
pat_buf = gimp_image_transform_temp_buf (image,
gimp_drawable_type (drawable),
pattern->mask, &new_buf);
}
else
......
......@@ -287,8 +287,8 @@ gimp_drawable_stroke_scan_convert (GimpDrawable *drawable,
&tmp_col[GREEN_PIX],
&tmp_col[BLUE_PIX]);
gimp_image_transform_color (image, drawable,
col, GIMP_RGB, tmp_col);
gimp_image_transform_color (image, gimp_drawable_type (drawable), col,
GIMP_RGB, tmp_col);
col[bytes - 1] = OPAQUE_OPACITY;
color_region_mask (&basePR, &maskPR, col);
......@@ -302,7 +302,8 @@ gimp_drawable_stroke_scan_convert (GimpDrawable *drawable,
gboolean new_buf;
pattern = gimp_context_get_pattern (context);
pat_buf = gimp_image_transform_temp_buf (image, drawable,
pat_buf = gimp_image_transform_temp_buf (image,
gimp_drawable_type (drawable),
pattern->mask, &new_buf);
pattern_region (&basePR, &maskPR, pat_buf, x, y);
......
......@@ -195,7 +195,8 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Get the background color */
gimp_image_get_background (image, drawable, context, bg_color);
gimp_image_get_background (image, context, gimp_drawable_type (drawable),
bg_color);
switch (GIMP_IMAGE_TYPE_BASE_TYPE (gimp_drawable_type (drawable)))
{
......@@ -324,12 +325,6 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
dest = g_new (guchar, tile_manager_width (new_tiles) * bytes);
uinc = m.coeff[0][0];
vinc = m.coeff[1][0];
winc = m.coeff[2][0];
coords = (interpolation_type != GIMP_INTERPOLATION_NONE) ? 5 : 1;
/* these loops could be rearranged, depending on which bit of code
* you'd most like to write more than once.
*/
......@@ -473,11 +468,16 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
}
g_free (lanczos);
g_free (dest);
return new_tiles;
goto done;
}
uinc = m.coeff[0][0];
vinc = m.coeff[1][0];
winc = m.coeff[2][0];
coords = (interpolation_type != GIMP_INTERPOLATION_NONE) ? 5 : 1;
for (y = y1; y < y2; y++)
{
if (progress && !(y & 0xf))
......@@ -637,6 +637,11 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
pixel_region_set_row (&destPR, 0, (y - y1), width, dest);
}
done:
if (progress)
gimp_progress_set_value (progress, 1.0);
switch (interpolation_type)
{
case GIMP_INTERPOLATION_NONE:
......@@ -715,7 +720,8 @@ gimp_drawable_transform_tiles_flip (GimpDrawable *drawable,
tile_manager_set_offsets (new_tiles, orig_x, orig_y);
gimp_image_get_background (image, drawable, context, bg_color);
gimp_image_get_background (image, context, gimp_drawable_type (drawable),
bg_color);
/* "Outside" a channel is transparency, not the bg color */
if (GIMP_IS_CHANNEL (drawable))
......@@ -892,7 +898,8 @@ gimp_drawable_transform_tiles_rotate (GimpDrawable *drawable,
tile_manager_set_offsets (new_tiles, orig_x, orig_y);
gimp_image_get_background (image, drawable, context, bg_color);
gimp_image_get_background (image, context, gimp_drawable_type (drawable),
bg_color);
/* "Outside" a channel is transparency, not the bg color */
if (GIMP_IS_CHANNEL (drawable))
......@@ -1831,4 +1838,3 @@ sample_cubic (PixelSurround *surround,
pixel_surround_release (surround);
}
......@@ -457,8 +457,8 @@ gimp_drawable_resize (GimpItem *item,
TRUE);
if (! gimp_drawable_has_alpha (drawable) && ! GIMP_IS_CHANNEL (drawable))
gimp_image_get_background (gimp_item_get_image (item), drawable,
context, bg);
gimp_image_get_background (gimp_item_get_image (item), context,
gimp_drawable_type (drawable), bg);
color_region (&destPR, bg);
}
......@@ -1121,7 +1121,7 @@ gimp_drawable_fill (GimpDrawable *drawable,
&tmp[BLUE_PIX],
&tmp[ALPHA_PIX]);
gimp_image_transform_color (image, drawable, c, GIMP_RGB, tmp);
gimp_image_transform_color (image, drawable_type, c, GIMP_RGB, tmp);
if (GIMP_IMAGE_TYPE_HAS_ALPHA (drawable_type))
c[GIMP_IMAGE_TYPE_BYTES (drawable_type) - 1] = tmp[ALPHA_PIX];
......@@ -1135,7 +1135,7 @@ gimp_drawable_fill (GimpDrawable *drawable,
TempBuf *pat_buf;
gboolean new_buf;
pat_buf = gimp_image_transform_temp_buf (image, drawable,
pat_buf = gimp_image_transform_temp_buf (image, drawable_type,
pattern->mask, &new_buf);
pattern_region (&destPR, NULL, pat_buf, 0, 0);
......
......@@ -423,8 +423,9 @@ gimp_image_merge_layers (GimpImage *image,
GIMP_ITEM (merge_layer)->offset_y = y1;
/* get the background for compositing */
gimp_image_get_background (image, GIMP_DRAWABLE (merge_layer),
context, bg);
gimp_image_get_background (image, context,
gimp_drawable_type (GIMP_DRAWABLE (merge_layer)),
bg);
/* init the pixel region */
pixel_region_init (&src1PR,
......
......@@ -1938,16 +1938,15 @@ gimp_image_flush (GimpImage *image)
/* color transforms / utilities */
void
gimp_image_get_foreground (const GimpImage *image,
const GimpDrawable *drawable,
GimpContext *context,
guchar *fg)
gimp_image_get_foreground (const GimpImage *image,
GimpContext *context,
GimpImageType dest_type,
guchar *fg)
{
GimpRGB color;
guchar pfg[3];
g_return_if_fail (GIMP_IS_IMAGE (image));
g_return_if_fail (! drawable || GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (fg != NULL);
......@@ -1955,20 +1954,19 @@ gimp_image_get_foreground (const GimpImage *image,
gimp_rgb_get_uchar (&color, &pfg[0], &pfg[1], &pfg[2]);
gimp_image_transform_color (image, drawable, fg, GIMP_RGB, pfg);
gimp_image_transform_color (image, dest_type, fg, GIMP_RGB, pfg);
}
void
gimp_image_get_background (const GimpImage *image,
const GimpDrawable *drawable,
GimpContext *context,
guchar *bg)
gimp_image_get_background (const GimpImage *image,
GimpContext *context,
GimpImageType dest_type,
guchar *bg)
{
GimpRGB color;
guchar pbg[3];
g_return_if_fail (GIMP_IS_IMAGE (image));
g_return_if_fail (! drawable || GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (bg != NULL);
......@@ -1976,7 +1974,7 @@ gimp_image_get_background (const GimpImage *image,
gimp_rgb_get_uchar (&color, &pbg[0], &pbg[1], &pbg[2]);
gimp_image_transform_color (image, drawable, bg, GIMP_RGB, pbg);
gimp_image_transform_color (image, dest_type, bg, GIMP_RGB, pbg);
}
void
......@@ -2034,38 +2032,31 @@ gimp_image_get_color (const GimpImage *src_image,
void
gimp_image_transform_rgb (const GimpImage *dest_image,
const GimpDrawable *dest_drawable,
GimpImageType dest_type,
const GimpRGB *rgb,
guchar *color)
{
guchar col[3];
g_return_if_fail (GIMP_IS_IMAGE (dest_image));
g_return_if_fail (! dest_drawable || GIMP_IS_DRAWABLE (dest_drawable));
g_return_if_fail (rgb != NULL);
g_return_if_fail (color != NULL);
gimp_rgb_get_uchar (rgb, &col[0], &col[1], &col[2]);
gimp_image_transform_color (dest_image, dest_drawable, color, GIMP_RGB, col);
gimp_image_transform_color (dest_image, dest_type, color, GIMP_RGB, col);
}
void
gimp_image_transform_color (const GimpImage *dest_image,
const GimpDrawable *dest_drawable,
GimpImageType dest_type,
guchar *dest,
GimpImageBaseType src_type,
const guchar *src)
{
GimpImageType dest_type;
g_return_if_fail (GIMP_IS_IMAGE (dest_image));
g_return_if_fail (src_type != GIMP_INDEXED);
dest_type = (dest_drawable ?
gimp_drawable_type (dest_drawable) :
gimp_image_base_type_with_alpha (dest_image));
switch (src_type)
{
case GIMP_RGB:
......@@ -2132,10 +2123,10 @@ gimp_image_transform_color (const GimpImage *dest_image,
}
TempBuf *
gimp_image_transform_temp_buf (const GimpImage *dest_image,
const GimpDrawable *dest_drawable,
TempBuf *temp_buf,
gboolean *new_buf)
gimp_image_transform_temp_buf (const GimpImage *dest_image,
GimpImageType dest_type,
TempBuf *temp_buf,
gboolean *new_buf)
{
TempBuf *ret_buf;
GimpImageType ret_buf_type;
......@@ -2145,7 +2136,6 @@ gimp_image_transform_temp_buf (const GimpImage *dest_image,
gint out_bytes;
g_return_val_if_fail (GIMP_IMAGE (dest_image), NULL);
g_return_val_if_fail (GIMP_DRAWABLE (dest_drawable), NULL);
g_return_val_if_fail (temp_buf != NULL, NULL);
g_return_val_if_fail (new_buf != NULL, NULL);
......@@ -2155,16 +2145,16 @@ gimp_image_transform_temp_buf (const GimpImage *dest_image,
is_rgb = (in_bytes == 3 || in_bytes == 4);
if (has_alpha)
ret_buf_type = gimp_drawable_type_with_alpha (dest_drawable);
ret_buf_type = GIMP_IMAGE_TYPE_WITH_ALPHA (dest_type);
else
ret_buf_type = gimp_drawable_type_without_alpha (dest_drawable);
ret_buf_type = GIMP_IMAGE_TYPE_WITHOUT_ALPHA (dest_type);
out_bytes = GIMP_IMAGE_TYPE_BYTES (ret_buf_type);
/* If the pattern doesn't match the image in terms of color type,
* transform it. (ie pattern is RGB, image is indexed)
*/
if (in_bytes != out_bytes || gimp_drawable_is_indexed (dest_drawable))
if (in_bytes != out_bytes || GIMP_IMAGE_TYPE_IS_INDEXED (dest_type))
{
guchar *src;
guchar *dest;
......@@ -2180,7 +2170,7 @@ gimp_image_transform_temp_buf (const GimpImage *dest_image,
while (size--)
{
gimp_image_transform_color (dest_image, dest_drawable, dest,
gimp_image_transform_color (dest_image, dest_type, dest,
is_rgb ? GIMP_RGB : GIMP_GRAY, src);
/* Handle alpha */
......
......@@ -343,28 +343,28 @@ void gimp_image_flush (GimpImage *image);
/* color transforms / utilities */
void gimp_image_get_foreground (const GimpImage *image,
const GimpDrawable *drawable,
GimpContext *context,
GimpImageType dest_type,
guchar *fg);
void gimp_image_get_background (const GimpImage *image,
const GimpDrawable *drawable,
GimpContext *context,
GimpImageType dest_type,
guchar *bg);
void gimp_image_get_color (const GimpImage *src_image,
GimpImageType src_type,
const guchar *src,
guchar *rgba);
void gimp_image_transform_rgb (const GimpImage *dest_image,
const GimpDrawable *dest_drawable,
GimpImageType dest_type,
const GimpRGB *rgb,
guchar *color);
void gimp_image_transform_color (const GimpImage *dest_image,
const GimpDrawable *dest_drawable,
GimpImageType dest_type,
guchar *dest,
GimpImageBaseType src_type,
const guchar *src);
TempBuf * gimp_image_transform_temp_buf (const GimpImage *dest_image,
const GimpDrawable *dest_drawable,
GimpImageType dest_type,
TempBuf *temp_buf,
gboolean *new_buf);
......
......@@ -154,7 +154,7 @@ static gint gimp_layer_get_opacity_at (GimpPickable *pickable,
static void gimp_layer_transform_color (GimpImage *image,
PixelRegion *layerPR,
PixelRegion *bufPR,
GimpDrawable *drawable,
GimpImageType dest_type,
GimpImageType src_type);
static void gimp_layer_layer_mask_update (GimpDrawable *layer_mask,
......@@ -601,7 +601,7 @@ gimp_layer_convert (GimpItem *item,
gimp_layer_transform_color (dest_image,
&newPR, &layerPR,
NULL,
new_type,
gimp_drawable_type (drawable));
}
break;
......@@ -883,7 +883,7 @@ static void
gimp_layer_transform_color (GimpImage *image,
PixelRegion *layerPR,
PixelRegion *bufPR,
GimpDrawable *drawable,
GimpImageType dest_type,
GimpImageType src_type)
{
GimpImageBaseType base_type = GIMP_IMAGE_TYPE_BASE_TYPE (src_type);
......@@ -906,7 +906,7 @@ gimp_layer_transform_color (GimpImage *image,
for (i = 0; i < layerPR->w; i++)
{
gimp_image_transform_color (image, drawable, d, base_type, s);
gimp_image_transform_color (image, dest_type, d, base_type, s);
/* alpha channel */
d[layerPR->bytes - 1] = (alpha ?
......@@ -1138,7 +1138,7 @@ gimp_layer_new_from_region (PixelRegion *region,
case GIMP_GRAY_IMAGE:
case GIMP_GRAYA_IMAGE:
gimp_layer_transform_color (dest_image, &layerPR, region,
GIMP_DRAWABLE (new_layer), src_type);
type, src_type);
break;
default:
g_warning ("%s: unhandled type conversion", G_STRFUNC);
......@@ -1164,7 +1164,7 @@ gimp_layer_new_from_region (PixelRegion *region,
case GIMP_RGB_IMAGE:
case GIMP_RGBA_IMAGE:
gimp_layer_transform_color (dest_image, &layerPR, region,
GIMP_DRAWABLE (new_layer), src_type);
type, src_type);
break;
case GIMP_GRAYA_IMAGE:
copy_region (region, &layerPR);
......@@ -1188,12 +1188,12 @@ gimp_layer_new_from_region (PixelRegion *region,
case GIMP_RGB_IMAGE:
case GIMP_RGBA_IMAGE:
gimp_layer_transform_color (dest_image, &layerPR, region,
GIMP_DRAWABLE (new_layer), src_type);
type, src_type);
break;
case GIMP_GRAY_IMAGE:
case GIMP_GRAYA_IMAGE:
gimp_layer_transform_color (dest_image, &layerPR, region,
GIMP_DRAWABLE (new_layer), src_type);
type, src_type);
break;
default:
g_warning ("%s: unhandled type conversion", G_STRFUNC);
......@@ -1643,9 +1643,9 @@ gimp_layer_flatten (GimpLayer *layer,
new_type = gimp_drawable_type_without_alpha (GIMP_DRAWABLE (layer));
gimp_image_get_background (gimp_item_get_image (GIMP_ITEM (layer)),
GIMP_DRAWABLE (layer),
context, bg);
gimp_image_get_background (gimp_item_get_image (GIMP_ITEM (layer)), context,
gimp_drawable_type (GIMP_DRAWABLE (layer)),
bg);
/* Allocate the new tiles */
new_tiles = tile_manager_new (GIMP_ITEM (layer)->width,
......
......@@ -671,7 +671,8 @@ gimp_selection_extract (GimpChannel *selection,
break;
}
gimp_image_get_background (image, drawable, context, bg_color);
gimp_image_get_background (image, context, gimp_drawable_type (drawable),
bg_color);
/* If a cut was specified, and the selection mask is not empty,
* push an undo
......
......@@ -1460,7 +1460,8 @@ paint_line_pixmap_mask (GimpImage *dest,
for (byte_loop = 0; byte_loop < bytes - 1; byte_loop++)
d[byte_loop] *= alpha;
gimp_image_transform_color (dest, drawable, d, GIMP_RGB, p);
gimp_image_transform_color (dest, gimp_drawable_type (drawable), d,
GIMP_RGB, p);
d += bytes;
}
}
......@@ -1477,7 +1478,8 @@ paint_line_pixmap_mask (GimpImage *dest,
* maybe we could do this at tool creation or brush switch time?
* and compute it for the whole brush at once and cache it?
*/
gimp_image_transform_color (dest, drawable, d, GIMP_RGB, p);
gimp_image_transform_color (dest, gimp_drawable_type (drawable), d,
GIMP_RGB, p);
d += bytes;
}
}
......
......@@ -66,7 +66,7 @@ static void gimp_clone_motion (GimpSourceCore *source_core,
gint paint_area_height);
static void gimp_clone_line_image (GimpImage *dest_image,
GimpDrawable *dest_drawable,
GimpImageType dest_type,
GimpImage *src_image,
GimpImageType src_type,
guchar *s,
......@@ -75,7 +75,7 @@ static void gimp_clone_line_image (GimpImage *dest_image,
gint dest_bytes,
gint width);
static void gimp_clone_line_pattern (GimpImage *dest_image,
GimpDrawable *dest_drawable,
GimpImageType dest_type,
GimpPattern *pattern,
guchar *d,
gint x,
......@@ -167,6 +167,7 @@ gimp_clone_motion (GimpSourceCore *source_core,
GimpContext *context = GIMP_CONTEXT (paint_options);
GimpImage *src_image = NULL;
GimpImageType src_type = 0;
GimpImageType dest_type;
GimpImage *image;