1 /* GIMP - The GNU Image Manipulation Program
2  * Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
16  */
17 
18 /* NOTE: This file is auto-generated by pdbgen.pl. */
19 
20 #include "config.h"
21 
22 #include <cairo.h>
23 
24 #include <gegl.h>
25 
26 #include <gdk-pixbuf/gdk-pixbuf.h>
27 
28 #include "libgimpbase/gimpbase.h"
29 #include "libgimpcolor/gimpcolor.h"
30 #include "libgimpconfig/gimpconfig.h"
31 #include "libgimpmath/gimpmath.h"
32 
33 #include "libgimpbase/gimpbase.h"
34 
35 #include "pdb-types.h"
36 
37 #include "config/gimpcoreconfig.h"
38 #include "core/gimp.h"
39 #include "core/gimpchannel.h"
40 #include "core/gimpcontext.h"
41 #include "core/gimpdrawable-operation.h"
42 #include "core/gimpdrawable.h"
43 #include "core/gimpimage-color-profile.h"
44 #include "core/gimpimage-crop.h"
45 #include "core/gimpimage-resize.h"
46 #include "core/gimpimage-rotate.h"
47 #include "core/gimpimage-undo.h"
48 #include "core/gimpimage.h"
49 #include "core/gimpparamspecs.h"
50 #include "core/gimppickable-auto-shrink.h"
51 #include "core/gimppickable.h"
52 #include "gegl/gimp-babl.h"
53 #include "gegl/gimp-gegl-utils.h"
54 
55 #include "gimppdb.h"
56 #include "gimppdberror.h"
57 #include "gimppdb-utils.h"
58 #include "gimpprocedure.h"
59 #include "internal-procs.h"
60 
61 #include "gimp-intl.h"
62 
63 
64 static GeglNode *
wrap_in_graph(GeglNode * node)65 wrap_in_graph (GeglNode *node)
66 {
67   GeglNode *new_node;
68   GeglNode *input;
69   GeglNode *output;
70 
71   new_node = gegl_node_new ();
72 
73   gegl_node_add_child (new_node, node);
74   g_object_unref (node);
75 
76   gimp_gegl_node_set_underlying_operation (new_node, node);
77 
78   input  = gegl_node_get_input_proxy  (new_node, "input");
79   output = gegl_node_get_output_proxy (new_node, "output");
80 
81   gegl_node_link_many (input,
82                        node,
83                        output,
84                        NULL);
85 
86   return new_node;
87 }
88 
89 static GeglNode *
wrap_in_selection_bounds(GeglNode * node,GimpDrawable * drawable)90 wrap_in_selection_bounds (GeglNode     *node,
91                           GimpDrawable *drawable)
92 {
93   gint x, y;
94   gint width, height;
95 
96   if (gimp_item_mask_intersect (GIMP_ITEM (drawable),
97                                 &x, &y, &width, &height))
98     {
99       GeglNode *new_node;
100       GeglNode *input;
101       GeglNode *output;
102       GeglNode *translate_before;
103       GeglNode *crop;
104       GeglNode *translate_after;
105 
106       new_node = gegl_node_new ();
107 
108       gegl_node_add_child (new_node, node);
109       g_object_unref (node);
110 
111       gimp_gegl_node_set_underlying_operation (new_node, node);
112 
113       input  = gegl_node_get_input_proxy  (new_node, "input");
114       output = gegl_node_get_output_proxy (new_node, "output");
115 
116       translate_before = gegl_node_new_child (new_node,
117                                               "operation", "gegl:translate",
118                                               "x",         (gdouble) -x,
119                                               "y",         (gdouble) -y,
120                                               NULL);
121       crop = gegl_node_new_child (new_node,
122                                   "operation", "gegl:crop",
123                                   "width",     (gdouble) width,
124                                   "height",    (gdouble) height,
125                                   NULL);
126       translate_after = gegl_node_new_child (new_node,
127                                              "operation", "gegl:translate",
128                                              "x",         (gdouble) x,
129                                              "y",         (gdouble) y,
130                                              NULL);
131 
132       gegl_node_link_many (input,
133                            translate_before,
134                            crop,
135                            node,
136                            translate_after,
137                            output,
138                            NULL);
139 
140       return new_node;
141     }
142   else
143     {
144       return node;
145     }
146 }
147 
148 static GeglNode *
wrap_in_gamma_cast(GeglNode * node,GimpDrawable * drawable)149 wrap_in_gamma_cast (GeglNode     *node,
150                     GimpDrawable *drawable)
151 {
152   if (! gimp_drawable_get_linear (drawable))
153     {
154       const Babl *drawable_format;
155       const Babl *cast_format;
156       GeglNode   *new_node;
157       GeglNode   *input;
158       GeglNode   *output;
159       GeglNode   *cast_before;
160       GeglNode   *cast_after;
161 
162       drawable_format = gimp_drawable_get_format (drawable);
163 
164       cast_format =
165         gimp_babl_format (gimp_babl_format_get_base_type (drawable_format),
166                           gimp_babl_precision (gimp_babl_format_get_component_type (drawable_format),
167                                                TRUE),
168                           babl_format_has_alpha (drawable_format));
169 
170       new_node = gegl_node_new ();
171 
172       gegl_node_add_child (new_node, node);
173       g_object_unref (node);
174 
175       gimp_gegl_node_set_underlying_operation (new_node, node);
176 
177       input  = gegl_node_get_input_proxy  (new_node, "input");
178       output = gegl_node_get_output_proxy (new_node, "output");
179 
180       cast_before = gegl_node_new_child (new_node,
181                                          "operation",     "gegl:cast-format",
182                                          "input-format",  drawable_format,
183                                          "output-format", cast_format,
184                                          NULL);
185       cast_after  = gegl_node_new_child (new_node,
186                                          "operation",     "gegl:cast-format",
187                                          "input-format",  cast_format,
188                                          "output-format", drawable_format,
189                                          NULL);
190 
191       gegl_node_link_many (input,
192                            cast_before,
193                            node,
194                            cast_after,
195                            output,
196                            NULL);
197 
198       return new_node;
199     }
200   else
201     {
202       return node;
203     }
204 }
205 
206 static GeglNode *
create_buffer_source_node(GeglNode * parent,GimpDrawable * drawable)207 create_buffer_source_node (GeglNode     *parent,
208                            GimpDrawable *drawable)
209 {
210   GeglNode   *new_node;
211   GeglBuffer *buffer;
212 
213   buffer = gimp_drawable_get_buffer (drawable);
214   g_object_ref (buffer);
215   new_node = gegl_node_new_child (parent,
216                                   "operation", "gegl:buffer-source",
217                                   "buffer", buffer,
218                                   NULL);
219   g_object_unref (buffer);
220   return new_node;
221 }
222 
223 static gboolean
bump_map(GimpDrawable * drawable,GimpDrawable * bump_map,gdouble azimuth,gdouble elevation,gint depth,gint offset_x,gint offset_y,gdouble waterlevel,gdouble ambient,gboolean compensate,gboolean invert,gint type,gboolean tiled,GimpProgress * progress,GError ** error)224 bump_map (GimpDrawable *drawable,
225           GimpDrawable *bump_map,
226           gdouble       azimuth,
227           gdouble       elevation,
228           gint          depth,
229           gint          offset_x,
230           gint          offset_y,
231           gdouble       waterlevel,
232           gdouble       ambient,
233           gboolean      compensate,
234           gboolean      invert,
235           gint          type,
236           gboolean      tiled,
237           GimpProgress  *progress,
238           GError       **error)
239 {
240   if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
241                                  GIMP_PDB_ITEM_CONTENT, error) &&
242       gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
243     {
244       GeglNode *graph;
245       GeglNode *node;
246       GeglNode *src_node;
247 
248       node = gegl_node_new_child (NULL,
249                                   "operation", "gegl:bump-map",
250                                   "tiled",      tiled,
251                                   "type",       type,
252                                   "compensate", compensate,
253                                   "invert",     invert,
254                                   "azimuth",    azimuth,
255                                   "elevation",  elevation,
256                                   "depth",      depth,
257                                   "offset_x",   offset_x,
258                                   "offset_y",   offset_y,
259                                   "waterlevel", waterlevel,
260                                   "ambient",    ambient,
261                                   NULL);
262 
263       graph = wrap_in_graph (node);
264 
265       src_node = create_buffer_source_node (graph, bump_map);
266 
267       gegl_node_connect_to (src_node, "output", node, "aux");
268 
269       gimp_drawable_apply_operation (drawable, progress,
270                                      C_("undo-type", "Bump Map"),
271                                      graph);
272       g_object_unref (graph);
273 
274       return TRUE;
275     }
276     else
277       return FALSE;
278 }
279 
280 static gboolean
displace(GimpDrawable * drawable,gdouble amount_x,gdouble amount_y,gboolean do_x,gboolean do_y,GimpDrawable * displace_map_x,GimpDrawable * displace_map_y,gint displace_type,gint displace_mode,GimpProgress * progress,GError ** error)281 displace (GimpDrawable  *drawable,
282           gdouble        amount_x,
283           gdouble        amount_y,
284           gboolean       do_x,
285           gboolean       do_y,
286           GimpDrawable  *displace_map_x,
287           GimpDrawable  *displace_map_y,
288           gint           displace_type,
289           gint           displace_mode,
290           GimpProgress  *progress,
291           GError       **error)
292 {
293   if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
294                                  GIMP_PDB_ITEM_CONTENT, error) &&
295       gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
296     {
297       if (do_x || do_y)
298         {
299           GeglNode *graph;
300           GeglNode *node;
301           GeglAbyssPolicy abyss_policy = GEGL_ABYSS_NONE;
302 
303           switch (displace_type)
304             {
305               case 1:
306                 abyss_policy = GEGL_ABYSS_LOOP;
307                 break;
308               case 2:
309                 abyss_policy = GEGL_ABYSS_CLAMP;
310                 break;
311               case 3:
312                 abyss_policy = GEGL_ABYSS_BLACK;
313                 break;
314             }
315 
316           node = gegl_node_new_child (NULL,
317                                       "operation",     "gegl:displace",
318                                       "displace_mode", displace_mode,
319                                       "sampler_type",  GEGL_SAMPLER_CUBIC,
320                                       "abyss_policy",  abyss_policy,
321                                       "amount_x",      amount_x,
322                                       "amount_y",      amount_y,
323                                       NULL);
324 
325           graph = wrap_in_graph (node);
326 
327           if (do_x)
328             {
329               GeglNode *src_node;
330               src_node = create_buffer_source_node (graph, displace_map_x);
331               gegl_node_connect_to (src_node, "output", node, "aux");
332             }
333 
334           if (do_y)
335             {
336               GeglNode *src_node;
337               src_node = create_buffer_source_node (graph, displace_map_y);
338               gegl_node_connect_to (src_node, "output", node, "aux2");
339             }
340 
341           gimp_drawable_apply_operation (drawable, progress,
342                                          C_("undo-type", "Displace"),
343                                          graph);
344           g_object_unref (graph);
345         }
346 
347       return TRUE;
348     }
349   else
350     return FALSE;
351 }
352 
353 static gboolean
gaussian_blur(GimpDrawable * drawable,gdouble horizontal,gdouble vertical,GimpProgress * progress,GError ** error)354 gaussian_blur (GimpDrawable  *drawable,
355                gdouble        horizontal,
356                gdouble        vertical,
357                GimpProgress  *progress,
358                GError       **error)
359 {
360   if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
361                                  GIMP_PDB_ITEM_CONTENT, error) &&
362       gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
363     {
364       GeglNode *node;
365 
366       node = gegl_node_new_child (NULL,
367                                   "operation",    "gegl:gaussian-blur",
368                                   "std-dev-x",    horizontal * 0.32,
369                                   "std-dev-y",    vertical   * 0.32,
370                                   "abyss-policy", 1,
371                                   NULL);
372 
373       node = wrap_in_gamma_cast (node, drawable);
374 
375       gimp_drawable_apply_operation (drawable, progress,
376                                      C_("undo-type", "Gaussian Blur"),
377                                      node);
378       g_object_unref (node);
379 
380       return TRUE;
381     }
382 
383   return FALSE;
384 }
385 
386 static gint
newsprint_color_model(gint colorspace)387 newsprint_color_model (gint colorspace)
388 {
389   switch (colorspace)
390     {
391     case 0: return 1; /* black on white */
392     case 1: return 2; /* rgb */
393     case 2: return 3; /* cmyk */
394     case 3: return 1; /* black on white */
395     }
396 
397   return 2;
398 }
399 
400 static gint
newsprint_pattern(gint spotfn)401 newsprint_pattern (gint spotfn)
402 {
403   switch (spotfn)
404     {
405     case 0: return 1; /* circle */
406     case 1: return 0; /* line */
407     case 2: return 2; /* diamond */
408     case 3: return 4; /* ps circle */
409     case 4: return 2; /* FIXME postscript diamond */
410     }
411 
412   return 1;
413 }
414 
415 static gdouble
newsprint_angle(gdouble angle)416 newsprint_angle (gdouble angle)
417 {
418   while (angle > 180.0)
419     angle -= 360.0;
420 
421   while (angle < -180.0)
422     angle += 360.0;
423 
424   return angle;
425 }
426 
427 static GimpValueArray *
plug_in_alienmap2_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)428 plug_in_alienmap2_invoker (GimpProcedure         *procedure,
429                            Gimp                  *gimp,
430                            GimpContext           *context,
431                            GimpProgress          *progress,
432                            const GimpValueArray  *args,
433                            GError               **error)
434 {
435   gboolean success = TRUE;
436   GimpDrawable *drawable;
437   gdouble redfrequency;
438   gdouble redangle;
439   gdouble greenfrequency;
440   gdouble greenangle;
441   gdouble bluefrequency;
442   gdouble blueangle;
443   guint8 colormodel;
444   guint8 redmode;
445   guint8 greenmode;
446   guint8 bluemode;
447 
448   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
449   redfrequency = g_value_get_double (gimp_value_array_index (args, 3));
450   redangle = g_value_get_double (gimp_value_array_index (args, 4));
451   greenfrequency = g_value_get_double (gimp_value_array_index (args, 5));
452   greenangle = g_value_get_double (gimp_value_array_index (args, 6));
453   bluefrequency = g_value_get_double (gimp_value_array_index (args, 7));
454   blueangle = g_value_get_double (gimp_value_array_index (args, 8));
455   colormodel = g_value_get_uint (gimp_value_array_index (args, 9));
456   redmode = g_value_get_uint (gimp_value_array_index (args, 10));
457   greenmode = g_value_get_uint (gimp_value_array_index (args, 11));
458   bluemode = g_value_get_uint (gimp_value_array_index (args, 12));
459 
460   if (success)
461     {
462       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
463                                      GIMP_PDB_ITEM_CONTENT, error) &&
464           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
465         {
466           GeglNode *node =
467             gegl_node_new_child (NULL,
468                                  "operation", "gegl:alien-map",
469                                  "color-model",      (gint)     colormodel,
470                                  "cpn-1-frequency",  (gdouble)  redfrequency,
471                                  "cpn-2-frequency",  (gdouble)  greenfrequency,
472                                  "cpn-3-frequency",  (gdouble)  bluefrequency,
473                                  "cpn-1-phaseshift", (gdouble)  redangle,
474                                  "cpn-2-phaseshift", (gdouble)  greenangle,
475                                  "cpn-3-phaseshift", (gdouble)  blueangle,
476                                  "cpn-1-keep",       (gboolean) !redmode,
477                                  "cpn-2-keep",       (gboolean) !greenmode,
478                                  "cpn-3-keep",       (gboolean) !bluemode,
479                                  NULL);
480 
481           gimp_drawable_apply_operation (drawable, progress,
482                                          C_("undo-type", "Alien Map"),
483                                          node);
484           g_object_unref (node);
485         }
486       else
487         success = FALSE;
488     }
489 
490   return gimp_procedure_get_return_values (procedure, success,
491                                            error ? *error : NULL);
492 }
493 
494 static GimpValueArray *
plug_in_antialias_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)495 plug_in_antialias_invoker (GimpProcedure         *procedure,
496                            Gimp                  *gimp,
497                            GimpContext           *context,
498                            GimpProgress          *progress,
499                            const GimpValueArray  *args,
500                            GError               **error)
501 {
502   gboolean success = TRUE;
503   GimpDrawable *drawable;
504 
505   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
506 
507   if (success)
508     {
509       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
510                                      GIMP_PDB_ITEM_CONTENT, error) &&
511           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
512         {
513           GeglNode *node =
514             gegl_node_new_child (NULL,
515                                  "operation", "gegl:antialias",
516                                  NULL);
517 
518           gimp_drawable_apply_operation (drawable, progress,
519                                          C_("undo-type", "Antialias"),
520                                          node);
521           g_object_unref (node);
522         }
523       else
524         success = FALSE;
525     }
526 
527   return gimp_procedure_get_return_values (procedure, success,
528                                            error ? *error : NULL);
529 }
530 
531 static GimpValueArray *
plug_in_apply_canvas_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)532 plug_in_apply_canvas_invoker (GimpProcedure         *procedure,
533                               Gimp                  *gimp,
534                               GimpContext           *context,
535                               GimpProgress          *progress,
536                               const GimpValueArray  *args,
537                               GError               **error)
538 {
539   gboolean success = TRUE;
540   GimpDrawable *drawable;
541   gint32 direction;
542   gint32 depth;
543 
544   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
545   direction = g_value_get_int (gimp_value_array_index (args, 3));
546   depth = g_value_get_int (gimp_value_array_index (args, 4));
547 
548   if (success)
549     {
550       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
551                                      GIMP_PDB_ITEM_CONTENT, error) &&
552           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
553         {
554           GeglNode *node =
555             gegl_node_new_child (NULL,
556                                  "operation", "gegl:texturize-canvas",
557                                  "direction", direction,
558                                  "depth",     depth,
559                                  NULL);
560 
561           gimp_drawable_apply_operation (drawable, progress,
562                                          C_("undo-type", "Apply Canvas"),
563                                          node);
564           g_object_unref (node);
565         }
566       else
567         success = FALSE;
568     }
569 
570   return gimp_procedure_get_return_values (procedure, success,
571                                            error ? *error : NULL);
572 }
573 
574 static GimpValueArray *
plug_in_applylens_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)575 plug_in_applylens_invoker (GimpProcedure         *procedure,
576                            Gimp                  *gimp,
577                            GimpContext           *context,
578                            GimpProgress          *progress,
579                            const GimpValueArray  *args,
580                            GError               **error)
581 {
582   gboolean success = TRUE;
583   GimpDrawable *drawable;
584   gdouble refraction;
585   gboolean keep_surroundings;
586   gboolean set_background;
587 
588   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
589   refraction = g_value_get_double (gimp_value_array_index (args, 3));
590   keep_surroundings = g_value_get_boolean (gimp_value_array_index (args, 4));
591   set_background = g_value_get_boolean (gimp_value_array_index (args, 5));
592 
593   if (success)
594     {
595       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
596                                      GIMP_PDB_ITEM_CONTENT, error) &&
597           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
598         {
599           GimpRGB    color;
600           GeglColor *gegl_color;
601           GeglNode  *node;
602 
603           if (set_background)
604             gimp_context_get_background (context, &color);
605           else
606             gimp_rgba_set (&color, 0.0, 0.0, 0.0, 0.0);
607 
608           gegl_color = gimp_gegl_color_new (&color);
609 
610           node = gegl_node_new_child (NULL,
611                                      "operation",         "gegl:apply-lens",
612                                      "refraction-index",  refraction,
613                                      "keep-surroundings", keep_surroundings,
614                                      "background-color",  gegl_color,
615                                      NULL);
616 
617           g_object_unref (gegl_color);
618 
619           node = wrap_in_selection_bounds (node, drawable);
620 
621           gimp_drawable_apply_operation (drawable, progress,
622                                          C_("undo-type", "Apply Lens"),
623                                          node);
624           g_object_unref (node);
625         }
626       else
627         success = FALSE;
628     }
629 
630   return gimp_procedure_get_return_values (procedure, success,
631                                            error ? *error : NULL);
632 }
633 
634 static GimpValueArray *
plug_in_autocrop_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)635 plug_in_autocrop_invoker (GimpProcedure         *procedure,
636                           Gimp                  *gimp,
637                           GimpContext           *context,
638                           GimpProgress          *progress,
639                           const GimpValueArray  *args,
640                           GError               **error)
641 {
642   gboolean success = TRUE;
643   GimpImage *image;
644   GimpDrawable *drawable;
645 
646   image = gimp_value_get_image (gimp_value_array_index (args, 1), gimp);
647   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
648 
649   if (success)
650     {
651       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
652                                      GIMP_PDB_ITEM_CONTENT, error))
653         {
654           gint x, y, width, height;
655           gint off_x, off_y;
656 
657           gimp_pickable_auto_shrink (GIMP_PICKABLE (drawable),
658                                      0, 0,
659                                      gimp_item_get_width  (GIMP_ITEM (drawable)),
660                                      gimp_item_get_height (GIMP_ITEM (drawable)),
661                                      &x, &y, &width, &height);
662 
663           gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
664           x += off_x;
665           y += off_y;
666 
667           gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_RESIZE,
668                                        _("Autocrop image"));
669 
670           if (x          < 0                             ||
671               y          < 0                             ||
672               x + width  > gimp_image_get_width  (image) ||
673               y + height > gimp_image_get_height (image))
674             {
675               /*
676                * partially outside the image area, we need to
677                * resize the image to be able to crop properly.
678                */
679               gimp_image_resize (image, context, width, height, -x, -y, NULL);
680 
681               x = y = 0;
682             }
683 
684           gimp_image_crop (image, context, GIMP_FILL_TRANSPARENT,
685                            x, y, width, height, TRUE);
686 
687           gimp_image_undo_group_end (image);
688         }
689       else
690         success = FALSE;
691     }
692 
693   return gimp_procedure_get_return_values (procedure, success,
694                                            error ? *error : NULL);
695 }
696 
697 static GimpValueArray *
plug_in_autocrop_layer_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)698 plug_in_autocrop_layer_invoker (GimpProcedure         *procedure,
699                                 Gimp                  *gimp,
700                                 GimpContext           *context,
701                                 GimpProgress          *progress,
702                                 const GimpValueArray  *args,
703                                 GError               **error)
704 {
705   gboolean success = TRUE;
706   GimpImage *image;
707   GimpDrawable *drawable;
708 
709   image = gimp_value_get_image (gimp_value_array_index (args, 1), gimp);
710   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
711 
712   if (success)
713     {
714       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
715                                      GIMP_PDB_ITEM_CONTENT, error))
716         {
717           GimpLayer *layer = gimp_image_get_active_layer (image);
718           gint       x, y, width, height;
719 
720           if (layer)
721             {
722               switch (gimp_pickable_auto_shrink (GIMP_PICKABLE (drawable),
723                                                  0, 0,
724                                                  gimp_item_get_width  (GIMP_ITEM (drawable)),
725                                                  gimp_item_get_height (GIMP_ITEM (drawable)),
726                                                  &x, &y, &width, &height))
727                 {
728                 case GIMP_AUTO_SHRINK_SHRINK:
729                   gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_RESIZE,
730                                                _("Autocrop layer"));
731 
732                   gimp_item_resize (GIMP_ITEM (layer),
733                                     context, GIMP_FILL_TRANSPARENT,
734                                     width, height, -x, -y);
735 
736                   gimp_image_undo_group_end (image);
737                   break;
738 
739                 default:
740                   break;
741                 }
742             }
743         }
744       else
745         success = FALSE;
746     }
747 
748   return gimp_procedure_get_return_values (procedure, success,
749                                            error ? *error : NULL);
750 }
751 
752 static GimpValueArray *
plug_in_autostretch_hsv_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)753 plug_in_autostretch_hsv_invoker (GimpProcedure         *procedure,
754                                  Gimp                  *gimp,
755                                  GimpContext           *context,
756                                  GimpProgress          *progress,
757                                  const GimpValueArray  *args,
758                                  GError               **error)
759 {
760   gboolean success = TRUE;
761   GimpDrawable *drawable;
762 
763   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
764 
765   if (success)
766     {
767       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
768                                      GIMP_PDB_ITEM_CONTENT, error) &&
769           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
770         {
771           GeglNode *node =
772             gegl_node_new_child (NULL,
773                                  "operation",   "gegl:stretch-contrast-hsv",
774                                  NULL);
775 
776           gimp_drawable_apply_operation (drawable, progress,
777                                          C_("undo-type", "Stretch Contrast HSV"),
778                                          node);
779           g_object_unref (node);
780         }
781       else
782         success = FALSE;
783     }
784 
785   return gimp_procedure_get_return_values (procedure, success,
786                                            error ? *error : NULL);
787 }
788 
789 static GimpValueArray *
plug_in_bump_map_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)790 plug_in_bump_map_invoker (GimpProcedure         *procedure,
791                           Gimp                  *gimp,
792                           GimpContext           *context,
793                           GimpProgress          *progress,
794                           const GimpValueArray  *args,
795                           GError               **error)
796 {
797   gboolean success = TRUE;
798   GimpDrawable *drawable;
799   GimpDrawable *bumpmap;
800   gdouble azimuth;
801   gdouble elevation;
802   gint32 depth;
803   gint32 xofs;
804   gint32 yofs;
805   gdouble waterlevel;
806   gdouble ambient;
807   gboolean compensate;
808   gboolean invert;
809   gint32 type;
810 
811   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
812   bumpmap = gimp_value_get_drawable (gimp_value_array_index (args, 3), gimp);
813   azimuth = g_value_get_double (gimp_value_array_index (args, 4));
814   elevation = g_value_get_double (gimp_value_array_index (args, 5));
815   depth = g_value_get_int (gimp_value_array_index (args, 6));
816   xofs = g_value_get_int (gimp_value_array_index (args, 7));
817   yofs = g_value_get_int (gimp_value_array_index (args, 8));
818   waterlevel = g_value_get_double (gimp_value_array_index (args, 9));
819   ambient = g_value_get_double (gimp_value_array_index (args, 10));
820   compensate = g_value_get_boolean (gimp_value_array_index (args, 11));
821   invert = g_value_get_boolean (gimp_value_array_index (args, 12));
822   type = g_value_get_int (gimp_value_array_index (args, 13));
823 
824   if (success)
825     {
826       success = bump_map (drawable,
827                           bumpmap,
828                           azimuth,
829                           elevation,
830                           depth,
831                           xofs,
832                           yofs,
833                           waterlevel,
834                           ambient,
835                           compensate,
836                           invert,
837                           type,
838                           FALSE,
839                           progress,
840                           error);
841     }
842 
843   return gimp_procedure_get_return_values (procedure, success,
844                                            error ? *error : NULL);
845 }
846 
847 static GimpValueArray *
plug_in_bump_map_tiled_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)848 plug_in_bump_map_tiled_invoker (GimpProcedure         *procedure,
849                                 Gimp                  *gimp,
850                                 GimpContext           *context,
851                                 GimpProgress          *progress,
852                                 const GimpValueArray  *args,
853                                 GError               **error)
854 {
855   gboolean success = TRUE;
856   GimpDrawable *drawable;
857   GimpDrawable *bumpmap;
858   gdouble azimuth;
859   gdouble elevation;
860   gint32 depth;
861   gint32 xofs;
862   gint32 yofs;
863   gdouble waterlevel;
864   gdouble ambient;
865   gboolean compensate;
866   gboolean invert;
867   gint32 type;
868 
869   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
870   bumpmap = gimp_value_get_drawable (gimp_value_array_index (args, 3), gimp);
871   azimuth = g_value_get_double (gimp_value_array_index (args, 4));
872   elevation = g_value_get_double (gimp_value_array_index (args, 5));
873   depth = g_value_get_int (gimp_value_array_index (args, 6));
874   xofs = g_value_get_int (gimp_value_array_index (args, 7));
875   yofs = g_value_get_int (gimp_value_array_index (args, 8));
876   waterlevel = g_value_get_double (gimp_value_array_index (args, 9));
877   ambient = g_value_get_double (gimp_value_array_index (args, 10));
878   compensate = g_value_get_boolean (gimp_value_array_index (args, 11));
879   invert = g_value_get_boolean (gimp_value_array_index (args, 12));
880   type = g_value_get_int (gimp_value_array_index (args, 13));
881 
882   if (success)
883     {
884       success = bump_map (drawable,
885                           bumpmap,
886                           azimuth,
887                           elevation,
888                           depth,
889                           xofs,
890                           yofs,
891                           waterlevel,
892                           ambient,
893                           compensate,
894                           invert,
895                           type,
896                           TRUE,
897                           progress,
898                           error);
899     }
900 
901   return gimp_procedure_get_return_values (procedure, success,
902                                            error ? *error : NULL);
903 }
904 
905 static GimpValueArray *
plug_in_c_astretch_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)906 plug_in_c_astretch_invoker (GimpProcedure         *procedure,
907                             Gimp                  *gimp,
908                             GimpContext           *context,
909                             GimpProgress          *progress,
910                             const GimpValueArray  *args,
911                             GError               **error)
912 {
913   gboolean success = TRUE;
914   GimpDrawable *drawable;
915 
916   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
917 
918   if (success)
919     {
920       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
921                                      GIMP_PDB_ITEM_CONTENT, error) &&
922           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
923         {
924           GeglNode *node =
925             gegl_node_new_child (NULL,
926                                  "operation",   "gegl:stretch-contrast",
927                                  "keep-colors", (gboolean) FALSE,
928                                  NULL);
929 
930           gimp_drawable_apply_operation (drawable, progress,
931                                          C_("undo-type", "Stretch Contrast"),
932                                          node);
933           g_object_unref (node);
934         }
935       else
936         success = FALSE;
937     }
938 
939   return gimp_procedure_get_return_values (procedure, success,
940                                            error ? *error : NULL);
941 }
942 
943 static GimpValueArray *
plug_in_colors_channel_mixer_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)944 plug_in_colors_channel_mixer_invoker (GimpProcedure         *procedure,
945                                       Gimp                  *gimp,
946                                       GimpContext           *context,
947                                       GimpProgress          *progress,
948                                       const GimpValueArray  *args,
949                                       GError               **error)
950 {
951   gboolean success = TRUE;
952   GimpDrawable *drawable;
953   gint32 monochrome;
954   gdouble rr_gain;
955   gdouble rg_gain;
956   gdouble rb_gain;
957   gdouble gr_gain;
958   gdouble gg_gain;
959   gdouble gb_gain;
960   gdouble br_gain;
961   gdouble bg_gain;
962   gdouble bb_gain;
963 
964   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
965   monochrome = g_value_get_int (gimp_value_array_index (args, 3));
966   rr_gain = g_value_get_double (gimp_value_array_index (args, 4));
967   rg_gain = g_value_get_double (gimp_value_array_index (args, 5));
968   rb_gain = g_value_get_double (gimp_value_array_index (args, 6));
969   gr_gain = g_value_get_double (gimp_value_array_index (args, 7));
970   gg_gain = g_value_get_double (gimp_value_array_index (args, 8));
971   gb_gain = g_value_get_double (gimp_value_array_index (args, 9));
972   br_gain = g_value_get_double (gimp_value_array_index (args, 10));
973   bg_gain = g_value_get_double (gimp_value_array_index (args, 11));
974   bb_gain = g_value_get_double (gimp_value_array_index (args, 12));
975 
976   if (success)
977     {
978       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
979                                      GIMP_PDB_ITEM_CONTENT, error) &&
980           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
981         {
982           GeglNode *node = NULL;
983 
984           if (monochrome)
985             {
986               node = gegl_node_new_child (NULL,
987                                           "operation", "gegl:mono-mixer",
988                                           "red",       rr_gain,
989                                           "green",     rg_gain,
990                                           "blue",      rb_gain,
991                                           NULL);
992              }
993            else
994              {
995                node = gegl_node_new_child (NULL,
996                                            "operation", "gegl:channel-mixer",
997                                            "rr-gain",   rr_gain,
998                                            "rg-gain",   rg_gain,
999                                            "rb-gain",   rb_gain,
1000                                            "gr-gain",   gr_gain,
1001                                            "gg-gain",   gg_gain,
1002                                            "gb-gain",   gb_gain,
1003                                            "br-gain",   br_gain,
1004                                            "bg-gain",   bg_gain,
1005                                            "bb-gain",   bb_gain,
1006                                             NULL);
1007              }
1008 
1009            gimp_drawable_apply_operation (drawable, progress,
1010                                           C_("undo-type", "Channel Mixer"),
1011                                           node);
1012            g_object_unref (node);
1013         }
1014       else
1015         success = FALSE;
1016     }
1017 
1018   return gimp_procedure_get_return_values (procedure, success,
1019                                            error ? *error : NULL);
1020 }
1021 
1022 static GimpValueArray *
plug_in_colortoalpha_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1023 plug_in_colortoalpha_invoker (GimpProcedure         *procedure,
1024                               Gimp                  *gimp,
1025                               GimpContext           *context,
1026                               GimpProgress          *progress,
1027                               const GimpValueArray  *args,
1028                               GError               **error)
1029 {
1030   gboolean success = TRUE;
1031   GimpDrawable *drawable;
1032   GimpRGB color;
1033 
1034   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1035   gimp_value_get_rgb (gimp_value_array_index (args, 3), &color);
1036 
1037   if (success)
1038     {
1039       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
1040                                      GIMP_PDB_ITEM_CONTENT, error) &&
1041           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
1042         {
1043           GeglColor *gegl_color = gimp_gegl_color_new (&color);
1044           GeglNode  *node =
1045             gegl_node_new_child (NULL,
1046                                  "operation", "gegl:color-to-alpha",
1047                                  "color",     gegl_color,
1048                                  NULL);
1049           g_object_unref (gegl_color);
1050 
1051           gimp_drawable_apply_operation (drawable, progress,
1052                                          C_("undo-type", "Color to Alpha"),
1053                                          node);
1054           g_object_unref (node);
1055         }
1056       else
1057         success = FALSE;
1058     }
1059 
1060   return gimp_procedure_get_return_values (procedure, success,
1061                                            error ? *error : NULL);
1062 }
1063 
1064 static GimpValueArray *
plug_in_convmatrix_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1065 plug_in_convmatrix_invoker (GimpProcedure         *procedure,
1066                             Gimp                  *gimp,
1067                             GimpContext           *context,
1068                             GimpProgress          *progress,
1069                             const GimpValueArray  *args,
1070                             GError               **error)
1071 {
1072   gboolean success = TRUE;
1073   GimpDrawable *drawable;
1074   gint32 argc_matrix;
1075   const gdouble *matrix;
1076   gboolean alpha_alg;
1077   gdouble divisor;
1078   gdouble offset;
1079   gint32 argc_channels;
1080   const gint32 *channels;
1081   gint32 bmode;
1082 
1083   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1084   argc_matrix = g_value_get_int (gimp_value_array_index (args, 3));
1085   matrix = gimp_value_get_floatarray (gimp_value_array_index (args, 4));
1086   alpha_alg = g_value_get_boolean (gimp_value_array_index (args, 5));
1087   divisor = g_value_get_double (gimp_value_array_index (args, 6));
1088   offset = g_value_get_double (gimp_value_array_index (args, 7));
1089   argc_channels = g_value_get_int (gimp_value_array_index (args, 8));
1090   channels = gimp_value_get_int32array (gimp_value_array_index (args, 9));
1091   bmode = g_value_get_int (gimp_value_array_index (args, 10));
1092 
1093   if (success)
1094     {
1095       if (argc_matrix != 25)
1096         {
1097           g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
1098                        _("Array 'matrix' has only %d members, must have 25"),
1099                        argc_matrix);
1100           success = FALSE;
1101         }
1102 
1103       if (success && argc_channels != 5)
1104         {
1105           g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
1106                        _("Array 'channels' has only %d members, must have 5"),
1107                        argc_channels);
1108           success = FALSE;
1109         }
1110 
1111       if (success &&
1112           gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
1113                                      GIMP_PDB_ITEM_CONTENT, error) &&
1114           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
1115         {
1116           GeglNode        *node;
1117           GeglAbyssPolicy  border = GEGL_ABYSS_CLAMP;
1118           gboolean         r      = channels[1];
1119           gboolean         g      = channels[2];
1120           gboolean         b      = channels[3];
1121           gboolean         a      = channels[4];
1122 
1123           if (gimp_drawable_is_gray (drawable))
1124             {
1125               r = channels[0];
1126               g = channels[0];
1127               b = channels[0];
1128             }
1129 
1130           switch (bmode)
1131             {
1132             case 0: border = GEGL_ABYSS_CLAMP; break;
1133             case 1: border = GEGL_ABYSS_LOOP; break;
1134             case 2: border = GEGL_ABYSS_NONE; break;
1135             }
1136 
1137           node = gegl_node_new_child (NULL,
1138                                       "operation",    "gegl:convolution-matrix",
1139                                       "a1",           matrix[0],
1140                                       "a2",           matrix[1],
1141                                       "a3",           matrix[2],
1142                                       "a4",           matrix[3],
1143                                       "a5",           matrix[4],
1144                                       "b1",           matrix[5],
1145                                       "b2",           matrix[6],
1146                                       "b3",           matrix[7],
1147                                       "b4",           matrix[8],
1148                                       "b5",           matrix[9],
1149                                       "c1",           matrix[10],
1150                                       "c2",           matrix[11],
1151                                       "c3",           matrix[12],
1152                                       "c4",           matrix[13],
1153                                       "c5",           matrix[14],
1154                                       "d1",           matrix[15],
1155                                       "d2",           matrix[16],
1156                                       "d3",           matrix[17],
1157                                       "d4",           matrix[18],
1158                                       "d5",           matrix[19],
1159                                       "e1",           matrix[20],
1160                                       "e2",           matrix[21],
1161                                       "e3",           matrix[22],
1162                                       "e4",           matrix[23],
1163                                       "e5",           matrix[24],
1164                                       "divisor",      divisor,
1165                                       "offset",       offset,
1166                                       "red",          r,
1167                                       "green",        g,
1168                                       "blue",         b,
1169                                       "alpha",        a,
1170                                       "normalize",    FALSE,
1171                                       "alpha-weight", alpha_alg,
1172                                       "border",       border,
1173                                       NULL);
1174 
1175           node = wrap_in_gamma_cast (node, drawable);
1176 
1177           gimp_drawable_apply_operation (drawable, progress,
1178                                          C_("undo-type", "Convolution Matrix"),
1179                                          node);
1180           g_object_unref (node);
1181         }
1182       else
1183         success = FALSE;
1184     }
1185 
1186   return gimp_procedure_get_return_values (procedure, success,
1187                                            error ? *error : NULL);
1188 }
1189 
1190 static GimpValueArray *
plug_in_cubism_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1191 plug_in_cubism_invoker (GimpProcedure         *procedure,
1192                         Gimp                  *gimp,
1193                         GimpContext           *context,
1194                         GimpProgress          *progress,
1195                         const GimpValueArray  *args,
1196                         GError               **error)
1197 {
1198   gboolean success = TRUE;
1199   GimpDrawable *drawable;
1200   gdouble tile_size;
1201   gdouble tile_saturation;
1202   gint32 bg_color;
1203 
1204   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1205   tile_size = g_value_get_double (gimp_value_array_index (args, 3));
1206   tile_saturation = g_value_get_double (gimp_value_array_index (args, 4));
1207   bg_color = g_value_get_int (gimp_value_array_index (args, 5));
1208 
1209   if (success)
1210     {
1211       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
1212                                      GIMP_PDB_ITEM_CONTENT, error) &&
1213           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
1214         {
1215           GimpRGB    color;
1216           GeglColor *gegl_color;
1217           GeglNode  *node;
1218 
1219           if (bg_color)
1220             {
1221               gimp_context_get_background (context, &color);
1222               gimp_rgb_set_alpha (&color, 0.0);
1223             }
1224           else
1225             {
1226               gimp_rgba_set (&color, 0.0, 0.0, 0.0, 0.0);
1227             }
1228 
1229           gegl_color = gimp_gegl_color_new (&color);
1230 
1231           node = gegl_node_new_child (NULL,
1232                                       "operation",       "gegl:cubism",
1233                                       "tile-size",       tile_size,
1234                                       "tile-saturation", tile_saturation,
1235                                       "bg-color",        gegl_color,
1236                                       NULL);
1237           g_object_unref (gegl_color);
1238 
1239           gimp_drawable_apply_operation (drawable, progress,
1240                                          C_("undo-type", "Cubism"),
1241                                          node);
1242           g_object_unref (node);
1243         }
1244       else
1245         success = FALSE;
1246     }
1247 
1248   return gimp_procedure_get_return_values (procedure, success,
1249                                            error ? *error : NULL);
1250 }
1251 
1252 static GimpValueArray *
plug_in_deinterlace_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1253 plug_in_deinterlace_invoker (GimpProcedure         *procedure,
1254                              Gimp                  *gimp,
1255                              GimpContext           *context,
1256                              GimpProgress          *progress,
1257                              const GimpValueArray  *args,
1258                              GError               **error)
1259 {
1260   gboolean success = TRUE;
1261   GimpDrawable *drawable;
1262   gint32 evenodd;
1263 
1264   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1265   evenodd = g_value_get_int (gimp_value_array_index (args, 3));
1266 
1267   if (success)
1268     {
1269       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
1270                                      GIMP_PDB_ITEM_CONTENT, error) &&
1271           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
1272         {
1273           GeglNode *node;
1274 
1275           node = gegl_node_new_child (NULL,
1276                                       "operation",   "gegl:deinterlace",
1277                                       "keep",        evenodd ? 0 : 1,
1278                                       "orientation", 0, /* HORIZONTAL */
1279                                       "size",        1,
1280                                       NULL);
1281 
1282           node = wrap_in_gamma_cast (node, drawable);
1283 
1284           gimp_drawable_apply_operation (drawable, progress,
1285                                          C_("undo-type", "Deinterlace"),
1286                                          node);
1287           g_object_unref (node);
1288         }
1289       else
1290         success = FALSE;
1291     }
1292 
1293   return gimp_procedure_get_return_values (procedure, success,
1294                                            error ? *error : NULL);
1295 }
1296 
1297 static GimpValueArray *
plug_in_diffraction_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1298 plug_in_diffraction_invoker (GimpProcedure         *procedure,
1299                              Gimp                  *gimp,
1300                              GimpContext           *context,
1301                              GimpProgress          *progress,
1302                              const GimpValueArray  *args,
1303                              GError               **error)
1304 {
1305   gboolean success = TRUE;
1306   GimpDrawable *drawable;
1307   gdouble lam_r;
1308   gdouble lam_g;
1309   gdouble lam_b;
1310   gdouble contour_r;
1311   gdouble contour_g;
1312   gdouble contour_b;
1313   gdouble edges_r;
1314   gdouble edges_g;
1315   gdouble edges_b;
1316   gdouble brightness;
1317   gdouble scattering;
1318   gdouble polarization;
1319 
1320   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1321   lam_r = g_value_get_double (gimp_value_array_index (args, 3));
1322   lam_g = g_value_get_double (gimp_value_array_index (args, 4));
1323   lam_b = g_value_get_double (gimp_value_array_index (args, 5));
1324   contour_r = g_value_get_double (gimp_value_array_index (args, 6));
1325   contour_g = g_value_get_double (gimp_value_array_index (args, 7));
1326   contour_b = g_value_get_double (gimp_value_array_index (args, 8));
1327   edges_r = g_value_get_double (gimp_value_array_index (args, 9));
1328   edges_g = g_value_get_double (gimp_value_array_index (args, 10));
1329   edges_b = g_value_get_double (gimp_value_array_index (args, 11));
1330   brightness = g_value_get_double (gimp_value_array_index (args, 12));
1331   scattering = g_value_get_double (gimp_value_array_index (args, 13));
1332   polarization = g_value_get_double (gimp_value_array_index (args, 14));
1333 
1334   if (success)
1335     {
1336       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
1337                                      GIMP_PDB_ITEM_CONTENT, error) &&
1338           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
1339         {
1340           GeglNode *node;
1341           gint      x, y, width, height;
1342 
1343           gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height);
1344 
1345           node = gegl_node_new_child (NULL,
1346                                       "operation",       "gegl:diffraction-patterns",
1347                                       "red-frequency",   lam_r,
1348                                       "green-frequency", lam_g,
1349                                       "blue-frequency",  lam_b,
1350                                       "red-contours",    contour_r,
1351                                       "green-contours",  contour_g,
1352                                       "blue-contours",   contour_b,
1353                                       "red-sedges",      edges_r,
1354                                       "green-sedges",    edges_g,
1355                                       "blue-sedges",     edges_b,
1356                                       "brightness",      brightness,
1357                                       "scattering",      scattering,
1358                                       "polarization",    polarization,
1359                                       "width",           width,
1360                                       "height",          height,
1361                                       NULL);
1362 
1363           gimp_drawable_apply_operation (drawable, progress,
1364                                          C_("undo-type", "Diffraction Patterns"),
1365                                          node);
1366           g_object_unref (node);
1367         }
1368       else
1369         success = FALSE;
1370     }
1371 
1372   return gimp_procedure_get_return_values (procedure, success,
1373                                            error ? *error : NULL);
1374 }
1375 
1376 static GimpValueArray *
plug_in_displace_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1377 plug_in_displace_invoker (GimpProcedure         *procedure,
1378                           Gimp                  *gimp,
1379                           GimpContext           *context,
1380                           GimpProgress          *progress,
1381                           const GimpValueArray  *args,
1382                           GError               **error)
1383 {
1384   gboolean success = TRUE;
1385   GimpDrawable *drawable;
1386   gdouble amount_x;
1387   gdouble amount_y;
1388   gboolean do_x;
1389   gboolean do_y;
1390   GimpDrawable *displace_map_x;
1391   GimpDrawable *displace_map_y;
1392   gint32 displace_type;
1393 
1394   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1395   amount_x = g_value_get_double (gimp_value_array_index (args, 3));
1396   amount_y = g_value_get_double (gimp_value_array_index (args, 4));
1397   do_x = g_value_get_boolean (gimp_value_array_index (args, 5));
1398   do_y = g_value_get_boolean (gimp_value_array_index (args, 6));
1399   displace_map_x = gimp_value_get_drawable (gimp_value_array_index (args, 7), gimp);
1400   displace_map_y = gimp_value_get_drawable (gimp_value_array_index (args, 8), gimp);
1401   displace_type = g_value_get_int (gimp_value_array_index (args, 9));
1402 
1403   if (success)
1404     {
1405       success = displace (drawable,
1406                           amount_x,
1407                           amount_y,
1408                           do_x,
1409                           do_y,
1410                           displace_map_x,
1411                           displace_map_y,
1412                           displace_type,
1413                           0,
1414                           progress,
1415                           error);
1416     }
1417 
1418   return gimp_procedure_get_return_values (procedure, success,
1419                                            error ? *error : NULL);
1420 }
1421 
1422 static GimpValueArray *
plug_in_displace_polar_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1423 plug_in_displace_polar_invoker (GimpProcedure         *procedure,
1424                                 Gimp                  *gimp,
1425                                 GimpContext           *context,
1426                                 GimpProgress          *progress,
1427                                 const GimpValueArray  *args,
1428                                 GError               **error)
1429 {
1430   gboolean success = TRUE;
1431   GimpDrawable *drawable;
1432   gdouble amount_x;
1433   gdouble amount_y;
1434   gboolean do_x;
1435   gboolean do_y;
1436   GimpDrawable *displace_map_x;
1437   GimpDrawable *displace_map_y;
1438   gint32 displace_type;
1439 
1440   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1441   amount_x = g_value_get_double (gimp_value_array_index (args, 3));
1442   amount_y = g_value_get_double (gimp_value_array_index (args, 4));
1443   do_x = g_value_get_boolean (gimp_value_array_index (args, 5));
1444   do_y = g_value_get_boolean (gimp_value_array_index (args, 6));
1445   displace_map_x = gimp_value_get_drawable (gimp_value_array_index (args, 7), gimp);
1446   displace_map_y = gimp_value_get_drawable (gimp_value_array_index (args, 8), gimp);
1447   displace_type = g_value_get_int (gimp_value_array_index (args, 9));
1448 
1449   if (success)
1450     {
1451       success = displace (drawable,
1452                           amount_x,
1453                           amount_y,
1454                           do_x,
1455                           do_y,
1456                           displace_map_x,
1457                           displace_map_y,
1458                           displace_type,
1459                           1,
1460                           progress,
1461                           error);
1462     }
1463 
1464   return gimp_procedure_get_return_values (procedure, success,
1465                                            error ? *error : NULL);
1466 }
1467 
1468 static GimpValueArray *
plug_in_edge_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1469 plug_in_edge_invoker (GimpProcedure         *procedure,
1470                       Gimp                  *gimp,
1471                       GimpContext           *context,
1472                       GimpProgress          *progress,
1473                       const GimpValueArray  *args,
1474                       GError               **error)
1475 {
1476   gboolean success = TRUE;
1477   GimpDrawable *drawable;
1478   gdouble amount;
1479   gint32 warpmode;
1480   gint32 edgemode;
1481 
1482   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1483   amount = g_value_get_double (gimp_value_array_index (args, 3));
1484   warpmode = g_value_get_int (gimp_value_array_index (args, 4));
1485   edgemode = g_value_get_int (gimp_value_array_index (args, 5));
1486 
1487   if (success)
1488     {
1489       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
1490                                      GIMP_PDB_ITEM_CONTENT, error) &&
1491           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
1492         {
1493           GeglNode        *node;
1494           GeglAbyssPolicy  border_behavior = GEGL_ABYSS_NONE;
1495 
1496           switch (warpmode)
1497             {
1498             case 0:
1499               border_behavior = GEGL_ABYSS_NONE;
1500               break;
1501 
1502             case 1:
1503               border_behavior = GEGL_ABYSS_LOOP;
1504               break;
1505 
1506             case 2:
1507               border_behavior = GEGL_ABYSS_CLAMP;
1508               break;
1509 
1510             case 3:
1511               border_behavior = GEGL_ABYSS_BLACK;
1512               break;
1513             }
1514 
1515           node = gegl_node_new_child (NULL,
1516                                       "operation",       "gegl:edge",
1517                                       "algorithm",       edgemode,
1518                                       "amount",          amount,
1519                                       "border-behavior", border_behavior,
1520                                       NULL);
1521 
1522           gimp_drawable_apply_operation (drawable, progress,
1523                                          C_("undo-type", "Edge"),
1524                                          node);
1525           g_object_unref (node);
1526         }
1527       else
1528         success = FALSE;
1529     }
1530 
1531   return gimp_procedure_get_return_values (procedure, success,
1532                                            error ? *error : NULL);
1533 }
1534 
1535 static GimpValueArray *
plug_in_engrave_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1536 plug_in_engrave_invoker (GimpProcedure         *procedure,
1537                          Gimp                  *gimp,
1538                          GimpContext           *context,
1539                          GimpProgress          *progress,
1540                          const GimpValueArray  *args,
1541                          GError               **error)
1542 {
1543   gboolean success = TRUE;
1544   GimpDrawable *drawable;
1545   gint32 height;
1546   gboolean limit;
1547 
1548   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1549   height = g_value_get_int (gimp_value_array_index (args, 3));
1550   limit = g_value_get_boolean (gimp_value_array_index (args, 4));
1551 
1552   if (success)
1553     {
1554       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
1555                                      GIMP_PDB_ITEM_CONTENT, error) &&
1556           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
1557         {
1558           GeglNode *node;
1559 
1560           node = gegl_node_new_child (NULL,
1561                                       "operation",   "gegl:engrave",
1562                                       "row-height",  height,
1563                                       "limit",       limit,
1564                                       NULL);
1565 
1566           gimp_drawable_apply_operation (drawable, progress,
1567                                          C_("undo-type", "Engrave"),
1568                                          node);
1569         }
1570       else
1571         success = FALSE;
1572     }
1573 
1574   return gimp_procedure_get_return_values (procedure, success,
1575                                            error ? *error : NULL);
1576 }
1577 
1578 static GimpValueArray *
plug_in_exchange_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1579 plug_in_exchange_invoker (GimpProcedure         *procedure,
1580                           Gimp                  *gimp,
1581                           GimpContext           *context,
1582                           GimpProgress          *progress,
1583                           const GimpValueArray  *args,
1584                           GError               **error)
1585 {
1586   gboolean success = TRUE;
1587   GimpDrawable *drawable;
1588   guint8 from_red;
1589   guint8 from_green;
1590   guint8 from_blue;
1591   guint8 to_red;
1592   guint8 to_green;
1593   guint8 to_blue;
1594   guint8 red_threshold;
1595   guint8 green_threshold;
1596   guint8 blue_threshold;
1597 
1598   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1599   from_red = g_value_get_uint (gimp_value_array_index (args, 3));
1600   from_green = g_value_get_uint (gimp_value_array_index (args, 4));
1601   from_blue = g_value_get_uint (gimp_value_array_index (args, 5));
1602   to_red = g_value_get_uint (gimp_value_array_index (args, 6));
1603   to_green = g_value_get_uint (gimp_value_array_index (args, 7));
1604   to_blue = g_value_get_uint (gimp_value_array_index (args, 8));
1605   red_threshold = g_value_get_uint (gimp_value_array_index (args, 9));
1606   green_threshold = g_value_get_uint (gimp_value_array_index (args, 10));
1607   blue_threshold = g_value_get_uint (gimp_value_array_index (args, 11));
1608 
1609   if (success)
1610     {
1611       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
1612                                      GIMP_PDB_ITEM_CONTENT, error) &&
1613           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
1614         {
1615           GimpRGB    from;
1616           GimpRGB    to;
1617           GeglColor *gegl_from;
1618           GeglColor *gegl_to;
1619           GeglNode  *node;
1620 
1621           gimp_rgb_set_uchar (&from, from_red, from_green, from_blue);
1622           gimp_rgb_set_uchar (&to,   to_red,   to_green,   to_blue);
1623 
1624           gegl_from = gimp_gegl_color_new (&from);
1625           gegl_to   = gimp_gegl_color_new (&to);
1626 
1627           node = gegl_node_new_child (NULL,
1628                                       "operation",       "gegl:color-exchange",
1629                                       "from-color",      gegl_from,
1630                                       "to-color",        gegl_to,
1631                                       "red-threshold",   red_threshold   / 255.0,
1632                                       "green-threshold", green_threshold / 255.0,
1633                                       "blue-threshold",  blue_threshold  / 255.0,
1634                                       NULL);
1635 
1636           g_object_unref (gegl_from);
1637           g_object_unref (gegl_to);
1638 
1639           gimp_drawable_apply_operation (drawable, progress,
1640                                          C_("undo-type", "Color Exchange"),
1641                                          node);
1642           g_object_unref (node);
1643         }
1644       else
1645         success = FALSE;
1646     }
1647 
1648   return gimp_procedure_get_return_values (procedure, success,
1649                                            error ? *error : NULL);
1650 }
1651 
1652 static GimpValueArray *
plug_in_flarefx_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1653 plug_in_flarefx_invoker (GimpProcedure         *procedure,
1654                          Gimp                  *gimp,
1655                          GimpContext           *context,
1656                          GimpProgress          *progress,
1657                          const GimpValueArray  *args,
1658                          GError               **error)
1659 {
1660   gboolean success = TRUE;
1661   GimpDrawable *drawable;
1662   gint32 pos_x;
1663   gint32 pos_y;
1664 
1665   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1666   pos_x = g_value_get_int (gimp_value_array_index (args, 3));
1667   pos_y = g_value_get_int (gimp_value_array_index (args, 4));
1668 
1669   if (success)
1670     {
1671       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
1672                                      GIMP_PDB_ITEM_CONTENT, error) &&
1673           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
1674         {
1675           GeglNode *node;
1676           gint      width  = gimp_item_get_width  (GIMP_ITEM (drawable));
1677           gint      height = gimp_item_get_height (GIMP_ITEM (drawable));
1678           gdouble   x      = (gdouble) pos_x / (gdouble) width;
1679           gdouble   y      = (gdouble) pos_y / (gdouble) height;
1680 
1681           node = gegl_node_new_child (NULL,
1682                                       "operation", "gegl:lens-flare",
1683                                       "pos-x",     x,
1684                                       "pos-y",     y,
1685                                       NULL);
1686 
1687           gimp_drawable_apply_operation (drawable, progress,
1688                                          C_("undo-type", "Lens Flare"),
1689                                          node);
1690           g_object_unref (node);
1691         }
1692       else
1693         success = FALSE;
1694     }
1695 
1696   return gimp_procedure_get_return_values (procedure, success,
1697                                            error ? *error : NULL);
1698 }
1699 
1700 static GimpValueArray *
plug_in_gauss_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1701 plug_in_gauss_invoker (GimpProcedure         *procedure,
1702                        Gimp                  *gimp,
1703                        GimpContext           *context,
1704                        GimpProgress          *progress,
1705                        const GimpValueArray  *args,
1706                        GError               **error)
1707 {
1708   gboolean success = TRUE;
1709   GimpDrawable *drawable;
1710   gdouble horizontal;
1711   gdouble vertical;
1712 
1713   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1714   horizontal = g_value_get_double (gimp_value_array_index (args, 3));
1715   vertical = g_value_get_double (gimp_value_array_index (args, 4));
1716 
1717   if (success)
1718     {
1719       success = gaussian_blur (drawable, horizontal, vertical, progress, error);
1720     }
1721 
1722   return gimp_procedure_get_return_values (procedure, success,
1723                                            error ? *error : NULL);
1724 }
1725 
1726 static GimpValueArray *
plug_in_gauss_iir_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1727 plug_in_gauss_iir_invoker (GimpProcedure         *procedure,
1728                            Gimp                  *gimp,
1729                            GimpContext           *context,
1730                            GimpProgress          *progress,
1731                            const GimpValueArray  *args,
1732                            GError               **error)
1733 {
1734   gboolean success = TRUE;
1735   GimpDrawable *drawable;
1736   gdouble radius;
1737   gboolean horizontal;
1738   gboolean vertical;
1739 
1740   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1741   radius = g_value_get_double (gimp_value_array_index (args, 3));
1742   horizontal = g_value_get_boolean (gimp_value_array_index (args, 4));
1743   vertical = g_value_get_boolean (gimp_value_array_index (args, 5));
1744 
1745   if (success)
1746     {
1747       success = gaussian_blur (drawable,
1748                                horizontal ? radius : 0.0,
1749                                vertical   ? radius : 0.0,
1750                                progress, error);
1751     }
1752 
1753   return gimp_procedure_get_return_values (procedure, success,
1754                                            error ? *error : NULL);
1755 }
1756 
1757 static GimpValueArray *
plug_in_gauss_iir2_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1758 plug_in_gauss_iir2_invoker (GimpProcedure         *procedure,
1759                             Gimp                  *gimp,
1760                             GimpContext           *context,
1761                             GimpProgress          *progress,
1762                             const GimpValueArray  *args,
1763                             GError               **error)
1764 {
1765   gboolean success = TRUE;
1766   GimpDrawable *drawable;
1767   gdouble horizontal;
1768   gdouble vertical;
1769 
1770   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1771   horizontal = g_value_get_double (gimp_value_array_index (args, 3));
1772   vertical = g_value_get_double (gimp_value_array_index (args, 4));
1773 
1774   if (success)
1775     {
1776       success = gaussian_blur (drawable, horizontal, vertical, progress, error);
1777     }
1778 
1779   return gimp_procedure_get_return_values (procedure, success,
1780                                            error ? *error : NULL);
1781 }
1782 
1783 static GimpValueArray *
plug_in_gauss_rle_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1784 plug_in_gauss_rle_invoker (GimpProcedure         *procedure,
1785                            Gimp                  *gimp,
1786                            GimpContext           *context,
1787                            GimpProgress          *progress,
1788                            const GimpValueArray  *args,
1789                            GError               **error)
1790 {
1791   gboolean success = TRUE;
1792   GimpDrawable *drawable;
1793   gdouble radius;
1794   gboolean horizontal;
1795   gboolean vertical;
1796 
1797   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1798   radius = g_value_get_double (gimp_value_array_index (args, 3));
1799   horizontal = g_value_get_boolean (gimp_value_array_index (args, 4));
1800   vertical = g_value_get_boolean (gimp_value_array_index (args, 5));
1801 
1802   if (success)
1803     {
1804       success = gaussian_blur (drawable,
1805                                horizontal ? radius : 0.0,
1806                                vertical   ? radius : 0.0,
1807                                progress, error);
1808     }
1809 
1810   return gimp_procedure_get_return_values (procedure, success,
1811                                            error ? *error : NULL);
1812 }
1813 
1814 static GimpValueArray *
plug_in_gauss_rle2_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1815 plug_in_gauss_rle2_invoker (GimpProcedure         *procedure,
1816                             Gimp                  *gimp,
1817                             GimpContext           *context,
1818                             GimpProgress          *progress,
1819                             const GimpValueArray  *args,
1820                             GError               **error)
1821 {
1822   gboolean success = TRUE;
1823   GimpDrawable *drawable;
1824   gdouble horizontal;
1825   gdouble vertical;
1826 
1827   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1828   horizontal = g_value_get_double (gimp_value_array_index (args, 3));
1829   vertical = g_value_get_double (gimp_value_array_index (args, 4));
1830 
1831   if (success)
1832     {
1833       success = gaussian_blur (drawable, horizontal, vertical, progress, error);
1834     }
1835 
1836   return gimp_procedure_get_return_values (procedure, success,
1837                                            error ? *error : NULL);
1838 }
1839 
1840 static GimpValueArray *
plug_in_glasstile_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1841 plug_in_glasstile_invoker (GimpProcedure         *procedure,
1842                            Gimp                  *gimp,
1843                            GimpContext           *context,
1844                            GimpProgress          *progress,
1845                            const GimpValueArray  *args,
1846                            GError               **error)
1847 {
1848   gboolean success = TRUE;
1849   GimpDrawable *drawable;
1850   gint32 tilex;
1851   gint32 tiley;
1852 
1853   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1854   tilex = g_value_get_int (gimp_value_array_index (args, 3));
1855   tiley = g_value_get_int (gimp_value_array_index (args, 4));
1856 
1857   if (success)
1858     {
1859       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
1860                                      GIMP_PDB_ITEM_CONTENT, error) &&
1861           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
1862         {
1863           GeglNode *node;
1864 
1865           node = gegl_node_new_child (NULL,
1866                                       "operation",   "gegl:tile-glass",
1867                                       "tile-width",  tilex,
1868                                       "tile-height", tiley,
1869                                       NULL);
1870 
1871           gimp_drawable_apply_operation (drawable, progress,
1872                                          C_("undo-type", "Glass Tile"),
1873                                          node);
1874           g_object_unref (node);
1875         }
1876       else
1877         success = FALSE;
1878     }
1879 
1880   return gimp_procedure_get_return_values (procedure, success,
1881                                            error ? *error : NULL);
1882 }
1883 
1884 static GimpValueArray *
plug_in_hsv_noise_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1885 plug_in_hsv_noise_invoker (GimpProcedure         *procedure,
1886                            Gimp                  *gimp,
1887                            GimpContext           *context,
1888                            GimpProgress          *progress,
1889                            const GimpValueArray  *args,
1890                            GError               **error)
1891 {
1892   gboolean success = TRUE;
1893   GimpDrawable *drawable;
1894   gint32 holdness;
1895   gint32 hue_distance;
1896   gint32 saturation_distance;
1897   gint32 value_distance;
1898 
1899   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
1900   holdness = g_value_get_int (gimp_value_array_index (args, 3));
1901   hue_distance = g_value_get_int (gimp_value_array_index (args, 4));
1902   saturation_distance = g_value_get_int (gimp_value_array_index (args, 5));
1903   value_distance = g_value_get_int (gimp_value_array_index (args, 6));
1904 
1905   if (success)
1906     {
1907       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
1908                                      GIMP_PDB_ITEM_CONTENT, error) &&
1909           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
1910         {
1911           GeglNode  *node;
1912 
1913           gdouble saturation = saturation_distance / 255.0;
1914           gdouble value = value_distance / 255.0;
1915 
1916           node = gegl_node_new_child (NULL,
1917                                       "operation",           "gegl:noise-hsv",
1918                                       "holdness",            (gint)    holdness,
1919                                       "hue-distance",        (gdouble) hue_distance,
1920                                       "saturation-distance", (gdouble) saturation,
1921                                       "value-distance",      (gdouble) value,
1922                                       NULL);
1923 
1924           gimp_drawable_apply_operation (drawable, progress,
1925                                          C_("undo-type", "Noise HSV"),
1926                                          node);
1927           g_object_unref (node);
1928         }
1929       else
1930         success = FALSE;
1931     }
1932 
1933   return gimp_procedure_get_return_values (procedure, success,
1934                                            error ? *error : NULL);
1935 }
1936 
1937 static GimpValueArray *
plug_in_icc_profile_info_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1938 plug_in_icc_profile_info_invoker (GimpProcedure         *procedure,
1939                                   Gimp                  *gimp,
1940                                   GimpContext           *context,
1941                                   GimpProgress          *progress,
1942                                   const GimpValueArray  *args,
1943                                   GError               **error)
1944 {
1945   gboolean success = TRUE;
1946   GimpValueArray *return_vals;
1947   GimpImage *image;
1948   gchar *profile_name = NULL;
1949   gchar *profile_desc = NULL;
1950   gchar *profile_info = NULL;
1951 
1952   image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
1953 
1954   if (success)
1955     {
1956       GimpColorProfile *profile;
1957 
1958       profile = gimp_color_managed_get_color_profile (GIMP_COLOR_MANAGED (image));
1959 
1960       if (profile)
1961         {
1962           profile_name = g_strdup (gimp_color_profile_get_model (profile));
1963           profile_desc = g_strdup (gimp_color_profile_get_description (profile));
1964           profile_info = g_strdup (gimp_color_profile_get_summary (profile));
1965         }
1966     }
1967 
1968   return_vals = gimp_procedure_get_return_values (procedure, success,
1969                                                   error ? *error : NULL);
1970 
1971   if (success)
1972     {
1973       g_value_take_string (gimp_value_array_index (return_vals, 1), profile_name);
1974       g_value_take_string (gimp_value_array_index (return_vals, 2), profile_desc);
1975       g_value_take_string (gimp_value_array_index (return_vals, 3), profile_info);
1976     }
1977 
1978   return return_vals;
1979 }
1980 
1981 static GimpValueArray *
plug_in_icc_profile_file_info_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)1982 plug_in_icc_profile_file_info_invoker (GimpProcedure         *procedure,
1983                                        Gimp                  *gimp,
1984                                        GimpContext           *context,
1985                                        GimpProgress          *progress,
1986                                        const GimpValueArray  *args,
1987                                        GError               **error)
1988 {
1989   gboolean success = TRUE;
1990   GimpValueArray *return_vals;
1991   const gchar *profile;
1992   gchar *profile_name = NULL;
1993   gchar *profile_desc = NULL;
1994   gchar *profile_info = NULL;
1995 
1996   profile = g_value_get_string (gimp_value_array_index (args, 0));
1997 
1998   if (success)
1999     {
2000       GFile *file = g_file_new_for_path (profile);
2001 
2002       if (file)
2003         {
2004           GimpColorProfile *p;
2005 
2006           p = gimp_color_profile_new_from_file (file, error);
2007           g_object_unref (file);
2008 
2009           if (p)
2010             {
2011               profile_name = g_strdup (gimp_color_profile_get_model (p));
2012               profile_desc = g_strdup (gimp_color_profile_get_description (p));
2013               profile_info = g_strdup (gimp_color_profile_get_summary (p));
2014 
2015               g_object_unref (p);
2016             }
2017           else
2018             success = FALSE;
2019         }
2020       else
2021         success = FALSE;
2022     }
2023 
2024   return_vals = gimp_procedure_get_return_values (procedure, success,
2025                                                   error ? *error : NULL);
2026 
2027   if (success)
2028     {
2029       g_value_take_string (gimp_value_array_index (return_vals, 1), profile_name);
2030       g_value_take_string (gimp_value_array_index (return_vals, 2), profile_desc);
2031       g_value_take_string (gimp_value_array_index (return_vals, 3), profile_info);
2032     }
2033 
2034   return return_vals;
2035 }
2036 
2037 static GimpValueArray *
plug_in_icc_profile_apply_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2038 plug_in_icc_profile_apply_invoker (GimpProcedure         *procedure,
2039                                    Gimp                  *gimp,
2040                                    GimpContext           *context,
2041                                    GimpProgress          *progress,
2042                                    const GimpValueArray  *args,
2043                                    GError               **error)
2044 {
2045   gboolean success = TRUE;
2046   GimpImage *image;
2047   const gchar *profile;
2048   gint32 intent;
2049   gboolean bpc;
2050 
2051   image = gimp_value_get_image (gimp_value_array_index (args, 1), gimp);
2052   profile = g_value_get_string (gimp_value_array_index (args, 2));
2053   intent = g_value_get_enum (gimp_value_array_index (args, 3));
2054   bpc = g_value_get_boolean (gimp_value_array_index (args, 4));
2055 
2056   if (success)
2057     {
2058       if (gimp_pdb_image_is_not_base_type (image, GIMP_GRAY, error))
2059         {
2060           GimpColorProfile *p = NULL;
2061 
2062           if (profile)
2063             {
2064               GFile *file = g_file_new_for_path (profile);
2065 
2066               if (file)
2067                 {
2068                   p = gimp_color_profile_new_from_file (file, error);
2069 
2070                   if (! p)
2071                     success = FALSE;
2072 
2073                   g_object_unref (file);
2074                 }
2075               else
2076                 {
2077                   success = FALSE;
2078                 }
2079             }
2080           else if (image->gimp->config->color_management->rgb_profile)
2081             {
2082               p = gimp_color_config_get_rgb_color_profile (image->gimp->config->color_management,
2083                                                            error);
2084 
2085               if (! p)
2086                 success = FALSE;
2087             }
2088 
2089           if (success)
2090             {
2091               if (! p)
2092                 p = gimp_image_get_builtin_color_profile (image);
2093 
2094               success = gimp_image_convert_color_profile (image, p, intent, bpc,
2095                                                           progress, error);
2096             }
2097         }
2098       else
2099         success = FALSE;
2100     }
2101 
2102   return gimp_procedure_get_return_values (procedure, success,
2103                                            error ? *error : NULL);
2104 }
2105 
2106 static GimpValueArray *
plug_in_icc_profile_apply_rgb_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2107 plug_in_icc_profile_apply_rgb_invoker (GimpProcedure         *procedure,
2108                                        Gimp                  *gimp,
2109                                        GimpContext           *context,
2110                                        GimpProgress          *progress,
2111                                        const GimpValueArray  *args,
2112                                        GError               **error)
2113 {
2114   gboolean success = TRUE;
2115   GimpImage *image;
2116   gint32 intent;
2117   gboolean bpc;
2118 
2119   image = gimp_value_get_image (gimp_value_array_index (args, 1), gimp);
2120   intent = g_value_get_enum (gimp_value_array_index (args, 2));
2121   bpc = g_value_get_boolean (gimp_value_array_index (args, 3));
2122 
2123   if (success)
2124     {
2125       if (gimp_pdb_image_is_not_base_type (image, GIMP_GRAY, error))
2126         {
2127           GimpColorProfile *p = NULL;
2128 
2129           if (image->gimp->config->color_management->rgb_profile)
2130             {
2131               p = gimp_color_config_get_rgb_color_profile (image->gimp->config->color_management,
2132                                                            error);
2133 
2134               if (! p)
2135                 success = FALSE;
2136             }
2137 
2138           if (success)
2139             {
2140               if (! p)
2141                 p = gimp_image_get_builtin_color_profile (image);
2142 
2143               success = gimp_image_convert_color_profile (image, p, intent, bpc,
2144                                                           progress, error);
2145             }
2146         }
2147       else
2148         success = FALSE;
2149     }
2150 
2151   return gimp_procedure_get_return_values (procedure, success,
2152                                            error ? *error : NULL);
2153 }
2154 
2155 static GimpValueArray *
plug_in_icc_profile_set_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2156 plug_in_icc_profile_set_invoker (GimpProcedure         *procedure,
2157                                  Gimp                  *gimp,
2158                                  GimpContext           *context,
2159                                  GimpProgress          *progress,
2160                                  const GimpValueArray  *args,
2161                                  GError               **error)
2162 {
2163   gboolean success = TRUE;
2164   GimpImage *image;
2165   const gchar *profile;
2166 
2167   image = gimp_value_get_image (gimp_value_array_index (args, 1), gimp);
2168   profile = g_value_get_string (gimp_value_array_index (args, 2));
2169 
2170   if (success)
2171     {
2172       if (gimp_pdb_image_is_not_base_type (image, GIMP_GRAY, error))
2173         {
2174           GimpColorProfile *p = NULL;
2175 
2176           if (profile)
2177             {
2178               GFile *file = g_file_new_for_path (profile);
2179 
2180               if (file)
2181                 {
2182                   p = gimp_color_profile_new_from_file (file, error);
2183 
2184                   if (! p)
2185                     success = FALSE;
2186 
2187                   g_object_unref (file);
2188                 }
2189               else
2190                 success = FALSE;
2191             }
2192           else if (image->gimp->config->color_management->rgb_profile)
2193             {
2194               p = gimp_color_config_get_rgb_color_profile (image->gimp->config->color_management,
2195                                                            error);
2196 
2197               if (! p)
2198                 success = FALSE;
2199             }
2200 
2201           if (success)
2202             {
2203               gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_MISC,
2204                                            _("Set color profile"));
2205 
2206               if (gimp_image_set_color_profile (image, p, error))
2207                 gimp_image_parasite_detach (image, "icc-profile-name", TRUE);
2208               else
2209                 success = FALSE;
2210 
2211               gimp_image_undo_group_end (image);
2212 
2213               if (! success)
2214                 gimp_image_undo (image);
2215 
2216               if (p)
2217                 g_object_unref (p);
2218             }
2219         }
2220       else
2221         success = FALSE;
2222     }
2223 
2224   return gimp_procedure_get_return_values (procedure, success,
2225                                            error ? *error : NULL);
2226 }
2227 
2228 static GimpValueArray *
plug_in_icc_profile_set_rgb_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2229 plug_in_icc_profile_set_rgb_invoker (GimpProcedure         *procedure,
2230                                      Gimp                  *gimp,
2231                                      GimpContext           *context,
2232                                      GimpProgress          *progress,
2233                                      const GimpValueArray  *args,
2234                                      GError               **error)
2235 {
2236   gboolean success = TRUE;
2237   GimpImage *image;
2238 
2239   image = gimp_value_get_image (gimp_value_array_index (args, 1), gimp);
2240 
2241   if (success)
2242     {
2243       if (gimp_pdb_image_is_not_base_type (image, GIMP_GRAY, error))
2244         {
2245           GimpColorProfile *p = NULL;
2246 
2247           if (image->gimp->config->color_management->rgb_profile)
2248             {
2249               p = gimp_color_config_get_rgb_color_profile (image->gimp->config->color_management,
2250                                                            error);
2251 
2252               if (! p)
2253                 success = FALSE;
2254             }
2255 
2256           if (success)
2257             {
2258               gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_MISC,
2259                                            _("Set color profile"));
2260 
2261               if (gimp_image_set_color_profile (image, p, error))
2262                 gimp_image_parasite_detach (image, "icc-profile-name", TRUE);
2263               else
2264                 success = FALSE;
2265 
2266               gimp_image_undo_group_end (image);
2267 
2268               if (! success)
2269                 gimp_image_undo (image);
2270 
2271               if (p)
2272                 g_object_unref (p);
2273             }
2274         }
2275       else
2276         success = FALSE;
2277     }
2278 
2279   return gimp_procedure_get_return_values (procedure, success,
2280                                            error ? *error : NULL);
2281 }
2282 
2283 static GimpValueArray *
plug_in_illusion_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2284 plug_in_illusion_invoker (GimpProcedure         *procedure,
2285                           Gimp                  *gimp,
2286                           GimpContext           *context,
2287                           GimpProgress          *progress,
2288                           const GimpValueArray  *args,
2289                           GError               **error)
2290 {
2291   gboolean success = TRUE;
2292   GimpDrawable *drawable;
2293   gint32 division;
2294   gint32 type;
2295 
2296   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
2297   division = g_value_get_int (gimp_value_array_index (args, 3));
2298   type = g_value_get_int (gimp_value_array_index (args, 4));
2299 
2300   if (success)
2301     {
2302       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
2303                                      GIMP_PDB_ITEM_CONTENT, error) &&
2304           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
2305         {
2306           GeglNode *node =
2307             gegl_node_new_child (NULL,
2308                                  "operation",     "gegl:illusion",
2309                                  "division",      (gint) division,
2310                                  "illusion-type", (gint) type,
2311                                  NULL);
2312 
2313           gimp_drawable_apply_operation (drawable, progress,
2314                                          C_("undo-type", "Illusion"),
2315                                          node);
2316           g_object_unref (node);
2317         }
2318       else
2319         success = FALSE;
2320     }
2321 
2322   return gimp_procedure_get_return_values (procedure, success,
2323                                            error ? *error : NULL);
2324 }
2325 
2326 static GimpValueArray *
plug_in_laplace_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2327 plug_in_laplace_invoker (GimpProcedure         *procedure,
2328                          Gimp                  *gimp,
2329                          GimpContext           *context,
2330                          GimpProgress          *progress,
2331                          const GimpValueArray  *args,
2332                          GError               **error)
2333 {
2334   gboolean success = TRUE;
2335   GimpDrawable *drawable;
2336 
2337   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
2338 
2339   if (success)
2340     {
2341       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
2342                                      GIMP_PDB_ITEM_CONTENT, error) &&
2343           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
2344         {
2345           GeglNode *node =
2346             gegl_node_new_child (NULL,
2347                                  "operation", "gegl:edge-laplace",
2348                                  NULL);
2349 
2350           gimp_drawable_apply_operation (drawable, progress,
2351                                          C_("undo-type", "Laplace"),
2352                                          node);
2353           g_object_unref (node);
2354         }
2355       else
2356         success = FALSE;
2357     }
2358 
2359   return gimp_procedure_get_return_values (procedure, success,
2360                                            error ? *error : NULL);
2361 }
2362 
2363 static GimpValueArray *
plug_in_lens_distortion_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2364 plug_in_lens_distortion_invoker (GimpProcedure         *procedure,
2365                                  Gimp                  *gimp,
2366                                  GimpContext           *context,
2367                                  GimpProgress          *progress,
2368                                  const GimpValueArray  *args,
2369                                  GError               **error)
2370 {
2371   gboolean success = TRUE;
2372   GimpDrawable *drawable;
2373   gdouble offset_x;
2374   gdouble offset_y;
2375   gdouble main_adjust;
2376   gdouble edge_adjust;
2377   gdouble rescale;
2378   gdouble brighten;
2379 
2380   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
2381   offset_x = g_value_get_double (gimp_value_array_index (args, 3));
2382   offset_y = g_value_get_double (gimp_value_array_index (args, 4));
2383   main_adjust = g_value_get_double (gimp_value_array_index (args, 5));
2384   edge_adjust = g_value_get_double (gimp_value_array_index (args, 6));
2385   rescale = g_value_get_double (gimp_value_array_index (args, 7));
2386   brighten = g_value_get_double (gimp_value_array_index (args, 8));
2387 
2388   if (success)
2389     {
2390       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
2391                                      GIMP_PDB_ITEM_CONTENT, error) &&
2392           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
2393         {
2394           GeglNode  *node = NULL;
2395           GimpRGB    color;
2396           GeglColor *gegl_color;
2397 
2398           gimp_context_get_background (context, &color);
2399 
2400           if (gimp_drawable_has_alpha (drawable))
2401             {
2402               gimp_rgb_set_alpha (&color, 0.0);
2403             }
2404           else
2405             {
2406               gimp_rgb_set_alpha (&color, 1.0);
2407             }
2408 
2409           gegl_color = gimp_gegl_color_new (&color);
2410 
2411           node =  gegl_node_new_child (NULL,
2412                                        "operation", "gegl:lens-distortion",
2413                                        "main",       (gdouble) main_adjust,
2414                                        "edge",       (gdouble) edge_adjust,
2415                                        "zoom",       (gdouble) rescale,
2416                                        "x-shift",    (gdouble) offset_x,
2417                                        "y-shift",    (gdouble) offset_y,
2418                                        "brighten",   (gdouble) brighten,
2419                                        "background", gegl_color,
2420                                        NULL);
2421 
2422           g_object_unref (gegl_color);
2423 
2424           node = wrap_in_selection_bounds (node, drawable);
2425 
2426           gimp_drawable_apply_operation (drawable, progress,
2427                                         C_("undo-type", "Lens Distortion"),
2428                                         node);
2429           g_object_unref (node);
2430 
2431         }
2432       else
2433         success = FALSE;
2434     }
2435 
2436   return gimp_procedure_get_return_values (procedure, success,
2437                                            error ? *error : NULL);
2438 }
2439 
2440 static GimpValueArray *
plug_in_make_seamless_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2441 plug_in_make_seamless_invoker (GimpProcedure         *procedure,
2442                                Gimp                  *gimp,
2443                                GimpContext           *context,
2444                                GimpProgress          *progress,
2445                                const GimpValueArray  *args,
2446                                GError               **error)
2447 {
2448   gboolean success = TRUE;
2449   GimpDrawable *drawable;
2450 
2451   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
2452 
2453   if (success)
2454     {
2455       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
2456                                      GIMP_PDB_ITEM_CONTENT, error) &&
2457           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
2458         {
2459           GeglNode *node =
2460             gegl_node_new_child (NULL,
2461                                  "operation", "gegl:tile-seamless",
2462                                  NULL);
2463 
2464           node = wrap_in_selection_bounds (node, drawable);
2465 
2466           gimp_drawable_apply_operation (drawable, progress,
2467                                          C_("undo-type", "Tile Seamless"),
2468                                          node);
2469           g_object_unref (node);
2470         }
2471       else
2472         success = FALSE;
2473     }
2474 
2475   return gimp_procedure_get_return_values (procedure, success,
2476                                            error ? *error : NULL);
2477 }
2478 
2479 static GimpValueArray *
plug_in_maze_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2480 plug_in_maze_invoker (GimpProcedure         *procedure,
2481                       Gimp                  *gimp,
2482                       GimpContext           *context,
2483                       GimpProgress          *progress,
2484                       const GimpValueArray  *args,
2485                       GError               **error)
2486 {
2487   gboolean success = TRUE;
2488   GimpDrawable *drawable;
2489   gint16 width;
2490   gint16 height;
2491   guint8 tileable;
2492   guint8 algorithm;
2493   gint32 seed;
2494 
2495   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
2496   width = g_value_get_int (gimp_value_array_index (args, 3));
2497   height = g_value_get_int (gimp_value_array_index (args, 4));
2498   tileable = g_value_get_uint (gimp_value_array_index (args, 5));
2499   algorithm = g_value_get_uint (gimp_value_array_index (args, 6));
2500   seed = g_value_get_int (gimp_value_array_index (args, 7));
2501 
2502   if (success)
2503     {
2504       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
2505                                      GIMP_PDB_ITEM_CONTENT, error) &&
2506           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
2507         {
2508           GeglNode  *node;
2509           GeglColor *fg_color;
2510           GeglColor *bg_color;
2511           GimpRGB    color;
2512 
2513           gimp_context_get_foreground (context, &color);
2514           fg_color = gimp_gegl_color_new (&color);
2515 
2516           gimp_context_get_background (context, &color);
2517           bg_color = gimp_gegl_color_new (&color);
2518 
2519           node =  gegl_node_new_child (NULL,
2520                                        "operation",      "gegl:maze",
2521                                        "x",              width,
2522                                        "y",              height,
2523                                        "algorithm-type", algorithm,
2524                                        "tileable",       tileable,
2525                                        "seed",           seed,
2526                                        "fg-color",       fg_color,
2527                                        "bg-color",       bg_color,
2528                                        NULL);
2529 
2530           g_object_unref (fg_color);
2531           g_object_unref (bg_color);
2532 
2533           gimp_drawable_apply_operation (drawable, progress,
2534                                          C_("undo-type", "Maze"),
2535                                         node);
2536           g_object_unref (node);
2537         }
2538       else
2539         success = FALSE;
2540     }
2541 
2542   return gimp_procedure_get_return_values (procedure, success,
2543                                            error ? *error : NULL);
2544 }
2545 
2546 static GimpValueArray *
plug_in_mblur_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2547 plug_in_mblur_invoker (GimpProcedure         *procedure,
2548                        Gimp                  *gimp,
2549                        GimpContext           *context,
2550                        GimpProgress          *progress,
2551                        const GimpValueArray  *args,
2552                        GError               **error)
2553 {
2554   gboolean success = TRUE;
2555   GimpDrawable *drawable;
2556   gint32 type;
2557   gdouble length;
2558   gdouble angle;
2559   gdouble center_x;
2560   gdouble center_y;
2561 
2562   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
2563   type = g_value_get_int (gimp_value_array_index (args, 3));
2564   length = g_value_get_double (gimp_value_array_index (args, 4));
2565   angle = g_value_get_double (gimp_value_array_index (args, 5));
2566   center_x = g_value_get_double (gimp_value_array_index (args, 6));
2567   center_y = g_value_get_double (gimp_value_array_index (args, 7));
2568 
2569   if (success)
2570     {
2571       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
2572                                      GIMP_PDB_ITEM_CONTENT, error) &&
2573           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
2574         {
2575           GeglNode *node   = NULL;
2576           gint      width  = gimp_item_get_width  (GIMP_ITEM (drawable));
2577           gint      height = gimp_item_get_height (GIMP_ITEM (drawable));
2578 
2579           center_x /= (gdouble) width;
2580           center_y /= (gdouble) height;
2581 
2582           if (angle > 180.0)
2583             angle -= 360.0;
2584 
2585           if (type == 0)
2586             {
2587               node =  gegl_node_new_child (NULL,
2588                                            "operation", "gegl:motion-blur-linear",
2589                                            "length",    length,
2590                                            "angle",     angle,
2591                                             NULL);
2592             }
2593           else if (type == 1)
2594             {
2595               node =  gegl_node_new_child (NULL,
2596                                            "operation", "gegl:motion-blur-circular",
2597                                            "center-x",  center_x,
2598                                            "center-y",  center_y,
2599                                            "angle",     angle,
2600                                             NULL);
2601             }
2602           else if (type == 2)
2603             {
2604               gdouble factor = CLAMP (length / 256.0, 0.0, 1.0);
2605 
2606               node =  gegl_node_new_child (NULL,
2607                                            "operation", "gegl:motion-blur-zoom",
2608                                            "center-x",  center_x,
2609                                            "center-y",  center_y,
2610                                            "factor",    factor,
2611                                             NULL);
2612             }
2613 
2614           if (node != NULL)
2615             {
2616               gimp_drawable_apply_operation (drawable, progress,
2617                                              C_("undo-type", "Motion Blur"),
2618                                              node);
2619               g_object_unref (node);
2620             }
2621           else
2622             success = FALSE;
2623 
2624         }
2625       else
2626         success = FALSE;
2627     }
2628 
2629   return gimp_procedure_get_return_values (procedure, success,
2630                                            error ? *error : NULL);
2631 }
2632 
2633 static GimpValueArray *
plug_in_mblur_inward_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2634 plug_in_mblur_inward_invoker (GimpProcedure         *procedure,
2635                               Gimp                  *gimp,
2636                               GimpContext           *context,
2637                               GimpProgress          *progress,
2638                               const GimpValueArray  *args,
2639                               GError               **error)
2640 {
2641   gboolean success = TRUE;
2642   GimpDrawable *drawable;
2643   gint32 type;
2644   gdouble length;
2645   gdouble angle;
2646   gdouble center_x;
2647   gdouble center_y;
2648 
2649   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
2650   type = g_value_get_int (gimp_value_array_index (args, 3));
2651   length = g_value_get_double (gimp_value_array_index (args, 4));
2652   angle = g_value_get_double (gimp_value_array_index (args, 5));
2653   center_x = g_value_get_double (gimp_value_array_index (args, 6));
2654   center_y = g_value_get_double (gimp_value_array_index (args, 7));
2655 
2656   if (success)
2657     {
2658       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
2659                                      GIMP_PDB_ITEM_CONTENT, error) &&
2660           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
2661         {
2662           GeglNode *node   = NULL;
2663           gint      width  = gimp_item_get_width  (GIMP_ITEM (drawable));
2664           gint      height = gimp_item_get_height (GIMP_ITEM (drawable));
2665 
2666           center_x /= (gdouble) width;
2667           center_y /= (gdouble) height;
2668 
2669           if (type == 0)
2670             {
2671               node =  gegl_node_new_child (NULL,
2672                                            "operation", "gegl:motion-blur-linear",
2673                                            "length",    length,
2674                                            "angle",     angle,
2675                                             NULL);
2676             }
2677           else if (type == 1)
2678             {
2679               node =  gegl_node_new_child (NULL,
2680                                            "operation", "gegl:motion-blur-circular",
2681                                            "center-x",  center_x,
2682                                            "center-y",  center_y,
2683                                            "angle",     angle,
2684                                             NULL);
2685             }
2686           else if (type == 2)
2687             {
2688               gdouble factor = CLAMP (-length / (256.0 - length), -10.0, 0.0);
2689 
2690               node =  gegl_node_new_child (NULL,
2691                                            "operation", "gegl:motion-blur-zoom",
2692                                            "center-x",  center_x,
2693                                            "center-y",  center_y,
2694                                            "factor",    factor,
2695                                             NULL);
2696             }
2697 
2698           if (node != NULL)
2699             {
2700               gimp_drawable_apply_operation (drawable, progress,
2701                                              C_("undo-type", "Motion Blur"),
2702                                              node);
2703               g_object_unref (node);
2704             }
2705           else
2706             success = FALSE;
2707 
2708         }
2709       else
2710         success = FALSE;
2711     }
2712 
2713   return gimp_procedure_get_return_values (procedure, success,
2714                                            error ? *error : NULL);
2715 }
2716 
2717 static GimpValueArray *
plug_in_median_blur_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2718 plug_in_median_blur_invoker (GimpProcedure         *procedure,
2719                              Gimp                  *gimp,
2720                              GimpContext           *context,
2721                              GimpProgress          *progress,
2722                              const GimpValueArray  *args,
2723                              GError               **error)
2724 {
2725   gboolean success = TRUE;
2726   GimpDrawable *drawable;
2727   gint32 radius;
2728   gdouble percentile;
2729 
2730   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
2731   radius = g_value_get_int (gimp_value_array_index (args, 3));
2732   percentile = g_value_get_double (gimp_value_array_index (args, 4));
2733 
2734   if (success)
2735     {
2736       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
2737                                      GIMP_PDB_ITEM_CONTENT, error) &&
2738           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
2739         {
2740           GeglNode *node =
2741             gegl_node_new_child (NULL,
2742                                  "operation", "gegl:median-blur",
2743                                  "radius",     radius,
2744                                  "percentile", percentile,
2745                                  NULL);
2746 
2747           gimp_drawable_apply_operation (drawable, progress,
2748                                          C_("undo-type", "Median Blur"),
2749                                          node);
2750           g_object_unref (node);
2751         }
2752       else
2753         success = FALSE;
2754     }
2755 
2756   return gimp_procedure_get_return_values (procedure, success,
2757                                            error ? *error : NULL);
2758 }
2759 
2760 static GimpValueArray *
plug_in_mosaic_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2761 plug_in_mosaic_invoker (GimpProcedure         *procedure,
2762                         Gimp                  *gimp,
2763                         GimpContext           *context,
2764                         GimpProgress          *progress,
2765                         const GimpValueArray  *args,
2766                         GError               **error)
2767 {
2768   gboolean success = TRUE;
2769   GimpDrawable *drawable;
2770   gdouble tile_size;
2771   gdouble tile_height;
2772   gdouble tile_spacing;
2773   gdouble tile_neatness;
2774   gint32 tile_allow_split;
2775   gdouble light_dir;
2776   gdouble color_variation;
2777   gint32 antialiasing;
2778   gint32 color_averaging;
2779   gint32 tile_type;
2780   gint32 tile_surface;
2781   gint32 grout_color;
2782 
2783   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
2784   tile_size = g_value_get_double (gimp_value_array_index (args, 3));
2785   tile_height = g_value_get_double (gimp_value_array_index (args, 4));
2786   tile_spacing = g_value_get_double (gimp_value_array_index (args, 5));
2787   tile_neatness = g_value_get_double (gimp_value_array_index (args, 6));
2788   tile_allow_split = g_value_get_int (gimp_value_array_index (args, 7));
2789   light_dir = g_value_get_double (gimp_value_array_index (args, 8));
2790   color_variation = g_value_get_double (gimp_value_array_index (args, 9));
2791   antialiasing = g_value_get_int (gimp_value_array_index (args, 10));
2792   color_averaging = g_value_get_int (gimp_value_array_index (args, 11));
2793   tile_type = g_value_get_int (gimp_value_array_index (args, 12));
2794   tile_surface = g_value_get_int (gimp_value_array_index (args, 13));
2795   grout_color = g_value_get_int (gimp_value_array_index (args, 14));
2796 
2797   if (success)
2798     {
2799       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
2800                                      GIMP_PDB_ITEM_CONTENT, error) &&
2801           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
2802         {
2803           GeglColor *fg_color;
2804           GeglColor *bg_color;
2805           GeglNode  *node;
2806 
2807           if (grout_color)
2808             {
2809               GimpRGB fgcolor, bgcolor;
2810 
2811               gimp_context_get_background (context, &bgcolor);
2812               bg_color = gimp_gegl_color_new (&bgcolor);
2813 
2814               gimp_context_get_foreground (context, &fgcolor);
2815               fg_color = gimp_gegl_color_new (&fgcolor);
2816             }
2817           else
2818             {
2819               /* sic */
2820               fg_color = gegl_color_new ("white");
2821               bg_color = gegl_color_new ("black");
2822             }
2823 
2824           node = gegl_node_new_child (NULL,
2825                      "operation",        "gegl:mosaic",
2826                      "tile-size",        (gdouble)  tile_size,
2827                      "tile-height",      (gdouble)  tile_height,
2828                      "tile-spacing",     (gdouble)  tile_spacing,
2829                      "tile-neatness",    (gdouble)  tile_neatness,
2830                      "tile-allow-split", (gboolean) tile_allow_split,
2831                      "light-dir",        (gdouble)  light_dir,
2832                      "color-variation",  (gfloat)   color_variation,
2833                      "antialiasing",     (gboolean) antialiasing,
2834                      "color-averaging",  (gboolean) color_averaging,
2835                      "tile-type",        (gint)     tile_type,
2836                      "tile-surface",     (gboolean) tile_surface,
2837                      "light-color",      fg_color,
2838                      "joints-color",     bg_color,
2839                      NULL);
2840 
2841           g_object_unref (fg_color);
2842           g_object_unref (bg_color);
2843 
2844           gimp_drawable_apply_operation (drawable, progress,
2845                                          C_("undo-type", "Mosaic"),
2846                                          node);
2847           g_object_unref (node);
2848         }
2849       else
2850         success = FALSE;
2851     }
2852 
2853   return gimp_procedure_get_return_values (procedure, success,
2854                                            error ? *error : NULL);
2855 }
2856 
2857 static GimpValueArray *
plug_in_neon_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2858 plug_in_neon_invoker (GimpProcedure         *procedure,
2859                       Gimp                  *gimp,
2860                       GimpContext           *context,
2861                       GimpProgress          *progress,
2862                       const GimpValueArray  *args,
2863                       GError               **error)
2864 {
2865   gboolean success = TRUE;
2866   GimpDrawable *drawable;
2867   gdouble radius;
2868   gdouble amount;
2869 
2870   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
2871   radius = g_value_get_double (gimp_value_array_index (args, 3));
2872   amount = g_value_get_double (gimp_value_array_index (args, 4));
2873 
2874   if (success)
2875     {
2876       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
2877                                      GIMP_PDB_ITEM_CONTENT, error) &&
2878           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
2879         {
2880           GeglNode *node;
2881 
2882           node = gegl_node_new_child (NULL,
2883                                       "operation", "gegl:edge-neon",
2884                                       "radius",    radius,
2885                                       "amount",    amount,
2886                                       NULL);
2887 
2888           gimp_drawable_apply_operation (drawable, progress,
2889                                          C_("undo-type", "Neon"),
2890                                          node);
2891           g_object_unref (node);
2892         }
2893       else
2894         success = FALSE;
2895     }
2896 
2897   return gimp_procedure_get_return_values (procedure, success,
2898                                            error ? *error : NULL);
2899 }
2900 
2901 static GimpValueArray *
plug_in_newsprint_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2902 plug_in_newsprint_invoker (GimpProcedure         *procedure,
2903                            Gimp                  *gimp,
2904                            GimpContext           *context,
2905                            GimpProgress          *progress,
2906                            const GimpValueArray  *args,
2907                            GError               **error)
2908 {
2909   gboolean success = TRUE;
2910   GimpDrawable *drawable;
2911   gint32 cell_width;
2912   gint32 colorspace;
2913   gint32 k_pullout;
2914   gdouble gry_ang;
2915   gint32 gry_spotfn;
2916   gdouble red_ang;
2917   gint32 red_spotfn;
2918   gdouble grn_ang;
2919   gint32 grn_spotfn;
2920   gdouble blu_ang;
2921   gint32 blu_spotfn;
2922   gint32 oversample;
2923 
2924   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
2925   cell_width = g_value_get_int (gimp_value_array_index (args, 3));
2926   colorspace = g_value_get_int (gimp_value_array_index (args, 4));
2927   k_pullout = g_value_get_int (gimp_value_array_index (args, 5));
2928   gry_ang = g_value_get_double (gimp_value_array_index (args, 6));
2929   gry_spotfn = g_value_get_int (gimp_value_array_index (args, 7));
2930   red_ang = g_value_get_double (gimp_value_array_index (args, 8));
2931   red_spotfn = g_value_get_int (gimp_value_array_index (args, 9));
2932   grn_ang = g_value_get_double (gimp_value_array_index (args, 10));
2933   grn_spotfn = g_value_get_int (gimp_value_array_index (args, 11));
2934   blu_ang = g_value_get_double (gimp_value_array_index (args, 12));
2935   blu_spotfn = g_value_get_int (gimp_value_array_index (args, 13));
2936   oversample = g_value_get_int (gimp_value_array_index (args, 14));
2937 
2938   if (success)
2939     {
2940       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
2941                                      GIMP_PDB_ITEM_CONTENT, error) &&
2942           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
2943         {
2944           GeglNode *node;
2945           gint      color_model = newsprint_color_model (colorspace);
2946           gint      pattern     = newsprint_pattern (gry_spotfn);
2947           gint      pattern2    = newsprint_pattern (red_spotfn);
2948           gint      pattern3    = newsprint_pattern (grn_spotfn);
2949           gint      pattern4    = newsprint_pattern (blu_spotfn);
2950           gdouble   angle       = newsprint_angle (gry_ang);
2951           gdouble   angle2      = newsprint_angle (red_ang);
2952           gdouble   angle3      = newsprint_angle (grn_ang);
2953           gdouble   angle4      = newsprint_angle (blu_ang);
2954 
2955           node = gegl_node_new_child (NULL,
2956                                       "operation",     "gegl:newsprint",
2957                                       "color-model",   color_model,
2958                                       "black-pullout", (gdouble) k_pullout / 100.0,
2959                                       "period",        (gdouble) cell_width,
2960                                       "angle",         angle,
2961                                       "pattern",       pattern,
2962                                       "period2",       (gdouble) cell_width,
2963                                       "angle2",        angle2,
2964                                       "pattern2",      pattern2,
2965                                       "period3",       (gdouble) cell_width,
2966                                       "angle3",        angle3,
2967                                       "pattern3",      pattern3,
2968                                       "period4",       (gdouble) cell_width,
2969                                       "angle4",        angle4,
2970                                       "pattern4",      pattern4,
2971                                       "aa-samples",    oversample,
2972                                       NULL);
2973 
2974           node = wrap_in_gamma_cast (node, drawable);
2975 
2976           gimp_drawable_apply_operation (drawable, progress,
2977                                          C_("undo-type", "Newsprint"),
2978                                          node);
2979           g_object_unref (node);
2980         }
2981       else
2982         success = FALSE;
2983     }
2984 
2985   return gimp_procedure_get_return_values (procedure, success,
2986                                            error ? *error : NULL);
2987 }
2988 
2989 static GimpValueArray *
plug_in_normalize_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)2990 plug_in_normalize_invoker (GimpProcedure         *procedure,
2991                            Gimp                  *gimp,
2992                            GimpContext           *context,
2993                            GimpProgress          *progress,
2994                            const GimpValueArray  *args,
2995                            GError               **error)
2996 {
2997   gboolean success = TRUE;
2998   GimpDrawable *drawable;
2999 
3000   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3001 
3002   if (success)
3003     {
3004       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3005                                      GIMP_PDB_ITEM_CONTENT, error) &&
3006           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3007         {
3008           GeglNode *node;
3009 
3010           node = gegl_node_new_child (NULL,
3011                                       "operation",   "gegl:stretch-contrast",
3012                                       "keep-colors", TRUE,
3013                                       "perceptual",  TRUE,
3014                                       NULL);
3015 
3016           gimp_drawable_apply_operation (drawable, progress,
3017                                          C_("undo-type", "Normalize"),
3018                                          node);
3019           g_object_unref (node);
3020         }
3021       else
3022         success = FALSE;
3023     }
3024 
3025   return gimp_procedure_get_return_values (procedure, success,
3026                                            error ? *error : NULL);
3027 }
3028 
3029 static GimpValueArray *
plug_in_nova_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3030 plug_in_nova_invoker (GimpProcedure         *procedure,
3031                       Gimp                  *gimp,
3032                       GimpContext           *context,
3033                       GimpProgress          *progress,
3034                       const GimpValueArray  *args,
3035                       GError               **error)
3036 {
3037   gboolean success = TRUE;
3038   GimpDrawable *drawable;
3039   gint32 xcenter;
3040   gint32 ycenter;
3041   GimpRGB color;
3042   gint32 radius;
3043   gint32 nspoke;
3044   gint32 randomhue;
3045 
3046   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3047   xcenter = g_value_get_int (gimp_value_array_index (args, 3));
3048   ycenter = g_value_get_int (gimp_value_array_index (args, 4));
3049   gimp_value_get_rgb (gimp_value_array_index (args, 5), &color);
3050   radius = g_value_get_int (gimp_value_array_index (args, 6));
3051   nspoke = g_value_get_int (gimp_value_array_index (args, 7));
3052   randomhue = g_value_get_int (gimp_value_array_index (args, 8));
3053 
3054   if (success)
3055     {
3056       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3057                                      GIMP_PDB_ITEM_CONTENT, error) &&
3058           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3059         {
3060           GeglNode  *node;
3061           GeglColor *gegl_color = gimp_gegl_color_new (&color);
3062           gdouble    center_x   = (gdouble) xcenter / (gdouble) gimp_item_get_width (GIMP_ITEM (drawable));
3063           gdouble    center_y   = (gdouble) ycenter / (gdouble) gimp_item_get_height (GIMP_ITEM (drawable));
3064 
3065           node = gegl_node_new_child (NULL,
3066                                       "operation",    "gegl:supernova",
3067                                       "center-x",     center_x,
3068                                       "center-y",     center_y,
3069                                       "radius",       radius,
3070                                       "spokes-count", nspoke,
3071                                       "random-hue",   randomhue,
3072                                       "color",        gegl_color,
3073                                       "seed",         g_random_int (),
3074                                       NULL);
3075 
3076           g_object_unref (gegl_color);
3077 
3078           gimp_drawable_apply_operation (drawable, progress,
3079                                          C_("undo-type", "Supernova"),
3080                                          node);
3081           g_object_unref (node);
3082         }
3083       else
3084         success = FALSE;
3085     }
3086 
3087   return gimp_procedure_get_return_values (procedure, success,
3088                                            error ? *error : NULL);
3089 }
3090 
3091 static GimpValueArray *
plug_in_oilify_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3092 plug_in_oilify_invoker (GimpProcedure         *procedure,
3093                         Gimp                  *gimp,
3094                         GimpContext           *context,
3095                         GimpProgress          *progress,
3096                         const GimpValueArray  *args,
3097                         GError               **error)
3098 {
3099   gboolean success = TRUE;
3100   GimpDrawable *drawable;
3101   gint32 mask_size;
3102   gint32 mode;
3103 
3104   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3105   mask_size = g_value_get_int (gimp_value_array_index (args, 3));
3106   mode = g_value_get_int (gimp_value_array_index (args, 4));
3107 
3108   if (success)
3109     {
3110       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3111                                      GIMP_PDB_ITEM_CONTENT, error) &&
3112           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3113         {
3114           GeglNode *node;
3115 
3116           node = gegl_node_new_child (NULL,
3117                                       "operation",       "gegl:oilify",
3118                                       "mask-radius",     MAX (1, mask_size / 2),
3119                                       "use-inten",       mode ? TRUE : FALSE,
3120                                       NULL);
3121 
3122           gimp_drawable_apply_operation (drawable, progress,
3123                                          C_("undo-type", "Oilify"),
3124                                          node);
3125           g_object_unref (node);
3126         }
3127       else
3128         success = FALSE;
3129     }
3130 
3131   return gimp_procedure_get_return_values (procedure, success,
3132                                            error ? *error : NULL);
3133 }
3134 
3135 static GimpValueArray *
plug_in_oilify_enhanced_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3136 plug_in_oilify_enhanced_invoker (GimpProcedure         *procedure,
3137                                  Gimp                  *gimp,
3138                                  GimpContext           *context,
3139                                  GimpProgress          *progress,
3140                                  const GimpValueArray  *args,
3141                                  GError               **error)
3142 {
3143   gboolean success = TRUE;
3144   GimpDrawable *drawable;
3145   gint32 mode;
3146   gint32 mask_size;
3147   GimpDrawable *mask_size_map;
3148   gint32 exponent;
3149   GimpDrawable *exponent_map;
3150 
3151   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3152   mode = g_value_get_int (gimp_value_array_index (args, 3));
3153   mask_size = g_value_get_int (gimp_value_array_index (args, 4));
3154   mask_size_map = gimp_value_get_drawable (gimp_value_array_index (args, 5), gimp);
3155   exponent = g_value_get_int (gimp_value_array_index (args, 6));
3156   exponent_map = gimp_value_get_drawable (gimp_value_array_index (args, 7), gimp);
3157 
3158   if (success)
3159     {
3160       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3161                                      GIMP_PDB_ITEM_CONTENT, error) &&
3162           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3163         {
3164           GeglNode *graph;
3165           GeglNode *node;
3166 
3167           node = gegl_node_new_child (NULL,
3168                                       "operation",   "gegl:oilify",
3169                                       "mask-radius", MAX (1, mask_size / 2),
3170                                       "use-inten",   mode ? TRUE : FALSE,
3171                                       "exponent",    exponent,
3172                                       NULL);
3173 
3174           graph = wrap_in_graph (node);
3175 
3176           if (mask_size_map)
3177             {
3178               GeglNode *src_node;
3179               src_node = create_buffer_source_node (graph, mask_size_map);
3180               gegl_node_connect_to (src_node, "output", node, "aux");
3181             }
3182 
3183           if (exponent_map)
3184             {
3185               GeglNode *src_node;
3186               src_node = create_buffer_source_node (graph, exponent_map);
3187               gegl_node_connect_to (src_node, "output", node, "aux2");
3188             }
3189 
3190           gimp_drawable_apply_operation (drawable, progress,
3191                                          C_("undo-type", "Oilify"),
3192                                          graph);
3193           g_object_unref (graph);
3194         }
3195       else
3196         success = FALSE;
3197     }
3198 
3199   return gimp_procedure_get_return_values (procedure, success,
3200                                            error ? *error : NULL);
3201 }
3202 
3203 static GimpValueArray *
plug_in_papertile_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3204 plug_in_papertile_invoker (GimpProcedure         *procedure,
3205                            Gimp                  *gimp,
3206                            GimpContext           *context,
3207                            GimpProgress          *progress,
3208                            const GimpValueArray  *args,
3209                            GError               **error)
3210 {
3211   gboolean success = TRUE;
3212   GimpDrawable *drawable;
3213   gint32 tile_size;
3214   gdouble move_max;
3215   gint32 fractional_type;
3216   gboolean wrap_around;
3217   gboolean centering;
3218   gint32 background_type;
3219   GimpRGB background_color;
3220 
3221   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3222   tile_size = g_value_get_int (gimp_value_array_index (args, 3));
3223   move_max = g_value_get_double (gimp_value_array_index (args, 4));
3224   fractional_type = g_value_get_int (gimp_value_array_index (args, 5));
3225   wrap_around = g_value_get_boolean (gimp_value_array_index (args, 6));
3226   centering = g_value_get_boolean (gimp_value_array_index (args, 7));
3227   background_type = g_value_get_int (gimp_value_array_index (args, 8));
3228   gimp_value_get_rgb (gimp_value_array_index (args, 9), &background_color);
3229 
3230   if (success)
3231     {
3232       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3233                                      GIMP_PDB_ITEM_CONTENT, error) &&
3234           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3235         {
3236           GeglNode  *node;
3237           GimpRGB    color;
3238           GeglColor *gegl_color;
3239           gint       bg_type;
3240 
3241           switch (background_type)
3242             {
3243             default:
3244               bg_type = background_type;
3245               gimp_rgba_set (&color, 0.0, 0.0, 1.0, 1.0);
3246               break;
3247 
3248             case 3:
3249               bg_type = 3;
3250               gimp_context_get_foreground (context, &color);
3251               break;
3252 
3253             case 4:
3254               bg_type = 3;
3255               gimp_context_get_background (context, &color);
3256               break;
3257 
3258             case 5:
3259               bg_type = 3;
3260               color = background_color;
3261               break;
3262             }
3263 
3264           gegl_color = gimp_gegl_color_new (&color);
3265 
3266           node = gegl_node_new_child (NULL,
3267                                       "operation",       "gegl:tile-paper",
3268                                       "tile-width",      tile_size,
3269                                       "tile-height",     tile_size,
3270                                       "move-rate",       move_max,
3271                                       "bg-color",        gegl_color,
3272                                       "centering",       centering,
3273                                       "wrap-around",     wrap_around,
3274                                       "background-type", bg_type,
3275                                       "fractional-type", fractional_type,
3276                                       NULL);
3277 
3278           g_object_unref (gegl_color);
3279 
3280           gimp_drawable_apply_operation (drawable, progress,
3281                                          C_("undo-type", "Paper Tile"),
3282                                          node);
3283           g_object_unref (node);
3284         }
3285       else
3286         success = FALSE;
3287     }
3288 
3289   return gimp_procedure_get_return_values (procedure, success,
3290                                            error ? *error : NULL);
3291 }
3292 
3293 static GimpValueArray *
plug_in_pixelize_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3294 plug_in_pixelize_invoker (GimpProcedure         *procedure,
3295                           Gimp                  *gimp,
3296                           GimpContext           *context,
3297                           GimpProgress          *progress,
3298                           const GimpValueArray  *args,
3299                           GError               **error)
3300 {
3301   gboolean success = TRUE;
3302   GimpDrawable *drawable;
3303   gint32 pixel_width;
3304 
3305   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3306   pixel_width = g_value_get_int (gimp_value_array_index (args, 3));
3307 
3308   if (success)
3309     {
3310       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3311                                      GIMP_PDB_ITEM_CONTENT, error) &&
3312           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3313         {
3314           GeglNode *node =
3315             gegl_node_new_child (NULL,
3316                                  "operation", "gegl:pixelize",
3317                                  "size-x",    pixel_width,
3318                                  "size-y",    pixel_width,
3319                                  NULL);
3320 
3321           gimp_drawable_apply_operation (drawable, progress,
3322                                          C_("undo-type", "Pixelize"),
3323                                          node);
3324           g_object_unref (node);
3325         }
3326       else
3327         success = FALSE;
3328     }
3329 
3330   return gimp_procedure_get_return_values (procedure, success,
3331                                            error ? *error : NULL);
3332 }
3333 
3334 static GimpValueArray *
plug_in_pixelize2_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3335 plug_in_pixelize2_invoker (GimpProcedure         *procedure,
3336                            Gimp                  *gimp,
3337                            GimpContext           *context,
3338                            GimpProgress          *progress,
3339                            const GimpValueArray  *args,
3340                            GError               **error)
3341 {
3342   gboolean success = TRUE;
3343   GimpDrawable *drawable;
3344   gint32 pixel_width;
3345   gint32 pixel_height;
3346 
3347   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3348   pixel_width = g_value_get_int (gimp_value_array_index (args, 3));
3349   pixel_height = g_value_get_int (gimp_value_array_index (args, 4));
3350 
3351   if (success)
3352     {
3353       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3354                                      GIMP_PDB_ITEM_CONTENT, error) &&
3355           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3356         {
3357           GeglNode *node =
3358             gegl_node_new_child (NULL,
3359                                  "operation", "gegl:pixelize",
3360                                  "size-x",    pixel_width,
3361                                  "size-y",    pixel_height,
3362                                  NULL);
3363 
3364           gimp_drawable_apply_operation (drawable, progress,
3365                                          C_("undo-type", "Pixelize"),
3366                                          node);
3367           g_object_unref (node);
3368         }
3369       else
3370         success = FALSE;
3371     }
3372 
3373   return gimp_procedure_get_return_values (procedure, success,
3374                                            error ? *error : NULL);
3375 }
3376 
3377 static GimpValueArray *
plug_in_plasma_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3378 plug_in_plasma_invoker (GimpProcedure         *procedure,
3379                         Gimp                  *gimp,
3380                         GimpContext           *context,
3381                         GimpProgress          *progress,
3382                         const GimpValueArray  *args,
3383                         GError               **error)
3384 {
3385   gboolean success = TRUE;
3386   GimpDrawable *drawable;
3387   gint32 seed;
3388   gdouble turbulence;
3389 
3390   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3391   seed = g_value_get_int (gimp_value_array_index (args, 3));
3392   turbulence = g_value_get_double (gimp_value_array_index (args, 4));
3393 
3394   if (success)
3395     {
3396       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3397                                      GIMP_PDB_ITEM_CONTENT, error) &&
3398           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3399         {
3400           GeglNode *node;
3401           gint      x, y, width, height;
3402 
3403           gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height);
3404 
3405           node = gegl_node_new_child (NULL,
3406                                       "operation",  "gegl:plasma",
3407                                       "seed",       seed,
3408                                       "turbulence", turbulence,
3409                                       "x",          x,
3410                                       "y",          y,
3411                                       "width",      width,
3412                                       "height",     height,
3413                                       NULL);
3414 
3415           gimp_drawable_apply_operation (drawable, progress,
3416                                          C_("undo-type", "Plasma"),
3417                                          node);
3418           g_object_unref (node);
3419         }
3420       else
3421         success = FALSE;
3422     }
3423 
3424   return gimp_procedure_get_return_values (procedure, success,
3425                                            error ? *error : NULL);
3426 }
3427 
3428 static GimpValueArray *
plug_in_polar_coords_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3429 plug_in_polar_coords_invoker (GimpProcedure         *procedure,
3430                               Gimp                  *gimp,
3431                               GimpContext           *context,
3432                               GimpProgress          *progress,
3433                               const GimpValueArray  *args,
3434                               GError               **error)
3435 {
3436   gboolean success = TRUE;
3437   GimpDrawable *drawable;
3438   gdouble circle;
3439   gdouble angle;
3440   gboolean backwards;
3441   gboolean inverse;
3442   gboolean polrec;
3443 
3444   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3445   circle = g_value_get_double (gimp_value_array_index (args, 3));
3446   angle = g_value_get_double (gimp_value_array_index (args, 4));
3447   backwards = g_value_get_boolean (gimp_value_array_index (args, 5));
3448   inverse = g_value_get_boolean (gimp_value_array_index (args, 6));
3449   polrec = g_value_get_boolean (gimp_value_array_index (args, 7));
3450 
3451   if (success)
3452     {
3453       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3454                                      GIMP_PDB_ITEM_CONTENT, error) &&
3455           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3456         {
3457           GeglNode *node =
3458             gegl_node_new_child (NULL,
3459                                  "operation", "gegl:polar-coordinates",
3460                                  "depth",     circle,
3461                                  "angle",     angle,
3462                                  "bw",        backwards, /* XXX name */
3463                                  "top",       inverse,
3464                                  "polar",     polrec,
3465                                  NULL);
3466 
3467           node = wrap_in_selection_bounds (node, drawable);
3468 
3469           gimp_drawable_apply_operation (drawable, progress,
3470                                          C_("undo-type", "Polar Coordinates"),
3471                                          node);
3472           g_object_unref (node);
3473         }
3474       else
3475         success = FALSE;
3476     }
3477 
3478   return gimp_procedure_get_return_values (procedure, success,
3479                                            error ? *error : NULL);
3480 }
3481 
3482 static GimpValueArray *
plug_in_red_eye_removal_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3483 plug_in_red_eye_removal_invoker (GimpProcedure         *procedure,
3484                                  Gimp                  *gimp,
3485                                  GimpContext           *context,
3486                                  GimpProgress          *progress,
3487                                  const GimpValueArray  *args,
3488                                  GError               **error)
3489 {
3490   gboolean success = TRUE;
3491   GimpDrawable *drawable;
3492   gint32 threshold;
3493 
3494   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3495   threshold = g_value_get_int (gimp_value_array_index (args, 3));
3496 
3497   if (success)
3498     {
3499       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3500                                      GIMP_PDB_ITEM_CONTENT, error) &&
3501           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3502         {
3503           GeglNode *node =
3504             gegl_node_new_child (NULL,
3505                                  "operation", "gegl:red-eye-removal",
3506                                  "threshold", (gdouble) (threshold - 50) / 50.0 * 0.2 + 0.4,
3507                                  NULL);
3508 
3509           gimp_drawable_apply_operation (drawable, progress,
3510                                          C_("undo-type", "Red Eye Removal"),
3511                                          node);
3512           g_object_unref (node);
3513         }
3514       else
3515         success = FALSE;
3516     }
3517 
3518   return gimp_procedure_get_return_values (procedure, success,
3519                                            error ? *error : NULL);
3520 }
3521 
3522 static GimpValueArray *
plug_in_randomize_hurl_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3523 plug_in_randomize_hurl_invoker (GimpProcedure         *procedure,
3524                                 Gimp                  *gimp,
3525                                 GimpContext           *context,
3526                                 GimpProgress          *progress,
3527                                 const GimpValueArray  *args,
3528                                 GError               **error)
3529 {
3530   gboolean success = TRUE;
3531   GimpDrawable *drawable;
3532   gdouble rndm_pct;
3533   gdouble rndm_rcount;
3534   gboolean randomize;
3535   gint32 seed;
3536 
3537   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3538   rndm_pct = g_value_get_double (gimp_value_array_index (args, 3));
3539   rndm_rcount = g_value_get_double (gimp_value_array_index (args, 4));
3540   randomize = g_value_get_boolean (gimp_value_array_index (args, 5));
3541   seed = g_value_get_int (gimp_value_array_index (args, 6));
3542 
3543   if (success)
3544     {
3545       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3546                                      GIMP_PDB_ITEM_CONTENT, error) &&
3547           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3548         {
3549           GeglNode *node;
3550 
3551           if (randomize)
3552             seed = (gint32) g_random_int ();
3553 
3554           node =
3555             gegl_node_new_child (NULL,
3556                                  "operation",  "gegl:noise-hurl",
3557                                  "seed",       seed,
3558                                  "pct-random", rndm_pct,
3559                                  "repeat",     (gint) rndm_rcount,
3560                                  NULL);
3561 
3562           gimp_drawable_apply_operation (drawable, progress,
3563                                          C_("undo-type", "Random Hurl"),
3564                                          node);
3565           g_object_unref (node);
3566         }
3567       else
3568         success = FALSE;
3569     }
3570 
3571   return gimp_procedure_get_return_values (procedure, success,
3572                                            error ? *error : NULL);
3573 }
3574 
3575 static GimpValueArray *
plug_in_randomize_pick_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3576 plug_in_randomize_pick_invoker (GimpProcedure         *procedure,
3577                                 Gimp                  *gimp,
3578                                 GimpContext           *context,
3579                                 GimpProgress          *progress,
3580                                 const GimpValueArray  *args,
3581                                 GError               **error)
3582 {
3583   gboolean success = TRUE;
3584   GimpDrawable *drawable;
3585   gdouble rndm_pct;
3586   gdouble rndm_rcount;
3587   gboolean randomize;
3588   gint32 seed;
3589 
3590   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3591   rndm_pct = g_value_get_double (gimp_value_array_index (args, 3));
3592   rndm_rcount = g_value_get_double (gimp_value_array_index (args, 4));
3593   randomize = g_value_get_boolean (gimp_value_array_index (args, 5));
3594   seed = g_value_get_int (gimp_value_array_index (args, 6));
3595 
3596   if (success)
3597     {
3598       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3599                                      GIMP_PDB_ITEM_CONTENT, error) &&
3600           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3601         {
3602           GeglNode *node;
3603 
3604           if (randomize)
3605             seed = (gint32) g_random_int ();
3606 
3607           node =
3608             gegl_node_new_child (NULL,
3609                                  "operation",  "gegl:noise-pick",
3610                                  "seed",       seed,
3611                                  "pct-random", rndm_pct,
3612                                  "repeat",     (gint) rndm_rcount,
3613                                  NULL);
3614 
3615           gimp_drawable_apply_operation (drawable, progress,
3616                                          C_("undo-type", "Random Pick"),
3617                                          node);
3618           g_object_unref (node);
3619         }
3620       else
3621         success = FALSE;
3622     }
3623 
3624   return gimp_procedure_get_return_values (procedure, success,
3625                                            error ? *error : NULL);
3626 }
3627 
3628 static GimpValueArray *
plug_in_randomize_slur_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3629 plug_in_randomize_slur_invoker (GimpProcedure         *procedure,
3630                                 Gimp                  *gimp,
3631                                 GimpContext           *context,
3632                                 GimpProgress          *progress,
3633                                 const GimpValueArray  *args,
3634                                 GError               **error)
3635 {
3636   gboolean success = TRUE;
3637   GimpDrawable *drawable;
3638   gdouble rndm_pct;
3639   gdouble rndm_rcount;
3640   gboolean randomize;
3641   gint32 seed;
3642 
3643   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3644   rndm_pct = g_value_get_double (gimp_value_array_index (args, 3));
3645   rndm_rcount = g_value_get_double (gimp_value_array_index (args, 4));
3646   randomize = g_value_get_boolean (gimp_value_array_index (args, 5));
3647   seed = g_value_get_int (gimp_value_array_index (args, 6));
3648 
3649   if (success)
3650     {
3651       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3652                                      GIMP_PDB_ITEM_CONTENT, error) &&
3653           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3654         {
3655           GeglNode *node;
3656 
3657           if (randomize)
3658             seed = (gint32) g_random_int ();
3659 
3660           node =
3661             gegl_node_new_child (NULL,
3662                                  "operation",  "gegl:noise-slur",
3663                                  "seed",       seed,
3664                                  "pct-random", rndm_pct,
3665                                  "repeat",     (gint) rndm_rcount,
3666                                  NULL);
3667 
3668           gimp_drawable_apply_operation (drawable, progress,
3669                                          C_("undo-type", "Random Slur"),
3670                                          node);
3671           g_object_unref (node);
3672         }
3673       else
3674         success = FALSE;
3675     }
3676 
3677   return gimp_procedure_get_return_values (procedure, success,
3678                                            error ? *error : NULL);
3679 }
3680 
3681 static GimpValueArray *
plug_in_rgb_noise_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3682 plug_in_rgb_noise_invoker (GimpProcedure         *procedure,
3683                            Gimp                  *gimp,
3684                            GimpContext           *context,
3685                            GimpProgress          *progress,
3686                            const GimpValueArray  *args,
3687                            GError               **error)
3688 {
3689   gboolean success = TRUE;
3690   GimpDrawable *drawable;
3691   gboolean independent;
3692   gboolean correlated;
3693   gdouble noise_1;
3694   gdouble noise_2;
3695   gdouble noise_3;
3696   gdouble noise_4;
3697 
3698   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3699   independent = g_value_get_boolean (gimp_value_array_index (args, 3));
3700   correlated = g_value_get_boolean (gimp_value_array_index (args, 4));
3701   noise_1 = g_value_get_double (gimp_value_array_index (args, 5));
3702   noise_2 = g_value_get_double (gimp_value_array_index (args, 6));
3703   noise_3 = g_value_get_double (gimp_value_array_index (args, 7));
3704   noise_4 = g_value_get_double (gimp_value_array_index (args, 8));
3705 
3706   if (success)
3707     {
3708       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3709                                      GIMP_PDB_ITEM_CONTENT, error) &&
3710           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3711         {
3712           GeglNode *node;
3713           gdouble   r, g, b, a;
3714 
3715           if (gimp_drawable_is_gray (drawable))
3716             {
3717               r = noise_1;
3718               g = noise_1;
3719               b = noise_1;
3720               a = noise_2;
3721             }
3722           else
3723             {
3724               r = noise_1;
3725               g = noise_2;
3726               b = noise_3;
3727               a = noise_4;
3728             }
3729 
3730           node = gegl_node_new_child (NULL,
3731                                       "operation",   "gegl:noise-rgb",
3732                                       "correlated",  correlated,
3733                                       "independent", independent,
3734                                       "red",         r,
3735                                       "green",       g,
3736                                       "blue",        b,
3737                                       "alpha",       a,
3738                                       "seed",        g_random_int (),
3739                                       NULL);
3740 
3741           node = wrap_in_gamma_cast (node, drawable);
3742 
3743           gimp_drawable_apply_operation (drawable, progress,
3744                                          C_("undo-type", "RGB Noise"),
3745                                          node);
3746           g_object_unref (node);
3747         }
3748       else
3749         success = FALSE;
3750     }
3751 
3752   return gimp_procedure_get_return_values (procedure, success,
3753                                            error ? *error : NULL);
3754 }
3755 
3756 static GimpValueArray *
plug_in_ripple_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3757 plug_in_ripple_invoker (GimpProcedure         *procedure,
3758                         Gimp                  *gimp,
3759                         GimpContext           *context,
3760                         GimpProgress          *progress,
3761                         const GimpValueArray  *args,
3762                         GError               **error)
3763 {
3764   gboolean success = TRUE;
3765   GimpDrawable *drawable;
3766   gint32 period;
3767   gint32 amplitude;
3768   gint32 orientation;
3769   gint32 edges;
3770   gint32 waveform;
3771   gboolean antialias;
3772   gboolean tile;
3773 
3774   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3775   period = g_value_get_int (gimp_value_array_index (args, 3));
3776   amplitude = g_value_get_int (gimp_value_array_index (args, 4));
3777   orientation = g_value_get_int (gimp_value_array_index (args, 5));
3778   edges = g_value_get_int (gimp_value_array_index (args, 6));
3779   waveform = g_value_get_int (gimp_value_array_index (args, 7));
3780   antialias = g_value_get_boolean (gimp_value_array_index (args, 8));
3781   tile = g_value_get_boolean (gimp_value_array_index (args, 9));
3782 
3783   if (success)
3784     {
3785       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3786                                      GIMP_PDB_ITEM_CONTENT, error) &&
3787           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3788         {
3789           GeglNode *node;
3790           gdouble angle, phi;
3791 
3792           angle = orientation ? 0.0 : 90.0;
3793           phi = waveform ? 0.0 : 0.75;
3794           if (orientation == 0 && waveform == 1)
3795             phi = 0.5;
3796 
3797           node = gegl_node_new_child (NULL,
3798                                       "operation",    "gegl:ripple",
3799                                       "amplitude",    (gdouble) amplitude,
3800                                       "period",       (gdouble) period,
3801                                       "phi",          phi,
3802                                       "angle",        angle,
3803                                       "sampler_type", antialias ? GEGL_SAMPLER_CUBIC : GEGL_SAMPLER_NEAREST,
3804                                       "wave_type",    waveform ? 0 : 1,
3805                                       "abyss_policy", edges == 0 ? GEGL_ABYSS_CLAMP :
3806                                                       edges == 1 ? GEGL_ABYSS_LOOP :
3807                                                       GEGL_ABYSS_NONE,
3808                                       "tileable",     tile ? TRUE : FALSE,
3809                                       NULL);
3810 
3811           node = wrap_in_gamma_cast (node, drawable);
3812 
3813           gimp_drawable_apply_operation (drawable, progress,
3814                                          C_("undo-type", "Ripple"),
3815                                          node);
3816           g_object_unref (node);
3817         }
3818       else
3819         {
3820           success = FALSE;
3821         }
3822     }
3823 
3824   return gimp_procedure_get_return_values (procedure, success,
3825                                            error ? *error : NULL);
3826 }
3827 
3828 static GimpValueArray *
plug_in_rotate_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3829 plug_in_rotate_invoker (GimpProcedure         *procedure,
3830                         Gimp                  *gimp,
3831                         GimpContext           *context,
3832                         GimpProgress          *progress,
3833                         const GimpValueArray  *args,
3834                         GError               **error)
3835 {
3836   gboolean success = TRUE;
3837   GimpImage *image;
3838   GimpDrawable *drawable;
3839   gint32 angle;
3840   gboolean everything;
3841 
3842   image = gimp_value_get_image (gimp_value_array_index (args, 1), gimp);
3843   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3844   angle = g_value_get_int (gimp_value_array_index (args, 3));
3845   everything = g_value_get_boolean (gimp_value_array_index (args, 4));
3846 
3847   if (success)
3848     {
3849       GimpRotationType rotate_type = angle - 1;
3850 
3851       if (everything)
3852         {
3853           gimp_image_rotate (image, context, rotate_type, progress);
3854         }
3855       else if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3856                                           GIMP_PDB_ITEM_CONTENT, error))
3857         {
3858           GimpItem *item = GIMP_ITEM (drawable);
3859           gint      off_x, off_y;
3860           gdouble   center_x, center_y;
3861 
3862           gimp_item_get_offset (item, &off_x, &off_y);
3863 
3864           center_x = ((gdouble) off_x + (gdouble) gimp_item_get_width  (item) / 2.0);
3865           center_y = ((gdouble) off_y + (gdouble) gimp_item_get_height (item) / 2.0);
3866 
3867           gimp_item_rotate (item, context, rotate_type, center_x, center_y,
3868                             GIMP_IS_CHANNEL (drawable));
3869         }
3870       else
3871         success = FALSE;
3872     }
3873 
3874   return gimp_procedure_get_return_values (procedure, success,
3875                                            error ? *error : NULL);
3876 }
3877 
3878 static GimpValueArray *
plug_in_noisify_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3879 plug_in_noisify_invoker (GimpProcedure         *procedure,
3880                          Gimp                  *gimp,
3881                          GimpContext           *context,
3882                          GimpProgress          *progress,
3883                          const GimpValueArray  *args,
3884                          GError               **error)
3885 {
3886   gboolean success = TRUE;
3887   GimpDrawable *drawable;
3888   gboolean independent;
3889   gdouble noise_1;
3890   gdouble noise_2;
3891   gdouble noise_3;
3892   gdouble noise_4;
3893 
3894   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3895   independent = g_value_get_boolean (gimp_value_array_index (args, 3));
3896   noise_1 = g_value_get_double (gimp_value_array_index (args, 4));
3897   noise_2 = g_value_get_double (gimp_value_array_index (args, 5));
3898   noise_3 = g_value_get_double (gimp_value_array_index (args, 6));
3899   noise_4 = g_value_get_double (gimp_value_array_index (args, 7));
3900 
3901   if (success)
3902     {
3903       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3904                                      GIMP_PDB_ITEM_CONTENT, error) &&
3905           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3906         {
3907           GeglNode *node;
3908           gdouble   r, g, b, a;
3909 
3910           if (gimp_drawable_is_gray (drawable))
3911             {
3912               r = noise_1;
3913               g = noise_1;
3914               b = noise_1;
3915               a = noise_2;
3916             }
3917           else
3918             {
3919               r = noise_1;
3920               g = noise_2;
3921               b = noise_3;
3922               a = noise_4;
3923             }
3924 
3925           node = gegl_node_new_child (NULL,
3926                                       "operation",   "gegl:noise-rgb",
3927                                       "correlated",  FALSE,
3928                                       "independent", independent,
3929                                       "red",         r,
3930                                       "green",       g,
3931                                       "blue",        b,
3932                                       "alpha",       a,
3933                                       "seed",        g_random_int (),
3934                                       NULL);
3935 
3936           node = wrap_in_gamma_cast (node, drawable);
3937 
3938           gimp_drawable_apply_operation (drawable, progress,
3939                                          C_("undo-type", "Noisify"),
3940                                          node);
3941           g_object_unref (node);
3942         }
3943       else
3944         success = FALSE;
3945     }
3946 
3947   return gimp_procedure_get_return_values (procedure, success,
3948                                            error ? *error : NULL);
3949 }
3950 
3951 static GimpValueArray *
plug_in_sel_gauss_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3952 plug_in_sel_gauss_invoker (GimpProcedure         *procedure,
3953                            Gimp                  *gimp,
3954                            GimpContext           *context,
3955                            GimpProgress          *progress,
3956                            const GimpValueArray  *args,
3957                            GError               **error)
3958 {
3959   gboolean success = TRUE;
3960   GimpDrawable *drawable;
3961   gdouble radius;
3962   gint32 max_delta;
3963 
3964   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
3965   radius = g_value_get_double (gimp_value_array_index (args, 3));
3966   max_delta = g_value_get_int (gimp_value_array_index (args, 4));
3967 
3968   if (success)
3969     {
3970       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
3971                                      GIMP_PDB_ITEM_CONTENT, error) &&
3972           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
3973         {
3974           GeglNode *node;
3975 
3976           node = gegl_node_new_child (NULL,
3977                                       "operation",   "gegl:gaussian-blur-selective",
3978                                       "blur-radius", radius,
3979                                       "max-delta",   (gdouble) max_delta / 255.0,
3980                                       NULL);
3981 
3982           gimp_drawable_apply_operation (drawable, progress,
3983                                          C_("undo-type", "Selective Gaussian Blur"),
3984                                          node);
3985           g_object_unref (node);
3986         }
3987       else
3988         success = FALSE;
3989     }
3990 
3991   return gimp_procedure_get_return_values (procedure, success,
3992                                            error ? *error : NULL);
3993 }
3994 
3995 static GimpValueArray *
plug_in_semiflatten_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)3996 plug_in_semiflatten_invoker (GimpProcedure         *procedure,
3997                              Gimp                  *gimp,
3998                              GimpContext           *context,
3999                              GimpProgress          *progress,
4000                              const GimpValueArray  *args,
4001                              GError               **error)
4002 {
4003   gboolean success = TRUE;
4004   GimpDrawable *drawable;
4005 
4006   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4007 
4008   if (success)
4009     {
4010       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4011                                      GIMP_PDB_ITEM_CONTENT, error) &&
4012           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
4013           gimp_drawable_has_alpha (drawable))
4014         {
4015           GeglNode *node;
4016           GimpRGB   color;
4017 
4018           gimp_context_get_background (context, &color);
4019 
4020           node =
4021             gegl_node_new_child (NULL,
4022                                  "operation", "gimp:semi-flatten",
4023                                  "color",     &color,
4024                                  NULL);
4025 
4026           gimp_drawable_apply_operation (drawable, progress,
4027                                          C_("undo-type", "Semi-Flatten"),
4028                                          node);
4029           g_object_unref (node);
4030         }
4031       else
4032         success = FALSE;
4033     }
4034 
4035   return gimp_procedure_get_return_values (procedure, success,
4036                                            error ? *error : NULL);
4037 }
4038 
4039 static GimpValueArray *
plug_in_shift_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4040 plug_in_shift_invoker (GimpProcedure         *procedure,
4041                        Gimp                  *gimp,
4042                        GimpContext           *context,
4043                        GimpProgress          *progress,
4044                        const GimpValueArray  *args,
4045                        GError               **error)
4046 {
4047   gboolean success = TRUE;
4048   GimpDrawable *drawable;
4049   gint32 shift_amount;
4050   gint32 orientation;
4051 
4052   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4053   shift_amount = g_value_get_int (gimp_value_array_index (args, 3));
4054   orientation = g_value_get_int (gimp_value_array_index (args, 4));
4055 
4056   if (success)
4057     {
4058       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4059                                      GIMP_PDB_ITEM_CONTENT, error) &&
4060           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
4061         {
4062           GeglNode *node =
4063             gegl_node_new_child (NULL,
4064                                  "operation", "gegl:shift",
4065                                  "shift",     shift_amount / 2,
4066                                  "direction", orientation ? 0 : 1,
4067                                  NULL);
4068 
4069           gimp_drawable_apply_operation (drawable, progress,
4070                                          C_("undo-type", "Shift"),
4071                                          node);
4072           g_object_unref (node);
4073         }
4074       else
4075         success = FALSE;
4076     }
4077 
4078   return gimp_procedure_get_return_values (procedure, success,
4079                                            error ? *error : NULL);
4080 }
4081 
4082 static GimpValueArray *
plug_in_sinus_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4083 plug_in_sinus_invoker (GimpProcedure         *procedure,
4084                        Gimp                  *gimp,
4085                        GimpContext           *context,
4086                        GimpProgress          *progress,
4087                        const GimpValueArray  *args,
4088                        GError               **error)
4089 {
4090   gboolean success = TRUE;
4091   GimpDrawable *drawable;
4092   gdouble xscale;
4093   gdouble yscale;
4094   gdouble complex;
4095   gint32 seed;
4096   gboolean tiling;
4097   gboolean perturb;
4098   gint32 colors;
4099   GimpRGB col1;
4100   GimpRGB col2;
4101   gdouble alpha1;
4102   gdouble alpha2;
4103   gint32 blend;
4104   gdouble blend_power;
4105 
4106   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4107   xscale = g_value_get_double (gimp_value_array_index (args, 3));
4108   yscale = g_value_get_double (gimp_value_array_index (args, 4));
4109   complex = g_value_get_double (gimp_value_array_index (args, 5));
4110   seed = g_value_get_int (gimp_value_array_index (args, 6));
4111   tiling = g_value_get_boolean (gimp_value_array_index (args, 7));
4112   perturb = g_value_get_boolean (gimp_value_array_index (args, 8));
4113   colors = g_value_get_int (gimp_value_array_index (args, 9));
4114   gimp_value_get_rgb (gimp_value_array_index (args, 10), &col1);
4115   gimp_value_get_rgb (gimp_value_array_index (args, 11), &col2);
4116   alpha1 = g_value_get_double (gimp_value_array_index (args, 12));
4117   alpha2 = g_value_get_double (gimp_value_array_index (args, 13));
4118   blend = g_value_get_int (gimp_value_array_index (args, 14));
4119   blend_power = g_value_get_double (gimp_value_array_index (args, 15));
4120 
4121   if (success)
4122     {
4123       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4124                                      GIMP_PDB_ITEM_CONTENT, error) &&
4125           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
4126         {
4127           GeglNode  *node;
4128           GeglColor *gegl_color1;
4129           GeglColor *gegl_color2;
4130           gint      x, y, width, height;
4131 
4132           switch (colors)
4133             {
4134             case 0:
4135               gimp_rgb_set (&col1, 0.0, 0.0, 0.0);
4136               gimp_rgb_set (&col2, 1.0, 1.0, 1.0);
4137               break;
4138 
4139             case 1:
4140               gimp_context_get_foreground (context, &col1);
4141               gimp_context_get_background (context, &col2);
4142               break;
4143             }
4144 
4145           gimp_rgb_set_alpha (&col1, alpha1);
4146           gimp_rgb_set_alpha (&col2, alpha2);
4147 
4148           gegl_color1 = gimp_gegl_color_new (&col1);
4149           gegl_color2 = gimp_gegl_color_new (&col2);
4150 
4151           gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height);
4152 
4153           node = gegl_node_new_child (NULL,
4154                                       "operation",    "gegl:sinus",
4155                                       "x_scale",      xscale,
4156                                       "y-scale",      yscale,
4157                                       "complexity",   complex,
4158                                       "seed",         seed,
4159                                       "tiling",       tiling,
4160                                       "perturbation", perturb,
4161                                       "color1",       gegl_color1,
4162                                       "color2",       gegl_color2,
4163                                       "blend-mode",   blend,
4164                                       "blend-power",  blend_power,
4165                                       "width",        width,
4166                                       "height",       height,
4167                                       NULL);
4168 
4169           g_object_unref (gegl_color1);
4170           g_object_unref (gegl_color2);
4171 
4172           gimp_drawable_apply_operation (drawable, progress,
4173                                          C_("undo-type", "Sinus"),
4174                                          node);
4175           g_object_unref (node);
4176         }
4177       else
4178         success = FALSE;
4179     }
4180 
4181   return gimp_procedure_get_return_values (procedure, success,
4182                                            error ? *error : NULL);
4183 }
4184 
4185 static GimpValueArray *
plug_in_sobel_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4186 plug_in_sobel_invoker (GimpProcedure         *procedure,
4187                        Gimp                  *gimp,
4188                        GimpContext           *context,
4189                        GimpProgress          *progress,
4190                        const GimpValueArray  *args,
4191                        GError               **error)
4192 {
4193   gboolean success = TRUE;
4194   GimpDrawable *drawable;
4195   gboolean horizontal;
4196   gboolean vertical;
4197   gboolean keep_sign;
4198 
4199   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4200   horizontal = g_value_get_boolean (gimp_value_array_index (args, 3));
4201   vertical = g_value_get_boolean (gimp_value_array_index (args, 4));
4202   keep_sign = g_value_get_boolean (gimp_value_array_index (args, 5));
4203 
4204   if (success)
4205     {
4206       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4207                                      GIMP_PDB_ITEM_CONTENT, error) &&
4208           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
4209         {
4210           GeglNode *node =
4211             gegl_node_new_child (NULL,
4212                                  "operation",  "gegl:edge-sobel",
4213                                  "horizontal", horizontal,
4214                                  "vertical",   vertical,
4215                                  "keep-sign",  keep_sign,
4216                                  NULL);
4217 
4218           node = wrap_in_gamma_cast (node, drawable);
4219 
4220           gimp_drawable_apply_operation (drawable, progress,
4221                                          C_("undo-type", "Sobel"),
4222                                          node);
4223           g_object_unref (node);
4224         }
4225       else
4226         success = FALSE;
4227     }
4228 
4229   return gimp_procedure_get_return_values (procedure, success,
4230                                            error ? *error : NULL);
4231 }
4232 
4233 static GimpValueArray *
plug_in_solid_noise_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4234 plug_in_solid_noise_invoker (GimpProcedure         *procedure,
4235                              Gimp                  *gimp,
4236                              GimpContext           *context,
4237                              GimpProgress          *progress,
4238                              const GimpValueArray  *args,
4239                              GError               **error)
4240 {
4241   gboolean success = TRUE;
4242   GimpDrawable *drawable;
4243   gboolean tileable;
4244   gboolean turbulent;
4245   gint32 seed;
4246   gint32 detail;
4247   gdouble xsize;
4248   gdouble ysize;
4249 
4250   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4251   tileable = g_value_get_boolean (gimp_value_array_index (args, 3));
4252   turbulent = g_value_get_boolean (gimp_value_array_index (args, 4));
4253   seed = g_value_get_int (gimp_value_array_index (args, 5));
4254   detail = g_value_get_int (gimp_value_array_index (args, 6));
4255   xsize = g_value_get_double (gimp_value_array_index (args, 7));
4256   ysize = g_value_get_double (gimp_value_array_index (args, 8));
4257 
4258   if (success)
4259     {
4260       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4261                                      GIMP_PDB_ITEM_CONTENT, error) &&
4262           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
4263         {
4264           GeglNode *node;
4265           gint      x, y, width, height;
4266 
4267           gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height);
4268 
4269           node = gegl_node_new_child (NULL,
4270                                       "operation", "gegl:noise-solid",
4271                                       "x-size",    xsize,
4272                                       "y-size",    ysize,
4273                                       "detail",    detail,
4274                                       "tileable",  tileable,
4275                                       "turbulent", turbulent,
4276                                       "seed",      seed,
4277                                       "width",     width,
4278                                       "height",    height,
4279                                       NULL);
4280 
4281           gimp_drawable_apply_operation (drawable, progress,
4282                                          C_("undo-type", "Solid Noise"),
4283                                          node);
4284           g_object_unref (node);
4285         }
4286       else
4287         success = FALSE;
4288     }
4289 
4290   return gimp_procedure_get_return_values (procedure, success,
4291                                            error ? *error : NULL);
4292 }
4293 
4294 static GimpValueArray *
plug_in_spread_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4295 plug_in_spread_invoker (GimpProcedure         *procedure,
4296                         Gimp                  *gimp,
4297                         GimpContext           *context,
4298                         GimpProgress          *progress,
4299                         const GimpValueArray  *args,
4300                         GError               **error)
4301 {
4302   gboolean success = TRUE;
4303   GimpDrawable *drawable;
4304   gdouble spread_amount_x;
4305   gdouble spread_amount_y;
4306 
4307   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4308   spread_amount_x = g_value_get_double (gimp_value_array_index (args, 3));
4309   spread_amount_y = g_value_get_double (gimp_value_array_index (args, 4));
4310 
4311   if (success)
4312     {
4313       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4314                                      GIMP_PDB_ITEM_CONTENT, error) &&
4315           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
4316         {
4317           GeglNode *node =
4318             gegl_node_new_child (NULL,
4319                                  "operation", "gegl:noise-spread",
4320                                  "amount-x",  (gint) spread_amount_x,
4321                                  "amount-y",  (gint) spread_amount_y,
4322                                  "seed",      g_random_int (),
4323                                  NULL);
4324 
4325           gimp_drawable_apply_operation (drawable, progress,
4326                                          C_("undo-type", "Spread"),
4327                                          node);
4328           g_object_unref (node);
4329         }
4330       else
4331         success = FALSE;
4332     }
4333 
4334   return gimp_procedure_get_return_values (procedure, success,
4335                                            error ? *error : NULL);
4336 }
4337 
4338 static GimpValueArray *
plug_in_threshold_alpha_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4339 plug_in_threshold_alpha_invoker (GimpProcedure         *procedure,
4340                                  Gimp                  *gimp,
4341                                  GimpContext           *context,
4342                                  GimpProgress          *progress,
4343                                  const GimpValueArray  *args,
4344                                  GError               **error)
4345 {
4346   gboolean success = TRUE;
4347   GimpDrawable *drawable;
4348   gint32 threshold;
4349 
4350   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4351   threshold = g_value_get_int (gimp_value_array_index (args, 3));
4352 
4353   if (success)
4354     {
4355       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4356                                      GIMP_PDB_ITEM_CONTENT, error) &&
4357           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
4358           gimp_drawable_has_alpha (drawable))
4359         {
4360           GeglNode *node =
4361             gegl_node_new_child (NULL,
4362                                  "operation", "gimp:threshold-alpha",
4363                                  "value",     threshold / 255.0,
4364                                  NULL);
4365 
4366           gimp_drawable_apply_operation (drawable, progress,
4367                                          C_("undo-type", "Threshold Alpha"),
4368                                          node);
4369           g_object_unref (node);
4370         }
4371       else
4372         success = FALSE;
4373     }
4374 
4375   return gimp_procedure_get_return_values (procedure, success,
4376                                            error ? *error : NULL);
4377 }
4378 
4379 static GimpValueArray *
plug_in_unsharp_mask_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4380 plug_in_unsharp_mask_invoker (GimpProcedure         *procedure,
4381                               Gimp                  *gimp,
4382                               GimpContext           *context,
4383                               GimpProgress          *progress,
4384                               const GimpValueArray  *args,
4385                               GError               **error)
4386 {
4387   gboolean success = TRUE;
4388   GimpDrawable *drawable;
4389   gdouble radius;
4390   gdouble amount;
4391   gint32 threshold;
4392 
4393   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4394   radius = g_value_get_double (gimp_value_array_index (args, 3));
4395   amount = g_value_get_double (gimp_value_array_index (args, 4));
4396   threshold = g_value_get_int (gimp_value_array_index (args, 5));
4397 
4398   if (success)
4399     {
4400       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4401                                      GIMP_PDB_ITEM_CONTENT, error) &&
4402           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
4403         {
4404           GeglNode *node =
4405             gegl_node_new_child (NULL,
4406                                  "operation", "gegl:unsharp-mask",
4407                                  "std-dev",   radius,
4408                                  "scale",     amount,
4409                                  "threshold", threshold / 255.0,
4410                                  NULL);
4411 
4412           gimp_drawable_apply_operation (drawable, progress,
4413                                          C_("undo-type", "Sharpen (Unsharp Mask)"),
4414                                          node);
4415           g_object_unref (node);
4416         }
4417       else
4418         success = FALSE;
4419     }
4420 
4421   return gimp_procedure_get_return_values (procedure, success,
4422                                            error ? *error : NULL);
4423 }
4424 
4425 static GimpValueArray *
plug_in_video_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4426 plug_in_video_invoker (GimpProcedure         *procedure,
4427                        Gimp                  *gimp,
4428                        GimpContext           *context,
4429                        GimpProgress          *progress,
4430                        const GimpValueArray  *args,
4431                        GError               **error)
4432 {
4433   gboolean success = TRUE;
4434   GimpDrawable *drawable;
4435   gint32 pattern_number;
4436   gboolean additive;
4437   gboolean rotated;
4438 
4439   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4440   pattern_number = g_value_get_int (gimp_value_array_index (args, 3));
4441   additive = g_value_get_boolean (gimp_value_array_index (args, 4));
4442   rotated = g_value_get_boolean (gimp_value_array_index (args, 5));
4443 
4444   if (success)
4445     {
4446       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4447                                      GIMP_PDB_ITEM_CONTENT, error) &&
4448           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
4449         {
4450           GeglNode *node =
4451             gegl_node_new_child (NULL,
4452                                  "operation", "gegl:video-degradation",
4453                                  "pattern",   pattern_number,
4454                                  "additive",  additive,
4455                                  "rotated",   rotated,
4456                                  NULL);
4457 
4458           gimp_drawable_apply_operation (drawable, progress,
4459                                          C_("undo-type", "Video"),
4460                                          node);
4461           g_object_unref (node);
4462         }
4463       else
4464         success = FALSE;
4465     }
4466 
4467   return gimp_procedure_get_return_values (procedure, success,
4468                                            error ? *error : NULL);
4469 }
4470 
4471 static GimpValueArray *
plug_in_vinvert_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4472 plug_in_vinvert_invoker (GimpProcedure         *procedure,
4473                          Gimp                  *gimp,
4474                          GimpContext           *context,
4475                          GimpProgress          *progress,
4476                          const GimpValueArray  *args,
4477                          GError               **error)
4478 {
4479   gboolean success = TRUE;
4480   GimpDrawable *drawable;
4481 
4482   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4483 
4484   if (success)
4485     {
4486       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4487                                      GIMP_PDB_ITEM_CONTENT, error) &&
4488           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
4489         {
4490           GeglNode *node =
4491             gegl_node_new_child (NULL,
4492                                  "operation", "gegl:value-invert",
4493                                  NULL);
4494 
4495           gimp_drawable_apply_operation (drawable, progress,
4496                                          C_("undo-type", "Value Invert"),
4497                                          node);
4498           g_object_unref (node);
4499         }
4500       else
4501         success = FALSE;
4502     }
4503 
4504   return gimp_procedure_get_return_values (procedure, success,
4505                                            error ? *error : NULL);
4506 }
4507 
4508 static GimpValueArray *
plug_in_vpropagate_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4509 plug_in_vpropagate_invoker (GimpProcedure         *procedure,
4510                             Gimp                  *gimp,
4511                             GimpContext           *context,
4512                             GimpProgress          *progress,
4513                             const GimpValueArray  *args,
4514                             GError               **error)
4515 {
4516   gboolean success = TRUE;
4517   GimpDrawable *drawable;
4518   gint32 propagate_mode;
4519   gint32 propagating_channel;
4520   gdouble propagating_rate;
4521   gint32 direction_mask;
4522   gint32 lower_limit;
4523   gint32 upper_limit;
4524 
4525   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4526   propagate_mode = g_value_get_int (gimp_value_array_index (args, 3));
4527   propagating_channel = g_value_get_int (gimp_value_array_index (args, 4));
4528   propagating_rate = g_value_get_double (gimp_value_array_index (args, 5));
4529   direction_mask = g_value_get_int (gimp_value_array_index (args, 6));
4530   lower_limit = g_value_get_int (gimp_value_array_index (args, 7));
4531   upper_limit = g_value_get_int (gimp_value_array_index (args, 8));
4532 
4533   if (success)
4534     {
4535       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4536                                      GIMP_PDB_ITEM_CONTENT, error) &&
4537           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
4538         {
4539           GeglNode  *node;
4540           GimpRGB    color;
4541           GeglColor *gegl_color = NULL;
4542           gint       gegl_mode  = 0;
4543           gboolean   to_left    = (direction_mask & (0x1 << 0)) != 0;
4544           gboolean   to_top     = (direction_mask & (0x1 << 1)) != 0;
4545           gboolean   to_right   = (direction_mask & (0x1 << 2)) != 0;
4546           gboolean   to_bottom  = (direction_mask & (0x1 << 3)) != 0;
4547           gboolean   value      = (propagating_channel & (0x1 << 0)) != 0;
4548           gboolean   alpha      = (propagating_channel & (0x1 << 1)) != 0;
4549 
4550           switch (propagate_mode)
4551             {
4552             case 0:
4553             case 1:
4554             case 2:
4555               gegl_mode = propagate_mode;
4556               break;
4557 
4558             case 3:
4559             case 4:
4560             case 5:
4561               if (propagate_mode == 3 || propagate_mode == 4)
4562                 {
4563                   gegl_mode = propagate_mode;
4564 
4565                   gimp_context_get_foreground (context, &color);
4566                 }
4567               else
4568                 {
4569                   gegl_mode = 4;
4570 
4571                   gimp_context_get_background (context, &color);
4572                 }
4573 
4574               gegl_color = gimp_gegl_color_new (&color);
4575               break;
4576 
4577             case 6:
4578             case 7:
4579               gegl_mode = propagate_mode - 1;
4580               break;
4581             }
4582 
4583           node =
4584             gegl_node_new_child (NULL,
4585                                  "operation",        "gegl:value-propagate",
4586                                  "mode",             gegl_mode,
4587                                  "lower-threshold",  (gdouble) lower_limit / 255.0,
4588                                  "upper-threshold",  (gdouble) upper_limit / 255.0,
4589                                  "rate",             propagating_rate,
4590                                  "color",            gegl_color,
4591                                  "top",              to_top,
4592                                  "left",             to_left,
4593                                  "right",            to_right,
4594                                  "bottom",           to_bottom,
4595                                  "value",            value,
4596                                  "alpha",            alpha,
4597                                  NULL);
4598 
4599           if (gegl_color)
4600             g_object_unref (gegl_color);
4601 
4602           gimp_drawable_apply_operation (drawable, progress,
4603                                          C_("undo-type", "Value Propagate"),
4604                                          node);
4605           g_object_unref (node);
4606         }
4607       else
4608         success = FALSE;
4609     }
4610 
4611   return gimp_procedure_get_return_values (procedure, success,
4612                                            error ? *error : NULL);
4613 }
4614 
4615 static GimpValueArray *
plug_in_dilate_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4616 plug_in_dilate_invoker (GimpProcedure         *procedure,
4617                         Gimp                  *gimp,
4618                         GimpContext           *context,
4619                         GimpProgress          *progress,
4620                         const GimpValueArray  *args,
4621                         GError               **error)
4622 {
4623   gboolean success = TRUE;
4624   GimpDrawable *drawable;
4625 
4626   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4627 
4628   if (success)
4629     {
4630       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4631                                      GIMP_PDB_ITEM_CONTENT, error) &&
4632           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
4633         {
4634           GeglNode *node =
4635             gegl_node_new_child (NULL,
4636                                  "operation",       "gegl:value-propagate",
4637                                  "mode",            0, /* GEGL_VALUE_PROPAGATE_MODE_WHITE */
4638                                  "lower-threshold", 0.0,
4639                                  "upper-threshold", 1.0,
4640                                  "rate",            1.0,
4641                                  "top",             TRUE,
4642                                  "left",            TRUE,
4643                                  "right",           TRUE,
4644                                  "bottom",          TRUE,
4645                                  "value",           TRUE,
4646                                  "alpha",           FALSE,
4647                                  NULL);
4648 
4649           gimp_drawable_apply_operation (drawable, progress,
4650                                          C_("undo-type", "Dilate"),
4651                                          node);
4652           g_object_unref (node);
4653         }
4654       else
4655         success = FALSE;
4656     }
4657 
4658   return gimp_procedure_get_return_values (procedure, success,
4659                                            error ? *error : NULL);
4660 }
4661 
4662 static GimpValueArray *
plug_in_erode_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4663 plug_in_erode_invoker (GimpProcedure         *procedure,
4664                        Gimp                  *gimp,
4665                        GimpContext           *context,
4666                        GimpProgress          *progress,
4667                        const GimpValueArray  *args,
4668                        GError               **error)
4669 {
4670   gboolean success = TRUE;
4671   GimpDrawable *drawable;
4672 
4673   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4674 
4675   if (success)
4676     {
4677       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4678                                      GIMP_PDB_ITEM_CONTENT, error) &&
4679           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
4680         {
4681           GeglNode *node =
4682             gegl_node_new_child (NULL,
4683                                  "operation",       "gegl:value-propagate",
4684                                  "mode",            1, /* GEGL_VALUE_PROPAGATE_MODE_BLACK */
4685                                  "lower-threshold", 0.0,
4686                                  "upper-threshold", 1.0,
4687                                  "rate",            1.0,
4688                                  "top",             TRUE,
4689                                  "left",            TRUE,
4690                                  "right",           TRUE,
4691                                  "bottom",          TRUE,
4692                                  "value",           TRUE,
4693                                  "alpha",           FALSE,
4694                                  NULL);
4695 
4696           gimp_drawable_apply_operation (drawable, progress,
4697                                          C_("undo-type", "Erode"),
4698                                          node);
4699           g_object_unref (node);
4700         }
4701       else
4702         success = FALSE;
4703     }
4704 
4705   return gimp_procedure_get_return_values (procedure, success,
4706                                            error ? *error : NULL);
4707 }
4708 
4709 static GimpValueArray *
plug_in_waves_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4710 plug_in_waves_invoker (GimpProcedure         *procedure,
4711                        Gimp                  *gimp,
4712                        GimpContext           *context,
4713                        GimpProgress          *progress,
4714                        const GimpValueArray  *args,
4715                        GError               **error)
4716 {
4717   gboolean success = TRUE;
4718   GimpDrawable *drawable;
4719   gdouble amplitude;
4720   gdouble phase;
4721   gdouble wavelength;
4722   gboolean type;
4723 
4724   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4725   amplitude = g_value_get_double (gimp_value_array_index (args, 3));
4726   phase = g_value_get_double (gimp_value_array_index (args, 4));
4727   wavelength = g_value_get_double (gimp_value_array_index (args, 5));
4728   type = g_value_get_boolean (gimp_value_array_index (args, 6));
4729 
4730   if (success)
4731     {
4732       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4733                                      GIMP_PDB_ITEM_CONTENT, error) &&
4734           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
4735         {
4736           GeglNode *node;
4737           gdouble   width  = gimp_item_get_width  (GIMP_ITEM (drawable));
4738           gdouble   height = gimp_item_get_height (GIMP_ITEM (drawable));
4739           gdouble   aspect;
4740 
4741           while (phase < 0)
4742             phase += 360.0;
4743 
4744           phase = fmod (phase, 360.0);
4745 
4746           aspect = CLAMP (width / height, 0.1, 10.0);
4747 
4748           node = gegl_node_new_child (NULL,
4749                                      "operation", "gegl:waves",
4750                                      "x",         0.5,
4751                                      "y",         0.5,
4752                                      "amplitude", amplitude,
4753                                      "phi",       (phase - 180.0) / 180.0,
4754                                      "period",    wavelength * 2.0,
4755                                      "aspect",    aspect,
4756                                      "clamp",     ! type,
4757                                      NULL);
4758 
4759           gimp_drawable_apply_operation (drawable, progress,
4760                                          C_("undo-type", "Waves"),
4761                                          node);
4762           g_object_unref (node);
4763         }
4764       else
4765         success = FALSE;
4766     }
4767 
4768   return gimp_procedure_get_return_values (procedure, success,
4769                                            error ? *error : NULL);
4770 }
4771 
4772 static GimpValueArray *
plug_in_whirl_pinch_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4773 plug_in_whirl_pinch_invoker (GimpProcedure         *procedure,
4774                              Gimp                  *gimp,
4775                              GimpContext           *context,
4776                              GimpProgress          *progress,
4777                              const GimpValueArray  *args,
4778                              GError               **error)
4779 {
4780   gboolean success = TRUE;
4781   GimpDrawable *drawable;
4782   gdouble whirl;
4783   gdouble pinch;
4784   gdouble radius;
4785 
4786   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4787   whirl = g_value_get_double (gimp_value_array_index (args, 3));
4788   pinch = g_value_get_double (gimp_value_array_index (args, 4));
4789   radius = g_value_get_double (gimp_value_array_index (args, 5));
4790 
4791   if (success)
4792     {
4793       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4794                                      GIMP_PDB_ITEM_CONTENT, error) &&
4795           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
4796         {
4797           GeglNode *node =
4798             gegl_node_new_child (NULL,
4799                                  "operation", "gegl:whirl-pinch",
4800                                  "whirl",     whirl,
4801                                  "pinch",     pinch,
4802                                  "radius",    radius,
4803                                  NULL);
4804 
4805           node = wrap_in_selection_bounds (node, drawable);
4806 
4807           gimp_drawable_apply_operation (drawable, progress,
4808                                          C_("undo-type", "Whirl and Pinch"),
4809                                          node);
4810           g_object_unref (node);
4811         }
4812       else
4813         success = FALSE;
4814     }
4815 
4816   return gimp_procedure_get_return_values (procedure, success,
4817                                            error ? *error : NULL);
4818 }
4819 
4820 static GimpValueArray *
plug_in_wind_invoker(GimpProcedure * procedure,Gimp * gimp,GimpContext * context,GimpProgress * progress,const GimpValueArray * args,GError ** error)4821 plug_in_wind_invoker (GimpProcedure         *procedure,
4822                       Gimp                  *gimp,
4823                       GimpContext           *context,
4824                       GimpProgress          *progress,
4825                       const GimpValueArray  *args,
4826                       GError               **error)
4827 {
4828   gboolean success = TRUE;
4829   GimpDrawable *drawable;
4830   gint32 threshold;
4831   gint32 direction;
4832   gint32 strength;
4833   gint32 algorithm;
4834   gint32 edge;
4835 
4836   drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
4837   threshold = g_value_get_int (gimp_value_array_index (args, 3));
4838   direction = g_value_get_int (gimp_value_array_index (args, 4));
4839   strength = g_value_get_int (gimp_value_array_index (args, 5));
4840   algorithm = g_value_get_int (gimp_value_array_index (args, 6));
4841   edge = g_value_get_int (gimp_value_array_index (args, 7));
4842 
4843   if (success)
4844     {
4845       if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
4846                                      GIMP_PDB_ITEM_CONTENT, error) &&
4847           gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
4848         {
4849           GeglNode *node =
4850             gegl_node_new_child (NULL,
4851                                  "operation", "gegl:wind",
4852                                  "threshold", threshold,
4853                                  "direction", direction,
4854                                  "strength",  strength,
4855                                  "style",     algorithm,
4856                                  "edge",      edge,
4857                                  NULL);
4858 
4859           gimp_drawable_apply_operation (drawable, progress,
4860                                          C_("undo-type", "Wind"),
4861                                          node);
4862           g_object_unref (node);
4863         }
4864       else
4865         success = FALSE;
4866     }
4867 
4868   return gimp_procedure_get_return_values (procedure, success,
4869                                            error ? *error : NULL);
4870 }
4871 
4872 void
register_plug_in_compat_procs(GimpPDB * pdb)4873 register_plug_in_compat_procs (GimpPDB *pdb)
4874 {
4875   GimpProcedure *procedure;
4876 
4877   /*
4878    * gimp-plug-in-alienmap2
4879    */
4880   procedure = gimp_procedure_new (plug_in_alienmap2_invoker);
4881   gimp_object_set_static_name (GIMP_OBJECT (procedure),
4882                                "plug-in-alienmap2");
4883   gimp_procedure_set_static_strings (procedure,
4884                                      "plug-in-alienmap2",
4885                                      "Alter colors in various psychedelic ways",
4886                                      "No help yet. Just try it and you'll see!",
4887                                      "Compatibility procedure. Please see 'gegl:alien-map' for credits.",
4888                                      "Compatibility procedure. Please see 'gegl:alien-map' for credits.",
4889                                      "2013",
4890                                      NULL);
4891   gimp_procedure_add_argument (procedure,
4892                                g_param_spec_enum ("run-mode",
4893                                                   "run mode",
4894                                                   "The run mode",
4895                                                   GIMP_TYPE_RUN_MODE,
4896                                                   GIMP_RUN_INTERACTIVE,
4897                                                   GIMP_PARAM_READWRITE));
4898   gimp_procedure_add_argument (procedure,
4899                                gimp_param_spec_image_id ("image",
4900                                                          "image",
4901                                                          "Input image (unused)",
4902                                                          pdb->gimp, FALSE,
4903                                                          GIMP_PARAM_READWRITE));
4904   gimp_procedure_add_argument (procedure,
4905                                gimp_param_spec_drawable_id ("drawable",
4906                                                             "drawable",
4907                                                             "Input drawable",
4908                                                             pdb->gimp, FALSE,
4909                                                             GIMP_PARAM_READWRITE));
4910   gimp_procedure_add_argument (procedure,
4911                                g_param_spec_double ("redfrequency",
4912                                                     "redfrequency",
4913                                                     "Red/hue component frequency factor",
4914                                                     0, 20, 0,
4915                                                     GIMP_PARAM_READWRITE));
4916   gimp_procedure_add_argument (procedure,
4917                                g_param_spec_double ("redangle",
4918                                                     "redangle",
4919                                                     "Red/hue component angle factor (0-360)",
4920                                                     0, 360, 0,
4921                                                     GIMP_PARAM_READWRITE));
4922   gimp_procedure_add_argument (procedure,
4923                                g_param_spec_double ("greenfrequency",
4924                                                     "greenfrequency",
4925                                                     "Green/saturation component frequency factor",
4926                                                     0, 20, 0,
4927                                                     GIMP_PARAM_READWRITE));
4928   gimp_procedure_add_argument (procedure,
4929                                g_param_spec_double ("greenangle",
4930                                                     "greenangle",
4931                                                     "Green/saturation component angle factor (0-360)",
4932                                                     0, 360, 0,
4933                                                     GIMP_PARAM_READWRITE));
4934   gimp_procedure_add_argument (procedure,
4935                                g_param_spec_double ("bluefrequency",
4936                                                     "bluefrequency",
4937                                                     "Blue/luminance component frequency factor",
4938                                                     0, 20, 0,
4939                                                     GIMP_PARAM_READWRITE));
4940   gimp_procedure_add_argument (procedure,
4941                                g_param_spec_double ("blueangle",
4942                                                     "blueangle",
4943                                                     "Blue/luminance component angle factor (0-360)",
4944                                                     0, 360, 0,
4945                                                     GIMP_PARAM_READWRITE));
4946   gimp_procedure_add_argument (procedure,
4947                                gimp_param_spec_int8 ("colormodel",
4948                                                      "colormodel",
4949                                                      "Color model { RGB-MODEL (0), HSL-MODEL (1) }",
4950                                                      0, 1, 0,
4951                                                      GIMP_PARAM_READWRITE));
4952   gimp_procedure_add_argument (procedure,
4953                                gimp_param_spec_int8 ("redmode",
4954                                                      "redmode",
4955                                                      "Red/hue application mode { TRUE, FALSE }",
4956                                                      0, 1, 0,
4957                                                      GIMP_PARAM_READWRITE));
4958   gimp_procedure_add_argument (procedure,
4959                                gimp_param_spec_int8 ("greenmode",
4960                                                      "greenmode",
4961                                                      "Green/saturation application mode { TRUE, FALSE }",
4962                                                      0, 1, 0,
4963                                                      GIMP_PARAM_READWRITE));
4964   gimp_procedure_add_argument (procedure,
4965                                gimp_param_spec_int8 ("bluemode",
4966                                                      "bluemode",
4967                                                      "Blue/luminance application mode { TRUE, FALSE }",
4968                                                      0, 1, 0,
4969                                                      GIMP_PARAM_READWRITE));
4970   gimp_pdb_register_procedure (pdb, procedure);
4971   g_object_unref (procedure);
4972 
4973   /*
4974    * gimp-plug-in-antialias
4975    */
4976   procedure = gimp_procedure_new (plug_in_antialias_invoker);
4977   gimp_object_set_static_name (GIMP_OBJECT (procedure),
4978                                "plug-in-antialias");
4979   gimp_procedure_set_static_strings (procedure,
4980                                      "plug-in-antialias",
4981                                      "Antialias using the Scale3X edge-extrapolation algorithm",
4982                                      "No more help.",
4983                                      "Compatibility procedure. Please see 'gegl:antialias' for credits.",
4984                                      "Compatibility procedure. Please see 'gegl:antialias' for credits.",
4985                                      "2013",
4986                                      NULL);
4987   gimp_procedure_add_argument (procedure,
4988                                g_param_spec_enum ("run-mode",
4989                                                   "run mode",
4990                                                   "The run mode",
4991                                                   GIMP_TYPE_RUN_MODE,
4992                                                   GIMP_RUN_INTERACTIVE,
4993                                                   GIMP_PARAM_READWRITE));
4994   gimp_procedure_add_argument (procedure,
4995                                gimp_param_spec_image_id ("image",
4996                                                          "image",
4997                                                          "Input image (unused)",
4998                                                          pdb->gimp, FALSE,
4999                                                          GIMP_PARAM_READWRITE));
5000   gimp_procedure_add_argument (procedure,
5001                                gimp_param_spec_drawable_id ("drawable",
5002                                                             "drawable",
5003                                                             "Input drawable",
5004                                                             pdb->gimp, FALSE,
5005                                                             GIMP_PARAM_READWRITE));
5006   gimp_pdb_register_procedure (pdb, procedure);
5007   g_object_unref (procedure);
5008 
5009   /*
5010    * gimp-plug-in-apply-canvas
5011    */
5012   procedure = gimp_procedure_new (plug_in_apply_canvas_invoker);
5013   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5014                                "plug-in-apply-canvas");
5015   gimp_procedure_set_static_strings (procedure,
5016                                      "plug-in-apply-canvas",
5017                                      "Add a canvas texture to the image",
5018                                      "This function applies a canvas texture map to the drawable.",
5019                                      "Compatibility procedure. Please see 'gegl:texturize-canvas' for credits.",
5020                                      "Compatibility procedure. Please see 'gegl:texturize-canvas' for credits.",
5021                                      "2014",
5022                                      NULL);
5023   gimp_procedure_add_argument (procedure,
5024                                g_param_spec_enum ("run-mode",
5025                                                   "run mode",
5026                                                   "The run mode",
5027                                                   GIMP_TYPE_RUN_MODE,
5028                                                   GIMP_RUN_INTERACTIVE,
5029                                                   GIMP_PARAM_READWRITE));
5030   gimp_procedure_add_argument (procedure,
5031                                gimp_param_spec_image_id ("image",
5032                                                          "image",
5033                                                          "Input image (unused)",
5034                                                          pdb->gimp, FALSE,
5035                                                          GIMP_PARAM_READWRITE));
5036   gimp_procedure_add_argument (procedure,
5037                                gimp_param_spec_drawable_id ("drawable",
5038                                                             "drawable",
5039                                                             "Input drawable",
5040                                                             pdb->gimp, FALSE,
5041                                                             GIMP_PARAM_READWRITE));
5042   gimp_procedure_add_argument (procedure,
5043                                gimp_param_spec_int32 ("direction",
5044                                                       "direction",
5045                                                       "Light direction (0 - 3)",
5046                                                       0, 3, 0,
5047                                                       GIMP_PARAM_READWRITE));
5048   gimp_procedure_add_argument (procedure,
5049                                gimp_param_spec_int32 ("depth",
5050                                                       "depth",
5051                                                       "Texture depth (1 - 50)",
5052                                                       1, 50, 1,
5053                                                       GIMP_PARAM_READWRITE));
5054   gimp_pdb_register_procedure (pdb, procedure);
5055   g_object_unref (procedure);
5056 
5057   /*
5058    * gimp-plug-in-applylens
5059    */
5060   procedure = gimp_procedure_new (plug_in_applylens_invoker);
5061   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5062                                "plug-in-applylens");
5063   gimp_procedure_set_static_strings (procedure,
5064                                      "plug-in-applylens",
5065                                      "Simulate an elliptical lens over the image",
5066                                      "This plug-in uses Snell's law to draw an ellipsoid lens over the image.",
5067                                      "Compatibility procedure. Please see 'gegl:apply-lens' for credits.",
5068                                      "Compatibility procedure. Please see 'gegl:apply-lens' for credits.",
5069                                      "2014",
5070                                      NULL);
5071   gimp_procedure_add_argument (procedure,
5072                                g_param_spec_enum ("run-mode",
5073                                                   "run mode",
5074                                                   "The run mode",
5075                                                   GIMP_TYPE_RUN_MODE,
5076                                                   GIMP_RUN_INTERACTIVE,
5077                                                   GIMP_PARAM_READWRITE));
5078   gimp_procedure_add_argument (procedure,
5079                                gimp_param_spec_image_id ("image",
5080                                                          "image",
5081                                                          "Input image (unused)",
5082                                                          pdb->gimp, FALSE,
5083                                                          GIMP_PARAM_READWRITE));
5084   gimp_procedure_add_argument (procedure,
5085                                gimp_param_spec_drawable_id ("drawable",
5086                                                             "drawable",
5087                                                             "Input drawable",
5088                                                             pdb->gimp, FALSE,
5089                                                             GIMP_PARAM_READWRITE));
5090   gimp_procedure_add_argument (procedure,
5091                                g_param_spec_double ("refraction",
5092                                                     "refraction",
5093                                                     "Lens refraction index",
5094                                                     1.0, 100.0, 1.0,
5095                                                     GIMP_PARAM_READWRITE));
5096   gimp_procedure_add_argument (procedure,
5097                                g_param_spec_boolean ("keep-surroundings",
5098                                                      "keep surroundings",
5099                                                      "Keep lens surroundings",
5100                                                      FALSE,
5101                                                      GIMP_PARAM_READWRITE));
5102   gimp_procedure_add_argument (procedure,
5103                                g_param_spec_boolean ("set-background",
5104                                                      "set background",
5105                                                      "Set lens surroundings to BG value",
5106                                                      FALSE,
5107                                                      GIMP_PARAM_READWRITE));
5108   gimp_procedure_add_argument (procedure,
5109                                g_param_spec_boolean ("set-transparent",
5110                                                      "set transparent",
5111                                                      "Set lens surroundings transparent",
5112                                                      FALSE,
5113                                                      GIMP_PARAM_READWRITE));
5114   gimp_pdb_register_procedure (pdb, procedure);
5115   g_object_unref (procedure);
5116 
5117   /*
5118    * gimp-plug-in-autocrop
5119    */
5120   procedure = gimp_procedure_new (plug_in_autocrop_invoker);
5121   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5122                                "plug-in-autocrop");
5123   gimp_procedure_set_static_strings (procedure,
5124                                      "plug-in-autocrop",
5125                                      "Remove empty borders from the image",
5126                                      "Remove empty borders from the image.",
5127                                      "Spencer Kimball & Peter Mattis",
5128                                      "Spencer Kimball & Peter Mattis",
5129                                      "1997",
5130                                      NULL);
5131   gimp_procedure_add_argument (procedure,
5132                                g_param_spec_enum ("run-mode",
5133                                                   "run mode",
5134                                                   "The run mode",
5135                                                   GIMP_TYPE_RUN_MODE,
5136                                                   GIMP_RUN_INTERACTIVE,
5137                                                   GIMP_PARAM_READWRITE));
5138   gimp_procedure_add_argument (procedure,
5139                                gimp_param_spec_image_id ("image",
5140                                                          "image",
5141                                                          "Input image)",
5142                                                          pdb->gimp, FALSE,
5143                                                          GIMP_PARAM_READWRITE));
5144   gimp_procedure_add_argument (procedure,
5145                                gimp_param_spec_drawable_id ("drawable",
5146                                                             "drawable",
5147                                                             "Input drawable",
5148                                                             pdb->gimp, FALSE,
5149                                                             GIMP_PARAM_READWRITE));
5150   gimp_pdb_register_procedure (pdb, procedure);
5151   g_object_unref (procedure);
5152 
5153   /*
5154    * gimp-plug-in-autocrop-layer
5155    */
5156   procedure = gimp_procedure_new (plug_in_autocrop_layer_invoker);
5157   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5158                                "plug-in-autocrop-layer");
5159   gimp_procedure_set_static_strings (procedure,
5160                                      "plug-in-autocrop-layer",
5161                                      "Crop the active layer based on empty borders of the input drawable",
5162                                      "Crop the active layer of the input \"image\" based on empty borders of the input \"drawable\". \n\nThe input drawable serves as a base for detecting cropping extents (transparency or background color), and is not necessarily the cropped layer (the current active layer).",
5163                                      "Spencer Kimball & Peter Mattis",
5164                                      "Spencer Kimball & Peter Mattis",
5165                                      "1997",
5166                                      NULL);
5167   gimp_procedure_add_argument (procedure,
5168                                g_param_spec_enum ("run-mode",
5169                                                   "run mode",
5170                                                   "The run mode",
5171                                                   GIMP_TYPE_RUN_MODE,
5172                                                   GIMP_RUN_INTERACTIVE,
5173                                                   GIMP_PARAM_READWRITE));
5174   gimp_procedure_add_argument (procedure,
5175                                gimp_param_spec_image_id ("image",
5176                                                          "image",
5177                                                          "Input image)",
5178                                                          pdb->gimp, FALSE,
5179                                                          GIMP_PARAM_READWRITE));
5180   gimp_procedure_add_argument (procedure,
5181                                gimp_param_spec_drawable_id ("drawable",
5182                                                             "drawable",
5183                                                             "Input drawable",
5184                                                             pdb->gimp, FALSE,
5185                                                             GIMP_PARAM_READWRITE));
5186   gimp_pdb_register_procedure (pdb, procedure);
5187   g_object_unref (procedure);
5188 
5189   /*
5190    * gimp-plug-in-autostretch-hsv
5191    */
5192   procedure = gimp_procedure_new (plug_in_autostretch_hsv_invoker);
5193   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5194                                "plug-in-autostretch-hsv");
5195   gimp_procedure_set_static_strings (procedure,
5196                                      "plug-in-autostretch-hsv",
5197                                      "Stretch contrast to cover the maximum possible range",
5198                                      "This simple plug-in does an automatic contrast stretch. For each channel in the image, it finds the minimum and maximum values... it uses those values to stretch the individual histograms to the full contrast range. For some images it may do just what you want; for others it may be total crap :). This version differs from Contrast Autostretch in that it works in HSV space, and preserves hue.",
5199                                      "Compatibility procedure. Please see 'gegl:stretch-contrast-hsv' for credits.",
5200                                      "Compatibility procedure. Please see 'gegl:stretch-contrast-hsv' for credits.",
5201                                      "2013",
5202                                      NULL);
5203   gimp_procedure_add_argument (procedure,
5204                                g_param_spec_enum ("run-mode",
5205                                                   "run mode",
5206                                                   "The run mode",
5207                                                   GIMP_TYPE_RUN_MODE,
5208                                                   GIMP_RUN_INTERACTIVE,
5209                                                   GIMP_PARAM_READWRITE));
5210   gimp_procedure_add_argument (procedure,
5211                                gimp_param_spec_image_id ("image",
5212                                                          "image",
5213                                                          "Input image (unused)",
5214                                                          pdb->gimp, FALSE,
5215                                                          GIMP_PARAM_READWRITE));
5216   gimp_procedure_add_argument (procedure,
5217                                gimp_param_spec_drawable_id ("drawable",
5218                                                             "drawable",
5219                                                             "Input drawable",
5220                                                             pdb->gimp, FALSE,
5221                                                             GIMP_PARAM_READWRITE));
5222   gimp_pdb_register_procedure (pdb, procedure);
5223   g_object_unref (procedure);
5224 
5225   /*
5226    * gimp-plug-in-bump-map
5227    */
5228   procedure = gimp_procedure_new (plug_in_bump_map_invoker);
5229   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5230                                "plug-in-bump-map");
5231   gimp_procedure_set_static_strings (procedure,
5232                                      "plug-in-bump-map",
5233                                      "Create an embossing effect using a bump map",
5234                                      "This plug-in uses the algorithm described by John Schlag, \"Fast Embossing Effects on Raster Image Data\" in Graphics GEMS IV (ISBN 0-12-336155-9). It takes a drawable to be applied as a bump map to another image and produces a nice embossing effect.",
5235                                      "Compatibility procedure. Please see 'gegl:bump-map' for credits.",
5236                                      "Compatibility procedure. Please see 'gegl:bump-map' for credits.",
5237                                      "2015",
5238                                      NULL);
5239   gimp_procedure_add_argument (procedure,
5240                                g_param_spec_enum ("run-mode",
5241                                                   "run mode",
5242                                                   "The run mode",
5243                                                   GIMP_TYPE_RUN_MODE,
5244                                                   GIMP_RUN_INTERACTIVE,
5245                                                   GIMP_PARAM_READWRITE));
5246   gimp_procedure_add_argument (procedure,
5247                                gimp_param_spec_image_id ("image",
5248                                                          "image",
5249                                                          "Input image (unused)",
5250                                                          pdb->gimp, FALSE,
5251                                                          GIMP_PARAM_READWRITE));
5252   gimp_procedure_add_argument (procedure,
5253                                gimp_param_spec_drawable_id ("drawable",
5254                                                             "drawable",
5255                                                             "Input drawable",
5256                                                             pdb->gimp, FALSE,
5257                                                             GIMP_PARAM_READWRITE));
5258   gimp_procedure_add_argument (procedure,
5259                                gimp_param_spec_drawable_id ("bumpmap",
5260                                                             "bumpmap",
5261                                                             "Bump map drawable",
5262                                                             pdb->gimp, FALSE,
5263                                                             GIMP_PARAM_READWRITE));
5264   gimp_procedure_add_argument (procedure,
5265                                g_param_spec_double ("azimuth",
5266                                                     "azimuth",
5267                                                     "Azimuth",
5268                                                     0.0, 360.0, 0.0,
5269                                                     GIMP_PARAM_READWRITE));
5270   gimp_procedure_add_argument (procedure,
5271                                g_param_spec_double ("elevation",
5272                                                     "elevation",
5273                                                     "Elevation",
5274                                                     0.5, 90.0, 0.5,
5275                                                     GIMP_PARAM_READWRITE));
5276   gimp_procedure_add_argument (procedure,
5277                                gimp_param_spec_int32 ("depth",
5278                                                       "depth",
5279                                                       "Depth",
5280                                                       1, 65, 1,
5281                                                       GIMP_PARAM_READWRITE));
5282   gimp_procedure_add_argument (procedure,
5283                                gimp_param_spec_int32 ("xofs",
5284                                                       "xofs",
5285                                                       "X offset",
5286                                                       G_MININT32, G_MAXINT32, 0,
5287                                                       GIMP_PARAM_READWRITE));
5288   gimp_procedure_add_argument (procedure,
5289                                gimp_param_spec_int32 ("yofs",
5290                                                       "yofs",
5291                                                       "Y offset",
5292                                                       G_MININT32, G_MAXINT32, 0,
5293                                                       GIMP_PARAM_READWRITE));
5294   gimp_procedure_add_argument (procedure,
5295                                g_param_spec_double ("waterlevel",
5296                                                     "waterlevel",
5297                                                     "Level that full transparency should represent",
5298                                                     0.0, 1.0, 0.0,
5299                                                     GIMP_PARAM_READWRITE));
5300   gimp_procedure_add_argument (procedure,
5301                                g_param_spec_double ("ambient",
5302                                                     "ambient",
5303                                                     "Ambient lighting factor",
5304                                                     0.0, 1.0, 0.0,
5305                                                     GIMP_PARAM_READWRITE));
5306   gimp_procedure_add_argument (procedure,
5307                                g_param_spec_boolean ("compensate",
5308                                                      "compensate",
5309                                                      "Compensate for darkening",
5310                                                      FALSE,
5311                                                      GIMP_PARAM_READWRITE));
5312   gimp_procedure_add_argument (procedure,
5313                                g_param_spec_boolean ("invert",
5314                                                      "invert",
5315                                                      "Invert bumpmap",
5316                                                      FALSE,
5317                                                      GIMP_PARAM_READWRITE));
5318   gimp_procedure_add_argument (procedure,
5319                                gimp_param_spec_int32 ("type",
5320                                                       "type",
5321                                                       "Type of map { LINEAR (0), SPHERICAL (1), SINUSOIDAL (2) }",
5322                                                       0, 3, 0,
5323                                                       GIMP_PARAM_READWRITE));
5324   gimp_pdb_register_procedure (pdb, procedure);
5325   g_object_unref (procedure);
5326 
5327   /*
5328    * gimp-plug-in-bump-map-tiled
5329    */
5330   procedure = gimp_procedure_new (plug_in_bump_map_tiled_invoker);
5331   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5332                                "plug-in-bump-map-tiled");
5333   gimp_procedure_set_static_strings (procedure,
5334                                      "plug-in-bump-map-tiled",
5335                                      "Create an embossing effect using a tiled image as a bump map",
5336                                      "This plug-in uses the algorithm described by John Schlag, \"Fast Embossing Effects on Raster Image Data\" in Graphics GEMS IV (ISBN 0-12-336155-9). It takes a drawable to be tiled and applied as a bump map to another image and produces a nice embossing effect.",
5337                                      "Compatibility procedure. Please see 'gegl:bump-map' for credits.",
5338                                      "Compatibility procedure. Please see 'gegl:bump-map' for credits.",
5339                                      "2015",
5340                                      NULL);
5341   gimp_procedure_add_argument (procedure,
5342                                g_param_spec_enum ("run-mode",
5343                                                   "run mode",
5344                                                   "The run mode",
5345                                                   GIMP_TYPE_RUN_MODE,
5346                                                   GIMP_RUN_INTERACTIVE,
5347                                                   GIMP_PARAM_READWRITE));
5348   gimp_procedure_add_argument (procedure,
5349                                gimp_param_spec_image_id ("image",
5350                                                          "image",
5351                                                          "Input image (unused)",
5352                                                          pdb->gimp, FALSE,
5353                                                          GIMP_PARAM_READWRITE));
5354   gimp_procedure_add_argument (procedure,
5355                                gimp_param_spec_drawable_id ("drawable",
5356                                                             "drawable",
5357                                                             "Input drawable",
5358                                                             pdb->gimp, FALSE,
5359                                                             GIMP_PARAM_READWRITE));
5360   gimp_procedure_add_argument (procedure,
5361                                gimp_param_spec_drawable_id ("bumpmap",
5362                                                             "bumpmap",
5363                                                             "Bump map drawable",
5364                                                             pdb->gimp, FALSE,
5365                                                             GIMP_PARAM_READWRITE));
5366   gimp_procedure_add_argument (procedure,
5367                                g_param_spec_double ("azimuth",
5368                                                     "azimuth",
5369                                                     "Azimuth",
5370                                                     0.0, 360.0, 0.0,
5371                                                     GIMP_PARAM_READWRITE));
5372   gimp_procedure_add_argument (procedure,
5373                                g_param_spec_double ("elevation",
5374                                                     "elevation",
5375                                                     "Elevation",
5376                                                     0.5, 90.0, 0.5,
5377                                                     GIMP_PARAM_READWRITE));
5378   gimp_procedure_add_argument (procedure,
5379                                gimp_param_spec_int32 ("depth",
5380                                                       "depth",
5381                                                       "Depth",
5382                                                       1, 65, 1,
5383                                                       GIMP_PARAM_READWRITE));
5384   gimp_procedure_add_argument (procedure,
5385                                gimp_param_spec_int32 ("xofs",
5386                                                       "xofs",
5387                                                       "X offset",
5388                                                       G_MININT32, G_MAXINT32, 0,
5389                                                       GIMP_PARAM_READWRITE));
5390   gimp_procedure_add_argument (procedure,
5391                                gimp_param_spec_int32 ("yofs",
5392                                                       "yofs",
5393                                                       "Y offset",
5394                                                       G_MININT32, G_MAXINT32, 0,
5395                                                       GIMP_PARAM_READWRITE));
5396   gimp_procedure_add_argument (procedure,
5397                                g_param_spec_double ("waterlevel",
5398                                                     "waterlevel",
5399                                                     "Level that full transparency should represent",
5400                                                     0.0, 1.0, 0.0,
5401                                                     GIMP_PARAM_READWRITE));
5402   gimp_procedure_add_argument (procedure,
5403                                g_param_spec_double ("ambient",
5404                                                     "ambient",
5405                                                     "Ambient lighting factor",
5406                                                     0.0, 1.0, 0.0,
5407                                                     GIMP_PARAM_READWRITE));
5408   gimp_procedure_add_argument (procedure,
5409                                g_param_spec_boolean ("compensate",
5410                                                      "compensate",
5411                                                      "Compensate for darkening",
5412                                                      FALSE,
5413                                                      GIMP_PARAM_READWRITE));
5414   gimp_procedure_add_argument (procedure,
5415                                g_param_spec_boolean ("invert",
5416                                                      "invert",
5417                                                      "Invert bumpmap",
5418                                                      FALSE,
5419                                                      GIMP_PARAM_READWRITE));
5420   gimp_procedure_add_argument (procedure,
5421                                gimp_param_spec_int32 ("type",
5422                                                       "type",
5423                                                       "Type of map { LINEAR (0), SPHERICAL (1), SINUSOIDAL (2) }",
5424                                                       0, 3, 0,
5425                                                       GIMP_PARAM_READWRITE));
5426   gimp_pdb_register_procedure (pdb, procedure);
5427   g_object_unref (procedure);
5428 
5429   /*
5430    * gimp-plug-in-c-astretch
5431    */
5432   procedure = gimp_procedure_new (plug_in_c_astretch_invoker);
5433   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5434                                "plug-in-c-astretch");
5435   gimp_procedure_set_static_strings (procedure,
5436                                      "plug-in-c-astretch",
5437                                      "Stretch contrast to cover the maximum possible range",
5438                                      "This simple plug-in does an automatic contrast stretch. For each channel in the image, it finds the minimum and maximum values... it uses those values to stretch the individual histograms to the full contrast range. For some images it may do just what you want; for others it may not work that well.",
5439                                      "Compatibility procedure. Please see 'gegl:stretch-contrast' for credits.",
5440                                      "Compatibility procedure. Please see 'gegl:stretch-contrast' for credits.",
5441                                      "2013",
5442                                      NULL);
5443   gimp_procedure_add_argument (procedure,
5444                                g_param_spec_enum ("run-mode",
5445                                                   "run mode",
5446                                                   "The run mode",
5447                                                   GIMP_TYPE_RUN_MODE,
5448                                                   GIMP_RUN_INTERACTIVE,
5449                                                   GIMP_PARAM_READWRITE));
5450   gimp_procedure_add_argument (procedure,
5451                                gimp_param_spec_image_id ("image",
5452                                                          "image",
5453                                                          "Input image (unused)",
5454                                                          pdb->gimp, FALSE,
5455                                                          GIMP_PARAM_READWRITE));
5456   gimp_procedure_add_argument (procedure,
5457                                gimp_param_spec_drawable_id ("drawable",
5458                                                             "drawable",
5459                                                             "Input drawable",
5460                                                             pdb->gimp, FALSE,
5461                                                             GIMP_PARAM_READWRITE));
5462   gimp_pdb_register_procedure (pdb, procedure);
5463   g_object_unref (procedure);
5464 
5465   /*
5466    * gimp-plug-in-colors-channel-mixer
5467    */
5468   procedure = gimp_procedure_new (plug_in_colors_channel_mixer_invoker);
5469   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5470                                "plug-in-colors-channel-mixer");
5471   gimp_procedure_set_static_strings (procedure,
5472                                      "plug-in-colors-channel-mixer",
5473                                      "Alter colors by mixing RGB Channels",
5474                                      "This plug-in mixes the RGB channels.",
5475                                      "Compatibility procedure. Please see 'gegl:channel-mixer' for credits.",
5476                                      "Compatibility procedure. Please see 'gegl:channel-mixer' for credits.",
5477                                      "2013",
5478                                      NULL);
5479   gimp_procedure_add_argument (procedure,
5480                                g_param_spec_enum ("run-mode",
5481                                                   "run mode",
5482                                                   "The run mode",
5483                                                   GIMP_TYPE_RUN_MODE,
5484                                                   GIMP_RUN_INTERACTIVE,
5485                                                   GIMP_PARAM_READWRITE));
5486   gimp_procedure_add_argument (procedure,
5487                                gimp_param_spec_image_id ("image",
5488                                                          "image",
5489                                                          "Input image (unused)",
5490                                                          pdb->gimp, FALSE,
5491                                                          GIMP_PARAM_READWRITE));
5492   gimp_procedure_add_argument (procedure,
5493                                gimp_param_spec_drawable_id ("drawable",
5494                                                             "drawable",
5495                                                             "Input drawable",
5496                                                             pdb->gimp, FALSE,
5497                                                             GIMP_PARAM_READWRITE));
5498   gimp_procedure_add_argument (procedure,
5499                                gimp_param_spec_int32 ("monochrome",
5500                                                       "monochrome",
5501                                                       "Monochrome { TRUE, FALSE }",
5502                                                       0, 1, 0,
5503                                                       GIMP_PARAM_READWRITE));
5504   gimp_procedure_add_argument (procedure,
5505                                g_param_spec_double ("rr-gain",
5506                                                     "rr gain",
5507                                                     "Set the red gain for the red channel",
5508                                                     -2, 2, -2,
5509                                                     GIMP_PARAM_READWRITE));
5510   gimp_procedure_add_argument (procedure,
5511                                g_param_spec_double ("rg-gain",
5512                                                     "rg gain",
5513                                                     "Set the green gain for the red channel",
5514                                                     -2, 2, -2,
5515                                                     GIMP_PARAM_READWRITE));
5516   gimp_procedure_add_argument (procedure,
5517                                g_param_spec_double ("rb-gain",
5518                                                     "rb gain",
5519                                                     "Set the blue gain for the red channel",
5520                                                     -2, 2, -2,
5521                                                     GIMP_PARAM_READWRITE));
5522   gimp_procedure_add_argument (procedure,
5523                                g_param_spec_double ("gr-gain",
5524                                                     "gr gain",
5525                                                     "Set the red gain for the green channel",
5526                                                     -2, 2, -2,
5527                                                     GIMP_PARAM_READWRITE));
5528   gimp_procedure_add_argument (procedure,
5529                                g_param_spec_double ("gg-gain",
5530                                                     "gg gain",
5531                                                     "Set the green gain for the green channel",
5532                                                     -2, 2, -2,
5533                                                     GIMP_PARAM_READWRITE));
5534   gimp_procedure_add_argument (procedure,
5535                                g_param_spec_double ("gb-gain",
5536                                                     "gb gain",
5537                                                     "Set the blue gain for the green channel",
5538                                                     -2, 2, -2,
5539                                                     GIMP_PARAM_READWRITE));
5540   gimp_procedure_add_argument (procedure,
5541                                g_param_spec_double ("br-gain",
5542                                                     "br gain",
5543                                                     "Set the red gain for the blue channel",
5544                                                     -2, 2, -2,
5545                                                     GIMP_PARAM_READWRITE));
5546   gimp_procedure_add_argument (procedure,
5547                                g_param_spec_double ("bg-gain",
5548                                                     "bg gain",
5549                                                     "Set the green gain for the blue channel",
5550                                                     -2, 2, -2,
5551                                                     GIMP_PARAM_READWRITE));
5552   gimp_procedure_add_argument (procedure,
5553                                g_param_spec_double ("bb-gain",
5554                                                     "bb gain",
5555                                                     "Set the blue gain for the blue channel",
5556                                                     -2, 2, -2,
5557                                                     GIMP_PARAM_READWRITE));
5558   gimp_pdb_register_procedure (pdb, procedure);
5559   g_object_unref (procedure);
5560 
5561   /*
5562    * gimp-plug-in-colortoalpha
5563    */
5564   procedure = gimp_procedure_new (plug_in_colortoalpha_invoker);
5565   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5566                                "plug-in-colortoalpha");
5567   gimp_procedure_set_static_strings (procedure,
5568                                      "plug-in-colortoalpha",
5569                                      "Convert a specified color to transparency",
5570                                      "This replaces as much of a given color as possible in each pixel with a corresponding amount of alpha, then readjusts the color accordingly.",
5571                                      "Spencer Kimball & Peter Mattis",
5572                                      "Spencer Kimball & Peter Mattis",
5573                                      "1999",
5574                                      NULL);
5575   gimp_procedure_add_argument (procedure,
5576                                g_param_spec_enum ("run-mode",
5577                                                   "run mode",
5578                                                   "The run mode",
5579                                                   GIMP_TYPE_RUN_MODE,
5580                                                   GIMP_RUN_INTERACTIVE,
5581                                                   GIMP_PARAM_READWRITE));
5582   gimp_procedure_add_argument (procedure,
5583                                gimp_param_spec_image_id ("image",
5584                                                          "image",
5585                                                          "Input image (unused)",
5586                                                          pdb->gimp, FALSE,
5587                                                          GIMP_PARAM_READWRITE));
5588   gimp_procedure_add_argument (procedure,
5589                                gimp_param_spec_drawable_id ("drawable",
5590                                                             "drawable",
5591                                                             "Input drawable",
5592                                                             pdb->gimp, FALSE,
5593                                                             GIMP_PARAM_READWRITE));
5594   gimp_procedure_add_argument (procedure,
5595                                gimp_param_spec_rgb ("color",
5596                                                     "color",
5597                                                     "Color to remove",
5598                                                     FALSE,
5599                                                     NULL,
5600                                                     GIMP_PARAM_READWRITE));
5601   gimp_pdb_register_procedure (pdb, procedure);
5602   g_object_unref (procedure);
5603 
5604   /*
5605    * gimp-plug-in-convmatrix
5606    */
5607   procedure = gimp_procedure_new (plug_in_convmatrix_invoker);
5608   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5609                                "plug-in-convmatrix");
5610   gimp_procedure_set_static_strings (procedure,
5611                                      "plug-in-convmatrix",
5612                                      "Apply a generic 5x5 convolution matrix",
5613                                      "Apply a generic 5x5 convolution matrix.",
5614                                      "Compatibility procedure. Please see 'gegl:convolution-matrix' for credits.",
5615                                      "Compatibility procedure. Please see 'gegl:convolution-matrix' for credits.",
5616                                      "2014",
5617                                      NULL);
5618   gimp_procedure_add_argument (procedure,
5619                                g_param_spec_enum ("run-mode",
5620                                                   "run mode",
5621                                                   "The run mode",
5622                                                   GIMP_TYPE_RUN_MODE,
5623                                                   GIMP_RUN_INTERACTIVE,
5624                                                   GIMP_PARAM_READWRITE));
5625   gimp_procedure_add_argument (procedure,
5626                                gimp_param_spec_image_id ("image",
5627                                                          "image",
5628                                                          "Input image (unused)",
5629                                                          pdb->gimp, FALSE,
5630                                                          GIMP_PARAM_READWRITE));
5631   gimp_procedure_add_argument (procedure,
5632                                gimp_param_spec_drawable_id ("drawable",
5633                                                             "drawable",
5634                                                             "Input drawable",
5635                                                             pdb->gimp, FALSE,
5636                                                             GIMP_PARAM_READWRITE));
5637   gimp_procedure_add_argument (procedure,
5638                                gimp_param_spec_int32 ("argc-matrix",
5639                                                       "argc matrix",
5640                                                       "The number of elements in the following array, must always be 25",
5641                                                       0, G_MAXINT32, 0,
5642                                                       GIMP_PARAM_READWRITE));
5643   gimp_procedure_add_argument (procedure,
5644                                gimp_param_spec_float_array ("matrix",
5645                                                             "matrix",
5646                                                             "The 5x5 convolution matrix",
5647                                                             GIMP_PARAM_READWRITE));
5648   gimp_procedure_add_argument (procedure,
5649                                g_param_spec_boolean ("alpha-alg",
5650                                                      "alpha alg",
5651                                                      "Enable weighting by alpha channel",
5652                                                      FALSE,
5653                                                      GIMP_PARAM_READWRITE));
5654   gimp_procedure_add_argument (procedure,
5655                                g_param_spec_double ("divisor",
5656                                                     "divisor",
5657                                                     "Divisor",
5658                                                     -G_MAXDOUBLE, G_MAXDOUBLE, 0,
5659                                                     GIMP_PARAM_READWRITE));
5660   gimp_procedure_add_argument (procedure,
5661                                g_param_spec_double ("offset",
5662                                                     "offset",
5663                                                     "Offset",
5664                                                     -G_MAXDOUBLE, G_MAXDOUBLE, 0,
5665                                                     GIMP_PARAM_READWRITE));
5666   gimp_procedure_add_argument (procedure,
5667                                gimp_param_spec_int32 ("argc-channels",
5668                                                       "argc channels",
5669                                                       "The number of elements in following array, must always be 5",
5670                                                       0, G_MAXINT32, 0,
5671                                                       GIMP_PARAM_READWRITE));
5672   gimp_procedure_add_argument (procedure,
5673                                gimp_param_spec_int32_array ("channels",
5674                                                             "channels",
5675                                                             "Mask of the channels to be filtered",
5676                                                             GIMP_PARAM_READWRITE));
5677   gimp_procedure_add_argument (procedure,
5678                                gimp_param_spec_int32 ("bmode",
5679                                                       "bmode",
5680                                                       "Mode for treating image borders { EXTEND (0), WRAP (1), CLEAR (2) }",
5681                                                       0, 2, 0,
5682                                                       GIMP_PARAM_READWRITE));
5683   gimp_pdb_register_procedure (pdb, procedure);
5684   g_object_unref (procedure);
5685 
5686   /*
5687    * gimp-plug-in-cubism
5688    */
5689   procedure = gimp_procedure_new (plug_in_cubism_invoker);
5690   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5691                                "plug-in-cubism");
5692   gimp_procedure_set_static_strings (procedure,
5693                                      "plug-in-cubism",
5694                                      "Convert the image into randomly rotated square blobs",
5695                                      "Convert the image into randomly rotated square blobs.",
5696                                      "Compatibility procedure. Please see 'gegl:cubism' for credits.",
5697                                      "Compatibility procedure. Please see 'gegl:cubism' for credits.",
5698                                      "2013",
5699                                      NULL);
5700   gimp_procedure_add_argument (procedure,
5701                                g_param_spec_enum ("run-mode",
5702                                                   "run mode",
5703                                                   "The run mode",
5704                                                   GIMP_TYPE_RUN_MODE,
5705                                                   GIMP_RUN_INTERACTIVE,
5706                                                   GIMP_PARAM_READWRITE));
5707   gimp_procedure_add_argument (procedure,
5708                                gimp_param_spec_image_id ("image",
5709                                                          "image",
5710                                                          "Input image (unused)",
5711                                                          pdb->gimp, FALSE,
5712                                                          GIMP_PARAM_READWRITE));
5713   gimp_procedure_add_argument (procedure,
5714                                gimp_param_spec_drawable_id ("drawable",
5715                                                             "drawable",
5716                                                             "Input drawable",
5717                                                             pdb->gimp, FALSE,
5718                                                             GIMP_PARAM_READWRITE));
5719   gimp_procedure_add_argument (procedure,
5720                                g_param_spec_double ("tile-size",
5721                                                     "tile size",
5722                                                     "Average diameter of each tile (in pixels)",
5723                                                     0.0, 100.0, 0.0,
5724                                                     GIMP_PARAM_READWRITE));
5725   gimp_procedure_add_argument (procedure,
5726                                g_param_spec_double ("tile-saturation",
5727                                                     "tile saturation",
5728                                                     "Expand tiles by this amount",
5729                                                     0.0, 10.0, 0.0,
5730                                                     GIMP_PARAM_READWRITE));
5731   gimp_procedure_add_argument (procedure,
5732                                gimp_param_spec_int32 ("bg-color",
5733                                                       "bg color",
5734                                                       "Background color { BLACK (0), BG (1) }",
5735                                                       0, 1, 0,
5736                                                       GIMP_PARAM_READWRITE));
5737   gimp_pdb_register_procedure (pdb, procedure);
5738   g_object_unref (procedure);
5739 
5740   /*
5741    * gimp-plug-in-deinterlace
5742    */
5743   procedure = gimp_procedure_new (plug_in_deinterlace_invoker);
5744   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5745                                "plug-in-deinterlace");
5746   gimp_procedure_set_static_strings (procedure,
5747                                      "plug-in-deinterlace",
5748                                      "Fix images where every other row is missing",
5749                                      "Deinterlace is useful for processing images from video capture cards. When only the odd or even fields get captured, deinterlace can be used to interpolate between the existing fields to correct this.",
5750                                      "Compatibility procedure. Please see 'gegl:deinterlace' for credits.",
5751                                      "Compatibility procedure. Please see 'gegl:deinterlace' for credits.",
5752                                      "2014",
5753                                      NULL);
5754   gimp_procedure_add_argument (procedure,
5755                                g_param_spec_enum ("run-mode",
5756                                                   "run mode",
5757                                                   "The run mode",
5758                                                   GIMP_TYPE_RUN_MODE,
5759                                                   GIMP_RUN_INTERACTIVE,
5760                                                   GIMP_PARAM_READWRITE));
5761   gimp_procedure_add_argument (procedure,
5762                                gimp_param_spec_image_id ("image",
5763                                                          "image",
5764                                                          "Input image (unused)",
5765                                                          pdb->gimp, FALSE,
5766                                                          GIMP_PARAM_READWRITE));
5767   gimp_procedure_add_argument (procedure,
5768                                gimp_param_spec_drawable_id ("drawable",
5769                                                             "drawable",
5770                                                             "Input drawable",
5771                                                             pdb->gimp, FALSE,
5772                                                             GIMP_PARAM_READWRITE));
5773   gimp_procedure_add_argument (procedure,
5774                                gimp_param_spec_int32 ("evenodd",
5775                                                       "evenodd",
5776                                                       "Which lines to keep { KEEP-ODD (0), KEEP-EVEN (1)",
5777                                                       0, 1, 0,
5778                                                       GIMP_PARAM_READWRITE));
5779   gimp_pdb_register_procedure (pdb, procedure);
5780   g_object_unref (procedure);
5781 
5782   /*
5783    * gimp-plug-in-diffraction
5784    */
5785   procedure = gimp_procedure_new (plug_in_diffraction_invoker);
5786   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5787                                "plug-in-diffraction");
5788   gimp_procedure_set_static_strings (procedure,
5789                                      "plug-in-diffraction",
5790                                      "Generate diffraction patterns",
5791                                      "Help? What help?",
5792                                      "Compatibility procedure. Please see 'gegl:diffraction-patterns' for credits.",
5793                                      "Compatibility procedure. Please see 'gegl:diffraction-patterns' for credits.",
5794                                      "2015",
5795                                      NULL);
5796   gimp_procedure_add_argument (procedure,
5797                                g_param_spec_enum ("run-mode",
5798                                                   "run mode",
5799                                                   "The run mode",
5800                                                   GIMP_TYPE_RUN_MODE,
5801                                                   GIMP_RUN_INTERACTIVE,
5802                                                   GIMP_PARAM_READWRITE));
5803   gimp_procedure_add_argument (procedure,
5804                                gimp_param_spec_image_id ("image",
5805                                                          "image",
5806                                                          "Input image (unused)",
5807                                                          pdb->gimp, FALSE,
5808                                                          GIMP_PARAM_READWRITE));
5809   gimp_procedure_add_argument (procedure,
5810                                gimp_param_spec_drawable_id ("drawable",
5811                                                             "drawable",
5812                                                             "Input drawable",
5813                                                             pdb->gimp, FALSE,
5814                                                             GIMP_PARAM_READWRITE));
5815   gimp_procedure_add_argument (procedure,
5816                                g_param_spec_double ("lam-r",
5817                                                     "lam r",
5818                                                     "Light frequency (red)",
5819                                                     0.0, 20.0, 0.0,
5820                                                     GIMP_PARAM_READWRITE));
5821   gimp_procedure_add_argument (procedure,
5822                                g_param_spec_double ("lam-g",
5823                                                     "lam g",
5824                                                     "Light frequency (green)",
5825                                                     0.0, 20.0, 0.0,
5826                                                     GIMP_PARAM_READWRITE));
5827   gimp_procedure_add_argument (procedure,
5828                                g_param_spec_double ("lam-b",
5829                                                     "lam b",
5830                                                     "Light frequency (blue)",
5831                                                     0.0, 20.0, 0.0,
5832                                                     GIMP_PARAM_READWRITE));
5833   gimp_procedure_add_argument (procedure,
5834                                g_param_spec_double ("contour-r",
5835                                                     "contour r",
5836                                                     "Number of contours (red)",
5837                                                     0.0, 10.0, 0.0,
5838                                                     GIMP_PARAM_READWRITE));
5839   gimp_procedure_add_argument (procedure,
5840                                g_param_spec_double ("contour-g",
5841                                                     "contour g",
5842                                                     "Number of contours (green)",
5843                                                     0.0, 10.0, 0.0,
5844                                                     GIMP_PARAM_READWRITE));
5845   gimp_procedure_add_argument (procedure,
5846                                g_param_spec_double ("contour-b",
5847                                                     "contour b",
5848                                                     "Number of contours (blue)",
5849                                                     0.0, 10.0, 0.0,
5850                                                     GIMP_PARAM_READWRITE));
5851   gimp_procedure_add_argument (procedure,
5852                                g_param_spec_double ("edges-r",
5853                                                     "edges r",
5854                                                     "Number of sharp edges (red)",
5855                                                     0.0, 1.0, 0.0,
5856                                                     GIMP_PARAM_READWRITE));
5857   gimp_procedure_add_argument (procedure,
5858                                g_param_spec_double ("edges-g",
5859                                                     "edges g",
5860                                                     "Number of sharp edges (green)",
5861                                                     0.0, 1.0, 0.0,
5862                                                     GIMP_PARAM_READWRITE));
5863   gimp_procedure_add_argument (procedure,
5864                                g_param_spec_double ("edges-b",
5865                                                     "edges b",
5866                                                     "Number of sharp edges (blue)",
5867                                                     0.0, 1.0, 0.0,
5868                                                     GIMP_PARAM_READWRITE));
5869   gimp_procedure_add_argument (procedure,
5870                                g_param_spec_double ("brightness",
5871                                                     "brightness",
5872                                                     "Brightness and shifting/fattening of contours",
5873                                                     0.0, 1.0, 0.0,
5874                                                     GIMP_PARAM_READWRITE));
5875   gimp_procedure_add_argument (procedure,
5876                                g_param_spec_double ("scattering",
5877                                                     "scattering",
5878                                                     "Scattering (Speed vs. quality)",
5879                                                     0.0, 100.0, 0.0,
5880                                                     GIMP_PARAM_READWRITE));
5881   gimp_procedure_add_argument (procedure,
5882                                g_param_spec_double ("polarization",
5883                                                     "polarization",
5884                                                     "Polarization",
5885                                                     -1.0, 1.0, -1.0,
5886                                                     GIMP_PARAM_READWRITE));
5887   gimp_pdb_register_procedure (pdb, procedure);
5888   g_object_unref (procedure);
5889 
5890   /*
5891    * gimp-plug-in-displace
5892    */
5893   procedure = gimp_procedure_new (plug_in_displace_invoker);
5894   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5895                                "plug-in-displace");
5896   gimp_procedure_set_static_strings (procedure,
5897                                      "plug-in-displace",
5898                                      "Displace pixels as indicated by displacement maps",
5899                                      "Displaces the contents of the specified drawable by the amounts specified by 'amount-x' and 'amount-y' multiplied by the luminance of corresponding pixels in the 'displace-map' drawables.",
5900                                      "Compatibility procedure. Please see 'gegl:displace' for credits.",
5901                                      "Compatibility procedure. Please see 'gegl:displace' for credits.",
5902                                      "2015",
5903                                      NULL);
5904   gimp_procedure_add_argument (procedure,
5905                                g_param_spec_enum ("run-mode",
5906                                                   "run mode",
5907                                                   "The run mode",
5908                                                   GIMP_TYPE_RUN_MODE,
5909                                                   GIMP_RUN_INTERACTIVE,
5910                                                   GIMP_PARAM_READWRITE));
5911   gimp_procedure_add_argument (procedure,
5912                                gimp_param_spec_image_id ("image",
5913                                                          "image",
5914                                                          "Input image (unused)",
5915                                                          pdb->gimp, FALSE,
5916                                                          GIMP_PARAM_READWRITE));
5917   gimp_procedure_add_argument (procedure,
5918                                gimp_param_spec_drawable_id ("drawable",
5919                                                             "drawable",
5920                                                             "Input drawable",
5921                                                             pdb->gimp, FALSE,
5922                                                             GIMP_PARAM_READWRITE));
5923   gimp_procedure_add_argument (procedure,
5924                                g_param_spec_double ("amount-x",
5925                                                     "amount x",
5926                                                     "Displace multiplier for x direction",
5927                                                     -500.0, 500.0, -500.0,
5928                                                     GIMP_PARAM_READWRITE));
5929   gimp_procedure_add_argument (procedure,
5930                                g_param_spec_double ("amount-y",
5931                                                     "amount y",
5932                                                     "Displace multiplier for y direction",
5933                                                     -500.0, 500.0, -500.0,
5934                                                     GIMP_PARAM_READWRITE));
5935   gimp_procedure_add_argument (procedure,
5936                                g_param_spec_boolean ("do-x",
5937                                                      "do x",
5938                                                      "Displace in x direction ?",
5939                                                      FALSE,
5940                                                      GIMP_PARAM_READWRITE));
5941   gimp_procedure_add_argument (procedure,
5942                                g_param_spec_boolean ("do-y",
5943                                                      "do y",
5944                                                      "Displace in y direction ?",
5945                                                      FALSE,
5946                                                      GIMP_PARAM_READWRITE));
5947   gimp_procedure_add_argument (procedure,
5948                                gimp_param_spec_drawable_id ("displace-map-x",
5949                                                             "displace map x",
5950                                                             "Displacement map for x direction",
5951                                                             pdb->gimp, FALSE,
5952                                                             GIMP_PARAM_READWRITE));
5953   gimp_procedure_add_argument (procedure,
5954                                gimp_param_spec_drawable_id ("displace-map-y",
5955                                                             "displace map y",
5956                                                             "Displacement map for y direction",
5957                                                             pdb->gimp, FALSE,
5958                                                             GIMP_PARAM_READWRITE));
5959   gimp_procedure_add_argument (procedure,
5960                                gimp_param_spec_int32 ("displace-type",
5961                                                       "displace type",
5962                                                       "Edge behavior { WRAP (1), SMEAR (2), BLACK (3) }",
5963                                                       1, 3, 1,
5964                                                       GIMP_PARAM_READWRITE));
5965   gimp_pdb_register_procedure (pdb, procedure);
5966   g_object_unref (procedure);
5967 
5968   /*
5969    * gimp-plug-in-displace-polar
5970    */
5971   procedure = gimp_procedure_new (plug_in_displace_polar_invoker);
5972   gimp_object_set_static_name (GIMP_OBJECT (procedure),
5973                                "plug-in-displace-polar");
5974   gimp_procedure_set_static_strings (procedure,
5975                                      "plug-in-displace-polar",
5976                                      "Displace pixels as indicated by displacement maps",
5977                                      "Just like plug-in-displace but working in polar coordinates. The drawable is whirled and pinched according to the map.",
5978                                      "Compatibility procedure. Please see 'gegl:displace' for credits.",
5979                                      "Compatibility procedure. Please see 'gegl:displace' for credits.",
5980                                      "2015",
5981                                      NULL);
5982   gimp_procedure_add_argument (procedure,
5983                                g_param_spec_enum ("run-mode",
5984                                                   "run mode",
5985                                                   "The run mode",
5986                                                   GIMP_TYPE_RUN_MODE,
5987                                                   GIMP_RUN_INTERACTIVE,
5988                                                   GIMP_PARAM_READWRITE));
5989   gimp_procedure_add_argument (procedure,
5990                                gimp_param_spec_image_id ("image",
5991                                                          "image",
5992                                                          "Input image (unused)",
5993                                                          pdb->gimp, FALSE,
5994                                                          GIMP_PARAM_READWRITE));
5995   gimp_procedure_add_argument (procedure,
5996                                gimp_param_spec_drawable_id ("drawable",
5997                                                             "drawable",
5998                                                             "Input drawable",
5999                                                             pdb->gimp, FALSE,
6000                                                             GIMP_PARAM_READWRITE));
6001   gimp_procedure_add_argument (procedure,
6002                                g_param_spec_double ("amount-x",
6003                                                     "amount x",
6004                                                     "Displace multiplier for radial direction",
6005                                                     -500.0, 500.0, -500.0,
6006                                                     GIMP_PARAM_READWRITE));
6007   gimp_procedure_add_argument (procedure,
6008                                g_param_spec_double ("amount-y",
6009                                                     "amount y",
6010                                                     "Displace multiplier for tangent direction",
6011                                                     -500.0, 500.0, -500.0,
6012                                                     GIMP_PARAM_READWRITE));
6013   gimp_procedure_add_argument (procedure,
6014                                g_param_spec_boolean ("do-x",
6015                                                      "do x",
6016                                                      "Displace in radial direction ?",
6017                                                      FALSE,
6018                                                      GIMP_PARAM_READWRITE));
6019   gimp_procedure_add_argument (procedure,
6020                                g_param_spec_boolean ("do-y",
6021                                                      "do y",
6022                                                      "Displace in tangent direction ?",
6023                                                      FALSE,
6024                                                      GIMP_PARAM_READWRITE));
6025   gimp_procedure_add_argument (procedure,
6026                                gimp_param_spec_drawable_id ("displace-map-x",
6027                                                             "displace map x",
6028                                                             "Displacement map for radial direction",
6029                                                             pdb->gimp, FALSE,
6030                                                             GIMP_PARAM_READWRITE));
6031   gimp_procedure_add_argument (procedure,
6032                                gimp_param_spec_drawable_id ("displace-map-y",
6033                                                             "displace map y",
6034                                                             "Displacement map for tangent direction",
6035                                                             pdb->gimp, FALSE,
6036                                                             GIMP_PARAM_READWRITE));
6037   gimp_procedure_add_argument (procedure,
6038                                gimp_param_spec_int32 ("displace-type",
6039                                                       "displace type",
6040                                                       "Edge behavior { WRAP (1), SMEAR (2), BLACK (3) }",
6041                                                       1, 3, 1,
6042                                                       GIMP_PARAM_READWRITE));
6043   gimp_pdb_register_procedure (pdb, procedure);
6044   g_object_unref (procedure);
6045 
6046   /*
6047    * gimp-plug-in-edge
6048    */
6049   procedure = gimp_procedure_new (plug_in_edge_invoker);
6050   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6051                                "plug-in-edge");
6052   gimp_procedure_set_static_strings (procedure,
6053                                      "plug-in-edge",
6054                                      "Several simple methods for detecting edges",
6055                                      "Perform edge detection on the contents of the specified drawable. AMOUNT is an arbitrary constant, WRAPMODE is like displace plug-in (useful for tileable image). EDGEMODE sets the kind of matrix transform applied to the pixels, SOBEL was the method used in older versions.",
6056                                      "Compatibility procedure. Please see 'gegl:edge' for credits.",
6057                                      "Compatibility procedure. Please see 'gegl:edge' for credits.",
6058                                      "2015",
6059                                      NULL);
6060   gimp_procedure_add_argument (procedure,
6061                                g_param_spec_enum ("run-mode",
6062                                                   "run mode",
6063                                                   "The run mode",
6064                                                   GIMP_TYPE_RUN_MODE,
6065                                                   GIMP_RUN_INTERACTIVE,
6066                                                   GIMP_PARAM_READWRITE));
6067   gimp_procedure_add_argument (procedure,
6068                                gimp_param_spec_image_id ("image",
6069                                                          "image",
6070                                                          "Input image (unused)",
6071                                                          pdb->gimp, FALSE,
6072                                                          GIMP_PARAM_READWRITE));
6073   gimp_procedure_add_argument (procedure,
6074                                gimp_param_spec_drawable_id ("drawable",
6075                                                             "drawable",
6076                                                             "Input drawable",
6077                                                             pdb->gimp, FALSE,
6078                                                             GIMP_PARAM_READWRITE));
6079   gimp_procedure_add_argument (procedure,
6080                                g_param_spec_double ("amount",
6081                                                     "amount",
6082                                                     "Edge detection amount",
6083                                                     1.0, 10.0, 1.0,
6084                                                     GIMP_PARAM_READWRITE));
6085   gimp_procedure_add_argument (procedure,
6086                                gimp_param_spec_int32 ("warpmode",
6087                                                       "warpmode",
6088                                                       "Edge detection behavior { NONE (0), WRAP (1), SMEAR (2), BLACK (3) }",
6089                                                       0, 3, 0,
6090                                                       GIMP_PARAM_READWRITE));
6091   gimp_procedure_add_argument (procedure,
6092                                gimp_param_spec_int32 ("edgemode",
6093                                                       "edgemode",
6094                                                       "Edge detection algorithm { SOBEL (0), PREWITT (1), GRADIENT (2), ROBERTS (3), DIFFERENTIAL (4), LAPLACE (5) }",
6095                                                       0, 5, 0,
6096                                                       GIMP_PARAM_READWRITE));
6097   gimp_pdb_register_procedure (pdb, procedure);
6098   g_object_unref (procedure);
6099 
6100   /*
6101    * gimp-plug-in-engrave
6102    */
6103   procedure = gimp_procedure_new (plug_in_engrave_invoker);
6104   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6105                                "plug-in-engrave");
6106   gimp_procedure_set_static_strings (procedure,
6107                                      "plug-in-engrave",
6108                                      "Simulate an antique engraving",
6109                                      "Creates a black-and-white 'engraved' version of an image as seen in old illustrations.",
6110                                      "Compatibility procedure. Please see 'gegl:engrave' for credits.",
6111                                      "Compatibility procedure. Please see 'gegl:engrave' for credits.",
6112                                      "2014",
6113                                      NULL);
6114   gimp_procedure_add_argument (procedure,
6115                                g_param_spec_enum ("run-mode",
6116                                                   "run mode",
6117                                                   "The run mode",
6118                                                   GIMP_TYPE_RUN_MODE,
6119                                                   GIMP_RUN_INTERACTIVE,
6120                                                   GIMP_PARAM_READWRITE));
6121   gimp_procedure_add_argument (procedure,
6122                                gimp_param_spec_image_id ("image",
6123                                                          "image",
6124                                                          "Input image (unused)",
6125                                                          pdb->gimp, FALSE,
6126                                                          GIMP_PARAM_READWRITE));
6127   gimp_procedure_add_argument (procedure,
6128                                gimp_param_spec_drawable_id ("drawable",
6129                                                             "drawable",
6130                                                             "Input drawable",
6131                                                             pdb->gimp, FALSE,
6132                                                             GIMP_PARAM_READWRITE));
6133   gimp_procedure_add_argument (procedure,
6134                                gimp_param_spec_int32 ("height",
6135                                                       "height",
6136                                                       "Resolution in pixels",
6137                                                       2, 16, 2,
6138                                                       GIMP_PARAM_READWRITE));
6139   gimp_procedure_add_argument (procedure,
6140                                g_param_spec_boolean ("limit",
6141                                                      "limit",
6142                                                      "Limit line width",
6143                                                      FALSE,
6144                                                      GIMP_PARAM_READWRITE));
6145   gimp_pdb_register_procedure (pdb, procedure);
6146   g_object_unref (procedure);
6147 
6148   /*
6149    * gimp-plug-in-exchange
6150    */
6151   procedure = gimp_procedure_new (plug_in_exchange_invoker);
6152   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6153                                "plug-in-exchange");
6154   gimp_procedure_set_static_strings (procedure,
6155                                      "plug-in-exchange",
6156                                      "Swap one color with another",
6157                                      "Exchange one color with another, optionally setting a threshold to convert from one shade to another.",
6158                                      "Compatibility procedure. Please see 'gegl:color-exchange' for credits.",
6159                                      "Compatibility procedure. Please see 'gegl:color-exchange' for credits.",
6160                                      "2014",
6161                                      NULL);
6162   gimp_procedure_add_argument (procedure,
6163                                g_param_spec_enum ("run-mode",
6164                                                   "run mode",
6165                                                   "The run mode",
6166                                                   GIMP_TYPE_RUN_MODE,
6167                                                   GIMP_RUN_INTERACTIVE,
6168                                                   GIMP_PARAM_READWRITE));
6169   gimp_procedure_add_argument (procedure,
6170                                gimp_param_spec_image_id ("image",
6171                                                          "image",
6172                                                          "Input image (unused)",
6173                                                          pdb->gimp, FALSE,
6174                                                          GIMP_PARAM_READWRITE));
6175   gimp_procedure_add_argument (procedure,
6176                                gimp_param_spec_drawable_id ("drawable",
6177                                                             "drawable",
6178                                                             "Input drawable",
6179                                                             pdb->gimp, FALSE,
6180                                                             GIMP_PARAM_READWRITE));
6181   gimp_procedure_add_argument (procedure,
6182                                gimp_param_spec_int8 ("from-red",
6183                                                      "from red",
6184                                                      "Red value (from)",
6185                                                      0, G_MAXUINT8, 0,
6186                                                      GIMP_PARAM_READWRITE));
6187   gimp_procedure_add_argument (procedure,
6188                                gimp_param_spec_int8 ("from-green",
6189                                                      "from green",
6190                                                      "Green value (from)",
6191                                                      0, G_MAXUINT8, 0,
6192                                                      GIMP_PARAM_READWRITE));
6193   gimp_procedure_add_argument (procedure,
6194                                gimp_param_spec_int8 ("from-blue",
6195                                                      "from blue",
6196                                                      "Blue value (from)",
6197                                                      0, G_MAXUINT8, 0,
6198                                                      GIMP_PARAM_READWRITE));
6199   gimp_procedure_add_argument (procedure,
6200                                gimp_param_spec_int8 ("to-red",
6201                                                      "to red",
6202                                                      "Red value (to)",
6203                                                      0, G_MAXUINT8, 0,
6204                                                      GIMP_PARAM_READWRITE));
6205   gimp_procedure_add_argument (procedure,
6206                                gimp_param_spec_int8 ("to-green",
6207                                                      "to green",
6208                                                      "Green value (to)",
6209                                                      0, G_MAXUINT8, 0,
6210                                                      GIMP_PARAM_READWRITE));
6211   gimp_procedure_add_argument (procedure,
6212                                gimp_param_spec_int8 ("to-blue",
6213                                                      "to blue",
6214                                                      "Blue value (to)",
6215                                                      0, G_MAXUINT8, 0,
6216                                                      GIMP_PARAM_READWRITE));
6217   gimp_procedure_add_argument (procedure,
6218                                gimp_param_spec_int8 ("red-threshold",
6219                                                      "red threshold",
6220                                                      "Red threshold",
6221                                                      0, G_MAXUINT8, 0,
6222                                                      GIMP_PARAM_READWRITE));
6223   gimp_procedure_add_argument (procedure,
6224                                gimp_param_spec_int8 ("green-threshold",
6225                                                      "green threshold",
6226                                                      "Green threshold",
6227                                                      0, G_MAXUINT8, 0,
6228                                                      GIMP_PARAM_READWRITE));
6229   gimp_procedure_add_argument (procedure,
6230                                gimp_param_spec_int8 ("blue-threshold",
6231                                                      "blue threshold",
6232                                                      "Blue threshold",
6233                                                      0, G_MAXUINT8, 0,
6234                                                      GIMP_PARAM_READWRITE));
6235   gimp_pdb_register_procedure (pdb, procedure);
6236   g_object_unref (procedure);
6237 
6238   /*
6239    * gimp-plug-in-flarefx
6240    */
6241   procedure = gimp_procedure_new (plug_in_flarefx_invoker);
6242   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6243                                "plug-in-flarefx");
6244   gimp_procedure_set_static_strings (procedure,
6245                                      "plug-in-flarefx",
6246                                      "Add a lens flare effect",
6247                                      "Adds a lens flare effects. Makes your image look like it was snapped with a cheap camera with a lot of lens :)",
6248                                      "Compatibility procedure. Please see 'gegl:lens-flare' for credits.",
6249                                      "Compatibility procedure. Please see 'gegl:lens-flare' for credits.",
6250                                      "2015",
6251                                      NULL);
6252   gimp_procedure_add_argument (procedure,
6253                                g_param_spec_enum ("run-mode",
6254                                                   "run mode",
6255                                                   "The run mode",
6256                                                   GIMP_TYPE_RUN_MODE,
6257                                                   GIMP_RUN_INTERACTIVE,
6258                                                   GIMP_PARAM_READWRITE));
6259   gimp_procedure_add_argument (procedure,
6260                                gimp_param_spec_image_id ("image",
6261                                                          "image",
6262                                                          "Input image (unused)",
6263                                                          pdb->gimp, FALSE,
6264                                                          GIMP_PARAM_READWRITE));
6265   gimp_procedure_add_argument (procedure,
6266                                gimp_param_spec_drawable_id ("drawable",
6267                                                             "drawable",
6268                                                             "Input drawable",
6269                                                             pdb->gimp, FALSE,
6270                                                             GIMP_PARAM_READWRITE));
6271   gimp_procedure_add_argument (procedure,
6272                                gimp_param_spec_int32 ("pos-x",
6273                                                       "pos x",
6274                                                       "X-Position",
6275                                                       G_MININT32, G_MAXINT32, 0,
6276                                                       GIMP_PARAM_READWRITE));
6277   gimp_procedure_add_argument (procedure,
6278                                gimp_param_spec_int32 ("pos-y",
6279                                                       "pos y",
6280                                                       "Y-Position",
6281                                                       G_MININT32, G_MAXINT32, 0,
6282                                                       GIMP_PARAM_READWRITE));
6283   gimp_pdb_register_procedure (pdb, procedure);
6284   g_object_unref (procedure);
6285 
6286   /*
6287    * gimp-plug-in-gauss
6288    */
6289   procedure = gimp_procedure_new (plug_in_gauss_invoker);
6290   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6291                                "plug-in-gauss");
6292   gimp_procedure_set_static_strings (procedure,
6293                                      "plug-in-gauss",
6294                                      "Simplest, most commonly used way of blurring",
6295                                      "Applies a gaussian blur to the drawable, with specified radius of affect. The standard deviation of the normal distribution used to modify pixel values is calculated based on the supplied radius. Horizontal and vertical blurring can be independently invoked by specifying only one to run. The 'method' parameter is ignored.",
6296                                      "Compatibility procedure. Please see 'gegl:gaussian-blur' for credits.",
6297                                      "Compatibility procedure. Please see 'gegl:gaussian-blur' for credits.",
6298                                      "2014",
6299                                      NULL);
6300   gimp_procedure_add_argument (procedure,
6301                                g_param_spec_enum ("run-mode",
6302                                                   "run mode",
6303                                                   "The run mode",
6304                                                   GIMP_TYPE_RUN_MODE,
6305                                                   GIMP_RUN_INTERACTIVE,
6306                                                   GIMP_PARAM_READWRITE));
6307   gimp_procedure_add_argument (procedure,
6308                                gimp_param_spec_image_id ("image",
6309                                                          "image",
6310                                                          "Input image (unused)",
6311                                                          pdb->gimp, FALSE,
6312                                                          GIMP_PARAM_READWRITE));
6313   gimp_procedure_add_argument (procedure,
6314                                gimp_param_spec_drawable_id ("drawable",
6315                                                             "drawable",
6316                                                             "Input drawable",
6317                                                             pdb->gimp, FALSE,
6318                                                             GIMP_PARAM_READWRITE));
6319   gimp_procedure_add_argument (procedure,
6320                                g_param_spec_double ("horizontal",
6321                                                     "horizontal",
6322                                                     "Horizontal radius of gaussian blur (in pixels",
6323                                                     0.0, 500.0, 0.0,
6324                                                     GIMP_PARAM_READWRITE));
6325   gimp_procedure_add_argument (procedure,
6326                                g_param_spec_double ("vertical",
6327                                                     "vertical",
6328                                                     "Vertical radius of gaussian blur (in pixels",
6329                                                     0.0, 500.0, 0.0,
6330                                                     GIMP_PARAM_READWRITE));
6331   gimp_procedure_add_argument (procedure,
6332                                gimp_param_spec_int32 ("method",
6333                                                       "method",
6334                                                       "Blur method { IIR (0), RLE (1) }",
6335                                                       0, 1, 0,
6336                                                       GIMP_PARAM_READWRITE));
6337   gimp_pdb_register_procedure (pdb, procedure);
6338   g_object_unref (procedure);
6339 
6340   /*
6341    * gimp-plug-in-gauss-iir
6342    */
6343   procedure = gimp_procedure_new (plug_in_gauss_iir_invoker);
6344   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6345                                "plug-in-gauss-iir");
6346   gimp_procedure_set_static_strings (procedure,
6347                                      "plug-in-gauss-iir",
6348                                      "Apply a gaussian blur",
6349                                      "Applies a gaussian blur to the drawable, with specified radius of affect. The standard deviation of the normal distribution used to modify pixel values is calculated based on the supplied radius. Horizontal and vertical blurring can be independently invoked by specifying only one to run.",
6350                                      "Compatibility procedure. Please see 'gegl:gaussian-blur' for credits.",
6351                                      "Compatibility procedure. Please see 'gegl:gaussian-blur' for credits.",
6352                                      "2014",
6353                                      NULL);
6354   gimp_procedure_add_argument (procedure,
6355                                g_param_spec_enum ("run-mode",
6356                                                   "run mode",
6357                                                   "The run mode",
6358                                                   GIMP_TYPE_RUN_MODE,
6359                                                   GIMP_RUN_INTERACTIVE,
6360                                                   GIMP_PARAM_READWRITE));
6361   gimp_procedure_add_argument (procedure,
6362                                gimp_param_spec_image_id ("image",
6363                                                          "image",
6364                                                          "Input image (unused)",
6365                                                          pdb->gimp, FALSE,
6366                                                          GIMP_PARAM_READWRITE));
6367   gimp_procedure_add_argument (procedure,
6368                                gimp_param_spec_drawable_id ("drawable",
6369                                                             "drawable",
6370                                                             "Input drawable",
6371                                                             pdb->gimp, FALSE,
6372                                                             GIMP_PARAM_READWRITE));
6373   gimp_procedure_add_argument (procedure,
6374                                g_param_spec_double ("radius",
6375                                                     "radius",
6376                                                     "Radius of gaussian blur (in pixels",
6377                                                     0.0, 500.0, 0.0,
6378                                                     GIMP_PARAM_READWRITE));
6379   gimp_procedure_add_argument (procedure,
6380                                g_param_spec_boolean ("horizontal",
6381                                                      "horizontal",
6382                                                      "Blur in horizontal direction",
6383                                                      FALSE,
6384                                                      GIMP_PARAM_READWRITE));
6385   gimp_procedure_add_argument (procedure,
6386                                g_param_spec_boolean ("vertical",
6387                                                      "vertical",
6388                                                      "Blur in vertical direction",
6389                                                      FALSE,
6390                                                      GIMP_PARAM_READWRITE));
6391   gimp_pdb_register_procedure (pdb, procedure);
6392   g_object_unref (procedure);
6393 
6394   /*
6395    * gimp-plug-in-gauss-iir2
6396    */
6397   procedure = gimp_procedure_new (plug_in_gauss_iir2_invoker);
6398   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6399                                "plug-in-gauss-iir2");
6400   gimp_procedure_set_static_strings (procedure,
6401                                      "plug-in-gauss-iir2",
6402                                      "Apply a gaussian blur",
6403                                      "Applies a gaussian blur to the drawable, with specified radius of affect. The standard deviation of the normal distribution used to modify pixel values is calculated based on the supplied radius. Horizontal and vertical blurring can be independently invoked by specifying only one to run.",
6404                                      "Compatibility procedure. Please see 'gegl:gaussian-blur' for credits.",
6405                                      "Compatibility procedure. Please see 'gegl:gaussian-blur' for credits.",
6406                                      "2014",
6407                                      NULL);
6408   gimp_procedure_add_argument (procedure,
6409                                g_param_spec_enum ("run-mode",
6410                                                   "run mode",
6411                                                   "The run mode",
6412                                                   GIMP_TYPE_RUN_MODE,
6413                                                   GIMP_RUN_INTERACTIVE,
6414                                                   GIMP_PARAM_READWRITE));
6415   gimp_procedure_add_argument (procedure,
6416                                gimp_param_spec_image_id ("image",
6417                                                          "image",
6418                                                          "Input image (unused)",
6419                                                          pdb->gimp, FALSE,
6420                                                          GIMP_PARAM_READWRITE));
6421   gimp_procedure_add_argument (procedure,
6422                                gimp_param_spec_drawable_id ("drawable",
6423                                                             "drawable",
6424                                                             "Input drawable",
6425                                                             pdb->gimp, FALSE,
6426                                                             GIMP_PARAM_READWRITE));
6427   gimp_procedure_add_argument (procedure,
6428                                g_param_spec_double ("horizontal",
6429                                                     "horizontal",
6430                                                     "Horizontal radius of gaussian blur (in pixels",
6431                                                     0.0, 500.0, 0.0,
6432                                                     GIMP_PARAM_READWRITE));
6433   gimp_procedure_add_argument (procedure,
6434                                g_param_spec_double ("vertical",
6435                                                     "vertical",
6436                                                     "Vertical radius of gaussian blur (in pixels",
6437                                                     0.0, 500.0, 0.0,
6438                                                     GIMP_PARAM_READWRITE));
6439   gimp_pdb_register_procedure (pdb, procedure);
6440   g_object_unref (procedure);
6441 
6442   /*
6443    * gimp-plug-in-gauss-rle
6444    */
6445   procedure = gimp_procedure_new (plug_in_gauss_rle_invoker);
6446   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6447                                "plug-in-gauss-rle");
6448   gimp_procedure_set_static_strings (procedure,
6449                                      "plug-in-gauss-rle",
6450                                      "Apply a gaussian blur",
6451                                      "Applies a gaussian blur to the drawable, with specified radius of affect. The standard deviation of the normal distribution used to modify pixel values is calculated based on the supplied radius. Horizontal and vertical blurring can be independently invoked by specifying only one to run.",
6452                                      "Compatibility procedure. Please see 'gegl:gaussian-blur' for credits.",
6453                                      "Compatibility procedure. Please see 'gegl:gaussian-blur' for credits.",
6454                                      "2014",
6455                                      NULL);
6456   gimp_procedure_add_argument (procedure,
6457                                g_param_spec_enum ("run-mode",
6458                                                   "run mode",
6459                                                   "The run mode",
6460                                                   GIMP_TYPE_RUN_MODE,
6461                                                   GIMP_RUN_INTERACTIVE,
6462                                                   GIMP_PARAM_READWRITE));
6463   gimp_procedure_add_argument (procedure,
6464                                gimp_param_spec_image_id ("image",
6465                                                          "image",
6466                                                          "Input image (unused)",
6467                                                          pdb->gimp, FALSE,
6468                                                          GIMP_PARAM_READWRITE));
6469   gimp_procedure_add_argument (procedure,
6470                                gimp_param_spec_drawable_id ("drawable",
6471                                                             "drawable",
6472                                                             "Input drawable",
6473                                                             pdb->gimp, FALSE,
6474                                                             GIMP_PARAM_READWRITE));
6475   gimp_procedure_add_argument (procedure,
6476                                g_param_spec_double ("radius",
6477                                                     "radius",
6478                                                     "Radius of gaussian blur (in pixels",
6479                                                     0.0, 500.0, 0.0,
6480                                                     GIMP_PARAM_READWRITE));
6481   gimp_procedure_add_argument (procedure,
6482                                g_param_spec_boolean ("horizontal",
6483                                                      "horizontal",
6484                                                      "Blur in horizontal direction",
6485                                                      FALSE,
6486                                                      GIMP_PARAM_READWRITE));
6487   gimp_procedure_add_argument (procedure,
6488                                g_param_spec_boolean ("vertical",
6489                                                      "vertical",
6490                                                      "Blur in vertical direction",
6491                                                      FALSE,
6492                                                      GIMP_PARAM_READWRITE));
6493   gimp_pdb_register_procedure (pdb, procedure);
6494   g_object_unref (procedure);
6495 
6496   /*
6497    * gimp-plug-in-gauss-rle2
6498    */
6499   procedure = gimp_procedure_new (plug_in_gauss_rle2_invoker);
6500   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6501                                "plug-in-gauss-rle2");
6502   gimp_procedure_set_static_strings (procedure,
6503                                      "plug-in-gauss-rle2",
6504                                      "Apply a gaussian blur",
6505                                      "Applies a gaussian blur to the drawable, with specified radius of affect. The standard deviation of the normal distribution used to modify pixel values is calculated based on the supplied radius. Horizontal and vertical blurring can be independently invoked by specifying only one to run.",
6506                                      "Compatibility procedure. Please see 'gegl:gaussian-blur' for credits.",
6507                                      "Compatibility procedure. Please see 'gegl:gaussian-blur' for credits.",
6508                                      "2014",
6509                                      NULL);
6510   gimp_procedure_add_argument (procedure,
6511                                g_param_spec_enum ("run-mode",
6512                                                   "run mode",
6513                                                   "The run mode",
6514                                                   GIMP_TYPE_RUN_MODE,
6515                                                   GIMP_RUN_INTERACTIVE,
6516                                                   GIMP_PARAM_READWRITE));
6517   gimp_procedure_add_argument (procedure,
6518                                gimp_param_spec_image_id ("image",
6519                                                          "image",
6520                                                          "Input image (unused)",
6521                                                          pdb->gimp, FALSE,
6522                                                          GIMP_PARAM_READWRITE));
6523   gimp_procedure_add_argument (procedure,
6524                                gimp_param_spec_drawable_id ("drawable",
6525                                                             "drawable",
6526                                                             "Input drawable",
6527                                                             pdb->gimp, FALSE,
6528                                                             GIMP_PARAM_READWRITE));
6529   gimp_procedure_add_argument (procedure,
6530                                g_param_spec_double ("horizontal",
6531                                                     "horizontal",
6532                                                     "Horizontal radius of gaussian blur (in pixels",
6533                                                     0.0, 500.0, 0.0,
6534                                                     GIMP_PARAM_READWRITE));
6535   gimp_procedure_add_argument (procedure,
6536                                g_param_spec_double ("vertical",
6537                                                     "vertical",
6538                                                     "Vertical radius of gaussian blur (in pixels",
6539                                                     0.0, 500.0, 0.0,
6540                                                     GIMP_PARAM_READWRITE));
6541   gimp_pdb_register_procedure (pdb, procedure);
6542   g_object_unref (procedure);
6543 
6544   /*
6545    * gimp-plug-in-glasstile
6546    */
6547   procedure = gimp_procedure_new (plug_in_glasstile_invoker);
6548   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6549                                "plug-in-glasstile");
6550   gimp_procedure_set_static_strings (procedure,
6551                                      "plug-in-glasstile",
6552                                      "Simulate distortion caused by square glass tiles",
6553                                      "Divide the image into square glassblocks in which the image is refracted.",
6554                                      "Compatibility procedure. Please see 'gegl:tile-glass' for credits.",
6555                                      "Compatibility procedure. Please see 'gegl:tile-glass' for credits.",
6556                                      "2014",
6557                                      NULL);
6558   gimp_procedure_add_argument (procedure,
6559                                g_param_spec_enum ("run-mode",
6560                                                   "run mode",
6561                                                   "The run mode",
6562                                                   GIMP_TYPE_RUN_MODE,
6563                                                   GIMP_RUN_INTERACTIVE,
6564                                                   GIMP_PARAM_READWRITE));
6565   gimp_procedure_add_argument (procedure,
6566                                gimp_param_spec_image_id ("image",
6567                                                          "image",
6568                                                          "Input image (unused)",
6569                                                          pdb->gimp, FALSE,
6570                                                          GIMP_PARAM_READWRITE));
6571   gimp_procedure_add_argument (procedure,
6572                                gimp_param_spec_drawable_id ("drawable",
6573                                                             "drawable",
6574                                                             "Input drawable",
6575                                                             pdb->gimp, FALSE,
6576                                                             GIMP_PARAM_READWRITE));
6577   gimp_procedure_add_argument (procedure,
6578                                gimp_param_spec_int32 ("tilex",
6579                                                       "tilex",
6580                                                       "Tile width",
6581                                                       10, 500, 10,
6582                                                       GIMP_PARAM_READWRITE));
6583   gimp_procedure_add_argument (procedure,
6584                                gimp_param_spec_int32 ("tiley",
6585                                                       "tiley",
6586                                                       "Tile height",
6587                                                       10, 500, 10,
6588                                                       GIMP_PARAM_READWRITE));
6589   gimp_pdb_register_procedure (pdb, procedure);
6590   g_object_unref (procedure);
6591 
6592   /*
6593    * gimp-plug-in-hsv-noise
6594    */
6595   procedure = gimp_procedure_new (plug_in_hsv_noise_invoker);
6596   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6597                                "plug-in-hsv-noise");
6598   gimp_procedure_set_static_strings (procedure,
6599                                      "plug-in-hsv-noise",
6600                                      "Randomize hue, saturation and value independently",
6601                                      "Scattering pixel values in HSV space",
6602                                      "Compatibility procedure. Please see 'gegl:noise-hsv' for credits.",
6603                                      "Compatibility procedure. Please see 'gegl:noise-hsv' for credits.",
6604                                      "2013",
6605                                      NULL);
6606   gimp_procedure_add_argument (procedure,
6607                                g_param_spec_enum ("run-mode",
6608                                                   "run mode",
6609                                                   "The run mode",
6610                                                   GIMP_TYPE_RUN_MODE,
6611                                                   GIMP_RUN_INTERACTIVE,
6612                                                   GIMP_PARAM_READWRITE));
6613   gimp_procedure_add_argument (procedure,
6614                                gimp_param_spec_image_id ("image",
6615                                                          "image",
6616                                                          "Input image (unused)",
6617                                                          pdb->gimp, FALSE,
6618                                                          GIMP_PARAM_READWRITE));
6619   gimp_procedure_add_argument (procedure,
6620                                gimp_param_spec_drawable_id ("drawable",
6621                                                             "drawable",
6622                                                             "Input drawable",
6623                                                             pdb->gimp, FALSE,
6624                                                             GIMP_PARAM_READWRITE));
6625   gimp_procedure_add_argument (procedure,
6626                                gimp_param_spec_int32 ("holdness",
6627                                                       "holdness",
6628                                                       "Convolution strength",
6629                                                       1, 8, 1,
6630                                                       GIMP_PARAM_READWRITE));
6631   gimp_procedure_add_argument (procedure,
6632                                gimp_param_spec_int32 ("hue-distance",
6633                                                       "hue distance",
6634                                                       "Scattering of hue angle",
6635                                                       0, 180, 0,
6636                                                       GIMP_PARAM_READWRITE));
6637   gimp_procedure_add_argument (procedure,
6638                                gimp_param_spec_int32 ("saturation-distance",
6639                                                       "saturation distance",
6640                                                       "Distribution distance on saturation axis",
6641                                                       0, 255, 0,
6642                                                       GIMP_PARAM_READWRITE));
6643   gimp_procedure_add_argument (procedure,
6644                                gimp_param_spec_int32 ("value-distance",
6645                                                       "value distance",
6646                                                       "Distribution distance on value axis",
6647                                                       0, 255, 0,
6648                                                       GIMP_PARAM_READWRITE));
6649   gimp_pdb_register_procedure (pdb, procedure);
6650   g_object_unref (procedure);
6651 
6652   /*
6653    * gimp-plug-in-icc-profile-info
6654    */
6655   procedure = gimp_procedure_new (plug_in_icc_profile_info_invoker);
6656   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6657                                "plug-in-icc-profile-info");
6658   gimp_procedure_set_static_strings (procedure,
6659                                      "plug-in-icc-profile-info",
6660                                      "Retrieve information about an image's color profile",
6661                                      "This procedure returns information about the RGB color profile attached to an image. If no RGB color profile is attached, sRGB is assumed.",
6662                                      "Sven Neumann <sven@gimp.org>",
6663                                      "Sven Neumann",
6664                                      "2015",
6665                                      NULL);
6666   gimp_procedure_add_argument (procedure,
6667                                gimp_param_spec_image_id ("image",
6668                                                          "image",
6669                                                          "Input image",
6670                                                          pdb->gimp, FALSE,
6671                                                          GIMP_PARAM_READWRITE));
6672   gimp_procedure_add_return_value (procedure,
6673                                    gimp_param_spec_string ("profile-name",
6674                                                            "profile name",
6675                                                            "Name",
6676                                                            FALSE, FALSE, FALSE,
6677                                                            NULL,
6678                                                            GIMP_PARAM_READWRITE));
6679   gimp_procedure_add_return_value (procedure,
6680                                    gimp_param_spec_string ("profile-desc",
6681                                                            "profile desc",
6682                                                            "Description",
6683                                                            FALSE, FALSE, FALSE,
6684                                                            NULL,
6685                                                            GIMP_PARAM_READWRITE));
6686   gimp_procedure_add_return_value (procedure,
6687                                    gimp_param_spec_string ("profile-info",
6688                                                            "profile info",
6689                                                            "Info",
6690                                                            FALSE, FALSE, FALSE,
6691                                                            NULL,
6692                                                            GIMP_PARAM_READWRITE));
6693   gimp_pdb_register_procedure (pdb, procedure);
6694   g_object_unref (procedure);
6695 
6696   /*
6697    * gimp-plug-in-icc-profile-file-info
6698    */
6699   procedure = gimp_procedure_new (plug_in_icc_profile_file_info_invoker);
6700   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6701                                "plug-in-icc-profile-file-info");
6702   gimp_procedure_set_static_strings (procedure,
6703                                      "plug-in-icc-profile-file-info",
6704                                      "Retrieve information about a color profile",
6705                                      "This procedure returns information about an ICC color profile on disk.",
6706                                      "Sven Neumann <sven@gimp.org>",
6707                                      "Sven Neumann",
6708                                      "2015",
6709                                      NULL);
6710   gimp_procedure_add_argument (procedure,
6711                                gimp_param_spec_string ("profile",
6712                                                        "profile",
6713                                                        "Filename of an ICC color profile",
6714                                                        TRUE, FALSE, FALSE,
6715                                                        NULL,
6716                                                        GIMP_PARAM_READWRITE));
6717   gimp_procedure_add_return_value (procedure,
6718                                    gimp_param_spec_string ("profile-name",
6719                                                            "profile name",
6720                                                            "Name",
6721                                                            FALSE, FALSE, FALSE,
6722                                                            NULL,
6723                                                            GIMP_PARAM_READWRITE));
6724   gimp_procedure_add_return_value (procedure,
6725                                    gimp_param_spec_string ("profile-desc",
6726                                                            "profile desc",
6727                                                            "Description",
6728                                                            FALSE, FALSE, FALSE,
6729                                                            NULL,
6730                                                            GIMP_PARAM_READWRITE));
6731   gimp_procedure_add_return_value (procedure,
6732                                    gimp_param_spec_string ("profile-info",
6733                                                            "profile info",
6734                                                            "Info",
6735                                                            FALSE, FALSE, FALSE,
6736                                                            NULL,
6737                                                            GIMP_PARAM_READWRITE));
6738   gimp_pdb_register_procedure (pdb, procedure);
6739   g_object_unref (procedure);
6740 
6741   /*
6742    * gimp-plug-in-icc-profile-apply
6743    */
6744   procedure = gimp_procedure_new (plug_in_icc_profile_apply_invoker);
6745   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6746                                "plug-in-icc-profile-apply");
6747   gimp_procedure_set_static_strings (procedure,
6748                                      "plug-in-icc-profile-apply",
6749                                      "Apply a color profile on the image",
6750                                      "This procedure transform from the image's color profile (or the default RGB profile if none is set) to the given ICC color profile. Only RGB color profiles are accepted. The profile is then set on the image using the 'icc-profile' \"parasite.",
6751                                      "Sven Neumann <sven@gimp.org>",
6752                                      "Sven Neumann",
6753                                      "2015",
6754                                      NULL);
6755   gimp_procedure_add_argument (procedure,
6756                                g_param_spec_enum ("run-mode",
6757                                                   "run mode",
6758                                                   "The run mode",
6759                                                   GIMP_TYPE_RUN_MODE,
6760                                                   GIMP_RUN_INTERACTIVE,
6761                                                   GIMP_PARAM_READWRITE));
6762   gimp_procedure_add_argument (procedure,
6763                                gimp_param_spec_image_id ("image",
6764                                                          "image",
6765                                                          "Input image",
6766                                                          pdb->gimp, FALSE,
6767                                                          GIMP_PARAM_READWRITE));
6768   gimp_procedure_add_argument (procedure,
6769                                gimp_param_spec_string ("profile",
6770                                                        "profile",
6771                                                        "Filename of an ICC color profile",
6772                                                        TRUE, FALSE, FALSE,
6773                                                        NULL,
6774                                                        GIMP_PARAM_READWRITE));
6775   gimp_procedure_add_argument (procedure,
6776                                g_param_spec_enum ("intent",
6777                                                   "intent",
6778                                                   "Rendering intent",
6779                                                   GIMP_TYPE_COLOR_RENDERING_INTENT,
6780                                                   GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
6781                                                   GIMP_PARAM_READWRITE));
6782   gimp_procedure_add_argument (procedure,
6783                                g_param_spec_boolean ("bpc",
6784                                                      "bpc",
6785                                                      "Black point compensation",
6786                                                      FALSE,
6787                                                      GIMP_PARAM_READWRITE));
6788   gimp_pdb_register_procedure (pdb, procedure);
6789   g_object_unref (procedure);
6790 
6791   /*
6792    * gimp-plug-in-icc-profile-apply-rgb
6793    */
6794   procedure = gimp_procedure_new (plug_in_icc_profile_apply_rgb_invoker);
6795   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6796                                "plug-in-icc-profile-apply-rgb");
6797   gimp_procedure_set_static_strings (procedure,
6798                                      "plug-in-icc-profile-apply-rgb",
6799                                      "Apply default RGB color profile on the image",
6800                                      "This procedure transform from the image's color profile (or the default RGB profile if none is set) to the configured default RGB color profile. The profile is then set on the image using the 'icc-profile' parasite. If no RGB color profile is configured, sRGB is assumed and the parasite is unset.",
6801                                      "Sven Neumann <sven@gimp.org>",
6802                                      "Sven Neumann",
6803                                      "2015",
6804                                      NULL);
6805   gimp_procedure_add_argument (procedure,
6806                                g_param_spec_enum ("run-mode",
6807                                                   "run mode",
6808                                                   "The run mode",
6809                                                   GIMP_TYPE_RUN_MODE,
6810                                                   GIMP_RUN_INTERACTIVE,
6811                                                   GIMP_PARAM_READWRITE));
6812   gimp_procedure_add_argument (procedure,
6813                                gimp_param_spec_image_id ("image",
6814                                                          "image",
6815                                                          "Input image",
6816                                                          pdb->gimp, FALSE,
6817                                                          GIMP_PARAM_READWRITE));
6818   gimp_procedure_add_argument (procedure,
6819                                g_param_spec_enum ("intent",
6820                                                   "intent",
6821                                                   "Rendering intent",
6822                                                   GIMP_TYPE_COLOR_RENDERING_INTENT,
6823                                                   GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
6824                                                   GIMP_PARAM_READWRITE));
6825   gimp_procedure_add_argument (procedure,
6826                                g_param_spec_boolean ("bpc",
6827                                                      "bpc",
6828                                                      "Black point compensation",
6829                                                      FALSE,
6830                                                      GIMP_PARAM_READWRITE));
6831   gimp_pdb_register_procedure (pdb, procedure);
6832   g_object_unref (procedure);
6833 
6834   /*
6835    * gimp-plug-in-icc-profile-set
6836    */
6837   procedure = gimp_procedure_new (plug_in_icc_profile_set_invoker);
6838   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6839                                "plug-in-icc-profile-set");
6840   gimp_procedure_set_static_strings (procedure,
6841                                      "plug-in-icc-profile-set",
6842                                      "Set a color profile on the image",
6843                                      "This procedure sets the user-configured RGB profile on an image using the 'icc-profile' parasite. This procedure does not do any color conversion.",
6844                                      "Sven Neumann <sven@gimp.org>",
6845                                      "Sven Neumann",
6846                                      "2015",
6847                                      NULL);
6848   gimp_procedure_add_argument (procedure,
6849                                g_param_spec_enum ("run-mode",
6850                                                   "run mode",
6851                                                   "The run mode",
6852                                                   GIMP_TYPE_RUN_MODE,
6853                                                   GIMP_RUN_INTERACTIVE,
6854                                                   GIMP_PARAM_READWRITE));
6855   gimp_procedure_add_argument (procedure,
6856                                gimp_param_spec_image_id ("image",
6857                                                          "image",
6858                                                          "Input image",
6859                                                          pdb->gimp, FALSE,
6860                                                          GIMP_PARAM_READWRITE));
6861   gimp_procedure_add_argument (procedure,
6862                                gimp_param_spec_string ("profile",
6863                                                        "profile",
6864                                                        "Filename of an ICC color profile",
6865                                                        TRUE, FALSE, FALSE,
6866                                                        NULL,
6867                                                        GIMP_PARAM_READWRITE));
6868   gimp_pdb_register_procedure (pdb, procedure);
6869   g_object_unref (procedure);
6870 
6871   /*
6872    * gimp-plug-in-icc-profile-set-rgb
6873    */
6874   procedure = gimp_procedure_new (plug_in_icc_profile_set_rgb_invoker);
6875   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6876                                "plug-in-icc-profile-set-rgb");
6877   gimp_procedure_set_static_strings (procedure,
6878                                      "plug-in-icc-profile-set-rgb",
6879                                      "Set the default RGB color profile on the image",
6880                                      "This procedure sets the user-configured RGB profile on an image using the 'icc-profile' parasite. If no RGB profile is configured, sRGB is assumed and the parasite is unset. This procedure does not do any color conversion.",
6881                                      "Sven Neumann <sven@gimp.org>",
6882                                      "Sven Neumann",
6883                                      "2015",
6884                                      NULL);
6885   gimp_procedure_add_argument (procedure,
6886                                g_param_spec_enum ("run-mode",
6887                                                   "run mode",
6888                                                   "The run mode",
6889                                                   GIMP_TYPE_RUN_MODE,
6890                                                   GIMP_RUN_INTERACTIVE,
6891                                                   GIMP_PARAM_READWRITE));
6892   gimp_procedure_add_argument (procedure,
6893                                gimp_param_spec_image_id ("image",
6894                                                          "image",
6895                                                          "Input image",
6896                                                          pdb->gimp, FALSE,
6897                                                          GIMP_PARAM_READWRITE));
6898   gimp_pdb_register_procedure (pdb, procedure);
6899   g_object_unref (procedure);
6900 
6901   /*
6902    * gimp-plug-in-illusion
6903    */
6904   procedure = gimp_procedure_new (plug_in_illusion_invoker);
6905   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6906                                "plug-in-illusion");
6907   gimp_procedure_set_static_strings (procedure,
6908                                      "plug-in-illusion",
6909                                      "Superimpose many altered copies of the image",
6910                                      "Produce illusion.",
6911                                      "Compatibility procedure. Please see 'gegl:illusion' for credits.",
6912                                      "Compatibility procedure. Please see 'gegl:illusion' for credits.",
6913                                      "2014",
6914                                      NULL);
6915   gimp_procedure_add_argument (procedure,
6916                                g_param_spec_enum ("run-mode",
6917                                                   "run mode",
6918                                                   "The run mode",
6919                                                   GIMP_TYPE_RUN_MODE,
6920                                                   GIMP_RUN_INTERACTIVE,
6921                                                   GIMP_PARAM_READWRITE));
6922   gimp_procedure_add_argument (procedure,
6923                                gimp_param_spec_image_id ("image",
6924                                                          "image",
6925                                                          "Input image (unused)",
6926                                                          pdb->gimp, FALSE,
6927                                                          GIMP_PARAM_READWRITE));
6928   gimp_procedure_add_argument (procedure,
6929                                gimp_param_spec_drawable_id ("drawable",
6930                                                             "drawable",
6931                                                             "Input drawable",
6932                                                             pdb->gimp, FALSE,
6933                                                             GIMP_PARAM_READWRITE));
6934   gimp_procedure_add_argument (procedure,
6935                                gimp_param_spec_int32 ("division",
6936                                                       "division",
6937                                                       "The number of divisions",
6938                                                       0, 64, 0,
6939                                                       GIMP_PARAM_READWRITE));
6940   gimp_procedure_add_argument (procedure,
6941                                gimp_param_spec_int32 ("type",
6942                                                       "type",
6943                                                       "Illusion type { TYPE1 (0), TYPE2 (1) }",
6944                                                       0, 1, 0,
6945                                                       GIMP_PARAM_READWRITE));
6946   gimp_pdb_register_procedure (pdb, procedure);
6947   g_object_unref (procedure);
6948 
6949   /*
6950    * gimp-plug-in-laplace
6951    */
6952   procedure = gimp_procedure_new (plug_in_laplace_invoker);
6953   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6954                                "plug-in-laplace");
6955   gimp_procedure_set_static_strings (procedure,
6956                                      "plug-in-laplace",
6957                                      "High-resolution edge detection",
6958                                      "This plug-in creates one-pixel wide edges from the image, with the value proportional to the gradient. It uses the Laplace operator (a 3x3 kernel with -8 in the middle). The image has to be laplacered to get useful results, a gauss_iir with 1.5 - 5.0 depending on the noise in the image is best.",
6959                                      "Compatibility procedure. Please see 'gegl:edge-laplace' for credits.",
6960                                      "Compatibility procedure. Please see 'gegl:edge-laplace' for credits.",
6961                                      "2013",
6962                                      NULL);
6963   gimp_procedure_add_argument (procedure,
6964                                g_param_spec_enum ("run-mode",
6965                                                   "run mode",
6966                                                   "The run mode",
6967                                                   GIMP_TYPE_RUN_MODE,
6968                                                   GIMP_RUN_INTERACTIVE,
6969                                                   GIMP_PARAM_READWRITE));
6970   gimp_procedure_add_argument (procedure,
6971                                gimp_param_spec_image_id ("image",
6972                                                          "image",
6973                                                          "Input image (unused)",
6974                                                          pdb->gimp, FALSE,
6975                                                          GIMP_PARAM_READWRITE));
6976   gimp_procedure_add_argument (procedure,
6977                                gimp_param_spec_drawable_id ("drawable",
6978                                                             "drawable",
6979                                                             "Input drawable",
6980                                                             pdb->gimp, FALSE,
6981                                                             GIMP_PARAM_READWRITE));
6982   gimp_pdb_register_procedure (pdb, procedure);
6983   g_object_unref (procedure);
6984 
6985   /*
6986    * gimp-plug-in-lens-distortion
6987    */
6988   procedure = gimp_procedure_new (plug_in_lens_distortion_invoker);
6989   gimp_object_set_static_name (GIMP_OBJECT (procedure),
6990                                "plug-in-lens-distortion");
6991   gimp_procedure_set_static_strings (procedure,
6992                                      "plug-in-lens-distortion",
6993                                      "Corrects lens distortion",
6994                                      "Corrects barrel or pincushion lens distortion.",
6995                                      "Compatibility procedure. Please see 'gegl:lens-distortion' for credits.",
6996                                      "Compatibility procedure. Please see 'gegl:lens-distortion' for credits.",
6997                                      "2013",
6998                                      NULL);
6999   gimp_procedure_add_argument (procedure,
7000                                g_param_spec_enum ("run-mode",
7001                                                   "run mode",
7002                                                   "The run mode",
7003                                                   GIMP_TYPE_RUN_MODE,
7004                                                   GIMP_RUN_INTERACTIVE,
7005                                                   GIMP_PARAM_READWRITE));
7006   gimp_procedure_add_argument (procedure,
7007                                gimp_param_spec_image_id ("image",
7008                                                          "image",
7009                                                          "Input image (unused)",
7010                                                          pdb->gimp, FALSE,
7011                                                          GIMP_PARAM_READWRITE));
7012   gimp_procedure_add_argument (procedure,
7013                                gimp_param_spec_drawable_id ("drawable",
7014                                                             "drawable",
7015                                                             "Input drawable",
7016                                                             pdb->gimp, FALSE,
7017                                                             GIMP_PARAM_READWRITE));
7018   gimp_procedure_add_argument (procedure,
7019                                g_param_spec_double ("offset-x",
7020                                                     "offset x",
7021                                                     "Effect centre offset in X",
7022                                                     -100, 100, -100,
7023                                                     GIMP_PARAM_READWRITE));
7024   gimp_procedure_add_argument (procedure,
7025                                g_param_spec_double ("offset-y",
7026                                                     "offset y",
7027                                                     "Effect centre offset in Y",
7028                                                     -100, 100, -100,
7029                                                     GIMP_PARAM_READWRITE));
7030   gimp_procedure_add_argument (procedure,
7031                                g_param_spec_double ("main-adjust",
7032                                                     "main adjust",
7033                                                     "Amount of second-order distortion",
7034                                                     -100, 100, -100,
7035                                                     GIMP_PARAM_READWRITE));
7036   gimp_procedure_add_argument (procedure,
7037                                g_param_spec_double ("edge-adjust",
7038                                                     "edge adjust",
7039                                                     "Amount of fourth-order distortion",
7040                                                     -100, 100, -100,
7041                                                     GIMP_PARAM_READWRITE));
7042   gimp_procedure_add_argument (procedure,
7043                                g_param_spec_double ("rescale",
7044                                                     "rescale",
7045                                                     "Rescale overall image size",
7046                                                     -100, 100, -100,
7047                                                     GIMP_PARAM_READWRITE));
7048   gimp_procedure_add_argument (procedure,
7049                                g_param_spec_double ("brighten",
7050                                                     "brighten",
7051                                                     "Adjust brightness in corners",
7052                                                     -100, 100, -100,
7053                                                     GIMP_PARAM_READWRITE));
7054   gimp_pdb_register_procedure (pdb, procedure);
7055   g_object_unref (procedure);
7056 
7057   /*
7058    * gimp-plug-in-make-seamless
7059    */
7060   procedure = gimp_procedure_new (plug_in_make_seamless_invoker);
7061   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7062                                "plug-in-make-seamless");
7063   gimp_procedure_set_static_strings (procedure,
7064                                      "plug-in-make-seamless",
7065                                      "Alters edges to make the image seamlessly tileable",
7066                                      "This plug-in creates a seamless tileable from the input drawable.",
7067                                      "Compatibility procedure. Please see 'gegl:tile-seamless' for credits.",
7068                                      "Compatibility procedure. Please see 'gegl:tile-seamless' for credits.",
7069                                      "2013",
7070                                      NULL);
7071   gimp_procedure_add_argument (procedure,
7072                                g_param_spec_enum ("run-mode",
7073                                                   "run mode",
7074                                                   "The run mode",
7075                                                   GIMP_TYPE_RUN_MODE,
7076                                                   GIMP_RUN_INTERACTIVE,
7077                                                   GIMP_PARAM_READWRITE));
7078   gimp_procedure_add_argument (procedure,
7079                                gimp_param_spec_image_id ("image",
7080                                                          "image",
7081                                                          "Input image (unused)",
7082                                                          pdb->gimp, FALSE,
7083                                                          GIMP_PARAM_READWRITE));
7084   gimp_procedure_add_argument (procedure,
7085                                gimp_param_spec_drawable_id ("drawable",
7086                                                             "drawable",
7087                                                             "Input drawable",
7088                                                             pdb->gimp, FALSE,
7089                                                             GIMP_PARAM_READWRITE));
7090   gimp_pdb_register_procedure (pdb, procedure);
7091   g_object_unref (procedure);
7092 
7093   /*
7094    * gimp-plug-in-maze
7095    */
7096   procedure = gimp_procedure_new (plug_in_maze_invoker);
7097   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7098                                "plug-in-maze");
7099   gimp_procedure_set_static_strings (procedure,
7100                                      "plug-in-maze",
7101                                      "Draw a labyrinth",
7102                                      "Generates a maze using either the depth-first search method or Prim's algorithm. Can make tileable mazes too.",
7103                                      "Compatibility procedure. Please see 'gegl:maze' for credits.",
7104                                      "Compatibility procedure. Please see 'gegl:maze' for credits.",
7105                                      "2015",
7106                                      NULL);
7107   gimp_procedure_add_argument (procedure,
7108                                g_param_spec_enum ("run-mode",
7109                                                   "run mode",
7110                                                   "The run mode",
7111                                                   GIMP_TYPE_RUN_MODE,
7112                                                   GIMP_RUN_INTERACTIVE,
7113                                                   GIMP_PARAM_READWRITE));
7114   gimp_procedure_add_argument (procedure,
7115                                gimp_param_spec_image_id ("image",
7116                                                          "image",
7117                                                          "Input image (unused)",
7118                                                          pdb->gimp, FALSE,
7119                                                          GIMP_PARAM_READWRITE));
7120   gimp_procedure_add_argument (procedure,
7121                                gimp_param_spec_drawable_id ("drawable",
7122                                                             "drawable",
7123                                                             "Input drawable",
7124                                                             pdb->gimp, FALSE,
7125                                                             GIMP_PARAM_READWRITE));
7126   gimp_procedure_add_argument (procedure,
7127                                gimp_param_spec_int16 ("width",
7128                                                       "width",
7129                                                       "Width of the passages",
7130                                                       1, 1024, 1,
7131                                                       GIMP_PARAM_READWRITE));
7132   gimp_procedure_add_argument (procedure,
7133                                gimp_param_spec_int16 ("height",
7134                                                       "height",
7135                                                       "Height of the passages",
7136                                                       1, 1024, 1,
7137                                                       GIMP_PARAM_READWRITE));
7138   gimp_procedure_add_argument (procedure,
7139                                gimp_param_spec_int8 ("tileable",
7140                                                      "tileable",
7141                                                      "Tileable maze? (TRUE or FALSE)",
7142                                                      0, 1, 0,
7143                                                      GIMP_PARAM_READWRITE));
7144   gimp_procedure_add_argument (procedure,
7145                                gimp_param_spec_int8 ("algorithm",
7146                                                      "algorithm",
7147                                                      "Generation algorithm (0 = DEPTH FIRST, 1 = PRIM'S ALGORITHM)",
7148                                                      0, 1, 0,
7149                                                      GIMP_PARAM_READWRITE));
7150   gimp_procedure_add_argument (procedure,
7151                                gimp_param_spec_int32 ("seed",
7152                                                       "seed",
7153                                                       "Random Seed",
7154                                                       G_MININT32, G_MAXINT32, 0,
7155                                                       GIMP_PARAM_READWRITE));
7156   gimp_procedure_add_argument (procedure,
7157                                gimp_param_spec_int16 ("multiple",
7158                                                       "multiple",
7159                                                       "Multiple (use 57)",
7160                                                       G_MININT16, G_MAXINT16, 0,
7161                                                       GIMP_PARAM_READWRITE));
7162   gimp_procedure_add_argument (procedure,
7163                                gimp_param_spec_int16 ("offset",
7164                                                       "offset",
7165                                                       "Offset (use 1)",
7166                                                       G_MININT16, G_MAXINT16, 0,
7167                                                       GIMP_PARAM_READWRITE));
7168   gimp_pdb_register_procedure (pdb, procedure);
7169   g_object_unref (procedure);
7170 
7171   /*
7172    * gimp-plug-in-mblur
7173    */
7174   procedure = gimp_procedure_new (plug_in_mblur_invoker);
7175   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7176                                "plug-in-mblur");
7177   gimp_procedure_set_static_strings (procedure,
7178                                      "plug-in-mblur",
7179                                      "Simulate movement using directional blur",
7180                                      "This plug-in simulates the effect seen when photographing a moving object at a slow shutter speed. Done by adding multiple displaced copies.",
7181                                      "Compatibility procedure. Please see 'gegl:motion-blur-linear, -zoom, -cirular' for credits.",
7182                                      "Compatibility procedure. Please see 'gegl:motion-blur-linear, -zoom, -cirular' for credits.",
7183                                      "2013",
7184                                      NULL);
7185   gimp_procedure_add_argument (procedure,
7186                                g_param_spec_enum ("run-mode",
7187                                                   "run mode",
7188                                                   "The run mode",
7189                                                   GIMP_TYPE_RUN_MODE,
7190                                                   GIMP_RUN_INTERACTIVE,
7191                                                   GIMP_PARAM_READWRITE));
7192   gimp_procedure_add_argument (procedure,
7193                                gimp_param_spec_image_id ("image",
7194                                                          "image",
7195                                                          "Input image (unused)",
7196                                                          pdb->gimp, FALSE,
7197                                                          GIMP_PARAM_READWRITE));
7198   gimp_procedure_add_argument (procedure,
7199                                gimp_param_spec_drawable_id ("drawable",
7200                                                             "drawable",
7201                                                             "Input drawable",
7202                                                             pdb->gimp, FALSE,
7203                                                             GIMP_PARAM_READWRITE));
7204   gimp_procedure_add_argument (procedure,
7205                                gimp_param_spec_int32 ("type",
7206                                                       "type",
7207                                                       "Type of motion blur { LINEAR (0), RADIAL (1), ZOOM (2) }",
7208                                                       0, 2, 0,
7209                                                       GIMP_PARAM_READWRITE));
7210   gimp_procedure_add_argument (procedure,
7211                                g_param_spec_double ("length",
7212                                                     "length",
7213                                                     "Length",
7214                                                     -G_MAXDOUBLE, G_MAXDOUBLE, 0,
7215                                                     GIMP_PARAM_READWRITE));
7216   gimp_procedure_add_argument (procedure,
7217                                g_param_spec_double ("angle",
7218                                                     "angle",
7219                                                     "Angle",
7220                                                     0, 360, 0,
7221                                                     GIMP_PARAM_READWRITE));
7222   gimp_procedure_add_argument (procedure,
7223                                g_param_spec_double ("center-x",
7224                                                     "center x",
7225                                                     "Center X",
7226                                                     -G_MAXDOUBLE, G_MAXDOUBLE, 0,
7227                                                     GIMP_PARAM_READWRITE));
7228   gimp_procedure_add_argument (procedure,
7229                                g_param_spec_double ("center-y",
7230                                                     "center y",
7231                                                     "Center Y",
7232                                                     -G_MAXDOUBLE, G_MAXDOUBLE, 0,
7233                                                     GIMP_PARAM_READWRITE));
7234   gimp_pdb_register_procedure (pdb, procedure);
7235   g_object_unref (procedure);
7236 
7237   /*
7238    * gimp-plug-in-mblur-inward
7239    */
7240   procedure = gimp_procedure_new (plug_in_mblur_inward_invoker);
7241   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7242                                "plug-in-mblur-inward");
7243   gimp_procedure_set_static_strings (procedure,
7244                                      "plug-in-mblur-inward",
7245                                      "Simulate movement using directional blur",
7246                                      "This procedure is equivalent to plug-in-mblur but performs the zoom blur inward instead of outward.",
7247                                      "Compatibility procedure. Please see 'gegl:motion-blur-linear, -zoom, -cirular' for credits.",
7248                                      "Compatibility procedure. Please see 'gegl:motion-blur-linear, -zoom, -cirular' for credits.",
7249                                      "2013",
7250                                      NULL);
7251   gimp_procedure_add_argument (procedure,
7252                                g_param_spec_enum ("run-mode",
7253                                                   "run mode",
7254                                                   "The run mode",
7255                                                   GIMP_TYPE_RUN_MODE,
7256                                                   GIMP_RUN_INTERACTIVE,
7257                                                   GIMP_PARAM_READWRITE));
7258   gimp_procedure_add_argument (procedure,
7259                                gimp_param_spec_image_id ("image",
7260                                                          "image",
7261                                                          "Input image (unused)",
7262                                                          pdb->gimp, FALSE,
7263                                                          GIMP_PARAM_READWRITE));
7264   gimp_procedure_add_argument (procedure,
7265                                gimp_param_spec_drawable_id ("drawable",
7266                                                             "drawable",
7267                                                             "Input drawable",
7268                                                             pdb->gimp, FALSE,
7269                                                             GIMP_PARAM_READWRITE));
7270   gimp_procedure_add_argument (procedure,
7271                                gimp_param_spec_int32 ("type",
7272                                                       "type",
7273                                                       "Type of motion blur { LINEAR (0), RADIAL (1), ZOOM (2) }",
7274                                                       0, 2, 0,
7275                                                       GIMP_PARAM_READWRITE));
7276   gimp_procedure_add_argument (procedure,
7277                                g_param_spec_double ("length",
7278                                                     "length",
7279                                                     "Length",
7280                                                     -G_MAXDOUBLE, G_MAXDOUBLE, 0,
7281                                                     GIMP_PARAM_READWRITE));
7282   gimp_procedure_add_argument (procedure,
7283                                g_param_spec_double ("angle",
7284                                                     "angle",
7285                                                     "Angle",
7286                                                     0, 360, 0,
7287                                                     GIMP_PARAM_READWRITE));
7288   gimp_procedure_add_argument (procedure,
7289                                g_param_spec_double ("center-x",
7290                                                     "center x",
7291                                                     "Center X",
7292                                                     -G_MAXDOUBLE, G_MAXDOUBLE, 0,
7293                                                     GIMP_PARAM_READWRITE));
7294   gimp_procedure_add_argument (procedure,
7295                                g_param_spec_double ("center-y",
7296                                                     "center y",
7297                                                     "Center Y",
7298                                                     -G_MAXDOUBLE, G_MAXDOUBLE, 0,
7299                                                     GIMP_PARAM_READWRITE));
7300   gimp_pdb_register_procedure (pdb, procedure);
7301   g_object_unref (procedure);
7302 
7303   /*
7304    * gimp-plug-in-median-blur
7305    */
7306   procedure = gimp_procedure_new (plug_in_median_blur_invoker);
7307   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7308                                "plug-in-median-blur");
7309   gimp_procedure_set_static_strings (procedure,
7310                                      "plug-in-median-blur",
7311                                      "Blur using the median color near each pixel",
7312                                      "Blur resulting from computing the median color in the neighborhood of each pixel",
7313                                      "Compatibility procedure. Please see 'gegl:median-blur' for credits.",
7314                                      "Compatibility procedure. Please see 'gegl:median-blur' for credits.",
7315                                      "2021",
7316                                      NULL);
7317   gimp_procedure_add_argument (procedure,
7318                                g_param_spec_enum ("run-mode",
7319                                                   "run mode",
7320                                                   "The run mode",
7321                                                   GIMP_TYPE_RUN_MODE,
7322                                                   GIMP_RUN_INTERACTIVE,
7323                                                   GIMP_PARAM_READWRITE));
7324   gimp_procedure_add_argument (procedure,
7325                                gimp_param_spec_image_id ("image",
7326                                                          "image",
7327                                                          "Input image (unused)",
7328                                                          pdb->gimp, FALSE,
7329                                                          GIMP_PARAM_READWRITE));
7330   gimp_procedure_add_argument (procedure,
7331                                gimp_param_spec_drawable_id ("drawable",
7332                                                             "drawable",
7333                                                             "Input drawable",
7334                                                             pdb->gimp, FALSE,
7335                                                             GIMP_PARAM_READWRITE));
7336   gimp_procedure_add_argument (procedure,
7337                                gimp_param_spec_int32 ("radius",
7338                                                       "radius",
7339                                                       "Neighborhood radius, a negative value will calculate with inverted percentiles",
7340                                                       -400, 400, -400,
7341                                                       GIMP_PARAM_READWRITE));
7342   gimp_procedure_add_argument (procedure,
7343                                g_param_spec_double ("percentile",
7344                                                     "percentile",
7345                                                     "Neighborhood color percentile",
7346                                                     0, 100, 0,
7347                                                     GIMP_PARAM_READWRITE));
7348   gimp_pdb_register_procedure (pdb, procedure);
7349   g_object_unref (procedure);
7350 
7351   /*
7352    * gimp-plug-in-mosaic
7353    */
7354   procedure = gimp_procedure_new (plug_in_mosaic_invoker);
7355   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7356                                "plug-in-mosaic");
7357   gimp_procedure_set_static_strings (procedure,
7358                                      "plug-in-mosaic",
7359                                      "Convert the image into irregular tiles",
7360                                      "Mosaic is a filter which transforms an image into what appears to be a mosaic, composed of small primitives, each of constant color and of an approximate size.",
7361                                      "Compatibility procedure. Please see 'gegl:mosaic' for credits.",
7362                                      "Compatibility procedure. Please see 'gegl:mosaic' for credits.",
7363                                      "2013",
7364                                      NULL);
7365   gimp_procedure_add_argument (procedure,
7366                                g_param_spec_enum ("run-mode",
7367                                                   "run mode",
7368                                                   "The run mode",
7369                                                   GIMP_TYPE_RUN_MODE,
7370                                                   GIMP_RUN_INTERACTIVE,
7371                                                   GIMP_PARAM_READWRITE));
7372   gimp_procedure_add_argument (procedure,
7373                                gimp_param_spec_image_id ("image",
7374                                                          "image",
7375                                                          "Input image (unused)",
7376                                                          pdb->gimp, FALSE,
7377                                                          GIMP_PARAM_READWRITE));
7378   gimp_procedure_add_argument (procedure,
7379                                gimp_param_spec_drawable_id ("drawable",
7380                                                             "drawable",
7381                                                             "Input drawable",
7382                                                             pdb->gimp, FALSE,
7383                                                             GIMP_PARAM_READWRITE));
7384   gimp_procedure_add_argument (procedure,
7385                                g_param_spec_double ("tile-size",
7386                                                     "tile size",
7387                                                     "Average diameter of each tile (in pixels)",
7388                                                     1, 1000, 1,
7389                                                     GIMP_PARAM_READWRITE));
7390   gimp_procedure_add_argument (procedure,
7391                                g_param_spec_double ("tile-height",
7392                                                     "tile height",
7393                                                     "Apparent height of each tile (in pixels)",
7394                                                     1, 1000, 1,
7395                                                     GIMP_PARAM_READWRITE));
7396   gimp_procedure_add_argument (procedure,
7397                                g_param_spec_double ("tile-spacing",
7398                                                     "tile spacing",
7399                                                     "Inter_tile spacing (in pixels)",
7400                                                     0.1, 1000, 0.1,
7401                                                     GIMP_PARAM_READWRITE));
7402   gimp_procedure_add_argument (procedure,
7403                                g_param_spec_double ("tile-neatness",
7404                                                     "tile neatness",
7405                                                     "Deviation from perfectly formed tiles",
7406                                                     0, 1.0, 0,
7407                                                     GIMP_PARAM_READWRITE));
7408   gimp_procedure_add_argument (procedure,
7409                                gimp_param_spec_int32 ("tile-allow-split",
7410                                                       "tile allow split",
7411                                                       "Allows splitting tiles at hard edges",
7412                                                       0, 1, 0,
7413                                                       GIMP_PARAM_READWRITE));
7414   gimp_procedure_add_argument (procedure,
7415                                g_param_spec_double ("light-dir",
7416                                                     "light dir",
7417                                                     "Direction of light_source (in degrees)",
7418                                                     0, 360, 0,
7419                                                     GIMP_PARAM_READWRITE));
7420   gimp_procedure_add_argument (procedure,
7421                                g_param_spec_double ("color-variation",
7422                                                     "color variation",
7423                                                     "Magnitude of random color variations",
7424                                                     0.0, 1.0, 0.0,
7425                                                     GIMP_PARAM_READWRITE));
7426   gimp_procedure_add_argument (procedure,
7427                                gimp_param_spec_int32 ("antialiasing",
7428                                                       "antialiasing",
7429                                                       "Enables smoother tile output at the cost of speed",
7430                                                       0, 1, 0,
7431                                                       GIMP_PARAM_READWRITE));
7432   gimp_procedure_add_argument (procedure,
7433                                gimp_param_spec_int32 ("color-averaging",
7434                                                       "color averaging",
7435                                                       "Tile color based on average of subsumed pixels",
7436                                                       0, 1, 0,
7437                                                       GIMP_PARAM_READWRITE));
7438   gimp_procedure_add_argument (procedure,
7439                                gimp_param_spec_int32 ("tile-type",
7440                                                       "tile type",
7441                                                       "Tile geometry { SQUARES (0), HEXAGONS (1), OCTAGONS (2), TRIANGLES (3) }",
7442                                                       0, 3, 0,
7443                                                       GIMP_PARAM_READWRITE));
7444   gimp_procedure_add_argument (procedure,
7445                                gimp_param_spec_int32 ("tile-surface",
7446                                                       "tile surface",
7447                                                       "Surface characteristics { SMOOTH (0), ROUGH (1) }",
7448                                                       0, 1, 0,
7449                                                       GIMP_PARAM_READWRITE));
7450   gimp_procedure_add_argument (procedure,
7451                                gimp_param_spec_int32 ("grout-color",
7452                                                       "grout color",
7453                                                       "Grout color (black/white or fore/background) { BW (0), FG-BG (1) }",
7454                                                       0, 1, 0,
7455                                                       GIMP_PARAM_READWRITE));
7456   gimp_pdb_register_procedure (pdb, procedure);
7457   g_object_unref (procedure);
7458 
7459   /*
7460    * gimp-plug-in-neon
7461    */
7462   procedure = gimp_procedure_new (plug_in_neon_invoker);
7463   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7464                                "plug-in-neon");
7465   gimp_procedure_set_static_strings (procedure,
7466                                      "plug-in-neon",
7467                                      "Simulate the glowing boundary of a neon light",
7468                                      "This filter works in a manner similar to the edge plug-in, but uses the first derivative of the gaussian operator to achieve resolution independence. The IIR method of calculating the effect is utilized to keep the processing time constant between large and small standard deviations.",
7469                                      "Compatibility procedure. Please see 'gegl:edge-neon' for credits.",
7470                                      "Compatibility procedure. Please see 'gegl:edge-neon' for credits.",
7471                                      "2019",
7472                                      NULL);
7473   gimp_procedure_add_argument (procedure,
7474                                g_param_spec_enum ("run-mode",
7475                                                   "run mode",
7476                                                   "The run mode",
7477                                                   GIMP_TYPE_RUN_MODE,
7478                                                   GIMP_RUN_INTERACTIVE,
7479                                                   GIMP_PARAM_READWRITE));
7480   gimp_procedure_add_argument (procedure,
7481                                gimp_param_spec_image_id ("image",
7482                                                          "image",
7483                                                          "Input image (unused)",
7484                                                          pdb->gimp, FALSE,
7485                                                          GIMP_PARAM_READWRITE));
7486   gimp_procedure_add_argument (procedure,
7487                                gimp_param_spec_drawable_id ("drawable",
7488                                                             "drawable",
7489                                                             "Input drawable",
7490                                                             pdb->gimp, FALSE,
7491                                                             GIMP_PARAM_READWRITE));
7492   gimp_procedure_add_argument (procedure,
7493                                g_param_spec_double ("radius",
7494                                                     "radius",
7495                                                     "Radius of neon effect (in pixels)",
7496                                                     0.0, 1500.0, 0.0,
7497                                                     GIMP_PARAM_READWRITE));
7498   gimp_procedure_add_argument (procedure,
7499                                g_param_spec_double ("amount",
7500                                                     "amount",
7501                                                     "Effect enhancement variable",
7502                                                     0.0, 100.0, 0.0,
7503                                                     GIMP_PARAM_READWRITE));
7504   gimp_pdb_register_procedure (pdb, procedure);
7505   g_object_unref (procedure);
7506 
7507   /*
7508    * gimp-plug-in-newsprint
7509    */
7510   procedure = gimp_procedure_new (plug_in_newsprint_invoker);
7511   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7512                                "plug-in-newsprint");
7513   gimp_procedure_set_static_strings (procedure,
7514                                      "plug-in-newsprint",
7515                                      "Halftone the image to give newspaper-like effect",
7516                                      "Halftone the image to give newspaper-like effect",
7517                                      "Compatibility procedure. Please see 'gegl:newsprint' for credits.",
7518                                      "Compatibility procedure. Please see 'gegl:newsprint' for credits.",
7519                                      "2019",
7520                                      NULL);
7521   gimp_procedure_add_argument (procedure,
7522                                g_param_spec_enum ("run-mode",
7523                                                   "run mode",
7524                                                   "The run mode",
7525                                                   GIMP_TYPE_RUN_MODE,
7526                                                   GIMP_RUN_INTERACTIVE,
7527                                                   GIMP_PARAM_READWRITE));
7528   gimp_procedure_add_argument (procedure,
7529                                gimp_param_spec_image_id ("image",
7530                                                          "image",
7531                                                          "Input image (unused)",
7532                                                          pdb->gimp, FALSE,
7533                                                          GIMP_PARAM_READWRITE));
7534   gimp_procedure_add_argument (procedure,
7535                                gimp_param_spec_drawable_id ("drawable",
7536                                                             "drawable",
7537                                                             "Input drawable",
7538                                                             pdb->gimp, FALSE,
7539                                                             GIMP_PARAM_READWRITE));
7540   gimp_procedure_add_argument (procedure,
7541                                gimp_param_spec_int32 ("cell-width",
7542                                                       "cell width",
7543                                                       "Screen cell width in pixels",
7544                                                       0, 1500, 0,
7545                                                       GIMP_PARAM_READWRITE));
7546   gimp_procedure_add_argument (procedure,
7547                                gimp_param_spec_int32 ("colorspace",
7548                                                       "colorspace",
7549                                                       "Separate to { GRAYSCALE (0), RGB (1), CMYK (2), LUMINANCE (3) }",
7550                                                       0, 3, 0,
7551                                                       GIMP_PARAM_READWRITE));
7552   gimp_procedure_add_argument (procedure,
7553                                gimp_param_spec_int32 ("k-pullout",
7554                                                       "k pullout",
7555                                                       "Percentage of black to pullout (CMYK only)",
7556                                                       0, 100, 0,
7557                                                       GIMP_PARAM_READWRITE));
7558   gimp_procedure_add_argument (procedure,
7559                                g_param_spec_double ("gry-ang",
7560                                                     "gry ang",
7561                                                     "Grey/black screen angle (degrees)",
7562                                                     0.0, 360.0, 0.0,
7563                                                     GIMP_PARAM_READWRITE));
7564   gimp_procedure_add_argument (procedure,
7565                                gimp_param_spec_int32 ("gry-spotfn",
7566                                                       "gry spotfn",
7567                                                       "Grey/black spot function { DOTS (0), LINES (1), DIAMONDS (2), EUCLIDIAN-DOT (3), PS-DIAMONDS (4) }",
7568                                                       0, 4, 0,
7569                                                       GIMP_PARAM_READWRITE));
7570   gimp_procedure_add_argument (procedure,
7571                                g_param_spec_double ("red-ang",
7572                                                     "red ang",
7573                                                     "Red/cyan screen angle (degrees)",
7574                                                     0.0, 360.0, 0.0,
7575                                                     GIMP_PARAM_READWRITE));
7576   gimp_procedure_add_argument (procedure,
7577                                gimp_param_spec_int32 ("red-spotfn",
7578                                                       "red spotfn",
7579                                                       "Red/cyan spot function { DOTS (0), LINES (1), DIAMONDS (2), EUCLIDIAN-DOT (3), PS-DIAMONDS (4) }",
7580                                                       0, 4, 0,
7581                                                       GIMP_PARAM_READWRITE));
7582   gimp_procedure_add_argument (procedure,
7583                                g_param_spec_double ("grn-ang",
7584                                                     "grn ang",
7585                                                     "Green/magenta screen angle (degrees)",
7586                                                     0.0, 360.0, 0.0,
7587                                                     GIMP_PARAM_READWRITE));
7588   gimp_procedure_add_argument (procedure,
7589                                gimp_param_spec_int32 ("grn-spotfn",
7590                                                       "grn spotfn",
7591                                                       "Green/magenta spot function { DOTS (0), LINES (1), DIAMONDS (2), EUCLIDIAN-DOT (3), PS-DIAMONDS (4) }",
7592                                                       0, 4, 0,
7593                                                       GIMP_PARAM_READWRITE));
7594   gimp_procedure_add_argument (procedure,
7595                                g_param_spec_double ("blu-ang",
7596                                                     "blu ang",
7597                                                     "Blue/yellow screen angle (degrees)",
7598                                                     0.0, 360.0, 0.0,
7599                                                     GIMP_PARAM_READWRITE));
7600   gimp_procedure_add_argument (procedure,
7601                                gimp_param_spec_int32 ("blu-spotfn",
7602                                                       "blu spotfn",
7603                                                       "Blue/yellow spot function { DOTS (0), LINES (1), DIAMONDS (2), EUCLIDIAN-DOT (3), PS-DIAMONDS (4) }",
7604                                                       0, 4, 0,
7605                                                       GIMP_PARAM_READWRITE));
7606   gimp_procedure_add_argument (procedure,
7607                                gimp_param_spec_int32 ("oversample",
7608                                                       "oversample",
7609                                                       "how many times to oversample spot fn",
7610                                                       0, 128, 0,
7611                                                       GIMP_PARAM_READWRITE));
7612   gimp_pdb_register_procedure (pdb, procedure);
7613   g_object_unref (procedure);
7614 
7615   /*
7616    * gimp-plug-in-normalize
7617    */
7618   procedure = gimp_procedure_new (plug_in_normalize_invoker);
7619   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7620                                "plug-in-normalize");
7621   gimp_procedure_set_static_strings (procedure,
7622                                      "plug-in-normalize",
7623                                      "Stretch brightness values to cover the full range",
7624                                      "This plug-in performs almost the same operation as the 'contrast autostretch' plug-in, except that it won't allow the color channels to normalize independently. This is actually what most people probably want instead of contrast-autostretch; use c-a only if you wish to remove an undesirable color-tint from a source image which is supposed to contain pure-white and pure-black.",
7625                                      "Compatibility procedure. Please see 'gegl:stretch-contrast' for credits.",
7626                                      "Compatibility procedure. Please see 'gegl:stretch-contrast' for credits.",
7627                                      "2019",
7628                                      NULL);
7629   gimp_procedure_add_argument (procedure,
7630                                g_param_spec_enum ("run-mode",
7631                                                   "run mode",
7632                                                   "The run mode",
7633                                                   GIMP_TYPE_RUN_MODE,
7634                                                   GIMP_RUN_INTERACTIVE,
7635                                                   GIMP_PARAM_READWRITE));
7636   gimp_procedure_add_argument (procedure,
7637                                gimp_param_spec_image_id ("image",
7638                                                          "image",
7639                                                          "Input image (unused)",
7640                                                          pdb->gimp, FALSE,
7641                                                          GIMP_PARAM_READWRITE));
7642   gimp_procedure_add_argument (procedure,
7643                                gimp_param_spec_drawable_id ("drawable",
7644                                                             "drawable",
7645                                                             "Input drawable",
7646                                                             pdb->gimp, FALSE,
7647                                                             GIMP_PARAM_READWRITE));
7648   gimp_pdb_register_procedure (pdb, procedure);
7649   g_object_unref (procedure);
7650 
7651   /*
7652    * gimp-plug-in-nova
7653    */
7654   procedure = gimp_procedure_new (plug_in_nova_invoker);
7655   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7656                                "plug-in-nova");
7657   gimp_procedure_set_static_strings (procedure,
7658                                      "plug-in-nova",
7659                                      "Add a starburst to the image",
7660                                      "This plug-in produces an effect like a supernova burst. The amount of the light effect is approximately in proportion to 1/r, where r is the distance from the center of the star.",
7661                                      "Compatibility procedure. Please see 'gegl:supernova' for credits.",
7662                                      "Compatibility procedure. Please see 'gegl:supernova' for credits.",
7663                                      "2014",
7664                                      NULL);
7665   gimp_procedure_add_argument (procedure,
7666                                g_param_spec_enum ("run-mode",
7667                                                   "run mode",
7668                                                   "The run mode",
7669                                                   GIMP_TYPE_RUN_MODE,
7670                                                   GIMP_RUN_INTERACTIVE,
7671                                                   GIMP_PARAM_READWRITE));
7672   gimp_procedure_add_argument (procedure,
7673                                gimp_param_spec_image_id ("image",
7674                                                          "image",
7675                                                          "Input image (unused)",
7676                                                          pdb->gimp, FALSE,
7677                                                          GIMP_PARAM_READWRITE));
7678   gimp_procedure_add_argument (procedure,
7679                                gimp_param_spec_drawable_id ("drawable",
7680                                                             "drawable",
7681                                                             "Input drawable",
7682                                                             pdb->gimp, FALSE,
7683                                                             GIMP_PARAM_READWRITE));
7684   gimp_procedure_add_argument (procedure,
7685                                gimp_param_spec_int32 ("xcenter",
7686                                                       "xcenter",
7687                                                       "X coordinates of the center of supernova",
7688                                                       G_MININT32, G_MAXINT32, 0,
7689                                                       GIMP_PARAM_READWRITE));
7690   gimp_procedure_add_argument (procedure,
7691                                gimp_param_spec_int32 ("ycenter",
7692                                                       "ycenter",
7693                                                       "Y coordinates of the center of supernova",
7694                                                       G_MININT32, G_MAXINT32, 0,
7695                                                       GIMP_PARAM_READWRITE));
7696   gimp_procedure_add_argument (procedure,
7697                                gimp_param_spec_rgb ("color",
7698                                                     "color",
7699                                                     "Color of supernova",
7700                                                     FALSE,
7701                                                     NULL,
7702                                                     GIMP_PARAM_READWRITE));
7703   gimp_procedure_add_argument (procedure,
7704                                gimp_param_spec_int32 ("radius",
7705                                                       "radius",
7706                                                       "Radius of supernova",
7707                                                       1, 3000, 1,
7708                                                       GIMP_PARAM_READWRITE));
7709   gimp_procedure_add_argument (procedure,
7710                                gimp_param_spec_int32 ("nspoke",
7711                                                       "nspoke",
7712                                                       "Number of spokes",
7713                                                       1, 1024, 1,
7714                                                       GIMP_PARAM_READWRITE));
7715   gimp_procedure_add_argument (procedure,
7716                                gimp_param_spec_int32 ("randomhue",
7717                                                       "randomhue",
7718                                                       "Random hue",
7719                                                       0, 360, 0,
7720                                                       GIMP_PARAM_READWRITE));
7721   gimp_pdb_register_procedure (pdb, procedure);
7722   g_object_unref (procedure);
7723 
7724   /*
7725    * gimp-plug-in-oilify
7726    */
7727   procedure = gimp_procedure_new (plug_in_oilify_invoker);
7728   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7729                                "plug-in-oilify");
7730   gimp_procedure_set_static_strings (procedure,
7731                                      "plug-in-oilify",
7732                                      "Smear colors to simulate an oil painting",
7733                                      "This function performs the well-known oil-paint effect on the specified drawable.",
7734                                      "Compatibility procedure. Please see 'gegl:oilify' for credits.",
7735                                      "Compatibility procedure. Please see 'gegl:oilify' for credits.",
7736                                      "2019",
7737                                      NULL);
7738   gimp_procedure_add_argument (procedure,
7739                                g_param_spec_enum ("run-mode",
7740                                                   "run mode",
7741                                                   "The run mode",
7742                                                   GIMP_TYPE_RUN_MODE,
7743                                                   GIMP_RUN_INTERACTIVE,
7744                                                   GIMP_PARAM_READWRITE));
7745   gimp_procedure_add_argument (procedure,
7746                                gimp_param_spec_image_id ("image",
7747                                                          "image",
7748                                                          "Input image (unused)",
7749                                                          pdb->gimp, FALSE,
7750                                                          GIMP_PARAM_READWRITE));
7751   gimp_procedure_add_argument (procedure,
7752                                gimp_param_spec_drawable_id ("drawable",
7753                                                             "drawable",
7754                                                             "Input drawable",
7755                                                             pdb->gimp, FALSE,
7756                                                             GIMP_PARAM_READWRITE));
7757   gimp_procedure_add_argument (procedure,
7758                                gimp_param_spec_int32 ("mask-size",
7759                                                       "mask size",
7760                                                       "Oil paint mask size",
7761                                                       1, 200, 1,
7762                                                       GIMP_PARAM_READWRITE));
7763   gimp_procedure_add_argument (procedure,
7764                                gimp_param_spec_int32 ("mode",
7765                                                       "mode",
7766                                                       "Algorithm { RGB (0), INTENSITY (1) }",
7767                                                       0, 1, 0,
7768                                                       GIMP_PARAM_READWRITE));
7769   gimp_pdb_register_procedure (pdb, procedure);
7770   g_object_unref (procedure);
7771 
7772   /*
7773    * gimp-plug-in-oilify-enhanced
7774    */
7775   procedure = gimp_procedure_new (plug_in_oilify_enhanced_invoker);
7776   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7777                                "plug-in-oilify-enhanced");
7778   gimp_procedure_set_static_strings (procedure,
7779                                      "plug-in-oilify-enhanced",
7780                                      "Smear colors to simulate an oil painting",
7781                                      "This function performs the well-known oil-paint effect on the specified drawable.",
7782                                      "Compatibility procedure. Please see 'gegl:oilify' for credits.",
7783                                      "Compatibility procedure. Please see 'gegl:oilify' for credits.",
7784                                      "2019",
7785                                      NULL);
7786   gimp_procedure_add_argument (procedure,
7787                                g_param_spec_enum ("run-mode",
7788                                                   "run mode",
7789                                                   "The run mode",
7790                                                   GIMP_TYPE_RUN_MODE,
7791                                                   GIMP_RUN_INTERACTIVE,
7792                                                   GIMP_PARAM_READWRITE));
7793   gimp_procedure_add_argument (procedure,
7794                                gimp_param_spec_image_id ("image",
7795                                                          "image",
7796                                                          "Input image (unused)",
7797                                                          pdb->gimp, FALSE,
7798                                                          GIMP_PARAM_READWRITE));
7799   gimp_procedure_add_argument (procedure,
7800                                gimp_param_spec_drawable_id ("drawable",
7801                                                             "drawable",
7802                                                             "Input drawable",
7803                                                             pdb->gimp, FALSE,
7804                                                             GIMP_PARAM_READWRITE));
7805   gimp_procedure_add_argument (procedure,
7806                                gimp_param_spec_int32 ("mode",
7807                                                       "mode",
7808                                                       "Algorithm { RGB (0), INTENSITY (1) }",
7809                                                       0, 1, 0,
7810                                                       GIMP_PARAM_READWRITE));
7811   gimp_procedure_add_argument (procedure,
7812                                gimp_param_spec_int32 ("mask-size",
7813                                                       "mask size",
7814                                                       "Oil paint mask size",
7815                                                       1, 200, 1,
7816                                                       GIMP_PARAM_READWRITE));
7817   gimp_procedure_add_argument (procedure,
7818                                gimp_param_spec_drawable_id ("mask-size-map",
7819                                                             "mask size map",
7820                                                             "Mask size control map",
7821                                                             pdb->gimp, TRUE,
7822                                                             GIMP_PARAM_READWRITE));
7823   gimp_procedure_add_argument (procedure,
7824                                gimp_param_spec_int32 ("exponent",
7825                                                       "exponent",
7826                                                       "Oil paint exponent",
7827                                                       1, 20, 1,
7828                                                       GIMP_PARAM_READWRITE));
7829   gimp_procedure_add_argument (procedure,
7830                                gimp_param_spec_drawable_id ("exponent-map",
7831                                                             "exponent map",
7832                                                             "Exponent control map",
7833                                                             pdb->gimp, TRUE,
7834                                                             GIMP_PARAM_READWRITE));
7835   gimp_pdb_register_procedure (pdb, procedure);
7836   g_object_unref (procedure);
7837 
7838   /*
7839    * gimp-plug-in-papertile
7840    */
7841   procedure = gimp_procedure_new (plug_in_papertile_invoker);
7842   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7843                                "plug-in-papertile");
7844   gimp_procedure_set_static_strings (procedure,
7845                                      "plug-in-papertile",
7846                                      "Cut image into paper tiles, and slide them",
7847                                      "This plug-in cuts an image into paper tiles and slides each paper tile.",
7848                                      "Compatibility procedure. Please see 'gegl:tile-paper' for credits.",
7849                                      "Compatibility procedure. Please see 'gegl:tile-paper' for credits.",
7850                                      "2015",
7851                                      NULL);
7852   gimp_procedure_add_argument (procedure,
7853                                g_param_spec_enum ("run-mode",
7854                                                   "run mode",
7855                                                   "The run mode",
7856                                                   GIMP_TYPE_RUN_MODE,
7857                                                   GIMP_RUN_INTERACTIVE,
7858                                                   GIMP_PARAM_READWRITE));
7859   gimp_procedure_add_argument (procedure,
7860                                gimp_param_spec_image_id ("image",
7861                                                          "image",
7862                                                          "Input image (unused)",
7863                                                          pdb->gimp, FALSE,
7864                                                          GIMP_PARAM_READWRITE));
7865   gimp_procedure_add_argument (procedure,
7866                                gimp_param_spec_drawable_id ("drawable",
7867                                                             "drawable",
7868                                                             "Input drawable",
7869                                                             pdb->gimp, FALSE,
7870                                                             GIMP_PARAM_READWRITE));
7871   gimp_procedure_add_argument (procedure,
7872                                gimp_param_spec_int32 ("tile-size",
7873                                                       "tile size",
7874                                                       "Tile size (pixels)",
7875                                                       G_MININT32, G_MAXINT32, 0,
7876                                                       GIMP_PARAM_READWRITE));
7877   gimp_procedure_add_argument (procedure,
7878                                g_param_spec_double ("move-max",
7879                                                     "move max",
7880                                                     "Max move rate (%)",
7881                                                     -G_MAXDOUBLE, G_MAXDOUBLE, 0,
7882                                                     GIMP_PARAM_READWRITE));
7883   gimp_procedure_add_argument (procedure,
7884                                gimp_param_spec_int32 ("fractional-type",
7885                                                       "fractional type",
7886                                                       "Fractional type { BACKGROUND (0), IGNORE (1), FORCE (2) }",
7887                                                       0, 2, 0,
7888                                                       GIMP_PARAM_READWRITE));
7889   gimp_procedure_add_argument (procedure,
7890                                g_param_spec_boolean ("wrap-around",
7891                                                      "wrap around",
7892                                                      "Wrap around",
7893                                                      FALSE,
7894                                                      GIMP_PARAM_READWRITE));
7895   gimp_procedure_add_argument (procedure,
7896                                g_param_spec_boolean ("centering",
7897                                                      "centering",
7898                                                      "Centering",
7899                                                      FALSE,
7900                                                      GIMP_PARAM_READWRITE));
7901   gimp_procedure_add_argument (procedure,
7902                                gimp_param_spec_int32 ("background-type",
7903                                                       "background type",
7904                                                       "Background type { TRANSPARENT (0), INVERTED (1), IMAGE (2), FG (3), BG (4), COLOR (5) }",
7905                                                       0, 5, 0,
7906                                                       GIMP_PARAM_READWRITE));
7907   gimp_procedure_add_argument (procedure,
7908                                gimp_param_spec_rgb ("background-color",
7909                                                     "background color",
7910                                                     "Background color (for background-type == 5)",
7911                                                     FALSE,
7912                                                     NULL,
7913                                                     GIMP_PARAM_READWRITE));
7914   gimp_procedure_add_argument (procedure,
7915                                gimp_param_spec_int32 ("background-alpha",
7916                                                       "background alpha",
7917                                                       "Background alpha (unused)",
7918                                                       G_MININT32, G_MAXINT32, 0,
7919                                                       GIMP_PARAM_READWRITE));
7920   gimp_pdb_register_procedure (pdb, procedure);
7921   g_object_unref (procedure);
7922 
7923   /*
7924    * gimp-plug-in-pixelize
7925    */
7926   procedure = gimp_procedure_new (plug_in_pixelize_invoker);
7927   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7928                                "plug-in-pixelize");
7929   gimp_procedure_set_static_strings (procedure,
7930                                      "plug-in-pixelize",
7931                                      "Simplify image into an array of solid-colored squares",
7932                                      "Pixelize the contents of the specified drawable with specified pixelizing width.",
7933                                      "Spencer Kimball & Peter Mattis",
7934                                      "Spencer Kimball & Peter Mattis",
7935                                      "1997",
7936                                      NULL);
7937   gimp_procedure_add_argument (procedure,
7938                                g_param_spec_enum ("run-mode",
7939                                                   "run mode",
7940                                                   "The run mode",
7941                                                   GIMP_TYPE_RUN_MODE,
7942                                                   GIMP_RUN_INTERACTIVE,
7943                                                   GIMP_PARAM_READWRITE));
7944   gimp_procedure_add_argument (procedure,
7945                                gimp_param_spec_image_id ("image",
7946                                                          "image",
7947                                                          "Input image (unused)",
7948                                                          pdb->gimp, FALSE,
7949                                                          GIMP_PARAM_READWRITE));
7950   gimp_procedure_add_argument (procedure,
7951                                gimp_param_spec_drawable_id ("drawable",
7952                                                             "drawable",
7953                                                             "Input drawable",
7954                                                             pdb->gimp, FALSE,
7955                                                             GIMP_PARAM_READWRITE));
7956   gimp_procedure_add_argument (procedure,
7957                                gimp_param_spec_int32 ("pixel-width",
7958                                                       "pixel width",
7959                                                       "Pixel width (the decrease in resolution)",
7960                                                       1, GIMP_MAX_IMAGE_SIZE, 1,
7961                                                       GIMP_PARAM_READWRITE));
7962   gimp_pdb_register_procedure (pdb, procedure);
7963   g_object_unref (procedure);
7964 
7965   /*
7966    * gimp-plug-in-pixelize2
7967    */
7968   procedure = gimp_procedure_new (plug_in_pixelize2_invoker);
7969   gimp_object_set_static_name (GIMP_OBJECT (procedure),
7970                                "plug-in-pixelize2");
7971   gimp_procedure_set_static_strings (procedure,
7972                                      "plug-in-pixelize2",
7973                                      "Simplify image into an array of solid-colored rectangles",
7974                                      "Pixelize the contents of the specified drawable with specified pixelizing width and height.",
7975                                      "Spencer Kimball & Peter Mattis",
7976                                      "Spencer Kimball & Peter Mattis",
7977                                      "1997",
7978                                      NULL);
7979   gimp_procedure_add_argument (procedure,
7980                                g_param_spec_enum ("run-mode",
7981                                                   "run mode",
7982                                                   "The run mode",
7983                                                   GIMP_TYPE_RUN_MODE,
7984                                                   GIMP_RUN_INTERACTIVE,
7985                                                   GIMP_PARAM_READWRITE));
7986   gimp_procedure_add_argument (procedure,
7987                                gimp_param_spec_image_id ("image",
7988                                                          "image",
7989                                                          "Input image (unused)",
7990                                                          pdb->gimp, FALSE,
7991                                                          GIMP_PARAM_READWRITE));
7992   gimp_procedure_add_argument (procedure,
7993                                gimp_param_spec_drawable_id ("drawable",
7994                                                             "drawable",
7995                                                             "Input drawable",
7996                                                             pdb->gimp, FALSE,
7997                                                             GIMP_PARAM_READWRITE));
7998   gimp_procedure_add_argument (procedure,
7999                                gimp_param_spec_int32 ("pixel-width",
8000                                                       "pixel width",
8001                                                       "Pixel width (the decrease in horizontal resolution)",
8002                                                       1, GIMP_MAX_IMAGE_SIZE, 1,
8003                                                       GIMP_PARAM_READWRITE));
8004   gimp_procedure_add_argument (procedure,
8005                                gimp_param_spec_int32 ("pixel-height",
8006                                                       "pixel height",
8007                                                       "Pixel height (the decrease in vertical resolution)",
8008                                                       1, GIMP_MAX_IMAGE_SIZE, 1,
8009                                                       GIMP_PARAM_READWRITE));
8010   gimp_pdb_register_procedure (pdb, procedure);
8011   g_object_unref (procedure);
8012 
8013   /*
8014    * gimp-plug-in-plasma
8015    */
8016   procedure = gimp_procedure_new (plug_in_plasma_invoker);
8017   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8018                                "plug-in-plasma");
8019   gimp_procedure_set_static_strings (procedure,
8020                                      "plug-in-plasma",
8021                                      "Create a random plasma texture",
8022                                      "This plug-in produces plasma fractal images.",
8023                                      "Compatibility procedure. Please see 'gegl:plasma' for credits.",
8024                                      "Compatibility procedure. Please see 'gegl:plasma' for credits.",
8025                                      "2013",
8026                                      NULL);
8027   gimp_procedure_add_argument (procedure,
8028                                g_param_spec_enum ("run-mode",
8029                                                   "run mode",
8030                                                   "The run mode",
8031                                                   GIMP_TYPE_RUN_MODE,
8032                                                   GIMP_RUN_INTERACTIVE,
8033                                                   GIMP_PARAM_READWRITE));
8034   gimp_procedure_add_argument (procedure,
8035                                gimp_param_spec_image_id ("image",
8036                                                          "image",
8037                                                          "Input image (unused)",
8038                                                          pdb->gimp, FALSE,
8039                                                          GIMP_PARAM_READWRITE));
8040   gimp_procedure_add_argument (procedure,
8041                                gimp_param_spec_drawable_id ("drawable",
8042                                                             "drawable",
8043                                                             "Input drawable",
8044                                                             pdb->gimp, FALSE,
8045                                                             GIMP_PARAM_READWRITE));
8046   gimp_procedure_add_argument (procedure,
8047                                gimp_param_spec_int32 ("seed",
8048                                                       "seed",
8049                                                       "Random seed",
8050                                                       -1, G_MAXINT, -1,
8051                                                       GIMP_PARAM_READWRITE));
8052   gimp_procedure_add_argument (procedure,
8053                                g_param_spec_double ("turbulence",
8054                                                     "turbulence",
8055                                                     "The value of the turbulence",
8056                                                     0.0, 7.0, 0.0,
8057                                                     GIMP_PARAM_READWRITE));
8058   gimp_pdb_register_procedure (pdb, procedure);
8059   g_object_unref (procedure);
8060 
8061   /*
8062    * gimp-plug-in-polar-coords
8063    */
8064   procedure = gimp_procedure_new (plug_in_polar_coords_invoker);
8065   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8066                                "plug-in-polar-coords");
8067   gimp_procedure_set_static_strings (procedure,
8068                                      "plug-in-polar-coords",
8069                                      "Convert image to or from polar coordinates",
8070                                      "Remaps and image from rectangular coordinates to polar coordinates or vice versa.",
8071                                      "Spencer Kimball & Peter Mattis",
8072                                      "Spencer Kimball & Peter Mattis",
8073                                      "1997",
8074                                      NULL);
8075   gimp_procedure_add_argument (procedure,
8076                                g_param_spec_enum ("run-mode",
8077                                                   "run mode",
8078                                                   "The run mode",
8079                                                   GIMP_TYPE_RUN_MODE,
8080                                                   GIMP_RUN_INTERACTIVE,
8081                                                   GIMP_PARAM_READWRITE));
8082   gimp_procedure_add_argument (procedure,
8083                                gimp_param_spec_image_id ("image",
8084                                                          "image",
8085                                                          "Input image (unused)",
8086                                                          pdb->gimp, FALSE,
8087                                                          GIMP_PARAM_READWRITE));
8088   gimp_procedure_add_argument (procedure,
8089                                gimp_param_spec_drawable_id ("drawable",
8090                                                             "drawable",
8091                                                             "Input drawable",
8092                                                             pdb->gimp, FALSE,
8093                                                             GIMP_PARAM_READWRITE));
8094   gimp_procedure_add_argument (procedure,
8095                                g_param_spec_double ("circle",
8096                                                     "circle",
8097                                                     "Circle depth in %",
8098                                                     0.0, 100.0, 0.0,
8099                                                     GIMP_PARAM_READWRITE));
8100   gimp_procedure_add_argument (procedure,
8101                                g_param_spec_double ("angle",
8102                                                     "angle",
8103                                                     "Offset angle",
8104                                                     0.0, 360.0, 0.0,
8105                                                     GIMP_PARAM_READWRITE));
8106   gimp_procedure_add_argument (procedure,
8107                                g_param_spec_boolean ("backwards",
8108                                                      "backwards",
8109                                                      "Map backwards",
8110                                                      FALSE,
8111                                                      GIMP_PARAM_READWRITE));
8112   gimp_procedure_add_argument (procedure,
8113                                g_param_spec_boolean ("inverse",
8114                                                      "inverse",
8115                                                      "Map from top",
8116                                                      FALSE,
8117                                                      GIMP_PARAM_READWRITE));
8118   gimp_procedure_add_argument (procedure,
8119                                g_param_spec_boolean ("polrec",
8120                                                      "polrec",
8121                                                      "Polar to rectangular",
8122                                                      FALSE,
8123                                                      GIMP_PARAM_READWRITE));
8124   gimp_pdb_register_procedure (pdb, procedure);
8125   g_object_unref (procedure);
8126 
8127   /*
8128    * gimp-plug-in-red-eye-removal
8129    */
8130   procedure = gimp_procedure_new (plug_in_red_eye_removal_invoker);
8131   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8132                                "plug-in-red-eye-removal");
8133   gimp_procedure_set_static_strings (procedure,
8134                                      "plug-in-red-eye-removal",
8135                                      "Remove the red eye effect caused by camera flashes",
8136                                      "This procedure removes the red eye effect caused by camera flashes by using a percentage based red color threshold. Make a selection containing the eyes, and apply the filter while adjusting the threshold to accurately remove the red eyes.",
8137                                      "Compatibility procedure. Please see 'gegl:red-eye-removal' for credits.",
8138                                      "Compatibility procedure. Please see 'gegl:red-eye-removal' for credits.",
8139                                      "2013",
8140                                      NULL);
8141   gimp_procedure_add_argument (procedure,
8142                                g_param_spec_enum ("run-mode",
8143                                                   "run mode",
8144                                                   "The run mode",
8145                                                   GIMP_TYPE_RUN_MODE,
8146                                                   GIMP_RUN_INTERACTIVE,
8147                                                   GIMP_PARAM_READWRITE));
8148   gimp_procedure_add_argument (procedure,
8149                                gimp_param_spec_image_id ("image",
8150                                                          "image",
8151                                                          "Input image (unused)",
8152                                                          pdb->gimp, FALSE,
8153                                                          GIMP_PARAM_READWRITE));
8154   gimp_procedure_add_argument (procedure,
8155                                gimp_param_spec_drawable_id ("drawable",
8156                                                             "drawable",
8157                                                             "Input drawable",
8158                                                             pdb->gimp, FALSE,
8159                                                             GIMP_PARAM_READWRITE));
8160   gimp_procedure_add_argument (procedure,
8161                                gimp_param_spec_int32 ("threshold",
8162                                                       "threshold",
8163                                                       "Red eye threshold in percent",
8164                                                       0, 100, 0,
8165                                                       GIMP_PARAM_READWRITE));
8166   gimp_pdb_register_procedure (pdb, procedure);
8167   g_object_unref (procedure);
8168 
8169   /*
8170    * gimp-plug-in-randomize-hurl
8171    */
8172   procedure = gimp_procedure_new (plug_in_randomize_hurl_invoker);
8173   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8174                                "plug-in-randomize-hurl");
8175   gimp_procedure_set_static_strings (procedure,
8176                                      "plug-in-randomize-hurl",
8177                                      "Completely randomize a fraction of pixels",
8178                                      "This plug-in \"hurls\" randomly-valued pixels onto the selection or image. You may select the percentage of pixels to modify and the number of times to repeat the process.",
8179                                      "Compatibility procedure. Please see 'gegl:noise-hurl' for credits.",
8180                                      "Compatibility procedure. Please see 'gegl:noise-hurl' for credits.",
8181                                      "2013",
8182                                      NULL);
8183   gimp_procedure_add_argument (procedure,
8184                                g_param_spec_enum ("run-mode",
8185                                                   "run mode",
8186                                                   "The run mode",
8187                                                   GIMP_TYPE_RUN_MODE,
8188                                                   GIMP_RUN_INTERACTIVE,
8189                                                   GIMP_PARAM_READWRITE));
8190   gimp_procedure_add_argument (procedure,
8191                                gimp_param_spec_image_id ("image",
8192                                                          "image",
8193                                                          "Input image (unused)",
8194                                                          pdb->gimp, FALSE,
8195                                                          GIMP_PARAM_READWRITE));
8196   gimp_procedure_add_argument (procedure,
8197                                gimp_param_spec_drawable_id ("drawable",
8198                                                             "drawable",
8199                                                             "Input drawable",
8200                                                             pdb->gimp, FALSE,
8201                                                             GIMP_PARAM_READWRITE));
8202   gimp_procedure_add_argument (procedure,
8203                                g_param_spec_double ("rndm-pct",
8204                                                     "rndm pct",
8205                                                     "Randomization percentage",
8206                                                     0.0, 100.0, 0.0,
8207                                                     GIMP_PARAM_READWRITE));
8208   gimp_procedure_add_argument (procedure,
8209                                g_param_spec_double ("rndm-rcount",
8210                                                     "rndm rcount",
8211                                                     "Repeat count",
8212                                                     1.0, 100.0, 1.0,
8213                                                     GIMP_PARAM_READWRITE));
8214   gimp_procedure_add_argument (procedure,
8215                                g_param_spec_boolean ("randomize",
8216                                                      "randomize",
8217                                                      "Use random seed",
8218                                                      FALSE,
8219                                                      GIMP_PARAM_READWRITE));
8220   gimp_procedure_add_argument (procedure,
8221                                gimp_param_spec_int32 ("seed",
8222                                                       "seed",
8223                                                       "Seed value (used only if randomize is FALSE)",
8224                                                       G_MININT32, G_MAXINT32, 0,
8225                                                       GIMP_PARAM_READWRITE));
8226   gimp_pdb_register_procedure (pdb, procedure);
8227   g_object_unref (procedure);
8228 
8229   /*
8230    * gimp-plug-in-randomize-pick
8231    */
8232   procedure = gimp_procedure_new (plug_in_randomize_pick_invoker);
8233   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8234                                "plug-in-randomize-pick");
8235   gimp_procedure_set_static_strings (procedure,
8236                                      "plug-in-randomize-pick",
8237                                      "Randomly interchange some pixels with neighbors",
8238                                      "This plug-in replaces a pixel with a random adjacent pixel. You may select the percentage of pixels to modify and the number of times to repeat the process.",
8239                                      "Compatibility procedure. Please see 'gegl:noise-pick' for credits.",
8240                                      "Compatibility procedure. Please see 'gegl:noise-pick' for credits.",
8241                                      "2013",
8242                                      NULL);
8243   gimp_procedure_add_argument (procedure,
8244                                g_param_spec_enum ("run-mode",
8245                                                   "run mode",
8246                                                   "The run mode",
8247                                                   GIMP_TYPE_RUN_MODE,
8248                                                   GIMP_RUN_INTERACTIVE,
8249                                                   GIMP_PARAM_READWRITE));
8250   gimp_procedure_add_argument (procedure,
8251                                gimp_param_spec_image_id ("image",
8252                                                          "image",
8253                                                          "Input image (unused)",
8254                                                          pdb->gimp, FALSE,
8255                                                          GIMP_PARAM_READWRITE));
8256   gimp_procedure_add_argument (procedure,
8257                                gimp_param_spec_drawable_id ("drawable",
8258                                                             "drawable",
8259                                                             "Input drawable",
8260                                                             pdb->gimp, FALSE,
8261                                                             GIMP_PARAM_READWRITE));
8262   gimp_procedure_add_argument (procedure,
8263                                g_param_spec_double ("rndm-pct",
8264                                                     "rndm pct",
8265                                                     "Randomization percentage",
8266                                                     1.0, 100.0, 1.0,
8267                                                     GIMP_PARAM_READWRITE));
8268   gimp_procedure_add_argument (procedure,
8269                                g_param_spec_double ("rndm-rcount",
8270                                                     "rndm rcount",
8271                                                     "Repeat count",
8272                                                     1.0, 100.0, 1.0,
8273                                                     GIMP_PARAM_READWRITE));
8274   gimp_procedure_add_argument (procedure,
8275                                g_param_spec_boolean ("randomize",
8276                                                      "randomize",
8277                                                      "Use random seed",
8278                                                      FALSE,
8279                                                      GIMP_PARAM_READWRITE));
8280   gimp_procedure_add_argument (procedure,
8281                                gimp_param_spec_int32 ("seed",
8282                                                       "seed",
8283                                                       "Seed value (used only if randomize is FALSE)",
8284                                                       G_MININT32, G_MAXINT32, 0,
8285                                                       GIMP_PARAM_READWRITE));
8286   gimp_pdb_register_procedure (pdb, procedure);
8287   g_object_unref (procedure);
8288 
8289   /*
8290    * gimp-plug-in-randomize-slur
8291    */
8292   procedure = gimp_procedure_new (plug_in_randomize_slur_invoker);
8293   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8294                                "plug-in-randomize-slur");
8295   gimp_procedure_set_static_strings (procedure,
8296                                      "plug-in-randomize-slur",
8297                                      "Randomly slide some pixels downward (similar to melting",
8298                                      "This plug-in \"slurs\" (melts like a bunch of icicles) an image. You may select the percentage of pixels to modify and the number of times to repeat the process.",
8299                                      "Compatibility procedure. Please see 'gegl:noise-slur' for credits.",
8300                                      "Compatibility procedure. Please see 'gegl:noise-slur' for credits.",
8301                                      "2013",
8302                                      NULL);
8303   gimp_procedure_add_argument (procedure,
8304                                g_param_spec_enum ("run-mode",
8305                                                   "run mode",
8306                                                   "The run mode",
8307                                                   GIMP_TYPE_RUN_MODE,
8308                                                   GIMP_RUN_INTERACTIVE,
8309                                                   GIMP_PARAM_READWRITE));
8310   gimp_procedure_add_argument (procedure,
8311                                gimp_param_spec_image_id ("image",
8312                                                          "image",
8313                                                          "Input image (unused)",
8314                                                          pdb->gimp, FALSE,
8315                                                          GIMP_PARAM_READWRITE));
8316   gimp_procedure_add_argument (procedure,
8317                                gimp_param_spec_drawable_id ("drawable",
8318                                                             "drawable",
8319                                                             "Input drawable",
8320                                                             pdb->gimp, FALSE,
8321                                                             GIMP_PARAM_READWRITE));
8322   gimp_procedure_add_argument (procedure,
8323                                g_param_spec_double ("rndm-pct",
8324                                                     "rndm pct",
8325                                                     "Randomization percentage",
8326                                                     1.0, 100.0, 1.0,
8327                                                     GIMP_PARAM_READWRITE));
8328   gimp_procedure_add_argument (procedure,
8329                                g_param_spec_double ("rndm-rcount",
8330                                                     "rndm rcount",
8331                                                     "Repeat count",
8332                                                     1.0, 100.0, 1.0,
8333                                                     GIMP_PARAM_READWRITE));
8334   gimp_procedure_add_argument (procedure,
8335                                g_param_spec_boolean ("randomize",
8336                                                      "randomize",
8337                                                      "Use random seed",
8338                                                      FALSE,
8339                                                      GIMP_PARAM_READWRITE));
8340   gimp_procedure_add_argument (procedure,
8341                                gimp_param_spec_int32 ("seed",
8342                                                       "seed",
8343                                                       "Seed value (used only if randomize is FALSE)",
8344                                                       G_MININT32, G_MAXINT32, 0,
8345                                                       GIMP_PARAM_READWRITE));
8346   gimp_pdb_register_procedure (pdb, procedure);
8347   g_object_unref (procedure);
8348 
8349   /*
8350    * gimp-plug-in-rgb-noise
8351    */
8352   procedure = gimp_procedure_new (plug_in_rgb_noise_invoker);
8353   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8354                                "plug-in-rgb-noise");
8355   gimp_procedure_set_static_strings (procedure,
8356                                      "plug-in-rgb-noise",
8357                                      "Distort colors by random amounts",
8358                                      "Add normally distributed (zero mean) random values to image channels. Noise may be additive (uncorrelated) or multiplicative (correlated - also known as speckle noise). For color images color channels may be treated together or independently.",
8359                                      "Compatibility procedure. Please see 'gegl:noise-rgb' for credits.",
8360                                      "Compatibility procedure. Please see 'gegl:noise-rgb' for credits.",
8361                                      "2013",
8362                                      NULL);
8363   gimp_procedure_add_argument (procedure,
8364                                g_param_spec_enum ("run-mode",
8365                                                   "run mode",
8366                                                   "The run mode",
8367                                                   GIMP_TYPE_RUN_MODE,
8368                                                   GIMP_RUN_INTERACTIVE,
8369                                                   GIMP_PARAM_READWRITE));
8370   gimp_procedure_add_argument (procedure,
8371                                gimp_param_spec_image_id ("image",
8372                                                          "image",
8373                                                          "Input image (unused)",
8374                                                          pdb->gimp, FALSE,
8375                                                          GIMP_PARAM_READWRITE));
8376   gimp_procedure_add_argument (procedure,
8377                                gimp_param_spec_drawable_id ("drawable",
8378                                                             "drawable",
8379                                                             "Input drawable",
8380                                                             pdb->gimp, FALSE,
8381                                                             GIMP_PARAM_READWRITE));
8382   gimp_procedure_add_argument (procedure,
8383                                g_param_spec_boolean ("independent",
8384                                                      "independent",
8385                                                      "Noise in channels independent",
8386                                                      FALSE,
8387                                                      GIMP_PARAM_READWRITE));
8388   gimp_procedure_add_argument (procedure,
8389                                g_param_spec_boolean ("correlated",
8390                                                      "correlated",
8391                                                      "Noise correlated (i.e. multiplicative not additive)",
8392                                                      FALSE,
8393                                                      GIMP_PARAM_READWRITE));
8394   gimp_procedure_add_argument (procedure,
8395                                g_param_spec_double ("noise-1",
8396                                                     "noise 1",
8397                                                     "Noise in the first channel (red, gray)",
8398                                                     0.0, 1.0, 0.0,
8399                                                     GIMP_PARAM_READWRITE));
8400   gimp_procedure_add_argument (procedure,
8401                                g_param_spec_double ("noise-2",
8402                                                     "noise 2",
8403                                                     "Noise in the second channel (green, gray_alpha)",
8404                                                     0.0, 1.0, 0.0,
8405                                                     GIMP_PARAM_READWRITE));
8406   gimp_procedure_add_argument (procedure,
8407                                g_param_spec_double ("noise-3",
8408                                                     "noise 3",
8409                                                     "Noise in the third channel (blue)",
8410                                                     0.0, 1.0, 0.0,
8411                                                     GIMP_PARAM_READWRITE));
8412   gimp_procedure_add_argument (procedure,
8413                                g_param_spec_double ("noise-4",
8414                                                     "noise 4",
8415                                                     "Noise in the fourth channel (alpha)",
8416                                                     0.0, 1.0, 0.0,
8417                                                     GIMP_PARAM_READWRITE));
8418   gimp_pdb_register_procedure (pdb, procedure);
8419   g_object_unref (procedure);
8420 
8421   /*
8422    * gimp-plug-in-ripple
8423    */
8424   procedure = gimp_procedure_new (plug_in_ripple_invoker);
8425   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8426                                "plug-in-ripple");
8427   gimp_procedure_set_static_strings (procedure,
8428                                      "plug-in-ripple",
8429                                      "Displace pixels in a ripple pattern",
8430                                      "Ripples the pixels of the specified drawable. Each row or column will be displaced a certain number of pixels coinciding with the given wave form.",
8431                                      "Compatibility procedure. Please see 'gegl:ripple' for credits.",
8432                                      "Compatibility procedure. Please see 'gegl:ripple' for credits.",
8433                                      "2018",
8434                                      NULL);
8435   gimp_procedure_add_argument (procedure,
8436                                g_param_spec_enum ("run-mode",
8437                                                   "run mode",
8438                                                   "The run mode",
8439                                                   GIMP_TYPE_RUN_MODE,
8440                                                   GIMP_RUN_INTERACTIVE,
8441                                                   GIMP_PARAM_READWRITE));
8442   gimp_procedure_add_argument (procedure,
8443                                gimp_param_spec_image_id ("image",
8444                                                          "image",
8445                                                          "Input image (unused)",
8446                                                          pdb->gimp, FALSE,
8447                                                          GIMP_PARAM_READWRITE));
8448   gimp_procedure_add_argument (procedure,
8449                                gimp_param_spec_drawable_id ("drawable",
8450                                                             "drawable",
8451                                                             "Input drawable",
8452                                                             pdb->gimp, FALSE,
8453                                                             GIMP_PARAM_READWRITE));
8454   gimp_procedure_add_argument (procedure,
8455                                gimp_param_spec_int32 ("period",
8456                                                       "period",
8457                                                       "Period: number of pixels for one wave to complete",
8458                                                       G_MININT32, G_MAXINT32, 0,
8459                                                       GIMP_PARAM_READWRITE));
8460   gimp_procedure_add_argument (procedure,
8461                                gimp_param_spec_int32 ("amplitude",
8462                                                       "amplitude",
8463                                                       "Amplitude: maximum displacement of wave",
8464                                                       G_MININT32, G_MAXINT32, 0,
8465                                                       GIMP_PARAM_READWRITE));
8466   gimp_procedure_add_argument (procedure,
8467                                gimp_param_spec_int32 ("orientation",
8468                                                       "orientation",
8469                                                       "Orientation { ORIENTATION-HORIZONTAL (0), ORIENTATION-VERTICAL (1) }",
8470                                                       0, 1, 0,
8471                                                       GIMP_PARAM_READWRITE));
8472   gimp_procedure_add_argument (procedure,
8473                                gimp_param_spec_int32 ("edges",
8474                                                       "edges",
8475                                                       "Edges { SMEAR (0), WRAP (1), BLANK (2) }",
8476                                                       0, 2, 0,
8477                                                       GIMP_PARAM_READWRITE));
8478   gimp_procedure_add_argument (procedure,
8479                                gimp_param_spec_int32 ("waveform",
8480                                                       "waveform",
8481                                                       "Waveform { SAWTOOTH (0), SINE (1) }",
8482                                                       0, 1, 0,
8483                                                       GIMP_PARAM_READWRITE));
8484   gimp_procedure_add_argument (procedure,
8485                                g_param_spec_boolean ("antialias",
8486                                                      "antialias",
8487                                                      "Antialias { TRUE, FALSE }",
8488                                                      FALSE,
8489                                                      GIMP_PARAM_READWRITE));
8490   gimp_procedure_add_argument (procedure,
8491                                g_param_spec_boolean ("tile",
8492                                                      "tile",
8493                                                      "Tileable { TRUE, FALSE }",
8494                                                      FALSE,
8495                                                      GIMP_PARAM_READWRITE));
8496   gimp_pdb_register_procedure (pdb, procedure);
8497   g_object_unref (procedure);
8498 
8499   /*
8500    * gimp-plug-in-rotate
8501    */
8502   procedure = gimp_procedure_new (plug_in_rotate_invoker);
8503   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8504                                "plug-in-rotate");
8505   gimp_procedure_set_static_strings (procedure,
8506                                      "plug-in-rotate",
8507                                      "Rotates a layer or the whole image by 90, 180 or 270 degrees",
8508                                      "This plug-in does rotate the active layer or the whole image clockwise by multiples of 90 degrees. When the whole image is chosen, the image is resized if necessary.",
8509                                      "Sven Neumann <sven@gimp.org>",
8510                                      "Sven Neumann",
8511                                      "2014",
8512                                      NULL);
8513   gimp_procedure_add_argument (procedure,
8514                                g_param_spec_enum ("run-mode",
8515                                                   "run mode",
8516                                                   "The run mode",
8517                                                   GIMP_TYPE_RUN_MODE,
8518                                                   GIMP_RUN_INTERACTIVE,
8519                                                   GIMP_PARAM_READWRITE));
8520   gimp_procedure_add_argument (procedure,
8521                                gimp_param_spec_image_id ("image",
8522                                                          "image",
8523                                                          "Input image (unused)",
8524                                                          pdb->gimp, FALSE,
8525                                                          GIMP_PARAM_READWRITE));
8526   gimp_procedure_add_argument (procedure,
8527                                gimp_param_spec_drawable_id ("drawable",
8528                                                             "drawable",
8529                                                             "Input drawable",
8530                                                             pdb->gimp, FALSE,
8531                                                             GIMP_PARAM_READWRITE));
8532   gimp_procedure_add_argument (procedure,
8533                                gimp_param_spec_int32 ("angle",
8534                                                       "angle",
8535                                                       "Angle { 90 (1), 180 (2), 270 (3) } degrees",
8536                                                       1, 3, 1,
8537                                                       GIMP_PARAM_READWRITE));
8538   gimp_procedure_add_argument (procedure,
8539                                g_param_spec_boolean ("everything",
8540                                                      "everything",
8541                                                      "Rotate the whole image",
8542                                                      FALSE,
8543                                                      GIMP_PARAM_READWRITE));
8544   gimp_pdb_register_procedure (pdb, procedure);
8545   g_object_unref (procedure);
8546 
8547   /*
8548    * gimp-plug-in-noisify
8549    */
8550   procedure = gimp_procedure_new (plug_in_noisify_invoker);
8551   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8552                                "plug-in-noisify");
8553   gimp_procedure_set_static_strings (procedure,
8554                                      "plug-in-noisify",
8555                                      "Adds random noise to image channels",
8556                                      "Add normally distributed random values to image channels. For color images each color channel may be treated together or independently.",
8557                                      "Compatibility procedure. Please see 'gegl:noise-rgb' for credits.",
8558                                      "Compatibility procedure. Please see 'gegl:noise-rgb' for credits.",
8559                                      "2013",
8560                                      NULL);
8561   gimp_procedure_add_argument (procedure,
8562                                g_param_spec_enum ("run-mode",
8563                                                   "run mode",
8564                                                   "The run mode",
8565                                                   GIMP_TYPE_RUN_MODE,
8566                                                   GIMP_RUN_INTERACTIVE,
8567                                                   GIMP_PARAM_READWRITE));
8568   gimp_procedure_add_argument (procedure,
8569                                gimp_param_spec_image_id ("image",
8570                                                          "image",
8571                                                          "Input image (unused)",
8572                                                          pdb->gimp, FALSE,
8573                                                          GIMP_PARAM_READWRITE));
8574   gimp_procedure_add_argument (procedure,
8575                                gimp_param_spec_drawable_id ("drawable",
8576                                                             "drawable",
8577                                                             "Input drawable",
8578                                                             pdb->gimp, FALSE,
8579                                                             GIMP_PARAM_READWRITE));
8580   gimp_procedure_add_argument (procedure,
8581                                g_param_spec_boolean ("independent",
8582                                                      "independent",
8583                                                      "Noise in channels independent",
8584                                                      FALSE,
8585                                                      GIMP_PARAM_READWRITE));
8586   gimp_procedure_add_argument (procedure,
8587                                g_param_spec_double ("noise-1",
8588                                                     "noise 1",
8589                                                     "Noise in the first channel (red, gray)",
8590                                                     0.0, 1.0, 0.0,
8591                                                     GIMP_PARAM_READWRITE));
8592   gimp_procedure_add_argument (procedure,
8593                                g_param_spec_double ("noise-2",
8594                                                     "noise 2",
8595                                                     "Noise in the second channel (green, gray_alpha)",
8596                                                     0.0, 1.0, 0.0,
8597                                                     GIMP_PARAM_READWRITE));
8598   gimp_procedure_add_argument (procedure,
8599                                g_param_spec_double ("noise-3",
8600                                                     "noise 3",
8601                                                     "Noise in the third channel (blue)",
8602                                                     0.0, 1.0, 0.0,
8603                                                     GIMP_PARAM_READWRITE));
8604   gimp_procedure_add_argument (procedure,
8605                                g_param_spec_double ("noise-4",
8606                                                     "noise 4",
8607                                                     "Noise in the fourth channel (alpha)",
8608                                                     0.0, 1.0, 0.0,
8609                                                     GIMP_PARAM_READWRITE));
8610   gimp_pdb_register_procedure (pdb, procedure);
8611   g_object_unref (procedure);
8612 
8613   /*
8614    * gimp-plug-in-sel-gauss
8615    */
8616   procedure = gimp_procedure_new (plug_in_sel_gauss_invoker);
8617   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8618                                "plug-in-sel-gauss");
8619   gimp_procedure_set_static_strings (procedure,
8620                                      "plug-in-sel-gauss",
8621                                      "Blur neighboring pixels, but only in low-contrast areas",
8622                                      "This filter functions similar to the regular gaussian blur filter except that neighbouring pixels that differ more than the given maxdelta parameter will not be blended with. This way with the correct parameters, an image can be smoothed out without losing details. However, this filter can be rather slow.",
8623                                      "Compatibility procedure. Please see 'gegl:gaussian-blur-selective' for credits.",
8624                                      "Compatibility procedure. Please see 'gegl:gaussian-blur-selective' for credits.",
8625                                      "2099",
8626                                      NULL);
8627   gimp_procedure_add_argument (procedure,
8628                                g_param_spec_enum ("run-mode",
8629                                                   "run mode",
8630                                                   "The run mode",
8631                                                   GIMP_TYPE_RUN_MODE,
8632                                                   GIMP_RUN_INTERACTIVE,
8633                                                   GIMP_PARAM_READWRITE));
8634   gimp_procedure_add_argument (procedure,
8635                                gimp_param_spec_image_id ("image",
8636                                                          "image",
8637                                                          "Input image (unused)",
8638                                                          pdb->gimp, FALSE,
8639                                                          GIMP_PARAM_READWRITE));
8640   gimp_procedure_add_argument (procedure,
8641                                gimp_param_spec_drawable_id ("drawable",
8642                                                             "drawable",
8643                                                             "Input drawable",
8644                                                             pdb->gimp, FALSE,
8645                                                             GIMP_PARAM_READWRITE));
8646   gimp_procedure_add_argument (procedure,
8647                                g_param_spec_double ("radius",
8648                                                     "radius",
8649                                                     "Radius of gaussian blur (in pixels)",
8650                                                     0.0, G_MAXDOUBLE, 0.0,
8651                                                     GIMP_PARAM_READWRITE));
8652   gimp_procedure_add_argument (procedure,
8653                                gimp_param_spec_int32 ("max-delta",
8654                                                       "max delta",
8655                                                       "Maximum delta",
8656                                                       0, 255, 0,
8657                                                       GIMP_PARAM_READWRITE));
8658   gimp_pdb_register_procedure (pdb, procedure);
8659   g_object_unref (procedure);
8660 
8661   /*
8662    * gimp-plug-in-semiflatten
8663    */
8664   procedure = gimp_procedure_new (plug_in_semiflatten_invoker);
8665   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8666                                "plug-in-semiflatten");
8667   gimp_procedure_set_static_strings (procedure,
8668                                      "plug-in-semiflatten",
8669                                      "Replace partial transparency with the current background color",
8670                                      "This plug-in flattens pixels in an RGBA image that aren't completely transparent against the current GIMP background color.",
8671                                      "Spencer Kimball & Peter Mattis",
8672                                      "Spencer Kimball & Peter Mattis",
8673                                      "1997",
8674                                      NULL);
8675   gimp_procedure_add_argument (procedure,
8676                                g_param_spec_enum ("run-mode",
8677                                                   "run mode",
8678                                                   "The run mode",
8679                                                   GIMP_TYPE_RUN_MODE,
8680                                                   GIMP_RUN_INTERACTIVE,
8681                                                   GIMP_PARAM_READWRITE));
8682   gimp_procedure_add_argument (procedure,
8683                                gimp_param_spec_image_id ("image",
8684                                                          "image",
8685                                                          "Input image (unused)",
8686                                                          pdb->gimp, FALSE,
8687                                                          GIMP_PARAM_READWRITE));
8688   gimp_procedure_add_argument (procedure,
8689                                gimp_param_spec_drawable_id ("drawable",
8690                                                             "drawable",
8691                                                             "Input drawable",
8692                                                             pdb->gimp, FALSE,
8693                                                             GIMP_PARAM_READWRITE));
8694   gimp_pdb_register_procedure (pdb, procedure);
8695   g_object_unref (procedure);
8696 
8697   /*
8698    * gimp-plug-in-shift
8699    */
8700   procedure = gimp_procedure_new (plug_in_shift_invoker);
8701   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8702                                "plug-in-shift");
8703   gimp_procedure_set_static_strings (procedure,
8704                                      "plug-in-shift",
8705                                      "Shift each row or column of pixels by a random amount",
8706                                      "Shifts the pixels of the specified drawable. Each row or column will be displaced a random value of pixels.",
8707                                      "Compatibility procedure. Please see 'gegl:shift' for credits.",
8708                                      "Compatibility procedure. Please see 'gegl:shift' for credits.",
8709                                      "2013",
8710                                      NULL);
8711   gimp_procedure_add_argument (procedure,
8712                                g_param_spec_enum ("run-mode",
8713                                                   "run mode",
8714                                                   "The run mode",
8715                                                   GIMP_TYPE_RUN_MODE,
8716                                                   GIMP_RUN_INTERACTIVE,
8717                                                   GIMP_PARAM_READWRITE));
8718   gimp_procedure_add_argument (procedure,
8719                                gimp_param_spec_image_id ("image",
8720                                                          "image",
8721                                                          "Input image (unused)",
8722                                                          pdb->gimp, FALSE,
8723                                                          GIMP_PARAM_READWRITE));
8724   gimp_procedure_add_argument (procedure,
8725                                gimp_param_spec_drawable_id ("drawable",
8726                                                             "drawable",
8727                                                             "Input drawable",
8728                                                             pdb->gimp, FALSE,
8729                                                             GIMP_PARAM_READWRITE));
8730   gimp_procedure_add_argument (procedure,
8731                                gimp_param_spec_int32 ("shift-amount",
8732                                                       "shift amount",
8733                                                       "Shift amount",
8734                                                       0, 200, 0,
8735                                                       GIMP_PARAM_READWRITE));
8736   gimp_procedure_add_argument (procedure,
8737                                gimp_param_spec_int32 ("orientation",
8738                                                       "orientation",
8739                                                       "Orientation { ORIENTATION-VERTICAL (0), ORIENTATION-HORIZONTAL (1) }",
8740                                                       0, 1, 0,
8741                                                       GIMP_PARAM_READWRITE));
8742   gimp_pdb_register_procedure (pdb, procedure);
8743   g_object_unref (procedure);
8744 
8745   /*
8746    * gimp-plug-in-sinus
8747    */
8748   procedure = gimp_procedure_new (plug_in_sinus_invoker);
8749   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8750                                "plug-in-sinus");
8751   gimp_procedure_set_static_strings (procedure,
8752                                      "plug-in-sinus",
8753                                      "Generate complex sinusoidal textures",
8754                                      "FIXME: sinus help",
8755                                      "Compatibility procedure. Please see 'gegl:sinus' for credits.",
8756                                      "Compatibility procedure. Please see 'gegl:sinus' for credits.",
8757                                      "2014",
8758                                      NULL);
8759   gimp_procedure_add_argument (procedure,
8760                                g_param_spec_enum ("run-mode",
8761                                                   "run mode",
8762                                                   "The run mode",
8763                                                   GIMP_TYPE_RUN_MODE,
8764                                                   GIMP_RUN_INTERACTIVE,
8765                                                   GIMP_PARAM_READWRITE));
8766   gimp_procedure_add_argument (procedure,
8767                                gimp_param_spec_image_id ("image",
8768                                                          "image",
8769                                                          "Input image (unused)",
8770                                                          pdb->gimp, FALSE,
8771                                                          GIMP_PARAM_READWRITE));
8772   gimp_procedure_add_argument (procedure,
8773                                gimp_param_spec_drawable_id ("drawable",
8774                                                             "drawable",
8775                                                             "Input drawable",
8776                                                             pdb->gimp, FALSE,
8777                                                             GIMP_PARAM_READWRITE));
8778   gimp_procedure_add_argument (procedure,
8779                                g_param_spec_double ("xscale",
8780                                                     "xscale",
8781                                                     "Scale value for x axis",
8782                                                     0, G_MAXDOUBLE, 0,
8783                                                     GIMP_PARAM_READWRITE));
8784   gimp_procedure_add_argument (procedure,
8785                                g_param_spec_double ("yscale",
8786                                                     "yscale",
8787                                                     "Scale value for y axis",
8788                                                     0, G_MAXDOUBLE, 0,
8789                                                     GIMP_PARAM_READWRITE));
8790   gimp_procedure_add_argument (procedure,
8791                                g_param_spec_double ("complex",
8792                                                     "complex",
8793                                                     "Complexity factor",
8794                                                     0, G_MAXDOUBLE, 0,
8795                                                     GIMP_PARAM_READWRITE));
8796   gimp_procedure_add_argument (procedure,
8797                                gimp_param_spec_int32 ("seed",
8798                                                       "seed",
8799                                                       "Seed value for random number generator",
8800                                                       0, G_MAXINT32, 0,
8801                                                       GIMP_PARAM_READWRITE));
8802   gimp_procedure_add_argument (procedure,
8803                                g_param_spec_boolean ("tiling",
8804                                                      "tiling",
8805                                                      "If set, the pattern generated will tile",
8806                                                      FALSE,
8807                                                      GIMP_PARAM_READWRITE));
8808   gimp_procedure_add_argument (procedure,
8809                                g_param_spec_boolean ("perturb",
8810                                                      "perturb",
8811                                                      "If set, the pattern is a little more distorted...",
8812                                                      FALSE,
8813                                                      GIMP_PARAM_READWRITE));
8814   gimp_procedure_add_argument (procedure,
8815                                gimp_param_spec_int32 ("colors",
8816                                                       "colors",
8817                                                       "where to take the colors (0=B&W, 1=fg/bg, 2=col1/col2)",
8818                                                       0, 2, 0,
8819                                                       GIMP_PARAM_READWRITE));
8820   gimp_procedure_add_argument (procedure,
8821                                gimp_param_spec_rgb ("col1",
8822                                                     "col1",
8823                                                     "fist color (sometimes unused)",
8824                                                     FALSE,
8825                                                     NULL,
8826                                                     GIMP_PARAM_READWRITE));
8827   gimp_procedure_add_argument (procedure,
8828                                gimp_param_spec_rgb ("col2",
8829                                                     "col2",
8830                                                     "second color (sometimes unused)",
8831                                                     FALSE,
8832                                                     NULL,
8833                                                     GIMP_PARAM_READWRITE));
8834   gimp_procedure_add_argument (procedure,
8835                                g_param_spec_double ("alpha1",
8836                                                     "alpha1",
8837                                                     "alpha for the first color (used if the drawable has an alpha channel)",
8838                                                     0, 1, 0,
8839                                                     GIMP_PARAM_READWRITE));
8840   gimp_procedure_add_argument (procedure,
8841                                g_param_spec_double ("alpha2",
8842                                                     "alpha2",
8843                                                     "alpha for the second color (used if the drawable has an alpha channel)",
8844                                                     0, 1, 0,
8845                                                     GIMP_PARAM_READWRITE));
8846   gimp_procedure_add_argument (procedure,
8847                                gimp_param_spec_int32 ("blend",
8848                                                       "blend",
8849                                                       "0=linear, 1=bilinear, 2=sinusoidal",
8850                                                       0, 2, 0,
8851                                                       GIMP_PARAM_READWRITE));
8852   gimp_procedure_add_argument (procedure,
8853                                g_param_spec_double ("blend-power",
8854                                                     "blend power",
8855                                                     "Power used to stretch the blend",
8856                                                     -G_MAXDOUBLE, G_MAXDOUBLE, 0,
8857                                                     GIMP_PARAM_READWRITE));
8858   gimp_pdb_register_procedure (pdb, procedure);
8859   g_object_unref (procedure);
8860 
8861   /*
8862    * gimp-plug-in-sobel
8863    */
8864   procedure = gimp_procedure_new (plug_in_sobel_invoker);
8865   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8866                                "plug-in-sobel");
8867   gimp_procedure_set_static_strings (procedure,
8868                                      "plug-in-sobel",
8869                                      "Specialized direction-dependent edge detection",
8870                                      "This plug-in calculates the gradient with a sobel operator. The user can specify which direction to use. When both directions are used, the result is the RMS of the two gradients; if only one direction is used, the result either the absolute value of the gradient, or 127 + gradient (if the 'keep sign' switch is on). This way, information about the direction of the gradient is preserved. Resulting images are not autoscaled.\"",
8871                                      "Compatibility procedure. Please see 'gegl:edge-sobel' for credits.",
8872                                      "Compatibility procedure. Please see 'gegl:edge-sobel' for credits.",
8873                                      "2014",
8874                                      NULL);
8875   gimp_procedure_add_argument (procedure,
8876                                g_param_spec_enum ("run-mode",
8877                                                   "run mode",
8878                                                   "The run mode",
8879                                                   GIMP_TYPE_RUN_MODE,
8880                                                   GIMP_RUN_INTERACTIVE,
8881                                                   GIMP_PARAM_READWRITE));
8882   gimp_procedure_add_argument (procedure,
8883                                gimp_param_spec_image_id ("image",
8884                                                          "image",
8885                                                          "Input image (unused)",
8886                                                          pdb->gimp, FALSE,
8887                                                          GIMP_PARAM_READWRITE));
8888   gimp_procedure_add_argument (procedure,
8889                                gimp_param_spec_drawable_id ("drawable",
8890                                                             "drawable",
8891                                                             "Input drawable",
8892                                                             pdb->gimp, FALSE,
8893                                                             GIMP_PARAM_READWRITE));
8894   gimp_procedure_add_argument (procedure,
8895                                g_param_spec_boolean ("horizontal",
8896                                                      "horizontal",
8897                                                      "Sobel in horizontal direction",
8898                                                      FALSE,
8899                                                      GIMP_PARAM_READWRITE));
8900   gimp_procedure_add_argument (procedure,
8901                                g_param_spec_boolean ("vertical",
8902                                                      "vertical",
8903                                                      "Sobel in vertical direction",
8904                                                      FALSE,
8905                                                      GIMP_PARAM_READWRITE));
8906   gimp_procedure_add_argument (procedure,
8907                                g_param_spec_boolean ("keep-sign",
8908                                                      "keep sign",
8909                                                      "Keep sign of result (one direction only)",
8910                                                      FALSE,
8911                                                      GIMP_PARAM_READWRITE));
8912   gimp_pdb_register_procedure (pdb, procedure);
8913   g_object_unref (procedure);
8914 
8915   /*
8916    * gimp-plug-in-solid-noise
8917    */
8918   procedure = gimp_procedure_new (plug_in_solid_noise_invoker);
8919   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8920                                "plug-in-solid-noise");
8921   gimp_procedure_set_static_strings (procedure,
8922                                      "plug-in-solid-noise",
8923                                      "Create a random cloud-like texture",
8924                                      "Generates 2D textures using Perlin's classic solid noise function.",
8925                                      "Compatibility procedure. Please see 'gegl:noise-solid' for credits.",
8926                                      "Compatibility procedure. Please see 'gegl:noise-solid' for credits.",
8927                                      "2014",
8928                                      NULL);
8929   gimp_procedure_add_argument (procedure,
8930                                g_param_spec_enum ("run-mode",
8931                                                   "run mode",
8932                                                   "The run mode",
8933                                                   GIMP_TYPE_RUN_MODE,
8934                                                   GIMP_RUN_INTERACTIVE,
8935                                                   GIMP_PARAM_READWRITE));
8936   gimp_procedure_add_argument (procedure,
8937                                gimp_param_spec_image_id ("image",
8938                                                          "image",
8939                                                          "Input image (unused)",
8940                                                          pdb->gimp, FALSE,
8941                                                          GIMP_PARAM_READWRITE));
8942   gimp_procedure_add_argument (procedure,
8943                                gimp_param_spec_drawable_id ("drawable",
8944                                                             "drawable",
8945                                                             "Input drawable",
8946                                                             pdb->gimp, FALSE,
8947                                                             GIMP_PARAM_READWRITE));
8948   gimp_procedure_add_argument (procedure,
8949                                g_param_spec_boolean ("tileable",
8950                                                      "tileable",
8951                                                      "Create a tileable output",
8952                                                      FALSE,
8953                                                      GIMP_PARAM_READWRITE));
8954   gimp_procedure_add_argument (procedure,
8955                                g_param_spec_boolean ("turbulent",
8956                                                      "turbulent",
8957                                                      "Make a turbulent noise",
8958                                                      FALSE,
8959                                                      GIMP_PARAM_READWRITE));
8960   gimp_procedure_add_argument (procedure,
8961                                gimp_param_spec_int32 ("seed",
8962                                                       "seed",
8963                                                       "Random seed",
8964                                                       G_MININT32, G_MAXINT32, 0,
8965                                                       GIMP_PARAM_READWRITE));
8966   gimp_procedure_add_argument (procedure,
8967                                gimp_param_spec_int32 ("detail",
8968                                                       "detail",
8969                                                       "Detail level",
8970                                                       0, 15, 0,
8971                                                       GIMP_PARAM_READWRITE));
8972   gimp_procedure_add_argument (procedure,
8973                                g_param_spec_double ("xsize",
8974                                                     "xsize",
8975                                                     "Horizontal texture size",
8976                                                     -G_MAXDOUBLE, G_MAXDOUBLE, 0,
8977                                                     GIMP_PARAM_READWRITE));
8978   gimp_procedure_add_argument (procedure,
8979                                g_param_spec_double ("ysize",
8980                                                     "ysize",
8981                                                     "Vertical texture size",
8982                                                     -G_MAXDOUBLE, G_MAXDOUBLE, 0,
8983                                                     GIMP_PARAM_READWRITE));
8984   gimp_pdb_register_procedure (pdb, procedure);
8985   g_object_unref (procedure);
8986 
8987   /*
8988    * gimp-plug-in-spread
8989    */
8990   procedure = gimp_procedure_new (plug_in_spread_invoker);
8991   gimp_object_set_static_name (GIMP_OBJECT (procedure),
8992                                "plug-in-spread");
8993   gimp_procedure_set_static_strings (procedure,
8994                                      "plug-in-spread",
8995                                      "Move pixels around randomly",
8996                                      "Spreads the pixels of the specified drawable. Pixels are randomly moved to another location whose distance varies from the original by the horizontal and vertical spread amounts.",
8997                                      "Compatibility procedure. Please see 'gegl:noise-spread' for credits.",
8998                                      "Compatibility procedure. Please see 'gegl:noise-spread' for credits.",
8999                                      "2013",
9000                                      NULL);
9001   gimp_procedure_add_argument (procedure,
9002                                g_param_spec_enum ("run-mode",
9003                                                   "run mode",
9004                                                   "The run mode",
9005                                                   GIMP_TYPE_RUN_MODE,
9006                                                   GIMP_RUN_INTERACTIVE,
9007                                                   GIMP_PARAM_READWRITE));
9008   gimp_procedure_add_argument (procedure,
9009                                gimp_param_spec_image_id ("image",
9010                                                          "image",
9011                                                          "Input image (unused)",
9012                                                          pdb->gimp, FALSE,
9013                                                          GIMP_PARAM_READWRITE));
9014   gimp_procedure_add_argument (procedure,
9015                                gimp_param_spec_drawable_id ("drawable",
9016                                                             "drawable",
9017                                                             "Input drawable",
9018                                                             pdb->gimp, FALSE,
9019                                                             GIMP_PARAM_READWRITE));
9020   gimp_procedure_add_argument (procedure,
9021                                g_param_spec_double ("spread-amount-x",
9022                                                     "spread amount x",
9023                                                     "Horizontal spread amount",
9024                                                     0, 200, 0,
9025                                                     GIMP_PARAM_READWRITE));
9026   gimp_procedure_add_argument (procedure,
9027                                g_param_spec_double ("spread-amount-y",
9028                                                     "spread amount y",
9029                                                     "Vertical spread amount",
9030                                                     0, 200, 0,
9031                                                     GIMP_PARAM_READWRITE));
9032   gimp_pdb_register_procedure (pdb, procedure);
9033   g_object_unref (procedure);
9034 
9035   /*
9036    * gimp-plug-in-threshold-alpha
9037    */
9038   procedure = gimp_procedure_new (plug_in_threshold_alpha_invoker);
9039   gimp_object_set_static_name (GIMP_OBJECT (procedure),
9040                                "plug-in-threshold-alpha");
9041   gimp_procedure_set_static_strings (procedure,
9042                                      "plug-in-threshold-alpha",
9043                                      "Make transparency all-or-nothing",
9044                                      "Make transparency all-or-nothing.",
9045                                      "Spencer Kimball & Peter Mattis",
9046                                      "Spencer Kimball & Peter Mattis",
9047                                      "1997",
9048                                      NULL);
9049   gimp_procedure_add_argument (procedure,
9050                                g_param_spec_enum ("run-mode",
9051                                                   "run mode",
9052                                                   "The run mode",
9053                                                   GIMP_TYPE_RUN_MODE,
9054                                                   GIMP_RUN_INTERACTIVE,
9055                                                   GIMP_PARAM_READWRITE));
9056   gimp_procedure_add_argument (procedure,
9057                                gimp_param_spec_image_id ("image",
9058                                                          "image",
9059                                                          "Input image (unused)",
9060                                                          pdb->gimp, FALSE,
9061                                                          GIMP_PARAM_READWRITE));
9062   gimp_procedure_add_argument (procedure,
9063                                gimp_param_spec_drawable_id ("drawable",
9064                                                             "drawable",
9065                                                             "Input drawable",
9066                                                             pdb->gimp, FALSE,
9067                                                             GIMP_PARAM_READWRITE));
9068   gimp_procedure_add_argument (procedure,
9069                                gimp_param_spec_int32 ("threshold",
9070                                                       "threshold",
9071                                                       "Threshold",
9072                                                       0, 255, 0,
9073                                                       GIMP_PARAM_READWRITE));
9074   gimp_pdb_register_procedure (pdb, procedure);
9075   g_object_unref (procedure);
9076 
9077   /*
9078    * gimp-plug-in-unsharp-mask
9079    */
9080   procedure = gimp_procedure_new (plug_in_unsharp_mask_invoker);
9081   gimp_object_set_static_name (GIMP_OBJECT (procedure),
9082                                "plug-in-unsharp-mask");
9083   gimp_procedure_set_static_strings (procedure,
9084                                      "plug-in-unsharp-mask",
9085                                      "The most widely useful method for sharpening an image",
9086                                      "The unsharp mask is a sharpening filter that works by comparing using the difference of the image and a blurred version of the image. It is commonly used on photographic images, and is provides a much more pleasing result than the standard sharpen filter.",
9087                                      "Compatibility procedure. Please see 'gegl:unsharp-mask' for credits.",
9088                                      "Compatibility procedure. Please see 'gegl:unsharp-mask' for credits.",
9089                                      "2018",
9090                                      NULL);
9091   gimp_procedure_add_argument (procedure,
9092                                g_param_spec_enum ("run-mode",
9093                                                   "run mode",
9094                                                   "The run mode",
9095                                                   GIMP_TYPE_RUN_MODE,
9096                                                   GIMP_RUN_INTERACTIVE,
9097                                                   GIMP_PARAM_READWRITE));
9098   gimp_procedure_add_argument (procedure,
9099                                gimp_param_spec_image_id ("image",
9100                                                          "image",
9101                                                          "Input image (unused)",
9102                                                          pdb->gimp, FALSE,
9103                                                          GIMP_PARAM_READWRITE));
9104   gimp_procedure_add_argument (procedure,
9105                                gimp_param_spec_drawable_id ("drawable",
9106                                                             "drawable",
9107                                                             "Input drawable",
9108                                                             pdb->gimp, FALSE,
9109                                                             GIMP_PARAM_READWRITE));
9110   gimp_procedure_add_argument (procedure,
9111                                g_param_spec_double ("radius",
9112                                                     "radius",
9113                                                     "Radius of gaussian blur",
9114                                                     0.0, 300.0, 0.0,
9115                                                     GIMP_PARAM_READWRITE));
9116   gimp_procedure_add_argument (procedure,
9117                                g_param_spec_double ("amount",
9118                                                     "amount",
9119                                                     "Strength of effect",
9120                                                     0.0, 300.0, 0.0,
9121                                                     GIMP_PARAM_READWRITE));
9122   gimp_procedure_add_argument (procedure,
9123                                gimp_param_spec_int32 ("threshold",
9124                                                       "threshold",
9125                                                       "Threshold",
9126                                                       0, 255, 0,
9127                                                       GIMP_PARAM_READWRITE));
9128   gimp_pdb_register_procedure (pdb, procedure);
9129   g_object_unref (procedure);
9130 
9131   /*
9132    * gimp-plug-in-video
9133    */
9134   procedure = gimp_procedure_new (plug_in_video_invoker);
9135   gimp_object_set_static_name (GIMP_OBJECT (procedure),
9136                                "plug-in-video");
9137   gimp_procedure_set_static_strings (procedure,
9138                                      "plug-in-video",
9139                                      "Simulate distortion produced by a fuzzy or low-res monitor",
9140                                      "This function simulates the degradation of being on an old low-dotpitch RGB video monitor to the specified drawable.",
9141                                      "Compatibility procedure. Please see 'gegl:video-degradation' for credits.",
9142                                      "Compatibility procedure. Please see 'gegl:video-degradation' for credits.",
9143                                      "2014",
9144                                      NULL);
9145   gimp_procedure_add_argument (procedure,
9146                                g_param_spec_enum ("run-mode",
9147                                                   "run mode",
9148                                                   "The run mode",
9149                                                   GIMP_TYPE_RUN_MODE,
9150                                                   GIMP_RUN_INTERACTIVE,
9151                                                   GIMP_PARAM_READWRITE));
9152   gimp_procedure_add_argument (procedure,
9153                                gimp_param_spec_image_id ("image",
9154                                                          "image",
9155                                                          "Input image (unused)",
9156                                                          pdb->gimp, FALSE,
9157                                                          GIMP_PARAM_READWRITE));
9158   gimp_procedure_add_argument (procedure,
9159                                gimp_param_spec_drawable_id ("drawable",
9160                                                             "drawable",
9161                                                             "Input drawable",
9162                                                             pdb->gimp, FALSE,
9163                                                             GIMP_PARAM_READWRITE));
9164   gimp_procedure_add_argument (procedure,
9165                                gimp_param_spec_int32 ("pattern-number",
9166                                                       "pattern number",
9167                                                       "Type of RGB pattern to use",
9168                                                       0, 8, 0,
9169                                                       GIMP_PARAM_READWRITE));
9170   gimp_procedure_add_argument (procedure,
9171                                g_param_spec_boolean ("additive",
9172                                                      "additive",
9173                                                      "Whether the function adds the result to the original image",
9174                                                      FALSE,
9175                                                      GIMP_PARAM_READWRITE));
9176   gimp_procedure_add_argument (procedure,
9177                                g_param_spec_boolean ("rotated",
9178                                                      "rotated",
9179                                                      "Whether to rotate the RGB pattern by ninety degrees",
9180                                                      FALSE,
9181                                                      GIMP_PARAM_READWRITE));
9182   gimp_pdb_register_procedure (pdb, procedure);
9183   g_object_unref (procedure);
9184 
9185   /*
9186    * gimp-plug-in-vinvert
9187    */
9188   procedure = gimp_procedure_new (plug_in_vinvert_invoker);
9189   gimp_object_set_static_name (GIMP_OBJECT (procedure),
9190                                "plug-in-vinvert");
9191   gimp_procedure_set_static_strings (procedure,
9192                                      "plug-in-vinvert",
9193                                      "Invert the brightness of each pixel",
9194                                      "This function takes an indexed/RGB image and inverts its 'value' in HSV space. The upshot of this is that the color and saturation at any given point remains the same, but its brightness is effectively inverted. Quite strange. Sometimes produces unpleasant color artifacts on images from lossy sources (ie. JPEG).",
9195                                      "Spencer Kimball & Peter Mattis",
9196                                      "Spencer Kimball & Peter Mattis",
9197                                      "1997",
9198                                      NULL);
9199   gimp_procedure_add_argument (procedure,
9200                                g_param_spec_enum ("run-mode",
9201                                                   "run mode",
9202                                                   "The run mode",
9203                                                   GIMP_TYPE_RUN_MODE,
9204                                                   GIMP_RUN_INTERACTIVE,
9205                                                   GIMP_PARAM_READWRITE));
9206   gimp_procedure_add_argument (procedure,
9207                                gimp_param_spec_image_id ("image",
9208                                                          "image",
9209                                                          "Input image (unused)",
9210                                                          pdb->gimp, FALSE,
9211                                                          GIMP_PARAM_READWRITE));
9212   gimp_procedure_add_argument (procedure,
9213                                gimp_param_spec_drawable_id ("drawable",
9214                                                             "drawable",
9215                                                             "Input drawable",
9216                                                             pdb->gimp, FALSE,
9217                                                             GIMP_PARAM_READWRITE));
9218   gimp_pdb_register_procedure (pdb, procedure);
9219   g_object_unref (procedure);
9220 
9221   /*
9222    * gimp-plug-in-vpropagate
9223    */
9224   procedure = gimp_procedure_new (plug_in_vpropagate_invoker);
9225   gimp_object_set_static_name (GIMP_OBJECT (procedure),
9226                                "plug-in-vpropagate");
9227   gimp_procedure_set_static_strings (procedure,
9228                                      "plug-in-vpropagate",
9229                                      "Propagate certain colors to neighboring pixels",
9230                                      "Propagate values of the layer.",
9231                                      "Compatibility procedure. Please see 'gegl:value-propagate' for credits.",
9232                                      "Compatibility procedure. Please see 'gegl:value-propagate' for credits.",
9233                                      "2015",
9234                                      NULL);
9235   gimp_procedure_add_argument (procedure,
9236                                g_param_spec_enum ("run-mode",
9237                                                   "run mode",
9238                                                   "The run mode",
9239                                                   GIMP_TYPE_RUN_MODE,
9240                                                   GIMP_RUN_INTERACTIVE,
9241                                                   GIMP_PARAM_READWRITE));
9242   gimp_procedure_add_argument (procedure,
9243                                gimp_param_spec_image_id ("image",
9244                                                          "image",
9245                                                          "Input image (unused)",
9246                                                          pdb->gimp, FALSE,
9247                                                          GIMP_PARAM_READWRITE));
9248   gimp_procedure_add_argument (procedure,
9249                                gimp_param_spec_drawable_id ("drawable",
9250                                                             "drawable",
9251                                                             "Input drawable",
9252                                                             pdb->gimp, FALSE,
9253                                                             GIMP_PARAM_READWRITE));
9254   gimp_procedure_add_argument (procedure,
9255                                gimp_param_spec_int32 ("propagate-mode",
9256                                                       "propagate mode",
9257                                                       "Propagate mode { 0:white, 1:black, 2:middle value 3:foreground to peak, 4:foreground, 5:background, 6:opaque, 7:transparent }",
9258                                                       0, 7, 0,
9259                                                       GIMP_PARAM_READWRITE));
9260   gimp_procedure_add_argument (procedure,
9261                                gimp_param_spec_int32 ("propagating-channel",
9262                                                       "propagating channel",
9263                                                       "Channels which values are propagated",
9264                                                       G_MININT32, G_MAXINT32, 0,
9265                                                       GIMP_PARAM_READWRITE));
9266   gimp_procedure_add_argument (procedure,
9267                                g_param_spec_double ("propagating-rate",
9268                                                     "propagating rate",
9269                                                     "Propagating rate",
9270                                                     0.0, 1.0, 0.0,
9271                                                     GIMP_PARAM_READWRITE));
9272   gimp_procedure_add_argument (procedure,
9273                                gimp_param_spec_int32 ("direction-mask",
9274                                                       "direction mask",
9275                                                       "Direction mask",
9276                                                       0, 15, 0,
9277                                                       GIMP_PARAM_READWRITE));
9278   gimp_procedure_add_argument (procedure,
9279                                gimp_param_spec_int32 ("lower-limit",
9280                                                       "lower limit",
9281                                                       "Lower limit",
9282                                                       0, 255, 0,
9283                                                       GIMP_PARAM_READWRITE));
9284   gimp_procedure_add_argument (procedure,
9285                                gimp_param_spec_int32 ("upper-limit",
9286                                                       "upper limit",
9287                                                       "Upper limit",
9288                                                       0, 255, 0,
9289                                                       GIMP_PARAM_READWRITE));
9290   gimp_pdb_register_procedure (pdb, procedure);
9291   g_object_unref (procedure);
9292 
9293   /*
9294    * gimp-plug-in-dilate
9295    */
9296   procedure = gimp_procedure_new (plug_in_dilate_invoker);
9297   gimp_object_set_static_name (GIMP_OBJECT (procedure),
9298                                "plug-in-dilate");
9299   gimp_procedure_set_static_strings (procedure,
9300                                      "plug-in-dilate",
9301                                      "Grow lighter areas of the image",
9302                                      "Dilate image.",
9303                                      "Compatibility procedure. Please see 'gegl:value-propagate' for credits.",
9304                                      "Compatibility procedure. Please see 'gegl:value-propagate' for credits.",
9305                                      "2015",
9306                                      NULL);
9307   gimp_procedure_add_argument (procedure,
9308                                g_param_spec_enum ("run-mode",
9309                                                   "run mode",
9310                                                   "The run mode",
9311                                                   GIMP_TYPE_RUN_MODE,
9312                                                   GIMP_RUN_INTERACTIVE,
9313                                                   GIMP_PARAM_READWRITE));
9314   gimp_procedure_add_argument (procedure,
9315                                gimp_param_spec_image_id ("image",
9316                                                          "image",
9317                                                          "Input image (unused)",
9318                                                          pdb->gimp, FALSE,
9319                                                          GIMP_PARAM_READWRITE));
9320   gimp_procedure_add_argument (procedure,
9321                                gimp_param_spec_drawable_id ("drawable",
9322                                                             "drawable",
9323                                                             "Input drawable",
9324                                                             pdb->gimp, FALSE,
9325                                                             GIMP_PARAM_READWRITE));
9326   gimp_procedure_add_argument (procedure,
9327                                gimp_param_spec_int32 ("propagate-mode",
9328                                                       "propagate mode",
9329                                                       "Propagate mode { 0:white, 1:black, 2:middle value 3:foreground to peak, 4:foreground, 5:background, 6:opaque, 7:transparent }",
9330                                                       0, 7, 0,
9331                                                       GIMP_PARAM_READWRITE));
9332   gimp_procedure_add_argument (procedure,
9333                                gimp_param_spec_int32 ("propagating-channel",
9334                                                       "propagating channel",
9335                                                       "Channels which values are propagated",
9336                                                       G_MININT32, G_MAXINT32, 0,
9337                                                       GIMP_PARAM_READWRITE));
9338   gimp_procedure_add_argument (procedure,
9339                                g_param_spec_double ("propagating-rate",
9340                                                     "propagating rate",
9341                                                     "Propagating rate",
9342                                                     0.0, 1.0, 0.0,
9343                                                     GIMP_PARAM_READWRITE));
9344   gimp_procedure_add_argument (procedure,
9345                                gimp_param_spec_int32 ("direction-mask",
9346                                                       "direction mask",
9347                                                       "Direction mask",
9348                                                       0, 15, 0,
9349                                                       GIMP_PARAM_READWRITE));
9350   gimp_procedure_add_argument (procedure,
9351                                gimp_param_spec_int32 ("lower-limit",
9352                                                       "lower limit",
9353                                                       "Lower limit",
9354                                                       0, 255, 0,
9355                                                       GIMP_PARAM_READWRITE));
9356   gimp_procedure_add_argument (procedure,
9357                                gimp_param_spec_int32 ("upper-limit",
9358                                                       "upper limit",
9359                                                       "Upper limit",
9360                                                       0, 255, 0,
9361                                                       GIMP_PARAM_READWRITE));
9362   gimp_pdb_register_procedure (pdb, procedure);
9363   g_object_unref (procedure);
9364 
9365   /*
9366    * gimp-plug-in-erode
9367    */
9368   procedure = gimp_procedure_new (plug_in_erode_invoker);
9369   gimp_object_set_static_name (GIMP_OBJECT (procedure),
9370                                "plug-in-erode");
9371   gimp_procedure_set_static_strings (procedure,
9372                                      "plug-in-erode",
9373                                      "Shrink lighter areas of the image",
9374                                      "Erode image.",
9375                                      "Compatibility procedure. Please see 'gegl:value-propagate' for credits.",
9376                                      "Compatibility procedure. Please see 'gegl:value-propagate' for credits.",
9377                                      "2015",
9378                                      NULL);
9379   gimp_procedure_add_argument (procedure,
9380                                g_param_spec_enum ("run-mode",
9381                                                   "run mode",
9382                                                   "The run mode",
9383                                                   GIMP_TYPE_RUN_MODE,
9384                                                   GIMP_RUN_INTERACTIVE,
9385                                                   GIMP_PARAM_READWRITE));
9386   gimp_procedure_add_argument (procedure,
9387                                gimp_param_spec_image_id ("image",
9388                                                          "image",
9389                                                          "Input image (unused)",
9390                                                          pdb->gimp, FALSE,
9391                                                          GIMP_PARAM_READWRITE));
9392   gimp_procedure_add_argument (procedure,
9393                                gimp_param_spec_drawable_id ("drawable",
9394                                                             "drawable",
9395                                                             "Input drawable",
9396                                                             pdb->gimp, FALSE,
9397                                                             GIMP_PARAM_READWRITE));
9398   gimp_procedure_add_argument (procedure,
9399                                gimp_param_spec_int32 ("propagate-mode",
9400                                                       "propagate mode",
9401                                                       "Propagate mode { 0:white, 1:black, 2:middle value 3:foreground to peak, 4:foreground, 5:background, 6:opaque, 7:transparent }",
9402                                                       0, 7, 0,
9403                                                       GIMP_PARAM_READWRITE));
9404   gimp_procedure_add_argument (procedure,
9405                                gimp_param_spec_int32 ("propagating-channel",
9406                                                       "propagating channel",
9407                                                       "Channels which values are propagated",
9408                                                       G_MININT32, G_MAXINT32, 0,
9409                                                       GIMP_PARAM_READWRITE));
9410   gimp_procedure_add_argument (procedure,
9411                                g_param_spec_double ("propagating-rate",
9412                                                     "propagating rate",
9413                                                     "Propagating rate",
9414                                                     0.0, 1.0, 0.0,
9415                                                     GIMP_PARAM_READWRITE));
9416   gimp_procedure_add_argument (procedure,
9417                                gimp_param_spec_int32 ("direction-mask",
9418                                                       "direction mask",
9419                                                       "Direction mask",
9420                                                       0, 15, 0,
9421                                                       GIMP_PARAM_READWRITE));
9422   gimp_procedure_add_argument (procedure,
9423                                gimp_param_spec_int32 ("lower-limit",
9424                                                       "lower limit",
9425                                                       "Lower limit",
9426                                                       0, 255, 0,
9427                                                       GIMP_PARAM_READWRITE));
9428   gimp_procedure_add_argument (procedure,
9429                                gimp_param_spec_int32 ("upper-limit",
9430                                                       "upper limit",
9431                                                       "Upper limit",
9432                                                       0, 255, 0,
9433                                                       GIMP_PARAM_READWRITE));
9434   gimp_pdb_register_procedure (pdb, procedure);
9435   g_object_unref (procedure);
9436 
9437   /*
9438    * gimp-plug-in-waves
9439    */
9440   procedure = gimp_procedure_new (plug_in_waves_invoker);
9441   gimp_object_set_static_name (GIMP_OBJECT (procedure),
9442                                "plug-in-waves");
9443   gimp_procedure_set_static_strings (procedure,
9444                                      "plug-in-waves",
9445                                      "Distort the image with waves",
9446                                      "Distort the image with waves.",
9447                                      "Compatibility procedure. Please see 'gegl:waves' for credits.",
9448                                      "Compatibility procedure. Please see 'gegl:waves' for credits.",
9449                                      "2013",
9450                                      NULL);
9451   gimp_procedure_add_argument (procedure,
9452                                g_param_spec_enum ("run-mode",
9453                                                   "run mode",
9454                                                   "The run mode",
9455                                                   GIMP_TYPE_RUN_MODE,
9456                                                   GIMP_RUN_INTERACTIVE,
9457                                                   GIMP_PARAM_READWRITE));
9458   gimp_procedure_add_argument (procedure,
9459                                gimp_param_spec_image_id ("image",
9460                                                          "image",
9461                                                          "Input image (unused)",
9462                                                          pdb->gimp, FALSE,
9463                                                          GIMP_PARAM_READWRITE));
9464   gimp_procedure_add_argument (procedure,
9465                                gimp_param_spec_drawable_id ("drawable",
9466                                                             "drawable",
9467                                                             "Input drawable",
9468                                                             pdb->gimp, FALSE,
9469                                                             GIMP_PARAM_READWRITE));
9470   gimp_procedure_add_argument (procedure,
9471                                g_param_spec_double ("amplitude",
9472                                                     "amplitude",
9473                                                     "The Amplitude of the Waves",
9474                                                     0, 101, 0,
9475                                                     GIMP_PARAM_READWRITE));
9476   gimp_procedure_add_argument (procedure,
9477                                g_param_spec_double ("phase",
9478                                                     "phase",
9479                                                     "The Phase of the Waves",
9480                                                     -360, 360, -360,
9481                                                     GIMP_PARAM_READWRITE));
9482   gimp_procedure_add_argument (procedure,
9483                                g_param_spec_double ("wavelength",
9484                                                     "wavelength",
9485                                                     "The Wavelength of the Waves",
9486                                                     0.1, 50, 0.1,
9487                                                     GIMP_PARAM_READWRITE));
9488   gimp_procedure_add_argument (procedure,
9489                                g_param_spec_boolean ("type",
9490                                                      "type",
9491                                                      "Type of waves: { 0 = smeared, 1 = black }",
9492                                                      FALSE,
9493                                                      GIMP_PARAM_READWRITE));
9494   gimp_procedure_add_argument (procedure,
9495                                g_param_spec_boolean ("reflective",
9496                                                      "reflective",
9497                                                      "Use Reflection (not implemented)",
9498                                                      FALSE,
9499                                                      GIMP_PARAM_READWRITE));
9500   gimp_pdb_register_procedure (pdb, procedure);
9501   g_object_unref (procedure);
9502 
9503   /*
9504    * gimp-plug-in-whirl-pinch
9505    */
9506   procedure = gimp_procedure_new (plug_in_whirl_pinch_invoker);
9507   gimp_object_set_static_name (GIMP_OBJECT (procedure),
9508                                "plug-in-whirl-pinch");
9509   gimp_procedure_set_static_strings (procedure,
9510                                      "plug-in-whirl-pinch",
9511                                      "Distort an image by whirling and pinching",
9512                                      "Distorts the image by whirling and pinching, which are two common center-based, circular distortions. Whirling is like projecting the image onto the surface of water in a toilet and flushing. Pinching is similar to projecting the image onto an elastic surface and pressing or pulling on the center of the surface.",
9513                                      "Compatibility procedure. Please see 'gegl:whirl-pinch' for credits.",
9514                                      "Compatibility procedure. Please see 'gegl:whirl-pinch' for credits.",
9515                                      "2013",
9516                                      NULL);
9517   gimp_procedure_add_argument (procedure,
9518                                g_param_spec_enum ("run-mode",
9519                                                   "run mode",
9520                                                   "The run mode",
9521                                                   GIMP_TYPE_RUN_MODE,
9522                                                   GIMP_RUN_INTERACTIVE,
9523                                                   GIMP_PARAM_READWRITE));
9524   gimp_procedure_add_argument (procedure,
9525                                gimp_param_spec_image_id ("image",
9526                                                          "image",
9527                                                          "Input image (unused)",
9528                                                          pdb->gimp, FALSE,
9529                                                          GIMP_PARAM_READWRITE));
9530   gimp_procedure_add_argument (procedure,
9531                                gimp_param_spec_drawable_id ("drawable",
9532                                                             "drawable",
9533                                                             "Input drawable",
9534                                                             pdb->gimp, FALSE,
9535                                                             GIMP_PARAM_READWRITE));
9536   gimp_procedure_add_argument (procedure,
9537                                g_param_spec_double ("whirl",
9538                                                     "whirl",
9539                                                     "Whirl angle (degrees)",
9540                                                     -720, 720, -720,
9541                                                     GIMP_PARAM_READWRITE));
9542   gimp_procedure_add_argument (procedure,
9543                                g_param_spec_double ("pinch",
9544                                                     "pinch",
9545                                                     "Pinch amount",
9546                                                     -1, 1, -1,
9547                                                     GIMP_PARAM_READWRITE));
9548   gimp_procedure_add_argument (procedure,
9549                                g_param_spec_double ("radius",
9550                                                     "radius",
9551                                                     "Radius (1.0 is the largest circle that fits in the image, and 2.0 goes all the way to the corners)",
9552                                                     0, 2, 0,
9553                                                     GIMP_PARAM_READWRITE));
9554   gimp_pdb_register_procedure (pdb, procedure);
9555   g_object_unref (procedure);
9556 
9557   /*
9558    * gimp-plug-in-wind
9559    */
9560   procedure = gimp_procedure_new (plug_in_wind_invoker);
9561   gimp_object_set_static_name (GIMP_OBJECT (procedure),
9562                                "plug-in-wind");
9563   gimp_procedure_set_static_strings (procedure,
9564                                      "plug-in-wind",
9565                                      "Smear image to give windblown effect",
9566                                      "Renders a wind effect.",
9567                                      "Compatibility procedure. Please see 'gegl:wind' for credits.",
9568                                      "Compatibility procedure. Please see 'gegl:wind' for credits.",
9569                                      "2015",
9570                                      NULL);
9571   gimp_procedure_add_argument (procedure,
9572                                g_param_spec_enum ("run-mode",
9573                                                   "run mode",
9574                                                   "The run mode",
9575                                                   GIMP_TYPE_RUN_MODE,
9576                                                   GIMP_RUN_INTERACTIVE,
9577                                                   GIMP_PARAM_READWRITE));
9578   gimp_procedure_add_argument (procedure,
9579                                gimp_param_spec_image_id ("image",
9580                                                          "image",
9581                                                          "Input image (unused)",
9582                                                          pdb->gimp, FALSE,
9583                                                          GIMP_PARAM_READWRITE));
9584   gimp_procedure_add_argument (procedure,
9585                                gimp_param_spec_drawable_id ("drawable",
9586                                                             "drawable",
9587                                                             "Input drawable",
9588                                                             pdb->gimp, FALSE,
9589                                                             GIMP_PARAM_READWRITE));
9590   gimp_procedure_add_argument (procedure,
9591                                gimp_param_spec_int32 ("threshold",
9592                                                       "threshold",
9593                                                       "Controls where blending will be done",
9594                                                       0, 50, 0,
9595                                                       GIMP_PARAM_READWRITE));
9596   gimp_procedure_add_argument (procedure,
9597                                gimp_param_spec_int32 ("direction",
9598                                                       "direction",
9599                                                       "Wind direction { 0:left, 1:right, 2:top, 3:bottom }",
9600                                                       0, 3, 0,
9601                                                       GIMP_PARAM_READWRITE));
9602   gimp_procedure_add_argument (procedure,
9603                                gimp_param_spec_int32 ("strength",
9604                                                       "strength",
9605                                                       "Controls the extent of the blending",
9606                                                       1, 100, 1,
9607                                                       GIMP_PARAM_READWRITE));
9608   gimp_procedure_add_argument (procedure,
9609                                gimp_param_spec_int32 ("algorithm",
9610                                                       "algorithm",
9611                                                       "Algorithm { WIND (0), BLAST (1) }",
9612                                                       0, 1, 0,
9613                                                       GIMP_PARAM_READWRITE));
9614   gimp_procedure_add_argument (procedure,
9615                                gimp_param_spec_int32 ("edge",
9616                                                       "edge",
9617                                                       "Affected edge { BOTH (0), LEADING (1), TRAILING (2) }",
9618                                                       0, 2, 0,
9619                                                       GIMP_PARAM_READWRITE));
9620   gimp_pdb_register_procedure (pdb, procedure);
9621   g_object_unref (procedure);
9622 }
9623