Commit b87d97ae authored by Michael Natterer's avatar Michael Natterer

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

parent 1dd27529
......@@ -28,7 +28,7 @@
#include "internal-procs.h"
/* 748 procedures registered total */
/* 749 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)
......
......@@ -1070,6 +1070,54 @@ plug_in_exchange_invoker (GimpProcedure *procedure,
error ? *error : NULL);
}
static GimpValueArray *
plug_in_flarefx_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gint32 pos_x;
gint32 pos_y;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
pos_x = g_value_get_int (gimp_value_array_index (args, 3));
pos_y = 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;
gint width = gimp_item_get_width (GIMP_ITEM (drawable));
gint height = gimp_item_get_height (GIMP_ITEM (drawable));
gdouble x = (gdouble) pos_x / (gdouble) width;
gdouble y = (gdouble) pos_y / (gdouble) height;
node = gegl_node_new_child (NULL,
"operation", "gegl:lens-flare",
"pos-x", x,
"pos-y", y,
NULL);
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Lens Flare"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GimpValueArray *
plug_in_gauss_invoker (GimpProcedure *procedure,
Gimp *gimp,
......@@ -3841,6 +3889,54 @@ register_plug_in_compat_procs (GimpPDB *pdb)
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-plug-in-flarefx
*/
procedure = gimp_procedure_new (plug_in_flarefx_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"plug-in-flarefx");
gimp_procedure_set_static_strings (procedure,
"plug-in-flarefx",
"Add a lens flare effect",
"Adds a lens flare effects. Makes your image look like it was snapped with a cheap camera with a lot of lens :)",
"Compatibility procedure. Please see 'gegl:lens-flare' for credits.",
"Compatibility procedure. Please see 'gegl:lens-flare' for credits.",
"2015",
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 ("pos-x",
"pos x",
"X-Position",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("pos-y",
"pos y",
"Y-Position",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-plug-in-gauss
*/
......
......@@ -154,8 +154,6 @@
/jigsaw.exe
/lcms
/lcms.exe
/lens-flare
/lens-flare.exe
/mail
/mail.exe
/max-rgb
......
......@@ -120,7 +120,6 @@ libexec_PROGRAMS = \
hot \
jigsaw \
lcms \
lens-flare \
$(MAIL) \
max-rgb \
metadata \
......@@ -1528,23 +1527,6 @@ lcms_LDADD = \
$(INTLLIBS) \
$(lcms_RC)
lens_flare_SOURCES = \
lens-flare.c
lens_flare_LDADD = \
$(libgimpui) \
$(libgimpwidgets) \
$(libgimpmodule) \
$(libgimp) \
$(libgimpmath) \
$(libgimpconfig) \
$(libgimpcolor) \
$(libgimpbase) \
$(GTK_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(lens_flare_RC)
mail_SOURCES = \
mail.c
......
......@@ -74,7 +74,6 @@ guillotine_RC = guillotine.rc.o
hot_RC = hot.rc.o
jigsaw_RC = jigsaw.rc.o
lcms_RC = lcms.rc.o
lens_flare_RC = lens-flare.rc.o
mail_RC = mail.rc.o
max_rgb_RC = max-rgb.rc.o
metadata_RC = metadata.rc.o
......
This diff is collapsed.
......@@ -75,7 +75,6 @@
'hot' => { ui => 1 },
'jigsaw' => { ui => 1 },
'lcms' => { ui => 1, gegl => 1, libs => 'LCMS_LIBS', cflags => 'LCMS_CFLAGS' },
'lens-flare' => { ui => 1 },
'mail' => { ui => 1, optional => 1 },
'max-rgb' => { ui => 1 },
'metadata' => { ui => 1, libs => 'GEXIV2_LIBS', cflags => 'GEXIV2_CFLAGS' },
......
......@@ -79,7 +79,6 @@ plug-ins/common/guillotine.c
plug-ins/common/hot.c
plug-ins/common/jigsaw.c
plug-ins/common/lcms.c
plug-ins/common/lens-flare.c
plug-ins/common/mail.c
plug-ins/common/max-rgb.c
plug-ins/common/metadata.c
......
......@@ -989,6 +989,61 @@ CODE
);
}
sub plug_in_flarefx {
$blurb = 'Add a lens flare effect';
$help = <<'HELP';
Adds a lens flare effects. Makes your image look like it was snapped
with a cheap camera with a lot of lens :)
HELP
&std_pdb_compat('gegl:lens-flare');
$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 => 'pos_x', type => 'int32',
desc => 'X-Position' },
{ name => 'pos_y', type => 'int32',
desc => 'Y-Position' }
);
%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;
gint width = gimp_item_get_width (GIMP_ITEM (drawable));
gint height = gimp_item_get_height (GIMP_ITEM (drawable));
gdouble x = (gdouble) pos_x / (gdouble) width;
gdouble y = (gdouble) pos_y / (gdouble) height;
node = gegl_node_new_child (NULL,
"operation", "gegl:lens-flare",
"pos-x", x,
"pos-y", y,
NULL);
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Lens Flare"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
CODE
);
}
sub plug_in_gauss {
$blurb = 'Simplest, most commonly used way of blurring';
......@@ -3382,6 +3437,7 @@ CODE
plug_in_deinterlace
plug_in_engrave
plug_in_exchange
plug_in_flarefx
plug_in_gauss
plug_in_gauss_iir
plug_in_gauss_iir2
......
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