2006-12-09 13:33:38 -08:00
|
|
|
# GIMP - The GNU Image Manipulation Program
|
2001-10-22 05:13:44 -07:00
|
|
|
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
|
|
|
|
|
|
|
|
|
|
sub by_color_select {
|
2011-02-04 09:41:41 -08:00
|
|
|
&std_pdb_deprecated ('gimp-image-select-color');
|
2001-10-22 05:13:44 -07:00
|
|
|
|
|
|
|
|
@inargs = (
|
2006-03-14 13:35:50 -08:00
|
|
|
{ name => 'drawable', type => 'drawable',
|
|
|
|
|
desc => 'The affected drawable' },
|
2001-10-22 05:13:44 -07:00
|
|
|
{ name => 'color', type => 'color',
|
|
|
|
|
desc => 'The color to select' },
|
2006-03-14 13:35:50 -08:00
|
|
|
{ name => 'threshold', type => '0 <= int32 <= 255',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'Threshold in intensity levels' },
|
2006-03-14 13:35:50 -08:00
|
|
|
{ name => 'operation', type => 'enum GimpChannelOps',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'The selection operation' },
|
2006-03-23 13:17:16 -08:00
|
|
|
{ name => 'antialias', type => 'boolean',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'Antialiasing' },
|
2006-03-14 13:35:50 -08:00
|
|
|
{ name => 'feather', type => 'boolean',
|
|
|
|
|
desc => 'Feather option for selections' },
|
2006-03-23 13:17:16 -08:00
|
|
|
{ name => 'feather_radius', type => '0 <= float',
|
2006-03-14 13:35:50 -08:00
|
|
|
desc => 'Radius for feather operation' },
|
|
|
|
|
{ name => 'sample_merged', type => 'boolean',
|
|
|
|
|
desc => 'Use the composite image, not the drawable' }
|
2001-10-22 05:13:44 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
%invoke = (
|
|
|
|
|
code => <<'CODE'
|
|
|
|
|
{
|
2006-03-23 13:17:16 -08:00
|
|
|
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
2001-10-22 05:13:44 -07:00
|
|
|
|
2006-03-23 13:17:16 -08:00
|
|
|
gimp_channel_select_by_color (gimp_image_get_mask (image), drawable,
|
2003-10-06 05:17:11 -07:00
|
|
|
sample_merged,
|
|
|
|
|
&color,
|
2012-04-27 05:23:19 -07:00
|
|
|
threshold / 255.0,
|
2003-10-06 05:17:11 -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,
|
2003-10-06 05:17:11 -07:00
|
|
|
operation,
|
|
|
|
|
antialias,
|
|
|
|
|
feather,
|
|
|
|
|
feather_radius,
|
|
|
|
|
feather_radius);
|
2001-10-22 05:13:44 -07:00
|
|
|
}
|
|
|
|
|
CODE
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2006-08-15 09:20:46 -07:00
|
|
|
|
|
|
|
|
sub by_color_select_full {
|
2011-02-04 09:41:41 -08:00
|
|
|
&std_pdb_deprecated ('gimp-image-select-color');
|
2006-08-15 09:20:46 -07:00
|
|
|
&david_pdb_misc('2006','2.4');
|
|
|
|
|
|
|
|
|
|
@inargs = (
|
|
|
|
|
{ name => 'drawable', type => 'drawable',
|
|
|
|
|
desc => 'The affected drawable' },
|
|
|
|
|
{ name => 'color', type => 'color',
|
|
|
|
|
desc => 'The color to select' },
|
|
|
|
|
{ name => 'threshold', type => '0 <= int32 <= 255',
|
|
|
|
|
desc => 'Threshold in intensity levels' },
|
|
|
|
|
{ name => 'operation', type => 'enum GimpChannelOps',
|
|
|
|
|
desc => 'The selection operation' },
|
|
|
|
|
{ name => 'antialias', type => 'boolean',
|
|
|
|
|
desc => 'Antialiasing' },
|
|
|
|
|
{ name => 'feather', type => 'boolean',
|
|
|
|
|
desc => 'Feather option for selections' },
|
2006-10-20 14:20:29 -07:00
|
|
|
{ name => 'feather_radius_x', type => '0 <= float',
|
|
|
|
|
desc => 'Radius for feather operation in X direction' },
|
|
|
|
|
{ name => 'feather_radius_y', type => '0 <= float',
|
|
|
|
|
desc => 'Radius for feather operation in Y direction' },
|
2006-08-15 09:20:46 -07:00
|
|
|
{ name => 'sample_merged', type => 'boolean',
|
|
|
|
|
desc => 'Use the composite image, not the drawable' },
|
|
|
|
|
{ name => 'select_transparent', type => 'boolean',
|
|
|
|
|
desc => "Whether to consider transparent pixels for selection.
|
|
|
|
|
If TRUE, transparency is considered as a unique selectable
|
|
|
|
|
color." },
|
|
|
|
|
{ name => 'select_criterion', type => 'enum GimpSelectCriterion',
|
|
|
|
|
desc => "The criterion used to determine color similarity.
|
|
|
|
|
SELECT_CRITERION_COMPOSITE is the standard choice.
|
|
|
|
|
" },
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
%invoke = (
|
|
|
|
|
code => <<'CODE'
|
|
|
|
|
{
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
CODE
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-10-22 05:13:44 -07:00
|
|
|
sub ellipse_select {
|
2011-01-25 10:28:30 -08:00
|
|
|
&std_pdb_deprecated ('gimp-image-select-ellipse');
|
2001-10-22 05:13:44 -07:00
|
|
|
|
|
|
|
|
@inargs = (
|
2006-03-23 13:17:16 -08:00
|
|
|
{ name => 'image', type => 'image',
|
|
|
|
|
desc => 'The image' },
|
2001-10-22 05:13:44 -07:00
|
|
|
{ name => 'x', type => 'float',
|
|
|
|
|
desc => 'x coordinate of upper-left corner of ellipse bounding box' },
|
|
|
|
|
{ name => 'y', type => 'float',
|
|
|
|
|
desc => 'y coordinate of upper-left corner of ellipse bounding box' },
|
|
|
|
|
{ name => 'width', type => '0 < float',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'The width of the ellipse' },
|
2001-10-22 05:13:44 -07:00
|
|
|
{ name => 'height', type => '0 < float',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'The height of the ellipse' },
|
2006-03-14 13:35:50 -08:00
|
|
|
{ name => 'operation', type => 'enum GimpChannelOps',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'The selection operation' },
|
2006-03-23 13:17:16 -08:00
|
|
|
{ name => 'antialias', type => 'boolean',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'Antialiasing' },
|
2006-03-14 13:35:50 -08:00
|
|
|
{ name => 'feather', type => 'boolean',
|
|
|
|
|
desc => 'Feather option for selections' },
|
2006-03-23 13:17:16 -08:00
|
|
|
{ name => 'feather_radius', type => '0 <= float',
|
2006-03-14 13:35:50 -08:00
|
|
|
desc => 'Radius for feather operation' }
|
2001-10-22 05:13:44 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
%invoke = (
|
|
|
|
|
code => <<'CODE'
|
2006-03-14 13:35:50 -08:00
|
|
|
{
|
2006-03-23 13:17:16 -08:00
|
|
|
gimp_channel_select_ellipse (gimp_image_get_mask (image),
|
2006-03-14 13:35:50 -08:00
|
|
|
(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-03-14 13:35:50 -08:00
|
|
|
}
|
2001-10-22 05:13:44 -07:00
|
|
|
CODE
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2006-10-20 14:20:29 -07:00
|
|
|
|
2001-10-22 05:13:44 -07:00
|
|
|
sub free_select {
|
2011-01-25 10:28:30 -08:00
|
|
|
&std_pdb_deprecated ('gimp-image-select-polygon');
|
2001-10-22 05:13:44 -07:00
|
|
|
|
|
|
|
|
@inargs = (
|
2006-03-23 13:17:16 -08:00
|
|
|
{ name => 'image', type => 'image',
|
|
|
|
|
desc => 'The image' },
|
2001-10-22 05:13:44 -07:00
|
|
|
{ name => 'segs', type => 'floatarray',
|
|
|
|
|
desc => 'Array of points: { p1.x, p1.y, p2.x, p2.y, ...,
|
|
|
|
|
pn.x, pn.y}',
|
2006-03-18 02:28:39 -08:00
|
|
|
array => { type => '2 <= int32',
|
2001-10-22 05:13:44 -07:00
|
|
|
desc => 'Number of points (count 1 coordinate as two
|
|
|
|
|
points)' } },
|
2006-03-14 13:35:50 -08:00
|
|
|
{ name => 'operation', type => 'enum GimpChannelOps',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'The selection operation' },
|
2006-03-23 13:17:16 -08:00
|
|
|
{ name => 'antialias', type => 'boolean',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'Antialiasing' },
|
2006-03-14 13:35:50 -08:00
|
|
|
{ name => 'feather', type => 'boolean',
|
|
|
|
|
desc => 'Feather option for selections' },
|
2006-03-23 13:17:16 -08:00
|
|
|
{ name => 'feather_radius', type => '0 <= float',
|
2006-03-14 13:35:50 -08:00
|
|
|
desc => 'Radius for feather operation' }
|
2001-10-22 05:13:44 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
%invoke = (
|
|
|
|
|
code => <<'CODE'
|
2006-03-14 13:35:50 -08:00
|
|
|
{
|
2006-03-23 13:17:16 -08:00
|
|
|
gimp_channel_select_polygon (gimp_image_get_mask (image),
|
2006-03-14 13:35:50 -08:00
|
|
|
_("Free Select"),
|
2006-03-18 02:28:39 -08:00
|
|
|
num_segs / 2,
|
2006-03-14 13:35:50 -08:00
|
|
|
(GimpVector2 *) segs,
|
|
|
|
|
operation,
|
|
|
|
|
antialias,
|
|
|
|
|
feather,
|
|
|
|
|
feather_radius,
|
2006-08-25 10:19:36 -07:00
|
|
|
feather_radius,
|
|
|
|
|
TRUE);
|
2006-03-14 13:35:50 -08:00
|
|
|
}
|
2001-10-22 05:13:44 -07:00
|
|
|
CODE
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2006-10-20 14:20:29 -07:00
|
|
|
|
2001-10-22 05:13:44 -07:00
|
|
|
sub fuzzy_select {
|
2011-02-13 08:11:20 -08:00
|
|
|
&std_pdb_deprecated ('gimp-image-select-contiguous-color');
|
2001-10-22 05:13:44 -07:00
|
|
|
|
|
|
|
|
@inargs = (
|
2006-03-14 13:35:50 -08:00
|
|
|
{ name => 'drawable', type => 'drawable',
|
|
|
|
|
desc => 'The affected drawable' },
|
2001-10-22 05:13:44 -07:00
|
|
|
{ name => 'x', type => 'float',
|
|
|
|
|
desc => 'x coordinate of initial seed fill point: (image
|
|
|
|
|
coordinates)' },
|
|
|
|
|
{ name => 'y', type => 'float',
|
|
|
|
|
desc => 'y coordinate of initial seed fill point: (image
|
|
|
|
|
coordinates)' },
|
2006-03-14 13:35:50 -08:00
|
|
|
{ name => 'threshold', type => '0 <= int32 <= 255',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'Threshold in intensity levels' },
|
2006-03-14 13:35:50 -08:00
|
|
|
{ name => 'operation', type => 'enum GimpChannelOps',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'The selection operation' },
|
2006-03-23 13:17:16 -08:00
|
|
|
{ name => 'antialias', type => 'boolean',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'Antialiasing' },
|
2006-03-14 13:35:50 -08:00
|
|
|
{ name => 'feather', type => 'boolean',
|
|
|
|
|
desc => 'Feather option for selections' },
|
2006-03-23 13:17:16 -08:00
|
|
|
{ name => 'feather_radius', type => '0 <= float',
|
2006-03-14 13:35:50 -08:00
|
|
|
desc => 'Radius for feather operation' },
|
|
|
|
|
{ name => 'sample_merged', type => 'boolean',
|
|
|
|
|
desc => 'Use the composite image, not the drawable' }
|
2001-10-22 05:13:44 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
%invoke = (
|
|
|
|
|
code => <<'CODE'
|
|
|
|
|
{
|
2006-03-23 13:17:16 -08:00
|
|
|
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
2001-10-22 05:13:44 -07:00
|
|
|
|
2006-03-23 13:17:16 -08:00
|
|
|
gimp_channel_select_fuzzy (gimp_image_get_mask (image),
|
2003-10-06 05:17:11 -07:00
|
|
|
drawable,
|
|
|
|
|
sample_merged,
|
2006-01-17 05:35:20 -08:00
|
|
|
x, y,
|
2012-04-27 05:23:19 -07:00
|
|
|
threshold / 255.0,
|
2003-10-06 05:17:11 -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 */,
|
2003-10-06 05:17:11 -07:00
|
|
|
operation,
|
|
|
|
|
antialias,
|
|
|
|
|
feather,
|
|
|
|
|
feather_radius,
|
|
|
|
|
feather_radius);
|
2001-10-22 05:13:44 -07:00
|
|
|
}
|
|
|
|
|
CODE
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2006-08-15 09:20:46 -07:00
|
|
|
|
|
|
|
|
sub fuzzy_select_full {
|
2011-02-13 08:11:20 -08:00
|
|
|
&std_pdb_deprecated ('gimp-image-select-contiguous-color');
|
2006-08-15 09:20:46 -07:00
|
|
|
&david_pdb_misc("2006","2.4");
|
|
|
|
|
|
|
|
|
|
@inargs = (
|
|
|
|
|
{ name => 'drawable', type => 'drawable',
|
|
|
|
|
desc => 'The affected drawable' },
|
|
|
|
|
{ name => 'x', type => 'float',
|
|
|
|
|
desc => 'x coordinate of initial seed fill point: (image
|
|
|
|
|
coordinates)' },
|
|
|
|
|
{ name => 'y', type => 'float',
|
|
|
|
|
desc => 'y coordinate of initial seed fill point: (image
|
|
|
|
|
coordinates)' },
|
|
|
|
|
{ name => 'threshold', type => '0 <= int32 <= 255',
|
|
|
|
|
desc => 'Threshold in intensity levels' },
|
|
|
|
|
{ name => 'operation', type => 'enum GimpChannelOps',
|
|
|
|
|
desc => 'The selection operation' },
|
|
|
|
|
{ name => 'antialias', type => 'boolean',
|
|
|
|
|
desc => 'Antialiasing' },
|
|
|
|
|
{ name => 'feather', type => 'boolean',
|
|
|
|
|
desc => 'Feather option for selections' },
|
2006-10-20 14:20:29 -07:00
|
|
|
{ name => 'feather_radius_x', type => '0 <= float',
|
|
|
|
|
desc => 'Radius for feather operation in X direction' },
|
|
|
|
|
{ name => 'feather_radius_y', type => '0 <= float',
|
|
|
|
|
desc => 'Radius for feather operation in Y direction' },
|
2006-08-15 09:20:46 -07:00
|
|
|
{ name => 'sample_merged', type => 'boolean',
|
|
|
|
|
desc => 'Use the composite image, not the drawable' },
|
|
|
|
|
{ name => 'select_transparent', type => 'boolean',
|
|
|
|
|
desc => "Whether to consider transparent pixels for selection.
|
|
|
|
|
If TRUE, transparency is considered as a unique selectable
|
|
|
|
|
color." },
|
|
|
|
|
{ name => 'select_criterion', type => 'enum GimpSelectCriterion',
|
|
|
|
|
desc => "The criterion used to determine color similarity.
|
|
|
|
|
SELECT_CRITERION_COMPOSITE is the standard choice.
|
|
|
|
|
" },
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
%invoke = (
|
|
|
|
|
code => <<'CODE'
|
|
|
|
|
{
|
|
|
|
|
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,
|
2016-01-11 03:02:27 -08:00
|
|
|
select_transparent,
|
2006-08-15 09:20:46 -07:00
|
|
|
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
|
|
|
}
|
|
|
|
|
CODE
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-10-22 05:13:44 -07:00
|
|
|
sub rect_select {
|
2011-01-25 10:28:30 -08:00
|
|
|
&std_pdb_deprecated ('gimp-image-select-rectangle');
|
2001-10-22 05:13:44 -07:00
|
|
|
|
|
|
|
|
@inargs = (
|
2006-03-23 13:17:16 -08:00
|
|
|
{ name => 'image', type => 'image',
|
|
|
|
|
desc => 'The image' },
|
2001-10-22 05:13:44 -07:00
|
|
|
{ name => 'x', type => 'float',
|
|
|
|
|
desc => 'x coordinate of upper-left corner of rectangle' },
|
|
|
|
|
{ name => 'y', type => 'float',
|
|
|
|
|
desc => 'y coordinate of upper-left corner of rectangle' },
|
|
|
|
|
{ name => 'width', type => '0 < float',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'The width of the rectangle' },
|
2001-10-22 05:13:44 -07:00
|
|
|
{ name => 'height', type => '0 < float',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'The height of the rectangle' },
|
2006-03-14 13:35:50 -08:00
|
|
|
{ name => 'operation', type => 'enum GimpChannelOps',
|
2006-05-18 10:25:15 -07:00
|
|
|
desc => 'The selection operation' },
|
2006-03-14 13:35:50 -08:00
|
|
|
{ name => 'feather', type => 'boolean',
|
|
|
|
|
desc => 'Feather option for selections' },
|
2006-03-23 13:17:16 -08:00
|
|
|
{ name => 'feather_radius', type => '0 <= float',
|
2006-03-14 13:35:50 -08:00
|
|
|
desc => 'Radius for feather operation' }
|
2001-10-22 05:13:44 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
%invoke = (
|
|
|
|
|
code => <<'CODE'
|
2006-03-14 13:35:50 -08:00
|
|
|
{
|
2006-03-23 13:17:16 -08:00
|
|
|
gimp_channel_select_rectangle (gimp_image_get_mask (image),
|
2006-03-14 13:35:50 -08:00
|
|
|
(gint) x, (gint) y,
|
|
|
|
|
(gint) width, (gint) height,
|
|
|
|
|
operation,
|
|
|
|
|
feather,
|
|
|
|
|
feather_radius,
|
2006-08-25 10:19:36 -07:00
|
|
|
feather_radius,
|
|
|
|
|
TRUE);
|
2006-03-14 13:35:50 -08:00
|
|
|
}
|
2001-10-22 05:13:44 -07:00
|
|
|
CODE
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2006-03-23 13:17:16 -08:00
|
|
|
|
2006-10-20 14:20:29 -07:00
|
|
|
sub round_rect_select {
|
2011-01-25 10:28:30 -08:00
|
|
|
&std_pdb_deprecated ('gimp-image-select-round-rectangle');
|
2006-10-20 14:20:29 -07:00
|
|
|
&martin_pdb_misc("2006","2.4");
|
|
|
|
|
|
|
|
|
|
@inargs = (
|
|
|
|
|
{ name => 'image', type => 'image',
|
|
|
|
|
desc => 'The image' },
|
|
|
|
|
{ name => 'x', type => 'float',
|
|
|
|
|
desc => 'x coordinate of upper-left corner of rectangle' },
|
|
|
|
|
{ name => 'y', type => 'float',
|
|
|
|
|
desc => 'y coordinate of upper-left corner of rectangle' },
|
|
|
|
|
{ name => 'width', type => '0 < float',
|
|
|
|
|
desc => 'The width of the rectangle' },
|
|
|
|
|
{ name => 'height', type => '0 < float',
|
|
|
|
|
desc => 'The height of the rectangle' },
|
|
|
|
|
{ name => 'corner_radius_x', type => '0 < float < GIMP_MAX_IMAGE_SIZE',
|
|
|
|
|
desc => 'The corner radius in X direction' },
|
|
|
|
|
{ name => 'corner_radius_y', type => '0 < float < GIMP_MAX_IMAGE_SIZE',
|
|
|
|
|
desc => 'The corner radius in Y direction' },
|
|
|
|
|
{ name => 'operation', type => 'enum GimpChannelOps',
|
|
|
|
|
desc => 'The selection operation' },
|
|
|
|
|
{ name => 'antialias', type => 'boolean',
|
|
|
|
|
desc => 'Antialiasing' },
|
|
|
|
|
{ name => 'feather', type => 'boolean',
|
|
|
|
|
desc => 'Feather option for selections' },
|
|
|
|
|
{ name => 'feather_radius_x', type => '0 <= float',
|
|
|
|
|
desc => 'Radius for feather operation in X direction' },
|
|
|
|
|
{ name => 'feather_radius_y', type => '0 <= float',
|
|
|
|
|
desc => 'Radius for feather operation in Y direction' }
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
%invoke = (
|
|
|
|
|
code => <<'CODE'
|
|
|
|
|
{
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
CODE
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-07-05 07:31:42 -07:00
|
|
|
@headers = qw("libgimpbase/gimpbase.h"
|
|
|
|
|
"core/gimpchannel-select.h"
|
|
|
|
|
"gimp-intl.h");
|
2001-10-22 05:13:44 -07:00
|
|
|
|
2006-08-15 09:20:46 -07:00
|
|
|
@procs = qw(by_color_select by_color_select_full
|
2006-10-20 14:20:29 -07:00
|
|
|
ellipse_select
|
|
|
|
|
free_select
|
2006-08-15 09:20:46 -07:00
|
|
|
fuzzy_select fuzzy_select_full
|
2006-10-20 14:20:29 -07:00
|
|
|
rect_select round_rect_select);
|
2006-03-23 13:17:16 -08:00
|
|
|
|
2001-10-22 05:13:44 -07:00
|
|
|
%exports = (app => [@procs], lib => [@procs]);
|
|
|
|
|
|
|
|
|
|
$desc = 'Selection Tool procedures';
|
2010-07-07 02:43:10 -07:00
|
|
|
$doc_title = 'gimpselectiontools';
|
|
|
|
|
$doc_short_desc = 'Access to toolbox selection tools.';
|
|
|
|
|
$doc_long_desc = 'Functions giving access to toolbox selection tools.';
|
2001-10-22 05:13:44 -07:00
|
|
|
|
|
|
|
|
1;
|