From 6ac920542e2054c003759bbde6ed7dfbab865453 Mon Sep 17 00:00:00 2001 From: Jehan Date: Sun, 3 Nov 2024 18:40:49 +0100 Subject: [PATCH] =?UTF-8?q?Issue=20#11653:=20Revise=20plug-in=20procedures?= =?UTF-8?q?=20that=20convert=20parameters=20from=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … legacy to gegl parameters. This commit removed 57 legacy PDB procedures which were replacing outdated plug-ins (before transformed into GEGL ops) as far as I understand. These were all kept only as a legacy compatibility layer for third-party scripts. Since we are breaking API anyway, let's remove as many as we can. I've only kept the few which are still used at least once in our core scripts or plug-ins. Now as pippin notes, we still have no easy way to quickly run GEGL ops on drawables in script-fu. Though we have at least access to GEGL API for C plug-ins and all GObject-Introspected bindings. But that's true for all other ops anyway. I guess what should happen (quickly-ish) after 3.0 release is a libgimp utility function which does the heavy lifting of creating a GEGL graph for us, and for script-fu probably a special-case binding or something. --- app/pdb/internal-procs.c | 2 +- app/pdb/plug-in-compat-cmds.c | 6878 ----------------- pdb/groups/plug_in_compat.pdb | 3866 +-------- plug-ins/script-fu/scripts/unsharp-mask.scm | 3 +- .../script-fu/test/tests/Plugins/gegl.scm | 81 - 5 files changed, 7 insertions(+), 10823 deletions(-) diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c index bae603f7a4..0649a4b706 100644 --- a/app/pdb/internal-procs.c +++ b/app/pdb/internal-procs.c @@ -30,7 +30,7 @@ #include "internal-procs.h" -/* 775 procedures registered total */ +/* 718 procedures registered total */ void internal_procs_init (GimpPDB *pdb) diff --git a/app/pdb/plug-in-compat-cmds.c b/app/pdb/plug-in-compat-cmds.c index b933cc294e..050d313c9e 100644 --- a/app/pdb/plug-in-compat-cmds.c +++ b/app/pdb/plug-in-compat-cmds.c @@ -428,215 +428,6 @@ newsprint_angle (gdouble angle) return angle; } -static GimpValueArray * -plug_in_alienmap2_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble redfrequency; - gdouble redangle; - gdouble greenfrequency; - gdouble greenangle; - gdouble bluefrequency; - gdouble blueangle; - gint colormodel; - gboolean redmode; - gboolean greenmode; - gboolean bluemode; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - redfrequency = g_value_get_double (gimp_value_array_index (args, 3)); - redangle = g_value_get_double (gimp_value_array_index (args, 4)); - greenfrequency = g_value_get_double (gimp_value_array_index (args, 5)); - greenangle = g_value_get_double (gimp_value_array_index (args, 6)); - bluefrequency = g_value_get_double (gimp_value_array_index (args, 7)); - blueangle = g_value_get_double (gimp_value_array_index (args, 8)); - colormodel = g_value_get_int (gimp_value_array_index (args, 9)); - redmode = g_value_get_boolean (gimp_value_array_index (args, 10)); - greenmode = g_value_get_boolean (gimp_value_array_index (args, 11)); - bluemode = g_value_get_boolean (gimp_value_array_index (args, 12)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:alien-map", - "color-model", (gint) colormodel, - "cpn-1-frequency", (gdouble) redfrequency, - "cpn-2-frequency", (gdouble) greenfrequency, - "cpn-3-frequency", (gdouble) bluefrequency, - "cpn-1-phaseshift", (gdouble) redangle, - "cpn-2-phaseshift", (gdouble) greenangle, - "cpn-3-phaseshift", (gdouble) blueangle, - "cpn-1-keep", (gboolean) !redmode, - "cpn-2-keep", (gboolean) !greenmode, - "cpn-3-keep", (gboolean) !bluemode, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Alien Map"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_antialias_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:antialias", - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Antialias"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_apply_canvas_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint direction; - gint depth; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - direction = g_value_get_int (gimp_value_array_index (args, 3)); - depth = g_value_get_int (gimp_value_array_index (args, 4)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:texturize-canvas", - "direction", direction, - "depth", depth, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Apply Canvas"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_applylens_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble refraction; - gboolean keep_surroundings; - gboolean set_background; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - refraction = g_value_get_double (gimp_value_array_index (args, 3)); - keep_surroundings = g_value_get_boolean (gimp_value_array_index (args, 4)); - set_background = g_value_get_boolean (gimp_value_array_index (args, 5)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglColor *color; - GeglNode *node; - - if (set_background) - { - color = gegl_color_duplicate (gimp_context_get_background (context)); - } - else - { - color = gegl_color_new ("black"); - gegl_color_set_rgba_with_space (color, 0.0, 0.0, 0.0, 0.0, NULL); - } - - node = gegl_node_new_child (NULL, - "operation", "gegl:apply-lens", - "refraction-index", refraction, - "keep-surroundings", keep_surroundings, - "background-color", color, - NULL); - - g_object_unref (color); - - node = wrap_in_selection_bounds (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Apply Lens"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - static GimpValueArray * plug_in_autocrop_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -763,43 +554,6 @@ plug_in_autocrop_layer_invoker (GimpProcedure *procedure, error ? *error : NULL); } -static GimpValueArray * -plug_in_autostretch_hsv_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:stretch-contrast-hsv", - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Stretch Contrast HSV"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - static GimpValueArray * plug_in_bump_map_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -858,64 +612,6 @@ plug_in_bump_map_invoker (GimpProcedure *procedure, error ? *error : NULL); } -static GimpValueArray * -plug_in_bump_map_tiled_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - GimpDrawable *bumpmap; - gdouble azimuth; - gdouble elevation; - gint depth; - gint xofs; - gint yofs; - gdouble waterlevel; - gdouble ambient; - gboolean compensate; - gboolean invert; - gint type; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - bumpmap = g_value_get_object (gimp_value_array_index (args, 3)); - azimuth = g_value_get_double (gimp_value_array_index (args, 4)); - elevation = g_value_get_double (gimp_value_array_index (args, 5)); - depth = g_value_get_int (gimp_value_array_index (args, 6)); - xofs = g_value_get_int (gimp_value_array_index (args, 7)); - yofs = g_value_get_int (gimp_value_array_index (args, 8)); - waterlevel = g_value_get_double (gimp_value_array_index (args, 9)); - ambient = g_value_get_double (gimp_value_array_index (args, 10)); - compensate = g_value_get_boolean (gimp_value_array_index (args, 11)); - invert = g_value_get_boolean (gimp_value_array_index (args, 12)); - type = g_value_get_int (gimp_value_array_index (args, 13)); - - if (success) - { - success = bump_map (drawable, - bumpmap, - azimuth, - elevation, - depth, - xofs, - yofs, - waterlevel, - ambient, - compensate, - invert, - type, - TRUE, - progress, - error); - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - static GimpValueArray * plug_in_c_astretch_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -954,300 +650,6 @@ plug_in_c_astretch_invoker (GimpProcedure *procedure, error ? *error : NULL); } -static GimpValueArray * -plug_in_cartoon_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble mask_radius; - gdouble pct_black; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - mask_radius = g_value_get_double (gimp_value_array_index (args, 3)); - pct_black = g_value_get_double (gimp_value_array_index (args, 4)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:cartoon", - "mask-radius", mask_radius, - "pct-black", pct_black, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Cartoon"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_colors_channel_mixer_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint monochrome; - gdouble rr_gain; - gdouble rg_gain; - gdouble rb_gain; - gdouble gr_gain; - gdouble gg_gain; - gdouble gb_gain; - gdouble br_gain; - gdouble bg_gain; - gdouble bb_gain; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - monochrome = g_value_get_int (gimp_value_array_index (args, 3)); - rr_gain = g_value_get_double (gimp_value_array_index (args, 4)); - rg_gain = g_value_get_double (gimp_value_array_index (args, 5)); - rb_gain = g_value_get_double (gimp_value_array_index (args, 6)); - gr_gain = g_value_get_double (gimp_value_array_index (args, 7)); - gg_gain = g_value_get_double (gimp_value_array_index (args, 8)); - gb_gain = g_value_get_double (gimp_value_array_index (args, 9)); - br_gain = g_value_get_double (gimp_value_array_index (args, 10)); - bg_gain = g_value_get_double (gimp_value_array_index (args, 11)); - bb_gain = g_value_get_double (gimp_value_array_index (args, 12)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = NULL; - - if (monochrome) - { - node = gegl_node_new_child (NULL, - "operation", "gegl:mono-mixer", - "red", rr_gain, - "green", rg_gain, - "blue", rb_gain, - NULL); - } - else - { - node = gegl_node_new_child (NULL, - "operation", "gegl:channel-mixer", - "rr-gain", rr_gain, - "rg-gain", rg_gain, - "rb-gain", rb_gain, - "gr-gain", gr_gain, - "gg-gain", gg_gain, - "gb-gain", gb_gain, - "br-gain", br_gain, - "bg-gain", bg_gain, - "bb-gain", bb_gain, - NULL); - } - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Channel Mixer"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_colortoalpha_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - GeglColor *color; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - color = g_value_get_object (gimp_value_array_index (args, 3)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglColor *gegl_color = gegl_color_duplicate (color); - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:color-to-alpha", - "color", gegl_color, - NULL); - g_object_unref (gegl_color); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Color to Alpha"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_convmatrix_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gsize argc_matrix; - const gdouble *matrix; - gboolean alpha_alg; - gdouble divisor; - gdouble offset; - gsize argc_channels; - const gint32 *channels; - gint bmode; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - matrix = gimp_value_get_double_array (gimp_value_array_index (args, 3), &argc_matrix); - alpha_alg = g_value_get_boolean (gimp_value_array_index (args, 4)); - divisor = g_value_get_double (gimp_value_array_index (args, 5)); - offset = g_value_get_double (gimp_value_array_index (args, 6)); - channels = gimp_value_get_int32_array (gimp_value_array_index (args, 7), &argc_channels); - bmode = g_value_get_int (gimp_value_array_index (args, 8)); - - if (success) - { - if (argc_matrix != 25) - { - g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT, - _("Array 'matrix' has only %d members, must have 25"), - /* TODO: rather than converting the gsize, we should - * change the string, but we are in string freeze. - */ - (gint) argc_matrix); - success = FALSE; - } - - if (success && argc_channels != 5) - { - g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT, - _("Array 'channels' has only %d members, must have 5"), - /* TODO: rather than converting the gsize, we should - * change the string, but we are in string freeze. - */ - (gint) argc_channels); - success = FALSE; - } - - if (success && - gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - GeglAbyssPolicy border = GEGL_ABYSS_CLAMP; - gboolean r = channels[1]; - gboolean g = channels[2]; - gboolean b = channels[3]; - gboolean a = channels[4]; - - if (gimp_drawable_is_gray (drawable)) - { - r = channels[0]; - g = channels[0]; - b = channels[0]; - } - - switch (bmode) - { - case 0: border = GEGL_ABYSS_CLAMP; break; - case 1: border = GEGL_ABYSS_LOOP; break; - case 2: border = GEGL_ABYSS_NONE; break; - } - - node = gegl_node_new_child (NULL, - "operation", "gegl:convolution-matrix", - "a1", matrix[0], - "a2", matrix[1], - "a3", matrix[2], - "a4", matrix[3], - "a5", matrix[4], - "b1", matrix[5], - "b2", matrix[6], - "b3", matrix[7], - "b4", matrix[8], - "b5", matrix[9], - "c1", matrix[10], - "c2", matrix[11], - "c3", matrix[12], - "c4", matrix[13], - "c5", matrix[14], - "d1", matrix[15], - "d2", matrix[16], - "d3", matrix[17], - "d4", matrix[18], - "d5", matrix[19], - "e1", matrix[20], - "e2", matrix[21], - "e3", matrix[22], - "e4", matrix[23], - "e5", matrix[24], - "divisor", divisor, - "offset", offset, - "red", r, - "green", g, - "blue", b, - "alpha", a, - "normalize", FALSE, - "alpha-weight", alpha_alg, - "border", border, - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Convolution Matrix"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - static GimpValueArray * plug_in_cubism_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -1308,130 +710,6 @@ plug_in_cubism_invoker (GimpProcedure *procedure, error ? *error : NULL); } -static GimpValueArray * -plug_in_deinterlace_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint evenodd; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - evenodd = g_value_get_int (gimp_value_array_index (args, 3)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - node = gegl_node_new_child (NULL, - "operation", "gegl:deinterlace", - "keep", evenodd ? 0 : 1, - "orientation", 0, /* HORIZONTAL */ - "size", 1, - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Deinterlace"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_diffraction_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble lam_r; - gdouble lam_g; - gdouble lam_b; - gdouble contour_r; - gdouble contour_g; - gdouble contour_b; - gdouble edges_r; - gdouble edges_g; - gdouble edges_b; - gdouble brightness; - gdouble scattering; - gdouble polarization; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - lam_r = g_value_get_double (gimp_value_array_index (args, 3)); - lam_g = g_value_get_double (gimp_value_array_index (args, 4)); - lam_b = g_value_get_double (gimp_value_array_index (args, 5)); - contour_r = g_value_get_double (gimp_value_array_index (args, 6)); - contour_g = g_value_get_double (gimp_value_array_index (args, 7)); - contour_b = g_value_get_double (gimp_value_array_index (args, 8)); - edges_r = g_value_get_double (gimp_value_array_index (args, 9)); - edges_g = g_value_get_double (gimp_value_array_index (args, 10)); - edges_b = g_value_get_double (gimp_value_array_index (args, 11)); - brightness = g_value_get_double (gimp_value_array_index (args, 12)); - scattering = g_value_get_double (gimp_value_array_index (args, 13)); - polarization = g_value_get_double (gimp_value_array_index (args, 14)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - gint x, y, width, height; - - gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height); - - node = gegl_node_new_child (NULL, - "operation", "gegl:diffraction-patterns", - "red-frequency", lam_r, - "green-frequency", lam_g, - "blue-frequency", lam_b, - "red-contours", contour_r, - "green-contours", contour_g, - "blue-contours", contour_b, - "red-sedges", edges_r, - "green-sedges", edges_g, - "blue-sedges", edges_b, - "brightness", brightness, - "scattering", scattering, - "polarization", polarization, - "width", width, - "height", height, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Diffraction Patterns"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - static GimpValueArray * plug_in_displace_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -1478,131 +756,6 @@ plug_in_displace_invoker (GimpProcedure *procedure, error ? *error : NULL); } -static GimpValueArray * -plug_in_displace_polar_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - 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; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - amount_x = g_value_get_double (gimp_value_array_index (args, 3)); - amount_y = g_value_get_double (gimp_value_array_index (args, 4)); - do_x = g_value_get_boolean (gimp_value_array_index (args, 5)); - do_y = g_value_get_boolean (gimp_value_array_index (args, 6)); - displace_map_x = g_value_get_object (gimp_value_array_index (args, 7)); - displace_map_y = g_value_get_object (gimp_value_array_index (args, 8)); - displace_type = g_value_get_int (gimp_value_array_index (args, 9)); - - if (success) - { - success = displace (drawable, - amount_x, - amount_y, - do_x, - do_y, - displace_map_x, - displace_map_y, - displace_type, - 1, - progress, - error); - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_dog_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpImage *image; - GimpDrawable *drawable; - gdouble inner; - gdouble outer; - gboolean normalize; - gboolean invert; - - image = g_value_get_object (gimp_value_array_index (args, 1)); - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - inner = g_value_get_double (gimp_value_array_index (args, 3)); - outer = g_value_get_double (gimp_value_array_index (args, 4)); - normalize = g_value_get_boolean (gimp_value_array_index (args, 5)); - invert = g_value_get_boolean (gimp_value_array_index (args, 6)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - if (normalize || invert) - gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_MISC, - C_("undo-type", "DoG Edge Detect")); - - node = gegl_node_new_child (NULL, - "operation", "gegl:difference-of-gaussians", - "radius1", inner * 0.32, - "radius2", outer * 0.32, - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "DoG Edge Detect"), - node); - g_object_unref (node); - - if (normalize) - { - node = gegl_node_new_child (NULL, - "operation", "gegl:stretch-contrast", - "keep-colors", TRUE, - "perceptual", TRUE, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Normalize"), - node); - g_object_unref (node); - } - - if (invert) - gimp_drawable_apply_operation_by_name (drawable, progress, - C_("undo-type", "Invert"), - "gegl:invert-gamma", - NULL); - - if (normalize || invert) - gimp_image_undo_group_end (image); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - static GimpValueArray * plug_in_edge_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -1721,233 +874,6 @@ plug_in_emboss_invoker (GimpProcedure *procedure, error ? *error : NULL); } -static GimpValueArray * -plug_in_engrave_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint height; - gboolean limit; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - height = g_value_get_int (gimp_value_array_index (args, 3)); - limit = g_value_get_boolean (gimp_value_array_index (args, 4)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - node = gegl_node_new_child (NULL, - "operation", "gegl:engrave", - "row-height", height, - "limit", limit, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Engrave"), - node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_exchange_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble from_red; - gdouble from_green; - gdouble from_blue; - gdouble to_red; - gdouble to_green; - gdouble to_blue; - gdouble red_threshold; - gdouble green_threshold; - gdouble blue_threshold; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - from_red = g_value_get_double (gimp_value_array_index (args, 3)); - from_green = g_value_get_double (gimp_value_array_index (args, 4)); - from_blue = g_value_get_double (gimp_value_array_index (args, 5)); - to_red = g_value_get_double (gimp_value_array_index (args, 6)); - to_green = g_value_get_double (gimp_value_array_index (args, 7)); - to_blue = g_value_get_double (gimp_value_array_index (args, 8)); - red_threshold = g_value_get_double (gimp_value_array_index (args, 9)); - green_threshold = g_value_get_double (gimp_value_array_index (args, 10)); - blue_threshold = g_value_get_double (gimp_value_array_index (args, 11)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglColor *gegl_from = gegl_color_new (NULL); - GeglColor *gegl_to = gegl_color_new (NULL); - GeglNode *node; - - gegl_color_set_rgba (gegl_from, from_red, from_green, - from_blue, 1.0); - gegl_color_set_rgba (gegl_to, to_red, to_green, - to_blue, 1.0); - - node = gegl_node_new_child (NULL, - "operation", "gegl:color-exchange", - "from-color", gegl_from, - "to-color", gegl_to, - "red-threshold", red_threshold, - "green-threshold", green_threshold, - "blue-threshold", blue_threshold, - NULL); - - g_object_unref (gegl_from); - g_object_unref (gegl_to); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Color Exchange"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_flarefx_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint pos_x; - gint pos_y; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - pos_x = g_value_get_int (gimp_value_array_index (args, 3)); - pos_y = g_value_get_int (gimp_value_array_index (args, 4)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - gint width = gimp_item_get_width (GIMP_ITEM (drawable)); - gint height = gimp_item_get_height (GIMP_ITEM (drawable)); - gdouble x = (gdouble) pos_x / (gdouble) width; - gdouble y = (gdouble) pos_y / (gdouble) height; - - node = gegl_node_new_child (NULL, - "operation", "gegl:lens-flare", - "pos-x", x, - "pos-y", y, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Lens Flare"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_fractal_trace_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble xmin; - gdouble xmax; - gdouble ymin; - gdouble ymax; - gint depth; - gint outside_type; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - xmin = g_value_get_double (gimp_value_array_index (args, 3)); - xmax = g_value_get_double (gimp_value_array_index (args, 4)); - ymin = g_value_get_double (gimp_value_array_index (args, 5)); - ymax = g_value_get_double (gimp_value_array_index (args, 6)); - depth = g_value_get_int (gimp_value_array_index (args, 7)); - outside_type = g_value_get_int (gimp_value_array_index (args, 8)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - GeglAbyssPolicy abyss = GEGL_ABYSS_LOOP; - - switch (outside_type) - { - case 0: abyss = GEGL_ABYSS_LOOP; break; - case 1: abyss = GEGL_ABYSS_NONE; break; - case 2: abyss = GEGL_ABYSS_BLACK; break; - case 3: abyss = GEGL_ABYSS_WHITE; break; - } - - node = gegl_node_new_child (NULL, - "operation", "gegl:fractal-trace", - "X1", xmin, - "X2", xmax, - "Y1", ymin, - "Y2", ymax, - "depth", depth, - "abyss-policy", abyss, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Fractal Trace"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - static GimpValueArray * plug_in_gauss_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -1977,292 +903,6 @@ plug_in_gauss_invoker (GimpProcedure *procedure, error ? *error : NULL); } -static GimpValueArray * -plug_in_glasstile_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint tilex; - gint tiley; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - tilex = g_value_get_int (gimp_value_array_index (args, 3)); - tiley = g_value_get_int (gimp_value_array_index (args, 4)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - node = gegl_node_new_child (NULL, - "operation", "gegl:tile-glass", - "tile-width", tilex, - "tile-height", tiley, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Glass Tile"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_hsv_noise_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint holdness; - gint hue_distance; - gint saturation_distance; - gint value_distance; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - holdness = g_value_get_int (gimp_value_array_index (args, 3)); - hue_distance = g_value_get_int (gimp_value_array_index (args, 4)); - saturation_distance = g_value_get_int (gimp_value_array_index (args, 5)); - value_distance = g_value_get_int (gimp_value_array_index (args, 6)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - gdouble saturation = saturation_distance / 255.0; - gdouble value = value_distance / 255.0; - - node = gegl_node_new_child (NULL, - "operation", "gegl:noise-hsv", - "holdness", (gint) holdness, - "hue-distance", (gdouble) hue_distance, - "saturation-distance", (gdouble) saturation, - "value-distance", (gdouble) value, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Noise HSV"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_illusion_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint division; - gint type; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - division = g_value_get_int (gimp_value_array_index (args, 3)); - type = g_value_get_int (gimp_value_array_index (args, 4)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:illusion", - "division", (gint) division, - "illusion-type", (gint) type, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Illusion"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_laplace_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:edge-laplace", - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Laplace"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_lens_distortion_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble offset_x; - gdouble offset_y; - gdouble main_adjust; - gdouble edge_adjust; - gdouble rescale; - gdouble brighten; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - offset_x = g_value_get_double (gimp_value_array_index (args, 3)); - offset_y = g_value_get_double (gimp_value_array_index (args, 4)); - main_adjust = g_value_get_double (gimp_value_array_index (args, 5)); - edge_adjust = g_value_get_double (gimp_value_array_index (args, 6)); - rescale = g_value_get_double (gimp_value_array_index (args, 7)); - brighten = g_value_get_double (gimp_value_array_index (args, 8)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = NULL; - GeglColor *color; - - color = gegl_color_duplicate (gimp_context_get_background (context)); - - if (gimp_drawable_has_alpha (drawable)) - gimp_color_set_alpha (color, 0.0); - else - gimp_color_set_alpha (color, 1.0); - - node = gegl_node_new_child (NULL, - "operation", "gegl:lens-distortion", - "main", (gdouble) main_adjust, - "edge", (gdouble) edge_adjust, - "zoom", (gdouble) rescale, - "x-shift", (gdouble) offset_x, - "y-shift", (gdouble) offset_y, - "brighten", (gdouble) brighten, - "background", color, - NULL); - - g_object_unref (color); - - node = wrap_in_selection_bounds (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Lens Distortion"), - node); - g_object_unref (node); - - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_make_seamless_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:tile-seamless", - NULL); - - node = wrap_in_selection_bounds (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Tile Seamless"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - static GimpValueArray * plug_in_maze_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -2323,548 +963,6 @@ plug_in_maze_invoker (GimpProcedure *procedure, error ? *error : NULL); } -static GimpValueArray * -plug_in_mblur_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint type; - gdouble length; - gdouble angle; - gdouble center_x; - gdouble center_y; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - type = g_value_get_int (gimp_value_array_index (args, 3)); - length = g_value_get_double (gimp_value_array_index (args, 4)); - angle = g_value_get_double (gimp_value_array_index (args, 5)); - center_x = g_value_get_double (gimp_value_array_index (args, 6)); - center_y = g_value_get_double (gimp_value_array_index (args, 7)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = NULL; - gint width = gimp_item_get_width (GIMP_ITEM (drawable)); - gint height = gimp_item_get_height (GIMP_ITEM (drawable)); - - center_x /= (gdouble) width; - center_y /= (gdouble) height; - - if (angle > 180.0) - angle -= 360.0; - - if (type == 0) - { - node = gegl_node_new_child (NULL, - "operation", "gegl:motion-blur-linear", - "length", length, - "angle", angle, - NULL); - } - else if (type == 1) - { - node = gegl_node_new_child (NULL, - "operation", "gegl:motion-blur-circular", - "center-x", center_x, - "center-y", center_y, - "angle", angle, - NULL); - } - else if (type == 2) - { - gdouble factor = CLAMP (length / 256.0, 0.0, 1.0); - - node = gegl_node_new_child (NULL, - "operation", "gegl:motion-blur-zoom", - "center-x", center_x, - "center-y", center_y, - "factor", factor, - NULL); - } - - if (node != NULL) - { - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Motion Blur"), - node); - g_object_unref (node); - } - else - success = FALSE; - - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_mblur_inward_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint type; - gdouble length; - gdouble angle; - gdouble center_x; - gdouble center_y; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - type = g_value_get_int (gimp_value_array_index (args, 3)); - length = g_value_get_double (gimp_value_array_index (args, 4)); - angle = g_value_get_double (gimp_value_array_index (args, 5)); - center_x = g_value_get_double (gimp_value_array_index (args, 6)); - center_y = g_value_get_double (gimp_value_array_index (args, 7)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = NULL; - gint width = gimp_item_get_width (GIMP_ITEM (drawable)); - gint height = gimp_item_get_height (GIMP_ITEM (drawable)); - - center_x /= (gdouble) width; - center_y /= (gdouble) height; - - if (type == 0) - { - node = gegl_node_new_child (NULL, - "operation", "gegl:motion-blur-linear", - "length", length, - "angle", angle, - NULL); - } - else if (type == 1) - { - node = gegl_node_new_child (NULL, - "operation", "gegl:motion-blur-circular", - "center-x", center_x, - "center-y", center_y, - "angle", angle, - NULL); - } - else if (type == 2) - { - gdouble factor = CLAMP (-length / (256.0 - length), -10.0, 0.0); - - node = gegl_node_new_child (NULL, - "operation", "gegl:motion-blur-zoom", - "center-x", center_x, - "center-y", center_y, - "factor", factor, - NULL); - } - - if (node != NULL) - { - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Motion Blur"), - node); - g_object_unref (node); - } - else - success = FALSE; - - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_median_blur_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint radius; - gdouble percentile; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - radius = g_value_get_int (gimp_value_array_index (args, 3)); - percentile = g_value_get_double (gimp_value_array_index (args, 4)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:median-blur", - "radius", radius, - "percentile", percentile, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Median Blur"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_mosaic_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble tile_size; - gdouble tile_height; - gdouble tile_spacing; - gdouble tile_neatness; - gint tile_allow_split; - gdouble light_dir; - gdouble color_variation; - gint antialiasing; - gint color_averaging; - gint tile_type; - gint tile_surface; - gint grout_color; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - tile_size = g_value_get_double (gimp_value_array_index (args, 3)); - tile_height = g_value_get_double (gimp_value_array_index (args, 4)); - tile_spacing = g_value_get_double (gimp_value_array_index (args, 5)); - tile_neatness = g_value_get_double (gimp_value_array_index (args, 6)); - tile_allow_split = g_value_get_int (gimp_value_array_index (args, 7)); - light_dir = g_value_get_double (gimp_value_array_index (args, 8)); - color_variation = g_value_get_double (gimp_value_array_index (args, 9)); - antialiasing = g_value_get_int (gimp_value_array_index (args, 10)); - color_averaging = g_value_get_int (gimp_value_array_index (args, 11)); - tile_type = g_value_get_int (gimp_value_array_index (args, 12)); - tile_surface = g_value_get_int (gimp_value_array_index (args, 13)); - grout_color = g_value_get_int (gimp_value_array_index (args, 14)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglColor *fg_color; - GeglColor *bg_color; - GeglNode *node; - - if (grout_color) - { - bg_color = gegl_color_duplicate (gimp_context_get_background (context)); - fg_color = gegl_color_duplicate (gimp_context_get_foreground (context)); - } - else - { - /* sic */ - fg_color = gegl_color_new ("white"); - bg_color = gegl_color_new ("black"); - } - - node = gegl_node_new_child (NULL, - "operation", "gegl:mosaic", - "tile-size", (gdouble) tile_size, - "tile-height", (gdouble) tile_height, - "tile-spacing", (gdouble) tile_spacing, - "tile-neatness", (gdouble) tile_neatness, - "tile-allow-split", (gboolean) tile_allow_split, - "light-dir", (gdouble) light_dir, - "color-variation", (gfloat) color_variation, - "antialiasing", (gboolean) antialiasing, - "color-averaging", (gboolean) color_averaging, - "tile-type", (gint) tile_type, - "tile-surface", (gboolean) tile_surface, - "light-color", fg_color, - "joints-color", bg_color, - NULL); - - g_object_unref (fg_color); - g_object_unref (bg_color); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Mosaic"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_neon_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble radius; - gdouble amount; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - radius = g_value_get_double (gimp_value_array_index (args, 3)); - amount = g_value_get_double (gimp_value_array_index (args, 4)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - node = gegl_node_new_child (NULL, - "operation", "gegl:edge-neon", - "radius", radius, - "amount", amount, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Neon"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_newsprint_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint cell_width; - gint colorspace; - gint k_pullout; - gdouble gry_ang; - gint gry_spotfn; - gdouble red_ang; - gint red_spotfn; - gdouble grn_ang; - gint grn_spotfn; - gdouble blu_ang; - gint blu_spotfn; - gint oversample; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - cell_width = g_value_get_int (gimp_value_array_index (args, 3)); - colorspace = g_value_get_int (gimp_value_array_index (args, 4)); - k_pullout = g_value_get_int (gimp_value_array_index (args, 5)); - gry_ang = g_value_get_double (gimp_value_array_index (args, 6)); - gry_spotfn = g_value_get_int (gimp_value_array_index (args, 7)); - red_ang = g_value_get_double (gimp_value_array_index (args, 8)); - red_spotfn = g_value_get_int (gimp_value_array_index (args, 9)); - grn_ang = g_value_get_double (gimp_value_array_index (args, 10)); - grn_spotfn = g_value_get_int (gimp_value_array_index (args, 11)); - blu_ang = g_value_get_double (gimp_value_array_index (args, 12)); - blu_spotfn = g_value_get_int (gimp_value_array_index (args, 13)); - oversample = g_value_get_int (gimp_value_array_index (args, 14)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - gint color_model = newsprint_color_model (colorspace); - gint pattern = newsprint_pattern (gry_spotfn); - gint pattern2 = newsprint_pattern (red_spotfn); - gint pattern3 = newsprint_pattern (grn_spotfn); - gint pattern4 = newsprint_pattern (blu_spotfn); - gdouble angle = newsprint_angle (gry_ang); - gdouble angle2 = newsprint_angle (red_ang); - gdouble angle3 = newsprint_angle (grn_ang); - gdouble angle4 = newsprint_angle (blu_ang); - - node = gegl_node_new_child (NULL, - "operation", "gegl:newsprint", - "color-model", color_model, - "black-pullout", (gdouble) k_pullout / 100.0, - "period", (gdouble) cell_width, - "angle", angle, - "pattern", pattern, - "period2", (gdouble) cell_width, - "angle2", angle2, - "pattern2", pattern2, - "period3", (gdouble) cell_width, - "angle3", angle3, - "pattern3", pattern3, - "period4", (gdouble) cell_width, - "angle4", angle4, - "pattern4", pattern4, - "aa-samples", oversample, - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Newsprint"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_normalize_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - node = gegl_node_new_child (NULL, - "operation", "gegl:stretch-contrast", - "keep-colors", TRUE, - "perceptual", TRUE, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Normalize"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_nova_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint xcenter; - gint ycenter; - GeglColor *color; - gint radius; - gint nspoke; - gint randomhue; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - xcenter = g_value_get_int (gimp_value_array_index (args, 3)); - ycenter = g_value_get_int (gimp_value_array_index (args, 4)); - color = g_value_get_object (gimp_value_array_index (args, 5)); - radius = g_value_get_int (gimp_value_array_index (args, 6)); - nspoke = g_value_get_int (gimp_value_array_index (args, 7)); - randomhue = g_value_get_int (gimp_value_array_index (args, 8)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglColor *gegl_color; - GeglNode *node; - gdouble center_x = (gdouble) xcenter / (gdouble) gimp_item_get_width (GIMP_ITEM (drawable)); - gdouble center_y = (gdouble) ycenter / (gdouble) gimp_item_get_height (GIMP_ITEM (drawable)); - - gegl_color = gegl_color_duplicate (color); - - node = gegl_node_new_child (NULL, - "operation", "gegl:supernova", - "center-x", center_x, - "center-y", center_y, - "radius", radius, - "spokes-count", nspoke, - "random-hue", randomhue, - "color", gegl_color, - "seed", g_random_int (), - NULL); - - g_object_unref (gegl_color); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Supernova"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - static GimpValueArray * plug_in_oilify_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -2909,257 +1007,6 @@ plug_in_oilify_invoker (GimpProcedure *procedure, error ? *error : NULL); } -static GimpValueArray * -plug_in_oilify_enhanced_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint mode; - gint mask_size; - GimpDrawable *mask_size_map; - gint exponent; - GimpDrawable *exponent_map; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - mode = g_value_get_int (gimp_value_array_index (args, 3)); - mask_size = g_value_get_int (gimp_value_array_index (args, 4)); - mask_size_map = g_value_get_object (gimp_value_array_index (args, 5)); - exponent = g_value_get_int (gimp_value_array_index (args, 6)); - exponent_map = g_value_get_object (gimp_value_array_index (args, 7)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *graph; - GeglNode *node; - - node = gegl_node_new_child (NULL, - "operation", "gegl:oilify", - "mask-radius", MAX (1, mask_size / 2), - "use-inten", mode ? TRUE : FALSE, - "exponent", exponent, - NULL); - - graph = wrap_in_graph (node); - - if (mask_size_map) - { - GeglNode *src_node; - src_node = create_buffer_source_node (graph, mask_size_map); - gegl_node_connect (src_node, "output", node, "aux"); - } - - if (exponent_map) - { - GeglNode *src_node; - src_node = create_buffer_source_node (graph, exponent_map); - gegl_node_connect (src_node, "output", node, "aux2"); - } - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Oilify"), - graph); - g_object_unref (graph); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_papertile_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint tile_size; - gdouble move_max; - gint fractional_type; - gboolean wrap_around; - gboolean centering; - gint background_type; - GeglColor *background_color; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - tile_size = g_value_get_int (gimp_value_array_index (args, 3)); - move_max = g_value_get_double (gimp_value_array_index (args, 4)); - fractional_type = g_value_get_int (gimp_value_array_index (args, 5)); - wrap_around = g_value_get_boolean (gimp_value_array_index (args, 6)); - centering = g_value_get_boolean (gimp_value_array_index (args, 7)); - background_type = g_value_get_int (gimp_value_array_index (args, 8)); - background_color = g_value_get_object (gimp_value_array_index (args, 9)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - GeglColor *color; - gint bg_type; - - switch (background_type) - { - default: - bg_type = background_type; - color = gegl_color_new (NULL); - /* XXX: I guess what we want is to set this color (why blue?) in the - * drawable's space, though I haven't looked too much into it. - */ - gegl_color_set_rgba_with_space (color, 0.0, 0.0, 1.0, 1.0, gimp_drawable_get_space (drawable)); - break; - - case 3: - bg_type = 3; - color = gegl_color_duplicate (gimp_context_get_foreground (context)); - break; - - case 4: - bg_type = 3; - color = gegl_color_duplicate (gimp_context_get_background (context)); - break; - - case 5: - bg_type = 3; - color = gegl_color_duplicate (background_color); - break; - } - - node = gegl_node_new_child (NULL, - "operation", "gegl:tile-paper", - "tile-width", tile_size, - "tile-height", tile_size, - "move-rate", move_max, - "bg-color", color, - "centering", centering, - "wrap-around", wrap_around, - "background-type", bg_type, - "fractional-type", fractional_type, - NULL); - - g_object_unref (color); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Paper Tile"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_photocopy_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble mask_radius; - gdouble sharpness; - gdouble pct_black; - gdouble pct_white; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - mask_radius = g_value_get_double (gimp_value_array_index (args, 3)); - sharpness = g_value_get_double (gimp_value_array_index (args, 4)); - pct_black = g_value_get_double (gimp_value_array_index (args, 5)); - pct_white = g_value_get_double (gimp_value_array_index (args, 6)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:photocopy", - "mask-radius", mask_radius, - "sharpness", sharpness, - "black", pct_black, - "white", pct_white, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Photocopy"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_pixelize_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint pixel_width; - gint pixel_height; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - pixel_width = g_value_get_int (gimp_value_array_index (args, 3)); - pixel_height = g_value_get_int (gimp_value_array_index (args, 4)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:pixelize", - "size-x", pixel_width, - "size-y", pixel_height, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Pixelize"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - static GimpValueArray * plug_in_plasma_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -3215,406 +1062,6 @@ plug_in_plasma_invoker (GimpProcedure *procedure, error ? *error : NULL); } -static GimpValueArray * -plug_in_polar_coords_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble circle; - gdouble angle; - gboolean backwards; - gboolean inverse; - gboolean polrec; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - circle = g_value_get_double (gimp_value_array_index (args, 3)); - angle = g_value_get_double (gimp_value_array_index (args, 4)); - backwards = g_value_get_boolean (gimp_value_array_index (args, 5)); - inverse = g_value_get_boolean (gimp_value_array_index (args, 6)); - polrec = g_value_get_boolean (gimp_value_array_index (args, 7)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:polar-coordinates", - "depth", circle, - "angle", angle, - "bw", backwards, /* XXX name */ - "top", inverse, - "polar", polrec, - NULL); - - node = wrap_in_selection_bounds (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Polar Coordinates"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_red_eye_removal_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint threshold; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - threshold = g_value_get_int (gimp_value_array_index (args, 3)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:red-eye-removal", - "threshold", (gdouble) (threshold - 50) / 50.0 * 0.2 + 0.4, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Red Eye Removal"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_randomize_hurl_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble rndm_pct; - gdouble rndm_rcount; - gboolean randomize; - gint seed; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - rndm_pct = g_value_get_double (gimp_value_array_index (args, 3)); - rndm_rcount = g_value_get_double (gimp_value_array_index (args, 4)); - randomize = g_value_get_boolean (gimp_value_array_index (args, 5)); - seed = g_value_get_int (gimp_value_array_index (args, 6)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - if (randomize) - seed = (gint32) g_random_int (); - - node = - gegl_node_new_child (NULL, - "operation", "gegl:noise-hurl", - "seed", seed, - "pct-random", rndm_pct, - "repeat", (gint) rndm_rcount, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Random Hurl"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_randomize_pick_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble rndm_pct; - gdouble rndm_rcount; - gboolean randomize; - gint seed; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - rndm_pct = g_value_get_double (gimp_value_array_index (args, 3)); - rndm_rcount = g_value_get_double (gimp_value_array_index (args, 4)); - randomize = g_value_get_boolean (gimp_value_array_index (args, 5)); - seed = g_value_get_int (gimp_value_array_index (args, 6)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - if (randomize) - seed = (gint32) g_random_int (); - - node = - gegl_node_new_child (NULL, - "operation", "gegl:noise-pick", - "seed", seed, - "pct-random", rndm_pct, - "repeat", (gint) rndm_rcount, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Random Pick"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_randomize_slur_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble rndm_pct; - gdouble rndm_rcount; - gboolean randomize; - gint seed; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - rndm_pct = g_value_get_double (gimp_value_array_index (args, 3)); - rndm_rcount = g_value_get_double (gimp_value_array_index (args, 4)); - randomize = g_value_get_boolean (gimp_value_array_index (args, 5)); - seed = g_value_get_int (gimp_value_array_index (args, 6)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - if (randomize) - seed = (gint32) g_random_int (); - - node = - gegl_node_new_child (NULL, - "operation", "gegl:noise-slur", - "seed", seed, - "pct-random", rndm_pct, - "repeat", (gint) rndm_rcount, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Random Slur"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_rgb_noise_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gboolean independent; - gboolean correlated; - gdouble noise_1; - gdouble noise_2; - gdouble noise_3; - gdouble noise_4; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - independent = g_value_get_boolean (gimp_value_array_index (args, 3)); - correlated = g_value_get_boolean (gimp_value_array_index (args, 4)); - noise_1 = g_value_get_double (gimp_value_array_index (args, 5)); - noise_2 = g_value_get_double (gimp_value_array_index (args, 6)); - noise_3 = g_value_get_double (gimp_value_array_index (args, 7)); - noise_4 = g_value_get_double (gimp_value_array_index (args, 8)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - gdouble r, g, b, a; - - if (gimp_drawable_is_gray (drawable)) - { - r = noise_1; - g = noise_1; - b = noise_1; - a = noise_2; - } - else - { - r = noise_1; - g = noise_2; - b = noise_3; - a = noise_4; - } - - node = gegl_node_new_child (NULL, - "operation", "gegl:noise-rgb", - "correlated", correlated, - "independent", independent, - "red", r, - "green", g, - "blue", b, - "alpha", a, - "seed", g_random_int (), - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "RGB Noise"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_ripple_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble period; - gdouble amplitude; - gint orientation; - gint edges; - gint waveform; - gboolean antialias; - gboolean tile; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - period = g_value_get_double (gimp_value_array_index (args, 3)); - amplitude = g_value_get_double (gimp_value_array_index (args, 4)); - orientation = g_value_get_int (gimp_value_array_index (args, 5)); - edges = g_value_get_int (gimp_value_array_index (args, 6)); - waveform = g_value_get_int (gimp_value_array_index (args, 7)); - antialias = g_value_get_boolean (gimp_value_array_index (args, 8)); - tile = g_value_get_boolean (gimp_value_array_index (args, 9)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - gdouble angle, phi; - - angle = orientation ? 0.0 : 90.0; - phi = waveform ? 0.0 : 0.75; - if (orientation == 0 && waveform == 1) - phi = 0.5; - - node = gegl_node_new_child (NULL, - "operation", "gegl:ripple", - "amplitude", amplitude, - "period", period, - "phi", phi, - "angle", angle, - "sampler_type", antialias ? GEGL_SAMPLER_CUBIC : GEGL_SAMPLER_NEAREST, - "wave_type", waveform ? 0 : 1, - "abyss_policy", edges == 0 ? GEGL_ABYSS_CLAMP : - edges == 1 ? GEGL_ABYSS_LOOP : - GEGL_ABYSS_NONE, - "tileable", tile ? TRUE : FALSE, - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Ripple"), - node); - g_object_unref (node); - } - else - { - success = FALSE; - } - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - static GimpValueArray * plug_in_rotate_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -3738,338 +1185,6 @@ plug_in_noisify_invoker (GimpProcedure *procedure, error ? *error : NULL); } -static GimpValueArray * -plug_in_sel_gauss_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble radius; - gint max_delta; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - radius = g_value_get_double (gimp_value_array_index (args, 3)); - max_delta = g_value_get_int (gimp_value_array_index (args, 4)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - node = gegl_node_new_child (NULL, - "operation", "gegl:gaussian-blur-selective", - "blur-radius", radius, - "max-delta", (gdouble) max_delta / 255.0, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Selective Gaussian Blur"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_semiflatten_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) && - gimp_drawable_has_alpha (drawable)) - { - GeglNode *node; - GeglColor *color; - - color = gimp_context_get_background (context); - - node = - gegl_node_new_child (NULL, - "operation", "gimp:semi-flatten", - "color", color, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Semi-Flatten"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_shift_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint shift_amount; - gint orientation; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - shift_amount = g_value_get_int (gimp_value_array_index (args, 3)); - orientation = g_value_get_int (gimp_value_array_index (args, 4)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:shift", - "shift", shift_amount / 2, - "direction", orientation ? 0 : 1, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Shift"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_sinus_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble xscale; - gdouble yscale; - gdouble complex; - gint seed; - gboolean tiling; - gboolean perturb; - gint colors; - GeglColor *col1; - GeglColor *col2; - gdouble alpha1; - gdouble alpha2; - gint blend; - gdouble blend_power; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - xscale = g_value_get_double (gimp_value_array_index (args, 3)); - yscale = g_value_get_double (gimp_value_array_index (args, 4)); - complex = g_value_get_double (gimp_value_array_index (args, 5)); - seed = g_value_get_int (gimp_value_array_index (args, 6)); - tiling = g_value_get_boolean (gimp_value_array_index (args, 7)); - perturb = g_value_get_boolean (gimp_value_array_index (args, 8)); - colors = g_value_get_int (gimp_value_array_index (args, 9)); - col1 = g_value_get_object (gimp_value_array_index (args, 10)); - col2 = g_value_get_object (gimp_value_array_index (args, 11)); - alpha1 = g_value_get_double (gimp_value_array_index (args, 12)); - alpha2 = g_value_get_double (gimp_value_array_index (args, 13)); - blend = g_value_get_int (gimp_value_array_index (args, 14)); - blend_power = g_value_get_double (gimp_value_array_index (args, 15)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - GeglColor *gegl_color1 = NULL; - GeglColor *gegl_color2 = NULL; - gint x, y, width, height; - - switch (colors) - { - case 0: - gegl_color1 = gegl_color_new ("black"); - gegl_color2 = gegl_color_new ("white"); - break; - - case 1: - gegl_color1 = gegl_color_duplicate (gimp_context_get_foreground (context)); - gegl_color2 = gegl_color_duplicate (gimp_context_get_background (context)); - break; - } - - if (gegl_color1 == NULL) - { - gegl_color1 = gegl_color_duplicate (col1); - gegl_color2 = gegl_color_duplicate (col2); - } - gimp_color_set_alpha (gegl_color1, alpha1); - gimp_color_set_alpha (gegl_color2, alpha2); - - gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height); - - node = gegl_node_new_child (NULL, - "operation", "gegl:sinus", - "x_scale", xscale, - "y-scale", yscale, - "complexity", complex, - "seed", seed, - "tiling", tiling, - "perturbation", perturb, - "color1", gegl_color1, - "color2", gegl_color2, - "blend-mode", blend, - "blend-power", blend_power, - "width", width, - "height", height, - NULL); - - g_object_unref (gegl_color1); - g_object_unref (gegl_color2); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Sinus"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_sobel_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gboolean horizontal; - gboolean vertical; - gboolean keep_sign; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - horizontal = g_value_get_boolean (gimp_value_array_index (args, 3)); - vertical = g_value_get_boolean (gimp_value_array_index (args, 4)); - keep_sign = g_value_get_boolean (gimp_value_array_index (args, 5)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:edge-sobel", - "horizontal", horizontal, - "vertical", vertical, - "keep-sign", keep_sign, - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Sobel"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_softglow_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble glow_radius; - gdouble brightness; - gdouble sharpness; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - glow_radius = g_value_get_double (gimp_value_array_index (args, 3)); - brightness = g_value_get_double (gimp_value_array_index (args, 4)); - sharpness = g_value_get_double (gimp_value_array_index (args, 5)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:softglow", - "glow-radius", glow_radius, - "brightness", brightness, - "sharpness", sharpness, - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Softglow"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - static GimpValueArray * plug_in_solid_noise_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -4216,330 +1331,6 @@ plug_in_threshold_alpha_invoker (GimpProcedure *procedure, error ? *error : NULL); } -static GimpValueArray * -plug_in_unsharp_mask_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble radius; - gdouble amount; - gint threshold; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - radius = g_value_get_double (gimp_value_array_index (args, 3)); - amount = g_value_get_double (gimp_value_array_index (args, 4)); - threshold = g_value_get_int (gimp_value_array_index (args, 5)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:unsharp-mask", - "std-dev", radius, - "scale", amount, - "threshold", threshold / 255.0, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Sharpen (Unsharp Mask)"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_video_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint pattern_number; - gboolean additive; - gboolean rotated; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - pattern_number = g_value_get_int (gimp_value_array_index (args, 3)); - additive = g_value_get_boolean (gimp_value_array_index (args, 4)); - rotated = g_value_get_boolean (gimp_value_array_index (args, 5)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:video-degradation", - "pattern", pattern_number, - "additive", additive, - "rotated", rotated, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Video"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_vinvert_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:value-invert", - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Value Invert"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_vpropagate_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint propagate_mode; - gint propagating_channel; - gdouble propagating_rate; - gint direction_mask; - gint lower_limit; - gint upper_limit; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - propagate_mode = g_value_get_int (gimp_value_array_index (args, 3)); - propagating_channel = g_value_get_int (gimp_value_array_index (args, 4)); - propagating_rate = g_value_get_double (gimp_value_array_index (args, 5)); - direction_mask = g_value_get_int (gimp_value_array_index (args, 6)); - lower_limit = g_value_get_int (gimp_value_array_index (args, 7)); - upper_limit = g_value_get_int (gimp_value_array_index (args, 8)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - GeglColor *color = NULL; - gint gegl_mode = 0; - gboolean to_left = (direction_mask & (0x1 << 0)) != 0; - gboolean to_top = (direction_mask & (0x1 << 1)) != 0; - gboolean to_right = (direction_mask & (0x1 << 2)) != 0; - gboolean to_bottom = (direction_mask & (0x1 << 3)) != 0; - gboolean value = (propagating_channel & (0x1 << 0)) != 0; - gboolean alpha = (propagating_channel & (0x1 << 1)) != 0; - - switch (propagate_mode) - { - case 0: - case 1: - case 2: - gegl_mode = propagate_mode; - break; - - case 3: - case 4: - case 5: - if (propagate_mode == 3 || propagate_mode == 4) - { - gegl_mode = propagate_mode; - - color = gimp_context_get_foreground (context); - } - else - { - gegl_mode = 4; - - color = gimp_context_get_background (context); - } - break; - - case 6: - case 7: - gegl_mode = propagate_mode - 1; - break; - } - - node = - gegl_node_new_child (NULL, - "operation", "gegl:value-propagate", - "mode", gegl_mode, - "lower-threshold", (gdouble) lower_limit / 255.0, - "upper-threshold", (gdouble) upper_limit / 255.0, - "rate", propagating_rate, - "color", color, - "top", to_top, - "left", to_left, - "right", to_right, - "bottom", to_bottom, - "value", value, - "alpha", alpha, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Value Propagate"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_dilate_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:value-propagate", - "mode", 0, /* GEGL_VALUE_PROPAGATE_MODE_WHITE */ - "lower-threshold", 0.0, - "upper-threshold", 1.0, - "rate", 1.0, - "top", TRUE, - "left", TRUE, - "right", TRUE, - "bottom", TRUE, - "value", TRUE, - "alpha", FALSE, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Dilate"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_erode_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:value-propagate", - "mode", 1, /* GEGL_VALUE_PROPAGATE_MODE_BLACK */ - "lower-threshold", 0.0, - "upper-threshold", 1.0, - "rate", 1.0, - "top", TRUE, - "left", TRUE, - "right", TRUE, - "bottom", TRUE, - "value", TRUE, - "alpha", FALSE, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Erode"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - static GimpValueArray * plug_in_waves_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -4603,351 +1394,11 @@ plug_in_waves_invoker (GimpProcedure *procedure, error ? *error : NULL); } -static GimpValueArray * -plug_in_whirl_pinch_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gdouble whirl; - gdouble pinch; - gdouble radius; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - whirl = g_value_get_double (gimp_value_array_index (args, 3)); - pinch = g_value_get_double (gimp_value_array_index (args, 4)); - radius = g_value_get_double (gimp_value_array_index (args, 5)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:whirl-pinch", - "whirl", whirl, - "pinch", pinch, - "radius", radius, - NULL); - - node = wrap_in_selection_bounds (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Whirl and Pinch"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -plug_in_wind_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpDrawable *drawable; - gint threshold; - gint direction; - gint strength; - gint algorithm; - gint edge; - - drawable = g_value_get_object (gimp_value_array_index (args, 2)); - threshold = g_value_get_int (gimp_value_array_index (args, 3)); - direction = g_value_get_int (gimp_value_array_index (args, 4)); - strength = g_value_get_int (gimp_value_array_index (args, 5)); - algorithm = g_value_get_int (gimp_value_array_index (args, 6)); - edge = g_value_get_int (gimp_value_array_index (args, 7)); - - if (success) - { - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:wind", - "threshold", threshold, - "direction", direction, - "strength", strength, - "style", algorithm, - "edge", edge, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Wind"), - node); - g_object_unref (node); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - void register_plug_in_compat_procs (GimpPDB *pdb) { GimpProcedure *procedure; - /* - * gimp-plug-in-alienmap2 - */ - procedure = gimp_procedure_new (plug_in_alienmap2_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-alienmap2"); - gimp_procedure_set_static_help (procedure, - "Alter colors in various psychedelic ways", - "No help yet. Just try it and you'll see!", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:alien-map' for credits.", - "Compatibility procedure. Please see 'gegl:alien-map' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("redfrequency", - "redfrequency", - "Red/hue component frequency factor", - 0, 20, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("redangle", - "redangle", - "Red/hue component angle factor (0-360)", - 0, 360, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("greenfrequency", - "greenfrequency", - "Green/saturation component frequency factor", - 0, 20, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("greenangle", - "greenangle", - "Green/saturation component angle factor (0-360)", - 0, 360, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("bluefrequency", - "bluefrequency", - "Blue/luminance component frequency factor", - 0, 20, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("blueangle", - "blueangle", - "Blue/luminance component angle factor (0-360)", - 0, 360, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("colormodel", - "colormodel", - "Color model { RGB-MODEL (0), HSL-MODEL (1) }", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("redmode", - "redmode", - "Red/hue application mode", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("greenmode", - "greenmode", - "Green/saturation application mode", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("bluemode", - "bluemode", - "Blue/luminance application mode", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-antialias - */ - procedure = gimp_procedure_new (plug_in_antialias_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-antialias"); - gimp_procedure_set_static_help (procedure, - "Antialias using the Scale3X edge-extrapolation algorithm", - "No more help.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:antialias' for credits.", - "Compatibility procedure. Please see 'gegl:antialias' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-apply-canvas - */ - procedure = gimp_procedure_new (plug_in_apply_canvas_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-apply-canvas"); - gimp_procedure_set_static_help (procedure, - "Add a canvas texture to the image", - "This function applies a canvas texture map to the drawable.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:texturize-canvas' for credits.", - "Compatibility procedure. Please see 'gegl:texturize-canvas' for credits.", - "2014"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("direction", - "direction", - "Light direction (0 - 3)", - 0, 3, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("depth", - "depth", - "Texture depth (1 - 50)", - 1, 50, 1, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-applylens - */ - procedure = gimp_procedure_new (plug_in_applylens_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-applylens"); - gimp_procedure_set_static_help (procedure, - "Simulate an elliptical lens over the image", - "This plug-in uses Snell's law to draw an ellipsoid lens over the image.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:apply-lens' for credits.", - "Compatibility procedure. Please see 'gegl:apply-lens' for credits.", - "2014"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("refraction", - "refraction", - "Lens refraction index", - 1.0, 100.0, 1.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("keep-surroundings", - "keep surroundings", - "Keep lens surroundings", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("set-background", - "set background", - "Set lens surroundings to BG value", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("set-transparent", - "set transparent", - "Set lens surroundings transparent", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-plug-in-autocrop */ @@ -5020,42 +1471,6 @@ register_plug_in_compat_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - /* - * gimp-plug-in-autostretch-hsv - */ - procedure = gimp_procedure_new (plug_in_autostretch_hsv_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-autostretch-hsv"); - gimp_procedure_set_static_help (procedure, - "Stretch contrast to cover the maximum possible range", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:stretch-contrast-hsv' for credits.", - "Compatibility procedure. Please see 'gegl:stretch-contrast-hsv' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-plug-in-bump-map */ @@ -5158,108 +1573,6 @@ register_plug_in_compat_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - /* - * gimp-plug-in-bump-map-tiled - */ - procedure = gimp_procedure_new (plug_in_bump_map_tiled_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-bump-map-tiled"); - gimp_procedure_set_static_help (procedure, - "Create an embossing effect using a tiled image as a bump map", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:bump-map' for credits.", - "Compatibility procedure. Please see 'gegl:bump-map' for credits.", - "2015"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("bumpmap", - "bumpmap", - "Bump map drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("azimuth", - "azimuth", - "Azimuth", - 0.0, 360.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("elevation", - "elevation", - "Elevation", - 0.5, 90.0, 0.5, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("depth", - "depth", - "Depth", - 1, 65, 1, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("xofs", - "xofs", - "X offset", - G_MININT32, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("yofs", - "yofs", - "Y offset", - G_MININT32, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("waterlevel", - "waterlevel", - "Level that full transparency should represent", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("ambient", - "ambient", - "Ambient lighting factor", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("compensate", - "compensate", - "Compensate for darkening", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("invert", - "invert", - "Invert bumpmap", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("type", - "type", - "Type of map { LINEAR (0), SPHERICAL (1), SINUSOIDAL (2) }", - 0, 3, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-plug-in-c-astretch */ @@ -5296,264 +1609,6 @@ register_plug_in_compat_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - /* - * gimp-plug-in-cartoon - */ - procedure = gimp_procedure_new (plug_in_cartoon_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-cartoon"); - gimp_procedure_set_static_help (procedure, - "Simulate a cartoon by enhancing edges", - "Propagates dark values in an image based on each pixel's relative darkness to a neighboring average. The idea behind this filter is to give the look of a black felt pen drawing subsequently shaded with color. This is achieved by darkening areas of the image which are measured to be darker than a neighborhood average. In this way, sufficiently large shifts in intensity are darkened to black. The rate at which they are darkened to black is determined by the second pct_black parameter. The mask_radius parameter controls the size of the pixel neighborhood over which the average intensity is computed and then compared to each pixel in the neighborhood to decide whether or not to darken it to black. Large values for mask_radius result in very thick black areas bordering the shaded regions of color and much less detail for black areas everywhere including inside regions of color. Small values result in more subtle pen strokes and detail everywhere. Small values for the pct_black make the\n" - "blend from the color regions to the black border lines smoother and the lines themselves thinner and less noticeable; larger values achieve the opposite effect.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:cartoon' for credits.", - "Compatibility procedure. Please see 'gegl:cartoon' for credits.", - "2019"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("mask-radius", - "mask radius", - "Cartoon mask radius (radius of pixel neighborhood)", - 1.0, 50.0, 1.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("pct-black", - "pct black", - "Percentage of darkened pixels to set to black", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-colors-channel-mixer - */ - procedure = gimp_procedure_new (plug_in_colors_channel_mixer_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-colors-channel-mixer"); - gimp_procedure_set_static_help (procedure, - "Alter colors by mixing RGB Channels", - "This plug-in mixes the RGB channels.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:channel-mixer' for credits.", - "Compatibility procedure. Please see 'gegl:channel-mixer' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("monochrome", - "monochrome", - "Monochrome { TRUE, FALSE }", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("rr-gain", - "rr gain", - "Set the red gain for the red channel", - -2, 2, -2, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("rg-gain", - "rg gain", - "Set the green gain for the red channel", - -2, 2, -2, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("rb-gain", - "rb gain", - "Set the blue gain for the red channel", - -2, 2, -2, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("gr-gain", - "gr gain", - "Set the red gain for the green channel", - -2, 2, -2, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("gg-gain", - "gg gain", - "Set the green gain for the green channel", - -2, 2, -2, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("gb-gain", - "gb gain", - "Set the blue gain for the green channel", - -2, 2, -2, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("br-gain", - "br gain", - "Set the red gain for the blue channel", - -2, 2, -2, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("bg-gain", - "bg gain", - "Set the green gain for the blue channel", - -2, 2, -2, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("bb-gain", - "bb gain", - "Set the blue gain for the blue channel", - -2, 2, -2, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-colortoalpha - */ - procedure = gimp_procedure_new (plug_in_colortoalpha_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-colortoalpha"); - gimp_procedure_set_static_help (procedure, - "Convert a specified color to transparency", - "This replaces as much of a given color as possible in each pixel with a corresponding amount of alpha, then readjusts the color accordingly.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Spencer Kimball & Peter Mattis", - "Spencer Kimball & Peter Mattis", - "1999"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_color ("color", - "color", - "Color to remove", - FALSE, - NULL, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-convmatrix - */ - procedure = gimp_procedure_new (plug_in_convmatrix_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-convmatrix"); - gimp_procedure_set_static_help (procedure, - "Apply a generic 5x5 convolution matrix", - "Apply a generic 5x5 convolution matrix.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:convolution-matrix' for credits.", - "Compatibility procedure. Please see 'gegl:convolution-matrix' for credits.", - "2014"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_double_array ("matrix", - "matrix", - "The 5x5 convolution matrix", - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("alpha-alg", - "alpha alg", - "Enable weighting by alpha channel", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("divisor", - "divisor", - "Divisor", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("offset", - "offset", - "Offset", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_int32_array ("channels", - "channels", - "Mask of the channels to be filtered", - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("bmode", - "bmode", - "Mode for treating image borders { EXTEND (0), WRAP (1), CLEAR (2) }", - 0, 2, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-plug-in-cubism */ @@ -5608,156 +1663,6 @@ register_plug_in_compat_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - /* - * gimp-plug-in-deinterlace - */ - procedure = gimp_procedure_new (plug_in_deinterlace_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-deinterlace"); - gimp_procedure_set_static_help (procedure, - "Fix images where every other row is missing", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:deinterlace' for credits.", - "Compatibility procedure. Please see 'gegl:deinterlace' for credits.", - "2014"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("evenodd", - "evenodd", - "Which lines to keep { KEEP-ODD (0), KEEP-EVEN (1)", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-diffraction - */ - procedure = gimp_procedure_new (plug_in_diffraction_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-diffraction"); - gimp_procedure_set_static_help (procedure, - "Generate diffraction patterns", - "Help? What help?", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:diffraction-patterns' for credits.", - "Compatibility procedure. Please see 'gegl:diffraction-patterns' for credits.", - "2015"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("lam-r", - "lam r", - "Light frequency (red)", - 0.0, 20.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("lam-g", - "lam g", - "Light frequency (green)", - 0.0, 20.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("lam-b", - "lam b", - "Light frequency (blue)", - 0.0, 20.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("contour-r", - "contour r", - "Number of contours (red)", - 0.0, 10.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("contour-g", - "contour g", - "Number of contours (green)", - 0.0, 10.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("contour-b", - "contour b", - "Number of contours (blue)", - 0.0, 10.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("edges-r", - "edges r", - "Number of sharp edges (red)", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("edges-g", - "edges g", - "Number of sharp edges (green)", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("edges-b", - "edges b", - "Number of sharp edges (blue)", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("brightness", - "brightness", - "Brightness and shifting/fattening of contours", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("scattering", - "scattering", - "Scattering (Speed vs. quality)", - 0.0, 100.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("polarization", - "polarization", - "Polarization", - -1.0, 1.0, -1.0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-plug-in-displace */ @@ -5836,144 +1741,6 @@ register_plug_in_compat_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - /* - * gimp-plug-in-displace-polar - */ - procedure = gimp_procedure_new (plug_in_displace_polar_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-displace-polar"); - gimp_procedure_set_static_help (procedure, - "Displace pixels as indicated by displacement maps", - "Just like plug-in-displace but working in polar coordinates. The drawable is whirled and pinched according to the map.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:displace' for credits.", - "Compatibility procedure. Please see 'gegl:displace' for credits.", - "2015"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("amount-x", - "amount x", - "Displace multiplier for radial direction", - -500.0, 500.0, -500.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("amount-y", - "amount y", - "Displace multiplier for tangent direction", - -500.0, 500.0, -500.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("do-x", - "do x", - "Displace in radial direction ?", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("do-y", - "do y", - "Displace in tangent direction ?", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("displace-map-x", - "displace map x", - "Displacement map for radial direction", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("displace-map-y", - "displace map y", - "Displacement map for tangent direction", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("displace-type", - "displace type", - "Edge behavior { WRAP (1), SMEAR (2), BLACK (3) }", - 1, 3, 1, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-dog - */ - procedure = gimp_procedure_new (plug_in_dog_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-dog"); - gimp_procedure_set_static_help (procedure, - "Edge detection with control of edge thickness", - "Applies two Gaussian blurs to the drawable, and subtracts the results. This is robust and widely used method for detecting edges.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:difference-of-gaussians' for credits.", - "Compatibility procedure. Please see 'gegl:difference-of-gaussians' for credits.", - "2015"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("inner", - "inner", - "Radius of inner gaussian blur in pixels", - 0.0, 10.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("outer", - "outer", - "Radius of outer gaussian blur in pixels", - 0.0, 10.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("normalize", - "normalize", - "Normalize", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("invert", - "invert", - "Invert", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-plug-in-edge */ @@ -6088,264 +1855,6 @@ register_plug_in_compat_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - /* - * gimp-plug-in-engrave - */ - procedure = gimp_procedure_new (plug_in_engrave_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-engrave"); - gimp_procedure_set_static_help (procedure, - "Simulate an antique engraving", - "Creates a black-and-white 'engraved' version of an image as seen in old illustrations.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:engrave' for credits.", - "Compatibility procedure. Please see 'gegl:engrave' for credits.", - "2014"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("height", - "height", - "Resolution in pixels", - 2, 16, 2, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("limit", - "limit", - "Limit line width", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-exchange - */ - procedure = gimp_procedure_new (plug_in_exchange_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-exchange"); - gimp_procedure_set_static_help (procedure, - "Swap one color with another", - "Exchange one color with another, optionally setting a threshold to convert from one shade to another.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:color-exchange' for credits.", - "Compatibility procedure. Please see 'gegl:color-exchange' for credits.", - "2014"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("from-red", - "from red", - "Red value (from)", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("from-green", - "from green", - "Green value (from)", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("from-blue", - "from blue", - "Blue value (from)", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("to-red", - "to red", - "Red value (to)", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("to-green", - "to green", - "Green value (to)", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("to-blue", - "to blue", - "Blue value (to)", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("red-threshold", - "red threshold", - "Red threshold", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("green-threshold", - "green threshold", - "Green threshold", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("blue-threshold", - "blue threshold", - "Blue threshold", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-flarefx - */ - procedure = gimp_procedure_new (plug_in_flarefx_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-flarefx"); - gimp_procedure_set_static_help (procedure, - "Add a lens flare effect", - "Adds a lens flare effects. Makes your image look like it was snapped with a cheap camera with a lot of lens :)", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:lens-flare' for credits.", - "Compatibility procedure. Please see 'gegl:lens-flare' for credits.", - "2015"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("pos-x", - "pos x", - "X-Position", - G_MININT32, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("pos-y", - "pos y", - "Y-Position", - G_MININT32, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-fractal-trace - */ - procedure = gimp_procedure_new (plug_in_fractal_trace_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-fractal-trace"); - gimp_procedure_set_static_help (procedure, - "Transform image with the Mandelbrot Fractal", - "Transform image with the Mandelbrot Fractal", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:fractal-trace' for credits.", - "Compatibility procedure. Please see 'gegl:fractal-trace' for credits.", - "2018"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("xmin", - "xmin", - "xmin fractal image delimiter", - -50.0, 50.0, -50.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("xmax", - "xmax", - "xmax fractal image delimiter", - -50.0, 50.0, -50.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("ymin", - "ymin", - "ymin fractal image delimiter", - -50.0, 50.0, -50.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("ymax", - "ymax", - "ymax fractal image delimiter", - -50.0, 50.0, -50.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("depth", - "depth", - "Trace depth", - 1, 65536, 1, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("outside-type", - "outside type", - "Outside type { WRAP (0), TRANS (1), BLACK (2), WHITE (3) }", - 0, 3, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-plug-in-gauss */ @@ -6400,306 +1909,6 @@ register_plug_in_compat_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - /* - * gimp-plug-in-glasstile - */ - procedure = gimp_procedure_new (plug_in_glasstile_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-glasstile"); - gimp_procedure_set_static_help (procedure, - "Simulate distortion caused by square glass tiles", - "Divide the image into square glassblocks in which the image is refracted.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:tile-glass' for credits.", - "Compatibility procedure. Please see 'gegl:tile-glass' for credits.", - "2014"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("tilex", - "tilex", - "Tile width", - 10, 500, 10, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("tiley", - "tiley", - "Tile height", - 10, 500, 10, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-hsv-noise - */ - procedure = gimp_procedure_new (plug_in_hsv_noise_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-hsv-noise"); - gimp_procedure_set_static_help (procedure, - "Randomize hue, saturation and value independently", - "Scattering pixel values in HSV space", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:noise-hsv' for credits.", - "Compatibility procedure. Please see 'gegl:noise-hsv' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("holdness", - "holdness", - "Convolution strength", - 1, 8, 1, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("hue-distance", - "hue distance", - "Scattering of hue angle", - 0, 180, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("saturation-distance", - "saturation distance", - "Distribution distance on saturation axis", - 0, 255, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("value-distance", - "value distance", - "Distribution distance on value axis", - 0, 255, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-illusion - */ - procedure = gimp_procedure_new (plug_in_illusion_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-illusion"); - gimp_procedure_set_static_help (procedure, - "Superimpose many altered copies of the image", - "Produce illusion.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:illusion' for credits.", - "Compatibility procedure. Please see 'gegl:illusion' for credits.", - "2014"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("division", - "division", - "The number of divisions", - 0, 64, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("type", - "type", - "Illusion type { TYPE1 (0), TYPE2 (1) }", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-laplace - */ - procedure = gimp_procedure_new (plug_in_laplace_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-laplace"); - gimp_procedure_set_static_help (procedure, - "High-resolution edge detection", - "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 with 1.5 - 5.0 depending on the noise in the image is best.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:edge-laplace' for credits.", - "Compatibility procedure. Please see 'gegl:edge-laplace' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-lens-distortion - */ - procedure = gimp_procedure_new (plug_in_lens_distortion_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-lens-distortion"); - gimp_procedure_set_static_help (procedure, - "Corrects lens distortion", - "Corrects barrel or pincushion lens distortion.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:lens-distortion' for credits.", - "Compatibility procedure. Please see 'gegl:lens-distortion' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("offset-x", - "offset x", - "Effect centre offset in X", - -100, 100, -100, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("offset-y", - "offset y", - "Effect centre offset in Y", - -100, 100, -100, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("main-adjust", - "main adjust", - "Amount of second-order distortion", - -100, 100, -100, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("edge-adjust", - "edge adjust", - "Amount of fourth-order distortion", - -100, 100, -100, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("rescale", - "rescale", - "Rescale overall image size", - -100, 100, -100, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("brighten", - "brighten", - "Adjust brightness in corners", - -100, 100, -100, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-make-seamless - */ - procedure = gimp_procedure_new (plug_in_make_seamless_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-make-seamless"); - gimp_procedure_set_static_help (procedure, - "Alters edges to make the image seamlessly tileable", - "This plug-in creates a seamless tileable from the input drawable.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:tile-seamless' for credits.", - "Compatibility procedure. Please see 'gegl:tile-seamless' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-plug-in-maze */ @@ -6778,559 +1987,6 @@ register_plug_in_compat_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - /* - * gimp-plug-in-mblur - */ - procedure = gimp_procedure_new (plug_in_mblur_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-mblur"); - gimp_procedure_set_static_help (procedure, - "Simulate movement using directional blur", - "This plug-in simulates the effect seen when photographing a moving object at a slow shutter speed. Done by adding multiple displaced copies.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:motion-blur-linear, -zoom, -circular' for credits.", - "Compatibility procedure. Please see 'gegl:motion-blur-linear, -zoom, -circular' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("type", - "type", - "Type of motion blur { LINEAR (0), RADIAL (1), ZOOM (2) }", - 0, 2, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("length", - "length", - "Length", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("angle", - "angle", - "Angle", - 0, 360, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("center-x", - "center x", - "Center X", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("center-y", - "center y", - "Center Y", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-mblur-inward - */ - procedure = gimp_procedure_new (plug_in_mblur_inward_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-mblur-inward"); - gimp_procedure_set_static_help (procedure, - "Simulate movement using directional blur", - "This procedure is equivalent to plug-in-mblur but performs the zoom blur inward instead of outward.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:motion-blur-linear, -zoom, -circular' for credits.", - "Compatibility procedure. Please see 'gegl:motion-blur-linear, -zoom, -circular' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("type", - "type", - "Type of motion blur { LINEAR (0), RADIAL (1), ZOOM (2) }", - 0, 2, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("length", - "length", - "Length", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("angle", - "angle", - "Angle", - 0, 360, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("center-x", - "center x", - "Center X", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("center-y", - "center y", - "Center Y", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-median-blur - */ - procedure = gimp_procedure_new (plug_in_median_blur_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-median-blur"); - gimp_procedure_set_static_help (procedure, - "Blur using the median color near each pixel", - "Blur resulting from computing the median color in the neighborhood of each pixel", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:median-blur' for credits.", - "Compatibility procedure. Please see 'gegl:median-blur' for credits.", - "2021"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("radius", - "radius", - "Neighborhood radius, a negative value will calculate with inverted percentiles", - -400, 400, -400, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("percentile", - "percentile", - "Neighborhood color percentile", - 0, 100, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-mosaic - */ - procedure = gimp_procedure_new (plug_in_mosaic_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-mosaic"); - gimp_procedure_set_static_help (procedure, - "Convert the image into irregular tiles", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:mosaic' for credits.", - "Compatibility procedure. Please see 'gegl:mosaic' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("tile-size", - "tile size", - "Average diameter of each tile (in pixels)", - 1, 1000, 1, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("tile-height", - "tile height", - "Apparent height of each tile (in pixels)", - 1, 1000, 1, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("tile-spacing", - "tile spacing", - "Inter_tile spacing (in pixels)", - 0.1, 1000, 0.1, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("tile-neatness", - "tile neatness", - "Deviation from perfectly formed tiles", - 0, 1.0, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("tile-allow-split", - "tile allow split", - "Allows splitting tiles at hard edges", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("light-dir", - "light dir", - "Direction of light_source (in degrees)", - 0, 360, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("color-variation", - "color variation", - "Magnitude of random color variations", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("antialiasing", - "antialiasing", - "Enables smoother tile output at the cost of speed", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("color-averaging", - "color averaging", - "Tile color based on average of subsumed pixels", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("tile-type", - "tile type", - "Tile geometry { SQUARES (0), HEXAGONS (1), OCTAGONS (2), TRIANGLES (3) }", - 0, 3, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("tile-surface", - "tile surface", - "Surface characteristics { SMOOTH (0), ROUGH (1) }", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("grout-color", - "grout color", - "Grout color (black/white or fore/background) { BW (0), FG-BG (1) }", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-neon - */ - procedure = gimp_procedure_new (plug_in_neon_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-neon"); - gimp_procedure_set_static_help (procedure, - "Simulate the glowing boundary of a neon light", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:edge-neon' for credits.", - "Compatibility procedure. Please see 'gegl:edge-neon' for credits.", - "2019"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("radius", - "radius", - "Radius of neon effect (in pixels)", - 0.0, 1500.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("amount", - "amount", - "Effect enhancement variable", - 0.0, 100.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-newsprint - */ - procedure = gimp_procedure_new (plug_in_newsprint_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-newsprint"); - gimp_procedure_set_static_help (procedure, - "Halftone the image to give newspaper-like effect", - "Halftone the image to give newspaper-like effect", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:newsprint' for credits.", - "Compatibility procedure. Please see 'gegl:newsprint' for credits.", - "2019"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("cell-width", - "cell width", - "Screen cell width in pixels", - 0, 1500, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("colorspace", - "colorspace", - "Separate to { GRAYSCALE (0), RGB (1), CMYK (2), LUMINANCE (3) }", - 0, 3, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("k-pullout", - "k pullout", - "Percentage of black to pullout (CMYK only)", - 0, 100, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("gry-ang", - "gry ang", - "Grey/black screen angle (degrees)", - 0.0, 360.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("gry-spotfn", - "gry spotfn", - "Grey/black spot function { DOTS (0), LINES (1), DIAMONDS (2), EUCLIDIAN-DOT (3), PS-DIAMONDS (4) }", - 0, 4, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("red-ang", - "red ang", - "Red/cyan screen angle (degrees)", - 0.0, 360.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("red-spotfn", - "red spotfn", - "Red/cyan spot function { DOTS (0), LINES (1), DIAMONDS (2), EUCLIDIAN-DOT (3), PS-DIAMONDS (4) }", - 0, 4, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("grn-ang", - "grn ang", - "Green/magenta screen angle (degrees)", - 0.0, 360.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("grn-spotfn", - "grn spotfn", - "Green/magenta spot function { DOTS (0), LINES (1), DIAMONDS (2), EUCLIDIAN-DOT (3), PS-DIAMONDS (4) }", - 0, 4, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("blu-ang", - "blu ang", - "Blue/yellow screen angle (degrees)", - 0.0, 360.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("blu-spotfn", - "blu spotfn", - "Blue/yellow spot function { DOTS (0), LINES (1), DIAMONDS (2), EUCLIDIAN-DOT (3), PS-DIAMONDS (4) }", - 0, 4, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("oversample", - "oversample", - "how many times to oversample spot fn", - 1, 128, 1, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-normalize - */ - procedure = gimp_procedure_new (plug_in_normalize_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-normalize"); - gimp_procedure_set_static_help (procedure, - "Stretch brightness values to cover the full range", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:stretch-contrast' for credits.", - "Compatibility procedure. Please see 'gegl:stretch-contrast' for credits.", - "2019"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-nova - */ - procedure = gimp_procedure_new (plug_in_nova_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-nova"); - gimp_procedure_set_static_help (procedure, - "Add a starburst to the image", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:supernova' for credits.", - "Compatibility procedure. Please see 'gegl:supernova' for credits.", - "2014"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("xcenter", - "xcenter", - "X coordinates of the center of supernova", - G_MININT32, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("ycenter", - "ycenter", - "Y coordinates of the center of supernova", - G_MININT32, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_color ("color", - "color", - "Color of supernova", - FALSE, - NULL, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("radius", - "radius", - "Radius of supernova", - 1, 3000, 1, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("nspoke", - "nspoke", - "Number of spokes", - 1, 1024, 1, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("randomhue", - "randomhue", - "Random hue", - 0, 360, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-plug-in-oilify */ @@ -7379,266 +2035,6 @@ register_plug_in_compat_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - /* - * gimp-plug-in-oilify-enhanced - */ - procedure = gimp_procedure_new (plug_in_oilify_enhanced_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-oilify-enhanced"); - gimp_procedure_set_static_help (procedure, - "Smear colors to simulate an oil painting", - "This function performs the well-known oil-paint effect on the specified drawable.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:oilify' for credits.", - "Compatibility procedure. Please see 'gegl:oilify' for credits.", - "2019"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("mode", - "mode", - "Algorithm { RGB (0), INTENSITY (1) }", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("mask-size", - "mask size", - "Oil paint mask size", - 1, 200, 1, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("mask-size-map", - "mask size map", - "Mask size control map", - TRUE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("exponent", - "exponent", - "Oil paint exponent", - 1, 20, 1, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("exponent-map", - "exponent map", - "Exponent control map", - TRUE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-papertile - */ - procedure = gimp_procedure_new (plug_in_papertile_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-papertile"); - gimp_procedure_set_static_help (procedure, - "Cut image into paper tiles, and slide them", - "This plug-in cuts an image into paper tiles and slides each paper tile.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:tile-paper' for credits.", - "Compatibility procedure. Please see 'gegl:tile-paper' for credits.", - "2015"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("tile-size", - "tile size", - "Tile size (pixels)", - 1, G_MAXINT32, 1, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("move-max", - "move max", - "Max move rate (%)", - 1.0, 100.0, 1.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("fractional-type", - "fractional type", - "Fractional type { BACKGROUND (0), IGNORE (1), FORCE (2) }", - 0, 2, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("wrap-around", - "wrap around", - "Wrap around", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("centering", - "centering", - "Centering", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("background-type", - "background type", - "Background type { TRANSPARENT (0), INVERTED (1), IMAGE (2), FG (3), BG (4), COLOR (5) }", - 0, 5, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_color ("background-color", - "background color", - "Background color (for background-type == 5)", - FALSE, - NULL, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("background-alpha", - "background alpha", - "Background alpha (unused)", - G_MININT32, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-photocopy - */ - procedure = gimp_procedure_new (plug_in_photocopy_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-photocopy"); - gimp_procedure_set_static_help (procedure, - "Simulate color distortion produced by a copy machine", - "Propagates dark values in an image based on each pixel's relative darkness to a neighboring average. The idea behind this filter is to give the look of a photocopied version of the image, with toner transferred based on the relative darkness of a particular region. This is achieved by darkening areas of the image which are measured to be darker than a neighborhood average and setting other pixels to white. In this way, sufficiently large shifts in intensity are darkened to black. The rate at which they are darkened to black is determined by the second pct_black parameter. The mask_radius parameter controls the size of the pixel neighborhood over which the average intensity is computed and then compared to each pixel in the neighborhood to decide whether or not to darken it to black. Large values for mask_radius result in very thick black areas bordering the regions of white and much less detail for black areas everywhere including inside regions of color. Small values result in\n" - "less toner overall and more detail everywhere. Small values for the pct_black make the blend from the white regions to the black border lines smoother and the toner regions themselves thinner and less noticeable; larger values achieve the opposite effect.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:photocopy' for credits.", - "Compatibility procedure. Please see 'gegl:photocopy' for credits.", - "2019"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("mask-radius", - "mask radius", - "Photocopy mask radius (radius of pixel neighborhood)", - 3.0, 50.0, 3.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("sharpness", - "sharpness", - "Sharpness (detail level)", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("pct-black", - "pct black", - "Percentage of darkened pixels to set to black", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("pct-white", - "pct white", - "Percentage of non-darkened pixels left white", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-pixelize - */ - procedure = gimp_procedure_new (plug_in_pixelize_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-pixelize"); - gimp_procedure_set_static_help (procedure, - "Simplify image into an array of solid-colored rectangles", - "Pixelize the contents of the specified drawable with specified pixelizing width and height.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Spencer Kimball & Peter Mattis", - "Spencer Kimball & Peter Mattis", - "1997"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("pixel-width", - "pixel width", - "Pixel width (the decrease in horizontal resolution)", - 1, GIMP_MAX_IMAGE_SIZE, 1, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("pixel-height", - "pixel height", - "Pixel height (the decrease in vertical resolution)", - 1, GIMP_MAX_IMAGE_SIZE, 1, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-plug-in-plasma */ @@ -7687,444 +2083,6 @@ register_plug_in_compat_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - /* - * gimp-plug-in-polar-coords - */ - procedure = gimp_procedure_new (plug_in_polar_coords_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-polar-coords"); - gimp_procedure_set_static_help (procedure, - "Convert image to or from polar coordinates", - "Remaps and image from rectangular coordinates to polar coordinates or vice versa.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Spencer Kimball & Peter Mattis", - "Spencer Kimball & Peter Mattis", - "1997"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("circle", - "circle", - "Circle depth in %", - 0.0, 100.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("angle", - "angle", - "Offset angle", - 0.0, 360.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("backwards", - "backwards", - "Map backwards", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("inverse", - "inverse", - "Map from top", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("polrec", - "polrec", - "Polar to rectangular", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-red-eye-removal - */ - procedure = gimp_procedure_new (plug_in_red_eye_removal_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-red-eye-removal"); - gimp_procedure_set_static_help (procedure, - "Remove the red eye effect caused by camera flashes", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:red-eye-removal' for credits.", - "Compatibility procedure. Please see 'gegl:red-eye-removal' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("threshold", - "threshold", - "Red eye threshold in percent", - 0, 100, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-randomize-hurl - */ - procedure = gimp_procedure_new (plug_in_randomize_hurl_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-randomize-hurl"); - gimp_procedure_set_static_help (procedure, - "Completely randomize a fraction of pixels", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:noise-hurl' for credits.", - "Compatibility procedure. Please see 'gegl:noise-hurl' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("rndm-pct", - "rndm pct", - "Randomization percentage", - 0.0, 100.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("rndm-rcount", - "rndm rcount", - "Repeat count", - 1.0, 100.0, 1.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("randomize", - "randomize", - "Use random seed", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("seed", - "seed", - "Seed value (used only if randomize is FALSE)", - G_MININT32, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-randomize-pick - */ - procedure = gimp_procedure_new (plug_in_randomize_pick_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-randomize-pick"); - gimp_procedure_set_static_help (procedure, - "Randomly interchange some pixels with neighbors", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:noise-pick' for credits.", - "Compatibility procedure. Please see 'gegl:noise-pick' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("rndm-pct", - "rndm pct", - "Randomization percentage", - 1.0, 100.0, 1.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("rndm-rcount", - "rndm rcount", - "Repeat count", - 1.0, 100.0, 1.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("randomize", - "randomize", - "Use random seed", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("seed", - "seed", - "Seed value (used only if randomize is FALSE)", - G_MININT32, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-randomize-slur - */ - procedure = gimp_procedure_new (plug_in_randomize_slur_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-randomize-slur"); - gimp_procedure_set_static_help (procedure, - "Randomly slide some pixels downward (similar to melting", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:noise-slur' for credits.", - "Compatibility procedure. Please see 'gegl:noise-slur' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("rndm-pct", - "rndm pct", - "Randomization percentage", - 1.0, 100.0, 1.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("rndm-rcount", - "rndm rcount", - "Repeat count", - 1.0, 100.0, 1.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("randomize", - "randomize", - "Use random seed", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("seed", - "seed", - "Seed value (used only if randomize is FALSE)", - G_MININT32, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-rgb-noise - */ - procedure = gimp_procedure_new (plug_in_rgb_noise_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-rgb-noise"); - gimp_procedure_set_static_help (procedure, - "Distort colors by random amounts", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:noise-rgb' for credits.", - "Compatibility procedure. Please see 'gegl:noise-rgb' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("independent", - "independent", - "Noise in channels independent", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("correlated", - "correlated", - "Noise correlated (i.e. multiplicative not additive)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("noise-1", - "noise 1", - "Noise in the first channel (red, gray)", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("noise-2", - "noise 2", - "Noise in the second channel (green, gray_alpha)", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("noise-3", - "noise 3", - "Noise in the third channel (blue)", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("noise-4", - "noise 4", - "Noise in the fourth channel (alpha)", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-ripple - */ - procedure = gimp_procedure_new (plug_in_ripple_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-ripple"); - gimp_procedure_set_static_help (procedure, - "Displace pixels in a ripple pattern", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:ripple' for credits.", - "Compatibility procedure. Please see 'gegl:ripple' for credits.", - "2018"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("period", - "period", - "Period: number of pixels for one wave to complete", - 0.0, 1000.0, 200, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("amplitude", - "amplitude", - "Amplitude: maximum displacement of wave", - 0.0, 1000.0, 25, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("orientation", - "orientation", - "Orientation { ORIENTATION-HORIZONTAL (0), ORIENTATION-VERTICAL (1) }", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("edges", - "edges", - "Edges { SMEAR (0), WRAP (1), BLANK (2) }", - 0, 2, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("waveform", - "waveform", - "Waveform { SAWTOOTH (0), SINE (1) }", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("antialias", - "antialias", - "Antialias { TRUE, FALSE }", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("tile", - "tile", - "Tileable { TRUE, FALSE }", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-plug-in-rotate */ @@ -8239,362 +2197,6 @@ register_plug_in_compat_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - /* - * gimp-plug-in-sel-gauss - */ - procedure = gimp_procedure_new (plug_in_sel_gauss_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-sel-gauss"); - gimp_procedure_set_static_help (procedure, - "Blur neighboring pixels, but only in low-contrast areas", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:gaussian-blur-selective' for credits.", - "Compatibility procedure. Please see 'gegl:gaussian-blur-selective' for credits.", - "2099"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("radius", - "radius", - "Radius of gaussian blur (in pixels)", - 1.0, 1000.0, 1.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("max-delta", - "max delta", - "Maximum delta", - 0, 255, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-semiflatten - */ - procedure = gimp_procedure_new (plug_in_semiflatten_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-semiflatten"); - gimp_procedure_set_static_help (procedure, - "Replace partial transparency with the current background color", - "This plug-in flattens pixels in an RGBA image that aren't completely transparent against the current GIMP background color.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Spencer Kimball & Peter Mattis", - "Spencer Kimball & Peter Mattis", - "1997"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-shift - */ - procedure = gimp_procedure_new (plug_in_shift_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-shift"); - gimp_procedure_set_static_help (procedure, - "Shift each row or column of pixels by a random amount", - "Shifts the pixels of the specified drawable. Each row or column will be displaced a random value of pixels.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:shift' for credits.", - "Compatibility procedure. Please see 'gegl:shift' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("shift-amount", - "shift amount", - "Shift amount", - 0, 200, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("orientation", - "orientation", - "Orientation { ORIENTATION-VERTICAL (0), ORIENTATION-HORIZONTAL (1) }", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-sinus - */ - procedure = gimp_procedure_new (plug_in_sinus_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-sinus"); - gimp_procedure_set_static_help (procedure, - "Generate complex sinusoidal textures", - "FIXME: sinus help", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:sinus' for credits.", - "Compatibility procedure. Please see 'gegl:sinus' for credits.", - "2014"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("xscale", - "xscale", - "Scale value for x axis", - 0.0001, 100.0, 0.0001, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("yscale", - "yscale", - "Scale value for y axis", - 0.0001, 100.0, 0.0001, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("complex", - "complex", - "Complexity factor", - 0, G_MAXDOUBLE, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("seed", - "seed", - "Seed value for random number generator", - 0, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("tiling", - "tiling", - "If set, the pattern generated will tile", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("perturb", - "perturb", - "If set, the pattern is a little more distorted...", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("colors", - "colors", - "where to take the colors (0=B&W, 1=fg/bg, 2=col1/col2)", - 0, 2, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_color ("col1", - "col1", - "fist color (sometimes unused)", - FALSE, - NULL, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_color ("col2", - "col2", - "second color (sometimes unused)", - FALSE, - NULL, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("alpha1", - "alpha1", - "alpha for the first color (used if the drawable has an alpha channel)", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("alpha2", - "alpha2", - "alpha for the second color (used if the drawable has an alpha channel)", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("blend", - "blend", - "0=linear, 1=bilinear, 2=sinusoidal", - 0, 2, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("blend-power", - "blend power", - "Power used to stretch the blend", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-sobel - */ - procedure = gimp_procedure_new (plug_in_sobel_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-sobel"); - gimp_procedure_set_static_help (procedure, - "Specialized direction-dependent edge detection", - "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.\"", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:edge-sobel' for credits.", - "Compatibility procedure. Please see 'gegl:edge-sobel' for credits.", - "2014"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("horizontal", - "horizontal", - "Sobel in horizontal direction", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("vertical", - "vertical", - "Sobel in vertical direction", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("keep-sign", - "keep sign", - "Keep sign of result (one direction only)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-softglow - */ - procedure = gimp_procedure_new (plug_in_softglow_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-softglow"); - gimp_procedure_set_static_help (procedure, - "Simulate glow by making highlights intense and fuzzy", - "Gives an image a softglow effect by intensifying the highlights in the image. This is done by screening a modified version of the drawable with itself. The modified version is desaturated and then a sigmoidal transfer function is applied to force the distribution of intensities into very small and very large only. This desaturated version is then blurred to give it a fuzzy 'vaseline-on-the-lens' effect. The glow radius parameter controls the sharpness of the glow effect. The brightness parameter controls the degree of intensification applied to image highlights. The sharpness parameter controls how defined or alternatively, diffuse, the glow effect should be.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:softglow' for credits.", - "Compatibility procedure. Please see 'gegl:softglow' for credits.", - "2019"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("glow-radius", - "glow radius", - "Glow radius in pixels", - 1.0, 50.0, 1.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("brightness", - "brightness", - "Glow brightness", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("sharpness", - "sharpness", - "Glow sharpness", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-plug-in-solid-noise */ @@ -8757,366 +2359,6 @@ register_plug_in_compat_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - /* - * gimp-plug-in-unsharp-mask - */ - procedure = gimp_procedure_new (plug_in_unsharp_mask_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-unsharp-mask"); - gimp_procedure_set_static_help (procedure, - "The most widely useful method for sharpening an image", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:unsharp-mask' for credits.", - "Compatibility procedure. Please see 'gegl:unsharp-mask' for credits.", - "2018"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("radius", - "radius", - "Radius of gaussian blur", - 0.0, 300.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("amount", - "amount", - "Strength of effect", - 0.0, 300.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("threshold", - "threshold", - "Threshold", - 0, 255, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-video - */ - procedure = gimp_procedure_new (plug_in_video_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-video"); - gimp_procedure_set_static_help (procedure, - "Simulate distortion produced by a fuzzy or low-res monitor", - "This function simulates the degradation of being on an old low-dotpitch RGB video monitor to the specified drawable.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:video-degradation' for credits.", - "Compatibility procedure. Please see 'gegl:video-degradation' for credits.", - "2014"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("pattern-number", - "pattern number", - "Type of RGB pattern to use", - 0, 8, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("additive", - "additive", - "Whether the function adds the result to the original image", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_boolean ("rotated", - "rotated", - "Whether to rotate the RGB pattern by ninety degrees", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-vinvert - */ - procedure = gimp_procedure_new (plug_in_vinvert_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-vinvert"); - gimp_procedure_set_static_help (procedure, - "Invert the brightness of each pixel", - "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).", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Spencer Kimball & Peter Mattis", - "Spencer Kimball & Peter Mattis", - "1997"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-vpropagate - */ - procedure = gimp_procedure_new (plug_in_vpropagate_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-vpropagate"); - gimp_procedure_set_static_help (procedure, - "Propagate certain colors to neighboring pixels", - "Propagate values of the layer.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:value-propagate' for credits.", - "Compatibility procedure. Please see 'gegl:value-propagate' for credits.", - "2015"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("propagate-mode", - "propagate mode", - "Propagate mode { 0:white, 1:black, 2:middle value 3:foreground to peak, 4:foreground, 5:background, 6:opaque, 7:transparent }", - 0, 7, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("propagating-channel", - "propagating channel", - "Channels which values are propagated", - G_MININT32, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("propagating-rate", - "propagating rate", - "Propagating rate", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("direction-mask", - "direction mask", - "Direction mask", - 0, 15, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("lower-limit", - "lower limit", - "Lower limit", - 0, 255, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("upper-limit", - "upper limit", - "Upper limit", - 0, 255, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-dilate - */ - procedure = gimp_procedure_new (plug_in_dilate_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-dilate"); - gimp_procedure_set_static_help (procedure, - "Grow lighter areas of the image", - "Dilate image.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:value-propagate' for credits.", - "Compatibility procedure. Please see 'gegl:value-propagate' for credits.", - "2015"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("propagate-mode", - "propagate mode", - "Propagate mode { 0:white, 1:black, 2:middle value 3:foreground to peak, 4:foreground, 5:background, 6:opaque, 7:transparent }", - 0, 7, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("propagating-channel", - "propagating channel", - "Channels which values are propagated", - G_MININT32, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("propagating-rate", - "propagating rate", - "Propagating rate", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("direction-mask", - "direction mask", - "Direction mask", - 0, 15, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("lower-limit", - "lower limit", - "Lower limit", - 0, 255, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("upper-limit", - "upper limit", - "Upper limit", - 0, 255, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-erode - */ - procedure = gimp_procedure_new (plug_in_erode_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-erode"); - gimp_procedure_set_static_help (procedure, - "Shrink lighter areas of the image", - "Erode image.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:value-propagate' for credits.", - "Compatibility procedure. Please see 'gegl:value-propagate' for credits.", - "2015"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("propagate-mode", - "propagate mode", - "Propagate mode { 0:white, 1:black, 2:middle value 3:foreground to peak, 4:foreground, 5:background, 6:opaque, 7:transparent }", - 0, 7, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("propagating-channel", - "propagating channel", - "Channels which values are propagated", - G_MININT32, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("propagating-rate", - "propagating rate", - "Propagating rate", - 0.0, 1.0, 0.0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("direction-mask", - "direction mask", - "Direction mask", - 0, 15, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("lower-limit", - "lower limit", - "Lower limit", - 0, 255, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("upper-limit", - "upper limit", - "Upper limit", - 0, 255, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-plug-in-waves */ @@ -9182,124 +2424,4 @@ register_plug_in_compat_procs (GimpPDB *pdb) GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - - /* - * gimp-plug-in-whirl-pinch - */ - procedure = gimp_procedure_new (plug_in_whirl_pinch_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-whirl-pinch"); - gimp_procedure_set_static_help (procedure, - "Distort an image by whirling and pinching", - "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.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:whirl-pinch' for credits.", - "Compatibility procedure. Please see 'gegl:whirl-pinch' for credits.", - "2013"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("whirl", - "whirl", - "Whirl angle (degrees)", - -720, 720, -720, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("pinch", - "pinch", - "Pinch amount", - -1, 1, -1, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_double ("radius", - "radius", - "Radius (1.0 is the largest circle that fits in the image, and 2.0 goes all the way to the corners)", - 0, 2, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - - /* - * gimp-plug-in-wind - */ - procedure = gimp_procedure_new (plug_in_wind_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-wind"); - gimp_procedure_set_static_help (procedure, - "Smear image to give windblown effect", - "Renders a wind effect.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Compatibility procedure. Please see 'gegl:wind' for credits.", - "Compatibility procedure. Please see 'gegl:wind' for credits.", - "2015"); - gimp_procedure_add_argument (procedure, - g_param_spec_enum ("run-mode", - "run mode", - "The run mode", - GIMP_TYPE_RUN_MODE, - GIMP_RUN_INTERACTIVE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_image ("image", - "image", - "Input image (unused)", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - gimp_param_spec_drawable ("drawable", - "drawable", - "Input drawable", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("threshold", - "threshold", - "Controls where blending will be done", - 0, 50, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("direction", - "direction", - "Wind direction { 0:left, 1:right, 2:top, 3:bottom }", - 0, 3, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("strength", - "strength", - "Controls the extent of the blending", - 1, 100, 1, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("algorithm", - "algorithm", - "Algorithm { WIND (0), BLAST (1) }", - 0, 1, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("edge", - "edge", - "Affected edge { BOTH (0), LEADING (1), TRAILING (2) }", - 0, 2, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); } diff --git a/pdb/groups/plug_in_compat.pdb b/pdb/groups/plug_in_compat.pdb index 612c9da2c3..dfcef44de9 100644 --- a/pdb/groups/plug_in_compat.pdb +++ b/pdb/groups/plug_in_compat.pdb @@ -22,241 +22,6 @@ # A declared range must correspond with range declared in GEGL # else args defaulted from min may generate out-of-range warnings. -sub plug_in_alienmap2 { - $blurb = 'Alter colors in various psychedelic ways'; - - $help = <<'HELP'; -No help yet. Just try it and you'll see! -HELP - - &std_pdb_compat('gegl:alien-map'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'redfrequency', type => '0 <= double <= 20', - desc => 'Red/hue component frequency factor' }, - { name => 'redangle', type => '0 <= double <= 360', - desc => 'Red/hue component angle factor (0-360)' }, - { name => 'greenfrequency', type => '0 <= double <= 20', - desc => 'Green/saturation component frequency factor' }, - { name => 'greenangle', type => '0 <= double <= 360', - desc => 'Green/saturation component angle factor (0-360)' }, - { name => 'bluefrequency', type => '0 <= double <= 20', - desc => 'Blue/luminance component frequency factor' }, - { name => 'blueangle', type => '0 <= double <= 360', - desc => 'Blue/luminance component angle factor (0-360)' }, - { name => 'colormodel', type => '0 <= int32 <= 1', - desc => 'Color model { RGB-MODEL (0), HSL-MODEL (1) }' }, - { name => 'redmode', type => 'boolean', - desc => 'Red/hue application mode' }, - { name => 'greenmode', type => 'boolean', - desc => 'Green/saturation application mode' }, - { name => 'bluemode', type => 'boolean', - desc => 'Blue/luminance application mode' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:alien-map", - "color-model", (gint) colormodel, - "cpn-1-frequency", (gdouble) redfrequency, - "cpn-2-frequency", (gdouble) greenfrequency, - "cpn-3-frequency", (gdouble) bluefrequency, - "cpn-1-phaseshift", (gdouble) redangle, - "cpn-2-phaseshift", (gdouble) greenangle, - "cpn-3-phaseshift", (gdouble) blueangle, - "cpn-1-keep", (gboolean) !redmode, - "cpn-2-keep", (gboolean) !greenmode, - "cpn-3-keep", (gboolean) !bluemode, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Alien Map"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_antialias { - $blurb = 'Antialias using the Scale3X edge-extrapolation algorithm'; - - $help = <<'HELP'; -No more help. -HELP - - &std_pdb_compat('gegl:antialias'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:antialias", - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Antialias"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_apply_canvas { - $blurb = 'Add a canvas texture to the image'; - - $help = <<'HELP'; -This function applies a canvas texture map to the drawable. -HELP - - &std_pdb_compat('gegl:texturize-canvas'); - $date = '2014'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'direction', type => '0 <= int32 <= 3', - desc => 'Light direction (0 - 3)' }, - { name => 'depth', type => '1 <= int32 <= 50', - desc => 'Texture depth (1 - 50)' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:texturize-canvas", - "direction", direction, - "depth", depth, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Apply Canvas"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_applylens { - $blurb = 'Simulate an elliptical lens over the image'; - - $help = <<'HELP'; -This plug-in uses Snell's law to draw an ellipsoid lens over the image. -HELP - - &std_pdb_compat('gegl:apply-lens'); - $date = '2014'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'refraction', type => '1.0 <= double <= 100.0', - desc => 'Lens refraction index' }, - { name => 'keep_surroundings', type => 'boolean', - desc => 'Keep lens surroundings' }, - { name => 'set_background', type => 'boolean', - desc => 'Set lens surroundings to BG value' }, - { name => 'set_transparent', type => 'boolean', dead => 1, - desc => 'Set lens surroundings transparent' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglColor *color; - GeglNode *node; - - if (set_background) - { - color = gegl_color_duplicate (gimp_context_get_background (context)); - } - else - { - color = gegl_color_new ("black"); - gegl_color_set_rgba_with_space (color, 0.0, 0.0, 0.0, 0.0, NULL); - } - - node = gegl_node_new_child (NULL, - "operation", "gegl:apply-lens", - "refraction-index", refraction, - "keep-surroundings", keep_surroundings, - "background-color", color, - NULL); - - g_object_unref (color); - - node = wrap_in_selection_bounds (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Apply Lens"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - sub plug_in_autocrop { $blurb = 'Remove empty borders from the image'; @@ -392,54 +157,6 @@ CODE ); } -sub plug_in_autostretch_hsv { - $blurb = 'Stretch contrast to cover the maximum possible range'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:stretch-contrast-hsv'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:stretch-contrast-hsv", - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Stretch Contrast HSV"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - sub plug_in_bump_map { $blurb = 'Create an embossing effect using a bump map'; @@ -508,74 +225,6 @@ CODE ); } -sub plug_in_bump_map_tiled { - $blurb = 'Create an embossing effect using a tiled image as a bump map'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:bump-map'); - $date = '2015'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'bumpmap', type => 'drawable', - desc => 'Bump map drawable' }, - { name => 'azimuth', type => '0.0 <= double <= 360.0', - desc => 'Azimuth' }, - { name => 'elevation', type => '0.5 <= double <= 90.0', - desc => 'Elevation' }, - { name => 'depth', type => '1 <= int32 <= 65', - desc => 'Depth' }, - { name => 'xofs', type => 'int32', - desc => 'X offset' }, - { name => 'yofs', type => 'int32', - desc => 'Y offset' }, - { name => 'waterlevel', type => '0.0 <= double <= 1.0', - desc => 'Level that full transparency should represent' }, - { name => 'ambient', type => '0.0 <= double <= 1.0', - desc => 'Ambient lighting factor' }, - { name => 'compensate', type => 'boolean', - desc => 'Compensate for darkening' }, - { name => 'invert', type => 'boolean', - desc => 'Invert bumpmap' }, - { name => 'type', type => '0 <= int32 <= 3', - desc => 'Type of map { LINEAR (0), SPHERICAL (1), SINUSOIDAL (2) }' } - ); - - %invoke = ( - code => <<'CODE' -{ - success = bump_map (drawable, - bumpmap, - azimuth, - elevation, - depth, - xofs, - yofs, - waterlevel, - ambient, - compensate, - invert, - type, - TRUE, - progress, - error); -} -CODE - ); -} - sub plug_in_c_astretch { $blurb = 'Stretch contrast to cover the maximum possible range'; @@ -624,344 +273,6 @@ CODE ); } -sub plug_in_cartoon { - $blurb = 'Simulate a cartoon by enhancing edges'; - - $help = <<'HELP'; -Propagates dark values in an image based on each pixel's relative -darkness to a neighboring average. The idea behind this filter is to -give the look of a black felt pen drawing subsequently shaded with -color. This is achieved by darkening areas of the image which are -measured to be darker than a neighborhood average. In this way, -sufficiently large shifts in intensity are darkened to black. The rate -at which they are darkened to black is determined by the second -pct_black parameter. The mask_radius parameter controls the size of -the pixel neighborhood over which the average intensity is computed -and then compared to each pixel in the neighborhood to decide whether -or not to darken it to black. Large values for mask_radius result in -very thick black areas bordering the shaded regions of color and much -less detail for black areas everywhere including inside regions of -color. Small values result in more subtle pen strokes and detail -everywhere. Small values for the pct_black make the blend from the -color regions to the black border lines smoother and the lines -themselves thinner and less noticeable; larger values achieve the -opposite effect. -HELP - - &std_pdb_compat('gegl:cartoon'); - $date = '2019'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'mask_radius', type => '1.0 <= double <= 50.0', - desc => 'Cartoon mask radius (radius of pixel neighborhood)' }, - { name => 'pct_black', type => '0.0 <= double <= 1.0', - desc => 'Percentage of darkened pixels to set to black' }, - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:cartoon", - "mask-radius", mask_radius, - "pct-black", pct_black, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Cartoon"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_colors_channel_mixer { - $blurb = 'Alter colors by mixing RGB Channels'; - - $help = <<'HELP'; -This plug-in mixes the RGB channels. -HELP - - &std_pdb_compat('gegl:channel-mixer'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'monochrome', type => '0 <= int32 <= 1', - desc => 'Monochrome { TRUE, FALSE }' }, - { name => 'rr_gain', type => '-2 <= double <= 2', - desc => 'Set the red gain for the red channel' }, - { name => 'rg_gain', type => '-2 <= double <= 2', - desc => 'Set the green gain for the red channel' }, - { name => 'rb_gain', type => '-2 <= double <= 2', - desc => 'Set the blue gain for the red channel' }, - { name => 'gr_gain', type => '-2 <= double <= 2', - desc => 'Set the red gain for the green channel' }, - { name => 'gg_gain', type => '-2 <= double <= 2', - desc => 'Set the green gain for the green channel' }, - { name => 'gb_gain', type => '-2 <= double <= 2', - desc => 'Set the blue gain for the green channel' }, - { name => 'br_gain', type => '-2 <= double <= 2', - desc => 'Set the red gain for the blue channel' }, - { name => 'bg_gain', type => '-2 <= double <= 2', - desc => 'Set the green gain for the blue channel' }, - { name => 'bb_gain', type => '-2 <= double <= 2', - desc => 'Set the blue gain for the blue channel' }, - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = NULL; - - if (monochrome) - { - node = gegl_node_new_child (NULL, - "operation", "gegl:mono-mixer", - "red", rr_gain, - "green", rg_gain, - "blue", rb_gain, - NULL); - } - else - { - node = gegl_node_new_child (NULL, - "operation", "gegl:channel-mixer", - "rr-gain", rr_gain, - "rg-gain", rg_gain, - "rb-gain", rb_gain, - "gr-gain", gr_gain, - "gg-gain", gg_gain, - "gb-gain", gb_gain, - "br-gain", br_gain, - "bg-gain", bg_gain, - "bb-gain", bb_gain, - NULL); - } - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Channel Mixer"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_colortoalpha { - $blurb = 'Convert a specified color to transparency'; - - $help = <<'HELP'; -This replaces as much of a given color as possible in each pixel with -a corresponding amount of alpha, then readjusts the color accordingly. -HELP - - &std_pdb_misc; - $date = '1999'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'color', type => 'geglcolor', - desc => 'Color to remove' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglColor *gegl_color = gegl_color_duplicate (color); - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:color-to-alpha", - "color", gegl_color, - NULL); - g_object_unref (gegl_color); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Color to Alpha"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_convmatrix { - $blurb = 'Apply a generic 5x5 convolution matrix'; - - $help = <<'HELP'; -Apply a generic 5x5 convolution matrix. -HELP - - &std_pdb_compat('gegl:convolution-matrix'); - $date = '2014'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'matrix', type => 'doublearray', - desc => 'The 5x5 convolution matrix', - array => { name => 'argc_matrix', - desc => 'The number of elements in the following array, must always be 25' } }, - { name => 'alpha_alg', type => 'boolean', - desc => 'Enable weighting by alpha channel' }, - { name => 'divisor', type => 'double', - desc => 'Divisor' }, - { name => 'offset', type => 'double', - desc => 'Offset' }, - { name => 'channels', type => 'int32array', - desc => 'Mask of the channels to be filtered', - array => { name => 'argc_channels', - desc => 'The number of elements in following array, must always be 5' } }, - { name => 'bmode', type => '0 <= int32 <= 2', - desc => 'Mode for treating image borders { EXTEND (0), WRAP (1), CLEAR (2) }' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (argc_matrix != 25) - { - g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT, - _("Array 'matrix' has only %d members, must have 25"), - /* TODO: rather than converting the gsize, we should - * change the string, but we are in string freeze. - */ - (gint) argc_matrix); - success = FALSE; - } - - if (success && argc_channels != 5) - { - g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT, - _("Array 'channels' has only %d members, must have 5"), - /* TODO: rather than converting the gsize, we should - * change the string, but we are in string freeze. - */ - (gint) argc_channels); - success = FALSE; - } - - if (success && - gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - GeglAbyssPolicy border = GEGL_ABYSS_CLAMP; - gboolean r = channels[1]; - gboolean g = channels[2]; - gboolean b = channels[3]; - gboolean a = channels[4]; - - if (gimp_drawable_is_gray (drawable)) - { - r = channels[0]; - g = channels[0]; - b = channels[0]; - } - - switch (bmode) - { - case 0: border = GEGL_ABYSS_CLAMP; break; - case 1: border = GEGL_ABYSS_LOOP; break; - case 2: border = GEGL_ABYSS_NONE; break; - } - - node = gegl_node_new_child (NULL, - "operation", "gegl:convolution-matrix", - "a1", matrix[0], - "a2", matrix[1], - "a3", matrix[2], - "a4", matrix[3], - "a5", matrix[4], - "b1", matrix[5], - "b2", matrix[6], - "b3", matrix[7], - "b4", matrix[8], - "b5", matrix[9], - "c1", matrix[10], - "c2", matrix[11], - "c3", matrix[12], - "c4", matrix[13], - "c5", matrix[14], - "d1", matrix[15], - "d2", matrix[16], - "d3", matrix[17], - "d4", matrix[18], - "d5", matrix[19], - "e1", matrix[20], - "e2", matrix[21], - "e3", matrix[22], - "e4", matrix[23], - "e5", matrix[24], - "divisor", divisor, - "offset", offset, - "red", r, - "green", g, - "blue", b, - "alpha", a, - "normalize", FALSE, - "alpha-weight", alpha_alg, - "border", border, - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Convolution Matrix"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - sub plug_in_cubism { $blurb = 'Convert the image into randomly rotated square blobs'; @@ -1028,144 +339,6 @@ CODE ); } -sub plug_in_deinterlace { - $blurb = 'Fix images where every other row is missing'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:deinterlace'); - $date = '2014'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'evenodd', type => '0 <= int32 <= 1', - desc => 'Which lines to keep { KEEP-ODD (0), KEEP-EVEN (1)' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - node = gegl_node_new_child (NULL, - "operation", "gegl:deinterlace", - "keep", evenodd ? 0 : 1, - "orientation", 0, /* HORIZONTAL */ - "size", 1, - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Deinterlace"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_diffraction { - $blurb = 'Generate diffraction patterns'; - - $help = <<'HELP'; -Help? What help? -HELP - - &std_pdb_compat('gegl:diffraction-patterns'); - $date = '2015'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'lam_r', type => '0.0 <= double <= 20.0', - desc => 'Light frequency (red)' }, - { name => 'lam_g', type => '0.0 <= double <= 20.0', - desc => 'Light frequency (green)' }, - { name => 'lam_b', type => '0.0 <= double <= 20.0', - desc => 'Light frequency (blue)' }, - { name => 'contour_r', type => '0.0 <= double <= 10.0', - desc => 'Number of contours (red)' }, - { name => 'contour_g', type => '0.0 <= double <= 10.0', - desc => 'Number of contours (green)' }, - { name => 'contour_b', type => '0.0 <= double <= 10.0', - desc => 'Number of contours (blue)' }, - { name => 'edges_r', type => '0.0 <= double <= 1.0', - desc => 'Number of sharp edges (red)' }, - { name => 'edges_g', type => '0.0 <= double <= 1.0', - desc => 'Number of sharp edges (green)' }, - { name => 'edges_b', type => '0.0 <= double <= 1.0', - desc => 'Number of sharp edges (blue)' }, - { name => 'brightness', type => '0.0 <= double <= 1.0', - desc => 'Brightness and shifting/fattening of contours' }, - { name => 'scattering', type => '0.0 <= double <= 100.0', - desc => 'Scattering (Speed vs. quality)' }, - { name => 'polarization', type => '-1.0 <= double <= 1.0', - desc => 'Polarization' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - gint x, y, width, height; - - gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height); - - node = gegl_node_new_child (NULL, - "operation", "gegl:diffraction-patterns", - "red-frequency", lam_r, - "green-frequency", lam_g, - "blue-frequency", lam_b, - "red-contours", contour_r, - "green-contours", contour_g, - "blue-contours", contour_b, - "red-sedges", edges_r, - "green-sedges", edges_g, - "blue-sedges", edges_b, - "brightness", brightness, - "scattering", scattering, - "polarization", polarization, - "width", width, - "height", height, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Diffraction Patterns"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - sub plug_in_displace { $blurb = 'Displace pixels as indicated by displacement maps'; @@ -1220,143 +393,6 @@ CODE ); } -sub plug_in_displace_polar { - $blurb = 'Displace pixels as indicated by displacement maps'; - - $help = <<'HELP'; -Just like plug-in-displace but working in polar coordinates. -The drawable is whirled and pinched according to the map. -HELP - - &std_pdb_compat('gegl:displace'); - $date = '2015'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'amount_x', type => '-500.0 <= double <= 500.0', - desc => 'Displace multiplier for radial direction' }, - { name => 'amount_y', type => '-500.0 <= double <= 500.0', - desc => 'Displace multiplier for tangent direction' }, - { name => 'do_x', type => 'boolean', - desc => 'Displace in radial direction ?' }, - { name => 'do_y', type => 'boolean', - desc => 'Displace in tangent direction ?' }, - { name => 'displace_map_x', type => 'drawable', - desc => 'Displacement map for radial direction' }, - { name => 'displace_map_y', type => 'drawable', - desc => 'Displacement map for tangent direction' }, - { name => 'displace_type', type => '1 <= int32 <= 3', - desc => 'Edge behavior { WRAP (1), SMEAR (2), BLACK (3) }' } - ); - - %invoke = ( - code => <<'CODE' -{ - success = displace (drawable, - amount_x, - amount_y, - do_x, - do_y, - displace_map_x, - displace_map_y, - displace_type, - 1, - progress, - error); -} -CODE - ); -} - -sub plug_in_dog { - $blurb = 'Edge detection with control of edge thickness'; - - $help = <<'HELP'; -Applies two Gaussian blurs to the drawable, and subtracts the results. -This is robust and widely used method for detecting edges. -HELP - - &std_pdb_compat('gegl:difference-of-gaussians'); - $date = '2015'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'inner', type => '0.0 <= double <= 10.0', - desc => 'Radius of inner gaussian blur in pixels' }, - { name => 'outer', type => '0.0 <= double <= 10.0', - desc => 'Radius of outer gaussian blur in pixels' }, - { name => 'normalize', type => 'boolean', - desc => 'Normalize' }, - { name => 'invert', type => 'boolean', - desc => 'Invert' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - if (normalize || invert) - gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_MISC, - C_("undo-type", "DoG Edge Detect")); - - node = gegl_node_new_child (NULL, - "operation", "gegl:difference-of-gaussians", - "radius1", inner * 0.32, - "radius2", outer * 0.32, - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "DoG Edge Detect"), - node); - g_object_unref (node); - - if (normalize) - { - node = gegl_node_new_child (NULL, - "operation", "gegl:stretch-contrast", - "keep-colors", TRUE, - "perceptual", TRUE, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Normalize"), - node); - g_object_unref (node); - } - - if (invert) - gimp_drawable_apply_operation_by_name (drawable, progress, - C_("undo-type", "Invert"), - "gegl:invert-gamma", - NULL); - - if (normalize || invert) - gimp_image_undo_group_end (image); - } - else - success = FALSE; -} -CODE - ); -} - sub plug_in_edge { $blurb = 'Several simple methods for detecting edges'; @@ -1491,261 +527,6 @@ CODE ); } -sub plug_in_engrave { - $blurb = 'Simulate an antique engraving'; - - $help = <<'HELP'; -Creates a black-and-white 'engraved' version of an image as seen in -old illustrations. -HELP - - &std_pdb_compat('gegl:engrave'); - $date = '2014'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'height', type => '2 <= int32 <= 16', - desc => 'Resolution in pixels' }, - { name => 'limit', type => 'boolean', - desc => 'Limit line width' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - node = gegl_node_new_child (NULL, - "operation", "gegl:engrave", - "row-height", height, - "limit", limit, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Engrave"), - node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_exchange { - $blurb = 'Swap one color with another'; - - $help = <<'HELP'; -Exchange one color with another, optionally setting a threshold to -convert from one shade to another. -HELP - - &std_pdb_compat('gegl:color-exchange'); - $date = '2014'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - - { name => 'from_red', type => '0.0 <= double <= 1.0', - desc => 'Red value (from)' }, - { name => 'from_green', type => '0.0 <= double <= 1.0', - desc => 'Green value (from)' }, - { name => 'from_blue', type => '0.0 <= double <= 1.0', - desc => 'Blue value (from)' }, - { name => 'to_red', type => '0.0 <= double <= 1.0', - desc => 'Red value (to)' }, - { name => 'to_green', type => '0.0 <= double <= 1.0', - desc => 'Green value (to)' }, - { name => 'to_blue', type => '0.0 <= double <= 1.0', - desc => 'Blue value (to)' }, - { name => 'red_threshold', type => '0.0 <= double <= 1.0', - desc => 'Red threshold' }, - { name => 'green_threshold', type => '0.0 <= double <= 1.0', - desc => 'Green threshold' }, - { name => 'blue_threshold', type => '0.0 <= double <= 1.0', - desc => 'Blue threshold' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglColor *gegl_from = gegl_color_new (NULL); - GeglColor *gegl_to = gegl_color_new (NULL); - GeglNode *node; - - gegl_color_set_rgba (gegl_from, from_red, from_green, - from_blue, 1.0); - gegl_color_set_rgba (gegl_to, to_red, to_green, - to_blue, 1.0); - - node = gegl_node_new_child (NULL, - "operation", "gegl:color-exchange", - "from-color", gegl_from, - "to-color", gegl_to, - "red-threshold", red_threshold, - "green-threshold", green_threshold, - "blue-threshold", blue_threshold, - NULL); - - g_object_unref (gegl_from); - g_object_unref (gegl_to); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Color Exchange"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_flarefx { - $blurb = 'Add a lens flare effect'; - - $help = <<'HELP'; -Adds a lens flare effects. Makes your image look like it was snapped -with a cheap camera with a lot of lens :) -HELP - - &std_pdb_compat('gegl:lens-flare'); - $date = '2015'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'pos_x', type => 'int32', - desc => 'X-Position' }, - { name => 'pos_y', type => 'int32', - desc => 'Y-Position' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - gint width = gimp_item_get_width (GIMP_ITEM (drawable)); - gint height = gimp_item_get_height (GIMP_ITEM (drawable)); - gdouble x = (gdouble) pos_x / (gdouble) width; - gdouble y = (gdouble) pos_y / (gdouble) height; - - node = gegl_node_new_child (NULL, - "operation", "gegl:lens-flare", - "pos-x", x, - "pos-y", y, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Lens Flare"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_fractal_trace { - $blurb = 'Transform image with the Mandelbrot Fractal'; - - $help = <<'HELP'; -Transform image with the Mandelbrot Fractal -HELP - - &std_pdb_compat('gegl:fractal-trace'); - $date = '2018'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'xmin', type => '-50.0 <= double <= 50.0', - desc => 'xmin fractal image delimiter' }, - { name => 'xmax', type => '-50.0 <= double <= 50.0', - desc => 'xmax fractal image delimiter' }, - { name => 'ymin', type => '-50.0 <= double <= 50.0', - desc => 'ymin fractal image delimiter' }, - { name => 'ymax', type => '-50.0 <= double <= 50.0', - desc => 'ymax fractal image delimiter' }, - { name => 'depth', type => '1 <= int32 <= 65536', - desc => 'Trace depth' }, - { name => 'outside_type', type => '0 <= int32 <= 3', - desc => 'Outside type { WRAP (0), TRANS (1), BLACK (2), WHITE (3) }' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - GeglAbyssPolicy abyss = GEGL_ABYSS_LOOP; - - switch (outside_type) - { - case 0: abyss = GEGL_ABYSS_LOOP; break; - case 1: abyss = GEGL_ABYSS_NONE; break; - case 2: abyss = GEGL_ABYSS_BLACK; break; - case 3: abyss = GEGL_ABYSS_WHITE; break; - } - - node = gegl_node_new_child (NULL, - "operation", "gegl:fractal-trace", - "X1", xmin, - "X2", xmax, - "Y1", ymin, - "Y2", ymax, - "depth", depth, - "abyss-policy", abyss, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Fractal Trace"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - sub plug_in_gauss { $blurb = 'Simplest, most commonly used way of blurring'; @@ -1785,335 +566,6 @@ CODE ); } -sub plug_in_glasstile { - $blurb = 'Simulate distortion caused by square glass tiles'; - - $help = <<'HELP'; -Divide the image into square glassblocks in which the image is -refracted. -HELP - - &std_pdb_compat('gegl:tile-glass'); - $date = '2014'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'tilex', type => '10 <= int32 <= 500', - desc => 'Tile width' }, - { name => 'tiley', type => '10 <= int32 <= 500', - desc => 'Tile height' }, - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - node = gegl_node_new_child (NULL, - "operation", "gegl:tile-glass", - "tile-width", tilex, - "tile-height", tiley, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Glass Tile"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_hsv_noise { - $blurb = 'Randomize hue, saturation and value independently'; - - $help = <<'HELP'; -Scattering pixel values in HSV space -HELP - - &std_pdb_compat('gegl:noise-hsv'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'holdness', type => '1 <= int32 <= 8', - desc => 'Convolution strength' }, - { name => 'hue_distance', type => '0 <= int32 <= 180', - desc => 'Scattering of hue angle' }, - { name => 'saturation_distance', type => '0 <= int32 <= 255', - desc => 'Distribution distance on saturation axis' }, - { name => 'value_distance', type => '0 <= int32 <= 255', - desc => 'Distribution distance on value axis' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - gdouble saturation = saturation_distance / 255.0; - gdouble value = value_distance / 255.0; - - - node = gegl_node_new_child (NULL, - "operation", "gegl:noise-hsv", - "holdness", (gint) holdness, - "hue-distance", (gdouble) hue_distance, - "saturation-distance", (gdouble) saturation, - "value-distance", (gdouble) value, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Noise HSV"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_illusion { - $blurb = 'Superimpose many altered copies of the image'; - - $help = <<'HELP'; -Produce illusion. -HELP - - &std_pdb_compat('gegl:illusion'); - $date = '2014'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'division', type => '0 <= int32 <= 64', - desc => 'The number of divisions' }, - { name => 'type', type => '0 <= int32 <= 1', - desc => 'Illusion type { TYPE1 (0), TYPE2 (1) }' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:illusion", - "division", (gint) division, - "illusion-type", (gint) type, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Illusion"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_laplace { - $blurb = 'High-resolution edge detection'; - - $help = <<'HELP'; -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 with 1.5 - 5.0 -depending on the noise in the image is best. -HELP - - &std_pdb_compat('gegl:edge-laplace'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:edge-laplace", - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Laplace"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_lens_distortion { - $blurb = 'Corrects lens distortion'; - - $help = <<'HELP'; -Corrects barrel or pincushion lens distortion. -HELP - - &std_pdb_compat('gegl:lens-distortion'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'offset_x', type => '-100 <= double <= 100', - desc => 'Effect centre offset in X' }, - { name => 'offset_y', type => '-100 <= double <= 100', - desc => 'Effect centre offset in Y' }, - { name => 'main_adjust', type => '-100 <= double <= 100', - desc => 'Amount of second-order distortion' }, - { name => 'edge_adjust', type => '-100 <= double <= 100', - desc => 'Amount of fourth-order distortion' }, - { name => 'rescale', type => '-100 <= double <= 100', - desc => 'Rescale overall image size' }, - { name => 'brighten', type => '-100 <= double <= 100', - desc => 'Adjust brightness in corners' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = NULL; - GeglColor *color; - - color = gegl_color_duplicate (gimp_context_get_background (context)); - - if (gimp_drawable_has_alpha (drawable)) - gimp_color_set_alpha (color, 0.0); - else - gimp_color_set_alpha (color, 1.0); - - node = gegl_node_new_child (NULL, - "operation", "gegl:lens-distortion", - "main", (gdouble) main_adjust, - "edge", (gdouble) edge_adjust, - "zoom", (gdouble) rescale, - "x-shift", (gdouble) offset_x, - "y-shift", (gdouble) offset_y, - "brighten", (gdouble) brighten, - "background", color, - NULL); - - g_object_unref (color); - - node = wrap_in_selection_bounds (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Lens Distortion"), - node); - g_object_unref (node); - - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_make_seamless { - $blurb = 'Alters edges to make the image seamlessly tileable'; - - $help = <<'HELP'; -This plug-in creates a seamless tileable from the input drawable. -HELP - - &std_pdb_compat('gegl:tile-seamless'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:tile-seamless", - NULL); - - node = wrap_in_selection_bounds (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Tile Seamless"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - sub plug_in_maze { $blurb = 'Draw a labyrinth'; @@ -2185,611 +637,6 @@ CODE ); } -sub plug_in_mblur { - $blurb = 'Simulate movement using directional blur'; - - $help = <<'HELP'; -This plug-in simulates the effect seen when -photographing a moving object at a slow shutter -speed. Done by adding multiple displaced copies. -HELP - - &std_pdb_compat('gegl:motion-blur-linear, -zoom, -circular'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'type', type => '0 <= int32 <= 2', - desc => 'Type of motion blur { LINEAR (0), RADIAL (1), ZOOM (2) }' }, - { name => 'length', type => 'double', - desc => 'Length' }, - { name => 'angle', type => '0 <= double <= 360', - desc => 'Angle' }, - { name => 'center_x', type => 'double', - desc => 'Center X' }, - { name => 'center_y', type => 'double', - desc => 'Center Y' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = NULL; - gint width = gimp_item_get_width (GIMP_ITEM (drawable)); - gint height = gimp_item_get_height (GIMP_ITEM (drawable)); - - center_x /= (gdouble) width; - center_y /= (gdouble) height; - - if (angle > 180.0) - angle -= 360.0; - - if (type == 0) - { - node = gegl_node_new_child (NULL, - "operation", "gegl:motion-blur-linear", - "length", length, - "angle", angle, - NULL); - } - else if (type == 1) - { - node = gegl_node_new_child (NULL, - "operation", "gegl:motion-blur-circular", - "center-x", center_x, - "center-y", center_y, - "angle", angle, - NULL); - } - else if (type == 2) - { - gdouble factor = CLAMP (length / 256.0, 0.0, 1.0); - - node = gegl_node_new_child (NULL, - "operation", "gegl:motion-blur-zoom", - "center-x", center_x, - "center-y", center_y, - "factor", factor, - NULL); - } - - if (node != NULL) - { - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Motion Blur"), - node); - g_object_unref (node); - } - else - success = FALSE; - - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_mblur_inward { - $blurb = 'Simulate movement using directional blur'; - - $help = <<'HELP'; -This procedure is equivalent to plug-in-mblur but -performs the zoom blur inward instead of outward. -HELP - - &std_pdb_compat('gegl:motion-blur-linear, -zoom, -circular'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'type', type => '0 <= int32 <= 2', - desc => 'Type of motion blur { LINEAR (0), RADIAL (1), ZOOM (2) }' }, - { name => 'length', type => 'double', - desc => 'Length' }, - { name => 'angle', type => '0 <= double <= 360', - desc => 'Angle' }, - { name => 'center_x', type => 'double', - desc => 'Center X' }, - { name => 'center_y', type => 'double', - desc => 'Center Y' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = NULL; - gint width = gimp_item_get_width (GIMP_ITEM (drawable)); - gint height = gimp_item_get_height (GIMP_ITEM (drawable)); - - center_x /= (gdouble) width; - center_y /= (gdouble) height; - - if (type == 0) - { - node = gegl_node_new_child (NULL, - "operation", "gegl:motion-blur-linear", - "length", length, - "angle", angle, - NULL); - } - else if (type == 1) - { - node = gegl_node_new_child (NULL, - "operation", "gegl:motion-blur-circular", - "center-x", center_x, - "center-y", center_y, - "angle", angle, - NULL); - } - else if (type == 2) - { - gdouble factor = CLAMP (-length / (256.0 - length), -10.0, 0.0); - - node = gegl_node_new_child (NULL, - "operation", "gegl:motion-blur-zoom", - "center-x", center_x, - "center-y", center_y, - "factor", factor, - NULL); - } - - if (node != NULL) - { - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Motion Blur"), - node); - g_object_unref (node); - } - else - success = FALSE; - - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_median_blur { - $blurb = 'Blur using the median color near each pixel'; - - $help = <<'HELP'; -Blur resulting from computing the median color in the -neighborhood of each pixel -HELP - - &std_pdb_compat('gegl:median-blur'); - $date = '2021'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'radius', type => '-400 <= int32 <= 400', - desc => 'Neighborhood radius, a negative value will calculate with inverted percentiles' }, - { name => 'percentile', type => '0 <= double <= 100', - desc => 'Neighborhood color percentile' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:median-blur", - "radius", radius, - "percentile", percentile, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Median Blur"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_mosaic { - $blurb = 'Convert the image into irregular tiles'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:mosaic'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'tile_size', type => '1 <= double <= 1000', - desc => 'Average diameter of each tile (in pixels)' }, - { name => 'tile_height', type => '1 <= double <= 1000', - desc => 'Apparent height of each tile (in pixels)' }, - { name => 'tile_spacing', type => '0.1 <= double <= 1000', - desc => 'Inter_tile spacing (in pixels)' }, - { name => 'tile_neatness', type => '0 <= double <= 1.0', - desc => 'Deviation from perfectly formed tiles' }, - { name => 'tile_allow_split', type => '0 <= int32 <= 1', - desc => 'Allows splitting tiles at hard edges' }, - { name => 'light_dir', type => '0 <= double <= 360', - desc => 'Direction of light_source (in degrees)' }, - { name => 'color_variation', type => '0.0 <= double <= 1.0', - desc => 'Magnitude of random color variations' }, - { name => 'antialiasing', type => '0 <= int32 <= 1', - desc => 'Enables smoother tile output at the cost of speed' }, - { name => 'color_averaging', type => '0 <= int32 <= 1', - desc => 'Tile color based on average of subsumed pixels' }, - { name => 'tile_type', type => '0 <= int32 <= 3', - desc => 'Tile geometry { SQUARES (0), HEXAGONS (1), OCTAGONS (2), TRIANGLES (3) }' }, - { name => 'tile_surface', type => '0 <= int32 <= 1', - desc => 'Surface characteristics { SMOOTH (0), ROUGH (1) }' }, - { name => 'grout_color', type => '0 <= int32 <= 1', - desc => 'Grout color (black/white or fore/background) { BW (0), FG-BG (1) }' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglColor *fg_color; - GeglColor *bg_color; - GeglNode *node; - - if (grout_color) - { - bg_color = gegl_color_duplicate (gimp_context_get_background (context)); - fg_color = gegl_color_duplicate (gimp_context_get_foreground (context)); - } - else - { - /* sic */ - fg_color = gegl_color_new ("white"); - bg_color = gegl_color_new ("black"); - } - - node = gegl_node_new_child (NULL, - "operation", "gegl:mosaic", - "tile-size", (gdouble) tile_size, - "tile-height", (gdouble) tile_height, - "tile-spacing", (gdouble) tile_spacing, - "tile-neatness", (gdouble) tile_neatness, - "tile-allow-split", (gboolean) tile_allow_split, - "light-dir", (gdouble) light_dir, - "color-variation", (gfloat) color_variation, - "antialiasing", (gboolean) antialiasing, - "color-averaging", (gboolean) color_averaging, - "tile-type", (gint) tile_type, - "tile-surface", (gboolean) tile_surface, - "light-color", fg_color, - "joints-color", bg_color, - NULL); - - g_object_unref (fg_color); - g_object_unref (bg_color); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Mosaic"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_neon { - $blurb = 'Simulate the glowing boundary of a neon light'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:edge-neon'); - $date = '2019'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'radius', type => '0.0 <= double <= 1500.0', - desc => 'Radius of neon effect (in pixels)' }, - { name => 'amount', type => '0.0 <= double <= 100.0', - desc => 'Effect enhancement variable' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - node = gegl_node_new_child (NULL, - "operation", "gegl:edge-neon", - "radius", radius, - "amount", amount, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Neon"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_newsprint { - $blurb = 'Halftone the image to give newspaper-like effect'; - - $help = $blurb; - - &std_pdb_compat('gegl:newsprint'); - $date = '2019'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'cell_width', type => '0 <= int32 <= 1500', - desc => 'Screen cell width in pixels' }, - { name => 'colorspace', type => '0 <= int32 <= 3', - desc => 'Separate to { GRAYSCALE (0), RGB (1), CMYK (2), LUMINANCE (3) }' }, - { name => 'k_pullout', type => '0 <= int32 <= 100', - desc => 'Percentage of black to pullout (CMYK only)' }, - { name => 'gry_ang', type => '0.0 <= double <= 360.0', - desc => 'Grey/black screen angle (degrees)' }, - { name => 'gry_spotfn', type => '0 <= int32 <= 4', - desc => 'Grey/black spot function { DOTS (0), LINES (1), DIAMONDS (2), EUCLIDIAN-DOT (3), PS-DIAMONDS (4) }' }, - { name => 'red_ang', type => '0.0 <= double <= 360.0', - desc => 'Red/cyan screen angle (degrees)' }, - { name => 'red_spotfn', type => '0 <= int32 <= 4', - desc => 'Red/cyan spot function { DOTS (0), LINES (1), DIAMONDS (2), EUCLIDIAN-DOT (3), PS-DIAMONDS (4) }' }, - { name => 'grn_ang', type => '0.0 <= double <= 360.0', - desc => 'Green/magenta screen angle (degrees)' }, - { name => 'grn_spotfn', type => '0 <= int32 <= 4', - desc => 'Green/magenta spot function { DOTS (0), LINES (1), DIAMONDS (2), EUCLIDIAN-DOT (3), PS-DIAMONDS (4) }' }, - { name => 'blu_ang', type => '0.0 <= double <= 360.0', - desc => 'Blue/yellow screen angle (degrees)' }, - { name => 'blu_spotfn', type => '0 <= int32 <= 4', - desc => 'Blue/yellow spot function { DOTS (0), LINES (1), DIAMONDS (2), EUCLIDIAN-DOT (3), PS-DIAMONDS (4) }' }, - { name => 'oversample', type => '1 <= int32 <= 128', - desc => 'how many times to oversample spot fn' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - gint color_model = newsprint_color_model (colorspace); - gint pattern = newsprint_pattern (gry_spotfn); - gint pattern2 = newsprint_pattern (red_spotfn); - gint pattern3 = newsprint_pattern (grn_spotfn); - gint pattern4 = newsprint_pattern (blu_spotfn); - gdouble angle = newsprint_angle (gry_ang); - gdouble angle2 = newsprint_angle (red_ang); - gdouble angle3 = newsprint_angle (grn_ang); - gdouble angle4 = newsprint_angle (blu_ang); - - node = gegl_node_new_child (NULL, - "operation", "gegl:newsprint", - "color-model", color_model, - "black-pullout", (gdouble) k_pullout / 100.0, - "period", (gdouble) cell_width, - "angle", angle, - "pattern", pattern, - "period2", (gdouble) cell_width, - "angle2", angle2, - "pattern2", pattern2, - "period3", (gdouble) cell_width, - "angle3", angle3, - "pattern3", pattern3, - "period4", (gdouble) cell_width, - "angle4", angle4, - "pattern4", pattern4, - "aa-samples", oversample, - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Newsprint"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_normalize { - $blurb = 'Stretch brightness values to cover the full range'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:stretch-contrast'); - $date = '2019'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - node = gegl_node_new_child (NULL, - "operation", "gegl:stretch-contrast", - "keep-colors", TRUE, - "perceptual", TRUE, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Normalize"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_nova { - $blurb = 'Add a starburst to the image'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:supernova'); - $date = '2014'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'xcenter', type => 'int32', - desc => 'X coordinates of the center of supernova' }, - { name => 'ycenter', type => 'int32', - desc => 'Y coordinates of the center of supernova' }, - { name => 'color', type => 'geglcolor', - desc => 'Color of supernova' }, - { name => 'radius', type => '1 <= int32 <= 3000', - desc => 'Radius of supernova' }, - { name => 'nspoke', type => '1 <= int32 <= 1024', - desc => 'Number of spokes' }, - { name => 'randomhue', type => '0 <= int32 <= 360', - desc => 'Random hue' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglColor *gegl_color; - GeglNode *node; - gdouble center_x = (gdouble) xcenter / (gdouble) gimp_item_get_width (GIMP_ITEM (drawable)); - gdouble center_y = (gdouble) ycenter / (gdouble) gimp_item_get_height (GIMP_ITEM (drawable)); - - gegl_color = gegl_color_duplicate (color); - - node = gegl_node_new_child (NULL, - "operation", "gegl:supernova", - "center-x", center_x, - "center-y", center_y, - "radius", radius, - "spokes-count", nspoke, - "random-hue", randomhue, - "color", gegl_color, - "seed", g_random_int (), - NULL); - - g_object_unref (gegl_color); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Supernova"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - sub plug_in_oilify { $blurb = 'Smear colors to simulate an oil painting'; @@ -2841,305 +688,8 @@ CODE ); } -sub plug_in_oilify_enhanced { - $blurb = 'Smear colors to simulate an oil painting'; - - $help = <<'HELP'; -This function performs the well-known oil-paint effect on the -specified drawable. -HELP - - &std_pdb_compat('gegl:oilify'); - $date = '2019'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'mode', type => '0 <= int32 <= 1', - desc => 'Algorithm { RGB (0), INTENSITY (1) }' }, - { name => 'mask_size', type => '1 <= int32 <= 200', - desc => 'Oil paint mask size' }, - { name => 'mask_size_map', type => 'drawable', none_ok => 1, - desc => 'Mask size control map' }, - { name => 'exponent', type => '1 <= int32 <= 20', - desc => 'Oil paint exponent' }, - { name => 'exponent_map', type => 'drawable', none_ok => 1, - desc => 'Exponent control map' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *graph; - GeglNode *node; - - node = gegl_node_new_child (NULL, - "operation", "gegl:oilify", - "mask-radius", MAX (1, mask_size / 2), - "use-inten", mode ? TRUE : FALSE, - "exponent", exponent, - NULL); - - graph = wrap_in_graph (node); - - if (mask_size_map) - { - GeglNode *src_node; - src_node = create_buffer_source_node (graph, mask_size_map); - gegl_node_connect (src_node, "output", node, "aux"); - } - - if (exponent_map) - { - GeglNode *src_node; - src_node = create_buffer_source_node (graph, exponent_map); - gegl_node_connect (src_node, "output", node, "aux2"); - } - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Oilify"), - graph); - g_object_unref (graph); - } - else - success = FALSE; -} -CODE - ); -} - # We simplify the GEGL signature, reducing tile width and height to just size -sub plug_in_papertile { - $blurb = 'Cut image into paper tiles, and slide them'; - - $help = <<'HELP'; -This plug-in cuts an image into paper tiles and slides each paper tile. -HELP - - &std_pdb_compat('gegl:tile-paper'); - $date = '2015'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'tile_size', type => '1 <= int32', - desc => 'Tile size (pixels)' }, - { name => 'move_max', type => '1.0 <= double <= 100.0', - desc => 'Max move rate (%)' }, - { name => 'fractional_type', type => '0 <= int32 <= 2', - desc => 'Fractional type { BACKGROUND (0), IGNORE (1), FORCE (2) }' }, - { name => 'wrap_around', type => 'boolean', - desc => 'Wrap around' }, - { name => 'centering', type => 'boolean', - desc => 'Centering' }, - { name => 'background_type', type => '0 <= int32 <= 5', - desc => 'Background type { TRANSPARENT (0), INVERTED (1), IMAGE (2), FG (3), BG (4), COLOR (5) }' }, - { name => 'background_color', type => 'geglcolor', - desc => 'Background color (for background-type == 5)' }, - { name => 'background_alpha', type => 'int32', dead => 1, - desc => 'Background alpha (unused)' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - GeglColor *color; - gint bg_type; - - switch (background_type) - { - default: - bg_type = background_type; - color = gegl_color_new (NULL); - /* XXX: I guess what we want is to set this color (why blue?) in the - * drawable's space, though I haven't looked too much into it. - */ - gegl_color_set_rgba_with_space (color, 0.0, 0.0, 1.0, 1.0, gimp_drawable_get_space (drawable)); - break; - - case 3: - bg_type = 3; - color = gegl_color_duplicate (gimp_context_get_foreground (context)); - break; - - case 4: - bg_type = 3; - color = gegl_color_duplicate (gimp_context_get_background (context)); - break; - - case 5: - bg_type = 3; - color = gegl_color_duplicate (background_color); - break; - } - - node = gegl_node_new_child (NULL, - "operation", "gegl:tile-paper", - "tile-width", tile_size, - "tile-height", tile_size, - "move-rate", move_max, - "bg-color", color, - "centering", centering, - "wrap-around", wrap_around, - "background-type", bg_type, - "fractional-type", fractional_type, - NULL); - - g_object_unref (color); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Paper Tile"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_photocopy { - $blurb = 'Simulate color distortion produced by a copy machine'; - - $help = <<'HELP'; -Propagates dark values in an image based on each pixel's relative -darkness to a neighboring average. The idea behind this filter is to -give the look of a photocopied version of the image, with toner -transferred based on the relative darkness of a particular -region. This is achieved by darkening areas of the image which are -measured to be darker than a neighborhood average and setting other -pixels to white. In this way, sufficiently large shifts in intensity -are darkened to black. The rate at which they are darkened to black is -determined by the second pct_black parameter. The mask_radius -parameter controls the size of the pixel neighborhood over which the -average intensity is computed and then compared to each pixel in the -neighborhood to decide whether or not to darken it to black. Large -values for mask_radius result in very thick black areas bordering the -regions of white and much less detail for black areas everywhere -including inside regions of color. Small values result in less toner -overall and more detail everywhere. Small values for the pct_black -make the blend from the white regions to the black border lines -smoother and the toner regions themselves thinner and less noticeable; -larger values achieve the opposite effect. -HELP - - &std_pdb_compat('gegl:photocopy'); - $date = '2019'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'mask_radius', type => '3.0 <= double <= 50.0', - desc => 'Photocopy mask radius (radius of pixel neighborhood)' }, - { name => 'sharpness', type => '0.0 <= double <= 1.0', - desc => 'Sharpness (detail level)' }, - { name => 'pct_black', type => '0.0 <= double <= 1.0', - desc => 'Percentage of darkened pixels to set to black' }, - { name => 'pct_white', type => '0.0 <= double <= 1.0', - desc => 'Percentage of non-darkened pixels left white' }, - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:photocopy", - "mask-radius", mask_radius, - "sharpness", sharpness, - "black", pct_black, - "white", pct_white, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Photocopy"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_pixelize { - $blurb = 'Simplify image into an array of solid-colored rectangles'; - - $help = <<'HELP'; -Pixelize the contents of the specified drawable with specified -pixelizing width and height. -HELP - - &std_pdb_misc; - $date = '1997'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'pixel_width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE', - desc => 'Pixel width (the decrease in horizontal resolution)' }, - { name => 'pixel_height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE', - desc => 'Pixel height (the decrease in vertical resolution)' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:pixelize", - "size-x", pixel_width, - "size-y", pixel_height, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Pixelize"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - sub plug_in_plasma { $blurb = 'Create a random plasma texture'; @@ -3201,463 +751,6 @@ CODE ); } -sub plug_in_polar_coords { - $blurb = 'Convert image to or from polar coordinates'; - - $help = <<'HELP'; -Remaps and image from rectangular coordinates to polar coordinates or -vice versa. -HELP - - &std_pdb_misc; - $date = '1997'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'circle', type => '0.0 <= double <= 100.0', - desc => 'Circle depth in %' }, - { name => 'angle', type => '0.0 <= double < 360.0', - desc => 'Offset angle' }, - { name => 'backwards', type => 'boolean', - desc => 'Map backwards' }, - { name => 'inverse', type => 'boolean', - desc => 'Map from top' }, - { name => 'polrec', type => 'boolean', - desc => 'Polar to rectangular' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:polar-coordinates", - "depth", circle, - "angle", angle, - "bw", backwards, /* XXX name */ - "top", inverse, - "polar", polrec, - NULL); - - node = wrap_in_selection_bounds (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Polar Coordinates"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_randomize_hurl { - $blurb = 'Completely randomize a fraction of pixels'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:noise-hurl'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'rndm_pct', type => '0.0 <= double <= 100.0', - desc => 'Randomization percentage' }, - { name => 'rndm_rcount', type => '1.0 <= double <= 100.0', - desc => 'Repeat count' }, - { name => 'randomize', type => 'boolean', - desc => 'Use random seed' }, - { name => 'seed', type => 'int32', - desc => 'Seed value (used only if randomize is FALSE)' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - if (randomize) - seed = (gint32) g_random_int (); - - node = - gegl_node_new_child (NULL, - "operation", "gegl:noise-hurl", - "seed", seed, - "pct-random", rndm_pct, - "repeat", (gint) rndm_rcount, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Random Hurl"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_randomize_pick { - $blurb = 'Randomly interchange some pixels with neighbors'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:noise-pick'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'rndm_pct', type => '1.0 <= double <= 100.0', - desc => 'Randomization percentage' }, - { name => 'rndm_rcount', type => '1.0 <= double <= 100.0', - desc => 'Repeat count' }, - { name => 'randomize', type => 'boolean', - desc => 'Use random seed' }, - { name => 'seed', type => 'int32', - desc => 'Seed value (used only if randomize is FALSE)' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - if (randomize) - seed = (gint32) g_random_int (); - - node = - gegl_node_new_child (NULL, - "operation", "gegl:noise-pick", - "seed", seed, - "pct-random", rndm_pct, - "repeat", (gint) rndm_rcount, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Random Pick"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_randomize_slur { - $blurb = 'Randomly slide some pixels downward (similar to melting'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:noise-slur'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'rndm_pct', type => '1.0 <= double <= 100.0', - desc => 'Randomization percentage' }, - { name => 'rndm_rcount', type => '1.0 <= double <= 100.0', - desc => 'Repeat count' }, - { name => 'randomize', type => 'boolean', - desc => 'Use random seed' }, - { name => 'seed', type => 'int32', - desc => 'Seed value (used only if randomize is FALSE)' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - if (randomize) - seed = (gint32) g_random_int (); - - node = - gegl_node_new_child (NULL, - "operation", "gegl:noise-slur", - "seed", seed, - "pct-random", rndm_pct, - "repeat", (gint) rndm_rcount, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Random Slur"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_red_eye_removal { - $blurb = 'Remove the red eye effect caused by camera flashes'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:red-eye-removal'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'threshold', type => '0 <= int32 <= 100', - desc => 'Red eye threshold in percent' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:red-eye-removal", - "threshold", (gdouble) (threshold - 50) / 50.0 * 0.2 + 0.4, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Red Eye Removal"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_rgb_noise { - $blurb = 'Distort colors by random amounts'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:noise-rgb'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'independent', type => 'boolean', - desc => 'Noise in channels independent' }, - { name => 'correlated', type => 'boolean', - desc => 'Noise correlated (i.e. multiplicative not additive)' }, - { name => 'noise_1', type => '0.0 <= double <= 1.0', - desc => 'Noise in the first channel (red, gray)' }, - { name => 'noise_2', type => '0.0 <= double <= 1.0', - desc => 'Noise in the second channel (green, gray_alpha)' }, - { name => 'noise_3', type => '0.0 <= double <= 1.0', - desc => 'Noise in the third channel (blue)' }, - { name => 'noise_4', type => '0.0 <= double <= 1.0', - desc => 'Noise in the fourth channel (alpha)' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - gdouble r, g, b, a; - - if (gimp_drawable_is_gray (drawable)) - { - r = noise_1; - g = noise_1; - b = noise_1; - a = noise_2; - } - else - { - r = noise_1; - g = noise_2; - b = noise_3; - a = noise_4; - } - - node = gegl_node_new_child (NULL, - "operation", "gegl:noise-rgb", - "correlated", correlated, - "independent", independent, - "red", r, - "green", g, - "blue", b, - "alpha", a, - "seed", g_random_int (), - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "RGB Noise"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_ripple { - $blurb = 'Displace pixels in a ripple pattern'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:ripple'); - $date = '2018'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'period', type => ' 0.0 < double < 1000.0', - default => 200.0, desc => 'Period: number of pixels for one wave to complete' }, - { name => 'amplitude', type => ' 0.0 < double < 1000.0', - default => 25.0, desc => 'Amplitude: maximum displacement of wave' }, - { name => 'orientation', type => '0 <= int32 <= 1', - desc => 'Orientation { ORIENTATION-HORIZONTAL (0), ORIENTATION-VERTICAL (1) }' }, - { name => 'edges', type => '0 <= int32 <= 2', - desc => 'Edges { SMEAR (0), WRAP (1), BLANK (2) }' }, - { name => 'waveform', type => '0 <= int32 <= 1', - desc => 'Waveform { SAWTOOTH (0), SINE (1) }' }, - { name => 'antialias', type => 'boolean', - desc => 'Antialias { TRUE, FALSE }' }, - { name => 'tile', type => 'boolean', - desc => 'Tileable { TRUE, FALSE }' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - gdouble angle, phi; - - angle = orientation ? 0.0 : 90.0; - phi = waveform ? 0.0 : 0.75; - if (orientation == 0 && waveform == 1) - phi = 0.5; - - node = gegl_node_new_child (NULL, - "operation", "gegl:ripple", - "amplitude", amplitude, - "period", period, - "phi", phi, - "angle", angle, - "sampler_type", antialias ? GEGL_SAMPLER_CUBIC : GEGL_SAMPLER_NEAREST, - "wave_type", waveform ? 0 : 1, - "abyss_policy", edges == 0 ? GEGL_ABYSS_CLAMP : - edges == 1 ? GEGL_ABYSS_LOOP : - GEGL_ABYSS_NONE, - "tileable", tile ? TRUE : FALSE, - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Ripple"), - node); - g_object_unref (node); - } - else - { - success = FALSE; - } -} -CODE - ); -} - sub plug_in_rotate { $blurb = 'Rotates a layer or the whole image by 90, 180 or 270 degrees'; @@ -3794,392 +887,6 @@ CODE ); } -sub plug_in_sel_gauss { - $blurb = 'Blur neighboring pixels, but only in low-contrast areas'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:gaussian-blur-selective'); - $date = '2099'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'radius', type => '1.0 <= double <= 1000.0', - desc => 'Radius of gaussian blur (in pixels)' }, - { name => 'max_delta', type => '0 <= int32 <= 255', - desc => 'Maximum delta' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - - node = gegl_node_new_child (NULL, - "operation", "gegl:gaussian-blur-selective", - "blur-radius", radius, - "max-delta", (gdouble) max_delta / 255.0, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Selective Gaussian Blur"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_semiflatten { - $blurb = 'Replace partial transparency with the current background color'; - - $help = <<'HELP'; -This plug-in flattens pixels in an RGBA image that aren't completely -transparent against the current GIMP background color. -HELP - - &std_pdb_misc; - $date = '1997'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) && - gimp_drawable_has_alpha (drawable)) - { - GeglNode *node; - GeglColor *color; - - color = gimp_context_get_background (context); - - node = - gegl_node_new_child (NULL, - "operation", "gimp:semi-flatten", - "color", color, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Semi-Flatten"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_shift { - $blurb = 'Shift each row or column of pixels by a random amount'; - - $help = <<'HELP'; -Shifts the pixels of the specified drawable. Each row or column will -be displaced a random value of pixels. -HELP - - &std_pdb_compat('gegl:shift'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'shift_amount', type => '0 <= int32 <= 200', - desc => 'Shift amount' }, - { name => 'orientation', type => '0 <= int32 <= 1', - desc => 'Orientation { ORIENTATION-VERTICAL (0), ORIENTATION-HORIZONTAL (1) }' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:shift", - "shift", shift_amount / 2, - "direction", orientation ? 0 : 1, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Shift"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_sinus { - $blurb = 'Generate complex sinusoidal textures'; - $help = 'FIXME: sinus help', - - &std_pdb_compat('gegl:sinus'); - $date = '2014'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'xscale', type => '0.0001 <= double <= 100.0', - desc => 'Scale value for x axis' }, - { name => 'yscale', type => '0.0001 <= double <= 100.0', - desc => 'Scale value for y axis' }, - { name => 'complex', type => '0 <= double', - desc => 'Complexity factor' }, - { name => 'seed', type => '0 <= int32', - desc => 'Seed value for random number generator' }, - { name => 'tiling', type => 'boolean', - desc => 'If set, the pattern generated will tile' }, - { name => 'perturb', type => 'boolean', - desc => 'If set, the pattern is a little more distorted...' }, - { name => 'colors', type => '0 <= int32 <=2', - desc => 'where to take the colors (0=B&W, 1=fg/bg, 2=col1/col2)' }, - { name => 'col1', type => 'geglcolor', - desc => 'fist color (sometimes unused)' }, - { name => 'col2', type => 'geglcolor', - desc => 'second color (sometimes unused)' }, - { name => 'alpha1', type => '0 <= double <= 1', - desc => 'alpha for the first color (used if the drawable has an alpha channel)' }, - { name => 'alpha2', type => '0 <= double <= 1', - desc => 'alpha for the second color (used if the drawable has an alpha channel)' }, - { name => 'blend', type => '0 <= int32 <= 2', - desc => '0=linear, 1=bilinear, 2=sinusoidal' }, - { name => 'blend_power', type => 'double', - desc => 'Power used to stretch the blend' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - GeglColor *gegl_color1 = NULL; - GeglColor *gegl_color2 = NULL; - gint x, y, width, height; - - switch (colors) - { - case 0: - gegl_color1 = gegl_color_new ("black"); - gegl_color2 = gegl_color_new ("white"); - break; - - case 1: - gegl_color1 = gegl_color_duplicate (gimp_context_get_foreground (context)); - gegl_color2 = gegl_color_duplicate (gimp_context_get_background (context)); - break; - } - - if (gegl_color1 == NULL) - { - gegl_color1 = gegl_color_duplicate (col1); - gegl_color2 = gegl_color_duplicate (col2); - } - gimp_color_set_alpha (gegl_color1, alpha1); - gimp_color_set_alpha (gegl_color2, alpha2); - - gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height); - - node = gegl_node_new_child (NULL, - "operation", "gegl:sinus", - "x_scale", xscale, - "y-scale", yscale, - "complexity", complex, - "seed", seed, - "tiling", tiling, - "perturbation", perturb, - "color1", gegl_color1, - "color2", gegl_color2, - "blend-mode", blend, - "blend-power", blend_power, - "width", width, - "height", height, - NULL); - - g_object_unref (gegl_color1); - g_object_unref (gegl_color2); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Sinus"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_sobel { - $blurb = 'Specialized direction-dependent edge detection'; - - $help = <<'HELP'; -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." -HELP - - &std_pdb_compat('gegl:edge-sobel'); - $date = '2014'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'horizontal', type => 'boolean', - desc => 'Sobel in horizontal direction' }, - { name => 'vertical', type => 'boolean', - desc => 'Sobel in vertical direction' }, - { name => 'keep_sign', type => 'boolean', - desc => 'Keep sign of result (one direction only)' }, - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:edge-sobel", - "horizontal", horizontal, - "vertical", vertical, - "keep-sign", keep_sign, - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Sobel"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_softglow { - $blurb = 'Simulate glow by making highlights intense and fuzzy'; - - $help = <<'HELP'; -Gives an image a softglow effect by intensifying the highlights in the -image. This is done by screening a modified version of the drawable -with itself. The modified version is desaturated and then a sigmoidal -transfer function is applied to force the distribution of intensities -into very small and very large only. This desaturated version is then -blurred to give it a fuzzy 'vaseline-on-the-lens' effect. The glow -radius parameter controls the sharpness of the glow effect. The -brightness parameter controls the degree of intensification applied to -image highlights. The sharpness parameter controls how defined or -alternatively, diffuse, the glow effect should be. -HELP - - &std_pdb_compat('gegl:softglow'); - $date = '2019'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'glow_radius', type => '1.0 <= double <= 50.0', - desc => 'Glow radius in pixels' }, - { name => 'brightness', type => '0.0 <= double <= 1.0', - desc => 'Glow brightness' }, - { name => 'sharpness', type => '0.0 <= double <= 1.0', - desc => 'Glow sharpness' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:softglow", - "glow-radius", glow_radius, - "brightness", brightness, - "sharpness", sharpness, - NULL); - - node = wrap_in_gamma_cast (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Softglow"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - sub plug_in_solid_noise { $blurb = 'Create a random cloud-like texture'; @@ -4346,398 +1053,6 @@ CODE ); } -sub plug_in_unsharp_mask { - $blurb = "The most widely useful method for sharpening an image"; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:unsharp-mask'); - $date = '2018'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'radius', type => '0.0 <= double <= 300.0', - desc => 'Radius of gaussian blur' }, - { name => 'amount', type => '0.0 <= double <= 300.0', - desc => 'Strength of effect' }, - { name => 'threshold', type => '0 <= int32 <= 255', - desc => 'Threshold' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:unsharp-mask", - "std-dev", radius, - "scale", amount, - "threshold", threshold / 255.0, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Sharpen (Unsharp Mask)"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_video { - $blurb = 'Simulate distortion produced by a fuzzy or low-res monitor'; - - $help = <<'HELP'; -This function simulates the degradation of being on an old -low-dotpitch RGB video monitor to the specified drawable. -HELP - - &std_pdb_compat('gegl:video-degradation'); - $date = '2014'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'pattern_number', type => '0 <= int32 <= 8', - desc => 'Type of RGB pattern to use' }, - { name => 'additive', type => 'boolean', - desc => 'Whether the function adds the result to the original image' }, - { name => 'rotated', type => 'boolean', - desc => 'Whether to rotate the RGB pattern by ninety degrees' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:video-degradation", - "pattern", pattern_number, - "additive", additive, - "rotated", rotated, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Video"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_vinvert { - $blurb = 'Invert the brightness of each pixel'; - - $help = <<'HELP'; -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). -HELP - - &std_pdb_misc; - $date = '1997'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:value-invert", - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Value Invert"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_vpropagate { - $blurb = 'Propagate certain colors to neighboring pixels', - - $help = <<'HELP'; -Propagate values of the layer. -HELP - - &std_pdb_compat('gegl:value-propagate'); - $date = '2015'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'propagate_mode', type => '0 <= int32 <= 7', - desc => 'Propagate mode { 0:white, 1:black, 2:middle value 3:foreground to peak, 4:foreground, 5:background, 6:opaque, 7:transparent }' }, - { name => 'propagating_channel', type => 'int32', - desc => 'Channels which values are propagated' }, - { name => 'propagating_rate', type => '0.0 <= double <= 1.0', - desc => 'Propagating rate' }, - { name => 'direction_mask', type => '0 <= int32 <= 15', - desc => 'Direction mask' }, - { name => 'lower_limit', type => '0 <= int32 <= 255', - desc => 'Lower limit' }, - { name => 'upper_limit', type => '0 <= int32 <= 255', - desc => 'Upper limit' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node; - GeglColor *color = NULL; - gint gegl_mode = 0; - gboolean to_left = (direction_mask & (0x1 << 0)) != 0; - gboolean to_top = (direction_mask & (0x1 << 1)) != 0; - gboolean to_right = (direction_mask & (0x1 << 2)) != 0; - gboolean to_bottom = (direction_mask & (0x1 << 3)) != 0; - gboolean value = (propagating_channel & (0x1 << 0)) != 0; - gboolean alpha = (propagating_channel & (0x1 << 1)) != 0; - - switch (propagate_mode) - { - case 0: - case 1: - case 2: - gegl_mode = propagate_mode; - break; - - case 3: - case 4: - case 5: - if (propagate_mode == 3 || propagate_mode == 4) - { - gegl_mode = propagate_mode; - - color = gimp_context_get_foreground (context); - } - else - { - gegl_mode = 4; - - color = gimp_context_get_background (context); - } - break; - - case 6: - case 7: - gegl_mode = propagate_mode - 1; - break; - } - - node = - gegl_node_new_child (NULL, - "operation", "gegl:value-propagate", - "mode", gegl_mode, - "lower-threshold", (gdouble) lower_limit / 255.0, - "upper-threshold", (gdouble) upper_limit / 255.0, - "rate", propagating_rate, - "color", color, - "top", to_top, - "left", to_left, - "right", to_right, - "bottom", to_bottom, - "value", value, - "alpha", alpha, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Value Propagate"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_dilate { - $blurb = 'Grow lighter areas of the image', - - $help = <<'HELP'; -Dilate image. -HELP - - &std_pdb_compat('gegl:value-propagate'); - $date = '2015'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'propagate_mode', type => '0 <= int32 <= 7', dead => 1, - desc => 'Propagate mode { 0:white, 1:black, 2:middle value 3:foreground to peak, 4:foreground, 5:background, 6:opaque, 7:transparent }' }, - { name => 'propagating_channel', type => 'int32', dead => 1, - desc => 'Channels which values are propagated' }, - { name => 'propagating_rate', type => '0.0 <= double <= 1.0', dead => 1, - desc => 'Propagating rate' }, - { name => 'direction_mask', type => '0 <= int32 <= 15', dead => 1, - desc => 'Direction mask' }, - { name => 'lower_limit', type => '0 <= int32 <= 255', dead => 1, - desc => 'Lower limit' }, - { name => 'upper_limit', type => '0 <= int32 <= 255', dead => 1, - desc => 'Upper limit' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:value-propagate", - "mode", 0, /* GEGL_VALUE_PROPAGATE_MODE_WHITE */ - "lower-threshold", 0.0, - "upper-threshold", 1.0, - "rate", 1.0, - "top", TRUE, - "left", TRUE, - "right", TRUE, - "bottom", TRUE, - "value", TRUE, - "alpha", FALSE, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Dilate"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_erode { - $blurb = 'Shrink lighter areas of the image', - - $help = <<'HELP'; -Erode image. -HELP - - &std_pdb_compat('gegl:value-propagate'); - $date = '2015'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'propagate_mode', type => '0 <= int32 <= 7', dead => 1, - desc => 'Propagate mode { 0:white, 1:black, 2:middle value 3:foreground to peak, 4:foreground, 5:background, 6:opaque, 7:transparent }' }, - { name => 'propagating_channel', type => 'int32', dead => 1, - desc => 'Channels which values are propagated' }, - { name => 'propagating_rate', type => '0.0 <= double <= 1.0', dead => 1, - desc => 'Propagating rate' }, - { name => 'direction_mask', type => '0 <= int32 <= 15', dead => 1, - desc => 'Direction mask' }, - { name => 'lower_limit', type => '0 <= int32 <= 255', dead => 1, - desc => 'Lower limit' }, - { name => 'upper_limit', type => '0 <= int32 <= 255', dead => 1, - desc => 'Upper limit' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:value-propagate", - "mode", 1, /* GEGL_VALUE_PROPAGATE_MODE_BLACK */ - "lower-threshold", 0.0, - "upper-threshold", 1.0, - "rate", 1.0, - "top", TRUE, - "left", TRUE, - "right", TRUE, - "bottom", TRUE, - "value", TRUE, - "alpha", FALSE, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Erode"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - sub plug_in_waves { $blurb = 'Distort the image with waves'; @@ -4809,122 +1124,6 @@ CODE ); } -sub plug_in_whirl_pinch { - $blurb = 'Distort an image by whirling and pinching'; - - $help = <<'HELP'; -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. -HELP - - &std_pdb_compat('gegl:whirl-pinch'); - $date = '2013'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'whirl', type => '-720 <= double <= 720', - desc => 'Whirl angle (degrees)' }, - { name => 'pinch', type => '-1 <= double <= 1', - desc => 'Pinch amount' }, - { name => 'radius', type => '0 <= double <= 2', - desc => 'Radius (1.0 is the largest circle that fits in the image, and 2.0 goes all the way to the corners)' } - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:whirl-pinch", - "whirl", whirl, - "pinch", pinch, - "radius", radius, - NULL); - - node = wrap_in_selection_bounds (node, drawable); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Whirl and Pinch"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - -sub plug_in_wind { - $blurb = 'Smear image to give windblown effect'; - - $help = <<'HELP'; -Renders a wind effect. -HELP - - &std_pdb_compat('gegl:wind'); - $date = '2015'; - - @inargs = ( - { name => 'run_mode', type => 'enum GimpRunMode', dead => 1, - desc => 'The run mode' }, - { name => 'image', type => 'image', dead => 1, - desc => 'Input image (unused)' }, - { name => 'drawable', type => 'drawable', - desc => 'Input drawable' }, - { name => 'threshold', type => '0 <= int32 <= 50', - desc => 'Controls where blending will be done' }, - { name => 'direction', type => '0 <= int32 <= 3', - desc => 'Wind direction { 0:left, 1:right, 2:top, 3:bottom }' }, - { name => 'strength', type => '1 <= int32 <= 100', - desc => 'Controls the extent of the blending' }, - { name => 'algorithm', type => '0 <= int32 <= 1', - desc => 'Algorithm { WIND (0), BLAST (1) }' }, - { name => 'edge', type => '0 <= int32 <= 2', - desc => 'Affected edge { BOTH (0), LEADING (1), TRAILING (2) }' }, - ); - - %invoke = ( - code => <<'CODE' -{ - if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, - GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gegl:wind", - "threshold", threshold, - "direction", direction, - "strength", strength, - "style", algorithm, - "edge", edge, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Wind"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - $extra{app}->{code} = <<'CODE'; static GeglNode * wrap_in_graph (GeglNode *node) @@ -5293,7 +1492,9 @@ newsprint_angle (gdouble angle) } CODE -@headers = qw("libgimpbase/gimpbase.h" +@headers = qw( + "libgimpbase/gimpbase.h" + "libgimpcolor/gimpcolor.h" "libgimpconfig/gimpconfig.h" "libgimpmath/gimpmath.h" "gegl/gimp-babl.h" @@ -5313,81 +1514,24 @@ CODE "gimppdb-utils.h" "gimp-intl.h"); -@procs = qw(plug_in_alienmap2 - plug_in_antialias - plug_in_apply_canvas - plug_in_applylens - plug_in_autocrop +@procs = qw(plug_in_autocrop plug_in_autocrop_layer - plug_in_autostretch_hsv plug_in_bump_map - plug_in_bump_map_tiled plug_in_c_astretch - plug_in_cartoon - plug_in_colors_channel_mixer - plug_in_colortoalpha - plug_in_convmatrix plug_in_cubism - plug_in_deinterlace - plug_in_diffraction plug_in_displace - plug_in_displace_polar - plug_in_dog plug_in_edge plug_in_emboss - plug_in_engrave - plug_in_exchange - plug_in_flarefx - plug_in_fractal_trace plug_in_gauss - plug_in_glasstile - plug_in_hsv_noise - plug_in_illusion - plug_in_laplace - plug_in_lens_distortion - plug_in_make_seamless plug_in_maze - plug_in_mblur - plug_in_mblur_inward - plug_in_median_blur - plug_in_mosaic - plug_in_neon - plug_in_newsprint - plug_in_normalize - plug_in_nova plug_in_oilify - plug_in_oilify_enhanced - plug_in_papertile - plug_in_photocopy - plug_in_pixelize plug_in_plasma - plug_in_polar_coords - plug_in_red_eye_removal - plug_in_randomize_hurl - plug_in_randomize_pick - plug_in_randomize_slur - plug_in_rgb_noise - plug_in_ripple plug_in_rotate plug_in_noisify - plug_in_sel_gauss - plug_in_semiflatten - plug_in_shift - plug_in_sinus - plug_in_sobel - plug_in_softglow plug_in_solid_noise plug_in_spread plug_in_threshold_alpha - plug_in_unsharp_mask - plug_in_video - plug_in_vinvert - plug_in_vpropagate - plug_in_dilate - plug_in_erode - plug_in_waves - plug_in_whirl_pinch - plug_in_wind); + plug_in_waves); %exports = (app => [@procs], lib => []); diff --git a/plug-ins/script-fu/scripts/unsharp-mask.scm b/plug-ins/script-fu/scripts/unsharp-mask.scm index f5c6050c48..cc646d0777 100644 --- a/plug-ins/script-fu/scripts/unsharp-mask.scm +++ b/plug-ins/script-fu/scripts/unsharp-mask.scm @@ -4,8 +4,7 @@ ;;; Version 0.8 ; This script-fu-unsharp-mask is not in the menus. -; There is an equivalent GEGL filter at Filters>Enhance>Sharpen (Unsharp) -; and a GEGL wrapper in the PDB, plug-in-unsharp-mask. +; There is an equivalent GEGL filter at Filters>Enhance>Sharpen (Unsharp). ; This might be kept for compatibility and used by third party scripts. ; Seems not used by any script in the repo. diff --git a/plug-ins/script-fu/test/tests/Plugins/gegl.scm b/plug-ins/script-fu/test/tests/Plugins/gegl.scm index 4f92f5d172..e5fe194a88 100644 --- a/plug-ins/script-fu/test/tests/Plugins/gegl.scm +++ b/plug-ins/script-fu/test/tests/Plugins/gegl.scm @@ -169,7 +169,6 @@ ; in alphabetical order. (define gegl-wrapper-names (list - "alienmap2" "antialias" "apply-canvas" "applylens" @@ -201,7 +200,6 @@ "median-blur" "mosaic" "neon" - ; nova requires color arg that does not default "newsprint" "normalize" "oilify" @@ -289,34 +287,6 @@ (define (testSpecialGeglWrappers) (test! "Special test GEGL wrappers") - ; This is a typical, more elaborate test using sensical, not default, values. - ; Note that freq 0 produces little effect - (test! "alienmap2") - (testImageCreator) - (assert - `(plug-in-alienmap2 - RUN-NONINTERACTIVE ,testImage ,testLayer - 1 0 ; red freq, angle - 1 0 ; green - 1 0 ; blue - 0 ; TODO what is the enum symbol RGB-MODEL ; color model - 1 1 1 ; RGB application modes - ; when script-fu-use-v3 #t #t #t - )) - - ; Requires non-defaultable convolution matrix - (test! "convmatrix") - (testImageCreator) - (assert `(plug-in-convmatrix - RUN-NONINTERACTIVE ,testImage ,testLayer - #(1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5) ; conv matrix - 0 0 0 - #(1 0 1 0 1) ; channel mask - 0 ; border mode - )) - (gimp-display-new testImage) - (gimp-displays-flush) - ; Requires non-defaultable maps. ; We can never add test auto-defaulting the args. ; These are NOT the declared defaults. @@ -331,57 +301,6 @@ )) (gimp-display-new testImage) (gimp-displays-flush) - - ; Requires non-defaultable maps - (test! "displace-polar") - (testImageCreator) - (assert `(plug-in-displace-polar - RUN-NONINTERACTIVE ,testImage ,testLayer - 0 0 ; multiplier radial, tangent default is -500 - 0 0 ; do displace x, y booleans - ,testLayer ,testLayer ; x, y maps - 1 ; edge behaviour - )) - (gimp-display-new testImage) - (gimp-displays-flush) - - ; Requires non-defaultable color - (test! "nova") - (testImageCreator) - (assert `(plug-in-nova - RUN-NONINTERACTIVE ,testImage ,testLayer - 0 0 "red" ; other args defaulted - )) - (gimp-display-new testImage) - (gimp-displays-flush) - - ; Requires non-defaultable color - (test! "papertile") - (testImageCreator) - (assert `(plug-in-papertile - RUN-NONINTERACTIVE ,testImage ,testLayer - 1 ; tile size (width, height as one arg) - 1.0 ; move rate - 0 ; fractional type enum - 0 0 ; wrap around, centering boolean - 5 ; background type enum - "red" ; color when background type==5 - ; other args defaulted - )) - (gimp-display-new testImage) - (gimp-displays-flush) - - ; Requires non-defaultable color - (test! "sinus") - (testImageCreator) - (assert `(plug-in-sinus - RUN-NONINTERACTIVE ,testImage ,testLayer - 0.1 0.1 ; x, y scale - 0 0 0 0 0 "red" "green" - ; other args defaulted - )) - (gimp-display-new testImage) - (gimp-displays-flush) )