1997-11-25 06:05:25 +08:00
/* 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
1998-04-13 13:44:11 +08:00
* Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
1997-11-25 06:05:25 +08:00
*/
# include <stdlib.h>
# include "appenv.h"
1998-07-09 13:31:06 +08:00
# include "gimpbrushlist.h"
1997-11-25 06:05:25 +08:00
# include "drawable.h"
# include "errors.h"
# include "gdisplay.h"
# include "paint_funcs.h"
# include "paint_core.h"
# include "palette.h"
# include "eraser.h"
# include "selection.h"
# include "tools.h"
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
# include "libgimp/gimpintl.h"
1999-04-09 06:25:54 +08:00
/* the eraser structures */
1998-03-01 09:18:45 +08:00
typedef struct _EraserOptions EraserOptions ;
struct _EraserOptions
{
1999-04-09 06:25:54 +08:00
gboolean hard ;
gboolean hard_d ;
GtkWidget * hard_w ;
gboolean incremental ;
gboolean incremental_d ;
GtkWidget * incremental_w ;
1998-03-01 09:18:45 +08:00
} ;
1999-04-09 06:25:54 +08:00
/* eraser tool options */
1998-03-01 09:18:45 +08:00
static EraserOptions * eraser_options = NULL ;
1999-04-09 06:25:54 +08:00
/* local variables */
static gboolean non_gui_hard ;
static gboolean non_gui_incremental ;
/* forward function declarations */
static void eraser_motion ( PaintCore * , GimpDrawable * , gboolean , gboolean ) ;
static Argument * eraser_invoker ( Argument * ) ;
static Argument * eraser_extended_invoker ( Argument * ) ;
/* functions */
1998-03-01 09:18:45 +08:00
static void
eraser_toggle_update ( GtkWidget * w ,
gpointer data )
{
gboolean * toggle_val ;
toggle_val = ( gboolean * ) data ;
if ( GTK_TOGGLE_BUTTON ( w ) - > active )
* toggle_val = TRUE ;
else
* toggle_val = FALSE ;
}
1999-04-09 06:25:54 +08:00
static void
reset_eraser_options ( void )
{
EraserOptions * options = eraser_options ;
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( options - > hard_w ) ,
options - > hard_d ) ;
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( options - > incremental_w ) ,
options - > incremental_d ) ;
}
1998-03-01 09:18:45 +08:00
static EraserOptions *
create_eraser_options ( void )
{
EraserOptions * options ;
1999-04-09 06:25:54 +08:00
GtkWidget * vbox ;
1998-03-01 09:18:45 +08:00
options = ( EraserOptions * ) g_malloc ( sizeof ( EraserOptions ) ) ;
1999-04-09 06:25:54 +08:00
options - > hard = options - > hard_d = FALSE ;
options - > incremental = options - > incremental_d = FALSE ;
1998-03-01 09:18:45 +08:00
/* the main vbox */
vbox = gtk_vbox_new ( FALSE , 1 ) ;
/* the hard toggle */
1999-04-09 06:25:54 +08:00
options - > hard_w = gtk_check_button_new_with_label ( _ ( " Hard edge " ) ) ;
gtk_box_pack_start ( GTK_BOX ( vbox ) , options - > hard_w , FALSE , FALSE , 0 ) ;
gtk_signal_connect ( GTK_OBJECT ( options - > hard_w ) , " toggled " ,
1998-03-01 09:18:45 +08:00
( GtkSignalFunc ) eraser_toggle_update ,
& options - > hard ) ;
1999-04-09 06:25:54 +08:00
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( options - > hard_w ) ,
options - > hard_d ) ;
gtk_widget_show ( options - > hard_w ) ;
1998-03-01 09:18:45 +08:00
/* the incremental toggle */
1999-04-09 06:25:54 +08:00
options - > incremental_w = gtk_check_button_new_with_label ( _ ( " Incremental " ) ) ;
gtk_box_pack_start ( GTK_BOX ( vbox ) , options - > incremental_w , FALSE , FALSE , 0 ) ;
gtk_signal_connect ( GTK_OBJECT ( options - > incremental_w ) , " toggled " ,
1998-03-01 09:18:45 +08:00
( GtkSignalFunc ) eraser_toggle_update ,
& options - > incremental ) ;
1999-04-09 06:25:54 +08:00
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( options - > incremental_w ) ,
options - > incremental_d ) ;
gtk_widget_show ( options - > incremental_w ) ;
1998-03-01 09:18:45 +08:00
/* Register this eraser options widget with the main tools options dialog */
1999-04-09 06:25:54 +08:00
tools_register ( ERASER , vbox , _ ( " Eraser Options " ) , reset_eraser_options ) ;
1998-03-01 09:18:45 +08:00
return options ;
}
1997-11-25 06:05:25 +08:00
void *
1999-04-09 06:25:54 +08:00
eraser_paint_func ( PaintCore * paint_core ,
GimpDrawable * drawable ,
int state )
1997-11-25 06:05:25 +08:00
{
switch ( state )
{
case INIT_PAINT :
break ;
case MOTION_PAINT :
1998-03-01 09:18:45 +08:00
eraser_motion ( paint_core , drawable , eraser_options - > hard , eraser_options - > incremental ) ;
1997-11-25 06:05:25 +08:00
break ;
case FINISH_PAINT :
break ;
default :
break ;
}
return NULL ;
}
Tool *
tools_new_eraser ( )
{
Tool * tool ;
PaintCore * private ;
if ( ! eraser_options )
1998-03-01 09:18:45 +08:00
eraser_options = create_eraser_options ( ) ;
1997-11-25 06:05:25 +08:00
tool = paint_core_new ( ERASER ) ;
private = ( PaintCore * ) tool - > private ;
private - > paint_func = eraser_paint_func ;
return tool ;
}
void
tools_free_eraser ( tool )
Tool * tool ;
{
paint_core_free ( tool ) ;
}
1998-03-19 06:35:31 +08:00
static void
1999-04-09 06:25:54 +08:00
eraser_motion ( PaintCore * paint_core ,
GimpDrawable * drawable ,
gboolean hard ,
gboolean incremental )
1997-11-25 06:05:25 +08:00
{
GImage * gimage ;
1998-06-21 23:37:48 +08:00
gint opacity ;
1997-11-25 06:05:25 +08:00
TempBuf * area ;
unsigned char col [ MAX_CHANNELS ] ;
1998-01-22 15:02:57 +08:00
if ( ! ( gimage = drawable_gimage ( drawable ) ) )
1997-11-25 06:05:25 +08:00
return ;
1998-01-22 15:02:57 +08:00
gimage_get_background ( gimage , drawable , col ) ;
1997-11-25 06:05:25 +08:00
/* Get a region which can be used to paint to */
1998-01-22 15:02:57 +08:00
if ( ! ( area = paint_core_get_paint_area ( paint_core , drawable ) ) )
1997-11-25 06:05:25 +08:00
return ;
/* set the alpha channel */
1998-01-25 09:24:46 +08:00
col [ area - > bytes - 1 ] = OPAQUE_OPACITY ;
1997-11-25 06:05:25 +08:00
/* color the pixels */
color_pixels ( temp_buf_data ( area ) , col ,
area - > width * area - > height , area - > bytes ) ;
1998-07-09 13:31:06 +08:00
opacity = 255 * gimp_brush_get_opacity ( ) * ( paint_core - > curpressure / 0.5 ) ;
1998-06-23 11:41:59 +08:00
if ( opacity > OPAQUE_OPACITY ) opacity = OPAQUE_OPACITY ;
1997-11-25 06:05:25 +08:00
/* paste the newly painted canvas to the gimage which is being worked on */
1998-06-21 23:37:48 +08:00
paint_core_paste_canvas ( paint_core , drawable , opacity ,
1998-07-09 13:31:06 +08:00
( int ) ( gimp_brush_get_opacity ( ) * 255 ) ,
1998-03-01 09:18:45 +08:00
ERASE_MODE , hard ? HARD : SOFT , incremental ? INCREMENTAL : CONSTANT ) ;
1997-11-25 06:05:25 +08:00
}
static void *
1999-04-09 06:25:54 +08:00
eraser_non_gui_paint_func ( PaintCore * paint_core ,
GimpDrawable * drawable ,
int state )
1997-11-25 06:05:25 +08:00
{
1998-03-01 09:18:45 +08:00
eraser_motion ( paint_core , drawable , non_gui_hard , non_gui_incremental ) ;
1997-11-25 06:05:25 +08:00
return NULL ;
}
/* The eraser procedure definition */
1998-03-01 09:18:45 +08:00
ProcArg eraser_extended_args [ ] =
{
{ PDB_DRAWABLE ,
" drawable " ,
1998-12-26 02:22:01 +08:00
" the drawable "
1998-03-01 09:18:45 +08:00
} ,
{ PDB_INT32 ,
" num_strokes " ,
1998-12-26 02:22:01 +08:00
" number of stroke control points (count each coordinate as 2 points) "
1998-03-01 09:18:45 +08:00
} ,
{ PDB_FLOATARRAY ,
" strokes " ,
1998-12-26 02:22:01 +08:00
" array of stroke coordinates: {s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y} "
1998-03-01 09:18:45 +08:00
} ,
{ PDB_INT32 ,
" hardness " ,
1998-12-26 02:22:01 +08:00
" SOFT(0) or HARD(1) "
1998-03-01 09:18:45 +08:00
} ,
{ PDB_INT32 ,
" method " ,
1998-12-26 02:22:01 +08:00
" CONTINUOUS(0) or INCREMENTAL(1) "
1998-03-01 09:18:45 +08:00
}
} ;
1997-11-25 06:05:25 +08:00
ProcArg eraser_args [ ] =
{
{ PDB_DRAWABLE ,
" drawable " ,
1998-12-26 02:22:01 +08:00
" the drawable "
1997-11-25 06:05:25 +08:00
} ,
{ PDB_INT32 ,
" num_strokes " ,
1998-12-26 02:22:01 +08:00
" number of stroke control points (count each coordinate as 2 points) "
1997-11-25 06:05:25 +08:00
} ,
{ PDB_FLOATARRAY ,
" strokes " ,
1998-12-26 02:22:01 +08:00
" array of stroke coordinates: {s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y} "
1997-11-25 06:05:25 +08:00
}
} ;
ProcRecord eraser_proc =
{
" gimp_eraser " ,
1998-12-26 02:22:01 +08:00
" 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. " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
PDB_INTERNAL ,
/* Input arguments */
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-14 04:40:00 +08:00
3 ,
1997-11-25 06:05:25 +08:00
eraser_args ,
/* Output arguments */
0 ,
NULL ,
/* Exec method */
{ { eraser_invoker } } ,
} ;
1998-03-01 09:18:45 +08:00
ProcRecord eraser_extended_proc =
{
" gimp_eraser_extended " ,
1998-12-26 02:22:01 +08:00
" 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. " ,
1998-03-01 09:18:45 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
PDB_INTERNAL ,
/* Input arguments */
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-14 04:40:00 +08:00
5 ,
1998-03-01 09:18:45 +08:00
eraser_extended_args ,
/* Output arguments */
0 ,
NULL ,
/* Exec method */
{ { eraser_extended_invoker } } ,
} ;
1997-11-25 06:05:25 +08:00
static Argument *
eraser_invoker ( args )
Argument * args ;
{
int success = TRUE ;
GImage * gimage ;
1998-01-22 15:02:57 +08:00
GimpDrawable * drawable ;
1997-11-25 06:05:25 +08:00
int num_strokes ;
double * stroke_array ;
int int_value ;
int i ;
1998-01-22 15:02:57 +08:00
drawable = NULL ;
1997-11-25 06:05:25 +08:00
num_strokes = 0 ;
/* the drawable */
if ( success )
{
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-14 04:40:00 +08:00
int_value = args [ 0 ] . value . pdb_int ;
1998-01-22 15:02:57 +08:00
drawable = drawable_get_ID ( int_value ) ;
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-14 04:40:00 +08:00
if ( drawable = = NULL )
success = FALSE ;
else
gimage = drawable_gimage ( drawable ) ;
1997-11-25 06:05:25 +08:00
}
/* num strokes */
if ( success )
{
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-14 04:40:00 +08:00
int_value = args [ 1 ] . value . pdb_int ;
1997-11-25 06:05:25 +08:00
if ( int_value > 0 )
num_strokes = int_value / 2 ;
else
success = FALSE ;
}
/* point array */
if ( success )
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-14 04:40:00 +08:00
stroke_array = ( double * ) args [ 2 ] . value . pdb_pointer ;
1997-11-25 06:05:25 +08:00
if ( success )
/* init the paint core */
1998-01-22 15:02:57 +08:00
success = paint_core_init ( & non_gui_paint_core , drawable ,
1997-11-25 06:05:25 +08:00
stroke_array [ 0 ] , stroke_array [ 1 ] ) ;
1998-03-01 09:18:45 +08:00
if ( success )
{
non_gui_hard = 0 ; non_gui_incremental = 0 ;
/* set the paint core's paint func */
non_gui_paint_core . paint_func = eraser_non_gui_paint_func ;
non_gui_paint_core . startx = non_gui_paint_core . lastx = stroke_array [ 0 ] ;
non_gui_paint_core . starty = non_gui_paint_core . lasty = stroke_array [ 1 ] ;
if ( num_strokes = = 1 )
eraser_non_gui_paint_func ( & non_gui_paint_core , drawable , 0 ) ;
for ( i = 1 ; i < num_strokes ; i + + )
{
non_gui_paint_core . curx = stroke_array [ i * 2 + 0 ] ;
non_gui_paint_core . cury = stroke_array [ i * 2 + 1 ] ;
paint_core_interpolate ( & non_gui_paint_core , drawable ) ;
non_gui_paint_core . lastx = non_gui_paint_core . curx ;
non_gui_paint_core . lasty = non_gui_paint_core . cury ;
}
/* finish the painting */
paint_core_finish ( & non_gui_paint_core , drawable , - 1 ) ;
/* cleanup */
paint_core_cleanup ( ) ;
}
return procedural_db_return_args ( & eraser_proc , success ) ;
}
static Argument *
eraser_extended_invoker ( args )
Argument * args ;
{
int success = TRUE ;
GImage * gimage ;
GimpDrawable * drawable ;
int num_strokes ;
double * stroke_array ;
int int_value ;
int i ;
drawable = NULL ;
num_strokes = 0 ;
/* the drawable */
if ( success )
{
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-14 04:40:00 +08:00
int_value = args [ 0 ] . value . pdb_int ;
1998-03-01 09:18:45 +08:00
drawable = drawable_get_ID ( int_value ) ;
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-14 04:40:00 +08:00
if ( drawable = = NULL )
success = FALSE ;
else
gimage = drawable_gimage ( drawable ) ;
1998-03-01 09:18:45 +08:00
}
/* num strokes */
if ( success )
{
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-14 04:40:00 +08:00
int_value = args [ 1 ] . value . pdb_int ;
1998-03-01 09:18:45 +08:00
if ( int_value > 0 )
num_strokes = int_value / 2 ;
else
success = FALSE ;
}
/* point array */
if ( success )
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-14 04:40:00 +08:00
stroke_array = ( double * ) args [ 2 ] . value . pdb_pointer ;
1998-03-01 09:18:45 +08:00
if ( success )
/* init the paint core */
success = paint_core_init ( & non_gui_paint_core , drawable ,
stroke_array [ 0 ] , stroke_array [ 1 ] ) ;
if ( success )
{
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-14 04:40:00 +08:00
non_gui_hard = args [ 3 ] . value . pdb_int ;
non_gui_incremental = args [ 4 ] . value . pdb_int ;
1998-03-01 09:18:45 +08:00
}
1997-11-25 06:05:25 +08:00
if ( success )
{
/* set the paint core's paint func */
non_gui_paint_core . paint_func = eraser_non_gui_paint_func ;
non_gui_paint_core . startx = non_gui_paint_core . lastx = stroke_array [ 0 ] ;
non_gui_paint_core . starty = non_gui_paint_core . lasty = stroke_array [ 1 ] ;
if ( num_strokes = = 1 )
1998-01-22 15:02:57 +08:00
eraser_non_gui_paint_func ( & non_gui_paint_core , drawable , 0 ) ;
1997-11-25 06:05:25 +08:00
for ( i = 1 ; i < num_strokes ; i + + )
{
non_gui_paint_core . curx = stroke_array [ i * 2 + 0 ] ;
non_gui_paint_core . cury = stroke_array [ i * 2 + 1 ] ;
1998-01-22 15:02:57 +08:00
paint_core_interpolate ( & non_gui_paint_core , drawable ) ;
1997-11-25 06:05:25 +08:00
non_gui_paint_core . lastx = non_gui_paint_core . curx ;
non_gui_paint_core . lasty = non_gui_paint_core . cury ;
}
/* finish the painting */
1998-01-22 15:02:57 +08:00
paint_core_finish ( & non_gui_paint_core , drawable , - 1 ) ;
1997-11-25 06:05:25 +08:00
/* cleanup */
paint_core_cleanup ( ) ;
}
return procedural_db_return_args ( & eraser_proc , success ) ;
}