2006-12-09 13:33:38 -08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2003-07-02 17:47:26 -07:00
|
|
|
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
|
2001-10-22 05:13:44 -07:00
|
|
|
*
|
2009-01-17 14:28:01 -08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2001-10-22 05:13:44 -07:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-17 14:28:01 -08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-10-22 05:13:44 -07: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 14:47:19 -07:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2001-10-22 05:13:44 -07:00
|
|
|
*/
|
|
|
|
|
|
2007-01-09 02:52:47 -08:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl. */
|
2001-10-22 05:13:44 -07:00
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
2011-04-28 06:50:39 -07:00
|
|
|
#include <cairo.h>
|
|
|
|
|
|
2008-10-09 13:24:04 -07:00
|
|
|
#include <gegl.h>
|
2001-10-22 05:13:44 -07:00
|
|
|
|
2012-05-02 18:36:22 -07:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
|
|
|
|
|
2007-07-05 07:31:42 -07:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2004-05-06 16:26:45 -07:00
|
|
|
#include "libgimpcolor/gimpcolor.h"
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
|
|
|
|
|
2001-10-22 05:13:44 -07:00
|
|
|
#include "pdb-types.h"
|
|
|
|
|
|
2003-10-06 05:17:11 -07:00
|
|
|
#include "core/gimpchannel-select.h"
|
2001-10-22 05:13:44 -07:00
|
|
|
#include "core/gimpdrawable.h"
|
|
|
|
|
#include "core/gimpimage.h"
|
2008-02-07 09:08:54 -08:00
|
|
|
#include "core/gimpparamspecs.h"
|
2003-03-25 09:39:01 -08:00
|
|
|
|
2008-02-07 09:08:54 -08:00
|
|
|
#include "gimppdb.h"
|
|
|
|
|
#include "gimpprocedure.h"
|
2008-04-04 04:15:55 -07:00
|
|
|
#include "internal-procs.h"
|
2006-10-31 11:02:56 -08:00
|
|
|
|
2008-02-07 09:08:54 -08:00
|
|
|
#include "gimp-intl.h"
|
|
|
|
|
|
2006-04-04 14:11:45 -07:00
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
static GimpValueArray *
|
2012-05-28 10:55:28 -07:00
|
|
|
by_color_select_invoker (GimpProcedure *procedure,
|
2012-05-03 15:50:23 -07:00
|
|
|
Gimp *gimp,
|
|
|
|
|
GimpContext *context,
|
|
|
|
|
GimpProgress *progress,
|
|
|
|
|
const GimpValueArray *args,
|
|
|
|
|
GError **error)
|
2006-04-04 14:11:45 -07:00
|
|
|
{
|
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
GimpDrawable *drawable;
|
|
|
|
|
GimpRGB color;
|
|
|
|
|
gint32 threshold;
|
|
|
|
|
gint32 operation;
|
|
|
|
|
gboolean antialias;
|
|
|
|
|
gboolean feather;
|
|
|
|
|
gdouble feather_radius;
|
|
|
|
|
gboolean sample_merged;
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
|
|
|
|
gimp_value_get_rgb (gimp_value_array_index (args, 1), &color);
|
|
|
|
|
threshold = g_value_get_int (gimp_value_array_index (args, 2));
|
|
|
|
|
operation = g_value_get_enum (gimp_value_array_index (args, 3));
|
|
|
|
|
antialias = g_value_get_boolean (gimp_value_array_index (args, 4));
|
|
|
|
|
feather = g_value_get_boolean (gimp_value_array_index (args, 5));
|
|
|
|
|
feather_radius = g_value_get_double (gimp_value_array_index (args, 6));
|
|
|
|
|
sample_merged = g_value_get_boolean (gimp_value_array_index (args, 7));
|
2006-04-04 14:11:45 -07:00
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
|
{
|
|
|
|
|
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
|
|
|
|
|
|
|
|
|
gimp_channel_select_by_color (gimp_image_get_mask (image), drawable,
|
|
|
|
|
sample_merged,
|
|
|
|
|
&color,
|
2012-04-27 05:23:19 -07:00
|
|
|
threshold / 255.0,
|
2006-04-04 14:11:45 -07:00
|
|
|
FALSE /* don't select transparent */,
|
Applied (modified and enhanced) patch from Chris Moller which allows tools
2006-08-05 Michael Natterer <mitch@gimp.org>
Applied (modified and enhanced) patch from Chris Moller which allows
tools to distinguish similar colors not only by composite, but also
by R, G, B, H, S and V. Fixes bug #348291.
* app/core/core-enums.[ch]: added new enum GimpSelectCriterion
which can be one of { COMPOSITE, R, G, B, H, S, V }.
* app/core/gimpimage-contiguous-region.[ch]: added
select_criterion params and create the region based on difference
by the selected criterion.
* app/core/gimpchannel-select.[ch]
* app/core/gimpdrawable-bucket-fill.[ch]: take criterion params and
pass them through to the contiguous region functions.
* app/tools/gimpbucketfilloptions.[ch]
* app/tools/gimpselectionoptions.[ch]: added criterion properties
and GUI to select it.
* app/tools/gimpbucketfilltool.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpfuzzyselecttool.c: pass the selected criterion to
the resp. core functions.
* app/widgets/gimpdrawabletreeview.c
* app/widgets/gimpselectioneditor.c
* app/display/gimpdisplayshell-dnd.c
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/selection_tools.pdb: changed accordingly
(simply pass GIMP_SELECT_CRITERION_COMPOSITE in most cases).
* app/pdb/edit_cmds.c
* app/pdb/selection_tools_cmds.c: regenerated.
2006-08-05 06:02:47 -07:00
|
|
|
GIMP_SELECT_CRITERION_COMPOSITE,
|
2006-04-04 14:11:45 -07:00
|
|
|
operation,
|
|
|
|
|
antialias,
|
|
|
|
|
feather,
|
|
|
|
|
feather_radius,
|
|
|
|
|
feather_radius);
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-16 06:57:57 -07:00
|
|
|
return gimp_procedure_get_return_values (procedure, success,
|
|
|
|
|
error ? *error : NULL);
|
2006-04-04 14:11:45 -07:00
|
|
|
}
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
static GimpValueArray *
|
2012-05-28 10:55:28 -07:00
|
|
|
by_color_select_full_invoker (GimpProcedure *procedure,
|
2012-05-03 15:50:23 -07:00
|
|
|
Gimp *gimp,
|
|
|
|
|
GimpContext *context,
|
|
|
|
|
GimpProgress *progress,
|
|
|
|
|
const GimpValueArray *args,
|
|
|
|
|
GError **error)
|
2006-08-15 09:20:46 -07:00
|
|
|
{
|
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
GimpDrawable *drawable;
|
|
|
|
|
GimpRGB color;
|
|
|
|
|
gint32 threshold;
|
|
|
|
|
gint32 operation;
|
|
|
|
|
gboolean antialias;
|
|
|
|
|
gboolean feather;
|
2006-10-20 14:20:29 -07:00
|
|
|
gdouble feather_radius_x;
|
|
|
|
|
gdouble feather_radius_y;
|
2006-08-15 09:20:46 -07:00
|
|
|
gboolean sample_merged;
|
|
|
|
|
gboolean select_transparent;
|
|
|
|
|
gint32 select_criterion;
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
|
|
|
|
gimp_value_get_rgb (gimp_value_array_index (args, 1), &color);
|
|
|
|
|
threshold = g_value_get_int (gimp_value_array_index (args, 2));
|
|
|
|
|
operation = g_value_get_enum (gimp_value_array_index (args, 3));
|
|
|
|
|
antialias = g_value_get_boolean (gimp_value_array_index (args, 4));
|
|
|
|
|
feather = g_value_get_boolean (gimp_value_array_index (args, 5));
|
|
|
|
|
feather_radius_x = g_value_get_double (gimp_value_array_index (args, 6));
|
|
|
|
|
feather_radius_y = g_value_get_double (gimp_value_array_index (args, 7));
|
|
|
|
|
sample_merged = g_value_get_boolean (gimp_value_array_index (args, 8));
|
|
|
|
|
select_transparent = g_value_get_boolean (gimp_value_array_index (args, 9));
|
|
|
|
|
select_criterion = g_value_get_enum (gimp_value_array_index (args, 10));
|
2006-08-15 09:20:46 -07:00
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
|
{
|
|
|
|
|
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
|
|
|
|
|
|
|
|
|
gimp_channel_select_by_color (gimp_image_get_mask (image), drawable,
|
|
|
|
|
sample_merged,
|
|
|
|
|
&color,
|
2012-04-27 05:23:19 -07:00
|
|
|
threshold / 255.0,
|
2006-08-15 09:20:46 -07:00
|
|
|
select_transparent,
|
|
|
|
|
select_criterion,
|
|
|
|
|
operation,
|
|
|
|
|
antialias,
|
|
|
|
|
feather,
|
2006-10-20 14:20:29 -07:00
|
|
|
feather_radius_x,
|
|
|
|
|
feather_radius_y);
|
2006-08-15 09:20:46 -07:00
|
|
|
}
|
|
|
|
|
|
2008-08-16 06:57:57 -07:00
|
|
|
return gimp_procedure_get_return_values (procedure, success,
|
|
|
|
|
error ? *error : NULL);
|
2006-08-15 09:20:46 -07:00
|
|
|
}
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
static GimpValueArray *
|
2012-05-28 10:55:28 -07:00
|
|
|
ellipse_select_invoker (GimpProcedure *procedure,
|
2012-05-03 15:50:23 -07:00
|
|
|
Gimp *gimp,
|
|
|
|
|
GimpContext *context,
|
|
|
|
|
GimpProgress *progress,
|
|
|
|
|
const GimpValueArray *args,
|
|
|
|
|
GError **error)
|
2006-04-04 14:11:45 -07:00
|
|
|
{
|
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
GimpImage *image;
|
|
|
|
|
gdouble x;
|
|
|
|
|
gdouble y;
|
|
|
|
|
gdouble width;
|
|
|
|
|
gdouble height;
|
|
|
|
|
gint32 operation;
|
|
|
|
|
gboolean antialias;
|
|
|
|
|
gboolean feather;
|
|
|
|
|
gdouble feather_radius;
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
|
|
|
|
|
x = g_value_get_double (gimp_value_array_index (args, 1));
|
|
|
|
|
y = g_value_get_double (gimp_value_array_index (args, 2));
|
|
|
|
|
width = g_value_get_double (gimp_value_array_index (args, 3));
|
|
|
|
|
height = g_value_get_double (gimp_value_array_index (args, 4));
|
|
|
|
|
operation = g_value_get_enum (gimp_value_array_index (args, 5));
|
|
|
|
|
antialias = g_value_get_boolean (gimp_value_array_index (args, 6));
|
|
|
|
|
feather = g_value_get_boolean (gimp_value_array_index (args, 7));
|
|
|
|
|
feather_radius = g_value_get_double (gimp_value_array_index (args, 8));
|
2006-04-04 14:11:45 -07:00
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
|
{
|
|
|
|
|
gimp_channel_select_ellipse (gimp_image_get_mask (image),
|
|
|
|
|
(gint) x, (gint) y,
|
|
|
|
|
(gint) width, (gint) height,
|
|
|
|
|
operation,
|
|
|
|
|
antialias,
|
|
|
|
|
feather,
|
|
|
|
|
feather_radius,
|
2006-08-25 10:19:36 -07:00
|
|
|
feather_radius,
|
|
|
|
|
TRUE);
|
2006-04-04 14:11:45 -07:00
|
|
|
}
|
|
|
|
|
|
2008-08-16 06:57:57 -07:00
|
|
|
return gimp_procedure_get_return_values (procedure, success,
|
|
|
|
|
error ? *error : NULL);
|
2006-04-04 14:11:45 -07:00
|
|
|
}
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
static GimpValueArray *
|
2012-05-28 10:55:28 -07:00
|
|
|
free_select_invoker (GimpProcedure *procedure,
|
2012-05-03 15:50:23 -07:00
|
|
|
Gimp *gimp,
|
|
|
|
|
GimpContext *context,
|
|
|
|
|
GimpProgress *progress,
|
|
|
|
|
const GimpValueArray *args,
|
|
|
|
|
GError **error)
|
2006-04-04 14:11:45 -07:00
|
|
|
{
|
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
GimpImage *image;
|
|
|
|
|
gint32 num_segs;
|
|
|
|
|
const gdouble *segs;
|
|
|
|
|
gint32 operation;
|
|
|
|
|
gboolean antialias;
|
|
|
|
|
gboolean feather;
|
|
|
|
|
gdouble feather_radius;
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
|
|
|
|
|
num_segs = g_value_get_int (gimp_value_array_index (args, 1));
|
|
|
|
|
segs = gimp_value_get_floatarray (gimp_value_array_index (args, 2));
|
|
|
|
|
operation = g_value_get_enum (gimp_value_array_index (args, 3));
|
|
|
|
|
antialias = g_value_get_boolean (gimp_value_array_index (args, 4));
|
|
|
|
|
feather = g_value_get_boolean (gimp_value_array_index (args, 5));
|
|
|
|
|
feather_radius = g_value_get_double (gimp_value_array_index (args, 6));
|
2006-04-04 14:11:45 -07:00
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
|
{
|
|
|
|
|
gimp_channel_select_polygon (gimp_image_get_mask (image),
|
|
|
|
|
_("Free Select"),
|
|
|
|
|
num_segs / 2,
|
|
|
|
|
(GimpVector2 *) segs,
|
|
|
|
|
operation,
|
|
|
|
|
antialias,
|
|
|
|
|
feather,
|
|
|
|
|
feather_radius,
|
2006-08-25 10:19:36 -07:00
|
|
|
feather_radius,
|
|
|
|
|
TRUE);
|
2006-04-04 14:11:45 -07:00
|
|
|
}
|
|
|
|
|
|
2008-08-16 06:57:57 -07:00
|
|
|
return gimp_procedure_get_return_values (procedure, success,
|
|
|
|
|
error ? *error : NULL);
|
2006-04-04 14:11:45 -07:00
|
|
|
}
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
static GimpValueArray *
|
2012-05-28 10:55:28 -07:00
|
|
|
fuzzy_select_invoker (GimpProcedure *procedure,
|
2012-05-03 15:50:23 -07:00
|
|
|
Gimp *gimp,
|
|
|
|
|
GimpContext *context,
|
|
|
|
|
GimpProgress *progress,
|
|
|
|
|
const GimpValueArray *args,
|
|
|
|
|
GError **error)
|
2006-04-04 14:11:45 -07:00
|
|
|
{
|
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
GimpDrawable *drawable;
|
|
|
|
|
gdouble x;
|
|
|
|
|
gdouble y;
|
|
|
|
|
gint32 threshold;
|
|
|
|
|
gint32 operation;
|
|
|
|
|
gboolean antialias;
|
|
|
|
|
gboolean feather;
|
|
|
|
|
gdouble feather_radius;
|
|
|
|
|
gboolean sample_merged;
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
|
|
|
|
x = g_value_get_double (gimp_value_array_index (args, 1));
|
|
|
|
|
y = g_value_get_double (gimp_value_array_index (args, 2));
|
|
|
|
|
threshold = g_value_get_int (gimp_value_array_index (args, 3));
|
|
|
|
|
operation = g_value_get_enum (gimp_value_array_index (args, 4));
|
|
|
|
|
antialias = g_value_get_boolean (gimp_value_array_index (args, 5));
|
|
|
|
|
feather = g_value_get_boolean (gimp_value_array_index (args, 6));
|
|
|
|
|
feather_radius = g_value_get_double (gimp_value_array_index (args, 7));
|
|
|
|
|
sample_merged = g_value_get_boolean (gimp_value_array_index (args, 8));
|
2006-04-04 14:11:45 -07:00
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
|
{
|
|
|
|
|
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
|
|
|
|
|
|
|
|
|
gimp_channel_select_fuzzy (gimp_image_get_mask (image),
|
|
|
|
|
drawable,
|
|
|
|
|
sample_merged,
|
|
|
|
|
x, y,
|
2012-04-27 05:23:19 -07:00
|
|
|
threshold / 255.0,
|
2006-04-04 14:11:45 -07:00
|
|
|
FALSE /* don't select transparent */,
|
Applied (modified and enhanced) patch from Chris Moller which allows tools
2006-08-05 Michael Natterer <mitch@gimp.org>
Applied (modified and enhanced) patch from Chris Moller which allows
tools to distinguish similar colors not only by composite, but also
by R, G, B, H, S and V. Fixes bug #348291.
* app/core/core-enums.[ch]: added new enum GimpSelectCriterion
which can be one of { COMPOSITE, R, G, B, H, S, V }.
* app/core/gimpimage-contiguous-region.[ch]: added
select_criterion params and create the region based on difference
by the selected criterion.
* app/core/gimpchannel-select.[ch]
* app/core/gimpdrawable-bucket-fill.[ch]: take criterion params and
pass them through to the contiguous region functions.
* app/tools/gimpbucketfilloptions.[ch]
* app/tools/gimpselectionoptions.[ch]: added criterion properties
and GUI to select it.
* app/tools/gimpbucketfilltool.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpfuzzyselecttool.c: pass the selected criterion to
the resp. core functions.
* app/widgets/gimpdrawabletreeview.c
* app/widgets/gimpselectioneditor.c
* app/display/gimpdisplayshell-dnd.c
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/selection_tools.pdb: changed accordingly
(simply pass GIMP_SELECT_CRITERION_COMPOSITE in most cases).
* app/pdb/edit_cmds.c
* app/pdb/selection_tools_cmds.c: regenerated.
2006-08-05 06:02:47 -07:00
|
|
|
GIMP_SELECT_CRITERION_COMPOSITE,
|
2016-01-11 03:02:27 -08:00
|
|
|
FALSE /* no diagonal neighbors */,
|
2006-04-04 14:11:45 -07:00
|
|
|
operation,
|
|
|
|
|
antialias,
|
|
|
|
|
feather,
|
|
|
|
|
feather_radius,
|
|
|
|
|
feather_radius);
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-16 06:57:57 -07:00
|
|
|
return gimp_procedure_get_return_values (procedure, success,
|
|
|
|
|
error ? *error : NULL);
|
2006-04-04 14:11:45 -07:00
|
|
|
}
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
static GimpValueArray *
|
2012-05-28 10:55:28 -07:00
|
|
|
fuzzy_select_full_invoker (GimpProcedure *procedure,
|
2012-05-03 15:50:23 -07:00
|
|
|
Gimp *gimp,
|
|
|
|
|
GimpContext *context,
|
|
|
|
|
GimpProgress *progress,
|
|
|
|
|
const GimpValueArray *args,
|
|
|
|
|
GError **error)
|
2006-08-15 09:20:46 -07:00
|
|
|
{
|
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
GimpDrawable *drawable;
|
|
|
|
|
gdouble x;
|
|
|
|
|
gdouble y;
|
|
|
|
|
gint32 threshold;
|
|
|
|
|
gint32 operation;
|
|
|
|
|
gboolean antialias;
|
|
|
|
|
gboolean feather;
|
2006-10-20 14:20:29 -07:00
|
|
|
gdouble feather_radius_x;
|
|
|
|
|
gdouble feather_radius_y;
|
2006-08-15 09:20:46 -07:00
|
|
|
gboolean sample_merged;
|
|
|
|
|
gboolean select_transparent;
|
|
|
|
|
gint32 select_criterion;
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
|
|
|
|
x = g_value_get_double (gimp_value_array_index (args, 1));
|
|
|
|
|
y = g_value_get_double (gimp_value_array_index (args, 2));
|
|
|
|
|
threshold = g_value_get_int (gimp_value_array_index (args, 3));
|
|
|
|
|
operation = g_value_get_enum (gimp_value_array_index (args, 4));
|
|
|
|
|
antialias = g_value_get_boolean (gimp_value_array_index (args, 5));
|
|
|
|
|
feather = g_value_get_boolean (gimp_value_array_index (args, 6));
|
|
|
|
|
feather_radius_x = g_value_get_double (gimp_value_array_index (args, 7));
|
|
|
|
|
feather_radius_y = g_value_get_double (gimp_value_array_index (args, 8));
|
|
|
|
|
sample_merged = g_value_get_boolean (gimp_value_array_index (args, 9));
|
|
|
|
|
select_transparent = g_value_get_boolean (gimp_value_array_index (args, 10));
|
|
|
|
|
select_criterion = g_value_get_enum (gimp_value_array_index (args, 11));
|
2006-08-15 09:20:46 -07:00
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
|
{
|
|
|
|
|
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
|
|
|
|
|
|
|
|
|
gimp_channel_select_fuzzy (gimp_image_get_mask (image),
|
|
|
|
|
drawable,
|
|
|
|
|
sample_merged,
|
|
|
|
|
x, y,
|
2012-04-27 05:23:19 -07:00
|
|
|
threshold / 255.0,
|
2006-08-15 09:20:46 -07:00
|
|
|
select_transparent,
|
|
|
|
|
select_criterion,
|
2016-01-11 03:02:27 -08:00
|
|
|
FALSE /* no diagonal neighbors */,
|
2006-08-15 09:20:46 -07:00
|
|
|
operation,
|
|
|
|
|
antialias,
|
|
|
|
|
feather,
|
2006-10-20 14:20:29 -07:00
|
|
|
feather_radius_x,
|
|
|
|
|
feather_radius_y);
|
2006-08-15 09:20:46 -07:00
|
|
|
}
|
|
|
|
|
|
2008-08-16 06:57:57 -07:00
|
|
|
return gimp_procedure_get_return_values (procedure, success,
|
|
|
|
|
error ? *error : NULL);
|
2006-08-15 09:20:46 -07:00
|
|
|
}
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
static GimpValueArray *
|
2012-05-28 10:55:28 -07:00
|
|
|
rect_select_invoker (GimpProcedure *procedure,
|
2012-05-03 15:50:23 -07:00
|
|
|
Gimp *gimp,
|
|
|
|
|
GimpContext *context,
|
|
|
|
|
GimpProgress *progress,
|
|
|
|
|
const GimpValueArray *args,
|
|
|
|
|
GError **error)
|
2006-04-04 14:11:45 -07:00
|
|
|
{
|
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
GimpImage *image;
|
|
|
|
|
gdouble x;
|
|
|
|
|
gdouble y;
|
|
|
|
|
gdouble width;
|
|
|
|
|
gdouble height;
|
|
|
|
|
gint32 operation;
|
|
|
|
|
gboolean feather;
|
|
|
|
|
gdouble feather_radius;
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
|
|
|
|
|
x = g_value_get_double (gimp_value_array_index (args, 1));
|
|
|
|
|
y = g_value_get_double (gimp_value_array_index (args, 2));
|
|
|
|
|
width = g_value_get_double (gimp_value_array_index (args, 3));
|
|
|
|
|
height = g_value_get_double (gimp_value_array_index (args, 4));
|
|
|
|
|
operation = g_value_get_enum (gimp_value_array_index (args, 5));
|
|
|
|
|
feather = g_value_get_boolean (gimp_value_array_index (args, 6));
|
|
|
|
|
feather_radius = g_value_get_double (gimp_value_array_index (args, 7));
|
2006-04-04 14:11:45 -07:00
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
|
{
|
|
|
|
|
gimp_channel_select_rectangle (gimp_image_get_mask (image),
|
|
|
|
|
(gint) x, (gint) y,
|
|
|
|
|
(gint) width, (gint) height,
|
|
|
|
|
operation,
|
|
|
|
|
feather,
|
|
|
|
|
feather_radius,
|
2006-08-25 10:19:36 -07:00
|
|
|
feather_radius,
|
|
|
|
|
TRUE);
|
2006-04-04 14:11:45 -07:00
|
|
|
}
|
|
|
|
|
|
2008-08-16 06:57:57 -07:00
|
|
|
return gimp_procedure_get_return_values (procedure, success,
|
|
|
|
|
error ? *error : NULL);
|
2006-04-04 14:11:45 -07:00
|
|
|
}
|
2001-10-22 05:13:44 -07:00
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
static GimpValueArray *
|
2012-05-28 10:55:28 -07:00
|
|
|
round_rect_select_invoker (GimpProcedure *procedure,
|
2012-05-03 15:50:23 -07:00
|
|
|
Gimp *gimp,
|
|
|
|
|
GimpContext *context,
|
|
|
|
|
GimpProgress *progress,
|
|
|
|
|
const GimpValueArray *args,
|
|
|
|
|
GError **error)
|
2006-10-20 14:20:29 -07:00
|
|
|
{
|
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
GimpImage *image;
|
|
|
|
|
gdouble x;
|
|
|
|
|
gdouble y;
|
|
|
|
|
gdouble width;
|
|
|
|
|
gdouble height;
|
|
|
|
|
gdouble corner_radius_x;
|
|
|
|
|
gdouble corner_radius_y;
|
|
|
|
|
gint32 operation;
|
|
|
|
|
gboolean antialias;
|
|
|
|
|
gboolean feather;
|
|
|
|
|
gdouble feather_radius_x;
|
|
|
|
|
gdouble feather_radius_y;
|
|
|
|
|
|
2012-05-03 15:50:23 -07:00
|
|
|
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
|
|
|
|
|
x = g_value_get_double (gimp_value_array_index (args, 1));
|
|
|
|
|
y = g_value_get_double (gimp_value_array_index (args, 2));
|
|
|
|
|
width = g_value_get_double (gimp_value_array_index (args, 3));
|
|
|
|
|
height = g_value_get_double (gimp_value_array_index (args, 4));
|
|
|
|
|
corner_radius_x = g_value_get_double (gimp_value_array_index (args, 5));
|
|
|
|
|
corner_radius_y = g_value_get_double (gimp_value_array_index (args, 6));
|
|
|
|
|
operation = g_value_get_enum (gimp_value_array_index (args, 7));
|
|
|
|
|
antialias = g_value_get_boolean (gimp_value_array_index (args, 8));
|
|
|
|
|
feather = g_value_get_boolean (gimp_value_array_index (args, 9));
|
|
|
|
|
feather_radius_x = g_value_get_double (gimp_value_array_index (args, 10));
|
|
|
|
|
feather_radius_y = g_value_get_double (gimp_value_array_index (args, 11));
|
2006-10-20 14:20:29 -07:00
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
|
{
|
|
|
|
|
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,
|
|
|
|
|
antialias,
|
|
|
|
|
feather,
|
|
|
|
|
feather_radius_x,
|
|
|
|
|
feather_radius_y,
|
|
|
|
|
TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-16 06:57:57 -07:00
|
|
|
return gimp_procedure_get_return_values (procedure, success,
|
|
|
|
|
error ? *error : NULL);
|
2006-10-20 14:20:29 -07:00
|
|
|
}
|
|
|
|
|
|
2001-10-22 05:13:44 -07:00
|
|
|
void
|
2006-04-26 02:13:47 -07:00
|
|
|
register_selection_tools_procs (GimpPDB *pdb)
|
2001-10-22 05:13:44 -07:00
|
|
|
{
|
2006-03-31 09:42:13 -08:00
|
|
|
GimpProcedure *procedure;
|
2006-03-29 12:27:46 -08:00
|
|
|
|
2006-03-28 11:58:00 -08:00
|
|
|
/*
|
2006-04-04 14:11:45 -07:00
|
|
|
* gimp-by-color-select
|
2006-03-28 11:58:00 -08:00
|
|
|
*/
|
2006-04-06 03:01:30 -07:00
|
|
|
procedure = gimp_procedure_new (by_color_select_invoker);
|
2008-04-04 03:58:56 -07:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
|
"gimp-by-color-select");
|
2006-04-04 14:11:45 -07:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
|
"gimp-by-color-select",
|
2011-02-04 09:41:41 -08:00
|
|
|
"Deprecated: Use 'gimp-image-select-color' instead.",
|
|
|
|
|
"Deprecated: Use 'gimp-image-select-color' instead.",
|
|
|
|
|
"",
|
|
|
|
|
"",
|
|
|
|
|
"",
|
|
|
|
|
"gimp-image-select-color");
|
2006-03-31 01:15:08 -08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2006-04-03 13:54:55 -07:00
|
|
|
gimp_param_spec_drawable_id ("drawable",
|
|
|
|
|
"drawable",
|
|
|
|
|
"The affected drawable",
|
2006-05-06 11:57:51 -07:00
|
|
|
pdb->gimp, FALSE,
|
2006-04-03 13:54:55 -07:00
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
2006-03-31 01:15:08 -08:00
|
|
|
gimp_param_spec_rgb ("color",
|
|
|
|
|
"color",
|
|
|
|
|
"The color to select",
|
2006-04-27 08:19:59 -07:00
|
|
|
FALSE,
|
2006-03-31 01:15:08 -08:00
|
|
|
NULL,
|
2006-03-28 11:58:00 -08:00
|
|
|
GIMP_PARAM_READWRITE));
|
2006-03-31 01:15:08 -08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2006-04-03 13:54:55 -07:00
|
|
|
gimp_param_spec_int32 ("threshold",
|
|
|
|
|
"threshold",
|
2006-05-18 10:25:15 -07:00
|
|
|
"Threshold in intensity levels",
|
2006-04-03 13:54:55 -07:00
|
|
|
0, 255, 0,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-03-31 01:15:08 -08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_enum ("operation",
|
|
|
|
|
"operation",
|
2006-05-18 10:25:15 -07:00
|
|
|
"The selection operation",
|
2006-03-31 01:15:08 -08:00
|
|
|
GIMP_TYPE_CHANNEL_OPS,
|
|
|
|
|
GIMP_CHANNEL_OP_ADD,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("antialias",
|
|
|
|
|
"antialias",
|
2006-05-18 10:25:15 -07:00
|
|
|
"Antialiasing",
|
2006-03-31 01:15:08 -08:00
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("feather",
|
|
|
|
|
"feather",
|
|
|
|
|
"Feather option for selections",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_double ("feather-radius",
|
|
|
|
|
"feather radius",
|
|
|
|
|
"Radius for feather operation",
|
|
|
|
|
0, G_MAXDOUBLE, 0,
|
2006-03-28 11:58:00 -08:00
|
|
|
GIMP_PARAM_READWRITE));
|
2006-03-31 01:15:08 -08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("sample-merged",
|
|
|
|
|
"sample merged",
|
|
|
|
|
"Use the composite image, not the drawable",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 02:13:47 -07:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 01:16:26 -07:00
|
|
|
g_object_unref (procedure);
|
2006-03-28 11:58:00 -08:00
|
|
|
|
2006-08-15 09:20:46 -07:00
|
|
|
/*
|
|
|
|
|
* gimp-by-color-select-full
|
|
|
|
|
*/
|
|
|
|
|
procedure = gimp_procedure_new (by_color_select_full_invoker);
|
2008-04-04 03:58:56 -07:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
|
"gimp-by-color-select-full");
|
2006-08-15 09:20:46 -07:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
|
"gimp-by-color-select-full",
|
2011-02-04 09:41:41 -08:00
|
|
|
"Deprecated: Use 'gimp-image-select-color' instead.",
|
|
|
|
|
"Deprecated: Use 'gimp-image-select-color' instead.",
|
2006-08-15 09:20:46 -07:00
|
|
|
"David Gowers",
|
|
|
|
|
"David Gowers",
|
|
|
|
|
"2006",
|
2011-02-04 09:41:41 -08:00
|
|
|
"gimp-image-select-color");
|
2006-08-15 09:20:46 -07:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
gimp_param_spec_drawable_id ("drawable",
|
|
|
|
|
"drawable",
|
|
|
|
|
"The affected drawable",
|
|
|
|
|
pdb->gimp, FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
gimp_param_spec_rgb ("color",
|
|
|
|
|
"color",
|
|
|
|
|
"The color to select",
|
|
|
|
|
FALSE,
|
|
|
|
|
NULL,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
gimp_param_spec_int32 ("threshold",
|
|
|
|
|
"threshold",
|
|
|
|
|
"Threshold in intensity levels",
|
|
|
|
|
0, 255, 0,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
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_boolean ("antialias",
|
|
|
|
|
"antialias",
|
|
|
|
|
"Antialiasing",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("feather",
|
|
|
|
|
"feather",
|
|
|
|
|
"Feather option for selections",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
2006-10-20 14:20:29 -07:00
|
|
|
g_param_spec_double ("feather-radius-x",
|
|
|
|
|
"feather radius x",
|
|
|
|
|
"Radius for feather operation in X direction",
|
|
|
|
|
0, G_MAXDOUBLE, 0,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_double ("feather-radius-y",
|
|
|
|
|
"feather radius y",
|
|
|
|
|
"Radius for feather operation in Y direction",
|
2006-08-15 09:20:46 -07:00
|
|
|
0, G_MAXDOUBLE, 0,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("sample-merged",
|
|
|
|
|
"sample merged",
|
|
|
|
|
"Use the composite image, not the drawable",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("select-transparent",
|
|
|
|
|
"select transparent",
|
|
|
|
|
"Whether to consider transparent pixels for selection. If TRUE, transparency is considered as a unique selectable color.",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_enum ("select-criterion",
|
|
|
|
|
"select criterion",
|
|
|
|
|
"The criterion used to determine color similarity. SELECT_CRITERION_COMPOSITE is the standard choice.",
|
|
|
|
|
GIMP_TYPE_SELECT_CRITERION,
|
|
|
|
|
GIMP_SELECT_CRITERION_COMPOSITE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
|
|
|
|
g_object_unref (procedure);
|
|
|
|
|
|
2006-03-28 11:58:00 -08:00
|
|
|
/*
|
2006-04-04 14:11:45 -07:00
|
|
|
* gimp-ellipse-select
|
2006-03-28 11:58:00 -08:00
|
|
|
*/
|
2006-04-06 03:01:30 -07:00
|
|
|
procedure = gimp_procedure_new (ellipse_select_invoker);
|
2008-04-04 03:58:56 -07:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
|
"gimp-ellipse-select");
|
2006-04-04 14:11:45 -07:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
|
"gimp-ellipse-select",
|
2011-01-25 10:28:30 -08:00
|
|
|
"Deprecated: Use 'gimp-image-select-ellipse' instead.",
|
|
|
|
|
"Deprecated: Use 'gimp-image-select-ellipse' instead.",
|
|
|
|
|
"",
|
|
|
|
|
"",
|
|
|
|
|
"",
|
|
|
|
|
"gimp-image-select-ellipse");
|
2006-03-31 01:15:08 -08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
gimp_param_spec_image_id ("image",
|
|
|
|
|
"image",
|
|
|
|
|
"The image",
|
2006-05-06 11:57:51 -07:00
|
|
|
pdb->gimp, FALSE,
|
2006-03-31 01:15:08 -08:00
|
|
|
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",
|
2006-05-18 10:25:15 -07:00
|
|
|
"The width of the ellipse",
|
2006-03-31 01:15:08 -08:00
|
|
|
0, G_MAXDOUBLE, 0,
|
2006-03-28 11:58:00 -08:00
|
|
|
GIMP_PARAM_READWRITE));
|
2006-03-31 01:15:08 -08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_double ("height",
|
|
|
|
|
"height",
|
2006-05-18 10:25:15 -07:00
|
|
|
"The height of the ellipse",
|
2006-03-31 01:15:08 -08:00
|
|
|
0, G_MAXDOUBLE, 0,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_enum ("operation",
|
|
|
|
|
"operation",
|
2006-05-18 10:25:15 -07:00
|
|
|
"The selection operation",
|
2006-03-31 01:15:08 -08:00
|
|
|
GIMP_TYPE_CHANNEL_OPS,
|
|
|
|
|
GIMP_CHANNEL_OP_ADD,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("antialias",
|
|
|
|
|
"antialias",
|
2006-05-18 10:25:15 -07:00
|
|
|
"Antialiasing",
|
2006-03-31 01:15:08 -08:00
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("feather",
|
|
|
|
|
"feather",
|
|
|
|
|
"Feather option for selections",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_double ("feather-radius",
|
|
|
|
|
"feather radius",
|
|
|
|
|
"Radius for feather operation",
|
|
|
|
|
0, G_MAXDOUBLE, 0,
|
2006-03-28 11:58:00 -08:00
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 02:13:47 -07:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 01:16:26 -07:00
|
|
|
g_object_unref (procedure);
|
2006-03-28 11:58:00 -08:00
|
|
|
|
|
|
|
|
/*
|
2006-04-04 14:11:45 -07:00
|
|
|
* gimp-free-select
|
2006-03-28 11:58:00 -08:00
|
|
|
*/
|
2006-04-06 03:01:30 -07:00
|
|
|
procedure = gimp_procedure_new (free_select_invoker);
|
2008-04-04 03:58:56 -07:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
|
"gimp-free-select");
|
2006-04-04 14:11:45 -07:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
|
"gimp-free-select",
|
2011-01-25 10:28:30 -08:00
|
|
|
"Deprecated: Use 'gimp-image-select-polygon' instead.",
|
|
|
|
|
"Deprecated: Use 'gimp-image-select-polygon' instead.",
|
|
|
|
|
"",
|
|
|
|
|
"",
|
|
|
|
|
"",
|
|
|
|
|
"gimp-image-select-polygon");
|
2006-03-31 01:15:08 -08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
gimp_param_spec_image_id ("image",
|
|
|
|
|
"image",
|
|
|
|
|
"The image",
|
2006-05-06 11:57:51 -07:00
|
|
|
pdb->gimp, FALSE,
|
2006-03-31 01:15:08 -08:00
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
2006-04-03 13:54:55 -07:00
|
|
|
gimp_param_spec_int32 ("num-segs",
|
|
|
|
|
"num segs",
|
|
|
|
|
"Number of points (count 1 coordinate as two points)",
|
|
|
|
|
2, G_MAXINT32, 2,
|
2006-03-31 17:33:28 -08:00
|
|
|
GIMP_PARAM_READWRITE));
|
2006-03-31 01:15:08 -08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2006-04-03 13:54:55 -07:00
|
|
|
gimp_param_spec_float_array ("segs",
|
|
|
|
|
"segs",
|
|
|
|
|
"Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y}",
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
2006-03-31 01:15:08 -08:00
|
|
|
g_param_spec_enum ("operation",
|
|
|
|
|
"operation",
|
2006-05-18 10:25:15 -07:00
|
|
|
"The selection operation",
|
2006-03-31 01:15:08 -08:00
|
|
|
GIMP_TYPE_CHANNEL_OPS,
|
|
|
|
|
GIMP_CHANNEL_OP_ADD,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("antialias",
|
|
|
|
|
"antialias",
|
2006-05-18 10:25:15 -07:00
|
|
|
"Antialiasing",
|
2006-03-31 01:15:08 -08:00
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("feather",
|
|
|
|
|
"feather",
|
|
|
|
|
"Feather option for selections",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_double ("feather-radius",
|
|
|
|
|
"feather radius",
|
|
|
|
|
"Radius for feather operation",
|
|
|
|
|
0, G_MAXDOUBLE, 0,
|
2006-03-28 11:58:00 -08:00
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 02:13:47 -07:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 01:16:26 -07:00
|
|
|
g_object_unref (procedure);
|
2006-03-28 11:58:00 -08:00
|
|
|
|
|
|
|
|
/*
|
2006-04-04 14:11:45 -07:00
|
|
|
* gimp-fuzzy-select
|
2006-03-28 11:58:00 -08:00
|
|
|
*/
|
2006-04-06 03:01:30 -07:00
|
|
|
procedure = gimp_procedure_new (fuzzy_select_invoker);
|
2008-04-04 03:58:56 -07:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
|
"gimp-fuzzy-select");
|
2006-04-04 14:11:45 -07:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
|
"gimp-fuzzy-select",
|
2011-02-13 08:11:20 -08:00
|
|
|
"Deprecated: Use 'gimp-image-select-contiguous-color' instead.",
|
|
|
|
|
"Deprecated: Use 'gimp-image-select-contiguous-color' instead.",
|
2011-02-04 09:41:41 -08:00
|
|
|
"",
|
|
|
|
|
"",
|
|
|
|
|
"",
|
2011-02-13 08:11:20 -08:00
|
|
|
"gimp-image-select-contiguous-color");
|
2006-03-31 01:15:08 -08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2006-04-03 13:54:55 -07:00
|
|
|
gimp_param_spec_drawable_id ("drawable",
|
|
|
|
|
"drawable",
|
|
|
|
|
"The affected drawable",
|
2006-05-06 11:57:51 -07:00
|
|
|
pdb->gimp, FALSE,
|
2006-04-03 13:54:55 -07:00
|
|
|
GIMP_PARAM_READWRITE));
|
2006-03-31 01:15:08 -08: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,
|
2006-03-28 11:58:00 -08:00
|
|
|
GIMP_PARAM_READWRITE));
|
2006-03-31 01:15:08 -08:00
|
|
|
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,
|
2006-03-28 11:58:00 -08:00
|
|
|
GIMP_PARAM_READWRITE));
|
2006-03-31 01:15:08 -08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
2006-04-03 13:54:55 -07:00
|
|
|
gimp_param_spec_int32 ("threshold",
|
|
|
|
|
"threshold",
|
2006-05-18 10:25:15 -07:00
|
|
|
"Threshold in intensity levels",
|
2006-04-03 13:54:55 -07:00
|
|
|
0, 255, 0,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-03-31 01:15:08 -08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_enum ("operation",
|
|
|
|
|
"operation",
|
2006-05-18 10:25:15 -07:00
|
|
|
"The selection operation",
|
2006-03-31 01:15:08 -08:00
|
|
|
GIMP_TYPE_CHANNEL_OPS,
|
|
|
|
|
GIMP_CHANNEL_OP_ADD,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("antialias",
|
|
|
|
|
"antialias",
|
2006-05-18 10:25:15 -07:00
|
|
|
"Antialiasing",
|
2006-03-31 01:15:08 -08:00
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("feather",
|
|
|
|
|
"feather",
|
|
|
|
|
"Feather option for selections",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_double ("feather-radius",
|
|
|
|
|
"feather radius",
|
|
|
|
|
"Radius for feather operation",
|
|
|
|
|
0, G_MAXDOUBLE, 0,
|
2006-03-28 11:58:00 -08:00
|
|
|
GIMP_PARAM_READWRITE));
|
2006-03-31 01:15:08 -08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("sample-merged",
|
|
|
|
|
"sample merged",
|
|
|
|
|
"Use the composite image, not the drawable",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 02:13:47 -07:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 01:16:26 -07:00
|
|
|
g_object_unref (procedure);
|
2006-03-28 11:58:00 -08:00
|
|
|
|
2006-08-15 09:20:46 -07:00
|
|
|
/*
|
|
|
|
|
* gimp-fuzzy-select-full
|
|
|
|
|
*/
|
|
|
|
|
procedure = gimp_procedure_new (fuzzy_select_full_invoker);
|
2008-04-04 03:58:56 -07:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
|
"gimp-fuzzy-select-full");
|
2006-08-15 09:20:46 -07:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
|
"gimp-fuzzy-select-full",
|
2011-02-13 08:11:20 -08:00
|
|
|
"Deprecated: Use 'gimp-image-select-contiguous-color' instead.",
|
|
|
|
|
"Deprecated: Use 'gimp-image-select-contiguous-color' instead.",
|
2006-08-15 09:20:46 -07:00
|
|
|
"David Gowers",
|
|
|
|
|
"David Gowers",
|
|
|
|
|
"2006",
|
2011-02-13 08:11:20 -08:00
|
|
|
"gimp-image-select-contiguous-color");
|
2006-08-15 09:20:46 -07:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
gimp_param_spec_drawable_id ("drawable",
|
|
|
|
|
"drawable",
|
|
|
|
|
"The affected drawable",
|
|
|
|
|
pdb->gimp, FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
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_procedure_add_argument (procedure,
|
|
|
|
|
gimp_param_spec_int32 ("threshold",
|
|
|
|
|
"threshold",
|
|
|
|
|
"Threshold in intensity levels",
|
|
|
|
|
0, 255, 0,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
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_boolean ("antialias",
|
|
|
|
|
"antialias",
|
|
|
|
|
"Antialiasing",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("feather",
|
|
|
|
|
"feather",
|
|
|
|
|
"Feather option for selections",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
2006-10-20 14:20:29 -07:00
|
|
|
g_param_spec_double ("feather-radius-x",
|
|
|
|
|
"feather radius x",
|
|
|
|
|
"Radius for feather operation in X direction",
|
|
|
|
|
0, G_MAXDOUBLE, 0,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_double ("feather-radius-y",
|
|
|
|
|
"feather radius y",
|
|
|
|
|
"Radius for feather operation in Y direction",
|
2006-08-15 09:20:46 -07:00
|
|
|
0, G_MAXDOUBLE, 0,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("sample-merged",
|
|
|
|
|
"sample merged",
|
|
|
|
|
"Use the composite image, not the drawable",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("select-transparent",
|
|
|
|
|
"select transparent",
|
|
|
|
|
"Whether to consider transparent pixels for selection. If TRUE, transparency is considered as a unique selectable color.",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_enum ("select-criterion",
|
|
|
|
|
"select criterion",
|
|
|
|
|
"The criterion used to determine color similarity. SELECT_CRITERION_COMPOSITE is the standard choice.",
|
|
|
|
|
GIMP_TYPE_SELECT_CRITERION,
|
|
|
|
|
GIMP_SELECT_CRITERION_COMPOSITE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
|
|
|
|
g_object_unref (procedure);
|
|
|
|
|
|
2006-03-28 11:58:00 -08:00
|
|
|
/*
|
2006-04-04 14:11:45 -07:00
|
|
|
* gimp-rect-select
|
2006-03-28 11:58:00 -08:00
|
|
|
*/
|
2006-04-06 03:01:30 -07:00
|
|
|
procedure = gimp_procedure_new (rect_select_invoker);
|
2008-04-04 03:58:56 -07:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
|
"gimp-rect-select");
|
2006-04-04 14:11:45 -07:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
|
"gimp-rect-select",
|
2011-01-25 10:28:30 -08:00
|
|
|
"Deprecated: Use 'gimp-image-select-rectangle' instead.",
|
|
|
|
|
"Deprecated: Use 'gimp-image-select-rectangle' instead.",
|
|
|
|
|
"",
|
|
|
|
|
"",
|
|
|
|
|
"",
|
|
|
|
|
"gimp-image-select-rectangle");
|
2006-03-31 01:15:08 -08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
gimp_param_spec_image_id ("image",
|
|
|
|
|
"image",
|
|
|
|
|
"The image",
|
2006-05-06 11:57:51 -07:00
|
|
|
pdb->gimp, FALSE,
|
2006-03-31 01:15:08 -08:00
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
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",
|
2006-05-18 10:25:15 -07:00
|
|
|
"The width of the rectangle",
|
2006-03-31 01:15:08 -08:00
|
|
|
0, G_MAXDOUBLE, 0,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_double ("height",
|
|
|
|
|
"height",
|
2006-05-18 10:25:15 -07:00
|
|
|
"The height of the rectangle",
|
2006-03-31 01:15:08 -08:00
|
|
|
0, G_MAXDOUBLE, 0,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_enum ("operation",
|
|
|
|
|
"operation",
|
2006-05-18 10:25:15 -07:00
|
|
|
"The selection operation",
|
2006-03-31 01:15:08 -08:00
|
|
|
GIMP_TYPE_CHANNEL_OPS,
|
|
|
|
|
GIMP_CHANNEL_OP_ADD,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("feather",
|
|
|
|
|
"feather",
|
|
|
|
|
"Feather option for selections",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_double ("feather-radius",
|
|
|
|
|
"feather radius",
|
|
|
|
|
"Radius for feather operation",
|
|
|
|
|
0, G_MAXDOUBLE, 0,
|
2006-03-28 11:58:00 -08:00
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 02:13:47 -07:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 01:16:26 -07:00
|
|
|
g_object_unref (procedure);
|
2006-10-20 14:20:29 -07:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* gimp-round-rect-select
|
|
|
|
|
*/
|
|
|
|
|
procedure = gimp_procedure_new (round_rect_select_invoker);
|
2008-04-04 03:58:56 -07:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
|
"gimp-round-rect-select");
|
2006-10-20 14:20:29 -07:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
|
"gimp-round-rect-select",
|
2011-01-25 10:28:30 -08:00
|
|
|
"Deprecated: Use 'gimp-image-select-round-rectangle' instead.",
|
|
|
|
|
"Deprecated: Use 'gimp-image-select-round-rectangle' instead.",
|
2006-10-20 14:20:29 -07:00
|
|
|
"Martin Nordholts",
|
|
|
|
|
"Martin Nordholts",
|
|
|
|
|
"2006",
|
2011-01-25 10:28:30 -08:00
|
|
|
"gimp-image-select-round-rectangle");
|
2006-10-20 14:20:29 -07:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
gimp_param_spec_image_id ("image",
|
|
|
|
|
"image",
|
|
|
|
|
"The image",
|
|
|
|
|
pdb->gimp, FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
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",
|
2007-07-05 07:31:42 -07:00
|
|
|
0, GIMP_MAX_IMAGE_SIZE, 0,
|
2006-10-20 14:20:29 -07:00
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_double ("corner-radius-y",
|
|
|
|
|
"corner radius y",
|
|
|
|
|
"The corner radius in Y direction",
|
2007-07-05 07:31:42 -07:00
|
|
|
0, GIMP_MAX_IMAGE_SIZE, 0,
|
2006-10-20 14:20:29 -07:00
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
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_boolean ("antialias",
|
|
|
|
|
"antialias",
|
|
|
|
|
"Antialiasing",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_boolean ("feather",
|
|
|
|
|
"feather",
|
|
|
|
|
"Feather option for selections",
|
|
|
|
|
FALSE,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_double ("feather-radius-x",
|
|
|
|
|
"feather radius x",
|
|
|
|
|
"Radius for feather operation in X direction",
|
|
|
|
|
0, G_MAXDOUBLE, 0,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
|
g_param_spec_double ("feather-radius-y",
|
|
|
|
|
"feather radius y",
|
|
|
|
|
"Radius for feather operation in Y direction",
|
|
|
|
|
0, G_MAXDOUBLE, 0,
|
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
|
|
|
|
g_object_unref (procedure);
|
2001-10-22 05:13:44 -07:00
|
|
|
}
|