1997-11-25 06:05:25 +08:00
/* The GIMP -- an image manipulation program
2003-07-03 08:47:26 +08:00
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
1997-11-25 06:05:25 +08: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
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
*/
1999-04-25 09:41:57 +08:00
/* NOTE: This file is autogenerated by pdbgen.pl. */
1997-11-25 06:05:25 +08:00
2000-12-29 23:22:01 +08:00
# include "config.h"
2001-08-17 22:27:31 +08:00
# include <glib-object.h>
2000-12-29 23:22:01 +08:00
2001-05-21 21:58:46 +08:00
# include "libgimpbase/gimpbasetypes.h"
2001-08-17 22:27:31 +08:00
# include "pdb-types.h"
1999-04-25 09:41:57 +08:00
# include "procedural_db.h"
1997-11-25 06:05:25 +08:00
2003-10-06 20:17:11 +08:00
# include "core/gimpchannel-select.h"
2001-05-09 10:32:03 +08:00
# include "core/gimpchannel.h"
2001-07-08 06:49:01 +08:00
# include "core/gimpdrawable.h"
2001-05-09 10:32:03 +08:00
# include "core/gimpimage.h"
# include "core/gimplayer.h"
2003-09-05 04:18:08 +08:00
# include "core/gimpselection.h"
2003-08-22 03:23:17 +08:00
# include "gimp-intl.h"
1999-04-25 09:41:57 +08:00
static ProcRecord selection_bounds_proc ;
static ProcRecord selection_value_proc ;
static ProcRecord selection_is_empty_proc ;
static ProcRecord selection_translate_proc ;
static ProcRecord selection_float_proc ;
static ProcRecord selection_clear_proc ;
static ProcRecord selection_invert_proc ;
static ProcRecord selection_sharpen_proc ;
static ProcRecord selection_all_proc ;
static ProcRecord selection_none_proc ;
static ProcRecord selection_feather_proc ;
static ProcRecord selection_border_proc ;
static ProcRecord selection_grow_proc ;
static ProcRecord selection_shrink_proc ;
static ProcRecord selection_layer_alpha_proc ;
static ProcRecord selection_load_proc ;
static ProcRecord selection_save_proc ;
2001-01-29 08:02:33 +08:00
static ProcRecord selection_combine_proc ;
1999-04-25 09:41:57 +08:00
void
2001-07-05 03:31:35 +08:00
register_selection_procs ( Gimp * gimp )
{
procedural_db_register ( gimp , & selection_bounds_proc ) ;
procedural_db_register ( gimp , & selection_value_proc ) ;
procedural_db_register ( gimp , & selection_is_empty_proc ) ;
procedural_db_register ( gimp , & selection_translate_proc ) ;
procedural_db_register ( gimp , & selection_float_proc ) ;
procedural_db_register ( gimp , & selection_clear_proc ) ;
procedural_db_register ( gimp , & selection_invert_proc ) ;
procedural_db_register ( gimp , & selection_sharpen_proc ) ;
procedural_db_register ( gimp , & selection_all_proc ) ;
procedural_db_register ( gimp , & selection_none_proc ) ;
procedural_db_register ( gimp , & selection_feather_proc ) ;
procedural_db_register ( gimp , & selection_border_proc ) ;
procedural_db_register ( gimp , & selection_grow_proc ) ;
procedural_db_register ( gimp , & selection_shrink_proc ) ;
procedural_db_register ( gimp , & selection_layer_alpha_proc ) ;
procedural_db_register ( gimp , & selection_load_proc ) ;
procedural_db_register ( gimp , & selection_save_proc ) ;
procedural_db_register ( gimp , & selection_combine_proc ) ;
1999-04-25 09:41:57 +08:00
}
1997-11-25 06:05:25 +08:00
static Argument *
2001-07-05 03:31:35 +08:00
selection_bounds_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
Argument * return_args ;
GimpImage * gimage ;
2000-01-02 08:16:47 +08:00
gboolean non_empty = FALSE ;
1999-04-25 09:41:57 +08:00
gint32 x1 ;
gint32 y1 ;
gint32 x2 ;
gint32 y2 ;
1997-11-25 06:05:25 +08:00
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_IMAGE ( gimage ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
if ( success )
2003-09-03 22:22:38 +08:00
non_empty = gimp_channel_bounds ( gimp_image_get_mask ( gimage ) , & x1 , & y1 , & x2 , & y2 ) ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
return_args = procedural_db_return_args ( & selection_bounds_proc , success ) ;
1997-11-25 06:05:25 +08:00
if ( success )
{
return_args [ 1 ] . value . pdb_int = non_empty ;
return_args [ 2 ] . value . pdb_int = x1 ;
return_args [ 3 ] . value . pdb_int = y1 ;
return_args [ 4 ] . value . pdb_int = x2 ;
return_args [ 5 ] . value . pdb_int = y2 ;
}
return return_args ;
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_bounds_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1999-04-25 09:41:57 +08:00
" The image "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcArg selection_bounds_outargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1999-04-25 09:41:57 +08:00
" non_empty " ,
" True if there is a selection "
1997-11-25 06:05:25 +08:00
} ,
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1997-11-25 06:05:25 +08:00
" x1 " ,
" x coordinate of upper left corner of selection bounds "
} ,
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1997-11-25 06:05:25 +08:00
" y1 " ,
" y coordinate of upper left corner of selection bounds "
} ,
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1997-11-25 06:05:25 +08:00
" x2 " ,
" x coordinate of lower right corner of selection bounds "
} ,
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1997-11-25 06:05:25 +08:00
" y2 " ,
" y coordinate of lower right corner of selection bounds "
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_bounds_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_bounds " ,
1999-04-25 09:41:57 +08:00
" Find the bounding box of the current selection. " ,
2002-12-14 03:19:09 +08:00
" This procedure returns whether there is a selection for the specified image. If there is one, the upper left and lower right corners of the bounding box are returned. These coordinates are relative to the image. Please note that the pixel specified by the lower righthand coordinate of the bounding box is not part of the selection. The selection ends at the upper left corner of this pixel. This means the width of the selection can be calculated as (x2 - x1), its height as (y2 - y1). " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
1 ,
1999-04-25 09:41:57 +08:00
selection_bounds_inargs ,
1997-11-25 06:05:25 +08:00
5 ,
1999-04-25 09:41:57 +08:00
selection_bounds_outargs ,
{ { selection_bounds_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_value_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
Argument * return_args ;
GimpImage * gimage ;
gint32 x ;
gint32 y ;
1997-11-25 06:05:25 +08:00
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_IMAGE ( gimage ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
x = args [ 1 ] . value . pdb_int ;
y = args [ 2 ] . value . pdb_int ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
return_args = procedural_db_return_args ( & selection_value_proc , success ) ;
1997-11-25 06:05:25 +08:00
if ( success )
2003-09-03 22:22:38 +08:00
return_args [ 1 ] . value . pdb_int = gimp_channel_value ( gimp_image_get_mask ( gimage ) , x , y ) ;
1997-11-25 06:05:25 +08:00
return return_args ;
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_value_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1999-04-25 09:41:57 +08:00
" The image "
1997-11-25 06:05:25 +08:00
} ,
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1997-11-25 06:05:25 +08:00
" x " ,
" x coordinate of value "
} ,
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1997-11-25 06:05:25 +08:00
" y " ,
" y coordinate of value "
}
} ;
1999-04-25 09:41:57 +08:00
static ProcArg selection_value_outargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1997-11-25 06:05:25 +08:00
" value " ,
1999-04-25 09:41:57 +08:00
" Value of the selection: (0 <= value <= 255) "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_value_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_value " ,
1999-04-25 09:41:57 +08:00
" Find the value of the selection at the specified coordinates. " ,
" This procedure returns the value of the selection at the specified coordinates. If the coordinates lie out of bounds, 0 is returned. " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
3 ,
1999-04-25 09:41:57 +08:00
selection_value_inargs ,
1997-11-25 06:05:25 +08:00
1 ,
1999-04-25 09:41:57 +08:00
selection_value_outargs ,
{ { selection_value_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_is_empty_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
Argument * return_args ;
GimpImage * gimage ;
1997-11-25 06:05:25 +08:00
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_IMAGE ( gimage ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
return_args = procedural_db_return_args ( & selection_is_empty_proc , success ) ;
1997-11-25 06:05:25 +08:00
if ( success )
2003-09-03 22:22:38 +08:00
return_args [ 1 ] . value . pdb_int = gimp_channel_is_empty ( gimp_image_get_mask ( gimage ) ) ;
1997-11-25 06:05:25 +08:00
return return_args ;
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_is_empty_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1999-04-25 09:41:57 +08:00
" The image "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcArg selection_is_empty_outargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1997-11-25 06:05:25 +08:00
" is_empty " ,
1999-04-25 09:41:57 +08:00
" Is the selection empty? "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_is_empty_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_is_empty " ,
1999-11-14 03:20:11 +08:00
" Determine whether the selection is empty. " ,
1997-11-25 06:05:25 +08:00
" This procedure returns non-zero if the selection for the specified image is not empty. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
1 ,
1999-04-25 09:41:57 +08:00
selection_is_empty_inargs ,
1997-11-25 06:05:25 +08:00
1 ,
1999-04-25 09:41:57 +08:00
selection_is_empty_outargs ,
{ { selection_is_empty_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_translate_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
GimpImage * gimage ;
gint32 offx ;
gint32 offy ;
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_IMAGE ( gimage ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
offx = args [ 1 ] . value . pdb_int ;
offy = args [ 2 ] . value . pdb_int ;
1997-11-25 06:05:25 +08:00
if ( success )
2003-09-03 18:19:47 +08:00
gimp_item_translate ( GIMP_ITEM ( gimp_image_get_mask ( gimage ) ) , offx , offy , TRUE ) ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
return procedural_db_return_args ( & selection_translate_proc , success ) ;
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_translate_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1999-04-25 09:41:57 +08:00
" The image "
1997-11-25 06:05:25 +08:00
} ,
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1999-04-25 09:41:57 +08:00
" offx " ,
1997-11-25 06:05:25 +08:00
" x offset for translation "
} ,
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1999-04-25 09:41:57 +08:00
" offy " ,
1997-11-25 06:05:25 +08:00
" y offset for translation "
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_translate_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_translate " ,
1999-04-25 09:41:57 +08:00
" Translate the selection by the specified offsets. " ,
" This procedure actually translates the selection for the specified image by the specified offsets. Regions that are translated from beyond the bounds of the image are set to empty. Valid regions of the selection which are translated beyond the bounds of the image because of this call are lost. " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
3 ,
1999-04-25 09:41:57 +08:00
selection_translate_inargs ,
1997-11-25 06:05:25 +08:00
0 ,
NULL ,
1999-04-25 09:41:57 +08:00
{ { selection_translate_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_float_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
Argument * return_args ;
1998-01-22 15:02:57 +08:00
GimpDrawable * drawable ;
1999-04-25 09:41:57 +08:00
gint32 offx ;
gint32 offy ;
GimpLayer * layer = NULL ;
1997-11-25 06:05:25 +08:00
2002-02-26 01:58:50 +08:00
drawable = ( GimpDrawable * ) gimp_item_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_DRAWABLE ( drawable ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
offx = args [ 1 ] . value . pdb_int ;
offy = args [ 2 ] . value . pdb_int ;
1997-11-25 06:05:25 +08:00
1998-01-22 15:02:57 +08:00
if ( success )
{
2004-01-27 00:18:16 +08:00
success = gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) ;
2004-01-26 23:34:47 +08:00
if ( success )
{
2004-01-27 00:18:16 +08:00
GimpImage * gimage = gimp_item_get_image ( GIMP_ITEM ( drawable ) ) ;
2004-01-26 23:34:47 +08:00
layer = gimp_selection_float ( gimp_image_get_mask ( gimage ) ,
drawable , TRUE , offx , offy ) ;
if ( ! layer )
success = FALSE ;
}
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
return_args = procedural_db_return_args ( & selection_float_proc , success ) ;
1997-11-25 06:05:25 +08:00
if ( success )
2002-02-26 01:58:50 +08:00
return_args [ 1 ] . value . pdb_int = gimp_item_get_ID ( GIMP_ITEM ( layer ) ) ;
1997-11-25 06:05:25 +08:00
return return_args ;
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_float_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_DRAWABLE ,
1997-11-25 06:05:25 +08:00
" drawable " ,
1999-04-25 09:41:57 +08:00
" The drawable from which to float selection "
1997-11-25 06:05:25 +08:00
} ,
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1999-04-25 09:41:57 +08:00
" offx " ,
1997-11-25 06:05:25 +08:00
" x offset for translation "
} ,
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1999-04-25 09:41:57 +08:00
" offy " ,
1997-11-25 06:05:25 +08:00
" y offset for translation "
}
} ;
1999-04-25 09:41:57 +08:00
static ProcArg selection_float_outargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_LAYER ,
1997-11-25 06:05:25 +08:00
" layer " ,
1999-04-25 09:41:57 +08:00
" The floated layer "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_float_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_float " ,
1999-04-25 09:41:57 +08:00
" Float the selection from the specified drawable with initial offsets as specified. " ,
" This procedure determines the region of the specified drawable that lies beneath the current selection. The region is then cut from the drawable and the resulting data is made into a new layer which is instantiated as a floating selection. The offsets allow initial positioning of the new floating selection. " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
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 ,
1999-04-25 09:41:57 +08:00
selection_float_inargs ,
1997-11-25 06:05:25 +08:00
1 ,
1999-04-25 09:41:57 +08:00
selection_float_outargs ,
{ { selection_float_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_clear_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
GimpImage * gimage ;
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_IMAGE ( gimage ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
if ( success )
2003-09-03 22:22:38 +08:00
gimp_channel_clear ( gimp_image_get_mask ( gimage ) , NULL , TRUE ) ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
return procedural_db_return_args ( & selection_clear_proc , success ) ;
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_clear_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1999-04-25 09:41:57 +08:00
" The image "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_clear_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_clear " ,
1999-04-25 09:41:57 +08:00
" Set the selection to none, clearing all previous content. " ,
1997-11-25 06:05:25 +08:00
" This procedure sets the selection mask to empty, assigning the value 0 to every pixel in the selection channel. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
1 ,
1999-04-25 09:41:57 +08:00
selection_clear_inargs ,
1997-11-25 06:05:25 +08:00
0 ,
NULL ,
1999-04-25 09:41:57 +08:00
{ { selection_clear_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_invert_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
GimpImage * gimage ;
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_IMAGE ( gimage ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
if ( success )
removed the feather(), sharpen(), all(), invert(), border(), grow() and
2003-09-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-mask.[ch]: removed the feather(), sharpen(),
all(), invert(), border(), grow() and shrink() wrappers.
* app/core/gimpselection.[ch]: changed gimp_selection_invalidate()
and gimp_selection_push_undo() to take GimpChannel parameters, not
GimpSelection ones. They will be made virtual GimpChannel
functions anyway.
* app/core/gimpedit.c
* app/gui/select-commands.c
* app/widgets/gimpselectioneditor.c
* tools/pdbgen/pdb/selection.pdb: changed accordingly.
* app/pdb/selection_cmds.c: regenerated.
2003-09-03 21:37:49 +08:00
gimp_channel_invert ( gimp_image_get_mask ( gimage ) , TRUE ) ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
return procedural_db_return_args ( & selection_invert_proc , success ) ;
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_invert_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1999-04-25 09:41:57 +08:00
" The image "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_invert_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_invert " ,
1999-04-25 09:41:57 +08:00
" Invert the selection mask. " ,
" This procedure inverts the selection mask. For every pixel in the selection channel, its new value is calculated as (255 - old_value). " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
1 ,
1999-04-25 09:41:57 +08:00
selection_invert_inargs ,
1997-11-25 06:05:25 +08:00
0 ,
NULL ,
1999-04-25 09:41:57 +08:00
{ { selection_invert_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_sharpen_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
GimpImage * gimage ;
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_IMAGE ( gimage ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
if ( success )
removed the feather(), sharpen(), all(), invert(), border(), grow() and
2003-09-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-mask.[ch]: removed the feather(), sharpen(),
all(), invert(), border(), grow() and shrink() wrappers.
* app/core/gimpselection.[ch]: changed gimp_selection_invalidate()
and gimp_selection_push_undo() to take GimpChannel parameters, not
GimpSelection ones. They will be made virtual GimpChannel
functions anyway.
* app/core/gimpedit.c
* app/gui/select-commands.c
* app/widgets/gimpselectioneditor.c
* tools/pdbgen/pdb/selection.pdb: changed accordingly.
* app/pdb/selection_cmds.c: regenerated.
2003-09-03 21:37:49 +08:00
gimp_channel_sharpen ( gimp_image_get_mask ( gimage ) , TRUE ) ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
return procedural_db_return_args ( & selection_sharpen_proc , success ) ;
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_sharpen_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1999-04-25 09:41:57 +08:00
" The image "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_sharpen_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_sharpen " ,
1999-04-25 09:41:57 +08:00
" Sharpen the selection mask. " ,
" This procedure sharpens the selection mask. For every pixel in the selection channel, if the value is > 0, the new pixel is assigned a value of 255. This removes any \" anti-aliasing \" that might exist in the selection mask's boundary. " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
1 ,
1999-04-25 09:41:57 +08:00
selection_sharpen_inargs ,
1997-11-25 06:05:25 +08:00
0 ,
NULL ,
1999-04-25 09:41:57 +08:00
{ { selection_sharpen_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_all_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
GimpImage * gimage ;
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_IMAGE ( gimage ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
if ( success )
removed the feather(), sharpen(), all(), invert(), border(), grow() and
2003-09-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-mask.[ch]: removed the feather(), sharpen(),
all(), invert(), border(), grow() and shrink() wrappers.
* app/core/gimpselection.[ch]: changed gimp_selection_invalidate()
and gimp_selection_push_undo() to take GimpChannel parameters, not
GimpSelection ones. They will be made virtual GimpChannel
functions anyway.
* app/core/gimpedit.c
* app/gui/select-commands.c
* app/widgets/gimpselectioneditor.c
* tools/pdbgen/pdb/selection.pdb: changed accordingly.
* app/pdb/selection_cmds.c: regenerated.
2003-09-03 21:37:49 +08:00
gimp_channel_all ( gimp_image_get_mask ( gimage ) , TRUE ) ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
return procedural_db_return_args ( & selection_all_proc , success ) ;
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_all_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1999-04-25 09:41:57 +08:00
" The image "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_all_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_all " ,
1999-04-25 09:41:57 +08:00
" Select all of the image. " ,
" This procedure sets the selection mask to completely encompass the image. Every pixel in the selection channel is set to 255. " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
1 ,
1999-04-25 09:41:57 +08:00
selection_all_inargs ,
1997-11-25 06:05:25 +08:00
0 ,
NULL ,
1999-04-25 09:41:57 +08:00
{ { selection_all_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_none_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
GimpImage * gimage ;
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_IMAGE ( gimage ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
if ( success )
2003-09-03 22:22:38 +08:00
gimp_channel_clear ( gimp_image_get_mask ( gimage ) , NULL , TRUE ) ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
return procedural_db_return_args ( & selection_none_proc , success ) ;
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_none_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1999-04-25 09:41:57 +08:00
" The image "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_none_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_none " ,
1999-04-25 09:41:57 +08:00
" Deselect the entire image. " ,
" This procedure deselects the entire image. Every pixel in the selection channel is set to 0. " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
1 ,
1999-04-25 09:41:57 +08:00
selection_none_inargs ,
1997-11-25 06:05:25 +08:00
0 ,
NULL ,
1999-04-25 09:41:57 +08:00
{ { selection_none_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_feather_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
GimpImage * gimage ;
gdouble radius ;
1997-11-25 06:05:25 +08:00
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_IMAGE ( gimage ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
radius = args [ 1 ] . value . pdb_float ;
2000-01-27 12:02:15 +08:00
if ( radius < 0.0 )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
if ( success )
removed the feather(), sharpen(), all(), invert(), border(), grow() and
2003-09-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-mask.[ch]: removed the feather(), sharpen(),
all(), invert(), border(), grow() and shrink() wrappers.
* app/core/gimpselection.[ch]: changed gimp_selection_invalidate()
and gimp_selection_push_undo() to take GimpChannel parameters, not
GimpSelection ones. They will be made virtual GimpChannel
functions anyway.
* app/core/gimpedit.c
* app/gui/select-commands.c
* app/widgets/gimpselectioneditor.c
* tools/pdbgen/pdb/selection.pdb: changed accordingly.
* app/pdb/selection_cmds.c: regenerated.
2003-09-03 21:37:49 +08:00
gimp_channel_feather ( gimp_image_get_mask ( gimage ) , radius , radius , TRUE ) ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
return procedural_db_return_args ( & selection_feather_proc , success ) ;
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_feather_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1999-04-25 09:41:57 +08:00
" The image "
1997-11-25 06:05:25 +08:00
} ,
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_FLOAT ,
1997-11-25 06:05:25 +08:00
" radius " ,
1999-04-25 09:41:57 +08:00
" Radius of feather (in pixels) "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_feather_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_feather " ,
" Feather the image's selection " ,
1999-04-25 09:41:57 +08:00
" This procedure feathers the selection. Feathering is implemented using a gaussian blur. " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
2 ,
1999-04-25 09:41:57 +08:00
selection_feather_inargs ,
1997-11-25 06:05:25 +08:00
0 ,
NULL ,
1999-04-25 09:41:57 +08:00
{ { selection_feather_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_border_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
GimpImage * gimage ;
gint32 radius ;
1997-11-25 06:05:25 +08:00
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_IMAGE ( gimage ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
radius = args [ 1 ] . value . pdb_int ;
2000-01-27 12:02:15 +08:00
if ( radius < 0 )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
if ( success )
removed the feather(), sharpen(), all(), invert(), border(), grow() and
2003-09-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-mask.[ch]: removed the feather(), sharpen(),
all(), invert(), border(), grow() and shrink() wrappers.
* app/core/gimpselection.[ch]: changed gimp_selection_invalidate()
and gimp_selection_push_undo() to take GimpChannel parameters, not
GimpSelection ones. They will be made virtual GimpChannel
functions anyway.
* app/core/gimpedit.c
* app/gui/select-commands.c
* app/widgets/gimpselectioneditor.c
* tools/pdbgen/pdb/selection.pdb: changed accordingly.
* app/pdb/selection_cmds.c: regenerated.
2003-09-03 21:37:49 +08:00
gimp_channel_border ( gimp_image_get_mask ( gimage ) , radius , radius , TRUE ) ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
return procedural_db_return_args ( & selection_border_proc , success ) ;
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_border_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1999-04-25 09:41:57 +08:00
" The image "
1997-11-25 06:05:25 +08:00
} ,
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1997-11-25 06:05:25 +08:00
" radius " ,
1999-04-25 09:41:57 +08:00
" Radius of border (in pixels) "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_border_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_border " ,
" Border the image's selection " ,
1999-04-25 09:41:57 +08:00
" This procedure borders the selection. Bordering creates a new selection which is defined along the boundary of the previous selection at every point within the specified radius. " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
2 ,
1999-04-25 09:41:57 +08:00
selection_border_inargs ,
1997-11-25 06:05:25 +08:00
0 ,
NULL ,
1999-04-25 09:41:57 +08:00
{ { selection_border_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_grow_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
GimpImage * gimage ;
gint32 steps ;
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_IMAGE ( gimage ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
steps = args [ 1 ] . value . pdb_int ;
2000-01-27 12:02:15 +08:00
if ( steps < 0 )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
if ( success )
removed the feather(), sharpen(), all(), invert(), border(), grow() and
2003-09-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-mask.[ch]: removed the feather(), sharpen(),
all(), invert(), border(), grow() and shrink() wrappers.
* app/core/gimpselection.[ch]: changed gimp_selection_invalidate()
and gimp_selection_push_undo() to take GimpChannel parameters, not
GimpSelection ones. They will be made virtual GimpChannel
functions anyway.
* app/core/gimpedit.c
* app/gui/select-commands.c
* app/widgets/gimpselectioneditor.c
* tools/pdbgen/pdb/selection.pdb: changed accordingly.
* app/pdb/selection_cmds.c: regenerated.
2003-09-03 21:37:49 +08:00
gimp_channel_grow ( gimp_image_get_mask ( gimage ) , steps , steps , TRUE ) ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
return procedural_db_return_args ( & selection_grow_proc , success ) ;
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_grow_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1999-04-25 09:41:57 +08:00
" The image "
1997-11-25 06:05:25 +08:00
} ,
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1997-11-25 06:05:25 +08:00
" steps " ,
1999-04-25 09:41:57 +08:00
" Steps of grow (in pixels) "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_grow_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_grow " ,
" Grow the image's selection " ,
1999-04-25 09:41:57 +08:00
" This procedure grows the selection. Growing involves expanding the boundary in all directions by the specified pixel amount. " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
2 ,
1999-04-25 09:41:57 +08:00
selection_grow_inargs ,
1997-11-25 06:05:25 +08:00
0 ,
NULL ,
1999-04-25 09:41:57 +08:00
{ { selection_grow_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_shrink_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
GimpImage * gimage ;
gint32 radius ;
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_IMAGE ( gimage ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
radius = args [ 1 ] . value . pdb_int ;
2000-01-27 12:02:15 +08:00
if ( radius < 0 )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
if ( success )
removed the feather(), sharpen(), all(), invert(), border(), grow() and
2003-09-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-mask.[ch]: removed the feather(), sharpen(),
all(), invert(), border(), grow() and shrink() wrappers.
* app/core/gimpselection.[ch]: changed gimp_selection_invalidate()
and gimp_selection_push_undo() to take GimpChannel parameters, not
GimpSelection ones. They will be made virtual GimpChannel
functions anyway.
* app/core/gimpedit.c
* app/gui/select-commands.c
* app/widgets/gimpselectioneditor.c
* tools/pdbgen/pdb/selection.pdb: changed accordingly.
* app/pdb/selection_cmds.c: regenerated.
2003-09-03 21:37:49 +08:00
gimp_channel_shrink ( gimp_image_get_mask ( gimage ) , radius , radius , FALSE , TRUE ) ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
return procedural_db_return_args ( & selection_shrink_proc , success ) ;
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_shrink_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1999-04-25 09:41:57 +08:00
" The image "
1997-11-25 06:05:25 +08:00
} ,
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
1997-11-25 06:05:25 +08:00
" radius " ,
1999-04-25 09:41:57 +08:00
" Radius of shrink (in pixels) "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_shrink_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_shrink " ,
" Shrink the image's selection " ,
1999-04-25 09:41:57 +08:00
" This procedure shrinks the selection. Shrinking invovles trimming the existing selection boundary on all sides by the specified number of pixels. " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
2 ,
1999-04-25 09:41:57 +08:00
selection_shrink_inargs ,
1997-11-25 06:05:25 +08:00
0 ,
NULL ,
1999-04-25 09:41:57 +08:00
{ { selection_shrink_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_layer_alpha_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
GimpLayer * layer ;
GimpImage * gimage ;
2002-02-26 01:58:50 +08:00
layer = ( GimpLayer * ) gimp_item_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_LAYER ( layer ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
if ( success )
{
2002-02-26 01:58:50 +08:00
gimage = gimp_item_get_image ( GIMP_ITEM ( layer ) ) ;
2004-03-17 00:23:06 +08:00
gimp_channel_select_alpha ( gimp_image_get_mask ( gimage ) ,
GIMP_DRAWABLE ( layer ) ,
2003-10-06 20:17:11 +08:00
GIMP_CHANNEL_OP_REPLACE , FALSE , 0.0 , 0.0 ) ;
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
return procedural_db_return_args ( & selection_layer_alpha_proc , success ) ;
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_layer_alpha_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_LAYER ,
1997-11-25 06:05:25 +08:00
" layer " ,
1999-04-25 09:41:57 +08:00
" Layer with alpha "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_layer_alpha_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_layer_alpha " ,
1999-04-25 09:41:57 +08:00
" Transfer the specified layer's alpha channel to the selection mask. " ,
" This procedure requires a layer with an alpha channel. The alpha channel information is used to create a selection mask such that for any pixel in the image defined in the specified layer, that layer pixel's alpha value is transferred to the selection mask. If the layer is undefined at a particular image pixel, the associated selection mask value is set to 0. " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
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
1 ,
1999-04-25 09:41:57 +08:00
selection_layer_alpha_inargs ,
1997-11-25 06:05:25 +08:00
0 ,
NULL ,
1999-04-25 09:41:57 +08:00
{ { selection_layer_alpha_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_load_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
2001-01-29 10:45:02 +08:00
GimpChannel * channel ;
1999-04-25 09:41:57 +08:00
2002-02-26 01:58:50 +08:00
channel = ( GimpChannel * ) gimp_item_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_CHANNEL ( channel ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
if ( success )
{
2003-08-22 03:23:17 +08:00
GimpImage * gimage ;
gint off_x , off_y ;
2002-02-26 01:58:50 +08:00
gimage = gimp_item_get_image ( GIMP_ITEM ( channel ) ) ;
2003-08-22 03:23:17 +08:00
gimp_item_offsets ( GIMP_ITEM ( channel ) , & off_x , & off_y ) ;
2003-05-08 21:12:46 +08:00
2003-10-06 20:17:11 +08:00
gimp_channel_select_channel ( gimp_image_get_mask ( gimage ) ,
_ ( " Channel to Selection " ) ,
channel ,
off_x , off_y ,
GIMP_CHANNEL_OP_REPLACE ,
FALSE , 0.0 , 0.0 ) ;
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
return procedural_db_return_args ( & selection_load_proc , success ) ;
1997-11-25 06:05:25 +08:00
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_load_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_CHANNEL ,
1997-11-25 06:05:25 +08:00
" channel " ,
1999-04-25 09:41:57 +08:00
" The channel "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_load_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_load " ,
1999-04-25 09:41:57 +08:00
" Transfer the specified channel to the selection mask. " ,
2003-08-22 03:23:17 +08:00
" This procedure loads the specified channel into the selection mask. " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
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
1 ,
1999-04-25 09:41:57 +08:00
selection_load_inargs ,
1997-11-25 06:05:25 +08:00
0 ,
NULL ,
1999-04-25 09:41:57 +08:00
{ { selection_load_invoker } }
1997-11-25 06:05:25 +08:00
} ;
static Argument *
2001-07-05 03:31:35 +08:00
selection_save_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
gboolean success = TRUE ;
Argument * return_args ;
GimpImage * gimage ;
2001-01-29 10:45:02 +08:00
GimpChannel * channel = NULL ;
1997-11-25 06:05:25 +08:00
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_IMAGE ( gimage ) )
1999-04-25 09:41:57 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
if ( success )
2003-09-05 04:18:08 +08:00
success = ( channel = gimp_selection_save ( gimp_image_get_mask ( gimage ) ) ) ! = NULL ;
1997-11-25 06:05:25 +08:00
1999-04-25 09:41:57 +08:00
return_args = procedural_db_return_args ( & selection_save_proc , success ) ;
1997-11-25 06:05:25 +08:00
if ( success )
2002-02-26 01:58:50 +08:00
return_args [ 1 ] . value . pdb_int = gimp_item_get_ID ( GIMP_ITEM ( channel ) ) ;
1997-11-25 06:05:25 +08:00
return return_args ;
}
1999-04-25 09:41:57 +08:00
static ProcArg selection_save_inargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1999-04-25 09:41:57 +08:00
" The image "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcArg selection_save_outargs [ ] =
1997-11-25 06:05:25 +08:00
{
1999-04-25 09:41:57 +08:00
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_CHANNEL ,
1997-11-25 06:05:25 +08:00
" channel " ,
1999-04-25 09:41:57 +08:00
" The new channel "
1997-11-25 06:05:25 +08:00
}
} ;
1999-04-25 09:41:57 +08:00
static ProcRecord selection_save_proc =
1997-11-25 06:05:25 +08:00
{
" gimp_selection_save " ,
1999-04-25 09:41:57 +08:00
" Copy the selection mask to a new channel. " ,
" This procedure copies the selection mask and stores the content in a new channel. The new channel is automatically inserted into the image's list of channels. " ,
1997-11-25 06:05:25 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
1 ,
1999-04-25 09:41:57 +08:00
selection_save_inargs ,
1997-11-25 06:05:25 +08:00
1 ,
1999-04-25 09:41:57 +08:00
selection_save_outargs ,
{ { selection_save_invoker } }
1997-11-25 06:05:25 +08:00
} ;
2001-01-29 08:02:33 +08:00
static Argument *
2001-07-05 03:31:35 +08:00
selection_combine_invoker ( Gimp * gimp ,
Argument * args )
2001-01-29 08:02:33 +08:00
{
gboolean success = TRUE ;
2001-01-29 10:45:02 +08:00
GimpChannel * channel ;
2001-01-29 08:02:33 +08:00
gint32 operation ;
2002-02-26 01:58:50 +08:00
channel = ( GimpChannel * ) gimp_item_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-30 01:21:21 +08:00
if ( ! GIMP_IS_CHANNEL ( channel ) )
2001-01-29 08:02:33 +08:00
success = FALSE ;
operation = args [ 1 ] . value . pdb_int ;
2002-03-19 00:22:14 +08:00
if ( operation < GIMP_CHANNEL_OP_ADD | | operation > GIMP_CHANNEL_OP_INTERSECT )
2001-01-29 08:02:33 +08:00
success = FALSE ;
if ( success )
{
2003-08-22 03:23:17 +08:00
GimpImage * gimage ;
gint off_x , off_y ;
2002-02-26 01:58:50 +08:00
gimage = gimp_item_get_image ( GIMP_ITEM ( channel ) ) ;
2003-08-22 03:23:17 +08:00
gimp_item_offsets ( GIMP_ITEM ( channel ) , & off_x , & off_y ) ;
2003-05-08 21:12:46 +08:00
2003-10-06 20:17:11 +08:00
gimp_channel_select_channel ( gimp_image_get_mask ( gimage ) ,
_ ( " Channel to Selection " ) ,
channel ,
off_x , off_y ,
operation ,
FALSE , 0.0 , 0.0 ) ;
2001-01-29 08:02:33 +08:00
}
return procedural_db_return_args ( & selection_combine_proc , success ) ;
}
static ProcArg selection_combine_inargs [ ] =
{
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_CHANNEL ,
2001-01-29 08:02:33 +08:00
" channel " ,
" The channel "
} ,
{
2001-05-21 21:58:46 +08:00
GIMP_PDB_INT32 ,
2001-01-29 08:02:33 +08:00
" operation " ,
2002-03-19 00:22:14 +08:00
" The selection operation: { GIMP_CHANNEL_OP_ADD (0), GIMP_CHANNEL_OP_SUBTRACT (1), GIMP_CHANNEL_OP_REPLACE (2), GIMP_CHANNEL_OP_INTERSECT (3) } "
2001-01-29 08:02:33 +08:00
}
} ;
static ProcRecord selection_combine_proc =
{
" gimp_selection_combine " ,
" Combines the specified channel with the selection mask. " ,
2003-08-22 03:23:17 +08:00
" This procedure combines the specified channel into the selection mask. " ,
2001-01-29 08:02:33 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
2001-01-29 08:02:33 +08:00
2 ,
selection_combine_inargs ,
0 ,
NULL ,
{ { selection_combine_invoker } }
} ;