Some PDB fixes/cosmetics before doing real changes again:

2003-12-08  Michael Natterer  <mitch@gimp.org>

	Some PDB fixes/cosmetics before doing real changes again:

	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/layer.pdb: changed order of generated functions
	to make more sense.

	* tools/pdbgen/pdb/misc_tools.pdb: doc cosmetics, removed unused
	subroutines.

	* tools/pdbgen/pdb/image.pdb: reordered generated functions as
	above, fixed resolution and unit accessors to use functions
	instead of setting gimage->foo directly, use &image_accessors()
	for the tattoo_state functions, cleanup.

	* app/pdb/drawable_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/layer_cmds.c
	* app/pdb/misc_tools_cmds.c
	* libgimp/gimpdrawable_pdb.[ch]
	* libgimp/gimpimage_pdb.[ch]
	* libgimp/gimplayer_pdb.[ch]
	* libgimp/gimpmisctools_pdb.c: regenerated.
This commit is contained in:
Michael Natterer 2003-12-08 17:26:55 +00:00 committed by Michael Natterer
parent 53be6dae66
commit ed6fe48b09
16 changed files with 2818 additions and 2838 deletions

View File

@ -1,3 +1,28 @@
2003-12-08 Michael Natterer <mitch@gimp.org>
Some PDB fixes/cosmetics before doing real changes again:
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/layer.pdb: changed order of generated functions
to make more sense.
* tools/pdbgen/pdb/misc_tools.pdb: doc cosmetics, removed unused
subroutines.
* tools/pdbgen/pdb/image.pdb: reordered generated functions as
above, fixed resolution and unit accessors to use functions
instead of setting gimage->foo directly, use &image_accessors()
for the tattoo_state functions, cleanup.
* app/pdb/drawable_cmds.c
* app/pdb/image_cmds.c
* app/pdb/layer_cmds.c
* app/pdb/misc_tools_cmds.c
* libgimp/gimpdrawable_pdb.[ch]
* libgimp/gimpimage_pdb.[ch]
* libgimp/gimplayer_pdb.[ch]
* libgimp/gimpmisctools_pdb.c: regenerated.
2003-12-08 Sven Neumann <sven@gimp.org>
* libgimpthumb/gimpthumbnail.c (gimp_thumbnail_load_thumb): don't

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -41,17 +41,17 @@
#include "pdb_glue.h"
static ProcRecord layer_new_proc;
static ProcRecord layer_new_from_drawable_proc;
static ProcRecord layer_copy_proc;
static ProcRecord layer_create_mask_proc;
static ProcRecord layer_add_alpha_proc;
static ProcRecord layer_scale_proc;
static ProcRecord layer_resize_proc;
static ProcRecord layer_resize_to_image_size_proc;
static ProcRecord layer_translate_proc;
static ProcRecord layer_add_alpha_proc;
static ProcRecord layer_set_offsets_proc;
static ProcRecord layer_create_mask_proc;
static ProcRecord layer_get_mask_proc;
static ProcRecord layer_is_floating_sel_proc;
static ProcRecord layer_new_from_drawable_proc;
static ProcRecord layer_get_preserve_trans_proc;
static ProcRecord layer_set_preserve_trans_proc;
static ProcRecord layer_get_apply_mask_proc;
@ -69,17 +69,17 @@ void
register_layer_procs (Gimp *gimp)
{
procedural_db_register (gimp, &layer_new_proc);
procedural_db_register (gimp, &layer_new_from_drawable_proc);
procedural_db_register (gimp, &layer_copy_proc);
procedural_db_register (gimp, &layer_create_mask_proc);
procedural_db_register (gimp, &layer_add_alpha_proc);
procedural_db_register (gimp, &layer_scale_proc);
procedural_db_register (gimp, &layer_resize_proc);
procedural_db_register (gimp, &layer_resize_to_image_size_proc);
procedural_db_register (gimp, &layer_translate_proc);
procedural_db_register (gimp, &layer_add_alpha_proc);
procedural_db_register (gimp, &layer_set_offsets_proc);
procedural_db_register (gimp, &layer_create_mask_proc);
procedural_db_register (gimp, &layer_get_mask_proc);
procedural_db_register (gimp, &layer_is_floating_sel_proc);
procedural_db_register (gimp, &layer_new_from_drawable_proc);
procedural_db_register (gimp, &layer_get_preserve_trans_proc);
procedural_db_register (gimp, &layer_set_preserve_trans_proc);
procedural_db_register (gimp, &layer_get_apply_mask_proc);
@ -219,6 +219,92 @@ static ProcRecord layer_new_proc =
{ { layer_new_invoker } }
};
static Argument *
layer_new_from_drawable_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
GimpImage *dest_image;
GimpLayer *layer_copy = NULL;
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_DRAWABLE (drawable))
success = FALSE;
dest_image = gimp_image_get_by_ID (gimp, args[1].value.pdb_int);
if (! GIMP_IS_IMAGE (dest_image))
success = FALSE;
if (success)
{
GType new_type;
GimpItem *new_item;
if (GIMP_IS_LAYER (drawable))
new_type = G_TYPE_FROM_INSTANCE (drawable);
else
new_type = GIMP_TYPE_LAYER;
if (dest_image == gimp_item_get_image (GIMP_ITEM (drawable)))
new_item = gimp_item_duplicate (GIMP_ITEM (drawable), new_type, TRUE);
else
new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type, TRUE);
if (new_item)
layer_copy = GIMP_LAYER (new_item);
else
success = FALSE;
}
return_args = procedural_db_return_args (&layer_new_from_drawable_proc, success);
if (success)
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (layer_copy));
return return_args;
}
static ProcArg layer_new_from_drawable_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The source drawable from where the new layer is copied"
},
{
GIMP_PDB_IMAGE,
"dest_image",
"The destination image to which to add the layer"
}
};
static ProcArg layer_new_from_drawable_outargs[] =
{
{
GIMP_PDB_LAYER,
"layer_copy",
"The newly copied layer"
}
};
static ProcRecord layer_new_from_drawable_proc =
{
"gimp_layer_new_from_drawable",
"Create a new layer by copying an existing drawable.",
"This procedure creates a new layer as a copy of the specified drawable. The new layer still needs to be added to the image, as this is not automatic. Add the new layer with the 'gimp_image_add_layer' command. Other attributes such as layer mask modes, and offsets should be set with explicit procedure calls.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
2,
layer_new_from_drawable_inargs,
1,
layer_new_from_drawable_outargs,
{ { layer_new_from_drawable_invoker } }
};
static Argument *
layer_copy_invoker (Gimp *gimp,
Argument *args)
@ -286,71 +372,45 @@ static ProcRecord layer_copy_proc =
};
static Argument *
layer_create_mask_invoker (Gimp *gimp,
Argument *args)
layer_add_alpha_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpLayer *layer;
gint32 mask_type;
GimpLayerMask *mask = NULL;
layer = (GimpLayer *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_LAYER (layer))
success = FALSE;
mask_type = args[1].value.pdb_int;
if (mask_type < GIMP_ADD_WHITE_MASK || mask_type > GIMP_ADD_COPY_MASK)
success = FALSE;
if (success)
success = (mask = gimp_layer_create_mask (layer, (GimpAddMaskType) mask_type)) != NULL;
gimp_layer_add_alpha (layer);
return_args = procedural_db_return_args (&layer_create_mask_proc, success);
if (success)
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (mask));
return return_args;
return procedural_db_return_args (&layer_add_alpha_proc, success);
}
static ProcArg layer_create_mask_inargs[] =
static ProcArg layer_add_alpha_inargs[] =
{
{
GIMP_PDB_LAYER,
"layer",
"The layer to which to add the mask"
},
{
GIMP_PDB_INT32,
"mask_type",
"The type of mask: { GIMP_ADD_WHITE_MASK (0), GIMP_ADD_BLACK_MASK (1), GIMP_ADD_ALPHA_MASK (2), GIMP_ADD_ALPHA_TRANSFER_MASK (3), GIMP_ADD_SELECTION_MASK (4), GIMP_ADD_COPY_MASK (5) }"
"The layer"
}
};
static ProcArg layer_create_mask_outargs[] =
static ProcRecord layer_add_alpha_proc =
{
{
GIMP_PDB_CHANNEL,
"mask",
"The newly created mask"
}
};
static ProcRecord layer_create_mask_proc =
{
"gimp_layer_create_mask",
"Create a layer mask for the specified specified layer.",
"This procedure creates a layer mask for the specified layer. Layer masks serve as an additional alpha channel for a layer. A number of ifferent types of masks are allowed for initialisation: completely white masks (which will leave the layer fully visible), completely black masks (which will give the layer complete transparency, the layer's already existing alpha channel (which will leave the layer fully visible, but which may be more useful than a white mask), the current selection or a grayscale copy of the layer. The layer mask still needs to be added to the layer. This can be done with a call to 'gimp_image_add_layer_mask'.",
"gimp_layer_add_alpha",
"Add an alpha channel to the layer if it doesn't already have one.",
"This procedure adds an additional component to the specified layer if it does not already possess an alpha channel. An alpha channel makes it possible to move a layer from the bottom of the layer stack and to clear and erase to transparency, instead of the background color. This transforms images of type RGB to RGBA, GRAY to GRAYA, and INDEXED to INDEXEDA.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
2,
layer_create_mask_inargs,
1,
layer_create_mask_outargs,
{ { layer_create_mask_invoker } }
layer_add_alpha_inargs,
0,
NULL,
{ { layer_add_alpha_invoker } }
};
static Argument *
@ -681,48 +741,6 @@ static ProcRecord layer_translate_proc =
{ { layer_translate_invoker } }
};
static Argument *
layer_add_alpha_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
GimpLayer *layer;
layer = (GimpLayer *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_LAYER (layer))
success = FALSE;
if (success)
gimp_layer_add_alpha (layer);
return procedural_db_return_args (&layer_add_alpha_proc, success);
}
static ProcArg layer_add_alpha_inargs[] =
{
{
GIMP_PDB_LAYER,
"layer",
"The layer"
}
};
static ProcRecord layer_add_alpha_proc =
{
"gimp_layer_add_alpha",
"Add an alpha channel to the layer if it doesn't already have one.",
"This procedure adds an additional component to the specified layer if it does not already possess an alpha channel. An alpha channel makes it possible to move a layer from the bottom of the layer stack and to clear and erase to transparency, instead of the background color. This transforms images of type RGB to RGBA, GRAY to GRAYA, and INDEXED to INDEXEDA.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
1,
layer_add_alpha_inargs,
0,
NULL,
{ { layer_add_alpha_invoker } }
};
static Argument *
layer_set_offsets_invoker (Gimp *gimp,
Argument *args)
@ -812,6 +830,74 @@ static ProcRecord layer_set_offsets_proc =
{ { layer_set_offsets_invoker } }
};
static Argument *
layer_create_mask_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpLayer *layer;
gint32 mask_type;
GimpLayerMask *mask = NULL;
layer = (GimpLayer *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_LAYER (layer))
success = FALSE;
mask_type = args[1].value.pdb_int;
if (mask_type < GIMP_ADD_WHITE_MASK || mask_type > GIMP_ADD_COPY_MASK)
success = FALSE;
if (success)
success = (mask = gimp_layer_create_mask (layer, (GimpAddMaskType) mask_type)) != NULL;
return_args = procedural_db_return_args (&layer_create_mask_proc, success);
if (success)
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (mask));
return return_args;
}
static ProcArg layer_create_mask_inargs[] =
{
{
GIMP_PDB_LAYER,
"layer",
"The layer to which to add the mask"
},
{
GIMP_PDB_INT32,
"mask_type",
"The type of mask: { GIMP_ADD_WHITE_MASK (0), GIMP_ADD_BLACK_MASK (1), GIMP_ADD_ALPHA_MASK (2), GIMP_ADD_ALPHA_TRANSFER_MASK (3), GIMP_ADD_SELECTION_MASK (4), GIMP_ADD_COPY_MASK (5) }"
}
};
static ProcArg layer_create_mask_outargs[] =
{
{
GIMP_PDB_CHANNEL,
"mask",
"The newly created mask"
}
};
static ProcRecord layer_create_mask_proc =
{
"gimp_layer_create_mask",
"Create a layer mask for the specified specified layer.",
"This procedure creates a layer mask for the specified layer. Layer masks serve as an additional alpha channel for a layer. A number of ifferent types of masks are allowed for initialisation: completely white masks (which will leave the layer fully visible), completely black masks (which will give the layer complete transparency, the layer's already existing alpha channel (which will leave the layer fully visible, but which may be more useful than a white mask), the current selection or a grayscale copy of the layer. The layer mask still needs to be added to the layer. This can be done with a call to 'gimp_image_add_layer_mask'.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
2,
layer_create_mask_inargs,
1,
layer_create_mask_outargs,
{ { layer_create_mask_invoker } }
};
static Argument *
layer_get_mask_invoker (Gimp *gimp,
Argument *args)
@ -920,92 +1006,6 @@ static ProcRecord layer_is_floating_sel_proc =
{ { layer_is_floating_sel_invoker } }
};
static Argument *
layer_new_from_drawable_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
GimpImage *dest_image;
GimpLayer *layer_copy = NULL;
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_DRAWABLE (drawable))
success = FALSE;
dest_image = gimp_image_get_by_ID (gimp, args[1].value.pdb_int);
if (! GIMP_IS_IMAGE (dest_image))
success = FALSE;
if (success)
{
GType new_type;
GimpItem *new_item;
if (GIMP_IS_LAYER (drawable))
new_type = G_TYPE_FROM_INSTANCE (drawable);
else
new_type = GIMP_TYPE_LAYER;
if (dest_image == gimp_item_get_image (GIMP_ITEM (drawable)))
new_item = gimp_item_duplicate (GIMP_ITEM (drawable), new_type, TRUE);
else
new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type, TRUE);
if (new_item)
layer_copy = GIMP_LAYER (new_item);
else
success = FALSE;
}
return_args = procedural_db_return_args (&layer_new_from_drawable_proc, success);
if (success)
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (layer_copy));
return return_args;
}
static ProcArg layer_new_from_drawable_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The source drawable from where the new layer is copied"
},
{
GIMP_PDB_IMAGE,
"dest_image",
"The destination image to which to add the layer"
}
};
static ProcArg layer_new_from_drawable_outargs[] =
{
{
GIMP_PDB_LAYER,
"layer_copy",
"The newly copied layer"
}
};
static ProcRecord layer_new_from_drawable_proc =
{
"gimp_layer_new_from_drawable",
"Create a new layer by copying an existing drawable.",
"This procedure creates a new layer as a copy of the specified drawable. The new layer still needs to be added to the image, as this is not automatic. Add the new layer with the 'gimp_image_add_layer' command. Other attributes such as layer mask modes, and offsets should be set with explicit procedure calls.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
2,
layer_new_from_drawable_inargs,
1,
layer_new_from_drawable_outargs,
{ { layer_new_from_drawable_invoker } }
};
static Argument *
layer_get_preserve_trans_invoker (Gimp *gimp,
Argument *args)

View File

@ -359,7 +359,7 @@ static ProcRecord bucket_fill_proc =
{
"gimp_bucket_fill",
"Fill the area specified either by the current selection if there is one, or by a seed fill starting at the specified coordinates.",
"This tool requires information on the paint application mode, and the fill mode, which can either be in the foreground color, or in the currently active pattern. If there is no selection, a seed fill is executed at the specified coordinates and extends outward in keeping with the threshold parameter. If there is a selection in the target image, the threshold, sample merged, x, and y arguments are unused. If the sample_merged parameter is non-zero, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of merged sampling, the x,y coordinates are relative to the image's origin; otherwise, they are relative to the drawable's origin.",
"This tool requires information on the paint application mode, and the fill mode, which can either be in the foreground color, or in the currently active pattern. If there is no selection, a seed fill is executed at the specified coordinates and extends outward in keeping with the threshold parameter. If there is a selection in the target image, the threshold, sample merged, x, and y arguments are unused. If the sample_merged parameter is non-zero, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of merged sampling, the x and y coordinates are relative to the image's origin; otherwise, they are relative to the drawable's origin.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
@ -482,7 +482,7 @@ static ProcRecord color_picker_proc =
{
"gimp_color_picker",
"Determine the color at the given drawable coordinates",
"This tool determines the color at the specified coordinates. The returned color is an RGB triplet even for grayscale and indexed drawables. If the coordinates lie outside of the extents of the specified drawable, then an error is returned. If the drawable has an alpha channel, the algorithm examines the alpha value of the drawable at the coordinates. If the alpha value is completely transparent (0), then an error is returned. If the sample_merged parameter is non-zero, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of a merged sampling, the supplied drawable is ignored.",
"This tool determines the color at the specified coordinates. The returned color is an RGB triplet even for grayscale and indexed drawables. If the coordinates lie outside of the extents of the specified drawable, then an error is returned. If the drawable has an alpha channel, the algorithm examines the alpha value of the drawable at the coordinates. If the alpha value is completely transparent (0), then an error is returned. If the sample_merged parameter is non-zero, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of a merged sampling, the supplied drawable is ignored except for finding the image it belongs to.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",

View File

@ -28,31 +28,29 @@
#include "gimp.h"
/**
* gimp_drawable_merge_shadow:
* @drawable_ID: The drawable.
* @undo: Push merge to undo stack?
* gimp_drawable_delete:
* @drawable_ID: The drawable to delete.
*
* Merge the shadow buffer with the specified drawable.
* Delete a drawable.
*
* This procedure combines the contents of the image's shadow buffer
* (for temporary processing) with the specified drawable. The \"undo\"
* parameter specifies whether to add an undo step for the operation.
* Requesting no undo is useful for such applications as 'auto-apply'.
* This procedure deletes the specified drawable. This must not be done
* if the gimage containing this drawable was already deleted or if the
* drawable was already removed from the image. The only case in which
* this procedure is useful is if you want to get rid of a drawable
* which has not yet been added to an image.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_merge_shadow (gint32 drawable_ID,
gboolean undo)
gimp_drawable_delete (gint32 drawable_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_drawable_merge_shadow",
return_vals = gimp_run_procedure ("gimp_drawable_delete",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, undo,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
@ -63,234 +61,96 @@ gimp_drawable_merge_shadow (gint32 drawable_ID,
}
/**
* gimp_drawable_fill:
* gimp_drawable_is_layer:
* @drawable_ID: The drawable.
* @fill_type: The type of fill.
*
* Fill the drawable with the specified fill mode.
* Returns whether the drawable is a layer.
*
* This procedure fills the drawable with the fill mode. If the fill
* mode is foreground the current foreground color is used. If the fill
* mode is background, the current background color is used. If the
* fill type is white, then white is used. Transparent fill only
* affects layers with an alpha channel, in which case the alpha
* channel is set to transparent. If the drawable has no alpha channel,
* it is filled to white. No fill leaves the drawable's contents
* undefined. This procedure is unlike the bucket fill tool because it
* fills regardless of a selection
* This procedure returns non-zero if the specified drawable is a
* layer.
*
* Returns: TRUE on success.
* Returns: Non-zero if the drawable is a layer.
*/
gboolean
gimp_drawable_fill (gint32 drawable_ID,
GimpFillType fill_type)
gimp_drawable_is_layer (gint32 drawable_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
gboolean layer = FALSE;
return_vals = gimp_run_procedure ("gimp_drawable_fill",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, fill_type,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_drawable_update:
* @drawable_ID: The drawable.
* @x: x coordinate of upper left corner of update region.
* @y: y coordinate of upper left corner of update region.
* @width: Width of update region.
* @height: Height of update region.
*
* Update the specified region of the drawable.
*
* This procedure updates the specified region of the drawable. The (x,
* y) coordinate pair is relative to the drawable's origin, not to the
* image origin. Therefore, the entire drawable can be updated with:
* {x-&gt;0, y-&gt;0, w-&gt;width, h-&gt;height }.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_update (gint32 drawable_ID,
gint x,
gint y,
gint width,
gint height)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_drawable_update",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, x,
GIMP_PDB_INT32, y,
GIMP_PDB_INT32, width,
GIMP_PDB_INT32, height,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_drawable_mask_bounds:
* @drawable_ID: The drawable.
* @x1: x coordinate of the upper left corner of selection bounds.
* @y1: y coordinate of the upper left corner of selection bounds.
* @x2: x coordinate of the lower right corner of selection bounds.
* @y2: y coordinate of the lower right corner of selection bounds.
*
* Find the bounding box of the current selection in relation to the
* specified drawable.
*
* This procedure returns the whether there is a selection. If there is
* one, the upper left and lower righthand corners of its bounding box
* are returned. These coordinates are specified relative to the
* drawable's origin, and bounded by the drawable's extents. Please
* note that the pixel specified by the lower righthand coordinate of
* the bounding box is not part of the selection. The selection ends at
* the upper left corner of this pixel. This means the width of the
* selection can be calculated as (x2 - x1), its height as (y2 - y1).
*
* Returns: TRUE if there is a selection.
*/
gboolean
gimp_drawable_mask_bounds (gint32 drawable_ID,
gint *x1,
gint *y1,
gint *x2,
gint *y2)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean non_empty = FALSE;
return_vals = gimp_run_procedure ("gimp_drawable_mask_bounds",
return_vals = gimp_run_procedure ("gimp_drawable_is_layer",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
{
non_empty = return_vals[1].data.d_int32;
*x1 = return_vals[2].data.d_int32;
*y1 = return_vals[3].data.d_int32;
*x2 = return_vals[4].data.d_int32;
*y2 = return_vals[5].data.d_int32;
}
layer = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return non_empty;
return layer;
}
/**
* gimp_drawable_get_image:
* gimp_drawable_is_layer_mask:
* @drawable_ID: The drawable.
*
* Returns the drawable's image.
* Returns whether the drawable is a layer mask.
*
* This procedure returns the drawable's image.
* This procedure returns non-zero if the specified drawable is a layer
* mask.
*
* Returns: The drawable's image.
* Returns: Non-zero if the drawable is a layer mask.
*/
gint32
gimp_drawable_get_image (gint32 drawable_ID)
gboolean
gimp_drawable_is_layer_mask (gint32 drawable_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gint32 image_ID = -1;
gboolean layer_mask = FALSE;
return_vals = gimp_run_procedure ("gimp_drawable_get_image",
return_vals = gimp_run_procedure ("gimp_drawable_is_layer_mask",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
image_ID = return_vals[1].data.d_image;
layer_mask = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return image_ID;
return layer_mask;
}
/**
* gimp_drawable_set_image:
* gimp_drawable_is_channel:
* @drawable_ID: The drawable.
* @image_ID: The image.
*
* Set image where drawable belongs to.
* Returns whether the drawable is a channel.
*
* Set the image the drawable should be a part of (Use this before
* adding a drawable to another image).
* This procedure returns non-zero if the specified drawable is a
* channel.
*
* Returns: TRUE on success.
* Returns: Non-zero if the drawable is a channel.
*/
gboolean
gimp_drawable_set_image (gint32 drawable_ID,
gint32 image_ID)
gimp_drawable_is_channel (gint32 drawable_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
gboolean channel = FALSE;
return_vals = gimp_run_procedure ("gimp_drawable_set_image",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_drawable_has_alpha:
* @drawable_ID: The drawable.
*
* Returns non-zero if the drawable has an alpha channel.
*
* This procedure returns whether the specified drawable has an alpha
* channel. This can only be true for layers, and the associated type
* will be one of: { RGBA , GRAYA, INDEXEDA }.
*
* Returns: Does the drawable have an alpha channel?
*/
gboolean
gimp_drawable_has_alpha (gint32 drawable_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean has_alpha = FALSE;
return_vals = gimp_run_procedure ("gimp_drawable_has_alpha",
return_vals = gimp_run_procedure ("gimp_drawable_is_channel",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
has_alpha = return_vals[1].data.d_int32;
channel = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return has_alpha;
return channel;
}
/**
@ -356,6 +216,38 @@ gimp_drawable_type_with_alpha (gint32 drawable_ID)
return type_with_alpha;
}
/**
* gimp_drawable_has_alpha:
* @drawable_ID: The drawable.
*
* Returns non-zero if the drawable has an alpha channel.
*
* This procedure returns whether the specified drawable has an alpha
* channel. This can only be true for layers, and the associated type
* will be one of: { RGBA , GRAYA, INDEXEDA }.
*
* Returns: Does the drawable have an alpha channel?
*/
gboolean
gimp_drawable_has_alpha (gint32 drawable_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean has_alpha = FALSE;
return_vals = gimp_run_procedure ("gimp_drawable_has_alpha",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
has_alpha = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return has_alpha;
}
/**
* gimp_drawable_is_rgb:
* @drawable_ID: The drawable.
@ -585,96 +477,66 @@ gimp_drawable_offsets (gint32 drawable_ID,
}
/**
* gimp_drawable_is_layer:
* gimp_drawable_get_image:
* @drawable_ID: The drawable.
*
* Returns whether the drawable is a layer.
* Returns the drawable's image.
*
* This procedure returns non-zero if the specified drawable is a
* layer.
* This procedure returns the drawable's image.
*
* Returns: Non-zero if the drawable is a layer.
* Returns: The drawable's image.
*/
gboolean
gimp_drawable_is_layer (gint32 drawable_ID)
gint32
gimp_drawable_get_image (gint32 drawable_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean layer = FALSE;
gint32 image_ID = -1;
return_vals = gimp_run_procedure ("gimp_drawable_is_layer",
return_vals = gimp_run_procedure ("gimp_drawable_get_image",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
layer = return_vals[1].data.d_int32;
image_ID = return_vals[1].data.d_image;
gimp_destroy_params (return_vals, nreturn_vals);
return layer;
return image_ID;
}
/**
* gimp_drawable_is_layer_mask:
* gimp_drawable_set_image:
* @drawable_ID: The drawable.
* @image_ID: The image.
*
* Returns whether the drawable is a layer mask.
* Set image where drawable belongs to.
*
* This procedure returns non-zero if the specified drawable is a layer
* mask.
* Set the image the drawable should be a part of (Use this before
* adding a drawable to another image).
*
* Returns: Non-zero if the drawable is a layer mask.
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_is_layer_mask (gint32 drawable_ID)
gimp_drawable_set_image (gint32 drawable_ID,
gint32 image_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean layer_mask = FALSE;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_drawable_is_layer_mask",
return_vals = gimp_run_procedure ("gimp_drawable_set_image",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
layer_mask = return_vals[1].data.d_int32;
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return layer_mask;
}
/**
* gimp_drawable_is_channel:
* @drawable_ID: The drawable.
*
* Returns whether the drawable is a channel.
*
* This procedure returns non-zero if the specified drawable is a
* channel.
*
* Returns: Non-zero if the drawable is a channel.
*/
gboolean
gimp_drawable_is_channel (gint32 drawable_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean channel = FALSE;
return_vals = gimp_run_procedure ("gimp_drawable_is_channel",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
channel = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return channel;
return success;
}
/**
@ -931,6 +793,137 @@ gimp_drawable_set_tattoo (gint32 drawable_ID,
return success;
}
/**
* gimp_drawable_mask_bounds:
* @drawable_ID: The drawable.
* @x1: x coordinate of the upper left corner of selection bounds.
* @y1: y coordinate of the upper left corner of selection bounds.
* @x2: x coordinate of the lower right corner of selection bounds.
* @y2: y coordinate of the lower right corner of selection bounds.
*
* Find the bounding box of the current selection in relation to the
* specified drawable.
*
* This procedure returns the whether there is a selection. If there is
* one, the upper left and lower righthand corners of its bounding box
* are returned. These coordinates are specified relative to the
* drawable's origin, and bounded by the drawable's extents. Please
* note that the pixel specified by the lower righthand coordinate of
* the bounding box is not part of the selection. The selection ends at
* the upper left corner of this pixel. This means the width of the
* selection can be calculated as (x2 - x1), its height as (y2 - y1).
*
* Returns: TRUE if there is a selection.
*/
gboolean
gimp_drawable_mask_bounds (gint32 drawable_ID,
gint *x1,
gint *y1,
gint *x2,
gint *y2)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean non_empty = FALSE;
return_vals = gimp_run_procedure ("gimp_drawable_mask_bounds",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
{
non_empty = return_vals[1].data.d_int32;
*x1 = return_vals[2].data.d_int32;
*y1 = return_vals[3].data.d_int32;
*x2 = return_vals[4].data.d_int32;
*y2 = return_vals[5].data.d_int32;
}
gimp_destroy_params (return_vals, nreturn_vals);
return non_empty;
}
/**
* gimp_drawable_merge_shadow:
* @drawable_ID: The drawable.
* @undo: Push merge to undo stack?
*
* Merge the shadow buffer with the specified drawable.
*
* This procedure combines the contents of the image's shadow buffer
* (for temporary processing) with the specified drawable. The \"undo\"
* parameter specifies whether to add an undo step for the operation.
* Requesting no undo is useful for such applications as 'auto-apply'.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_merge_shadow (gint32 drawable_ID,
gboolean undo)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_drawable_merge_shadow",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, undo,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_drawable_update:
* @drawable_ID: The drawable.
* @x: x coordinate of upper left corner of update region.
* @y: y coordinate of upper left corner of update region.
* @width: Width of update region.
* @height: Height of update region.
*
* Update the specified region of the drawable.
*
* This procedure updates the specified region of the drawable. The (x,
* y) coordinate pair is relative to the drawable's origin, not to the
* image origin. Therefore, the entire drawable can be updated with:
* {x-&gt;0, y-&gt;0, w-&gt;width, h-&gt;height }.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_update (gint32 drawable_ID,
gint x,
gint y,
gint width,
gint height)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_drawable_update",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, x,
GIMP_PDB_INT32, y,
GIMP_PDB_INT32, width,
GIMP_PDB_INT32, height,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_drawable_get_pixel:
* @drawable_ID: The drawable.
@ -1023,6 +1016,93 @@ gimp_drawable_set_pixel (gint32 drawable_ID,
return success;
}
/**
* gimp_drawable_fill:
* @drawable_ID: The drawable.
* @fill_type: The type of fill.
*
* Fill the drawable with the specified fill mode.
*
* This procedure fills the drawable with the fill mode. If the fill
* mode is foreground the current foreground color is used. If the fill
* mode is background, the current background color is used. If the
* fill type is white, then white is used. Transparent fill only
* affects layers with an alpha channel, in which case the alpha
* channel is set to transparent. If the drawable has no alpha channel,
* it is filled to white. No fill leaves the drawable's contents
* undefined. This procedure is unlike the bucket fill tool because it
* fills regardless of a selection
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_fill (gint32 drawable_ID,
GimpFillType fill_type)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_drawable_fill",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, fill_type,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_drawable_offset:
* @drawable_ID: The drawable to offset.
* @wrap_around: wrap image around or fill vacated regions.
* @fill_type: fill vacated regions of drawable with background or transparent.
* @offset_x: offset by this amount in X direction.
* @offset_y: offset by this amount in Y direction.
*
* Offset the drawable by the specified amounts in the X and Y
* directions
*
* This procedure offsets the specified drawable by the amounts
* specified by 'offset_x' and 'offset_y'. If 'wrap_around' is set to
* TRUE, then portions of the drawable which are offset out of bounds
* are wrapped around. Alternatively, the undefined regions of the
* drawable can be filled with transparency or the background color, as
* specified by the 'fill_type' parameter.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_offset (gint32 drawable_ID,
gboolean wrap_around,
GimpOffsetType fill_type,
gint offset_x,
gint offset_y)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_drawable_offset",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, wrap_around,
GIMP_PDB_INT32, fill_type,
GIMP_PDB_INT32, offset_x,
GIMP_PDB_INT32, offset_y,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* _gimp_drawable_thumbnail:
* @drawable_ID: The drawable.
@ -1088,83 +1168,3 @@ _gimp_drawable_thumbnail (gint32 drawable_ID,
return success;
}
/**
* gimp_drawable_offset:
* @drawable_ID: The drawable to offset.
* @wrap_around: wrap image around or fill vacated regions.
* @fill_type: fill vacated regions of drawable with background or transparent.
* @offset_x: offset by this amount in X direction.
* @offset_y: offset by this amount in Y direction.
*
* Offset the drawable by the specified amounts in the X and Y
* directions
*
* This procedure offsets the specified drawable by the amounts
* specified by 'offset_x' and 'offset_y'. If 'wrap_around' is set to
* TRUE, then portions of the drawable which are offset out of bounds
* are wrapped around. Alternatively, the undefined regions of the
* drawable can be filled with transparency or the background color, as
* specified by the 'fill_type' parameter.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_offset (gint32 drawable_ID,
gboolean wrap_around,
GimpOffsetType fill_type,
gint offset_x,
gint offset_y)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_drawable_offset",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, wrap_around,
GIMP_PDB_INT32, fill_type,
GIMP_PDB_INT32, offset_x,
GIMP_PDB_INT32, offset_y,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_drawable_delete:
* @drawable_ID: The drawable to delete.
*
* Delete a drawable.
*
* This procedure deletes the specified drawable. This must not be done
* if the gimage containing this drawable was already deleted or if the
* drawable was already removed from the image. The only case in which
* this procedure is useful is if you want to get rid of a drawable
* which has not yet been added to an image.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_delete (gint32 drawable_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_drawable_delete",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}

View File

@ -29,26 +29,13 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_drawable_merge_shadow (gint32 drawable_ID,
gboolean undo);
gboolean gimp_drawable_fill (gint32 drawable_ID,
GimpFillType fill_type);
gboolean gimp_drawable_update (gint32 drawable_ID,
gint x,
gint y,
gint width,
gint height);
gboolean gimp_drawable_mask_bounds (gint32 drawable_ID,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
gint32 gimp_drawable_get_image (gint32 drawable_ID);
gboolean gimp_drawable_set_image (gint32 drawable_ID,
gint32 image_ID);
gboolean gimp_drawable_has_alpha (gint32 drawable_ID);
gboolean gimp_drawable_delete (gint32 drawable_ID);
gboolean gimp_drawable_is_layer (gint32 drawable_ID);
gboolean gimp_drawable_is_layer_mask (gint32 drawable_ID);
gboolean gimp_drawable_is_channel (gint32 drawable_ID);
GimpImageType gimp_drawable_type (gint32 drawable_ID);
GimpImageType gimp_drawable_type_with_alpha (gint32 drawable_ID);
gboolean gimp_drawable_has_alpha (gint32 drawable_ID);
gboolean gimp_drawable_is_rgb (gint32 drawable_ID);
gboolean gimp_drawable_is_gray (gint32 drawable_ID);
gboolean gimp_drawable_is_indexed (gint32 drawable_ID);
@ -58,9 +45,9 @@ gint gimp_drawable_height (gint32 drawable_ID);
gboolean gimp_drawable_offsets (gint32 drawable_ID,
gint *offset_x,
gint *offset_y);
gboolean gimp_drawable_is_layer (gint32 drawable_ID);
gboolean gimp_drawable_is_layer_mask (gint32 drawable_ID);
gboolean gimp_drawable_is_channel (gint32 drawable_ID);
gint32 gimp_drawable_get_image (gint32 drawable_ID);
gboolean gimp_drawable_set_image (gint32 drawable_ID,
gint32 image_ID);
gchar* gimp_drawable_get_name (gint32 drawable_ID);
gboolean gimp_drawable_set_name (gint32 drawable_ID,
const gchar *name);
@ -73,6 +60,18 @@ gboolean gimp_drawable_set_linked (gint32 drawable_ID,
gint gimp_drawable_get_tattoo (gint32 drawable_ID);
gboolean gimp_drawable_set_tattoo (gint32 drawable_ID,
gint tattoo);
gboolean gimp_drawable_mask_bounds (gint32 drawable_ID,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
gboolean gimp_drawable_merge_shadow (gint32 drawable_ID,
gboolean undo);
gboolean gimp_drawable_update (gint32 drawable_ID,
gint x,
gint y,
gint width,
gint height);
guint8* gimp_drawable_get_pixel (gint32 drawable_ID,
gint x_coord,
gint y_coord,
@ -82,6 +81,13 @@ gboolean gimp_drawable_set_pixel (gint32 drawable_ID,
gint y_coord,
gint num_channels,
const guint8 *pixel);
gboolean gimp_drawable_fill (gint32 drawable_ID,
GimpFillType fill_type);
gboolean gimp_drawable_offset (gint32 drawable_ID,
gboolean wrap_around,
GimpOffsetType fill_type,
gint offset_x,
gint offset_y);
gboolean _gimp_drawable_thumbnail (gint32 drawable_ID,
gint width,
gint height,
@ -90,12 +96,6 @@ gboolean _gimp_drawable_thumbnail (gint32 drawable_ID,
gint *bpp,
gint *thumbnail_data_count,
guint8 **thumbnail_data);
gboolean gimp_drawable_offset (gint32 drawable_ID,
gboolean wrap_around,
GimpOffsetType fill_type,
gint offset_x,
gint offset_y);
gboolean gimp_drawable_delete (gint32 drawable_ID);
G_END_DECLS

File diff suppressed because it is too large Load Diff

View File

@ -33,8 +33,12 @@ gint* gimp_image_list (gint *num
gint32 gimp_image_new (gint width,
gint height,
GimpImageBaseType type);
gint32 gimp_image_duplicate (gint32 image_ID);
gboolean gimp_image_delete (gint32 image_ID);
GimpImageBaseType gimp_image_base_type (gint32 image_ID);
gint gimp_image_width (gint32 image_ID);
gint gimp_image_height (gint32 image_ID);
gboolean gimp_image_free_shadow (gint32 image_ID);
gboolean gimp_image_resize (gint32 image_ID,
gint new_width,
gint new_height,
@ -50,16 +54,22 @@ gboolean gimp_image_crop (gint32 ima
gint offy);
gboolean gimp_image_flip (gint32 image_ID,
GimpOrientationType flip_type);
gboolean gimp_image_free_shadow (gint32 image_ID);
gint* gimp_image_get_layers (gint32 image_ID,
gint *num_layers);
gint* gimp_image_get_channels (gint32 image_ID,
gint *num_channels);
gint32 gimp_image_active_drawable (gint32 image_ID);
gboolean gimp_image_unset_active_channel (gint32 image_ID);
gint32 gimp_image_get_floating_sel (gint32 image_ID);
gint32 gimp_image_floating_sel_attached_to (gint32 image_ID);
gint32 gimp_image_pick_correlate_layer (gint32 image_ID,
gint x,
gint y);
gboolean gimp_image_add_layer (gint32 image_ID,
gint32 layer_ID,
gint position);
gboolean gimp_image_remove_layer (gint32 image_ID,
gint32 layer_ID);
gboolean gimp_image_raise_layer (gint32 image_ID,
gint32 layer_ID);
gboolean gimp_image_lower_layer (gint32 image_ID,
@ -68,32 +78,27 @@ gboolean gimp_image_raise_layer_to_top (gint32 ima
gint32 layer_ID);
gboolean gimp_image_lower_layer_to_bottom (gint32 image_ID,
gint32 layer_ID);
gboolean gimp_image_add_channel (gint32 image_ID,
gint32 channel_ID,
gint position);
gboolean gimp_image_remove_channel (gint32 image_ID,
gint32 channel_ID);
gboolean gimp_image_raise_channel (gint32 image_ID,
gint32 channel_ID);
gboolean gimp_image_lower_channel (gint32 image_ID,
gint32 layer_ID);
gint32 gimp_image_flatten (gint32 image_ID);
gint32 gimp_image_merge_visible_layers (gint32 image_ID,
GimpMergeType merge_type);
gint32 gimp_image_merge_down (gint32 image_ID,
gint32 merge_layer_ID,
GimpMergeType merge_type);
gint32 gimp_image_flatten (gint32 image_ID);
gboolean gimp_image_add_layer (gint32 image_ID,
gint32 layer_ID,
gint position);
gboolean gimp_image_remove_layer (gint32 image_ID,
gint32 layer_ID);
gboolean gimp_image_add_layer_mask (gint32 image_ID,
gint32 layer_ID,
gint32 mask_ID);
gboolean gimp_image_remove_layer_mask (gint32 image_ID,
gint32 layer_ID,
GimpMaskApplyMode mode);
gboolean gimp_image_raise_channel (gint32 image_ID,
gint32 channel_ID);
gboolean gimp_image_lower_channel (gint32 image_ID,
gint32 layer_ID);
gboolean gimp_image_add_channel (gint32 image_ID,
gint32 channel_ID,
gint position);
gboolean gimp_image_remove_channel (gint32 image_ID,
gint32 channel_ID);
guint8* _gimp_image_get_cmap (gint32 image_ID,
gint *num_bytes);
gboolean _gimp_image_set_cmap (gint32 image_ID,
@ -101,8 +106,6 @@ gboolean _gimp_image_set_cmap (gint32 ima
const guint8 *cmap);
gboolean gimp_image_clean_all (gint32 image_ID);
gboolean gimp_image_is_dirty (gint32 image_ID);
gint32 gimp_image_get_floating_sel (gint32 image_ID);
gint32 gimp_image_floating_sel_attached_to (gint32 image_ID);
gboolean _gimp_image_thumbnail (gint32 image_ID,
gint width,
gint height,
@ -111,12 +114,6 @@ gboolean _gimp_image_thumbnail (gint32 ima
gint *bpp,
gint *thumbnail_data_count,
guint8 **thumbnail_data);
gboolean gimp_image_set_tattoo_state (gint32 image_ID,
gint tattoo);
gint gimp_image_get_tattoo_state (gint32 image_ID);
gint32 gimp_image_duplicate (gint32 image_ID);
gint gimp_image_width (gint32 image_ID);
gint gimp_image_height (gint32 image_ID);
gint32 gimp_image_get_active_layer (gint32 image_ID);
gboolean gimp_image_set_active_layer (gint32 image_ID,
gint32 active_layer_ID);
@ -147,6 +144,9 @@ gboolean gimp_image_set_resolution (gint32 ima
GimpUnit gimp_image_get_unit (gint32 image_ID);
gboolean gimp_image_set_unit (gint32 image_ID,
GimpUnit unit);
gint gimp_image_get_tattoo_state (gint32 image_ID);
gboolean gimp_image_set_tattoo_state (gint32 image_ID,
gint tattoo_state);
gint32 gimp_image_get_layer_by_tattoo (gint32 image_ID,
gint tattoo);
gint32 gimp_image_get_channel_by_tattoo (gint32 image_ID,

View File

@ -78,6 +78,43 @@ _gimp_layer_new (gint32 image_ID,
return layer_ID;
}
/**
* gimp_layer_new_from_drawable:
* @drawable_ID: The source drawable from where the new layer is copied.
* @dest_image_ID: The destination image to which to add the layer.
*
* Create a new layer by copying an existing drawable.
*
* This procedure creates a new layer as a copy of the specified
* drawable. The new layer still needs to be added to the image, as
* this is not automatic. Add the new layer with the
* 'gimp_image_add_layer' command. Other attributes such as layer mask
* modes, and offsets should be set with explicit procedure calls.
*
* Returns: The newly copied layer.
*/
gint32
gimp_layer_new_from_drawable (gint32 drawable_ID,
gint32 dest_image_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gint32 layer_copy_ID = -1;
return_vals = gimp_run_procedure ("gimp_layer_new_from_drawable",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_IMAGE, dest_image_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
layer_copy_ID = return_vals[1].data.d_layer;
gimp_destroy_params (return_vals, nreturn_vals);
return layer_copy_ID;
}
/**
* _gimp_layer_copy:
* @layer_ID: The layer to copy.
@ -117,45 +154,37 @@ _gimp_layer_copy (gint32 layer_ID,
}
/**
* gimp_layer_create_mask:
* @layer_ID: The layer to which to add the mask.
* @mask_type: The type of mask.
* gimp_layer_add_alpha:
* @layer_ID: The layer.
*
* Create a layer mask for the specified specified layer.
* Add an alpha channel to the layer if it doesn't already have one.
*
* This procedure creates a layer mask for the specified layer. Layer
* masks serve as an additional alpha channel for a layer. A number of
* ifferent types of masks are allowed for initialisation: completely
* white masks (which will leave the layer fully visible), completely
* black masks (which will give the layer complete transparency, the
* layer's already existing alpha channel (which will leave the layer
* fully visible, but which may be more useful than a white mask), the
* current selection or a grayscale copy of the layer. The layer mask
* still needs to be added to the layer. This can be done with a call
* to 'gimp_image_add_layer_mask'.
* This procedure adds an additional component to the specified layer
* if it does not already possess an alpha channel. An alpha channel
* makes it possible to move a layer from the bottom of the layer stack
* and to clear and erase to transparency, instead of the background
* color. This transforms images of type RGB to RGBA, GRAY to GRAYA,
* and INDEXED to INDEXEDA.
*
* Returns: The newly created mask.
* Returns: TRUE on success.
*/
gint32
gimp_layer_create_mask (gint32 layer_ID,
GimpAddMaskType mask_type)
gboolean
gimp_layer_add_alpha (gint32 layer_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gint32 mask_ID = -1;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_layer_create_mask",
return_vals = gimp_run_procedure ("gimp_layer_add_alpha",
&nreturn_vals,
GIMP_PDB_LAYER, layer_ID,
GIMP_PDB_INT32, mask_type,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
mask_ID = return_vals[1].data.d_layer_mask;
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return mask_ID;
return success;
}
/**
@ -314,40 +343,6 @@ gimp_layer_translate (gint32 layer_ID,
return success;
}
/**
* gimp_layer_add_alpha:
* @layer_ID: The layer.
*
* Add an alpha channel to the layer if it doesn't already have one.
*
* This procedure adds an additional component to the specified layer
* if it does not already possess an alpha channel. An alpha channel
* makes it possible to move a layer from the bottom of the layer stack
* and to clear and erase to transparency, instead of the background
* color. This transforms images of type RGB to RGBA, GRAY to GRAYA,
* and INDEXED to INDEXEDA.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_add_alpha (gint32 layer_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_layer_add_alpha",
&nreturn_vals,
GIMP_PDB_LAYER, layer_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_layer_set_offsets:
* @layer_ID: The layer.
@ -385,6 +380,48 @@ gimp_layer_set_offsets (gint32 layer_ID,
return success;
}
/**
* gimp_layer_create_mask:
* @layer_ID: The layer to which to add the mask.
* @mask_type: The type of mask.
*
* Create a layer mask for the specified specified layer.
*
* This procedure creates a layer mask for the specified layer. Layer
* masks serve as an additional alpha channel for a layer. A number of
* ifferent types of masks are allowed for initialisation: completely
* white masks (which will leave the layer fully visible), completely
* black masks (which will give the layer complete transparency, the
* layer's already existing alpha channel (which will leave the layer
* fully visible, but which may be more useful than a white mask), the
* current selection or a grayscale copy of the layer. The layer mask
* still needs to be added to the layer. This can be done with a call
* to 'gimp_image_add_layer_mask'.
*
* Returns: The newly created mask.
*/
gint32
gimp_layer_create_mask (gint32 layer_ID,
GimpAddMaskType mask_type)
{
GimpParam *return_vals;
gint nreturn_vals;
gint32 mask_ID = -1;
return_vals = gimp_run_procedure ("gimp_layer_create_mask",
&nreturn_vals,
GIMP_PDB_LAYER, layer_ID,
GIMP_PDB_INT32, mask_type,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
mask_ID = return_vals[1].data.d_layer_mask;
gimp_destroy_params (return_vals, nreturn_vals);
return mask_ID;
}
/**
* gimp_layer_get_mask:
* @layer_ID: The layer.
@ -448,43 +485,6 @@ gimp_layer_is_floating_sel (gint32 layer_ID)
return is_floating_sel;
}
/**
* gimp_layer_new_from_drawable:
* @drawable_ID: The source drawable from where the new layer is copied.
* @dest_image_ID: The destination image to which to add the layer.
*
* Create a new layer by copying an existing drawable.
*
* This procedure creates a new layer as a copy of the specified
* drawable. The new layer still needs to be added to the image, as
* this is not automatic. Add the new layer with the
* 'gimp_image_add_layer' command. Other attributes such as layer mask
* modes, and offsets should be set with explicit procedure calls.
*
* Returns: The newly copied layer.
*/
gint32
gimp_layer_new_from_drawable (gint32 drawable_ID,
gint32 dest_image_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gint32 layer_copy_ID = -1;
return_vals = gimp_run_procedure ("gimp_layer_new_from_drawable",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_IMAGE, dest_image_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
layer_copy_ID = return_vals[1].data.d_layer;
gimp_destroy_params (return_vals, nreturn_vals);
return layer_copy_ID;
}
/**
* gimp_layer_get_preserve_trans:
* @layer_ID: The layer.

View File

@ -36,10 +36,11 @@ gint32 _gimp_layer_new (gint32 imag
const gchar *name,
gdouble opacity,
GimpLayerModeEffects mode);
gint32 gimp_layer_new_from_drawable (gint32 drawable_ID,
gint32 dest_image_ID);
gint32 _gimp_layer_copy (gint32 layer_ID,
gboolean add_alpha);
gint32 gimp_layer_create_mask (gint32 layer_ID,
GimpAddMaskType mask_type);
gboolean gimp_layer_add_alpha (gint32 layer_ID);
gboolean gimp_layer_scale (gint32 layer_ID,
gint new_width,
gint new_height,
@ -53,14 +54,13 @@ gboolean gimp_layer_resize_to_image_size (gint32 laye
gboolean gimp_layer_translate (gint32 layer_ID,
gint offx,
gint offy);
gboolean gimp_layer_add_alpha (gint32 layer_ID);
gboolean gimp_layer_set_offsets (gint32 layer_ID,
gint offx,
gint offy);
gint32 gimp_layer_create_mask (gint32 layer_ID,
GimpAddMaskType mask_type);
gint32 gimp_layer_get_mask (gint32 layer_ID);
gboolean gimp_layer_is_floating_sel (gint32 layer_ID);
gint32 gimp_layer_new_from_drawable (gint32 drawable_ID,
gint32 dest_image_ID);
gboolean gimp_layer_get_preserve_trans (gint32 layer_ID);
gboolean gimp_layer_set_preserve_trans (gint32 layer_ID,
gboolean preserve_trans);

View File

@ -126,7 +126,7 @@ gimp_blend (gint32 drawable_ID,
* unused. If the sample_merged parameter is non-zero, the data of the
* composite image will be used instead of that for the specified
* drawable. This is equivalent to sampling for colors after merging
* all visible layers. In the case of merged sampling, the x,y
* all visible layers. In the case of merged sampling, the x and y
* coordinates are relative to the image's origin; otherwise, they are
* relative to the drawable's origin.
*
@ -188,7 +188,8 @@ gimp_bucket_fill (gint32 drawable_ID,
* parameter is non-zero, the data of the composite image will be used
* instead of that for the specified drawable. This is equivalent to
* sampling for colors after merging all visible layers. In the case of
* a merged sampling, the supplied drawable is ignored.
* a merged sampling, the supplied drawable is ignored except for
* finding the image it belongs to.
*
* Returns: TRUE on success.
*/

View File

@ -697,19 +697,20 @@ CODE
"core/gimpdrawable-offset.h" "base/tile.h" "base/tile-manager.h"
"base/temp-buf.h" "gimp-intl.h");
@procs = qw(drawable_merge_shadow drawable_fill drawable_update
drawable_mask_bounds
drawable_get_image drawable_set_image
drawable_has_alpha drawable_type drawable_type_with_alpha
@procs = qw(drawable_delete
drawable_is_layer drawable_is_layer_mask drawable_is_channel
drawable_type drawable_type_with_alpha drawable_has_alpha
drawable_is_rgb drawable_is_gray drawable_is_indexed
drawable_bpp drawable_width drawable_height drawable_offsets
drawable_is_layer drawable_is_layer_mask drawable_is_channel
drawable_get_image drawable_set_image
drawable_get_name drawable_set_name
drawable_get_visible drawable_set_visible
drawable_get_linked drawable_set_linked
drawable_get_tattoo drawable_set_tattoo
drawable_mask_bounds drawable_merge_shadow drawable_update
drawable_get_pixel drawable_set_pixel
drawable_thumbnail drawable_offset drawable_delete);
drawable_fill drawable_offset
drawable_thumbnail);
%exports = (app => [@procs], lib => [@procs]);
$desc = 'Drawable procedures';

View File

@ -31,7 +31,8 @@ sub channel_arg () {{
sub new_dim_args {
foreach (qw(width height)) {
push @inargs, { name => "new_$_", type => '0 < int32',
push @inargs, { name => "new_$_",
type => '0 < int32',
desc => "New image $_: %%desc%%" }
}
}
@ -42,11 +43,11 @@ sub image_list_proc {
$blurb = "Returns the list of ${type}s contained in the specified image.";
$help = <<HELP;
This procedure returns the list of ${type}s contained in the specified image.
This procedure returns the list of ${type}s contained in the specified image.
HELP
&std_pdb_misc;
@inargs = ( &std_image_arg );
@outargs = (
@ -256,7 +257,7 @@ HELP
}
@outargs = (
{ name => 'image', type => 'image', init => 1,
{ name => 'image', type => 'image', init => 1,
desc => 'The ID of the newly created image' }
);
@ -270,6 +271,57 @@ CODE
);
}
sub image_duplicate {
$blurb = 'Duplicate the specified image';
$help = <<'HELP';
This procedure duplicates the specified image, copying all layers, channels,
and image information.
HELP
&std_pdb_misc;
$date = '1997';
@inargs = ( &std_image_arg );
@outargs = (
{ name => 'new_image', type => 'image',
desc => 'The new, duplicated image', init => 1 }
);
%invoke = (
headers => [ qw("core/gimpimage-duplicate.h") ],
code => <<'CODE'
success = (new_image = gimp_image_duplicate (gimage)) != NULL;
CODE
);
}
sub image_delete {
$blurb = 'Delete the specified image.';
$help = <<'HELP';
If there are no displays associated with this image it will be deleted.
This means that you can not delete an image through the PDB that was
created by the user. If the associated display was however created
through the PDB and you know the display ID, you may delete the display.
Removal of the last associated display will then delete the image.
HELP
&std_pdb_misc;
@inargs = ( &std_image_arg );
%invoke = ( code => <<'CODE' );
{
if (gimage->disp_count == 0)
g_object_unref (gimage);
else
success = FALSE;
}
CODE
}
sub image_resize {
$blurb = 'Resize the image to the specified extents.';
@ -340,7 +392,7 @@ sub image_crop {
$help = <<'HELP';
This procedure crops the image so that it's new width and height are equal to
the supplied parameters. Offsets are also provided which describe the position
of the previous image's content. All channels and layers within the image are
of the previous image's content. All channels and layers within the image are
cropped to the new image extents; this includes the image selection mask. If
any parameters are out of range, an error is returned.
HELP
@ -401,31 +453,6 @@ CODE
);
}
sub image_delete {
$blurb = 'Delete the specified image.';
$help = <<'HELP';
If there are no displays associated with this image it will be deleted.
This means that you can not delete an image through the PDB that was
created by the user. If the associated display was however created
through the PDB and you know the display ID, you may delete the display.
Removal of the last associated display will then delete the image.
HELP
&std_pdb_misc;
@inargs = ( &std_image_arg );
%invoke = ( code => <<'CODE' );
{
if (gimage->disp_count == 0)
g_object_unref (gimage);
else
success = FALSE;
}
CODE
}
sub image_free_shadow {
$blurb = "Free the specified image's shadow data (if it exists).";
@ -581,7 +608,7 @@ HELP
&std_image_arg,
{ name => 'merge_layer', type => 'layer',
desc => 'The layer to merge down from' },
{ name => 'merge_type',
{ name => 'merge_type',
type => 'enum GimpMergeType (no GIMP_FLATTEN_IMAGE)',
desc => 'The type of merge: { %%desc%% }' }
);
@ -988,7 +1015,6 @@ CODE
}
foreach (qw(width height)) {
push @procs, "image_$_";
eval <<SUB;
sub image_$_ {
\$blurb = 'Return the $_ of the image';
@ -1208,24 +1234,24 @@ HELP
$invoke{code} = <<'CODE';
{
if (!FINITE (xresolution) ||
if (! FINITE (xresolution) ||
xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION ||
!FINITE (yresolution) ||
! FINITE (yresolution) ||
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
{
g_message (_("Image resolution is out of bounds, "
g_message (_("Image resolution is out of bounds, "
"using the default resolution instead."));
success = FALSE;
}
else
{
gimage->xresolution = xresolution;
gimage->yresolution = yresolution;
gimp_image_set_resolution (gimage, xresolution, yresolution);
}
}
CODE
CODE2
my $unit_help = <<'HELP';
This value is independent of any of the layers in this image. See the
gimp_unit_* procedure definitions for the valid range of unit IDs and a
@ -1236,7 +1262,8 @@ my $unit_misc = <<'CODE';
$author = $copyright = 'Michael Natterer';
$date = '1998';
CODE
&image_accessors('unit', 'unit (min GIMP_UNIT_INCH)', 'unit', 0,
&image_accessors('unit', 'unit (min GIMP_UNIT_INCH)', 'unit', 1,
[ <<CODE1, <<CODE2 ]);
\$help .= '$unit_help';
$unit_misc
@ -1245,6 +1272,39 @@ CODE1
$unit_misc
CODE2
my $tattoo_state_misc = <<'CODE';
$author = $copyright = 'Andy Thomas';
$date = '2000';
CODE
&image_accessors('tattoo_state', 'int32', 'tattoo_state', 1,
[ <<CODE1, <<CODE2 ]);
\$blurb = 'Returns the tattoo state associated with the image.';
\$help = <<'HELP';
This procedure returns the tattoo state of the image. Use only by
save/load plugins that wish to preserve an images tattoo state. Using this
function at other times will produce unexpected results.
HELP
$tattoo_state_misc
CODE1
\$blurb = 'Set the tattoo state associated with the image.';
\$help = <<'HELP';
This procedure sets the tattoo state of the image. Use only by
save/load plugins that wish to preserve an images tattoo state. Using
this function at other times will produce unexpected results. A full
check of uniqueness of states in layers, channels and paths will be
performed by this procedure and a execution failure will be returned
if this fails. A failure will also be returned if the new tattoo state
value is less than the maximum tattoo value from all of the tattoos
from the paths, layers and channels. After the image data has been
loaded and all the tattoos have been set then this is the last
procedure that should be called. If effectively does a status check on
the tattoo values that have been set to make sure that all is OK.
HELP
$tattoo_state_misc
CODE2
foreach (qw(layer channel)) {
push @procs, "image_get_${_}_by_tattoo";
eval <<SUB;
@ -1284,7 +1344,10 @@ SUB
sub preview_dim_args () {
my @args;
foreach (qw(width height bpp)) {
push @args, { name => $_, type => 'int32', desc => "The previews $_", init => 1 };
push @args, { name => $_,
type => 'int32',
desc => "The previews $_",
init => 1 };
}
@args;
}
@ -1293,7 +1356,7 @@ sub image_thumbnail {
$blurb = 'Get a thumbnail of an image.';
$help = <<'HELP';
This function gets data from which a thumbnail of an image preview can be
This function gets data from which a thumbnail of an image preview can be
created. Maximum x or y dimension is 1024 pixels. The pixels are returned in
the RGB[A] format. The bpp return value gives the number of bits per pixel
in the image. If the image has an alpha channel, it is also returned.
@ -1304,14 +1367,10 @@ HELP
@inargs = (
&std_image_arg,
{ name => 'width',
type => '0 < int32 <= 1024',
desc => 'The thumbnail width',
alias => 'req_width' },
{ name => 'height',
type => '0 < int32 <= 1024',
desc => 'The thumbnail height',
alias => 'req_height' }
{ name => 'width', type => '0 < int32 <= 1024',
desc => 'The thumbnail width', alias => 'req_width' },
{ name => 'height', type => '0 < int32 <= 1024',
desc => 'The thumbnail height', alias => 'req_height' }
);
@outargs = (
@ -1349,7 +1408,7 @@ HELP
{
num_bytes = buf->height * buf->width * buf->bytes;
thumbnail_data = g_memdup (temp_buf_data (buf), num_bytes);
width = buf->width;
width = buf->width;
height = buf->height;
bpp = buf->bytes;
@ -1360,94 +1419,6 @@ CODE
);
}
sub image_get_tattoo_state {
$blurb = 'Returns the tattoo state associated with the image.';
$help = <<'HELP';
This procedure returns the tattoo state of the image. Use only by
save/load plugins that wish to preserve an images tattoo state. Using this
function at other times will produce unexpected results.
HELP
$author = $copyright = 'Andy Thomas';
$date = '2000';
@inargs = ( &std_image_arg );
@outargs = (
{ name => 'tattoo', type => 'int32',
desc => 'The tattoo state associated with the image', init => 1 }
);
%invoke = (
code => <<'CODE'
{
tattoo = gimp_image_get_tattoo_state (gimage);
}
CODE
);
}
sub image_set_tattoo_state {
$blurb = 'Set the tattoo state associated with the image.';
$help = <<'HELP';
This procedure sets the tattoo state of the image. Use only by
save/load plugins that wish to preserve an images tattoo state. Using this
function at other times will produce unexpected results. A full check of
uniqueness of states in layers, channels and paths will be performed by this
procedure and a execution failure will be returned if this fails. A failure
will also be returned if the new tattoo state value is less than the maximum
tattoo value from all of the tattoos from the paths,layers and channels. After
the image data has been loaded and all the tattoos have been set then this is
the last procedure that should be called. If effectively does a status check
on the tattoo values that have been set to make sure that all is OK.
HELP
$author = $copyright = 'Andy Thomas';
$date = '2000';
@inargs = (
&std_image_arg,
{ name => 'tattoo', type => 'int32',
desc => 'The new tattoo state of the image' }
);
%invoke = (
code => <<'CODE'
{
success = gimp_image_set_tattoo_state (gimage, tattoo);
}
CODE
);
}
sub image_duplicate {
$blurb = 'Duplicate the specified image';
$help = <<'HELP';
This procedure duplicates the specified image, copying all layers, channels,
and image information.
HELP
&std_pdb_misc;
$date = '1997';
@inargs = ( &std_image_arg );
@outargs = (
{ name => 'new_image', type => 'image',
desc => 'The new, duplicated image', init => 1 }
);
%invoke = (
headers => [ qw("core/gimpimage-duplicate.h") ],
code => <<'CODE'
success = (new_image = gimp_image_duplicate (gimage)) != NULL;
CODE
);
}
@headers = qw(<string.h>
"core/gimp.h" "core/gimpcontainer.h"
@ -1480,26 +1451,26 @@ gimlist_cb (gpointer im,
}
CODE
unshift @procs, qw(image_list image_new image_delete image_base_type
image_resize image_scale image_crop image_flip
unshift @procs, qw(image_list image_new image_duplicate image_delete
image_base_type
image_width image_height
image_free_shadow
image_resize image_scale image_crop image_flip
image_get_layers image_get_channels
image_active_drawable image_unset_active_channel
image_active_drawable
image_unset_active_channel
image_get_floating_sel image_floating_sel_attached_to
image_pick_correlate_layer
image_raise_layer image_lower_layer image_raise_layer_to_top
image_lower_layer_to_bottom
image_merge_visible_layers image_merge_down
image_flatten
image_add_layer image_remove_layer
image_add_layer_mask image_remove_layer_mask
image_raise_channel image_lower_channel
image_raise_layer image_lower_layer
image_raise_layer_to_top image_lower_layer_to_bottom
image_add_channel image_remove_channel
image_raise_channel image_lower_channel
image_flatten image_merge_visible_layers image_merge_down
image_add_layer_mask image_remove_layer_mask
image_get_cmap image_set_cmap
image_clean_all image_is_dirty
image_get_floating_sel image_floating_sel_attached_to
image_thumbnail
image_set_tattoo_state image_get_tattoo_state
image_duplicate);
image_thumbnail);
%exports = (app => [@procs], lib => [@procs]);
$desc = 'Image';

View File

@ -592,11 +592,12 @@ CODE2
@headers = qw("config/gimpcoreconfig.h" "core/gimp.h" "core/gimpimage-undo.h"
"core/gimpitem-linked.h" "pdb_glue.h" "gimp-intl.h");
unshift @procs, qw(layer_new layer_copy layer_create_mask layer_scale
layer_resize layer_resize_to_image_size
layer_translate layer_add_alpha layer_set_offsets
layer_get_mask
layer_is_floating_sel layer_new_from_drawable);
unshift @procs, qw(layer_new layer_new_from_drawable layer_copy
layer_add_alpha
layer_scale layer_resize layer_resize_to_image_size
layer_translate layer_set_offsets
layer_create_mask layer_get_mask
layer_is_floating_sel);
%exports = (app => [@procs], lib => [@procs]);
$desc = 'Layer';

View File

@ -27,26 +27,12 @@ sub drawable_arg () {{
desc => 'The affected drawable',
}}
sub drawable_out_arg {
my $type = shift;
my $arg = &drawable_arg;
$arg->{desc} = "The $type drawable";
$arg->{no_declare} = 1;
$arg;
}
sub sample_merged_arg () {{
name => 'sample_merged',
type => 'boolean',
desc => 'Use the composite image, not the drawable'
}}
sub threshold_arg () {{
name => 'threshold',
type => '0 <= int32 <= 255',
desc => 'Threshold in intensity levels %%desc%%'
}}
# The defs
@ -135,16 +121,18 @@ a seed fill starting at the specified coordinates.
BLURB
$help = <<'HELP';
This tool requires information on the paint application mode, and the fill
mode, which can either be in the foreground color, or in the currently active
pattern. If there is no selection, a seed fill is executed at the specified
coordinates and extends outward in keeping with the threshold parameter. If
there is a selection in the target image, the threshold, sample merged, x, and
y arguments are unused. If the sample_merged parameter is non-zero, the data of
the composite image will be used instead of that for the specified drawable.
This is equivalent to sampling for colors after merging all visible layers. In
the case of merged sampling, the x,y coordinates are relative to the image's
origin; otherwise, they are relative to the drawable's origin.
This tool requires information on the paint application mode, and the
fill mode, which can either be in the foreground color, or in the
currently active pattern. If there is no selection, a seed fill is
executed at the specified coordinates and extends outward in keeping
with the threshold parameter. If there is a selection in the target
image, the threshold, sample merged, x, and y arguments are unused. If
the sample_merged parameter is non-zero, the data of the composite
image will be used instead of that for the specified drawable. This
is equivalent to sampling for colors after merging all visible
layers. In the case of merged sampling, the x and y coordinates are
relative to the image's origin; otherwise, they are relative to the
drawable's origin.
HELP
&std_pdb_misc;
@ -164,7 +152,7 @@ HELP
desc => "The threshold determines how extensive the seed fill will
be. It's value is specified in terms of intensity levels
(%%desc%%). $validity" },
&sample_merged_arg,
&sample_merged_arg
);
foreach (qw(x y)) {
@ -208,16 +196,18 @@ Determine the color at the given drawable coordinates
BLURB
$help = <<'HELP';
This tool determines the color at the specified coordinates. The returned color
is an RGB triplet even for grayscale and indexed drawables. If the coordinates
lie outside of the extents of the specified drawable, then an error is
returned. If the drawable has an alpha channel, the algorithm examines the
alpha value of the drawable at the coordinates. If the alpha value is
completely transparent (0), then an error is returned. If the sample_merged
parameter is non-zero, the data of the composite image will be used instead of
that for the specified drawable. This is equivalent to sampling for colors
after merging all visible layers. In the case of a merged sampling, the
supplied drawable is ignored.
This tool determines the color at the specified coordinates. The
returned color is an RGB triplet even for grayscale and indexed
drawables. If the coordinates lie outside of the extents of the
specified drawable, then an error is returned. If the drawable has an
alpha channel, the algorithm examines the alpha value of the drawable
at the coordinates. If the alpha value is completely transparent (0),
then an error is returned. If the sample_merged parameter is non-zero,
the data of the composite image will be used instead of that for the
specified drawable. This is equivalent to sampling for colors after
merging all visible layers. In the case of a merged sampling, the
supplied drawable is ignored except for finding the image it belongs
to.
HELP
&std_pdb_misc;