app/Makefile.am new file.

2001-01-29  Michael Natterer  <mitch@gimp.org>

	* app/Makefile.am
	* app/undo_history.h: new file.

	* app/apptypes.h: removed the "Channel" typedef.

	* app/channel.[ch]: renamed all functions to gimp_channel_*()

	* app/channel_ops.c
	* app/channels_dialog.c
	* app/commands.c
	* app/disp_callbacks.c
	* app/gdisplay.c
	* app/gimage_mask.[ch]
	* app/gimpdnd.c
	* app/gimphistogram.c
	* app/gimpimage.[ch]
	* app/global_edit.c
	* app/layer.c
	* app/layers_dialog.c
	* app/qmask.c
	* app/scan_convert.c
	* app/scan_convert.h
	* app/toolbox.c
	* app/undo.[ch]
	* app/undo_history.c
	* app/xcf.[ch]
	* app/pdb/channel_cmds.c
	* app/pdb/color_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/pdb_glue.h
	* app/pdb/selection_cmds.c
	* app/pdb/tools_cmds.c
	* app/tools/bezier_select.c
	* app/tools/bezier_selectP.h
	* app/tools/blend.c
	* app/tools/bucket_fill.c
	* app/tools/by_color_select.c
	* app/tools/crop.c
	* app/tools/ellipse_select.c
	* app/tools/free_select.c
	* app/tools/fuzzy_select.c
	* app/tools/fuzzy_select.h
	* app/tools/iscissors.c
	* app/tools/rect_select.c
	* app/tools/text_tool.c
	* app/tools/transform_core.c
	* tools/pdbgen/pdb.pl
	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/color.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/selection.pdb
	* tools/pdbgen/pdb/tools.pdb: changed accordingly.
This commit is contained in:
Michael Natterer 2001-01-29 02:45:02 +00:00 committed by Michael Natterer
parent d3dcfadccf
commit 227eea67cb
128 changed files with 3833 additions and 3715 deletions

View file

@ -1,3 +1,59 @@
2001-01-29 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
* app/undo_history.h: new file.
* app/apptypes.h: removed the "Channel" typedef.
* app/channel.[ch]: renamed all functions to gimp_channel_*()
* app/channel_ops.c
* app/channels_dialog.c
* app/commands.c
* app/disp_callbacks.c
* app/gdisplay.c
* app/gimage_mask.[ch]
* app/gimpdnd.c
* app/gimphistogram.c
* app/gimpimage.[ch]
* app/global_edit.c
* app/layer.c
* app/layers_dialog.c
* app/qmask.c
* app/scan_convert.c
* app/scan_convert.h
* app/toolbox.c
* app/undo.[ch]
* app/undo_history.c
* app/xcf.[ch]
* app/pdb/channel_cmds.c
* app/pdb/color_cmds.c
* app/pdb/drawable_cmds.c
* app/pdb/image_cmds.c
* app/pdb/pdb_glue.h
* app/pdb/selection_cmds.c
* app/pdb/tools_cmds.c
* app/tools/bezier_select.c
* app/tools/bezier_selectP.h
* app/tools/blend.c
* app/tools/bucket_fill.c
* app/tools/by_color_select.c
* app/tools/crop.c
* app/tools/ellipse_select.c
* app/tools/free_select.c
* app/tools/fuzzy_select.c
* app/tools/fuzzy_select.h
* app/tools/iscissors.c
* app/tools/rect_select.c
* app/tools/text_tool.c
* app/tools/transform_core.c
* tools/pdbgen/pdb.pl
* tools/pdbgen/pdb/channel.pdb
* tools/pdbgen/pdb/color.pdb
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/selection.pdb
* tools/pdbgen/pdb/tools.pdb: changed accordingly.
2001-01-29 Michael Natterer <mitch@gimp.org> 2001-01-29 Michael Natterer <mitch@gimp.org>
* app/pdb/Makefile.am * app/pdb/Makefile.am

View file

@ -276,6 +276,7 @@ gimp_SOURCES = \
undo.c \ undo.c \
undo.h \ undo.h \
undo_history.c \ undo_history.c \
undo_history.h \
undo_types.h \ undo_types.h \
unitrc.h \ unitrc.h \
user_install.c \ user_install.c \

View file

@ -73,6 +73,7 @@
#include "selection.h" #include "selection.h"
#include "tips_dialog.h" #include "tips_dialog.h"
#include "undo.h" #include "undo.h"
#include "undo_history.h"
#ifdef DISPLAY_FILTERS #ifdef DISPLAY_FILTERS
#include "gdisplay_color_ui.h" #include "gdisplay_color_ui.h"

View file

@ -232,7 +232,7 @@ qmask_activate (GtkWidget *widget,
floating_sel_to_layer (layer); floating_sel_to_layer (layer);
} }
gmask = channel_new (gimg, gmask = gimp_channel_new (gimg,
gimg->width, gimg->width,
gimg->height, gimg->height,
"Qmask", "Qmask",
@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget,
{ {
/* if selection */ /* if selection */
gmask = channel_copy (gimp_image_get_mask (gimg)); gmask = gimp_channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0); gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, &color); gimp_channel_set_color (gmask, &color);
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask"); gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
gimage_mask_none (gimg); /* Clear the selection */ gimage_mask_none (gimg); /* Clear the selection */
} }
@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
EditQmaskOptions *options; EditQmaskOptions *options;
Channel *channel; GimpChannel *channel;
GimpRGB color; GimpRGB color;
options = (EditQmaskOptions *) data; options = (EditQmaskOptions *) data;
@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001) if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{ {
channel->color = color; channel->color = color;
channel_update (channel); gimp_channel_update (channel);
} }
} }

View file

@ -232,7 +232,7 @@ qmask_activate (GtkWidget *widget,
floating_sel_to_layer (layer); floating_sel_to_layer (layer);
} }
gmask = channel_new (gimg, gmask = gimp_channel_new (gimg,
gimg->width, gimg->width,
gimg->height, gimg->height,
"Qmask", "Qmask",
@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget,
{ {
/* if selection */ /* if selection */
gmask = channel_copy (gimp_image_get_mask (gimg)); gmask = gimp_channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0); gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, &color); gimp_channel_set_color (gmask, &color);
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask"); gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
gimage_mask_none (gimg); /* Clear the selection */ gimage_mask_none (gimg); /* Clear the selection */
} }
@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
EditQmaskOptions *options; EditQmaskOptions *options;
Channel *channel; GimpChannel *channel;
GimpRGB color; GimpRGB color;
options = (EditQmaskOptions *) data; options = (EditQmaskOptions *) data;
@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001) if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{ {
channel->color = color; channel->color = color;
channel_update (channel); gimp_channel_update (channel);
} }
} }

View file

@ -44,7 +44,6 @@ typedef struct _GimpContext GimpContext;
typedef struct _GimpDrawable GimpDrawable; typedef struct _GimpDrawable GimpDrawable;
typedef struct _GimpChannel GimpChannel; typedef struct _GimpChannel GimpChannel;
typedef GimpChannel Channel; /* convenience */
typedef struct _GimpLayer GimpLayer; typedef struct _GimpLayer GimpLayer;
typedef struct _GimpLayerMask GimpLayerMask; typedef struct _GimpLayerMask GimpLayerMask;

View file

@ -365,7 +365,7 @@ gimp_histogram_calculate_drawable (GimpHistogram *histogram,
if (!no_mask) if (!no_mask)
{ {
Channel *sel_mask; GimpChannel *sel_mask;
GimpImage *gimage; GimpImage *gimage;
gimage = gimp_drawable_gimage (drawable); gimage = gimp_drawable_gimage (drawable);

View file

@ -54,7 +54,7 @@ static void gimp_channel_class_init (GimpChannelClass *klass);
static void gimp_channel_init (GimpChannel *channel); static void gimp_channel_init (GimpChannel *channel);
static void gimp_channel_destroy (GtkObject *object); static void gimp_channel_destroy (GtkObject *object);
static TempBuf * channel_preview_private (Channel *channel, static TempBuf * gimp_channel_preview_private (GimpChannel *channel,
gint width, gint width,
gint height); gint height);
@ -109,7 +109,7 @@ gimp_channel_init (GimpChannel *channel)
/**************************/ /**************************/
static void static void
channel_validate (TileManager *tm, gimp_channel_validate (TileManager *tm,
Tile *tile) Tile *tile)
{ {
/* Set the contents of the tile to empty */ /* Set the contents of the tile to empty */
@ -117,14 +117,14 @@ channel_validate (TileManager *tm,
TRANSPARENT_OPACITY, tile_size (tile)); TRANSPARENT_OPACITY, tile_size (tile));
} }
Channel * GimpChannel *
channel_new (GimpImage *gimage, gimp_channel_new (GimpImage *gimage,
gint width, gint width,
gint height, gint height,
const gchar *name, const gchar *name,
const GimpRGB *color) const GimpRGB *color)
{ {
Channel *channel; GimpChannel *channel;
g_return_val_if_fail (color != NULL, NULL); g_return_val_if_fail (color != NULL, NULL);
@ -154,11 +154,11 @@ channel_new (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
channel_copy (const Channel *channel) gimp_channel_copy (const GimpChannel *channel)
{ {
gchar *channel_name; gchar *channel_name;
Channel *new_channel; GimpChannel *new_channel;
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
gchar *ext; gchar *ext;
gint number; gint number;
@ -180,7 +180,7 @@ channel_copy (const Channel *channel)
channel_name = g_strdup_printf (_("%s copy"), name); channel_name = g_strdup_printf (_("%s copy"), name);
/* allocate a new channel object */ /* allocate a new channel object */
new_channel = channel_new (GIMP_DRAWABLE (channel)->gimage, new_channel = gimp_channel_new (GIMP_DRAWABLE (channel)->gimage,
GIMP_DRAWABLE (channel)->width, GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height, GIMP_DRAWABLE (channel)->height,
channel_name, channel_name,
@ -209,7 +209,7 @@ channel_copy (const Channel *channel)
} }
void void
channel_set_color (Channel *channel, gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color) const GimpRGB *color)
{ {
g_return_if_fail (channel != NULL); g_return_if_fail (channel != NULL);
@ -220,7 +220,7 @@ channel_set_color (Channel *channel,
} }
const GimpRGB * const GimpRGB *
channel_get_color (const Channel *channel) gimp_channel_get_color (const GimpChannel *channel)
{ {
g_return_val_if_fail (channel != NULL, NULL); g_return_val_if_fail (channel != NULL, NULL);
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), NULL); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), NULL);
@ -229,7 +229,7 @@ channel_get_color (const Channel *channel)
} }
gint gint
channel_get_opacity (const Channel *channel) gimp_channel_get_opacity (const GimpChannel *channel)
{ {
g_return_val_if_fail (channel != NULL, 0); g_return_val_if_fail (channel != NULL, 0);
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0);
@ -238,7 +238,7 @@ channel_get_opacity (const Channel *channel)
} }
void void
channel_set_opacity (Channel *channel, gimp_channel_set_opacity (GimpChannel *channel,
gint opacity) gint opacity)
{ {
g_return_if_fail (channel != NULL); g_return_if_fail (channel != NULL);
@ -270,7 +270,7 @@ gimp_channel_destroy (GtkObject *object)
} }
void void
channel_scale (Channel *channel, gimp_channel_scale (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height) gint new_height)
{ {
@ -318,7 +318,7 @@ channel_scale (Channel *channel,
} }
void void
channel_resize (Channel *channel, gimp_channel_resize (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height, gint new_height,
gint offx, gint offx,
@ -415,7 +415,7 @@ channel_resize (Channel *channel,
} }
void void
channel_update (Channel *channel) gimp_channel_update (GimpChannel *channel)
{ {
drawable_update (GIMP_DRAWABLE (channel), drawable_update (GIMP_DRAWABLE (channel),
0, 0, 0, 0,
@ -429,7 +429,7 @@ channel_update (Channel *channel)
/**********************/ /**********************/
gboolean gboolean
channel_toggle_visibility (Channel *channel) gimp_channel_toggle_visibility (GimpChannel *channel)
{ {
GIMP_DRAWABLE (channel)->visible = !GIMP_DRAWABLE (channel)->visible; GIMP_DRAWABLE (channel)->visible = !GIMP_DRAWABLE (channel)->visible;
@ -437,7 +437,7 @@ channel_toggle_visibility (Channel *channel)
} }
TempBuf * TempBuf *
channel_preview (Channel *channel, gimp_channel_preview (GimpChannel *channel,
gint width, gint width,
gint height) gint height)
{ {
@ -449,7 +449,7 @@ channel_preview (Channel *channel,
GIMP_DRAWABLE (channel)->gimage->width > PREVIEW_CACHE_PRIME_WIDTH && GIMP_DRAWABLE (channel)->gimage->width > PREVIEW_CACHE_PRIME_WIDTH &&
GIMP_DRAWABLE (channel)->gimage->height > PREVIEW_CACHE_PRIME_HEIGHT) GIMP_DRAWABLE (channel)->gimage->height > PREVIEW_CACHE_PRIME_HEIGHT)
{ {
TempBuf * tb = channel_preview_private (channel, TempBuf * tb = gimp_channel_preview_private (channel,
PREVIEW_CACHE_PRIME_WIDTH, PREVIEW_CACHE_PRIME_WIDTH,
PREVIEW_CACHE_PRIME_HEIGHT); PREVIEW_CACHE_PRIME_HEIGHT);
@ -460,11 +460,11 @@ channel_preview (Channel *channel,
} }
/* Second call - should NOT visit the tile cache... */ /* Second call - should NOT visit the tile cache... */
return channel_preview_private (channel, width, height); return gimp_channel_preview_private (channel, width, height);
} }
static TempBuf * static TempBuf *
channel_preview_private (Channel *channel, gimp_channel_preview_private (GimpChannel *channel,
gint width, gint width,
gint height) gint height)
{ {
@ -526,27 +526,27 @@ channel_preview_private (Channel *channel,
/* selection mask functions */ /* selection mask functions */
/******************************/ /******************************/
Channel * GimpChannel *
channel_new_mask (GimpImage *gimage, gimp_channel_new_mask (GimpImage *gimage,
gint width, gint width,
gint height) gint height)
{ {
GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; GimpRGB black = { 0.0, 0.0, 0.0, 0.5 };
Channel *new_channel; GimpChannel *new_channel;
/* Create the new channel */ /* Create the new channel */
new_channel = channel_new (gimage, width, height, new_channel = gimp_channel_new (gimage, width, height,
_("Selection Mask"), &black); _("Selection Mask"), &black);
/* Set the validate procedure */ /* Set the validate procedure */
tile_manager_set_validate_proc (GIMP_DRAWABLE (new_channel)->tiles, tile_manager_set_validate_proc (GIMP_DRAWABLE (new_channel)->tiles,
channel_validate); gimp_channel_validate);
return new_channel; return new_channel;
} }
gboolean gboolean
channel_boundary (Channel *mask, gimp_channel_boundary (GimpChannel *mask,
BoundSeg **segs_in, BoundSeg **segs_in,
BoundSeg **segs_out, BoundSeg **segs_out,
gint *num_segs_in, gint *num_segs_in,
@ -567,7 +567,7 @@ channel_boundary (Channel *mask,
if (mask->segs_out) if (mask->segs_out)
g_free (mask->segs_out); g_free (mask->segs_out);
if (channel_bounds (mask, &x3, &y3, &x4, &y4)) if (gimp_channel_bounds (mask, &x3, &y3, &x4, &y4))
{ {
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles,
x3, y3, (x4 - x3), (y4 - y3), FALSE); x3, y3, (x4 - x3), (y4 - y3), FALSE);
@ -616,7 +616,7 @@ channel_boundary (Channel *mask,
} }
gint gint
channel_value (Channel *mask, gimp_channel_value (GimpChannel *mask,
gint x, gint x,
gint y) gint y)
{ {
@ -646,7 +646,7 @@ channel_value (Channel *mask,
} }
gboolean gboolean
channel_bounds (Channel *mask, gimp_channel_bounds (GimpChannel *mask,
gint *x1, gint *x1,
gint *y1, gint *y1,
gint *x2, gint *x2,
@ -760,7 +760,7 @@ channel_bounds (Channel *mask,
} }
gboolean gboolean
channel_is_empty (Channel *mask) gimp_channel_is_empty (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
guchar *data; guchar *data;
@ -811,7 +811,7 @@ channel_is_empty (Channel *mask)
} }
void void
channel_add_segment (Channel *mask, gimp_channel_add_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
@ -854,7 +854,7 @@ channel_add_segment (Channel *mask,
} }
void void
channel_sub_segment (Channel *mask, gimp_channel_sub_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
@ -896,7 +896,7 @@ channel_sub_segment (Channel *mask,
} }
void void
channel_combine_rect (Channel *mask, gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
@ -956,7 +956,7 @@ channel_combine_rect (Channel *mask,
} }
void void
channel_combine_ellipse (Channel *mask, gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
@ -1002,10 +1002,10 @@ channel_combine_ellipse (Channel *mask,
{ {
case CHANNEL_OP_ADD: case CHANNEL_OP_ADD:
case CHANNEL_OP_REPLACE: case CHANNEL_OP_REPLACE:
channel_add_segment (mask, x1, i, (x2 - x1), 255); gimp_channel_add_segment (mask, x1, i, (x2 - x1), 255);
break; break;
case CHANNEL_OP_SUB: case CHANNEL_OP_SUB:
channel_sub_segment (mask, x1, i, (x2 - x1), 255); gimp_channel_sub_segment (mask, x1, i, (x2 - x1), 255);
break; break;
default: default:
g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!");
@ -1046,10 +1046,10 @@ channel_combine_ellipse (Channel *mask,
{ {
case CHANNEL_OP_ADD: case CHANNEL_OP_ADD:
case CHANNEL_OP_REPLACE: case CHANNEL_OP_REPLACE:
channel_add_segment (mask, x0, i, j - x0, last); gimp_channel_add_segment (mask, x0, i, j - x0, last);
break; break;
case CHANNEL_OP_SUB: case CHANNEL_OP_SUB:
channel_sub_segment (mask, x0, i, j - x0, last); gimp_channel_sub_segment (mask, x0, i, j - x0, last);
break; break;
default: default:
g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!");
@ -1071,9 +1071,9 @@ channel_combine_ellipse (Channel *mask,
if (last) if (last)
{ {
if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE)
channel_add_segment (mask, x0, i, j - x0, last); gimp_channel_add_segment (mask, x0, i, j - x0, last);
else if (op == CHANNEL_OP_SUB) else if (op == CHANNEL_OP_SUB)
channel_sub_segment (mask, x0, i, j - x0, last); gimp_channel_sub_segment (mask, x0, i, j - x0, last);
else else
g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!");
} }
@ -1112,7 +1112,7 @@ channel_combine_ellipse (Channel *mask,
} }
static void static void
channel_combine_sub_region_add (void *unused, gimp_channel_combine_sub_region_add (void *unused,
PixelRegion *srcPR, PixelRegion *srcPR,
PixelRegion *destPR) PixelRegion *destPR)
{ {
@ -1138,7 +1138,7 @@ channel_combine_sub_region_add (void *unused,
} }
static void static void
channel_combine_sub_region_sub (void *unused, gimp_channel_combine_sub_region_sub (void *unused,
PixelRegion *srcPR, PixelRegion *srcPR,
PixelRegion *destPR) PixelRegion *destPR)
{ {
@ -1163,7 +1163,7 @@ channel_combine_sub_region_sub (void *unused,
} }
static void static void
channel_combine_sub_region_intersect (void *unused, gimp_channel_combine_sub_region_intersect (void *unused,
PixelRegion *srcPR, PixelRegion *srcPR,
PixelRegion *destPR) PixelRegion *destPR)
{ {
@ -1185,8 +1185,8 @@ channel_combine_sub_region_intersect (void *unused,
} }
void void
channel_combine_mask (Channel *mask, gimp_channel_combine_mask (GimpChannel *mask,
Channel *add_on, GimpChannel *add_on,
ChannelOps op, ChannelOps op,
gint off_x, gint off_x,
gint off_y) gint off_y)
@ -1213,28 +1213,31 @@ channel_combine_mask (Channel *mask,
{ {
case CHANNEL_OP_ADD: case CHANNEL_OP_ADD:
case CHANNEL_OP_REPLACE: case CHANNEL_OP_REPLACE:
pixel_regions_process_parallel ((p_func) channel_combine_sub_region_add, pixel_regions_process_parallel ((p_func)
gimp_channel_combine_sub_region_add,
NULL, 2, &srcPR, &destPR); NULL, 2, &srcPR, &destPR);
break; break;
case CHANNEL_OP_SUB: case CHANNEL_OP_SUB:
pixel_regions_process_parallel ((p_func) channel_combine_sub_region_sub, pixel_regions_process_parallel ((p_func)
gimp_channel_combine_sub_region_sub,
NULL, 2, &srcPR, &destPR); NULL, 2, &srcPR, &destPR);
break; break;
case CHANNEL_OP_INTERSECT: case CHANNEL_OP_INTERSECT:
pixel_regions_process_parallel ((p_func) pixel_regions_process_parallel ((p_func)
channel_combine_sub_region_intersect, gimp_channel_combine_sub_region_intersect,
NULL, 2, &srcPR, &destPR); NULL, 2, &srcPR, &destPR);
break; break;
default: default:
g_message ("Error: unknown opperation type in channel_combine_mask\n"); g_message ("Error: unknown opperation type in channel_combine_mask\n");
break; break;
} }
mask->bounds_known = FALSE; mask->bounds_known = FALSE;
} }
void void
channel_feather (Channel *input, gimp_channel_feather (GimpChannel *input,
Channel *output, GimpChannel *output,
gdouble radius_x, gdouble radius_x,
gdouble radius_y, gdouble radius_y,
ChannelOps op, ChannelOps op,
@ -1256,13 +1259,13 @@ channel_feather (Channel *input,
gaussian_blur_region (&srcPR, radius_x, radius_y); gaussian_blur_region (&srcPR, radius_x, radius_y);
if (input != output) if (input != output)
channel_combine_mask (output, input, op, 0, 0); gimp_channel_combine_mask (output, input, op, 0, 0);
output->bounds_known = FALSE; output->bounds_known = FALSE;
} }
void void
channel_push_undo (Channel *mask) gimp_channel_push_undo (GimpChannel *mask)
{ {
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
MaskUndo *mask_undo; MaskUndo *mask_undo;
@ -1271,7 +1274,7 @@ channel_push_undo (Channel *mask)
GImage *gimage; GImage *gimage;
mask_undo = g_new (MaskUndo, 1); mask_undo = g_new (MaskUndo, 1);
if (channel_bounds (mask, &x1, &y1, &x2, &y2)) if (gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
{ {
undo_tiles = tile_manager_new ((x2 - x1), (y2 - y1), 1); undo_tiles = tile_manager_new ((x2 - x1), (y2 - y1), 1);
pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles,
@ -1296,13 +1299,13 @@ channel_push_undo (Channel *mask)
} }
void void
channel_clear (Channel *mask) gimp_channel_clear (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
guchar bg = 0; guchar bg = 0;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
if (mask->bounds_known && !mask->empty) if (mask->bounds_known && !mask->empty)
{ {
@ -1331,13 +1334,13 @@ channel_clear (Channel *mask)
} }
void void
channel_invert (Channel *mask) gimp_channel_invert (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
GimpLut *lut; GimpLut *lut;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
0, 0, 0, 0,
@ -1353,13 +1356,13 @@ channel_invert (Channel *mask)
} }
void void
channel_sharpen (Channel *mask) gimp_channel_sharpen (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
GimpLut *lut; GimpLut *lut;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
0, 0, 0, 0,
@ -1373,13 +1376,13 @@ channel_sharpen (Channel *mask)
} }
void void
channel_all (Channel *mask) gimp_channel_all (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
guchar bg = 255; guchar bg = 255;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* clear the mask */ /* clear the mask */
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
@ -1398,7 +1401,7 @@ channel_all (Channel *mask)
} }
void void
channel_border (Channel *mask, gimp_channel_border (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y) gint radius_y)
{ {
@ -1408,9 +1411,9 @@ channel_border (Channel *mask,
if (radius_x < 0 || radius_y < 0) if (radius_x < 0 || radius_y < 0)
return; return;
if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return; return;
if (channel_is_empty (mask)) if (gimp_channel_is_empty (mask))
return; return;
if (x1 - radius_x < 0) if (x1 - radius_x < 0)
@ -1430,8 +1433,9 @@ channel_border (Channel *mask,
y2 = GIMP_DRAWABLE (mask)->height; y2 = GIMP_DRAWABLE (mask)->height;
else else
y2 += radius_y; y2 += radius_y;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1,
(x2-x1), (y2-y1), TRUE); (x2-x1), (y2-y1), TRUE);
@ -1442,7 +1446,7 @@ channel_border (Channel *mask,
} }
void void
channel_grow (Channel *mask, gimp_channel_grow (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y) gint radius_y)
{ {
@ -1454,16 +1458,16 @@ channel_grow (Channel *mask,
if (radius_x <= 0 && radius_y <= 0) if (radius_x <= 0 && radius_y <= 0)
{ {
channel_shrink (mask, -radius_x, -radius_y, FALSE); gimp_channel_shrink (mask, -radius_x, -radius_y, FALSE);
return; return;
} }
if (radius_x < 0 || radius_y < 0) if (radius_x < 0 || radius_y < 0)
return; return;
if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return; return;
if (channel_is_empty (mask)) if (gimp_channel_is_empty (mask))
return; return;
if (x1 - radius_x > 0) if (x1 - radius_x > 0)
@ -1484,7 +1488,7 @@ channel_grow (Channel *mask,
y2 = GIMP_DRAWABLE (mask)->height; y2 = GIMP_DRAWABLE (mask)->height;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* need full extents for grow, not! */ /* need full extents for grow, not! */
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1),
@ -1496,7 +1500,7 @@ channel_grow (Channel *mask,
} }
void void
channel_shrink (Channel *mask, gimp_channel_shrink (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y, gint radius_y,
gboolean edge_lock) gboolean edge_lock)
@ -1509,16 +1513,16 @@ channel_shrink (Channel *mask,
if (radius_x <= 0 && radius_y <= 0) if (radius_x <= 0 && radius_y <= 0)
{ {
channel_grow (mask, -radius_x, -radius_y); gimp_channel_grow (mask, -radius_x, -radius_y);
return; return;
} }
if (radius_x < 0 || radius_y < 0) if (radius_x < 0 || radius_y < 0)
return; return;
if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return; return;
if (channel_is_empty (mask)) if (gimp_channel_is_empty (mask))
return; return;
if (x1 > 0) if (x1 > 0)
@ -1531,7 +1535,7 @@ channel_shrink (Channel *mask,
y2++; y2++;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1),
(y2 - y1), TRUE); (y2 - y1), TRUE);
@ -1542,12 +1546,12 @@ channel_shrink (Channel *mask,
} }
void void
channel_translate (Channel *mask, gimp_channel_translate (GimpChannel *mask,
gint off_x, gint off_x,
gint off_y) gint off_y)
{ {
gint width, height; gint width, height;
Channel *tmp_mask; GimpChannel *tmp_mask;
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
guchar empty = 0; guchar empty = 0;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
@ -1555,9 +1559,9 @@ channel_translate (Channel *mask,
tmp_mask = NULL; tmp_mask = NULL;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
channel_bounds (mask, &x1, &y1, &x2, &y2); gimp_channel_bounds (mask, &x1, &y1, &x2, &y2);
x1 = CLAMP ((x1 + off_x), 0, GIMP_DRAWABLE (mask)->width); x1 = CLAMP ((x1 + off_x), 0, GIMP_DRAWABLE (mask)->width);
y1 = CLAMP ((y1 + off_y), 0, GIMP_DRAWABLE (mask)->height); y1 = CLAMP ((y1 + off_y), 0, GIMP_DRAWABLE (mask)->height);
x2 = CLAMP ((x2 + off_x), 0, GIMP_DRAWABLE (mask)->width); x2 = CLAMP ((x2 + off_x), 0, GIMP_DRAWABLE (mask)->width);
@ -1572,7 +1576,8 @@ channel_translate (Channel *mask,
/* copy the portion of the mask we will keep to a /* copy the portion of the mask we will keep to a
* temporary buffer * temporary buffer
*/ */
tmp_mask = channel_new_mask (GIMP_DRAWABLE (mask)->gimage, width, height); tmp_mask = gimp_channel_new_mask (GIMP_DRAWABLE (mask)->gimage,
width, height);
pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles,
x1 - off_x, y1 - off_y, width, height, FALSE); x1 - off_x, y1 - off_y, width, height, FALSE);
@ -1619,13 +1624,13 @@ channel_translate (Channel *mask,
} }
void void
channel_load (Channel *mask, gimp_channel_load (GimpChannel *mask,
Channel *channel) GimpChannel *channel)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* copy the channel to the mask */ /* copy the channel to the mask */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
@ -1642,7 +1647,7 @@ channel_load (Channel *mask,
} }
void void
channel_layer_alpha (Channel *mask, gimp_channel_layer_alpha (GimpChannel *mask,
GimpLayer *layer) GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
@ -1650,7 +1655,7 @@ channel_layer_alpha (Channel *mask,
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* clear the mask */ /* clear the mask */
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles,
@ -1678,7 +1683,7 @@ channel_layer_alpha (Channel *mask,
} }
void void
channel_layer_mask (Channel *mask, gimp_channel_layer_mask (GimpChannel *mask,
GimpLayer *layer) GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
@ -1686,7 +1691,7 @@ channel_layer_mask (Channel *mask,
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* clear the mask */ /* clear the mask */
pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles, pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
@ -1717,7 +1722,7 @@ channel_layer_mask (Channel *mask,
} }
void void
channel_invalidate_bounds (Channel *channel) gimp_channel_invalidate_bounds (GimpChannel *channel)
{ {
channel->bounds_known = FALSE; channel->bounds_known = FALSE;
} }

View file

@ -16,8 +16,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef __CHANNEL_H__ #ifndef __GIMP_CHANNEL_H__
#define __CHANNEL_H__ #define __GIMP_CHANNEL_H__
#include "gimpdrawable.h" #include "gimpdrawable.h"
@ -26,7 +26,6 @@
/* Half way point where a region is no longer visible in a selection */ /* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127 #define HALF_WAY 127
/* structure declarations */
#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) #define GIMP_TYPE_CHANNEL (gimp_channel_get_type ())
#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) #define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel))
@ -63,21 +62,18 @@ struct _GimpChannelClass
}; };
/* Special undo types */
/* Special undo type */
typedef struct _ChannelUndo ChannelUndo; typedef struct _ChannelUndo ChannelUndo;
typedef struct _MaskUndo MaskUndo;
struct _ChannelUndo struct _ChannelUndo
{ {
Channel *channel; /* the actual channel */ GimpChannel *channel; /* the actual channel */
gint prev_position; /* former position in list */ gint prev_position; /* former position in list */
Channel *prev_channel; /* previous active channel */ GimpChannel *prev_channel; /* previous active channel */
}; };
/* Special undo type */
typedef struct _MaskUndo MaskUndo;
struct _MaskUndo struct _MaskUndo
{ {
TileManager *tiles; /* the actual mask */ TileManager *tiles; /* the actual mask */
@ -89,44 +85,44 @@ struct _MaskUndo
GtkType gimp_channel_get_type (void); GtkType gimp_channel_get_type (void);
Channel * channel_new (GimpImage *gimage, GimpChannel * gimp_channel_new (GimpImage *gimage,
gint width, gint width,
gint height, gint height,
const gchar *name, const gchar *name,
const GimpRGB *color); const GimpRGB *color);
Channel * channel_copy (const Channel *channel); GimpChannel * gimp_channel_copy (const GimpChannel *channel);
gint channel_get_opacity (const Channel *channel); gint gimp_channel_get_opacity (const GimpChannel *channel);
void channel_set_opacity (Channel *channel, void gimp_channel_set_opacity (GimpChannel *channel,
gint opacity); gint opacity);
const GimpRGB * channel_get_color (const Channel *channel); const GimpRGB * gimp_channel_get_color (const GimpChannel *channel);
void channel_set_color (Channel *channel, void gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color); const GimpRGB *color);
void channel_scale (Channel *channel, void gimp_channel_scale (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height); gint new_height);
void channel_resize (Channel *channel, void gimp_channel_resize (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height, gint new_height,
gint offx, gint offx,
gint offy); gint offy);
void channel_update (Channel *channel); void gimp_channel_update (GimpChannel *channel);
/* access functions */ /* access functions */
gboolean channel_toggle_visibility (Channel *channel); gboolean gimp_channel_toggle_visibility (GimpChannel *channel);
TempBuf * channel_preview (Channel *channel, TempBuf * gimp_channel_preview (GimpChannel *channel,
gint width, gint width,
gint height); gint height);
/* selection mask functions */ /* selection mask functions */
Channel * channel_new_mask (GimpImage *gimage, GimpChannel * gimp_channel_new_mask (GimpImage *gimage,
gint width, gint width,
gint height); gint height);
gboolean channel_boundary (Channel *mask, gboolean gimp_channel_boundary (GimpChannel *mask,
BoundSeg **segs_in, BoundSeg **segs_in,
BoundSeg **segs_out, BoundSeg **segs_out,
gint *num_segs_in, gint *num_segs_in,
@ -135,80 +131,80 @@ gboolean channel_boundary (Channel *mask,
gint y1, gint y1,
gint x2, gint x2,
gint y2); gint y2);
gboolean channel_bounds (Channel *mask, gboolean gimp_channel_bounds (GimpChannel *mask,
gint *x1, gint *x1,
gint *y1, gint *y1,
gint *x2, gint *x2,
gint *y2); gint *y2);
gint channel_value (Channel *mask, gint gimp_channel_value (GimpChannel *mask,
gint x, gint x,
gint y); gint y);
gboolean channel_is_empty (Channel *mask); gboolean gimp_channel_is_empty (GimpChannel *mask);
void channel_add_segment (Channel *mask, void gimp_channel_add_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint value); gint value);
void channel_sub_segment (Channel *mask, void gimp_channel_sub_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint value); gint value);
void channel_combine_rect (Channel *mask, void gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h); gint h);
void channel_combine_ellipse (Channel *mask, void gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h, gint h,
gboolean antialias); gboolean antialias);
void channel_combine_mask (Channel *mask, void gimp_channel_combine_mask (GimpChannel *mask,
Channel *add_on, GimpChannel *add_on,
ChannelOps op, ChannelOps op,
gint off_x, gint off_x,
gint off_y); gint off_y);
void channel_feather (Channel *input, void gimp_channel_feather (GimpChannel *input,
Channel *output, GimpChannel *output,
gdouble radius_x, gdouble radius_x,
gdouble radius_y, gdouble radius_y,
ChannelOps op, ChannelOps op,
gint off_x, gint off_x,
gint off_y); gint off_y);
void channel_push_undo (Channel *mask); void gimp_channel_push_undo (GimpChannel *mask);
void channel_clear (Channel *mask); void gimp_channel_clear (GimpChannel *mask);
void channel_invert (Channel *mask); void gimp_channel_invert (GimpChannel *mask);
void channel_sharpen (Channel *mask); void gimp_channel_sharpen (GimpChannel *mask);
void channel_all (Channel *mask); void gimp_channel_all (GimpChannel *mask);
void channel_border (Channel *mask, void gimp_channel_border (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y); gint radius_y);
void channel_grow (Channel *mask, void gimp_channel_grow (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y); gint radius_y);
void channel_shrink (Channel *mask, void gimp_channel_shrink (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y, gint radius_y,
gboolean edge_lock); gboolean edge_lock);
void channel_translate (Channel *mask, void gimp_channel_translate (GimpChannel *mask,
gint off_x, gint off_x,
gint off_y); gint off_y);
void channel_load (Channel *mask, void gimp_channel_load (GimpChannel *mask,
Channel *channel); GimpChannel *channel);
void channel_layer_alpha (Channel *mask, void gimp_channel_layer_alpha (GimpChannel *mask,
GimpLayer *layer); GimpLayer *layer);
void channel_layer_mask (Channel *mask, void gimp_channel_layer_mask (GimpChannel *mask,
GimpLayer *layer); GimpLayer *layer);
void channel_invalidate_bounds (Channel *channel); void gimp_channel_invalidate_bounds (GimpChannel *channel);
#endif /* __CHANNEL_H__ */ #endif /* __GIMP_CHANNEL_H__ */

View file

@ -569,12 +569,12 @@ duplicate (GimpImage *gimage)
GimpImage *new_gimage; GimpImage *new_gimage;
GimpLayer *layer, *new_layer; GimpLayer *layer, *new_layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
Channel *channel, *new_channel; GimpChannel *channel, *new_channel;
GSList *list; GSList *list;
GList *glist; GList *glist;
Guide *guide = NULL; Guide *guide = NULL;
GimpLayer *active_layer = NULL; GimpLayer *active_layer = NULL;
Channel *active_channel = NULL; GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL;
ParasiteList *parasites; ParasiteList *parasites;
@ -645,12 +645,12 @@ duplicate (GimpImage *gimage)
count = 0; count = 0;
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
list = g_slist_next (list); list = g_slist_next (list);
new_channel = channel_copy (channel); new_channel = gimp_channel_copy (channel);
gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage); gimp_drawable_set_gimage (GIMP_DRAWABLE (new_channel), new_gimage);
/* Make sure the copied channel doesn't say: "<old channel> copy" */ /* Make sure the copied channel doesn't say: "<old channel> copy" */
gimp_object_set_name (GIMP_OBJECT (new_channel), gimp_object_set_name (GIMP_OBJECT (new_channel),

View file

@ -81,7 +81,7 @@ struct _ChannelsDialog
gint base_type; gint base_type;
ChannelType components[3]; ChannelType components[3];
Channel *active_channel; GimpChannel *active_channel;
GimpLayer *floating_sel; GimpLayer *floating_sel;
GSList *channel_widgets; GSList *channel_widgets;
}; };
@ -100,7 +100,7 @@ struct _ChannelWidget
/* state information */ /* state information */
GimpImage *gimage; GimpImage *gimage;
Channel *channel; GimpChannel *channel;
gint width, height; gint width, height;
ChannelType type; ChannelType type;
@ -115,9 +115,9 @@ static void channels_dialog_preview_extents (void);
static void channels_dialog_set_menu_sensitivity (void); static void channels_dialog_set_menu_sensitivity (void);
static void channels_dialog_set_channel (ChannelWidget *cw); static void channels_dialog_set_channel (ChannelWidget *cw);
static void channels_dialog_unset_channel (ChannelWidget *cw); static void channels_dialog_unset_channel (ChannelWidget *cw);
static void channels_dialog_position_channel (Channel *channel, static void channels_dialog_position_channel (GimpChannel *channel,
gint position); gint position);
static void channels_dialog_add_channel (Channel *channel); static void channels_dialog_add_channel (GimpChannel *channel);
static void channels_dialog_remove_channel (ChannelWidget *cw); static void channels_dialog_remove_channel (ChannelWidget *cw);
static gint channel_list_events (GtkWidget *widget, static gint channel_list_events (GtkWidget *widget,
@ -156,9 +156,9 @@ static gboolean channels_dialog_drag_delete_channel_callback
guint time); guint time);
/* channel widget function prototypes */ /* channel widget function prototypes */
static ChannelWidget * channel_widget_get_ID (Channel *channel); static ChannelWidget * channel_widget_get_ID (GimpChannel *channel);
static ChannelWidget * channel_widget_create (GimpImage *gimage, static ChannelWidget * channel_widget_create (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
ChannelType channel_type); ChannelType channel_type);
static gboolean channel_widget_drag_motion_callback static gboolean channel_widget_drag_motion_callback
@ -441,7 +441,7 @@ channels_dialog_free (void)
void void
channels_dialog_update (GimpImage* gimage) channels_dialog_update (GimpImage* gimage)
{ {
Channel *channel; GimpChannel *channel;
ChannelWidget *cw; ChannelWidget *cw;
GSList *list; GSList *list;
GList *item_list; GList *item_list;
@ -517,9 +517,11 @@ channels_dialog_update (GimpImage* gimage)
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
/* create a channel list item */ /* create a channel list item */
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
cw = channel_widget_create (gimage, channel, AUXILLARY_CHANNEL); cw = channel_widget_create (gimage, channel, AUXILLARY_CHANNEL);
channelsD->channel_widgets = g_slist_append (channelsD->channel_widgets, cw); channelsD->channel_widgets =
g_slist_append (channelsD->channel_widgets, cw);
item_list = g_list_append (item_list, cw->list_item); item_list = g_list_append (item_list, cw->list_item);
} }
@ -532,7 +534,7 @@ void
channels_dialog_flush (void) channels_dialog_flush (void)
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *channel; GimpChannel *channel;
ChannelWidget *cw; ChannelWidget *cw;
GSList *list; GSList *list;
gint pos; gint pos;
@ -560,7 +562,7 @@ channels_dialog_flush (void)
/* Add any missing channels */ /* Add any missing channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
cw = channel_widget_get_ID (channel); cw = channel_widget_get_ID (channel);
/* If the channel isn't in the channel widget list, add it */ /* If the channel isn't in the channel widget list, add it */
@ -590,7 +592,7 @@ channels_dialog_flush (void)
pos = 0; pos = 0;
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channels_dialog_position_channel (channel, pos++); channels_dialog_position_channel (channel, pos++);
} }
@ -843,7 +845,7 @@ channels_dialog_unset_channel (ChannelWidget *channel_widget)
} }
static void static void
channels_dialog_position_channel (Channel *channel, channels_dialog_position_channel (GimpChannel *channel,
gint new_index) gint new_index)
{ {
ChannelWidget *channel_widget; ChannelWidget *channel_widget;
@ -881,7 +883,7 @@ channels_dialog_position_channel (Channel *channel,
} }
static void static void
channels_dialog_add_channel (Channel *channel) channels_dialog_add_channel (GimpChannel *channel)
{ {
ChannelWidget *channel_widget; ChannelWidget *channel_widget;
GimpImage *gimage; GimpImage *gimage;
@ -1043,15 +1045,15 @@ channels_dialog_duplicate_channel_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *active_channel; GimpChannel *active_channel;
Channel *new_channel; GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage)) if (!channelsD || !(gimage = channelsD->gimage))
return; return;
if ((active_channel = gimp_image_get_active_channel (gimage))) if ((active_channel = gimp_image_get_active_channel (gimage)))
{ {
new_channel = channel_copy (active_channel); new_channel = gimp_channel_copy (active_channel);
gimp_image_add_channel (gimage, new_channel, -1); gimp_image_add_channel (gimage, new_channel, -1);
gdisplays_flush (); gdisplays_flush ();
} }
@ -1094,16 +1096,16 @@ channels_dialog_add_channel_to_sel_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *active_channel; GimpChannel *active_channel;
Channel *new_channel; GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage)) if (!channelsD || !(gimage = channelsD->gimage))
return; return;
if ((active_channel = gimp_image_get_active_channel (gimage))) if ((active_channel = gimp_image_get_active_channel (gimage)))
{ {
new_channel = channel_copy (gimp_image_get_mask (gimage)); new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
channel_combine_mask (new_channel, gimp_channel_combine_mask (new_channel,
active_channel, active_channel,
CHANNEL_OP_ADD, CHANNEL_OP_ADD,
0, 0); /* off x/y */ 0, 0); /* off x/y */
@ -1118,16 +1120,16 @@ channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *active_channel; GimpChannel *active_channel;
Channel *new_channel; GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage)) if (!channelsD || !(gimage = channelsD->gimage))
return; return;
if ((active_channel = gimp_image_get_active_channel (gimage))) if ((active_channel = gimp_image_get_active_channel (gimage)))
{ {
new_channel = channel_copy (gimp_image_get_mask (gimage)); new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
channel_combine_mask (new_channel, gimp_channel_combine_mask (new_channel,
active_channel, active_channel,
CHANNEL_OP_SUB, CHANNEL_OP_SUB,
0, 0); /* off x/y */ 0, 0); /* off x/y */
@ -1142,16 +1144,16 @@ channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *active_channel; GimpChannel *active_channel;
Channel *new_channel; GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage)) if (!channelsD || !(gimage = channelsD->gimage))
return; return;
if ((active_channel = gimp_image_get_active_channel (gimage))) if ((active_channel = gimp_image_get_active_channel (gimage)))
{ {
new_channel = channel_copy (gimp_image_get_mask (gimage)); new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
channel_combine_mask (new_channel, gimp_channel_combine_mask (new_channel,
active_channel, active_channel,
CHANNEL_OP_INTERSECT, CHANNEL_OP_INTERSECT,
0, 0); /* off x/y */ 0, 0); /* off x/y */
@ -1199,7 +1201,7 @@ channels_dialog_drag_new_channel_callback (GtkWidget *widget,
if (src && if (src &&
src->channel == channelsD->active_channel) src->channel == channelsD->active_channel)
{ {
Channel *channel; GimpChannel *channel;
GimpImage *gimage; GimpImage *gimage;
gint width, height; gint width, height;
gint off_x, off_y; gint off_x, off_y;
@ -1213,13 +1215,13 @@ channels_dialog_drag_new_channel_callback (GtkWidget *widget,
/* Start a group undo */ /* Start a group undo */
undo_push_group_start (gimage, EDIT_PASTE_UNDO); undo_push_group_start (gimage, EDIT_PASTE_UNDO);
channel = channel_new (gimage, width, height, channel = gimp_channel_new (gimage, width, height,
_("Empty Channel Copy"), _("Empty Channel Copy"),
&src->channel->color); &src->channel->color);
if (channel) if (channel)
{ {
drawable_fill (GIMP_DRAWABLE (channel), TRANSPARENT_FILL); drawable_fill (GIMP_DRAWABLE (channel), TRANSPARENT_FILL);
channel_translate (channel, off_x, off_y); gimp_channel_translate (channel, off_x, off_y);
gimp_image_add_channel (gimage, channel, -1); gimp_image_add_channel (gimage, channel, -1);
/* End the group undo */ /* End the group undo */
@ -1340,7 +1342,7 @@ channels_dialog_drag_delete_channel_callback (GtkWidget *widget,
/******************************/ /******************************/
static ChannelWidget * static ChannelWidget *
channel_widget_get_ID (Channel *channel) channel_widget_get_ID (GimpChannel *channel)
{ {
ChannelWidget *lw; ChannelWidget *lw;
GSList *list; GSList *list;
@ -1361,7 +1363,7 @@ channel_widget_get_ID (Channel *channel)
static ChannelWidget * static ChannelWidget *
channel_widget_create (GimpImage *gimage, channel_widget_create (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
ChannelType type) ChannelType type)
{ {
ChannelWidget *channel_widget; ChannelWidget *channel_widget;
@ -1633,7 +1635,7 @@ channel_widget_drag_begin_callback (GtkWidget *widget,
typedef struct typedef struct
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *channel; GimpChannel *channel;
gint dest_index; gint dest_index;
} ChannelDrop; } ChannelDrop;
@ -1760,7 +1762,7 @@ channel_widget_drop_color (GtkWidget *widget,
gpointer data) gpointer data)
{ {
ChannelWidget *channel_widget; ChannelWidget *channel_widget;
Channel *channel; GimpChannel *channel;
channel_widget = (ChannelWidget *) data; channel_widget = (ChannelWidget *) data;
channel = channel_widget->channel; channel = channel_widget->channel;
@ -2102,7 +2104,7 @@ channel_widget_preview_redraw (ChannelWidget *channel_widget)
if (channelsD->ratio > 1.0) /* Preview is scaling up! */ if (channelsD->ratio > 1.0) /* Preview is scaling up! */
{ {
preview_buf = channel_preview (channel_widget->channel, preview_buf = gimp_channel_preview (channel_widget->channel,
channelsD->gimage_width, channelsD->gimage_width,
channelsD->gimage_height); channelsD->gimage_height);
preview_buf = gimp_preview_scale (preview_buf, preview_buf = gimp_preview_scale (preview_buf,
@ -2111,7 +2113,7 @@ channel_widget_preview_redraw (ChannelWidget *channel_widget)
} }
else else
{ {
preview_buf = channel_preview (channel_widget->channel, preview_buf = gimp_channel_preview (channel_widget->channel,
channel_widget->width, channel_widget->width,
channel_widget->height); channel_widget->height);
} }
@ -2507,7 +2509,7 @@ new_channel_query_ok_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
NewChannelOptions *options; NewChannelOptions *options;
Channel *new_channel; GimpChannel *new_channel;
GimpImage *gimage; GimpImage *gimage;
options = (NewChannelOptions *) data; options = (NewChannelOptions *) data;
@ -2520,7 +2522,7 @@ new_channel_query_ok_callback (GtkWidget *widget,
{ {
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel), gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
&channel_color); &channel_color);
new_channel = channel_new (gimage, gimage->width, gimage->height, new_channel = gimp_channel_new (gimage, gimage->width, gimage->height,
channel_name, channel_name,
&channel_color); &channel_color);
@ -2654,7 +2656,7 @@ edit_channel_query_ok_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
EditChannelOptions *options; EditChannelOptions *options;
Channel *channel; GimpChannel *channel;
GimpRGB color; GimpRGB color;
options = (EditChannelOptions *) data; options = (EditChannelOptions *) data;

View file

@ -73,6 +73,7 @@
#include "selection.h" #include "selection.h"
#include "tips_dialog.h" #include "tips_dialog.h"
#include "undo.h" #include "undo.h"
#include "undo_history.h"
#ifdef DISPLAY_FILTERS #ifdef DISPLAY_FILTERS
#include "gdisplay_color_ui.h" #include "gdisplay_color_ui.h"

View file

@ -351,7 +351,7 @@ edit_paste (GimpImage *gimage,
* it seems like the correct behavior. * it seems like the correct behavior.
*/ */
if (! gimage_mask_is_empty (gimage) && !paste_into) if (! gimage_mask_is_empty (gimage) && !paste_into)
channel_clear (gimp_image_get_mask (gimage)); gimp_channel_clear (gimp_image_get_mask (gimage));
/* if there's a drawable, add a new floating selection */ /* if there's a drawable, add a new floating selection */
if (drawable != NULL) if (drawable != NULL)

View file

@ -54,7 +54,7 @@ static void gimp_channel_class_init (GimpChannelClass *klass);
static void gimp_channel_init (GimpChannel *channel); static void gimp_channel_init (GimpChannel *channel);
static void gimp_channel_destroy (GtkObject *object); static void gimp_channel_destroy (GtkObject *object);
static TempBuf * channel_preview_private (Channel *channel, static TempBuf * gimp_channel_preview_private (GimpChannel *channel,
gint width, gint width,
gint height); gint height);
@ -109,7 +109,7 @@ gimp_channel_init (GimpChannel *channel)
/**************************/ /**************************/
static void static void
channel_validate (TileManager *tm, gimp_channel_validate (TileManager *tm,
Tile *tile) Tile *tile)
{ {
/* Set the contents of the tile to empty */ /* Set the contents of the tile to empty */
@ -117,14 +117,14 @@ channel_validate (TileManager *tm,
TRANSPARENT_OPACITY, tile_size (tile)); TRANSPARENT_OPACITY, tile_size (tile));
} }
Channel * GimpChannel *
channel_new (GimpImage *gimage, gimp_channel_new (GimpImage *gimage,
gint width, gint width,
gint height, gint height,
const gchar *name, const gchar *name,
const GimpRGB *color) const GimpRGB *color)
{ {
Channel *channel; GimpChannel *channel;
g_return_val_if_fail (color != NULL, NULL); g_return_val_if_fail (color != NULL, NULL);
@ -154,11 +154,11 @@ channel_new (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
channel_copy (const Channel *channel) gimp_channel_copy (const GimpChannel *channel)
{ {
gchar *channel_name; gchar *channel_name;
Channel *new_channel; GimpChannel *new_channel;
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
gchar *ext; gchar *ext;
gint number; gint number;
@ -180,7 +180,7 @@ channel_copy (const Channel *channel)
channel_name = g_strdup_printf (_("%s copy"), name); channel_name = g_strdup_printf (_("%s copy"), name);
/* allocate a new channel object */ /* allocate a new channel object */
new_channel = channel_new (GIMP_DRAWABLE (channel)->gimage, new_channel = gimp_channel_new (GIMP_DRAWABLE (channel)->gimage,
GIMP_DRAWABLE (channel)->width, GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height, GIMP_DRAWABLE (channel)->height,
channel_name, channel_name,
@ -209,7 +209,7 @@ channel_copy (const Channel *channel)
} }
void void
channel_set_color (Channel *channel, gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color) const GimpRGB *color)
{ {
g_return_if_fail (channel != NULL); g_return_if_fail (channel != NULL);
@ -220,7 +220,7 @@ channel_set_color (Channel *channel,
} }
const GimpRGB * const GimpRGB *
channel_get_color (const Channel *channel) gimp_channel_get_color (const GimpChannel *channel)
{ {
g_return_val_if_fail (channel != NULL, NULL); g_return_val_if_fail (channel != NULL, NULL);
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), NULL); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), NULL);
@ -229,7 +229,7 @@ channel_get_color (const Channel *channel)
} }
gint gint
channel_get_opacity (const Channel *channel) gimp_channel_get_opacity (const GimpChannel *channel)
{ {
g_return_val_if_fail (channel != NULL, 0); g_return_val_if_fail (channel != NULL, 0);
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0);
@ -238,7 +238,7 @@ channel_get_opacity (const Channel *channel)
} }
void void
channel_set_opacity (Channel *channel, gimp_channel_set_opacity (GimpChannel *channel,
gint opacity) gint opacity)
{ {
g_return_if_fail (channel != NULL); g_return_if_fail (channel != NULL);
@ -270,7 +270,7 @@ gimp_channel_destroy (GtkObject *object)
} }
void void
channel_scale (Channel *channel, gimp_channel_scale (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height) gint new_height)
{ {
@ -318,7 +318,7 @@ channel_scale (Channel *channel,
} }
void void
channel_resize (Channel *channel, gimp_channel_resize (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height, gint new_height,
gint offx, gint offx,
@ -415,7 +415,7 @@ channel_resize (Channel *channel,
} }
void void
channel_update (Channel *channel) gimp_channel_update (GimpChannel *channel)
{ {
drawable_update (GIMP_DRAWABLE (channel), drawable_update (GIMP_DRAWABLE (channel),
0, 0, 0, 0,
@ -429,7 +429,7 @@ channel_update (Channel *channel)
/**********************/ /**********************/
gboolean gboolean
channel_toggle_visibility (Channel *channel) gimp_channel_toggle_visibility (GimpChannel *channel)
{ {
GIMP_DRAWABLE (channel)->visible = !GIMP_DRAWABLE (channel)->visible; GIMP_DRAWABLE (channel)->visible = !GIMP_DRAWABLE (channel)->visible;
@ -437,7 +437,7 @@ channel_toggle_visibility (Channel *channel)
} }
TempBuf * TempBuf *
channel_preview (Channel *channel, gimp_channel_preview (GimpChannel *channel,
gint width, gint width,
gint height) gint height)
{ {
@ -449,7 +449,7 @@ channel_preview (Channel *channel,
GIMP_DRAWABLE (channel)->gimage->width > PREVIEW_CACHE_PRIME_WIDTH && GIMP_DRAWABLE (channel)->gimage->width > PREVIEW_CACHE_PRIME_WIDTH &&
GIMP_DRAWABLE (channel)->gimage->height > PREVIEW_CACHE_PRIME_HEIGHT) GIMP_DRAWABLE (channel)->gimage->height > PREVIEW_CACHE_PRIME_HEIGHT)
{ {
TempBuf * tb = channel_preview_private (channel, TempBuf * tb = gimp_channel_preview_private (channel,
PREVIEW_CACHE_PRIME_WIDTH, PREVIEW_CACHE_PRIME_WIDTH,
PREVIEW_CACHE_PRIME_HEIGHT); PREVIEW_CACHE_PRIME_HEIGHT);
@ -460,11 +460,11 @@ channel_preview (Channel *channel,
} }
/* Second call - should NOT visit the tile cache... */ /* Second call - should NOT visit the tile cache... */
return channel_preview_private (channel, width, height); return gimp_channel_preview_private (channel, width, height);
} }
static TempBuf * static TempBuf *
channel_preview_private (Channel *channel, gimp_channel_preview_private (GimpChannel *channel,
gint width, gint width,
gint height) gint height)
{ {
@ -526,27 +526,27 @@ channel_preview_private (Channel *channel,
/* selection mask functions */ /* selection mask functions */
/******************************/ /******************************/
Channel * GimpChannel *
channel_new_mask (GimpImage *gimage, gimp_channel_new_mask (GimpImage *gimage,
gint width, gint width,
gint height) gint height)
{ {
GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; GimpRGB black = { 0.0, 0.0, 0.0, 0.5 };
Channel *new_channel; GimpChannel *new_channel;
/* Create the new channel */ /* Create the new channel */
new_channel = channel_new (gimage, width, height, new_channel = gimp_channel_new (gimage, width, height,
_("Selection Mask"), &black); _("Selection Mask"), &black);
/* Set the validate procedure */ /* Set the validate procedure */
tile_manager_set_validate_proc (GIMP_DRAWABLE (new_channel)->tiles, tile_manager_set_validate_proc (GIMP_DRAWABLE (new_channel)->tiles,
channel_validate); gimp_channel_validate);
return new_channel; return new_channel;
} }
gboolean gboolean
channel_boundary (Channel *mask, gimp_channel_boundary (GimpChannel *mask,
BoundSeg **segs_in, BoundSeg **segs_in,
BoundSeg **segs_out, BoundSeg **segs_out,
gint *num_segs_in, gint *num_segs_in,
@ -567,7 +567,7 @@ channel_boundary (Channel *mask,
if (mask->segs_out) if (mask->segs_out)
g_free (mask->segs_out); g_free (mask->segs_out);
if (channel_bounds (mask, &x3, &y3, &x4, &y4)) if (gimp_channel_bounds (mask, &x3, &y3, &x4, &y4))
{ {
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles,
x3, y3, (x4 - x3), (y4 - y3), FALSE); x3, y3, (x4 - x3), (y4 - y3), FALSE);
@ -616,7 +616,7 @@ channel_boundary (Channel *mask,
} }
gint gint
channel_value (Channel *mask, gimp_channel_value (GimpChannel *mask,
gint x, gint x,
gint y) gint y)
{ {
@ -646,7 +646,7 @@ channel_value (Channel *mask,
} }
gboolean gboolean
channel_bounds (Channel *mask, gimp_channel_bounds (GimpChannel *mask,
gint *x1, gint *x1,
gint *y1, gint *y1,
gint *x2, gint *x2,
@ -760,7 +760,7 @@ channel_bounds (Channel *mask,
} }
gboolean gboolean
channel_is_empty (Channel *mask) gimp_channel_is_empty (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
guchar *data; guchar *data;
@ -811,7 +811,7 @@ channel_is_empty (Channel *mask)
} }
void void
channel_add_segment (Channel *mask, gimp_channel_add_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
@ -854,7 +854,7 @@ channel_add_segment (Channel *mask,
} }
void void
channel_sub_segment (Channel *mask, gimp_channel_sub_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
@ -896,7 +896,7 @@ channel_sub_segment (Channel *mask,
} }
void void
channel_combine_rect (Channel *mask, gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
@ -956,7 +956,7 @@ channel_combine_rect (Channel *mask,
} }
void void
channel_combine_ellipse (Channel *mask, gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
@ -1002,10 +1002,10 @@ channel_combine_ellipse (Channel *mask,
{ {
case CHANNEL_OP_ADD: case CHANNEL_OP_ADD:
case CHANNEL_OP_REPLACE: case CHANNEL_OP_REPLACE:
channel_add_segment (mask, x1, i, (x2 - x1), 255); gimp_channel_add_segment (mask, x1, i, (x2 - x1), 255);
break; break;
case CHANNEL_OP_SUB: case CHANNEL_OP_SUB:
channel_sub_segment (mask, x1, i, (x2 - x1), 255); gimp_channel_sub_segment (mask, x1, i, (x2 - x1), 255);
break; break;
default: default:
g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!");
@ -1046,10 +1046,10 @@ channel_combine_ellipse (Channel *mask,
{ {
case CHANNEL_OP_ADD: case CHANNEL_OP_ADD:
case CHANNEL_OP_REPLACE: case CHANNEL_OP_REPLACE:
channel_add_segment (mask, x0, i, j - x0, last); gimp_channel_add_segment (mask, x0, i, j - x0, last);
break; break;
case CHANNEL_OP_SUB: case CHANNEL_OP_SUB:
channel_sub_segment (mask, x0, i, j - x0, last); gimp_channel_sub_segment (mask, x0, i, j - x0, last);
break; break;
default: default:
g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!");
@ -1071,9 +1071,9 @@ channel_combine_ellipse (Channel *mask,
if (last) if (last)
{ {
if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE)
channel_add_segment (mask, x0, i, j - x0, last); gimp_channel_add_segment (mask, x0, i, j - x0, last);
else if (op == CHANNEL_OP_SUB) else if (op == CHANNEL_OP_SUB)
channel_sub_segment (mask, x0, i, j - x0, last); gimp_channel_sub_segment (mask, x0, i, j - x0, last);
else else
g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!");
} }
@ -1112,7 +1112,7 @@ channel_combine_ellipse (Channel *mask,
} }
static void static void
channel_combine_sub_region_add (void *unused, gimp_channel_combine_sub_region_add (void *unused,
PixelRegion *srcPR, PixelRegion *srcPR,
PixelRegion *destPR) PixelRegion *destPR)
{ {
@ -1138,7 +1138,7 @@ channel_combine_sub_region_add (void *unused,
} }
static void static void
channel_combine_sub_region_sub (void *unused, gimp_channel_combine_sub_region_sub (void *unused,
PixelRegion *srcPR, PixelRegion *srcPR,
PixelRegion *destPR) PixelRegion *destPR)
{ {
@ -1163,7 +1163,7 @@ channel_combine_sub_region_sub (void *unused,
} }
static void static void
channel_combine_sub_region_intersect (void *unused, gimp_channel_combine_sub_region_intersect (void *unused,
PixelRegion *srcPR, PixelRegion *srcPR,
PixelRegion *destPR) PixelRegion *destPR)
{ {
@ -1185,8 +1185,8 @@ channel_combine_sub_region_intersect (void *unused,
} }
void void
channel_combine_mask (Channel *mask, gimp_channel_combine_mask (GimpChannel *mask,
Channel *add_on, GimpChannel *add_on,
ChannelOps op, ChannelOps op,
gint off_x, gint off_x,
gint off_y) gint off_y)
@ -1213,28 +1213,31 @@ channel_combine_mask (Channel *mask,
{ {
case CHANNEL_OP_ADD: case CHANNEL_OP_ADD:
case CHANNEL_OP_REPLACE: case CHANNEL_OP_REPLACE:
pixel_regions_process_parallel ((p_func) channel_combine_sub_region_add, pixel_regions_process_parallel ((p_func)
gimp_channel_combine_sub_region_add,
NULL, 2, &srcPR, &destPR); NULL, 2, &srcPR, &destPR);
break; break;
case CHANNEL_OP_SUB: case CHANNEL_OP_SUB:
pixel_regions_process_parallel ((p_func) channel_combine_sub_region_sub, pixel_regions_process_parallel ((p_func)
gimp_channel_combine_sub_region_sub,
NULL, 2, &srcPR, &destPR); NULL, 2, &srcPR, &destPR);
break; break;
case CHANNEL_OP_INTERSECT: case CHANNEL_OP_INTERSECT:
pixel_regions_process_parallel ((p_func) pixel_regions_process_parallel ((p_func)
channel_combine_sub_region_intersect, gimp_channel_combine_sub_region_intersect,
NULL, 2, &srcPR, &destPR); NULL, 2, &srcPR, &destPR);
break; break;
default: default:
g_message ("Error: unknown opperation type in channel_combine_mask\n"); g_message ("Error: unknown opperation type in channel_combine_mask\n");
break; break;
} }
mask->bounds_known = FALSE; mask->bounds_known = FALSE;
} }
void void
channel_feather (Channel *input, gimp_channel_feather (GimpChannel *input,
Channel *output, GimpChannel *output,
gdouble radius_x, gdouble radius_x,
gdouble radius_y, gdouble radius_y,
ChannelOps op, ChannelOps op,
@ -1256,13 +1259,13 @@ channel_feather (Channel *input,
gaussian_blur_region (&srcPR, radius_x, radius_y); gaussian_blur_region (&srcPR, radius_x, radius_y);
if (input != output) if (input != output)
channel_combine_mask (output, input, op, 0, 0); gimp_channel_combine_mask (output, input, op, 0, 0);
output->bounds_known = FALSE; output->bounds_known = FALSE;
} }
void void
channel_push_undo (Channel *mask) gimp_channel_push_undo (GimpChannel *mask)
{ {
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
MaskUndo *mask_undo; MaskUndo *mask_undo;
@ -1271,7 +1274,7 @@ channel_push_undo (Channel *mask)
GImage *gimage; GImage *gimage;
mask_undo = g_new (MaskUndo, 1); mask_undo = g_new (MaskUndo, 1);
if (channel_bounds (mask, &x1, &y1, &x2, &y2)) if (gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
{ {
undo_tiles = tile_manager_new ((x2 - x1), (y2 - y1), 1); undo_tiles = tile_manager_new ((x2 - x1), (y2 - y1), 1);
pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles,
@ -1296,13 +1299,13 @@ channel_push_undo (Channel *mask)
} }
void void
channel_clear (Channel *mask) gimp_channel_clear (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
guchar bg = 0; guchar bg = 0;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
if (mask->bounds_known && !mask->empty) if (mask->bounds_known && !mask->empty)
{ {
@ -1331,13 +1334,13 @@ channel_clear (Channel *mask)
} }
void void
channel_invert (Channel *mask) gimp_channel_invert (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
GimpLut *lut; GimpLut *lut;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
0, 0, 0, 0,
@ -1353,13 +1356,13 @@ channel_invert (Channel *mask)
} }
void void
channel_sharpen (Channel *mask) gimp_channel_sharpen (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
GimpLut *lut; GimpLut *lut;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
0, 0, 0, 0,
@ -1373,13 +1376,13 @@ channel_sharpen (Channel *mask)
} }
void void
channel_all (Channel *mask) gimp_channel_all (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
guchar bg = 255; guchar bg = 255;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* clear the mask */ /* clear the mask */
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
@ -1398,7 +1401,7 @@ channel_all (Channel *mask)
} }
void void
channel_border (Channel *mask, gimp_channel_border (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y) gint radius_y)
{ {
@ -1408,9 +1411,9 @@ channel_border (Channel *mask,
if (radius_x < 0 || radius_y < 0) if (radius_x < 0 || radius_y < 0)
return; return;
if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return; return;
if (channel_is_empty (mask)) if (gimp_channel_is_empty (mask))
return; return;
if (x1 - radius_x < 0) if (x1 - radius_x < 0)
@ -1430,8 +1433,9 @@ channel_border (Channel *mask,
y2 = GIMP_DRAWABLE (mask)->height; y2 = GIMP_DRAWABLE (mask)->height;
else else
y2 += radius_y; y2 += radius_y;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1,
(x2-x1), (y2-y1), TRUE); (x2-x1), (y2-y1), TRUE);
@ -1442,7 +1446,7 @@ channel_border (Channel *mask,
} }
void void
channel_grow (Channel *mask, gimp_channel_grow (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y) gint radius_y)
{ {
@ -1454,16 +1458,16 @@ channel_grow (Channel *mask,
if (radius_x <= 0 && radius_y <= 0) if (radius_x <= 0 && radius_y <= 0)
{ {
channel_shrink (mask, -radius_x, -radius_y, FALSE); gimp_channel_shrink (mask, -radius_x, -radius_y, FALSE);
return; return;
} }
if (radius_x < 0 || radius_y < 0) if (radius_x < 0 || radius_y < 0)
return; return;
if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return; return;
if (channel_is_empty (mask)) if (gimp_channel_is_empty (mask))
return; return;
if (x1 - radius_x > 0) if (x1 - radius_x > 0)
@ -1484,7 +1488,7 @@ channel_grow (Channel *mask,
y2 = GIMP_DRAWABLE (mask)->height; y2 = GIMP_DRAWABLE (mask)->height;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* need full extents for grow, not! */ /* need full extents for grow, not! */
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1),
@ -1496,7 +1500,7 @@ channel_grow (Channel *mask,
} }
void void
channel_shrink (Channel *mask, gimp_channel_shrink (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y, gint radius_y,
gboolean edge_lock) gboolean edge_lock)
@ -1509,16 +1513,16 @@ channel_shrink (Channel *mask,
if (radius_x <= 0 && radius_y <= 0) if (radius_x <= 0 && radius_y <= 0)
{ {
channel_grow (mask, -radius_x, -radius_y); gimp_channel_grow (mask, -radius_x, -radius_y);
return; return;
} }
if (radius_x < 0 || radius_y < 0) if (radius_x < 0 || radius_y < 0)
return; return;
if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return; return;
if (channel_is_empty (mask)) if (gimp_channel_is_empty (mask))
return; return;
if (x1 > 0) if (x1 > 0)
@ -1531,7 +1535,7 @@ channel_shrink (Channel *mask,
y2++; y2++;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1),
(y2 - y1), TRUE); (y2 - y1), TRUE);
@ -1542,12 +1546,12 @@ channel_shrink (Channel *mask,
} }
void void
channel_translate (Channel *mask, gimp_channel_translate (GimpChannel *mask,
gint off_x, gint off_x,
gint off_y) gint off_y)
{ {
gint width, height; gint width, height;
Channel *tmp_mask; GimpChannel *tmp_mask;
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
guchar empty = 0; guchar empty = 0;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
@ -1555,9 +1559,9 @@ channel_translate (Channel *mask,
tmp_mask = NULL; tmp_mask = NULL;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
channel_bounds (mask, &x1, &y1, &x2, &y2); gimp_channel_bounds (mask, &x1, &y1, &x2, &y2);
x1 = CLAMP ((x1 + off_x), 0, GIMP_DRAWABLE (mask)->width); x1 = CLAMP ((x1 + off_x), 0, GIMP_DRAWABLE (mask)->width);
y1 = CLAMP ((y1 + off_y), 0, GIMP_DRAWABLE (mask)->height); y1 = CLAMP ((y1 + off_y), 0, GIMP_DRAWABLE (mask)->height);
x2 = CLAMP ((x2 + off_x), 0, GIMP_DRAWABLE (mask)->width); x2 = CLAMP ((x2 + off_x), 0, GIMP_DRAWABLE (mask)->width);
@ -1572,7 +1576,8 @@ channel_translate (Channel *mask,
/* copy the portion of the mask we will keep to a /* copy the portion of the mask we will keep to a
* temporary buffer * temporary buffer
*/ */
tmp_mask = channel_new_mask (GIMP_DRAWABLE (mask)->gimage, width, height); tmp_mask = gimp_channel_new_mask (GIMP_DRAWABLE (mask)->gimage,
width, height);
pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles,
x1 - off_x, y1 - off_y, width, height, FALSE); x1 - off_x, y1 - off_y, width, height, FALSE);
@ -1619,13 +1624,13 @@ channel_translate (Channel *mask,
} }
void void
channel_load (Channel *mask, gimp_channel_load (GimpChannel *mask,
Channel *channel) GimpChannel *channel)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* copy the channel to the mask */ /* copy the channel to the mask */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
@ -1642,7 +1647,7 @@ channel_load (Channel *mask,
} }
void void
channel_layer_alpha (Channel *mask, gimp_channel_layer_alpha (GimpChannel *mask,
GimpLayer *layer) GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
@ -1650,7 +1655,7 @@ channel_layer_alpha (Channel *mask,
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* clear the mask */ /* clear the mask */
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles,
@ -1678,7 +1683,7 @@ channel_layer_alpha (Channel *mask,
} }
void void
channel_layer_mask (Channel *mask, gimp_channel_layer_mask (GimpChannel *mask,
GimpLayer *layer) GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
@ -1686,7 +1691,7 @@ channel_layer_mask (Channel *mask,
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* clear the mask */ /* clear the mask */
pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles, pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
@ -1717,7 +1722,7 @@ channel_layer_mask (Channel *mask,
} }
void void
channel_invalidate_bounds (Channel *channel) gimp_channel_invalidate_bounds (GimpChannel *channel)
{ {
channel->bounds_known = FALSE; channel->bounds_known = FALSE;
} }

View file

@ -16,8 +16,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef __CHANNEL_H__ #ifndef __GIMP_CHANNEL_H__
#define __CHANNEL_H__ #define __GIMP_CHANNEL_H__
#include "gimpdrawable.h" #include "gimpdrawable.h"
@ -26,7 +26,6 @@
/* Half way point where a region is no longer visible in a selection */ /* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127 #define HALF_WAY 127
/* structure declarations */
#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) #define GIMP_TYPE_CHANNEL (gimp_channel_get_type ())
#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) #define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel))
@ -63,21 +62,18 @@ struct _GimpChannelClass
}; };
/* Special undo types */
/* Special undo type */
typedef struct _ChannelUndo ChannelUndo; typedef struct _ChannelUndo ChannelUndo;
typedef struct _MaskUndo MaskUndo;
struct _ChannelUndo struct _ChannelUndo
{ {
Channel *channel; /* the actual channel */ GimpChannel *channel; /* the actual channel */
gint prev_position; /* former position in list */ gint prev_position; /* former position in list */
Channel *prev_channel; /* previous active channel */ GimpChannel *prev_channel; /* previous active channel */
}; };
/* Special undo type */
typedef struct _MaskUndo MaskUndo;
struct _MaskUndo struct _MaskUndo
{ {
TileManager *tiles; /* the actual mask */ TileManager *tiles; /* the actual mask */
@ -89,44 +85,44 @@ struct _MaskUndo
GtkType gimp_channel_get_type (void); GtkType gimp_channel_get_type (void);
Channel * channel_new (GimpImage *gimage, GimpChannel * gimp_channel_new (GimpImage *gimage,
gint width, gint width,
gint height, gint height,
const gchar *name, const gchar *name,
const GimpRGB *color); const GimpRGB *color);
Channel * channel_copy (const Channel *channel); GimpChannel * gimp_channel_copy (const GimpChannel *channel);
gint channel_get_opacity (const Channel *channel); gint gimp_channel_get_opacity (const GimpChannel *channel);
void channel_set_opacity (Channel *channel, void gimp_channel_set_opacity (GimpChannel *channel,
gint opacity); gint opacity);
const GimpRGB * channel_get_color (const Channel *channel); const GimpRGB * gimp_channel_get_color (const GimpChannel *channel);
void channel_set_color (Channel *channel, void gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color); const GimpRGB *color);
void channel_scale (Channel *channel, void gimp_channel_scale (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height); gint new_height);
void channel_resize (Channel *channel, void gimp_channel_resize (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height, gint new_height,
gint offx, gint offx,
gint offy); gint offy);
void channel_update (Channel *channel); void gimp_channel_update (GimpChannel *channel);
/* access functions */ /* access functions */
gboolean channel_toggle_visibility (Channel *channel); gboolean gimp_channel_toggle_visibility (GimpChannel *channel);
TempBuf * channel_preview (Channel *channel, TempBuf * gimp_channel_preview (GimpChannel *channel,
gint width, gint width,
gint height); gint height);
/* selection mask functions */ /* selection mask functions */
Channel * channel_new_mask (GimpImage *gimage, GimpChannel * gimp_channel_new_mask (GimpImage *gimage,
gint width, gint width,
gint height); gint height);
gboolean channel_boundary (Channel *mask, gboolean gimp_channel_boundary (GimpChannel *mask,
BoundSeg **segs_in, BoundSeg **segs_in,
BoundSeg **segs_out, BoundSeg **segs_out,
gint *num_segs_in, gint *num_segs_in,
@ -135,80 +131,80 @@ gboolean channel_boundary (Channel *mask,
gint y1, gint y1,
gint x2, gint x2,
gint y2); gint y2);
gboolean channel_bounds (Channel *mask, gboolean gimp_channel_bounds (GimpChannel *mask,
gint *x1, gint *x1,
gint *y1, gint *y1,
gint *x2, gint *x2,
gint *y2); gint *y2);
gint channel_value (Channel *mask, gint gimp_channel_value (GimpChannel *mask,
gint x, gint x,
gint y); gint y);
gboolean channel_is_empty (Channel *mask); gboolean gimp_channel_is_empty (GimpChannel *mask);
void channel_add_segment (Channel *mask, void gimp_channel_add_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint value); gint value);
void channel_sub_segment (Channel *mask, void gimp_channel_sub_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint value); gint value);
void channel_combine_rect (Channel *mask, void gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h); gint h);
void channel_combine_ellipse (Channel *mask, void gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h, gint h,
gboolean antialias); gboolean antialias);
void channel_combine_mask (Channel *mask, void gimp_channel_combine_mask (GimpChannel *mask,
Channel *add_on, GimpChannel *add_on,
ChannelOps op, ChannelOps op,
gint off_x, gint off_x,
gint off_y); gint off_y);
void channel_feather (Channel *input, void gimp_channel_feather (GimpChannel *input,
Channel *output, GimpChannel *output,
gdouble radius_x, gdouble radius_x,
gdouble radius_y, gdouble radius_y,
ChannelOps op, ChannelOps op,
gint off_x, gint off_x,
gint off_y); gint off_y);
void channel_push_undo (Channel *mask); void gimp_channel_push_undo (GimpChannel *mask);
void channel_clear (Channel *mask); void gimp_channel_clear (GimpChannel *mask);
void channel_invert (Channel *mask); void gimp_channel_invert (GimpChannel *mask);
void channel_sharpen (Channel *mask); void gimp_channel_sharpen (GimpChannel *mask);
void channel_all (Channel *mask); void gimp_channel_all (GimpChannel *mask);
void channel_border (Channel *mask, void gimp_channel_border (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y); gint radius_y);
void channel_grow (Channel *mask, void gimp_channel_grow (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y); gint radius_y);
void channel_shrink (Channel *mask, void gimp_channel_shrink (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y, gint radius_y,
gboolean edge_lock); gboolean edge_lock);
void channel_translate (Channel *mask, void gimp_channel_translate (GimpChannel *mask,
gint off_x, gint off_x,
gint off_y); gint off_y);
void channel_load (Channel *mask, void gimp_channel_load (GimpChannel *mask,
Channel *channel); GimpChannel *channel);
void channel_layer_alpha (Channel *mask, void gimp_channel_layer_alpha (GimpChannel *mask,
GimpLayer *layer); GimpLayer *layer);
void channel_layer_mask (Channel *mask, void gimp_channel_layer_mask (GimpChannel *mask,
GimpLayer *layer); GimpLayer *layer);
void channel_invalidate_bounds (Channel *channel); void gimp_channel_invalidate_bounds (GimpChannel *channel);
#endif /* __CHANNEL_H__ */ #endif /* __GIMP_CHANNEL_H__ */

View file

@ -54,7 +54,7 @@ static void gimp_channel_class_init (GimpChannelClass *klass);
static void gimp_channel_init (GimpChannel *channel); static void gimp_channel_init (GimpChannel *channel);
static void gimp_channel_destroy (GtkObject *object); static void gimp_channel_destroy (GtkObject *object);
static TempBuf * channel_preview_private (Channel *channel, static TempBuf * gimp_channel_preview_private (GimpChannel *channel,
gint width, gint width,
gint height); gint height);
@ -109,7 +109,7 @@ gimp_channel_init (GimpChannel *channel)
/**************************/ /**************************/
static void static void
channel_validate (TileManager *tm, gimp_channel_validate (TileManager *tm,
Tile *tile) Tile *tile)
{ {
/* Set the contents of the tile to empty */ /* Set the contents of the tile to empty */
@ -117,14 +117,14 @@ channel_validate (TileManager *tm,
TRANSPARENT_OPACITY, tile_size (tile)); TRANSPARENT_OPACITY, tile_size (tile));
} }
Channel * GimpChannel *
channel_new (GimpImage *gimage, gimp_channel_new (GimpImage *gimage,
gint width, gint width,
gint height, gint height,
const gchar *name, const gchar *name,
const GimpRGB *color) const GimpRGB *color)
{ {
Channel *channel; GimpChannel *channel;
g_return_val_if_fail (color != NULL, NULL); g_return_val_if_fail (color != NULL, NULL);
@ -154,11 +154,11 @@ channel_new (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
channel_copy (const Channel *channel) gimp_channel_copy (const GimpChannel *channel)
{ {
gchar *channel_name; gchar *channel_name;
Channel *new_channel; GimpChannel *new_channel;
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
gchar *ext; gchar *ext;
gint number; gint number;
@ -180,7 +180,7 @@ channel_copy (const Channel *channel)
channel_name = g_strdup_printf (_("%s copy"), name); channel_name = g_strdup_printf (_("%s copy"), name);
/* allocate a new channel object */ /* allocate a new channel object */
new_channel = channel_new (GIMP_DRAWABLE (channel)->gimage, new_channel = gimp_channel_new (GIMP_DRAWABLE (channel)->gimage,
GIMP_DRAWABLE (channel)->width, GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height, GIMP_DRAWABLE (channel)->height,
channel_name, channel_name,
@ -209,7 +209,7 @@ channel_copy (const Channel *channel)
} }
void void
channel_set_color (Channel *channel, gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color) const GimpRGB *color)
{ {
g_return_if_fail (channel != NULL); g_return_if_fail (channel != NULL);
@ -220,7 +220,7 @@ channel_set_color (Channel *channel,
} }
const GimpRGB * const GimpRGB *
channel_get_color (const Channel *channel) gimp_channel_get_color (const GimpChannel *channel)
{ {
g_return_val_if_fail (channel != NULL, NULL); g_return_val_if_fail (channel != NULL, NULL);
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), NULL); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), NULL);
@ -229,7 +229,7 @@ channel_get_color (const Channel *channel)
} }
gint gint
channel_get_opacity (const Channel *channel) gimp_channel_get_opacity (const GimpChannel *channel)
{ {
g_return_val_if_fail (channel != NULL, 0); g_return_val_if_fail (channel != NULL, 0);
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0);
@ -238,7 +238,7 @@ channel_get_opacity (const Channel *channel)
} }
void void
channel_set_opacity (Channel *channel, gimp_channel_set_opacity (GimpChannel *channel,
gint opacity) gint opacity)
{ {
g_return_if_fail (channel != NULL); g_return_if_fail (channel != NULL);
@ -270,7 +270,7 @@ gimp_channel_destroy (GtkObject *object)
} }
void void
channel_scale (Channel *channel, gimp_channel_scale (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height) gint new_height)
{ {
@ -318,7 +318,7 @@ channel_scale (Channel *channel,
} }
void void
channel_resize (Channel *channel, gimp_channel_resize (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height, gint new_height,
gint offx, gint offx,
@ -415,7 +415,7 @@ channel_resize (Channel *channel,
} }
void void
channel_update (Channel *channel) gimp_channel_update (GimpChannel *channel)
{ {
drawable_update (GIMP_DRAWABLE (channel), drawable_update (GIMP_DRAWABLE (channel),
0, 0, 0, 0,
@ -429,7 +429,7 @@ channel_update (Channel *channel)
/**********************/ /**********************/
gboolean gboolean
channel_toggle_visibility (Channel *channel) gimp_channel_toggle_visibility (GimpChannel *channel)
{ {
GIMP_DRAWABLE (channel)->visible = !GIMP_DRAWABLE (channel)->visible; GIMP_DRAWABLE (channel)->visible = !GIMP_DRAWABLE (channel)->visible;
@ -437,7 +437,7 @@ channel_toggle_visibility (Channel *channel)
} }
TempBuf * TempBuf *
channel_preview (Channel *channel, gimp_channel_preview (GimpChannel *channel,
gint width, gint width,
gint height) gint height)
{ {
@ -449,7 +449,7 @@ channel_preview (Channel *channel,
GIMP_DRAWABLE (channel)->gimage->width > PREVIEW_CACHE_PRIME_WIDTH && GIMP_DRAWABLE (channel)->gimage->width > PREVIEW_CACHE_PRIME_WIDTH &&
GIMP_DRAWABLE (channel)->gimage->height > PREVIEW_CACHE_PRIME_HEIGHT) GIMP_DRAWABLE (channel)->gimage->height > PREVIEW_CACHE_PRIME_HEIGHT)
{ {
TempBuf * tb = channel_preview_private (channel, TempBuf * tb = gimp_channel_preview_private (channel,
PREVIEW_CACHE_PRIME_WIDTH, PREVIEW_CACHE_PRIME_WIDTH,
PREVIEW_CACHE_PRIME_HEIGHT); PREVIEW_CACHE_PRIME_HEIGHT);
@ -460,11 +460,11 @@ channel_preview (Channel *channel,
} }
/* Second call - should NOT visit the tile cache... */ /* Second call - should NOT visit the tile cache... */
return channel_preview_private (channel, width, height); return gimp_channel_preview_private (channel, width, height);
} }
static TempBuf * static TempBuf *
channel_preview_private (Channel *channel, gimp_channel_preview_private (GimpChannel *channel,
gint width, gint width,
gint height) gint height)
{ {
@ -526,27 +526,27 @@ channel_preview_private (Channel *channel,
/* selection mask functions */ /* selection mask functions */
/******************************/ /******************************/
Channel * GimpChannel *
channel_new_mask (GimpImage *gimage, gimp_channel_new_mask (GimpImage *gimage,
gint width, gint width,
gint height) gint height)
{ {
GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; GimpRGB black = { 0.0, 0.0, 0.0, 0.5 };
Channel *new_channel; GimpChannel *new_channel;
/* Create the new channel */ /* Create the new channel */
new_channel = channel_new (gimage, width, height, new_channel = gimp_channel_new (gimage, width, height,
_("Selection Mask"), &black); _("Selection Mask"), &black);
/* Set the validate procedure */ /* Set the validate procedure */
tile_manager_set_validate_proc (GIMP_DRAWABLE (new_channel)->tiles, tile_manager_set_validate_proc (GIMP_DRAWABLE (new_channel)->tiles,
channel_validate); gimp_channel_validate);
return new_channel; return new_channel;
} }
gboolean gboolean
channel_boundary (Channel *mask, gimp_channel_boundary (GimpChannel *mask,
BoundSeg **segs_in, BoundSeg **segs_in,
BoundSeg **segs_out, BoundSeg **segs_out,
gint *num_segs_in, gint *num_segs_in,
@ -567,7 +567,7 @@ channel_boundary (Channel *mask,
if (mask->segs_out) if (mask->segs_out)
g_free (mask->segs_out); g_free (mask->segs_out);
if (channel_bounds (mask, &x3, &y3, &x4, &y4)) if (gimp_channel_bounds (mask, &x3, &y3, &x4, &y4))
{ {
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles,
x3, y3, (x4 - x3), (y4 - y3), FALSE); x3, y3, (x4 - x3), (y4 - y3), FALSE);
@ -616,7 +616,7 @@ channel_boundary (Channel *mask,
} }
gint gint
channel_value (Channel *mask, gimp_channel_value (GimpChannel *mask,
gint x, gint x,
gint y) gint y)
{ {
@ -646,7 +646,7 @@ channel_value (Channel *mask,
} }
gboolean gboolean
channel_bounds (Channel *mask, gimp_channel_bounds (GimpChannel *mask,
gint *x1, gint *x1,
gint *y1, gint *y1,
gint *x2, gint *x2,
@ -760,7 +760,7 @@ channel_bounds (Channel *mask,
} }
gboolean gboolean
channel_is_empty (Channel *mask) gimp_channel_is_empty (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
guchar *data; guchar *data;
@ -811,7 +811,7 @@ channel_is_empty (Channel *mask)
} }
void void
channel_add_segment (Channel *mask, gimp_channel_add_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
@ -854,7 +854,7 @@ channel_add_segment (Channel *mask,
} }
void void
channel_sub_segment (Channel *mask, gimp_channel_sub_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
@ -896,7 +896,7 @@ channel_sub_segment (Channel *mask,
} }
void void
channel_combine_rect (Channel *mask, gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
@ -956,7 +956,7 @@ channel_combine_rect (Channel *mask,
} }
void void
channel_combine_ellipse (Channel *mask, gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
@ -1002,10 +1002,10 @@ channel_combine_ellipse (Channel *mask,
{ {
case CHANNEL_OP_ADD: case CHANNEL_OP_ADD:
case CHANNEL_OP_REPLACE: case CHANNEL_OP_REPLACE:
channel_add_segment (mask, x1, i, (x2 - x1), 255); gimp_channel_add_segment (mask, x1, i, (x2 - x1), 255);
break; break;
case CHANNEL_OP_SUB: case CHANNEL_OP_SUB:
channel_sub_segment (mask, x1, i, (x2 - x1), 255); gimp_channel_sub_segment (mask, x1, i, (x2 - x1), 255);
break; break;
default: default:
g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!");
@ -1046,10 +1046,10 @@ channel_combine_ellipse (Channel *mask,
{ {
case CHANNEL_OP_ADD: case CHANNEL_OP_ADD:
case CHANNEL_OP_REPLACE: case CHANNEL_OP_REPLACE:
channel_add_segment (mask, x0, i, j - x0, last); gimp_channel_add_segment (mask, x0, i, j - x0, last);
break; break;
case CHANNEL_OP_SUB: case CHANNEL_OP_SUB:
channel_sub_segment (mask, x0, i, j - x0, last); gimp_channel_sub_segment (mask, x0, i, j - x0, last);
break; break;
default: default:
g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!");
@ -1071,9 +1071,9 @@ channel_combine_ellipse (Channel *mask,
if (last) if (last)
{ {
if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE)
channel_add_segment (mask, x0, i, j - x0, last); gimp_channel_add_segment (mask, x0, i, j - x0, last);
else if (op == CHANNEL_OP_SUB) else if (op == CHANNEL_OP_SUB)
channel_sub_segment (mask, x0, i, j - x0, last); gimp_channel_sub_segment (mask, x0, i, j - x0, last);
else else
g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!");
} }
@ -1112,7 +1112,7 @@ channel_combine_ellipse (Channel *mask,
} }
static void static void
channel_combine_sub_region_add (void *unused, gimp_channel_combine_sub_region_add (void *unused,
PixelRegion *srcPR, PixelRegion *srcPR,
PixelRegion *destPR) PixelRegion *destPR)
{ {
@ -1138,7 +1138,7 @@ channel_combine_sub_region_add (void *unused,
} }
static void static void
channel_combine_sub_region_sub (void *unused, gimp_channel_combine_sub_region_sub (void *unused,
PixelRegion *srcPR, PixelRegion *srcPR,
PixelRegion *destPR) PixelRegion *destPR)
{ {
@ -1163,7 +1163,7 @@ channel_combine_sub_region_sub (void *unused,
} }
static void static void
channel_combine_sub_region_intersect (void *unused, gimp_channel_combine_sub_region_intersect (void *unused,
PixelRegion *srcPR, PixelRegion *srcPR,
PixelRegion *destPR) PixelRegion *destPR)
{ {
@ -1185,8 +1185,8 @@ channel_combine_sub_region_intersect (void *unused,
} }
void void
channel_combine_mask (Channel *mask, gimp_channel_combine_mask (GimpChannel *mask,
Channel *add_on, GimpChannel *add_on,
ChannelOps op, ChannelOps op,
gint off_x, gint off_x,
gint off_y) gint off_y)
@ -1213,28 +1213,31 @@ channel_combine_mask (Channel *mask,
{ {
case CHANNEL_OP_ADD: case CHANNEL_OP_ADD:
case CHANNEL_OP_REPLACE: case CHANNEL_OP_REPLACE:
pixel_regions_process_parallel ((p_func) channel_combine_sub_region_add, pixel_regions_process_parallel ((p_func)
gimp_channel_combine_sub_region_add,
NULL, 2, &srcPR, &destPR); NULL, 2, &srcPR, &destPR);
break; break;
case CHANNEL_OP_SUB: case CHANNEL_OP_SUB:
pixel_regions_process_parallel ((p_func) channel_combine_sub_region_sub, pixel_regions_process_parallel ((p_func)
gimp_channel_combine_sub_region_sub,
NULL, 2, &srcPR, &destPR); NULL, 2, &srcPR, &destPR);
break; break;
case CHANNEL_OP_INTERSECT: case CHANNEL_OP_INTERSECT:
pixel_regions_process_parallel ((p_func) pixel_regions_process_parallel ((p_func)
channel_combine_sub_region_intersect, gimp_channel_combine_sub_region_intersect,
NULL, 2, &srcPR, &destPR); NULL, 2, &srcPR, &destPR);
break; break;
default: default:
g_message ("Error: unknown opperation type in channel_combine_mask\n"); g_message ("Error: unknown opperation type in channel_combine_mask\n");
break; break;
} }
mask->bounds_known = FALSE; mask->bounds_known = FALSE;
} }
void void
channel_feather (Channel *input, gimp_channel_feather (GimpChannel *input,
Channel *output, GimpChannel *output,
gdouble radius_x, gdouble radius_x,
gdouble radius_y, gdouble radius_y,
ChannelOps op, ChannelOps op,
@ -1256,13 +1259,13 @@ channel_feather (Channel *input,
gaussian_blur_region (&srcPR, radius_x, radius_y); gaussian_blur_region (&srcPR, radius_x, radius_y);
if (input != output) if (input != output)
channel_combine_mask (output, input, op, 0, 0); gimp_channel_combine_mask (output, input, op, 0, 0);
output->bounds_known = FALSE; output->bounds_known = FALSE;
} }
void void
channel_push_undo (Channel *mask) gimp_channel_push_undo (GimpChannel *mask)
{ {
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
MaskUndo *mask_undo; MaskUndo *mask_undo;
@ -1271,7 +1274,7 @@ channel_push_undo (Channel *mask)
GImage *gimage; GImage *gimage;
mask_undo = g_new (MaskUndo, 1); mask_undo = g_new (MaskUndo, 1);
if (channel_bounds (mask, &x1, &y1, &x2, &y2)) if (gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
{ {
undo_tiles = tile_manager_new ((x2 - x1), (y2 - y1), 1); undo_tiles = tile_manager_new ((x2 - x1), (y2 - y1), 1);
pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles,
@ -1296,13 +1299,13 @@ channel_push_undo (Channel *mask)
} }
void void
channel_clear (Channel *mask) gimp_channel_clear (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
guchar bg = 0; guchar bg = 0;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
if (mask->bounds_known && !mask->empty) if (mask->bounds_known && !mask->empty)
{ {
@ -1331,13 +1334,13 @@ channel_clear (Channel *mask)
} }
void void
channel_invert (Channel *mask) gimp_channel_invert (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
GimpLut *lut; GimpLut *lut;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
0, 0, 0, 0,
@ -1353,13 +1356,13 @@ channel_invert (Channel *mask)
} }
void void
channel_sharpen (Channel *mask) gimp_channel_sharpen (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
GimpLut *lut; GimpLut *lut;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
0, 0, 0, 0,
@ -1373,13 +1376,13 @@ channel_sharpen (Channel *mask)
} }
void void
channel_all (Channel *mask) gimp_channel_all (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
guchar bg = 255; guchar bg = 255;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* clear the mask */ /* clear the mask */
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
@ -1398,7 +1401,7 @@ channel_all (Channel *mask)
} }
void void
channel_border (Channel *mask, gimp_channel_border (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y) gint radius_y)
{ {
@ -1408,9 +1411,9 @@ channel_border (Channel *mask,
if (radius_x < 0 || radius_y < 0) if (radius_x < 0 || radius_y < 0)
return; return;
if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return; return;
if (channel_is_empty (mask)) if (gimp_channel_is_empty (mask))
return; return;
if (x1 - radius_x < 0) if (x1 - radius_x < 0)
@ -1430,8 +1433,9 @@ channel_border (Channel *mask,
y2 = GIMP_DRAWABLE (mask)->height; y2 = GIMP_DRAWABLE (mask)->height;
else else
y2 += radius_y; y2 += radius_y;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1,
(x2-x1), (y2-y1), TRUE); (x2-x1), (y2-y1), TRUE);
@ -1442,7 +1446,7 @@ channel_border (Channel *mask,
} }
void void
channel_grow (Channel *mask, gimp_channel_grow (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y) gint radius_y)
{ {
@ -1454,16 +1458,16 @@ channel_grow (Channel *mask,
if (radius_x <= 0 && radius_y <= 0) if (radius_x <= 0 && radius_y <= 0)
{ {
channel_shrink (mask, -radius_x, -radius_y, FALSE); gimp_channel_shrink (mask, -radius_x, -radius_y, FALSE);
return; return;
} }
if (radius_x < 0 || radius_y < 0) if (radius_x < 0 || radius_y < 0)
return; return;
if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return; return;
if (channel_is_empty (mask)) if (gimp_channel_is_empty (mask))
return; return;
if (x1 - radius_x > 0) if (x1 - radius_x > 0)
@ -1484,7 +1488,7 @@ channel_grow (Channel *mask,
y2 = GIMP_DRAWABLE (mask)->height; y2 = GIMP_DRAWABLE (mask)->height;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* need full extents for grow, not! */ /* need full extents for grow, not! */
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1),
@ -1496,7 +1500,7 @@ channel_grow (Channel *mask,
} }
void void
channel_shrink (Channel *mask, gimp_channel_shrink (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y, gint radius_y,
gboolean edge_lock) gboolean edge_lock)
@ -1509,16 +1513,16 @@ channel_shrink (Channel *mask,
if (radius_x <= 0 && radius_y <= 0) if (radius_x <= 0 && radius_y <= 0)
{ {
channel_grow (mask, -radius_x, -radius_y); gimp_channel_grow (mask, -radius_x, -radius_y);
return; return;
} }
if (radius_x < 0 || radius_y < 0) if (radius_x < 0 || radius_y < 0)
return; return;
if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return; return;
if (channel_is_empty (mask)) if (gimp_channel_is_empty (mask))
return; return;
if (x1 > 0) if (x1 > 0)
@ -1531,7 +1535,7 @@ channel_shrink (Channel *mask,
y2++; y2++;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1),
(y2 - y1), TRUE); (y2 - y1), TRUE);
@ -1542,12 +1546,12 @@ channel_shrink (Channel *mask,
} }
void void
channel_translate (Channel *mask, gimp_channel_translate (GimpChannel *mask,
gint off_x, gint off_x,
gint off_y) gint off_y)
{ {
gint width, height; gint width, height;
Channel *tmp_mask; GimpChannel *tmp_mask;
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
guchar empty = 0; guchar empty = 0;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
@ -1555,9 +1559,9 @@ channel_translate (Channel *mask,
tmp_mask = NULL; tmp_mask = NULL;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
channel_bounds (mask, &x1, &y1, &x2, &y2); gimp_channel_bounds (mask, &x1, &y1, &x2, &y2);
x1 = CLAMP ((x1 + off_x), 0, GIMP_DRAWABLE (mask)->width); x1 = CLAMP ((x1 + off_x), 0, GIMP_DRAWABLE (mask)->width);
y1 = CLAMP ((y1 + off_y), 0, GIMP_DRAWABLE (mask)->height); y1 = CLAMP ((y1 + off_y), 0, GIMP_DRAWABLE (mask)->height);
x2 = CLAMP ((x2 + off_x), 0, GIMP_DRAWABLE (mask)->width); x2 = CLAMP ((x2 + off_x), 0, GIMP_DRAWABLE (mask)->width);
@ -1572,7 +1576,8 @@ channel_translate (Channel *mask,
/* copy the portion of the mask we will keep to a /* copy the portion of the mask we will keep to a
* temporary buffer * temporary buffer
*/ */
tmp_mask = channel_new_mask (GIMP_DRAWABLE (mask)->gimage, width, height); tmp_mask = gimp_channel_new_mask (GIMP_DRAWABLE (mask)->gimage,
width, height);
pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles,
x1 - off_x, y1 - off_y, width, height, FALSE); x1 - off_x, y1 - off_y, width, height, FALSE);
@ -1619,13 +1624,13 @@ channel_translate (Channel *mask,
} }
void void
channel_load (Channel *mask, gimp_channel_load (GimpChannel *mask,
Channel *channel) GimpChannel *channel)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* copy the channel to the mask */ /* copy the channel to the mask */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
@ -1642,7 +1647,7 @@ channel_load (Channel *mask,
} }
void void
channel_layer_alpha (Channel *mask, gimp_channel_layer_alpha (GimpChannel *mask,
GimpLayer *layer) GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
@ -1650,7 +1655,7 @@ channel_layer_alpha (Channel *mask,
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* clear the mask */ /* clear the mask */
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles,
@ -1678,7 +1683,7 @@ channel_layer_alpha (Channel *mask,
} }
void void
channel_layer_mask (Channel *mask, gimp_channel_layer_mask (GimpChannel *mask,
GimpLayer *layer) GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
@ -1686,7 +1691,7 @@ channel_layer_mask (Channel *mask,
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* clear the mask */ /* clear the mask */
pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles, pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
@ -1717,7 +1722,7 @@ channel_layer_mask (Channel *mask,
} }
void void
channel_invalidate_bounds (Channel *channel) gimp_channel_invalidate_bounds (GimpChannel *channel)
{ {
channel->bounds_known = FALSE; channel->bounds_known = FALSE;
} }

View file

@ -16,8 +16,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef __CHANNEL_H__ #ifndef __GIMP_CHANNEL_H__
#define __CHANNEL_H__ #define __GIMP_CHANNEL_H__
#include "gimpdrawable.h" #include "gimpdrawable.h"
@ -26,7 +26,6 @@
/* Half way point where a region is no longer visible in a selection */ /* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127 #define HALF_WAY 127
/* structure declarations */
#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) #define GIMP_TYPE_CHANNEL (gimp_channel_get_type ())
#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) #define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel))
@ -63,21 +62,18 @@ struct _GimpChannelClass
}; };
/* Special undo types */
/* Special undo type */
typedef struct _ChannelUndo ChannelUndo; typedef struct _ChannelUndo ChannelUndo;
typedef struct _MaskUndo MaskUndo;
struct _ChannelUndo struct _ChannelUndo
{ {
Channel *channel; /* the actual channel */ GimpChannel *channel; /* the actual channel */
gint prev_position; /* former position in list */ gint prev_position; /* former position in list */
Channel *prev_channel; /* previous active channel */ GimpChannel *prev_channel; /* previous active channel */
}; };
/* Special undo type */
typedef struct _MaskUndo MaskUndo;
struct _MaskUndo struct _MaskUndo
{ {
TileManager *tiles; /* the actual mask */ TileManager *tiles; /* the actual mask */
@ -89,44 +85,44 @@ struct _MaskUndo
GtkType gimp_channel_get_type (void); GtkType gimp_channel_get_type (void);
Channel * channel_new (GimpImage *gimage, GimpChannel * gimp_channel_new (GimpImage *gimage,
gint width, gint width,
gint height, gint height,
const gchar *name, const gchar *name,
const GimpRGB *color); const GimpRGB *color);
Channel * channel_copy (const Channel *channel); GimpChannel * gimp_channel_copy (const GimpChannel *channel);
gint channel_get_opacity (const Channel *channel); gint gimp_channel_get_opacity (const GimpChannel *channel);
void channel_set_opacity (Channel *channel, void gimp_channel_set_opacity (GimpChannel *channel,
gint opacity); gint opacity);
const GimpRGB * channel_get_color (const Channel *channel); const GimpRGB * gimp_channel_get_color (const GimpChannel *channel);
void channel_set_color (Channel *channel, void gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color); const GimpRGB *color);
void channel_scale (Channel *channel, void gimp_channel_scale (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height); gint new_height);
void channel_resize (Channel *channel, void gimp_channel_resize (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height, gint new_height,
gint offx, gint offx,
gint offy); gint offy);
void channel_update (Channel *channel); void gimp_channel_update (GimpChannel *channel);
/* access functions */ /* access functions */
gboolean channel_toggle_visibility (Channel *channel); gboolean gimp_channel_toggle_visibility (GimpChannel *channel);
TempBuf * channel_preview (Channel *channel, TempBuf * gimp_channel_preview (GimpChannel *channel,
gint width, gint width,
gint height); gint height);
/* selection mask functions */ /* selection mask functions */
Channel * channel_new_mask (GimpImage *gimage, GimpChannel * gimp_channel_new_mask (GimpImage *gimage,
gint width, gint width,
gint height); gint height);
gboolean channel_boundary (Channel *mask, gboolean gimp_channel_boundary (GimpChannel *mask,
BoundSeg **segs_in, BoundSeg **segs_in,
BoundSeg **segs_out, BoundSeg **segs_out,
gint *num_segs_in, gint *num_segs_in,
@ -135,80 +131,80 @@ gboolean channel_boundary (Channel *mask,
gint y1, gint y1,
gint x2, gint x2,
gint y2); gint y2);
gboolean channel_bounds (Channel *mask, gboolean gimp_channel_bounds (GimpChannel *mask,
gint *x1, gint *x1,
gint *y1, gint *y1,
gint *x2, gint *x2,
gint *y2); gint *y2);
gint channel_value (Channel *mask, gint gimp_channel_value (GimpChannel *mask,
gint x, gint x,
gint y); gint y);
gboolean channel_is_empty (Channel *mask); gboolean gimp_channel_is_empty (GimpChannel *mask);
void channel_add_segment (Channel *mask, void gimp_channel_add_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint value); gint value);
void channel_sub_segment (Channel *mask, void gimp_channel_sub_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint value); gint value);
void channel_combine_rect (Channel *mask, void gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h); gint h);
void channel_combine_ellipse (Channel *mask, void gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h, gint h,
gboolean antialias); gboolean antialias);
void channel_combine_mask (Channel *mask, void gimp_channel_combine_mask (GimpChannel *mask,
Channel *add_on, GimpChannel *add_on,
ChannelOps op, ChannelOps op,
gint off_x, gint off_x,
gint off_y); gint off_y);
void channel_feather (Channel *input, void gimp_channel_feather (GimpChannel *input,
Channel *output, GimpChannel *output,
gdouble radius_x, gdouble radius_x,
gdouble radius_y, gdouble radius_y,
ChannelOps op, ChannelOps op,
gint off_x, gint off_x,
gint off_y); gint off_y);
void channel_push_undo (Channel *mask); void gimp_channel_push_undo (GimpChannel *mask);
void channel_clear (Channel *mask); void gimp_channel_clear (GimpChannel *mask);
void channel_invert (Channel *mask); void gimp_channel_invert (GimpChannel *mask);
void channel_sharpen (Channel *mask); void gimp_channel_sharpen (GimpChannel *mask);
void channel_all (Channel *mask); void gimp_channel_all (GimpChannel *mask);
void channel_border (Channel *mask, void gimp_channel_border (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y); gint radius_y);
void channel_grow (Channel *mask, void gimp_channel_grow (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y); gint radius_y);
void channel_shrink (Channel *mask, void gimp_channel_shrink (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y, gint radius_y,
gboolean edge_lock); gboolean edge_lock);
void channel_translate (Channel *mask, void gimp_channel_translate (GimpChannel *mask,
gint off_x, gint off_x,
gint off_y); gint off_y);
void channel_load (Channel *mask, void gimp_channel_load (GimpChannel *mask,
Channel *channel); GimpChannel *channel);
void channel_layer_alpha (Channel *mask, void gimp_channel_layer_alpha (GimpChannel *mask,
GimpLayer *layer); GimpLayer *layer);
void channel_layer_mask (Channel *mask, void gimp_channel_layer_mask (GimpChannel *mask,
GimpLayer *layer); GimpLayer *layer);
void channel_invalidate_bounds (Channel *channel); void gimp_channel_invalidate_bounds (GimpChannel *channel);
#endif /* __CHANNEL_H__ */ #endif /* __GIMP_CHANNEL_H__ */

View file

@ -1221,7 +1221,7 @@ gradient_precalc_shapeburst (GImage *gimage,
PixelRegion *PR, PixelRegion *PR,
gdouble dist) gdouble dist)
{ {
Channel *mask; GimpChannel *mask;
PixelRegion tempR; PixelRegion tempR;
gfloat max_iteration; gfloat max_iteration;
gfloat *distp; gfloat *distp;

View file

@ -569,12 +569,12 @@ duplicate (GimpImage *gimage)
GimpImage *new_gimage; GimpImage *new_gimage;
GimpLayer *layer, *new_layer; GimpLayer *layer, *new_layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
Channel *channel, *new_channel; GimpChannel *channel, *new_channel;
GSList *list; GSList *list;
GList *glist; GList *glist;
Guide *guide = NULL; Guide *guide = NULL;
GimpLayer *active_layer = NULL; GimpLayer *active_layer = NULL;
Channel *active_channel = NULL; GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL;
ParasiteList *parasites; ParasiteList *parasites;
@ -645,12 +645,12 @@ duplicate (GimpImage *gimage)
count = 0; count = 0;
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
list = g_slist_next (list); list = g_slist_next (list);
new_channel = channel_copy (channel); new_channel = gimp_channel_copy (channel);
gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage); gimp_drawable_set_gimage (GIMP_DRAWABLE (new_channel), new_gimage);
/* Make sure the copied channel doesn't say: "<old channel> copy" */ /* Make sure the copied channel doesn't say: "<old channel> copy" */
gimp_object_set_name (GIMP_OBJECT (new_channel), gimp_object_set_name (GIMP_OBJECT (new_channel),

View file

@ -351,7 +351,7 @@ edit_paste (GimpImage *gimage,
* it seems like the correct behavior. * it seems like the correct behavior.
*/ */
if (! gimage_mask_is_empty (gimage) && !paste_into) if (! gimage_mask_is_empty (gimage) && !paste_into)
channel_clear (gimp_image_get_mask (gimage)); gimp_channel_clear (gimp_image_get_mask (gimage));
/* if there's a drawable, add a new floating selection */ /* if there's a drawable, add a new floating selection */
if (drawable != NULL) if (drawable != NULL)

View file

@ -569,12 +569,12 @@ duplicate (GimpImage *gimage)
GimpImage *new_gimage; GimpImage *new_gimage;
GimpLayer *layer, *new_layer; GimpLayer *layer, *new_layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
Channel *channel, *new_channel; GimpChannel *channel, *new_channel;
GSList *list; GSList *list;
GList *glist; GList *glist;
Guide *guide = NULL; Guide *guide = NULL;
GimpLayer *active_layer = NULL; GimpLayer *active_layer = NULL;
Channel *active_channel = NULL; GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL;
ParasiteList *parasites; ParasiteList *parasites;
@ -645,12 +645,12 @@ duplicate (GimpImage *gimage)
count = 0; count = 0;
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
list = g_slist_next (list); list = g_slist_next (list);
new_channel = channel_copy (channel); new_channel = gimp_channel_copy (channel);
gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage); gimp_drawable_set_gimage (GIMP_DRAWABLE (new_channel), new_gimage);
/* Make sure the copied channel doesn't say: "<old channel> copy" */ /* Make sure the copied channel doesn't say: "<old channel> copy" */
gimp_object_set_name (GIMP_OBJECT (new_channel), gimp_object_set_name (GIMP_OBJECT (new_channel),

View file

@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage,
PixelRegion *dest, PixelRegion *dest,
PixelRegion *mask); PixelRegion *mask);
static void project_channel (GimpImage *gimage, static void project_channel (GimpImage *gimage,
Channel *layer, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2); PixelRegion *src2);
@ -437,8 +437,9 @@ gimp_image_new (gint width,
} }
/* create the selection mask */ /* create the selection mask */
gimage->selection_mask = channel_new_mask (gimage, gimage->selection_mask = gimp_channel_new_mask (gimage,
gimage->width, gimage->height); gimage->width,
gimage->height);
return gimage; return gimage;
@ -552,7 +553,7 @@ gimp_image_resize (GimpImage *gimage,
gint offset_x, gint offset_x,
gint offset_y) gint offset_y)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage,
/* Resize all channels */ /* Resize all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_resize (channel, new_width, new_height, offset_x, offset_y); gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y);
} }
/* Reposition or remove any guides */ /* Reposition or remove any guides */
@ -617,7 +618,7 @@ gimp_image_resize (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
channel_resize (gimage->selection_mask, gimp_channel_resize (gimage->selection_mask,
new_width, new_height, offset_x, offset_y); new_width, new_height, offset_x, offset_y);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -646,7 +647,7 @@ gimp_image_scale (GimpImage *gimage,
gint new_width, gint new_width,
gint new_height) gint new_height)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage,
/* Scale all channels */ /* Scale all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_scale (channel, new_width, new_height);
gimp_channel_scale (channel, new_width, new_height);
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
/* if (channel_is_empty(gimage->selection_mask)) /* if (channel_is_empty(gimage->selection_mask))
channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0)
else else
*/ */
channel_scale (gimage->selection_mask, new_width, new_height); gimp_channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
/* Scale all layers */ /* Scale all layers */
@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR; PixelRegion src1PR, destPR, maskPR;
@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR; PixelRegion src1PR, destPR;
@ -1377,7 +1379,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
GimpLayer *layer; GimpLayer *layer;
GSList *layers; GSList *layers;
gboolean retval = TRUE; gboolean retval = TRUE;
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
Tattoo maxval = 0; Tattoo maxval = 0;
Path *pptr = NULL; Path *pptr = NULL;
@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
Tattoo ctattoo; Tattoo ctattoo;
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval) if (ctattoo > maxval)
@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage,
static void static void
project_channel (GimpImage *gimage, project_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2) PixelRegion *src2)
{ {
@ -1599,11 +1601,11 @@ static void
gimp_image_free_channels (GimpImage *gimage) gimp_image_free_channels (GimpImage *gimage)
{ {
GSList *list; GSList *list;
Channel *channel; GimpChannel *channel;
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
gtk_object_unref (GTK_OBJECT (channel)); gtk_object_unref (GTK_OBJECT (channel));
} }
@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage,
gint w, gint w,
gint h) gint h)
{ {
Channel *channel; GimpChannel *channel;
PixelRegion src1PR; PixelRegion src1PR;
PixelRegion src2PR; PixelRegion src2PR;
GSList *list; GSList *list;
@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage,
while (reverse_list) while (reverse_list)
{ {
channel = (Channel *) reverse_list->data; channel = (GimpChannel *) reverse_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{ {
@ -2122,14 +2124,14 @@ void
gimp_image_invalidate_channel_previews (GimpImage *gimage) gimp_image_invalidate_channel_previews (GimpImage *gimage)
{ {
GSList *tmp; GSList *tmp;
Channel *channel; GimpChannel *channel;
g_return_if_fail (gimage != NULL); g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage)); g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{ {
channel = (Channel *) tmp->data; channel = (GimpChannel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
} }
@ -2174,9 +2176,9 @@ gimp_image_get_layer_by_index (const GimpImage *gimage,
gint gint
gimp_image_get_channel_index (const GimpImage *gimage, gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg) const GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
gint index; gint index;
@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels), index++) channels = g_slist_next (channels), index++)
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (channel == channel_arg) if (channel == channel_arg)
return index; return index;
@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage)
return gimage->active_layer; return gimage->active_layer;
} }
Channel * GimpChannel *
gimp_image_get_active_channel (const GimpImage *gimage) gimp_image_get_active_channel (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2235,11 +2237,11 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_tattoo (const GimpImage *gimage, gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tattoo) Tattoo tattoo)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel; return channel;
@ -2257,11 +2259,11 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_name (const GimpImage *gimage, gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel; return channel;
} }
@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_mask (const GimpImage *gimage) gimp_image_get_mask (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage,
return layer; return layer;
} }
Channel * GimpChannel *
gimp_image_set_active_channel (GimpImage *gimage, gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage,
gimage->active_channel = NULL; gimage->active_channel = NULL;
return NULL; return NULL;
} }
channel = (Channel *) gimage->channels->data; channel = (GimpChannel *) gimage->channels->data;
} }
/* Set the active channel */ /* Set the active channel */
@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_unset_active_channel (GimpImage *gimage) gimp_image_unset_active_channel (GimpImage *gimage)
{ {
Channel *channel; GimpChannel *channel;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return mask; return mask;
} }
Channel * GimpChannel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
@ -3362,12 +3364,12 @@ gimp_image_remove_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_raise_channel (GimpImage *gimage, gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *prev_channel; GimpChannel *prev_channel;
GSList *list; GSList *list;
GSList *prev; GSList *prev;
gint index = -1; gint index = -1;
@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (prev) if (prev)
prev_channel = (Channel *) prev->data; prev_channel = (GimpChannel *) prev->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
@ -3411,12 +3413,12 @@ gimp_image_raise_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_lower_channel (GimpImage *gimage, gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *next_channel; GimpChannel *next_channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index = 0; gint index = 0;
@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
next = g_slist_next (list); next = g_slist_next (list);
if (next) if (next)
next_channel = (Channel *) next->data; next_channel = (GimpChannel *) next->data;
index++; index++;
if (channel == channel_arg) if (channel == channel_arg)
@ -3460,12 +3462,12 @@ gimp_image_lower_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_position_channel (GimpImage *gimage, gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint new_index) gint new_index)
{ {
Channel *channel; GimpChannel *channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index; gint index;
@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage,
list; list;
list = g_slist_next (list), index++) list = g_slist_next (list), index++)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
break; break;
@ -3513,9 +3515,9 @@ gimp_image_position_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_add_channel (GimpImage *gimage, gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position) gint position)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_remove_channel (GimpImage *gimage, gimp_image_remove_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage,
if (gimage->active_channel == channel) if (gimage->active_channel == channel)
{ {
if (gimage->channels) if (gimage->channels)
gimage->active_channel = (((Channel *) gimage->channels->data)); gimage->active_channel = (((GimpChannel *) gimage->channels->data));
else else
gimage->active_channel = NULL; gimage->active_channel = NULL;
} }

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */ GSList *layer_stack; /* the layers in MRU order */
GimpLayer *active_layer; /* ID of active layer */ GimpLayer *active_layer; /* ID of active layer */
Channel *active_channel; /* ID of active channel */ GimpChannel *active_channel; /* ID of active channel */
GimpLayer *floating_sel; /* ID of fs layer */ GimpLayer *floating_sel; /* ID of fs layer */
Channel *selection_mask; /* selection mask channel */ GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */ ParasiteList *parasites; /* Plug-in parasite data */
@ -287,16 +287,16 @@ gint gimp_image_get_layer_index (const GimpImage *gimage,
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
@ -306,9 +306,9 @@ gboolean gimp_image_layer_boundary (const GimpImage *gimage,
gint *n_segs); gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer); GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
@ -347,21 +347,21 @@ GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
GimpLayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, GimpChannel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, GimpChannel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,

View file

@ -75,7 +75,7 @@ gimage_mask_boundary (GImage *gimage,
*/ */
/* Find the selection mask boundary */ /* Find the selection mask boundary */
channel_boundary (gimp_image_get_mask (gimage), gimp_channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out, segs_in, segs_out,
num_segs_in, num_segs_out, num_segs_in, num_segs_out,
0, 0, 0, 0); 0, 0, 0, 0);
@ -89,7 +89,7 @@ gimage_mask_boundary (GImage *gimage,
else if ((d = gimp_image_active_drawable (gimage)) && else if ((d = gimp_image_active_drawable (gimage)) &&
GIMP_IS_CHANNEL (d)) GIMP_IS_CHANNEL (d))
{ {
return channel_boundary (gimp_image_get_mask (gimage), return gimp_channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out, segs_in, segs_out,
num_segs_in, num_segs_out, num_segs_in, num_segs_out,
0, 0, gimage->width, gimage->height); 0, 0, gimage->width, gimage->height);
@ -107,7 +107,7 @@ gimage_mask_boundary (GImage *gimage,
y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE(layer)), 0, y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE(layer)), 0,
gimage->height); gimage->height);
return channel_boundary (gimp_image_get_mask (gimage), return gimp_channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out, segs_in, segs_out,
num_segs_in, num_segs_out, num_segs_in, num_segs_out,
x1, y1, x2, y2); x1, y1, x2, y2);
@ -130,7 +130,7 @@ gimage_mask_bounds (GImage *gimage,
gint *x2, gint *x2,
gint *y2) gint *y2)
{ {
return channel_bounds (gimp_image_get_mask (gimage), x1, y1, x2, y2); return gimp_channel_bounds (gimp_image_get_mask (gimage), x1, y1, x2, y2);
} }
@ -138,7 +138,7 @@ void
gimage_mask_invalidate (GImage *gimage) gimage_mask_invalidate (GImage *gimage)
{ {
GimpLayer *layer; GimpLayer *layer;
Channel *mask; GimpChannel *mask;
/* Turn the current selection off */ /* Turn the current selection off */
gdisplays_selection_visibility (gimage, SelectionOff); gdisplays_selection_visibility (gimage, SelectionOff);
@ -163,7 +163,7 @@ gimage_mask_value (GImage *gimage,
int x, int x,
int y) int y)
{ {
return channel_value (gimp_image_get_mask (gimage), x, y); return gimp_channel_value (gimp_image_get_mask (gimage), x, y);
} }
@ -177,7 +177,7 @@ gimage_mask_is_empty (GImage *gimage)
if (gimage_mask_stroking) if (gimage_mask_stroking)
return TRUE; return TRUE;
else else
return channel_is_empty (gimp_image_get_mask (gimage)); return gimp_channel_is_empty (gimp_image_get_mask (gimage));
} }
@ -186,7 +186,7 @@ gimage_mask_translate (GImage *gimage,
gint off_x, gint off_x,
gint off_y) gint off_y)
{ {
channel_translate (gimp_image_get_mask (gimage), off_x, off_y); gimp_channel_translate (gimp_image_get_mask (gimage), off_x, off_y);
} }
@ -197,8 +197,8 @@ gimage_mask_extract (GImage *gimage,
gboolean keep_indexed, gboolean keep_indexed,
gboolean add_alpha) gboolean add_alpha)
{ {
TileManager * tiles; TileManager *tiles;
Channel * sel_mask; GimpChannel *sel_mask;
PixelRegion srcPR, destPR, maskPR; PixelRegion srcPR, destPR, maskPR;
guchar bg[MAX_CHANNELS]; guchar bg[MAX_CHANNELS];
gint bytes, type; gint bytes, type;
@ -293,7 +293,7 @@ gimage_mask_extract (GImage *gimage,
if (cut_gimage) if (cut_gimage)
{ {
/* Clear the region */ /* Clear the region */
channel_clear (gimp_image_get_mask (gimage)); gimp_channel_clear (gimp_image_get_mask (gimage));
/* Update the region */ /* Update the region */
gdisplays_update_area (gimage, gdisplays_update_area (gimage,
@ -350,7 +350,7 @@ gimage_mask_float (GImage *gimage,
gint off_y) gint off_y)
{ {
GimpLayer *layer; GimpLayer *layer;
Channel *mask = gimp_image_get_mask (gimage); GimpChannel *mask = gimp_image_get_mask (gimage);
TileManager *tiles; TileManager *tiles;
gboolean non_empty; gboolean non_empty;
gint x1, y1; gint x1, y1;
@ -401,21 +401,21 @@ gimage_mask_float (GImage *gimage,
void void
gimage_mask_clear (GImage *gimage) gimage_mask_clear (GImage *gimage)
{ {
channel_clear (gimp_image_get_mask (gimage)); gimp_channel_clear (gimp_image_get_mask (gimage));
} }
void void
gimage_mask_undo (GImage *gimage) gimage_mask_undo (GImage *gimage)
{ {
channel_push_undo (gimp_image_get_mask (gimage)); gimp_channel_push_undo (gimp_image_get_mask (gimage));
} }
void void
gimage_mask_invert (GImage *gimage) gimage_mask_invert (GImage *gimage)
{ {
channel_invert (gimp_image_get_mask (gimage)); gimp_channel_invert (gimp_image_get_mask (gimage));
} }
@ -425,21 +425,21 @@ gimage_mask_sharpen (GImage *gimage)
/* No need to play with the selection visibility /* No need to play with the selection visibility
* because sharpen will not change the outline * because sharpen will not change the outline
*/ */
channel_sharpen (gimp_image_get_mask (gimage)); gimp_channel_sharpen (gimp_image_get_mask (gimage));
} }
void void
gimage_mask_all (GImage *gimage) gimage_mask_all (GImage *gimage)
{ {
channel_all (gimp_image_get_mask (gimage)); gimp_channel_all (gimp_image_get_mask (gimage));
} }
void void
gimage_mask_none (GImage *gimage) gimage_mask_none (GImage *gimage)
{ {
channel_clear (gimp_image_get_mask (gimage)); gimp_channel_clear (gimp_image_get_mask (gimage));
} }
@ -449,12 +449,12 @@ gimage_mask_feather (GImage *gimage,
gdouble feather_radius_y) gdouble feather_radius_y)
{ {
/* push the current mask onto the undo stack--need to do this here because /* push the current mask onto the undo stack--need to do this here because
* channel_feather doesn't do it * gimp_channel_feather doesn't do it
*/ */
channel_push_undo (gimp_image_get_mask (gimage)); gimp_channel_push_undo (gimp_image_get_mask (gimage));
/* feather the region */ /* feather the region */
channel_feather (gimp_image_get_mask (gimage), gimp_channel_feather (gimp_image_get_mask (gimage),
gimp_image_get_mask (gimage), gimp_image_get_mask (gimage),
feather_radius_x, feather_radius_x,
feather_radius_y, feather_radius_y,
@ -468,7 +468,7 @@ gimage_mask_border (GImage *gimage,
gint border_radius_y) gint border_radius_y)
{ {
/* feather the region */ /* feather the region */
channel_border (gimp_image_get_mask (gimage), gimp_channel_border (gimp_image_get_mask (gimage),
border_radius_x, border_radius_x,
border_radius_y); border_radius_y);
} }
@ -480,7 +480,7 @@ gimage_mask_grow (GImage *gimage,
int grow_pixels_y) int grow_pixels_y)
{ {
/* feather the region */ /* feather the region */
channel_grow (gimp_image_get_mask (gimage), gimp_channel_grow (gimp_image_get_mask (gimage),
grow_pixels_x, grow_pixels_x,
grow_pixels_y); grow_pixels_y);
} }
@ -493,7 +493,7 @@ gimage_mask_shrink (GImage *gimage,
gboolean edge_lock) gboolean edge_lock)
{ {
/* feather the region */ /* feather the region */
channel_shrink (gimp_image_get_mask (gimage), gimp_channel_shrink (gimp_image_get_mask (gimage),
shrink_pixels_x, shrink_pixels_x,
shrink_pixels_y, shrink_pixels_y,
edge_lock); edge_lock);
@ -508,7 +508,7 @@ gimage_mask_layer_alpha (GimpImage *gimage,
if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer))) if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)))
{ {
/* load the mask with the given layer's alpha channel */ /* load the mask with the given layer's alpha channel */
channel_layer_alpha (gimp_image_get_mask (gimage), layer); gimp_channel_layer_alpha (gimp_image_get_mask (gimage), layer);
} }
else else
{ {
@ -527,7 +527,7 @@ gimage_mask_layer_mask (GimpImage *gimage,
if (gimp_layer_get_mask (layer)) if (gimp_layer_get_mask (layer))
{ {
/* load the mask with the given layer's alpha channel */ /* load the mask with the given layer's alpha channel */
channel_layer_mask (gimp_image_get_mask (gimage), layer); gimp_channel_layer_mask (gimp_image_get_mask (gimage), layer);
} }
else else
{ {
@ -540,19 +540,19 @@ gimage_mask_layer_mask (GimpImage *gimage,
void void
gimage_mask_load (GImage *gimage, gimage_mask_load (GImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
/* Load the specified channel to the gimage mask */ /* Load the specified channel to the gimage mask */
channel_load (gimp_image_get_mask (gimage), (channel)); gimp_channel_load (gimp_image_get_mask (gimage), (channel));
} }
Channel * GimpChannel *
gimage_mask_save (GImage *gimage) gimage_mask_save (GImage *gimage)
{ {
Channel *new_channel; GimpChannel *new_channel;
new_channel = channel_copy (gimp_image_get_mask (gimage)); new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
/* saved selections are not visible by default */ /* saved selections are not visible by default */
GIMP_DRAWABLE(new_channel)->visible = FALSE; GIMP_DRAWABLE(new_channel)->visible = FALSE;

View file

@ -86,9 +86,9 @@ void gimage_mask_layer_mask (GImage *gimage,
GimpLayer *layer); GimpLayer *layer);
void gimage_mask_load (GImage *gimage, void gimage_mask_load (GImage *gimage,
Channel *channel); GimpChannel *channel);
Channel * gimage_mask_save (GImage *gimage); GimpChannel * gimage_mask_save (GImage *gimage);
gboolean gimage_mask_stroke (GImage *gimage, gboolean gimage_mask_stroke (GImage *gimage,
GimpDrawable *drawable); GimpDrawable *drawable);

View file

@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage,
PixelRegion *dest, PixelRegion *dest,
PixelRegion *mask); PixelRegion *mask);
static void project_channel (GimpImage *gimage, static void project_channel (GimpImage *gimage,
Channel *layer, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2); PixelRegion *src2);
@ -437,8 +437,9 @@ gimp_image_new (gint width,
} }
/* create the selection mask */ /* create the selection mask */
gimage->selection_mask = channel_new_mask (gimage, gimage->selection_mask = gimp_channel_new_mask (gimage,
gimage->width, gimage->height); gimage->width,
gimage->height);
return gimage; return gimage;
@ -552,7 +553,7 @@ gimp_image_resize (GimpImage *gimage,
gint offset_x, gint offset_x,
gint offset_y) gint offset_y)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage,
/* Resize all channels */ /* Resize all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_resize (channel, new_width, new_height, offset_x, offset_y); gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y);
} }
/* Reposition or remove any guides */ /* Reposition or remove any guides */
@ -617,7 +618,7 @@ gimp_image_resize (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
channel_resize (gimage->selection_mask, gimp_channel_resize (gimage->selection_mask,
new_width, new_height, offset_x, offset_y); new_width, new_height, offset_x, offset_y);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -646,7 +647,7 @@ gimp_image_scale (GimpImage *gimage,
gint new_width, gint new_width,
gint new_height) gint new_height)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage,
/* Scale all channels */ /* Scale all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_scale (channel, new_width, new_height);
gimp_channel_scale (channel, new_width, new_height);
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
/* if (channel_is_empty(gimage->selection_mask)) /* if (channel_is_empty(gimage->selection_mask))
channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0)
else else
*/ */
channel_scale (gimage->selection_mask, new_width, new_height); gimp_channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
/* Scale all layers */ /* Scale all layers */
@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR; PixelRegion src1PR, destPR, maskPR;
@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR; PixelRegion src1PR, destPR;
@ -1377,7 +1379,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
GimpLayer *layer; GimpLayer *layer;
GSList *layers; GSList *layers;
gboolean retval = TRUE; gboolean retval = TRUE;
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
Tattoo maxval = 0; Tattoo maxval = 0;
Path *pptr = NULL; Path *pptr = NULL;
@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
Tattoo ctattoo; Tattoo ctattoo;
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval) if (ctattoo > maxval)
@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage,
static void static void
project_channel (GimpImage *gimage, project_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2) PixelRegion *src2)
{ {
@ -1599,11 +1601,11 @@ static void
gimp_image_free_channels (GimpImage *gimage) gimp_image_free_channels (GimpImage *gimage)
{ {
GSList *list; GSList *list;
Channel *channel; GimpChannel *channel;
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
gtk_object_unref (GTK_OBJECT (channel)); gtk_object_unref (GTK_OBJECT (channel));
} }
@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage,
gint w, gint w,
gint h) gint h)
{ {
Channel *channel; GimpChannel *channel;
PixelRegion src1PR; PixelRegion src1PR;
PixelRegion src2PR; PixelRegion src2PR;
GSList *list; GSList *list;
@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage,
while (reverse_list) while (reverse_list)
{ {
channel = (Channel *) reverse_list->data; channel = (GimpChannel *) reverse_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{ {
@ -2122,14 +2124,14 @@ void
gimp_image_invalidate_channel_previews (GimpImage *gimage) gimp_image_invalidate_channel_previews (GimpImage *gimage)
{ {
GSList *tmp; GSList *tmp;
Channel *channel; GimpChannel *channel;
g_return_if_fail (gimage != NULL); g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage)); g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{ {
channel = (Channel *) tmp->data; channel = (GimpChannel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
} }
@ -2174,9 +2176,9 @@ gimp_image_get_layer_by_index (const GimpImage *gimage,
gint gint
gimp_image_get_channel_index (const GimpImage *gimage, gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg) const GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
gint index; gint index;
@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels), index++) channels = g_slist_next (channels), index++)
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (channel == channel_arg) if (channel == channel_arg)
return index; return index;
@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage)
return gimage->active_layer; return gimage->active_layer;
} }
Channel * GimpChannel *
gimp_image_get_active_channel (const GimpImage *gimage) gimp_image_get_active_channel (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2235,11 +2237,11 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_tattoo (const GimpImage *gimage, gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tattoo) Tattoo tattoo)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel; return channel;
@ -2257,11 +2259,11 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_name (const GimpImage *gimage, gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel; return channel;
} }
@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_mask (const GimpImage *gimage) gimp_image_get_mask (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage,
return layer; return layer;
} }
Channel * GimpChannel *
gimp_image_set_active_channel (GimpImage *gimage, gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage,
gimage->active_channel = NULL; gimage->active_channel = NULL;
return NULL; return NULL;
} }
channel = (Channel *) gimage->channels->data; channel = (GimpChannel *) gimage->channels->data;
} }
/* Set the active channel */ /* Set the active channel */
@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_unset_active_channel (GimpImage *gimage) gimp_image_unset_active_channel (GimpImage *gimage)
{ {
Channel *channel; GimpChannel *channel;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return mask; return mask;
} }
Channel * GimpChannel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
@ -3362,12 +3364,12 @@ gimp_image_remove_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_raise_channel (GimpImage *gimage, gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *prev_channel; GimpChannel *prev_channel;
GSList *list; GSList *list;
GSList *prev; GSList *prev;
gint index = -1; gint index = -1;
@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (prev) if (prev)
prev_channel = (Channel *) prev->data; prev_channel = (GimpChannel *) prev->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
@ -3411,12 +3413,12 @@ gimp_image_raise_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_lower_channel (GimpImage *gimage, gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *next_channel; GimpChannel *next_channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index = 0; gint index = 0;
@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
next = g_slist_next (list); next = g_slist_next (list);
if (next) if (next)
next_channel = (Channel *) next->data; next_channel = (GimpChannel *) next->data;
index++; index++;
if (channel == channel_arg) if (channel == channel_arg)
@ -3460,12 +3462,12 @@ gimp_image_lower_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_position_channel (GimpImage *gimage, gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint new_index) gint new_index)
{ {
Channel *channel; GimpChannel *channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index; gint index;
@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage,
list; list;
list = g_slist_next (list), index++) list = g_slist_next (list), index++)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
break; break;
@ -3513,9 +3515,9 @@ gimp_image_position_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_add_channel (GimpImage *gimage, gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position) gint position)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_remove_channel (GimpImage *gimage, gimp_image_remove_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage,
if (gimage->active_channel == channel) if (gimage->active_channel == channel)
{ {
if (gimage->channels) if (gimage->channels)
gimage->active_channel = (((Channel *) gimage->channels->data)); gimage->active_channel = (((GimpChannel *) gimage->channels->data));
else else
gimage->active_channel = NULL; gimage->active_channel = NULL;
} }

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */ GSList *layer_stack; /* the layers in MRU order */
GimpLayer *active_layer; /* ID of active layer */ GimpLayer *active_layer; /* ID of active layer */
Channel *active_channel; /* ID of active channel */ GimpChannel *active_channel; /* ID of active channel */
GimpLayer *floating_sel; /* ID of fs layer */ GimpLayer *floating_sel; /* ID of fs layer */
Channel *selection_mask; /* selection mask channel */ GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */ ParasiteList *parasites; /* Plug-in parasite data */
@ -287,16 +287,16 @@ gint gimp_image_get_layer_index (const GimpImage *gimage,
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
@ -306,9 +306,9 @@ gboolean gimp_image_layer_boundary (const GimpImage *gimage,
gint *n_segs); gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer); GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
@ -347,21 +347,21 @@ GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
GimpLayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, GimpChannel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, GimpChannel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,

View file

@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage,
PixelRegion *dest, PixelRegion *dest,
PixelRegion *mask); PixelRegion *mask);
static void project_channel (GimpImage *gimage, static void project_channel (GimpImage *gimage,
Channel *layer, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2); PixelRegion *src2);
@ -437,8 +437,9 @@ gimp_image_new (gint width,
} }
/* create the selection mask */ /* create the selection mask */
gimage->selection_mask = channel_new_mask (gimage, gimage->selection_mask = gimp_channel_new_mask (gimage,
gimage->width, gimage->height); gimage->width,
gimage->height);
return gimage; return gimage;
@ -552,7 +553,7 @@ gimp_image_resize (GimpImage *gimage,
gint offset_x, gint offset_x,
gint offset_y) gint offset_y)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage,
/* Resize all channels */ /* Resize all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_resize (channel, new_width, new_height, offset_x, offset_y); gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y);
} }
/* Reposition or remove any guides */ /* Reposition or remove any guides */
@ -617,7 +618,7 @@ gimp_image_resize (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
channel_resize (gimage->selection_mask, gimp_channel_resize (gimage->selection_mask,
new_width, new_height, offset_x, offset_y); new_width, new_height, offset_x, offset_y);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -646,7 +647,7 @@ gimp_image_scale (GimpImage *gimage,
gint new_width, gint new_width,
gint new_height) gint new_height)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage,
/* Scale all channels */ /* Scale all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_scale (channel, new_width, new_height);
gimp_channel_scale (channel, new_width, new_height);
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
/* if (channel_is_empty(gimage->selection_mask)) /* if (channel_is_empty(gimage->selection_mask))
channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0)
else else
*/ */
channel_scale (gimage->selection_mask, new_width, new_height); gimp_channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
/* Scale all layers */ /* Scale all layers */
@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR; PixelRegion src1PR, destPR, maskPR;
@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR; PixelRegion src1PR, destPR;
@ -1377,7 +1379,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
GimpLayer *layer; GimpLayer *layer;
GSList *layers; GSList *layers;
gboolean retval = TRUE; gboolean retval = TRUE;
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
Tattoo maxval = 0; Tattoo maxval = 0;
Path *pptr = NULL; Path *pptr = NULL;
@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
Tattoo ctattoo; Tattoo ctattoo;
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval) if (ctattoo > maxval)
@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage,
static void static void
project_channel (GimpImage *gimage, project_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2) PixelRegion *src2)
{ {
@ -1599,11 +1601,11 @@ static void
gimp_image_free_channels (GimpImage *gimage) gimp_image_free_channels (GimpImage *gimage)
{ {
GSList *list; GSList *list;
Channel *channel; GimpChannel *channel;
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
gtk_object_unref (GTK_OBJECT (channel)); gtk_object_unref (GTK_OBJECT (channel));
} }
@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage,
gint w, gint w,
gint h) gint h)
{ {
Channel *channel; GimpChannel *channel;
PixelRegion src1PR; PixelRegion src1PR;
PixelRegion src2PR; PixelRegion src2PR;
GSList *list; GSList *list;
@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage,
while (reverse_list) while (reverse_list)
{ {
channel = (Channel *) reverse_list->data; channel = (GimpChannel *) reverse_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{ {
@ -2122,14 +2124,14 @@ void
gimp_image_invalidate_channel_previews (GimpImage *gimage) gimp_image_invalidate_channel_previews (GimpImage *gimage)
{ {
GSList *tmp; GSList *tmp;
Channel *channel; GimpChannel *channel;
g_return_if_fail (gimage != NULL); g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage)); g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{ {
channel = (Channel *) tmp->data; channel = (GimpChannel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
} }
@ -2174,9 +2176,9 @@ gimp_image_get_layer_by_index (const GimpImage *gimage,
gint gint
gimp_image_get_channel_index (const GimpImage *gimage, gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg) const GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
gint index; gint index;
@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels), index++) channels = g_slist_next (channels), index++)
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (channel == channel_arg) if (channel == channel_arg)
return index; return index;
@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage)
return gimage->active_layer; return gimage->active_layer;
} }
Channel * GimpChannel *
gimp_image_get_active_channel (const GimpImage *gimage) gimp_image_get_active_channel (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2235,11 +2237,11 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_tattoo (const GimpImage *gimage, gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tattoo) Tattoo tattoo)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel; return channel;
@ -2257,11 +2259,11 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_name (const GimpImage *gimage, gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel; return channel;
} }
@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_mask (const GimpImage *gimage) gimp_image_get_mask (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage,
return layer; return layer;
} }
Channel * GimpChannel *
gimp_image_set_active_channel (GimpImage *gimage, gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage,
gimage->active_channel = NULL; gimage->active_channel = NULL;
return NULL; return NULL;
} }
channel = (Channel *) gimage->channels->data; channel = (GimpChannel *) gimage->channels->data;
} }
/* Set the active channel */ /* Set the active channel */
@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_unset_active_channel (GimpImage *gimage) gimp_image_unset_active_channel (GimpImage *gimage)
{ {
Channel *channel; GimpChannel *channel;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return mask; return mask;
} }
Channel * GimpChannel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
@ -3362,12 +3364,12 @@ gimp_image_remove_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_raise_channel (GimpImage *gimage, gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *prev_channel; GimpChannel *prev_channel;
GSList *list; GSList *list;
GSList *prev; GSList *prev;
gint index = -1; gint index = -1;
@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (prev) if (prev)
prev_channel = (Channel *) prev->data; prev_channel = (GimpChannel *) prev->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
@ -3411,12 +3413,12 @@ gimp_image_raise_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_lower_channel (GimpImage *gimage, gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *next_channel; GimpChannel *next_channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index = 0; gint index = 0;
@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
next = g_slist_next (list); next = g_slist_next (list);
if (next) if (next)
next_channel = (Channel *) next->data; next_channel = (GimpChannel *) next->data;
index++; index++;
if (channel == channel_arg) if (channel == channel_arg)
@ -3460,12 +3462,12 @@ gimp_image_lower_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_position_channel (GimpImage *gimage, gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint new_index) gint new_index)
{ {
Channel *channel; GimpChannel *channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index; gint index;
@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage,
list; list;
list = g_slist_next (list), index++) list = g_slist_next (list), index++)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
break; break;
@ -3513,9 +3515,9 @@ gimp_image_position_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_add_channel (GimpImage *gimage, gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position) gint position)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_remove_channel (GimpImage *gimage, gimp_image_remove_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage,
if (gimage->active_channel == channel) if (gimage->active_channel == channel)
{ {
if (gimage->channels) if (gimage->channels)
gimage->active_channel = (((Channel *) gimage->channels->data)); gimage->active_channel = (((GimpChannel *) gimage->channels->data));
else else
gimage->active_channel = NULL; gimage->active_channel = NULL;
} }

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */ GSList *layer_stack; /* the layers in MRU order */
GimpLayer *active_layer; /* ID of active layer */ GimpLayer *active_layer; /* ID of active layer */
Channel *active_channel; /* ID of active channel */ GimpChannel *active_channel; /* ID of active channel */
GimpLayer *floating_sel; /* ID of fs layer */ GimpLayer *floating_sel; /* ID of fs layer */
Channel *selection_mask; /* selection mask channel */ GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */ ParasiteList *parasites; /* Plug-in parasite data */
@ -287,16 +287,16 @@ gint gimp_image_get_layer_index (const GimpImage *gimage,
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
@ -306,9 +306,9 @@ gboolean gimp_image_layer_boundary (const GimpImage *gimage,
gint *n_segs); gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer); GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
@ -347,21 +347,21 @@ GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
GimpLayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, GimpChannel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, GimpChannel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,

View file

@ -232,7 +232,7 @@ qmask_activate (GtkWidget *widget,
floating_sel_to_layer (layer); floating_sel_to_layer (layer);
} }
gmask = channel_new (gimg, gmask = gimp_channel_new (gimg,
gimg->width, gimg->width,
gimg->height, gimg->height,
"Qmask", "Qmask",
@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget,
{ {
/* if selection */ /* if selection */
gmask = channel_copy (gimp_image_get_mask (gimg)); gmask = gimp_channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0); gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, &color); gimp_channel_set_color (gmask, &color);
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask"); gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
gimage_mask_none (gimg); /* Clear the selection */ gimage_mask_none (gimg); /* Clear the selection */
} }
@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
EditQmaskOptions *options; EditQmaskOptions *options;
Channel *channel; GimpChannel *channel;
GimpRGB color; GimpRGB color;
options = (EditQmaskOptions *) data; options = (EditQmaskOptions *) data;
@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001) if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{ {
channel->color = color; channel->color = color;
channel_update (channel); gimp_channel_update (channel);
} }
} }

View file

@ -232,7 +232,7 @@ qmask_activate (GtkWidget *widget,
floating_sel_to_layer (layer); floating_sel_to_layer (layer);
} }
gmask = channel_new (gimg, gmask = gimp_channel_new (gimg,
gimg->width, gimg->width,
gimg->height, gimg->height,
"Qmask", "Qmask",
@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget,
{ {
/* if selection */ /* if selection */
gmask = channel_copy (gimp_image_get_mask (gimg)); gmask = gimp_channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0); gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, &color); gimp_channel_set_color (gmask, &color);
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask"); gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
gimage_mask_none (gimg); /* Clear the selection */ gimage_mask_none (gimg); /* Clear the selection */
} }
@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
EditQmaskOptions *options; EditQmaskOptions *options;
Channel *channel; GimpChannel *channel;
GimpRGB color; GimpRGB color;
options = (EditQmaskOptions *) data; options = (EditQmaskOptions *) data;
@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001) if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{ {
channel->color = color; channel->color = color;
channel_update (channel); gimp_channel_update (channel);
} }
} }

View file

@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage,
PixelRegion *dest, PixelRegion *dest,
PixelRegion *mask); PixelRegion *mask);
static void project_channel (GimpImage *gimage, static void project_channel (GimpImage *gimage,
Channel *layer, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2); PixelRegion *src2);
@ -437,8 +437,9 @@ gimp_image_new (gint width,
} }
/* create the selection mask */ /* create the selection mask */
gimage->selection_mask = channel_new_mask (gimage, gimage->selection_mask = gimp_channel_new_mask (gimage,
gimage->width, gimage->height); gimage->width,
gimage->height);
return gimage; return gimage;
@ -552,7 +553,7 @@ gimp_image_resize (GimpImage *gimage,
gint offset_x, gint offset_x,
gint offset_y) gint offset_y)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage,
/* Resize all channels */ /* Resize all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_resize (channel, new_width, new_height, offset_x, offset_y); gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y);
} }
/* Reposition or remove any guides */ /* Reposition or remove any guides */
@ -617,7 +618,7 @@ gimp_image_resize (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
channel_resize (gimage->selection_mask, gimp_channel_resize (gimage->selection_mask,
new_width, new_height, offset_x, offset_y); new_width, new_height, offset_x, offset_y);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -646,7 +647,7 @@ gimp_image_scale (GimpImage *gimage,
gint new_width, gint new_width,
gint new_height) gint new_height)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage,
/* Scale all channels */ /* Scale all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_scale (channel, new_width, new_height);
gimp_channel_scale (channel, new_width, new_height);
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
/* if (channel_is_empty(gimage->selection_mask)) /* if (channel_is_empty(gimage->selection_mask))
channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0)
else else
*/ */
channel_scale (gimage->selection_mask, new_width, new_height); gimp_channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
/* Scale all layers */ /* Scale all layers */
@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR; PixelRegion src1PR, destPR, maskPR;
@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR; PixelRegion src1PR, destPR;
@ -1377,7 +1379,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
GimpLayer *layer; GimpLayer *layer;
GSList *layers; GSList *layers;
gboolean retval = TRUE; gboolean retval = TRUE;
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
Tattoo maxval = 0; Tattoo maxval = 0;
Path *pptr = NULL; Path *pptr = NULL;
@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
Tattoo ctattoo; Tattoo ctattoo;
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval) if (ctattoo > maxval)
@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage,
static void static void
project_channel (GimpImage *gimage, project_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2) PixelRegion *src2)
{ {
@ -1599,11 +1601,11 @@ static void
gimp_image_free_channels (GimpImage *gimage) gimp_image_free_channels (GimpImage *gimage)
{ {
GSList *list; GSList *list;
Channel *channel; GimpChannel *channel;
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
gtk_object_unref (GTK_OBJECT (channel)); gtk_object_unref (GTK_OBJECT (channel));
} }
@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage,
gint w, gint w,
gint h) gint h)
{ {
Channel *channel; GimpChannel *channel;
PixelRegion src1PR; PixelRegion src1PR;
PixelRegion src2PR; PixelRegion src2PR;
GSList *list; GSList *list;
@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage,
while (reverse_list) while (reverse_list)
{ {
channel = (Channel *) reverse_list->data; channel = (GimpChannel *) reverse_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{ {
@ -2122,14 +2124,14 @@ void
gimp_image_invalidate_channel_previews (GimpImage *gimage) gimp_image_invalidate_channel_previews (GimpImage *gimage)
{ {
GSList *tmp; GSList *tmp;
Channel *channel; GimpChannel *channel;
g_return_if_fail (gimage != NULL); g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage)); g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{ {
channel = (Channel *) tmp->data; channel = (GimpChannel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
} }
@ -2174,9 +2176,9 @@ gimp_image_get_layer_by_index (const GimpImage *gimage,
gint gint
gimp_image_get_channel_index (const GimpImage *gimage, gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg) const GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
gint index; gint index;
@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels), index++) channels = g_slist_next (channels), index++)
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (channel == channel_arg) if (channel == channel_arg)
return index; return index;
@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage)
return gimage->active_layer; return gimage->active_layer;
} }
Channel * GimpChannel *
gimp_image_get_active_channel (const GimpImage *gimage) gimp_image_get_active_channel (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2235,11 +2237,11 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_tattoo (const GimpImage *gimage, gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tattoo) Tattoo tattoo)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel; return channel;
@ -2257,11 +2259,11 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_name (const GimpImage *gimage, gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel; return channel;
} }
@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_mask (const GimpImage *gimage) gimp_image_get_mask (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage,
return layer; return layer;
} }
Channel * GimpChannel *
gimp_image_set_active_channel (GimpImage *gimage, gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage,
gimage->active_channel = NULL; gimage->active_channel = NULL;
return NULL; return NULL;
} }
channel = (Channel *) gimage->channels->data; channel = (GimpChannel *) gimage->channels->data;
} }
/* Set the active channel */ /* Set the active channel */
@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_unset_active_channel (GimpImage *gimage) gimp_image_unset_active_channel (GimpImage *gimage)
{ {
Channel *channel; GimpChannel *channel;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return mask; return mask;
} }
Channel * GimpChannel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
@ -3362,12 +3364,12 @@ gimp_image_remove_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_raise_channel (GimpImage *gimage, gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *prev_channel; GimpChannel *prev_channel;
GSList *list; GSList *list;
GSList *prev; GSList *prev;
gint index = -1; gint index = -1;
@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (prev) if (prev)
prev_channel = (Channel *) prev->data; prev_channel = (GimpChannel *) prev->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
@ -3411,12 +3413,12 @@ gimp_image_raise_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_lower_channel (GimpImage *gimage, gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *next_channel; GimpChannel *next_channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index = 0; gint index = 0;
@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
next = g_slist_next (list); next = g_slist_next (list);
if (next) if (next)
next_channel = (Channel *) next->data; next_channel = (GimpChannel *) next->data;
index++; index++;
if (channel == channel_arg) if (channel == channel_arg)
@ -3460,12 +3462,12 @@ gimp_image_lower_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_position_channel (GimpImage *gimage, gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint new_index) gint new_index)
{ {
Channel *channel; GimpChannel *channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index; gint index;
@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage,
list; list;
list = g_slist_next (list), index++) list = g_slist_next (list), index++)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
break; break;
@ -3513,9 +3515,9 @@ gimp_image_position_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_add_channel (GimpImage *gimage, gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position) gint position)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_remove_channel (GimpImage *gimage, gimp_image_remove_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage,
if (gimage->active_channel == channel) if (gimage->active_channel == channel)
{ {
if (gimage->channels) if (gimage->channels)
gimage->active_channel = (((Channel *) gimage->channels->data)); gimage->active_channel = (((GimpChannel *) gimage->channels->data));
else else
gimage->active_channel = NULL; gimage->active_channel = NULL;
} }

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */ GSList *layer_stack; /* the layers in MRU order */
GimpLayer *active_layer; /* ID of active layer */ GimpLayer *active_layer; /* ID of active layer */
Channel *active_channel; /* ID of active channel */ GimpChannel *active_channel; /* ID of active channel */
GimpLayer *floating_sel; /* ID of fs layer */ GimpLayer *floating_sel; /* ID of fs layer */
Channel *selection_mask; /* selection mask channel */ GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */ ParasiteList *parasites; /* Plug-in parasite data */
@ -287,16 +287,16 @@ gint gimp_image_get_layer_index (const GimpImage *gimage,
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
@ -306,9 +306,9 @@ gboolean gimp_image_layer_boundary (const GimpImage *gimage,
gint *n_segs); gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer); GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
@ -347,21 +347,21 @@ GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
GimpLayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, GimpChannel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, GimpChannel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,

View file

@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage,
PixelRegion *dest, PixelRegion *dest,
PixelRegion *mask); PixelRegion *mask);
static void project_channel (GimpImage *gimage, static void project_channel (GimpImage *gimage,
Channel *layer, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2); PixelRegion *src2);
@ -437,8 +437,9 @@ gimp_image_new (gint width,
} }
/* create the selection mask */ /* create the selection mask */
gimage->selection_mask = channel_new_mask (gimage, gimage->selection_mask = gimp_channel_new_mask (gimage,
gimage->width, gimage->height); gimage->width,
gimage->height);
return gimage; return gimage;
@ -552,7 +553,7 @@ gimp_image_resize (GimpImage *gimage,
gint offset_x, gint offset_x,
gint offset_y) gint offset_y)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage,
/* Resize all channels */ /* Resize all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_resize (channel, new_width, new_height, offset_x, offset_y); gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y);
} }
/* Reposition or remove any guides */ /* Reposition or remove any guides */
@ -617,7 +618,7 @@ gimp_image_resize (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
channel_resize (gimage->selection_mask, gimp_channel_resize (gimage->selection_mask,
new_width, new_height, offset_x, offset_y); new_width, new_height, offset_x, offset_y);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -646,7 +647,7 @@ gimp_image_scale (GimpImage *gimage,
gint new_width, gint new_width,
gint new_height) gint new_height)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage,
/* Scale all channels */ /* Scale all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_scale (channel, new_width, new_height);
gimp_channel_scale (channel, new_width, new_height);
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
/* if (channel_is_empty(gimage->selection_mask)) /* if (channel_is_empty(gimage->selection_mask))
channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0)
else else
*/ */
channel_scale (gimage->selection_mask, new_width, new_height); gimp_channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
/* Scale all layers */ /* Scale all layers */
@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR; PixelRegion src1PR, destPR, maskPR;
@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR; PixelRegion src1PR, destPR;
@ -1377,7 +1379,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
GimpLayer *layer; GimpLayer *layer;
GSList *layers; GSList *layers;
gboolean retval = TRUE; gboolean retval = TRUE;
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
Tattoo maxval = 0; Tattoo maxval = 0;
Path *pptr = NULL; Path *pptr = NULL;
@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
Tattoo ctattoo; Tattoo ctattoo;
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval) if (ctattoo > maxval)
@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage,
static void static void
project_channel (GimpImage *gimage, project_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2) PixelRegion *src2)
{ {
@ -1599,11 +1601,11 @@ static void
gimp_image_free_channels (GimpImage *gimage) gimp_image_free_channels (GimpImage *gimage)
{ {
GSList *list; GSList *list;
Channel *channel; GimpChannel *channel;
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
gtk_object_unref (GTK_OBJECT (channel)); gtk_object_unref (GTK_OBJECT (channel));
} }
@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage,
gint w, gint w,
gint h) gint h)
{ {
Channel *channel; GimpChannel *channel;
PixelRegion src1PR; PixelRegion src1PR;
PixelRegion src2PR; PixelRegion src2PR;
GSList *list; GSList *list;
@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage,
while (reverse_list) while (reverse_list)
{ {
channel = (Channel *) reverse_list->data; channel = (GimpChannel *) reverse_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{ {
@ -2122,14 +2124,14 @@ void
gimp_image_invalidate_channel_previews (GimpImage *gimage) gimp_image_invalidate_channel_previews (GimpImage *gimage)
{ {
GSList *tmp; GSList *tmp;
Channel *channel; GimpChannel *channel;
g_return_if_fail (gimage != NULL); g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage)); g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{ {
channel = (Channel *) tmp->data; channel = (GimpChannel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
} }
@ -2174,9 +2176,9 @@ gimp_image_get_layer_by_index (const GimpImage *gimage,
gint gint
gimp_image_get_channel_index (const GimpImage *gimage, gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg) const GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
gint index; gint index;
@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels), index++) channels = g_slist_next (channels), index++)
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (channel == channel_arg) if (channel == channel_arg)
return index; return index;
@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage)
return gimage->active_layer; return gimage->active_layer;
} }
Channel * GimpChannel *
gimp_image_get_active_channel (const GimpImage *gimage) gimp_image_get_active_channel (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2235,11 +2237,11 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_tattoo (const GimpImage *gimage, gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tattoo) Tattoo tattoo)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel; return channel;
@ -2257,11 +2259,11 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_name (const GimpImage *gimage, gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel; return channel;
} }
@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_mask (const GimpImage *gimage) gimp_image_get_mask (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage,
return layer; return layer;
} }
Channel * GimpChannel *
gimp_image_set_active_channel (GimpImage *gimage, gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage,
gimage->active_channel = NULL; gimage->active_channel = NULL;
return NULL; return NULL;
} }
channel = (Channel *) gimage->channels->data; channel = (GimpChannel *) gimage->channels->data;
} }
/* Set the active channel */ /* Set the active channel */
@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_unset_active_channel (GimpImage *gimage) gimp_image_unset_active_channel (GimpImage *gimage)
{ {
Channel *channel; GimpChannel *channel;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return mask; return mask;
} }
Channel * GimpChannel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
@ -3362,12 +3364,12 @@ gimp_image_remove_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_raise_channel (GimpImage *gimage, gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *prev_channel; GimpChannel *prev_channel;
GSList *list; GSList *list;
GSList *prev; GSList *prev;
gint index = -1; gint index = -1;
@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (prev) if (prev)
prev_channel = (Channel *) prev->data; prev_channel = (GimpChannel *) prev->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
@ -3411,12 +3413,12 @@ gimp_image_raise_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_lower_channel (GimpImage *gimage, gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *next_channel; GimpChannel *next_channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index = 0; gint index = 0;
@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
next = g_slist_next (list); next = g_slist_next (list);
if (next) if (next)
next_channel = (Channel *) next->data; next_channel = (GimpChannel *) next->data;
index++; index++;
if (channel == channel_arg) if (channel == channel_arg)
@ -3460,12 +3462,12 @@ gimp_image_lower_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_position_channel (GimpImage *gimage, gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint new_index) gint new_index)
{ {
Channel *channel; GimpChannel *channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index; gint index;
@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage,
list; list;
list = g_slist_next (list), index++) list = g_slist_next (list), index++)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
break; break;
@ -3513,9 +3515,9 @@ gimp_image_position_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_add_channel (GimpImage *gimage, gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position) gint position)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_remove_channel (GimpImage *gimage, gimp_image_remove_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage,
if (gimage->active_channel == channel) if (gimage->active_channel == channel)
{ {
if (gimage->channels) if (gimage->channels)
gimage->active_channel = (((Channel *) gimage->channels->data)); gimage->active_channel = (((GimpChannel *) gimage->channels->data));
else else
gimage->active_channel = NULL; gimage->active_channel = NULL;
} }

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */ GSList *layer_stack; /* the layers in MRU order */
GimpLayer *active_layer; /* ID of active layer */ GimpLayer *active_layer; /* ID of active layer */
Channel *active_channel; /* ID of active channel */ GimpChannel *active_channel; /* ID of active channel */
GimpLayer *floating_sel; /* ID of fs layer */ GimpLayer *floating_sel; /* ID of fs layer */
Channel *selection_mask; /* selection mask channel */ GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */ ParasiteList *parasites; /* Plug-in parasite data */
@ -287,16 +287,16 @@ gint gimp_image_get_layer_index (const GimpImage *gimage,
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
@ -306,9 +306,9 @@ gboolean gimp_image_layer_boundary (const GimpImage *gimage,
gint *n_segs); gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer); GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
@ -347,21 +347,21 @@ GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
GimpLayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, GimpChannel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, GimpChannel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,

View file

@ -163,7 +163,7 @@ static void undo_free_cantundo (UndoState, UndoType, gpointer);
/* Sizing functions */ /* Sizing functions */
static gint layer_size (GimpLayer *layer); static gint layer_size (GimpLayer *layer);
static gint channel_size (Channel *channel); static gint channel_size (GimpChannel *channel);
static const gchar * undo_type_to_name (UndoType undo_type); static const gchar * undo_type_to_name (UndoType undo_type);
@ -194,12 +194,12 @@ layer_size (GimpLayer *layer)
static gint static gint
channel_size (Channel *channel) channel_size (GimpChannel *channel)
{ {
gint size; gint size;
size = size =
sizeof (Channel) + sizeof (GimpChannel) +
GIMP_DRAWABLE (channel)->width * GIMP_DRAWABLE (channel)->height + GIMP_DRAWABLE (channel)->width * GIMP_DRAWABLE (channel)->height +
strlen (GIMP_OBJECT (channel)->name); strlen (GIMP_OBJECT (channel)->name);
@ -1027,7 +1027,7 @@ undo_pop_mask (GimpImage *gimage,
{ {
MaskUndo *mask_undo; MaskUndo *mask_undo;
TileManager *new_tiles; TileManager *new_tiles;
Channel *sel_mask; GimpChannel *sel_mask;
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
gint selection; gint selection;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
@ -1040,7 +1040,7 @@ undo_pop_mask (GimpImage *gimage,
/* save current selection mask */ /* save current selection mask */
sel_mask = gimp_image_get_mask (gimage); sel_mask = gimp_image_get_mask (gimage);
selection = channel_bounds (sel_mask, &x1, &y1, &x2, &y2); selection = gimp_channel_bounds (sel_mask, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, GIMP_DRAWABLE (sel_mask)->tiles, pixel_region_init (&srcPR, GIMP_DRAWABLE (sel_mask)->tiles,
x1, y1, (x2 - x1), (y2 - y1), FALSE); x1, y1, (x2 - x1), (y2 - y1), FALSE);
@ -1886,13 +1886,13 @@ gboolean
undo_push_channel_mod (GimpImage *gimage, undo_push_channel_mod (GimpImage *gimage,
gpointer channel_ptr) gpointer channel_ptr)
{ {
Channel *channel; GimpChannel *channel;
TileManager *tiles; TileManager *tiles;
Undo *new; Undo *new;
gpointer *data; gpointer *data;
gint size; gint size;
channel = (Channel *) channel_ptr; channel = (GimpChannel *) channel_ptr;
tiles = GIMP_DRAWABLE (channel)->tiles; tiles = GIMP_DRAWABLE (channel)->tiles;
size = GIMP_DRAWABLE (channel)->width * GIMP_DRAWABLE (channel)->height + size = GIMP_DRAWABLE (channel)->width * GIMP_DRAWABLE (channel)->height +
@ -1927,10 +1927,10 @@ undo_pop_channel_mod (GimpImage *gimage,
gpointer *data; gpointer *data;
TileManager *tiles; TileManager *tiles;
TileManager *temp; TileManager *temp;
Channel *channel; GimpChannel *channel;
data = (gpointer *) data_ptr; data = (gpointer *) data_ptr;
channel = (Channel *) data[0]; channel = (GimpChannel *) data[0];
tiles = (TileManager *) data[1]; tiles = (TileManager *) data[1];

View file

@ -111,12 +111,6 @@ void undo_map_over_redo_stack (GImage *gimage,
UndoType undo_get_undo_top_type (GImage *gimage); UndoType undo_get_undo_top_type (GImage *gimage);
/* Not really appropriate here, since undo_history_new is not defined
* in undo.c, but it saves on having a full header file for just one
* function prototype. */
GtkWidget *undo_history_new (GImage *gimage);
/* Argument to undo_event signal emitted by gimages: */ /* Argument to undo_event signal emitted by gimages: */
typedef enum typedef enum
{ {

View file

@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage,
PixelRegion *dest, PixelRegion *dest,
PixelRegion *mask); PixelRegion *mask);
static void project_channel (GimpImage *gimage, static void project_channel (GimpImage *gimage,
Channel *layer, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2); PixelRegion *src2);
@ -437,8 +437,9 @@ gimp_image_new (gint width,
} }
/* create the selection mask */ /* create the selection mask */
gimage->selection_mask = channel_new_mask (gimage, gimage->selection_mask = gimp_channel_new_mask (gimage,
gimage->width, gimage->height); gimage->width,
gimage->height);
return gimage; return gimage;
@ -552,7 +553,7 @@ gimp_image_resize (GimpImage *gimage,
gint offset_x, gint offset_x,
gint offset_y) gint offset_y)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage,
/* Resize all channels */ /* Resize all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_resize (channel, new_width, new_height, offset_x, offset_y); gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y);
} }
/* Reposition or remove any guides */ /* Reposition or remove any guides */
@ -617,7 +618,7 @@ gimp_image_resize (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
channel_resize (gimage->selection_mask, gimp_channel_resize (gimage->selection_mask,
new_width, new_height, offset_x, offset_y); new_width, new_height, offset_x, offset_y);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -646,7 +647,7 @@ gimp_image_scale (GimpImage *gimage,
gint new_width, gint new_width,
gint new_height) gint new_height)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage,
/* Scale all channels */ /* Scale all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_scale (channel, new_width, new_height);
gimp_channel_scale (channel, new_width, new_height);
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
/* if (channel_is_empty(gimage->selection_mask)) /* if (channel_is_empty(gimage->selection_mask))
channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0)
else else
*/ */
channel_scale (gimage->selection_mask, new_width, new_height); gimp_channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
/* Scale all layers */ /* Scale all layers */
@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR; PixelRegion src1PR, destPR, maskPR;
@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR; PixelRegion src1PR, destPR;
@ -1377,7 +1379,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
GimpLayer *layer; GimpLayer *layer;
GSList *layers; GSList *layers;
gboolean retval = TRUE; gboolean retval = TRUE;
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
Tattoo maxval = 0; Tattoo maxval = 0;
Path *pptr = NULL; Path *pptr = NULL;
@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
Tattoo ctattoo; Tattoo ctattoo;
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval) if (ctattoo > maxval)
@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage,
static void static void
project_channel (GimpImage *gimage, project_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2) PixelRegion *src2)
{ {
@ -1599,11 +1601,11 @@ static void
gimp_image_free_channels (GimpImage *gimage) gimp_image_free_channels (GimpImage *gimage)
{ {
GSList *list; GSList *list;
Channel *channel; GimpChannel *channel;
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
gtk_object_unref (GTK_OBJECT (channel)); gtk_object_unref (GTK_OBJECT (channel));
} }
@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage,
gint w, gint w,
gint h) gint h)
{ {
Channel *channel; GimpChannel *channel;
PixelRegion src1PR; PixelRegion src1PR;
PixelRegion src2PR; PixelRegion src2PR;
GSList *list; GSList *list;
@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage,
while (reverse_list) while (reverse_list)
{ {
channel = (Channel *) reverse_list->data; channel = (GimpChannel *) reverse_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{ {
@ -2122,14 +2124,14 @@ void
gimp_image_invalidate_channel_previews (GimpImage *gimage) gimp_image_invalidate_channel_previews (GimpImage *gimage)
{ {
GSList *tmp; GSList *tmp;
Channel *channel; GimpChannel *channel;
g_return_if_fail (gimage != NULL); g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage)); g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{ {
channel = (Channel *) tmp->data; channel = (GimpChannel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
} }
@ -2174,9 +2176,9 @@ gimp_image_get_layer_by_index (const GimpImage *gimage,
gint gint
gimp_image_get_channel_index (const GimpImage *gimage, gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg) const GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
gint index; gint index;
@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels), index++) channels = g_slist_next (channels), index++)
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (channel == channel_arg) if (channel == channel_arg)
return index; return index;
@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage)
return gimage->active_layer; return gimage->active_layer;
} }
Channel * GimpChannel *
gimp_image_get_active_channel (const GimpImage *gimage) gimp_image_get_active_channel (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2235,11 +2237,11 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_tattoo (const GimpImage *gimage, gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tattoo) Tattoo tattoo)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel; return channel;
@ -2257,11 +2259,11 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_name (const GimpImage *gimage, gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel; return channel;
} }
@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_mask (const GimpImage *gimage) gimp_image_get_mask (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage,
return layer; return layer;
} }
Channel * GimpChannel *
gimp_image_set_active_channel (GimpImage *gimage, gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage,
gimage->active_channel = NULL; gimage->active_channel = NULL;
return NULL; return NULL;
} }
channel = (Channel *) gimage->channels->data; channel = (GimpChannel *) gimage->channels->data;
} }
/* Set the active channel */ /* Set the active channel */
@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_unset_active_channel (GimpImage *gimage) gimp_image_unset_active_channel (GimpImage *gimage)
{ {
Channel *channel; GimpChannel *channel;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return mask; return mask;
} }
Channel * GimpChannel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
@ -3362,12 +3364,12 @@ gimp_image_remove_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_raise_channel (GimpImage *gimage, gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *prev_channel; GimpChannel *prev_channel;
GSList *list; GSList *list;
GSList *prev; GSList *prev;
gint index = -1; gint index = -1;
@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (prev) if (prev)
prev_channel = (Channel *) prev->data; prev_channel = (GimpChannel *) prev->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
@ -3411,12 +3413,12 @@ gimp_image_raise_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_lower_channel (GimpImage *gimage, gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *next_channel; GimpChannel *next_channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index = 0; gint index = 0;
@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
next = g_slist_next (list); next = g_slist_next (list);
if (next) if (next)
next_channel = (Channel *) next->data; next_channel = (GimpChannel *) next->data;
index++; index++;
if (channel == channel_arg) if (channel == channel_arg)
@ -3460,12 +3462,12 @@ gimp_image_lower_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_position_channel (GimpImage *gimage, gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint new_index) gint new_index)
{ {
Channel *channel; GimpChannel *channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index; gint index;
@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage,
list; list;
list = g_slist_next (list), index++) list = g_slist_next (list), index++)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
break; break;
@ -3513,9 +3515,9 @@ gimp_image_position_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_add_channel (GimpImage *gimage, gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position) gint position)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_remove_channel (GimpImage *gimage, gimp_image_remove_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage,
if (gimage->active_channel == channel) if (gimage->active_channel == channel)
{ {
if (gimage->channels) if (gimage->channels)
gimage->active_channel = (((Channel *) gimage->channels->data)); gimage->active_channel = (((GimpChannel *) gimage->channels->data));
else else
gimage->active_channel = NULL; gimage->active_channel = NULL;
} }

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */ GSList *layer_stack; /* the layers in MRU order */
GimpLayer *active_layer; /* ID of active layer */ GimpLayer *active_layer; /* ID of active layer */
Channel *active_channel; /* ID of active channel */ GimpChannel *active_channel; /* ID of active channel */
GimpLayer *floating_sel; /* ID of fs layer */ GimpLayer *floating_sel; /* ID of fs layer */
Channel *selection_mask; /* selection mask channel */ GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */ ParasiteList *parasites; /* Plug-in parasite data */
@ -287,16 +287,16 @@ gint gimp_image_get_layer_index (const GimpImage *gimage,
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
@ -306,9 +306,9 @@ gboolean gimp_image_layer_boundary (const GimpImage *gimage,
gint *n_segs); gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer); GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
@ -347,21 +347,21 @@ GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
GimpLayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, GimpChannel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, GimpChannel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,

View file

@ -742,7 +742,7 @@ gimp_layer_scale_lowlevel (GimpLayer *layer,
{ {
GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x; GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x;
GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y; GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y;
channel_scale (GIMP_CHANNEL (layer->mask), new_width, new_height); gimp_channel_scale (GIMP_CHANNEL (layer->mask), new_width, new_height);
} }
/* Make sure we're not caching any old selection info */ /* Make sure we're not caching any old selection info */
@ -1016,7 +1016,7 @@ gimp_layer_resize (GimpLayer *layer,
{ {
GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x; GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x;
GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y; GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y;
channel_resize (GIMP_CHANNEL (layer->mask), gimp_channel_resize (GIMP_CHANNEL (layer->mask),
new_width, new_height, offx, offy); new_width, new_height, offx, offy);
} }
@ -1115,7 +1115,7 @@ void
gimp_layer_invalidate_boundary (GimpLayer *layer) gimp_layer_invalidate_boundary (GimpLayer *layer)
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *mask; GimpChannel *mask;
/* first get the selection mask channel */ /* first get the selection mask channel */
if (! (gimage = gimp_drawable_gimage (GIMP_DRAWABLE (layer)))) if (! (gimage = gimp_drawable_gimage (GIMP_DRAWABLE (layer))))
@ -1130,7 +1130,7 @@ gimp_layer_invalidate_boundary (GimpLayer *layer)
mask = gimp_image_get_mask (gimage); mask = gimp_image_get_mask (gimage);
/* Only bother with the bounds if there is a selection */ /* Only bother with the bounds if there is a selection */
if (! channel_is_empty (mask)) if (! gimp_channel_is_empty (mask))
{ {
mask->bounds_known = FALSE; mask->bounds_known = FALSE;
mask->boundary_known = FALSE; mask->boundary_known = FALSE;

View file

@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage,
PixelRegion *dest, PixelRegion *dest,
PixelRegion *mask); PixelRegion *mask);
static void project_channel (GimpImage *gimage, static void project_channel (GimpImage *gimage,
Channel *layer, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2); PixelRegion *src2);
@ -437,8 +437,9 @@ gimp_image_new (gint width,
} }
/* create the selection mask */ /* create the selection mask */
gimage->selection_mask = channel_new_mask (gimage, gimage->selection_mask = gimp_channel_new_mask (gimage,
gimage->width, gimage->height); gimage->width,
gimage->height);
return gimage; return gimage;
@ -552,7 +553,7 @@ gimp_image_resize (GimpImage *gimage,
gint offset_x, gint offset_x,
gint offset_y) gint offset_y)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage,
/* Resize all channels */ /* Resize all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_resize (channel, new_width, new_height, offset_x, offset_y); gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y);
} }
/* Reposition or remove any guides */ /* Reposition or remove any guides */
@ -617,7 +618,7 @@ gimp_image_resize (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
channel_resize (gimage->selection_mask, gimp_channel_resize (gimage->selection_mask,
new_width, new_height, offset_x, offset_y); new_width, new_height, offset_x, offset_y);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -646,7 +647,7 @@ gimp_image_scale (GimpImage *gimage,
gint new_width, gint new_width,
gint new_height) gint new_height)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage,
/* Scale all channels */ /* Scale all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_scale (channel, new_width, new_height);
gimp_channel_scale (channel, new_width, new_height);
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
/* if (channel_is_empty(gimage->selection_mask)) /* if (channel_is_empty(gimage->selection_mask))
channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0)
else else
*/ */
channel_scale (gimage->selection_mask, new_width, new_height); gimp_channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
/* Scale all layers */ /* Scale all layers */
@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR; PixelRegion src1PR, destPR, maskPR;
@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR; PixelRegion src1PR, destPR;
@ -1377,7 +1379,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
GimpLayer *layer; GimpLayer *layer;
GSList *layers; GSList *layers;
gboolean retval = TRUE; gboolean retval = TRUE;
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
Tattoo maxval = 0; Tattoo maxval = 0;
Path *pptr = NULL; Path *pptr = NULL;
@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
Tattoo ctattoo; Tattoo ctattoo;
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval) if (ctattoo > maxval)
@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage,
static void static void
project_channel (GimpImage *gimage, project_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2) PixelRegion *src2)
{ {
@ -1599,11 +1601,11 @@ static void
gimp_image_free_channels (GimpImage *gimage) gimp_image_free_channels (GimpImage *gimage)
{ {
GSList *list; GSList *list;
Channel *channel; GimpChannel *channel;
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
gtk_object_unref (GTK_OBJECT (channel)); gtk_object_unref (GTK_OBJECT (channel));
} }
@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage,
gint w, gint w,
gint h) gint h)
{ {
Channel *channel; GimpChannel *channel;
PixelRegion src1PR; PixelRegion src1PR;
PixelRegion src2PR; PixelRegion src2PR;
GSList *list; GSList *list;
@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage,
while (reverse_list) while (reverse_list)
{ {
channel = (Channel *) reverse_list->data; channel = (GimpChannel *) reverse_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{ {
@ -2122,14 +2124,14 @@ void
gimp_image_invalidate_channel_previews (GimpImage *gimage) gimp_image_invalidate_channel_previews (GimpImage *gimage)
{ {
GSList *tmp; GSList *tmp;
Channel *channel; GimpChannel *channel;
g_return_if_fail (gimage != NULL); g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage)); g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{ {
channel = (Channel *) tmp->data; channel = (GimpChannel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
} }
@ -2174,9 +2176,9 @@ gimp_image_get_layer_by_index (const GimpImage *gimage,
gint gint
gimp_image_get_channel_index (const GimpImage *gimage, gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg) const GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
gint index; gint index;
@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels), index++) channels = g_slist_next (channels), index++)
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (channel == channel_arg) if (channel == channel_arg)
return index; return index;
@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage)
return gimage->active_layer; return gimage->active_layer;
} }
Channel * GimpChannel *
gimp_image_get_active_channel (const GimpImage *gimage) gimp_image_get_active_channel (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2235,11 +2237,11 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_tattoo (const GimpImage *gimage, gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tattoo) Tattoo tattoo)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel; return channel;
@ -2257,11 +2259,11 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_name (const GimpImage *gimage, gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel; return channel;
} }
@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_mask (const GimpImage *gimage) gimp_image_get_mask (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage,
return layer; return layer;
} }
Channel * GimpChannel *
gimp_image_set_active_channel (GimpImage *gimage, gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage,
gimage->active_channel = NULL; gimage->active_channel = NULL;
return NULL; return NULL;
} }
channel = (Channel *) gimage->channels->data; channel = (GimpChannel *) gimage->channels->data;
} }
/* Set the active channel */ /* Set the active channel */
@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_unset_active_channel (GimpImage *gimage) gimp_image_unset_active_channel (GimpImage *gimage)
{ {
Channel *channel; GimpChannel *channel;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return mask; return mask;
} }
Channel * GimpChannel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
@ -3362,12 +3364,12 @@ gimp_image_remove_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_raise_channel (GimpImage *gimage, gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *prev_channel; GimpChannel *prev_channel;
GSList *list; GSList *list;
GSList *prev; GSList *prev;
gint index = -1; gint index = -1;
@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (prev) if (prev)
prev_channel = (Channel *) prev->data; prev_channel = (GimpChannel *) prev->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
@ -3411,12 +3413,12 @@ gimp_image_raise_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_lower_channel (GimpImage *gimage, gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *next_channel; GimpChannel *next_channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index = 0; gint index = 0;
@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
next = g_slist_next (list); next = g_slist_next (list);
if (next) if (next)
next_channel = (Channel *) next->data; next_channel = (GimpChannel *) next->data;
index++; index++;
if (channel == channel_arg) if (channel == channel_arg)
@ -3460,12 +3462,12 @@ gimp_image_lower_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_position_channel (GimpImage *gimage, gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint new_index) gint new_index)
{ {
Channel *channel; GimpChannel *channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index; gint index;
@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage,
list; list;
list = g_slist_next (list), index++) list = g_slist_next (list), index++)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
break; break;
@ -3513,9 +3515,9 @@ gimp_image_position_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_add_channel (GimpImage *gimage, gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position) gint position)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_remove_channel (GimpImage *gimage, gimp_image_remove_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage,
if (gimage->active_channel == channel) if (gimage->active_channel == channel)
{ {
if (gimage->channels) if (gimage->channels)
gimage->active_channel = (((Channel *) gimage->channels->data)); gimage->active_channel = (((GimpChannel *) gimage->channels->data));
else else
gimage->active_channel = NULL; gimage->active_channel = NULL;
} }

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */ GSList *layer_stack; /* the layers in MRU order */
GimpLayer *active_layer; /* ID of active layer */ GimpLayer *active_layer; /* ID of active layer */
Channel *active_channel; /* ID of active channel */ GimpChannel *active_channel; /* ID of active channel */
GimpLayer *floating_sel; /* ID of fs layer */ GimpLayer *floating_sel; /* ID of fs layer */
Channel *selection_mask; /* selection mask channel */ GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */ ParasiteList *parasites; /* Plug-in parasite data */
@ -287,16 +287,16 @@ gint gimp_image_get_layer_index (const GimpImage *gimage,
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
@ -306,9 +306,9 @@ gboolean gimp_image_layer_boundary (const GimpImage *gimage,
gint *n_segs); gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer); GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
@ -347,21 +347,21 @@ GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
GimpLayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, GimpChannel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, GimpChannel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,

View file

@ -1448,7 +1448,8 @@ gdisplay_mask_bounds (GDisplay *gdisp,
{ {
gimp_drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y); gimp_drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y);
if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) if (! gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage),
x1, y1, x2, y2))
{ {
*x1 = off_x; *x1 = off_x;
*y1 = off_y; *y1 = off_y;
@ -1463,7 +1464,8 @@ gdisplay_mask_bounds (GDisplay *gdisp,
*y2 = MAX (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), *y2); *y2 = MAX (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), *y2);
} }
} }
else if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) else if (! gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage),
x1, y1, x2, y2))
return FALSE; return FALSE;
gdisplay_transform_coords (gdisp, *x1, *y1, x1, y1, 0); gdisplay_transform_coords (gdisp, *x1, *y1, x1, y1, 0);

View file

@ -235,11 +235,11 @@ scan_converter_add_points (ScanConverter *sc,
* according to the even-odd rule. The polygon is closed by * according to the even-odd rule. The polygon is closed by
* joining the final point to the initial point. * joining the final point to the initial point.
*/ */
Channel * GimpChannel *
scan_converter_to_channel (ScanConverter *sc, scan_converter_to_channel (ScanConverter *sc,
GimpImage *gimage) GimpImage *gimage)
{ {
Channel *mask; GimpChannel *mask;
GSList *list; GSList *list;
PixelRegion maskPR; PixelRegion maskPR;
guint widtha; guint widtha;
@ -267,7 +267,7 @@ scan_converter_to_channel (ScanConverter *sc,
(int) sc->first.y * antialias); (int) sc->first.y * antialias);
} }
mask = channel_new_mask (gimage, sc->width, sc->height); mask = gimp_channel_new_mask (gimage, sc->width, sc->height);
buf = g_new0 (guchar, sc->width); buf = g_new0 (guchar, sc->width);
widtha = sc->width * antialias; widtha = sc->width * antialias;
@ -320,7 +320,7 @@ scan_converter_to_channel (ScanConverter *sc,
{ {
if (antialias == 1) if (antialias == 1)
{ {
channel_add_segment (mask, x, i, w, 255); gimp_channel_add_segment (mask, x, i, w, 255);
} }
else else
{ {

View file

@ -53,7 +53,7 @@ void scan_converter_add_points (ScanConverter *scan_converter,
* according to the even-odd rule. The polygon is closed by * according to the even-odd rule. The polygon is closed by
* joining the final point to the initial point. * joining the final point to the initial point.
*/ */
Channel * scan_converter_to_channel (ScanConverter *scan_converter, GimpChannel * scan_converter_to_channel (ScanConverter *scan_converter,
GimpImage *gimage); GimpImage *gimage);

View file

@ -753,14 +753,14 @@ gdisplay_drag_drop (GtkWidget *widget,
{ {
GimpDrawable *drawable = NULL; GimpDrawable *drawable = NULL;
GimpLayer *layer = NULL; GimpLayer *layer = NULL;
Channel *channel = NULL; GimpChannel *channel = NULL;
GimpLayerMask *layer_mask = NULL; GimpLayerMask *layer_mask = NULL;
GimpImage *component = NULL; GimpImage *component = NULL;
ChannelType component_type = -1; ChannelType component_type = -1;
layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget), layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer"); "gimp_layer");
channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), channel = (GimpChannel *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_channel"); "gimp_channel");
layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer_mask"); "gimp_layer_mask");

View file

@ -753,14 +753,14 @@ gdisplay_drag_drop (GtkWidget *widget,
{ {
GimpDrawable *drawable = NULL; GimpDrawable *drawable = NULL;
GimpLayer *layer = NULL; GimpLayer *layer = NULL;
Channel *channel = NULL; GimpChannel *channel = NULL;
GimpLayerMask *layer_mask = NULL; GimpLayerMask *layer_mask = NULL;
GimpImage *component = NULL; GimpImage *component = NULL;
ChannelType component_type = -1; ChannelType component_type = -1;
layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget), layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer"); "gimp_layer");
channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), channel = (GimpChannel *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_channel"); "gimp_channel");
layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer_mask"); "gimp_layer_mask");

View file

@ -1448,7 +1448,8 @@ gdisplay_mask_bounds (GDisplay *gdisp,
{ {
gimp_drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y); gimp_drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y);
if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) if (! gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage),
x1, y1, x2, y2))
{ {
*x1 = off_x; *x1 = off_x;
*y1 = off_y; *y1 = off_y;
@ -1463,7 +1464,8 @@ gdisplay_mask_bounds (GDisplay *gdisp,
*y2 = MAX (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), *y2); *y2 = MAX (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), *y2);
} }
} }
else if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) else if (! gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage),
x1, y1, x2, y2))
return FALSE; return FALSE;
gdisplay_transform_coords (gdisp, *x1, *y1, x1, y1, 0); gdisplay_transform_coords (gdisp, *x1, *y1, x1, y1, 0);

View file

@ -753,14 +753,14 @@ gdisplay_drag_drop (GtkWidget *widget,
{ {
GimpDrawable *drawable = NULL; GimpDrawable *drawable = NULL;
GimpLayer *layer = NULL; GimpLayer *layer = NULL;
Channel *channel = NULL; GimpChannel *channel = NULL;
GimpLayerMask *layer_mask = NULL; GimpLayerMask *layer_mask = NULL;
GimpImage *component = NULL; GimpImage *component = NULL;
ChannelType component_type = -1; ChannelType component_type = -1;
layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget), layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer"); "gimp_layer");
channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), channel = (GimpChannel *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_channel"); "gimp_channel");
layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer_mask"); "gimp_layer_mask");

View file

@ -232,7 +232,7 @@ qmask_activate (GtkWidget *widget,
floating_sel_to_layer (layer); floating_sel_to_layer (layer);
} }
gmask = channel_new (gimg, gmask = gimp_channel_new (gimg,
gimg->width, gimg->width,
gimg->height, gimg->height,
"Qmask", "Qmask",
@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget,
{ {
/* if selection */ /* if selection */
gmask = channel_copy (gimp_image_get_mask (gimg)); gmask = gimp_channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0); gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, &color); gimp_channel_set_color (gmask, &color);
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask"); gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
gimage_mask_none (gimg); /* Clear the selection */ gimage_mask_none (gimg); /* Clear the selection */
} }
@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
EditQmaskOptions *options; EditQmaskOptions *options;
Channel *channel; GimpChannel *channel;
GimpRGB color; GimpRGB color;
options = (EditQmaskOptions *) data; options = (EditQmaskOptions *) data;
@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001) if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{ {
channel->color = color; channel->color = color;
channel_update (channel); gimp_channel_update (channel);
} }
} }

View file

@ -1448,7 +1448,8 @@ gdisplay_mask_bounds (GDisplay *gdisp,
{ {
gimp_drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y); gimp_drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y);
if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) if (! gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage),
x1, y1, x2, y2))
{ {
*x1 = off_x; *x1 = off_x;
*y1 = off_y; *y1 = off_y;
@ -1463,7 +1464,8 @@ gdisplay_mask_bounds (GDisplay *gdisp,
*y2 = MAX (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), *y2); *y2 = MAX (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), *y2);
} }
} }
else if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) else if (! gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage),
x1, y1, x2, y2))
return FALSE; return FALSE;
gdisplay_transform_coords (gdisp, *x1, *y1, x1, y1, 0); gdisplay_transform_coords (gdisp, *x1, *y1, x1, y1, 0);

View file

@ -75,7 +75,7 @@ gimage_mask_boundary (GImage *gimage,
*/ */
/* Find the selection mask boundary */ /* Find the selection mask boundary */
channel_boundary (gimp_image_get_mask (gimage), gimp_channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out, segs_in, segs_out,
num_segs_in, num_segs_out, num_segs_in, num_segs_out,
0, 0, 0, 0); 0, 0, 0, 0);
@ -89,7 +89,7 @@ gimage_mask_boundary (GImage *gimage,
else if ((d = gimp_image_active_drawable (gimage)) && else if ((d = gimp_image_active_drawable (gimage)) &&
GIMP_IS_CHANNEL (d)) GIMP_IS_CHANNEL (d))
{ {
return channel_boundary (gimp_image_get_mask (gimage), return gimp_channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out, segs_in, segs_out,
num_segs_in, num_segs_out, num_segs_in, num_segs_out,
0, 0, gimage->width, gimage->height); 0, 0, gimage->width, gimage->height);
@ -107,7 +107,7 @@ gimage_mask_boundary (GImage *gimage,
y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE(layer)), 0, y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE(layer)), 0,
gimage->height); gimage->height);
return channel_boundary (gimp_image_get_mask (gimage), return gimp_channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out, segs_in, segs_out,
num_segs_in, num_segs_out, num_segs_in, num_segs_out,
x1, y1, x2, y2); x1, y1, x2, y2);
@ -130,7 +130,7 @@ gimage_mask_bounds (GImage *gimage,
gint *x2, gint *x2,
gint *y2) gint *y2)
{ {
return channel_bounds (gimp_image_get_mask (gimage), x1, y1, x2, y2); return gimp_channel_bounds (gimp_image_get_mask (gimage), x1, y1, x2, y2);
} }
@ -138,7 +138,7 @@ void
gimage_mask_invalidate (GImage *gimage) gimage_mask_invalidate (GImage *gimage)
{ {
GimpLayer *layer; GimpLayer *layer;
Channel *mask; GimpChannel *mask;
/* Turn the current selection off */ /* Turn the current selection off */
gdisplays_selection_visibility (gimage, SelectionOff); gdisplays_selection_visibility (gimage, SelectionOff);
@ -163,7 +163,7 @@ gimage_mask_value (GImage *gimage,
int x, int x,
int y) int y)
{ {
return channel_value (gimp_image_get_mask (gimage), x, y); return gimp_channel_value (gimp_image_get_mask (gimage), x, y);
} }
@ -177,7 +177,7 @@ gimage_mask_is_empty (GImage *gimage)
if (gimage_mask_stroking) if (gimage_mask_stroking)
return TRUE; return TRUE;
else else
return channel_is_empty (gimp_image_get_mask (gimage)); return gimp_channel_is_empty (gimp_image_get_mask (gimage));
} }
@ -186,7 +186,7 @@ gimage_mask_translate (GImage *gimage,
gint off_x, gint off_x,
gint off_y) gint off_y)
{ {
channel_translate (gimp_image_get_mask (gimage), off_x, off_y); gimp_channel_translate (gimp_image_get_mask (gimage), off_x, off_y);
} }
@ -197,8 +197,8 @@ gimage_mask_extract (GImage *gimage,
gboolean keep_indexed, gboolean keep_indexed,
gboolean add_alpha) gboolean add_alpha)
{ {
TileManager * tiles; TileManager *tiles;
Channel * sel_mask; GimpChannel *sel_mask;
PixelRegion srcPR, destPR, maskPR; PixelRegion srcPR, destPR, maskPR;
guchar bg[MAX_CHANNELS]; guchar bg[MAX_CHANNELS];
gint bytes, type; gint bytes, type;
@ -293,7 +293,7 @@ gimage_mask_extract (GImage *gimage,
if (cut_gimage) if (cut_gimage)
{ {
/* Clear the region */ /* Clear the region */
channel_clear (gimp_image_get_mask (gimage)); gimp_channel_clear (gimp_image_get_mask (gimage));
/* Update the region */ /* Update the region */
gdisplays_update_area (gimage, gdisplays_update_area (gimage,
@ -350,7 +350,7 @@ gimage_mask_float (GImage *gimage,
gint off_y) gint off_y)
{ {
GimpLayer *layer; GimpLayer *layer;
Channel *mask = gimp_image_get_mask (gimage); GimpChannel *mask = gimp_image_get_mask (gimage);
TileManager *tiles; TileManager *tiles;
gboolean non_empty; gboolean non_empty;
gint x1, y1; gint x1, y1;
@ -401,21 +401,21 @@ gimage_mask_float (GImage *gimage,
void void
gimage_mask_clear (GImage *gimage) gimage_mask_clear (GImage *gimage)
{ {
channel_clear (gimp_image_get_mask (gimage)); gimp_channel_clear (gimp_image_get_mask (gimage));
} }
void void
gimage_mask_undo (GImage *gimage) gimage_mask_undo (GImage *gimage)
{ {
channel_push_undo (gimp_image_get_mask (gimage)); gimp_channel_push_undo (gimp_image_get_mask (gimage));
} }
void void
gimage_mask_invert (GImage *gimage) gimage_mask_invert (GImage *gimage)
{ {
channel_invert (gimp_image_get_mask (gimage)); gimp_channel_invert (gimp_image_get_mask (gimage));
} }
@ -425,21 +425,21 @@ gimage_mask_sharpen (GImage *gimage)
/* No need to play with the selection visibility /* No need to play with the selection visibility
* because sharpen will not change the outline * because sharpen will not change the outline
*/ */
channel_sharpen (gimp_image_get_mask (gimage)); gimp_channel_sharpen (gimp_image_get_mask (gimage));
} }
void void
gimage_mask_all (GImage *gimage) gimage_mask_all (GImage *gimage)
{ {
channel_all (gimp_image_get_mask (gimage)); gimp_channel_all (gimp_image_get_mask (gimage));
} }
void void
gimage_mask_none (GImage *gimage) gimage_mask_none (GImage *gimage)
{ {
channel_clear (gimp_image_get_mask (gimage)); gimp_channel_clear (gimp_image_get_mask (gimage));
} }
@ -449,12 +449,12 @@ gimage_mask_feather (GImage *gimage,
gdouble feather_radius_y) gdouble feather_radius_y)
{ {
/* push the current mask onto the undo stack--need to do this here because /* push the current mask onto the undo stack--need to do this here because
* channel_feather doesn't do it * gimp_channel_feather doesn't do it
*/ */
channel_push_undo (gimp_image_get_mask (gimage)); gimp_channel_push_undo (gimp_image_get_mask (gimage));
/* feather the region */ /* feather the region */
channel_feather (gimp_image_get_mask (gimage), gimp_channel_feather (gimp_image_get_mask (gimage),
gimp_image_get_mask (gimage), gimp_image_get_mask (gimage),
feather_radius_x, feather_radius_x,
feather_radius_y, feather_radius_y,
@ -468,7 +468,7 @@ gimage_mask_border (GImage *gimage,
gint border_radius_y) gint border_radius_y)
{ {
/* feather the region */ /* feather the region */
channel_border (gimp_image_get_mask (gimage), gimp_channel_border (gimp_image_get_mask (gimage),
border_radius_x, border_radius_x,
border_radius_y); border_radius_y);
} }
@ -480,7 +480,7 @@ gimage_mask_grow (GImage *gimage,
int grow_pixels_y) int grow_pixels_y)
{ {
/* feather the region */ /* feather the region */
channel_grow (gimp_image_get_mask (gimage), gimp_channel_grow (gimp_image_get_mask (gimage),
grow_pixels_x, grow_pixels_x,
grow_pixels_y); grow_pixels_y);
} }
@ -493,7 +493,7 @@ gimage_mask_shrink (GImage *gimage,
gboolean edge_lock) gboolean edge_lock)
{ {
/* feather the region */ /* feather the region */
channel_shrink (gimp_image_get_mask (gimage), gimp_channel_shrink (gimp_image_get_mask (gimage),
shrink_pixels_x, shrink_pixels_x,
shrink_pixels_y, shrink_pixels_y,
edge_lock); edge_lock);
@ -508,7 +508,7 @@ gimage_mask_layer_alpha (GimpImage *gimage,
if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer))) if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)))
{ {
/* load the mask with the given layer's alpha channel */ /* load the mask with the given layer's alpha channel */
channel_layer_alpha (gimp_image_get_mask (gimage), layer); gimp_channel_layer_alpha (gimp_image_get_mask (gimage), layer);
} }
else else
{ {
@ -527,7 +527,7 @@ gimage_mask_layer_mask (GimpImage *gimage,
if (gimp_layer_get_mask (layer)) if (gimp_layer_get_mask (layer))
{ {
/* load the mask with the given layer's alpha channel */ /* load the mask with the given layer's alpha channel */
channel_layer_mask (gimp_image_get_mask (gimage), layer); gimp_channel_layer_mask (gimp_image_get_mask (gimage), layer);
} }
else else
{ {
@ -540,19 +540,19 @@ gimage_mask_layer_mask (GimpImage *gimage,
void void
gimage_mask_load (GImage *gimage, gimage_mask_load (GImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
/* Load the specified channel to the gimage mask */ /* Load the specified channel to the gimage mask */
channel_load (gimp_image_get_mask (gimage), (channel)); gimp_channel_load (gimp_image_get_mask (gimage), (channel));
} }
Channel * GimpChannel *
gimage_mask_save (GImage *gimage) gimage_mask_save (GImage *gimage)
{ {
Channel *new_channel; GimpChannel *new_channel;
new_channel = channel_copy (gimp_image_get_mask (gimage)); new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
/* saved selections are not visible by default */ /* saved selections are not visible by default */
GIMP_DRAWABLE(new_channel)->visible = FALSE; GIMP_DRAWABLE(new_channel)->visible = FALSE;

View file

@ -86,9 +86,9 @@ void gimage_mask_layer_mask (GImage *gimage,
GimpLayer *layer); GimpLayer *layer);
void gimage_mask_load (GImage *gimage, void gimage_mask_load (GImage *gimage,
Channel *channel); GimpChannel *channel);
Channel * gimage_mask_save (GImage *gimage); GimpChannel * gimage_mask_save (GImage *gimage);
gboolean gimage_mask_stroke (GImage *gimage, gboolean gimage_mask_stroke (GImage *gimage,
GimpDrawable *drawable); GimpDrawable *drawable);

View file

@ -54,7 +54,7 @@ static void gimp_channel_class_init (GimpChannelClass *klass);
static void gimp_channel_init (GimpChannel *channel); static void gimp_channel_init (GimpChannel *channel);
static void gimp_channel_destroy (GtkObject *object); static void gimp_channel_destroy (GtkObject *object);
static TempBuf * channel_preview_private (Channel *channel, static TempBuf * gimp_channel_preview_private (GimpChannel *channel,
gint width, gint width,
gint height); gint height);
@ -109,7 +109,7 @@ gimp_channel_init (GimpChannel *channel)
/**************************/ /**************************/
static void static void
channel_validate (TileManager *tm, gimp_channel_validate (TileManager *tm,
Tile *tile) Tile *tile)
{ {
/* Set the contents of the tile to empty */ /* Set the contents of the tile to empty */
@ -117,14 +117,14 @@ channel_validate (TileManager *tm,
TRANSPARENT_OPACITY, tile_size (tile)); TRANSPARENT_OPACITY, tile_size (tile));
} }
Channel * GimpChannel *
channel_new (GimpImage *gimage, gimp_channel_new (GimpImage *gimage,
gint width, gint width,
gint height, gint height,
const gchar *name, const gchar *name,
const GimpRGB *color) const GimpRGB *color)
{ {
Channel *channel; GimpChannel *channel;
g_return_val_if_fail (color != NULL, NULL); g_return_val_if_fail (color != NULL, NULL);
@ -154,11 +154,11 @@ channel_new (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
channel_copy (const Channel *channel) gimp_channel_copy (const GimpChannel *channel)
{ {
gchar *channel_name; gchar *channel_name;
Channel *new_channel; GimpChannel *new_channel;
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
gchar *ext; gchar *ext;
gint number; gint number;
@ -180,7 +180,7 @@ channel_copy (const Channel *channel)
channel_name = g_strdup_printf (_("%s copy"), name); channel_name = g_strdup_printf (_("%s copy"), name);
/* allocate a new channel object */ /* allocate a new channel object */
new_channel = channel_new (GIMP_DRAWABLE (channel)->gimage, new_channel = gimp_channel_new (GIMP_DRAWABLE (channel)->gimage,
GIMP_DRAWABLE (channel)->width, GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height, GIMP_DRAWABLE (channel)->height,
channel_name, channel_name,
@ -209,7 +209,7 @@ channel_copy (const Channel *channel)
} }
void void
channel_set_color (Channel *channel, gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color) const GimpRGB *color)
{ {
g_return_if_fail (channel != NULL); g_return_if_fail (channel != NULL);
@ -220,7 +220,7 @@ channel_set_color (Channel *channel,
} }
const GimpRGB * const GimpRGB *
channel_get_color (const Channel *channel) gimp_channel_get_color (const GimpChannel *channel)
{ {
g_return_val_if_fail (channel != NULL, NULL); g_return_val_if_fail (channel != NULL, NULL);
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), NULL); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), NULL);
@ -229,7 +229,7 @@ channel_get_color (const Channel *channel)
} }
gint gint
channel_get_opacity (const Channel *channel) gimp_channel_get_opacity (const GimpChannel *channel)
{ {
g_return_val_if_fail (channel != NULL, 0); g_return_val_if_fail (channel != NULL, 0);
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0);
@ -238,7 +238,7 @@ channel_get_opacity (const Channel *channel)
} }
void void
channel_set_opacity (Channel *channel, gimp_channel_set_opacity (GimpChannel *channel,
gint opacity) gint opacity)
{ {
g_return_if_fail (channel != NULL); g_return_if_fail (channel != NULL);
@ -270,7 +270,7 @@ gimp_channel_destroy (GtkObject *object)
} }
void void
channel_scale (Channel *channel, gimp_channel_scale (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height) gint new_height)
{ {
@ -318,7 +318,7 @@ channel_scale (Channel *channel,
} }
void void
channel_resize (Channel *channel, gimp_channel_resize (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height, gint new_height,
gint offx, gint offx,
@ -415,7 +415,7 @@ channel_resize (Channel *channel,
} }
void void
channel_update (Channel *channel) gimp_channel_update (GimpChannel *channel)
{ {
drawable_update (GIMP_DRAWABLE (channel), drawable_update (GIMP_DRAWABLE (channel),
0, 0, 0, 0,
@ -429,7 +429,7 @@ channel_update (Channel *channel)
/**********************/ /**********************/
gboolean gboolean
channel_toggle_visibility (Channel *channel) gimp_channel_toggle_visibility (GimpChannel *channel)
{ {
GIMP_DRAWABLE (channel)->visible = !GIMP_DRAWABLE (channel)->visible; GIMP_DRAWABLE (channel)->visible = !GIMP_DRAWABLE (channel)->visible;
@ -437,7 +437,7 @@ channel_toggle_visibility (Channel *channel)
} }
TempBuf * TempBuf *
channel_preview (Channel *channel, gimp_channel_preview (GimpChannel *channel,
gint width, gint width,
gint height) gint height)
{ {
@ -449,7 +449,7 @@ channel_preview (Channel *channel,
GIMP_DRAWABLE (channel)->gimage->width > PREVIEW_CACHE_PRIME_WIDTH && GIMP_DRAWABLE (channel)->gimage->width > PREVIEW_CACHE_PRIME_WIDTH &&
GIMP_DRAWABLE (channel)->gimage->height > PREVIEW_CACHE_PRIME_HEIGHT) GIMP_DRAWABLE (channel)->gimage->height > PREVIEW_CACHE_PRIME_HEIGHT)
{ {
TempBuf * tb = channel_preview_private (channel, TempBuf * tb = gimp_channel_preview_private (channel,
PREVIEW_CACHE_PRIME_WIDTH, PREVIEW_CACHE_PRIME_WIDTH,
PREVIEW_CACHE_PRIME_HEIGHT); PREVIEW_CACHE_PRIME_HEIGHT);
@ -460,11 +460,11 @@ channel_preview (Channel *channel,
} }
/* Second call - should NOT visit the tile cache... */ /* Second call - should NOT visit the tile cache... */
return channel_preview_private (channel, width, height); return gimp_channel_preview_private (channel, width, height);
} }
static TempBuf * static TempBuf *
channel_preview_private (Channel *channel, gimp_channel_preview_private (GimpChannel *channel,
gint width, gint width,
gint height) gint height)
{ {
@ -526,27 +526,27 @@ channel_preview_private (Channel *channel,
/* selection mask functions */ /* selection mask functions */
/******************************/ /******************************/
Channel * GimpChannel *
channel_new_mask (GimpImage *gimage, gimp_channel_new_mask (GimpImage *gimage,
gint width, gint width,
gint height) gint height)
{ {
GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; GimpRGB black = { 0.0, 0.0, 0.0, 0.5 };
Channel *new_channel; GimpChannel *new_channel;
/* Create the new channel */ /* Create the new channel */
new_channel = channel_new (gimage, width, height, new_channel = gimp_channel_new (gimage, width, height,
_("Selection Mask"), &black); _("Selection Mask"), &black);
/* Set the validate procedure */ /* Set the validate procedure */
tile_manager_set_validate_proc (GIMP_DRAWABLE (new_channel)->tiles, tile_manager_set_validate_proc (GIMP_DRAWABLE (new_channel)->tiles,
channel_validate); gimp_channel_validate);
return new_channel; return new_channel;
} }
gboolean gboolean
channel_boundary (Channel *mask, gimp_channel_boundary (GimpChannel *mask,
BoundSeg **segs_in, BoundSeg **segs_in,
BoundSeg **segs_out, BoundSeg **segs_out,
gint *num_segs_in, gint *num_segs_in,
@ -567,7 +567,7 @@ channel_boundary (Channel *mask,
if (mask->segs_out) if (mask->segs_out)
g_free (mask->segs_out); g_free (mask->segs_out);
if (channel_bounds (mask, &x3, &y3, &x4, &y4)) if (gimp_channel_bounds (mask, &x3, &y3, &x4, &y4))
{ {
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles,
x3, y3, (x4 - x3), (y4 - y3), FALSE); x3, y3, (x4 - x3), (y4 - y3), FALSE);
@ -616,7 +616,7 @@ channel_boundary (Channel *mask,
} }
gint gint
channel_value (Channel *mask, gimp_channel_value (GimpChannel *mask,
gint x, gint x,
gint y) gint y)
{ {
@ -646,7 +646,7 @@ channel_value (Channel *mask,
} }
gboolean gboolean
channel_bounds (Channel *mask, gimp_channel_bounds (GimpChannel *mask,
gint *x1, gint *x1,
gint *y1, gint *y1,
gint *x2, gint *x2,
@ -760,7 +760,7 @@ channel_bounds (Channel *mask,
} }
gboolean gboolean
channel_is_empty (Channel *mask) gimp_channel_is_empty (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
guchar *data; guchar *data;
@ -811,7 +811,7 @@ channel_is_empty (Channel *mask)
} }
void void
channel_add_segment (Channel *mask, gimp_channel_add_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
@ -854,7 +854,7 @@ channel_add_segment (Channel *mask,
} }
void void
channel_sub_segment (Channel *mask, gimp_channel_sub_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
@ -896,7 +896,7 @@ channel_sub_segment (Channel *mask,
} }
void void
channel_combine_rect (Channel *mask, gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
@ -956,7 +956,7 @@ channel_combine_rect (Channel *mask,
} }
void void
channel_combine_ellipse (Channel *mask, gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
@ -1002,10 +1002,10 @@ channel_combine_ellipse (Channel *mask,
{ {
case CHANNEL_OP_ADD: case CHANNEL_OP_ADD:
case CHANNEL_OP_REPLACE: case CHANNEL_OP_REPLACE:
channel_add_segment (mask, x1, i, (x2 - x1), 255); gimp_channel_add_segment (mask, x1, i, (x2 - x1), 255);
break; break;
case CHANNEL_OP_SUB: case CHANNEL_OP_SUB:
channel_sub_segment (mask, x1, i, (x2 - x1), 255); gimp_channel_sub_segment (mask, x1, i, (x2 - x1), 255);
break; break;
default: default:
g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!");
@ -1046,10 +1046,10 @@ channel_combine_ellipse (Channel *mask,
{ {
case CHANNEL_OP_ADD: case CHANNEL_OP_ADD:
case CHANNEL_OP_REPLACE: case CHANNEL_OP_REPLACE:
channel_add_segment (mask, x0, i, j - x0, last); gimp_channel_add_segment (mask, x0, i, j - x0, last);
break; break;
case CHANNEL_OP_SUB: case CHANNEL_OP_SUB:
channel_sub_segment (mask, x0, i, j - x0, last); gimp_channel_sub_segment (mask, x0, i, j - x0, last);
break; break;
default: default:
g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!");
@ -1071,9 +1071,9 @@ channel_combine_ellipse (Channel *mask,
if (last) if (last)
{ {
if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE)
channel_add_segment (mask, x0, i, j - x0, last); gimp_channel_add_segment (mask, x0, i, j - x0, last);
else if (op == CHANNEL_OP_SUB) else if (op == CHANNEL_OP_SUB)
channel_sub_segment (mask, x0, i, j - x0, last); gimp_channel_sub_segment (mask, x0, i, j - x0, last);
else else
g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!");
} }
@ -1112,7 +1112,7 @@ channel_combine_ellipse (Channel *mask,
} }
static void static void
channel_combine_sub_region_add (void *unused, gimp_channel_combine_sub_region_add (void *unused,
PixelRegion *srcPR, PixelRegion *srcPR,
PixelRegion *destPR) PixelRegion *destPR)
{ {
@ -1138,7 +1138,7 @@ channel_combine_sub_region_add (void *unused,
} }
static void static void
channel_combine_sub_region_sub (void *unused, gimp_channel_combine_sub_region_sub (void *unused,
PixelRegion *srcPR, PixelRegion *srcPR,
PixelRegion *destPR) PixelRegion *destPR)
{ {
@ -1163,7 +1163,7 @@ channel_combine_sub_region_sub (void *unused,
} }
static void static void
channel_combine_sub_region_intersect (void *unused, gimp_channel_combine_sub_region_intersect (void *unused,
PixelRegion *srcPR, PixelRegion *srcPR,
PixelRegion *destPR) PixelRegion *destPR)
{ {
@ -1185,8 +1185,8 @@ channel_combine_sub_region_intersect (void *unused,
} }
void void
channel_combine_mask (Channel *mask, gimp_channel_combine_mask (GimpChannel *mask,
Channel *add_on, GimpChannel *add_on,
ChannelOps op, ChannelOps op,
gint off_x, gint off_x,
gint off_y) gint off_y)
@ -1213,28 +1213,31 @@ channel_combine_mask (Channel *mask,
{ {
case CHANNEL_OP_ADD: case CHANNEL_OP_ADD:
case CHANNEL_OP_REPLACE: case CHANNEL_OP_REPLACE:
pixel_regions_process_parallel ((p_func) channel_combine_sub_region_add, pixel_regions_process_parallel ((p_func)
gimp_channel_combine_sub_region_add,
NULL, 2, &srcPR, &destPR); NULL, 2, &srcPR, &destPR);
break; break;
case CHANNEL_OP_SUB: case CHANNEL_OP_SUB:
pixel_regions_process_parallel ((p_func) channel_combine_sub_region_sub, pixel_regions_process_parallel ((p_func)
gimp_channel_combine_sub_region_sub,
NULL, 2, &srcPR, &destPR); NULL, 2, &srcPR, &destPR);
break; break;
case CHANNEL_OP_INTERSECT: case CHANNEL_OP_INTERSECT:
pixel_regions_process_parallel ((p_func) pixel_regions_process_parallel ((p_func)
channel_combine_sub_region_intersect, gimp_channel_combine_sub_region_intersect,
NULL, 2, &srcPR, &destPR); NULL, 2, &srcPR, &destPR);
break; break;
default: default:
g_message ("Error: unknown opperation type in channel_combine_mask\n"); g_message ("Error: unknown opperation type in channel_combine_mask\n");
break; break;
} }
mask->bounds_known = FALSE; mask->bounds_known = FALSE;
} }
void void
channel_feather (Channel *input, gimp_channel_feather (GimpChannel *input,
Channel *output, GimpChannel *output,
gdouble radius_x, gdouble radius_x,
gdouble radius_y, gdouble radius_y,
ChannelOps op, ChannelOps op,
@ -1256,13 +1259,13 @@ channel_feather (Channel *input,
gaussian_blur_region (&srcPR, radius_x, radius_y); gaussian_blur_region (&srcPR, radius_x, radius_y);
if (input != output) if (input != output)
channel_combine_mask (output, input, op, 0, 0); gimp_channel_combine_mask (output, input, op, 0, 0);
output->bounds_known = FALSE; output->bounds_known = FALSE;
} }
void void
channel_push_undo (Channel *mask) gimp_channel_push_undo (GimpChannel *mask)
{ {
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
MaskUndo *mask_undo; MaskUndo *mask_undo;
@ -1271,7 +1274,7 @@ channel_push_undo (Channel *mask)
GImage *gimage; GImage *gimage;
mask_undo = g_new (MaskUndo, 1); mask_undo = g_new (MaskUndo, 1);
if (channel_bounds (mask, &x1, &y1, &x2, &y2)) if (gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
{ {
undo_tiles = tile_manager_new ((x2 - x1), (y2 - y1), 1); undo_tiles = tile_manager_new ((x2 - x1), (y2 - y1), 1);
pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles,
@ -1296,13 +1299,13 @@ channel_push_undo (Channel *mask)
} }
void void
channel_clear (Channel *mask) gimp_channel_clear (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
guchar bg = 0; guchar bg = 0;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
if (mask->bounds_known && !mask->empty) if (mask->bounds_known && !mask->empty)
{ {
@ -1331,13 +1334,13 @@ channel_clear (Channel *mask)
} }
void void
channel_invert (Channel *mask) gimp_channel_invert (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
GimpLut *lut; GimpLut *lut;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
0, 0, 0, 0,
@ -1353,13 +1356,13 @@ channel_invert (Channel *mask)
} }
void void
channel_sharpen (Channel *mask) gimp_channel_sharpen (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
GimpLut *lut; GimpLut *lut;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
0, 0, 0, 0,
@ -1373,13 +1376,13 @@ channel_sharpen (Channel *mask)
} }
void void
channel_all (Channel *mask) gimp_channel_all (GimpChannel *mask)
{ {
PixelRegion maskPR; PixelRegion maskPR;
guchar bg = 255; guchar bg = 255;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* clear the mask */ /* clear the mask */
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
@ -1398,7 +1401,7 @@ channel_all (Channel *mask)
} }
void void
channel_border (Channel *mask, gimp_channel_border (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y) gint radius_y)
{ {
@ -1408,9 +1411,9 @@ channel_border (Channel *mask,
if (radius_x < 0 || radius_y < 0) if (radius_x < 0 || radius_y < 0)
return; return;
if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return; return;
if (channel_is_empty (mask)) if (gimp_channel_is_empty (mask))
return; return;
if (x1 - radius_x < 0) if (x1 - radius_x < 0)
@ -1430,8 +1433,9 @@ channel_border (Channel *mask,
y2 = GIMP_DRAWABLE (mask)->height; y2 = GIMP_DRAWABLE (mask)->height;
else else
y2 += radius_y; y2 += radius_y;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1,
(x2-x1), (y2-y1), TRUE); (x2-x1), (y2-y1), TRUE);
@ -1442,7 +1446,7 @@ channel_border (Channel *mask,
} }
void void
channel_grow (Channel *mask, gimp_channel_grow (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y) gint radius_y)
{ {
@ -1454,16 +1458,16 @@ channel_grow (Channel *mask,
if (radius_x <= 0 && radius_y <= 0) if (radius_x <= 0 && radius_y <= 0)
{ {
channel_shrink (mask, -radius_x, -radius_y, FALSE); gimp_channel_shrink (mask, -radius_x, -radius_y, FALSE);
return; return;
} }
if (radius_x < 0 || radius_y < 0) if (radius_x < 0 || radius_y < 0)
return; return;
if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return; return;
if (channel_is_empty (mask)) if (gimp_channel_is_empty (mask))
return; return;
if (x1 - radius_x > 0) if (x1 - radius_x > 0)
@ -1484,7 +1488,7 @@ channel_grow (Channel *mask,
y2 = GIMP_DRAWABLE (mask)->height; y2 = GIMP_DRAWABLE (mask)->height;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* need full extents for grow, not! */ /* need full extents for grow, not! */
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1),
@ -1496,7 +1500,7 @@ channel_grow (Channel *mask,
} }
void void
channel_shrink (Channel *mask, gimp_channel_shrink (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y, gint radius_y,
gboolean edge_lock) gboolean edge_lock)
@ -1509,16 +1513,16 @@ channel_shrink (Channel *mask,
if (radius_x <= 0 && radius_y <= 0) if (radius_x <= 0 && radius_y <= 0)
{ {
channel_grow (mask, -radius_x, -radius_y); gimp_channel_grow (mask, -radius_x, -radius_y);
return; return;
} }
if (radius_x < 0 || radius_y < 0) if (radius_x < 0 || radius_y < 0)
return; return;
if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return; return;
if (channel_is_empty (mask)) if (gimp_channel_is_empty (mask))
return; return;
if (x1 > 0) if (x1 > 0)
@ -1531,7 +1535,7 @@ channel_shrink (Channel *mask,
y2++; y2++;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1),
(y2 - y1), TRUE); (y2 - y1), TRUE);
@ -1542,12 +1546,12 @@ channel_shrink (Channel *mask,
} }
void void
channel_translate (Channel *mask, gimp_channel_translate (GimpChannel *mask,
gint off_x, gint off_x,
gint off_y) gint off_y)
{ {
gint width, height; gint width, height;
Channel *tmp_mask; GimpChannel *tmp_mask;
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
guchar empty = 0; guchar empty = 0;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
@ -1555,9 +1559,9 @@ channel_translate (Channel *mask,
tmp_mask = NULL; tmp_mask = NULL;
/* push the current channel onto the undo stack */ /* push the current channel onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
channel_bounds (mask, &x1, &y1, &x2, &y2); gimp_channel_bounds (mask, &x1, &y1, &x2, &y2);
x1 = CLAMP ((x1 + off_x), 0, GIMP_DRAWABLE (mask)->width); x1 = CLAMP ((x1 + off_x), 0, GIMP_DRAWABLE (mask)->width);
y1 = CLAMP ((y1 + off_y), 0, GIMP_DRAWABLE (mask)->height); y1 = CLAMP ((y1 + off_y), 0, GIMP_DRAWABLE (mask)->height);
x2 = CLAMP ((x2 + off_x), 0, GIMP_DRAWABLE (mask)->width); x2 = CLAMP ((x2 + off_x), 0, GIMP_DRAWABLE (mask)->width);
@ -1572,7 +1576,8 @@ channel_translate (Channel *mask,
/* copy the portion of the mask we will keep to a /* copy the portion of the mask we will keep to a
* temporary buffer * temporary buffer
*/ */
tmp_mask = channel_new_mask (GIMP_DRAWABLE (mask)->gimage, width, height); tmp_mask = gimp_channel_new_mask (GIMP_DRAWABLE (mask)->gimage,
width, height);
pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles,
x1 - off_x, y1 - off_y, width, height, FALSE); x1 - off_x, y1 - off_y, width, height, FALSE);
@ -1619,13 +1624,13 @@ channel_translate (Channel *mask,
} }
void void
channel_load (Channel *mask, gimp_channel_load (GimpChannel *mask,
Channel *channel) GimpChannel *channel)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* copy the channel to the mask */ /* copy the channel to the mask */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
@ -1642,7 +1647,7 @@ channel_load (Channel *mask,
} }
void void
channel_layer_alpha (Channel *mask, gimp_channel_layer_alpha (GimpChannel *mask,
GimpLayer *layer) GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
@ -1650,7 +1655,7 @@ channel_layer_alpha (Channel *mask,
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* clear the mask */ /* clear the mask */
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles, pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles,
@ -1678,7 +1683,7 @@ channel_layer_alpha (Channel *mask,
} }
void void
channel_layer_mask (Channel *mask, gimp_channel_layer_mask (GimpChannel *mask,
GimpLayer *layer) GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
@ -1686,7 +1691,7 @@ channel_layer_mask (Channel *mask,
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); gimp_channel_push_undo (mask);
/* clear the mask */ /* clear the mask */
pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles, pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
@ -1717,7 +1722,7 @@ channel_layer_mask (Channel *mask,
} }
void void
channel_invalidate_bounds (Channel *channel) gimp_channel_invalidate_bounds (GimpChannel *channel)
{ {
channel->bounds_known = FALSE; channel->bounds_known = FALSE;
} }

View file

@ -16,8 +16,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef __CHANNEL_H__ #ifndef __GIMP_CHANNEL_H__
#define __CHANNEL_H__ #define __GIMP_CHANNEL_H__
#include "gimpdrawable.h" #include "gimpdrawable.h"
@ -26,7 +26,6 @@
/* Half way point where a region is no longer visible in a selection */ /* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127 #define HALF_WAY 127
/* structure declarations */
#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) #define GIMP_TYPE_CHANNEL (gimp_channel_get_type ())
#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) #define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel))
@ -63,21 +62,18 @@ struct _GimpChannelClass
}; };
/* Special undo types */
/* Special undo type */
typedef struct _ChannelUndo ChannelUndo; typedef struct _ChannelUndo ChannelUndo;
typedef struct _MaskUndo MaskUndo;
struct _ChannelUndo struct _ChannelUndo
{ {
Channel *channel; /* the actual channel */ GimpChannel *channel; /* the actual channel */
gint prev_position; /* former position in list */ gint prev_position; /* former position in list */
Channel *prev_channel; /* previous active channel */ GimpChannel *prev_channel; /* previous active channel */
}; };
/* Special undo type */
typedef struct _MaskUndo MaskUndo;
struct _MaskUndo struct _MaskUndo
{ {
TileManager *tiles; /* the actual mask */ TileManager *tiles; /* the actual mask */
@ -89,44 +85,44 @@ struct _MaskUndo
GtkType gimp_channel_get_type (void); GtkType gimp_channel_get_type (void);
Channel * channel_new (GimpImage *gimage, GimpChannel * gimp_channel_new (GimpImage *gimage,
gint width, gint width,
gint height, gint height,
const gchar *name, const gchar *name,
const GimpRGB *color); const GimpRGB *color);
Channel * channel_copy (const Channel *channel); GimpChannel * gimp_channel_copy (const GimpChannel *channel);
gint channel_get_opacity (const Channel *channel); gint gimp_channel_get_opacity (const GimpChannel *channel);
void channel_set_opacity (Channel *channel, void gimp_channel_set_opacity (GimpChannel *channel,
gint opacity); gint opacity);
const GimpRGB * channel_get_color (const Channel *channel); const GimpRGB * gimp_channel_get_color (const GimpChannel *channel);
void channel_set_color (Channel *channel, void gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color); const GimpRGB *color);
void channel_scale (Channel *channel, void gimp_channel_scale (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height); gint new_height);
void channel_resize (Channel *channel, void gimp_channel_resize (GimpChannel *channel,
gint new_width, gint new_width,
gint new_height, gint new_height,
gint offx, gint offx,
gint offy); gint offy);
void channel_update (Channel *channel); void gimp_channel_update (GimpChannel *channel);
/* access functions */ /* access functions */
gboolean channel_toggle_visibility (Channel *channel); gboolean gimp_channel_toggle_visibility (GimpChannel *channel);
TempBuf * channel_preview (Channel *channel, TempBuf * gimp_channel_preview (GimpChannel *channel,
gint width, gint width,
gint height); gint height);
/* selection mask functions */ /* selection mask functions */
Channel * channel_new_mask (GimpImage *gimage, GimpChannel * gimp_channel_new_mask (GimpImage *gimage,
gint width, gint width,
gint height); gint height);
gboolean channel_boundary (Channel *mask, gboolean gimp_channel_boundary (GimpChannel *mask,
BoundSeg **segs_in, BoundSeg **segs_in,
BoundSeg **segs_out, BoundSeg **segs_out,
gint *num_segs_in, gint *num_segs_in,
@ -135,80 +131,80 @@ gboolean channel_boundary (Channel *mask,
gint y1, gint y1,
gint x2, gint x2,
gint y2); gint y2);
gboolean channel_bounds (Channel *mask, gboolean gimp_channel_bounds (GimpChannel *mask,
gint *x1, gint *x1,
gint *y1, gint *y1,
gint *x2, gint *x2,
gint *y2); gint *y2);
gint channel_value (Channel *mask, gint gimp_channel_value (GimpChannel *mask,
gint x, gint x,
gint y); gint y);
gboolean channel_is_empty (Channel *mask); gboolean gimp_channel_is_empty (GimpChannel *mask);
void channel_add_segment (Channel *mask, void gimp_channel_add_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint value); gint value);
void channel_sub_segment (Channel *mask, void gimp_channel_sub_segment (GimpChannel *mask,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint value); gint value);
void channel_combine_rect (Channel *mask, void gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h); gint h);
void channel_combine_ellipse (Channel *mask, void gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op, ChannelOps op,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h, gint h,
gboolean antialias); gboolean antialias);
void channel_combine_mask (Channel *mask, void gimp_channel_combine_mask (GimpChannel *mask,
Channel *add_on, GimpChannel *add_on,
ChannelOps op, ChannelOps op,
gint off_x, gint off_x,
gint off_y); gint off_y);
void channel_feather (Channel *input, void gimp_channel_feather (GimpChannel *input,
Channel *output, GimpChannel *output,
gdouble radius_x, gdouble radius_x,
gdouble radius_y, gdouble radius_y,
ChannelOps op, ChannelOps op,
gint off_x, gint off_x,
gint off_y); gint off_y);
void channel_push_undo (Channel *mask); void gimp_channel_push_undo (GimpChannel *mask);
void channel_clear (Channel *mask); void gimp_channel_clear (GimpChannel *mask);
void channel_invert (Channel *mask); void gimp_channel_invert (GimpChannel *mask);
void channel_sharpen (Channel *mask); void gimp_channel_sharpen (GimpChannel *mask);
void channel_all (Channel *mask); void gimp_channel_all (GimpChannel *mask);
void channel_border (Channel *mask, void gimp_channel_border (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y); gint radius_y);
void channel_grow (Channel *mask, void gimp_channel_grow (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y); gint radius_y);
void channel_shrink (Channel *mask, void gimp_channel_shrink (GimpChannel *mask,
gint radius_x, gint radius_x,
gint radius_y, gint radius_y,
gboolean edge_lock); gboolean edge_lock);
void channel_translate (Channel *mask, void gimp_channel_translate (GimpChannel *mask,
gint off_x, gint off_x,
gint off_y); gint off_y);
void channel_load (Channel *mask, void gimp_channel_load (GimpChannel *mask,
Channel *channel); GimpChannel *channel);
void channel_layer_alpha (Channel *mask, void gimp_channel_layer_alpha (GimpChannel *mask,
GimpLayer *layer); GimpLayer *layer);
void channel_layer_mask (Channel *mask, void gimp_channel_layer_mask (GimpChannel *mask,
GimpLayer *layer); GimpLayer *layer);
void channel_invalidate_bounds (Channel *channel); void gimp_channel_invalidate_bounds (GimpChannel *channel);
#endif /* __CHANNEL_H__ */ #endif /* __GIMP_CHANNEL_H__ */

View file

@ -1097,7 +1097,7 @@ gimp_dnd_set_drawable_preview_icon (GtkWidget *widget,
} }
else if (GIMP_IS_CHANNEL (drawable)) else if (GIMP_IS_CHANNEL (drawable))
{ {
tmpbuf = channel_preview (GIMP_CHANNEL (drawable), width, height); tmpbuf = gimp_channel_preview (GIMP_CHANNEL (drawable), width, height);
} }
else else
{ {

View file

@ -569,12 +569,12 @@ duplicate (GimpImage *gimage)
GimpImage *new_gimage; GimpImage *new_gimage;
GimpLayer *layer, *new_layer; GimpLayer *layer, *new_layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
Channel *channel, *new_channel; GimpChannel *channel, *new_channel;
GSList *list; GSList *list;
GList *glist; GList *glist;
Guide *guide = NULL; Guide *guide = NULL;
GimpLayer *active_layer = NULL; GimpLayer *active_layer = NULL;
Channel *active_channel = NULL; GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL;
ParasiteList *parasites; ParasiteList *parasites;
@ -645,12 +645,12 @@ duplicate (GimpImage *gimage)
count = 0; count = 0;
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
list = g_slist_next (list); list = g_slist_next (list);
new_channel = channel_copy (channel); new_channel = gimp_channel_copy (channel);
gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage); gimp_drawable_set_gimage (GIMP_DRAWABLE (new_channel), new_gimage);
/* Make sure the copied channel doesn't say: "<old channel> copy" */ /* Make sure the copied channel doesn't say: "<old channel> copy" */
gimp_object_set_name (GIMP_OBJECT (new_channel), gimp_object_set_name (GIMP_OBJECT (new_channel),

View file

@ -365,7 +365,7 @@ gimp_histogram_calculate_drawable (GimpHistogram *histogram,
if (!no_mask) if (!no_mask)
{ {
Channel *sel_mask; GimpChannel *sel_mask;
GimpImage *gimage; GimpImage *gimage;
gimage = gimp_drawable_gimage (drawable); gimage = gimp_drawable_gimage (drawable);

View file

@ -569,12 +569,12 @@ duplicate (GimpImage *gimage)
GimpImage *new_gimage; GimpImage *new_gimage;
GimpLayer *layer, *new_layer; GimpLayer *layer, *new_layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
Channel *channel, *new_channel; GimpChannel *channel, *new_channel;
GSList *list; GSList *list;
GList *glist; GList *glist;
Guide *guide = NULL; Guide *guide = NULL;
GimpLayer *active_layer = NULL; GimpLayer *active_layer = NULL;
Channel *active_channel = NULL; GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL;
ParasiteList *parasites; ParasiteList *parasites;
@ -645,12 +645,12 @@ duplicate (GimpImage *gimage)
count = 0; count = 0;
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
list = g_slist_next (list); list = g_slist_next (list);
new_channel = channel_copy (channel); new_channel = gimp_channel_copy (channel);
gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage); gimp_drawable_set_gimage (GIMP_DRAWABLE (new_channel), new_gimage);
/* Make sure the copied channel doesn't say: "<old channel> copy" */ /* Make sure the copied channel doesn't say: "<old channel> copy" */
gimp_object_set_name (GIMP_OBJECT (new_channel), gimp_object_set_name (GIMP_OBJECT (new_channel),

View file

@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage,
PixelRegion *dest, PixelRegion *dest,
PixelRegion *mask); PixelRegion *mask);
static void project_channel (GimpImage *gimage, static void project_channel (GimpImage *gimage,
Channel *layer, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2); PixelRegion *src2);
@ -437,8 +437,9 @@ gimp_image_new (gint width,
} }
/* create the selection mask */ /* create the selection mask */
gimage->selection_mask = channel_new_mask (gimage, gimage->selection_mask = gimp_channel_new_mask (gimage,
gimage->width, gimage->height); gimage->width,
gimage->height);
return gimage; return gimage;
@ -552,7 +553,7 @@ gimp_image_resize (GimpImage *gimage,
gint offset_x, gint offset_x,
gint offset_y) gint offset_y)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage,
/* Resize all channels */ /* Resize all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_resize (channel, new_width, new_height, offset_x, offset_y); gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y);
} }
/* Reposition or remove any guides */ /* Reposition or remove any guides */
@ -617,7 +618,7 @@ gimp_image_resize (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
channel_resize (gimage->selection_mask, gimp_channel_resize (gimage->selection_mask,
new_width, new_height, offset_x, offset_y); new_width, new_height, offset_x, offset_y);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -646,7 +647,7 @@ gimp_image_scale (GimpImage *gimage,
gint new_width, gint new_width,
gint new_height) gint new_height)
{ {
Channel *channel; GimpChannel *channel;
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
GSList *list; GSList *list;
@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage,
/* Scale all channels */ /* Scale all channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_scale (channel, new_width, new_height);
gimp_channel_scale (channel, new_width, new_height);
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
/* if (channel_is_empty(gimage->selection_mask)) /* if (channel_is_empty(gimage->selection_mask))
channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0)
else else
*/ */
channel_scale (gimage->selection_mask, new_width, new_height); gimp_channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
/* Scale all layers */ /* Scale all layers */
@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR; PixelRegion src1PR, destPR, maskPR;
@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage,
gint x, gint x,
gint y) gint y)
{ {
Channel *mask; GimpChannel *mask;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint offset_x, offset_y; gint offset_x, offset_y;
PixelRegion src1PR, destPR; PixelRegion src1PR, destPR;
@ -1377,7 +1379,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
GimpLayer *layer; GimpLayer *layer;
GSList *layers; GSList *layers;
gboolean retval = TRUE; gboolean retval = TRUE;
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
Tattoo maxval = 0; Tattoo maxval = 0;
Path *pptr = NULL; Path *pptr = NULL;
@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
Tattoo ctattoo; Tattoo ctattoo;
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval) if (ctattoo > maxval)
@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage,
static void static void
project_channel (GimpImage *gimage, project_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
PixelRegion *src, PixelRegion *src,
PixelRegion *src2) PixelRegion *src2)
{ {
@ -1599,11 +1601,11 @@ static void
gimp_image_free_channels (GimpImage *gimage) gimp_image_free_channels (GimpImage *gimage)
{ {
GSList *list; GSList *list;
Channel *channel; GimpChannel *channel;
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
gtk_object_unref (GTK_OBJECT (channel)); gtk_object_unref (GTK_OBJECT (channel));
} }
@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage,
gint w, gint w,
gint h) gint h)
{ {
Channel *channel; GimpChannel *channel;
PixelRegion src1PR; PixelRegion src1PR;
PixelRegion src2PR; PixelRegion src2PR;
GSList *list; GSList *list;
@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage,
while (reverse_list) while (reverse_list)
{ {
channel = (Channel *) reverse_list->data; channel = (GimpChannel *) reverse_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{ {
@ -2122,14 +2124,14 @@ void
gimp_image_invalidate_channel_previews (GimpImage *gimage) gimp_image_invalidate_channel_previews (GimpImage *gimage)
{ {
GSList *tmp; GSList *tmp;
Channel *channel; GimpChannel *channel;
g_return_if_fail (gimage != NULL); g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage)); g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{ {
channel = (Channel *) tmp->data; channel = (GimpChannel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
} }
@ -2174,9 +2176,9 @@ gimp_image_get_layer_by_index (const GimpImage *gimage,
gint gint
gimp_image_get_channel_index (const GimpImage *gimage, gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg) const GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
gint index; gint index;
@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels), index++) channels = g_slist_next (channels), index++)
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (channel == channel_arg) if (channel == channel_arg)
return index; return index;
@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage)
return gimage->active_layer; return gimage->active_layer;
} }
Channel * GimpChannel *
gimp_image_get_active_channel (const GimpImage *gimage) gimp_image_get_active_channel (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2235,11 +2237,11 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_tattoo (const GimpImage *gimage, gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tattoo) Tattoo tattoo)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel; return channel;
@ -2257,11 +2259,11 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_channel_by_name (const GimpImage *gimage, gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
Channel *channel; GimpChannel *channel;
GSList *channels; GSList *channels;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
channels; channels;
channels = g_slist_next (channels)) channels = g_slist_next (channels))
{ {
channel = (Channel *) channels->data; channel = (GimpChannel *) channels->data;
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel; return channel;
} }
@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_get_mask (const GimpImage *gimage) gimp_image_get_mask (const GimpImage *gimage)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage,
return layer; return layer;
} }
Channel * GimpChannel *
gimp_image_set_active_channel (GimpImage *gimage, gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage,
gimage->active_channel = NULL; gimage->active_channel = NULL;
return NULL; return NULL;
} }
channel = (Channel *) gimage->channels->data; channel = (GimpChannel *) gimage->channels->data;
} }
/* Set the active channel */ /* Set the active channel */
@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_unset_active_channel (GimpImage *gimage) gimp_image_unset_active_channel (GimpImage *gimage)
{ {
Channel *channel; GimpChannel *channel;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return mask; return mask;
} }
Channel * GimpChannel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
@ -3362,12 +3364,12 @@ gimp_image_remove_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_raise_channel (GimpImage *gimage, gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *prev_channel; GimpChannel *prev_channel;
GSList *list; GSList *list;
GSList *prev; GSList *prev;
gint index = -1; gint index = -1;
@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (prev) if (prev)
prev_channel = (Channel *) prev->data; prev_channel = (GimpChannel *) prev->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
@ -3411,12 +3413,12 @@ gimp_image_raise_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_lower_channel (GimpImage *gimage, gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg) GimpChannel *channel_arg)
{ {
Channel *channel; GimpChannel *channel;
Channel *next_channel; GimpChannel *next_channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index = 0; gint index = 0;
@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage,
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
next = g_slist_next (list); next = g_slist_next (list);
if (next) if (next)
next_channel = (Channel *) next->data; next_channel = (GimpChannel *) next->data;
index++; index++;
if (channel == channel_arg) if (channel == channel_arg)
@ -3460,12 +3462,12 @@ gimp_image_lower_channel (GimpImage *gimage,
return NULL; return NULL;
} }
Channel * GimpChannel *
gimp_image_position_channel (GimpImage *gimage, gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint new_index) gint new_index)
{ {
Channel *channel; GimpChannel *channel;
GSList *list; GSList *list;
GSList *next; GSList *next;
gint index; gint index;
@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage,
list; list;
list = g_slist_next (list), index++) list = g_slist_next (list), index++)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
if (channel == channel_arg) if (channel == channel_arg)
{ {
break; break;
@ -3513,9 +3515,9 @@ gimp_image_position_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_add_channel (GimpImage *gimage, gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position) gint position)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage,
return channel; return channel;
} }
Channel * GimpChannel *
gimp_image_remove_channel (GimpImage *gimage, gimp_image_remove_channel (GimpImage *gimage,
Channel *channel) GimpChannel *channel)
{ {
ChannelUndo *cu; ChannelUndo *cu;
@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage,
if (gimage->active_channel == channel) if (gimage->active_channel == channel)
{ {
if (gimage->channels) if (gimage->channels)
gimage->active_channel = (((Channel *) gimage->channels->data)); gimage->active_channel = (((GimpChannel *) gimage->channels->data));
else else
gimage->active_channel = NULL; gimage->active_channel = NULL;
} }

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */ GSList *layer_stack; /* the layers in MRU order */
GimpLayer *active_layer; /* ID of active layer */ GimpLayer *active_layer; /* ID of active layer */
Channel *active_channel; /* ID of active channel */ GimpChannel *active_channel; /* ID of active channel */
GimpLayer *floating_sel; /* ID of fs layer */ GimpLayer *floating_sel; /* ID of fs layer */
Channel *selection_mask; /* selection mask channel */ GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */ ParasiteList *parasites; /* Plug-in parasite data */
@ -287,16 +287,16 @@ gint gimp_image_get_layer_index (const GimpImage *gimage,
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
@ -306,9 +306,9 @@ gboolean gimp_image_layer_boundary (const GimpImage *gimage,
gint *n_segs); gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer); GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
@ -347,21 +347,21 @@ GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
GimpLayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer, GimpLayer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); GimpChannel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, GimpChannel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, GimpChannel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, GimpChannel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,

View file

@ -742,7 +742,7 @@ gimp_layer_scale_lowlevel (GimpLayer *layer,
{ {
GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x; GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x;
GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y; GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y;
channel_scale (GIMP_CHANNEL (layer->mask), new_width, new_height); gimp_channel_scale (GIMP_CHANNEL (layer->mask), new_width, new_height);
} }
/* Make sure we're not caching any old selection info */ /* Make sure we're not caching any old selection info */
@ -1016,7 +1016,7 @@ gimp_layer_resize (GimpLayer *layer,
{ {
GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x; GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x;
GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y; GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y;
channel_resize (GIMP_CHANNEL (layer->mask), gimp_channel_resize (GIMP_CHANNEL (layer->mask),
new_width, new_height, offx, offy); new_width, new_height, offx, offy);
} }
@ -1115,7 +1115,7 @@ void
gimp_layer_invalidate_boundary (GimpLayer *layer) gimp_layer_invalidate_boundary (GimpLayer *layer)
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *mask; GimpChannel *mask;
/* first get the selection mask channel */ /* first get the selection mask channel */
if (! (gimage = gimp_drawable_gimage (GIMP_DRAWABLE (layer)))) if (! (gimage = gimp_drawable_gimage (GIMP_DRAWABLE (layer))))
@ -1130,7 +1130,7 @@ gimp_layer_invalidate_boundary (GimpLayer *layer)
mask = gimp_image_get_mask (gimage); mask = gimp_image_get_mask (gimage);
/* Only bother with the bounds if there is a selection */ /* Only bother with the bounds if there is a selection */
if (! channel_is_empty (mask)) if (! gimp_channel_is_empty (mask))
{ {
mask->bounds_known = FALSE; mask->bounds_known = FALSE;
mask->boundary_known = FALSE; mask->boundary_known = FALSE;

View file

@ -351,7 +351,7 @@ edit_paste (GimpImage *gimage,
* it seems like the correct behavior. * it seems like the correct behavior.
*/ */
if (! gimage_mask_is_empty (gimage) && !paste_into) if (! gimage_mask_is_empty (gimage) && !paste_into)
channel_clear (gimp_image_get_mask (gimage)); gimp_channel_clear (gimp_image_get_mask (gimage));
/* if there's a drawable, add a new floating selection */ /* if there's a drawable, add a new floating selection */
if (drawable != NULL) if (drawable != NULL)

View file

@ -81,7 +81,7 @@ struct _ChannelsDialog
gint base_type; gint base_type;
ChannelType components[3]; ChannelType components[3];
Channel *active_channel; GimpChannel *active_channel;
GimpLayer *floating_sel; GimpLayer *floating_sel;
GSList *channel_widgets; GSList *channel_widgets;
}; };
@ -100,7 +100,7 @@ struct _ChannelWidget
/* state information */ /* state information */
GimpImage *gimage; GimpImage *gimage;
Channel *channel; GimpChannel *channel;
gint width, height; gint width, height;
ChannelType type; ChannelType type;
@ -115,9 +115,9 @@ static void channels_dialog_preview_extents (void);
static void channels_dialog_set_menu_sensitivity (void); static void channels_dialog_set_menu_sensitivity (void);
static void channels_dialog_set_channel (ChannelWidget *cw); static void channels_dialog_set_channel (ChannelWidget *cw);
static void channels_dialog_unset_channel (ChannelWidget *cw); static void channels_dialog_unset_channel (ChannelWidget *cw);
static void channels_dialog_position_channel (Channel *channel, static void channels_dialog_position_channel (GimpChannel *channel,
gint position); gint position);
static void channels_dialog_add_channel (Channel *channel); static void channels_dialog_add_channel (GimpChannel *channel);
static void channels_dialog_remove_channel (ChannelWidget *cw); static void channels_dialog_remove_channel (ChannelWidget *cw);
static gint channel_list_events (GtkWidget *widget, static gint channel_list_events (GtkWidget *widget,
@ -156,9 +156,9 @@ static gboolean channels_dialog_drag_delete_channel_callback
guint time); guint time);
/* channel widget function prototypes */ /* channel widget function prototypes */
static ChannelWidget * channel_widget_get_ID (Channel *channel); static ChannelWidget * channel_widget_get_ID (GimpChannel *channel);
static ChannelWidget * channel_widget_create (GimpImage *gimage, static ChannelWidget * channel_widget_create (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
ChannelType channel_type); ChannelType channel_type);
static gboolean channel_widget_drag_motion_callback static gboolean channel_widget_drag_motion_callback
@ -441,7 +441,7 @@ channels_dialog_free (void)
void void
channels_dialog_update (GimpImage* gimage) channels_dialog_update (GimpImage* gimage)
{ {
Channel *channel; GimpChannel *channel;
ChannelWidget *cw; ChannelWidget *cw;
GSList *list; GSList *list;
GList *item_list; GList *item_list;
@ -517,9 +517,11 @@ channels_dialog_update (GimpImage* gimage)
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
/* create a channel list item */ /* create a channel list item */
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
cw = channel_widget_create (gimage, channel, AUXILLARY_CHANNEL); cw = channel_widget_create (gimage, channel, AUXILLARY_CHANNEL);
channelsD->channel_widgets = g_slist_append (channelsD->channel_widgets, cw); channelsD->channel_widgets =
g_slist_append (channelsD->channel_widgets, cw);
item_list = g_list_append (item_list, cw->list_item); item_list = g_list_append (item_list, cw->list_item);
} }
@ -532,7 +534,7 @@ void
channels_dialog_flush (void) channels_dialog_flush (void)
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *channel; GimpChannel *channel;
ChannelWidget *cw; ChannelWidget *cw;
GSList *list; GSList *list;
gint pos; gint pos;
@ -560,7 +562,7 @@ channels_dialog_flush (void)
/* Add any missing channels */ /* Add any missing channels */
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
cw = channel_widget_get_ID (channel); cw = channel_widget_get_ID (channel);
/* If the channel isn't in the channel widget list, add it */ /* If the channel isn't in the channel widget list, add it */
@ -590,7 +592,7 @@ channels_dialog_flush (void)
pos = 0; pos = 0;
for (list = gimage->channels; list; list = g_slist_next (list)) for (list = gimage->channels; list; list = g_slist_next (list))
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channels_dialog_position_channel (channel, pos++); channels_dialog_position_channel (channel, pos++);
} }
@ -843,7 +845,7 @@ channels_dialog_unset_channel (ChannelWidget *channel_widget)
} }
static void static void
channels_dialog_position_channel (Channel *channel, channels_dialog_position_channel (GimpChannel *channel,
gint new_index) gint new_index)
{ {
ChannelWidget *channel_widget; ChannelWidget *channel_widget;
@ -881,7 +883,7 @@ channels_dialog_position_channel (Channel *channel,
} }
static void static void
channels_dialog_add_channel (Channel *channel) channels_dialog_add_channel (GimpChannel *channel)
{ {
ChannelWidget *channel_widget; ChannelWidget *channel_widget;
GimpImage *gimage; GimpImage *gimage;
@ -1043,15 +1045,15 @@ channels_dialog_duplicate_channel_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *active_channel; GimpChannel *active_channel;
Channel *new_channel; GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage)) if (!channelsD || !(gimage = channelsD->gimage))
return; return;
if ((active_channel = gimp_image_get_active_channel (gimage))) if ((active_channel = gimp_image_get_active_channel (gimage)))
{ {
new_channel = channel_copy (active_channel); new_channel = gimp_channel_copy (active_channel);
gimp_image_add_channel (gimage, new_channel, -1); gimp_image_add_channel (gimage, new_channel, -1);
gdisplays_flush (); gdisplays_flush ();
} }
@ -1094,16 +1096,16 @@ channels_dialog_add_channel_to_sel_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *active_channel; GimpChannel *active_channel;
Channel *new_channel; GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage)) if (!channelsD || !(gimage = channelsD->gimage))
return; return;
if ((active_channel = gimp_image_get_active_channel (gimage))) if ((active_channel = gimp_image_get_active_channel (gimage)))
{ {
new_channel = channel_copy (gimp_image_get_mask (gimage)); new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
channel_combine_mask (new_channel, gimp_channel_combine_mask (new_channel,
active_channel, active_channel,
CHANNEL_OP_ADD, CHANNEL_OP_ADD,
0, 0); /* off x/y */ 0, 0); /* off x/y */
@ -1118,16 +1120,16 @@ channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *active_channel; GimpChannel *active_channel;
Channel *new_channel; GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage)) if (!channelsD || !(gimage = channelsD->gimage))
return; return;
if ((active_channel = gimp_image_get_active_channel (gimage))) if ((active_channel = gimp_image_get_active_channel (gimage)))
{ {
new_channel = channel_copy (gimp_image_get_mask (gimage)); new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
channel_combine_mask (new_channel, gimp_channel_combine_mask (new_channel,
active_channel, active_channel,
CHANNEL_OP_SUB, CHANNEL_OP_SUB,
0, 0); /* off x/y */ 0, 0); /* off x/y */
@ -1142,16 +1144,16 @@ channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *active_channel; GimpChannel *active_channel;
Channel *new_channel; GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage)) if (!channelsD || !(gimage = channelsD->gimage))
return; return;
if ((active_channel = gimp_image_get_active_channel (gimage))) if ((active_channel = gimp_image_get_active_channel (gimage)))
{ {
new_channel = channel_copy (gimp_image_get_mask (gimage)); new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
channel_combine_mask (new_channel, gimp_channel_combine_mask (new_channel,
active_channel, active_channel,
CHANNEL_OP_INTERSECT, CHANNEL_OP_INTERSECT,
0, 0); /* off x/y */ 0, 0); /* off x/y */
@ -1199,7 +1201,7 @@ channels_dialog_drag_new_channel_callback (GtkWidget *widget,
if (src && if (src &&
src->channel == channelsD->active_channel) src->channel == channelsD->active_channel)
{ {
Channel *channel; GimpChannel *channel;
GimpImage *gimage; GimpImage *gimage;
gint width, height; gint width, height;
gint off_x, off_y; gint off_x, off_y;
@ -1213,13 +1215,13 @@ channels_dialog_drag_new_channel_callback (GtkWidget *widget,
/* Start a group undo */ /* Start a group undo */
undo_push_group_start (gimage, EDIT_PASTE_UNDO); undo_push_group_start (gimage, EDIT_PASTE_UNDO);
channel = channel_new (gimage, width, height, channel = gimp_channel_new (gimage, width, height,
_("Empty Channel Copy"), _("Empty Channel Copy"),
&src->channel->color); &src->channel->color);
if (channel) if (channel)
{ {
drawable_fill (GIMP_DRAWABLE (channel), TRANSPARENT_FILL); drawable_fill (GIMP_DRAWABLE (channel), TRANSPARENT_FILL);
channel_translate (channel, off_x, off_y); gimp_channel_translate (channel, off_x, off_y);
gimp_image_add_channel (gimage, channel, -1); gimp_image_add_channel (gimage, channel, -1);
/* End the group undo */ /* End the group undo */
@ -1340,7 +1342,7 @@ channels_dialog_drag_delete_channel_callback (GtkWidget *widget,
/******************************/ /******************************/
static ChannelWidget * static ChannelWidget *
channel_widget_get_ID (Channel *channel) channel_widget_get_ID (GimpChannel *channel)
{ {
ChannelWidget *lw; ChannelWidget *lw;
GSList *list; GSList *list;
@ -1361,7 +1363,7 @@ channel_widget_get_ID (Channel *channel)
static ChannelWidget * static ChannelWidget *
channel_widget_create (GimpImage *gimage, channel_widget_create (GimpImage *gimage,
Channel *channel, GimpChannel *channel,
ChannelType type) ChannelType type)
{ {
ChannelWidget *channel_widget; ChannelWidget *channel_widget;
@ -1633,7 +1635,7 @@ channel_widget_drag_begin_callback (GtkWidget *widget,
typedef struct typedef struct
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *channel; GimpChannel *channel;
gint dest_index; gint dest_index;
} ChannelDrop; } ChannelDrop;
@ -1760,7 +1762,7 @@ channel_widget_drop_color (GtkWidget *widget,
gpointer data) gpointer data)
{ {
ChannelWidget *channel_widget; ChannelWidget *channel_widget;
Channel *channel; GimpChannel *channel;
channel_widget = (ChannelWidget *) data; channel_widget = (ChannelWidget *) data;
channel = channel_widget->channel; channel = channel_widget->channel;
@ -2102,7 +2104,7 @@ channel_widget_preview_redraw (ChannelWidget *channel_widget)
if (channelsD->ratio > 1.0) /* Preview is scaling up! */ if (channelsD->ratio > 1.0) /* Preview is scaling up! */
{ {
preview_buf = channel_preview (channel_widget->channel, preview_buf = gimp_channel_preview (channel_widget->channel,
channelsD->gimage_width, channelsD->gimage_width,
channelsD->gimage_height); channelsD->gimage_height);
preview_buf = gimp_preview_scale (preview_buf, preview_buf = gimp_preview_scale (preview_buf,
@ -2111,7 +2113,7 @@ channel_widget_preview_redraw (ChannelWidget *channel_widget)
} }
else else
{ {
preview_buf = channel_preview (channel_widget->channel, preview_buf = gimp_channel_preview (channel_widget->channel,
channel_widget->width, channel_widget->width,
channel_widget->height); channel_widget->height);
} }
@ -2507,7 +2509,7 @@ new_channel_query_ok_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
NewChannelOptions *options; NewChannelOptions *options;
Channel *new_channel; GimpChannel *new_channel;
GimpImage *gimage; GimpImage *gimage;
options = (NewChannelOptions *) data; options = (NewChannelOptions *) data;
@ -2520,7 +2522,7 @@ new_channel_query_ok_callback (GtkWidget *widget,
{ {
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel), gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
&channel_color); &channel_color);
new_channel = channel_new (gimage, gimage->width, gimage->height, new_channel = gimp_channel_new (gimage, gimage->width, gimage->height,
channel_name, channel_name,
&channel_color); &channel_color);
@ -2654,7 +2656,7 @@ edit_channel_query_ok_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
EditChannelOptions *options; EditChannelOptions *options;
Channel *channel; GimpChannel *channel;
GimpRGB color; GimpRGB color;
options = (EditChannelOptions *) data; options = (EditChannelOptions *) data;

View file

@ -73,6 +73,7 @@
#include "selection.h" #include "selection.h"
#include "tips_dialog.h" #include "tips_dialog.h"
#include "undo.h" #include "undo.h"
#include "undo_history.h"
#ifdef DISPLAY_FILTERS #ifdef DISPLAY_FILTERS
#include "gdisplay_color_ui.h" #include "gdisplay_color_ui.h"

View file

@ -73,6 +73,7 @@
#include "selection.h" #include "selection.h"
#include "tips_dialog.h" #include "tips_dialog.h"
#include "undo.h" #include "undo.h"
#include "undo_history.h"
#ifdef DISPLAY_FILTERS #ifdef DISPLAY_FILTERS
#include "gdisplay_color_ui.h" #include "gdisplay_color_ui.h"

View file

@ -94,7 +94,7 @@ struct _LayersDialog
gdouble ratio; gdouble ratio;
GimpLayer *active_layer; GimpLayer *active_layer;
Channel *active_channel; GimpChannel *active_channel;
GimpLayer *floating_sel; GimpLayer *floating_sel;
GSList *layer_widgets; GSList *layer_widgets;
}; };

View file

@ -232,7 +232,7 @@ qmask_activate (GtkWidget *widget,
floating_sel_to_layer (layer); floating_sel_to_layer (layer);
} }
gmask = channel_new (gimg, gmask = gimp_channel_new (gimg,
gimg->width, gimg->width,
gimg->height, gimg->height,
"Qmask", "Qmask",
@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget,
{ {
/* if selection */ /* if selection */
gmask = channel_copy (gimp_image_get_mask (gimg)); gmask = gimp_channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0); gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, &color); gimp_channel_set_color (gmask, &color);
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask"); gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
gimage_mask_none (gimg); /* Clear the selection */ gimage_mask_none (gimg); /* Clear the selection */
} }
@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
EditQmaskOptions *options; EditQmaskOptions *options;
Channel *channel; GimpChannel *channel;
GimpRGB color; GimpRGB color;
options = (EditQmaskOptions *) data; options = (EditQmaskOptions *) data;
@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001) if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{ {
channel->color = color; channel->color = color;
channel_update (channel); gimp_channel_update (channel);
} }
} }

View file

@ -659,14 +659,14 @@ toolbox_drag_drop (GtkWidget *widget,
{ {
GimpDrawable *drawable = NULL; GimpDrawable *drawable = NULL;
GimpLayer *layer = NULL; GimpLayer *layer = NULL;
Channel *channel = NULL; GimpChannel *channel = NULL;
GimpLayerMask *layer_mask = NULL; GimpLayerMask *layer_mask = NULL;
GimpImage *component = NULL; GimpImage *component = NULL;
ChannelType component_type = -1; ChannelType component_type = -1;
layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget), layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer"); "gimp_layer");
channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), channel = (GimpChannel *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_channel"); "gimp_channel");
layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer_mask"); "gimp_layer_mask");

View file

@ -742,7 +742,7 @@ gimp_layer_scale_lowlevel (GimpLayer *layer,
{ {
GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x; GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x;
GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y; GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y;
channel_scale (GIMP_CHANNEL (layer->mask), new_width, new_height); gimp_channel_scale (GIMP_CHANNEL (layer->mask), new_width, new_height);
} }
/* Make sure we're not caching any old selection info */ /* Make sure we're not caching any old selection info */
@ -1016,7 +1016,7 @@ gimp_layer_resize (GimpLayer *layer,
{ {
GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x; GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x;
GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y; GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y;
channel_resize (GIMP_CHANNEL (layer->mask), gimp_channel_resize (GIMP_CHANNEL (layer->mask),
new_width, new_height, offx, offy); new_width, new_height, offx, offy);
} }
@ -1115,7 +1115,7 @@ void
gimp_layer_invalidate_boundary (GimpLayer *layer) gimp_layer_invalidate_boundary (GimpLayer *layer)
{ {
GimpImage *gimage; GimpImage *gimage;
Channel *mask; GimpChannel *mask;
/* first get the selection mask channel */ /* first get the selection mask channel */
if (! (gimage = gimp_drawable_gimage (GIMP_DRAWABLE (layer)))) if (! (gimage = gimp_drawable_gimage (GIMP_DRAWABLE (layer))))
@ -1130,7 +1130,7 @@ gimp_layer_invalidate_boundary (GimpLayer *layer)
mask = gimp_image_get_mask (gimage); mask = gimp_image_get_mask (gimage);
/* Only bother with the bounds if there is a selection */ /* Only bother with the bounds if there is a selection */
if (! channel_is_empty (mask)) if (! gimp_channel_is_empty (mask))
{ {
mask->bounds_known = FALSE; mask->bounds_known = FALSE;
mask->boundary_known = FALSE; mask->boundary_known = FALSE;

View file

@ -94,7 +94,7 @@ struct _LayersDialog
gdouble ratio; gdouble ratio;
GimpLayer *active_layer; GimpLayer *active_layer;
Channel *active_channel; GimpChannel *active_channel;
GimpLayer *floating_sel; GimpLayer *floating_sel;
GSList *layer_widgets; GSList *layer_widgets;
}; };

View file

@ -82,7 +82,7 @@ channel_new_invoker (Argument *args)
gchar *name; gchar *name;
gdouble opacity; gdouble opacity;
GimpRGB color; GimpRGB color;
Channel *channel = NULL; GimpChannel *channel = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int); gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL) if (gimage == NULL)
@ -111,7 +111,7 @@ channel_new_invoker (Argument *args)
GimpRGB rgb_color = color; GimpRGB rgb_color = color;
rgb_color.a = opacity / 100.0; rgb_color.a = opacity / 100.0;
channel = channel_new (gimage, width, height, name, &rgb_color); channel = gimp_channel_new (gimage, width, height, name, &rgb_color);
success = channel != NULL; success = channel != NULL;
} }
@ -187,15 +187,15 @@ channel_copy_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
Channel *channel; GimpChannel *channel;
Channel *copy = NULL; GimpChannel *copy = NULL;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL) if (channel == NULL)
success = FALSE; success = FALSE;
if (success) if (success)
success = (copy = channel_copy (channel)) != NULL; success = (copy = gimp_channel_copy (channel)) != NULL;
return_args = procedural_db_return_args (&channel_copy_proc, success); return_args = procedural_db_return_args (&channel_copy_proc, success);
@ -243,7 +243,7 @@ static Argument *
channel_delete_invoker (Argument *args) channel_delete_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Channel *channel; GimpChannel *channel;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL) if (channel == NULL)
@ -284,8 +284,8 @@ static Argument *
channel_combine_masks_invoker (Argument *args) channel_combine_masks_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Channel *channel1; GimpChannel *channel1;
Channel *channel2; GimpChannel *channel2;
gint32 operation; gint32 operation;
gint32 offx; gint32 offx;
gint32 offy; gint32 offy;
@ -308,7 +308,7 @@ channel_combine_masks_invoker (Argument *args)
if (success) if (success)
{ {
channel_combine_mask (channel1, channel2, operation, offx, offy); gimp_channel_combine_mask (channel1, channel2, operation, offx, offy);
} }
return procedural_db_return_args (&channel_combine_masks_proc, success); return procedural_db_return_args (&channel_combine_masks_proc, success);
@ -364,7 +364,7 @@ channel_get_name_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
Channel *channel; GimpChannel *channel;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL) if (channel == NULL)
@ -373,7 +373,7 @@ channel_get_name_invoker (Argument *args)
return_args = procedural_db_return_args (&channel_get_name_proc, success); return_args = procedural_db_return_args (&channel_get_name_proc, success);
if (success) if (success)
return_args[1].value.pdb_pointer = g_strdup (channel_get_name (channel)); return_args[1].value.pdb_pointer = g_strdup (gimp_channel_get_name (channel));
return return_args; return return_args;
} }
@ -416,7 +416,7 @@ static Argument *
channel_set_name_invoker (Argument *args) channel_set_name_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Channel *channel; GimpChannel *channel;
gchar *name; gchar *name;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
@ -428,7 +428,7 @@ channel_set_name_invoker (Argument *args)
success = FALSE; success = FALSE;
if (success) if (success)
channel_set_name (channel, name); gimp_channel_set_name (channel, name);
return procedural_db_return_args (&channel_set_name_proc, success); return procedural_db_return_args (&channel_set_name_proc, success);
} }
@ -468,7 +468,7 @@ channel_get_visible_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
Channel *channel; GimpChannel *channel;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL) if (channel == NULL)
@ -520,7 +520,7 @@ static Argument *
channel_set_visible_invoker (Argument *args) channel_set_visible_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Channel *channel; GimpChannel *channel;
gboolean visible; gboolean visible;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
@ -570,7 +570,7 @@ channel_get_show_masked_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
Channel *channel; GimpChannel *channel;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL) if (channel == NULL)
@ -622,7 +622,7 @@ static Argument *
channel_set_show_masked_invoker (Argument *args) channel_set_show_masked_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Channel *channel; GimpChannel *channel;
gboolean show_masked; gboolean show_masked;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
@ -672,7 +672,7 @@ channel_get_opacity_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
Channel *channel; GimpChannel *channel;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL) if (channel == NULL)
@ -724,7 +724,7 @@ static Argument *
channel_set_opacity_invoker (Argument *args) channel_set_opacity_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Channel *channel; GimpChannel *channel;
gdouble opacity; gdouble opacity;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
@ -776,7 +776,7 @@ channel_get_color_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
Channel *channel; GimpChannel *channel;
GimpRGB color; GimpRGB color;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
@ -834,7 +834,7 @@ static Argument *
channel_set_color_invoker (Argument *args) channel_set_color_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Channel *channel; GimpChannel *channel;
GimpRGB color; GimpRGB color;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
@ -848,7 +848,7 @@ channel_set_color_invoker (Argument *args)
GimpRGB rgb_color = color; GimpRGB rgb_color = color;
rgb_color.a = channel->color.a; rgb_color.a = channel->color.a;
channel_set_color(channel, &rgb_color); gimp_channel_set_color(channel, &rgb_color);
} }
return procedural_db_return_args (&channel_set_color_proc, success); return procedural_db_return_args (&channel_set_color_proc, success);
@ -889,7 +889,7 @@ channel_get_tattoo_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
Channel *channel; GimpChannel *channel;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL) if (channel == NULL)
@ -898,7 +898,7 @@ channel_get_tattoo_invoker (Argument *args)
return_args = procedural_db_return_args (&channel_get_tattoo_proc, success); return_args = procedural_db_return_args (&channel_get_tattoo_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = channel_get_tattoo (channel); return_args[1].value.pdb_int = gimp_channel_get_tattoo (channel);
return return_args; return return_args;
} }
@ -941,7 +941,7 @@ static Argument *
channel_set_tattoo_invoker (Argument *args) channel_set_tattoo_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Channel *channel; GimpChannel *channel;
gint32 tattoo; gint32 tattoo;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
@ -953,7 +953,7 @@ channel_set_tattoo_invoker (Argument *args)
success = FALSE; success = FALSE;
if (success) if (success)
channel_set_tattoo (channel, tattoo); gimp_channel_set_tattoo (channel, tattoo);
return procedural_db_return_args (&channel_set_tattoo_proc, success); return procedural_db_return_args (&channel_set_tattoo_proc, success);
} }

View file

@ -914,7 +914,7 @@ histogram_invoker (Argument *args)
HistogramToolDialog htd; HistogramToolDialog htd;
int off_x, off_y; int off_x, off_y;
gboolean no_mask; gboolean no_mask;
Channel *mask; GimpChannel *mask;
drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (drawable == NULL) if (drawable == NULL)

View file

@ -1409,7 +1409,7 @@ drawable_thumbnail_invoker (Argument *args)
if (GIMP_IS_LAYER (drawable)) if (GIMP_IS_LAYER (drawable))
buf = gimp_layer_preview (GIMP_LAYER (drawable), req_width, req_height); buf = gimp_layer_preview (GIMP_LAYER (drawable), req_width, req_height);
else else
buf = channel_preview (GIMP_CHANNEL (drawable), req_width, req_height); buf = gimp_channel_preview (GIMP_CHANNEL (drawable), req_width, req_height);
num_pixels = buf->height * buf->width * buf->bytes; num_pixels = buf->height * buf->width * buf->bytes;
thumbnail_data = g_new (guint8, num_pixels); thumbnail_data = g_new (guint8, num_pixels);

View file

@ -1459,7 +1459,7 @@ image_raise_channel_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
Channel *channel; GimpChannel *channel;
gimage = pdb_id_to_image (args[0].value.pdb_int); gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL) if (gimage == NULL)
@ -1561,7 +1561,7 @@ image_add_channel_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
Channel *channel; GimpChannel *channel;
gint32 position; gint32 position;
gimage = pdb_id_to_image (args[0].value.pdb_int); gimage = pdb_id_to_image (args[0].value.pdb_int);
@ -1620,7 +1620,7 @@ image_remove_channel_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
Channel *channel; GimpChannel *channel;
gimage = pdb_id_to_image (args[0].value.pdb_int); gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL) if (gimage == NULL)
@ -2831,7 +2831,7 @@ image_get_active_channel_invoker (Argument *args)
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *gimage;
Channel *active_channel = NULL; GimpChannel *active_channel = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int); gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL) if (gimage == NULL)
@ -2887,7 +2887,7 @@ image_set_active_channel_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
Channel *active_channel; GimpChannel *active_channel;
gimage = pdb_id_to_image (args[0].value.pdb_int); gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL) if (gimage == NULL)
@ -2939,7 +2939,7 @@ image_get_selection_invoker (Argument *args)
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *gimage;
Channel *selection = NULL; GimpChannel *selection = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int); gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL) if (gimage == NULL)
@ -3692,7 +3692,7 @@ image_get_channel_by_tattoo_invoker (Argument *args)
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *gimage;
gint32 tattoo; gint32 tattoo;
Channel *channel = NULL; GimpChannel *channel = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int); gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL) if (gimage == NULL)

View file

@ -29,10 +29,10 @@
#define gimp_layer_set_tattoo(l,t) gimp_drawable_set_tattoo(GIMP_DRAWABLE(l),(t)) #define gimp_layer_set_tattoo(l,t) gimp_drawable_set_tattoo(GIMP_DRAWABLE(l),(t))
#define gimp_layer_get_tattoo(l) gimp_drawable_get_tattoo(GIMP_DRAWABLE(l)) #define gimp_layer_get_tattoo(l) gimp_drawable_get_tattoo(GIMP_DRAWABLE(l))
#define channel_set_name(c,n) gimp_object_set_name(GIMP_OBJECT(c),(n)) #define gimp_channel_set_name(c,n) gimp_object_set_name(GIMP_OBJECT(c),(n))
#define channel_get_name(c) gimp_object_get_name(GIMP_OBJECT(c)) #define gimp_channel_get_name(c) gimp_object_get_name(GIMP_OBJECT(c))
#define channel_set_tattoo(c,t) gimp_drawable_set_tattoo(GIMP_DRAWABLE(c),(t)) #define gimp_channel_set_tattoo(c,t) gimp_drawable_set_tattoo(GIMP_DRAWABLE(c),(t))
#define channel_get_tattoo(c) gimp_drawable_get_tattoo(GIMP_DRAWABLE(c)) #define gimp_channel_get_tattoo(c) gimp_drawable_get_tattoo(GIMP_DRAWABLE(c))
#endif /* __PDB_GLUE_H__ */ #endif /* __PDB_GLUE_H__ */

View file

@ -876,7 +876,7 @@ static Argument *
selection_load_invoker (Argument *args) selection_load_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Channel *channel; GimpChannel *channel;
GimpImage *gimage; GimpImage *gimage;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
@ -928,7 +928,7 @@ selection_save_invoker (Argument *args)
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *gimage;
Channel *channel = NULL; GimpChannel *channel = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int); gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL) if (gimage == NULL)
@ -983,10 +983,10 @@ static Argument *
selection_combine_invoker (Argument *args) selection_combine_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Channel *channel; GimpChannel *channel;
gint32 operation; gint32 operation;
GimpImage *gimage; GimpImage *gimage;
Channel *new_channel; GimpChannel *new_channel;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL) if (channel == NULL)
@ -1003,8 +1003,8 @@ selection_combine_invoker (Argument *args)
if (gimp_drawable_width (GIMP_DRAWABLE (channel)) == gimage->width && if (gimp_drawable_width (GIMP_DRAWABLE (channel)) == gimage->width &&
gimp_drawable_height (GIMP_DRAWABLE (channel)) == gimage->height) gimp_drawable_height (GIMP_DRAWABLE (channel)) == gimage->height)
{ {
new_channel = channel_copy (gimp_image_get_mask (gimage)); new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
channel_combine_mask (new_channel, gimp_channel_combine_mask (new_channel,
channel, channel,
operation, operation,
0, 0); /* off x/y */ 0, 0); /* off x/y */

View file

@ -1782,7 +1782,7 @@ fuzzy_select_invoker (Argument *args)
gdouble feather_radius; gdouble feather_radius;
gboolean sample_merged; gboolean sample_merged;
GimpImage *gimage; GimpImage *gimage;
Channel *new, *old_fuzzy_mask; GimpChannel *new, *old_fuzzy_mask;
drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (drawable == NULL) if (drawable == NULL)

View file

@ -232,7 +232,7 @@ qmask_activate (GtkWidget *widget,
floating_sel_to_layer (layer); floating_sel_to_layer (layer);
} }
gmask = channel_new (gimg, gmask = gimp_channel_new (gimg,
gimg->width, gimg->width,
gimg->height, gimg->height,
"Qmask", "Qmask",
@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget,
{ {
/* if selection */ /* if selection */
gmask = channel_copy (gimp_image_get_mask (gimg)); gmask = gimp_channel_copy (gimp_image_get_mask (gimg));
gimp_image_add_channel (gimg, gmask, 0); gimp_image_add_channel (gimg, gmask, 0);
channel_set_color (gmask, &color); gimp_channel_set_color (gmask, &color);
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask"); gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
gimage_mask_none (gimg); /* Clear the selection */ gimage_mask_none (gimg); /* Clear the selection */
} }
@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
EditQmaskOptions *options; EditQmaskOptions *options;
Channel *channel; GimpChannel *channel;
GimpRGB color; GimpRGB color;
options = (EditQmaskOptions *) data; options = (EditQmaskOptions *) data;
@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001) if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{ {
channel->color = color; channel->color = color;
channel_update (channel); gimp_channel_update (channel);
} }
} }

View file

@ -235,11 +235,11 @@ scan_converter_add_points (ScanConverter *sc,
* according to the even-odd rule. The polygon is closed by * according to the even-odd rule. The polygon is closed by
* joining the final point to the initial point. * joining the final point to the initial point.
*/ */
Channel * GimpChannel *
scan_converter_to_channel (ScanConverter *sc, scan_converter_to_channel (ScanConverter *sc,
GimpImage *gimage) GimpImage *gimage)
{ {
Channel *mask; GimpChannel *mask;
GSList *list; GSList *list;
PixelRegion maskPR; PixelRegion maskPR;
guint widtha; guint widtha;
@ -267,7 +267,7 @@ scan_converter_to_channel (ScanConverter *sc,
(int) sc->first.y * antialias); (int) sc->first.y * antialias);
} }
mask = channel_new_mask (gimage, sc->width, sc->height); mask = gimp_channel_new_mask (gimage, sc->width, sc->height);
buf = g_new0 (guchar, sc->width); buf = g_new0 (guchar, sc->width);
widtha = sc->width * antialias; widtha = sc->width * antialias;
@ -320,7 +320,7 @@ scan_converter_to_channel (ScanConverter *sc,
{ {
if (antialias == 1) if (antialias == 1)
{ {
channel_add_segment (mask, x, i, w, 255); gimp_channel_add_segment (mask, x, i, w, 255);
} }
else else
{ {

View file

@ -53,7 +53,7 @@ void scan_converter_add_points (ScanConverter *scan_converter,
* according to the even-odd rule. The polygon is closed by * according to the even-odd rule. The polygon is closed by
* joining the final point to the initial point. * joining the final point to the initial point.
*/ */
Channel * scan_converter_to_channel (ScanConverter *scan_converter, GimpChannel * scan_converter_to_channel (ScanConverter *scan_converter,
GimpImage *gimage); GimpImage *gimage);

View file

@ -659,14 +659,14 @@ toolbox_drag_drop (GtkWidget *widget,
{ {
GimpDrawable *drawable = NULL; GimpDrawable *drawable = NULL;
GimpLayer *layer = NULL; GimpLayer *layer = NULL;
Channel *channel = NULL; GimpChannel *channel = NULL;
GimpLayerMask *layer_mask = NULL; GimpLayerMask *layer_mask = NULL;
GimpImage *component = NULL; GimpImage *component = NULL;
ChannelType component_type = -1; ChannelType component_type = -1;
layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget), layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer"); "gimp_layer");
channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), channel = (GimpChannel *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_channel"); "gimp_channel");
layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer_mask"); "gimp_layer_mask");

View file

@ -1239,7 +1239,7 @@ bezier_select_button_press (Tool *tool,
} }
} }
if (!grab_pointer && channel_value (bezier_sel->mask, x, y)) if (!grab_pointer && gimp_channel_value (bezier_sel->mask, x, y))
{ {
gboolean replace = FALSE; gboolean replace = FALSE;
@ -1744,7 +1744,7 @@ bezier_select_cursor_update (Tool *tool,
on_curve = bezier_point_on_curve (gdisp, bezier_sel, x, y, halfwidth); on_curve = bezier_point_on_curve (gdisp, bezier_sel, x, y, halfwidth);
if (bezier_sel->mask && bezier_sel->closed && if (bezier_sel->mask && bezier_sel->closed &&
channel_value(bezier_sel->mask, x, y) && gimp_channel_value (bezier_sel->mask, x, y) &&
!on_control_pnt && !on_control_pnt &&
(!on_curve || ModeEdit != EXTEND_ADD)) (!on_curve || ModeEdit != EXTEND_ADD))
{ {
@ -2472,7 +2472,7 @@ bezier_convert (BezierSelect *bezier_sel,
} }
/* create a new mask */ /* create a new mask */
bezier_sel->mask = channel_new_mask (gdisp->gimage, bezier_sel->mask = gimp_channel_new_mask (gdisp->gimage,
gdisp->gimage->width, gdisp->gimage->width,
gdisp->gimage->height); gdisp->gimage->height);
@ -2537,7 +2537,7 @@ bezier_convert (BezierSelect *bezier_sel,
w = x2 - x; w = x2 - x;
if (!antialias) if (!antialias)
channel_add_segment (bezier_sel->mask, x, i, w, 255); gimp_channel_add_segment (bezier_sel->mask, x, i, w, 255);
else else
for (j = 0; j < w; j++) for (j = 0; j < w; j++)
vals[j + x] += 255; vals[j + x] += 255;
@ -2576,7 +2576,7 @@ bezier_convert (BezierSelect *bezier_sel,
g_free (bezier_sel->scanlines); g_free (bezier_sel->scanlines);
bezier_sel->scanlines = NULL; bezier_sel->scanlines = NULL;
channel_invalidate_bounds (bezier_sel->mask); gimp_channel_invalidate_bounds (bezier_sel->mask);
} }
static void static void
@ -2879,13 +2879,13 @@ bezier_to_sel_internal (BezierSelect *bezier_sel,
gimage_mask_undo (gdisp->gimage); gimage_mask_undo (gdisp->gimage);
if (bezier_options->feather) if (bezier_options->feather)
channel_feather (bezier_sel->mask, gimp_channel_feather (bezier_sel->mask,
gimp_image_get_mask (gdisp->gimage), gimp_image_get_mask (gdisp->gimage),
bezier_options->feather_radius, bezier_options->feather_radius,
bezier_options->feather_radius, bezier_options->feather_radius,
op, 0, 0); op, 0, 0);
else else
channel_combine_mask (gimp_image_get_mask (gdisp->gimage), gimp_channel_combine_mask (gimp_image_get_mask (gdisp->gimage),
bezier_sel->mask, op, 0, 0); bezier_sel->mask, op, 0, 0);
/* show selection on all views */ /* show selection on all views */

View file

@ -62,7 +62,7 @@ struct _BezierSelect
BezierPoint *cur_control; /* the current active control point */ BezierPoint *cur_control; /* the current active control point */
BezierPoint *last_point; /* the last point on the curve */ BezierPoint *last_point; /* the last point on the curve */
gint num_points; /* number of points in the curve */ gint num_points; /* number of points in the curve */
Channel *mask; /* null if the curve is open */ GimpChannel *mask; /* null if the curve is open */
GSList **scanlines; /* used in converting a curve */ GSList **scanlines; /* used in converting a curve */
}; };

View file

@ -1221,7 +1221,7 @@ gradient_precalc_shapeburst (GImage *gimage,
PixelRegion *PR, PixelRegion *PR,
gdouble dist) gdouble dist)
{ {
Channel *mask; GimpChannel *mask;
PixelRegion tempR; PixelRegion tempR;
gfloat max_iteration; gfloat max_iteration;
gfloat *distp; gfloat *distp;

View file

@ -370,7 +370,7 @@ bucket_fill (GimpImage *gimage,
{ {
TileManager *buf_tiles; TileManager *buf_tiles;
PixelRegion bufPR, maskPR; PixelRegion bufPR, maskPR;
Channel *mask = NULL; GimpChannel *mask = NULL;
gint bytes; gint bytes;
gboolean has_alpha; gboolean has_alpha;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
@ -442,7 +442,7 @@ bucket_fill (GimpImage *gimage,
mask = find_contiguous_region (gimage, drawable, TRUE, (int) threshold, mask = find_contiguous_region (gimage, drawable, TRUE, (int) threshold,
(int) x, (int) y, sample_merged); (int) x, (int) y, sample_merged);
channel_bounds (mask, &x1, &y1, &x2, &y2); gimp_channel_bounds (mask, &x1, &y1, &x2, &y2);
/* make sure we handle the mask correctly if it was sample-merged */ /* make sure we handle the mask correctly if it was sample-merged */
if (sample_merged) if (sample_merged)

View file

@ -155,7 +155,7 @@ static gint is_pixel_sufficiently_different (guchar *,
gint , gint ,
gint , gint ,
gint ); gint );
static Channel * by_color_select_color (GImage *, static GimpChannel * by_color_select_color (GImage *,
GimpDrawable *, GimpDrawable *,
guchar *, guchar *,
gint , gint ,
@ -214,7 +214,7 @@ is_pixel_sufficiently_different (guchar *col1,
} }
} }
static Channel * static GimpChannel *
by_color_select_color (GImage *gimage, by_color_select_color (GImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
guchar *color, guchar *color,
@ -227,7 +227,7 @@ by_color_select_color (GImage *gimage,
* use the same antialiasing scheme as in fuzzy_select. Modify the gimage's * use the same antialiasing scheme as in fuzzy_select. Modify the gimage's
* mask to reflect the additional selection * mask to reflect the additional selection
*/ */
Channel *mask; GimpChannel *mask;
PixelRegion imagePR, maskPR; PixelRegion imagePR, maskPR;
guchar *image_data; guchar *image_data;
guchar *mask_data; guchar *mask_data;
@ -279,7 +279,7 @@ by_color_select_color (GImage *gimage,
} }
alpha = bytes - 1; alpha = bytes - 1;
mask = channel_new_mask (gimage, width, height); mask = gimp_channel_new_mask (gimage, width, height);
pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE (mask)), pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE (mask)),
0, 0, width, height, TRUE); 0, 0, width, height, TRUE);
@ -334,7 +334,7 @@ by_color_select (GImage *gimage,
gdouble feather_radius, gdouble feather_radius,
gboolean sample_merged) gboolean sample_merged)
{ {
Channel *new_mask; GimpChannel *new_mask;
gint off_x, off_y; gint off_x, off_y;
if (!drawable) if (!drawable)
@ -359,12 +359,12 @@ by_color_select (GImage *gimage,
} }
if (feather) if (feather)
channel_feather (new_mask, gimp_image_get_mask (gimage), gimp_channel_feather (new_mask, gimp_image_get_mask (gimage),
feather_radius, feather_radius,
feather_radius, feather_radius,
op, off_x, off_y); op, off_x, off_y);
else else
channel_combine_mask (gimp_image_get_mask (gimage), gimp_channel_combine_mask (gimp_image_get_mask (gimage),
new_mask, op, off_x, off_y); new_mask, op, off_x, off_y);
gtk_object_unref (GTK_OBJECT (new_mask)); gtk_object_unref (GTK_OBJECT (new_mask));
@ -901,8 +901,8 @@ static void
by_color_select_render (ByColorDialog *bcd, by_color_select_render (ByColorDialog *bcd,
GImage *gimage) GImage *gimage)
{ {
Channel * mask; GimpChannel *mask;
MaskBuf * scaled_buf = NULL; MaskBuf *scaled_buf = NULL;
guchar *buf; guchar *buf;
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
guchar *src; guchar *src;

View file

@ -876,7 +876,7 @@ crop_image (GImage *gimage,
{ {
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
Channel *channel; GimpChannel *channel;
GList *guide_list_ptr; GList *guide_list_ptr;
GSList *list; GSList *list;
gint width, height; gint width, height;
@ -934,13 +934,13 @@ crop_image (GImage *gimage,
list = gimage->channels; list = gimage->channels;
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_resize (channel, width, height, -x1, -y1); gimp_channel_resize (channel, width, height, -x1, -y1);
list = g_slist_next (list); list = g_slist_next (list);
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
channel_resize (gimage->selection_mask, width, height, -x1, -y1); gimp_channel_resize (gimage->selection_mask, width, height, -x1, -y1);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
/* crop all layers */ /* crop all layers */

View file

@ -57,7 +57,7 @@ ellipse_select (GimpImage *gimage,
gboolean feather, gboolean feather,
gdouble feather_radius) gdouble feather_radius)
{ {
Channel *new_mask; GimpChannel *new_mask;
/* if applicable, replace the current selection */ /* if applicable, replace the current selection */
if (op == SELECTION_REPLACE) if (op == SELECTION_REPLACE)
@ -70,9 +70,10 @@ ellipse_select (GimpImage *gimage,
*/ */
if (feather) if (feather)
{ {
new_mask = channel_new_mask (gimage, gimage->width, gimage->height); new_mask = gimp_channel_new_mask (gimage, gimage->width, gimage->height);
channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); gimp_channel_combine_ellipse (new_mask, CHANNEL_OP_ADD,
channel_feather (new_mask, gimp_image_get_mask (gimage), x, y, w, h, antialias);
gimp_channel_feather (new_mask, gimp_image_get_mask (gimage),
feather_radius, feather_radius,
feather_radius, feather_radius,
op, 0, 0); op, 0, 0);
@ -80,14 +81,18 @@ ellipse_select (GimpImage *gimage,
} }
else if (op == SELECTION_INTERSECT) else if (op == SELECTION_INTERSECT)
{ {
new_mask = channel_new_mask (gimage, gimage->width, gimage->height); new_mask = gimp_channel_new_mask (gimage, gimage->width, gimage->height);
channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); gimp_channel_combine_ellipse (new_mask, CHANNEL_OP_ADD,
channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); x, y, w, h, antialias);
gimp_channel_combine_mask (gimp_image_get_mask (gimage), new_mask,
op, 0, 0);
gtk_object_unref (GTK_OBJECT (new_mask)); gtk_object_unref (GTK_OBJECT (new_mask));
} }
else else
channel_combine_ellipse (gimp_image_get_mask (gimage), op, {
gimp_channel_combine_ellipse (gimp_image_get_mask (gimage), op,
x, y, w, h, antialias); x, y, w, h, antialias);
}
} }
void void

View file

@ -111,7 +111,7 @@ add_point (gint num_pts,
} }
static Channel * static GimpChannel *
scan_convert (GimpImage *gimage, scan_convert (GimpImage *gimage,
gint num_pts, gint num_pts,
ScanConvertPoint *pts, ScanConvertPoint *pts,
@ -119,7 +119,7 @@ scan_convert (GimpImage *gimage,
gint height, gint height,
gboolean antialias) gboolean antialias)
{ {
Channel *mask; GimpChannel *mask;
ScanConverter *sc; ScanConverter *sc;
sc = scan_converter_new (width, height, antialias ? SUPERSAMPLE : 1); sc = scan_converter_new (width, height, antialias ? SUPERSAMPLE : 1);
@ -144,7 +144,7 @@ free_select (GImage *gimage,
gboolean feather, gboolean feather,
gdouble feather_radius) gdouble feather_radius)
{ {
Channel *mask; GimpChannel *mask;
/* if applicable, replace the current selection */ /* if applicable, replace the current selection */
/* or insure that a floating selection is anchored down... */ /* or insure that a floating selection is anchored down... */
@ -159,12 +159,12 @@ free_select (GImage *gimage,
if (mask) if (mask)
{ {
if (feather) if (feather)
channel_feather (mask, gimp_image_get_mask (gimage), gimp_channel_feather (mask, gimp_image_get_mask (gimage),
feather_radius, feather_radius,
feather_radius, feather_radius,
op, 0, 0); op, 0, 0);
else else
channel_combine_mask (gimp_image_get_mask (gimage), gimp_channel_combine_mask (gimp_image_get_mask (gimage),
mask, op, 0, 0); mask, op, 0, 0);
gtk_object_unref (GTK_OBJECT (mask)); gtk_object_unref (GTK_OBJECT (mask));

View file

@ -98,7 +98,7 @@ static SelectionOptions *fuzzy_options = NULL;
static GdkSegment *segs = NULL; static GdkSegment *segs = NULL;
static gint num_segs = 0; static gint num_segs = 0;
Channel * fuzzy_mask = NULL; GimpChannel * fuzzy_mask = NULL;
/*************************************/ /*************************************/
@ -298,7 +298,7 @@ find_contiguous_region_helper (PixelRegion *mask,
} }
} }
Channel * GimpChannel *
find_contiguous_region (GImage *gimage, find_contiguous_region (GImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
gboolean antialias, gboolean antialias,
@ -308,7 +308,7 @@ find_contiguous_region (GImage *gimage,
gboolean sample_merged) gboolean sample_merged)
{ {
PixelRegion srcPR, maskPR; PixelRegion srcPR, maskPR;
Channel *mask; GimpChannel *mask;
guchar *start; guchar *start;
gboolean has_alpha; gboolean has_alpha;
gboolean indexed; gboolean indexed;
@ -341,7 +341,7 @@ find_contiguous_region (GImage *gimage,
{ {
bytes = has_alpha ? 4 : 3; bytes = has_alpha ? 4 : 3;
} }
mask = channel_new_mask (gimage, srcPR.w, srcPR.h); mask = gimp_channel_new_mask (gimage, srcPR.w, srcPR.h);
pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE(mask)), pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE(mask)),
0, 0, 0, 0,
gimp_drawable_width (GIMP_DRAWABLE(mask)), gimp_drawable_width (GIMP_DRAWABLE(mask)),
@ -383,12 +383,12 @@ fuzzy_select (GImage *gimage,
off_x = off_y = 0; off_x = off_y = 0;
if (feather) if (feather)
channel_feather (fuzzy_mask, gimp_image_get_mask (gimage), gimp_channel_feather (fuzzy_mask, gimp_image_get_mask (gimage),
feather_radius, feather_radius,
feather_radius, feather_radius,
op, off_x, off_y); op, off_x, off_y);
else else
channel_combine_mask (gimp_image_get_mask (gimage), gimp_channel_combine_mask (gimp_image_get_mask (gimage),
fuzzy_mask, op, off_x, off_y); fuzzy_mask, op, off_x, off_y);
gtk_object_unref (GTK_OBJECT (fuzzy_mask)); gtk_object_unref (GTK_OBJECT (fuzzy_mask));
@ -534,7 +534,7 @@ fuzzy_select_calculate (Tool *tool,
{ {
PixelRegion maskPR; PixelRegion maskPR;
FuzzySelect *fuzzy_sel; FuzzySelect *fuzzy_sel;
Channel *new; GimpChannel *new;
GdkSegment *segs; GdkSegment *segs;
BoundSeg *bsegs; BoundSeg *bsegs;
GimpDrawable *drawable; GimpDrawable *drawable;

View file

@ -20,7 +20,7 @@
#define __FUZZY_SELECT_H__ #define __FUZZY_SELECT_H__
Channel * find_contiguous_region (GimpImage *gimage, GimpChannel * find_contiguous_region (GimpImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
gboolean antialias, gboolean antialias,
gint threshold, gint threshold,
@ -37,7 +37,7 @@ Tool * tools_new_fuzzy_select (void);
void tools_free_fuzzy_select (Tool *tool); void tools_free_fuzzy_select (Tool *tool);
extern Channel *fuzzy_mask; extern GimpChannel *fuzzy_mask;
#endif /* __FUZZY_SELECT_H__ */ #endif /* __FUZZY_SELECT_H__ */

View file

@ -1221,7 +1221,7 @@ gradient_precalc_shapeburst (GImage *gimage,
PixelRegion *PR, PixelRegion *PR,
gdouble dist) gdouble dist)
{ {
Channel *mask; GimpChannel *mask;
PixelRegion tempR; PixelRegion tempR;
gfloat max_iteration; gfloat max_iteration;
gfloat *distp; gfloat *distp;

View file

@ -370,7 +370,7 @@ bucket_fill (GimpImage *gimage,
{ {
TileManager *buf_tiles; TileManager *buf_tiles;
PixelRegion bufPR, maskPR; PixelRegion bufPR, maskPR;
Channel *mask = NULL; GimpChannel *mask = NULL;
gint bytes; gint bytes;
gboolean has_alpha; gboolean has_alpha;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
@ -442,7 +442,7 @@ bucket_fill (GimpImage *gimage,
mask = find_contiguous_region (gimage, drawable, TRUE, (int) threshold, mask = find_contiguous_region (gimage, drawable, TRUE, (int) threshold,
(int) x, (int) y, sample_merged); (int) x, (int) y, sample_merged);
channel_bounds (mask, &x1, &y1, &x2, &y2); gimp_channel_bounds (mask, &x1, &y1, &x2, &y2);
/* make sure we handle the mask correctly if it was sample-merged */ /* make sure we handle the mask correctly if it was sample-merged */
if (sample_merged) if (sample_merged)

View file

@ -155,7 +155,7 @@ static gint is_pixel_sufficiently_different (guchar *,
gint , gint ,
gint , gint ,
gint ); gint );
static Channel * by_color_select_color (GImage *, static GimpChannel * by_color_select_color (GImage *,
GimpDrawable *, GimpDrawable *,
guchar *, guchar *,
gint , gint ,
@ -214,7 +214,7 @@ is_pixel_sufficiently_different (guchar *col1,
} }
} }
static Channel * static GimpChannel *
by_color_select_color (GImage *gimage, by_color_select_color (GImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
guchar *color, guchar *color,
@ -227,7 +227,7 @@ by_color_select_color (GImage *gimage,
* use the same antialiasing scheme as in fuzzy_select. Modify the gimage's * use the same antialiasing scheme as in fuzzy_select. Modify the gimage's
* mask to reflect the additional selection * mask to reflect the additional selection
*/ */
Channel *mask; GimpChannel *mask;
PixelRegion imagePR, maskPR; PixelRegion imagePR, maskPR;
guchar *image_data; guchar *image_data;
guchar *mask_data; guchar *mask_data;
@ -279,7 +279,7 @@ by_color_select_color (GImage *gimage,
} }
alpha = bytes - 1; alpha = bytes - 1;
mask = channel_new_mask (gimage, width, height); mask = gimp_channel_new_mask (gimage, width, height);
pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE (mask)), pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE (mask)),
0, 0, width, height, TRUE); 0, 0, width, height, TRUE);
@ -334,7 +334,7 @@ by_color_select (GImage *gimage,
gdouble feather_radius, gdouble feather_radius,
gboolean sample_merged) gboolean sample_merged)
{ {
Channel *new_mask; GimpChannel *new_mask;
gint off_x, off_y; gint off_x, off_y;
if (!drawable) if (!drawable)
@ -359,12 +359,12 @@ by_color_select (GImage *gimage,
} }
if (feather) if (feather)
channel_feather (new_mask, gimp_image_get_mask (gimage), gimp_channel_feather (new_mask, gimp_image_get_mask (gimage),
feather_radius, feather_radius,
feather_radius, feather_radius,
op, off_x, off_y); op, off_x, off_y);
else else
channel_combine_mask (gimp_image_get_mask (gimage), gimp_channel_combine_mask (gimp_image_get_mask (gimage),
new_mask, op, off_x, off_y); new_mask, op, off_x, off_y);
gtk_object_unref (GTK_OBJECT (new_mask)); gtk_object_unref (GTK_OBJECT (new_mask));
@ -901,8 +901,8 @@ static void
by_color_select_render (ByColorDialog *bcd, by_color_select_render (ByColorDialog *bcd,
GImage *gimage) GImage *gimage)
{ {
Channel * mask; GimpChannel *mask;
MaskBuf * scaled_buf = NULL; MaskBuf *scaled_buf = NULL;
guchar *buf; guchar *buf;
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
guchar *src; guchar *src;

View file

@ -876,7 +876,7 @@ crop_image (GImage *gimage,
{ {
GimpLayer *layer; GimpLayer *layer;
GimpLayer *floating_layer; GimpLayer *floating_layer;
Channel *channel; GimpChannel *channel;
GList *guide_list_ptr; GList *guide_list_ptr;
GSList *list; GSList *list;
gint width, height; gint width, height;
@ -934,13 +934,13 @@ crop_image (GImage *gimage,
list = gimage->channels; list = gimage->channels;
while (list) while (list)
{ {
channel = (Channel *) list->data; channel = (GimpChannel *) list->data;
channel_resize (channel, width, height, -x1, -y1); gimp_channel_resize (channel, width, height, -x1, -y1);
list = g_slist_next (list); list = g_slist_next (list);
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
channel_resize (gimage->selection_mask, width, height, -x1, -y1); gimp_channel_resize (gimage->selection_mask, width, height, -x1, -y1);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
/* crop all layers */ /* crop all layers */

View file

@ -57,7 +57,7 @@ ellipse_select (GimpImage *gimage,
gboolean feather, gboolean feather,
gdouble feather_radius) gdouble feather_radius)
{ {
Channel *new_mask; GimpChannel *new_mask;
/* if applicable, replace the current selection */ /* if applicable, replace the current selection */
if (op == SELECTION_REPLACE) if (op == SELECTION_REPLACE)
@ -70,9 +70,10 @@ ellipse_select (GimpImage *gimage,
*/ */
if (feather) if (feather)
{ {
new_mask = channel_new_mask (gimage, gimage->width, gimage->height); new_mask = gimp_channel_new_mask (gimage, gimage->width, gimage->height);
channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); gimp_channel_combine_ellipse (new_mask, CHANNEL_OP_ADD,
channel_feather (new_mask, gimp_image_get_mask (gimage), x, y, w, h, antialias);
gimp_channel_feather (new_mask, gimp_image_get_mask (gimage),
feather_radius, feather_radius,
feather_radius, feather_radius,
op, 0, 0); op, 0, 0);
@ -80,14 +81,18 @@ ellipse_select (GimpImage *gimage,
} }
else if (op == SELECTION_INTERSECT) else if (op == SELECTION_INTERSECT)
{ {
new_mask = channel_new_mask (gimage, gimage->width, gimage->height); new_mask = gimp_channel_new_mask (gimage, gimage->width, gimage->height);
channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); gimp_channel_combine_ellipse (new_mask, CHANNEL_OP_ADD,
channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); x, y, w, h, antialias);
gimp_channel_combine_mask (gimp_image_get_mask (gimage), new_mask,
op, 0, 0);
gtk_object_unref (GTK_OBJECT (new_mask)); gtk_object_unref (GTK_OBJECT (new_mask));
} }
else else
channel_combine_ellipse (gimp_image_get_mask (gimage), op, {
gimp_channel_combine_ellipse (gimp_image_get_mask (gimage), op,
x, y, w, h, antialias); x, y, w, h, antialias);
}
} }
void void

View file

@ -111,7 +111,7 @@ add_point (gint num_pts,
} }
static Channel * static GimpChannel *
scan_convert (GimpImage *gimage, scan_convert (GimpImage *gimage,
gint num_pts, gint num_pts,
ScanConvertPoint *pts, ScanConvertPoint *pts,
@ -119,7 +119,7 @@ scan_convert (GimpImage *gimage,
gint height, gint height,
gboolean antialias) gboolean antialias)
{ {
Channel *mask; GimpChannel *mask;
ScanConverter *sc; ScanConverter *sc;
sc = scan_converter_new (width, height, antialias ? SUPERSAMPLE : 1); sc = scan_converter_new (width, height, antialias ? SUPERSAMPLE : 1);
@ -144,7 +144,7 @@ free_select (GImage *gimage,
gboolean feather, gboolean feather,
gdouble feather_radius) gdouble feather_radius)
{ {
Channel *mask; GimpChannel *mask;
/* if applicable, replace the current selection */ /* if applicable, replace the current selection */
/* or insure that a floating selection is anchored down... */ /* or insure that a floating selection is anchored down... */
@ -159,12 +159,12 @@ free_select (GImage *gimage,
if (mask) if (mask)
{ {
if (feather) if (feather)
channel_feather (mask, gimp_image_get_mask (gimage), gimp_channel_feather (mask, gimp_image_get_mask (gimage),
feather_radius, feather_radius,
feather_radius, feather_radius,
op, 0, 0); op, 0, 0);
else else
channel_combine_mask (gimp_image_get_mask (gimage), gimp_channel_combine_mask (gimp_image_get_mask (gimage),
mask, op, 0, 0); mask, op, 0, 0);
gtk_object_unref (GTK_OBJECT (mask)); gtk_object_unref (GTK_OBJECT (mask));

View file

@ -98,7 +98,7 @@ static SelectionOptions *fuzzy_options = NULL;
static GdkSegment *segs = NULL; static GdkSegment *segs = NULL;
static gint num_segs = 0; static gint num_segs = 0;
Channel * fuzzy_mask = NULL; GimpChannel * fuzzy_mask = NULL;
/*************************************/ /*************************************/
@ -298,7 +298,7 @@ find_contiguous_region_helper (PixelRegion *mask,
} }
} }
Channel * GimpChannel *
find_contiguous_region (GImage *gimage, find_contiguous_region (GImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
gboolean antialias, gboolean antialias,
@ -308,7 +308,7 @@ find_contiguous_region (GImage *gimage,
gboolean sample_merged) gboolean sample_merged)
{ {
PixelRegion srcPR, maskPR; PixelRegion srcPR, maskPR;
Channel *mask; GimpChannel *mask;
guchar *start; guchar *start;
gboolean has_alpha; gboolean has_alpha;
gboolean indexed; gboolean indexed;
@ -341,7 +341,7 @@ find_contiguous_region (GImage *gimage,
{ {
bytes = has_alpha ? 4 : 3; bytes = has_alpha ? 4 : 3;
} }
mask = channel_new_mask (gimage, srcPR.w, srcPR.h); mask = gimp_channel_new_mask (gimage, srcPR.w, srcPR.h);
pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE(mask)), pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE(mask)),
0, 0, 0, 0,
gimp_drawable_width (GIMP_DRAWABLE(mask)), gimp_drawable_width (GIMP_DRAWABLE(mask)),
@ -383,12 +383,12 @@ fuzzy_select (GImage *gimage,
off_x = off_y = 0; off_x = off_y = 0;
if (feather) if (feather)
channel_feather (fuzzy_mask, gimp_image_get_mask (gimage), gimp_channel_feather (fuzzy_mask, gimp_image_get_mask (gimage),
feather_radius, feather_radius,
feather_radius, feather_radius,
op, off_x, off_y); op, off_x, off_y);
else else
channel_combine_mask (gimp_image_get_mask (gimage), gimp_channel_combine_mask (gimp_image_get_mask (gimage),
fuzzy_mask, op, off_x, off_y); fuzzy_mask, op, off_x, off_y);
gtk_object_unref (GTK_OBJECT (fuzzy_mask)); gtk_object_unref (GTK_OBJECT (fuzzy_mask));
@ -534,7 +534,7 @@ fuzzy_select_calculate (Tool *tool,
{ {
PixelRegion maskPR; PixelRegion maskPR;
FuzzySelect *fuzzy_sel; FuzzySelect *fuzzy_sel;
Channel *new; GimpChannel *new;
GdkSegment *segs; GdkSegment *segs;
BoundSeg *bsegs; BoundSeg *bsegs;
GimpDrawable *drawable; GimpDrawable *drawable;

View file

@ -20,7 +20,7 @@
#define __FUZZY_SELECT_H__ #define __FUZZY_SELECT_H__
Channel * find_contiguous_region (GimpImage *gimage, GimpChannel * find_contiguous_region (GimpImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
gboolean antialias, gboolean antialias,
gint threshold, gint threshold,
@ -37,7 +37,7 @@ Tool * tools_new_fuzzy_select (void);
void tools_free_fuzzy_select (Tool *tool); void tools_free_fuzzy_select (Tool *tool);
extern Channel *fuzzy_mask; extern GimpChannel *fuzzy_mask;
#endif /* __FUZZY_SELECT_H__ */ #endif /* __FUZZY_SELECT_H__ */

Some files were not shown because too many files have changed in this diff Show more