removed, chopped...

2001-12-10  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/tools.pdb: removed, chopped...

	* tools/pdbgen/pdb/misc_tools.pdb
	* tools/pdbgen/pdb/paint_tools.pdb: ...and added here.

	* app/pdb/tools_cmds.c
	* libgimp/gimptools_pdb.[ch]: removed.

	* app/pdb/internal_procs.c
	* app/pdb/misc_tools_cmds.c
	* app/pdb/paint_tools_cmds.c
	* libgimp/gimpmisctools_pdb.[ch]
	* libgimp/gimppainttools_pdb.[ch]: generated files.

	* app/pdb/Makefile.am
	* libgimp/Makefile.am
	* libgimp/gimp_pdb.h
	* tools/pdbgen/Makefile.am
	* tools/pdbgen/groups.pl: changed accordingly.

	* tools/pdbgen/pdb/selection_tools.pdb
	* tools/pdbgen/pdb/transform_tools.pdb: cosmetic comment changes.
This commit is contained in:
Michael Natterer 2001-12-10 17:01:49 +00:00 committed by Michael Natterer
parent 3a84f99d2b
commit 29ae695725
18 changed files with 853 additions and 2242 deletions

View File

@ -1,3 +1,28 @@
2001-12-10 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/tools.pdb: removed, chopped...
* tools/pdbgen/pdb/misc_tools.pdb
* tools/pdbgen/pdb/paint_tools.pdb: ...and added here.
* app/pdb/tools_cmds.c
* libgimp/gimptools_pdb.[ch]: removed.
* app/pdb/internal_procs.c
* app/pdb/misc_tools_cmds.c
* app/pdb/paint_tools_cmds.c
* libgimp/gimpmisctools_pdb.[ch]
* libgimp/gimppainttools_pdb.[ch]: generated files.
* app/pdb/Makefile.am
* libgimp/Makefile.am
* libgimp/gimp_pdb.h
* tools/pdbgen/Makefile.am
* tools/pdbgen/groups.pl: changed accordingly.
* tools/pdbgen/pdb/selection_tools.pdb
* tools/pdbgen/pdb/transform_tools.pdb: cosmetic comment changes.
2001-12-10 Sven Neumann <sven@gimp.org>
* app/base/Makefile.am

View File

@ -26,6 +26,8 @@ libapppdb_a_SOURCES = @STRIP_BEGIN@ \
layer_cmds.c \
message_cmds.c \
misc_cmds.c \
misc_tools_cmds.c \
paint_tools_cmds.c \
palette_cmds.c \
parasite_cmds.c \
paths_cmds.c \
@ -38,7 +40,6 @@ libapppdb_a_SOURCES = @STRIP_BEGIN@ \
selection_cmds.c \
selection_tools_cmds.c \
text_tool_cmds.c \
tools_cmds.c \
transform_tools_cmds.c \
undo_cmds.c \
unit_cmds.c \

View File

@ -49,6 +49,8 @@ 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_parasite_procs (Gimp *gimp);
void register_paths_procs (Gimp *gimp);
@ -59,7 +61,6 @@ void register_procedural_db_procs (Gimp *gimp);
void register_selection_procs (Gimp *gimp);
void register_selection_tools_procs (Gimp *gimp);
void register_text_tool_procs (Gimp *gimp);
void register_tools_procs (Gimp *gimp);
void register_transform_tools_procs (Gimp *gimp);
void register_undo_procs (Gimp *gimp);
void register_unit_procs (Gimp *gimp);
@ -130,39 +131,42 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Miscellaneous"), 0.624);
register_misc_procs (gimp);
(* status_callback) (NULL, _("Palette"), 0.63);
(* status_callback) (NULL, _("Misc Tool procedures"), 0.63);
register_misc_tools_procs (gimp);
(* status_callback) (NULL, _("Paint Tool procedures"), 0.639);
register_paint_tools_procs (gimp);
(* status_callback) (NULL, _("Palette"), 0.685);
register_palette_procs (gimp);
(* status_callback) (NULL, _("Parasite procedures"), 0.664);
(* status_callback) (NULL, _("Parasite procedures"), 0.718);
register_parasite_procs (gimp);
(* status_callback) (NULL, _("Paths"), 0.7);
(* status_callback) (NULL, _("Paths"), 0.755);
register_paths_procs (gimp);
(* status_callback) (NULL, _("Pattern UI"), 0.739);
(* status_callback) (NULL, _("Pattern UI"), 0.794);
register_pattern_select_procs (gimp);
(* status_callback) (NULL, _("Patterns"), 0.748);
(* status_callback) (NULL, _("Patterns"), 0.803);
register_patterns_procs (gimp);
(* status_callback) (NULL, _("Plug-in"), 0.761);
(* status_callback) (NULL, _("Plug-in"), 0.815);
register_plug_in_procs (gimp);
(* status_callback) (NULL, _("Procedural database"), 0.779);
(* status_callback) (NULL, _("Procedural database"), 0.833);
register_procedural_db_procs (gimp);
(* status_callback) (NULL, _("Image mask"), 0.803);
(* status_callback) (NULL, _("Image mask"), 0.858);
register_selection_procs (gimp);
(* status_callback) (NULL, _("Selection Tool procedures"), 0.858);
(* status_callback) (NULL, _("Selection Tool procedures"), 0.912);
register_selection_tools_procs (gimp);
(* status_callback) (NULL, _("Text procedures"), 0.873);
(* status_callback) (NULL, _("Text procedures"), 0.927);
register_text_tool_procs (gimp);
(* status_callback) (NULL, _("Tool procedures"), 0.885);
register_tools_procs (gimp);
(* status_callback) (NULL, _("Tool procedures"), 0.939);
register_transform_tools_procs (gimp);

484
app/pdb/misc_tools_cmds.c Normal file
View File

@ -0,0 +1,484 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2000 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.
*/
/* NOTE: This file is autogenerated by pdbgen.pl. */
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpbase/gimpbasetypes.h"
#include "pdb-types.h"
#include "tools/tools-types.h"
#include "procedural_db.h"
#include "base/base-enums.h"
#include "base/tile-manager.h"
#include "core/core-types.h"
#include "core/gimpdrawable-blend.h"
#include "core/gimpdrawable-bucket-fill.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "tools/gimpcolorpickertool.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 *
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 supersample;
gint32 max_depth;
gdouble threshold;
gdouble x1;
gdouble y1;
gdouble x2;
gdouble y2;
drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
blend_mode = args[1].value.pdb_int;
if (blend_mode < FG_BG_RGB_MODE || blend_mode > 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 < LINEAR || gradient_type > 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 < REPEAT_NONE || repeat > REPEAT_TRIANGULAR)
success = FALSE;
supersample = args[7].value.pdb_int ? TRUE : FALSE;
max_depth = args[8].value.pdb_int;
if (supersample && (max_depth < 1 || max_depth > 9))
success = FALSE;
threshold = args[9].value.pdb_float;
if (supersample && (threshold < 0.0 || threshold > 4.0))
success = FALSE;
x1 = args[10].value.pdb_float;
y1 = args[11].value.pdb_float;
x2 = args[12].value.pdb_float;
y2 = args[13].value.pdb_float;
if (success)
{
if (! gimp_drawable_gimage (drawable))
{
success = FALSE;
}
else
{
gimp_drawable_blend (drawable,
blend_mode,
paint_mode,
gradient_type,
opacity / 100.0,
offset, repeat,
supersample, max_depth,
threshold,
x1, y1, x2, y2,
NULL, NULL);
}
}
return procedural_db_return_args (&blend_proc, success);
}
static ProcArg blend_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The affected drawable"
},
{
GIMP_PDB_INT32,
"blend_mode",
"The type of blend: { FG_BG_RGB (0), FG_BG_HSV (1), FG_TRANS (2), CUSTOM (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_COLOR_ERASE_MODE (19) }"
},
{
GIMP_PDB_INT32,
"gradient_type",
"The type of gradient: { LINEAR (0), BILINEAR (1), RADIAL (2), SQUARE (3), CONICAL_SYMMETRIC (4), CONICAL_ASYMMETRIC (5), SHAPEBURST_ANGULAR (6), SHAPEBURST_SPHERICAL (7), SHAPEBURST_DIMPLED (8), SPIRAL_CLOCKWISE (9), 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: { REPEAT_NONE (0), REPEAT_SAWTOOTH (1), REPEAT_TRIANGULAR (2) }"
},
{
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_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 blend_proc =
{
"gimp_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,
14,
blend_inargs,
0,
NULL,
{ { blend_invoker } }
};
static Argument *
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 = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
fill_mode = args[1].value.pdb_int;
if (fill_mode < FG_BUCKET_FILL || fill_mode > 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)
{
if (! gimp_drawable_gimage (GIMP_DRAWABLE (drawable)))
{
success = FALSE;
}
else
{
gimp_drawable_bucket_fill (drawable, fill_mode,
paint_mode, opacity / 100.0,
threshold, sample_merged, x, y);
}
}
return procedural_db_return_args (&bucket_fill_proc, success);
}
static ProcArg bucket_fill_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The affected drawable"
},
{
GIMP_PDB_INT32,
"fill_mode",
"The type of fill: { FG_BUCKET_FILL (0), BG_BUCKET_FILL (1), 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_COLOR_ERASE_MODE (19) }"
},
{
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 bucket_fill_proc =
{
"gimp_bucket_fill",
"Fill the area specified either by the current selection if there is one, or by a seed fill starting at the specified coordinates.",
"This tool requires information on the paint application mode, and the fill mode, which can either be in the foreground color, or in the currently active pattern. If there is no selection, a seed fill is executed at the specified coordinates and extends outward in keeping with the threshold parameter. If there is a selection in the target image, the threshold, sample merged, x, and y arguments are unused. If the sample_merged parameter is non-zero, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of merged sampling, the x,y coordinates are relative to the image's origin; otherwise, they are relative to the drawable's origin.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
8,
bucket_fill_inargs,
0,
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;
gboolean save_color;
GimpRGB color;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (gimage == NULL)
success = FALSE;
drawable = gimp_drawable_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;
save_color = args[7].value.pdb_int ? TRUE : FALSE;
if (success)
{
if (!sample_merged)
if (!drawable || (gimp_drawable_gimage (drawable) != gimage))
success = FALSE;
if (success)
success = pick_color (gimage, drawable, (int) x, (int) y,
sample_merged, sample_average, average_radius,
save_color);
if (success)
{
gimp_rgba_set_uchar (&color,
col_value[RED_PIX],
col_value[GREEN_PIX],
col_value[BLUE_PIX],
col_value[ALPHA_PIX]);
}
}
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"
},
{
GIMP_PDB_INT32,
"save_color",
"Save the color to the active palette"
}
};
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.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
8,
color_picker_inargs,
1,
color_picker_outargs,
{ { color_picker_invoker } }
};

View File

@ -29,17 +29,12 @@
#include "tools/tools-types.h"
#include "procedural_db.h"
#include "base/base-enums.h"
#include "base/tile-manager.h"
#include "core/core-types.h"
#include "core/gimpdrawable-blend.h"
#include "core/gimpdrawable-bucket-fill.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage-mask-select.h"
#include "core/gimpimage.h"
#include "tools/gimpairbrushtool.h"
#include "tools/gimpclonetool.h"
#include "tools/gimpcolorpickertool.h"
#include "tools/gimpconvolvetool.h"
#include "tools/gimpdodgeburntool.h"
#include "tools/gimperasertool.h"
@ -47,16 +42,12 @@
#include "tools/gimppenciltool.h"
#include "tools/gimpsmudgetool.h"
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
static ProcRecord airbrush_proc;
static ProcRecord airbrush_default_proc;
static ProcRecord blend_proc;
static ProcRecord bucket_fill_proc;
static ProcRecord clone_proc;
static ProcRecord clone_default_proc;
static ProcRecord color_picker_proc;
static ProcRecord convolve_proc;
static ProcRecord convolve_default_proc;
static ProcRecord dodgeburn_proc;
@ -70,15 +61,12 @@ static ProcRecord smudge_proc;
static ProcRecord smudge_default_proc;
void
register_tools_procs (Gimp *gimp)
register_paint_tools_procs (Gimp *gimp)
{
procedural_db_register (gimp, &airbrush_proc);
procedural_db_register (gimp, &airbrush_default_proc);
procedural_db_register (gimp, &blend_proc);
procedural_db_register (gimp, &bucket_fill_proc);
procedural_db_register (gimp, &clone_proc);
procedural_db_register (gimp, &clone_default_proc);
procedural_db_register (gimp, &color_picker_proc);
procedural_db_register (gimp, &convolve_proc);
procedural_db_register (gimp, &convolve_default_proc);
procedural_db_register (gimp, &dodgeburn_proc);
@ -226,303 +214,6 @@ static ProcRecord airbrush_default_proc =
{ { airbrush_default_invoker } }
};
static Argument *
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 supersample;
gint32 max_depth;
gdouble threshold;
gdouble x1;
gdouble y1;
gdouble x2;
gdouble y2;
drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
blend_mode = args[1].value.pdb_int;
if (blend_mode < FG_BG_RGB_MODE || blend_mode > 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 < LINEAR || gradient_type > 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 < REPEAT_NONE || repeat > REPEAT_TRIANGULAR)
success = FALSE;
supersample = args[7].value.pdb_int ? TRUE : FALSE;
max_depth = args[8].value.pdb_int;
if (supersample && (max_depth < 1 || max_depth > 9))
success = FALSE;
threshold = args[9].value.pdb_float;
if (supersample && (threshold < 0.0 || threshold > 4.0))
success = FALSE;
x1 = args[10].value.pdb_float;
y1 = args[11].value.pdb_float;
x2 = args[12].value.pdb_float;
y2 = args[13].value.pdb_float;
if (success)
{
if (! gimp_drawable_gimage (drawable))
{
success = FALSE;
}
else
{
gimp_drawable_blend (drawable,
blend_mode,
paint_mode,
gradient_type,
opacity / 100.0,
offset, repeat,
supersample, max_depth,
threshold,
x1, y1, x2, y2,
NULL, NULL);
}
}
return procedural_db_return_args (&blend_proc, success);
}
static ProcArg blend_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The affected drawable"
},
{
GIMP_PDB_INT32,
"blend_mode",
"The type of blend: { FG_BG_RGB (0), FG_BG_HSV (1), FG_TRANS (2), CUSTOM (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_COLOR_ERASE_MODE (19) }"
},
{
GIMP_PDB_INT32,
"gradient_type",
"The type of gradient: { LINEAR (0), BILINEAR (1), RADIAL (2), SQUARE (3), CONICAL_SYMMETRIC (4), CONICAL_ASYMMETRIC (5), SHAPEBURST_ANGULAR (6), SHAPEBURST_SPHERICAL (7), SHAPEBURST_DIMPLED (8), SPIRAL_CLOCKWISE (9), 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: { REPEAT_NONE (0), REPEAT_SAWTOOTH (1), REPEAT_TRIANGULAR (2) }"
},
{
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_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 blend_proc =
{
"gimp_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,
14,
blend_inargs,
0,
NULL,
{ { blend_invoker } }
};
static Argument *
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 = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
fill_mode = args[1].value.pdb_int;
if (fill_mode < FG_BUCKET_FILL || fill_mode > 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)
{
if (! gimp_drawable_gimage (GIMP_DRAWABLE (drawable)))
{
success = FALSE;
}
else
{
gimp_drawable_bucket_fill (drawable, fill_mode,
paint_mode, opacity / 100.0,
threshold, sample_merged, x, y);
}
}
return procedural_db_return_args (&bucket_fill_proc, success);
}
static ProcArg bucket_fill_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The affected drawable"
},
{
GIMP_PDB_INT32,
"fill_mode",
"The type of fill: { FG_BUCKET_FILL (0), BG_BUCKET_FILL (1), 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_COLOR_ERASE_MODE (19) }"
},
{
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 bucket_fill_proc =
{
"gimp_bucket_fill",
"Fill the area specified either by the current selection if there is one, or by a seed fill starting at the specified coordinates.",
"This tool requires information on the paint application mode, and the fill mode, which can either be in the foreground color, or in the currently active pattern. If there is no selection, a seed fill is executed at the specified coordinates and extends outward in keeping with the threshold parameter. If there is a selection in the target image, the threshold, sample merged, x, and y arguments are unused. If the sample_merged parameter is non-zero, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of merged sampling, the x,y coordinates are relative to the image's origin; otherwise, they are relative to the drawable's origin.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
8,
bucket_fill_inargs,
0,
NULL,
{ { bucket_fill_invoker } }
};
static Argument *
clone_invoker (Gimp *gimp,
Argument *args)
@ -684,139 +375,6 @@ static ProcRecord clone_default_proc =
{ { clone_default_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;
gboolean save_color;
GimpRGB color;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (gimage == NULL)
success = FALSE;
drawable = gimp_drawable_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;
save_color = args[7].value.pdb_int ? TRUE : FALSE;
if (success)
{
if (!sample_merged)
if (!drawable || (gimp_drawable_gimage (drawable) != gimage))
success = FALSE;
if (success)
success = pick_color (gimage, drawable, (int) x, (int) y,
sample_merged, sample_average, average_radius,
save_color);
if (success)
{
gimp_rgba_set_uchar (&color,
col_value[RED_PIX],
col_value[GREEN_PIX],
col_value[BLUE_PIX],
col_value[ALPHA_PIX]);
}
}
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"
},
{
GIMP_PDB_INT32,
"save_color",
"Save the color to the active palette"
}
};
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.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
8,
color_picker_inargs,
1,
color_picker_outargs,
{ { color_picker_invoker } }
};
static Argument *
convolve_invoker (Gimp *gimp,
Argument *args)

View File

@ -45,6 +45,8 @@ PDB_WRAPPERS_C = \
gimplayer_pdb.c \
gimpmessage_pdb.c \
gimpmisc_pdb.c \
gimpmisctools_pdb.c \
gimppainttools_pdb.c \
gimppalette_pdb.c \
gimpparasite_pdb.c \
gimppaths_pdb.c \
@ -55,7 +57,6 @@ PDB_WRAPPERS_C = \
gimpselection_pdb.c \
gimpselectiontools_pdb.c \
gimptexttool_pdb.c \
gimptools_pdb.c \
gimptransformtools_pdb.c \
gimpundo_pdb.c \
gimpunit_pdb.c
@ -81,6 +82,8 @@ PDB_WRAPPERS_H = \
gimplayer_pdb.h \
gimpmessage_pdb.h \
gimpmisc_pdb.h \
gimpmisctools_pdb.h \
gimppainttools_pdb.h \
gimppalette_pdb.h \
gimpparasite_pdb.h \
gimppaths_pdb.h \
@ -91,7 +94,6 @@ PDB_WRAPPERS_H = \
gimpselection_pdb.h \
gimpselectiontools_pdb.h \
gimptexttool_pdb.h \
gimptools_pdb.h \
gimptransformtools_pdb.h \
gimpundo_pdb.h \
gimpunit_pdb.h

View File

@ -41,6 +41,8 @@
#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/gimpparasite_pdb.h>
#include <libgimp/gimppaths_pdb.h>
@ -51,7 +53,6 @@
#include <libgimp/gimpselection_pdb.h>
#include <libgimp/gimpselectiontools_pdb.h>
#include <libgimp/gimptexttool_pdb.h>
#include <libgimp/gimptools_pdb.h>
#include <libgimp/gimptransformtools_pdb.h>
#include <libgimp/gimpundo_pdb.h>
#include <libgimp/gimpunit_pdb.h>

223
libgimp/gimpmisctools_pdb.c Normal file
View File

@ -0,0 +1,223 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2000 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 "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.
* @supersample: Do adaptive supersampling.
* @max_depth: Maximum recursion levels for supersampling.
* @threshold: Supersampling threshold.
* @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 supersample,
gint max_depth,
gdouble threshold,
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, supersample,
GIMP_PDB_INT32, max_depth,
GIMP_PDB_FLOAT, threshold,
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,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.
* @save_color: Save the color to the active palette.
* @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.
*
* 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,
gboolean save_color,
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_INT32, save_color,
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

@ -0,0 +1,67 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2000 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 supersample,
gint max_depth,
gdouble threshold,
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,
gboolean save_color,
GimpRGB *color);
G_END_DECLS
#endif /* __GIMP_MISC_TOOLS_PDB_H__ */

View File

@ -1,7 +1,7 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimptools_pdb.c
* gimppainttools_pdb.c
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -104,140 +104,6 @@ gimp_airbrush_default (gint32 drawable_ID,
return success;
}
/**
* 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.
* @supersample: Do adaptive supersampling.
* @max_depth: Maximum recursion levels for supersampling.
* @threshold: Supersampling threshold.
* @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 supersample,
gint max_depth,
gdouble threshold,
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, supersample,
GIMP_PDB_INT32, max_depth,
GIMP_PDB_FLOAT, threshold,
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,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_clone:
* @drawable_ID: The affected drawable.
@ -336,71 +202,6 @@ gimp_clone_default (gint32 drawable_ID,
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.
* @save_color: Save the color to the active palette.
* @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.
*
* 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,
gboolean save_color,
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_INT32, save_color,
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_convolve:
* @drawable_ID: The affected drawable.

View File

@ -1,7 +1,7 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimptools_pdb.h
* gimppainttools_pdb.h
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -21,8 +21,8 @@
/* NOTE: This file is autogenerated by pdbgen.pl */
#ifndef __GIMP_TOOLS_PDB_H__
#define __GIMP_TOOLS_PDB_H__
#ifndef __GIMP_PAINT_TOOLS_PDB_H__
#define __GIMP_PAINT_TOOLS_PDB_H__
G_BEGIN_DECLS
@ -36,28 +36,6 @@ gboolean gimp_airbrush (gint32 drawable_ID,
gboolean gimp_airbrush_default (gint32 drawable_ID,
gint num_strokes,
gdouble *strokes);
gboolean gimp_blend (gint32 drawable_ID,
GimpBlendMode blend_mode,
GimpLayerModeEffects paint_mode,
GimpGradientType gradient_type,
gdouble opacity,
gdouble offset,
GimpRepeatMode repeat,
gboolean supersample,
gint max_depth,
gdouble threshold,
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_clone (gint32 drawable_ID,
gint32 src_drawable_ID,
GimpCloneType clone_type,
@ -68,15 +46,6 @@ gboolean gimp_clone (gint32 drawable_ID,
gboolean gimp_clone_default (gint32 drawable_ID,
gint num_strokes,
gdouble *strokes);
gboolean gimp_color_picker (gint32 image_ID,
gint32 drawable_ID,
gdouble x,
gdouble y,
gboolean sample_merged,
gboolean sample_average,
gdouble average_radius,
gboolean save_color,
GimpRGB *color);
gboolean gimp_convolve (gint32 drawable_ID,
gdouble pressure,
GimpConvolveType convolve_type,
@ -125,4 +94,4 @@ gboolean gimp_smudge_default (gint32 drawable_ID,
G_END_DECLS
#endif /* __GIMP_TOOLS_PDB_H__ */
#endif /* __GIMP_PAINT_TOOLS_PDB_H__ */

View File

@ -21,6 +21,8 @@ pdb_sources = \
pdb/layer.pdb \
pdb/message.pdb \
pdb/misc.pdb \
pdb/misc_tools.pdb \
pdb/paint_tools.pdb \
pdb/palette.pdb \
pdb/parasite.pdb \
pdb/paths.pdb \
@ -31,7 +33,6 @@ pdb_sources = \
pdb/selection.pdb \
pdb/selection_tools.pdb \
pdb/text_tool.pdb \
pdb/tools.pdb \
pdb/transform_tools.pdb \
pdb/undo.pdb \
pdb/unit.pdb

View File

@ -19,6 +19,8 @@
layer
message
misc
misc_tools
paint_tools
palette
parasite
paths
@ -29,7 +31,6 @@
selection
selection_tools
text_tool
tools
transform_tools
undo
unit

View File

@ -17,7 +17,7 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
# Tools
# Misc Tools
# shortcuts
@ -47,82 +47,9 @@ sub threshold_arg () {{
desc => 'Threshold in intensity levels %%desc%%'
}}
sub feather_select_args () {(
{ name => 'feather', type => 'boolean',
desc => 'Feather option for selections' },
{ name => 'feather_radius', type => 'float',
desc => 'Radius for feather operation' }
)}
sub stroke_arg () {
{ name => 'strokes', type => 'floatarray',
desc => 'Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ...,
sn.x, sn.y }',
array => { type => '2 <= int32', on_success => 'num_strokes /= 2;',
desc => 'Number of stroke control points (count each
coordinate as 2 points)' } }
}
# The defs
sub airbrush {
$blurb = <<'BLURB';
Paint in the current brush with varying pressure. Paint application is
time-dependent.
BLURB
$help = <<'HELP';
This tool simulates the use of an airbrush. Paint pressure represents the
relative intensity of the paint application. High pressure results in a thicker
layer of paint while low pressure results in a thinner layer.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
{ name => 'pressure', type => '0 <= float <= 100',
desc => 'The pressure of the airbrush strokes (%%desc%%)' },
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpairbrushtool.h") ],
code => <<'CODE'
success = airbrush_non_gui (drawable, pressure, num_strokes, strokes);
CODE
);
}
sub airbrush_default {
$blurb = <<'BLURB';
Paint in the current brush with varying pressure. Paint application is
time-dependent.
BLURB
$help = <<'HELP';
This tool simulates the use of an airbrush. It is similar to gimp_airbrush
except that the pressure is derived from the airbrush tools options box.
It the option has not been set the default for the option will be used.
HELP
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpairbrushtool.h") ],
code => <<'CODE'
success = airbrush_non_gui_default (drawable, num_strokes, strokes);
CODE
);
}
sub blend {
$blurb = <<'BLURB';
Blend between the starting and ending coordinates with the specified blend mode
@ -261,76 +188,6 @@ CODE
);
}
sub clone {
$blurb = <<'BLURB';
Clone from the source to the dest drawable using the current brush
BLURB
$help = <<'HELP';
This tool clones (copies) from the source drawable starting at the specified
source coordinates to the dest drawable. If the "clone_type" argument is set
to PATTERN-CLONE, then the current pattern is used as the source and the
"src_drawable" argument is ignored. Pattern cloning assumes a tileable
pattern and mods the sum of the src coordinates and subsequent stroke offsets
with the width and height of the pattern. For image cloning, if the sum of the
src coordinates and subsequent stroke offsets exceeds the extents of the src
drawable, then no paint is transferred. The clone tool is capable of
transforming between any image types including RGB->Indexed--although
converting from any type to indexed is significantly slower.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
{ name => 'src_drawable', type => 'drawable',
desc => 'The source drawable' },
{ name => 'clone_type', type => 'enum CloneType',
desc => 'The type of clone: { %%desc%% }' },
{ name => 'src_x', type => 'float',
desc => 'The x coordinate in the source image' },
{ name => 'src_y', type => 'float',
desc => 'The y coordinate in the source image' },
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpclonetool.h") ],
code => <<'CODE'
success = clone_non_gui (drawable, src_drawable, clone_type, src_x, src_y,
num_strokes, strokes);
CODE
);
}
sub clone_default {
$blurb = <<'BLURB';
Clone from the source to the dest drawable using the current brush
BLURB
$help = <<'HELP';
This tool clones (copies) from the source drawable starting at the specified
source coordinates to the dest drawable. This function performs exactly
the same as the gimp_clone function except that the tools arguments are
obtained from the clones option dialog. It this dialog has not been activated
then the dialogs default values will be used.
HELP
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpclonetool.h") ],
code => <<'CODE'
success = clone_non_gui_default (drawable, num_strokes, strokes);
CODE
);
}
sub color_picker {
$blurb = <<'BLURB';
@ -401,389 +258,14 @@ CODE
);
}
sub convolve_default {
$blurb = 'Convolve (Blur, Sharpen) using the current brush.';
$help = <<'HELP';
This tool convolves the specified drawable with either a sharpening or blurring
kernel. This function performs exactly the same as the gimp_convolve
function except that the tools arguments are obtained from the convolve
option dialog. It this dialog has not been activated then the dialogs
default values will be used.
HELP
@headers = qw("libgimpmath/gimpmath.h" "base/tile-manager.h"
"core/gimpdrawable.h" "tools/tools-types.h");
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpconvolvetool.h") ],
code => <<'CODE'
success = convolve_non_gui_default (drawable, num_strokes, strokes);
CODE
);
}
sub convolve {
$blurb = 'Convolve (Blur, Sharpen) using the current brush.';
$help = <<'HELP';
This tool convolves the specified drawable with either a sharpening or blurring
kernel. The pressure parameter controls the magnitude of the operation. Like
the paintbrush, this tool linearly interpolates between the specified stroke
coordinates.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
{ name => 'pressure', type => '0 <= float <= 100',
desc => 'The pressure: %%desc%%' },
{ name => 'convolve_type',
type => 'enum ConvolveType (no CUSTOM_CONVOLVE)',
desc => 'Convolve type: { %%desc%% }' },
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpconvolvetool.h") ],
code => <<'CODE'
success = convolve_non_gui (drawable, pressure, convolve_type, num_strokes, strokes);
CODE
);
}
sub eraser_default {
$blurb = 'Erase using the current brush.';
$help = <<'HELP';
This tool erases using the current brush mask. This function performs exactly
the same as the gimp_eraser function except that the tools arguments are
obtained from the eraser option dialog. It this dialog has not been activated
then the dialogs default values will be used.
HELP
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimperasertool.h") ],
code => <<'CODE'
success = eraser_non_gui_default (drawable, num_strokes, strokes);
CODE
);
}
sub eraser {
$blurb = 'Erase using the current brush.';
$help = <<'HELP';
This tool erases using the current brush mask. If the specified drawable
contains an alpha channel, then the erased pixels will become transparent.
Otherwise, the eraser tool replaces the contents of the drawable with the
background color. Like paintbrush, this tool linearly interpolates between the
specified stroke coordinates.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
&stroke_arg,
{ name => 'hardness', type => 'enum BrushApplicationMode (no PRESSURE)',
desc => '%%desc%%' },
{ name => 'method', type => 'enum PaintApplicationMode',
desc => '%%desc%%' }
);
%invoke = (
headers => [ qw("tools/gimperasertool.h") ],
code => <<'CODE'
success = eraser_non_gui (drawable, num_strokes, strokes, hardness, method, TRUE);
CODE
);
}
sub anti_eraser {
$blurb = 'Anti-erase using the current brush.';
$help = <<'HELP';
This tool anti-erases using the current brush mask. If the specified drawable
contains an alpha channel, then the erased pixels will become opaque.
Otherwise, the eraser tool replaces the contents of the drawable with the
background color. Like paintbrush, this tool linearly interpolates between the
specified stroke coordinates.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
&stroke_arg,
{ name => 'hardness', type => 'enum BrushApplicationMode (no PRESSURE)',
desc => '%%desc%%' },
{ name => 'method', type => 'enum PaintApplicationMode',
desc => '%%desc%%' }
);
%invoke = (
headers => [ qw("tools/gimperasertool.h") ],
code => <<'CODE'
success = eraser_non_gui (drawable, num_strokes, strokes, hardness, method, TRUE);
CODE
);
}
sub paintbrush {
$blurb = <<'BLURB';
Paint in the current brush with optional fade out parameter and pull colors
from a gradient.
BLURB
$help = <<'HELP';
This tool is the standard paintbrush. It draws linearly interpolated lines
through the specified stroke coordinates. It operates on the specified drawable
in the foreground color with the active brush. The "fade_out" parameter is
measured in pixels and allows the brush stroke to linearly fall off. The
pressure is set to the maximum at the beginning of the stroke. As the distance
of the stroke nears the fade_out value, the pressure will approach zero. The
gradient_length is the distance to spread the gradient over. It is measured in
pixels. If the gradient_length is 0, no gradient is used.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
{ name => 'fade_out', type => '0 <= float',
desc => 'Fade out parameter: %%desc%%' },
&stroke_arg,
{ name => 'method', type => 'enum PaintApplicationMode',
desc => '%%desc%%' },
{ name => 'gradient_length', type => '0 <= float',
desc => 'Length of gradient to draw: %%desc%%' }
);
%invoke = (
headers => [ qw("tools/gimppaintbrushtool.h") ],
code => <<'CODE'
success = gimp_paintbrush_tool_non_gui (drawable, num_strokes, strokes,
fade_out, method, gradient_length);
CODE
);
}
sub paintbrush_default {
$blurb = <<'BLURB';
Paint in the current brush. The fade out parameter and pull colors
from a gradient parameter are set from the paintbrush options dialog. If this
dialog has not been activated then the dialog defaults will be used.
BLURB
$help = <<'HELP';
This tool is similar to the standard paintbrush. It draws linearly interpolated lines
through the specified stroke coordinates. It operates on the specified drawable
in the foreground color with the active brush. The "fade_out" parameter is
measured in pixels and allows the brush stroke to linearly fall
off (value obtained from the option dialog). The pressure is set
to the maximum at the beginning of the stroke. As the distance
of the stroke nears the fade_out value, the pressure will approach zero. The
gradient_length (value obtained from the option dialog) is the
distance to spread the gradient over. It is measured in pixels. If
the gradient_length is 0, no gradient is used.
HELP
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimppaintbrushtool.h") ],
code => <<'CODE'
success = gimp_paintbrush_tool_non_gui_default (drawable, num_strokes, strokes);
CODE
);
}
sub pencil {
$blurb = 'Paint in the current brush without sub-pixel sampling.';
$help = <<'HELP';
This tool is the standard pencil. It draws linearly interpolated lines through
the specified stroke coordinates. It operates on the specified drawable in the
foreground color with the active brush. The brush mask is treated as though it
contains only black and white values. Any value below half is treated as black;
any above half, as white.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimppenciltool.h") ],
code => 'success = pencil_non_gui (drawable, num_strokes, strokes);'
);
}
sub smudge {
$blurb = <<'BLURB';
Smudge image with varying pressure.
BLURB
$help = <<'HELP';
This tool simulates a smudge using the current brush. High pressure results
in a greater smudge of paint while low pressure results in a lesser smudge.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
{ name => 'pressure', type => '0 <= float <= 100',
desc => 'The pressure of the smudge strokes (%%desc%%)' },
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpsmudgetool.h") ],
code => <<'CODE'
success = gimp_smudge_tool_non_gui (drawable, pressure, num_strokes, strokes);
CODE
);
}
sub smudge_default {
$blurb = <<'BLURB';
Smudge image with varying pressure.
BLURB
$help = <<'HELP';
This tool simulates a smudge using the current brush. It behaves exactly
the same as gimp_smudge except that the pressure value is taken from the
smudge tool options or the options default if the tools option dialog has
not been activated.
HELP
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpsmudgetool.h") ],
code => <<'CODE'
success = gimp_smudge_tool_non_gui_default (drawable, num_strokes, strokes);
CODE
);
}
sub dodgeburn {
$blurb = <<'BLURB';
Dodgeburn image with varying exposure.
BLURB
$help = <<'HELP';
Dodgebure. More details here later.
HELP
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = (
&drawable_arg,
{ name => 'exposure', type => '0 <= float <= 100',
desc => 'The exposer of the strokes (%%desc%%)' },
{ name => 'dodgeburn_type', type => 'enum DodgeBurnType',
desc => 'The type either dodge or burn: { %%desc%% }' },
{ name => 'dodgeburn_mode', type => 'enum GimpTransferMode',
desc => 'The mode: { %%desc%% }' },
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpdodgeburntool.h") ],
code => <<'CODE'
success = gimp_dodgeburn_tool_non_gui (drawable, exposure, dodgeburn_type, dodgeburn_mode, num_strokes, strokes);
CODE
);
}
sub dodgeburn_default {
$blurb = <<'BLURB';
Dodgeburn image with varying exposure. This is the same as the gimp_dodgeburn
function except that the exposure, type and mode are taken from the tools
option dialog. If the dialog has not been activated then the defaults
as used by the dialog will be used.
BLURB
$help = <<'HELP';
Dodgeburn. More details here later.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpdodgeburntool.h") ],
code => <<'CODE'
success = gimp_dodgeburn_tool_non_gui_default (drawable, num_strokes, strokes);
CODE
);
}
# Incomplete
sub ink {
$blurb = 'Paint in the current brush without sub-pixel sampling.';
$help = 'fixme fixme';
&std_pdb_misc;
@inargs = (
&drawable_arg,
&stroke_arg
);
}
@headers = qw("libgimpmath/gimpmath.h" "core/gimpimage-mask-select.h"
"tools/tools-types.h" "core/gimpdrawable.h"
"base/tile-manager.h");
@procs = qw(airbrush airbrush_default blend bucket_fill clone clone_default
color_picker convolve convolve_default dodgeburn dodgeburn_default
eraser eraser_default paintbrush paintbrush_default
pencil smudge smudge_default);
@procs = qw(blend bucket_fill color_picker);
%exports = (app => [@procs], lib => [@procs]);
$desc = 'Tool procedures';
$desc = 'Misc Tool procedures';
1;

View File

@ -35,25 +35,6 @@ sub drawable_out_arg {
$arg;
}
sub sample_merged_arg () {{
name => 'sample_merged',
type => 'boolean',
desc => 'Use the composite image, not the drawable'
}}
sub threshold_arg () {{
name => 'threshold',
type => '0 <= int32 <= 255',
desc => 'Threshold in intensity levels %%desc%%'
}}
sub feather_select_args () {(
{ name => 'feather', type => 'boolean',
desc => 'Feather option for selections' },
{ name => 'feather_radius', type => 'float',
desc => 'Radius for feather operation' }
)}
sub stroke_arg () {
{ name => 'strokes', type => 'floatarray',
desc => 'Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ...,
@ -123,144 +104,6 @@ CODE
}
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 BlendMode',
desc => 'The type of blend: { %%desc%% }' },
{ name => 'paint_mode', type => 'enum GimpLayerModeEffects',
desc => 'The paint application mode: { %%desc%% }' },
{ name => 'gradient_type', type => 'enum GradientType',
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 RepeatMode',
desc => 'Repeat mode: { %%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 => '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_drawable_gimage (drawable))
{
success = FALSE;
}
else
{
gimp_drawable_blend (drawable,
blend_mode,
paint_mode,
gradient_type,
opacity / 100.0,
offset, repeat,
supersample, max_depth,
threshold,
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,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 BucketFillMode',
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") ],
code => <<'CODE'
{
if (! gimp_drawable_gimage (GIMP_DRAWABLE (drawable)))
{
success = FALSE;
}
else
{
gimp_drawable_bucket_fill (drawable, fill_mode,
paint_mode, opacity / 100.0,
threshold, sample_merged, x, y);
}
}
CODE
);
}
sub clone {
$blurb = <<'BLURB';
Clone from the source to the dest drawable using the current brush
@ -332,74 +175,6 @@ 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.
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' ] },
{ name => 'save_color', type => 'boolean',
desc => 'Save the color to the active palette' }
);
$inargs[1]->{no_success} = 1;
@outargs = (
{ name => 'color', type => 'color', void_ret => 1,
desc => 'The return color', init => 1 }
);
%invoke = (
headers => [ qw("tools/gimpcolorpickertool.h") ],
code => <<'CODE'
{
if (!sample_merged)
if (!drawable || (gimp_drawable_gimage (drawable) != gimage))
success = FALSE;
if (success)
success = pick_color (gimage, drawable, (int) x, (int) y,
sample_merged, sample_average, average_radius,
save_color);
if (success)
{
gimp_rgba_set_uchar (&color,
col_value[RED_PIX],
col_value[GREEN_PIX],
col_value[BLUE_PIX],
col_value[ALPHA_PIX]);
}
}
CODE
);
}
sub convolve_default {
$blurb = 'Convolve (Blur, Sharpen) using the current brush.';
@ -777,13 +552,17 @@ sub ink {
"tools/tools-types.h" "core/gimpdrawable.h"
"base/tile-manager.h");
@procs = qw(airbrush airbrush_default blend bucket_fill clone clone_default
color_picker convolve convolve_default dodgeburn dodgeburn_default
eraser eraser_default paintbrush paintbrush_default
pencil smudge smudge_default);
@procs = qw(airbrush airbrush_default
clone clone_default
convolve convolve_default
dodgeburn dodgeburn_default
eraser eraser_default
paintbrush paintbrush_default
pencil
smudge smudge_default);
%exports = (app => [@procs], lib => [@procs]);
$desc = 'Tool procedures';
$desc = 'Paint Tool procedures';
1;

View File

@ -17,7 +17,7 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
# Tools
# Selection Tools
# shortcuts
@ -60,6 +60,7 @@ sub feather_select_args () {(
desc => 'Radius for feather operation' }
)}
# The defs
sub by_color_select {

View File

@ -1,789 +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>
# Tools
# shortcuts
sub drawable_arg () {{
name => 'drawable',
type => 'drawable',
desc => 'The affected drawable',
}}
sub drawable_out_arg {
my $type = shift;
my $arg = &drawable_arg;
$arg->{desc} = "The $type drawable";
$arg->{no_declare} = 1;
$arg;
}
sub sample_merged_arg () {{
name => 'sample_merged',
type => 'boolean',
desc => 'Use the composite image, not the drawable'
}}
sub threshold_arg () {{
name => 'threshold',
type => '0 <= int32 <= 255',
desc => 'Threshold in intensity levels %%desc%%'
}}
sub feather_select_args () {(
{ name => 'feather', type => 'boolean',
desc => 'Feather option for selections' },
{ name => 'feather_radius', type => 'float',
desc => 'Radius for feather operation' }
)}
sub stroke_arg () {
{ name => 'strokes', type => 'floatarray',
desc => 'Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ...,
sn.x, sn.y }',
array => { type => '2 <= int32', on_success => 'num_strokes /= 2;',
desc => 'Number of stroke control points (count each
coordinate as 2 points)' } }
}
# The defs
sub airbrush {
$blurb = <<'BLURB';
Paint in the current brush with varying pressure. Paint application is
time-dependent.
BLURB
$help = <<'HELP';
This tool simulates the use of an airbrush. Paint pressure represents the
relative intensity of the paint application. High pressure results in a thicker
layer of paint while low pressure results in a thinner layer.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
{ name => 'pressure', type => '0 <= float <= 100',
desc => 'The pressure of the airbrush strokes (%%desc%%)' },
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpairbrushtool.h") ],
code => <<'CODE'
success = airbrush_non_gui (drawable, pressure, num_strokes, strokes);
CODE
);
}
sub airbrush_default {
$blurb = <<'BLURB';
Paint in the current brush with varying pressure. Paint application is
time-dependent.
BLURB
$help = <<'HELP';
This tool simulates the use of an airbrush. It is similar to gimp_airbrush
except that the pressure is derived from the airbrush tools options box.
It the option has not been set the default for the option will be used.
HELP
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpairbrushtool.h") ],
code => <<'CODE'
success = airbrush_non_gui_default (drawable, num_strokes, strokes);
CODE
);
}
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 BlendMode',
desc => 'The type of blend: { %%desc%% }' },
{ name => 'paint_mode', type => 'enum GimpLayerModeEffects',
desc => 'The paint application mode: { %%desc%% }' },
{ name => 'gradient_type', type => 'enum GradientType',
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 RepeatMode',
desc => 'Repeat mode: { %%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 => '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_drawable_gimage (drawable))
{
success = FALSE;
}
else
{
gimp_drawable_blend (drawable,
blend_mode,
paint_mode,
gradient_type,
opacity / 100.0,
offset, repeat,
supersample, max_depth,
threshold,
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,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 BucketFillMode',
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") ],
code => <<'CODE'
{
if (! gimp_drawable_gimage (GIMP_DRAWABLE (drawable)))
{
success = FALSE;
}
else
{
gimp_drawable_bucket_fill (drawable, fill_mode,
paint_mode, opacity / 100.0,
threshold, sample_merged, x, y);
}
}
CODE
);
}
sub clone {
$blurb = <<'BLURB';
Clone from the source to the dest drawable using the current brush
BLURB
$help = <<'HELP';
This tool clones (copies) from the source drawable starting at the specified
source coordinates to the dest drawable. If the "clone_type" argument is set
to PATTERN-CLONE, then the current pattern is used as the source and the
"src_drawable" argument is ignored. Pattern cloning assumes a tileable
pattern and mods the sum of the src coordinates and subsequent stroke offsets
with the width and height of the pattern. For image cloning, if the sum of the
src coordinates and subsequent stroke offsets exceeds the extents of the src
drawable, then no paint is transferred. The clone tool is capable of
transforming between any image types including RGB->Indexed--although
converting from any type to indexed is significantly slower.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
{ name => 'src_drawable', type => 'drawable',
desc => 'The source drawable' },
{ name => 'clone_type', type => 'enum CloneType',
desc => 'The type of clone: { %%desc%% }' },
{ name => 'src_x', type => 'float',
desc => 'The x coordinate in the source image' },
{ name => 'src_y', type => 'float',
desc => 'The y coordinate in the source image' },
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpclonetool.h") ],
code => <<'CODE'
success = clone_non_gui (drawable, src_drawable, clone_type, src_x, src_y,
num_strokes, strokes);
CODE
);
}
sub clone_default {
$blurb = <<'BLURB';
Clone from the source to the dest drawable using the current brush
BLURB
$help = <<'HELP';
This tool clones (copies) from the source drawable starting at the specified
source coordinates to the dest drawable. This function performs exactly
the same as the gimp_clone function except that the tools arguments are
obtained from the clones option dialog. It this dialog has not been activated
then the dialogs default values will be used.
HELP
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpclonetool.h") ],
code => <<'CODE'
success = clone_non_gui_default (drawable, num_strokes, strokes);
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.
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' ] },
{ name => 'save_color', type => 'boolean',
desc => 'Save the color to the active palette' }
);
$inargs[1]->{no_success} = 1;
@outargs = (
{ name => 'color', type => 'color', void_ret => 1,
desc => 'The return color', init => 1 }
);
%invoke = (
headers => [ qw("tools/gimpcolorpickertool.h") ],
code => <<'CODE'
{
if (!sample_merged)
if (!drawable || (gimp_drawable_gimage (drawable) != gimage))
success = FALSE;
if (success)
success = pick_color (gimage, drawable, (int) x, (int) y,
sample_merged, sample_average, average_radius,
save_color);
if (success)
{
gimp_rgba_set_uchar (&color,
col_value[RED_PIX],
col_value[GREEN_PIX],
col_value[BLUE_PIX],
col_value[ALPHA_PIX]);
}
}
CODE
);
}
sub convolve_default {
$blurb = 'Convolve (Blur, Sharpen) using the current brush.';
$help = <<'HELP';
This tool convolves the specified drawable with either a sharpening or blurring
kernel. This function performs exactly the same as the gimp_convolve
function except that the tools arguments are obtained from the convolve
option dialog. It this dialog has not been activated then the dialogs
default values will be used.
HELP
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpconvolvetool.h") ],
code => <<'CODE'
success = convolve_non_gui_default (drawable, num_strokes, strokes);
CODE
);
}
sub convolve {
$blurb = 'Convolve (Blur, Sharpen) using the current brush.';
$help = <<'HELP';
This tool convolves the specified drawable with either a sharpening or blurring
kernel. The pressure parameter controls the magnitude of the operation. Like
the paintbrush, this tool linearly interpolates between the specified stroke
coordinates.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
{ name => 'pressure', type => '0 <= float <= 100',
desc => 'The pressure: %%desc%%' },
{ name => 'convolve_type',
type => 'enum ConvolveType (no CUSTOM_CONVOLVE)',
desc => 'Convolve type: { %%desc%% }' },
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpconvolvetool.h") ],
code => <<'CODE'
success = convolve_non_gui (drawable, pressure, convolve_type, num_strokes, strokes);
CODE
);
}
sub eraser_default {
$blurb = 'Erase using the current brush.';
$help = <<'HELP';
This tool erases using the current brush mask. This function performs exactly
the same as the gimp_eraser function except that the tools arguments are
obtained from the eraser option dialog. It this dialog has not been activated
then the dialogs default values will be used.
HELP
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimperasertool.h") ],
code => <<'CODE'
success = eraser_non_gui_default (drawable, num_strokes, strokes);
CODE
);
}
sub eraser {
$blurb = 'Erase using the current brush.';
$help = <<'HELP';
This tool erases using the current brush mask. If the specified drawable
contains an alpha channel, then the erased pixels will become transparent.
Otherwise, the eraser tool replaces the contents of the drawable with the
background color. Like paintbrush, this tool linearly interpolates between the
specified stroke coordinates.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
&stroke_arg,
{ name => 'hardness', type => 'enum BrushApplicationMode (no PRESSURE)',
desc => '%%desc%%' },
{ name => 'method', type => 'enum PaintApplicationMode',
desc => '%%desc%%' }
);
%invoke = (
headers => [ qw("tools/gimperasertool.h") ],
code => <<'CODE'
success = eraser_non_gui (drawable, num_strokes, strokes, hardness, method, TRUE);
CODE
);
}
sub anti_eraser {
$blurb = 'Anti-erase using the current brush.';
$help = <<'HELP';
This tool anti-erases using the current brush mask. If the specified drawable
contains an alpha channel, then the erased pixels will become opaque.
Otherwise, the eraser tool replaces the contents of the drawable with the
background color. Like paintbrush, this tool linearly interpolates between the
specified stroke coordinates.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
&stroke_arg,
{ name => 'hardness', type => 'enum BrushApplicationMode (no PRESSURE)',
desc => '%%desc%%' },
{ name => 'method', type => 'enum PaintApplicationMode',
desc => '%%desc%%' }
);
%invoke = (
headers => [ qw("tools/gimperasertool.h") ],
code => <<'CODE'
success = eraser_non_gui (drawable, num_strokes, strokes, hardness, method, TRUE);
CODE
);
}
sub paintbrush {
$blurb = <<'BLURB';
Paint in the current brush with optional fade out parameter and pull colors
from a gradient.
BLURB
$help = <<'HELP';
This tool is the standard paintbrush. It draws linearly interpolated lines
through the specified stroke coordinates. It operates on the specified drawable
in the foreground color with the active brush. The "fade_out" parameter is
measured in pixels and allows the brush stroke to linearly fall off. The
pressure is set to the maximum at the beginning of the stroke. As the distance
of the stroke nears the fade_out value, the pressure will approach zero. The
gradient_length is the distance to spread the gradient over. It is measured in
pixels. If the gradient_length is 0, no gradient is used.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
{ name => 'fade_out', type => '0 <= float',
desc => 'Fade out parameter: %%desc%%' },
&stroke_arg,
{ name => 'method', type => 'enum PaintApplicationMode',
desc => '%%desc%%' },
{ name => 'gradient_length', type => '0 <= float',
desc => 'Length of gradient to draw: %%desc%%' }
);
%invoke = (
headers => [ qw("tools/gimppaintbrushtool.h") ],
code => <<'CODE'
success = gimp_paintbrush_tool_non_gui (drawable, num_strokes, strokes,
fade_out, method, gradient_length);
CODE
);
}
sub paintbrush_default {
$blurb = <<'BLURB';
Paint in the current brush. The fade out parameter and pull colors
from a gradient parameter are set from the paintbrush options dialog. If this
dialog has not been activated then the dialog defaults will be used.
BLURB
$help = <<'HELP';
This tool is similar to the standard paintbrush. It draws linearly interpolated lines
through the specified stroke coordinates. It operates on the specified drawable
in the foreground color with the active brush. The "fade_out" parameter is
measured in pixels and allows the brush stroke to linearly fall
off (value obtained from the option dialog). The pressure is set
to the maximum at the beginning of the stroke. As the distance
of the stroke nears the fade_out value, the pressure will approach zero. The
gradient_length (value obtained from the option dialog) is the
distance to spread the gradient over. It is measured in pixels. If
the gradient_length is 0, no gradient is used.
HELP
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimppaintbrushtool.h") ],
code => <<'CODE'
success = gimp_paintbrush_tool_non_gui_default (drawable, num_strokes, strokes);
CODE
);
}
sub pencil {
$blurb = 'Paint in the current brush without sub-pixel sampling.';
$help = <<'HELP';
This tool is the standard pencil. It draws linearly interpolated lines through
the specified stroke coordinates. It operates on the specified drawable in the
foreground color with the active brush. The brush mask is treated as though it
contains only black and white values. Any value below half is treated as black;
any above half, as white.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimppenciltool.h") ],
code => 'success = pencil_non_gui (drawable, num_strokes, strokes);'
);
}
sub smudge {
$blurb = <<'BLURB';
Smudge image with varying pressure.
BLURB
$help = <<'HELP';
This tool simulates a smudge using the current brush. High pressure results
in a greater smudge of paint while low pressure results in a lesser smudge.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
{ name => 'pressure', type => '0 <= float <= 100',
desc => 'The pressure of the smudge strokes (%%desc%%)' },
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpsmudgetool.h") ],
code => <<'CODE'
success = gimp_smudge_tool_non_gui (drawable, pressure, num_strokes, strokes);
CODE
);
}
sub smudge_default {
$blurb = <<'BLURB';
Smudge image with varying pressure.
BLURB
$help = <<'HELP';
This tool simulates a smudge using the current brush. It behaves exactly
the same as gimp_smudge except that the pressure value is taken from the
smudge tool options or the options default if the tools option dialog has
not been activated.
HELP
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpsmudgetool.h") ],
code => <<'CODE'
success = gimp_smudge_tool_non_gui_default (drawable, num_strokes, strokes);
CODE
);
}
sub dodgeburn {
$blurb = <<'BLURB';
Dodgeburn image with varying exposure.
BLURB
$help = <<'HELP';
Dodgebure. More details here later.
HELP
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = (
&drawable_arg,
{ name => 'exposure', type => '0 <= float <= 100',
desc => 'The exposer of the strokes (%%desc%%)' },
{ name => 'dodgeburn_type', type => 'enum DodgeBurnType',
desc => 'The type either dodge or burn: { %%desc%% }' },
{ name => 'dodgeburn_mode', type => 'enum GimpTransferMode',
desc => 'The mode: { %%desc%% }' },
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpdodgeburntool.h") ],
code => <<'CODE'
success = gimp_dodgeburn_tool_non_gui (drawable, exposure, dodgeburn_type, dodgeburn_mode, num_strokes, strokes);
CODE
);
}
sub dodgeburn_default {
$blurb = <<'BLURB';
Dodgeburn image with varying exposure. This is the same as the gimp_dodgeburn
function except that the exposure, type and mode are taken from the tools
option dialog. If the dialog has not been activated then the defaults
as used by the dialog will be used.
BLURB
$help = <<'HELP';
Dodgeburn. More details here later.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
&stroke_arg
);
%invoke = (
headers => [ qw("tools/gimpdodgeburntool.h") ],
code => <<'CODE'
success = gimp_dodgeburn_tool_non_gui_default (drawable, num_strokes, strokes);
CODE
);
}
# Incomplete
sub ink {
$blurb = 'Paint in the current brush without sub-pixel sampling.';
$help = 'fixme fixme';
&std_pdb_misc;
@inargs = (
&drawable_arg,
&stroke_arg
);
}
@headers = qw("libgimpmath/gimpmath.h" "core/gimpimage-mask-select.h"
"tools/tools-types.h" "core/gimpdrawable.h"
"base/tile-manager.h");
@procs = qw(airbrush airbrush_default blend bucket_fill clone clone_default
color_picker convolve convolve_default dodgeburn dodgeburn_default
eraser eraser_default paintbrush paintbrush_default
pencil smudge smudge_default);
%exports = (app => [@procs], lib => [@procs]);
$desc = 'Tool procedures';
1;

View File

@ -17,7 +17,7 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
# Tools
# Transform Tools
# shortcuts
@ -35,6 +35,7 @@ sub drawable_out_arg {
$arg;
}
# The defs
sub flip {