Commit b7cf8506 authored by Michael Natterer's avatar Michael Natterer 😴

plug-ins: remove the oilify plug-in and add a PDB compat procedure

parent 3c73d42e
......@@ -28,7 +28,7 @@
#include "internal-procs.h"
/* 743 procedures registered total */
/* 745 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)
......
......@@ -2910,6 +2910,115 @@ plug_in_nova_invoker (GimpProcedure *procedure,
error ? *error : NULL);
}
static GimpValueArray *
plug_in_oilify2_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gint32 mask_size;
gint32 mode;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
mask_size = g_value_get_int (gimp_value_array_index (args, 3));
mode = 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:oilify",
"mask-radius", MAX (1, mask_size / 2),
"use-inten", mode ? TRUE : FALSE,
NULL);
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Oilify"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GimpValueArray *
plug_in_oilify_enhanced2_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gint32 mode;
gint32 mask_size;
GimpDrawable *mask_size_map;
gint32 exponent;
GimpDrawable *exponent_map;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
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 = gimp_value_get_drawable (gimp_value_array_index (args, 5), gimp);
exponent = g_value_get_int (gimp_value_array_index (args, 6));
exponent_map = gimp_value_get_drawable (gimp_value_array_index (args, 7), gimp);
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:oilify",
"mask-radius", MAX (1, mask_size / 2),
"use-inten", mode ? TRUE : FALSE,
"exponent", exponent,
NULL);
if (mask_size_map)
{
GeglNode *src_node;
src_node = create_buffer_source_node (node, mask_size_map);
gegl_node_connect_to (src_node, "output", node, "aux");
}
if (exponent_map)
{
GeglNode *src_node;
src_node = create_buffer_source_node (node, exponent_map);
gegl_node_connect_to (src_node, "output", node, "aux2");
}
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Oilify"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GimpValueArray *
plug_in_papertile_invoker (GimpProcedure *procedure,
Gimp *gimp,
......@@ -7469,6 +7578,120 @@ register_plug_in_compat_procs (GimpPDB *pdb)
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-plug-in-oilify2
*/
procedure = gimp_procedure_new (plug_in_oilify2_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"plug-in-oilify2");
gimp_procedure_set_static_strings (procedure,
"plug-in-oilify2",
"Smear colors to simulate an oil painting",
"This function performs the well-known oil-paint effect on the specified drawable.",
"Compatibility procedure. Please see 'gegl:oilify' for credits.",
"Compatibility procedure. Please see 'gegl:oilify' 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,
gimp_param_spec_int32 ("mask-size",
"mask size",
"Oil paint mask size",
1, 200, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("mode",
"mode",
"Algorithm { RGB (0), INTENSITY (1) }",
0, 1, 0,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-plug-in-oilify-enhanced2
*/
procedure = gimp_procedure_new (plug_in_oilify_enhanced2_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"plug-in-oilify-enhanced2");
gimp_procedure_set_static_strings (procedure,
"plug-in-oilify-enhanced2",
"Smear colors to simulate an oil painting",
"This function performs the well-known oil-paint effect on the specified drawable.",
"Compatibility procedure. Please see 'gegl:oilify' for credits.",
"Compatibility procedure. Please see 'gegl:oilify' 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,
gimp_param_spec_int32 ("mode",
"mode",
"Algorithm { RGB (0), INTENSITY (1) }",
0, 1, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("mask-size",
"mask size",
"Oil paint mask size",
1, 200, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("mask-size-map",
"mask size map",
"Mask size control map",
pdb->gimp, TRUE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("exponent",
"exponent",
"Oil paint exponent",
1, 20, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("exponent-map",
"exponent map",
"Exponent control map",
pdb->gimp, TRUE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-plug-in-papertile
*/
......
......@@ -1214,26 +1214,26 @@ HELP
$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 <= float <= 500.0',
desc => 'Displace multiplier for radial direction' },
{ name => 'amount_y', type => '-500.0 <= float <= 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) }' }
{ 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 <= float <= 500.0',
desc => 'Displace multiplier for radial direction' },
{ name => 'amount_y', type => '-500.0 <= float <= 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 = (
......@@ -2891,6 +2891,129 @@ CODE
);
}
sub plug_in_oilify2 {
$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 => 'mask_size', type => '1 <= int32 <= 200',
desc => 'Oil paint mask size' },
{ name => 'mode', type => '0 <= int32 <= 1',
desc => 'Algorithm { RGB (0), INTENSITY (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:oilify",
"mask-radius", MAX (1, mask_size / 2),
"use-inten", mode ? TRUE : FALSE,
NULL);
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Oilify"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
CODE
);
}
sub plug_in_oilify_enhanced2 {
$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 *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);
if (mask_size_map)
{
GeglNode *src_node;
src_node = create_buffer_source_node (node, mask_size_map);
gegl_node_connect_to (src_node, "output", node, "aux");
}
if (exponent_map)
{
GeglNode *src_node;
src_node = create_buffer_source_node (node, exponent_map);
gegl_node_connect_to (src_node, "output", node, "aux2");
}
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Oilify"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
CODE
);
}
sub plug_in_papertile {
$blurb = 'Cut image into paper tiles, and slide them';
......@@ -5344,6 +5467,8 @@ CODE
plug_in_newsprint
plug_in_normalize
plug_in_nova
plug_in_oilify2
plug_in_oilify_enhanced2
plug_in_papertile
plug_in_photocopy
plug_in_pixelize
......
......@@ -124,8 +124,6 @@
/mail.exe
/nl-filter
/nl-filter.exe
/oilify
/oilify.exe
/plugin-browser
/plugin-browser.exe
/procedure-browser
......
......@@ -107,7 +107,6 @@ hot_libexecdir = $(gimpplugindir)/plug-ins/hot
jigsaw_libexecdir = $(gimpplugindir)/plug-ins/jigsaw
mail_libexecdir = $(gimpplugindir)/plug-ins/mail
nl_filter_libexecdir = $(gimpplugindir)/plug-ins/nl-filter
oilify_libexecdir = $(gimpplugindir)/plug-ins/oilify
plugin_browser_libexecdir = $(gimpplugindir)/plug-ins/plugin-browser
procedure_browser_libexecdir = $(gimpplugindir)/plug-ins/procedure-browser
qbist_libexecdir = $(gimpplugindir)/plug-ins/qbist
......@@ -186,7 +185,6 @@ hot_libexec_PROGRAMS = hot
jigsaw_libexec_PROGRAMS = jigsaw
mail_libexec_PROGRAMS = $(MAIL)
nl_filter_libexec_PROGRAMS = nl-filter
oilify_libexec_PROGRAMS = oilify
plugin_browser_libexec_PROGRAMS = plugin-browser
procedure_browser_libexec_PROGRAMS = procedure-browser
qbist_libexec_PROGRAMS = qbist
......@@ -1337,23 +1335,6 @@ nl_filter_LDADD = \
$(INTLLIBS) \
$(nl_filter_RC)
oilify_SOURCES = \
oilify.c
oilify_LDADD = \
$(libgimpui) \
$(libgimpwidgets) \
$(libgimpmodule) \
$(libgimp) \
$(libgimpmath) \
$(libgimpconfig) \
$(libgimpcolor) \
$(libgimpbase) \
$(GTK_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(oilify_RC)
plugin_browser_SOURCES = \
plugin-browser.c
......
......@@ -59,7 +59,6 @@ hot_RC = hot.rc.o
jigsaw_RC = jigsaw.rc.o
mail_RC = mail.rc.o
nl_filter_RC = nl-filter.rc.o
oilify_RC = oilify.rc.o
plugin_browser_RC = plugin-browser.rc.o
procedure_browser_RC = procedure-browser.rc.o
qbist_RC = qbist.rc.o
......
This diff is collapsed.
......@@ -61,7 +61,6 @@
'jigsaw' => { ui => 1, gegl => 1 },
'mail' => { ui => 1, optional => 1 },
'nl-filter' => { ui => 1, gegl => 1 },
'oilify' => { ui => 1 },
'plugin-browser' => { ui => 1 },
'procedure-browser' => { ui => 1 },
'qbist' => { ui => 1, gegl => 1 },
......
......@@ -65,7 +65,6 @@ plug-ins/common/hot.c
plug-ins/common/jigsaw.c
plug-ins/common/mail.c
plug-ins/common/nl-filter.c
plug-ins/common/oilify.c
plug-ins/common/plugin-browser.c
plug-ins/common/procedure-browser.c
plug-ins/common/qbist.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