[gimp/gimp-2-10] plug-ins: remove the oilify plug-in and add a PDB compat procedure
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] plug-ins: remove the oilify plug-in and add a PDB compat procedure
- Date: Fri, 19 Jul 2019 16:25:29 +0000 (UTC)
commit ae493acbe95a4c31a6cff9b5e80a44c2f41fe992
Author: Michael Natterer <mitch gimp org>
Date: Fri Jul 19 17:35:13 2019 +0200
plug-ins: remove the oilify plug-in and add a PDB compat procedure
(cherry picked from commit b7cf8506719bf51126361d22e49ffab4dd1ca404)
app/pdb/internal-procs.c | 2 +-
app/pdb/plug-in-compat-cmds.c | 223 ++++++++++
pdb/groups/plug_in_compat.pdb | 165 ++++++-
plug-ins/common/.gitignore | 2 -
plug-ins/common/Makefile.am | 19 -
plug-ins/common/gimprc.common | 1 -
plug-ins/common/oilify.c | 945 -----------------------------------------
plug-ins/common/plugin-defs.pl | 1 -
po-plug-ins/POTFILES.in | 1 -
9 files changed, 369 insertions(+), 990 deletions(-)
---
diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c
index 1708b5840c..665656969b 100644
--- a/app/pdb/internal-procs.c
+++ b/app/pdb/internal-procs.c
@@ -28,7 +28,7 @@
#include "internal-procs.h"
-/* 846 procedures registered total */
+/* 848 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 48adaf79db..314b622ea5 100644
--- a/app/pdb/plug-in-compat-cmds.c
+++ b/app/pdb/plug-in-compat-cmds.c
@@ -3018,6 +3018,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,
@@ -7488,6 +7597,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
*/
diff --git a/pdb/groups/plug_in_compat.pdb b/pdb/groups/plug_in_compat.pdb
index 64f1f6c644..dc01bb5d30 100644
--- a/pdb/groups/plug_in_compat.pdb
+++ b/pdb/groups/plug_in_compat.pdb
@@ -1148,26 +1148,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 = (
@@ -2984,6 +2984,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';
@@ -5303,6 +5426,8 @@ CODE
plug_in_newsprint
plug_in_normalize
plug_in_nova
+ plug_in_oilify2
+ plug_in_oilify_enhanced2
plug_in_papertile
plug_in_pixelize
plug_in_pixelize2
diff --git a/plug-ins/common/.gitignore b/plug-ins/common/.gitignore
index ec9da70c5c..dda0467dee 100644
--- a/plug-ins/common/.gitignore
+++ b/plug-ins/common/.gitignore
@@ -144,8 +144,6 @@
/max-rgb.exe
/nl-filter
/nl-filter.exe
-/oilify
-/oilify.exe
/photocopy
/photocopy.exe
/plugin-browser
diff --git a/plug-ins/common/Makefile.am b/plug-ins/common/Makefile.am
index 447b00f2ea..c509f1f0a1 100644
--- a/plug-ins/common/Makefile.am
+++ b/plug-ins/common/Makefile.am
@@ -117,7 +117,6 @@ jigsaw_libexecdir = $(gimpplugindir)/plug-ins/jigsaw
mail_libexecdir = $(gimpplugindir)/plug-ins/mail
max_rgb_libexecdir = $(gimpplugindir)/plug-ins/max-rgb
nl_filter_libexecdir = $(gimpplugindir)/plug-ins/nl-filter
-oilify_libexecdir = $(gimpplugindir)/plug-ins/oilify
photocopy_libexecdir = $(gimpplugindir)/plug-ins/photocopy
plugin_browser_libexecdir = $(gimpplugindir)/plug-ins/plugin-browser
procedure_browser_libexecdir = $(gimpplugindir)/plug-ins/procedure-browser
@@ -209,7 +208,6 @@ jigsaw_libexec_PROGRAMS = jigsaw
mail_libexec_PROGRAMS = $(MAIL)
max_rgb_libexec_PROGRAMS = max-rgb
nl_filter_libexec_PROGRAMS = nl-filter
-oilify_libexec_PROGRAMS = oilify
photocopy_libexec_PROGRAMS = photocopy
plugin_browser_libexec_PROGRAMS = plugin-browser
procedure_browser_libexec_PROGRAMS = procedure-browser
@@ -1532,23 +1530,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)
-
photocopy_SOURCES = \
photocopy.c
diff --git a/plug-ins/common/gimprc.common b/plug-ins/common/gimprc.common
index e4484905ff..96d04b6dfb 100644
--- a/plug-ins/common/gimprc.common
+++ b/plug-ins/common/gimprc.common
@@ -69,7 +69,6 @@ jigsaw_RC = jigsaw.rc.o
mail_RC = mail.rc.o
max_rgb_RC = max-rgb.rc.o
nl_filter_RC = nl-filter.rc.o
-oilify_RC = oilify.rc.o
photocopy_RC = photocopy.rc.o
plugin_browser_RC = plugin-browser.rc.o
procedure_browser_RC = procedure-browser.rc.o
diff --git a/plug-ins/common/plugin-defs.pl b/plug-ins/common/plugin-defs.pl
index f2a9e42f71..c8db21e4b4 100644
--- a/plug-ins/common/plugin-defs.pl
+++ b/plug-ins/common/plugin-defs.pl
@@ -70,7 +70,6 @@
'mail' => { ui => 1, optional => 1 },
'max-rgb' => { ui => 1 },
'nl-filter' => { ui => 1, gegl => 1 },
- 'oilify' => { ui => 1 },
'photocopy' => { ui => 1 },
'plugin-browser' => { ui => 1 },
'procedure-browser' => { ui => 1 },
diff --git a/po-plug-ins/POTFILES.in b/po-plug-ins/POTFILES.in
index f5d097fec3..3542007cf9 100644
--- a/po-plug-ins/POTFILES.in
+++ b/po-plug-ins/POTFILES.in
@@ -74,7 +74,6 @@ plug-ins/common/jigsaw.c
plug-ins/common/mail.c
plug-ins/common/max-rgb.c
plug-ins/common/nl-filter.c
-plug-ins/common/oilify.c
plug-ins/common/photocopy.c
plug-ins/common/plugin-browser.c
plug-ins/common/procedure-browser.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]