Commit 16a04218 authored by Michael Natterer's avatar Michael Natterer

plug-ins, pdb: remove the blur-gauss-selective plug-in, add a PDB compat proc

parent baae27c7
......@@ -28,7 +28,7 @@
#include "internal-procs.h"
/* 789 procedures registered total */
/* 790 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)
......
......@@ -3471,6 +3471,50 @@ 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;
gint32 max_delta;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
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,
......@@ -7608,6 +7652,54 @@ 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_strings (procedure,
"plug-in-sel-gauss",
"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.",
"Compatibility procedure. Please see 'gegl:gaussian-blur-selective' for credits.",
"Compatibility procedure. Please see 'gegl:gaussian-blur-selective' for credits.",
"2099",
NULL);
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_id ("image",
"image",
"Input image (unused)",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"Input drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("radius",
"radius",
"Radius of gaussian blur (in pixels)",
0.0, G_MAXDOUBLE, 0.0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("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
*/
......
......@@ -12,8 +12,6 @@
/blinds.exe
/blur
/blur.exe
/blur-gauss-selective
/blur-gauss-selective.exe
/border-average
/border-average.exe
/cartoon
......
......@@ -49,7 +49,6 @@ libexec_PROGRAMS = \
animation-play \
blinds \
blur \
blur-gauss-selective \
border-average \
cartoon \
checkerboard \
......@@ -251,25 +250,6 @@ blur_LDADD = \
$(INTLLIBS) \
$(blur_RC)
blur_gauss_selective_CFLAGS = $(MMX_EXTRA_CFLAGS)
blur_gauss_selective_SOURCES = \
blur-gauss-selective.c
blur_gauss_selective_LDADD = \
$(libgimpui) \
$(libgimpwidgets) \
$(libgimpmodule) \
$(libgimp) \
$(libgimpmath) \
$(libgimpconfig) \
$(libgimpcolor) \
$(libgimpbase) \
$(GTK_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(blur_gauss_selective_RC)
border_average_SOURCES = \
border-average.c
......
This diff is collapsed.
......@@ -3,7 +3,6 @@ animation_optimize_RC = animation-optimize.rc.o
animation_play_RC = animation-play.rc.o
blinds_RC = blinds.rc.o
blur_RC = blur.rc.o
blur_gauss_selective_RC = blur-gauss-selective.rc.o
border_average_RC = border-average.rc.o
cartoon_RC = cartoon.rc.o
checkerboard_RC = checkerboard.rc.o
......
......@@ -4,7 +4,6 @@
'animation-play' => { ui => 1, gegl => 1 },
'blinds' => { ui => 1 },
'blur' => {},
'blur-gauss-selective' => { ui => 1, cflags => 'MMX_EXTRA_CFLAGS' },
'border-average' => { ui => 1, gegl => 1 },
'cartoon' => { ui => 1 },
'checkerboard' => { ui => 1 },
......
......@@ -8,7 +8,6 @@ plug-ins/common/animation-optimize.c
plug-ins/common/animation-play.c
plug-ins/common/blinds.c
plug-ins/common/blur.c
plug-ins/common/blur-gauss-selective.c
plug-ins/common/border-average.c
plug-ins/common/cartoon.c
plug-ins/common/checkerboard.c
......
......@@ -3543,6 +3543,60 @@ 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 => '0.0 < float',
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';
......@@ -4875,6 +4929,7 @@ CODE
plug_in_rgb_noise
plug_in_rotate
plug_in_noisify
plug_in_sel_gauss
plug_in_semiflatten
plug_in_shift
plug_in_sinus
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment