GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit 2ead5609 authored by Michael Natterer's avatar Michael Natterer 😴

plug-ins, pdb: remove the softglow plug-in and add a PDB compat procedure

Not for 2.10 because the GEGL op's result looks different. I have no
clue how softglow is supposed to look at all, but the removed plug-in
did things that can't possibly be done with physical light in a
darkroom, so chances are the GEGL op is more correct.
parent a0ae31d3
......@@ -28,7 +28,7 @@
#include "internal-procs.h"
/* 740 procedures registered total */
/* 741 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)
......
......@@ -3809,6 +3809,54 @@ plug_in_sobel_invoker (GimpProcedure *procedure,
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 = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
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,
......@@ -8211,6 +8259,60 @@ register_plug_in_compat_procs (GimpPDB *pdb)
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_strings (procedure,
"plug-in-softglow",
"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.",
"Compatibility procedure. Please see 'gegl:softglow' for credits.",
"Compatibility procedure. Please see 'gegl:softglow' for credits.",
"2019",
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 ("glow-radius",
"glow radius",
"Glow radius in pixels",
0, G_MAXDOUBLE, 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
*/
......
......@@ -3981,6 +3981,69 @@ 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 => '0 <= float',
desc => 'Glow radius in pixels' },
{ name => 'brightness', type => '0.0 <= float <= 1.0',
desc => 'Glow brightness' },
{ name => 'sharpness', type => '0.0 <= float <= 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';
......@@ -5107,6 +5170,7 @@ CODE
plug_in_shift
plug_in_sinus
plug_in_sobel
plug_in_softglow
plug_in_solid_noise
plug_in_spread
plug_in_threshold_alpha
......
......@@ -150,8 +150,6 @@
/sharpen.exe
/smooth-palette
/smooth-palette.exe
/softglow
/softglow.exe
/sparkle
/sparkle.exe
/sphere-designer
......
......@@ -120,7 +120,6 @@ qbist_libexecdir = $(gimpplugindir)/plug-ins/qbist
sample_colorize_libexecdir = $(gimpplugindir)/plug-ins/sample-colorize
sharpen_libexecdir = $(gimpplugindir)/plug-ins/sharpen
smooth_palette_libexecdir = $(gimpplugindir)/plug-ins/smooth-palette
softglow_libexecdir = $(gimpplugindir)/plug-ins/softglow
sparkle_libexecdir = $(gimpplugindir)/plug-ins/sparkle
sphere_designer_libexecdir = $(gimpplugindir)/plug-ins/sphere-designer
tile_libexecdir = $(gimpplugindir)/plug-ins/tile
......@@ -207,7 +206,6 @@ qbist_libexec_PROGRAMS = qbist
sample_colorize_libexec_PROGRAMS = sample-colorize
sharpen_libexec_PROGRAMS = sharpen
smooth_palette_libexec_PROGRAMS = smooth-palette
softglow_libexec_PROGRAMS = softglow
sparkle_libexec_PROGRAMS = sparkle
sphere_designer_libexec_PROGRAMS = sphere-designer
tile_libexec_PROGRAMS = tile
......@@ -1573,23 +1571,6 @@ smooth_palette_LDADD = \
$(INTLLIBS) \
$(smooth_palette_RC)
softglow_SOURCES = \
softglow.c
softglow_LDADD = \
$(libgimpui) \
$(libgimpwidgets) \
$(libgimpmodule) \
$(libgimp) \
$(libgimpmath) \
$(libgimpconfig) \
$(libgimpcolor) \
$(libgimpbase) \
$(GTK_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(softglow_RC)
sparkle_SOURCES = \
sparkle.c
......
......@@ -72,7 +72,6 @@ qbist_RC = qbist.rc.o
sample_colorize_RC = sample-colorize.rc.o
sharpen_RC = sharpen.rc.o
smooth_palette_RC = smooth-palette.rc.o
softglow_RC = softglow.rc.o
sparkle_RC = sparkle.rc.o
sphere_designer_RC = sphere-designer.rc.o
tile_RC = tile.rc.o
......
......@@ -74,7 +74,6 @@
'sample-colorize' => { ui => 1, gegl => 1 },
'sharpen' => { ui => 1 },
'smooth-palette' => { ui => 1, gegl => 1 },
'softglow' => { ui => 1 },
'sparkle' => { ui => 1, gegl => 1 },
'sphere-designer' => { ui => 1, gegl => 1 },
'tile' => { ui => 1, gegl => 1 },
......
This diff is collapsed.
......@@ -78,7 +78,6 @@ plug-ins/common/qbist.c
plug-ins/common/sample-colorize.c
plug-ins/common/sharpen.c
plug-ins/common/smooth-palette.c
plug-ins/common/softglow.c
plug-ins/common/sparkle.c
plug-ins/common/sphere-designer.c
plug-ins/common/tile.c
......
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