2010-10-30 22:06:20 +02:00
/* GIMP - The GNU Image Manipulation Program
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2018-07-11 23:27:07 +02:00
* along with this program . If not , see < https : //www.gnu.org/licenses/>.
2010-10-30 22:06:20 +02:00
*/
/* NOTE: This file is auto-generated by pdbgen.pl. */
# include "config.h"
2022-03-28 15:13:17 +02:00
# include "stamp-pdbgen.h"
2024-03-23 04:10:26 +00:00
# include <cairo.h>
2010-10-30 22:06:20 +02:00
# include <gegl.h>
2012-05-03 03:36:22 +02:00
# include <gdk-pixbuf/gdk-pixbuf.h>
2010-10-30 22:06:20 +02:00
# include "libgimpbase/gimpbase.h"
2024-03-23 04:10:26 +00:00
# include "libgimpcolor/gimpcolor.h"
2010-10-30 22:06:20 +02:00
2012-05-04 00:50:23 +02:00
# include "libgimpbase/gimpbase.h"
2010-10-30 22:06:20 +02:00
# include "pdb-types.h"
# include "core/gimpchannel-select.h"
# include "core/gimpdrawable.h"
# include "core/gimpimage.h"
# include "core/gimpitem.h"
# include "core/gimpparamspecs.h"
# include "gimppdb.h"
# include "gimppdb-utils.h"
# include "gimppdbcontext.h"
# include "gimpprocedure.h"
# include "internal-procs.h"
# include "gimp-intl.h"
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
image_select_color_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2010-10-30 22:06:20 +02:00
{
gboolean success = TRUE ;
GimpImage * image ;
2019-08-15 14:04:56 +02:00
gint operation ;
2010-10-30 22:06:20 +02:00
GimpDrawable * drawable ;
2023-11-12 17:56:32 +01:00
GeglColor * color ;
2010-10-30 22:06:20 +02:00
2019-08-29 11:25:35 +02:00
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
operation = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 2 ) ) ;
2023-11-12 17:56:32 +01:00
color = g_value_get_object ( gimp_value_array_index ( args , 3 ) ) ;
2010-10-30 22:06:20 +02:00
if ( success )
{
2011-01-27 19:37:13 +01:00
GimpPDBContext * pdb_context = GIMP_PDB_CONTEXT ( context ) ;
if ( pdb_context - > sample_merged | |
2012-11-08 20:46:18 +01:00
gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , image , 0 , error ) )
2010-10-30 22:06:20 +02:00
{
2020-08-17 18:22:19 +02:00
GList * drawables = g_list_prepend ( NULL , drawable ) ;
gimp_channel_select_by_color ( gimp_image_get_mask ( image ) , drawables ,
2011-01-27 19:37:13 +01:00
pdb_context - > sample_merged ,
2023-11-12 17:56:32 +01:00
color ,
2012-04-27 14:23:19 +02:00
pdb_context - > sample_threshold ,
2011-02-04 18:37:01 +01:00
pdb_context - > sample_transparent ,
2011-01-27 20:01:28 +01:00
pdb_context - > sample_criterion ,
2010-10-30 22:06:20 +02:00
operation ,
pdb_context - > antialias ,
pdb_context - > feather ,
pdb_context - > feather_radius_x ,
pdb_context - > feather_radius_y ) ;
2020-08-17 18:22:19 +02:00
g_list_free ( drawables ) ;
2010-10-30 22:06:20 +02:00
}
else
success = FALSE ;
}
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
image_select_contiguous_color_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2010-10-30 22:06:20 +02:00
{
gboolean success = TRUE ;
GimpImage * image ;
2019-08-15 14:04:56 +02:00
gint operation ;
2010-10-30 22:06:20 +02:00
GimpDrawable * drawable ;
gdouble x ;
gdouble y ;
2019-08-29 11:25:35 +02:00
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
operation = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
2019-08-29 11:25:35 +02:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 2 ) ) ;
2012-05-04 00:50:23 +02:00
x = g_value_get_double ( gimp_value_array_index ( args , 3 ) ) ;
y = g_value_get_double ( gimp_value_array_index ( args , 4 ) ) ;
2010-10-30 22:06:20 +02:00
if ( success )
{
2011-01-27 19:37:13 +01:00
GimpPDBContext * pdb_context = GIMP_PDB_CONTEXT ( context ) ;
if ( pdb_context - > sample_merged | |
2012-11-08 20:46:18 +01:00
gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , image , 0 , error ) )
2010-10-30 22:06:20 +02:00
{
gimp_channel_select_fuzzy ( gimp_image_get_mask ( image ) ,
drawable ,
2011-01-27 19:37:13 +01:00
pdb_context - > sample_merged ,
2010-10-30 22:06:20 +02:00
x , y ,
2012-04-27 14:23:19 +02:00
pdb_context - > sample_threshold ,
2011-02-04 18:37:01 +01:00
pdb_context - > sample_transparent ,
2011-01-27 20:01:28 +01:00
pdb_context - > sample_criterion ,
2016-01-11 10:44:21 +00:00
pdb_context - > diagonal_neighbors ,
2010-10-30 22:06:20 +02:00
operation ,
pdb_context - > antialias ,
pdb_context - > feather ,
pdb_context - > feather_radius_x ,
pdb_context - > feather_radius_y ) ;
}
else
success = FALSE ;
}
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
image_select_rectangle_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2010-10-30 22:06:20 +02:00
{
gboolean success = TRUE ;
GimpImage * image ;
2019-08-15 14:04:56 +02:00
gint operation ;
2010-10-30 22:06:20 +02:00
gdouble x ;
gdouble y ;
gdouble width ;
gdouble height ;
2019-08-29 11:25:35 +02:00
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
operation = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
x = g_value_get_double ( gimp_value_array_index ( args , 2 ) ) ;
y = g_value_get_double ( gimp_value_array_index ( args , 3 ) ) ;
width = g_value_get_double ( gimp_value_array_index ( args , 4 ) ) ;
height = g_value_get_double ( gimp_value_array_index ( args , 5 ) ) ;
2010-10-30 22:06:20 +02:00
if ( success )
{
GimpPDBContext * pdb_context = GIMP_PDB_CONTEXT ( context ) ;
gimp_channel_select_rectangle ( gimp_image_get_mask ( image ) ,
( gint ) x , ( gint ) y ,
( gint ) width , ( gint ) height ,
operation ,
pdb_context - > feather ,
pdb_context - > feather_radius_x ,
pdb_context - > feather_radius_y ,
TRUE ) ;
}
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
image_select_round_rectangle_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2010-10-30 22:06:20 +02:00
{
gboolean success = TRUE ;
GimpImage * image ;
2019-08-15 14:04:56 +02:00
gint operation ;
2010-10-30 22:06:20 +02:00
gdouble x ;
gdouble y ;
gdouble width ;
gdouble height ;
gdouble corner_radius_x ;
gdouble corner_radius_y ;
2019-08-29 11:25:35 +02:00
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
operation = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
x = g_value_get_double ( gimp_value_array_index ( args , 2 ) ) ;
y = g_value_get_double ( gimp_value_array_index ( args , 3 ) ) ;
width = g_value_get_double ( gimp_value_array_index ( args , 4 ) ) ;
height = g_value_get_double ( gimp_value_array_index ( args , 5 ) ) ;
corner_radius_x = g_value_get_double ( gimp_value_array_index ( args , 6 ) ) ;
corner_radius_y = g_value_get_double ( gimp_value_array_index ( args , 7 ) ) ;
2010-10-30 22:06:20 +02:00
if ( success )
{
GimpPDBContext * pdb_context = GIMP_PDB_CONTEXT ( context ) ;
gimp_channel_select_round_rect ( gimp_image_get_mask ( image ) ,
( gint ) x , ( gint ) y ,
( gint ) width , ( gint ) height ,
corner_radius_x ,
corner_radius_y ,
operation ,
pdb_context - > antialias ,
pdb_context - > feather ,
pdb_context - > feather_radius_x ,
pdb_context - > feather_radius_y ,
TRUE ) ;
}
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
image_select_ellipse_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2011-02-13 17:11:20 +01:00
{
gboolean success = TRUE ;
GimpImage * image ;
2019-08-15 14:04:56 +02:00
gint operation ;
2011-02-13 17:11:20 +01:00
gdouble x ;
gdouble y ;
gdouble width ;
gdouble height ;
2019-08-29 11:25:35 +02:00
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
operation = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
x = g_value_get_double ( gimp_value_array_index ( args , 2 ) ) ;
y = g_value_get_double ( gimp_value_array_index ( args , 3 ) ) ;
width = g_value_get_double ( gimp_value_array_index ( args , 4 ) ) ;
height = g_value_get_double ( gimp_value_array_index ( args , 5 ) ) ;
2011-02-13 17:11:20 +01:00
if ( success )
{
GimpPDBContext * pdb_context = GIMP_PDB_CONTEXT ( context ) ;
gimp_channel_select_ellipse ( gimp_image_get_mask ( image ) ,
( gint ) x , ( gint ) y ,
( gint ) width , ( gint ) height ,
operation ,
pdb_context - > antialias ,
pdb_context - > feather ,
pdb_context - > feather_radius_x ,
pdb_context - > feather_radius_y ,
TRUE ) ;
}
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
image_select_polygon_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2011-02-13 17:11:20 +01:00
{
gboolean success = TRUE ;
GimpImage * image ;
2019-08-15 14:04:56 +02:00
gint operation ;
2024-10-28 02:03:57 +01:00
gsize num_segs ;
2011-02-13 17:11:20 +01:00
const gdouble * segs ;
2019-08-29 11:25:35 +02:00
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
operation = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
app, libgimp*, pdb, plug-ins: rename various public API name s/float/double/.
Several types functions were using the wording "float" historically to
mean double-precision, e.g. the float array type (which was in fact a
double array). Or the scanner function gimp_scanner_parse_float() was in
fact returning a double value. What if we wanted someday to actually add
float (usually this naming means in C the single-precision IEEE 754
floating point representation) support? How would we name this?
Now technically it's not entirely wrong (a double is still a floating
point). So I've been wondering if that is because maybe we never planned
to have float and double precision may be good enough for all usage in a
plug-in API (which doesn't have to be as generic so the higher precision
is enough)? But how can we be sure? Also we already had some functions
using the wording double (e.g. gimp_procedure_add_double_argument()), so
let's just go the safe route and use the accurate wording.
The additional change in PDB is internal, but there too, I was also
finding very confusing that we were naming double-precision float as
'float' type. So I took the opportunity to update this. It doesn't
change any signature.
In fact the whole commit doesn't change any type or code logic, only
naming, except for one bug fix in the middle which I encountered while
renaming: in gimp_scanner_parse_deprecated_color(), I discovered a
hidden bug in scanning (color-hsv*) values, which was mistakenly using a
double type for an array of float.
2024-11-02 14:03:37 +01:00
segs = gimp_value_get_double_array ( gimp_value_array_index ( args , 2 ) , & num_segs ) ;
2011-02-13 17:11:20 +01:00
if ( success )
{
GimpPDBContext * pdb_context = GIMP_PDB_CONTEXT ( context ) ;
gimp_channel_select_polygon ( gimp_image_get_mask ( image ) ,
_ ( " Free Select " ) ,
num_segs / 2 ,
( GimpVector2 * ) segs ,
operation ,
pdb_context - > antialias ,
pdb_context - > feather ,
pdb_context - > feather_radius_x ,
pdb_context - > feather_radius_y ,
TRUE ) ;
}
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
}
2012-05-04 00:50:23 +02:00
static GimpValueArray *
2012-05-28 19:55:28 +02:00
image_select_item_invoker ( GimpProcedure * procedure ,
2012-05-04 00:50:23 +02:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2010-10-30 22:06:20 +02:00
{
gboolean success = TRUE ;
GimpImage * image ;
2019-08-15 14:04:56 +02:00
gint operation ;
2011-01-24 14:53:42 +01:00
GimpItem * item ;
2010-10-30 22:06:20 +02:00
2019-08-29 11:25:35 +02:00
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 00:50:23 +02:00
operation = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
2019-08-29 11:25:35 +02:00
item = g_value_get_object ( gimp_value_array_index ( args , 2 ) ) ;
2010-10-30 22:06:20 +02:00
if ( success )
{
2012-11-08 20:46:18 +01:00
if ( gimp_pdb_item_is_attached ( item , image , 0 , error ) )
2010-10-30 22:06:20 +02:00
{
GimpPDBContext * pdb_context = GIMP_PDB_CONTEXT ( context ) ;
gimp_item_to_selection ( item , operation ,
pdb_context - > antialias ,
pdb_context - > feather ,
pdb_context - > feather_radius_x ,
pdb_context - > feather_radius_y ) ;
}
else
success = FALSE ;
}
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
}
void
register_image_select_procs ( GimpPDB * pdb )
{
GimpProcedure * procedure ;
/*
* gimp - image - select - color
*/
2025-02-25 19:34:00 +01:00
procedure = gimp_procedure_new ( image_select_color_invoker , FALSE ) ;
2010-10-30 22:06:20 +02:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-image-select-color " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Create a selection by selecting all pixels (in the specified drawable) with the same (or similar) color to that specified. " ,
" This tool creates a selection over the specified image. A by-color selection is determined by the supplied color under the constraints of the current context settings. Essentially, all pixels (in the drawable) that have color sufficiently close to the specified color (as determined by the threshold and criterion context values) are included in the selection. To select transparent regions, the color specified must also have minimum alpha. \n "
2022-06-05 00:20:03 +02:00
" \n "
" This procedure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius', 'gimp-context-set-sample-merged', 'gimp-context-set-sample-criterion', 'gimp-context-set-sample-threshold', 'gimp-context-set-sample-transparent'. \n "
" \n "
" In the case of a merged sampling, the supplied drawable is ignored. " ,
2019-09-08 23:40:34 +02:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" David Gowers " ,
" David Gowers " ,
" 2010 " ) ;
2010-10-30 22:06:20 +02:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_image ( " image " ,
" image " ,
" The affected image " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2011-01-24 14:53:42 +01:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " operation " ,
" operation " ,
" The selection operation " ,
GIMP_TYPE_CHANNEL_OPS ,
GIMP_CHANNEL_OP_ADD ,
GIMP_PARAM_READWRITE ) ) ;
2010-10-30 22:06:20 +02:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The affected drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2010-10-30 22:06:20 +02:00
gimp_procedure_add_argument ( procedure ,
2024-04-19 23:02:29 +02:00
gimp_param_spec_color ( " color " ,
2023-11-12 17:56:32 +01:00
" color " ,
" The color to select " ,
2024-04-19 23:02:29 +02:00
FALSE ,
2023-11-12 17:56:32 +01:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2010-10-30 22:06:20 +02:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
/*
2011-02-13 17:11:20 +01:00
* gimp - image - select - contiguous - color
2010-10-30 22:06:20 +02:00
*/
2025-02-25 19:34:00 +01:00
procedure = gimp_procedure_new ( image_select_contiguous_color_invoker , FALSE ) ;
2010-10-30 22:06:20 +02:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
2011-02-13 17:11:20 +01:00
" gimp-image-select-contiguous-color " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Create a selection by selecting all pixels around specified coordinates with the same (or similar) color to that at the coordinates. " ,
" This tool creates a contiguous selection over the specified image. A contiguous color selection is determined by a seed fill under the constraints of the current context settings. Essentially, the color at the specified coordinates (in the drawable) is measured and the selection expands outwards from that point to any adjacent pixels which are not significantly different (as determined by the threshold and criterion context settings). This process continues until no more expansion is possible. If antialiasing is turned on, the final selection mask will contain intermediate values based on close misses to the threshold bar at pixels along the seed fill boundary. \n "
2022-06-05 00:20:03 +02:00
" \n "
" This procedure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius', 'gimp-context-set-sample-merged', 'gimp-context-set-sample-criterion', 'gimp-context-set-sample-threshold', 'gimp-context-set-sample-transparent', 'gimp-context-set-diagonal-neighbors'. \n "
" \n "
" In the case of a merged sampling, the supplied drawable is ignored. If the sample is merged, the specified coordinates are relative to the image origin; otherwise, they are relative to the drawable's origin. " ,
2019-09-08 23:40:34 +02:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" David Gowers " ,
" David Gowers " ,
" 2010 " ) ;
2010-10-30 22:06:20 +02:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_image ( " image " ,
" image " ,
" The affected image " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2011-01-24 14:53:42 +01:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " operation " ,
" operation " ,
" The selection operation " ,
GIMP_TYPE_CHANNEL_OPS ,
GIMP_CHANNEL_OP_ADD ,
GIMP_PARAM_READWRITE ) ) ;
2010-10-30 22:06:20 +02:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The affected drawable " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2010-10-30 22:06:20 +02:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " x " ,
" x " ,
" x coordinate of initial seed fill point: (image coordinates) " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " y " ,
" y " ,
" y coordinate of initial seed fill point: (image coordinates) " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
/*
* gimp - image - select - rectangle
*/
2025-02-25 19:34:00 +01:00
procedure = gimp_procedure_new ( image_select_rectangle_invoker , FALSE ) ;
2010-10-30 22:06:20 +02:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-image-select-rectangle " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Create a rectangular selection over the specified image; " ,
" This tool creates a rectangular selection over the specified image. The rectangular region can be either added to, subtracted from, or replace the contents of the previous selection mask. \n "
2022-06-05 00:20:03 +02:00
" \n "
" This procedure is affected by the following context setters: 'gimp-context-set-feather', 'gimp-context-set-feather-radius'. " ,
2019-09-08 23:40:34 +02:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2010 " ) ;
2010-10-30 22:06:20 +02:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_image ( " image " ,
" image " ,
" The image " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2011-01-24 14:53:42 +01:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " operation " ,
" operation " ,
" The selection operation " ,
GIMP_TYPE_CHANNEL_OPS ,
GIMP_CHANNEL_OP_ADD ,
GIMP_PARAM_READWRITE ) ) ;
2010-10-30 22:06:20 +02:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " x " ,
" x " ,
" x coordinate of upper-left corner of rectangle " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " y " ,
" y " ,
" y coordinate of upper-left corner of rectangle " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " width " ,
" width " ,
" The width of the rectangle " ,
0 , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " height " ,
" height " ,
" The height of the rectangle " ,
0 , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
/*
* gimp - image - select - round - rectangle
*/
2025-02-25 19:34:00 +01:00
procedure = gimp_procedure_new ( image_select_round_rectangle_invoker , FALSE ) ;
2010-10-30 22:06:20 +02:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-image-select-round-rectangle " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Create a rectangular selection with round corners over the specified image; " ,
" This tool creates a rectangular selection with round corners over the specified image. The rectangular region can be either added to, subtracted from, or replace the contents of the previous selection mask. \n "
2022-06-05 00:20:03 +02:00
" \n "
" This procedure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius'. " ,
2019-09-08 23:40:34 +02:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Martin Nordholts " ,
" Martin Nordholts " ,
" 2010 " ) ;
2010-10-30 22:06:20 +02:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_image ( " image " ,
" image " ,
" The image " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2011-01-24 14:53:42 +01:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " operation " ,
" operation " ,
" The selection operation " ,
GIMP_TYPE_CHANNEL_OPS ,
GIMP_CHANNEL_OP_ADD ,
GIMP_PARAM_READWRITE ) ) ;
2010-10-30 22:06:20 +02:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " x " ,
" x " ,
" x coordinate of upper-left corner of rectangle " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " y " ,
" y " ,
" y coordinate of upper-left corner of rectangle " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " width " ,
" width " ,
" The width of the rectangle " ,
0 , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " height " ,
" height " ,
" The height of the rectangle " ,
0 , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " corner-radius-x " ,
" corner radius x " ,
" The corner radius in X direction " ,
0 , GIMP_MAX_IMAGE_SIZE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " corner-radius-y " ,
" corner radius y " ,
" The corner radius in Y direction " ,
0 , GIMP_MAX_IMAGE_SIZE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
2011-02-13 17:11:20 +01:00
/*
* gimp - image - select - ellipse
*/
2025-02-25 19:34:00 +01:00
procedure = gimp_procedure_new ( image_select_ellipse_invoker , FALSE ) ;
2011-02-13 17:11:20 +01:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-image-select-ellipse " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Create an elliptical selection over the specified image. " ,
" This tool creates an elliptical selection over the specified image. The elliptical region can be either added to, subtracted from, or replace the contents of the previous selection mask. \n "
2022-06-05 00:20:03 +02:00
" \n "
" This procedure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius'. " ,
2019-09-08 23:40:34 +02:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2010 " ) ;
2011-02-13 17:11:20 +01:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_image ( " image " ,
" image " ,
" The image " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2011-02-13 17:11:20 +01:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " operation " ,
" operation " ,
" The selection operation " ,
GIMP_TYPE_CHANNEL_OPS ,
GIMP_CHANNEL_OP_ADD ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " x " ,
" x " ,
" x coordinate of upper-left corner of ellipse bounding box " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " y " ,
" y " ,
" y coordinate of upper-left corner of ellipse bounding box " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " width " ,
" width " ,
" The width of the ellipse " ,
0 , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " height " ,
" height " ,
" The height of the ellipse " ,
0 , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
/*
* gimp - image - select - polygon
*/
2025-02-25 19:34:00 +01:00
procedure = gimp_procedure_new ( image_select_polygon_invoker , FALSE ) ;
2011-02-13 17:11:20 +01:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-image-select-polygon " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Create a polygonal selection over the specified image. " ,
" This tool creates a polygonal selection over the specified image. The polygonal region can be either added to, subtracted from, or replace the contents of the previous selection mask. The polygon is specified through an array of floating point numbers and its length. The length of array must be 2n, where n is the number of points. Each point is defined by 2 floating point values which correspond to the x and y coordinates. If the final point does not connect to the starting point, a connecting segment is automatically added. \n "
2022-06-05 00:20:03 +02:00
" \n "
" This procedure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius'. " ,
2019-09-08 23:40:34 +02:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2010 " ) ;
2011-02-13 17:11:20 +01:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_image ( " image " ,
" image " ,
" The image " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2011-02-13 17:11:20 +01:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " operation " ,
" operation " ,
" The selection operation " ,
GIMP_TYPE_CHANNEL_OPS ,
GIMP_CHANNEL_OP_ADD ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
app, libgimp*, pdb, plug-ins: rename various public API name s/float/double/.
Several types functions were using the wording "float" historically to
mean double-precision, e.g. the float array type (which was in fact a
double array). Or the scanner function gimp_scanner_parse_float() was in
fact returning a double value. What if we wanted someday to actually add
float (usually this naming means in C the single-precision IEEE 754
floating point representation) support? How would we name this?
Now technically it's not entirely wrong (a double is still a floating
point). So I've been wondering if that is because maybe we never planned
to have float and double precision may be good enough for all usage in a
plug-in API (which doesn't have to be as generic so the higher precision
is enough)? But how can we be sure? Also we already had some functions
using the wording double (e.g. gimp_procedure_add_double_argument()), so
let's just go the safe route and use the accurate wording.
The additional change in PDB is internal, but there too, I was also
finding very confusing that we were naming double-precision float as
'float' type. So I took the opportunity to update this. It doesn't
change any signature.
In fact the whole commit doesn't change any type or code logic, only
naming, except for one bug fix in the middle which I encountered while
renaming: in gimp_scanner_parse_deprecated_color(), I discovered a
hidden bug in scanning (color-hsv*) values, which was mistakenly using a
double type for an array of float.
2024-11-02 14:03:37 +01:00
gimp_param_spec_double_array ( " segs " ,
" segs " ,
" Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y} " ,
GIMP_PARAM_READWRITE ) ) ;
2011-02-13 17:11:20 +01:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
2010-10-30 22:06:20 +02:00
/*
* gimp - image - select - item
*/
2025-02-25 19:34:00 +01:00
procedure = gimp_procedure_new ( image_select_item_invoker , FALSE ) ;
2010-10-30 22:06:20 +02:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-image-select-item " ) ;
2019-09-08 23:40:34 +02:00
gimp_procedure_set_static_help ( procedure ,
" Transforms the specified item into a selection " ,
2025-07-07 13:17:06 +02:00
" This procedure renders the item's outline into the current selection of the image the item belongs to. What exactly the item's outline is depends on the item type: for layers, it's the layer's alpha channel, for paths the path's shape. \n "
2022-06-05 00:20:03 +02:00
" \n "
" This procedure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius'. " ,
2019-09-08 23:40:34 +02:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2010 " ) ;
2010-10-30 22:06:20 +02:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_image ( " image " ,
" image " ,
" The image " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2010-10-30 22:06:20 +02:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " operation " ,
" operation " ,
" The desired operation with current selection " ,
GIMP_TYPE_CHANNEL_OPS ,
GIMP_CHANNEL_OP_ADD ,
GIMP_PARAM_READWRITE ) ) ;
2011-01-24 14:53:42 +01:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 11:25:35 +02:00
gimp_param_spec_item ( " item " ,
" item " ,
" The item to render to the selection " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2010-10-30 22:06:20 +02:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
}