Commit 82223783 authored by Thomas Manni's avatar Thomas Manni

plug-ins, pdb: remove the bump-map plug-in and add 2 PDB compat procs

parent 9e76b64f
......@@ -28,7 +28,7 @@
#include "internal-procs.h"
/* 764 procedures registered total */
/* 766 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)
......
This diff is collapsed.
......@@ -16,8 +16,6 @@
/blur-gauss-selective.exe
/border-average
/border-average.exe
/bump-map
/bump-map.exe
/cartoon
/cartoon.exe
/checkerboard
......
......@@ -51,7 +51,6 @@ libexec_PROGRAMS = \
blur \
blur-gauss-selective \
border-average \
bump-map \
cartoon \
checkerboard \
cml-explorer \
......@@ -293,23 +292,6 @@ border_average_LDADD = \
$(INTLLIBS) \
$(border_average_RC)
bump_map_SOURCES = \
bump-map.c
bump_map_LDADD = \
$(libgimpui) \
$(libgimpwidgets) \
$(libgimpmodule) \
$(libgimp) \
$(libgimpmath) \
$(libgimpconfig) \
$(libgimpcolor) \
$(libgimpbase) \
$(GTK_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(bump_map_RC)
cartoon_SOURCES = \
cartoon.c
......
This diff is collapsed.
......@@ -5,7 +5,6 @@ blinds_RC = blinds.rc.o
blur_RC = blur.rc.o
blur_gauss_selective_RC = blur-gauss-selective.rc.o
border_average_RC = border-average.rc.o
bump_map_RC = bump-map.rc.o
cartoon_RC = cartoon.rc.o
checkerboard_RC = checkerboard.rc.o
cml_explorer_RC = cml-explorer.rc.o
......
......@@ -6,7 +6,6 @@
'blur' => {},
'blur-gauss-selective' => { ui => 1, cflags => 'MMX_EXTRA_CFLAGS' },
'border-average' => { ui => 1, gegl => 1 },
'bump-map' => { ui => 1 },
'cartoon' => { ui => 1 },
'checkerboard' => { ui => 1 },
'cml-explorer' => { ui => 1 },
......
......@@ -10,7 +10,6 @@ plug-ins/common/blinds.c
plug-ins/common/blur.c
plug-ins/common/blur-gauss-selective.c
plug-ins/common/border-average.c
plug-ins/common/bump-map.c
plug-ins/common/cartoon.c
plug-ins/common/checkerboard.c
plug-ins/common/cml-explorer.c
......
......@@ -419,6 +419,142 @@ CODE
);
}
sub plug_in_bump_map {
$blurb = 'Create an embossing effect using a bump map';
$help = <<'HELP';
This plug-in uses the algorithm described by John Schlag,
"Fast Embossing Effects on Raster Image Data" in
Graphics GEMS IV (ISBN 0-12-336155-9).
It takes a drawable to be applied as a bump
map to another image and produces a nice embossing effect.
HELP
&std_pdb_compat('gegl:bump-map');
$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 => 'bumpmap', type => 'drawable',
desc => 'Bump map drawable' },
{ name => 'azimuth', type => '0.0 <= float <= 360.0',
desc => 'Azimuth' },
{ name => 'elevation', type => '0.5 <= float <= 90.0',
desc => 'Elevation' },
{ name => 'depth', type => '1 <= int32 <= 65',
desc => 'Depth' },
{ name => 'xofs', type => 'int32',
desc => 'X offset' },
{ name => 'yofs', type => 'int32',
desc => 'Y offset' },
{ name => 'waterlevel', type => '0.0 <= float <= 1.0',
desc => 'Level that full transparency should represent' },
{ name => 'ambient', type => '0.0 <= float <= 1.0',
desc => 'Ambient lighting factor' },
{ name => 'compensate', type => 'boolean',
desc => 'Compensate for darkening' },
{ name => 'invert', type => 'boolean',
desc => 'Invert bumpmap' },
{ name => 'type', type => '0 <= int32 <= 3',
desc => 'Type of map { LINEAR (0), SPHERICAL (1), SINUSOIDAL (2) }' }
);
%invoke = (
code => <<'CODE'
{
success = bump_map (drawable,
bumpmap,
azimuth,
elevation,
depth,
xofs,
yofs,
waterlevel,
ambient,
compensate,
invert,
type,
FALSE,
progress,
error);
}
CODE
);
}
sub plug_in_bump_map_tiled {
$blurb = 'Create an embossing effect using a tiled image as a bump map';
$help = <<'HELP';
This plug-in uses the algorithm described by John Schlag,
"Fast Embossing Effects on Raster Image Data" in
Graphics GEMS IV (ISBN 0-12-336155-9).
It takes a drawable to be tiled and applied as a bump map
to another image and produces a nice embossing effect.
HELP
&std_pdb_compat('gegl:bump-map');
$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 => 'bumpmap', type => 'drawable',
desc => 'Bump map drawable' },
{ name => 'azimuth', type => '0.0 <= float <= 360.0',
desc => 'Azimuth' },
{ name => 'elevation', type => '0.5 <= float <= 90.0',
desc => 'Elevation' },
{ name => 'depth', type => '1 <= int32 <= 65',
desc => 'Depth' },
{ name => 'xofs', type => 'int32',
desc => 'X offset' },
{ name => 'yofs', type => 'int32',
desc => 'Y offset' },
{ name => 'waterlevel', type => '0.0 <= float <= 1.0',
desc => 'Level that full transparency should represent' },
{ name => 'ambient', type => '0.0 <= float <= 1.0',
desc => 'Ambient lighting factor' },
{ name => 'compensate', type => 'boolean',
desc => 'Compensate for darkening' },
{ name => 'invert', type => 'boolean',
desc => 'Invert bumpmap' },
{ name => 'type', type => '0 <= int32 <= 3',
desc => 'Type of map { LINEAR (0), SPHERICAL (1), SINUSOIDAL (2) }' }
);
%invoke = (
code => <<'CODE'
{
success = bump_map (drawable,
bumpmap,
azimuth,
elevation,
depth,
xofs,
yofs,
waterlevel,
ambient,
compensate,
invert,
type,
TRUE,
progress,
error);
}
CODE
);
}
sub plug_in_c_astretch {
$blurb = 'Stretch contrast to cover the maximum possible range';
......@@ -4148,6 +4284,63 @@ create_buffer_source_node (GeglNode *parent,
return new_node;
}
static gboolean
bump_map (GimpDrawable *drawable,
GimpDrawable *bump_map,
gdouble azimuth,
gdouble elevation,
gint depth,
gint offset_x,
gint offset_y,
gdouble waterlevel,
gdouble ambient,
gboolean compensate,
gboolean invert,
gint type,
gboolean tiled,
GimpProgress *progress,
GError **error)
{
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 *gegl;
GeglNode *node;
GeglNode *src_node;
gegl = gegl_node_new ();
node = gegl_node_new_child (gegl,
"operation", "gegl:bump-map",
"tiled", tiled,
"type", type,
"compensate", compensate,
"invert", invert,
"azimuth", azimuth,
"elevation", elevation,
"depth", depth,
"offset_x", offset_x,
"offset_y", offset_y,
"waterlevel", waterlevel,
"ambient", ambient,
NULL);
src_node = create_buffer_source_node (gegl, bump_map);
gegl_node_connect_to (src_node, "output", node, "aux");
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Bump Map"),
node);
g_object_unref (gegl);
return TRUE;
}
else
return FALSE;
}
static gboolean
displace (GimpDrawable *drawable,
gdouble amount_x,
......@@ -4277,6 +4470,8 @@ CODE
plug_in_autocrop
plug_in_autocrop_layer
plug_in_autostretch_hsv
plug_in_bump_map
plug_in_bump_map_tiled
plug_in_c_astretch
plug_in_colors_channel_mixer
plug_in_colortoalpha
......
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