2006-12-09 21:33:38 +00:00
/* GIMP - The GNU Image Manipulation Program
2003-07-03 00:47:26 +00:00
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
1997-11-24 22:05:25 +00:00
*
2009-01-17 22:28:01 +00:00
* This program is free software : you can redistribute it and / or modify
1997-11-24 22:05:25 +00:00
* it under the terms of the GNU General Public License as published by
2009-01-17 22:28:01 +00:00
* the Free Software Foundation ; either version 3 of the License , or
1997-11-24 22:05:25 +00:00
* ( 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
2018-07-11 23:27:07 +02:00
* along with this program . If not , see < https : //www.gnu.org/licenses/>.
1997-11-24 22:05:25 +00:00
*/
1998-07-08 06:41:58 +00:00
2007-01-09 10:52:47 +00:00
/* NOTE: This file is auto-generated by pdbgen.pl. */
1997-11-24 22:05:25 +00:00
2000-12-29 15:22:01 +00:00
# include "config.h"
1997-11-24 22:05:25 +00:00
2008-10-09 20:24:04 +00:00
# include <gegl.h>
2000-12-29 15:22:01 +00:00
2012-05-03 03:36:22 +02:00
# include <gdk-pixbuf/gdk-pixbuf.h>
2012-05-04 00:50:23 +02:00
# include "libgimpbase/gimpbase.h"
2001-08-17 14:27:31 +00:00
# include "pdb-types.h"
2000-12-29 15:22:01 +00:00
2004-02-10 15:33:37 +00:00
# include "config/gimpcoreconfig.h"
2001-07-07 12:17:23 +00:00
# include "core/gimp.h"
2014-06-03 23:05:23 +02:00
# include "core/gimpchannel-select.h"
2016-03-08 01:38:05 +01:00
# include "core/gimpdrawable-fill.h"
2005-07-09 22:44:26 +00:00
# include "core/gimpdrawable-foreground-extract.h"
2001-05-09 02:32:03 +00:00
# include "core/gimpdrawable-offset.h"
2004-12-13 23:36:17 +00:00
# include "core/gimpdrawable-preview.h"
2008-04-21 17:20:51 +00:00
# include "core/gimpdrawable-shadow.h"
2001-05-09 02:32:03 +00:00
# include "core/gimpdrawable.h"
# include "core/gimpimage.h"
2008-02-07 17:08:54 +00:00
# include "core/gimpparamspecs.h"
2012-04-09 00:59:20 +02:00
# include "core/gimptempbuf.h"
2012-04-25 13:02:20 +02:00
# include "gegl/gimp-babl-compat.h"
2012-04-24 21:45:35 +02:00
# include "gegl/gimp-babl.h"
2008-04-21 17:20:51 +00:00
# include "plug-in/gimpplugin-cleanup.h"
2006-05-03 18:05:06 +00:00
# include "plug-in/gimpplugin.h"
2006-04-28 22:26:51 +00:00
# include "plug-in/gimppluginmanager.h"
2003-02-14 14:14:29 +00:00
2008-02-07 17:08:54 +00:00
# include "gimppdb.h"
# include "gimppdb-utils.h"
2014-06-03 23:05:23 +02:00
# include "gimppdbcontext.h"
2008-02-07 17:08:54 +00:00
# include "gimpprocedure.h"
2008-04-04 11:15:55 +00:00
# include "internal-procs.h"
2006-10-31 19:02:56 +00:00
2008-02-07 17:08:54 +00:00
# include "gimp-intl.h"
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-23 20:54:02 +00:00
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_get_format_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2012-04-24 21:45:35 +02:00
{
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
2012-04-24 21:45:35 +02:00
GimpDrawable * drawable ;
gchar * format = NULL ;
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-04-24 21:45:35 +02:00
if ( success )
{
2019-01-01 18:24:35 +01:00
/* this only transfers the encoding, losing the space, see the
* code in libgimp / gimpdrawable . c which reconstructs the actual
* format in the plug - in process
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 14:23:01 +02:00
*/
format = g_strdup ( babl_format_get_encoding ( gimp_drawable_get_format ( drawable ) ) ) ;
2012-04-24 21:45:35 +02:00
}
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
if ( success )
2012-05-04 00:50:23 +02:00
g_value_take_string ( gimp_value_array_index ( return_vals , 1 ) , format ) ;
2012-04-24 21:45:35 +02:00
return return_vals ;
}
2019-07-10 15:10:03 +02:00
static GimpValueArray *
drawable_get_thumbnail_format_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
{
gboolean success = TRUE ;
GimpValueArray * return_vals ;
GimpDrawable * drawable ;
gchar * format = NULL ;
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2019-07-10 15:10:03 +02:00
if ( success )
{
format = g_strdup ( babl_format_get_encoding ( gimp_drawable_get_preview_format ( drawable ) ) ) ;
}
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
if ( success )
g_value_take_string ( gimp_value_array_index ( return_vals , 1 ) , format ) ;
return return_vals ;
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_type_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-04 21:11:45 +00:00
{
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
2006-04-04 21:11:45 +00:00
GimpDrawable * drawable ;
2019-08-15 14:04:56 +02:00
gint type = 0 ;
2006-03-28 19:58:00 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2006-03-28 19:58:00 +00:00
2006-04-04 21:11:45 +00:00
if ( success )
{
2012-04-11 01:22:29 +02:00
type = gimp_babl_format_get_image_type ( gimp_drawable_get_format ( drawable ) ) ;
2006-04-04 21:11:45 +00:00
}
2006-03-28 19:58:00 +00:00
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2000-02-17 11:44:27 +00:00
if ( success )
2012-05-04 00:50:23 +02:00
g_value_set_enum ( gimp_value_array_index ( return_vals , 1 ) , type ) ;
1997-11-24 22:05:25 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
1997-11-24 22:05:25 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_type_with_alpha_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-04 13:21:27 +00:00
{
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
2003-12-04 13:21:27 +00:00
GimpDrawable * drawable ;
2019-08-15 14:04:56 +02:00
gint type_with_alpha = 0 ;
2003-12-04 13:21:27 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2003-12-04 13:21:27 +00:00
2006-03-18 13:26:38 +00:00
if ( success )
{
2012-04-07 02:27:58 +02:00
const Babl * format = gimp_drawable_get_format_with_alpha ( drawable ) ;
type_with_alpha = gimp_babl_format_get_image_type ( format ) ;
2006-03-18 13:26:38 +00:00
}
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-04 13:21:27 +00:00
if ( success )
2012-05-04 00:50:23 +02:00
g_value_set_enum ( gimp_value_array_index ( return_vals , 1 ) , type_with_alpha ) ;
2003-12-04 13:21:27 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2003-12-04 13:21:27 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_has_alpha_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-08 17:26:55 +00:00
{
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
2003-12-08 17:26:55 +00:00
GimpDrawable * drawable ;
2006-03-18 13:26:38 +00:00
gboolean has_alpha = FALSE ;
2003-12-08 17:26:55 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2003-12-08 17:26:55 +00:00
2006-03-18 13:26:38 +00:00
if ( success )
{
has_alpha = gimp_drawable_has_alpha ( drawable ) ;
}
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-08 17:26:55 +00:00
if ( success )
2012-05-04 00:50:23 +02:00
g_value_set_boolean ( gimp_value_array_index ( return_vals , 1 ) , has_alpha ) ;
2003-12-08 17:26:55 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2003-12-08 17:26:55 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_is_rgb_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-24 22:05:25 +00:00
{
2000-02-17 11:44:27 +00:00
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-23 20:54:02 +00:00
GimpDrawable * drawable ;
2006-03-18 13:26:38 +00:00
gboolean is_rgb = FALSE ;
1997-11-24 22:05:25 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
1997-11-24 22:05:25 +00:00
2006-03-18 13:26:38 +00:00
if ( success )
{
is_rgb = gimp_drawable_is_rgb ( drawable ) ;
}
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2000-02-17 11:44:27 +00:00
if ( success )
2012-05-04 00:50:23 +02:00
g_value_set_boolean ( gimp_value_array_index ( return_vals , 1 ) , is_rgb ) ;
1997-11-24 22:05:25 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
1997-11-24 22:05:25 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_is_gray_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-24 22:05:25 +00:00
{
2000-02-17 11:44:27 +00:00
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-23 20:54:02 +00:00
GimpDrawable * drawable ;
2006-03-18 13:26:38 +00:00
gboolean is_gray = FALSE ;
1997-11-24 22:05:25 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
1997-11-24 22:05:25 +00:00
2006-03-18 13:26:38 +00:00
if ( success )
{
is_gray = gimp_drawable_is_gray ( drawable ) ;
}
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2000-02-17 11:44:27 +00:00
if ( success )
2012-05-04 00:50:23 +02:00
g_value_set_boolean ( gimp_value_array_index ( return_vals , 1 ) , is_gray ) ;
1997-11-24 22:05:25 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
1997-11-24 22:05:25 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_is_indexed_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-24 22:05:25 +00:00
{
2000-02-17 11:44:27 +00:00
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-23 20:54:02 +00:00
GimpDrawable * drawable ;
2006-03-18 13:26:38 +00:00
gboolean is_indexed = FALSE ;
1997-11-24 22:05:25 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2000-02-17 11:44:27 +00:00
2006-03-18 13:26:38 +00:00
if ( success )
{
is_indexed = gimp_drawable_is_indexed ( drawable ) ;
}
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1997-11-24 22:05:25 +00:00
2000-02-17 11:44:27 +00:00
if ( success )
2012-05-04 00:50:23 +02:00
g_value_set_boolean ( gimp_value_array_index ( return_vals , 1 ) , is_indexed ) ;
1997-11-24 22:05:25 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
1997-11-24 22:05:25 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2021-04-06 14:28:40 +02:00
drawable_get_bpp_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-24 22:05:25 +00:00
{
2000-02-17 11:44:27 +00:00
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-23 20:54:02 +00:00
GimpDrawable * drawable ;
2019-08-15 14:04:56 +02:00
gint bpp = 0 ;
1997-11-24 22:05:25 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
1997-11-24 22:05:25 +00:00
2006-03-18 13:26:38 +00:00
if ( success )
{
2012-04-24 21:45:35 +02:00
const Babl * format = gimp_drawable_get_format ( drawable ) ;
bpp = babl_format_get_bytes_per_pixel ( format ) ;
2006-03-18 13:26:38 +00:00
}
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2000-02-17 11:44:27 +00:00
if ( success )
2012-05-04 00:50:23 +02:00
g_value_set_int ( gimp_value_array_index ( return_vals , 1 ) , bpp ) ;
1997-11-24 22:05:25 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
1997-11-24 22:05:25 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2021-04-06 14:28:40 +02:00
drawable_get_width_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-24 22:05:25 +00:00
{
2000-02-17 11:44:27 +00:00
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-23 20:54:02 +00:00
GimpDrawable * drawable ;
2019-08-15 14:04:56 +02:00
gint width = 0 ;
1997-11-24 22:05:25 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
1997-11-24 22:05:25 +00:00
2006-03-18 13:26:38 +00:00
if ( success )
{
2008-11-03 00:09:01 +00:00
width = gimp_item_get_width ( GIMP_ITEM ( drawable ) ) ;
2006-03-18 13:26:38 +00:00
}
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2000-02-17 11:44:27 +00:00
if ( success )
2012-05-04 00:50:23 +02:00
g_value_set_int ( gimp_value_array_index ( return_vals , 1 ) , width ) ;
1997-11-24 22:05:25 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
1997-11-24 22:05:25 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2021-04-06 14:28:40 +02:00
drawable_get_height_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-24 22:05:25 +00:00
{
2000-02-17 11:44:27 +00:00
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-23 20:54:02 +00:00
GimpDrawable * drawable ;
2019-08-15 14:04:56 +02:00
gint height = 0 ;
1997-11-24 22:05:25 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2000-02-17 11:44:27 +00:00
2006-03-18 13:26:38 +00:00
if ( success )
{
2008-11-03 00:09:01 +00:00
height = gimp_item_get_height ( GIMP_ITEM ( drawable ) ) ;
2006-03-18 13:26:38 +00:00
}
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1997-11-24 22:05:25 +00:00
2000-02-17 11:44:27 +00:00
if ( success )
2012-05-04 00:50:23 +02:00
g_value_set_int ( gimp_value_array_index ( return_vals , 1 ) , height ) ;
1997-11-24 22:05:25 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
1997-11-24 22:05:25 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2021-04-06 14:28:40 +02:00
drawable_get_offsets_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-04 21:11:45 +00:00
{
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
2006-04-04 21:11:45 +00:00
GimpDrawable * drawable ;
2019-08-15 14:04:56 +02:00
gint offset_x = 0 ;
gint offset_y = 0 ;
2006-04-04 21:11:45 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2006-04-04 21:11:45 +00:00
if ( success )
{
2010-09-15 21:43:03 +02:00
gimp_item_get_offset ( GIMP_ITEM ( drawable ) , & offset_x , & offset_y ) ;
2006-04-04 21:11:45 +00:00
}
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-04 21:11:45 +00:00
if ( success )
2010-09-15 21:43:03 +02:00
{
2012-05-04 00:50:23 +02:00
g_value_set_int ( gimp_value_array_index ( return_vals , 1 ) , offset_x ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 2 ) , offset_y ) ;
2010-09-15 21:43:03 +02:00
}
2006-04-04 21:11:45 +00:00
return return_vals ;
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_mask_bounds_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-03 16:39:32 +00:00
{
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
2003-12-03 16:39:32 +00:00
GimpDrawable * drawable ;
2006-04-04 21:11:45 +00:00
gboolean non_empty = FALSE ;
2019-08-15 14:04:56 +02:00
gint x1 = 0 ;
gint y1 = 0 ;
gint x2 = 0 ;
gint y2 = 0 ;
2003-12-03 16:39:32 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2003-12-03 16:39:32 +00:00
2006-03-18 13:26:38 +00:00
if ( success )
{
2012-11-08 20:46:18 +01:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL , 0 , error ) )
2010-09-07 21:28:00 +02:00
non_empty = gimp_item_mask_bounds ( GIMP_ITEM ( drawable ) , & x1 , & y1 , & x2 , & y2 ) ;
2008-09-17 22:52:06 +00:00
else
success = FALSE ;
2006-03-18 13:26:38 +00:00
}
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-03 16:39:32 +00:00
if ( success )
2006-04-04 21:11:45 +00:00
{
2012-05-04 00:50:23 +02:00
g_value_set_boolean ( gimp_value_array_index ( return_vals , 1 ) , non_empty ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 2 ) , x1 ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 3 ) , y1 ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 4 ) , x2 ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 5 ) , y2 ) ;
2006-04-04 21:11:45 +00:00
}
2003-12-03 16:39:32 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2003-12-03 16:39:32 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_mask_intersect_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-03 16:39:32 +00:00
{
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
2003-12-03 16:39:32 +00:00
GimpDrawable * drawable ;
2006-04-04 21:11:45 +00:00
gboolean non_empty = FALSE ;
2019-08-15 14:04:56 +02:00
gint x = 0 ;
gint y = 0 ;
gint width = 0 ;
gint height = 0 ;
2003-12-03 16:39:32 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2003-12-03 16:39:32 +00:00
if ( success )
2006-03-18 13:26:38 +00:00
{
2012-11-08 20:46:18 +01:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL , 0 , error ) )
2010-09-07 21:28:00 +02:00
non_empty = gimp_item_mask_intersect ( GIMP_ITEM ( drawable ) ,
& x , & y , & width , & height ) ;
2008-09-17 22:52:06 +00:00
else
success = FALSE ;
2006-03-18 13:26:38 +00:00
}
2003-12-03 16:39:32 +00:00
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-03 16:39:32 +00:00
2006-04-04 21:11:45 +00:00
if ( success )
{
2012-05-04 00:50:23 +02:00
g_value_set_boolean ( gimp_value_array_index ( return_vals , 1 ) , non_empty ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 2 ) , x ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 3 ) , y ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 4 ) , width ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 5 ) , height ) ;
2006-04-04 21:11:45 +00:00
}
return return_vals ;
}
2003-12-03 16:39:32 +00:00
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_merge_shadow_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-03 16:39:32 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2006-04-04 21:11:45 +00:00
gboolean undo ;
2003-12-03 16:39:32 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
undo = g_value_get_boolean ( gimp_value_array_index ( args , 1 ) ) ;
2003-12-03 16:39:32 +00:00
2006-03-18 13:26:38 +00:00
if ( success )
{
2012-11-08 20:46:18 +01:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2009-08-29 09:16:35 +02:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) )
2006-04-04 21:11:45 +00:00
{
2017-03-21 17:45:50 +01:00
const gchar * undo_desc = _ ( " Plug-in " ) ;
2006-03-18 13:26:38 +00:00
2006-04-28 22:26:51 +00:00
if ( gimp - > plug_in_manager - > current_plug_in )
2006-05-03 18:05:06 +00:00
undo_desc = gimp_plug_in_get_undo_desc ( gimp - > plug_in_manager - > current_plug_in ) ;
2003-12-03 16:39:32 +00:00
2012-03-22 19:10:12 +01:00
gimp_drawable_merge_shadow_buffer ( drawable , undo , undo_desc ) ;
2006-04-04 21:11:45 +00:00
}
else
success = FALSE ;
}
2008-08-16 13:57:57 +00:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-04 21:11:45 +00:00
}
2003-12-03 16:39:32 +00:00
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_free_shadow_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2008-04-21 17:20:51 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2008-04-21 17:20:51 +00:00
if ( success )
{
if ( gimp - > plug_in_manager - > current_plug_in )
gimp_plug_in_cleanup_remove_shadow ( gimp - > plug_in_manager - > current_plug_in ,
drawable ) ;
2012-03-22 19:10:12 +01:00
gimp_drawable_free_shadow_buffer ( drawable ) ;
2008-04-21 17:20:51 +00:00
}
2008-08-16 13:57:57 +00:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2008-04-21 17:20:51 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_update_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-03 16:39:32 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2019-08-15 14:04:56 +02:00
gint x ;
gint y ;
gint width ;
gint height ;
2003-12-03 16:39:32 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
x = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
y = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
width = g_value_get_int ( gimp_value_array_index ( args , 3 ) ) ;
height = g_value_get_int ( gimp_value_array_index ( args , 4 ) ) ;
2003-12-03 16:39:32 +00:00
if ( success )
2006-03-18 13:26:38 +00:00
{
2006-04-04 21:11:45 +00:00
gimp_drawable_update ( drawable , x , y , width , height ) ;
2006-03-18 13:26:38 +00:00
}
2003-12-03 16:39:32 +00:00
2008-08-16 13:57:57 +00:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-03 16:39:32 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_get_pixel_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-04 11:10:20 +00:00
{
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
2003-12-04 11:10:20 +00:00
GimpDrawable * drawable ;
2019-08-15 14:04:56 +02:00
gint x_coord ;
gint y_coord ;
gint num_channels = 0 ;
2006-04-04 21:11:45 +00:00
guint8 * pixel = NULL ;
2003-12-04 11:10:20 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
x_coord = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
y_coord = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
2003-12-04 11:10:20 +00:00
2006-03-18 13:26:38 +00:00
if ( success )
{
2012-04-25 13:34:30 +02:00
const Babl * format = gimp_drawable_get_format ( drawable ) ;
2008-11-03 00:09:01 +00:00
if ( x_coord < gimp_item_get_width ( GIMP_ITEM ( drawable ) ) & &
y_coord < gimp_item_get_height ( GIMP_ITEM ( drawable ) ) )
2006-04-04 21:11:45 +00:00
{
2015-11-25 00:00:44 +01:00
num_channels = babl_format_get_bytes_per_pixel ( format ) ;
pixel = g_new0 ( guint8 , num_channels ) ;
2012-03-27 23:12:59 +02:00
gegl_buffer_sample ( gimp_drawable_get_buffer ( drawable ) ,
2012-04-25 13:34:30 +02:00
x_coord , y_coord , NULL , pixel , format ,
2012-03-27 23:12:59 +02:00
GEGL_SAMPLER_NEAREST , GEGL_ABYSS_NONE ) ;
2006-04-04 21:11:45 +00:00
}
else
success = FALSE ;
2006-03-18 13:26:38 +00:00
}
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-04 11:10:20 +00:00
if ( success )
2006-04-04 21:11:45 +00:00
{
2012-05-04 00:50:23 +02:00
g_value_set_int ( gimp_value_array_index ( return_vals , 1 ) , num_channels ) ;
2019-08-15 15:04:34 +02:00
gimp_value_take_uint8_array ( gimp_value_array_index ( return_vals , 2 ) , pixel , num_channels ) ;
2006-04-04 21:11:45 +00:00
}
2003-12-04 11:10:20 +00:00
2006-03-27 21:09:32 +00:00
return return_vals ;
2003-12-04 11:10:20 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_set_pixel_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-04 11:10:20 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2019-08-15 14:04:56 +02:00
gint x_coord ;
gint y_coord ;
gint num_channels ;
2006-04-04 21:11:45 +00:00
const guint8 * pixel ;
2003-12-04 11:10:20 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
x_coord = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
y_coord = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
num_channels = g_value_get_int ( gimp_value_array_index ( args , 3 ) ) ;
2019-08-15 15:04:34 +02:00
pixel = gimp_value_get_uint8_array ( gimp_value_array_index ( args , 4 ) ) ;
2003-12-04 11:10:20 +00:00
if ( success )
2006-03-18 13:26:38 +00:00
{
2012-04-25 13:34:30 +02:00
const Babl * format = gimp_drawable_get_format ( drawable ) ;
2018-04-20 23:32:07 +02:00
if ( gimp_pdb_item_is_modifiable ( GIMP_ITEM ( drawable ) ,
2012-11-08 20:46:18 +01:00
GIMP_PDB_ITEM_CONTENT , error ) & &
2009-08-29 09:16:35 +02:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) & &
2009-08-20 20:47:01 +02:00
x_coord < gimp_item_get_width ( GIMP_ITEM ( drawable ) ) & &
2008-11-03 00:09:01 +00:00
y_coord < gimp_item_get_height ( GIMP_ITEM ( drawable ) ) & &
2012-04-25 13:34:30 +02:00
num_channels = = babl_format_get_bytes_per_pixel ( format ) )
2006-04-04 21:11:45 +00:00
{
2012-03-27 23:12:59 +02:00
gegl_buffer_set ( gimp_drawable_get_buffer ( drawable ) ,
2012-04-02 14:19:47 +01:00
GEGL_RECTANGLE ( x_coord , y_coord , 1 , 1 ) ,
2014-07-03 20:47:02 +02:00
0 , format , pixel , GEGL_AUTO_ROWSTRIDE ) ;
2006-04-04 21:11:45 +00:00
}
else
success = FALSE ;
2006-03-18 13:26:38 +00:00
}
2003-12-04 11:10:20 +00:00
2008-08-16 13:57:57 +00:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-04 11:10:20 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_fill_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-03 16:39:32 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2019-08-15 14:04:56 +02:00
gint fill_type ;
2003-12-03 16:39:32 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
fill_type = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
2003-12-03 16:39:32 +00:00
2006-03-18 13:26:38 +00:00
if ( success )
{
2018-04-20 23:32:07 +02:00
if ( gimp_pdb_item_is_modifiable ( GIMP_ITEM ( drawable ) ,
2012-11-08 20:46:18 +01:00
GIMP_PDB_ITEM_CONTENT , error ) & &
2009-08-29 09:16:35 +02:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) )
2014-06-03 14:11:59 +02:00
{
gimp_drawable_fill ( drawable , context , ( GimpFillType ) fill_type ) ;
}
2009-08-20 20:47:01 +02:00
else
success = FALSE ;
2006-03-18 13:26:38 +00:00
}
2008-08-16 13:57:57 +00:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-03 16:39:32 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_offset_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-03 16:39:32 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2006-04-04 21:11:45 +00:00
gboolean wrap_around ;
2019-08-15 14:04:56 +02:00
gint fill_type ;
gint offset_x ;
gint offset_y ;
2003-12-03 16:39:32 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
wrap_around = g_value_get_boolean ( gimp_value_array_index ( args , 1 ) ) ;
fill_type = g_value_get_enum ( gimp_value_array_index ( args , 2 ) ) ;
offset_x = g_value_get_int ( gimp_value_array_index ( args , 3 ) ) ;
offset_y = g_value_get_int ( gimp_value_array_index ( args , 4 ) ) ;
2003-12-03 16:39:32 +00:00
if ( success )
2006-03-18 13:26:38 +00:00
{
2012-11-08 20:46:18 +01:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2009-08-29 09:16:35 +02:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) )
2006-04-04 21:11:45 +00:00
gimp_drawable_offset ( drawable , context , wrap_around , fill_type ,
offset_x , offset_y ) ;
else
success = FALSE ;
2006-03-18 13:26:38 +00:00
}
2003-12-03 16:39:32 +00:00
2008-08-16 13:57:57 +00:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-03 16:39:32 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_thumbnail_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-08 17:26:55 +00:00
{
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
2003-12-08 17:26:55 +00:00
GimpDrawable * drawable ;
2019-08-15 14:04:56 +02:00
gint width ;
gint height ;
gint actual_width = 0 ;
gint actual_height = 0 ;
gint bpp = 0 ;
gint thumbnail_data_count = 0 ;
2006-04-04 21:11:45 +00:00
guint8 * thumbnail_data = NULL ;
2003-12-08 17:26:55 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
width = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
height = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
2003-12-08 17:26:55 +00:00
if ( success )
2006-03-18 13:26:38 +00:00
{
2012-04-08 20:25:49 +02:00
GimpImage * image = gimp_item_get_image ( GIMP_ITEM ( drawable ) ) ;
GimpTempBuf * buf ;
gint dwidth , dheight ;
2006-04-04 21:11:45 +00:00
2018-02-11 22:23:10 +01:00
gimp_assert ( GIMP_VIEWABLE_MAX_PREVIEW_SIZE > = 1024 ) ;
2006-08-08 14:45:40 +00:00
2006-04-04 21:11:45 +00:00
/* Adjust the width/height ratio */
2008-11-03 00:09:01 +00:00
dwidth = gimp_item_get_width ( GIMP_ITEM ( drawable ) ) ;
dheight = gimp_item_get_height ( GIMP_ITEM ( drawable ) ) ;
2006-04-04 21:11:45 +00:00
if ( dwidth > dheight )
height = MAX ( 1 , ( width * dheight ) / dwidth ) ;
else
width = MAX ( 1 , ( height * dwidth ) / dheight ) ;
if ( image - > gimp - > config - > layer_previews )
2012-04-21 22:09:39 +02:00
buf = gimp_viewable_get_new_preview ( GIMP_VIEWABLE ( drawable ) , context ,
width , height ) ;
2006-04-04 21:11:45 +00:00
else
2012-04-21 22:09:39 +02:00
buf = gimp_viewable_get_dummy_preview ( GIMP_VIEWABLE ( drawable ) ,
width , height ,
gimp_drawable_get_preview_format ( drawable ) ) ;
2006-04-04 21:11:45 +00:00
if ( buf )
{
2012-04-23 09:40:56 +02:00
actual_width = gimp_temp_buf_get_width ( buf ) ;
actual_height = gimp_temp_buf_get_height ( buf ) ;
bpp = babl_format_get_bytes_per_pixel ( gimp_temp_buf_get_format ( buf ) ) ;
2012-04-08 23:56:52 +02:00
thumbnail_data_count = gimp_temp_buf_get_data_size ( buf ) ;
thumbnail_data = g_memdup ( gimp_temp_buf_get_data ( buf ) ,
2006-04-04 21:11:45 +00:00
thumbnail_data_count ) ;
2012-04-09 00:16:46 +02:00
gimp_temp_buf_unref ( buf ) ;
2006-04-04 21:11:45 +00:00
}
else
success = FALSE ;
2006-03-18 13:26:38 +00:00
}
2003-12-08 17:26:55 +00:00
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-08 17:26:55 +00:00
if ( success )
{
2012-05-04 00:50:23 +02:00
g_value_set_int ( gimp_value_array_index ( return_vals , 1 ) , actual_width ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 2 ) , actual_height ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 3 ) , bpp ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 4 ) , thumbnail_data_count ) ;
2019-08-15 15:04:34 +02:00
gimp_value_take_uint8_array ( gimp_value_array_index ( return_vals , 5 ) , thumbnail_data , thumbnail_data_count ) ;
2003-12-08 17:26:55 +00:00
}
2006-03-27 21:09:32 +00:00
return return_vals ;
2003-12-08 17:26:55 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_sub_thumbnail_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-10-19 23:32:01 +00:00
{
gboolean success = TRUE ;
2012-05-04 00:50:23 +02:00
GimpValueArray * return_vals ;
2004-10-19 23:32:01 +00:00
GimpDrawable * drawable ;
2019-08-15 14:04:56 +02:00
gint src_x ;
gint src_y ;
gint src_width ;
gint src_height ;
gint dest_width ;
gint dest_height ;
gint width = 0 ;
gint height = 0 ;
gint bpp = 0 ;
gint thumbnail_data_count = 0 ;
2006-04-04 21:11:45 +00:00
guint8 * thumbnail_data = NULL ;
2004-10-19 23:32:01 +00:00
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
src_x = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
src_y = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
src_width = g_value_get_int ( gimp_value_array_index ( args , 3 ) ) ;
src_height = g_value_get_int ( gimp_value_array_index ( args , 4 ) ) ;
dest_width = g_value_get_int ( gimp_value_array_index ( args , 5 ) ) ;
dest_height = g_value_get_int ( gimp_value_array_index ( args , 6 ) ) ;
2004-10-19 23:32:01 +00:00
if ( success )
2006-03-18 13:26:38 +00:00
{
2008-11-03 00:09:01 +00:00
if ( ( src_x + src_width ) < = gimp_item_get_width ( GIMP_ITEM ( drawable ) ) & &
( src_y + src_height ) < = gimp_item_get_height ( GIMP_ITEM ( drawable ) ) )
2006-04-04 21:11:45 +00:00
{
2012-04-08 20:25:49 +02:00
GimpImage * image = gimp_item_get_image ( GIMP_ITEM ( drawable ) ) ;
GimpTempBuf * buf ;
2006-04-04 21:11:45 +00:00
if ( image - > gimp - > config - > layer_previews )
2012-04-21 22:09:39 +02:00
buf = gimp_drawable_get_sub_preview ( drawable ,
src_x , src_y ,
src_width , src_height ,
dest_width , dest_height ) ;
2006-04-04 21:11:45 +00:00
else
2012-04-21 22:09:39 +02:00
buf = gimp_viewable_get_dummy_preview ( GIMP_VIEWABLE ( drawable ) ,
dest_width , dest_height ,
gimp_drawable_get_preview_format ( drawable ) ) ;
2006-04-04 21:11:45 +00:00
if ( buf )
{
2012-04-23 09:40:56 +02:00
width = gimp_temp_buf_get_width ( buf ) ;
height = gimp_temp_buf_get_height ( buf ) ;
bpp = babl_format_get_bytes_per_pixel ( gimp_temp_buf_get_format ( buf ) ) ;
2012-04-08 23:56:52 +02:00
thumbnail_data_count = gimp_temp_buf_get_data_size ( buf ) ;
thumbnail_data = g_memdup ( gimp_temp_buf_get_data ( buf ) ,
2006-04-04 21:11:45 +00:00
thumbnail_data_count ) ;
2012-04-09 00:16:46 +02:00
gimp_temp_buf_unref ( buf ) ;
2006-04-04 21:11:45 +00:00
}
else
success = FALSE ;
}
else
success = FALSE ;
2006-03-18 13:26:38 +00:00
}
2004-10-19 23:32:01 +00:00
2008-08-16 13:57:57 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-10-19 23:32:01 +00:00
if ( success )
{
2012-05-04 00:50:23 +02:00
g_value_set_int ( gimp_value_array_index ( return_vals , 1 ) , width ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 2 ) , height ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 3 ) , bpp ) ;
g_value_set_int ( gimp_value_array_index ( return_vals , 4 ) , thumbnail_data_count ) ;
2019-08-15 15:04:34 +02:00
gimp_value_take_uint8_array ( gimp_value_array_index ( return_vals , 5 ) , thumbnail_data , thumbnail_data_count ) ;
2004-10-19 23:32:01 +00:00
}
2006-03-27 21:09:32 +00:00
return return_vals ;
2004-10-19 23:32:01 +00:00
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
drawable_foreground_extract_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-08 17:26:55 +00:00
{
gboolean success = TRUE ;
2013-06-10 11:24:15 +02:00
GimpDrawable * drawable ;
2019-08-15 14:04:56 +02:00
gint mode ;
2013-06-10 11:24:15 +02:00
GimpDrawable * mask ;
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2013-06-10 11:24:15 +02:00
mode = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
2019-08-29 11:25:35 +02:00
mask = g_value_get_object ( gimp_value_array_index ( args , 2 ) ) ;
2013-06-10 11:24:15 +02:00
2003-12-08 17:26:55 +00:00
if ( success )
{
2014-06-03 23:05:23 +02:00
if ( mode = = GIMP_FOREGROUND_EXTRACT_MATTING & &
gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL , 0 , error ) )
{
GimpPDBContext * pdb_context = GIMP_PDB_CONTEXT ( context ) ;
GimpImage * image = gimp_item_get_image ( GIMP_ITEM ( drawable ) ) ;
GeglBuffer * buffer ;
buffer = gimp_drawable_foreground_extract ( drawable ,
GIMP_MATTING_ENGINE_GLOBAL ,
2 ,
2 ,
2 ,
gimp_drawable_get_buffer ( mask ) ,
progress ) ;
gimp_channel_select_buffer ( gimp_image_get_mask ( image ) ,
C_ ( " command " , " Foreground Select " ) ,
buffer ,
0 , /* x offset */
0 , /* y offset */
GIMP_CHANNEL_OP_REPLACE ,
pdb_context - > feather ,
pdb_context - > feather_radius_x ,
pdb_context - > feather_radius_y ) ;
g_object_unref ( buffer ) ;
}
2006-03-24 21:57:47 +00:00
else
success = FALSE ;
2003-12-08 17:26:55 +00:00
}
2013-06-10 11:24:15 +02:00
2008-08-16 13:57:57 +00:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-08 17:26:55 +00:00
}
2006-04-04 21:11:45 +00:00
void
2006-04-26 09:13:47 +00:00
register_drawable_procs ( GimpPDB * pdb )
2003-12-08 17:26:55 +00:00
{
2006-04-04 21:11:45 +00:00
GimpProcedure * procedure ;
2003-12-08 17:26:55 +00:00
2012-04-24 21:45:35 +02:00
/*
* gimp - drawable - get - format
*/
procedure = gimp_procedure_new ( drawable_get_format_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-get-format " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Returns the drawable's Babl format " ,
" This procedure returns the drawable's Babl format. \n "
2019-01-01 18:24:35 +01:00
" Note that the actual PDB procedure only transfers the format's encoding. In order to get to the real format, the libbgimp C wrapper must be used. " ,
2019-09-08 23:40:34 +02:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2012 " ) ;
2012-04-24 21:45:35 +02:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2012-04-24 21:45:35 +02:00
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_string ( " format " ,
" format " ,
" The drawable's Babl format " ,
FALSE , FALSE , FALSE ,
NULL ,
2019-07-10 15:10:03 +02:00
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
/*
* gimp - drawable - get - thumbnail - format
*/
procedure = gimp_procedure_new ( drawable_get_thumbnail_format_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-get-thumbnail-format " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Returns the drawable's thumbnail Babl format " ,
" This procedure returns the drawable's thumbnail Babl format. \n "
2019-07-10 15:10:03 +02:00
" Thumbnails are always 8-bit images, see 'gimp-drawable-thumbnail' and 'gimp-drawable-sub-thmbnail'. " ,
2019-09-08 23:40:34 +02:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2019 " ) ;
2019-07-10 15:10:03 +02:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2019-07-10 15:10:03 +02:00
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_string ( " format " ,
" format " ,
" The drawable's thumbnail Babl format " ,
FALSE , FALSE , FALSE ,
NULL ,
2012-04-24 21:45:35 +02:00
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - type
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_type_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-type " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Returns the drawable's type. " ,
" This procedure returns the drawable's type. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_enum ( " type " ,
" type " ,
2006-05-18 17:25:15 +00:00
" The drawable's type " ,
2006-04-04 21:11:45 +00:00
GIMP_TYPE_IMAGE_TYPE ,
GIMP_RGB_IMAGE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2003-12-08 17:26:55 +00:00
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - type - with - alpha
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_type_with_alpha_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-type-with-alpha " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Returns the drawable's type with alpha. " ,
" This procedure returns the drawable's type as if had an alpha channel. If the type is currently Gray, for instance, the returned type would be GrayA. If the drawable already has an alpha channel, the drawable's type is simply returned. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_enum ( " type-with-alpha " ,
" type with alpha " ,
2006-05-18 17:25:15 +00:00
" The drawable's type with alpha " ,
2006-04-04 21:11:45 +00:00
GIMP_TYPE_IMAGE_TYPE ,
GIMP_RGB_IMAGE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_param_spec_enum_exclude_value ( GIMP_PARAM_SPEC_ENUM ( procedure - > values [ 0 ] ) ,
GIMP_RGB_IMAGE ) ;
gimp_param_spec_enum_exclude_value ( GIMP_PARAM_SPEC_ENUM ( procedure - > values [ 0 ] ) ,
GIMP_GRAY_IMAGE ) ;
gimp_param_spec_enum_exclude_value ( GIMP_PARAM_SPEC_ENUM ( procedure - > values [ 0 ] ) ,
GIMP_INDEXED_IMAGE ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
1997-11-24 22:05:25 +00:00
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - has - alpha
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_has_alpha_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-has-alpha " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Returns TRUE if the drawable has an alpha channel. " ,
" This procedure returns whether the specified drawable has an alpha channel. This can only be true for layers, and the associated type will be one of: { RGBA , GRAYA, INDEXEDA }. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_boolean ( " has-alpha " ,
" has alpha " ,
" Does the drawable have an alpha channel? " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2006-03-15 12:49:25 +00:00
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - is - rgb
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_is_rgb_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-is-rgb " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Returns whether the drawable is an RGB type. " ,
" This procedure returns TRUE if the specified drawable is of type { RGB, RGBA }. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_boolean ( " is-rgb " ,
" is rgb " ,
" TRUE if the drawable is an RGB type " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2004-03-26 16:38:44 +00:00
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - is - gray
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_is_gray_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-is-gray " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Returns whether the drawable is a grayscale type. " ,
" This procedure returns TRUE if the specified drawable is of type { Gray, GrayA }. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_boolean ( " is-gray " ,
" is gray " ,
" TRUE if the drawable is a grayscale type " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2004-03-26 16:38:44 +00:00
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - is - indexed
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_is_indexed_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-is-indexed " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Returns whether the drawable is an indexed type. " ,
" This procedure returns TRUE if the specified drawable is of type { Indexed, IndexedA }. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_boolean ( " is-indexed " ,
" is indexed " ,
" TRUE if the drawable is an indexed type " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
1997-11-24 22:05:25 +00:00
2006-04-04 21:11:45 +00:00
/*
2021-04-06 14:28:40 +02:00
* gimp - drawable - get - bpp
2006-04-04 21:11:45 +00:00
*/
2021-04-06 14:28:40 +02:00
procedure = gimp_procedure_new ( drawable_get_bpp_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
2021-04-06 14:28:40 +02:00
" gimp-drawable-get-bpp " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Returns the bytes per pixel. " ,
" This procedure returns the number of bytes per pixel. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " bpp " ,
" bpp " ,
" Bytes per pixel " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
1997-11-24 22:05:25 +00:00
2006-04-04 21:11:45 +00:00
/*
2021-04-06 14:28:40 +02:00
* gimp - drawable - get - width
2006-04-04 21:11:45 +00:00
*/
2021-04-06 14:28:40 +02:00
procedure = gimp_procedure_new ( drawable_get_width_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
2021-04-06 14:28:40 +02:00
" gimp-drawable-get-width " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Returns the width of the drawable. " ,
" This procedure returns the specified drawable's width in pixels. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " width " ,
" width " ,
" Width of drawable " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
1998-10-08 08:15:21 +00:00
2006-04-04 21:11:45 +00:00
/*
2021-04-06 14:28:40 +02:00
* gimp - drawable - get - height
2006-04-04 21:11:45 +00:00
*/
2021-04-06 14:28:40 +02:00
procedure = gimp_procedure_new ( drawable_get_height_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
2021-04-06 14:28:40 +02:00
" gimp-drawable-get-height " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Returns the height of the drawable. " ,
" This procedure returns the specified drawable's height in pixels. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " height " ,
" height " ,
" Height of drawable " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2006-03-15 12:49:25 +00:00
2006-04-04 21:11:45 +00:00
/*
2021-04-06 14:28:40 +02:00
* gimp - drawable - get - offsets
2006-04-04 21:11:45 +00:00
*/
2021-04-06 14:28:40 +02:00
procedure = gimp_procedure_new ( drawable_get_offsets_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
2021-04-06 14:28:40 +02:00
" gimp-drawable-get-offsets " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Returns the offsets for the drawable. " ,
" This procedure returns the specified drawable's offsets. This only makes sense if the drawable is a layer since channels are anchored. The offsets of a channel will be returned as 0. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " offset-x " ,
" offset x " ,
" x offset of drawable " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " offset-y " ,
" offset y " ,
" y offset of drawable " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2004-03-26 16:38:44 +00:00
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - mask - bounds
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_mask_bounds_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-mask-bounds " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Find the bounding box of the current selection in relation to the specified drawable. " ,
" This procedure returns whether there is a selection. If there is one, the upper left and lower right-hand corners of its bounding box are returned. These coordinates are specified relative to the drawable's origin, and bounded by the drawable's extents. Please note that the pixel specified by the lower right-hand 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). \n "
2013-09-14 13:12:26 +12:00
" Note that the returned boolean does NOT correspond with the returned region being empty or not, it always returns whether the selection is non_empty. See 'gimp-drawable-mask-intersect' for a boolean return value which is more useful in most cases. " ,
2019-09-08 23:40:34 +02:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_boolean ( " non-empty " ,
" non empty " ,
" TRUE if there is a selection " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " x1 " ,
" x1 " ,
" x coordinate of the upper left corner of selection bounds " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " y1 " ,
" y1 " ,
" y coordinate of the upper left corner of selection bounds " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " x2 " ,
" x2 " ,
" x coordinate of the lower right corner of selection bounds " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " y2 " ,
" y2 " ,
" y coordinate of the lower right corner of selection bounds " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
1999-06-23 23:01:14 +00:00
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - mask - intersect
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_mask_intersect_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-mask-intersect " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Find the bounding box of the current selection in relation to the specified drawable. " ,
" This procedure returns whether there is an intersection between the drawable and the selection. Unlike 'gimp-drawable-mask-bounds', the intersection's bounds are returned as x, y, width, height. \n "
2013-09-14 13:12:26 +12:00
" If there is no selection this function returns TRUE and the returned bounds are the extents of the whole drawable. " ,
2019-09-08 23:40:34 +02:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2004 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_boolean ( " non-empty " ,
" non empty " ,
" TRUE if the returned area is not empty " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " x " ,
" x " ,
" x coordinate of the upper left corner of the intersection " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " y " ,
" y " ,
" y coordinate of the upper left corner of the intersection " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " width " ,
" width " ,
" width of the intersection " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " height " ,
" height " ,
" height of the intersection " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
1999-06-23 23:01:14 +00:00
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - merge - shadow
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_merge_shadow_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-merge-shadow " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Merge the shadow buffer with the specified drawable. " ,
" This procedure combines the contents of the drawable's shadow buffer (for temporary processing) with the specified drawable. The 'undo' parameter specifies whether to add an undo step for the operation. Requesting no undo is useful for such applications as 'auto-apply'. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " undo " ,
" undo " ,
" Push merge to undo stack? " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2004-12-13 23:36:17 +00:00
2008-04-21 17:20:51 +00:00
/*
* gimp - drawable - free - shadow
*/
procedure = gimp_procedure_new ( drawable_free_shadow_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-free-shadow " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Free the specified drawable's shadow data (if it exists). " ,
" This procedure is intended as a memory saving device. If any shadow memory has been allocated, it will be freed automatically when the drawable is removed from the image, or when the plug-in procedure which allocated it returns. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2008 " ) ;
2008-04-21 17:20:51 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2008-04-21 17:20:51 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - update
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_update_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-update " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Update the specified region of the drawable. " ,
" This procedure updates the specified region of the drawable. The (x, y) coordinate pair is relative to the drawable's origin, not to the image origin. Therefore, the entire drawable can be updated using (0, 0, width, height). " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " x " ,
" x " ,
" x coordinate of upper left corner of update region " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " y " ,
" y " ,
" y coordinate of upper left corner of update region " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " width " ,
" width " ,
" Width of update region " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " height " ,
" height " ,
" Height of update region " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2004-12-13 23:36:17 +00:00
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - get - pixel
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_get_pixel_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-get-pixel " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Gets the value of the pixel at the specified coordinates. " ,
" This procedure gets the pixel value at the specified coordinates. The 'num_channels' argument must always be equal to the bytes-per-pixel value for the specified drawable. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1997 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " x-coord " ,
" x coord " ,
" The x coordinate " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " y-coord " ,
" y coord " ,
" The y coordinate " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " num-channels " ,
" num channels " ,
" The number of channels for the pixel " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 15:04:34 +02:00
gimp_param_spec_uint8_array ( " pixel " ,
" pixel " ,
" The pixel value " ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - set - pixel
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_set_pixel_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-set-pixel " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Sets the value of the pixel at the specified coordinates. " ,
" This procedure sets the pixel value at the specified coordinates. The 'num_channels' argument must always be equal to the bytes-per-pixel value for the specified drawable. Note that this function is not undoable, you should use it only on drawables you just created yourself. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1997 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " x-coord " ,
" x coord " ,
" The x coordinate " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " y-coord " ,
" y coord " ,
" The y coordinate " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " num-channels " ,
" num channels " ,
" The number of channels for the pixel " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 15:04:34 +02:00
gimp_param_spec_uint8_array ( " pixel " ,
" pixel " ,
" The pixel value " ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2004-12-13 23:36:17 +00:00
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - fill
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_fill_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-fill " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Fill the drawable with the specified fill mode. " ,
" This procedure fills the drawable. If the fill mode is foreground the current foreground color is used. If the fill mode is background, the current background color is used. If the fill type is white, then white is used. Transparent fill only affects layers with an alpha channel, in which case the alpha channel is set to transparent. If the drawable has no alpha channel, it is filled to white. No fill leaves the drawable's contents undefined. \n "
2020-10-26 12:35:17 +01:00
" This procedure is unlike 'gimp-drawable-edit-fill' or the bucket fill tool because it fills regardless of a selection. Its main purpose is to fill a newly created drawable before adding it to the image. This operation cannot be undone. " ,
2019-09-08 23:40:34 +02:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " fill-type " ,
" fill type " ,
2006-05-18 17:25:15 +00:00
" The type of fill " ,
2006-04-04 21:11:45 +00:00
GIMP_TYPE_FILL_TYPE ,
2014-06-03 01:11:32 +02:00
GIMP_FILL_FOREGROUND ,
2006-04-04 21:11:45 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2004-12-13 23:36:17 +00:00
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - offset
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_offset_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-offset " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Offset the drawable by the specified amounts in the X and Y directions " ,
" This procedure offsets the specified drawable by the amounts specified by 'offset_x' and 'offset_y'. If 'wrap_around' is set to TRUE, then portions of the drawable which are offset out of bounds are wrapped around. Alternatively, the undefined regions of the drawable can be filled with transparency or the background color, as specified by the 'fill-type' parameter. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1997 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable to offset " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " wrap-around " ,
" wrap around " ,
" wrap image around or fill vacated regions " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " fill-type " ,
" fill type " ,
2006-05-18 17:25:15 +00:00
" fill vacated regions of drawable with background or transparent " ,
2006-04-04 21:11:45 +00:00
GIMP_TYPE_OFFSET_TYPE ,
GIMP_OFFSET_BACKGROUND ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " offset-x " ,
" offset x " ,
" offset by this amount in X direction " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " offset-y " ,
" offset y " ,
" offset by this amount in Y direction " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2004-12-13 23:36:17 +00:00
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - thumbnail
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_thumbnail_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-thumbnail " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Get a thumbnail of a drawable. " ,
" This function gets data from which a thumbnail of a drawable preview can be created. Maximum x or y dimension is 1024 pixels. The pixels are returned in RGB[A] or GRAY[A] format. The bpp return value gives the number of bytes in the image. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Andy Thomas " ,
" Andy Thomas " ,
" 1999 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " width " ,
" width " ,
" The requested thumbnail width " ,
1 , 1024 , 1 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " height " ,
" height " ,
" The requested thumbnail height " ,
1 , 1024 , 1 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " actual-width " ,
" actual width " ,
" The previews width " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " actual-height " ,
" actual height " ,
" The previews height " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " bpp " ,
" bpp " ,
" The previews bpp " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " thumbnail-data-count " ,
" thumbnail data count " ,
" The number of bytes in thumbnail data " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 15:04:34 +02:00
gimp_param_spec_uint8_array ( " thumbnail-data " ,
" thumbnail data " ,
" The thumbnail data " ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2005-07-09 22:44:26 +00:00
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - sub - thumbnail
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_sub_thumbnail_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-sub-thumbnail " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Get a thumbnail of a sub-area of a drawable drawable. " ,
" This function gets data from which a thumbnail of a drawable preview can be created. Maximum x or y dimension is 1024 pixels. The pixels are returned in RGB[A] or GRAY[A] format. The bpp return value gives the number of bytes in the image. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2004 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " src-x " ,
" src x " ,
" The x coordinate of the area " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " src-y " ,
" src y " ,
" The y coordinate of the area " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " src-width " ,
" src width " ,
" The width of the area " ,
1 , G_MAXINT32 , 1 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " src-height " ,
" src height " ,
" The height of the area " ,
1 , G_MAXINT32 , 1 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " dest-width " ,
" dest width " ,
" The thumbnail width " ,
1 , 1024 , 1 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " dest-height " ,
" dest height " ,
" The thumbnail height " ,
1 , 1024 , 1 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " width " ,
" width " ,
" The previews width " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " height " ,
" height " ,
" The previews height " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " bpp " ,
" bpp " ,
" The previews bpp " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 14:04:56 +02:00
g_param_spec_int ( " thumbnail-data-count " ,
" thumbnail data count " ,
" The number of bytes in thumbnail data " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_return_value ( procedure ,
2019-08-15 15:04:34 +02:00
gimp_param_spec_uint8_array ( " thumbnail-data " ,
" thumbnail data " ,
" The thumbnail data " ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2005-07-09 22:44:26 +00:00
2006-04-04 21:11:45 +00:00
/*
* gimp - drawable - foreground - extract
*/
2006-04-06 10:01:30 +00:00
procedure = gimp_procedure_new ( drawable_foreground_extract_invoker ) ;
2008-04-04 10:58:56 +00:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-drawable-foreground-extract " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Extract the foreground of a drawable using a given trimap. " ,
" Image Segmentation by Uniform Color Clustering, see https://www.inf.fu-berlin.de/inst/pubs/tr-b-05-07.pdf " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Gerald Friedland <fland@inf.fu-berlin.de>, Kristian Jantz <jantz@inf.fu-berlin.de>, Sven Neumann <sven@gimp.org> " ,
" Gerald Friedland " ,
" 2005 " ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-04 21:11:45 +00:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " mode " ,
" mode " ,
2006-05-18 17:25:15 +00:00
" The algorithm to use " ,
2006-04-04 21:11:45 +00:00
GIMP_TYPE_FOREGROUND_EXTRACT_MODE ,
2019-11-19 21:25:26 +01:00
GIMP_FOREGROUND_EXTRACT_MATTING ,
2006-04-04 21:11:45 +00:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " mask " ,
" mask " ,
" Tri-Map " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 09:13:47 +00:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 08:16:26 +00:00
g_object_unref ( procedure ) ;
2006-04-04 21:11:45 +00:00
}