tools/pdbgen/Makefile.am tools/pdbgen/groups.pl removed the "misc tools"

2004-01-05  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/Makefile.am
	* tools/pdbgen/groups.pl
	* tools/pdbgen/pdb/misc_tools.pdb: removed the "misc tools" PDB group.

	* tools/pdbgen/pdb/edit.pdb: added gimp_edit_bucket_fill() and
	gimp_edit_blend().

	* tools/pdbgen/pdb/image.pdb: added gimp_image_pick_color().

	* app/pdb/procedural_db.c
	* libgimp/gimpcompat.h: added compat stuff.

	* app/pdb/edit_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/internal_procs.c
	* app/pdb/misc_tools_cmds.c
	* libgimp/gimp_pdb.h
	* libgimp/gimpedit_pdb.[ch]
	* libgimp/gimpimage_pdb.[ch]: regenerated.

	* libgimp/Makefile.am
	* libgimp/gimpmisctools_pdb.[ch]: removed.

	* plug-ins/gfig/gfig.c
	* plug-ins/script-fu/scripts/3dTruchet.scm
	* plug-ins/script-fu/scripts/alien-glow-arrow.scm
	* plug-ins/script-fu/scripts/alien-glow-bar.scm
	* plug-ins/script-fu/scripts/alien-glow-bullet.scm
	* plug-ins/script-fu/scripts/alien-glow-button.scm
	* plug-ins/script-fu/scripts/alien-glow-logo.scm
	* plug-ins/script-fu/scripts/basic1-logo.scm
	* plug-ins/script-fu/scripts/basic2-logo.scm
	* plug-ins/script-fu/scripts/beveled-button.scm
	* plug-ins/script-fu/scripts/blended-logo.scm
	* plug-ins/script-fu/scripts/burn-in-anim.scm
	* plug-ins/script-fu/scripts/coffee.scm
	* plug-ins/script-fu/scripts/comic-logo.scm
	* plug-ins/script-fu/scripts/coolmetal-logo.scm
	* plug-ins/script-fu/scripts/glossy.scm
	* plug-ins/script-fu/scripts/gradient-bevel-logo.scm
	* plug-ins/script-fu/scripts/gradient-example.scm
	* plug-ins/script-fu/scripts/hsv-graph.scm
	* plug-ins/script-fu/scripts/pupi-button.scm
	* plug-ins/script-fu/scripts/rendermap.scm
	* plug-ins/script-fu/scripts/sphere.scm
	* plug-ins/script-fu/scripts/starscape-logo.scm
	* plug-ins/script-fu/scripts/test-sphere.scm
	* plug-ins/script-fu/scripts/textured-logo.scm
	* plug-ins/script-fu/scripts/title-header.scm
	* plug-ins/script-fu/scripts/weave.scm: follow "blend" and "color
	picker" changes. Leave "bucket fill" users unchanged because fill
	and bucket_fill need another cleanup (will follow next...)

2004-01-05  Michael Natterer  <mitch@gimp.org>

	* libgimp/libgimp-sections.txt: moved color_picker, blend and
	bucket_fill to their new places.

	* libgimp/tmpl/gimpedit.sgml
	* libgimp/tmpl/gimpimage.sgml
	* libgimp/tmpl/gimptools.sgml: regenerated.
This commit is contained in:
Michael Natterer 2004-01-05 14:35:19 +00:00 committed by Michael Natterer
parent 1f16d9cfc3
commit b2e3434d38
55 changed files with 1256 additions and 953 deletions

View file

@ -1,3 +1,58 @@
2004-01-05 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/Makefile.am
* tools/pdbgen/groups.pl
* tools/pdbgen/pdb/misc_tools.pdb: removed the "misc tools" PDB group.
* tools/pdbgen/pdb/edit.pdb: added gimp_edit_bucket_fill() and
gimp_edit_blend().
* tools/pdbgen/pdb/image.pdb: added gimp_image_pick_color().
* app/pdb/procedural_db.c
* libgimp/gimpcompat.h: added compat stuff.
* app/pdb/edit_cmds.c
* app/pdb/image_cmds.c
* app/pdb/internal_procs.c
* app/pdb/misc_tools_cmds.c
* libgimp/gimp_pdb.h
* libgimp/gimpedit_pdb.[ch]
* libgimp/gimpimage_pdb.[ch]: regenerated.
* libgimp/Makefile.am
* libgimp/gimpmisctools_pdb.[ch]: removed.
* plug-ins/gfig/gfig.c
* plug-ins/script-fu/scripts/3dTruchet.scm
* plug-ins/script-fu/scripts/alien-glow-arrow.scm
* plug-ins/script-fu/scripts/alien-glow-bar.scm
* plug-ins/script-fu/scripts/alien-glow-bullet.scm
* plug-ins/script-fu/scripts/alien-glow-button.scm
* plug-ins/script-fu/scripts/alien-glow-logo.scm
* plug-ins/script-fu/scripts/basic1-logo.scm
* plug-ins/script-fu/scripts/basic2-logo.scm
* plug-ins/script-fu/scripts/beveled-button.scm
* plug-ins/script-fu/scripts/blended-logo.scm
* plug-ins/script-fu/scripts/burn-in-anim.scm
* plug-ins/script-fu/scripts/coffee.scm
* plug-ins/script-fu/scripts/comic-logo.scm
* plug-ins/script-fu/scripts/coolmetal-logo.scm
* plug-ins/script-fu/scripts/glossy.scm
* plug-ins/script-fu/scripts/gradient-bevel-logo.scm
* plug-ins/script-fu/scripts/gradient-example.scm
* plug-ins/script-fu/scripts/hsv-graph.scm
* plug-ins/script-fu/scripts/pupi-button.scm
* plug-ins/script-fu/scripts/rendermap.scm
* plug-ins/script-fu/scripts/sphere.scm
* plug-ins/script-fu/scripts/starscape-logo.scm
* plug-ins/script-fu/scripts/test-sphere.scm
* plug-ins/script-fu/scripts/textured-logo.scm
* plug-ins/script-fu/scripts/title-header.scm
* plug-ins/script-fu/scripts/weave.scm: follow "blend" and "color
picker" changes. Leave "bucket fill" users unchanged because fill
and bucket_fill need another cleanup (will follow next...)
2004-01-05 Dave Neary <bolsh@gimp.org>
* NEWS: Update news.

View file

@ -30,7 +30,10 @@
#include "core/gimp-edit.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpcontext.h"
#include "core/gimpdrawable-blend.h"
#include "core/gimpdrawable-bucket-fill.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimplayer.h"
@ -41,6 +44,8 @@ static ProcRecord edit_copy_proc;
static ProcRecord edit_paste_proc;
static ProcRecord edit_clear_proc;
static ProcRecord edit_fill_proc;
static ProcRecord edit_bucket_fill_proc;
static ProcRecord edit_blend_proc;
static ProcRecord edit_stroke_proc;
void
@ -51,6 +56,8 @@ register_edit_procs (Gimp *gimp)
procedural_db_register (gimp, &edit_paste_proc);
procedural_db_register (gimp, &edit_clear_proc);
procedural_db_register (gimp, &edit_fill_proc);
procedural_db_register (gimp, &edit_bucket_fill_proc);
procedural_db_register (gimp, &edit_blend_proc);
procedural_db_register (gimp, &edit_stroke_proc);
}
@ -319,6 +326,327 @@ static ProcRecord edit_fill_proc =
{ { edit_fill_invoker } }
};
static Argument *
edit_bucket_fill_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gint32 fill_mode;
gint32 paint_mode;
gdouble opacity;
gdouble threshold;
gboolean sample_merged;
gdouble x;
gdouble y;
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_DRAWABLE (drawable))
success = FALSE;
fill_mode = args[1].value.pdb_int;
if (fill_mode < GIMP_FG_BUCKET_FILL || fill_mode > GIMP_PATTERN_BUCKET_FILL)
success = FALSE;
paint_mode = args[2].value.pdb_int;
if (paint_mode < GIMP_NORMAL_MODE || paint_mode > GIMP_COLOR_ERASE_MODE)
success = FALSE;
opacity = args[3].value.pdb_float;
if (opacity < 0.0 || opacity > 100.0)
success = FALSE;
threshold = args[4].value.pdb_float;
if (threshold < 0.0 || threshold > 255.0)
success = FALSE;
sample_merged = args[5].value.pdb_int ? TRUE : FALSE;
x = args[6].value.pdb_float;
y = args[7].value.pdb_float;
if (success)
{
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable));
if (! gimage)
{
success = FALSE;
}
else
{
gboolean do_seed_fill;
do_seed_fill = gimp_channel_is_empty (gimp_image_get_mask (gimage));
gimp_drawable_bucket_fill (drawable, fill_mode,
paint_mode, opacity / 100.0,
do_seed_fill,
FALSE /* don't fill transparent */,
threshold, sample_merged, x, y);
}
}
return procedural_db_return_args (&edit_bucket_fill_proc, success);
}
static ProcArg edit_bucket_fill_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The affected drawable"
},
{
GIMP_PDB_INT32,
"fill_mode",
"The type of fill: { GIMP_FG_BUCKET_FILL (0), GIMP_BG_BUCKET_FILL (1), GIMP_PATTERN_BUCKET_FILL (2) }"
},
{
GIMP_PDB_INT32,
"paint_mode",
"The paint application mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }"
},
{
GIMP_PDB_FLOAT,
"opacity",
"The opacity of the final bucket fill (0 <= opacity <= 100)"
},
{
GIMP_PDB_FLOAT,
"threshold",
"The threshold determines how extensive the seed fill will be. It's value is specified in terms of intensity levels (0 <= threshold <= 255). This parameter is only valid when there is no selection in the specified image."
},
{
GIMP_PDB_INT32,
"sample_merged",
"Use the composite image, not the drawable"
},
{
GIMP_PDB_FLOAT,
"x",
"The x coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image."
},
{
GIMP_PDB_FLOAT,
"y",
"The y coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image."
}
};
static ProcRecord edit_bucket_fill_proc =
{
"gimp_edit_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 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",
GIMP_INTERNAL,
8,
edit_bucket_fill_inargs,
0,
NULL,
{ { edit_bucket_fill_invoker } }
};
static Argument *
edit_blend_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gint32 blend_mode;
gint32 paint_mode;
gint32 gradient_type;
gdouble opacity;
gdouble offset;
gint32 repeat;
gboolean reverse;
gboolean supersample;
gint32 max_depth;
gdouble threshold;
gboolean dither;
gdouble x1;
gdouble y1;
gdouble x2;
gdouble y2;
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_DRAWABLE (drawable))
success = FALSE;
blend_mode = args[1].value.pdb_int;
if (blend_mode < GIMP_FG_BG_RGB_MODE || blend_mode > GIMP_CUSTOM_MODE)
success = FALSE;
paint_mode = args[2].value.pdb_int;
if (paint_mode < GIMP_NORMAL_MODE || paint_mode > GIMP_COLOR_ERASE_MODE)
success = FALSE;
gradient_type = args[3].value.pdb_int;
if (gradient_type < GIMP_GRADIENT_LINEAR || gradient_type > GIMP_GRADIENT_SPIRAL_ANTICLOCKWISE)
success = FALSE;
opacity = args[4].value.pdb_float;
if (opacity < 0.0 || opacity > 100.0)
success = FALSE;
offset = args[5].value.pdb_float;
if (offset < 0.0)
success = FALSE;
repeat = args[6].value.pdb_int;
if (repeat < GIMP_REPEAT_NONE || repeat > GIMP_REPEAT_TRIANGULAR)
success = FALSE;
reverse = args[7].value.pdb_int ? TRUE : FALSE;
supersample = args[8].value.pdb_int ? TRUE : FALSE;
max_depth = args[9].value.pdb_int;
if (supersample && (max_depth < 1 || max_depth > 9))
success = FALSE;
threshold = args[10].value.pdb_float;
if (supersample && (threshold < 0.0 || threshold > 4.0))
success = FALSE;
dither = args[11].value.pdb_int ? TRUE : FALSE;
x1 = args[12].value.pdb_float;
y1 = args[13].value.pdb_float;
x2 = args[14].value.pdb_float;
y2 = args[15].value.pdb_float;
if (success)
{
if (! gimp_item_get_image (GIMP_ITEM (drawable)))
{
success = FALSE;
}
else
{
gimp_drawable_blend (drawable,
blend_mode,
paint_mode,
gradient_type,
opacity / 100.0,
offset, repeat, reverse,
supersample, max_depth,
threshold, dither,
x1, y1, x2, y2,
NULL, NULL);
}
}
return procedural_db_return_args (&edit_blend_proc, success);
}
static ProcArg edit_blend_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The affected drawable"
},
{
GIMP_PDB_INT32,
"blend_mode",
"The type of blend: { GIMP_FG_BG_RGB_MODE (0), GIMP_FG_BG_HSV_MODE (1), GIMP_FG_TRANSPARENT_MODE (2), GIMP_CUSTOM_MODE (3) }"
},
{
GIMP_PDB_INT32,
"paint_mode",
"The paint application mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }"
},
{
GIMP_PDB_INT32,
"gradient_type",
"The type of gradient: { GIMP_GRADIENT_LINEAR (0), GIMP_GRADIENT_BILINEAR (1), GIMP_GRADIENT_RADIAL (2), GIMP_GRADIENT_SQUARE (3), GIMP_GRADIENT_CONICAL_SYMMETRIC (4), GIMP_GRADIENT_CONICAL_ASYMMETRIC (5), GIMP_GRADIENT_SHAPEBURST_ANGULAR (6), GIMP_GRADIENT_SHAPEBURST_SPHERICAL (7), GIMP_GRADIENT_SHAPEBURST_DIMPLED (8), GIMP_GRADIENT_SPIRAL_CLOCKWISE (9), GIMP_GRADIENT_SPIRAL_ANTICLOCKWISE (10) }"
},
{
GIMP_PDB_FLOAT,
"opacity",
"The opacity of the final blend (0 <= opacity <= 100)"
},
{
GIMP_PDB_FLOAT,
"offset",
"Offset relates to the starting and ending coordinates specified for the blend. This parameter is mode dependent (0 <= offset)"
},
{
GIMP_PDB_INT32,
"repeat",
"Repeat mode: { GIMP_REPEAT_NONE (0), GIMP_REPEAT_SAWTOOTH (1), GIMP_REPEAT_TRIANGULAR (2) }"
},
{
GIMP_PDB_INT32,
"reverse",
"Use the reverse gradient (TRUE or FALSE)"
},
{
GIMP_PDB_INT32,
"supersample",
"Do adaptive supersampling (TRUE or FALSE)"
},
{
GIMP_PDB_INT32,
"max_depth",
"Maximum recursion levels for supersampling"
},
{
GIMP_PDB_FLOAT,
"threshold",
"Supersampling threshold"
},
{
GIMP_PDB_INT32,
"dither",
"Use dithering to reduce banding (TRUE or FALSE)"
},
{
GIMP_PDB_FLOAT,
"x1",
"The x coordinate of this blend's starting point"
},
{
GIMP_PDB_FLOAT,
"y1",
"The y coordinate of this blend's starting point"
},
{
GIMP_PDB_FLOAT,
"x2",
"The x coordinate of this blend's ending point"
},
{
GIMP_PDB_FLOAT,
"y2",
"The y coordinate of this blend's ending point"
}
};
static ProcRecord edit_blend_proc =
{
"gimp_edit_blend",
"Blend between the starting and ending coordinates with the specified blend mode and gradient type.",
"This tool requires information on the paint application mode, the blend mode, and the gradient type. It creates the specified variety of blend using the starting and ending coordinates as defined for each gradient type.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
16,
edit_blend_inargs,
0,
NULL,
{ { edit_blend_invoker } }
};
static Argument *
edit_stroke_invoker (Gimp *gimp,
Argument *args)

View file

@ -118,7 +118,9 @@ procedural_db_init_procs (Gimp *gimp,
}
compat_procs[] =
{
{ "gimp_blend", "gimp_edit_blend" },
{ "gimp_brushes_list", "gimp_brushes_get_list" },
{ "gimp_bucket_fill", "gimp_edit_bucket_fill" },
{ "gimp_channel_delete", "gimp_drawable_delete" },
{ "gimp_channel_get_name", "gimp_drawable_get_name" },
{ "gimp_channel_get_tattoo", "gimp_drawable_get_tattoo" },
@ -126,6 +128,7 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_channel_set_name", "gimp_drawable_set_name" },
{ "gimp_channel_set_tattoo", "gimp_drawable_set_tattoo" },
{ "gimp_channel_set_visible", "gimp_drawable_set_visible" },
{ "gimp_color_picker", "gimp_image_pick_color" },
{ "gimp_convert_grayscale", "gimp_image_convert_grayscale" },
{ "gimp_convert_indexed", "gimp_image_convert_indexed" },
{ "gimp_convert_rgb", "gimp_image_convert_rgb" },

View file

@ -118,7 +118,9 @@ procedural_db_init_procs (Gimp *gimp,
}
compat_procs[] =
{
{ "gimp_blend", "gimp_edit_blend" },
{ "gimp_brushes_list", "gimp_brushes_get_list" },
{ "gimp_bucket_fill", "gimp_edit_bucket_fill" },
{ "gimp_channel_delete", "gimp_drawable_delete" },
{ "gimp_channel_get_name", "gimp_drawable_get_name" },
{ "gimp_channel_get_tattoo", "gimp_drawable_get_tattoo" },
@ -126,6 +128,7 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_channel_set_name", "gimp_drawable_set_name" },
{ "gimp_channel_set_tattoo", "gimp_drawable_set_tattoo" },
{ "gimp_channel_set_visible", "gimp_drawable_set_visible" },
{ "gimp_color_picker", "gimp_image_pick_color" },
{ "gimp_convert_grayscale", "gimp_image_convert_grayscale" },
{ "gimp_convert_indexed", "gimp_image_convert_indexed" },
{ "gimp_convert_rgb", "gimp_image_convert_rgb" },

View file

@ -118,7 +118,9 @@ procedural_db_init_procs (Gimp *gimp,
}
compat_procs[] =
{
{ "gimp_blend", "gimp_edit_blend" },
{ "gimp_brushes_list", "gimp_brushes_get_list" },
{ "gimp_bucket_fill", "gimp_edit_bucket_fill" },
{ "gimp_channel_delete", "gimp_drawable_delete" },
{ "gimp_channel_get_name", "gimp_drawable_get_name" },
{ "gimp_channel_get_tattoo", "gimp_drawable_get_tattoo" },
@ -126,6 +128,7 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_channel_set_name", "gimp_drawable_set_name" },
{ "gimp_channel_set_tattoo", "gimp_drawable_set_tattoo" },
{ "gimp_channel_set_visible", "gimp_drawable_set_visible" },
{ "gimp_color_picker", "gimp_image_pick_color" },
{ "gimp_convert_grayscale", "gimp_image_convert_grayscale" },
{ "gimp_convert_indexed", "gimp_image_convert_indexed" },
{ "gimp_convert_rgb", "gimp_image_convert_rgb" },

View file

@ -40,6 +40,7 @@
#include "core/gimpimage-duplicate.h"
#include "core/gimpimage-flip.h"
#include "core/gimpimage-merge.h"
#include "core/gimpimage-pick-color.h"
#include "core/gimpimage-resize.h"
#include "core/gimpimage-rotate.h"
#include "core/gimpimage-scale.h"
@ -52,6 +53,7 @@
#include "gimp-intl.h"
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
static ProcRecord image_list_proc;
@ -73,6 +75,7 @@ static ProcRecord image_get_active_drawable_proc;
static ProcRecord image_unset_active_channel_proc;
static ProcRecord image_get_floating_sel_proc;
static ProcRecord image_floating_sel_attached_to_proc;
static ProcRecord image_pick_color_proc;
static ProcRecord image_pick_correlate_layer_proc;
static ProcRecord image_add_layer_proc;
static ProcRecord image_remove_layer_proc;
@ -137,6 +140,7 @@ register_image_procs (Gimp *gimp)
procedural_db_register (gimp, &image_unset_active_channel_proc);
procedural_db_register (gimp, &image_get_floating_sel_proc);
procedural_db_register (gimp, &image_floating_sel_attached_to_proc);
procedural_db_register (gimp, &image_pick_color_proc);
procedural_db_register (gimp, &image_pick_correlate_layer_proc);
procedural_db_register (gimp, &image_add_layer_proc);
procedural_db_register (gimp, &image_remove_layer_proc);
@ -1371,6 +1375,129 @@ static ProcRecord image_floating_sel_attached_to_proc =
{ { image_floating_sel_attached_to_invoker } }
};
static Argument *
image_pick_color_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpImage *gimage;
GimpDrawable *drawable;
gdouble x;
gdouble y;
gboolean sample_merged;
gboolean sample_average;
gdouble average_radius;
GimpRGB color;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
x = args[2].value.pdb_float;
y = args[3].value.pdb_float;
sample_merged = args[4].value.pdb_int ? TRUE : FALSE;
sample_average = args[5].value.pdb_int ? TRUE : FALSE;
average_radius = args[6].value.pdb_float;
if (sample_average && (average_radius <= 0.0))
success = FALSE;
if (success)
{
if (!sample_merged)
if (!drawable || (gimp_item_get_image (GIMP_ITEM (drawable)) != gimage))
success = FALSE;
if (success)
success = gimp_image_pick_color (gimage,
drawable,
(gint) x, (gint) y,
sample_merged,
sample_average,
average_radius,
NULL,
&color,
NULL);
}
return_args = procedural_db_return_args (&image_pick_color_proc, success);
if (success)
return_args[1].value.pdb_color = color;
return return_args;
}
static ProcArg image_pick_color_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_DRAWABLE,
"drawable",
"The drawable to pick from"
},
{
GIMP_PDB_FLOAT,
"x",
"x coordinate of upper-left corner of rectangle"
},
{
GIMP_PDB_FLOAT,
"y",
"y coordinate of upper-left corner of rectangle"
},
{
GIMP_PDB_INT32,
"sample_merged",
"Use the composite image, not the drawable"
},
{
GIMP_PDB_INT32,
"sample_average",
"Average the color of all the pixels in a specified radius"
},
{
GIMP_PDB_FLOAT,
"average_radius",
"The radius of pixels to average"
}
};
static ProcArg image_pick_color_outargs[] =
{
{
GIMP_PDB_COLOR,
"color",
"The return color"
}
};
static ProcRecord image_pick_color_proc =
{
"gimp_image_pick_color",
"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 except for finding the image it belongs to.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
7,
image_pick_color_inargs,
1,
image_pick_color_outargs,
{ { image_pick_color_invoker } }
};
static Argument *
image_pick_correlate_layer_invoker (Gimp *gimp,
Argument *args)

View file

@ -51,7 +51,6 @@ void register_image_procs (Gimp *gimp);
void register_layer_procs (Gimp *gimp);
void register_message_procs (Gimp *gimp);
void register_misc_procs (Gimp *gimp);
void register_misc_tools_procs (Gimp *gimp);
void register_paint_tools_procs (Gimp *gimp);
void register_palette_procs (Gimp *gimp);
void register_palette_select_procs (Gimp *gimp);
@ -102,48 +101,45 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Edit procedures"), 0.216);
register_edit_procs (gimp);
(* status_callback) (NULL, _("File Operations"), 0.233);
(* status_callback) (NULL, _("File Operations"), 0.239);
register_fileops_procs (gimp);
(* status_callback) (NULL, _("Floating selections"), 0.256);
(* status_callback) (NULL, _("Floating selections"), 0.262);
register_floating_sel_procs (gimp);
(* status_callback) (NULL, _("Font UI"), 0.274);
(* status_callback) (NULL, _("Font UI"), 0.28);
register_font_select_procs (gimp);
(* status_callback) (NULL, _("Fonts"), 0.282);
(* status_callback) (NULL, _("Fonts"), 0.288);
register_fonts_procs (gimp);
(* status_callback) (NULL, _("Gimprc procedures"), 0.288);
(* status_callback) (NULL, _("Gimprc procedures"), 0.294);
register_gimprc_procs (gimp);
(* status_callback) (NULL, _("Gradient UI"), 0.305);
(* status_callback) (NULL, _("Gradient UI"), 0.311);
register_gradient_select_procs (gimp);
(* status_callback) (NULL, _("Gradients"), 0.314);
(* status_callback) (NULL, _("Gradients"), 0.32);
register_gradients_procs (gimp);
(* status_callback) (NULL, _("Guide procedures"), 0.334);
(* status_callback) (NULL, _("Guide procedures"), 0.34);
register_guides_procs (gimp);
(* status_callback) (NULL, _("Help procedures"), 0.352);
(* status_callback) (NULL, _("Help procedures"), 0.357);
register_help_procs (gimp);
(* status_callback) (NULL, _("Image"), 0.354);
(* status_callback) (NULL, _("Image"), 0.36);
register_image_procs (gimp);
(* status_callback) (NULL, _("Layer"), 0.527);
(* status_callback) (NULL, _("Layer"), 0.536);
register_layer_procs (gimp);
(* status_callback) (NULL, _("Message procedures"), 0.602);
(* status_callback) (NULL, _("Message procedures"), 0.611);
register_message_procs (gimp);
(* status_callback) (NULL, _("Miscellaneous"), 0.611);
(* status_callback) (NULL, _("Miscellaneous"), 0.62);
register_misc_procs (gimp);
(* status_callback) (NULL, _("Misc Tool procedures"), 0.617);
register_misc_tools_procs (gimp);
(* status_callback) (NULL, _("Paint Tool procedures"), 0.625);
register_paint_tools_procs (gimp);

View file

@ -32,22 +32,17 @@
#include "core/gimpdrawable-blend.h"
#include "core/gimpdrawable-bucket-fill.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage-pick-color.h"
#include "core/gimpimage.h"
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
static ProcRecord blend_proc;
static ProcRecord bucket_fill_proc;
static ProcRecord color_picker_proc;
void
register_misc_tools_procs (Gimp *gimp)
{
procedural_db_register (gimp, &blend_proc);
procedural_db_register (gimp, &bucket_fill_proc);
procedural_db_register (gimp, &color_picker_proc);
}
static Argument *
@ -370,126 +365,3 @@ static ProcRecord bucket_fill_proc =
NULL,
{ { bucket_fill_invoker } }
};
static Argument *
color_picker_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpImage *gimage;
GimpDrawable *drawable;
gdouble x;
gdouble y;
gboolean sample_merged;
gboolean sample_average;
gdouble average_radius;
GimpRGB color;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
x = args[2].value.pdb_float;
y = args[3].value.pdb_float;
sample_merged = args[4].value.pdb_int ? TRUE : FALSE;
sample_average = args[5].value.pdb_int ? TRUE : FALSE;
average_radius = args[6].value.pdb_float;
if (sample_average && (average_radius <= 0.0))
success = FALSE;
if (success)
{
if (!sample_merged)
if (!drawable || (gimp_item_get_image (GIMP_ITEM (drawable)) != gimage))
success = FALSE;
if (success)
success = gimp_image_pick_color (gimage,
drawable,
(gint) x, (gint) y,
sample_merged,
sample_average,
average_radius,
NULL,
&color,
NULL);
}
return_args = procedural_db_return_args (&color_picker_proc, success);
if (success)
return_args[1].value.pdb_color = color;
return return_args;
}
static ProcArg color_picker_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_DRAWABLE,
"drawable",
"The affected drawable"
},
{
GIMP_PDB_FLOAT,
"x",
"x coordinate of upper-left corner of rectangle"
},
{
GIMP_PDB_FLOAT,
"y",
"y coordinate of upper-left corner of rectangle"
},
{
GIMP_PDB_INT32,
"sample_merged",
"Use the composite image, not the drawable"
},
{
GIMP_PDB_INT32,
"sample_average",
"Average the color of all the pixels in a specified radius"
},
{
GIMP_PDB_FLOAT,
"average_radius",
"The radius of pixels to average"
}
};
static ProcArg color_picker_outargs[] =
{
{
GIMP_PDB_COLOR,
"color",
"The return color"
}
};
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 except for finding the image it belongs to.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
7,
color_picker_inargs,
1,
color_picker_outargs,
{ { color_picker_invoker } }
};

View file

@ -118,7 +118,9 @@ procedural_db_init_procs (Gimp *gimp,
}
compat_procs[] =
{
{ "gimp_blend", "gimp_edit_blend" },
{ "gimp_brushes_list", "gimp_brushes_get_list" },
{ "gimp_bucket_fill", "gimp_edit_bucket_fill" },
{ "gimp_channel_delete", "gimp_drawable_delete" },
{ "gimp_channel_get_name", "gimp_drawable_get_name" },
{ "gimp_channel_get_tattoo", "gimp_drawable_get_tattoo" },
@ -126,6 +128,7 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_channel_set_name", "gimp_drawable_set_name" },
{ "gimp_channel_set_tattoo", "gimp_drawable_set_tattoo" },
{ "gimp_channel_set_visible", "gimp_drawable_set_visible" },
{ "gimp_color_picker", "gimp_image_pick_color" },
{ "gimp_convert_grayscale", "gimp_image_convert_grayscale" },
{ "gimp_convert_indexed", "gimp_image_convert_indexed" },
{ "gimp_convert_rgb", "gimp_image_convert_rgb" },

View file

@ -1,3 +1,12 @@
2004-01-05 Michael Natterer <mitch@gimp.org>
* libgimp/libgimp-sections.txt: moved color_picker, blend and
bucket_fill to their new places.
* libgimp/tmpl/gimpedit.sgml
* libgimp/tmpl/gimpimage.sgml
* libgimp/tmpl/gimptools.sgml: regenerated.
2003-12-20 Sven Neumann <sven@gimp.org>
* app/app-docs.sgml

View file

@ -221,6 +221,8 @@ gimp_edit_copy
gimp_edit_paste
gimp_edit_clear
gimp_edit_fill
gimp_edit_bucket_fill
gimp_edit_blend
gimp_edit_stroke
</SECTION>
@ -327,6 +329,7 @@ gimp_image_get_active_drawable
gimp_image_unset_active_channel
gimp_image_get_floating_sel
gimp_image_floating_sel_attached_to
gimp_image_pick_color
gimp_image_pick_correlate_layer
gimp_image_add_layer
gimp_image_remove_layer
@ -554,12 +557,9 @@ gimp_tile_cache_ntiles
<FILE>gimptools</FILE>
gimp_airbrush
gimp_airbrush_default
gimp_blend
gimp_bucket_fill
gimp_by_color_select
gimp_clone
gimp_clone_default
gimp_color_picker
gimp_convolve
gimp_convolve_default
gimp_dodgeburn

View file

@ -62,6 +62,46 @@ Edit menu functions (cut, copy, paste, clear, etc.)
@Returns:
<!-- ##### FUNCTION gimp_edit_bucket_fill ##### -->
<para>
</para>
@drawable_ID:
@fill_mode:
@paint_mode:
@opacity:
@threshold:
@sample_merged:
@x:
@y:
@Returns:
<!-- ##### FUNCTION gimp_edit_blend ##### -->
<para>
</para>
@drawable_ID:
@blend_mode:
@paint_mode:
@gradient_type:
@opacity:
@offset:
@repeat:
@reverse:
@supersample:
@max_depth:
@threshold:
@dither:
@x1:
@y1:
@x2:
@y2:
@Returns:
<!-- ##### FUNCTION gimp_edit_stroke ##### -->
<para>

View file

@ -203,6 +203,22 @@ and operations involving multiple layers.
@Returns:
<!-- ##### FUNCTION gimp_image_pick_color ##### -->
<para>
</para>
@image_ID:
@drawable_ID:
@x:
@y:
@sample_merged:
@sample_average:
@average_radius:
@color:
@Returns:
<!-- ##### FUNCTION gimp_image_pick_correlate_layer ##### -->
<para>

View file

@ -38,46 +38,6 @@ Functions giving access to common toolbox tools.
@Returns:
<!-- ##### FUNCTION gimp_blend ##### -->
<para>
</para>
@drawable_ID:
@blend_mode:
@paint_mode:
@gradient_type:
@opacity:
@offset:
@repeat:
@reverse:
@supersample:
@max_depth:
@threshold:
@dither:
@x1:
@y1:
@x2:
@y2:
@Returns:
<!-- ##### FUNCTION gimp_bucket_fill ##### -->
<para>
</para>
@drawable_ID:
@fill_mode:
@paint_mode:
@opacity:
@threshold:
@sample_merged:
@x:
@y:
@Returns:
<!-- ##### FUNCTION gimp_by_color_select ##### -->
<para>
@ -120,22 +80,6 @@ Functions giving access to common toolbox tools.
@Returns:
<!-- ##### FUNCTION gimp_color_picker ##### -->
<para>
</para>
@image_ID:
@drawable_ID:
@x:
@y:
@sample_merged:
@sample_average:
@average_radius:
@color:
@Returns:
<!-- ##### FUNCTION gimp_convolve ##### -->
<para>

View file

@ -95,7 +95,6 @@ PDB_WRAPPERS_C = \
gimplayer_pdb.c \
gimpmessage_pdb.c \
gimpmisc_pdb.c \
gimpmisctools_pdb.c \
gimppainttools_pdb.c \
gimppalette_pdb.c \
gimppalettes_pdb.c \
@ -136,7 +135,6 @@ PDB_WRAPPERS_H = \
gimplayer_pdb.h \
gimpmessage_pdb.h \
gimpmisc_pdb.h \
gimpmisctools_pdb.h \
gimppainttools_pdb.h \
gimppalette_pdb.h \
gimppalettes_pdb.h \

View file

@ -45,7 +45,6 @@
#include <libgimp/gimplayer_pdb.h>
#include <libgimp/gimpmessage_pdb.h>
#include <libgimp/gimpmisc_pdb.h>
#include <libgimp/gimpmisctools_pdb.h>
#include <libgimp/gimppainttools_pdb.h>
#include <libgimp/gimppalette_pdb.h>
#include <libgimp/gimppalettes_pdb.h>

View file

@ -42,6 +42,9 @@ G_BEGIN_DECLS
#define gimp_use_xshm TRUE
#define gimp_color_cube ((guchar *) { 6, 6, 4, 24 })
#define gimp_blend gimp_edit_blend
#define gimp_bucket_fill gimp_edit_bucket_fill
#define gimp_color_picker gimp_image_pick_color
#define gimp_convert_rgb gimp_image_convert_rgb
#define gimp_convert_grayscale gimp_image_convert_grayscale
#define gimp_convert_indexed gimp_image_convert_indexed

View file

@ -211,6 +211,146 @@ gimp_edit_fill (gint32 drawable_ID,
return success;
}
/**
* gimp_edit_bucket_fill:
* @drawable_ID: The affected drawable.
* @fill_mode: The type of fill.
* @paint_mode: The paint application mode.
* @opacity: The opacity of the final bucket fill.
* @threshold: The threshold determines how extensive the seed fill will be. It's value is specified in terms of intensity levels . This parameter is only valid when there is no selection in the specified image.
* @sample_merged: Use the composite image, not the drawable.
* @x: The x coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.
* @y: The y coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.
*
* 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 and y
* coordinates are relative to the image's origin; otherwise, they are
* relative to the drawable's origin.
*
* Returns: TRUE on success.
*/
gboolean
gimp_edit_bucket_fill (gint32 drawable_ID,
GimpBucketFillMode fill_mode,
GimpLayerModeEffects paint_mode,
gdouble opacity,
gdouble threshold,
gboolean sample_merged,
gdouble x,
gdouble y)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_edit_bucket_fill",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, fill_mode,
GIMP_PDB_INT32, paint_mode,
GIMP_PDB_FLOAT, opacity,
GIMP_PDB_FLOAT, threshold,
GIMP_PDB_INT32, sample_merged,
GIMP_PDB_FLOAT, x,
GIMP_PDB_FLOAT, y,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_edit_blend:
* @drawable_ID: The affected drawable.
* @blend_mode: The type of blend.
* @paint_mode: The paint application mode.
* @gradient_type: The type of gradient.
* @opacity: The opacity of the final blend.
* @offset: Offset relates to the starting and ending coordinates specified for the blend. This parameter is mode dependent.
* @repeat: Repeat mode.
* @reverse: Use the reverse gradient.
* @supersample: Do adaptive supersampling.
* @max_depth: Maximum recursion levels for supersampling.
* @threshold: Supersampling threshold.
* @dither: Use dithering to reduce banding.
* @x1: The x coordinate of this blend's starting point.
* @y1: The y coordinate of this blend's starting point.
* @x2: The x coordinate of this blend's ending point.
* @y2: The y coordinate of this blend's ending point.
*
* Blend between the starting and ending coordinates with the specified
* blend mode and gradient type.
*
* This tool requires information on the paint application mode, the
* blend mode, and the gradient type. It creates the specified variety
* of blend using the starting and ending coordinates as defined for
* each gradient type.
*
* Returns: TRUE on success.
*/
gboolean
gimp_edit_blend (gint32 drawable_ID,
GimpBlendMode blend_mode,
GimpLayerModeEffects paint_mode,
GimpGradientType gradient_type,
gdouble opacity,
gdouble offset,
GimpRepeatMode repeat,
gboolean reverse,
gboolean supersample,
gint max_depth,
gdouble threshold,
gboolean dither,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_edit_blend",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, blend_mode,
GIMP_PDB_INT32, paint_mode,
GIMP_PDB_INT32, gradient_type,
GIMP_PDB_FLOAT, opacity,
GIMP_PDB_FLOAT, offset,
GIMP_PDB_INT32, repeat,
GIMP_PDB_INT32, reverse,
GIMP_PDB_INT32, supersample,
GIMP_PDB_INT32, max_depth,
GIMP_PDB_FLOAT, threshold,
GIMP_PDB_INT32, dither,
GIMP_PDB_FLOAT, x1,
GIMP_PDB_FLOAT, y1,
GIMP_PDB_FLOAT, x2,
GIMP_PDB_FLOAT, y2,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_edit_stroke:
* @drawable_ID: The drawable to stroke to.

View file

@ -29,14 +29,38 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_edit_cut (gint32 drawable_ID);
gboolean gimp_edit_copy (gint32 drawable_ID);
gint32 gimp_edit_paste (gint32 drawable_ID,
gboolean paste_into);
gboolean gimp_edit_clear (gint32 drawable_ID);
gboolean gimp_edit_fill (gint32 drawable_ID,
GimpFillType fill_type);
gboolean gimp_edit_stroke (gint32 drawable_ID);
gboolean gimp_edit_cut (gint32 drawable_ID);
gboolean gimp_edit_copy (gint32 drawable_ID);
gint32 gimp_edit_paste (gint32 drawable_ID,
gboolean paste_into);
gboolean gimp_edit_clear (gint32 drawable_ID);
gboolean gimp_edit_fill (gint32 drawable_ID,
GimpFillType fill_type);
gboolean gimp_edit_bucket_fill (gint32 drawable_ID,
GimpBucketFillMode fill_mode,
GimpLayerModeEffects paint_mode,
gdouble opacity,
gdouble threshold,
gboolean sample_merged,
gdouble x,
gdouble y);
gboolean gimp_edit_blend (gint32 drawable_ID,
GimpBlendMode blend_mode,
GimpLayerModeEffects paint_mode,
GimpGradientType gradient_type,
gdouble opacity,
gdouble offset,
GimpRepeatMode repeat,
gboolean reverse,
gboolean supersample,
gint max_depth,
gdouble threshold,
gboolean dither,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2);
gboolean gimp_edit_stroke (gint32 drawable_ID);
G_END_DECLS

View file

@ -705,6 +705,69 @@ gimp_image_floating_sel_attached_to (gint32 image_ID)
return drawable_ID;
}
/**
* gimp_image_pick_color:
* @image_ID: The image.
* @drawable_ID: The drawable to pick from.
* @x: x coordinate of upper-left corner of rectangle.
* @y: y coordinate of upper-left corner of rectangle.
* @sample_merged: Use the composite image, not the drawable.
* @sample_average: Average the color of all the pixels in a specified radius.
* @average_radius: The radius of pixels to average.
* @color: The return color.
*
* 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 except for
* finding the image it belongs to.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_pick_color (gint32 image_ID,
gint32 drawable_ID,
gdouble x,
gdouble y,
gboolean sample_merged,
gboolean sample_average,
gdouble average_radius,
GimpRGB *color)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_image_pick_color",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_FLOAT, x,
GIMP_PDB_FLOAT, y,
GIMP_PDB_INT32, sample_merged,
GIMP_PDB_INT32, sample_average,
GIMP_PDB_FLOAT, average_radius,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
if (success)
*color = return_vals[1].data.d_color;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_pick_correlate_layer:
* @image_ID: The image.

View file

@ -64,6 +64,14 @@ gint32 gimp_image_get_active_drawable (gint32 ima
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);
gboolean gimp_image_pick_color (gint32 image_ID,
gint32 drawable_ID,
gdouble x,
gdouble y,
gboolean sample_merged,
gboolean sample_average,
gdouble average_radius,
GimpRGB *color);
gint32 gimp_image_pick_correlate_layer (gint32 image_ID,
gint x,
gint y);

View file

@ -1,229 +0,0 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
*
* gimpmisctools_pdb.c
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* NOTE: This file is autogenerated by pdbgen.pl */
#include "config.h"
#include "gimp.h"
/**
* gimp_blend:
* @drawable_ID: The affected drawable.
* @blend_mode: The type of blend.
* @paint_mode: The paint application mode.
* @gradient_type: The type of gradient.
* @opacity: The opacity of the final blend.
* @offset: Offset relates to the starting and ending coordinates specified for the blend. This parameter is mode dependent.
* @repeat: Repeat mode.
* @reverse: Use the reverse gradient.
* @supersample: Do adaptive supersampling.
* @max_depth: Maximum recursion levels for supersampling.
* @threshold: Supersampling threshold.
* @dither: Use dithering to reduce banding.
* @x1: The x coordinate of this blend's starting point.
* @y1: The y coordinate of this blend's starting point.
* @x2: The x coordinate of this blend's ending point.
* @y2: The y coordinate of this blend's ending point.
*
* Blend between the starting and ending coordinates with the specified
* blend mode and gradient type.
*
* This tool requires information on the paint application mode, the
* blend mode, and the gradient type. It creates the specified variety
* of blend using the starting and ending coordinates as defined for
* each gradient type.
*
* Returns: TRUE on success.
*/
gboolean
gimp_blend (gint32 drawable_ID,
GimpBlendMode blend_mode,
GimpLayerModeEffects paint_mode,
GimpGradientType gradient_type,
gdouble opacity,
gdouble offset,
GimpRepeatMode repeat,
gboolean reverse,
gboolean supersample,
gint max_depth,
gdouble threshold,
gboolean dither,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_blend",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, blend_mode,
GIMP_PDB_INT32, paint_mode,
GIMP_PDB_INT32, gradient_type,
GIMP_PDB_FLOAT, opacity,
GIMP_PDB_FLOAT, offset,
GIMP_PDB_INT32, repeat,
GIMP_PDB_INT32, reverse,
GIMP_PDB_INT32, supersample,
GIMP_PDB_INT32, max_depth,
GIMP_PDB_FLOAT, threshold,
GIMP_PDB_INT32, dither,
GIMP_PDB_FLOAT, x1,
GIMP_PDB_FLOAT, y1,
GIMP_PDB_FLOAT, x2,
GIMP_PDB_FLOAT, y2,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_bucket_fill:
* @drawable_ID: The affected drawable.
* @fill_mode: The type of fill.
* @paint_mode: The paint application mode.
* @opacity: The opacity of the final bucket fill.
* @threshold: The threshold determines how extensive the seed fill will be. It's value is specified in terms of intensity levels . This parameter is only valid when there is no selection in the specified image.
* @sample_merged: Use the composite image, not the drawable.
* @x: The x coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.
* @y: The y coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.
*
* 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 and y
* coordinates are relative to the image's origin; otherwise, they are
* relative to the drawable's origin.
*
* Returns: TRUE on success.
*/
gboolean
gimp_bucket_fill (gint32 drawable_ID,
GimpBucketFillMode fill_mode,
GimpLayerModeEffects paint_mode,
gdouble opacity,
gdouble threshold,
gboolean sample_merged,
gdouble x,
gdouble y)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_bucket_fill",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, fill_mode,
GIMP_PDB_INT32, paint_mode,
GIMP_PDB_FLOAT, opacity,
GIMP_PDB_FLOAT, threshold,
GIMP_PDB_INT32, sample_merged,
GIMP_PDB_FLOAT, x,
GIMP_PDB_FLOAT, y,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_color_picker:
* @image_ID: The image.
* @drawable_ID: The affected drawable.
* @x: x coordinate of upper-left corner of rectangle.
* @y: y coordinate of upper-left corner of rectangle.
* @sample_merged: Use the composite image, not the drawable.
* @sample_average: Average the color of all the pixels in a specified radius.
* @average_radius: The radius of pixels to average.
* @color: The return color.
*
* 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 except for
* finding the image it belongs to.
*
* Returns: TRUE on success.
*/
gboolean
gimp_color_picker (gint32 image_ID,
gint32 drawable_ID,
gdouble x,
gdouble y,
gboolean sample_merged,
gboolean sample_average,
gdouble average_radius,
GimpRGB *color)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_color_picker",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_FLOAT, x,
GIMP_PDB_FLOAT, y,
GIMP_PDB_INT32, sample_merged,
GIMP_PDB_INT32, sample_average,
GIMP_PDB_FLOAT, average_radius,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
if (success)
*color = return_vals[1].data.d_color;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}

View file

@ -1,68 +0,0 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
*
* gimpmisctools_pdb.h
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* NOTE: This file is autogenerated by pdbgen.pl */
#ifndef __GIMP_MISC_TOOLS_PDB_H__
#define __GIMP_MISC_TOOLS_PDB_H__
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_blend (gint32 drawable_ID,
GimpBlendMode blend_mode,
GimpLayerModeEffects paint_mode,
GimpGradientType gradient_type,
gdouble opacity,
gdouble offset,
GimpRepeatMode repeat,
gboolean reverse,
gboolean supersample,
gint max_depth,
gdouble threshold,
gboolean dither,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2);
gboolean gimp_bucket_fill (gint32 drawable_ID,
GimpBucketFillMode fill_mode,
GimpLayerModeEffects paint_mode,
gdouble opacity,
gdouble threshold,
gboolean sample_merged,
gdouble x,
gdouble y);
gboolean gimp_color_picker (gint32 image_ID,
gint32 drawable_ID,
gdouble x,
gdouble y,
gboolean sample_merged,
gboolean sample_average,
gdouble average_radius,
GimpRGB *color);
G_END_DECLS
#endif /* __GIMP_MISC_TOOLS_PDB_H__ */

View file

@ -3525,14 +3525,14 @@ paint_layer_new (gchar *new_name)
static void
paint_layer_fill (void)
{
gimp_bucket_fill (gfig_drawable,
selopt.fill_type, /* Fill mode */
GIMP_NORMAL_MODE,
selopt.fill_opacity, /* Fill opacity */
0.0, /* threshold - ignored */
FALSE, /* Sample merged - ignored */
0.0, /* x - ignored */
0.0); /* y - ignored */
gimp_edit_bucket_fill (gfig_drawable,
selopt.fill_type, /* Fill mode */
GIMP_NORMAL_MODE,
selopt.fill_opacity, /* Fill opacity */
0.0, /* threshold - ignored */
FALSE, /* Sample merged - ignored */
0.0, /* x - ignored */
0.0); /* y - ignored */
}
static void

View file

@ -101,10 +101,10 @@
(center-ellipse temp-img (* size 2) (* size 2) inner-radius inner-radius
SUB TRUE FALSE 0)
(gimp-blend temp-draw FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
supersample 3 .2 TRUE
size size (* size 2) (/ size 2))
(gimp-edit-blend temp-draw FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
supersample 3 .2 TRUE
size size (* size 2) (/ size 2))
(center-ellipse temp-img size (* size 2) outer-radius outer-radius
REPLACE TRUE FALSE 0)
@ -118,10 +118,10 @@
;(gimp-edit-fill temp-img temp-draw2 BACKGROUND-FILL)
(gimp-blend temp-draw2 FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
supersample 3 .2 TRUE
size size (* size 2) (* size 2))
(gimp-edit-blend temp-draw2 FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
supersample 3 .2 TRUE
size size (* size 2) (* size 2))
(gimp-selection-none temp-img)

View file

@ -108,10 +108,10 @@
(gimp-palette-set-foreground '(103 103 103))
(gimp-palette-set-background '(0 0 0))
(gimp-blend ruler-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 size size)
(gimp-edit-blend ruler-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 size size)
(gimp-selection-grow img grow-amount)
(gimp-palette-set-foreground glow-color)

View file

@ -54,10 +54,10 @@
(gimp-palette-set-foreground '(79 79 79))
(gimp-palette-set-background '(0 0 0))
(gimp-blend ruler-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 height height)
(gimp-edit-blend ruler-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 height height)
(gimp-palette-set-foreground glow-color)
(gimp-selection-grow img border)

View file

@ -70,11 +70,11 @@
(gimp-palette-set-foreground '(90 90 90))
(gimp-palette-set-background '(0 0 0))
(gimp-blend bullet-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-RADIAL 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
blend-start blend-start
(+ half-radius radius) (+ half-radius radius))
(gimp-edit-blend bullet-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-RADIAL 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
blend-start blend-start
(+ half-radius radius) (+ half-radius radius))
(gimp-palette-set-foreground glow-color)
(gimp-selection-grow img border)

View file

@ -41,10 +41,10 @@
y1
x2
y2)
(gimp-blend drawable FG-BG-RGB-MODE DARKEN-ONLY
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
x1 y1 x2 y2))
(gimp-edit-blend drawable FG-BG-RGB-MODE DARKEN-ONLY
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
x1 y1 x2 y2))
(define (script-fu-alien-glow-button text
font
@ -102,10 +102,10 @@
(gimp-palette-set-foreground '(100 100 100))
(gimp-palette-set-background '(0 0 0))
(gimp-blend button-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 img-height img-width)
(gimp-edit-blend button-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 img-height img-width)
(gimp-edit-clear glow-layer)

View file

@ -37,10 +37,10 @@
(gimp-palette-set-background '(0 0 0))
(gimp-palette-set-foreground '(79 79 79))
(gimp-blend logo-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 1 1)
(gimp-edit-blend logo-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 1 1)
(gimp-palette-set-background old-bg)
(gimp-palette-set-foreground old-fg)))

View file

@ -29,10 +29,10 @@
(gimp-selection-none img)
(gimp-palette-set-foreground '(255 255 255))
(gimp-blend logo-layer FG-BG-RGB-MODE MULTIPLY-MODE
GRADIENT-RADIAL 100 20 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 width height)
(gimp-edit-blend logo-layer FG-BG-RGB-MODE MULTIPLY-MODE
GRADIENT-RADIAL 100 20 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 width height)
(gimp-layer-translate shadow-layer 3 3)
(gimp-palette-set-background old-bg)

View file

@ -46,10 +46,10 @@
(gimp-selection-none img)
(gimp-palette-set-foreground '(255 255 255))
(gimp-blend logo-layer FG-BG-RGB-MODE MULTIPLY-MODE
GRADIENT-RADIAL 100 20 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 width height)
(gimp-edit-blend logo-layer FG-BG-RGB-MODE MULTIPLY-MODE
GRADIENT-RADIAL 100 20 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 width height)
(gimp-layer-translate shadow-layer 3 3)
(gimp-layer-translate highlight-layer (- posx 2) (- posy 2))

View file

@ -44,10 +44,10 @@
y1
x2
y2)
(gimp-blend drawable FG-BG-RGB-MODE DARKEN-ONLY
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
x1 y1 x2 y2))
(gimp-edit-blend drawable FG-BG-RGB-MODE DARKEN-ONLY
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
x1 y1 x2 y2))
(define (script-fu-button00 text
size
@ -111,10 +111,10 @@
(gimp-palette-set-foreground ul-color)
(gimp-palette-set-background lr-color)
(gimp-blend gradient FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 (- img-width 1) (- img-height 1))
(gimp-edit-blend gradient FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 (- img-width 1) (- img-height 1))
(plug-in-bump-map 1 img gradient bumpmap
135 45 bevel-width 0 0 0 0 TRUE pressed 0)

View file

@ -69,20 +69,20 @@
(gimp-edit-fill text-shadow-layer BACKGROUND-FILL)
(gimp-palette-set-foreground '(255 255 255))
(gimp-blend text-shadow-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 1 1)
(gimp-edit-blend text-shadow-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 1 1)
(gimp-selection-none img)
(gimp-palette-set-foreground blend-fg)
(gimp-palette-set-background blend-bg)
(gimp-gradients-set-gradient blend-gradient)
(gimp-blend blend-layer blend-mode NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE blend-gradient-reverse
FALSE 0 0 TRUE
0 0 width 0)
(gimp-edit-blend blend-layer blend-mode NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE blend-gradient-reverse
FALSE 0 0 TRUE
0 0 width 0)
(gimp-layer-translate logo-layer (- b-size-2) (- b-size-2))
(gimp-layer-translate blend-layer (- b-size) (- b-size))

View file

@ -93,10 +93,10 @@
(if (= fadeout TRUE)
(begin
; blend with 20% offset to get less transparency in the front
(gimp-blend bl-mask FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-LINEAR 100 20 REPEAT-NONE FALSE
FALSE 0 0 TRUE
(+ bl-x-off bl-width) 0 bl-x-off 0)))
(gimp-edit-blend bl-mask FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-LINEAR 100 20 REPEAT-NONE FALSE
FALSE 0 0 TRUE
(+ bl-x-off bl-width) 0 bl-x-off 0)))
(if (= fadeout FALSE)
(begin
@ -115,11 +115,11 @@
;--- blend glow color inside the letters
(gimp-palette-set-foreground glow-color)
(gimp-blend bl-layer FG-TRANSPARENT-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
(+ bl-x-off bl-width) 0
(- (+ bl-x-off bl-width) after-glow) 0)
(gimp-edit-blend bl-layer FG-TRANSPARENT-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
(+ bl-x-off bl-width) 0
(- (+ bl-x-off bl-width) after-glow) 0)
;--- add corona effect
(gimp-selection-layer-alpha bl-layer)
@ -128,11 +128,11 @@
(gimp-layer-set-preserve-trans bl-layer FALSE)
(gimp-selection-feather img corona-width)
(gimp-palette-set-foreground glow-color)
(gimp-blend bl-layer FG-TRANSPARENT-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
(- (+ bl-x-off bl-width) corona-width) 0
(- (+ bl-x-off bl-width) after-glow) 0))
(gimp-edit-blend bl-layer FG-TRANSPARENT-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
(- (+ bl-x-off bl-width) corona-width) 0
(- (+ bl-x-off bl-width) after-glow) 0))
;--- merge with bg layer
(set! bg-layer (car (gimp-layer-copy bg-source-layer FALSE)))

View file

@ -53,10 +53,10 @@
(gimp-gradients-set-gradient "Coffee")
(gimp-blend theStain CUSTOM-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-DIMPLED 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 0 0)
(gimp-edit-blend theStain CUSTOM-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-DIMPLED 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 0 0)
(gimp-layer-set-offsets theStain
(- (rand theWidth) (/ theSize 2))

View file

@ -75,10 +75,10 @@
(gimp-layer-set-preserve-trans logo-layer TRUE)
(gimp-selection-all img)
(gimp-blend logo-layer CUSTOM-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE gradient-reverse
FALSE 0 0 TRUE
0 (* height 0.33333) 0 (* height 0.83333))
(gimp-edit-blend logo-layer CUSTOM-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE gradient-reverse
FALSE 0 0 TRUE
0 (* height 0.33333) 0 (* height 0.83333))
(plug-in-noisify 1 img logo-layer 0 0.20 0.20 0.20 0.20)
(gimp-selection-none img)

View file

@ -47,10 +47,10 @@
(gimp-gradients-set-gradient gradient)
(gimp-blend logo-layer CUSTOM-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE gradient-reverse
FALSE 0 0 TRUE
0 0 0 (+ height 5))
(gimp-edit-blend logo-layer CUSTOM-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE gradient-reverse
FALSE 0 0 TRUE
0 0 0 (+ height 5))
(gimp-rect-select img 0 (- (/ height 2) feather) img-width (* 2 feather) REPLACE 0 0)
(plug-in-gauss-iir 1 img logo-layer smear TRUE TRUE)
@ -95,10 +95,10 @@
(gimp-layer-add-mask reflect-layer layer-mask)
(gimp-palette-set-foreground '(255 255 255))
(gimp-palette-set-background '(0 0 0))
(gimp-blend layer-mask FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 (- (/ height 2)) 0 height)
(gimp-edit-blend layer-mask FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 (- (/ height 2)) 0 height)
(gimp-image-remove-channel img channel)

View file

@ -80,10 +80,11 @@
(begin
(gimp-gradients-set-gradient blend-gradient-text)
(gimp-blend logo-layer CUSTOM-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE blend-gradient-text-reverse
FALSE 0 0 TRUE
0 0 0 (+ height 5))))
(gimp-edit-blend logo-layer CUSTOM-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE
blend-gradient-text-reverse
FALSE 0 0 TRUE
0 0 0 (+ height 5))))
(gimp-selection-none img)
@ -105,10 +106,11 @@
(begin
(gimp-gradients-set-gradient blend-gradient-outline)
(gimp-blend grow-me CUSTOM-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE blend-gradient-outline-reverse
FALSE 0 0 TRUE
0 0 0 (+ height 5))))
(gimp-edit-blend grow-me CUSTOM-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE
blend-gradient-outline-reverse
FALSE 0 0 TRUE
0 0 0 (+ height 5))))
(gimp-selection-none img)

View file

@ -59,10 +59,10 @@
(gimp-layer-set-preserve-trans logo-layer TRUE)
(gimp-selection-all img)
(gimp-blend logo-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-RADIAL 95 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
indentX indentY indentX (- height indentY))
(gimp-edit-blend logo-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-RADIAL 95 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
indentX indentY indentX (- height indentY))
(gimp-selection-none img)
(gimp-layer-set-preserve-trans logo-layer FALSE)

View file

@ -47,10 +47,10 @@
; Render gradient
(gimp-blend drawable CUSTOM-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE gradient-reverse
FALSE 0 0 TRUE
0 0 (- width 1) 0)
(gimp-edit-blend drawable CUSTOM-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE gradient-reverse
FALSE 0 0 TRUE
0 0 (- width 1) 0)
; Terminate

View file

@ -280,10 +280,10 @@
(gimp-brushes-set-opacity 70)
(gimp-display-new gimg)
(while (< index limit)
(set! rgb (car (gimp-color-picker img drawable
(+ beg-x (* x-len (/ index limit)))
(+ beg-y (* y-len (/ index limit)))
TRUE FALSE 0)))
(set! rgb (car (gimp-image-pick-color img drawable
(+ beg-x (* x-len (/ index limit)))
(+ beg-y (* y-len (/ index limit)))
TRUE FALSE 0)))
(fill-color-band gimg clayer index scale x-base 40 rgb)
(rgb-to-hsv rgb hsv)
(plot-hsv gimg hsv-layer index scale x-base y-base hsv)

View file

@ -140,10 +140,10 @@
(gimp-palette-set-foreground ul-color)
(gimp-palette-set-background lr-color)
(gimp-blend gradient FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 0 (- height 1))
(gimp-edit-blend gradient FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 0 (- height 1))
(gimp-selection-none img)

View file

@ -56,10 +56,10 @@
(let ((theMask (car (gimp-layer-create-mask thinLayer 0))))
(gimp-layer-add-mask thinLayer theMask)
(gimp-blend theMask FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-TRIANGULAR FALSE
FALSE 0 0 TRUE
0 0 0 (/ theHeight 2)))
(gimp-edit-blend theMask FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-TRIANGULAR FALSE
FALSE 0 0 TRUE
0 0 0 (/ theHeight 2)))
(set! theLayer (car(gimp-image-flatten theImage)))))

View file

@ -53,10 +53,10 @@
(gimp-ellipse-select img (- cx radius) (- cy radius)
(* 2 radius) (* 2 radius) REPLACE TRUE FALSE 0)
(gimp-blend drawable FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-RADIAL 100 offset REPEAT-NONE FALSE
FALSE 0 0 TRUE
light-x light-y light-end-x light-end-y)
(gimp-edit-blend drawable FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-RADIAL 100 offset REPEAT-NONE FALSE
FALSE 0 0 TRUE
light-x light-y light-end-x light-end-y)
(gimp-selection-none img)
(gimp-palette-set-background old-bg)

View file

@ -94,10 +94,10 @@
(gimp-palette-set-background '(31 31 31))
(gimp-palette-set-foreground '(255 255 255))
(gimp-blend logo-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-BILINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
cx cy bx by)
(gimp-edit-blend logo-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-BILINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
cx cy bx by)
(plug-in-nova 1 img glow-layer novax novay glow-color novaradius 100 0)

View file

@ -178,20 +178,20 @@
(gimp-ellipse-select img (- cx radius) (- cy radius)
(* 2 radius) (* 2 radius) REPLACE TRUE FALSE 0)
(gimp-blend drawable FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-RADIAL 100 offset REPEAT-NONE FALSE
FALSE 0 0 TRUE
light-x light-y light-end-x light-end-y)
(gimp-edit-blend drawable FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-RADIAL 100 offset REPEAT-NONE FALSE
FALSE 0 0 TRUE
light-x light-y light-end-x light-end-y)
(gimp-selection-none img)
(gimp-gradients-set-gradient gradient)
(gimp-ellipse-select img 10 10 50 50 REPLACE TRUE FALSE 0)
(gimp-blend drawable CUSTOM-MODE NORMAL-MODE
GRADIENT-LINEAR 100 offset REPEAT-NONE gradient-reverse
FALSE 0 0 TRUE
10 10 30 60)
(gimp-edit-blend drawable CUSTOM-MODE NORMAL-MODE
GRADIENT-LINEAR 100 offset REPEAT-NONE gradient-reverse
FALSE 0 0 TRUE
10 10 30 60)
(gimp-selection-none img)

View file

@ -66,19 +66,19 @@
(gimp-edit-fill text-shadow-layer BACKGROUND-FILL)
(gimp-palette-set-foreground '(255 255 255))
(gimp-blend text-shadow-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 1 1)
(gimp-edit-blend text-shadow-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 1 1)
(gimp-selection-none img)
(gimp-palette-set-foreground blend-fg)
(gimp-palette-set-background blend-bg)
(gimp-blend blend-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 width 0)
(gimp-edit-blend blend-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 0 width 0)
(plug-in-mosaic 1 img blend-layer 12 1 1 0.7 TRUE 135 0.2 TRUE FALSE
tile-type 1 0)

View file

@ -121,11 +121,11 @@
(gimp-drawable-set-visible text-layer TRUE)
(gimp-layer-set-preserve-trans text-layer TRUE)
(gimp-blend text-layer CUSTOM-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE gradient-reverse
FALSE 0.2 3 TRUE
padding padding
(- text-width padding 1) (- text-height padding 1))
(gimp-edit-blend text-layer CUSTOM-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE gradient-reverse
FALSE 0.2 3 TRUE
padding padding
(- text-width padding 1) (- text-height padding 1))
; Semicircle at the left
@ -133,9 +133,9 @@
(gimp-edit-fill bg-layer BACKGROUND-FILL)
(gimp-ellipse-select img 0 0 text-height text-height REPLACE TRUE FALSE 0)
(gimp-palette-set-background (car (gimp-color-picker img text-layer
text-layers-offset 0
TRUE FALSE 0)))
(gimp-palette-set-background (car (gimp-image-pick-color img text-layer
text-layers-offset 0
TRUE FALSE 0)))
(gimp-edit-fill bg-layer BACKGROUND-FILL)
; Fade-out gradient at the right
@ -145,10 +145,10 @@
(gimp-palette-set-foreground (car (gimp-palette-get-background)))
(gimp-palette-set-background '(0 0 0))
(gimp-blend bg-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0.2 3 TRUE
(- img-width fade-width) 0 (- img-width 1) 0)
(gimp-edit-blend bg-layer FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
FALSE 0.2 3 TRUE
(- img-width fade-width) 0 (- img-width 1) 0)
(gimp-selection-none img)

View file

@ -68,10 +68,10 @@
FALSE
0)
(gimp-blend drawable FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-BILINEAR 100 (- 100 shadow-depth) REPEAT-NONE FALSE
FALSE 0 0 TRUE
(/ (+ (* 2 ribbon-spacing) ribbon-width -1) 2) 0 0 0)
(gimp-edit-blend drawable FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-BILINEAR 100 (- 100 shadow-depth) REPEAT-NONE FALSE
FALSE 0 0 TRUE
(/ (+ (* 2 ribbon-spacing) ribbon-width -1) 2) 0 0 0)
; Create main vertical ribbon
@ -84,10 +84,10 @@
FALSE
0)
(gimp-blend drawable FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-BILINEAR 100 (- 100 shadow-depth) REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 (/ (+ (* 2 ribbon-spacing) ribbon-width -1) 2) 0 0)
(gimp-edit-blend drawable FG-BG-RGB-MODE NORMAL-MODE
GRADIENT-BILINEAR 100 (- 100 shadow-depth) REPEAT-NONE FALSE
FALSE 0 0 TRUE
0 (/ (+ (* 2 ribbon-spacing) ribbon-width -1) 2) 0 0)
; Create the secondary horizontal ribbon

View file

@ -23,7 +23,6 @@ pdb_sources = \
pdb/layer.pdb \
pdb/message.pdb \
pdb/misc.pdb \
pdb/misc_tools.pdb \
pdb/paint_tools.pdb \
pdb/palette.pdb \
pdb/palette_select.pdb \

View file

@ -21,7 +21,6 @@
layer
message
misc
misc_tools
paint_tools
palette
palette_select

View file

@ -25,6 +25,18 @@ sub inargs {
);
}
sub drawable_arg () {{
name => 'drawable',
type => 'drawable',
desc => 'The affected drawable',
}}
sub sample_merged_arg () {{
name => 'sample_merged',
type => 'boolean',
desc => 'Use the composite image, not the drawable'
}}
# Common invoker for checking for image/drawable consistency
sub invoke {
%invoke = (
@ -149,6 +161,159 @@ HELP
&invoke('gimp_edit_fill (gimage, drawable, (GimpFillType) fill_type)');
}
sub edit_bucket_fill {
$blurb = <<'BLURB';
Fill the area specified either by the current selection if there is one, or by
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 and y coordinates are
relative to the image's origin; otherwise, they are relative to the
drawable's origin.
HELP
&std_pdb_misc;
my $validity = 'This parameter is only valid when there is no selection in
the specified image.';
@inargs = (
&drawable_arg,
{ name => 'fill_mode', type => 'enum GimpBucketFillMode',
desc => 'The type of fill: { %%desc%% }' },
{ name => paint_mode, type => 'enum GimpLayerModeEffects',
desc => 'The paint application mode: { %%desc%% }' },
{ name => 'opacity', type => '0 <= float <= 100',
desc => 'The opacity of the final bucket fill (%%desc%%)' },
{ name => 'threshold', type => '0 <= float <= 255',
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
);
foreach (qw(x y)) {
push @inargs, { name => $_, type => 'float',
desc => "The $_ coordinate of this bucket fill's
application. $validity" }
}
%invoke = (
headers => [ qw ("core/gimpdrawable-bucket-fill.h"
"core/gimpchannel.h") ],
code => <<'CODE'
{
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable));
if (! gimage)
{
success = FALSE;
}
else
{
gboolean do_seed_fill;
do_seed_fill = gimp_channel_is_empty (gimp_image_get_mask (gimage));
gimp_drawable_bucket_fill (drawable, fill_mode,
paint_mode, opacity / 100.0,
do_seed_fill,
FALSE /* don't fill transparent */,
threshold, sample_merged, x, y);
}
}
CODE
);
}
sub edit_blend {
$blurb = <<'BLURB';
Blend between the starting and ending coordinates with the specified blend mode
and gradient type.
BLURB
$help = <<'HELP';
This tool requires information on the paint application mode, the blend mode,
and the gradient type. It creates the specified variety of blend using the
starting and ending coordinates as defined for each gradient type.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
{ name => 'blend_mode', type => 'enum GimpBlendMode',
desc => 'The type of blend: { %%desc%% }' },
{ name => 'paint_mode', type => 'enum GimpLayerModeEffects',
desc => 'The paint application mode: { %%desc%% }' },
{ name => 'gradient_type', type => 'enum GimpGradientType',
desc => 'The type of gradient: { %%desc%% }' },
{ name => 'opacity', type => '0 <= float <= 100',
desc => 'The opacity of the final blend (%%desc%%)' },
{ name => 'offset', type => '0 <= float',
desc => 'Offset relates to the starting and ending coordinates
specified for the blend. This parameter is mode dependent
(%%desc%%)' },
{ name => 'repeat', type => 'enum GimpRepeatMode',
desc => 'Repeat mode: { %%desc%% }' },
{ name => 'reverse', type => 'boolean',
desc => 'Use the reverse gradient (%%desc%%)' },
{ name => 'supersample', type => 'boolean',
desc => 'Do adaptive supersampling (%%desc%%)' },
{ name => 'max_depth', type => '1 <= int32 <= 9',
desc => 'Maximum recursion levels for supersampling',
cond => [ 'supersample' ] },
{ name => 'threshold', type => '0 <= float <= 4',
desc => 'Supersampling threshold',
cond => [ 'supersample' ] },
{ name => 'dither', type => 'boolean',
desc => 'Use dithering to reduce banding (%%desc%%)' },
{ name => 'x1', type => 'float',
desc => "The x coordinate of this blend's starting point" },
{ name => 'y1', type => 'float',
desc => "The y coordinate of this blend's starting point" },
{ name => 'x2', type => 'float',
desc => "The x coordinate of this blend's ending point" },
{ name => 'y2', type => 'float',
desc => "The y coordinate of this blend's ending point" }
);
%invoke = (
headers => [ qw("core/gimpdrawable-blend.h") ],
code => <<'CODE'
{
if (! gimp_item_get_image (GIMP_ITEM (drawable)))
{
success = FALSE;
}
else
{
gimp_drawable_blend (drawable,
blend_mode,
paint_mode,
gradient_type,
opacity / 100.0,
offset, repeat, reverse,
supersample, max_depth,
threshold, dither,
x1, y1, x2, y2,
NULL, NULL);
}
}
CODE
);
}
sub edit_stroke {
$blurb = 'Stroke the current selection';
@ -182,7 +347,8 @@ CODE
@headers = qw("core/gimpimage.h");
@procs = qw(edit_cut edit_copy edit_paste edit_clear edit_fill edit_stroke);
@procs = qw(edit_cut edit_copy edit_paste edit_clear
edit_fill edit_bucket_fill edit_blend edit_stroke);
%exports = (app => [@procs], lib => [@procs]);
$desc = 'Edit procedures';

View file

@ -522,6 +522,75 @@ HELP
%invoke = ( code => 'gimp_image_unset_active_channel (gimage);' );
}
sub image_pick_color {
$blurb = <<'BLURB';
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 except for finding the image it belongs
to.
HELP
&std_pdb_misc;
@inargs = (
&std_image_arg,
{ name => 'drawable', type => 'drawable',
desc => 'The drawable to pick from' },
{ name => 'x', type => 'float',
desc => 'x coordinate of upper-left corner of rectangle' },
{ name => 'y', type => 'float',
desc => 'y coordinate of upper-left corner of rectangle' },
{ name => 'sample_merged', type => 'boolean',
desc => 'Use the composite image, not the drawable' },
{ name => 'sample_average', type => 'boolean',
desc => 'Average the color of all the pixels in a specified
radius' },
{ name => 'average_radius', type => '0 < float',
desc => 'The radius of pixels to average',
cond => [ 'sample_average' ] }
);
$inargs[1]->{no_success} = 1;
@outargs = (
{ name => 'color', type => 'color', void_ret => 1,
desc => 'The return color', init => 1 }
);
%invoke = (
headers => [ qw("core/gimpimage-pick-color.h") ],
code => <<'CODE'
{
if (!sample_merged)
if (!drawable || (gimp_item_get_image (GIMP_ITEM (drawable)) != gimage))
success = FALSE;
if (success)
success = gimp_image_pick_color (gimage,
drawable,
(gint) x, (gint) y,
sample_merged,
sample_average,
average_radius,
NULL,
&color,
NULL);
}
CODE
);
}
sub image_pick_correlate_layer {
$blurb = 'Find the layer visible at the specified coordinates.';
@ -1454,7 +1523,7 @@ unshift @procs, qw(image_list image_new image_duplicate image_delete
image_get_active_drawable
image_unset_active_channel
image_get_floating_sel image_floating_sel_attached_to
image_pick_correlate_layer
image_pick_color image_pick_correlate_layer
image_add_layer image_remove_layer
image_raise_layer image_lower_layer
image_raise_layer_to_top image_lower_layer_to_bottom
@ -1465,7 +1534,7 @@ unshift @procs, qw(image_list image_new image_duplicate image_delete
image_get_cmap image_set_cmap
image_clean_all image_is_dirty
image_thumbnail);
%exports = (app => [@procs], lib => [@procs[0..32,35..59]]);
%exports = (app => [@procs], lib => [@procs[0..33,36..60]]);
$desc = 'Image';

View file

@ -1,269 +0,0 @@
# The GIMP -- an image manipulation program
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
# Misc Tools
# shortcuts
sub drawable_arg () {{
name => 'drawable',
type => 'drawable',
desc => 'The affected drawable',
}}
sub sample_merged_arg () {{
name => 'sample_merged',
type => 'boolean',
desc => 'Use the composite image, not the drawable'
}}
# The defs
sub blend {
$blurb = <<'BLURB';
Blend between the starting and ending coordinates with the specified blend mode
and gradient type.
BLURB
$help = <<'HELP';
This tool requires information on the paint application mode, the blend mode,
and the gradient type. It creates the specified variety of blend using the
starting and ending coordinates as defined for each gradient type.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
{ name => 'blend_mode', type => 'enum GimpBlendMode',
desc => 'The type of blend: { %%desc%% }' },
{ name => 'paint_mode', type => 'enum GimpLayerModeEffects',
desc => 'The paint application mode: { %%desc%% }' },
{ name => 'gradient_type', type => 'enum GimpGradientType',
desc => 'The type of gradient: { %%desc%% }' },
{ name => 'opacity', type => '0 <= float <= 100',
desc => 'The opacity of the final blend (%%desc%%)' },
{ name => 'offset', type => '0 <= float',
desc => 'Offset relates to the starting and ending coordinates
specified for the blend. This parameter is mode dependent
(%%desc%%)' },
{ name => 'repeat', type => 'enum GimpRepeatMode',
desc => 'Repeat mode: { %%desc%% }' },
{ name => 'reverse', type => 'boolean',
desc => 'Use the reverse gradient (%%desc%%)' },
{ name => 'supersample', type => 'boolean',
desc => 'Do adaptive supersampling (%%desc%%)' },
{ name => 'max_depth', type => '1 <= int32 <= 9',
desc => 'Maximum recursion levels for supersampling',
cond => [ 'supersample' ] },
{ name => 'threshold', type => '0 <= float <= 4',
desc => 'Supersampling threshold',
cond => [ 'supersample' ] },
{ name => 'dither', type => 'boolean',
desc => 'Use dithering to reduce banding (%%desc%%)' },
{ name => 'x1', type => 'float',
desc => "The x coordinate of this blend's starting point" },
{ name => 'y1', type => 'float',
desc => "The y coordinate of this blend's starting point" },
{ name => 'x2', type => 'float',
desc => "The x coordinate of this blend's ending point" },
{ name => 'y2', type => 'float',
desc => "The y coordinate of this blend's ending point" }
);
%invoke = (
headers => [ qw("core/gimpdrawable-blend.h") ],
code => <<'CODE'
{
if (! gimp_item_get_image (GIMP_ITEM (drawable)))
{
success = FALSE;
}
else
{
gimp_drawable_blend (drawable,
blend_mode,
paint_mode,
gradient_type,
opacity / 100.0,
offset, repeat, reverse,
supersample, max_depth,
threshold, dither,
x1, y1, x2, y2,
NULL, NULL);
}
}
CODE
);
}
sub bucket_fill {
$blurb = <<'BLURB';
Fill the area specified either by the current selection if there is one, or by
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 and y coordinates are
relative to the image's origin; otherwise, they are relative to the
drawable's origin.
HELP
&std_pdb_misc;
my $validity = 'This parameter is only valid when there is no selection in
the specified image.';
@inargs = (
&drawable_arg,
{ name => 'fill_mode', type => 'enum GimpBucketFillMode',
desc => 'The type of fill: { %%desc%% }' },
{ name => paint_mode, type => 'enum GimpLayerModeEffects',
desc => 'The paint application mode: { %%desc%% }' },
{ name => 'opacity', type => '0 <= float <= 100',
desc => 'The opacity of the final bucket fill (%%desc%%)' },
{ name => 'threshold', type => '0 <= float <= 255',
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
);
foreach (qw(x y)) {
push @inargs, { name => $_, type => 'float',
desc => "The $_ coordinate of this bucket fill's
application. $validity" }
}
%invoke = (
headers => [ qw ("core/gimpdrawable-bucket-fill.h"
"core/gimpchannel.h") ],
code => <<'CODE'
{
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable));
if (! gimage)
{
success = FALSE;
}
else
{
gboolean do_seed_fill;
do_seed_fill = gimp_channel_is_empty (gimp_image_get_mask (gimage));
gimp_drawable_bucket_fill (drawable, fill_mode,
paint_mode, opacity / 100.0,
do_seed_fill,
FALSE /* don't fill transparent */,
threshold, sample_merged, x, y);
}
}
CODE
);
}
sub color_picker {
$blurb = <<'BLURB';
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 except for finding the image it belongs
to.
HELP
&std_pdb_misc;
@inargs = (
&std_image_arg,
&drawable_arg,
{ name => 'x', type => 'float',
desc => 'x coordinate of upper-left corner of rectangle' },
{ name => 'y', type => 'float',
desc => 'y coordinate of upper-left corner of rectangle' },
&sample_merged_arg,
{ name => 'sample_average', type => 'boolean',
desc => 'Average the color of all the pixels in a specified
radius' },
{ name => 'average_radius', type => '0 < float',
desc => 'The radius of pixels to average',
cond => [ 'sample_average' ] }
);
$inargs[1]->{no_success} = 1;
@outargs = (
{ name => 'color', type => 'color', void_ret => 1,
desc => 'The return color', init => 1 }
);
%invoke = (
headers => [ qw("core/gimpimage-pick-color.h") ],
code => <<'CODE'
{
if (!sample_merged)
if (!drawable || (gimp_item_get_image (GIMP_ITEM (drawable)) != gimage))
success = FALSE;
if (success)
success = gimp_image_pick_color (gimage,
drawable,
(gint) x, (gint) y,
sample_merged,
sample_average,
average_radius,
NULL,
&color,
NULL);
}
CODE
);
}
@headers = qw("libgimpmath/gimpmath.h" "core/gimpdrawable.h");
@procs = qw(blend bucket_fill color_picker);
%exports = (app => [@procs], lib => [@procs]);
$desc = 'Misc Tool procedures';
1;