~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/pdb/selection_tools_cmds.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
16
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
17
 */
18
18
 
19
 
/* NOTE: This file is autogenerated by pdbgen.pl. */
 
19
/* NOTE: This file is auto-generated by pdbgen.pl. */
20
20
 
21
21
#include "config.h"
22
22
 
26
26
#include "libgimpcolor/gimpcolor.h"
27
27
 
28
28
#include "pdb-types.h"
29
 
#include "procedural_db.h"
 
29
#include "gimppdb.h"
 
30
#include "gimpprocedure.h"
 
31
#include "core/gimpparamspecs.h"
30
32
 
31
33
#include "core/gimpchannel-select.h"
32
34
#include "core/gimpdrawable.h"
33
35
#include "core/gimpimage.h"
34
36
#include "gimp-intl.h"
35
37
 
36
 
static ProcRecord by_color_select_proc;
37
 
static ProcRecord ellipse_select_proc;
38
 
static ProcRecord free_select_proc;
39
 
static ProcRecord fuzzy_select_proc;
40
 
static ProcRecord rect_select_proc;
41
 
 
42
 
void
43
 
register_selection_tools_procs (Gimp *gimp)
44
 
{
45
 
  procedural_db_register (gimp, &by_color_select_proc);
46
 
  procedural_db_register (gimp, &ellipse_select_proc);
47
 
  procedural_db_register (gimp, &free_select_proc);
48
 
  procedural_db_register (gimp, &fuzzy_select_proc);
49
 
  procedural_db_register (gimp, &rect_select_proc);
50
 
}
51
 
 
52
 
static Argument *
53
 
by_color_select_invoker (Gimp         *gimp,
54
 
                         GimpContext  *context,
55
 
                         GimpProgress *progress,
56
 
                         Argument     *args)
 
38
#include "internal_procs.h"
 
39
 
 
40
 
 
41
static GValueArray *
 
42
by_color_select_invoker (GimpProcedure     *procedure,
 
43
                         Gimp              *gimp,
 
44
                         GimpContext       *context,
 
45
                         GimpProgress      *progress,
 
46
                         const GValueArray *args)
57
47
{
58
48
  gboolean success = TRUE;
59
49
  GimpDrawable *drawable;
64
54
  gboolean feather;
65
55
  gdouble feather_radius;
66
56
  gboolean sample_merged;
67
 
  GimpImage *gimage;
68
 
 
69
 
  drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
70
 
  if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
71
 
    success = FALSE;
72
 
 
73
 
  color = args[1].value.pdb_color;
74
 
 
75
 
  threshold = args[2].value.pdb_int;
76
 
  if (threshold < 0 || threshold > 255)
77
 
    success = FALSE;
78
 
 
79
 
  operation = args[3].value.pdb_int;
80
 
  if (operation < GIMP_CHANNEL_OP_ADD || operation > GIMP_CHANNEL_OP_INTERSECT)
81
 
    success = FALSE;
82
 
 
83
 
  antialias = args[4].value.pdb_int ? TRUE : FALSE;
84
 
 
85
 
  feather = args[5].value.pdb_int ? TRUE : FALSE;
86
 
 
87
 
  feather_radius = args[6].value.pdb_float;
88
 
 
89
 
  sample_merged = args[7].value.pdb_int ? TRUE : FALSE;
 
57
 
 
58
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
 
59
  gimp_value_get_rgb (&args->values[1], &color);
 
60
  threshold = g_value_get_int (&args->values[2]);
 
61
  operation = g_value_get_enum (&args->values[3]);
 
62
  antialias = g_value_get_boolean (&args->values[4]);
 
63
  feather = g_value_get_boolean (&args->values[5]);
 
64
  feather_radius = g_value_get_double (&args->values[6]);
 
65
  sample_merged = g_value_get_boolean (&args->values[7]);
90
66
 
91
67
  if (success)
92
68
    {
93
 
      gimage = gimp_item_get_image (GIMP_ITEM (drawable));
 
69
      GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
94
70
 
95
 
      gimp_channel_select_by_color (gimp_image_get_mask (gimage), drawable,
 
71
      gimp_channel_select_by_color (gimp_image_get_mask (image), drawable,
96
72
                                    sample_merged,
97
73
                                    &color,
98
74
                                    threshold,
99
75
                                    FALSE /* don't select transparent */,
 
76
                                    GIMP_SELECT_CRITERION_COMPOSITE,
100
77
                                    operation,
101
78
                                    antialias,
102
79
                                    feather,
104
81
                                    feather_radius);
105
82
    }
106
83
 
107
 
  return procedural_db_return_args (&by_color_select_proc, success);
108
 
}
109
 
 
110
 
static ProcArg by_color_select_inargs[] =
111
 
{
112
 
  {
113
 
    GIMP_PDB_DRAWABLE,
114
 
    "drawable",
115
 
    "The affected drawable"
116
 
  },
117
 
  {
118
 
    GIMP_PDB_COLOR,
119
 
    "color",
120
 
    "The color to select"
121
 
  },
122
 
  {
123
 
    GIMP_PDB_INT32,
124
 
    "threshold",
125
 
    "Threshold in intensity levels 0 <= threshold <= 255"
126
 
  },
127
 
  {
128
 
    GIMP_PDB_INT32,
129
 
    "operation",
130
 
    "The selection operation: { GIMP_CHANNEL_OP_ADD (0), GIMP_CHANNEL_OP_SUBTRACT (1), GIMP_CHANNEL_OP_REPLACE (2), GIMP_CHANNEL_OP_INTERSECT (3) }"
131
 
  },
132
 
  {
133
 
    GIMP_PDB_INT32,
134
 
    "antialias",
135
 
    "Antialiasing (TRUE or FALSE)"
136
 
  },
137
 
  {
138
 
    GIMP_PDB_INT32,
139
 
    "feather",
140
 
    "Feather option for selections"
141
 
  },
142
 
  {
143
 
    GIMP_PDB_FLOAT,
144
 
    "feather_radius",
145
 
    "Radius for feather operation"
146
 
  },
147
 
  {
148
 
    GIMP_PDB_INT32,
149
 
    "sample_merged",
150
 
    "Use the composite image, not the drawable"
151
 
  }
152
 
};
153
 
 
154
 
static ProcRecord by_color_select_proc =
155
 
{
156
 
  "gimp_by_color_select",
157
 
  "Create a selection by selecting all pixels (in the specified drawable) with the same (or similar) color to that specified.",
158
 
  "This tool creates a selection over the specified image. A by-color selection is determined by the supplied color under the constraints of the specified threshold. Essentially, all pixels (in the drawable) that have color sufficiently close to the specified color (as determined by the threshold value) are included in the selection. The antialiasing parameter allows the final selection mask to contain intermediate values based on close misses to the threshold bar. Feathering can be enabled optionally and is controlled with the \"feather_radius\" parameter. If the sample_merged parameter is non-zero, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of a merged sampling, the supplied drawable is ignored.",
159
 
  "Spencer Kimball & Peter Mattis",
160
 
  "Spencer Kimball & Peter Mattis",
161
 
  "1995-1996",
162
 
  NULL,
163
 
  GIMP_INTERNAL,
164
 
  8,
165
 
  by_color_select_inargs,
166
 
  0,
167
 
  NULL,
168
 
  { { by_color_select_invoker } }
169
 
};
170
 
 
171
 
static Argument *
172
 
ellipse_select_invoker (Gimp         *gimp,
173
 
                        GimpContext  *context,
174
 
                        GimpProgress *progress,
175
 
                        Argument     *args)
176
 
{
177
 
  gboolean success = TRUE;
178
 
  GimpImage *gimage;
 
84
  return gimp_procedure_get_return_values (procedure, success);
 
85
}
 
86
 
 
87
static GValueArray *
 
88
by_color_select_full_invoker (GimpProcedure     *procedure,
 
89
                              Gimp              *gimp,
 
90
                              GimpContext       *context,
 
91
                              GimpProgress      *progress,
 
92
                              const GValueArray *args)
 
93
{
 
94
  gboolean success = TRUE;
 
95
  GimpDrawable *drawable;
 
96
  GimpRGB color;
 
97
  gint32 threshold;
 
98
  gint32 operation;
 
99
  gboolean antialias;
 
100
  gboolean feather;
 
101
  gdouble feather_radius_x;
 
102
  gdouble feather_radius_y;
 
103
  gboolean sample_merged;
 
104
  gboolean select_transparent;
 
105
  gint32 select_criterion;
 
106
 
 
107
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
 
108
  gimp_value_get_rgb (&args->values[1], &color);
 
109
  threshold = g_value_get_int (&args->values[2]);
 
110
  operation = g_value_get_enum (&args->values[3]);
 
111
  antialias = g_value_get_boolean (&args->values[4]);
 
112
  feather = g_value_get_boolean (&args->values[5]);
 
113
  feather_radius_x = g_value_get_double (&args->values[6]);
 
114
  feather_radius_y = g_value_get_double (&args->values[7]);
 
115
  sample_merged = g_value_get_boolean (&args->values[8]);
 
116
  select_transparent = g_value_get_boolean (&args->values[9]);
 
117
  select_criterion = g_value_get_enum (&args->values[10]);
 
118
 
 
119
  if (success)
 
120
    {
 
121
      GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
 
122
 
 
123
      gimp_channel_select_by_color (gimp_image_get_mask (image), drawable,
 
124
                                    sample_merged,
 
125
                                    &color,
 
126
                                    threshold,
 
127
                                    select_transparent,
 
128
                                    select_criterion,
 
129
                                    operation,
 
130
                                    antialias,
 
131
                                    feather,
 
132
                                    feather_radius_x,
 
133
                                    feather_radius_y);
 
134
    }
 
135
 
 
136
  return gimp_procedure_get_return_values (procedure, success);
 
137
}
 
138
 
 
139
static GValueArray *
 
140
ellipse_select_invoker (GimpProcedure     *procedure,
 
141
                        Gimp              *gimp,
 
142
                        GimpContext       *context,
 
143
                        GimpProgress      *progress,
 
144
                        const GValueArray *args)
 
145
{
 
146
  gboolean success = TRUE;
 
147
  GimpImage *image;
179
148
  gdouble x;
180
149
  gdouble y;
181
150
  gdouble width;
185
154
  gboolean feather;
186
155
  gdouble feather_radius;
187
156
 
188
 
  gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
189
 
  if (! GIMP_IS_IMAGE (gimage))
190
 
    success = FALSE;
191
 
 
192
 
  x = args[1].value.pdb_float;
193
 
 
194
 
  y = args[2].value.pdb_float;
195
 
 
196
 
  width = args[3].value.pdb_float;
197
 
  if (width <= 0.0)
198
 
    success = FALSE;
199
 
 
200
 
  height = args[4].value.pdb_float;
201
 
  if (height <= 0.0)
202
 
    success = FALSE;
203
 
 
204
 
  operation = args[5].value.pdb_int;
205
 
  if (operation < GIMP_CHANNEL_OP_ADD || operation > GIMP_CHANNEL_OP_INTERSECT)
206
 
    success = FALSE;
207
 
 
208
 
  antialias = args[6].value.pdb_int ? TRUE : FALSE;
209
 
 
210
 
  feather = args[7].value.pdb_int ? TRUE : FALSE;
211
 
 
212
 
  feather_radius = args[8].value.pdb_float;
 
157
  image = gimp_value_get_image (&args->values[0], gimp);
 
158
  x = g_value_get_double (&args->values[1]);
 
159
  y = g_value_get_double (&args->values[2]);
 
160
  width = g_value_get_double (&args->values[3]);
 
161
  height = g_value_get_double (&args->values[4]);
 
162
  operation = g_value_get_enum (&args->values[5]);
 
163
  antialias = g_value_get_boolean (&args->values[6]);
 
164
  feather = g_value_get_boolean (&args->values[7]);
 
165
  feather_radius = g_value_get_double (&args->values[8]);
213
166
 
214
167
  if (success)
215
 
    gimp_channel_select_ellipse (gimp_image_get_mask (gimage),
216
 
                                 (gint) x, (gint) y,
217
 
                                 (gint) width, (gint) height,
218
 
                                 operation,
219
 
                                 antialias,
220
 
                                 feather,
221
 
                                 feather_radius,
222
 
                                 feather_radius);
 
168
    {
 
169
      gimp_channel_select_ellipse (gimp_image_get_mask (image),
 
170
                                   (gint) x, (gint) y,
 
171
                                   (gint) width, (gint) height,
 
172
                                   operation,
 
173
                                   antialias,
 
174
                                   feather,
 
175
                                   feather_radius,
 
176
                                   feather_radius,
 
177
                                   TRUE);
 
178
    }
223
179
 
224
 
  return procedural_db_return_args (&ellipse_select_proc, success);
 
180
  return gimp_procedure_get_return_values (procedure, success);
225
181
}
226
182
 
227
 
static ProcArg ellipse_select_inargs[] =
228
 
{
229
 
  {
230
 
    GIMP_PDB_IMAGE,
231
 
    "image",
232
 
    "The image"
233
 
  },
234
 
  {
235
 
    GIMP_PDB_FLOAT,
236
 
    "x",
237
 
    "x coordinate of upper-left corner of ellipse bounding box"
238
 
  },
239
 
  {
240
 
    GIMP_PDB_FLOAT,
241
 
    "y",
242
 
    "y coordinate of upper-left corner of ellipse bounding box"
243
 
  },
244
 
  {
245
 
    GIMP_PDB_FLOAT,
246
 
    "width",
247
 
    "The width of the ellipse: 0 < width"
248
 
  },
249
 
  {
250
 
    GIMP_PDB_FLOAT,
251
 
    "height",
252
 
    "The height of the ellipse: 0 < height"
253
 
  },
254
 
  {
255
 
    GIMP_PDB_INT32,
256
 
    "operation",
257
 
    "The selection operation: { GIMP_CHANNEL_OP_ADD (0), GIMP_CHANNEL_OP_SUBTRACT (1), GIMP_CHANNEL_OP_REPLACE (2), GIMP_CHANNEL_OP_INTERSECT (3) }"
258
 
  },
259
 
  {
260
 
    GIMP_PDB_INT32,
261
 
    "antialias",
262
 
    "Antialiasing (TRUE or FALSE)"
263
 
  },
264
 
  {
265
 
    GIMP_PDB_INT32,
266
 
    "feather",
267
 
    "Feather option for selections"
268
 
  },
269
 
  {
270
 
    GIMP_PDB_FLOAT,
271
 
    "feather_radius",
272
 
    "Radius for feather operation"
273
 
  }
274
 
};
275
 
 
276
 
static ProcRecord ellipse_select_proc =
277
 
{
278
 
  "gimp_ellipse_select",
279
 
  "Create an elliptical selection over the specified image.",
280
 
  "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. If antialiasing is turned on, the edges of the elliptical 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. If the feather option is enabled, the resulting selection is blurred before combining. The blur is a gaussian blur with the specified feather radius.",
281
 
  "Spencer Kimball & Peter Mattis",
282
 
  "Spencer Kimball & Peter Mattis",
283
 
  "1995-1996",
284
 
  NULL,
285
 
  GIMP_INTERNAL,
286
 
  9,
287
 
  ellipse_select_inargs,
288
 
  0,
289
 
  NULL,
290
 
  { { ellipse_select_invoker } }
291
 
};
292
 
 
293
 
static Argument *
294
 
free_select_invoker (Gimp         *gimp,
295
 
                     GimpContext  *context,
296
 
                     GimpProgress *progress,
297
 
                     Argument     *args)
 
183
static GValueArray *
 
184
free_select_invoker (GimpProcedure     *procedure,
 
185
                     Gimp              *gimp,
 
186
                     GimpContext       *context,
 
187
                     GimpProgress      *progress,
 
188
                     const GValueArray *args)
298
189
{
299
190
  gboolean success = TRUE;
300
 
  GimpImage *gimage;
 
191
  GimpImage *image;
301
192
  gint32 num_segs;
302
 
  gdouble *segs;
 
193
  const gdouble *segs;
303
194
  gint32 operation;
304
195
  gboolean antialias;
305
196
  gboolean feather;
306
197
  gdouble feather_radius;
307
198
 
308
 
  gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
309
 
  if (! GIMP_IS_IMAGE (gimage))
310
 
    success = FALSE;
311
 
 
312
 
  num_segs = args[1].value.pdb_int;
313
 
  if (!(num_segs < 2))
314
 
    num_segs /= 2;
315
 
  else
316
 
    success = FALSE;
317
 
 
318
 
  segs = (gdouble *) args[2].value.pdb_pointer;
319
 
 
320
 
  operation = args[3].value.pdb_int;
321
 
  if (operation < GIMP_CHANNEL_OP_ADD || operation > GIMP_CHANNEL_OP_INTERSECT)
322
 
    success = FALSE;
323
 
 
324
 
  antialias = args[4].value.pdb_int ? TRUE : FALSE;
325
 
 
326
 
  feather = args[5].value.pdb_int ? TRUE : FALSE;
327
 
 
328
 
  feather_radius = args[6].value.pdb_float;
 
199
  image = gimp_value_get_image (&args->values[0], gimp);
 
200
  num_segs = g_value_get_int (&args->values[1]);
 
201
  segs = gimp_value_get_floatarray (&args->values[2]);
 
202
  operation = g_value_get_enum (&args->values[3]);
 
203
  antialias = g_value_get_boolean (&args->values[4]);
 
204
  feather = g_value_get_boolean (&args->values[5]);
 
205
  feather_radius = g_value_get_double (&args->values[6]);
329
206
 
330
207
  if (success)
331
 
    gimp_channel_select_polygon (gimp_image_get_mask (gimage),
332
 
                                 _("Free Select"),
333
 
                                 num_segs,
334
 
                                 (GimpVector2 *) segs, 
335
 
                                 operation,
336
 
                                 antialias,
337
 
                                 feather, 
338
 
                                 feather_radius,
339
 
                                 feather_radius);
 
208
    {
 
209
      gimp_channel_select_polygon (gimp_image_get_mask (image),
 
210
                                   _("Free Select"),
 
211
                                   num_segs / 2,
 
212
                                   (GimpVector2 *) segs,
 
213
                                   operation,
 
214
                                   antialias,
 
215
                                   feather,
 
216
                                   feather_radius,
 
217
                                   feather_radius,
 
218
                                   TRUE);
 
219
    }
340
220
 
341
 
  return procedural_db_return_args (&free_select_proc, success);
 
221
  return gimp_procedure_get_return_values (procedure, success);
342
222
}
343
223
 
344
 
static ProcArg free_select_inargs[] =
345
 
{
346
 
  {
347
 
    GIMP_PDB_IMAGE,
348
 
    "image",
349
 
    "The image"
350
 
  },
351
 
  {
352
 
    GIMP_PDB_INT32,
353
 
    "num_segs",
354
 
    "Number of points (count 1 coordinate as two points)"
355
 
  },
356
 
  {
357
 
    GIMP_PDB_FLOATARRAY,
358
 
    "segs",
359
 
    "Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y}"
360
 
  },
361
 
  {
362
 
    GIMP_PDB_INT32,
363
 
    "operation",
364
 
    "The selection operation: { GIMP_CHANNEL_OP_ADD (0), GIMP_CHANNEL_OP_SUBTRACT (1), GIMP_CHANNEL_OP_REPLACE (2), GIMP_CHANNEL_OP_INTERSECT (3) }"
365
 
  },
366
 
  {
367
 
    GIMP_PDB_INT32,
368
 
    "antialias",
369
 
    "Antialiasing (TRUE or FALSE)"
370
 
  },
371
 
  {
372
 
    GIMP_PDB_INT32,
373
 
    "feather",
374
 
    "Feather option for selections"
375
 
  },
376
 
  {
377
 
    GIMP_PDB_FLOAT,
378
 
    "feather_radius",
379
 
    "Radius for feather operation"
380
 
  }
381
 
};
382
 
 
383
 
static ProcRecord free_select_proc =
384
 
{
385
 
  "gimp_free_select",
386
 
  "Create a polygonal selection over the specified image.",
387
 
  "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. If the feather option is enabled, the resulting selection is blurred before combining. The blur is a gaussian blur with the specified feather radius.",
388
 
  "Spencer Kimball & Peter Mattis",
389
 
  "Spencer Kimball & Peter Mattis",
390
 
  "1995-1996",
391
 
  NULL,
392
 
  GIMP_INTERNAL,
393
 
  7,
394
 
  free_select_inargs,
395
 
  0,
396
 
  NULL,
397
 
  { { free_select_invoker } }
398
 
};
399
 
 
400
 
static Argument *
401
 
fuzzy_select_invoker (Gimp         *gimp,
402
 
                      GimpContext  *context,
403
 
                      GimpProgress *progress,
404
 
                      Argument     *args)
 
224
static GValueArray *
 
225
fuzzy_select_invoker (GimpProcedure     *procedure,
 
226
                      Gimp              *gimp,
 
227
                      GimpContext       *context,
 
228
                      GimpProgress      *progress,
 
229
                      const GValueArray *args)
405
230
{
406
231
  gboolean success = TRUE;
407
232
  GimpDrawable *drawable;
413
238
  gboolean feather;
414
239
  gdouble feather_radius;
415
240
  gboolean sample_merged;
416
 
  GimpImage *gimage;
417
 
 
418
 
  drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
419
 
  if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
420
 
    success = FALSE;
421
 
 
422
 
  x = args[1].value.pdb_float;
423
 
 
424
 
  y = args[2].value.pdb_float;
425
 
 
426
 
  threshold = args[3].value.pdb_int;
427
 
  if (threshold < 0 || threshold > 255)
428
 
    success = FALSE;
429
 
 
430
 
  operation = args[4].value.pdb_int;
431
 
  if (operation < GIMP_CHANNEL_OP_ADD || operation > GIMP_CHANNEL_OP_INTERSECT)
432
 
    success = FALSE;
433
 
 
434
 
  antialias = args[5].value.pdb_int ? TRUE : FALSE;
435
 
 
436
 
  feather = args[6].value.pdb_int ? TRUE : FALSE;
437
 
 
438
 
  feather_radius = args[7].value.pdb_float;
439
 
 
440
 
  sample_merged = args[8].value.pdb_int ? TRUE : FALSE;
 
241
 
 
242
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
 
243
  x = g_value_get_double (&args->values[1]);
 
244
  y = g_value_get_double (&args->values[2]);
 
245
  threshold = g_value_get_int (&args->values[3]);
 
246
  operation = g_value_get_enum (&args->values[4]);
 
247
  antialias = g_value_get_boolean (&args->values[5]);
 
248
  feather = g_value_get_boolean (&args->values[6]);
 
249
  feather_radius = g_value_get_double (&args->values[7]);
 
250
  sample_merged = g_value_get_boolean (&args->values[8]);
441
251
 
442
252
  if (success)
443
253
    {
444
 
      gimage = gimp_item_get_image (GIMP_ITEM (drawable));
 
254
      GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
445
255
 
446
 
      gimp_channel_select_fuzzy (gimp_image_get_mask (gimage),
 
256
      gimp_channel_select_fuzzy (gimp_image_get_mask (image),
447
257
                                 drawable,
448
258
                                 sample_merged,
449
 
                                 x, y, 
 
259
                                 x, y,
450
260
                                 threshold,
451
261
                                 FALSE /* don't select transparent */,
 
262
                                 GIMP_SELECT_CRITERION_COMPOSITE,
452
263
                                 operation,
453
264
                                 antialias,
454
265
                                 feather,
456
267
                                 feather_radius);
457
268
    }
458
269
 
459
 
  return procedural_db_return_args (&fuzzy_select_proc, success);
460
 
}
461
 
 
462
 
static ProcArg fuzzy_select_inargs[] =
463
 
{
464
 
  {
465
 
    GIMP_PDB_DRAWABLE,
466
 
    "drawable",
467
 
    "The affected drawable"
468
 
  },
469
 
  {
470
 
    GIMP_PDB_FLOAT,
471
 
    "x",
472
 
    "x coordinate of initial seed fill point: (image coordinates)"
473
 
  },
474
 
  {
475
 
    GIMP_PDB_FLOAT,
476
 
    "y",
477
 
    "y coordinate of initial seed fill point: (image coordinates)"
478
 
  },
479
 
  {
480
 
    GIMP_PDB_INT32,
481
 
    "threshold",
482
 
    "Threshold in intensity levels 0 <= threshold <= 255"
483
 
  },
484
 
  {
485
 
    GIMP_PDB_INT32,
486
 
    "operation",
487
 
    "The selection operation: { GIMP_CHANNEL_OP_ADD (0), GIMP_CHANNEL_OP_SUBTRACT (1), GIMP_CHANNEL_OP_REPLACE (2), GIMP_CHANNEL_OP_INTERSECT (3) }"
488
 
  },
489
 
  {
490
 
    GIMP_PDB_INT32,
491
 
    "antialias",
492
 
    "Antialiasing (TRUE or FALSE)"
493
 
  },
494
 
  {
495
 
    GIMP_PDB_INT32,
496
 
    "feather",
497
 
    "Feather option for selections"
498
 
  },
499
 
  {
500
 
    GIMP_PDB_FLOAT,
501
 
    "feather_radius",
502
 
    "Radius for feather operation"
503
 
  },
504
 
  {
505
 
    GIMP_PDB_INT32,
506
 
    "sample_merged",
507
 
    "Use the composite image, not the drawable"
508
 
  }
509
 
};
510
 
 
511
 
static ProcRecord fuzzy_select_proc =
512
 
{
513
 
  "gimp_fuzzy_select",
514
 
  "Create a fuzzy selection starting at the specified coordinates on the specified drawable.",
515
 
  "This tool creates a fuzzy selection over the specified image. A fuzzy selection is determined by a seed fill under the constraints of the specified threshold. 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 value). This process continues until no more expansion is possible. The antialiasing parameter allows the final selection mask to contain intermediate values based on close misses to the threshold bar at pixels along the seed fill boundary. Feathering can be enabled optionally and is controlled with the \"feather_radius\" paramter. If the sample_merged parameter is non-zero, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of a merged sampling, the supplied drawable is ignored."
516
 
  "If the sample is merged, the specified coordinates are relative to the image origin; otherwise, they are relative to the drawable's origin.",
517
 
  "Spencer Kimball & Peter Mattis",
518
 
  "Spencer Kimball & Peter Mattis",
519
 
  "1995-1996",
520
 
  NULL,
521
 
  GIMP_INTERNAL,
522
 
  9,
523
 
  fuzzy_select_inargs,
524
 
  0,
525
 
  NULL,
526
 
  { { fuzzy_select_invoker } }
527
 
};
528
 
 
529
 
static Argument *
530
 
rect_select_invoker (Gimp         *gimp,
531
 
                     GimpContext  *context,
532
 
                     GimpProgress *progress,
533
 
                     Argument     *args)
534
 
{
535
 
  gboolean success = TRUE;
536
 
  GimpImage *gimage;
 
270
  return gimp_procedure_get_return_values (procedure, success);
 
271
}
 
272
 
 
273
static GValueArray *
 
274
fuzzy_select_full_invoker (GimpProcedure     *procedure,
 
275
                           Gimp              *gimp,
 
276
                           GimpContext       *context,
 
277
                           GimpProgress      *progress,
 
278
                           const GValueArray *args)
 
279
{
 
280
  gboolean success = TRUE;
 
281
  GimpDrawable *drawable;
 
282
  gdouble x;
 
283
  gdouble y;
 
284
  gint32 threshold;
 
285
  gint32 operation;
 
286
  gboolean antialias;
 
287
  gboolean feather;
 
288
  gdouble feather_radius_x;
 
289
  gdouble feather_radius_y;
 
290
  gboolean sample_merged;
 
291
  gboolean select_transparent;
 
292
  gint32 select_criterion;
 
293
 
 
294
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
 
295
  x = g_value_get_double (&args->values[1]);
 
296
  y = g_value_get_double (&args->values[2]);
 
297
  threshold = g_value_get_int (&args->values[3]);
 
298
  operation = g_value_get_enum (&args->values[4]);
 
299
  antialias = g_value_get_boolean (&args->values[5]);
 
300
  feather = g_value_get_boolean (&args->values[6]);
 
301
  feather_radius_x = g_value_get_double (&args->values[7]);
 
302
  feather_radius_y = g_value_get_double (&args->values[8]);
 
303
  sample_merged = g_value_get_boolean (&args->values[9]);
 
304
  select_transparent = g_value_get_boolean (&args->values[10]);
 
305
  select_criterion = g_value_get_enum (&args->values[11]);
 
306
 
 
307
  if (success)
 
308
    {
 
309
      GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
 
310
 
 
311
      gimp_channel_select_fuzzy (gimp_image_get_mask (image),
 
312
                                 drawable,
 
313
                                 sample_merged,
 
314
                                 x, y,
 
315
                                 threshold,
 
316
                                 select_transparent,
 
317
                                 select_criterion,
 
318
                                 operation,
 
319
                                 antialias,
 
320
                                 feather,
 
321
                                 feather_radius_x,
 
322
                                 feather_radius_y);
 
323
    }
 
324
 
 
325
  return gimp_procedure_get_return_values (procedure, success);
 
326
}
 
327
 
 
328
static GValueArray *
 
329
rect_select_invoker (GimpProcedure     *procedure,
 
330
                     Gimp              *gimp,
 
331
                     GimpContext       *context,
 
332
                     GimpProgress      *progress,
 
333
                     const GValueArray *args)
 
334
{
 
335
  gboolean success = TRUE;
 
336
  GimpImage *image;
537
337
  gdouble x;
538
338
  gdouble y;
539
339
  gdouble width;
542
342
  gboolean feather;
543
343
  gdouble feather_radius;
544
344
 
545
 
  gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
546
 
  if (! GIMP_IS_IMAGE (gimage))
547
 
    success = FALSE;
548
 
 
549
 
  x = args[1].value.pdb_float;
550
 
 
551
 
  y = args[2].value.pdb_float;
552
 
 
553
 
  width = args[3].value.pdb_float;
554
 
  if (width <= 0.0)
555
 
    success = FALSE;
556
 
 
557
 
  height = args[4].value.pdb_float;
558
 
  if (height <= 0.0)
559
 
    success = FALSE;
560
 
 
561
 
  operation = args[5].value.pdb_int;
562
 
  if (operation < GIMP_CHANNEL_OP_ADD || operation > GIMP_CHANNEL_OP_INTERSECT)
563
 
    success = FALSE;
564
 
 
565
 
  feather = args[6].value.pdb_int ? TRUE : FALSE;
566
 
 
567
 
  feather_radius = args[7].value.pdb_float;
568
 
 
569
 
  if (success)
570
 
    gimp_channel_select_rectangle (gimp_image_get_mask (gimage),
571
 
                                   (gint) x, (gint) y,
572
 
                                   (gint) width, (gint) height,
573
 
                                   operation,
574
 
                                   feather,
575
 
                                   feather_radius,
576
 
                                   feather_radius);
577
 
 
578
 
  return procedural_db_return_args (&rect_select_proc, success);
579
 
}
580
 
 
581
 
static ProcArg rect_select_inargs[] =
582
 
{
583
 
  {
584
 
    GIMP_PDB_IMAGE,
585
 
    "image",
586
 
    "The image"
587
 
  },
588
 
  {
589
 
    GIMP_PDB_FLOAT,
590
 
    "x",
591
 
    "x coordinate of upper-left corner of rectangle"
592
 
  },
593
 
  {
594
 
    GIMP_PDB_FLOAT,
595
 
    "y",
596
 
    "y coordinate of upper-left corner of rectangle"
597
 
  },
598
 
  {
599
 
    GIMP_PDB_FLOAT,
600
 
    "width",
601
 
    "The width of the rectangle: 0 < width"
602
 
  },
603
 
  {
604
 
    GIMP_PDB_FLOAT,
605
 
    "height",
606
 
    "The height of the rectangle: 0 < height"
607
 
  },
608
 
  {
609
 
    GIMP_PDB_INT32,
610
 
    "operation",
611
 
    "The selection operation: { GIMP_CHANNEL_OP_ADD (0), GIMP_CHANNEL_OP_SUBTRACT (1), GIMP_CHANNEL_OP_REPLACE (2), GIMP_CHANNEL_OP_INTERSECT (3) }"
612
 
  },
613
 
  {
614
 
    GIMP_PDB_INT32,
615
 
    "feather",
616
 
    "Feather option for selections"
617
 
  },
618
 
  {
619
 
    GIMP_PDB_FLOAT,
620
 
    "feather_radius",
621
 
    "Radius for feather operation"
622
 
  }
623
 
};
624
 
 
625
 
static ProcRecord rect_select_proc =
626
 
{
627
 
  "gimp_rect_select",
628
 
  "Create a rectangular selection over the specified image;",
629
 
  "This tool creates a rectangular selection over the specified image. The rectangular region can be either added to, subtracted from, or replace the contents of the previous selection mask. If the feather option is enabled, the resulting selection is blurred before combining. The blur is a gaussian blur with the specified feather radius.",
630
 
  "Spencer Kimball & Peter Mattis",
631
 
  "Spencer Kimball & Peter Mattis",
632
 
  "1995-1996",
633
 
  NULL,
634
 
  GIMP_INTERNAL,
635
 
  8,
636
 
  rect_select_inargs,
637
 
  0,
638
 
  NULL,
639
 
  { { rect_select_invoker } }
640
 
};
 
345
  image = gimp_value_get_image (&args->values[0], gimp);
 
346
  x = g_value_get_double (&args->values[1]);
 
347
  y = g_value_get_double (&args->values[2]);
 
348
  width = g_value_get_double (&args->values[3]);
 
349
  height = g_value_get_double (&args->values[4]);
 
350
  operation = g_value_get_enum (&args->values[5]);
 
351
  feather = g_value_get_boolean (&args->values[6]);
 
352
  feather_radius = g_value_get_double (&args->values[7]);
 
353
 
 
354
  if (success)
 
355
    {
 
356
      gimp_channel_select_rectangle (gimp_image_get_mask (image),
 
357
                                     (gint) x, (gint) y,
 
358
                                     (gint) width, (gint) height,
 
359
                                     operation,
 
360
                                     feather,
 
361
                                     feather_radius,
 
362
                                     feather_radius,
 
363
                                     TRUE);
 
364
    }
 
365
 
 
366
  return gimp_procedure_get_return_values (procedure, success);
 
367
}
 
368
 
 
369
static GValueArray *
 
370
round_rect_select_invoker (GimpProcedure     *procedure,
 
371
                           Gimp              *gimp,
 
372
                           GimpContext       *context,
 
373
                           GimpProgress      *progress,
 
374
                           const GValueArray *args)
 
375
{
 
376
  gboolean success = TRUE;
 
377
  GimpImage *image;
 
378
  gdouble x;
 
379
  gdouble y;
 
380
  gdouble width;
 
381
  gdouble height;
 
382
  gdouble corner_radius_x;
 
383
  gdouble corner_radius_y;
 
384
  gint32 operation;
 
385
  gboolean antialias;
 
386
  gboolean feather;
 
387
  gdouble feather_radius_x;
 
388
  gdouble feather_radius_y;
 
389
 
 
390
  image = gimp_value_get_image (&args->values[0], gimp);
 
391
  x = g_value_get_double (&args->values[1]);
 
392
  y = g_value_get_double (&args->values[2]);
 
393
  width = g_value_get_double (&args->values[3]);
 
394
  height = g_value_get_double (&args->values[4]);
 
395
  corner_radius_x = g_value_get_double (&args->values[5]);
 
396
  corner_radius_y = g_value_get_double (&args->values[6]);
 
397
  operation = g_value_get_enum (&args->values[7]);
 
398
  antialias = g_value_get_boolean (&args->values[8]);
 
399
  feather = g_value_get_boolean (&args->values[9]);
 
400
  feather_radius_x = g_value_get_double (&args->values[10]);
 
401
  feather_radius_y = g_value_get_double (&args->values[11]);
 
402
 
 
403
  if (success)
 
404
    {
 
405
      gimp_channel_select_round_rect (gimp_image_get_mask (image),
 
406
                                      (gint) x, (gint) y,
 
407
                                      (gint) width, (gint) height,
 
408
                                      corner_radius_x,
 
409
                                      corner_radius_y,
 
410
                                      operation,
 
411
                                      antialias,
 
412
                                      feather,
 
413
                                      feather_radius_x,
 
414
                                      feather_radius_y,
 
415
                                      TRUE);
 
416
    }
 
417
 
 
418
  return gimp_procedure_get_return_values (procedure, success);
 
419
}
 
420
 
 
421
void
 
422
register_selection_tools_procs (GimpPDB *pdb)
 
423
{
 
424
  GimpProcedure *procedure;
 
425
 
 
426
  /*
 
427
   * gimp-by-color-select
 
428
   */
 
429
  procedure = gimp_procedure_new (by_color_select_invoker);
 
430
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-by-color-select");
 
431
  gimp_procedure_set_static_strings (procedure,
 
432
                                     "gimp-by-color-select",
 
433
                                     "Create a selection by selecting all pixels (in the specified drawable) with the same (or similar) color to that specified.",
 
434
                                     "This tool creates a selection over the specified image. A by-color selection is determined by the supplied color under the constraints of the specified threshold. Essentially, all pixels (in the drawable) that have color sufficiently close to the specified color (as determined by the threshold value) are included in the selection. The antialiasing parameter allows the final selection mask to contain intermediate values based on close misses to the threshold bar. Feathering can be enabled optionally and is controlled with the 'feather-radius' parameter. If the 'sample-merged' parameter is TRUE, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of a merged sampling, the supplied drawable is ignored.",
 
435
                                     "Spencer Kimball & Peter Mattis",
 
436
                                     "Spencer Kimball & Peter Mattis",
 
437
                                     "1995-1996",
 
438
                                     NULL);
 
439
  gimp_procedure_add_argument (procedure,
 
440
                               gimp_param_spec_drawable_id ("drawable",
 
441
                                                            "drawable",
 
442
                                                            "The affected drawable",
 
443
                                                            pdb->gimp, FALSE,
 
444
                                                            GIMP_PARAM_READWRITE));
 
445
  gimp_procedure_add_argument (procedure,
 
446
                               gimp_param_spec_rgb ("color",
 
447
                                                    "color",
 
448
                                                    "The color to select",
 
449
                                                    FALSE,
 
450
                                                    NULL,
 
451
                                                    GIMP_PARAM_READWRITE));
 
452
  gimp_procedure_add_argument (procedure,
 
453
                               gimp_param_spec_int32 ("threshold",
 
454
                                                      "threshold",
 
455
                                                      "Threshold in intensity levels",
 
456
                                                      0, 255, 0,
 
457
                                                      GIMP_PARAM_READWRITE));
 
458
  gimp_procedure_add_argument (procedure,
 
459
                               g_param_spec_enum ("operation",
 
460
                                                  "operation",
 
461
                                                  "The selection operation",
 
462
                                                  GIMP_TYPE_CHANNEL_OPS,
 
463
                                                  GIMP_CHANNEL_OP_ADD,
 
464
                                                  GIMP_PARAM_READWRITE));
 
465
  gimp_procedure_add_argument (procedure,
 
466
                               g_param_spec_boolean ("antialias",
 
467
                                                     "antialias",
 
468
                                                     "Antialiasing",
 
469
                                                     FALSE,
 
470
                                                     GIMP_PARAM_READWRITE));
 
471
  gimp_procedure_add_argument (procedure,
 
472
                               g_param_spec_boolean ("feather",
 
473
                                                     "feather",
 
474
                                                     "Feather option for selections",
 
475
                                                     FALSE,
 
476
                                                     GIMP_PARAM_READWRITE));
 
477
  gimp_procedure_add_argument (procedure,
 
478
                               g_param_spec_double ("feather-radius",
 
479
                                                    "feather radius",
 
480
                                                    "Radius for feather operation",
 
481
                                                    0, G_MAXDOUBLE, 0,
 
482
                                                    GIMP_PARAM_READWRITE));
 
483
  gimp_procedure_add_argument (procedure,
 
484
                               g_param_spec_boolean ("sample-merged",
 
485
                                                     "sample merged",
 
486
                                                     "Use the composite image, not the drawable",
 
487
                                                     FALSE,
 
488
                                                     GIMP_PARAM_READWRITE));
 
489
  gimp_pdb_register_procedure (pdb, procedure);
 
490
  g_object_unref (procedure);
 
491
 
 
492
  /*
 
493
   * gimp-by-color-select-full
 
494
   */
 
495
  procedure = gimp_procedure_new (by_color_select_full_invoker);
 
496
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-by-color-select-full");
 
497
  gimp_procedure_set_static_strings (procedure,
 
498
                                     "gimp-by-color-select-full",
 
499
                                     "Create a selection by selecting all pixels (in the specified drawable) with the same (or similar) color to that specified.",
 
500
                                     "This tool creates a selection over the specified image. A by-color selection is determined by the supplied color under the constraints of the specified threshold. Essentially, all pixels (in the drawable) that have color sufficiently close to the specified color (as determined by the threshold value) are included in the selection. To select transparent regions, the color specified must also have minimum alpha. The antialiasing parameter allows the final selection mask to contain intermediate values based on close misses to the threshold bar. Feathering can be enabled optionally and is controlled with the 'feather-radius' parameter. If the 'sample-merged' parameter is TRUE, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of a merged sampling, the supplied drawable is ignored.",
 
501
                                     "David Gowers",
 
502
                                     "David Gowers",
 
503
                                     "2006",
 
504
                                     NULL);
 
505
  gimp_procedure_add_argument (procedure,
 
506
                               gimp_param_spec_drawable_id ("drawable",
 
507
                                                            "drawable",
 
508
                                                            "The affected drawable",
 
509
                                                            pdb->gimp, FALSE,
 
510
                                                            GIMP_PARAM_READWRITE));
 
511
  gimp_procedure_add_argument (procedure,
 
512
                               gimp_param_spec_rgb ("color",
 
513
                                                    "color",
 
514
                                                    "The color to select",
 
515
                                                    FALSE,
 
516
                                                    NULL,
 
517
                                                    GIMP_PARAM_READWRITE));
 
518
  gimp_procedure_add_argument (procedure,
 
519
                               gimp_param_spec_int32 ("threshold",
 
520
                                                      "threshold",
 
521
                                                      "Threshold in intensity levels",
 
522
                                                      0, 255, 0,
 
523
                                                      GIMP_PARAM_READWRITE));
 
524
  gimp_procedure_add_argument (procedure,
 
525
                               g_param_spec_enum ("operation",
 
526
                                                  "operation",
 
527
                                                  "The selection operation",
 
528
                                                  GIMP_TYPE_CHANNEL_OPS,
 
529
                                                  GIMP_CHANNEL_OP_ADD,
 
530
                                                  GIMP_PARAM_READWRITE));
 
531
  gimp_procedure_add_argument (procedure,
 
532
                               g_param_spec_boolean ("antialias",
 
533
                                                     "antialias",
 
534
                                                     "Antialiasing",
 
535
                                                     FALSE,
 
536
                                                     GIMP_PARAM_READWRITE));
 
537
  gimp_procedure_add_argument (procedure,
 
538
                               g_param_spec_boolean ("feather",
 
539
                                                     "feather",
 
540
                                                     "Feather option for selections",
 
541
                                                     FALSE,
 
542
                                                     GIMP_PARAM_READWRITE));
 
543
  gimp_procedure_add_argument (procedure,
 
544
                               g_param_spec_double ("feather-radius-x",
 
545
                                                    "feather radius x",
 
546
                                                    "Radius for feather operation in X direction",
 
547
                                                    0, G_MAXDOUBLE, 0,
 
548
                                                    GIMP_PARAM_READWRITE));
 
549
  gimp_procedure_add_argument (procedure,
 
550
                               g_param_spec_double ("feather-radius-y",
 
551
                                                    "feather radius y",
 
552
                                                    "Radius for feather operation in Y direction",
 
553
                                                    0, G_MAXDOUBLE, 0,
 
554
                                                    GIMP_PARAM_READWRITE));
 
555
  gimp_procedure_add_argument (procedure,
 
556
                               g_param_spec_boolean ("sample-merged",
 
557
                                                     "sample merged",
 
558
                                                     "Use the composite image, not the drawable",
 
559
                                                     FALSE,
 
560
                                                     GIMP_PARAM_READWRITE));
 
561
  gimp_procedure_add_argument (procedure,
 
562
                               g_param_spec_boolean ("select-transparent",
 
563
                                                     "select transparent",
 
564
                                                     "Whether to consider transparent pixels for selection. If TRUE, transparency is considered as a unique selectable color.",
 
565
                                                     FALSE,
 
566
                                                     GIMP_PARAM_READWRITE));
 
567
  gimp_procedure_add_argument (procedure,
 
568
                               g_param_spec_enum ("select-criterion",
 
569
                                                  "select criterion",
 
570
                                                  "The criterion used to determine color similarity. SELECT_CRITERION_COMPOSITE is the standard choice.",
 
571
                                                  GIMP_TYPE_SELECT_CRITERION,
 
572
                                                  GIMP_SELECT_CRITERION_COMPOSITE,
 
573
                                                  GIMP_PARAM_READWRITE));
 
574
  gimp_pdb_register_procedure (pdb, procedure);
 
575
  g_object_unref (procedure);
 
576
 
 
577
  /*
 
578
   * gimp-ellipse-select
 
579
   */
 
580
  procedure = gimp_procedure_new (ellipse_select_invoker);
 
581
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-ellipse-select");
 
582
  gimp_procedure_set_static_strings (procedure,
 
583
                                     "gimp-ellipse-select",
 
584
                                     "Create an elliptical selection over the specified image.",
 
585
                                     "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. If antialiasing is turned on, the edges of the elliptical 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. If the feather option is enabled, the resulting selection is blurred before combining. The blur is a gaussian blur with the specified feather radius.",
 
586
                                     "Spencer Kimball & Peter Mattis",
 
587
                                     "Spencer Kimball & Peter Mattis",
 
588
                                     "1995-1996",
 
589
                                     NULL);
 
590
  gimp_procedure_add_argument (procedure,
 
591
                               gimp_param_spec_image_id ("image",
 
592
                                                         "image",
 
593
                                                         "The image",
 
594
                                                         pdb->gimp, FALSE,
 
595
                                                         GIMP_PARAM_READWRITE));
 
596
  gimp_procedure_add_argument (procedure,
 
597
                               g_param_spec_double ("x",
 
598
                                                    "x",
 
599
                                                    "x coordinate of upper-left corner of ellipse bounding box",
 
600
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
 
601
                                                    GIMP_PARAM_READWRITE));
 
602
  gimp_procedure_add_argument (procedure,
 
603
                               g_param_spec_double ("y",
 
604
                                                    "y",
 
605
                                                    "y coordinate of upper-left corner of ellipse bounding box",
 
606
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
 
607
                                                    GIMP_PARAM_READWRITE));
 
608
  gimp_procedure_add_argument (procedure,
 
609
                               g_param_spec_double ("width",
 
610
                                                    "width",
 
611
                                                    "The width of the ellipse",
 
612
                                                    0, G_MAXDOUBLE, 0,
 
613
                                                    GIMP_PARAM_READWRITE));
 
614
  gimp_procedure_add_argument (procedure,
 
615
                               g_param_spec_double ("height",
 
616
                                                    "height",
 
617
                                                    "The height of the ellipse",
 
618
                                                    0, G_MAXDOUBLE, 0,
 
619
                                                    GIMP_PARAM_READWRITE));
 
620
  gimp_procedure_add_argument (procedure,
 
621
                               g_param_spec_enum ("operation",
 
622
                                                  "operation",
 
623
                                                  "The selection operation",
 
624
                                                  GIMP_TYPE_CHANNEL_OPS,
 
625
                                                  GIMP_CHANNEL_OP_ADD,
 
626
                                                  GIMP_PARAM_READWRITE));
 
627
  gimp_procedure_add_argument (procedure,
 
628
                               g_param_spec_boolean ("antialias",
 
629
                                                     "antialias",
 
630
                                                     "Antialiasing",
 
631
                                                     FALSE,
 
632
                                                     GIMP_PARAM_READWRITE));
 
633
  gimp_procedure_add_argument (procedure,
 
634
                               g_param_spec_boolean ("feather",
 
635
                                                     "feather",
 
636
                                                     "Feather option for selections",
 
637
                                                     FALSE,
 
638
                                                     GIMP_PARAM_READWRITE));
 
639
  gimp_procedure_add_argument (procedure,
 
640
                               g_param_spec_double ("feather-radius",
 
641
                                                    "feather radius",
 
642
                                                    "Radius for feather operation",
 
643
                                                    0, G_MAXDOUBLE, 0,
 
644
                                                    GIMP_PARAM_READWRITE));
 
645
  gimp_pdb_register_procedure (pdb, procedure);
 
646
  g_object_unref (procedure);
 
647
 
 
648
  /*
 
649
   * gimp-free-select
 
650
   */
 
651
  procedure = gimp_procedure_new (free_select_invoker);
 
652
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-free-select");
 
653
  gimp_procedure_set_static_strings (procedure,
 
654
                                     "gimp-free-select",
 
655
                                     "Create a polygonal selection over the specified image.",
 
656
                                     "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. If the feather option is enabled, the resulting selection is blurred before combining. The blur is a gaussian blur with the specified feather radius.",
 
657
                                     "Spencer Kimball & Peter Mattis",
 
658
                                     "Spencer Kimball & Peter Mattis",
 
659
                                     "1995-1996",
 
660
                                     NULL);
 
661
  gimp_procedure_add_argument (procedure,
 
662
                               gimp_param_spec_image_id ("image",
 
663
                                                         "image",
 
664
                                                         "The image",
 
665
                                                         pdb->gimp, FALSE,
 
666
                                                         GIMP_PARAM_READWRITE));
 
667
  gimp_procedure_add_argument (procedure,
 
668
                               gimp_param_spec_int32 ("num-segs",
 
669
                                                      "num segs",
 
670
                                                      "Number of points (count 1 coordinate as two points)",
 
671
                                                      2, G_MAXINT32, 2,
 
672
                                                      GIMP_PARAM_READWRITE));
 
673
  gimp_procedure_add_argument (procedure,
 
674
                               gimp_param_spec_float_array ("segs",
 
675
                                                            "segs",
 
676
                                                            "Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y}",
 
677
                                                            GIMP_PARAM_READWRITE));
 
678
  gimp_procedure_add_argument (procedure,
 
679
                               g_param_spec_enum ("operation",
 
680
                                                  "operation",
 
681
                                                  "The selection operation",
 
682
                                                  GIMP_TYPE_CHANNEL_OPS,
 
683
                                                  GIMP_CHANNEL_OP_ADD,
 
684
                                                  GIMP_PARAM_READWRITE));
 
685
  gimp_procedure_add_argument (procedure,
 
686
                               g_param_spec_boolean ("antialias",
 
687
                                                     "antialias",
 
688
                                                     "Antialiasing",
 
689
                                                     FALSE,
 
690
                                                     GIMP_PARAM_READWRITE));
 
691
  gimp_procedure_add_argument (procedure,
 
692
                               g_param_spec_boolean ("feather",
 
693
                                                     "feather",
 
694
                                                     "Feather option for selections",
 
695
                                                     FALSE,
 
696
                                                     GIMP_PARAM_READWRITE));
 
697
  gimp_procedure_add_argument (procedure,
 
698
                               g_param_spec_double ("feather-radius",
 
699
                                                    "feather radius",
 
700
                                                    "Radius for feather operation",
 
701
                                                    0, G_MAXDOUBLE, 0,
 
702
                                                    GIMP_PARAM_READWRITE));
 
703
  gimp_pdb_register_procedure (pdb, procedure);
 
704
  g_object_unref (procedure);
 
705
 
 
706
  /*
 
707
   * gimp-fuzzy-select
 
708
   */
 
709
  procedure = gimp_procedure_new (fuzzy_select_invoker);
 
710
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-fuzzy-select");
 
711
  gimp_procedure_set_static_strings (procedure,
 
712
                                     "gimp-fuzzy-select",
 
713
                                     "Create a fuzzy selection starting at the specified coordinates on the specified drawable.",
 
714
                                     "This tool creates a fuzzy selection over the specified image. A fuzzy selection is determined by a seed fill under the constraints of the specified threshold. 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 value). This process continues until no more expansion is possible. The antialiasing parameter allows the final selection mask to contain intermediate values based on close misses to the threshold bar at pixels along the seed fill boundary. Feathering can be enabled optionally and is controlled with the 'feather-radius' paramter. If the 'sample-merged' parameter is TRUE, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of a merged sampling, the supplied drawable is ignored. If"
 
715
  "the sample is merged, the specified coordinates are relative to the image origin; otherwise, they are relative to the drawable's origin.",
 
716
                                     "Spencer Kimball & Peter Mattis",
 
717
                                     "Spencer Kimball & Peter Mattis",
 
718
                                     "1995-1996",
 
719
                                     NULL);
 
720
  gimp_procedure_add_argument (procedure,
 
721
                               gimp_param_spec_drawable_id ("drawable",
 
722
                                                            "drawable",
 
723
                                                            "The affected drawable",
 
724
                                                            pdb->gimp, FALSE,
 
725
                                                            GIMP_PARAM_READWRITE));
 
726
  gimp_procedure_add_argument (procedure,
 
727
                               g_param_spec_double ("x",
 
728
                                                    "x",
 
729
                                                    "x coordinate of initial seed fill point: (image coordinates)",
 
730
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
 
731
                                                    GIMP_PARAM_READWRITE));
 
732
  gimp_procedure_add_argument (procedure,
 
733
                               g_param_spec_double ("y",
 
734
                                                    "y",
 
735
                                                    "y coordinate of initial seed fill point: (image coordinates)",
 
736
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
 
737
                                                    GIMP_PARAM_READWRITE));
 
738
  gimp_procedure_add_argument (procedure,
 
739
                               gimp_param_spec_int32 ("threshold",
 
740
                                                      "threshold",
 
741
                                                      "Threshold in intensity levels",
 
742
                                                      0, 255, 0,
 
743
                                                      GIMP_PARAM_READWRITE));
 
744
  gimp_procedure_add_argument (procedure,
 
745
                               g_param_spec_enum ("operation",
 
746
                                                  "operation",
 
747
                                                  "The selection operation",
 
748
                                                  GIMP_TYPE_CHANNEL_OPS,
 
749
                                                  GIMP_CHANNEL_OP_ADD,
 
750
                                                  GIMP_PARAM_READWRITE));
 
751
  gimp_procedure_add_argument (procedure,
 
752
                               g_param_spec_boolean ("antialias",
 
753
                                                     "antialias",
 
754
                                                     "Antialiasing",
 
755
                                                     FALSE,
 
756
                                                     GIMP_PARAM_READWRITE));
 
757
  gimp_procedure_add_argument (procedure,
 
758
                               g_param_spec_boolean ("feather",
 
759
                                                     "feather",
 
760
                                                     "Feather option for selections",
 
761
                                                     FALSE,
 
762
                                                     GIMP_PARAM_READWRITE));
 
763
  gimp_procedure_add_argument (procedure,
 
764
                               g_param_spec_double ("feather-radius",
 
765
                                                    "feather radius",
 
766
                                                    "Radius for feather operation",
 
767
                                                    0, G_MAXDOUBLE, 0,
 
768
                                                    GIMP_PARAM_READWRITE));
 
769
  gimp_procedure_add_argument (procedure,
 
770
                               g_param_spec_boolean ("sample-merged",
 
771
                                                     "sample merged",
 
772
                                                     "Use the composite image, not the drawable",
 
773
                                                     FALSE,
 
774
                                                     GIMP_PARAM_READWRITE));
 
775
  gimp_pdb_register_procedure (pdb, procedure);
 
776
  g_object_unref (procedure);
 
777
 
 
778
  /*
 
779
   * gimp-fuzzy-select-full
 
780
   */
 
781
  procedure = gimp_procedure_new (fuzzy_select_full_invoker);
 
782
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-fuzzy-select-full");
 
783
  gimp_procedure_set_static_strings (procedure,
 
784
                                     "gimp-fuzzy-select-full",
 
785
                                     "Create a fuzzy selection starting at the specified coordinates on the specified drawable.",
 
786
                                     "This tool creates a fuzzy selection over the specified image. A fuzzy selection is determined by a seed fill under the constraints of the specified threshold. 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 value). This process continues until no more expansion is possible. The antialiasing parameter allows the final selection mask to contain intermediate values based on close misses to the threshold bar at pixels along the seed fill boundary. Feathering can be enabled optionally and is controlled with the 'feather-radius' paramter. If the 'sample-merged' parameter is TRUE, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of a merged sampling, the supplied drawable is ignored. If"
 
787
  "the sample is merged, the specified coordinates are relative to the image origin; otherwise, they are relative to the drawable's origin.",
 
788
                                     "David Gowers",
 
789
                                     "David Gowers",
 
790
                                     "2006",
 
791
                                     NULL);
 
792
  gimp_procedure_add_argument (procedure,
 
793
                               gimp_param_spec_drawable_id ("drawable",
 
794
                                                            "drawable",
 
795
                                                            "The affected drawable",
 
796
                                                            pdb->gimp, FALSE,
 
797
                                                            GIMP_PARAM_READWRITE));
 
798
  gimp_procedure_add_argument (procedure,
 
799
                               g_param_spec_double ("x",
 
800
                                                    "x",
 
801
                                                    "x coordinate of initial seed fill point: (image coordinates)",
 
802
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
 
803
                                                    GIMP_PARAM_READWRITE));
 
804
  gimp_procedure_add_argument (procedure,
 
805
                               g_param_spec_double ("y",
 
806
                                                    "y",
 
807
                                                    "y coordinate of initial seed fill point: (image coordinates)",
 
808
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
 
809
                                                    GIMP_PARAM_READWRITE));
 
810
  gimp_procedure_add_argument (procedure,
 
811
                               gimp_param_spec_int32 ("threshold",
 
812
                                                      "threshold",
 
813
                                                      "Threshold in intensity levels",
 
814
                                                      0, 255, 0,
 
815
                                                      GIMP_PARAM_READWRITE));
 
816
  gimp_procedure_add_argument (procedure,
 
817
                               g_param_spec_enum ("operation",
 
818
                                                  "operation",
 
819
                                                  "The selection operation",
 
820
                                                  GIMP_TYPE_CHANNEL_OPS,
 
821
                                                  GIMP_CHANNEL_OP_ADD,
 
822
                                                  GIMP_PARAM_READWRITE));
 
823
  gimp_procedure_add_argument (procedure,
 
824
                               g_param_spec_boolean ("antialias",
 
825
                                                     "antialias",
 
826
                                                     "Antialiasing",
 
827
                                                     FALSE,
 
828
                                                     GIMP_PARAM_READWRITE));
 
829
  gimp_procedure_add_argument (procedure,
 
830
                               g_param_spec_boolean ("feather",
 
831
                                                     "feather",
 
832
                                                     "Feather option for selections",
 
833
                                                     FALSE,
 
834
                                                     GIMP_PARAM_READWRITE));
 
835
  gimp_procedure_add_argument (procedure,
 
836
                               g_param_spec_double ("feather-radius-x",
 
837
                                                    "feather radius x",
 
838
                                                    "Radius for feather operation in X direction",
 
839
                                                    0, G_MAXDOUBLE, 0,
 
840
                                                    GIMP_PARAM_READWRITE));
 
841
  gimp_procedure_add_argument (procedure,
 
842
                               g_param_spec_double ("feather-radius-y",
 
843
                                                    "feather radius y",
 
844
                                                    "Radius for feather operation in Y direction",
 
845
                                                    0, G_MAXDOUBLE, 0,
 
846
                                                    GIMP_PARAM_READWRITE));
 
847
  gimp_procedure_add_argument (procedure,
 
848
                               g_param_spec_boolean ("sample-merged",
 
849
                                                     "sample merged",
 
850
                                                     "Use the composite image, not the drawable",
 
851
                                                     FALSE,
 
852
                                                     GIMP_PARAM_READWRITE));
 
853
  gimp_procedure_add_argument (procedure,
 
854
                               g_param_spec_boolean ("select-transparent",
 
855
                                                     "select transparent",
 
856
                                                     "Whether to consider transparent pixels for selection. If TRUE, transparency is considered as a unique selectable color.",
 
857
                                                     FALSE,
 
858
                                                     GIMP_PARAM_READWRITE));
 
859
  gimp_procedure_add_argument (procedure,
 
860
                               g_param_spec_enum ("select-criterion",
 
861
                                                  "select criterion",
 
862
                                                  "The criterion used to determine color similarity. SELECT_CRITERION_COMPOSITE is the standard choice.",
 
863
                                                  GIMP_TYPE_SELECT_CRITERION,
 
864
                                                  GIMP_SELECT_CRITERION_COMPOSITE,
 
865
                                                  GIMP_PARAM_READWRITE));
 
866
  gimp_pdb_register_procedure (pdb, procedure);
 
867
  g_object_unref (procedure);
 
868
 
 
869
  /*
 
870
   * gimp-rect-select
 
871
   */
 
872
  procedure = gimp_procedure_new (rect_select_invoker);
 
873
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-rect-select");
 
874
  gimp_procedure_set_static_strings (procedure,
 
875
                                     "gimp-rect-select",
 
876
                                     "Create a rectangular selection over the specified image;",
 
877
                                     "This tool creates a rectangular selection over the specified image. The rectangular region can be either added to, subtracted from, or replace the contents of the previous selection mask. If the feather option is enabled, the resulting selection is blurred before combining. The blur is a gaussian blur with the specified feather radius.",
 
878
                                     "Spencer Kimball & Peter Mattis",
 
879
                                     "Spencer Kimball & Peter Mattis",
 
880
                                     "1995-1996",
 
881
                                     NULL);
 
882
  gimp_procedure_add_argument (procedure,
 
883
                               gimp_param_spec_image_id ("image",
 
884
                                                         "image",
 
885
                                                         "The image",
 
886
                                                         pdb->gimp, FALSE,
 
887
                                                         GIMP_PARAM_READWRITE));
 
888
  gimp_procedure_add_argument (procedure,
 
889
                               g_param_spec_double ("x",
 
890
                                                    "x",
 
891
                                                    "x coordinate of upper-left corner of rectangle",
 
892
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
 
893
                                                    GIMP_PARAM_READWRITE));
 
894
  gimp_procedure_add_argument (procedure,
 
895
                               g_param_spec_double ("y",
 
896
                                                    "y",
 
897
                                                    "y coordinate of upper-left corner of rectangle",
 
898
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
 
899
                                                    GIMP_PARAM_READWRITE));
 
900
  gimp_procedure_add_argument (procedure,
 
901
                               g_param_spec_double ("width",
 
902
                                                    "width",
 
903
                                                    "The width of the rectangle",
 
904
                                                    0, G_MAXDOUBLE, 0,
 
905
                                                    GIMP_PARAM_READWRITE));
 
906
  gimp_procedure_add_argument (procedure,
 
907
                               g_param_spec_double ("height",
 
908
                                                    "height",
 
909
                                                    "The height of the rectangle",
 
910
                                                    0, G_MAXDOUBLE, 0,
 
911
                                                    GIMP_PARAM_READWRITE));
 
912
  gimp_procedure_add_argument (procedure,
 
913
                               g_param_spec_enum ("operation",
 
914
                                                  "operation",
 
915
                                                  "The selection operation",
 
916
                                                  GIMP_TYPE_CHANNEL_OPS,
 
917
                                                  GIMP_CHANNEL_OP_ADD,
 
918
                                                  GIMP_PARAM_READWRITE));
 
919
  gimp_procedure_add_argument (procedure,
 
920
                               g_param_spec_boolean ("feather",
 
921
                                                     "feather",
 
922
                                                     "Feather option for selections",
 
923
                                                     FALSE,
 
924
                                                     GIMP_PARAM_READWRITE));
 
925
  gimp_procedure_add_argument (procedure,
 
926
                               g_param_spec_double ("feather-radius",
 
927
                                                    "feather radius",
 
928
                                                    "Radius for feather operation",
 
929
                                                    0, G_MAXDOUBLE, 0,
 
930
                                                    GIMP_PARAM_READWRITE));
 
931
  gimp_pdb_register_procedure (pdb, procedure);
 
932
  g_object_unref (procedure);
 
933
 
 
934
  /*
 
935
   * gimp-round-rect-select
 
936
   */
 
937
  procedure = gimp_procedure_new (round_rect_select_invoker);
 
938
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-round-rect-select");
 
939
  gimp_procedure_set_static_strings (procedure,
 
940
                                     "gimp-round-rect-select",
 
941
                                     "Create a rectangular selection with round corners over the specified image;",
 
942
                                     "This tool creates a rectangular selection with round corners over the specified image. The rectangular region can be either added to, subtracted from, or replace the contents of the previous selection mask. If the feather option is enabled, the resulting selection is blurred before combining. The blur is a gaussian blur with the specified feather radius.",
 
943
                                     "Martin Nordholts",
 
944
                                     "Martin Nordholts",
 
945
                                     "2006",
 
946
                                     NULL);
 
947
  gimp_procedure_add_argument (procedure,
 
948
                               gimp_param_spec_image_id ("image",
 
949
                                                         "image",
 
950
                                                         "The image",
 
951
                                                         pdb->gimp, FALSE,
 
952
                                                         GIMP_PARAM_READWRITE));
 
953
  gimp_procedure_add_argument (procedure,
 
954
                               g_param_spec_double ("x",
 
955
                                                    "x",
 
956
                                                    "x coordinate of upper-left corner of rectangle",
 
957
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
 
958
                                                    GIMP_PARAM_READWRITE));
 
959
  gimp_procedure_add_argument (procedure,
 
960
                               g_param_spec_double ("y",
 
961
                                                    "y",
 
962
                                                    "y coordinate of upper-left corner of rectangle",
 
963
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
 
964
                                                    GIMP_PARAM_READWRITE));
 
965
  gimp_procedure_add_argument (procedure,
 
966
                               g_param_spec_double ("width",
 
967
                                                    "width",
 
968
                                                    "The width of the rectangle",
 
969
                                                    0, G_MAXDOUBLE, 0,
 
970
                                                    GIMP_PARAM_READWRITE));
 
971
  gimp_procedure_add_argument (procedure,
 
972
                               g_param_spec_double ("height",
 
973
                                                    "height",
 
974
                                                    "The height of the rectangle",
 
975
                                                    0, G_MAXDOUBLE, 0,
 
976
                                                    GIMP_PARAM_READWRITE));
 
977
  gimp_procedure_add_argument (procedure,
 
978
                               g_param_spec_double ("corner-radius-x",
 
979
                                                    "corner radius x",
 
980
                                                    "The corner radius in X direction",
 
981
                                                    0, G_MAXDOUBLE, 0,
 
982
                                                    GIMP_PARAM_READWRITE));
 
983
  gimp_procedure_add_argument (procedure,
 
984
                               g_param_spec_double ("corner-radius-y",
 
985
                                                    "corner radius y",
 
986
                                                    "The corner radius in Y direction",
 
987
                                                    0, G_MAXDOUBLE, 0,
 
988
                                                    GIMP_PARAM_READWRITE));
 
989
  gimp_procedure_add_argument (procedure,
 
990
                               g_param_spec_enum ("operation",
 
991
                                                  "operation",
 
992
                                                  "The selection operation",
 
993
                                                  GIMP_TYPE_CHANNEL_OPS,
 
994
                                                  GIMP_CHANNEL_OP_ADD,
 
995
                                                  GIMP_PARAM_READWRITE));
 
996
  gimp_procedure_add_argument (procedure,
 
997
                               g_param_spec_boolean ("antialias",
 
998
                                                     "antialias",
 
999
                                                     "Antialiasing",
 
1000
                                                     FALSE,
 
1001
                                                     GIMP_PARAM_READWRITE));
 
1002
  gimp_procedure_add_argument (procedure,
 
1003
                               g_param_spec_boolean ("feather",
 
1004
                                                     "feather",
 
1005
                                                     "Feather option for selections",
 
1006
                                                     FALSE,
 
1007
                                                     GIMP_PARAM_READWRITE));
 
1008
  gimp_procedure_add_argument (procedure,
 
1009
                               g_param_spec_double ("feather-radius-x",
 
1010
                                                    "feather radius x",
 
1011
                                                    "Radius for feather operation in X direction",
 
1012
                                                    0, G_MAXDOUBLE, 0,
 
1013
                                                    GIMP_PARAM_READWRITE));
 
1014
  gimp_procedure_add_argument (procedure,
 
1015
                               g_param_spec_double ("feather-radius-y",
 
1016
                                                    "feather radius y",
 
1017
                                                    "Radius for feather operation in Y direction",
 
1018
                                                    0, G_MAXDOUBLE, 0,
 
1019
                                                    GIMP_PARAM_READWRITE));
 
1020
  gimp_pdb_register_procedure (pdb, procedure);
 
1021
  g_object_unref (procedure);
 
1022
}