Commit 95c235f8 authored by Téo Mazars's avatar Téo Mazars

plugins: Add compat wrappers for alien-map

And remove the old plugin
parent 23706703
......@@ -28,7 +28,7 @@
#include "internal-procs.h"
/* 692 procedures registered total */
/* 693 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)
......
......@@ -52,6 +52,74 @@
#include "gimp-intl.h"
static GimpValueArray *
plug_in_alienmap2_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gdouble redfrequency;
gdouble redangle;
gdouble greenfrequency;
gdouble greenangle;
gdouble bluefrequency;
gdouble blueangle;
guint8 colormodel;
guint8 redmode;
guint8 greenmode;
guint8 bluemode;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
redfrequency = g_value_get_double (gimp_value_array_index (args, 3));
redangle = g_value_get_double (gimp_value_array_index (args, 4));
greenfrequency = g_value_get_double (gimp_value_array_index (args, 5));
greenangle = g_value_get_double (gimp_value_array_index (args, 6));
bluefrequency = g_value_get_double (gimp_value_array_index (args, 7));
blueangle = g_value_get_double (gimp_value_array_index (args, 8));
colormodel = g_value_get_uint (gimp_value_array_index (args, 9));
redmode = g_value_get_uint (gimp_value_array_index (args, 10));
greenmode = g_value_get_uint (gimp_value_array_index (args, 11));
bluemode = g_value_get_uint (gimp_value_array_index (args, 12));
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:alien-map",
"color_representation", (gint) colormodel,
"cpn-1-frequency", (gdouble) redfrequency,
"cpn-2-frequency", (gdouble) greenfrequency,
"cpn-3-frequency", (gdouble) bluefrequency,
"cpn-1-phaseshift", (gdouble) redangle,
"cpn-2-phaseshift", (gdouble) greenangle,
"cpn-3-phaseshift", (gdouble) blueangle,
"cpn-1-keep", (gboolean) !redmode,
"cpn-2-keep", (gboolean) !greenmode,
"cpn-3-keep", (gboolean) !bluemode,
NULL);
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Alien Map"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GimpValueArray *
plug_in_autocrop_invoker (GimpProcedure *procedure,
Gimp *gimp,
......@@ -1089,6 +1157,102 @@ register_plug_in_compat_procs (GimpPDB *pdb)
{
GimpProcedure *procedure;
/*
* gimp-plug-in-alienmap2
*/
procedure = gimp_procedure_new (plug_in_alienmap2_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"plug-in-alienmap2");
gimp_procedure_set_static_strings (procedure,
"plug-in-alienmap2",
"Alter colors in various psychedelic ways",
"No help yet. Just try it and you'll see!",
"Compatibility procedure. Please see 'gegl:alien-map' for credits.",
"Compatibility procedure. Please see 'gegl:alien-map' for credits.",
"2013",
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 ("redfrequency",
"redfrequency",
"Red/hue component frequency factor",
0, 20, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("redangle",
"redangle",
"Red/hue component angle factor (0-360)",
0, 360, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("greenfrequency",
"greenfrequency",
"Green/saturation component frequency factor",
0, 20, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("greenangle",
"greenangle",
"Green/saturation component angle factor (0-360)",
0, 360, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("bluefrequency",
"bluefrequency",
"Blue/luminance component frequency factor",
0, 20, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("blueangle",
"blueangle",
"Blue/luminance component angle factor (0-360)",
0, 360, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int8 ("colormodel",
"colormodel",
"Color model { RGB-MODEL (0), HSL-MODEL (1) }",
0, 1, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int8 ("redmode",
"redmode",
"Red/hue application mode { TRUE, FALSE }",
0, 1, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int8 ("greenmode",
"greenmode",
"Green/saturation application mode { TRUE, FALSE }",
0, 1, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int8 ("bluemode",
"bluemode",
"Blue/luminance application mode { TRUE, FALSE }",
0, 1, 0,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-plug-in-autocrop
*/
......
......@@ -2,8 +2,6 @@
/.libs
/Makefile
/Makefile.in
/alien-map
/alien-map.exe
/align-layers
/align-layers.exe
/animation-optimize
......
......@@ -44,7 +44,6 @@ AM_CPPFLAGS = \
-I$(includedir)
libexec_PROGRAMS = \
alien-map \
align-layers \
animation-optimize \
animation-play \
......@@ -209,23 +208,6 @@ install-%: %
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$f || exit 1; \
else :; fi
alien_map_SOURCES = \
alien-map.c
alien_map_LDADD = \
$(libgimpui) \
$(libgimpwidgets) \
$(libgimpmodule) \
$(libgimp) \
$(libgimpmath) \
$(libgimpconfig) \
$(libgimpcolor) \
$(libgimpbase) \
$(GTK_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(alien_map_RC)
align_layers_SOURCES = \
align-layers.c
......
This diff is collapsed.
alien_map_RC = alien-map.rc.o
align_layers_RC = align-layers.rc.o
animation_optimize_RC = animation-optimize.rc.o
animation_play_RC = animation-play.rc.o
......
%plugins = (
'alien-map' => { ui => 1 },
'align-layers' => { ui => 1 },
'animation-optimize' => {},
'animation-play' => { ui => 1, gegl => 1 },
......
......@@ -6,7 +6,6 @@
plug-ins/color-rotate/color-rotate-dialog.c
plug-ins/color-rotate/color-rotate-stock.c
plug-ins/color-rotate/color-rotate.c
plug-ins/common/alien-map.c
plug-ins/common/align-layers.c
plug-ins/common/animation-optimize.c
plug-ins/common/animation-play.c
......
......@@ -16,6 +16,80 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub plug_in_alienmap2 {
$blurb = 'Alter colors in various psychedelic ways';
$help = <<'HELP';
No help yet. Just try it and you'll see!
HELP
&std_pdb_compat('gegl:alien-map');
$date = '2013';
@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 => 'redfrequency', type => '0 <= float <= 20',
desc => 'Red/hue component frequency factor' },
{ name => 'redangle', type => '0 <= float <= 360',
desc => 'Red/hue component angle factor (0-360)' },
{ name => 'greenfrequency', type => '0 <= float <= 20',
desc => 'Green/saturation component frequency factor' },
{ name => 'greenangle', type => '0 <= float <= 360',
desc => 'Green/saturation component angle factor (0-360)' },
{ name => 'bluefrequency', type => '0 <= float <= 20',
desc => 'Blue/luminance component frequency factor' },
{ name => 'blueangle', type => '0 <= float <= 360',
desc => 'Blue/luminance component angle factor (0-360)' },
{ name => 'colormodel', type => '0 <= int8 <= 1',
desc => 'Color model { RGB-MODEL (0), HSL-MODEL (1) }' },
{ name => 'redmode', type => '0 <= int8 <= 1',
desc => 'Red/hue application mode { TRUE, FALSE }' },
{ name => 'greenmode', type => '0 <= int8 <= 1',
desc => 'Green/saturation application mode { TRUE, FALSE }' },
{ name => 'bluemode', type => '0 <= int8 <= 1',
desc => 'Blue/luminance application mode { TRUE, FALSE }' }
);
%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:alien-map",
"color_representation", (gint) colormodel,
"cpn-1-frequency", (gdouble) redfrequency,
"cpn-2-frequency", (gdouble) greenfrequency,
"cpn-3-frequency", (gdouble) bluefrequency,
"cpn-1-phaseshift", (gdouble) redangle,
"cpn-2-phaseshift", (gdouble) greenangle,
"cpn-3-phaseshift", (gdouble) blueangle,
"cpn-1-keep", (gboolean) !redmode,
"cpn-2-keep", (gboolean) !greenmode,
"cpn-3-keep", (gboolean) !bluemode,
NULL);
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Alien Map"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
CODE
);
}
sub plug_in_autocrop {
$blurb = 'Remove empty borders from the image';
......@@ -1209,7 +1283,8 @@ CODE
"gimppdb-utils.h"
"gimp-intl.h");
@procs = qw(plug_in_autocrop
@procs = qw(plug_in_alienmap2
plug_in_autocrop
plug_in_autocrop_layer
plug_in_colortoalpha
plug_in_cubism
......
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