185
154
gboolean feather;
186
155
gdouble feather_radius;
188
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
189
if (! GIMP_IS_IMAGE (gimage))
192
x = args[1].value.pdb_float;
194
y = args[2].value.pdb_float;
196
width = args[3].value.pdb_float;
200
height = args[4].value.pdb_float;
204
operation = args[5].value.pdb_int;
205
if (operation < GIMP_CHANNEL_OP_ADD || operation > GIMP_CHANNEL_OP_INTERSECT)
208
antialias = args[6].value.pdb_int ? TRUE : FALSE;
210
feather = args[7].value.pdb_int ? TRUE : FALSE;
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]);
215
gimp_channel_select_ellipse (gimp_image_get_mask (gimage),
217
(gint) width, (gint) height,
169
gimp_channel_select_ellipse (gimp_image_get_mask (image),
171
(gint) width, (gint) height,
224
return procedural_db_return_args (&ellipse_select_proc, success);
180
return gimp_procedure_get_return_values (procedure, success);
227
static ProcArg ellipse_select_inargs[] =
237
"x coordinate of upper-left corner of ellipse bounding box"
242
"y coordinate of upper-left corner of ellipse bounding box"
247
"The width of the ellipse: 0 < width"
252
"The height of the ellipse: 0 < height"
257
"The selection operation: { GIMP_CHANNEL_OP_ADD (0), GIMP_CHANNEL_OP_SUBTRACT (1), GIMP_CHANNEL_OP_REPLACE (2), GIMP_CHANNEL_OP_INTERSECT (3) }"
262
"Antialiasing (TRUE or FALSE)"
267
"Feather option for selections"
272
"Radius for feather operation"
276
static ProcRecord ellipse_select_proc =
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",
287
ellipse_select_inargs,
290
{ { ellipse_select_invoker } }
294
free_select_invoker (Gimp *gimp,
295
GimpContext *context,
296
GimpProgress *progress,
184
free_select_invoker (GimpProcedure *procedure,
186
GimpContext *context,
187
GimpProgress *progress,
188
const GValueArray *args)
299
190
gboolean success = TRUE;
303
194
gint32 operation;
304
195
gboolean antialias;
305
196
gboolean feather;
306
197
gdouble feather_radius;
308
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
309
if (! GIMP_IS_IMAGE (gimage))
312
num_segs = args[1].value.pdb_int;
318
segs = (gdouble *) args[2].value.pdb_pointer;
320
operation = args[3].value.pdb_int;
321
if (operation < GIMP_CHANNEL_OP_ADD || operation > GIMP_CHANNEL_OP_INTERSECT)
324
antialias = args[4].value.pdb_int ? TRUE : FALSE;
326
feather = args[5].value.pdb_int ? TRUE : FALSE;
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]);
331
gimp_channel_select_polygon (gimp_image_get_mask (gimage),
334
(GimpVector2 *) segs,
209
gimp_channel_select_polygon (gimp_image_get_mask (image),
212
(GimpVector2 *) segs,
341
return procedural_db_return_args (&free_select_proc, success);
221
return gimp_procedure_get_return_values (procedure, success);
344
static ProcArg free_select_inargs[] =
354
"Number of points (count 1 coordinate as two points)"
359
"Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y}"
364
"The selection operation: { GIMP_CHANNEL_OP_ADD (0), GIMP_CHANNEL_OP_SUBTRACT (1), GIMP_CHANNEL_OP_REPLACE (2), GIMP_CHANNEL_OP_INTERSECT (3) }"
369
"Antialiasing (TRUE or FALSE)"
374
"Feather option for selections"
379
"Radius for feather operation"
383
static ProcRecord free_select_proc =
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",
397
{ { free_select_invoker } }
401
fuzzy_select_invoker (Gimp *gimp,
402
GimpContext *context,
403
GimpProgress *progress,
225
fuzzy_select_invoker (GimpProcedure *procedure,
227
GimpContext *context,
228
GimpProgress *progress,
229
const GValueArray *args)
406
231
gboolean success = TRUE;
407
232
GimpDrawable *drawable;
542
342
gboolean feather;
543
343
gdouble feather_radius;
545
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
546
if (! GIMP_IS_IMAGE (gimage))
549
x = args[1].value.pdb_float;
551
y = args[2].value.pdb_float;
553
width = args[3].value.pdb_float;
557
height = args[4].value.pdb_float;
561
operation = args[5].value.pdb_int;
562
if (operation < GIMP_CHANNEL_OP_ADD || operation > GIMP_CHANNEL_OP_INTERSECT)
565
feather = args[6].value.pdb_int ? TRUE : FALSE;
567
feather_radius = args[7].value.pdb_float;
570
gimp_channel_select_rectangle (gimp_image_get_mask (gimage),
572
(gint) width, (gint) height,
578
return procedural_db_return_args (&rect_select_proc, success);
581
static ProcArg rect_select_inargs[] =
591
"x coordinate of upper-left corner of rectangle"
596
"y coordinate of upper-left corner of rectangle"
601
"The width of the rectangle: 0 < width"
606
"The height of the rectangle: 0 < height"
611
"The selection operation: { GIMP_CHANNEL_OP_ADD (0), GIMP_CHANNEL_OP_SUBTRACT (1), GIMP_CHANNEL_OP_REPLACE (2), GIMP_CHANNEL_OP_INTERSECT (3) }"
616
"Feather option for selections"
621
"Radius for feather operation"
625
static ProcRecord rect_select_proc =
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",
639
{ { rect_select_invoker } }
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]);
356
gimp_channel_select_rectangle (gimp_image_get_mask (image),
358
(gint) width, (gint) height,
366
return gimp_procedure_get_return_values (procedure, success);
370
round_rect_select_invoker (GimpProcedure *procedure,
372
GimpContext *context,
373
GimpProgress *progress,
374
const GValueArray *args)
376
gboolean success = TRUE;
382
gdouble corner_radius_x;
383
gdouble corner_radius_y;
387
gdouble feather_radius_x;
388
gdouble feather_radius_y;
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]);
405
gimp_channel_select_round_rect (gimp_image_get_mask (image),
407
(gint) width, (gint) height,
418
return gimp_procedure_get_return_values (procedure, success);
422
register_selection_tools_procs (GimpPDB *pdb)
424
GimpProcedure *procedure;
427
* gimp-by-color-select
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",
439
gimp_procedure_add_argument (procedure,
440
gimp_param_spec_drawable_id ("drawable",
442
"The affected drawable",
444
GIMP_PARAM_READWRITE));
445
gimp_procedure_add_argument (procedure,
446
gimp_param_spec_rgb ("color",
448
"The color to select",
451
GIMP_PARAM_READWRITE));
452
gimp_procedure_add_argument (procedure,
453
gimp_param_spec_int32 ("threshold",
455
"Threshold in intensity levels",
457
GIMP_PARAM_READWRITE));
458
gimp_procedure_add_argument (procedure,
459
g_param_spec_enum ("operation",
461
"The selection operation",
462
GIMP_TYPE_CHANNEL_OPS,
464
GIMP_PARAM_READWRITE));
465
gimp_procedure_add_argument (procedure,
466
g_param_spec_boolean ("antialias",
470
GIMP_PARAM_READWRITE));
471
gimp_procedure_add_argument (procedure,
472
g_param_spec_boolean ("feather",
474
"Feather option for selections",
476
GIMP_PARAM_READWRITE));
477
gimp_procedure_add_argument (procedure,
478
g_param_spec_double ("feather-radius",
480
"Radius for feather operation",
482
GIMP_PARAM_READWRITE));
483
gimp_procedure_add_argument (procedure,
484
g_param_spec_boolean ("sample-merged",
486
"Use the composite image, not the drawable",
488
GIMP_PARAM_READWRITE));
489
gimp_pdb_register_procedure (pdb, procedure);
490
g_object_unref (procedure);
493
* gimp-by-color-select-full
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.",
505
gimp_procedure_add_argument (procedure,
506
gimp_param_spec_drawable_id ("drawable",
508
"The affected drawable",
510
GIMP_PARAM_READWRITE));
511
gimp_procedure_add_argument (procedure,
512
gimp_param_spec_rgb ("color",
514
"The color to select",
517
GIMP_PARAM_READWRITE));
518
gimp_procedure_add_argument (procedure,
519
gimp_param_spec_int32 ("threshold",
521
"Threshold in intensity levels",
523
GIMP_PARAM_READWRITE));
524
gimp_procedure_add_argument (procedure,
525
g_param_spec_enum ("operation",
527
"The selection operation",
528
GIMP_TYPE_CHANNEL_OPS,
530
GIMP_PARAM_READWRITE));
531
gimp_procedure_add_argument (procedure,
532
g_param_spec_boolean ("antialias",
536
GIMP_PARAM_READWRITE));
537
gimp_procedure_add_argument (procedure,
538
g_param_spec_boolean ("feather",
540
"Feather option for selections",
542
GIMP_PARAM_READWRITE));
543
gimp_procedure_add_argument (procedure,
544
g_param_spec_double ("feather-radius-x",
546
"Radius for feather operation in X direction",
548
GIMP_PARAM_READWRITE));
549
gimp_procedure_add_argument (procedure,
550
g_param_spec_double ("feather-radius-y",
552
"Radius for feather operation in Y direction",
554
GIMP_PARAM_READWRITE));
555
gimp_procedure_add_argument (procedure,
556
g_param_spec_boolean ("sample-merged",
558
"Use the composite image, not the drawable",
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.",
566
GIMP_PARAM_READWRITE));
567
gimp_procedure_add_argument (procedure,
568
g_param_spec_enum ("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);
578
* gimp-ellipse-select
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",
590
gimp_procedure_add_argument (procedure,
591
gimp_param_spec_image_id ("image",
595
GIMP_PARAM_READWRITE));
596
gimp_procedure_add_argument (procedure,
597
g_param_spec_double ("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",
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",
611
"The width of the ellipse",
613
GIMP_PARAM_READWRITE));
614
gimp_procedure_add_argument (procedure,
615
g_param_spec_double ("height",
617
"The height of the ellipse",
619
GIMP_PARAM_READWRITE));
620
gimp_procedure_add_argument (procedure,
621
g_param_spec_enum ("operation",
623
"The selection operation",
624
GIMP_TYPE_CHANNEL_OPS,
626
GIMP_PARAM_READWRITE));
627
gimp_procedure_add_argument (procedure,
628
g_param_spec_boolean ("antialias",
632
GIMP_PARAM_READWRITE));
633
gimp_procedure_add_argument (procedure,
634
g_param_spec_boolean ("feather",
636
"Feather option for selections",
638
GIMP_PARAM_READWRITE));
639
gimp_procedure_add_argument (procedure,
640
g_param_spec_double ("feather-radius",
642
"Radius for feather operation",
644
GIMP_PARAM_READWRITE));
645
gimp_pdb_register_procedure (pdb, procedure);
646
g_object_unref (procedure);
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,
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",
661
gimp_procedure_add_argument (procedure,
662
gimp_param_spec_image_id ("image",
666
GIMP_PARAM_READWRITE));
667
gimp_procedure_add_argument (procedure,
668
gimp_param_spec_int32 ("num-segs",
670
"Number of points (count 1 coordinate as two points)",
672
GIMP_PARAM_READWRITE));
673
gimp_procedure_add_argument (procedure,
674
gimp_param_spec_float_array ("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",
681
"The selection operation",
682
GIMP_TYPE_CHANNEL_OPS,
684
GIMP_PARAM_READWRITE));
685
gimp_procedure_add_argument (procedure,
686
g_param_spec_boolean ("antialias",
690
GIMP_PARAM_READWRITE));
691
gimp_procedure_add_argument (procedure,
692
g_param_spec_boolean ("feather",
694
"Feather option for selections",
696
GIMP_PARAM_READWRITE));
697
gimp_procedure_add_argument (procedure,
698
g_param_spec_double ("feather-radius",
700
"Radius for feather operation",
702
GIMP_PARAM_READWRITE));
703
gimp_pdb_register_procedure (pdb, procedure);
704
g_object_unref (procedure);
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,
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",
720
gimp_procedure_add_argument (procedure,
721
gimp_param_spec_drawable_id ("drawable",
723
"The affected drawable",
725
GIMP_PARAM_READWRITE));
726
gimp_procedure_add_argument (procedure,
727
g_param_spec_double ("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",
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",
741
"Threshold in intensity levels",
743
GIMP_PARAM_READWRITE));
744
gimp_procedure_add_argument (procedure,
745
g_param_spec_enum ("operation",
747
"The selection operation",
748
GIMP_TYPE_CHANNEL_OPS,
750
GIMP_PARAM_READWRITE));
751
gimp_procedure_add_argument (procedure,
752
g_param_spec_boolean ("antialias",
756
GIMP_PARAM_READWRITE));
757
gimp_procedure_add_argument (procedure,
758
g_param_spec_boolean ("feather",
760
"Feather option for selections",
762
GIMP_PARAM_READWRITE));
763
gimp_procedure_add_argument (procedure,
764
g_param_spec_double ("feather-radius",
766
"Radius for feather operation",
768
GIMP_PARAM_READWRITE));
769
gimp_procedure_add_argument (procedure,
770
g_param_spec_boolean ("sample-merged",
772
"Use the composite image, not the drawable",
774
GIMP_PARAM_READWRITE));
775
gimp_pdb_register_procedure (pdb, procedure);
776
g_object_unref (procedure);
779
* gimp-fuzzy-select-full
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.",
792
gimp_procedure_add_argument (procedure,
793
gimp_param_spec_drawable_id ("drawable",
795
"The affected drawable",
797
GIMP_PARAM_READWRITE));
798
gimp_procedure_add_argument (procedure,
799
g_param_spec_double ("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",
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",
813
"Threshold in intensity levels",
815
GIMP_PARAM_READWRITE));
816
gimp_procedure_add_argument (procedure,
817
g_param_spec_enum ("operation",
819
"The selection operation",
820
GIMP_TYPE_CHANNEL_OPS,
822
GIMP_PARAM_READWRITE));
823
gimp_procedure_add_argument (procedure,
824
g_param_spec_boolean ("antialias",
828
GIMP_PARAM_READWRITE));
829
gimp_procedure_add_argument (procedure,
830
g_param_spec_boolean ("feather",
832
"Feather option for selections",
834
GIMP_PARAM_READWRITE));
835
gimp_procedure_add_argument (procedure,
836
g_param_spec_double ("feather-radius-x",
838
"Radius for feather operation in X direction",
840
GIMP_PARAM_READWRITE));
841
gimp_procedure_add_argument (procedure,
842
g_param_spec_double ("feather-radius-y",
844
"Radius for feather operation in Y direction",
846
GIMP_PARAM_READWRITE));
847
gimp_procedure_add_argument (procedure,
848
g_param_spec_boolean ("sample-merged",
850
"Use the composite image, not the drawable",
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.",
858
GIMP_PARAM_READWRITE));
859
gimp_procedure_add_argument (procedure,
860
g_param_spec_enum ("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);
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,
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",
882
gimp_procedure_add_argument (procedure,
883
gimp_param_spec_image_id ("image",
887
GIMP_PARAM_READWRITE));
888
gimp_procedure_add_argument (procedure,
889
g_param_spec_double ("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",
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",
903
"The width of the rectangle",
905
GIMP_PARAM_READWRITE));
906
gimp_procedure_add_argument (procedure,
907
g_param_spec_double ("height",
909
"The height of the rectangle",
911
GIMP_PARAM_READWRITE));
912
gimp_procedure_add_argument (procedure,
913
g_param_spec_enum ("operation",
915
"The selection operation",
916
GIMP_TYPE_CHANNEL_OPS,
918
GIMP_PARAM_READWRITE));
919
gimp_procedure_add_argument (procedure,
920
g_param_spec_boolean ("feather",
922
"Feather option for selections",
924
GIMP_PARAM_READWRITE));
925
gimp_procedure_add_argument (procedure,
926
g_param_spec_double ("feather-radius",
928
"Radius for feather operation",
930
GIMP_PARAM_READWRITE));
931
gimp_pdb_register_procedure (pdb, procedure);
932
g_object_unref (procedure);
935
* gimp-round-rect-select
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.",
947
gimp_procedure_add_argument (procedure,
948
gimp_param_spec_image_id ("image",
952
GIMP_PARAM_READWRITE));
953
gimp_procedure_add_argument (procedure,
954
g_param_spec_double ("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",
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",
968
"The width of the rectangle",
970
GIMP_PARAM_READWRITE));
971
gimp_procedure_add_argument (procedure,
972
g_param_spec_double ("height",
974
"The height of the rectangle",
976
GIMP_PARAM_READWRITE));
977
gimp_procedure_add_argument (procedure,
978
g_param_spec_double ("corner-radius-x",
980
"The corner radius in X direction",
982
GIMP_PARAM_READWRITE));
983
gimp_procedure_add_argument (procedure,
984
g_param_spec_double ("corner-radius-y",
986
"The corner radius in Y direction",
988
GIMP_PARAM_READWRITE));
989
gimp_procedure_add_argument (procedure,
990
g_param_spec_enum ("operation",
992
"The selection operation",
993
GIMP_TYPE_CHANNEL_OPS,
995
GIMP_PARAM_READWRITE));
996
gimp_procedure_add_argument (procedure,
997
g_param_spec_boolean ("antialias",
1001
GIMP_PARAM_READWRITE));
1002
gimp_procedure_add_argument (procedure,
1003
g_param_spec_boolean ("feather",
1005
"Feather option for selections",
1007
GIMP_PARAM_READWRITE));
1008
gimp_procedure_add_argument (procedure,
1009
g_param_spec_double ("feather-radius-x",
1011
"Radius for feather operation in X direction",
1013
GIMP_PARAM_READWRITE));
1014
gimp_procedure_add_argument (procedure,
1015
g_param_spec_double ("feather-radius-y",
1017
"Radius for feather operation in Y direction",
1019
GIMP_PARAM_READWRITE));
1020
gimp_pdb_register_procedure (pdb, procedure);
1021
g_object_unref (procedure);