see plug-ins/perl/Changes

This commit is contained in:
Marc Lehmann
1999-02-26 03:50:32 +00:00
parent 76164bb802
commit 7d749f4218
6 changed files with 117 additions and 15 deletions

View File

@ -6,7 +6,7 @@ Revision history for Gimp-Perl extension.
- removed publicly-visible non-PDB pixelfunctions. - removed publicly-visible non-PDB pixelfunctions.
"uuuuuse peedee-ell or dieieie". "uuuuuse peedee-ell or dieieie".
- implemented Gimp::Fu::PF_RADIO. - implemented Gimp::Fu::PF_RADIO.
- added blowinout.pl. - added blowinout.pl and terral_text.
1.055 Mon Feb 22 22:38:44 CET 1999 1.055 Mon Feb 22 22:38:44 CET 1999
- applied seth's script changes. - applied seth's script changes.

View File

@ -23,12 +23,14 @@ extern "C" {
/* FIXME */ /* FIXME */
/* dirty is used in gimp.h. */ /* dirty is used in gimp.h. */
#undef dirty #ifdef dirty
# undef dirty
#endif
#include "extradefs.h" #include "extradefs.h"
#if GIMP_MAJOR_VERSION>1 || (GIMP_MAJOR_VERSION==1 && GIMP_MINOR_VERSION>=1) #if GIMP_MAJOR_VERSION>1 || (GIMP_MAJOR_VERSION==1 && GIMP_MINOR_VERSION>=1)
#define GIMP11 1 # define GIMP11 1
#define GIMP_PARASITE 1 # define GIMP_PARASITE 1
#endif #endif
/* Shamelesssly stolen from IO.xs. See perlguts, this is only for /* Shamelesssly stolen from IO.xs. See perlguts, this is only for

View File

@ -5,12 +5,12 @@
#include <libgimp/gimp.h> #include <libgimp/gimp.h>
#if UI #if UI
#include <libgimp/gimpui.h> # include <libgimp/gimpui.h>
#endif #endif
#if GIMP_MAJOR_VERSION>1 || (GIMP_MAJOR_VERSION==1 && GIMP_MINOR_VERSION>=1) #if GIMP_MAJOR_VERSION>1 || (GIMP_MAJOR_VERSION==1 && GIMP_MINOR_VERSION>=1)
#define GIMP11 1 # define GIMP11 1
#define GIMP_PARASITE 1 # define GIMP_PARASITE 1
#endif #endif
/* FIXME */ /* FIXME */
@ -32,18 +32,16 @@
#endif #endif
/* And also for newer perls... */ /* And also for newer perls... */
#ifndef dTHR #ifndef dTHR
#define dTHR (void)0 # define dTHR (void)0
#endif #endif
#if (PATCHLEVEL < 5) #if (PATCHLEVEL < 5)
#define newSVpvn(data,len) ((len) ? newSVpv ((data), (len)) : newSVpv ("", 0)) # define newSVpvn(data,len) ((len) ? newSVpv ((data), (len)) : newSVpv ("", 0))
#endif # define PL_sv_undef sv_undef
#ifndef PL_sv_undef
#define PL_sv_undef sv_undef
#endif #endif
/* dirty is used in gimp.h AND in perl < 5.005 or with PERL_POLLUTE. */ /* dirty is used in gimp.h AND in perl < 5.005 or with PERL_POLLUTE. */
#ifdef dirty #ifdef dirty
#undef dirty # undef dirty
#endif #endif
#include "extradefs.h" #include "extradefs.h"
@ -60,7 +58,7 @@
#define PKG_SELECTION GIMP_PKG "Selection" #define PKG_SELECTION GIMP_PKG "Selection"
#define PKG_REGION GIMP_PKG "Region" #define PKG_REGION GIMP_PKG "Region"
#if GIMP_PARASITE #if GIMP_PARASITE
#define PKG_PARASITE GIMP_PKG "Parasite" # define PKG_PARASITE GIMP_PKG "Parasite"
#endif #endif
#define PKG_GDRAWABLE GIMP_PKG "GDrawable" #define PKG_GDRAWABLE GIMP_PKG "GDrawable"

View File

@ -58,3 +58,4 @@ examples/xachshadow.pl
examples/parasite-editor examples/parasite-editor
examples/scratches.pl examples/scratches.pl
examples/blowinout.pl examples/blowinout.pl
examples/terral_text

View File

@ -89,7 +89,7 @@ register
"Blow selected layer inout", "Blow selected layer inout",
"Generates an animation thats blows the selected layer in or out", "Generates an animation thats blows the selected layer in or out",
"John Pitney", "John Pitney",
"John Pitney <pitney\@students.uiuc.edu>", "John Pitney <pitney\@uiuc.edu>",
"1999-02-24", "1999-02-24",
"<Image>/Filters/Distorts/BlowInOut", "<Image>/Filters/Distorts/BlowInOut",
"*", "*",

View File

@ -0,0 +1,101 @@
#!/usr/bin/perl -w
# Terral Text
# by Seth Burgess <sjburges@gimp.org>
# effect by Terral from #gimp
#*L* IRC log started on Tue Feb 23 21:59:08 1999
#*** LOG is set to on
#[terral] the inputs would be the following
#[terral] Text, font, and blur amount [22:00]
#[terral] it is executed on an existing image with 1 layer
#[terral] this layer will be named the pattern layer
#[terral] start of script-
#[terral] add new layer (white)
#[terral] add text, (centered, black) to the new layer [22:02]
#[terral] anchor the text
#[terral] guassian blur (blur amount)
#[terral] invert colors on text layer [22:05]
#[terral] make active layer the pattern layer now
#[terral] bump map text layer into pattern layer, ( azimuth 130.30, elevation 40, depth 20, x offset, y offset, waterlevel, azimuth. all 0)
#[terral] add layer mask, (white full opacity) [22:08]
#[terral] copy text layer
#[terral] paste into layer mask of pattern layer
#[terral] select layer mask of pattern layer to be active layer [22:09]
#[terral] edit curves
#[terral] input levels of 0, .24, 113 [22:11]
#[terral] --end of script [22:12]
use Gimp;
use Gimp::Fu;
# Gimp::set_trace(TRACE_ALL);
register
"terraltext",
"Make a cool text bumpmap thingy",
"Creates a bumpmap text thingy. Can work using the current layer as a bumpmap or make a solid noise layer for it.",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1999-02-24",
"<Image>/Filters/Render/Terral Text",
"RGB*",
[
[ PF_TOGGLE, "Solid Noise?", "Say yes here", "Either use solid noise or the current background", 0 ],
[ PF_FONT, "helvetica", "Font Name", "-*-helvetica-medium-r-normal-*-*-240-*-*-p-*-iso8859-1" ],
[ PF_STRING, "Text", "Enter your Text to be Terral-ified", "TerralText"],
[ PF_SLIDER, "Blur Amount", "Blur Amount", 10, [0,26,1]],
],
sub {
($img, $pattern, $solidnoise, $font, $text, $blur) = @_;
$oldbg = gimp_palette_get_background();
$oldfg = gimp_palette_get_foreground();
if ($solidnoise) {
$pattern->plug_in_solid_noise(1,1,256*rand(), 1,2.5,2.5);
}
# FIXME: I should endeavour to find out what kind of image I'm talking
# about before blindly apply a type of layer. Oh well. Call it RGBA
# for now.
$textlayer = $img->layer_new($img->width, $img->height,RGBA_IMAGE,
"TextLayer", 100, 0);
$img->add_layer($textlayer,1);
palette_set_background([255,255,255]);
$textlayer->edit_fill();
palette_set_foreground([0,0,0]);
# Place centered Text - what a PITA!
@extents = text_get_extents_fontname($text, xlfd_size($font), $font);
$width = $extents[0];
$height = $extents[1]; # there's other info in 2&3
$width_offset = ($img->width - $width)/2;
$height_offset = ($img->height - $height)/2;
$floating=$textlayer->text_fontname($width_offset, $height_offset, $text, 0,0,xlfd_size($font), $font);
$floating->floating_sel_anchor;
$textlayer->plug_in_gauss_iir($blur, 1,1);
$textlayer->invert();
$pattern->plug_in_bump_map($textlayer, 130.30, 40, 20, 0, 0, 0, 0, 1, 0, 0);
if (!($pattern->has_alpha)) {
$pattern->add_alpha;
}
$mask = $pattern->create_mask(0);
$img->add_layer_mask($pattern, $mask);
$textlayer->edit_copy();
$floater = $mask->edit_paste(0);
$floater->floating_sel_anchor;
$mask->levels(0, 0, 113, 0.24, 0, 255);
palette_set_background($oldbg);
palette_set_foreground($oldfg);
return;
};
exit main;