mirror of https://github.com/GNOME/gimp.git
see plug-ins/perl/Changes
This commit is contained in:
parent
76164bb802
commit
7d749f4218
|
@ -6,7 +6,7 @@ Revision history for Gimp-Perl extension.
|
|||
- removed publicly-visible non-PDB pixelfunctions.
|
||||
"uuuuuse peedee-ell or dieieie".
|
||||
- implemented Gimp::Fu::PF_RADIO.
|
||||
- added blowinout.pl.
|
||||
- added blowinout.pl and terral_text.
|
||||
|
||||
1.055 Mon Feb 22 22:38:44 CET 1999
|
||||
- applied seth's script changes.
|
||||
|
|
|
@ -23,12 +23,14 @@ extern "C" {
|
|||
|
||||
/* FIXME */
|
||||
/* dirty is used in gimp.h. */
|
||||
#undef dirty
|
||||
#ifdef dirty
|
||||
# undef dirty
|
||||
#endif
|
||||
#include "extradefs.h"
|
||||
|
||||
#if GIMP_MAJOR_VERSION>1 || (GIMP_MAJOR_VERSION==1 && GIMP_MINOR_VERSION>=1)
|
||||
#define GIMP11 1
|
||||
#define GIMP_PARASITE 1
|
||||
# define GIMP11 1
|
||||
# define GIMP_PARASITE 1
|
||||
#endif
|
||||
|
||||
/* Shamelesssly stolen from IO.xs. See perlguts, this is only for
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
|
||||
#include <libgimp/gimp.h>
|
||||
#if UI
|
||||
#include <libgimp/gimpui.h>
|
||||
# include <libgimp/gimpui.h>
|
||||
#endif
|
||||
|
||||
#if GIMP_MAJOR_VERSION>1 || (GIMP_MAJOR_VERSION==1 && GIMP_MINOR_VERSION>=1)
|
||||
#define GIMP11 1
|
||||
#define GIMP_PARASITE 1
|
||||
# define GIMP11 1
|
||||
# define GIMP_PARASITE 1
|
||||
#endif
|
||||
|
||||
/* FIXME */
|
||||
|
@ -32,18 +32,16 @@
|
|||
#endif
|
||||
/* And also for newer perls... */
|
||||
#ifndef dTHR
|
||||
#define dTHR (void)0
|
||||
# define dTHR (void)0
|
||||
#endif
|
||||
#if (PATCHLEVEL < 5)
|
||||
#define newSVpvn(data,len) ((len) ? newSVpv ((data), (len)) : newSVpv ("", 0))
|
||||
#endif
|
||||
#ifndef PL_sv_undef
|
||||
#define PL_sv_undef sv_undef
|
||||
# define newSVpvn(data,len) ((len) ? newSVpv ((data), (len)) : newSVpv ("", 0))
|
||||
# define PL_sv_undef sv_undef
|
||||
#endif
|
||||
|
||||
/* dirty is used in gimp.h AND in perl < 5.005 or with PERL_POLLUTE. */
|
||||
#ifdef dirty
|
||||
#undef dirty
|
||||
# undef dirty
|
||||
#endif
|
||||
|
||||
#include "extradefs.h"
|
||||
|
@ -60,7 +58,7 @@
|
|||
#define PKG_SELECTION GIMP_PKG "Selection"
|
||||
#define PKG_REGION GIMP_PKG "Region"
|
||||
#if GIMP_PARASITE
|
||||
#define PKG_PARASITE GIMP_PKG "Parasite"
|
||||
# define PKG_PARASITE GIMP_PKG "Parasite"
|
||||
#endif
|
||||
|
||||
#define PKG_GDRAWABLE GIMP_PKG "GDrawable"
|
||||
|
|
|
@ -58,3 +58,4 @@ examples/xachshadow.pl
|
|||
examples/parasite-editor
|
||||
examples/scratches.pl
|
||||
examples/blowinout.pl
|
||||
examples/terral_text
|
||||
|
|
|
@ -89,7 +89,7 @@ register
|
|||
"Blow selected layer inout",
|
||||
"Generates an animation thats blows the selected layer in or out",
|
||||
"John Pitney",
|
||||
"John Pitney <pitney\@students.uiuc.edu>",
|
||||
"John Pitney <pitney\@uiuc.edu>",
|
||||
"1999-02-24",
|
||||
"<Image>/Filters/Distorts/BlowInOut",
|
||||
"*",
|
||||
|
|
|
@ -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;
|
Loading…
Reference in New Issue