#!/usr/app/bin/perl
eval
'exec /usr/app/bin/perl -S $0 ${1+"$@"}'
if
0;
use
Gimp
qw(:auto __ N_)
;
N_
"/Xtns/Render"
; N_
"/Xtns/Render/Logos"
;
$defaultcolor1
= [124,10,18];
$defaultcolor2
= [200,19,27];
$path
= N_
"<Toolbox>/Xtns/Render/Logos/Inner Bevel"
;
$shortdesc
=
"Perform an inner bevel on text"
;
$longdesc
=
"This uses tigert's inner bevel method on text, which can be found with his other excellent tutorials at http://tigert.gimp.org/"
;
$date
=
"1999-03-23"
;
$imgtypes
=
undef
;
$author
=
"Seth Burgess <sjburges\@gimp.org>"
;
$path
=~ m,/([^/]+)$,;
$regname
= $1;
$regname
=~ s/ /_/g;
$regname
=~
tr
/A-Z/a-z/;
$author
=~ m/^(.*) </;
$authorname
= $1;
register
$regname
,
$shortdesc
,
$longdesc
,
$authorname
,
$author
,
$date
,
$path
,
$imgtypes
,
[
[PF_FONT,
"font"
,
"Font Name"
],
[PF_STRING,
"text"
,
"Enter your text to be beveled"
,
"INNERBEVEL"
],
[PF_COLOR,
"top_color"
,
"Blend to this color"
,
$defaultcolor2
],
[PF_COLOR,
"bot_color"
,
"Blend from this color"
,
$defaultcolor1
],
[PF_SLIDER,
"azimuth"
,
"Direction of the shine"
, 132, [0,255,5]],
[PF_SLIDER,
"shinyness"
,
"How shiny the final image will be"
,30, [0,90,5]],
[PF_SLIDER,
"depth_shape"
,
"Determines the final shape"
, 34 , [0,64,32]],
[PF_RADIO,
"map"
,
"The type of Map to use"
, 2, [
Linear
=> 0,
Spherical
=> 1,
Sinusoidal
=> 2] ],
],[],
[
'gimp-1.1'
,
],
sub
{
my
(
$font
,
$text
,
$color1
,
$color2
,
$azimuth
,
$elevation
,
$depth
,
$maptype
) =
@_
;
gimp_palette_set_background(
$color1
);
gimp_palette_set_foreground(
$color2
);
@dims
= gimp_text_wh(
$text
,
$font
);
$img
= gimp_image_new(
$dims
[0]+10,
$dims
[1]+10, RGB);
$layertmp
=
$img
->add_new_layer(0,TRANS_IMAGE_FILL);
$txtlayer
=
$img
->text_fontname(-1, 10, 10,
$text
, 0, 1, xlfd_size(
$font
),
$font
);
$dsp
= gimp_display_new(
$img
);
$layer
=
$img
->merge_visible_layers(EXPAND_AS_NECESSARY);
@pt1
= (
$layer
->width * 0.5 -1, 0);
@pt2
= (
$layer
->width * 0.5 +1,
$layer
->height);
$layer
->set_preserve_trans(1);
$layer
->blend(FG_BG_RGB, 0, LINEAR, 100, 0, REPEAT_NONE, 0, 3, 0.20,
@pt1
,
@pt2
);
$layer2
=
$layer
->copy(0);
$img
->add_layer(
$layer2
, 0);
$layer2
->set_preserve_trans(1);
$img
->selection_all;
gimp_palette_set_background([255,255,255]);
$layer2
->edit_fill(BG_IMAGE_FILL);
$layer2
->set_preserve_trans(0);
$layer2
->gauss_rle(6,1,1);
$layer
->plug_in_bump_map(
$layer2
,
$azimuth
,
$elevation
,
$depth
, 0,0,0,0,1,0,
$maptype
);
$layer2
->invert;
$img
->lower_layer(
$layer2
);
$layer2
->translate(2, 3);
$img
->add_new_layer(2);
$img
->gimp_selection_none();
return
();
};
exit
main;