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

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.
parent 1f16d9cf
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.
......@@ -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)
......
......@@ -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" },
......
......@@ -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" },
......
......@@ -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" },
......
......@@ -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)
......
......@@ -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);
......
......@@ -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"