1999-04-18 21:22:41 +00:00
/* The GIMP -- an image manipulation program
2000-02-17 11:44:27 +00:00
* Copyright ( C ) 1995 - 2000 Spencer Kimball and Peter Mattis
1999-04-18 21:22:41 +00:00
*
* 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. */
2000-12-29 15:22:01 +00:00
# include "config.h"
# include <gtk/gtk.h>
2001-05-21 13:58:46 +00:00
# include "libgimpbase/gimpbasetypes.h"
2001-08-17 14:27:31 +00:00
# include "pdb-types.h"
2001-05-09 22:34:59 +00:00
# include "tools/tools-types.h"
1999-04-18 21:22:41 +00:00
# include "procedural_db.h"
2001-12-08 23:12:59 +00:00
# include "base/base-enums.h"
2001-05-15 11:25:25 +00:00
# include "base/tile-manager.h"
2001-08-01 02:01:49 +00:00
# include "core/core-types.h"
2001-11-09 16:54:56 +00:00
# include "core/gimpdrawable-blend.h"
2001-11-08 19:14:51 +00:00
# include "core/gimpdrawable-bucket-fill.h"
2001-05-09 02:32:03 +00:00
# include "core/gimpdrawable.h"
2001-10-22 12:13:44 +00:00
# include "core/gimpimage-mask-select.h"
2001-05-09 02:32:03 +00:00
# include "core/gimpimage.h"
2001-03-08 01:07:03 +00:00
# include "tools/gimpairbrushtool.h"
# include "tools/gimpclonetool.h"
2001-02-28 15:01:02 +00:00
# include "tools/gimpcolorpickertool.h"
2001-03-08 01:07:03 +00:00
# include "tools/gimpconvolvetool.h"
# include "tools/gimpdodgeburntool.h"
# include "tools/gimperasertool.h"
2001-02-27 05:21:12 +00:00
# include "tools/gimppaintbrushtool.h"
2001-03-08 01:07:03 +00:00
# include "tools/gimppenciltool.h"
# include "tools/gimpsmudgetool.h"
1999-04-18 21:22:41 +00:00
2001-01-25 01:20:05 +00:00
# include "libgimpcolor/gimpcolor.h"
2001-01-24 22:36:18 +00:00
# include "libgimpmath/gimpmath.h"
1999-04-18 21:22:41 +00:00
static ProcRecord airbrush_proc ;
1999-07-19 22:42:49 +00:00
static ProcRecord airbrush_default_proc ;
1999-04-18 21:22:41 +00:00
static ProcRecord blend_proc ;
static ProcRecord bucket_fill_proc ;
static ProcRecord clone_proc ;
1999-07-19 22:42:49 +00:00
static ProcRecord clone_default_proc ;
1999-04-18 21:22:41 +00:00
static ProcRecord color_picker_proc ;
static ProcRecord convolve_proc ;
1999-07-19 22:42:49 +00:00
static ProcRecord convolve_default_proc ;
static ProcRecord dodgeburn_proc ;
static ProcRecord dodgeburn_default_proc ;
1999-04-18 21:22:41 +00:00
static ProcRecord eraser_proc ;
1999-07-19 22:42:49 +00:00
static ProcRecord eraser_default_proc ;
1999-04-18 21:22:41 +00:00
static ProcRecord paintbrush_proc ;
1999-07-19 22:42:49 +00:00
static ProcRecord paintbrush_default_proc ;
1999-04-18 21:22:41 +00:00
static ProcRecord pencil_proc ;
1999-07-19 22:42:49 +00:00
static ProcRecord smudge_proc ;
static ProcRecord smudge_default_proc ;
1999-04-18 21:22:41 +00:00
void
2001-07-04 19:31:35 +00:00
register_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 ) ;
procedural_db_register ( gimp , & dodgeburn_default_proc ) ;
procedural_db_register ( gimp , & eraser_proc ) ;
procedural_db_register ( gimp , & eraser_default_proc ) ;
procedural_db_register ( gimp , & paintbrush_proc ) ;
procedural_db_register ( gimp , & paintbrush_default_proc ) ;
procedural_db_register ( gimp , & pencil_proc ) ;
procedural_db_register ( gimp , & smudge_proc ) ;
procedural_db_register ( gimp , & smudge_default_proc ) ;
1999-04-18 21:22:41 +00:00
}
static Argument *
2001-07-04 19:31:35 +00:00
airbrush_invoker ( Gimp * gimp ,
Argument * args )
1999-04-18 21:22:41 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gdouble pressure ;
gint32 num_strokes ;
gdouble * strokes ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-04-18 21:22:41 +00:00
if ( drawable = = NULL )
success = FALSE ;
pressure = args [ 1 ] . value . pdb_float ;
if ( pressure < 0.0 | | pressure > 100.0 )
success = FALSE ;
num_strokes = args [ 2 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 3 ] . value . pdb_pointer ;
if ( success )
success = airbrush_non_gui ( drawable , pressure , num_strokes , strokes ) ;
return procedural_db_return_args ( & airbrush_proc , success ) ;
}
static ProcArg airbrush_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-04-18 21:22:41 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" pressure " ,
" The pressure of the airbrush strokes (0 <= pressure <= 100) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-04-18 21:22:41 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
}
} ;
static ProcRecord airbrush_proc =
{
" gimp_airbrush " ,
" Paint in the current brush with varying pressure. Paint application is time-dependent. " ,
" 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. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-18 21:22:41 +00:00
4 ,
airbrush_inargs ,
0 ,
NULL ,
{ { airbrush_invoker } }
} ;
1999-07-19 22:42:49 +00:00
static Argument *
2001-07-04 19:31:35 +00:00
airbrush_default_invoker ( Gimp * gimp ,
Argument * args )
1999-07-19 22:42:49 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 num_strokes ;
gdouble * strokes ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-07-19 22:42:49 +00:00
if ( drawable = = NULL )
success = FALSE ;
num_strokes = args [ 1 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 2 ] . value . pdb_pointer ;
if ( success )
success = airbrush_non_gui_default ( drawable , num_strokes , strokes ) ;
return procedural_db_return_args ( & airbrush_default_proc , success ) ;
}
static ProcArg airbrush_default_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-07-19 22:42:49 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-07-19 22:42:49 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-07-19 22:42:49 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
}
} ;
static ProcRecord airbrush_default_proc =
{
" gimp_airbrush_default " ,
" Paint in the current brush with varying pressure. Paint application is time-dependent. " ,
" 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. " ,
" Andy Thomas " ,
" Andy Thomas " ,
" 1999 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-07-19 22:42:49 +00:00
3 ,
airbrush_default_inargs ,
0 ,
NULL ,
{ { airbrush_default_invoker } }
} ;
1999-04-18 21:22:41 +00:00
static Argument *
2001-07-04 19:31:35 +00:00
blend_invoker ( Gimp * gimp ,
Argument * args )
1999-04-18 21:22:41 +00:00
{
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 ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-04-18 21:22:41 +00:00
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 ;
2001-12-08 23:12:59 +00:00
if ( paint_mode < GIMP_NORMAL_MODE | | paint_mode > GIMP_COLOR_ERASE_MODE )
1999-04-18 21:22:41 +00:00
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 )
{
2001-11-09 16:54:56 +00:00
if ( ! gimp_drawable_gimage ( drawable ) )
{
success = FALSE ;
}
else
{
gimp_drawable_blend ( drawable ,
2001-11-15 23:15:52 +00:00
blend_mode ,
paint_mode ,
gradient_type ,
opacity / 100.0 ,
offset , repeat ,
supersample , max_depth ,
threshold ,
2001-11-09 16:54:56 +00:00
x1 , y1 , x2 , y2 ,
NULL , NULL ) ;
}
1999-04-18 21:22:41 +00:00
}
return procedural_db_return_args ( & blend_proc , success ) ;
}
static ProcArg blend_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-04-18 21:22:41 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" blend_mode " ,
" The type of blend: { FG_BG_RGB (0), FG_BG_HSV (1), FG_TRANS (2), CUSTOM (3) } "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" paint_mode " ,
2001-12-08 23:12:59 +00:00
" 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) } "
1999-04-18 21:22:41 +00:00
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" 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) } "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" opacity " ,
" The opacity of the final blend (0 <= opacity <= 100) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" offset " ,
" Offset relates to the starting and ending coordinates specified for the blend. This parameter is mode dependent (0 <= offset) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" repeat " ,
" Repeat mode: { REPEAT_NONE (0), REPEAT_SAWTOOTH (1), REPEAT_TRIANGULAR (2) } "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" supersample " ,
" Do adaptive supersampling (TRUE or FALSE) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" max_depth " ,
" Maximum recursion levels for supersampling "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" threshold " ,
" Supersampling threshold "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" x1 " ,
" The x coordinate of this blend's starting point "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" y1 " ,
" The y coordinate of this blend's starting point "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" x2 " ,
" The x coordinate of this blend's ending point "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" 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 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-18 21:22:41 +00:00
14 ,
blend_inargs ,
0 ,
NULL ,
{ { blend_invoker } }
} ;
static Argument *
2001-07-04 19:31:35 +00:00
bucket_fill_invoker ( Gimp * gimp ,
Argument * args )
1999-04-18 21:22:41 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 fill_mode ;
gint32 paint_mode ;
gdouble opacity ;
gdouble threshold ;
gboolean sample_merged ;
gdouble x ;
gdouble y ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-04-18 21:22:41 +00:00
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 ;
2001-12-08 23:12:59 +00:00
if ( paint_mode < GIMP_NORMAL_MODE | | paint_mode > GIMP_COLOR_ERASE_MODE )
1999-04-18 21:22:41 +00:00
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 )
{
2001-11-08 19:14:51 +00:00
if ( ! gimp_drawable_gimage ( GIMP_DRAWABLE ( drawable ) ) )
{
success = FALSE ;
}
else
{
2001-11-15 23:15:52 +00:00
gimp_drawable_bucket_fill ( drawable , fill_mode ,
paint_mode , opacity / 100.0 ,
2001-11-08 19:14:51 +00:00
threshold , sample_merged , x , y ) ;
}
1999-04-18 21:22:41 +00:00
}
return procedural_db_return_args ( & bucket_fill_proc , success ) ;
}
static ProcArg bucket_fill_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-04-18 21:22:41 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" fill_mode " ,
" The type of fill: { FG_BUCKET_FILL (0), BG_BUCKET_FILL (1), PATTERN_BUCKET_FILL (2) } "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" paint_mode " ,
2001-12-08 23:12:59 +00:00
" 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) } "
1999-04-18 21:22:41 +00:00
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" opacity " ,
" The opacity of the final bucket fill (0 <= opacity <= 100) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" 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. "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" sample_merged " ,
" Use the composite image, not the drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" x " ,
" The x coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image. "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" 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 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-18 21:22:41 +00:00
8 ,
bucket_fill_inargs ,
0 ,
NULL ,
{ { bucket_fill_invoker } }
} ;
static Argument *
2001-07-04 19:31:35 +00:00
clone_invoker ( Gimp * gimp ,
Argument * args )
1999-04-18 21:22:41 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
GimpDrawable * src_drawable ;
gint32 clone_type ;
gdouble src_x ;
gdouble src_y ;
gint32 num_strokes ;
gdouble * strokes ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-04-18 21:22:41 +00:00
if ( drawable = = NULL )
success = FALSE ;
2001-07-11 12:39:49 +00:00
src_drawable = gimp_drawable_get_by_ID ( gimp , args [ 1 ] . value . pdb_int ) ;
1999-04-18 21:22:41 +00:00
if ( src_drawable = = NULL )
success = FALSE ;
clone_type = args [ 2 ] . value . pdb_int ;
if ( clone_type < IMAGE_CLONE | | clone_type > PATTERN_CLONE )
success = FALSE ;
src_x = args [ 3 ] . value . pdb_float ;
src_y = args [ 4 ] . value . pdb_float ;
num_strokes = args [ 5 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 6 ] . value . pdb_pointer ;
if ( success )
success = clone_non_gui ( drawable , src_drawable , clone_type , src_x , src_y ,
1999-04-24 20:33:31 +00:00
num_strokes , strokes ) ;
1999-04-18 21:22:41 +00:00
return procedural_db_return_args ( & clone_proc , success ) ;
}
static ProcArg clone_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-04-18 21:22:41 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-04-18 21:22:41 +00:00
" src_drawable " ,
" The source drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" clone_type " ,
" The type of clone: { IMAGE_CLONE (0), PATTERN_CLONE (1) } "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" src_x " ,
" The x coordinate in the source image "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" src_y " ,
" The y coordinate in the source image "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-04-18 21:22:41 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
}
} ;
static ProcRecord clone_proc =
{
" gimp_clone " ,
" Clone from the source to the dest drawable using the current brush " ,
" 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. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-18 21:22:41 +00:00
7 ,
clone_inargs ,
0 ,
NULL ,
{ { clone_invoker } }
} ;
1999-07-19 22:42:49 +00:00
static Argument *
2001-07-04 19:31:35 +00:00
clone_default_invoker ( Gimp * gimp ,
Argument * args )
1999-07-19 22:42:49 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 num_strokes ;
gdouble * strokes ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-07-19 22:42:49 +00:00
if ( drawable = = NULL )
success = FALSE ;
num_strokes = args [ 1 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 2 ] . value . pdb_pointer ;
if ( success )
success = clone_non_gui_default ( drawable , num_strokes , strokes ) ;
return procedural_db_return_args ( & clone_default_proc , success ) ;
}
static ProcArg clone_default_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-07-19 22:42:49 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-07-19 22:42:49 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-07-19 22:42:49 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
}
} ;
static ProcRecord clone_default_proc =
{
" gimp_clone_default " ,
" Clone from the source to the dest drawable using the current brush " ,
" 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. " ,
" Andy Thomas " ,
" Andy Thomas " ,
" 1999 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-07-19 22:42:49 +00:00
3 ,
clone_default_inargs ,
0 ,
NULL ,
{ { clone_default_invoker } }
} ;
1999-04-18 21:22:41 +00:00
static Argument *
2001-07-04 19:31:35 +00:00
color_picker_invoker ( Gimp * gimp ,
Argument * args )
1999-04-18 21:22:41 +00:00
{
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 ;
2001-01-25 14:38:10 +00:00
GimpRGB color ;
1999-04-18 21:22:41 +00:00
2001-07-11 12:39:49 +00:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-04-18 21:22:41 +00:00
if ( gimage = = NULL )
success = FALSE ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 1 ] . value . pdb_int ) ;
1999-04-18 21:22:41 +00:00
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 )
2001-01-14 21:11:52 +00:00
if ( ! drawable | | ( gimp_drawable_gimage ( drawable ) ! = gimage ) )
1999-04-18 21:22:41 +00:00
success = FALSE ;
if ( success )
success = pick_color ( gimage , drawable , ( int ) x , ( int ) y ,
1999-04-24 20:33:31 +00:00
sample_merged , sample_average , average_radius ,
save_color ) ;
1999-04-18 21:22:41 +00:00
if ( success )
{
2001-01-25 14:38:10 +00:00
gimp_rgba_set_uchar ( & color ,
2001-01-25 01:20:05 +00:00
col_value [ RED_PIX ] ,
col_value [ GREEN_PIX ] ,
col_value [ BLUE_PIX ] ,
col_value [ ALPHA_PIX ] ) ;
1999-04-18 21:22:41 +00:00
}
}
return_args = procedural_db_return_args ( & color_picker_proc , success ) ;
if ( success )
2001-01-25 14:38:10 +00:00
return_args [ 1 ] . value . pdb_color = color ;
1999-04-18 21:22:41 +00:00
return return_args ;
}
static ProcArg color_picker_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_IMAGE ,
1999-04-18 21:22:41 +00:00
" image " ,
" The image "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-04-18 21:22:41 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" x " ,
" x coordinate of upper-left corner of rectangle "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" y " ,
" y coordinate of upper-left corner of rectangle "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" sample_merged " ,
" Use the composite image, not the drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" sample_average " ,
" Average the color of all the pixels in a specified radius "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" average_radius " ,
" The radius of pixels to average "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" save_color " ,
" Save the color to the active palette "
}
} ;
static ProcArg color_picker_outargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_COLOR ,
1999-04-18 21:22:41 +00:00
" 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 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-18 21:22:41 +00:00
8 ,
color_picker_inargs ,
1 ,
color_picker_outargs ,
{ { color_picker_invoker } }
} ;
static Argument *
2001-07-04 19:31:35 +00:00
convolve_invoker ( Gimp * gimp ,
Argument * args )
1999-04-18 21:22:41 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gdouble pressure ;
gint32 convolve_type ;
gint32 num_strokes ;
gdouble * strokes ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-04-18 21:22:41 +00:00
if ( drawable = = NULL )
success = FALSE ;
pressure = args [ 1 ] . value . pdb_float ;
if ( pressure < 0.0 | | pressure > 100.0 )
success = FALSE ;
convolve_type = args [ 2 ] . value . pdb_int ;
if ( convolve_type < BLUR_CONVOLVE | | convolve_type > SHARPEN_CONVOLVE )
success = FALSE ;
num_strokes = args [ 3 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 4 ] . value . pdb_pointer ;
if ( success )
1999-07-19 22:42:49 +00:00
success = convolve_non_gui ( drawable , pressure , convolve_type , num_strokes , strokes ) ;
1999-04-18 21:22:41 +00:00
return procedural_db_return_args ( & convolve_proc , success ) ;
}
static ProcArg convolve_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-04-18 21:22:41 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" pressure " ,
" The pressure: 0 <= pressure <= 100 "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" convolve_type " ,
1999-07-28 23:00:08 +00:00
" Convolve type: { BLUR_CONVOLVE (0), SHARPEN_CONVOLVE (1) } "
1999-04-18 21:22:41 +00:00
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-04-18 21:22:41 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
}
} ;
static ProcRecord convolve_proc =
{
" gimp_convolve " ,
" Convolve (Blur, Sharpen) using the current brush. " ,
" 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. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-18 21:22:41 +00:00
5 ,
convolve_inargs ,
0 ,
NULL ,
{ { convolve_invoker } }
} ;
1999-07-19 22:42:49 +00:00
static Argument *
2001-07-04 19:31:35 +00:00
convolve_default_invoker ( Gimp * gimp ,
Argument * args )
1999-07-19 22:42:49 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 num_strokes ;
gdouble * strokes ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-07-19 22:42:49 +00:00
if ( drawable = = NULL )
success = FALSE ;
num_strokes = args [ 1 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 2 ] . value . pdb_pointer ;
if ( success )
success = convolve_non_gui_default ( drawable , num_strokes , strokes ) ;
return procedural_db_return_args ( & convolve_default_proc , success ) ;
}
static ProcArg convolve_default_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-07-19 22:42:49 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-07-19 22:42:49 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-07-19 22:42:49 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
}
} ;
static ProcRecord convolve_default_proc =
{
" gimp_convolve_default " ,
" Convolve (Blur, Sharpen) using the current brush. " ,
" 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. " ,
" Andy Thomas " ,
" Andy Thomas " ,
" 1999 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-07-19 22:42:49 +00:00
3 ,
convolve_default_inargs ,
0 ,
NULL ,
{ { convolve_default_invoker } }
} ;
static Argument *
2001-07-04 19:31:35 +00:00
dodgeburn_invoker ( Gimp * gimp ,
Argument * args )
1999-07-19 22:42:49 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gdouble exposure ;
gint32 dodgeburn_type ;
gint32 dodgeburn_mode ;
gint32 num_strokes ;
gdouble * strokes ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-07-19 22:42:49 +00:00
if ( drawable = = NULL )
success = FALSE ;
exposure = args [ 1 ] . value . pdb_float ;
if ( exposure < 0.0 | | exposure > 100.0 )
success = FALSE ;
dodgeburn_type = args [ 2 ] . value . pdb_int ;
if ( dodgeburn_type < DODGE | | dodgeburn_type > BURN )
success = FALSE ;
dodgeburn_mode = args [ 3 ] . value . pdb_int ;
2001-08-01 02:01:49 +00:00
if ( dodgeburn_mode < GIMP_SHADOWS | | dodgeburn_mode > GIMP_HIGHLIGHTS )
1999-07-19 22:42:49 +00:00
success = FALSE ;
num_strokes = args [ 4 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 5 ] . value . pdb_pointer ;
if ( success )
2001-04-07 11:01:22 +00:00
success = gimp_dodgeburn_tool_non_gui ( drawable , exposure , dodgeburn_type , dodgeburn_mode , num_strokes , strokes ) ;
1999-07-19 22:42:49 +00:00
return procedural_db_return_args ( & dodgeburn_proc , success ) ;
}
static ProcArg dodgeburn_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-07-19 22:42:49 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-07-19 22:42:49 +00:00
" exposure " ,
" The exposer of the strokes (0 <= exposure <= 100) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-07-19 22:42:49 +00:00
" dodgeburn_type " ,
" The type either dodge or burn: { DODGE (0), BURN (1) } "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-07-19 22:42:49 +00:00
" dodgeburn_mode " ,
2001-12-07 16:10:53 +00:00
" The mode: { GIMP_SHADOWS (0), GIMP_MIDTONES (1), GIMP_HIGHLIGHTS (2) } "
1999-07-19 22:42:49 +00:00
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-07-19 22:42:49 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-07-19 22:42:49 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
}
} ;
static ProcRecord dodgeburn_proc =
{
" gimp_dodgeburn " ,
" Dodgeburn image with varying exposure. " ,
" Dodgebure. More details here later. " ,
" Andy Thomas " ,
" Andy Thomas " ,
" 1999 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-07-19 22:42:49 +00:00
6 ,
dodgeburn_inargs ,
0 ,
NULL ,
{ { dodgeburn_invoker } }
} ;
static Argument *
2001-07-04 19:31:35 +00:00
dodgeburn_default_invoker ( Gimp * gimp ,
Argument * args )
1999-07-19 22:42:49 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 num_strokes ;
gdouble * strokes ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-07-19 22:42:49 +00:00
if ( drawable = = NULL )
success = FALSE ;
num_strokes = args [ 1 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 2 ] . value . pdb_pointer ;
if ( success )
2001-04-07 11:01:22 +00:00
success = gimp_dodgeburn_tool_non_gui_default ( drawable , num_strokes , strokes ) ;
1999-07-19 22:42:49 +00:00
return procedural_db_return_args ( & dodgeburn_default_proc , success ) ;
}
static ProcArg dodgeburn_default_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-07-19 22:42:49 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-07-19 22:42:49 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-07-19 22:42:49 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
}
} ;
static ProcRecord dodgeburn_default_proc =
{
" gimp_dodgeburn_default " ,
" 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. " ,
2001-10-22 12:13:44 +00:00
" Dodgeburn. More details here later. " ,
1999-07-19 22:42:49 +00:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-07-19 22:42:49 +00:00
3 ,
dodgeburn_default_inargs ,
0 ,
NULL ,
{ { dodgeburn_default_invoker } }
} ;
1999-04-18 21:22:41 +00:00
static Argument *
2001-07-04 19:31:35 +00:00
eraser_invoker ( Gimp * gimp ,
Argument * args )
1999-04-18 21:22:41 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 num_strokes ;
gdouble * strokes ;
gint32 hardness ;
gint32 method ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-04-18 21:22:41 +00:00
if ( drawable = = NULL )
success = FALSE ;
num_strokes = args [ 1 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 2 ] . value . pdb_pointer ;
hardness = args [ 3 ] . value . pdb_int ;
if ( hardness < HARD | | hardness > SOFT )
success = FALSE ;
method = args [ 4 ] . value . pdb_int ;
if ( method < CONSTANT | | method > INCREMENTAL )
success = FALSE ;
if ( success )
2001-11-25 19:01:23 +00:00
success = eraser_non_gui ( drawable , num_strokes , strokes , hardness , method , TRUE ) ;
1999-04-18 21:22:41 +00:00
return procedural_db_return_args ( & eraser_proc , success ) ;
}
static ProcArg eraser_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-04-18 21:22:41 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-04-18 21:22:41 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" hardness " ,
" HARD (0) or SOFT (1) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" method " ,
" CONTINUOUS (0) or INCREMENTAL (1) "
}
} ;
static ProcRecord eraser_proc =
{
" gimp_eraser " ,
" Erase using the current brush. " ,
" 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. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-18 21:22:41 +00:00
5 ,
eraser_inargs ,
0 ,
NULL ,
{ { eraser_invoker } }
} ;
1999-07-19 22:42:49 +00:00
static Argument *
2001-07-04 19:31:35 +00:00
eraser_default_invoker ( Gimp * gimp ,
Argument * args )
1999-07-19 22:42:49 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 num_strokes ;
gdouble * strokes ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-07-19 22:42:49 +00:00
if ( drawable = = NULL )
success = FALSE ;
num_strokes = args [ 1 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 2 ] . value . pdb_pointer ;
if ( success )
success = eraser_non_gui_default ( drawable , num_strokes , strokes ) ;
return procedural_db_return_args ( & eraser_default_proc , success ) ;
}
static ProcArg eraser_default_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-07-19 22:42:49 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-07-19 22:42:49 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-07-19 22:42:49 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
}
} ;
static ProcRecord eraser_default_proc =
{
" gimp_eraser_default " ,
" Erase using the current brush. " ,
" 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. " ,
" Andy Thomas " ,
" Andy Thomas " ,
" 1999 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-07-19 22:42:49 +00:00
3 ,
eraser_default_inargs ,
0 ,
NULL ,
{ { eraser_default_invoker } }
} ;
1999-04-18 21:22:41 +00:00
static Argument *
2001-07-04 19:31:35 +00:00
paintbrush_invoker ( Gimp * gimp ,
Argument * args )
1999-04-18 21:22:41 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gdouble fade_out ;
gint32 num_strokes ;
gdouble * strokes ;
gint32 method ;
gdouble gradient_length ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-04-18 21:22:41 +00:00
if ( drawable = = NULL )
success = FALSE ;
fade_out = args [ 1 ] . value . pdb_float ;
1999-04-20 23:03:31 +00:00
if ( fade_out < 0.0 )
1999-04-18 21:22:41 +00:00
success = FALSE ;
num_strokes = args [ 2 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 3 ] . value . pdb_pointer ;
method = args [ 4 ] . value . pdb_int ;
if ( method < CONSTANT | | method > INCREMENTAL )
success = FALSE ;
gradient_length = args [ 5 ] . value . pdb_float ;
if ( gradient_length < 0.0 )
success = FALSE ;
if ( success )
2001-02-28 15:01:02 +00:00
success = gimp_paintbrush_tool_non_gui ( drawable , num_strokes , strokes ,
fade_out , method , gradient_length ) ;
1999-04-18 21:22:41 +00:00
return procedural_db_return_args ( & paintbrush_proc , success ) ;
}
static ProcArg paintbrush_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-04-18 21:22:41 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" fade_out " ,
1999-04-20 23:03:31 +00:00
" Fade out parameter: 0 <= fade_out "
1999-04-18 21:22:41 +00:00
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-04-18 21:22:41 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" method " ,
" CONTINUOUS (0) or INCREMENTAL (1) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-04-18 21:22:41 +00:00
" gradient_length " ,
" Length of gradient to draw: 0 <= gradient_length "
}
} ;
static ProcRecord paintbrush_proc =
{
" gimp_paintbrush " ,
" Paint in the current brush with optional fade out parameter and pull colors from a gradient. " ,
" 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. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-18 21:22:41 +00:00
6 ,
paintbrush_inargs ,
0 ,
NULL ,
{ { paintbrush_invoker } }
} ;
1999-07-19 22:42:49 +00:00
static Argument *
2001-07-04 19:31:35 +00:00
paintbrush_default_invoker ( Gimp * gimp ,
Argument * args )
1999-07-19 22:42:49 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 num_strokes ;
gdouble * strokes ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-07-19 22:42:49 +00:00
if ( drawable = = NULL )
success = FALSE ;
num_strokes = args [ 1 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 2 ] . value . pdb_pointer ;
if ( success )
2001-02-27 05:21:12 +00:00
success = gimp_paintbrush_tool_non_gui_default ( drawable , num_strokes , strokes ) ;
1999-07-19 22:42:49 +00:00
return procedural_db_return_args ( & paintbrush_default_proc , success ) ;
}
static ProcArg paintbrush_default_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-07-19 22:42:49 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-07-19 22:42:49 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-07-19 22:42:49 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
}
} ;
static ProcRecord paintbrush_default_proc =
{
" gimp_paintbrush_default " ,
" 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. " ,
" 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. " ,
" Andy Thomas " ,
" Andy Thomas " ,
" 1999 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-07-19 22:42:49 +00:00
3 ,
paintbrush_default_inargs ,
0 ,
NULL ,
{ { paintbrush_default_invoker } }
} ;
1999-04-18 21:22:41 +00:00
static Argument *
2001-07-04 19:31:35 +00:00
pencil_invoker ( Gimp * gimp ,
Argument * args )
1999-04-18 21:22:41 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 num_strokes ;
gdouble * strokes ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-04-18 21:22:41 +00:00
if ( drawable = = NULL )
success = FALSE ;
num_strokes = args [ 1 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 2 ] . value . pdb_pointer ;
if ( success )
success = pencil_non_gui ( drawable , num_strokes , strokes ) ;
return procedural_db_return_args ( & pencil_proc , success ) ;
}
static ProcArg pencil_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-04-18 21:22:41 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-04-18 21:22:41 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-04-18 21:22:41 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
}
} ;
static ProcRecord pencil_proc =
{
" gimp_pencil " ,
" Paint in the current brush without sub-pixel sampling. " ,
" 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. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-04-18 21:22:41 +00:00
3 ,
pencil_inargs ,
0 ,
NULL ,
{ { pencil_invoker } }
} ;
1999-07-19 22:42:49 +00:00
static Argument *
2001-07-04 19:31:35 +00:00
smudge_invoker ( Gimp * gimp ,
Argument * args )
1999-07-19 22:42:49 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gdouble pressure ;
gint32 num_strokes ;
gdouble * strokes ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-07-19 22:42:49 +00:00
if ( drawable = = NULL )
success = FALSE ;
pressure = args [ 1 ] . value . pdb_float ;
if ( pressure < 0.0 | | pressure > 100.0 )
success = FALSE ;
num_strokes = args [ 2 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 3 ] . value . pdb_pointer ;
if ( success )
2001-04-11 17:20:34 +00:00
success = gimp_smudge_tool_non_gui ( drawable , pressure , num_strokes , strokes ) ;
1999-07-19 22:42:49 +00:00
return procedural_db_return_args ( & smudge_proc , success ) ;
}
static ProcArg smudge_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-07-19 22:42:49 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOAT ,
1999-07-19 22:42:49 +00:00
" pressure " ,
" The pressure of the smudge strokes (0 <= pressure <= 100) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-07-19 22:42:49 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-07-19 22:42:49 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
}
} ;
static ProcRecord smudge_proc =
{
" gimp_smudge " ,
" Smudge image with varying pressure. " ,
" 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. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-07-19 22:42:49 +00:00
4 ,
smudge_inargs ,
0 ,
NULL ,
{ { smudge_invoker } }
} ;
static Argument *
2001-07-04 19:31:35 +00:00
smudge_default_invoker ( Gimp * gimp ,
Argument * args )
1999-07-19 22:42:49 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 num_strokes ;
gdouble * strokes ;
2001-07-11 12:39:49 +00:00
drawable = gimp_drawable_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
1999-07-19 22:42:49 +00:00
if ( drawable = = NULL )
success = FALSE ;
num_strokes = args [ 1 ] . value . pdb_int ;
if ( ! ( num_strokes < 2 ) )
num_strokes / = 2 ;
else
success = FALSE ;
strokes = ( gdouble * ) args [ 2 ] . value . pdb_pointer ;
if ( success )
2001-04-11 17:20:34 +00:00
success = gimp_smudge_tool_non_gui_default ( drawable , num_strokes , strokes ) ;
1999-07-19 22:42:49 +00:00
return procedural_db_return_args ( & smudge_default_proc , success ) ;
}
static ProcArg smudge_default_inargs [ ] =
{
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1999-07-19 22:42:49 +00:00
" drawable " ,
" The affected drawable "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1999-07-19 22:42:49 +00:00
" num_strokes " ,
" Number of stroke control points (count each coordinate as 2 points) "
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_FLOATARRAY ,
1999-07-19 22:42:49 +00:00
" strokes " ,
" Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y } "
}
} ;
static ProcRecord smudge_default_proc =
{
" gimp_smudge_default " ,
" Smudge image with varying pressure. " ,
" 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. " ,
" Andy Thomas " ,
" Andy Thomas " ,
" 1999 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
1999-07-19 22:42:49 +00:00
3 ,
smudge_default_inargs ,
0 ,
NULL ,
{ { smudge_default_invoker } }
} ;