diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c index 250080995b..1e1408a6c5 100644 --- a/app/pdb/internal-procs.c +++ b/app/pdb/internal-procs.c @@ -30,7 +30,7 @@ #include "internal-procs.h" -/* 727 procedures registered total */ +/* 726 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 e27d67d0ff..9c45f7c76b 100644 --- a/app/pdb/plug-in-compat-cmds.c +++ b/app/pdb/plug-in-compat-cmds.c @@ -916,47 +916,6 @@ plug_in_noisify_invoker (GimpProcedure *procedure, error ? *error : NULL); } -static GimpValueArray * -plug_in_threshold_alpha_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) && - gimp_drawable_has_alpha (drawable)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gimp:threshold-alpha", - "value", threshold / 255.0, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Threshold Alpha"), - 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, @@ -1553,48 +1512,6 @@ register_plug_in_compat_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - /* - * gimp-plug-in-threshold-alpha - */ - procedure = gimp_procedure_new (plug_in_threshold_alpha_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "plug-in-threshold-alpha"); - gimp_procedure_set_static_help (procedure, - "Make transparency all-or-nothing", - "Make transparency all-or-nothing.", - 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 ("threshold", - "threshold", - "Threshold", - 0, 255, 0, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-plug-in-waves */ diff --git a/pdb/groups/plug_in_compat.pdb b/pdb/groups/plug_in_compat.pdb index 6d2cbd2cb1..56f7e0468c 100644 --- a/pdb/groups/plug_in_compat.pdb +++ b/pdb/groups/plug_in_compat.pdb @@ -575,53 +575,6 @@ CODE ); } -sub plug_in_threshold_alpha { - $blurb = 'Make transparency all-or-nothing'; - - $help = <<'HELP'; -Make transparency all-or-nothing. -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 => '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) && - gimp_drawable_has_alpha (drawable)) - { - GeglNode *node = - gegl_node_new_child (NULL, - "operation", "gimp:threshold-alpha", - "value", threshold / 255.0, - NULL); - - gimp_drawable_apply_operation (drawable, progress, - C_("undo-type", "Threshold Alpha"), - node); - g_object_unref (node); - } - else - success = FALSE; -} -CODE - ); -} - sub plug_in_waves { $blurb = 'Distort the image with waves'; @@ -1092,7 +1045,6 @@ CODE plug_in_plasma plug_in_rotate plug_in_noisify - plug_in_threshold_alpha plug_in_waves); %exports = (app => [@procs], lib => []); diff --git a/plug-ins/file-ico/ico-dialog.c b/plug-ins/file-ico/ico-dialog.c index 8ccceeccdd..42b9943608 100644 --- a/plug-ins/file-ico/ico-dialog.c +++ b/plug-ins/file-ico/ico-dialog.c @@ -462,8 +462,6 @@ ico_dialog_update_icon_preview (GtkWidget *dialog, GimpImage *image; GimpImage *tmp_image; GimpLayer *tmp_layer; - GimpProcedure *procedure; - GimpValueArray *return_vals; image = gimp_item_get_image (GIMP_ITEM (layer)); @@ -490,16 +488,11 @@ ico_dialog_update_icon_preview (GtkWidget *dialog, if (gimp_drawable_is_indexed (layer)) gimp_image_convert_rgb (tmp_image); - procedure = gimp_pdb_lookup_procedure (gimp_get_pdb (), - "plug-in-threshold-alpha"); - return_vals = gimp_procedure_run (procedure, - "run-mode", GIMP_RUN_NONINTERACTIVE, - "image", tmp_image, - "drawable", tmp_layer, - "threshold", ICO_ALPHA_THRESHOLD, - NULL); - - gimp_value_array_unref (return_vals); + gimp_drawable_merge_new_filter (GIMP_DRAWABLE (tmp_layer), + "gimp:threshold-alpha", NULL, + GIMP_LAYER_MODE_REPLACE, 1.0, + "value", ICO_ALPHA_THRESHOLD / 255.0, + NULL); pixbuf = gimp_drawable_get_thumbnail (GIMP_DRAWABLE (tmp_layer), MIN (w, 128), MIN (h, 128), diff --git a/plug-ins/file-ico/ico-export.c b/plug-ins/file-ico/ico-export.c index 50a33e1007..c533829c79 100644 --- a/plug-ins/file-ico/ico-export.c +++ b/plug-ins/file-ico/ico-export.c @@ -840,19 +840,11 @@ ico_image_get_reduced_buf (GimpDrawable *layer, } else if (bpp == 24) { - GimpProcedure *procedure; - GimpValueArray *return_vals; - - procedure = gimp_pdb_lookup_procedure (gimp_get_pdb (), - "plug-in-threshold-alpha"); - return_vals = gimp_procedure_run (procedure, - "run-mode", GIMP_RUN_NONINTERACTIVE, - "image", tmp_image, - "drawable", tmp_layer, - "threshold", ICO_ALPHA_THRESHOLD, - NULL); - - gimp_value_array_unref (return_vals); + gimp_drawable_merge_new_filter (GIMP_DRAWABLE (tmp_layer), + "gimp:threshold-alpha", NULL, + GIMP_LAYER_MODE_REPLACE, 1.0, + "value", ICO_ALPHA_THRESHOLD / 255.0, + NULL); } gimp_layer_add_alpha (tmp_layer); diff --git a/plug-ins/script-fu/scripts/distress-selection.scm b/plug-ins/script-fu/scripts/distress-selection.scm index 231dc9952f..d5f6d360bb 100644 --- a/plug-ins/script-fu/scripts/distress-selection.scm +++ b/plug-ins/script-fu/scripts/distress-selection.scm @@ -89,7 +89,7 @@ (plug-in-gauss RUN-NONINTERACTIVE theImage theLayer horizontalRadius verticalRadius 0) (gimp-layer-scale theLayer theWidth theHeight TRUE) - (plug-in-threshold-alpha RUN-NONINTERACTIVE theImage theLayer (* inThreshold 255)) + (gimp-drawable-merge-new-filter theLayer "gimp:threshold-alpha" 0 LAYER-MODE-REPLACE 1.0 "value" inThreshold) (plug-in-gauss RUN-NONINTERACTIVE theImage theLayer 0.32 0.32 0) (gimp-image-select-item inImage CHANNEL-OP-REPLACE theLayer) (gimp-image-remove-layer theImage theLayer)