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

This commit is contained in:
Michael Natterer 2014-11-16 22:08:51 +01:00
parent 4f647e6ed7
commit e78540e581
9 changed files with 155 additions and 2161 deletions

View File

@ -28,7 +28,7 @@
#include "internal-procs.h"
/* 737 procedures registered total */
/* 738 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)

View File

@ -2478,6 +2478,52 @@ plug_in_threshold_alpha_invoker (GimpProcedure *procedure,
error ? *error : NULL);
}
static GimpValueArray *
plug_in_video_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gint32 pattern_number;
gboolean additive;
gboolean rotated;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
pattern_number = g_value_get_int (gimp_value_array_index (args, 3));
additive = g_value_get_boolean (gimp_value_array_index (args, 4));
rotated = g_value_get_boolean (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:video-degradation",
"pattern", pattern_number,
"additive", additive,
"rotated", rotated,
NULL);
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Video"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GimpValueArray *
plug_in_vinvert_invoker (GimpProcedure *procedure,
Gimp *gimp,
@ -5012,6 +5058,60 @@ register_plug_in_compat_procs (GimpPDB *pdb)
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-plug-in-video
*/
procedure = gimp_procedure_new (plug_in_video_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"plug-in-video");
gimp_procedure_set_static_strings (procedure,
"plug-in-video",
"Simulate distortion produced by a fuzzy or low-res monitor",
"This function simulates the degradation of being on an old low-dotpitch RGB video monitor to the specified drawable.",
"Compatibility procedure. Please see 'gegl:video-degradation' for credits.",
"Compatibility procedure. Please see 'gegl:video-degradation' for credits.",
"2014",
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 ("pattern-number",
"pattern number",
"Type of RGB pattern to use",
0, 8, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("additive",
"additive",
"Whether the function adds the result to the original image",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("rotated",
"rotated",
"Whether to rotate the RGB pattern by ninety degrees",
FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-plug-in-vinvert
*/

View File

@ -216,8 +216,6 @@
/value-propagate.exe
/van-gogh-lic
/van-gogh-lic.exe
/video
/video.exe
/warp
/warp.exe
/web-browser

View File

@ -151,7 +151,6 @@ libexec_PROGRAMS = \
unsharp-mask \
value-propagate \
van-gogh-lic \
video \
warp \
web-browser \
$(WEB_PAGE) \
@ -2067,23 +2066,6 @@ van_gogh_lic_LDADD = \
$(INTLLIBS) \
$(van_gogh_lic_RC)
video_SOURCES = \
video.c
video_LDADD = \
$(libgimpui) \
$(libgimpwidgets) \
$(libgimpmodule) \
$(libgimp) \
$(libgimpmath) \
$(libgimpconfig) \
$(libgimpcolor) \
$(libgimpbase) \
$(GTK_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(video_RC)
warp_SOURCES = \
warp.c

View File

@ -105,7 +105,6 @@ unit_editor_RC = unit-editor.rc.o
unsharp_mask_RC = unsharp-mask.rc.o
value_propagate_RC = value-propagate.rc.o
van_gogh_lic_RC = van-gogh-lic.rc.o
video_RC = video.rc.o
warp_RC = warp.rc.o
web_browser_RC = web-browser.rc.o
web_page_RC = web-page.rc.o

View File

@ -106,7 +106,6 @@
'unsharp-mask' => { ui => 1 },
'value-propagate' => { ui => 1 },
'van-gogh-lic' => { ui => 1 },
'video' => { ui => 1 },
'warp' => { ui => 1 },
'web-browser' => { ui => 1 },
'web-page' => { ui => 1, optional => 1, libs => 'WEBKIT_LIBS', cflags => 'WEBKIT_CFLAGS' },

File diff suppressed because it is too large Load Diff

View File

@ -110,7 +110,6 @@ plug-ins/common/unit-editor.c
plug-ins/common/unsharp-mask.c
plug-ins/common/value-propagate.c
plug-ins/common/van-gogh-lic.c
plug-ins/common/video.c
plug-ins/common/warp.c
plug-ins/common/web-browser.c
plug-ins/common/web-page.c

View File

@ -2620,6 +2620,59 @@ CODE
);
}
sub plug_in_video {
$blurb = 'Simulate distortion produced by a fuzzy or low-res monitor';
$help = <<'HELP';
This function simulates the degradation of being on an old
low-dotpitch RGB video monitor to the specified drawable.
HELP
&std_pdb_compat('gegl:video-degradation');
$date = '2014';
@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 => 'pattern_number', type => '0 <= int32 <= 8',
desc => 'Type of RGB pattern to use' },
{ name => 'additive', type => 'boolean',
desc => 'Whether the function adds the result to the original image' },
{ name => 'rotated', type => 'boolean',
desc => 'Whether to rotate the RGB pattern by ninety degrees' }
);
%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:video-degradation",
"pattern", pattern_number,
"additive", additive,
"rotated", rotated,
NULL);
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Video"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
CODE
);
}
sub plug_in_vinvert {
$blurb = 'Invert the brightness of each pixel';
@ -3002,6 +3055,7 @@ CODE
plug_in_sobel
plug_in_spread
plug_in_threshold_alpha
plug_in_video
plug_in_vinvert
plug_in_waves
plug_in_whirl_pinch);