mirror of https://github.com/GNOME/gimp.git
app: rename gimp_image_select_fuzzy() to gimp_image_select_contiguous_color()
and update all documentation accordingly. Also reorder the gimp_image_select procedures.
This commit is contained in:
parent
d650117dfb
commit
aa667f790e
|
@ -1789,7 +1789,7 @@ register_context_procs (GimpPDB *pdb)
|
||||||
gimp_procedure_set_static_strings (procedure,
|
gimp_procedure_set_static_strings (procedure,
|
||||||
"gimp-context-set-antialias",
|
"gimp-context-set-antialias",
|
||||||
"Set the antialias setting.",
|
"Set the antialias setting.",
|
||||||
"This procedure modifies the antialias setting. If antialiasing is turned on, the edges of selected region will contain intermediate values which give the appearance of a sharper, less pixelized edge. This should be set as TRUE most of the time unless a binary-only selection is wanted. This settings affects the following procedures: 'gimp-image-select-color', 'gimp-image-select-ellipse', 'gimp-image-select-polygon', 'gimp-image-select-fuzzy', 'gimp-image-select-round-rectangle', 'gimp-image-select-item'.",
|
"This procedure modifies the antialias setting. If antialiasing is turned on, the edges of selected region will contain intermediate values which give the appearance of a sharper, less pixelized edge. This should be set as TRUE most of the time unless a binary-only selection is wanted. This settings affects the following procedures: 'gimp-image-select-color', 'gimp-image-select-contiguous-color', 'gimp-image-select-round-rectangle', 'gimp-image-select-ellipse', 'gimp-image-select-polygon', 'gimp-image-select-item'.",
|
||||||
"Michael Natterer <mitch@gimp.org>",
|
"Michael Natterer <mitch@gimp.org>",
|
||||||
"Michael Natterer",
|
"Michael Natterer",
|
||||||
"2010",
|
"2010",
|
||||||
|
@ -1835,7 +1835,7 @@ register_context_procs (GimpPDB *pdb)
|
||||||
gimp_procedure_set_static_strings (procedure,
|
gimp_procedure_set_static_strings (procedure,
|
||||||
"gimp-context-set-feather",
|
"gimp-context-set-feather",
|
||||||
"Set the feather setting.",
|
"Set the feather setting.",
|
||||||
"This procedure modifies the feather setting. If the feather option is enabled, selections will be blurred before combining. The blur is a gaussian blur; its radii can be controlled using 'gimp-context-set-feather-radius'. This setting affects the following procedures: 'gimp-image-select-color', 'gimp-image-select-ellipse', 'gimp-image-select-polygon', 'gimp-image-select-fuzzy', 'gimp-image-select-rectangle', 'gimp-image-select-round-rectangle', 'gimp-image-select-item'.",
|
"This procedure modifies the feather setting. If the feather option is enabled, selections will be blurred before combining. The blur is a gaussian blur; its radii can be controlled using 'gimp-context-set-feather-radius'. This setting affects the following procedures: 'gimp-image-select-color', 'gimp-image-select-contiguous-color', 'gimp-image-select-rectangle', 'gimp-image-select-round-rectangle', 'gimp-image-select-ellipse', 'gimp-image-select-polygon', 'gimp-image-select-item'.",
|
||||||
"Michael Natterer <mitch@gimp.org>",
|
"Michael Natterer <mitch@gimp.org>",
|
||||||
"Michael Natterer",
|
"Michael Natterer",
|
||||||
"2010",
|
"2010",
|
||||||
|
@ -1939,7 +1939,7 @@ register_context_procs (GimpPDB *pdb)
|
||||||
gimp_procedure_set_static_strings (procedure,
|
gimp_procedure_set_static_strings (procedure,
|
||||||
"gimp-context-set-sample-merged",
|
"gimp-context-set-sample-merged",
|
||||||
"Set the sample merged setting.",
|
"Set the sample merged setting.",
|
||||||
"This procedure modifies the sample merged setting. If an operation depends on the colors of the pixels present in a drawable, like when doing a seed fill, this setting controls whether the pixel data from the specified drawable is used ('sample-merged' is FALSE), or the pixel data from the composite image ('sample-merged' is TRUE. This is equivalent to sampling for colors after merging all visible layers). This setting affects the following procedures: 'gimp-image-select-color', 'gimp-image-select-fuzzy'.",
|
"This procedure modifies the sample merged setting. If an operation depends on the colors of the pixels present in a drawable, like when doing a seed fill, this setting controls whether the pixel data from the specified drawable is used ('sample-merged' is FALSE), or the pixel data from the composite image ('sample-merged' is TRUE. This is equivalent to sampling for colors after merging all visible layers). This setting affects the following procedures: 'gimp-image-select-color', 'gimp-image-select-contiguous-color'.",
|
||||||
"Michael Natterer <mitch@gimp.org>",
|
"Michael Natterer <mitch@gimp.org>",
|
||||||
"Michael Natterer",
|
"Michael Natterer",
|
||||||
"2011",
|
"2011",
|
||||||
|
@ -1986,7 +1986,7 @@ register_context_procs (GimpPDB *pdb)
|
||||||
gimp_procedure_set_static_strings (procedure,
|
gimp_procedure_set_static_strings (procedure,
|
||||||
"gimp-context-set-sample-criterion",
|
"gimp-context-set-sample-criterion",
|
||||||
"Set the sample criterion setting.",
|
"Set the sample criterion setting.",
|
||||||
"This procedure modifies the sample criterion setting. If an operation depends on the colors of the pixels present in a drawable, like when doing a seed fill, this setting controls how color similarity is determined. SELECT_CRITERION_COMPOSITE is the default value. This setting affects the following procedures: 'gimp-image-select-color', 'gimp-image-select-fuzzy'.",
|
"This procedure modifies the sample criterion setting. If an operation depends on the colors of the pixels present in a drawable, like when doing a seed fill, this setting controls how color similarity is determined. SELECT_CRITERION_COMPOSITE is the default value. This setting affects the following procedures: 'gimp-image-select-color', 'gimp-image-select-contiguous-color'.",
|
||||||
"Michael Natterer <mitch@gimp.org>",
|
"Michael Natterer <mitch@gimp.org>",
|
||||||
"Michael Natterer",
|
"Michael Natterer",
|
||||||
"2011",
|
"2011",
|
||||||
|
@ -2033,7 +2033,7 @@ register_context_procs (GimpPDB *pdb)
|
||||||
gimp_procedure_set_static_strings (procedure,
|
gimp_procedure_set_static_strings (procedure,
|
||||||
"gimp-context-set-sample-threshold",
|
"gimp-context-set-sample-threshold",
|
||||||
"Set the sample threshold setting.",
|
"Set the sample threshold setting.",
|
||||||
"This procedure modifies the sample threshold setting. If an operation depends on the colors of the pixels present in a drawable, like when doing a seed fill, this setting controls what is \"sufficiently close\" to be considered a similar color. If the sample threshold has not been set explicitly, the default threshold set in gimprc will be used. This setting affects the following procedures: 'gimp-image-select-color', 'gimp-image-select-fuzzy'.",
|
"This procedure modifies the sample threshold setting. If an operation depends on the colors of the pixels present in a drawable, like when doing a seed fill, this setting controls what is \"sufficiently close\" to be considered a similar color. If the sample threshold has not been set explicitly, the default threshold set in gimprc will be used. This setting affects the following procedures: 'gimp-image-select-color', 'gimp-image-select-contiguous-color'.",
|
||||||
"Michael Natterer <mitch@gimp.org>",
|
"Michael Natterer <mitch@gimp.org>",
|
||||||
"Michael Natterer",
|
"Michael Natterer",
|
||||||
"2011",
|
"2011",
|
||||||
|
@ -2125,7 +2125,7 @@ register_context_procs (GimpPDB *pdb)
|
||||||
gimp_procedure_set_static_strings (procedure,
|
gimp_procedure_set_static_strings (procedure,
|
||||||
"gimp-context-set-sample-transparent",
|
"gimp-context-set-sample-transparent",
|
||||||
"Set the sample transparent setting.",
|
"Set the sample transparent setting.",
|
||||||
"This procedure modifies the sample transparent setting. If an operation depends on the colors of the pixels present in a drawable, like when doing a seed fill, this setting controls whether transparency is considered to be a unique selectable color. When this setting is TRUE, transparent areas can be selected or filled. This setting affects the following procedures: 'gimp-image-select-color', 'gimp-image-select-fuzzy'.",
|
"This procedure modifies the sample transparent setting. If an operation depends on the colors of the pixels present in a drawable, like when doing a seed fill, this setting controls whether transparency is considered to be a unique selectable color. When this setting is TRUE, transparent areas can be selected or filled. This setting affects the following procedures: 'gimp-image-select-color', 'gimp-image-select-contiguous-color'.",
|
||||||
"Michael Natterer <mitch@gimp.org>",
|
"Michael Natterer <mitch@gimp.org>",
|
||||||
"Michael Natterer",
|
"Michael Natterer",
|
||||||
"2011",
|
"2011",
|
||||||
|
|
|
@ -88,93 +88,12 @@ image_select_color_invoker (GimpProcedure *procedure,
|
||||||
}
|
}
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
image_select_ellipse_invoker (GimpProcedure *procedure,
|
image_select_contiguous_color_invoker (GimpProcedure *procedure,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
GimpProgress *progress,
|
GimpProgress *progress,
|
||||||
const GValueArray *args,
|
const GValueArray *args,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
|
||||||
gboolean success = TRUE;
|
|
||||||
GimpImage *image;
|
|
||||||
gint32 operation;
|
|
||||||
gdouble x;
|
|
||||||
gdouble y;
|
|
||||||
gdouble width;
|
|
||||||
gdouble height;
|
|
||||||
|
|
||||||
image = gimp_value_get_image (&args->values[0], gimp);
|
|
||||||
operation = g_value_get_enum (&args->values[1]);
|
|
||||||
x = g_value_get_double (&args->values[2]);
|
|
||||||
y = g_value_get_double (&args->values[3]);
|
|
||||||
width = g_value_get_double (&args->values[4]);
|
|
||||||
height = g_value_get_double (&args->values[5]);
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
static GValueArray *
|
|
||||||
image_select_polygon_invoker (GimpProcedure *procedure,
|
|
||||||
Gimp *gimp,
|
|
||||||
GimpContext *context,
|
|
||||||
GimpProgress *progress,
|
|
||||||
const GValueArray *args,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
gboolean success = TRUE;
|
|
||||||
GimpImage *image;
|
|
||||||
gint32 operation;
|
|
||||||
gint32 num_segs;
|
|
||||||
const gdouble *segs;
|
|
||||||
|
|
||||||
image = gimp_value_get_image (&args->values[0], gimp);
|
|
||||||
operation = g_value_get_enum (&args->values[1]);
|
|
||||||
num_segs = g_value_get_int (&args->values[2]);
|
|
||||||
segs = gimp_value_get_floatarray (&args->values[3]);
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
static GValueArray *
|
|
||||||
image_select_fuzzy_invoker (GimpProcedure *procedure,
|
|
||||||
Gimp *gimp,
|
|
||||||
GimpContext *context,
|
|
||||||
GimpProgress *progress,
|
|
||||||
const GValueArray *args,
|
|
||||||
GError **error)
|
|
||||||
{
|
{
|
||||||
gboolean success = TRUE;
|
gboolean success = TRUE;
|
||||||
GimpImage *image;
|
GimpImage *image;
|
||||||
|
@ -307,6 +226,87 @@ image_select_round_rectangle_invoker (GimpProcedure *procedure,
|
||||||
error ? *error : NULL);
|
error ? *error : NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GValueArray *
|
||||||
|
image_select_ellipse_invoker (GimpProcedure *procedure,
|
||||||
|
Gimp *gimp,
|
||||||
|
GimpContext *context,
|
||||||
|
GimpProgress *progress,
|
||||||
|
const GValueArray *args,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
gboolean success = TRUE;
|
||||||
|
GimpImage *image;
|
||||||
|
gint32 operation;
|
||||||
|
gdouble x;
|
||||||
|
gdouble y;
|
||||||
|
gdouble width;
|
||||||
|
gdouble height;
|
||||||
|
|
||||||
|
image = gimp_value_get_image (&args->values[0], gimp);
|
||||||
|
operation = g_value_get_enum (&args->values[1]);
|
||||||
|
x = g_value_get_double (&args->values[2]);
|
||||||
|
y = g_value_get_double (&args->values[3]);
|
||||||
|
width = g_value_get_double (&args->values[4]);
|
||||||
|
height = g_value_get_double (&args->values[5]);
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
static GValueArray *
|
||||||
|
image_select_polygon_invoker (GimpProcedure *procedure,
|
||||||
|
Gimp *gimp,
|
||||||
|
GimpContext *context,
|
||||||
|
GimpProgress *progress,
|
||||||
|
const GValueArray *args,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
gboolean success = TRUE;
|
||||||
|
GimpImage *image;
|
||||||
|
gint32 operation;
|
||||||
|
gint32 num_segs;
|
||||||
|
const gdouble *segs;
|
||||||
|
|
||||||
|
image = gimp_value_get_image (&args->values[0], gimp);
|
||||||
|
operation = g_value_get_enum (&args->values[1]);
|
||||||
|
num_segs = g_value_get_int (&args->values[2]);
|
||||||
|
segs = gimp_value_get_floatarray (&args->values[3]);
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
static GValueArray *
|
static GValueArray *
|
||||||
image_select_item_invoker (GimpProcedure *procedure,
|
image_select_item_invoker (GimpProcedure *procedure,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
|
@ -393,111 +393,16 @@ register_image_select_procs (GimpPDB *pdb)
|
||||||
g_object_unref (procedure);
|
g_object_unref (procedure);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gimp-image-select-ellipse
|
* gimp-image-select-contiguous-color
|
||||||
*/
|
*/
|
||||||
procedure = gimp_procedure_new (image_select_ellipse_invoker);
|
procedure = gimp_procedure_new (image_select_contiguous_color_invoker);
|
||||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||||
"gimp-image-select-ellipse");
|
"gimp-image-select-contiguous-color");
|
||||||
gimp_procedure_set_static_strings (procedure,
|
gimp_procedure_set_static_strings (procedure,
|
||||||
"gimp-image-select-ellipse",
|
"gimp-image-select-contiguous-color",
|
||||||
"Create an elliptical selection over the specified image.",
|
"Create a selection by selecting all pixels around specified coordinates with the same (or similar) color to that at the coordinates.",
|
||||||
"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. This prodecure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius'.",
|
"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. This prodecure 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'. In the case of a merged"
|
||||||
"Michael Natterer <mitch@gimp.org>",
|
"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.",
|
||||||
"Michael Natterer",
|
|
||||||
"2010",
|
|
||||||
NULL);
|
|
||||||
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_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
|
|
||||||
*/
|
|
||||||
procedure = gimp_procedure_new (image_select_polygon_invoker);
|
|
||||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
||||||
"gimp-image-select-polygon");
|
|
||||||
gimp_procedure_set_static_strings (procedure,
|
|
||||||
"gimp-image-select-polygon",
|
|
||||||
"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. This prodecure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius'.",
|
|
||||||
"Michael Natterer <mitch@gimp.org>",
|
|
||||||
"Michael Natterer",
|
|
||||||
"2010",
|
|
||||||
NULL);
|
|
||||||
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_enum ("operation",
|
|
||||||
"operation",
|
|
||||||
"The selection operation",
|
|
||||||
GIMP_TYPE_CHANNEL_OPS,
|
|
||||||
GIMP_CHANNEL_OP_ADD,
|
|
||||||
GIMP_PARAM_READWRITE));
|
|
||||||
gimp_procedure_add_argument (procedure,
|
|
||||||
gimp_param_spec_int32 ("num-segs",
|
|
||||||
"num segs",
|
|
||||||
"Number of points (count 1 coordinate as two points)",
|
|
||||||
2, G_MAXINT32, 2,
|
|
||||||
GIMP_PARAM_READWRITE));
|
|
||||||
gimp_procedure_add_argument (procedure,
|
|
||||||
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_pdb_register_procedure (pdb, procedure);
|
|
||||||
g_object_unref (procedure);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* gimp-image-select-fuzzy
|
|
||||||
*/
|
|
||||||
procedure = gimp_procedure_new (image_select_fuzzy_invoker);
|
|
||||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
||||||
"gimp-image-select-fuzzy");
|
|
||||||
gimp_procedure_set_static_strings (procedure,
|
|
||||||
"gimp-image-select-fuzzy",
|
|
||||||
"Create a fuzzy selection starting at the specified coordinates on the specified drawable.",
|
|
||||||
"This tool creates a fuzzy selection over the specified image. A fuzzy 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. This prodecure 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'. 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.",
|
|
||||||
"David Gowers",
|
"David Gowers",
|
||||||
"David Gowers",
|
"David Gowers",
|
||||||
"2010",
|
"2010",
|
||||||
|
@ -656,6 +561,101 @@ register_image_select_procs (GimpPDB *pdb)
|
||||||
gimp_pdb_register_procedure (pdb, procedure);
|
gimp_pdb_register_procedure (pdb, procedure);
|
||||||
g_object_unref (procedure);
|
g_object_unref (procedure);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* gimp-image-select-ellipse
|
||||||
|
*/
|
||||||
|
procedure = gimp_procedure_new (image_select_ellipse_invoker);
|
||||||
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||||
|
"gimp-image-select-ellipse");
|
||||||
|
gimp_procedure_set_static_strings (procedure,
|
||||||
|
"gimp-image-select-ellipse",
|
||||||
|
"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. This prodecure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius'.",
|
||||||
|
"Michael Natterer <mitch@gimp.org>",
|
||||||
|
"Michael Natterer",
|
||||||
|
"2010",
|
||||||
|
NULL);
|
||||||
|
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_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
|
||||||
|
*/
|
||||||
|
procedure = gimp_procedure_new (image_select_polygon_invoker);
|
||||||
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||||
|
"gimp-image-select-polygon");
|
||||||
|
gimp_procedure_set_static_strings (procedure,
|
||||||
|
"gimp-image-select-polygon",
|
||||||
|
"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. This prodecure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius'.",
|
||||||
|
"Michael Natterer <mitch@gimp.org>",
|
||||||
|
"Michael Natterer",
|
||||||
|
"2010",
|
||||||
|
NULL);
|
||||||
|
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_enum ("operation",
|
||||||
|
"operation",
|
||||||
|
"The selection operation",
|
||||||
|
GIMP_TYPE_CHANNEL_OPS,
|
||||||
|
GIMP_CHANNEL_OP_ADD,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
gimp_procedure_add_argument (procedure,
|
||||||
|
gimp_param_spec_int32 ("num-segs",
|
||||||
|
"num segs",
|
||||||
|
"Number of points (count 1 coordinate as two points)",
|
||||||
|
2, G_MAXINT32, 2,
|
||||||
|
GIMP_PARAM_READWRITE));
|
||||||
|
gimp_procedure_add_argument (procedure,
|
||||||
|
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_pdb_register_procedure (pdb, procedure);
|
||||||
|
g_object_unref (procedure);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gimp-image-select-item
|
* gimp-image-select-item
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -731,12 +731,12 @@ register_selection_tools_procs (GimpPDB *pdb)
|
||||||
"gimp-fuzzy-select");
|
"gimp-fuzzy-select");
|
||||||
gimp_procedure_set_static_strings (procedure,
|
gimp_procedure_set_static_strings (procedure,
|
||||||
"gimp-fuzzy-select",
|
"gimp-fuzzy-select",
|
||||||
"Deprecated: Use 'gimp-image-select-fuzzy' instead.",
|
"Deprecated: Use 'gimp-image-select-contiguous-color' instead.",
|
||||||
"Deprecated: Use 'gimp-image-select-fuzzy' instead.",
|
"Deprecated: Use 'gimp-image-select-contiguous-color' instead.",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"gimp-image-select-fuzzy");
|
"gimp-image-select-contiguous-color");
|
||||||
gimp_procedure_add_argument (procedure,
|
gimp_procedure_add_argument (procedure,
|
||||||
gimp_param_spec_drawable_id ("drawable",
|
gimp_param_spec_drawable_id ("drawable",
|
||||||
"drawable",
|
"drawable",
|
||||||
|
@ -803,12 +803,12 @@ register_selection_tools_procs (GimpPDB *pdb)
|
||||||
"gimp-fuzzy-select-full");
|
"gimp-fuzzy-select-full");
|
||||||
gimp_procedure_set_static_strings (procedure,
|
gimp_procedure_set_static_strings (procedure,
|
||||||
"gimp-fuzzy-select-full",
|
"gimp-fuzzy-select-full",
|
||||||
"Deprecated: Use 'gimp-image-select-fuzzy' instead.",
|
"Deprecated: Use 'gimp-image-select-contiguous-color' instead.",
|
||||||
"Deprecated: Use 'gimp-image-select-fuzzy' instead.",
|
"Deprecated: Use 'gimp-image-select-contiguous-color' instead.",
|
||||||
"David Gowers",
|
"David Gowers",
|
||||||
"David Gowers",
|
"David Gowers",
|
||||||
"2006",
|
"2006",
|
||||||
"gimp-image-select-fuzzy");
|
"gimp-image-select-contiguous-color");
|
||||||
gimp_procedure_add_argument (procedure,
|
gimp_procedure_add_argument (procedure,
|
||||||
gimp_param_spec_drawable_id ("drawable",
|
gimp_param_spec_drawable_id ("drawable",
|
||||||
"drawable",
|
"drawable",
|
||||||
|
|
|
@ -418,8 +418,8 @@ EXPORTS
|
||||||
gimp_image_scale
|
gimp_image_scale
|
||||||
gimp_image_scale_full
|
gimp_image_scale_full
|
||||||
gimp_image_select_color
|
gimp_image_select_color
|
||||||
|
gimp_image_select_contiguous_color
|
||||||
gimp_image_select_ellipse
|
gimp_image_select_ellipse
|
||||||
gimp_image_select_fuzzy
|
|
||||||
gimp_image_select_item
|
gimp_image_select_item
|
||||||
gimp_image_select_polygon
|
gimp_image_select_polygon
|
||||||
gimp_image_select_rectangle
|
gimp_image_select_rectangle
|
||||||
|
|
|
@ -907,9 +907,9 @@ gimp_context_get_antialias (void)
|
||||||
* values which give the appearance of a sharper, less pixelized edge.
|
* values which give the appearance of a sharper, less pixelized edge.
|
||||||
* This should be set as TRUE most of the time unless a binary-only
|
* This should be set as TRUE most of the time unless a binary-only
|
||||||
* selection is wanted. This settings affects the following procedures:
|
* selection is wanted. This settings affects the following procedures:
|
||||||
* gimp_image_select_color(), gimp_image_select_ellipse(),
|
* gimp_image_select_color(), gimp_image_select_contiguous_color(),
|
||||||
* gimp_image_select_polygon(), gimp_image_select_fuzzy(),
|
* gimp_image_select_round_rectangle(), gimp_image_select_ellipse(),
|
||||||
* gimp_image_select_round_rectangle(), gimp_image_select_item().
|
* gimp_image_select_polygon(), gimp_image_select_item().
|
||||||
*
|
*
|
||||||
* Returns: TRUE on success.
|
* Returns: TRUE on success.
|
||||||
*
|
*
|
||||||
|
@ -975,9 +975,9 @@ gimp_context_get_feather (void)
|
||||||
* a gaussian blur; its radii can be controlled using
|
* a gaussian blur; its radii can be controlled using
|
||||||
* gimp_context_set_feather_radius(). This setting affects the
|
* gimp_context_set_feather_radius(). This setting affects the
|
||||||
* following procedures: gimp_image_select_color(),
|
* following procedures: gimp_image_select_color(),
|
||||||
* gimp_image_select_ellipse(), gimp_image_select_polygon(),
|
* gimp_image_select_contiguous_color(), gimp_image_select_rectangle(),
|
||||||
* gimp_image_select_fuzzy(), gimp_image_select_rectangle(),
|
* gimp_image_select_round_rectangle(), gimp_image_select_ellipse(),
|
||||||
* gimp_image_select_round_rectangle(), gimp_image_select_item().
|
* gimp_image_select_polygon(), gimp_image_select_item().
|
||||||
*
|
*
|
||||||
* Returns: TRUE on success.
|
* Returns: TRUE on success.
|
||||||
*
|
*
|
||||||
|
@ -1122,7 +1122,7 @@ gimp_context_get_sample_merged (void)
|
||||||
* pixel data from the composite image ('sample-merged' is TRUE. This
|
* pixel data from the composite image ('sample-merged' is TRUE. This
|
||||||
* is equivalent to sampling for colors after merging all visible
|
* is equivalent to sampling for colors after merging all visible
|
||||||
* layers). This setting affects the following procedures:
|
* layers). This setting affects the following procedures:
|
||||||
* gimp_image_select_color(), gimp_image_select_fuzzy().
|
* gimp_image_select_color(), gimp_image_select_contiguous_color().
|
||||||
*
|
*
|
||||||
* Returns: TRUE on success.
|
* Returns: TRUE on success.
|
||||||
*
|
*
|
||||||
|
@ -1188,7 +1188,7 @@ gimp_context_get_sample_criterion (void)
|
||||||
* like when doing a seed fill, this setting controls how color
|
* like when doing a seed fill, this setting controls how color
|
||||||
* similarity is determined. SELECT_CRITERION_COMPOSITE is the default
|
* similarity is determined. SELECT_CRITERION_COMPOSITE is the default
|
||||||
* value. This setting affects the following procedures:
|
* value. This setting affects the following procedures:
|
||||||
* gimp_image_select_color(), gimp_image_select_fuzzy().
|
* gimp_image_select_color(), gimp_image_select_contiguous_color().
|
||||||
*
|
*
|
||||||
* Returns: TRUE on success.
|
* Returns: TRUE on success.
|
||||||
*
|
*
|
||||||
|
@ -1255,7 +1255,8 @@ gimp_context_get_sample_threshold (void)
|
||||||
* \"sufficiently close\" to be considered a similar color. If the
|
* \"sufficiently close\" to be considered a similar color. If the
|
||||||
* sample threshold has not been set explicitly, the default threshold
|
* sample threshold has not been set explicitly, the default threshold
|
||||||
* set in gimprc will be used. This setting affects the following
|
* set in gimprc will be used. This setting affects the following
|
||||||
* procedures: gimp_image_select_color(), gimp_image_select_fuzzy().
|
* procedures: gimp_image_select_color(),
|
||||||
|
* gimp_image_select_contiguous_color().
|
||||||
*
|
*
|
||||||
* Returns: TRUE on success.
|
* Returns: TRUE on success.
|
||||||
*
|
*
|
||||||
|
@ -1385,7 +1386,7 @@ gimp_context_get_sample_transparent (void)
|
||||||
* transparency is considered to be a unique selectable color. When
|
* transparency is considered to be a unique selectable color. When
|
||||||
* this setting is TRUE, transparent areas can be selected or filled.
|
* this setting is TRUE, transparent areas can be selected or filled.
|
||||||
* This setting affects the following procedures:
|
* This setting affects the following procedures:
|
||||||
* gimp_image_select_color(), gimp_image_select_fuzzy().
|
* gimp_image_select_color(), gimp_image_select_contiguous_color().
|
||||||
*
|
*
|
||||||
* Returns: TRUE on success.
|
* Returns: TRUE on success.
|
||||||
*
|
*
|
||||||
|
|
|
@ -89,121 +89,21 @@ gimp_image_select_color (gint32 image_ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_image_select_ellipse:
|
* gimp_image_select_contiguous_color:
|
||||||
* @image_ID: The image.
|
|
||||||
* @operation: The selection operation.
|
|
||||||
* @x: x coordinate of upper-left corner of ellipse bounding box.
|
|
||||||
* @y: y coordinate of upper-left corner of ellipse bounding box.
|
|
||||||
* @width: The width of the ellipse.
|
|
||||||
* @height: The height of the ellipse.
|
|
||||||
*
|
|
||||||
* 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. This prodecure
|
|
||||||
* is affected by the following context setters:
|
|
||||||
* gimp_context_set_antialias(), gimp_context_set_feather(),
|
|
||||||
* gimp_context_set_feather_radius().
|
|
||||||
*
|
|
||||||
* Returns: TRUE on success.
|
|
||||||
*
|
|
||||||
* Since: GIMP 2.8
|
|
||||||
**/
|
|
||||||
gboolean
|
|
||||||
gimp_image_select_ellipse (gint32 image_ID,
|
|
||||||
GimpChannelOps operation,
|
|
||||||
gdouble x,
|
|
||||||
gdouble y,
|
|
||||||
gdouble width,
|
|
||||||
gdouble height)
|
|
||||||
{
|
|
||||||
GimpParam *return_vals;
|
|
||||||
gint nreturn_vals;
|
|
||||||
gboolean success = TRUE;
|
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp-image-select-ellipse",
|
|
||||||
&nreturn_vals,
|
|
||||||
GIMP_PDB_IMAGE, image_ID,
|
|
||||||
GIMP_PDB_INT32, operation,
|
|
||||||
GIMP_PDB_FLOAT, x,
|
|
||||||
GIMP_PDB_FLOAT, y,
|
|
||||||
GIMP_PDB_FLOAT, width,
|
|
||||||
GIMP_PDB_FLOAT, height,
|
|
||||||
GIMP_PDB_END);
|
|
||||||
|
|
||||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
|
||||||
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gimp_image_select_polygon:
|
|
||||||
* @image_ID: The image.
|
|
||||||
* @operation: The selection operation.
|
|
||||||
* @num_segs: Number of points (count 1 coordinate as two points).
|
|
||||||
* @segs: Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y}.
|
|
||||||
*
|
|
||||||
* 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. This
|
|
||||||
* prodecure is affected by the following context setters:
|
|
||||||
* gimp_context_set_antialias(), gimp_context_set_feather(),
|
|
||||||
* gimp_context_set_feather_radius().
|
|
||||||
*
|
|
||||||
* Returns: TRUE on success.
|
|
||||||
*
|
|
||||||
* Since: GIMP 2.8
|
|
||||||
**/
|
|
||||||
gboolean
|
|
||||||
gimp_image_select_polygon (gint32 image_ID,
|
|
||||||
GimpChannelOps operation,
|
|
||||||
gint num_segs,
|
|
||||||
const gdouble *segs)
|
|
||||||
{
|
|
||||||
GimpParam *return_vals;
|
|
||||||
gint nreturn_vals;
|
|
||||||
gboolean success = TRUE;
|
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp-image-select-polygon",
|
|
||||||
&nreturn_vals,
|
|
||||||
GIMP_PDB_IMAGE, image_ID,
|
|
||||||
GIMP_PDB_INT32, operation,
|
|
||||||
GIMP_PDB_INT32, num_segs,
|
|
||||||
GIMP_PDB_FLOATARRAY, segs,
|
|
||||||
GIMP_PDB_END);
|
|
||||||
|
|
||||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
||||||
|
|
||||||
gimp_destroy_params (return_vals, nreturn_vals);
|
|
||||||
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gimp_image_select_fuzzy:
|
|
||||||
* @image_ID: The affected image.
|
* @image_ID: The affected image.
|
||||||
* @operation: The selection operation.
|
* @operation: The selection operation.
|
||||||
* @drawable_ID: The affected drawable.
|
* @drawable_ID: The affected drawable.
|
||||||
* @x: x coordinate of initial seed fill point: (image coordinates).
|
* @x: x coordinate of initial seed fill point: (image coordinates).
|
||||||
* @y: y coordinate of initial seed fill point: (image coordinates).
|
* @y: y coordinate of initial seed fill point: (image coordinates).
|
||||||
*
|
*
|
||||||
* Create a fuzzy selection starting at the specified coordinates on
|
* Create a selection by selecting all pixels around specified
|
||||||
* the specified drawable.
|
* coordinates with the same (or similar) color to that at the
|
||||||
|
* coordinates.
|
||||||
*
|
*
|
||||||
* This tool creates a fuzzy selection over the specified image. A
|
* This tool creates a contiguous selection over the specified image. A
|
||||||
* fuzzy selection is determined by a seed fill under the constraints
|
* contiguous color selection is determined by a seed fill under the
|
||||||
* of the current context settings. Essentially, the color at the
|
* constraints of the current context settings. Essentially, the color
|
||||||
* specified coordinates (in the drawable) is measured and the
|
* at the specified coordinates (in the drawable) is measured and the
|
||||||
* selection expands outwards from that point to any adjacent pixels
|
* selection expands outwards from that point to any adjacent pixels
|
||||||
* which are not significantly different (as determined by the
|
* which are not significantly different (as determined by the
|
||||||
* threshold and criterion context settings). This process continues
|
* threshold and criterion context settings). This process continues
|
||||||
|
@ -225,17 +125,17 @@ gimp_image_select_polygon (gint32 image_ID,
|
||||||
* Since: GIMP 2.8
|
* Since: GIMP 2.8
|
||||||
**/
|
**/
|
||||||
gboolean
|
gboolean
|
||||||
gimp_image_select_fuzzy (gint32 image_ID,
|
gimp_image_select_contiguous_color (gint32 image_ID,
|
||||||
GimpChannelOps operation,
|
GimpChannelOps operation,
|
||||||
gint32 drawable_ID,
|
gint32 drawable_ID,
|
||||||
gdouble x,
|
gdouble x,
|
||||||
gdouble y)
|
gdouble y)
|
||||||
{
|
{
|
||||||
GimpParam *return_vals;
|
GimpParam *return_vals;
|
||||||
gint nreturn_vals;
|
gint nreturn_vals;
|
||||||
gboolean success = TRUE;
|
gboolean success = TRUE;
|
||||||
|
|
||||||
return_vals = gimp_run_procedure ("gimp-image-select-fuzzy",
|
return_vals = gimp_run_procedure ("gimp-image-select-contiguous-color",
|
||||||
&nreturn_vals,
|
&nreturn_vals,
|
||||||
GIMP_PDB_IMAGE, image_ID,
|
GIMP_PDB_IMAGE, image_ID,
|
||||||
GIMP_PDB_INT32, operation,
|
GIMP_PDB_INT32, operation,
|
||||||
|
@ -359,6 +259,107 @@ gimp_image_select_round_rectangle (gint32 image_ID,
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gimp_image_select_ellipse:
|
||||||
|
* @image_ID: The image.
|
||||||
|
* @operation: The selection operation.
|
||||||
|
* @x: x coordinate of upper-left corner of ellipse bounding box.
|
||||||
|
* @y: y coordinate of upper-left corner of ellipse bounding box.
|
||||||
|
* @width: The width of the ellipse.
|
||||||
|
* @height: The height of the ellipse.
|
||||||
|
*
|
||||||
|
* 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. This prodecure
|
||||||
|
* is affected by the following context setters:
|
||||||
|
* gimp_context_set_antialias(), gimp_context_set_feather(),
|
||||||
|
* gimp_context_set_feather_radius().
|
||||||
|
*
|
||||||
|
* Returns: TRUE on success.
|
||||||
|
*
|
||||||
|
* Since: GIMP 2.8
|
||||||
|
**/
|
||||||
|
gboolean
|
||||||
|
gimp_image_select_ellipse (gint32 image_ID,
|
||||||
|
GimpChannelOps operation,
|
||||||
|
gdouble x,
|
||||||
|
gdouble y,
|
||||||
|
gdouble width,
|
||||||
|
gdouble height)
|
||||||
|
{
|
||||||
|
GimpParam *return_vals;
|
||||||
|
gint nreturn_vals;
|
||||||
|
gboolean success = TRUE;
|
||||||
|
|
||||||
|
return_vals = gimp_run_procedure ("gimp-image-select-ellipse",
|
||||||
|
&nreturn_vals,
|
||||||
|
GIMP_PDB_IMAGE, image_ID,
|
||||||
|
GIMP_PDB_INT32, operation,
|
||||||
|
GIMP_PDB_FLOAT, x,
|
||||||
|
GIMP_PDB_FLOAT, y,
|
||||||
|
GIMP_PDB_FLOAT, width,
|
||||||
|
GIMP_PDB_FLOAT, height,
|
||||||
|
GIMP_PDB_END);
|
||||||
|
|
||||||
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||||
|
|
||||||
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
|
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gimp_image_select_polygon:
|
||||||
|
* @image_ID: The image.
|
||||||
|
* @operation: The selection operation.
|
||||||
|
* @num_segs: Number of points (count 1 coordinate as two points).
|
||||||
|
* @segs: Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y}.
|
||||||
|
*
|
||||||
|
* 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. This
|
||||||
|
* prodecure is affected by the following context setters:
|
||||||
|
* gimp_context_set_antialias(), gimp_context_set_feather(),
|
||||||
|
* gimp_context_set_feather_radius().
|
||||||
|
*
|
||||||
|
* Returns: TRUE on success.
|
||||||
|
*
|
||||||
|
* Since: GIMP 2.8
|
||||||
|
**/
|
||||||
|
gboolean
|
||||||
|
gimp_image_select_polygon (gint32 image_ID,
|
||||||
|
GimpChannelOps operation,
|
||||||
|
gint num_segs,
|
||||||
|
const gdouble *segs)
|
||||||
|
{
|
||||||
|
GimpParam *return_vals;
|
||||||
|
gint nreturn_vals;
|
||||||
|
gboolean success = TRUE;
|
||||||
|
|
||||||
|
return_vals = gimp_run_procedure ("gimp-image-select-polygon",
|
||||||
|
&nreturn_vals,
|
||||||
|
GIMP_PDB_IMAGE, image_ID,
|
||||||
|
GIMP_PDB_INT32, operation,
|
||||||
|
GIMP_PDB_INT32, num_segs,
|
||||||
|
GIMP_PDB_FLOATARRAY, segs,
|
||||||
|
GIMP_PDB_END);
|
||||||
|
|
||||||
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||||
|
|
||||||
|
gimp_destroy_params (return_vals, nreturn_vals);
|
||||||
|
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_image_select_item:
|
* gimp_image_select_item:
|
||||||
* @image_ID: The image.
|
* @image_ID: The image.
|
||||||
|
|
|
@ -28,42 +28,42 @@ G_BEGIN_DECLS
|
||||||
/* For information look into the C source or the html documentation */
|
/* For information look into the C source or the html documentation */
|
||||||
|
|
||||||
|
|
||||||
gboolean gimp_image_select_color (gint32 image_ID,
|
gboolean gimp_image_select_color (gint32 image_ID,
|
||||||
GimpChannelOps operation,
|
GimpChannelOps operation,
|
||||||
gint32 drawable_ID,
|
gint32 drawable_ID,
|
||||||
const GimpRGB *color);
|
const GimpRGB *color);
|
||||||
gboolean gimp_image_select_ellipse (gint32 image_ID,
|
gboolean gimp_image_select_contiguous_color (gint32 image_ID,
|
||||||
GimpChannelOps operation,
|
GimpChannelOps operation,
|
||||||
gdouble x,
|
gint32 drawable_ID,
|
||||||
gdouble y,
|
gdouble x,
|
||||||
gdouble width,
|
gdouble y);
|
||||||
gdouble height);
|
gboolean gimp_image_select_rectangle (gint32 image_ID,
|
||||||
gboolean gimp_image_select_polygon (gint32 image_ID,
|
GimpChannelOps operation,
|
||||||
GimpChannelOps operation,
|
gdouble x,
|
||||||
gint num_segs,
|
gdouble y,
|
||||||
const gdouble *segs);
|
gdouble width,
|
||||||
gboolean gimp_image_select_fuzzy (gint32 image_ID,
|
gdouble height);
|
||||||
GimpChannelOps operation,
|
gboolean gimp_image_select_round_rectangle (gint32 image_ID,
|
||||||
gint32 drawable_ID,
|
GimpChannelOps operation,
|
||||||
gdouble x,
|
gdouble x,
|
||||||
gdouble y);
|
gdouble y,
|
||||||
gboolean gimp_image_select_rectangle (gint32 image_ID,
|
gdouble width,
|
||||||
GimpChannelOps operation,
|
gdouble height,
|
||||||
gdouble x,
|
gdouble corner_radius_x,
|
||||||
gdouble y,
|
gdouble corner_radius_y);
|
||||||
gdouble width,
|
gboolean gimp_image_select_ellipse (gint32 image_ID,
|
||||||
gdouble height);
|
GimpChannelOps operation,
|
||||||
gboolean gimp_image_select_round_rectangle (gint32 image_ID,
|
gdouble x,
|
||||||
GimpChannelOps operation,
|
gdouble y,
|
||||||
gdouble x,
|
gdouble width,
|
||||||
gdouble y,
|
gdouble height);
|
||||||
gdouble width,
|
gboolean gimp_image_select_polygon (gint32 image_ID,
|
||||||
gdouble height,
|
GimpChannelOps operation,
|
||||||
gdouble corner_radius_x,
|
gint num_segs,
|
||||||
gdouble corner_radius_y);
|
const gdouble *segs);
|
||||||
gboolean gimp_image_select_item (gint32 image_ID,
|
gboolean gimp_image_select_item (gint32 image_ID,
|
||||||
GimpChannelOps operation,
|
GimpChannelOps operation,
|
||||||
gint32 item_ID);
|
gint32 item_ID);
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
@ -252,7 +252,7 @@ gimp_free_select (gint32 image_ID,
|
||||||
* @feather_radius: Radius for feather operation.
|
* @feather_radius: Radius for feather operation.
|
||||||
* @sample_merged: Use the composite image, not the drawable.
|
* @sample_merged: Use the composite image, not the drawable.
|
||||||
*
|
*
|
||||||
* Deprecated: Use gimp_image_select_fuzzy() instead.
|
* Deprecated: Use gimp_image_select_contiguous_color() instead.
|
||||||
*
|
*
|
||||||
* Returns: TRUE on success.
|
* Returns: TRUE on success.
|
||||||
**/
|
**/
|
||||||
|
@ -306,7 +306,7 @@ gimp_fuzzy_select (gint32 drawable_ID,
|
||||||
* @select_transparent: Whether to consider transparent pixels for selection. If TRUE, transparency is considered as a unique selectable color.
|
* @select_transparent: Whether to consider transparent pixels for selection. If TRUE, transparency is considered as a unique selectable color.
|
||||||
* @select_criterion: The criterion used to determine color similarity. SELECT_CRITERION_COMPOSITE is the standard choice.
|
* @select_criterion: The criterion used to determine color similarity. SELECT_CRITERION_COMPOSITE is the standard choice.
|
||||||
*
|
*
|
||||||
* Deprecated: Use gimp_image_select_fuzzy() instead.
|
* Deprecated: Use gimp_image_select_contiguous_color() instead.
|
||||||
*
|
*
|
||||||
* Returns: TRUE on success.
|
* Returns: TRUE on success.
|
||||||
*
|
*
|
||||||
|
|
|
@ -741,9 +741,9 @@ This should be set as TRUE most of the time unless a binary-only
|
||||||
selection is wanted.
|
selection is wanted.
|
||||||
|
|
||||||
This settings affects the following procedures:
|
This settings affects the following procedures:
|
||||||
gimp_image_select_color(), gimp_image_select_ellipse(),
|
gimp_image_select_color(), gimp_image_select_contiguous_color(),
|
||||||
gimp_image_select_polygon(), gimp_image_select_fuzzy(),
|
gimp_image_select_round_rectangle(), gimp_image_select_ellipse(),
|
||||||
gimp_image_select_round_rectangle(), gimp_image_select_item().
|
gimp_image_select_polygon(), gimp_image_select_item().
|
||||||
HELP
|
HELP
|
||||||
|
|
||||||
&mitch_pdb_misc('2010', '2.8');
|
&mitch_pdb_misc('2010', '2.8');
|
||||||
|
@ -799,9 +799,9 @@ gaussian blur; its radii can be controlled using
|
||||||
gimp_context_set_feather_radius().
|
gimp_context_set_feather_radius().
|
||||||
|
|
||||||
This setting affects the following procedures:
|
This setting affects the following procedures:
|
||||||
gimp_image_select_color(), gimp_image_select_ellipse(),
|
gimp_image_select_color(), gimp_image_select_contiguous_color(),
|
||||||
gimp_image_select_polygon(), gimp_image_select_fuzzy(),
|
|
||||||
gimp_image_select_rectangle(), gimp_image_select_round_rectangle(),
|
gimp_image_select_rectangle(), gimp_image_select_round_rectangle(),
|
||||||
|
gimp_image_select_ellipse(), gimp_image_select_polygon(),
|
||||||
gimp_image_select_item().
|
gimp_image_select_item().
|
||||||
HELP
|
HELP
|
||||||
|
|
||||||
|
@ -919,7 +919,7 @@ pixel data from the composite image ('sample-merged' is TRUE. This is
|
||||||
equivalent to sampling for colors after merging all visible layers).
|
equivalent to sampling for colors after merging all visible layers).
|
||||||
|
|
||||||
This setting affects the following procedures:
|
This setting affects the following procedures:
|
||||||
gimp_image_select_color(), gimp_image_select_fuzzy().
|
gimp_image_select_color(), gimp_image_select_contiguous_color().
|
||||||
HELP
|
HELP
|
||||||
|
|
||||||
&mitch_pdb_misc('2011', '2.8');
|
&mitch_pdb_misc('2011', '2.8');
|
||||||
|
@ -975,7 +975,7 @@ doing a seed fill, this setting controls how color similarity is
|
||||||
determined. SELECT_CRITERION_COMPOSITE is the default value.
|
determined. SELECT_CRITERION_COMPOSITE is the default value.
|
||||||
|
|
||||||
This setting affects the following procedures:
|
This setting affects the following procedures:
|
||||||
gimp_image_select_color(), gimp_image_select_fuzzy().
|
gimp_image_select_color(), gimp_image_select_contiguous_color().
|
||||||
HELP
|
HELP
|
||||||
|
|
||||||
&mitch_pdb_misc('2011', '2.8');
|
&mitch_pdb_misc('2011', '2.8');
|
||||||
|
@ -1033,7 +1033,7 @@ to be considered a similar color. If the sample threshold has not been
|
||||||
set explicitly, the default threshold set in gimprc will be used.
|
set explicitly, the default threshold set in gimprc will be used.
|
||||||
|
|
||||||
This setting affects the following procedures:
|
This setting affects the following procedures:
|
||||||
gimp_image_select_color(), gimp_image_select_fuzzy().
|
gimp_image_select_color(), gimp_image_select_contiguous_color().
|
||||||
|
|
||||||
HELP
|
HELP
|
||||||
|
|
||||||
|
@ -1148,7 +1148,7 @@ transparency is considered to be a unique selectable color. When this
|
||||||
setting is TRUE, transparent areas can be selected or filled.
|
setting is TRUE, transparent areas can be selected or filled.
|
||||||
|
|
||||||
This setting affects the following procedures:
|
This setting affects the following procedures:
|
||||||
gimp_image_select_color(), gimp_image_select_fuzzy().
|
gimp_image_select_color(), gimp_image_select_contiguous_color().
|
||||||
HELP
|
HELP
|
||||||
|
|
||||||
&mitch_pdb_misc('2011', '2.8');
|
&mitch_pdb_misc('2011', '2.8');
|
||||||
|
|
|
@ -81,127 +81,23 @@ CODE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub image_select_ellipse {
|
sub image_select_contiguous_color {
|
||||||
$blurb = 'Create an elliptical selection over the specified image.';
|
|
||||||
|
|
||||||
$help = <<'HELP';
|
|
||||||
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.
|
|
||||||
|
|
||||||
This prodecure is affected by the following context setters:
|
|
||||||
gimp_context_set_antialias(), gimp_context_set_feather(),
|
|
||||||
gimp_context_set_feather_radius().
|
|
||||||
HELP
|
|
||||||
|
|
||||||
&mitch_pdb_misc('2010', '2.8');
|
|
||||||
|
|
||||||
@inargs = (
|
|
||||||
{ name => 'image', type => 'image',
|
|
||||||
desc => 'The image' },
|
|
||||||
{ name => 'operation', type => 'enum GimpChannelOps',
|
|
||||||
desc => 'The selection operation' },
|
|
||||||
{ 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',
|
|
||||||
desc => 'The width of the ellipse' },
|
|
||||||
{ name => 'height', type => '0 < float',
|
|
||||||
desc => 'The height of the ellipse' }
|
|
||||||
);
|
|
||||||
|
|
||||||
%invoke = (
|
|
||||||
code => <<'CODE'
|
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
CODE
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub image_select_polygon {
|
|
||||||
$blurb = 'Create a polygonal selection over the specified image.';
|
|
||||||
|
|
||||||
$help = <<'HELP';
|
|
||||||
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.
|
|
||||||
|
|
||||||
This prodecure is affected by the following context setters:
|
|
||||||
gimp_context_set_antialias(), gimp_context_set_feather(),
|
|
||||||
gimp_context_set_feather_radius().
|
|
||||||
HELP
|
|
||||||
|
|
||||||
&mitch_pdb_misc('2010', '2.8');
|
|
||||||
|
|
||||||
@inargs = (
|
|
||||||
{ name => 'image', type => 'image',
|
|
||||||
desc => 'The image' },
|
|
||||||
{ name => 'operation', type => 'enum GimpChannelOps',
|
|
||||||
desc => 'The selection operation' },
|
|
||||||
{ name => 'segs', type => 'floatarray',
|
|
||||||
desc => 'Array of points: { p1.x, p1.y, p2.x, p2.y, ...,
|
|
||||||
pn.x, pn.y}',
|
|
||||||
array => { type => '2 <= int32',
|
|
||||||
desc => 'Number of points (count 1 coordinate as two
|
|
||||||
points)' } }
|
|
||||||
);
|
|
||||||
|
|
||||||
%invoke = (
|
|
||||||
code => <<'CODE'
|
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
CODE
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub image_select_fuzzy {
|
|
||||||
$blurb = <<'BLURB';
|
$blurb = <<'BLURB';
|
||||||
Create a fuzzy selection starting at the specified coordinates on the specified
|
Create a selection by selecting all pixels around specified coordinates
|
||||||
drawable.
|
with the same (or similar) color to that at the coordinates.
|
||||||
BLURB
|
BLURB
|
||||||
|
|
||||||
$help = <<'HELP';
|
$help = <<'HELP';
|
||||||
This tool creates a fuzzy selection over the specified image. A fuzzy
|
This tool creates a contiguous selection over the specified image. A
|
||||||
selection is determined by a seed fill under the constraints of the
|
contiguous color selection is determined by a seed fill under the
|
||||||
current context settings. Essentially, the color at the specified
|
constraints of the current context settings. Essentially, the color
|
||||||
coordinates (in the drawable) is measured and the selection expands
|
at the specified coordinates (in the drawable) is measured and the
|
||||||
outwards from that point to any adjacent pixels which are not
|
selection expands outwards from that point to any adjacent pixels
|
||||||
significantly different (as determined by the threshold and criterion
|
which are not significantly different (as determined by the threshold
|
||||||
context settings). This process continues until no more expansion is
|
and criterion context settings). This process continues until no more
|
||||||
possible. If antialiasing is turned on, the final selection mask will
|
expansion is possible. If antialiasing is turned on, the final
|
||||||
contain intermediate values based on close misses to the threshold bar
|
selection mask will contain intermediate values based on close misses
|
||||||
at pixels along the seed fill boundary.
|
to the threshold bar at pixels along the seed fill boundary.
|
||||||
|
|
||||||
This prodecure is affected by the following context setters:
|
This prodecure is affected by the following context setters:
|
||||||
gimp_context_set_antialias(), gimp_context_set_feather(),
|
gimp_context_set_antialias(), gimp_context_set_feather(),
|
||||||
|
@ -366,6 +262,110 @@ CODE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub image_select_ellipse {
|
||||||
|
$blurb = 'Create an elliptical selection over the specified image.';
|
||||||
|
|
||||||
|
$help = <<'HELP';
|
||||||
|
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.
|
||||||
|
|
||||||
|
This prodecure is affected by the following context setters:
|
||||||
|
gimp_context_set_antialias(), gimp_context_set_feather(),
|
||||||
|
gimp_context_set_feather_radius().
|
||||||
|
HELP
|
||||||
|
|
||||||
|
&mitch_pdb_misc('2010', '2.8');
|
||||||
|
|
||||||
|
@inargs = (
|
||||||
|
{ name => 'image', type => 'image',
|
||||||
|
desc => 'The image' },
|
||||||
|
{ name => 'operation', type => 'enum GimpChannelOps',
|
||||||
|
desc => 'The selection operation' },
|
||||||
|
{ 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',
|
||||||
|
desc => 'The width of the ellipse' },
|
||||||
|
{ name => 'height', type => '0 < float',
|
||||||
|
desc => 'The height of the ellipse' }
|
||||||
|
);
|
||||||
|
|
||||||
|
%invoke = (
|
||||||
|
code => <<'CODE'
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
CODE
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub image_select_polygon {
|
||||||
|
$blurb = 'Create a polygonal selection over the specified image.';
|
||||||
|
|
||||||
|
$help = <<'HELP';
|
||||||
|
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.
|
||||||
|
|
||||||
|
This prodecure is affected by the following context setters:
|
||||||
|
gimp_context_set_antialias(), gimp_context_set_feather(),
|
||||||
|
gimp_context_set_feather_radius().
|
||||||
|
HELP
|
||||||
|
|
||||||
|
&mitch_pdb_misc('2010', '2.8');
|
||||||
|
|
||||||
|
@inargs = (
|
||||||
|
{ name => 'image', type => 'image',
|
||||||
|
desc => 'The image' },
|
||||||
|
{ name => 'operation', type => 'enum GimpChannelOps',
|
||||||
|
desc => 'The selection operation' },
|
||||||
|
{ name => 'segs', type => 'floatarray',
|
||||||
|
desc => 'Array of points: { p1.x, p1.y, p2.x, p2.y, ...,
|
||||||
|
pn.x, pn.y}',
|
||||||
|
array => { type => '2 <= int32',
|
||||||
|
desc => 'Number of points (count 1 coordinate as two
|
||||||
|
points)' } }
|
||||||
|
);
|
||||||
|
|
||||||
|
%invoke = (
|
||||||
|
code => <<'CODE'
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
CODE
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub image_select_item {
|
sub image_select_item {
|
||||||
$blurb = 'Transforms the specified item into a selection';
|
$blurb = 'Transforms the specified item into a selection';
|
||||||
|
|
||||||
|
@ -420,11 +420,11 @@ CODE
|
||||||
"gimp-intl.h");
|
"gimp-intl.h");
|
||||||
|
|
||||||
@procs = qw(image_select_color
|
@procs = qw(image_select_color
|
||||||
|
image_select_contiguous_color
|
||||||
|
image_select_rectangle
|
||||||
|
image_select_round_rectangle
|
||||||
image_select_ellipse
|
image_select_ellipse
|
||||||
image_select_polygon
|
image_select_polygon
|
||||||
image_select_fuzzy
|
|
||||||
image_select_rectangle
|
|
||||||
image_select_round_rectangle
|
|
||||||
image_select_item);
|
image_select_item);
|
||||||
|
|
||||||
%exports = (app => [@procs], lib => [@procs]);
|
%exports = (app => [@procs], lib => [@procs]);
|
||||||
|
|
|
@ -199,7 +199,7 @@ CODE
|
||||||
|
|
||||||
|
|
||||||
sub fuzzy_select {
|
sub fuzzy_select {
|
||||||
&std_pdb_deprecated ('gimp-image-select-fuzzy');
|
&std_pdb_deprecated ('gimp-image-select-contiguous-color');
|
||||||
|
|
||||||
@inargs = (
|
@inargs = (
|
||||||
{ name => 'drawable', type => 'drawable',
|
{ name => 'drawable', type => 'drawable',
|
||||||
|
@ -248,7 +248,7 @@ CODE
|
||||||
|
|
||||||
|
|
||||||
sub fuzzy_select_full {
|
sub fuzzy_select_full {
|
||||||
&std_pdb_deprecated ('gimp-image-select-fuzzy');
|
&std_pdb_deprecated ('gimp-image-select-contiguous-color');
|
||||||
&david_pdb_misc("2006","2.4");
|
&david_pdb_misc("2006","2.4");
|
||||||
|
|
||||||
@inargs = (
|
@inargs = (
|
||||||
|
|
Loading…
Reference in New Issue