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>
* app/pdb/Makefile.am

View file

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

View file

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

View file

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

View file

@ -232,11 +232,11 @@ qmask_activate (GtkWidget *widget,
floating_sel_to_layer (layer);
}
gmask = channel_new (gimg,
gimg->width,
gimg->height,
"Qmask",
&color);
gmask = gimp_channel_new (gimg,
gimg->width,
gimg->height,
"Qmask",
&color);
gimp_image_add_channel (gimg, gmask, 0);
drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL);
}
@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget,
{
/* 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);
channel_set_color (gmask, &color);
gimp_channel_set_color (gmask, &color);
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
gimage_mask_none (gimg); /* Clear the selection */
}
@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
gpointer data)
{
EditQmaskOptions *options;
Channel *channel;
GimpChannel *channel;
GimpRGB color;
options = (EditQmaskOptions *) data;
@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{
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 _GimpChannel GimpChannel;
typedef GimpChannel Channel; /* convenience */
typedef struct _GimpLayer GimpLayer;
typedef struct _GimpLayerMask GimpLayerMask;

View file

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

View file

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

View file

@ -16,8 +16,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __CHANNEL_H__
#define __CHANNEL_H__
#ifndef __GIMP_CHANNEL_H__
#define __GIMP_CHANNEL_H__
#include "gimpdrawable.h"
@ -26,7 +26,6 @@
/* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127
/* structure declarations */
#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ())
#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 _MaskUndo MaskUndo;
struct _ChannelUndo
{
Channel *channel; /* the actual channel */
gint prev_position; /* former position in list */
Channel *prev_channel; /* previous active channel */
GimpChannel *channel; /* the actual channel */
gint prev_position; /* former position in list */
GimpChannel *prev_channel; /* previous active channel */
};
/* Special undo type */
typedef struct _MaskUndo MaskUndo;
struct _MaskUndo
{
TileManager *tiles; /* the actual mask */
@ -87,128 +83,128 @@ struct _MaskUndo
/* function declarations */
GtkType gimp_channel_get_type (void);
GtkType gimp_channel_get_type (void);
Channel * channel_new (GimpImage *gimage,
gint width,
gint height,
const gchar *name,
const GimpRGB *color);
Channel * channel_copy (const Channel *channel);
GimpChannel * gimp_channel_new (GimpImage *gimage,
gint width,
gint height,
const gchar *name,
const GimpRGB *color);
GimpChannel * gimp_channel_copy (const GimpChannel *channel);
gint channel_get_opacity (const Channel *channel);
void channel_set_opacity (Channel *channel,
gint opacity);
gint gimp_channel_get_opacity (const GimpChannel *channel);
void gimp_channel_set_opacity (GimpChannel *channel,
gint opacity);
const GimpRGB * channel_get_color (const Channel *channel);
void channel_set_color (Channel *channel,
const GimpRGB *color);
const GimpRGB * gimp_channel_get_color (const GimpChannel *channel);
void gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color);
void channel_scale (Channel *channel,
gint new_width,
gint new_height);
void channel_resize (Channel *channel,
gint new_width,
gint new_height,
gint offx,
gint offy);
void channel_update (Channel *channel);
void gimp_channel_scale (GimpChannel *channel,
gint new_width,
gint new_height);
void gimp_channel_resize (GimpChannel *channel,
gint new_width,
gint new_height,
gint offx,
gint offy);
void gimp_channel_update (GimpChannel *channel);
/* access functions */
gboolean channel_toggle_visibility (Channel *channel);
TempBuf * channel_preview (Channel *channel,
gint width,
gint height);
gboolean gimp_channel_toggle_visibility (GimpChannel *channel);
TempBuf * gimp_channel_preview (GimpChannel *channel,
gint width,
gint height);
/* selection mask functions */
Channel * channel_new_mask (GimpImage *gimage,
gint width,
gint height);
gboolean channel_boundary (Channel *mask,
BoundSeg **segs_in,
BoundSeg **segs_out,
gint *num_segs_in,
gint *num_segs_out,
gint x1,
gint y1,
gint x2,
gint y2);
gboolean channel_bounds (Channel *mask,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
gint channel_value (Channel *mask,
gint x,
gint y);
gboolean channel_is_empty (Channel *mask);
void channel_add_segment (Channel *mask,
gint x,
gint y,
gint width,
gint value);
void channel_sub_segment (Channel *mask,
gint x,
gint y,
gint width,
gint value);
void channel_combine_rect (Channel *mask,
ChannelOps op,
gint x,
gint y,
gint w,
gint h);
void channel_combine_ellipse (Channel *mask,
ChannelOps op,
gint x,
gint y,
gint w,
gint h,
gboolean antialias);
void channel_combine_mask (Channel *mask,
Channel *add_on,
ChannelOps op,
gint off_x,
gint off_y);
void channel_feather (Channel *input,
Channel *output,
gdouble radius_x,
gdouble radius_y,
ChannelOps op,
gint off_x,
gint off_y);
GimpChannel * gimp_channel_new_mask (GimpImage *gimage,
gint width,
gint height);
gboolean gimp_channel_boundary (GimpChannel *mask,
BoundSeg **segs_in,
BoundSeg **segs_out,
gint *num_segs_in,
gint *num_segs_out,
gint x1,
gint y1,
gint x2,
gint y2);
gboolean gimp_channel_bounds (GimpChannel *mask,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
gint gimp_channel_value (GimpChannel *mask,
gint x,
gint y);
gboolean gimp_channel_is_empty (GimpChannel *mask);
void gimp_channel_add_segment (GimpChannel *mask,
gint x,
gint y,
gint width,
gint value);
void gimp_channel_sub_segment (GimpChannel *mask,
gint x,
gint y,
gint width,
gint value);
void gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op,
gint x,
gint y,
gint w,
gint h);
void gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op,
gint x,
gint y,
gint w,
gint h,
gboolean antialias);
void gimp_channel_combine_mask (GimpChannel *mask,
GimpChannel *add_on,
ChannelOps op,
gint off_x,
gint off_y);
void gimp_channel_feather (GimpChannel *input,
GimpChannel *output,
gdouble radius_x,
gdouble radius_y,
ChannelOps op,
gint off_x,
gint off_y);
void channel_push_undo (Channel *mask);
void channel_clear (Channel *mask);
void channel_invert (Channel *mask);
void channel_sharpen (Channel *mask);
void channel_all (Channel *mask);
void gimp_channel_push_undo (GimpChannel *mask);
void gimp_channel_clear (GimpChannel *mask);
void gimp_channel_invert (GimpChannel *mask);
void gimp_channel_sharpen (GimpChannel *mask);
void gimp_channel_all (GimpChannel *mask);
void channel_border (Channel *mask,
gint radius_x,
gint radius_y);
void channel_grow (Channel *mask,
gint radius_x,
gint radius_y);
void channel_shrink (Channel *mask,
gint radius_x,
gint radius_y,
gboolean edge_lock);
void gimp_channel_border (GimpChannel *mask,
gint radius_x,
gint radius_y);
void gimp_channel_grow (GimpChannel *mask,
gint radius_x,
gint radius_y);
void gimp_channel_shrink (GimpChannel *mask,
gint radius_x,
gint radius_y,
gboolean edge_lock);
void channel_translate (Channel *mask,
gint off_x,
gint off_y);
void channel_load (Channel *mask,
Channel *channel);
void gimp_channel_translate (GimpChannel *mask,
gint off_x,
gint off_y);
void gimp_channel_load (GimpChannel *mask,
GimpChannel *channel);
void channel_layer_alpha (Channel *mask,
GimpLayer *layer);
void channel_layer_mask (Channel *mask,
GimpLayer *layer);
void gimp_channel_layer_alpha (GimpChannel *mask,
GimpLayer *layer);
void gimp_channel_layer_mask (GimpChannel *mask,
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;
GimpLayer *layer, *new_layer;
GimpLayer *floating_layer;
Channel *channel, *new_channel;
GimpChannel *channel, *new_channel;
GSList *list;
GList *glist;
Guide *guide = NULL;
GimpLayer *active_layer = NULL;
Channel *active_channel = NULL;
GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL;
ParasiteList *parasites;
@ -645,12 +645,12 @@ duplicate (GimpImage *gimage)
count = 0;
while (list)
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
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" */
gimp_object_set_name (GIMP_OBJECT (new_channel),

View file

@ -81,7 +81,7 @@ struct _ChannelsDialog
gint base_type;
ChannelType components[3];
Channel *active_channel;
GimpChannel *active_channel;
GimpLayer *floating_sel;
GSList *channel_widgets;
};
@ -100,7 +100,7 @@ struct _ChannelWidget
/* state information */
GimpImage *gimage;
Channel *channel;
GimpChannel *channel;
gint width, height;
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_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);
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 gint channel_list_events (GtkWidget *widget,
@ -156,9 +156,9 @@ static gboolean channels_dialog_drag_delete_channel_callback
guint time);
/* 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,
Channel *channel,
GimpChannel *channel,
ChannelType channel_type);
static gboolean channel_widget_drag_motion_callback
@ -410,7 +410,7 @@ void
channels_dialog_free (void)
{
ChannelWidget *cw;
GSList *list;
GSList *list;
if (!channelsD)
return;
@ -441,7 +441,7 @@ channels_dialog_free (void)
void
channels_dialog_update (GimpImage* gimage)
{
Channel *channel;
GimpChannel *channel;
ChannelWidget *cw;
GSList *list;
GList *item_list;
@ -517,9 +517,11 @@ channels_dialog_update (GimpImage* gimage)
for (list = gimage->channels; list; list = g_slist_next (list))
{
/* create a channel list item */
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
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);
}
@ -532,7 +534,7 @@ void
channels_dialog_flush (void)
{
GimpImage *gimage;
Channel *channel;
GimpChannel *channel;
ChannelWidget *cw;
GSList *list;
gint pos;
@ -560,7 +562,7 @@ channels_dialog_flush (void)
/* Add any missing channels */
for (list = gimage->channels; list; list = g_slist_next (list))
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
cw = channel_widget_get_ID (channel);
/* If the channel isn't in the channel widget list, add it */
@ -590,7 +592,7 @@ channels_dialog_flush (void)
pos = 0;
for (list = gimage->channels; list; list = g_slist_next (list))
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
channels_dialog_position_channel (channel, pos++);
}
@ -659,8 +661,8 @@ static void
channels_dialog_set_menu_sensitivity (void)
{
ChannelWidget *cw;
gint fs_sens;
gint aux_sens;
gint fs_sens;
gint aux_sens;
cw = channel_widget_get_ID (channelsD->active_channel);
fs_sens = (channelsD->floating_sel != NULL);
@ -843,11 +845,11 @@ channels_dialog_unset_channel (ChannelWidget *channel_widget)
}
static void
channels_dialog_position_channel (Channel *channel,
gint new_index)
channels_dialog_position_channel (GimpChannel *channel,
gint new_index)
{
ChannelWidget *channel_widget;
GList *list = NULL;
GList *list = NULL;
channel_widget = channel_widget_get_ID (channel);
if (!channelsD || !channel_widget)
@ -881,12 +883,12 @@ channels_dialog_position_channel (Channel *channel,
}
static void
channels_dialog_add_channel (Channel *channel)
channels_dialog_add_channel (GimpChannel *channel)
{
ChannelWidget *channel_widget;
GimpImage *gimage;
GList *item_list;
gint position;
GimpImage *gimage;
GList *item_list;
gint position;
if (!channelsD || !channel || !(gimage = channelsD->gimage))
return;
@ -1042,16 +1044,16 @@ void
channels_dialog_duplicate_channel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
Channel *active_channel;
Channel *new_channel;
GimpImage *gimage;
GimpChannel *active_channel;
GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage))
return;
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);
gdisplays_flush ();
}
@ -1093,20 +1095,20 @@ void
channels_dialog_add_channel_to_sel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
Channel *active_channel;
Channel *new_channel;
GimpImage *gimage;
GimpChannel *active_channel;
GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage))
return;
if ((active_channel = gimp_image_get_active_channel (gimage)))
{
new_channel = channel_copy (gimp_image_get_mask (gimage));
channel_combine_mask (new_channel,
active_channel,
CHANNEL_OP_ADD,
0, 0); /* off x/y */
new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
gimp_channel_combine_mask (new_channel,
active_channel,
CHANNEL_OP_ADD,
0, 0); /* off x/y */
gimage_mask_load (gimage, new_channel);
gtk_object_unref (GTK_OBJECT (new_channel));
gdisplays_flush ();
@ -1117,20 +1119,20 @@ void
channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
Channel *active_channel;
Channel *new_channel;
GimpImage *gimage;
GimpChannel *active_channel;
GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage))
return;
if ((active_channel = gimp_image_get_active_channel (gimage)))
{
new_channel = channel_copy (gimp_image_get_mask (gimage));
channel_combine_mask (new_channel,
active_channel,
CHANNEL_OP_SUB,
0, 0); /* off x/y */
new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
gimp_channel_combine_mask (new_channel,
active_channel,
CHANNEL_OP_SUB,
0, 0); /* off x/y */
gimage_mask_load (gimage, new_channel);
gtk_object_unref (GTK_OBJECT (new_channel));
gdisplays_flush ();
@ -1141,20 +1143,20 @@ void
channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
Channel *active_channel;
Channel *new_channel;
GimpImage *gimage;
GimpChannel *active_channel;
GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage))
return;
if ((active_channel = gimp_image_get_active_channel (gimage)))
{
new_channel = channel_copy (gimp_image_get_mask (gimage));
channel_combine_mask (new_channel,
active_channel,
CHANNEL_OP_INTERSECT,
0, 0); /* off x/y */
new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
gimp_channel_combine_mask (new_channel,
active_channel,
CHANNEL_OP_INTERSECT,
0, 0); /* off x/y */
gimage_mask_load (gimage, new_channel);
gtk_object_unref (GTK_OBJECT (new_channel));
gdisplays_flush ();
@ -1199,10 +1201,10 @@ channels_dialog_drag_new_channel_callback (GtkWidget *widget,
if (src &&
src->channel == channelsD->active_channel)
{
Channel *channel;
GimpImage *gimage;
gint width, height;
gint off_x, off_y;
GimpChannel *channel;
GimpImage *gimage;
gint width, height;
gint off_x, off_y;
gimage = channelsD->gimage;
@ -1213,13 +1215,13 @@ channels_dialog_drag_new_channel_callback (GtkWidget *widget,
/* Start a group undo */
undo_push_group_start (gimage, EDIT_PASTE_UNDO);
channel = channel_new (gimage, width, height,
_("Empty Channel Copy"),
&src->channel->color);
channel = gimp_channel_new (gimage, width, height,
_("Empty Channel Copy"),
&src->channel->color);
if (channel)
{
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);
/* End the group undo */
@ -1340,10 +1342,10 @@ channels_dialog_drag_delete_channel_callback (GtkWidget *widget,
/******************************/
static ChannelWidget *
channel_widget_get_ID (Channel *channel)
channel_widget_get_ID (GimpChannel *channel)
{
ChannelWidget *lw;
GSList *list;
GSList *list;
if (!channelsD)
return NULL;
@ -1361,14 +1363,14 @@ channel_widget_get_ID (Channel *channel)
static ChannelWidget *
channel_widget_create (GimpImage *gimage,
Channel *channel,
GimpChannel *channel,
ChannelType type)
{
ChannelWidget *channel_widget;
GtkWidget *list_item;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *alignment;
GtkWidget *list_item;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *alignment;
list_item = gtk_list_item_new ();
@ -1632,9 +1634,9 @@ channel_widget_drag_begin_callback (GtkWidget *widget,
typedef struct
{
GimpImage *gimage;
Channel *channel;
gint dest_index;
GimpImage *gimage;
GimpChannel *channel;
gint dest_index;
} ChannelDrop;
static gint
@ -1760,7 +1762,7 @@ channel_widget_drop_color (GtkWidget *widget,
gpointer data)
{
ChannelWidget *channel_widget;
Channel *channel;
GimpChannel *channel;
channel_widget = (ChannelWidget *) data;
channel = channel_widget->channel;
@ -2102,18 +2104,18 @@ channel_widget_preview_redraw (ChannelWidget *channel_widget)
if (channelsD->ratio > 1.0) /* Preview is scaling up! */
{
preview_buf = channel_preview (channel_widget->channel,
channelsD->gimage_width,
channelsD->gimage_height);
preview_buf = gimp_channel_preview (channel_widget->channel,
channelsD->gimage_width,
channelsD->gimage_height);
preview_buf = gimp_preview_scale (preview_buf,
channel_widget->width,
channel_widget->height);
}
else
{
preview_buf = channel_preview (channel_widget->channel,
channel_widget->width,
channel_widget->height);
preview_buf = gimp_channel_preview (channel_widget->channel,
channel_widget->width,
channel_widget->height);
}
break;
@ -2382,7 +2384,7 @@ channel_widget_channel_flush (GtkWidget *widget,
gpointer data)
{
ChannelWidget *channel_widget;
gboolean update_preview = FALSE;
gboolean update_preview = FALSE;
channel_widget =
(ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (widget));
@ -2507,7 +2509,7 @@ new_channel_query_ok_callback (GtkWidget *widget,
gpointer data)
{
NewChannelOptions *options;
Channel *new_channel;
GimpChannel *new_channel;
GimpImage *gimage;
options = (NewChannelOptions *) data;
@ -2520,9 +2522,9 @@ new_channel_query_ok_callback (GtkWidget *widget,
{
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
&channel_color);
new_channel = channel_new (gimage, gimage->width, gimage->height,
channel_name,
&channel_color);
new_channel = gimp_channel_new (gimage, gimage->width, gimage->height,
channel_name,
&channel_color);
drawable_fill (GIMP_DRAWABLE (new_channel), TRANSPARENT_FILL);
@ -2654,7 +2656,7 @@ edit_channel_query_ok_callback (GtkWidget *widget,
gpointer data)
{
EditChannelOptions *options;
Channel *channel;
GimpChannel *channel;
GimpRGB color;
options = (EditChannelOptions *) data;

View file

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

View file

@ -351,7 +351,7 @@ edit_paste (GimpImage *gimage,
* it seems like the correct behavior.
*/
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 (drawable != NULL)

View file

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

View file

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

View file

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

View file

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

View file

@ -569,12 +569,12 @@ duplicate (GimpImage *gimage)
GimpImage *new_gimage;
GimpLayer *layer, *new_layer;
GimpLayer *floating_layer;
Channel *channel, *new_channel;
GimpChannel *channel, *new_channel;
GSList *list;
GList *glist;
Guide *guide = NULL;
GimpLayer *active_layer = NULL;
Channel *active_channel = NULL;
GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL;
ParasiteList *parasites;
@ -645,12 +645,12 @@ duplicate (GimpImage *gimage)
count = 0;
while (list)
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
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" */
gimp_object_set_name (GIMP_OBJECT (new_channel),

View file

@ -351,7 +351,7 @@ edit_paste (GimpImage *gimage,
* it seems like the correct behavior.
*/
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 (drawable != NULL)

View file

@ -569,12 +569,12 @@ duplicate (GimpImage *gimage)
GimpImage *new_gimage;
GimpLayer *layer, *new_layer;
GimpLayer *floating_layer;
Channel *channel, *new_channel;
GimpChannel *channel, *new_channel;
GSList *list;
GList *glist;
Guide *guide = NULL;
GimpLayer *active_layer = NULL;
Channel *active_channel = NULL;
GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL;
ParasiteList *parasites;
@ -645,12 +645,12 @@ duplicate (GimpImage *gimage)
count = 0;
while (list)
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
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" */
gimp_object_set_name (GIMP_OBJECT (new_channel),

View file

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

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */
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 */
Channel *selection_mask; /* selection mask channel */
GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */
@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg,
gint position);
Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel,
gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
GimpChannel *channel);
GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_position_channel (GimpImage *gimage,
GimpChannel *channel_arg,
gint position);
GimpChannel * gimp_image_add_channel (GimpImage *gimage,
GimpChannel *channel,
gint position);
GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,

View file

@ -75,10 +75,10 @@ gimage_mask_boundary (GImage *gimage,
*/
/* Find the selection mask boundary */
channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out,
num_segs_in, num_segs_out,
0, 0, 0, 0);
gimp_channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out,
num_segs_in, num_segs_out,
0, 0, 0, 0);
/* Find the floating selection boundary */
*segs_in = floating_sel_boundary (layer, num_segs_in);
@ -89,10 +89,10 @@ gimage_mask_boundary (GImage *gimage,
else if ((d = gimp_image_active_drawable (gimage)) &&
GIMP_IS_CHANNEL (d))
{
return channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out,
num_segs_in, num_segs_out,
0, 0, gimage->width, gimage->height);
return gimp_channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out,
num_segs_in, num_segs_out,
0, 0, gimage->width, gimage->height);
}
/* if a layer is active, we return multiple boundaries based on the extents */
else if ((layer = gimp_image_get_active_layer (gimage)))
@ -107,10 +107,10 @@ gimage_mask_boundary (GImage *gimage,
y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE(layer)), 0,
gimage->height);
return channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out,
num_segs_in, num_segs_out,
x1, y1, x2, y2);
return gimp_channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out,
num_segs_in, num_segs_out,
x1, y1, x2, y2);
}
else
{
@ -130,15 +130,15 @@ gimage_mask_bounds (GImage *gimage,
gint *x2,
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);
}
void
gimage_mask_invalidate (GImage *gimage)
{
GimpLayer *layer;
Channel *mask;
GimpLayer *layer;
GimpChannel *mask;
/* Turn the current selection off */
gdisplays_selection_visibility (gimage, SelectionOff);
@ -163,7 +163,7 @@ gimage_mask_value (GImage *gimage,
int x,
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)
return TRUE;
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_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,15 +197,15 @@ gimage_mask_extract (GImage *gimage,
gboolean keep_indexed,
gboolean add_alpha)
{
TileManager * tiles;
Channel * sel_mask;
PixelRegion srcPR, destPR, maskPR;
guchar bg[MAX_CHANNELS];
gint bytes, type;
gint x1, y1;
gint x2, y2;
gint off_x, off_y;
gboolean non_empty;
TileManager *tiles;
GimpChannel *sel_mask;
PixelRegion srcPR, destPR, maskPR;
guchar bg[MAX_CHANNELS];
gint bytes, type;
gint x1, y1;
gint x2, y2;
gint off_x, off_y;
gboolean non_empty;
if (!drawable)
return NULL;
@ -293,7 +293,7 @@ gimage_mask_extract (GImage *gimage,
if (cut_gimage)
{
/* Clear the region */
channel_clear (gimp_image_get_mask (gimage));
gimp_channel_clear (gimp_image_get_mask (gimage));
/* Update the region */
gdisplays_update_area (gimage,
@ -350,7 +350,7 @@ gimage_mask_float (GImage *gimage,
gint off_y)
{
GimpLayer *layer;
Channel *mask = gimp_image_get_mask (gimage);
GimpChannel *mask = gimp_image_get_mask (gimage);
TileManager *tiles;
gboolean non_empty;
gint x1, y1;
@ -401,21 +401,21 @@ gimage_mask_float (GImage *gimage,
void
gimage_mask_clear (GImage *gimage)
{
channel_clear (gimp_image_get_mask (gimage));
gimp_channel_clear (gimp_image_get_mask (gimage));
}
void
gimage_mask_undo (GImage *gimage)
{
channel_push_undo (gimp_image_get_mask (gimage));
gimp_channel_push_undo (gimp_image_get_mask (gimage));
}
void
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
* because sharpen will not change the outline
*/
channel_sharpen (gimp_image_get_mask (gimage));
gimp_channel_sharpen (gimp_image_get_mask (gimage));
}
void
gimage_mask_all (GImage *gimage)
{
channel_all (gimp_image_get_mask (gimage));
gimp_channel_all (gimp_image_get_mask (gimage));
}
void
gimage_mask_none (GImage *gimage)
{
channel_clear (gimp_image_get_mask (gimage));
gimp_channel_clear (gimp_image_get_mask (gimage));
}
@ -449,16 +449,16 @@ gimage_mask_feather (GImage *gimage,
gdouble feather_radius_y)
{
/* 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 */
channel_feather (gimp_image_get_mask (gimage),
gimp_image_get_mask (gimage),
feather_radius_x,
feather_radius_y,
CHANNEL_OP_REPLACE, 0, 0);
gimp_channel_feather (gimp_image_get_mask (gimage),
gimp_image_get_mask (gimage),
feather_radius_x,
feather_radius_y,
CHANNEL_OP_REPLACE, 0, 0);
}
@ -468,9 +468,9 @@ gimage_mask_border (GImage *gimage,
gint border_radius_y)
{
/* feather the region */
channel_border (gimp_image_get_mask (gimage),
border_radius_x,
border_radius_y);
gimp_channel_border (gimp_image_get_mask (gimage),
border_radius_x,
border_radius_y);
}
@ -480,9 +480,9 @@ gimage_mask_grow (GImage *gimage,
int grow_pixels_y)
{
/* feather the region */
channel_grow (gimp_image_get_mask (gimage),
grow_pixels_x,
grow_pixels_y);
gimp_channel_grow (gimp_image_get_mask (gimage),
grow_pixels_x,
grow_pixels_y);
}
@ -493,10 +493,10 @@ gimage_mask_shrink (GImage *gimage,
gboolean edge_lock)
{
/* feather the region */
channel_shrink (gimp_image_get_mask (gimage),
shrink_pixels_x,
shrink_pixels_y,
edge_lock);
gimp_channel_shrink (gimp_image_get_mask (gimage),
shrink_pixels_x,
shrink_pixels_y,
edge_lock);
}
@ -508,7 +508,7 @@ gimage_mask_layer_alpha (GimpImage *gimage,
if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)))
{
/* 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
{
@ -527,7 +527,7 @@ gimage_mask_layer_mask (GimpImage *gimage,
if (gimp_layer_get_mask (layer))
{
/* 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
{
@ -539,20 +539,20 @@ gimage_mask_layer_mask (GimpImage *gimage,
void
gimage_mask_load (GImage *gimage,
Channel *channel)
gimage_mask_load (GImage *gimage,
GimpChannel *channel)
{
/* 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)
{
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 */
GIMP_DRAWABLE(new_channel)->visible = FALSE;

View file

@ -86,9 +86,9 @@ void gimage_mask_layer_mask (GImage *gimage,
GimpLayer *layer);
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,
GimpDrawable *drawable);

View file

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

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */
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 */
Channel *selection_mask; /* selection mask channel */
GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */
@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg,
gint position);
Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel,
gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
GimpChannel *channel);
GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_position_channel (GimpImage *gimage,
GimpChannel *channel_arg,
gint position);
GimpChannel * gimp_image_add_channel (GimpImage *gimage,
GimpChannel *channel,
gint position);
GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,

View file

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

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */
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 */
Channel *selection_mask; /* selection mask channel */
GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */
@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg,
gint position);
Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel,
gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
GimpChannel *channel);
GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_position_channel (GimpImage *gimage,
GimpChannel *channel_arg,
gint position);
GimpChannel * gimp_image_add_channel (GimpImage *gimage,
GimpChannel *channel,
gint position);
GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,

View file

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

View file

@ -232,11 +232,11 @@ qmask_activate (GtkWidget *widget,
floating_sel_to_layer (layer);
}
gmask = channel_new (gimg,
gimg->width,
gimg->height,
"Qmask",
&color);
gmask = gimp_channel_new (gimg,
gimg->width,
gimg->height,
"Qmask",
&color);
gimp_image_add_channel (gimg, gmask, 0);
drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL);
}
@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget,
{
/* 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);
channel_set_color (gmask, &color);
gimp_channel_set_color (gmask, &color);
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
gimage_mask_none (gimg); /* Clear the selection */
}
@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
gpointer data)
{
EditQmaskOptions *options;
Channel *channel;
GimpChannel *channel;
GimpRGB color;
options = (EditQmaskOptions *) data;
@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{
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 *mask);
static void project_channel (GimpImage *gimage,
Channel *layer,
GimpChannel *channel,
PixelRegion *src,
PixelRegion *src2);
@ -437,8 +437,9 @@ gimp_image_new (gint width,
}
/* create the selection mask */
gimage->selection_mask = channel_new_mask (gimage,
gimage->width, gimage->height);
gimage->selection_mask = gimp_channel_new_mask (gimage,
gimage->width,
gimage->height);
return gimage;
@ -552,11 +553,11 @@ gimp_image_resize (GimpImage *gimage,
gint offset_x,
gint offset_y)
{
Channel *channel;
GimpLayer *layer;
GimpLayer *floating_layer;
GSList *list;
GList *guide_list;
GimpChannel *channel;
GimpLayer *layer;
GimpLayer *floating_layer;
GSList *list;
GList *guide_list;
gimp_add_busy_cursors ();
@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage,
/* Resize all channels */
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 */
@ -617,8 +618,8 @@ gimp_image_resize (GimpImage *gimage,
}
/* Don't forget the selection mask! */
channel_resize (gimage->selection_mask,
new_width, new_height, offset_x, offset_y);
gimp_channel_resize (gimage->selection_mask,
new_width, new_height, offset_x, offset_y);
gimage_mask_invalidate (gimage);
/* Reposition all layers */
@ -646,17 +647,17 @@ gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height)
{
Channel *channel;
GimpLayer *layer;
GimpLayer *floating_layer;
GSList *list;
GSList *remove = NULL;
GList *glist;
Guide *guide;
gint old_width;
gint old_height;
gdouble img_scale_w = 1.0;
gdouble img_scale_h = 1.0;
GimpChannel *channel;
GimpLayer *layer;
GimpLayer *floating_layer;
GSList *list;
GSList *remove = NULL;
GList *glist;
Guide *guide;
gint old_width;
gint old_height;
gdouble img_scale_w = 1.0;
gdouble img_scale_h = 1.0;
if ((new_width == 0) || (new_height == 0))
{
@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage,
/* Scale all channels */
for (list = gimage->channels; list; list = g_slist_next (list))
{
channel = (Channel *) list->data;
channel_scale (channel, new_width, new_height);
channel = (GimpChannel *) list->data;
gimp_channel_scale (channel, new_width, new_height);
}
/* Don't forget the 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
*/
channel_scale (gimage->selection_mask, new_width, new_height);
gimp_channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage);
/* Scale all layers */
@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage,
gint x,
gint y)
{
Channel *mask;
GimpChannel *mask;
gint x1, y1, x2, y2;
gint offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR;
@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage,
gint x,
gint y)
{
Channel *mask;
GimpChannel *mask;
gint x1, y1, x2, y2;
gint offset_x, offset_y;
PixelRegion src1PR, destPR;
@ -1374,14 +1376,14 @@ gboolean
gimp_image_set_tattoo_state (GimpImage *gimage,
Tattoo val)
{
GimpLayer *layer;
GSList *layers;
gboolean retval = TRUE;
Channel *channel;
GSList *channels;
Tattoo maxval = 0;
Path *pptr = NULL;
PathList *plist;
GimpLayer *layer;
GSList *layers;
gboolean retval = TRUE;
GimpChannel *channel;
GSList *channels;
Tattoo maxval = 0;
Path *pptr = NULL;
PathList *plist;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
channels = g_slist_next (channels))
{
Tattoo ctattoo;
channel = (Channel *) channels->data;
channel = (GimpChannel *) channels->data;
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval)
@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage,
static void
project_channel (GimpImage *gimage,
Channel *channel,
GimpChannel *channel,
PixelRegion *src,
PixelRegion *src2)
{
@ -1598,12 +1600,12 @@ gimp_image_free_layers (GimpImage *gimage)
static void
gimp_image_free_channels (GimpImage *gimage)
{
GSList *list;
Channel *channel;
GSList *list;
GimpChannel *channel;
for (list = gimage->channels; list; list = g_slist_next (list))
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
gtk_object_unref (GTK_OBJECT (channel));
}
@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage,
gint w,
gint h)
{
Channel *channel;
GimpChannel *channel;
PixelRegion src1PR;
PixelRegion src2PR;
GSList *list;
@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage,
while (reverse_list)
{
channel = (Channel *) reverse_list->data;
channel = (GimpChannel *) reverse_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
{
@ -2121,15 +2123,15 @@ gimp_image_invalidate_layer_previews (GimpImage *gimage)
void
gimp_image_invalidate_channel_previews (GimpImage *gimage)
{
GSList *tmp;
Channel *channel;
GSList *tmp;
GimpChannel *channel;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
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);
}
@ -2173,12 +2175,12 @@ gimp_image_get_layer_by_index (const GimpImage *gimage,
}
gint
gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg)
gimp_image_get_channel_index (const GimpImage *gimage,
const GimpChannel *channel_arg)
{
Channel *channel;
GSList *channels;
gint index;
GimpChannel *channel;
GSList *channels;
gint index;
g_return_val_if_fail (gimage != NULL, -1);
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1);
@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage,
channels;
channels = g_slist_next (channels), index++)
{
channel = (Channel *) channels->data;
channel = (GimpChannel *) channels->data;
if (channel == channel_arg)
return index;
@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage)
return gimage->active_layer;
}
Channel *
GimpChannel *
gimp_image_get_active_channel (const GimpImage *gimage)
{
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2235,12 +2237,12 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
return NULL;
}
Channel *
GimpChannel *
gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tattoo)
{
Channel *channel;
GSList *channels;
GimpChannel *channel;
GSList *channels;
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 = g_slist_next (channels))
{
channel = (Channel *) channels->data;
channel = (GimpChannel *) channels->data;
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel;
@ -2257,12 +2259,12 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
return NULL;
}
Channel *
GimpChannel *
gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name)
{
Channel *channel;
GSList *channels;
GimpChannel *channel;
GSList *channels;
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 = g_slist_next (channels))
{
channel = (Channel *) channels->data;
channel = (GimpChannel *) channels->data;
if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name))
return channel;
}
@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage,
return NULL;
}
Channel *
GimpChannel *
gimp_image_get_mask (const GimpImage *gimage)
{
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage,
return layer;
}
Channel *
gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel)
GimpChannel *
gimp_image_set_active_channel (GimpImage *gimage,
GimpChannel *channel)
{
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;
return NULL;
}
channel = (Channel *) gimage->channels->data;
channel = (GimpChannel *) gimage->channels->data;
}
/* Set the active channel */
@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage,
return channel;
}
Channel *
GimpChannel *
gimp_image_unset_active_channel (GimpImage *gimage)
{
Channel *channel;
GimpChannel *channel;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return mask;
}
Channel *
GimpChannel *
gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode)
@ -3362,15 +3364,15 @@ gimp_image_remove_layer_mask (GimpImage *gimage,
return NULL;
}
Channel *
gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg)
GimpChannel *
gimp_image_raise_channel (GimpImage *gimage,
GimpChannel *channel_arg)
{
Channel *channel;
Channel *prev_channel;
GSList *list;
GSList *prev;
gint index = -1;
GimpChannel *channel;
GimpChannel *prev_channel;
GSList *list;
GSList *prev;
gint index = -1;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage,
while (list)
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
if (prev)
prev_channel = (Channel *) prev->data;
prev_channel = (GimpChannel *) prev->data;
if (channel == channel_arg)
{
@ -3411,15 +3413,15 @@ gimp_image_raise_channel (GimpImage *gimage,
return NULL;
}
Channel *
gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg)
GimpChannel *
gimp_image_lower_channel (GimpImage *gimage,
GimpChannel *channel_arg)
{
Channel *channel;
Channel *next_channel;
GSList *list;
GSList *next;
gint index = 0;
GimpChannel *channel;
GimpChannel *next_channel;
GSList *list;
GSList *next;
gint index = 0;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage,
while (list)
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
next = g_slist_next (list);
if (next)
next_channel = (Channel *) next->data;
next_channel = (GimpChannel *) next->data;
index++;
if (channel == channel_arg)
@ -3460,16 +3462,16 @@ gimp_image_lower_channel (GimpImage *gimage,
return NULL;
}
Channel *
gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg,
gint new_index)
GimpChannel *
gimp_image_position_channel (GimpImage *gimage,
GimpChannel *channel_arg,
gint new_index)
{
Channel *channel;
GSList *list;
GSList *next;
gint index;
gint list_length;
GimpChannel *channel;
GSList *list;
GSList *next;
gint index;
gint list_length;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage,
list;
list = g_slist_next (list), index++)
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
if (channel == channel_arg)
{
break;
@ -3513,10 +3515,10 @@ gimp_image_position_channel (GimpImage *gimage,
return channel;
}
Channel *
gimp_image_add_channel (GimpImage *gimage,
Channel *channel,
gint position)
GimpChannel *
gimp_image_add_channel (GimpImage *gimage,
GimpChannel *channel,
gint position)
{
ChannelUndo *cu;
GSList *cc;
@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage,
return channel;
}
Channel *
gimp_image_remove_channel (GimpImage *gimage,
Channel *channel)
GimpChannel *
gimp_image_remove_channel (GimpImage *gimage,
GimpChannel *channel)
{
ChannelUndo *cu;
@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage,
if (gimage->active_channel == channel)
{
if (gimage->channels)
gimage->active_channel = (((Channel *) gimage->channels->data));
gimage->active_channel = (((GimpChannel *) gimage->channels->data));
else
gimage->active_channel = NULL;
}

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */
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 */
Channel *selection_mask; /* selection mask channel */
GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */
@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg,
gint position);
Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel,
gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
GimpChannel *channel);
GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_position_channel (GimpImage *gimage,
GimpChannel *channel_arg,
gint position);
GimpChannel * gimp_image_add_channel (GimpImage *gimage,
GimpChannel *channel,
gint position);
GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,

View file

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

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */
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 */
Channel *selection_mask; /* selection mask channel */
GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */
@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg,
gint position);
Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel,
gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
GimpChannel *channel);
GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_position_channel (GimpImage *gimage,
GimpChannel *channel_arg,
gint position);
GimpChannel * gimp_image_add_channel (GimpImage *gimage,
GimpChannel *channel,
gint position);
GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,

View file

@ -162,14 +162,14 @@ static void undo_free_cantundo (UndoState, UndoType, gpointer);
/* Sizing functions */
static gint layer_size (GimpLayer *layer);
static gint channel_size (Channel *channel);
static gint layer_size (GimpLayer *layer);
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);
static Undo * undo_new (UndoType undo_type,
glong size,
gboolean dirties_image);
static Undo * undo_new (UndoType undo_type,
glong size,
gboolean dirties_image);
static gboolean shrink_wrap = FALSE;
@ -194,12 +194,12 @@ layer_size (GimpLayer *layer)
static gint
channel_size (Channel *channel)
channel_size (GimpChannel *channel)
{
gint size;
size =
sizeof (Channel) +
sizeof (GimpChannel) +
GIMP_DRAWABLE (channel)->width * GIMP_DRAWABLE (channel)->height +
strlen (GIMP_OBJECT (channel)->name);
@ -1027,7 +1027,7 @@ undo_pop_mask (GimpImage *gimage,
{
MaskUndo *mask_undo;
TileManager *new_tiles;
Channel *sel_mask;
GimpChannel *sel_mask;
PixelRegion srcPR, destPR;
gint selection;
gint x1, y1, x2, y2;
@ -1040,7 +1040,7 @@ undo_pop_mask (GimpImage *gimage,
/* save current selection mask */
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,
x1, y1, (x2 - x1), (y2 - y1), FALSE);
@ -1886,13 +1886,13 @@ gboolean
undo_push_channel_mod (GimpImage *gimage,
gpointer channel_ptr)
{
Channel *channel;
GimpChannel *channel;
TileManager *tiles;
Undo *new;
gpointer *data;
gint size;
channel = (Channel *) channel_ptr;
channel = (GimpChannel *) channel_ptr;
tiles = GIMP_DRAWABLE (channel)->tiles;
size = GIMP_DRAWABLE (channel)->width * GIMP_DRAWABLE (channel)->height +
@ -1927,10 +1927,10 @@ undo_pop_channel_mod (GimpImage *gimage,
gpointer *data;
TileManager *tiles;
TileManager *temp;
Channel *channel;
GimpChannel *channel;
data = (gpointer *) data_ptr;
channel = (Channel *) data[0];
channel = (GimpChannel *) data[0];
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);
/* 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: */
typedef enum
{

View file

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

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */
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 */
Channel *selection_mask; /* selection mask channel */
GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */
@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg,
gint position);
Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel,
gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
GimpChannel *channel);
GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_position_channel (GimpImage *gimage,
GimpChannel *channel_arg,
gint position);
GimpChannel * gimp_image_add_channel (GimpImage *gimage,
GimpChannel *channel,
gint position);
GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,

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_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 */
@ -1016,8 +1016,8 @@ gimp_layer_resize (GimpLayer *layer,
{
GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x;
GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y;
channel_resize (GIMP_CHANNEL (layer->mask),
new_width, new_height, offx, offy);
gimp_channel_resize (GIMP_CHANNEL (layer->mask),
new_width, new_height, offx, offy);
}
/* Make sure we're not caching any old selection info */
@ -1114,8 +1114,8 @@ gimp_layer_boundary (GimpLayer *layer,
void
gimp_layer_invalidate_boundary (GimpLayer *layer)
{
GimpImage *gimage;
Channel *mask;
GimpImage *gimage;
GimpChannel *mask;
/* first get the selection mask channel */
if (! (gimage = gimp_drawable_gimage (GIMP_DRAWABLE (layer))))
@ -1130,7 +1130,7 @@ gimp_layer_invalidate_boundary (GimpLayer *layer)
mask = gimp_image_get_mask (gimage);
/* 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->boundary_known = FALSE;

View file

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

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */
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 */
Channel *selection_mask; /* selection mask channel */
GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */
@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg,
gint position);
Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel,
gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
GimpChannel *channel);
GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_position_channel (GimpImage *gimage,
GimpChannel *channel_arg,
gint position);
GimpChannel * gimp_image_add_channel (GimpImage *gimage,
GimpChannel *channel,
gint position);
GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,

View file

@ -1448,7 +1448,8 @@ gdisplay_mask_bounds (GDisplay *gdisp,
{
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;
*y1 = off_y;
@ -1463,7 +1464,8 @@ gdisplay_mask_bounds (GDisplay *gdisp,
*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;
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
* joining the final point to the initial point.
*/
Channel *
GimpChannel *
scan_converter_to_channel (ScanConverter *sc,
GimpImage *gimage)
{
Channel *mask;
GimpChannel *mask;
GSList *list;
PixelRegion maskPR;
guint widtha;
@ -267,7 +267,7 @@ scan_converter_to_channel (ScanConverter *sc,
(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);
widtha = sc->width * antialias;
@ -320,7 +320,7 @@ scan_converter_to_channel (ScanConverter *sc,
{
if (antialias == 1)
{
channel_add_segment (mask, x, i, w, 255);
gimp_channel_add_segment (mask, x, i, w, 255);
}
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
* 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);

View file

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

View file

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

View file

@ -1448,7 +1448,8 @@ gdisplay_mask_bounds (GDisplay *gdisp,
{
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;
*y1 = off_y;
@ -1463,7 +1464,8 @@ gdisplay_mask_bounds (GDisplay *gdisp,
*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;
gdisplay_transform_coords (gdisp, *x1, *y1, x1, y1, 0);

View file

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

View file

@ -232,11 +232,11 @@ qmask_activate (GtkWidget *widget,
floating_sel_to_layer (layer);
}
gmask = channel_new (gimg,
gimg->width,
gimg->height,
"Qmask",
&color);
gmask = gimp_channel_new (gimg,
gimg->width,
gimg->height,
"Qmask",
&color);
gimp_image_add_channel (gimg, gmask, 0);
drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL);
}
@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget,
{
/* 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);
channel_set_color (gmask, &color);
gimp_channel_set_color (gmask, &color);
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
gimage_mask_none (gimg); /* Clear the selection */
}
@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
gpointer data)
{
EditQmaskOptions *options;
Channel *channel;
GimpChannel *channel;
GimpRGB color;
options = (EditQmaskOptions *) data;
@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{
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);
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;
*y1 = off_y;
@ -1463,7 +1464,8 @@ gdisplay_mask_bounds (GDisplay *gdisp,
*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;
gdisplay_transform_coords (gdisp, *x1, *y1, x1, y1, 0);

View file

@ -75,10 +75,10 @@ gimage_mask_boundary (GImage *gimage,
*/
/* Find the selection mask boundary */
channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out,
num_segs_in, num_segs_out,
0, 0, 0, 0);
gimp_channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out,
num_segs_in, num_segs_out,
0, 0, 0, 0);
/* Find the floating selection boundary */
*segs_in = floating_sel_boundary (layer, num_segs_in);
@ -89,10 +89,10 @@ gimage_mask_boundary (GImage *gimage,
else if ((d = gimp_image_active_drawable (gimage)) &&
GIMP_IS_CHANNEL (d))
{
return channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out,
num_segs_in, num_segs_out,
0, 0, gimage->width, gimage->height);
return gimp_channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out,
num_segs_in, num_segs_out,
0, 0, gimage->width, gimage->height);
}
/* if a layer is active, we return multiple boundaries based on the extents */
else if ((layer = gimp_image_get_active_layer (gimage)))
@ -107,10 +107,10 @@ gimage_mask_boundary (GImage *gimage,
y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE(layer)), 0,
gimage->height);
return channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out,
num_segs_in, num_segs_out,
x1, y1, x2, y2);
return gimp_channel_boundary (gimp_image_get_mask (gimage),
segs_in, segs_out,
num_segs_in, num_segs_out,
x1, y1, x2, y2);
}
else
{
@ -130,15 +130,15 @@ gimage_mask_bounds (GImage *gimage,
gint *x2,
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);
}
void
gimage_mask_invalidate (GImage *gimage)
{
GimpLayer *layer;
Channel *mask;
GimpLayer *layer;
GimpChannel *mask;
/* Turn the current selection off */
gdisplays_selection_visibility (gimage, SelectionOff);
@ -163,7 +163,7 @@ gimage_mask_value (GImage *gimage,
int x,
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)
return TRUE;
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_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,15 +197,15 @@ gimage_mask_extract (GImage *gimage,
gboolean keep_indexed,
gboolean add_alpha)
{
TileManager * tiles;
Channel * sel_mask;
PixelRegion srcPR, destPR, maskPR;
guchar bg[MAX_CHANNELS];
gint bytes, type;
gint x1, y1;
gint x2, y2;
gint off_x, off_y;
gboolean non_empty;
TileManager *tiles;
GimpChannel *sel_mask;
PixelRegion srcPR, destPR, maskPR;
guchar bg[MAX_CHANNELS];
gint bytes, type;
gint x1, y1;
gint x2, y2;
gint off_x, off_y;
gboolean non_empty;
if (!drawable)
return NULL;
@ -293,7 +293,7 @@ gimage_mask_extract (GImage *gimage,
if (cut_gimage)
{
/* Clear the region */
channel_clear (gimp_image_get_mask (gimage));
gimp_channel_clear (gimp_image_get_mask (gimage));
/* Update the region */
gdisplays_update_area (gimage,
@ -350,7 +350,7 @@ gimage_mask_float (GImage *gimage,
gint off_y)
{
GimpLayer *layer;
Channel *mask = gimp_image_get_mask (gimage);
GimpChannel *mask = gimp_image_get_mask (gimage);
TileManager *tiles;
gboolean non_empty;
gint x1, y1;
@ -401,21 +401,21 @@ gimage_mask_float (GImage *gimage,
void
gimage_mask_clear (GImage *gimage)
{
channel_clear (gimp_image_get_mask (gimage));
gimp_channel_clear (gimp_image_get_mask (gimage));
}
void
gimage_mask_undo (GImage *gimage)
{
channel_push_undo (gimp_image_get_mask (gimage));
gimp_channel_push_undo (gimp_image_get_mask (gimage));
}
void
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
* because sharpen will not change the outline
*/
channel_sharpen (gimp_image_get_mask (gimage));
gimp_channel_sharpen (gimp_image_get_mask (gimage));
}
void
gimage_mask_all (GImage *gimage)
{
channel_all (gimp_image_get_mask (gimage));
gimp_channel_all (gimp_image_get_mask (gimage));
}
void
gimage_mask_none (GImage *gimage)
{
channel_clear (gimp_image_get_mask (gimage));
gimp_channel_clear (gimp_image_get_mask (gimage));
}
@ -449,16 +449,16 @@ gimage_mask_feather (GImage *gimage,
gdouble feather_radius_y)
{
/* 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 */
channel_feather (gimp_image_get_mask (gimage),
gimp_image_get_mask (gimage),
feather_radius_x,
feather_radius_y,
CHANNEL_OP_REPLACE, 0, 0);
gimp_channel_feather (gimp_image_get_mask (gimage),
gimp_image_get_mask (gimage),
feather_radius_x,
feather_radius_y,
CHANNEL_OP_REPLACE, 0, 0);
}
@ -468,9 +468,9 @@ gimage_mask_border (GImage *gimage,
gint border_radius_y)
{
/* feather the region */
channel_border (gimp_image_get_mask (gimage),
border_radius_x,
border_radius_y);
gimp_channel_border (gimp_image_get_mask (gimage),
border_radius_x,
border_radius_y);
}
@ -480,9 +480,9 @@ gimage_mask_grow (GImage *gimage,
int grow_pixels_y)
{
/* feather the region */
channel_grow (gimp_image_get_mask (gimage),
grow_pixels_x,
grow_pixels_y);
gimp_channel_grow (gimp_image_get_mask (gimage),
grow_pixels_x,
grow_pixels_y);
}
@ -493,10 +493,10 @@ gimage_mask_shrink (GImage *gimage,
gboolean edge_lock)
{
/* feather the region */
channel_shrink (gimp_image_get_mask (gimage),
shrink_pixels_x,
shrink_pixels_y,
edge_lock);
gimp_channel_shrink (gimp_image_get_mask (gimage),
shrink_pixels_x,
shrink_pixels_y,
edge_lock);
}
@ -508,7 +508,7 @@ gimage_mask_layer_alpha (GimpImage *gimage,
if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)))
{
/* 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
{
@ -527,7 +527,7 @@ gimage_mask_layer_mask (GimpImage *gimage,
if (gimp_layer_get_mask (layer))
{
/* 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
{
@ -539,20 +539,20 @@ gimage_mask_layer_mask (GimpImage *gimage,
void
gimage_mask_load (GImage *gimage,
Channel *channel)
gimage_mask_load (GImage *gimage,
GimpChannel *channel)
{
/* 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)
{
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 */
GIMP_DRAWABLE(new_channel)->visible = FALSE;

View file

@ -86,9 +86,9 @@ void gimage_mask_layer_mask (GImage *gimage,
GimpLayer *layer);
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,
GimpDrawable *drawable);

View file

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

View file

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

View file

@ -569,12 +569,12 @@ duplicate (GimpImage *gimage)
GimpImage *new_gimage;
GimpLayer *layer, *new_layer;
GimpLayer *floating_layer;
Channel *channel, *new_channel;
GimpChannel *channel, *new_channel;
GSList *list;
GList *glist;
Guide *guide = NULL;
GimpLayer *active_layer = NULL;
Channel *active_channel = NULL;
GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL;
ParasiteList *parasites;
@ -645,12 +645,12 @@ duplicate (GimpImage *gimage)
count = 0;
while (list)
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
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" */
gimp_object_set_name (GIMP_OBJECT (new_channel),

View file

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

View file

@ -569,12 +569,12 @@ duplicate (GimpImage *gimage)
GimpImage *new_gimage;
GimpLayer *layer, *new_layer;
GimpLayer *floating_layer;
Channel *channel, *new_channel;
GimpChannel *channel, *new_channel;
GSList *list;
GList *glist;
Guide *guide = NULL;
GimpLayer *active_layer = NULL;
Channel *active_channel = NULL;
GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL;
ParasiteList *parasites;
@ -645,12 +645,12 @@ duplicate (GimpImage *gimage)
count = 0;
while (list)
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
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" */
gimp_object_set_name (GIMP_OBJECT (new_channel),

View file

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

View file

@ -86,9 +86,9 @@ struct _GimpImage
GSList *layer_stack; /* the layers in MRU order */
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 */
Channel *selection_mask; /* selection mask channel */
GimpChannel *selection_mask; /* selection mask channel */
ParasiteList *parasites; /* Plug-in parasite data */
@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg,
gint position);
Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel,
gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
gint gimp_image_get_layer_index (const GimpImage *gimage,
const GimpLayer *layer_arg);
GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage,
const GimpChannel *channel_arg);
GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage);
GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage);
GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo);
GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name);
GimpChannel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs,
gint *n_segs);
GimpLayer * gimp_image_set_active_layer (GimpImage *gimage,
GimpLayer *layer);
GimpChannel * gimp_image_set_active_channel (GimpImage *gimage,
GimpChannel *channel);
GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type,
gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type,
gboolean visible);
GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x,
gint y);
GimpLayer * gimp_image_raise_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
GimpLayer *layer_arg);
GimpLayer * gimp_image_position_layer (GimpImage *gimage,
GimpLayer *layer_arg,
gint new_index,
gboolean push_undo);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_add_layer (GimpImage *gimage,
GimpLayer *float_layer,
gint position);
GimpLayer * gimp_image_remove_layer (GimpImage *gimage,
GimpLayer *layer);
GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
GimpLayer *layer,
GimpLayerMask *mask);
GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage,
GimpLayer *layer,
MaskApplyMode mode);
GimpChannel * gimp_image_raise_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_lower_channel (GimpImage *gimage,
GimpChannel *channel_arg);
GimpChannel * gimp_image_position_channel (GimpImage *gimage,
GimpChannel *channel_arg,
gint position);
GimpChannel * gimp_image_add_channel (GimpImage *gimage,
GimpChannel *channel,
gint position);
GimpChannel * gimp_image_remove_channel (GimpImage *gimage,
GimpChannel *channel);
void gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,

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_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 */
@ -1016,8 +1016,8 @@ gimp_layer_resize (GimpLayer *layer,
{
GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x;
GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y;
channel_resize (GIMP_CHANNEL (layer->mask),
new_width, new_height, offx, offy);
gimp_channel_resize (GIMP_CHANNEL (layer->mask),
new_width, new_height, offx, offy);
}
/* Make sure we're not caching any old selection info */
@ -1114,8 +1114,8 @@ gimp_layer_boundary (GimpLayer *layer,
void
gimp_layer_invalidate_boundary (GimpLayer *layer)
{
GimpImage *gimage;
Channel *mask;
GimpImage *gimage;
GimpChannel *mask;
/* first get the selection mask channel */
if (! (gimage = gimp_drawable_gimage (GIMP_DRAWABLE (layer))))
@ -1130,7 +1130,7 @@ gimp_layer_invalidate_boundary (GimpLayer *layer)
mask = gimp_image_get_mask (gimage);
/* 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->boundary_known = FALSE;

View file

@ -351,7 +351,7 @@ edit_paste (GimpImage *gimage,
* it seems like the correct behavior.
*/
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 (drawable != NULL)

View file

@ -81,7 +81,7 @@ struct _ChannelsDialog
gint base_type;
ChannelType components[3];
Channel *active_channel;
GimpChannel *active_channel;
GimpLayer *floating_sel;
GSList *channel_widgets;
};
@ -100,7 +100,7 @@ struct _ChannelWidget
/* state information */
GimpImage *gimage;
Channel *channel;
GimpChannel *channel;
gint width, height;
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_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);
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 gint channel_list_events (GtkWidget *widget,
@ -156,9 +156,9 @@ static gboolean channels_dialog_drag_delete_channel_callback
guint time);
/* 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,
Channel *channel,
GimpChannel *channel,
ChannelType channel_type);
static gboolean channel_widget_drag_motion_callback
@ -410,7 +410,7 @@ void
channels_dialog_free (void)
{
ChannelWidget *cw;
GSList *list;
GSList *list;
if (!channelsD)
return;
@ -441,7 +441,7 @@ channels_dialog_free (void)
void
channels_dialog_update (GimpImage* gimage)
{
Channel *channel;
GimpChannel *channel;
ChannelWidget *cw;
GSList *list;
GList *item_list;
@ -517,9 +517,11 @@ channels_dialog_update (GimpImage* gimage)
for (list = gimage->channels; list; list = g_slist_next (list))
{
/* create a channel list item */
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
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);
}
@ -532,7 +534,7 @@ void
channels_dialog_flush (void)
{
GimpImage *gimage;
Channel *channel;
GimpChannel *channel;
ChannelWidget *cw;
GSList *list;
gint pos;
@ -560,7 +562,7 @@ channels_dialog_flush (void)
/* Add any missing channels */
for (list = gimage->channels; list; list = g_slist_next (list))
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
cw = channel_widget_get_ID (channel);
/* If the channel isn't in the channel widget list, add it */
@ -590,7 +592,7 @@ channels_dialog_flush (void)
pos = 0;
for (list = gimage->channels; list; list = g_slist_next (list))
{
channel = (Channel *) list->data;
channel = (GimpChannel *) list->data;
channels_dialog_position_channel (channel, pos++);
}
@ -659,8 +661,8 @@ static void
channels_dialog_set_menu_sensitivity (void)
{
ChannelWidget *cw;
gint fs_sens;
gint aux_sens;
gint fs_sens;
gint aux_sens;
cw = channel_widget_get_ID (channelsD->active_channel);
fs_sens = (channelsD->floating_sel != NULL);
@ -843,11 +845,11 @@ channels_dialog_unset_channel (ChannelWidget *channel_widget)
}
static void
channels_dialog_position_channel (Channel *channel,
gint new_index)
channels_dialog_position_channel (GimpChannel *channel,
gint new_index)
{
ChannelWidget *channel_widget;
GList *list = NULL;
GList *list = NULL;
channel_widget = channel_widget_get_ID (channel);
if (!channelsD || !channel_widget)
@ -881,12 +883,12 @@ channels_dialog_position_channel (Channel *channel,
}
static void
channels_dialog_add_channel (Channel *channel)
channels_dialog_add_channel (GimpChannel *channel)
{
ChannelWidget *channel_widget;
GimpImage *gimage;
GList *item_list;
gint position;
GimpImage *gimage;
GList *item_list;
gint position;
if (!channelsD || !channel || !(gimage = channelsD->gimage))
return;
@ -1042,16 +1044,16 @@ void
channels_dialog_duplicate_channel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
Channel *active_channel;
Channel *new_channel;
GimpImage *gimage;
GimpChannel *active_channel;
GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage))
return;
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);
gdisplays_flush ();
}
@ -1093,20 +1095,20 @@ void
channels_dialog_add_channel_to_sel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
Channel *active_channel;
Channel *new_channel;
GimpImage *gimage;
GimpChannel *active_channel;
GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage))
return;
if ((active_channel = gimp_image_get_active_channel (gimage)))
{
new_channel = channel_copy (gimp_image_get_mask (gimage));
channel_combine_mask (new_channel,
active_channel,
CHANNEL_OP_ADD,
0, 0); /* off x/y */
new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
gimp_channel_combine_mask (new_channel,
active_channel,
CHANNEL_OP_ADD,
0, 0); /* off x/y */
gimage_mask_load (gimage, new_channel);
gtk_object_unref (GTK_OBJECT (new_channel));
gdisplays_flush ();
@ -1117,20 +1119,20 @@ void
channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
Channel *active_channel;
Channel *new_channel;
GimpImage *gimage;
GimpChannel *active_channel;
GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage))
return;
if ((active_channel = gimp_image_get_active_channel (gimage)))
{
new_channel = channel_copy (gimp_image_get_mask (gimage));
channel_combine_mask (new_channel,
active_channel,
CHANNEL_OP_SUB,
0, 0); /* off x/y */
new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
gimp_channel_combine_mask (new_channel,
active_channel,
CHANNEL_OP_SUB,
0, 0); /* off x/y */
gimage_mask_load (gimage, new_channel);
gtk_object_unref (GTK_OBJECT (new_channel));
gdisplays_flush ();
@ -1141,20 +1143,20 @@ void
channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
Channel *active_channel;
Channel *new_channel;
GimpImage *gimage;
GimpChannel *active_channel;
GimpChannel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage))
return;
if ((active_channel = gimp_image_get_active_channel (gimage)))
{
new_channel = channel_copy (gimp_image_get_mask (gimage));
channel_combine_mask (new_channel,
active_channel,
CHANNEL_OP_INTERSECT,
0, 0); /* off x/y */
new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
gimp_channel_combine_mask (new_channel,
active_channel,
CHANNEL_OP_INTERSECT,
0, 0); /* off x/y */
gimage_mask_load (gimage, new_channel);
gtk_object_unref (GTK_OBJECT (new_channel));
gdisplays_flush ();
@ -1199,10 +1201,10 @@ channels_dialog_drag_new_channel_callback (GtkWidget *widget,
if (src &&
src->channel == channelsD->active_channel)
{
Channel *channel;
GimpImage *gimage;
gint width, height;
gint off_x, off_y;
GimpChannel *channel;
GimpImage *gimage;
gint width, height;
gint off_x, off_y;
gimage = channelsD->gimage;
@ -1213,13 +1215,13 @@ channels_dialog_drag_new_channel_callback (GtkWidget *widget,
/* Start a group undo */
undo_push_group_start (gimage, EDIT_PASTE_UNDO);
channel = channel_new (gimage, width, height,
_("Empty Channel Copy"),
&src->channel->color);
channel = gimp_channel_new (gimage, width, height,
_("Empty Channel Copy"),
&src->channel->color);
if (channel)
{
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);
/* End the group undo */
@ -1340,10 +1342,10 @@ channels_dialog_drag_delete_channel_callback (GtkWidget *widget,
/******************************/
static ChannelWidget *
channel_widget_get_ID (Channel *channel)
channel_widget_get_ID (GimpChannel *channel)
{
ChannelWidget *lw;
GSList *list;
GSList *list;
if (!channelsD)
return NULL;
@ -1361,14 +1363,14 @@ channel_widget_get_ID (Channel *channel)
static ChannelWidget *
channel_widget_create (GimpImage *gimage,
Channel *channel,
GimpChannel *channel,
ChannelType type)
{
ChannelWidget *channel_widget;
GtkWidget *list_item;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *alignment;
GtkWidget *list_item;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *alignment;
list_item = gtk_list_item_new ();
@ -1632,9 +1634,9 @@ channel_widget_drag_begin_callback (GtkWidget *widget,
typedef struct
{
GimpImage *gimage;
Channel *channel;
gint dest_index;
GimpImage *gimage;
GimpChannel *channel;
gint dest_index;
} ChannelDrop;
static gint
@ -1760,7 +1762,7 @@ channel_widget_drop_color (GtkWidget *widget,
gpointer data)
{
ChannelWidget *channel_widget;
Channel *channel;
GimpChannel *channel;
channel_widget = (ChannelWidget *) data;
channel = channel_widget->channel;
@ -2102,18 +2104,18 @@ channel_widget_preview_redraw (ChannelWidget *channel_widget)
if (channelsD->ratio > 1.0) /* Preview is scaling up! */
{
preview_buf = channel_preview (channel_widget->channel,
channelsD->gimage_width,
channelsD->gimage_height);
preview_buf = gimp_channel_preview (channel_widget->channel,
channelsD->gimage_width,
channelsD->gimage_height);
preview_buf = gimp_preview_scale (preview_buf,
channel_widget->width,
channel_widget->height);
}
else
{
preview_buf = channel_preview (channel_widget->channel,
channel_widget->width,
channel_widget->height);
preview_buf = gimp_channel_preview (channel_widget->channel,
channel_widget->width,
channel_widget->height);
}
break;
@ -2382,7 +2384,7 @@ channel_widget_channel_flush (GtkWidget *widget,
gpointer data)
{
ChannelWidget *channel_widget;
gboolean update_preview = FALSE;
gboolean update_preview = FALSE;
channel_widget =
(ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (widget));
@ -2507,7 +2509,7 @@ new_channel_query_ok_callback (GtkWidget *widget,
gpointer data)
{
NewChannelOptions *options;
Channel *new_channel;
GimpChannel *new_channel;
GimpImage *gimage;
options = (NewChannelOptions *) data;
@ -2520,9 +2522,9 @@ new_channel_query_ok_callback (GtkWidget *widget,
{
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
&channel_color);
new_channel = channel_new (gimage, gimage->width, gimage->height,
channel_name,
&channel_color);
new_channel = gimp_channel_new (gimage, gimage->width, gimage->height,
channel_name,
&channel_color);
drawable_fill (GIMP_DRAWABLE (new_channel), TRANSPARENT_FILL);
@ -2654,7 +2656,7 @@ edit_channel_query_ok_callback (GtkWidget *widget,
gpointer data)
{
EditChannelOptions *options;
Channel *channel;
GimpChannel *channel;
GimpRGB color;
options = (EditChannelOptions *) data;

View file

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

View file

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

View file

@ -88,15 +88,15 @@ struct _LayersDialog
GtkWidget *layer_preview;
/* state information */
GimpImage *gimage;
gint image_width, image_height;
gint gimage_width, gimage_height;
gdouble ratio;
GimpImage *gimage;
gint image_width, image_height;
gint gimage_width, gimage_height;
gdouble ratio;
GimpLayer *active_layer;
Channel *active_channel;
GimpLayer *floating_sel;
GSList *layer_widgets;
GimpLayer *active_layer;
GimpChannel *active_channel;
GimpLayer *floating_sel;
GSList *layer_widgets;
};
typedef struct _LayerWidget LayerWidget;

View file

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

View file

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

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_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 */
@ -1016,8 +1016,8 @@ gimp_layer_resize (GimpLayer *layer,
{
GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x;
GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y;
channel_resize (GIMP_CHANNEL (layer->mask),
new_width, new_height, offx, offy);
gimp_channel_resize (GIMP_CHANNEL (layer->mask),
new_width, new_height, offx, offy);
}
/* Make sure we're not caching any old selection info */
@ -1114,8 +1114,8 @@ gimp_layer_boundary (GimpLayer *layer,
void
gimp_layer_invalidate_boundary (GimpLayer *layer)
{
GimpImage *gimage;
Channel *mask;
GimpImage *gimage;
GimpChannel *mask;
/* first get the selection mask channel */
if (! (gimage = gimp_drawable_gimage (GIMP_DRAWABLE (layer))))
@ -1130,7 +1130,7 @@ gimp_layer_invalidate_boundary (GimpLayer *layer)
mask = gimp_image_get_mask (gimage);
/* 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->boundary_known = FALSE;

View file

@ -88,15 +88,15 @@ struct _LayersDialog
GtkWidget *layer_preview;
/* state information */
GimpImage *gimage;
gint image_width, image_height;
gint gimage_width, gimage_height;
gdouble ratio;
GimpImage *gimage;
gint image_width, image_height;
gint gimage_width, gimage_height;
gdouble ratio;
GimpLayer *active_layer;
Channel *active_channel;
GimpLayer *floating_sel;
GSList *layer_widgets;
GimpLayer *active_layer;
GimpChannel *active_channel;
GimpLayer *floating_sel;
GSList *layer_widgets;
};
typedef struct _LayerWidget LayerWidget;

View file

@ -82,7 +82,7 @@ channel_new_invoker (Argument *args)
gchar *name;
gdouble opacity;
GimpRGB color;
Channel *channel = NULL;
GimpChannel *channel = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
@ -111,7 +111,7 @@ channel_new_invoker (Argument *args)
GimpRGB rgb_color = color;
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;
}
@ -187,15 +187,15 @@ channel_copy_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Channel *channel;
Channel *copy = NULL;
GimpChannel *channel;
GimpChannel *copy = NULL;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL)
success = FALSE;
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);
@ -243,7 +243,7 @@ static Argument *
channel_delete_invoker (Argument *args)
{
gboolean success = TRUE;
Channel *channel;
GimpChannel *channel;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL)
@ -284,8 +284,8 @@ static Argument *
channel_combine_masks_invoker (Argument *args)
{
gboolean success = TRUE;
Channel *channel1;
Channel *channel2;
GimpChannel *channel1;
GimpChannel *channel2;
gint32 operation;
gint32 offx;
gint32 offy;
@ -308,7 +308,7 @@ channel_combine_masks_invoker (Argument *args)
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);
@ -364,7 +364,7 @@ channel_get_name_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Channel *channel;
GimpChannel *channel;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL)
@ -373,7 +373,7 @@ channel_get_name_invoker (Argument *args)
return_args = procedural_db_return_args (&channel_get_name_proc, 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;
}
@ -416,7 +416,7 @@ static Argument *
channel_set_name_invoker (Argument *args)
{
gboolean success = TRUE;
Channel *channel;
GimpChannel *channel;
gchar *name;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
@ -428,7 +428,7 @@ channel_set_name_invoker (Argument *args)
success = FALSE;
if (success)
channel_set_name (channel, name);
gimp_channel_set_name (channel, name);
return procedural_db_return_args (&channel_set_name_proc, success);
}
@ -468,7 +468,7 @@ channel_get_visible_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Channel *channel;
GimpChannel *channel;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL)
@ -520,7 +520,7 @@ static Argument *
channel_set_visible_invoker (Argument *args)
{
gboolean success = TRUE;
Channel *channel;
GimpChannel *channel;
gboolean visible;
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;
Argument *return_args;
Channel *channel;
GimpChannel *channel;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL)
@ -622,7 +622,7 @@ static Argument *
channel_set_show_masked_invoker (Argument *args)
{
gboolean success = TRUE;
Channel *channel;
GimpChannel *channel;
gboolean show_masked;
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;
Argument *return_args;
Channel *channel;
GimpChannel *channel;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL)
@ -724,7 +724,7 @@ static Argument *
channel_set_opacity_invoker (Argument *args)
{
gboolean success = TRUE;
Channel *channel;
GimpChannel *channel;
gdouble opacity;
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;
Argument *return_args;
Channel *channel;
GimpChannel *channel;
GimpRGB color;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
@ -834,7 +834,7 @@ static Argument *
channel_set_color_invoker (Argument *args)
{
gboolean success = TRUE;
Channel *channel;
GimpChannel *channel;
GimpRGB color;
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;
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);
@ -889,7 +889,7 @@ channel_get_tattoo_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Channel *channel;
GimpChannel *channel;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (channel == NULL)
@ -898,7 +898,7 @@ channel_get_tattoo_invoker (Argument *args)
return_args = procedural_db_return_args (&channel_get_tattoo_proc, 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;
}
@ -941,7 +941,7 @@ static Argument *
channel_set_tattoo_invoker (Argument *args)
{
gboolean success = TRUE;
Channel *channel;
GimpChannel *channel;
gint32 tattoo;
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
@ -953,7 +953,7 @@ channel_set_tattoo_invoker (Argument *args)
success = FALSE;
if (success)
channel_set_tattoo (channel, tattoo);
gimp_channel_set_tattoo (channel, tattoo);
return procedural_db_return_args (&channel_set_tattoo_proc, success);
}

View file

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

View file

@ -1409,7 +1409,7 @@ drawable_thumbnail_invoker (Argument *args)
if (GIMP_IS_LAYER (drawable))
buf = gimp_layer_preview (GIMP_LAYER (drawable), req_width, req_height);
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;
thumbnail_data = g_new (guint8, num_pixels);

View file

@ -1459,7 +1459,7 @@ image_raise_channel_invoker (Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
Channel *channel;
GimpChannel *channel;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
@ -1561,7 +1561,7 @@ image_add_channel_invoker (Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
Channel *channel;
GimpChannel *channel;
gint32 position;
gimage = pdb_id_to_image (args[0].value.pdb_int);
@ -1620,7 +1620,7 @@ image_remove_channel_invoker (Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
Channel *channel;
GimpChannel *channel;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
@ -2831,7 +2831,7 @@ image_get_active_channel_invoker (Argument *args)
gboolean success = TRUE;
Argument *return_args;
GimpImage *gimage;
Channel *active_channel = NULL;
GimpChannel *active_channel = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
@ -2887,7 +2887,7 @@ image_set_active_channel_invoker (Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
Channel *active_channel;
GimpChannel *active_channel;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
@ -2939,7 +2939,7 @@ image_get_selection_invoker (Argument *args)
gboolean success = TRUE;
Argument *return_args;
GimpImage *gimage;
Channel *selection = NULL;
GimpChannel *selection = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
@ -3692,7 +3692,7 @@ image_get_channel_by_tattoo_invoker (Argument *args)
Argument *return_args;
GimpImage *gimage;
gint32 tattoo;
Channel *channel = NULL;
GimpChannel *channel = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int);
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_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 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 channel_get_tattoo(c) gimp_drawable_get_tattoo(GIMP_DRAWABLE(c))
#define gimp_channel_set_name(c,n) gimp_object_set_name(GIMP_OBJECT(c),(n))
#define gimp_channel_get_name(c) gimp_object_get_name(GIMP_OBJECT(c))
#define gimp_channel_set_tattoo(c,t) gimp_drawable_set_tattoo(GIMP_DRAWABLE(c),(t))
#define gimp_channel_get_tattoo(c) gimp_drawable_get_tattoo(GIMP_DRAWABLE(c))
#endif /* __PDB_GLUE_H__ */

View file

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

View file

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

View file

@ -232,11 +232,11 @@ qmask_activate (GtkWidget *widget,
floating_sel_to_layer (layer);
}
gmask = channel_new (gimg,
gimg->width,
gimg->height,
"Qmask",
&color);
gmask = gimp_channel_new (gimg,
gimg->width,
gimg->height,
"Qmask",
&color);
gimp_image_add_channel (gimg, gmask, 0);
drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL);
}
@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget,
{
/* 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);
channel_set_color (gmask, &color);
gimp_channel_set_color (gmask, &color);
gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask");
gimage_mask_none (gimg); /* Clear the selection */
}
@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
gpointer data)
{
EditQmaskOptions *options;
Channel *channel;
GimpChannel *channel;
GimpRGB color;
options = (EditQmaskOptions *) data;
@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{
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
* joining the final point to the initial point.
*/
Channel *
GimpChannel *
scan_converter_to_channel (ScanConverter *sc,
GimpImage *gimage)
{
Channel *mask;
GimpChannel *mask;
GSList *list;
PixelRegion maskPR;
guint widtha;
@ -267,7 +267,7 @@ scan_converter_to_channel (ScanConverter *sc,
(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);
widtha = sc->width * antialias;
@ -320,7 +320,7 @@ scan_converter_to_channel (ScanConverter *sc,
{
if (antialias == 1)
{
channel_add_segment (mask, x, i, w, 255);
gimp_channel_add_segment (mask, x, i, w, 255);
}
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
* 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);

View file

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

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;
@ -1744,7 +1744,7 @@ bezier_select_cursor_update (Tool *tool,
on_curve = bezier_point_on_curve (gdisp, bezier_sel, x, y, halfwidth);
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_curve || ModeEdit != EXTEND_ADD))
{
@ -2472,9 +2472,9 @@ bezier_convert (BezierSelect *bezier_sel,
}
/* create a new mask */
bezier_sel->mask = channel_new_mask (gdisp->gimage,
gdisp->gimage->width,
gdisp->gimage->height);
bezier_sel->mask = gimp_channel_new_mask (gdisp->gimage,
gdisp->gimage->width,
gdisp->gimage->height);
gtk_object_ref (GTK_OBJECT (bezier_sel->mask));
gtk_object_sink (GTK_OBJECT (bezier_sel->mask));
@ -2537,7 +2537,7 @@ bezier_convert (BezierSelect *bezier_sel,
w = x2 - x;
if (!antialias)
channel_add_segment (bezier_sel->mask, x, i, w, 255);
gimp_channel_add_segment (bezier_sel->mask, x, i, w, 255);
else
for (j = 0; j < w; j++)
vals[j + x] += 255;
@ -2576,7 +2576,7 @@ bezier_convert (BezierSelect *bezier_sel,
g_free (bezier_sel->scanlines);
bezier_sel->scanlines = NULL;
channel_invalidate_bounds (bezier_sel->mask);
gimp_channel_invalidate_bounds (bezier_sel->mask);
}
static void
@ -2879,14 +2879,14 @@ bezier_to_sel_internal (BezierSelect *bezier_sel,
gimage_mask_undo (gdisp->gimage);
if (bezier_options->feather)
channel_feather (bezier_sel->mask,
gimp_image_get_mask (gdisp->gimage),
bezier_options->feather_radius,
bezier_options->feather_radius,
op, 0, 0);
gimp_channel_feather (bezier_sel->mask,
gimp_image_get_mask (gdisp->gimage),
bezier_options->feather_radius,
bezier_options->feather_radius,
op, 0, 0);
else
channel_combine_mask (gimp_image_get_mask (gdisp->gimage),
bezier_sel->mask, op, 0, 0);
gimp_channel_combine_mask (gimp_image_get_mask (gdisp->gimage),
bezier_sel->mask, op, 0, 0);
/* show selection on all views */
gdisplays_flush ();

View file

@ -62,7 +62,7 @@ struct _BezierSelect
BezierPoint *cur_control; /* the current active control point */
BezierPoint *last_point; /* the last point on 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 */
};

View file

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

View file

@ -370,7 +370,7 @@ bucket_fill (GimpImage *gimage,
{
TileManager *buf_tiles;
PixelRegion bufPR, maskPR;
Channel *mask = NULL;
GimpChannel *mask = NULL;
gint bytes;
gboolean has_alpha;
gint x1, y1, x2, y2;
@ -442,7 +442,7 @@ bucket_fill (GimpImage *gimage,
mask = find_contiguous_region (gimage, drawable, TRUE, (int) threshold,
(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 */
if (sample_merged)

View file

@ -155,7 +155,7 @@ static gint is_pixel_sufficiently_different (guchar *,
gint ,
gint ,
gint );
static Channel * by_color_select_color (GImage *,
static GimpChannel * by_color_select_color (GImage *,
GimpDrawable *,
guchar *,
gint ,
@ -214,7 +214,7 @@ is_pixel_sufficiently_different (guchar *col1,
}
}
static Channel *
static GimpChannel *
by_color_select_color (GImage *gimage,
GimpDrawable *drawable,
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
* mask to reflect the additional selection
*/
Channel *mask;
GimpChannel *mask;
PixelRegion imagePR, maskPR;
guchar *image_data;
guchar *mask_data;
@ -279,7 +279,7 @@ by_color_select_color (GImage *gimage,
}
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)),
0, 0, width, height, TRUE);
@ -334,8 +334,8 @@ by_color_select (GImage *gimage,
gdouble feather_radius,
gboolean sample_merged)
{
Channel *new_mask;
gint off_x, off_y;
GimpChannel *new_mask;
gint off_x, off_y;
if (!drawable)
return;
@ -359,13 +359,13 @@ by_color_select (GImage *gimage,
}
if (feather)
channel_feather (new_mask, gimp_image_get_mask (gimage),
feather_radius,
feather_radius,
op, off_x, off_y);
gimp_channel_feather (new_mask, gimp_image_get_mask (gimage),
feather_radius,
feather_radius,
op, off_x, off_y);
else
channel_combine_mask (gimp_image_get_mask (gimage),
new_mask, op, off_x, off_y);
gimp_channel_combine_mask (gimp_image_get_mask (gimage),
new_mask, op, off_x, off_y);
gtk_object_unref (GTK_OBJECT (new_mask));
}
@ -901,16 +901,16 @@ static void
by_color_select_render (ByColorDialog *bcd,
GImage *gimage)
{
Channel * mask;
MaskBuf * scaled_buf = NULL;
guchar *buf;
PixelRegion srcPR, destPR;
guchar *src;
gint subsample;
gint width, height;
gint srcwidth;
gint i;
gint scale;
GimpChannel *mask;
MaskBuf *scaled_buf = NULL;
guchar *buf;
PixelRegion srcPR, destPR;
guchar *src;
gint subsample;
gint width, height;
gint srcwidth;
gint i;
gint scale;
mask = gimp_image_get_mask (gimage);
if ((gimp_drawable_width (GIMP_DRAWABLE(mask)) > PREVIEW_WIDTH) ||

View file

@ -874,15 +874,15 @@ crop_image (GImage *gimage,
gboolean layer_only,
gboolean crop_layers)
{
GimpLayer *layer;
GimpLayer *floating_layer;
Channel *channel;
GList *guide_list_ptr;
GSList *list;
gint width, height;
gint lx1, ly1, lx2, ly2;
gint off_x, off_y;
gint doff_x, doff_y;
GimpLayer *layer;
GimpLayer *floating_layer;
GimpChannel *channel;
GList *guide_list_ptr;
GSList *list;
gint width, height;
gint lx1, ly1, lx2, ly2;
gint off_x, off_y;
gint doff_x, doff_y;
width = x2 - x1;
height = y2 - y1;
@ -934,13 +934,13 @@ crop_image (GImage *gimage,
list = gimage->channels;
while (list)
{
channel = (Channel *) list->data;
channel_resize (channel, width, height, -x1, -y1);
channel = (GimpChannel *) list->data;
gimp_channel_resize (channel, width, height, -x1, -y1);
list = g_slist_next (list);
}
/* 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);
/* crop all layers */

View file

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

View file

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

View file

@ -98,7 +98,7 @@ static SelectionOptions *fuzzy_options = NULL;
static GdkSegment *segs = NULL;
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,
GimpDrawable *drawable,
gboolean antialias,
@ -307,14 +307,14 @@ find_contiguous_region (GImage *gimage,
gint y,
gboolean sample_merged)
{
PixelRegion srcPR, maskPR;
Channel *mask;
guchar *start;
gboolean has_alpha;
gboolean indexed;
gint type;
gint bytes;
Tile *tile;
PixelRegion srcPR, maskPR;
GimpChannel *mask;
guchar *start;
gboolean has_alpha;
gboolean indexed;
gint type;
gint bytes;
Tile *tile;
if (sample_merged)
{
@ -341,7 +341,7 @@ find_contiguous_region (GImage *gimage,
{
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)),
0, 0,
gimp_drawable_width (GIMP_DRAWABLE(mask)),
@ -383,13 +383,13 @@ fuzzy_select (GImage *gimage,
off_x = off_y = 0;
if (feather)
channel_feather (fuzzy_mask, gimp_image_get_mask (gimage),
feather_radius,
feather_radius,
op, off_x, off_y);
gimp_channel_feather (fuzzy_mask, gimp_image_get_mask (gimage),
feather_radius,
feather_radius,
op, off_x, off_y);
else
channel_combine_mask (gimp_image_get_mask (gimage),
fuzzy_mask, op, off_x, off_y);
gimp_channel_combine_mask (gimp_image_get_mask (gimage),
fuzzy_mask, op, off_x, off_y);
gtk_object_unref (GTK_OBJECT (fuzzy_mask));
fuzzy_mask = NULL;
@ -534,7 +534,7 @@ fuzzy_select_calculate (Tool *tool,
{
PixelRegion maskPR;
FuzzySelect *fuzzy_sel;
Channel *new;
GimpChannel *new;
GdkSegment *segs;
BoundSeg *bsegs;
GimpDrawable *drawable;

View file

@ -20,24 +20,24 @@
#define __FUZZY_SELECT_H__
Channel * find_contiguous_region (GimpImage *gimage,
GimpDrawable *drawable,
gboolean antialias,
gint threshold,
gint x,
gint y,
gboolean sample_merged);
void fuzzy_select (GimpImage *gimage,
GimpDrawable *drawable,
gint op,
gboolean feather,
gdouble feather_radius);
GimpChannel * find_contiguous_region (GimpImage *gimage,
GimpDrawable *drawable,
gboolean antialias,
gint threshold,
gint x,
gint y,
gboolean sample_merged);
void fuzzy_select (GimpImage *gimage,
GimpDrawable *drawable,
gint op,
gboolean feather,
gdouble feather_radius);
Tool * tools_new_fuzzy_select (void);
void tools_free_fuzzy_select (Tool *tool);
Tool * tools_new_fuzzy_select (void);
void tools_free_fuzzy_select (Tool *tool);
extern Channel *fuzzy_mask;
extern GimpChannel *fuzzy_mask;
#endif /* __FUZZY_SELECT_H__ */

View file

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

View file

@ -370,7 +370,7 @@ bucket_fill (GimpImage *gimage,
{
TileManager *buf_tiles;
PixelRegion bufPR, maskPR;
Channel *mask = NULL;
GimpChannel *mask = NULL;
gint bytes;
gboolean has_alpha;
gint x1, y1, x2, y2;
@ -442,7 +442,7 @@ bucket_fill (GimpImage *gimage,
mask = find_contiguous_region (gimage, drawable, TRUE, (int) threshold,
(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 */
if (sample_merged)

View file

@ -155,7 +155,7 @@ static gint is_pixel_sufficiently_different (guchar *,
gint ,
gint ,
gint );
static Channel * by_color_select_color (GImage *,
static GimpChannel * by_color_select_color (GImage *,
GimpDrawable *,
guchar *,
gint ,
@ -214,7 +214,7 @@ is_pixel_sufficiently_different (guchar *col1,
}
}
static Channel *
static GimpChannel *
by_color_select_color (GImage *gimage,
GimpDrawable *drawable,
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
* mask to reflect the additional selection
*/
Channel *mask;
GimpChannel *mask;
PixelRegion imagePR, maskPR;
guchar *image_data;
guchar *mask_data;
@ -279,7 +279,7 @@ by_color_select_color (GImage *gimage,
}
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)),
0, 0, width, height, TRUE);
@ -334,8 +334,8 @@ by_color_select (GImage *gimage,
gdouble feather_radius,
gboolean sample_merged)
{
Channel *new_mask;
gint off_x, off_y;
GimpChannel *new_mask;
gint off_x, off_y;
if (!drawable)
return;
@ -359,13 +359,13 @@ by_color_select (GImage *gimage,
}
if (feather)
channel_feather (new_mask, gimp_image_get_mask (gimage),
feather_radius,
feather_radius,
op, off_x, off_y);
gimp_channel_feather (new_mask, gimp_image_get_mask (gimage),
feather_radius,
feather_radius,
op, off_x, off_y);
else
channel_combine_mask (gimp_image_get_mask (gimage),
new_mask, op, off_x, off_y);
gimp_channel_combine_mask (gimp_image_get_mask (gimage),
new_mask, op, off_x, off_y);
gtk_object_unref (GTK_OBJECT (new_mask));
}
@ -901,16 +901,16 @@ static void
by_color_select_render (ByColorDialog *bcd,
GImage *gimage)
{
Channel * mask;
MaskBuf * scaled_buf = NULL;
guchar *buf;
PixelRegion srcPR, destPR;
guchar *src;
gint subsample;
gint width, height;
gint srcwidth;
gint i;
gint scale;
GimpChannel *mask;
MaskBuf *scaled_buf = NULL;
guchar *buf;
PixelRegion srcPR, destPR;
guchar *src;
gint subsample;
gint width, height;
gint srcwidth;
gint i;
gint scale;
mask = gimp_image_get_mask (gimage);
if ((gimp_drawable_width (GIMP_DRAWABLE(mask)) > PREVIEW_WIDTH) ||

View file

@ -874,15 +874,15 @@ crop_image (GImage *gimage,
gboolean layer_only,
gboolean crop_layers)
{
GimpLayer *layer;
GimpLayer *floating_layer;
Channel *channel;
GList *guide_list_ptr;
GSList *list;
gint width, height;
gint lx1, ly1, lx2, ly2;
gint off_x, off_y;
gint doff_x, doff_y;
GimpLayer *layer;
GimpLayer *floating_layer;
GimpChannel *channel;
GList *guide_list_ptr;
GSList *list;
gint width, height;
gint lx1, ly1, lx2, ly2;
gint off_x, off_y;
gint doff_x, doff_y;
width = x2 - x1;
height = y2 - y1;
@ -934,13 +934,13 @@ crop_image (GImage *gimage,
list = gimage->channels;
while (list)
{
channel = (Channel *) list->data;
channel_resize (channel, width, height, -x1, -y1);
channel = (GimpChannel *) list->data;
gimp_channel_resize (channel, width, height, -x1, -y1);
list = g_slist_next (list);
}
/* 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);
/* crop all layers */

View file

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

View file

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

View file

@ -98,7 +98,7 @@ static SelectionOptions *fuzzy_options = NULL;
static GdkSegment *segs = NULL;
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,
GimpDrawable *drawable,
gboolean antialias,
@ -307,14 +307,14 @@ find_contiguous_region (GImage *gimage,
gint y,
gboolean sample_merged)
{
PixelRegion srcPR, maskPR;
Channel *mask;
guchar *start;
gboolean has_alpha;
gboolean indexed;
gint type;
gint bytes;
Tile *tile;
PixelRegion srcPR, maskPR;
GimpChannel *mask;
guchar *start;
gboolean has_alpha;
gboolean indexed;
gint type;
gint bytes;
Tile *tile;
if (sample_merged)
{
@ -341,7 +341,7 @@ find_contiguous_region (GImage *gimage,
{
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)),
0, 0,
gimp_drawable_width (GIMP_DRAWABLE(mask)),
@ -383,13 +383,13 @@ fuzzy_select (GImage *gimage,
off_x = off_y = 0;
if (feather)
channel_feather (fuzzy_mask, gimp_image_get_mask (gimage),
feather_radius,
feather_radius,
op, off_x, off_y);
gimp_channel_feather (fuzzy_mask, gimp_image_get_mask (gimage),
feather_radius,
feather_radius,
op, off_x, off_y);
else
channel_combine_mask (gimp_image_get_mask (gimage),
fuzzy_mask, op, off_x, off_y);
gimp_channel_combine_mask (gimp_image_get_mask (gimage),
fuzzy_mask, op, off_x, off_y);
gtk_object_unref (GTK_OBJECT (fuzzy_mask));
fuzzy_mask = NULL;
@ -534,7 +534,7 @@ fuzzy_select_calculate (Tool *tool,
{
PixelRegion maskPR;
FuzzySelect *fuzzy_sel;
Channel *new;
GimpChannel *new;
GdkSegment *segs;
BoundSeg *bsegs;
GimpDrawable *drawable;

View file

@ -20,24 +20,24 @@
#define __FUZZY_SELECT_H__
Channel * find_contiguous_region (GimpImage *gimage,
GimpDrawable *drawable,
gboolean antialias,
gint threshold,
gint x,
gint y,
gboolean sample_merged);
void fuzzy_select (GimpImage *gimage,
GimpDrawable *drawable,
gint op,
gboolean feather,
gdouble feather_radius);
GimpChannel * find_contiguous_region (GimpImage *gimage,
GimpDrawable *drawable,
gboolean antialias,
gint threshold,
gint x,
gint y,
gboolean sample_merged);
void fuzzy_select (GimpImage *gimage,
GimpDrawable *drawable,
gint op,
gboolean feather,
gdouble feather_radius);
Tool * tools_new_fuzzy_select (void);
void tools_free_fuzzy_select (Tool *tool);
Tool * tools_new_fuzzy_select (void);
void tools_free_fuzzy_select (Tool *tool);
extern Channel *fuzzy_mask;
extern GimpChannel *fuzzy_mask;
#endif /* __FUZZY_SELECT_H__ */

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