see plug-ins/perl/Changes

This commit is contained in:
Marc Lehmann 1999-11-08 17:39:13 +00:00
parent 4d93809fec
commit 1efdbb0eee
23 changed files with 308 additions and 464 deletions

View File

@ -119,6 +119,7 @@ examples/map_to_gradient
examples/fire
examples/povray
examples/avi
examples/layerfuncs
pxgettext
po/gimp-perl.pot
po/de.po

View File

@ -13,7 +13,7 @@ $|=1;
repdup centerguide stampify goldenmean triangle billboard mirrorsplit
oneliners randomart1 pixelmap glowing_steel frame_reshuffle frame_filter
logulator miff gimpmagick guide_remove guides_to_selection burst map_to_gradient
fire povray avi
fire povray avi layerfuncs
);
if ($ARGV[0] ne "--writemakefile") {

View File

@ -1,114 +1,63 @@
#!/usr/bin/perl
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
use Gimp qw(:auto __);
use Gimp::Fu;
<!--
# alpha2color.pl
# by Seth Burgess <sjburges@gimp.org>
# Version 0.02
# Oct 16th, 1998
#
# This script simply changes the current alpha channel to a given color
# instead. I'm writing it primarily for use with the displace plugin,
# but I imagine it'll have other uses.
Available WWWOFFLE Variables (all with a '$' prefix).
# TODO: Selection is currently ignored. It'd be better if it remembered
# what the previous selection was.
# Also, it needs to find a happier home than in the Filters/Misc menu.
localhost = The hostname of the server running wwwoffled (='localhost:8080').
url = The URL that was asked for (='http://www.gimp.org/%7Esjburges/alpha2color.pl').
already = A flag to indicate that the page is already cached (='').
password = A one-time password to allow cancellation of the page (='0U3T7nn1gRTCe8Y3QkMQOg').
# Gimp::set_trace(TRACE_ALL);
-->
# Revision History
# v0.02 - fixed up @color (should be $color) and undef; (should be return();)
<HEAD>
<TITLE>WWWOFFLE - Will Get http://www.gimp.org/%7Esjburges/alpha2color.pl</TITLE>
</HEAD>
sub save_layers_state ($) {
$img = shift;
my @layers = $img->get_layers;
$i = 0;
foreach $lay (@layers) {
if ($lay->get_visible){
$arr[$i] = 1;
}
else {
$arr[$i] = 0;
}
$i++;
}
return @arr;
}
<BODY>
sub restore_layers_state($@) {
$img = shift;
@arr = @_;
my @layers = $img->get_layers;
$i = 0;
foreach $lay (@layers) {
$lay->set_visible($arr[$i]);
$i++;
}
}
<!-- Standard WWWOFFLE Message Page Top Banner -->
<p align=center>
<b>WWWOFFLE</b> - <b>W</b>orld <b>W</b>ide <b>W</b>eb <b>Offl</b>ine <b>E</b>xplorer
</p>
<hr>
sub alpha2col {
my ($img, $drawable, $color) = @_;
<!-- Standard WWWOFFLE Message Page Top Banner -->
my $oldcolor = gimp_palette_get_background();
<H1 align=center>WWWOFFLE Request Recorded</H1>
my @layers = gimp_image_get_layers($img);
<p align=center>
Your request for URL
<br>
<b><tt>http://www.gimp.org/%7Esjburges/alpha2color.pl</tt></b>
<br>
has been recorded for download.
</p>
# if there's not enough layers, abort.
if ($#layers < 0) {
gimp_message("You need at least 1 layer to perform alpha2color!");
print "Only ", scalar(@layers), " layers found!(", $layers[0],")\n";
return 0;
}
<!--
# Hide the bottom layer, so it doesn't get into the merge visible later.
Useful WWWOFFLE Buttons
@layer_visibilities = save_layers_state ($img);
# foreach $visible (@layer_visibilities) {
# print $visible, "\n";
# }
$target_layer = gimp_image_get_active_layer($img);
@offsets=$target_layer->offsets;
# print $target_layer, "\n";
foreach $eachlay (@layers) {
$eachlay->set_visible(0);
}
$target_layer->set_visible(1);
gimp_palette_set_background($color);
$newlay = $target_layer->copy(1);
$img->add_layer($newlay, 0);
$newlay->set_offsets(@offsets);
$target_layer->set_active_layer;
-->
$img->selection_all;
$target_layer->edit_fill;
$img->selection_none;
<p align=center>
[<a href="http://localhost:8080/control/delete-req/password=0U3T7nn1gRTCe8Y3QkMQOg?http://www.gimp.org/%7Esjburges/alpha2color.pl">Cancel</a>|Refresh:<a href="http://localhost:8080/refresh-options/?http://www.gimp.org/%7Esjburges/alpha2color.pl">Options</a>|<a href="http://localhost:8080/monitor-options/?http://www.gimp.org/%7Esjburges/alpha2color.pl">Monitor</a>|<a href="http://localhost:8080/index/url/?http://www.gimp.org/%7Esjburges/alpha2color.pl">Index</a>]
</p>
$foreground = gimp_image_merge_visible_layers($img,0);
<!-- Standard WWWOFFLE Message Page Bottom Buttons -->
restore_layers_state($img, @layer_visibilities);
<hr>
gimp_palette_set_background($oldcolor);
gimp_displays_flush();
return();
}
<p align=center>
WWWOFFLE - [<a href="http://localhost:8080/Welcome.html">Welcome Page</a>|<a href="http://localhost:8080/FAQ.html">FAQ</a>] - WWWOFFLE
</p>
register
"plug_in_alpha2color",
"Alpha 2 Color",
"Change the current alpha to a selected color.",
"Seth Burgess",
"Seth Burgess<sjburges\@gimp.org>",
"2-15-98",
__"<Image>/Image/Colors/Alpha2Color",
"RGBA",
[
[PF_COLOR, "color", "Color for current alpha", [127,127,127]]
],
\&alpha2col;
<!-- Standard WWWOFFLE Message Page Bottom Buttons -->
exit main;
</BODY>
</HTML>

View File

@ -1,171 +1,63 @@
#!/usr/bin/perl -w
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
# This one's all mine. Well, its GPL/Artisitic but I"m the author and creator. # I think you need gimp 1.1 or better for this - if you don't, please let
# me know
<!--
# I'm hacking this on top of my sethspin script, so this is doing even more
# stuff it wasn't really designed to do. Hence if you thought sethspin was
# a bit ugly, look at this one...
Available WWWOFFLE Variables (all with a '$' prefix).
# I think it was tigert that suggested this. It turned out to be less
# complex than I orginally thought so I figured I'd give it a spin.
# Seth Burgess
# <sjburges@gimp.org>
localhost = The hostname of the server running wwwoffled (='localhost:8080').
url = The URL that was asked for (='http://www.gimp.org/%7Esjburges/billboard').
already = A flag to indicate that the page is already cached (='').
password = A one-time password to allow cancellation of the page (='G2HohImsZPA9Rmi3igNl5Q').
use Gimp;
use Gimp::Fu;
use Gimp::Util;
-->
# Gimp::set_trace(TRACE_ALL);
<HEAD>
<TITLE>WWWOFFLE - Will Get http://www.gimp.org/%7Esjburges/billboard</TITLE>
</HEAD>
sub saw { # a sawtooth function on PI
($val) = @_;
if ($val < 3.14159/2.0) {
return ($val/3.14159) ;
}
elsif ($val < 3.14159) {
return (-1+$val/3.14159);
}
elsif ($val < 3.14159+3.14159/2.0) {
return ($val/3.14159) ;
}
else {
return (-1+$val/3.14159);
}
}
<BODY>
sub spin_layer { # the function for actually spinning the layer
my ($img, $spin, $dest, $numframes, $prp, $blinds) = @_;
# Now lets spin it!
$stepsize = 3.14159/$numframes; # in radians
for ($i=0; $i<=3.14159; $i+=$stepsize) {
Gimp->progress_update ($i/3.14159);
# create a new layer for spinning
$framelay = ($i < 3.14159/2.0) ? $spin->copy(1) : $dest->copy(1);
$img->add_layer($framelay, 0);
# spin it a step
# Here I need to make the proper selection, repeatedly if necessary
$blindheight = $img->height/$blinds;
for ($j=0; $j<$blinds; $j++) {
# select a section
$img->rect_select(0, $j*$blindheight, $img->width, $blindheight, 2, 0, 0.13);
@x = $img->selection_bounds();
# x[1],x[2] x[3],x[2]
# x[1],x[4] x[3],x[4]
$floater = $framelay->perspective(1,
$x[1]+saw($i)*$prp*$framelay->width,$x[2]+$blindheight *sin($i)/2,
$x[3]-saw($i)*$prp*$framelay->width,$x[2]+$blindheight *sin($i)/2,
$x[1]-saw($i)*$prp*$framelay->width,$x[4]-$blindheight *sin($i)/2,
$x[3]+saw($i)*$prp*$framelay->width,$x[4]-$blindheight *sin($i)/2);
$floater->floating_sel_anchor;
} # end for ($j=0;...
<!-- Standard WWWOFFLE Message Page Top Banner -->
# I need to create another layer beind this spun one now
$backlayer = $framelay->layer_copy(0);
$img->add_layer($backlayer, 1);
$backlayer->fill(1); # BG-IMAGE-FILL
}
for ($i=0; $i<$numframes; $i++) {
@all_layers = $img->get_layers();
$img->set_visible($all_layers[$i],$all_layers[$i+1]);
$img->merge_visible_layers(0);
}
@all_layers = $img->get_layers();
$destfram = $all_layers[$numframes]->copy(0);
$img->add_layer($destfram,0);
<p align=center>
<b>WWWOFFLE</b> - <b>W</b>orld <b>W</b>ide <b>W</b>eb <b>Offl</b>ine <b>E</b>xplorer
</p>
# clean up my temporary layers
$img->remove_layer($all_layers[$numframes]);
$img->remove_layer($all_layers[$numframes+1]);
}
<hr>
register "billboard",
"Billboard",
"Take one image. Spin it about the multiple axes, and end up with another image. I made it for easy web buttons, mostly because somebody suggested to me.",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1.3",
__"<Toolbox>/Xtns/Animation/Billboard",
"*",
[
[PF_DRAWABLE, "source", "What drawable to spin from?"],
[PF_DRAWABLE, "destination","What drawable to spin to?"],
[PF_INT8, "frames", "How many frames to use?", 16],
[PF_COLOR, "background", "What color to use for background if not transparent", [0,0,0]],
[PF_SLIDER, "perspective", "How much perspective effect to get", 40, [0,255,5]],
[PF_TOGGLE, "spin_back", "Also spin back?" , 0],
[PF_TOGGLE, "convert_indexed", "Convert to indexed?", 1],
[PF_SPINNER, "billboard_slats", "Number of shades", 3, [1,50,1]],
],
[],
['gimp-1.1'],
sub {
my($src,$dest,$frames,$color,$psp,$spinback,$indexed, $shadenum) =@_;
$maxwide = ($src->width > $dest->width) ? $src->width : $dest->width;
$maxhigh = ($src->height > $dest->height) ? $src->height: $dest->height;
$img = gimp_image_new($maxwide, $maxhigh, RGB);
<!-- Standard WWWOFFLE Message Page Top Banner -->
<H1 align=center>WWWOFFLE Request Recorded</H1>
$tmpimglayer = $img->add_new_layer(0,3,1);
$img->display_new;
Gimp->progress_init("Billboard...",-1);
$oldbackground = gimp_palette_get_background();
Palette->set_background($color);
$src->edit_copy();
$spinlayer = $tmpimglayer->edit_paste(1);
$spinlayer->floating_sel_to_layer();
<p align=center>
Your request for URL
<br>
<b><tt>http://www.gimp.org/%7Esjburges/billboard</tt></b>
<br>
has been recorded for download.
</p>
$dest->edit_copy();
$destlayer = $tmpimglayer->edit_paste(1);
$destlayer->floating_sel_to_layer();
<!--
$tmpimglayer->remove_layer;
Useful WWWOFFLE Buttons
$spinlayer->resize($maxwide, $maxhigh, $spinlayer->offsets);
$destlayer->resize($maxwide, $maxhigh, $destlayer->offsets);
# work around for PF_SLIDER when < 1
$psp = $psp/255.0;
-->
# need an even number of frames for spinback
if ($frames%2 && $spinback) {
$frames++;
gimp_message("An even number of frames is needed for spin back.\nAdjusted frames up to $frames");
}
<p align=center>
[<a href="http://localhost:8080/control/delete-req/password=G2HohImsZPA9Rmi3igNl5Q?http://www.gimp.org/%7Esjburges/billboard">Cancel</a>|Refresh:<a href="http://localhost:8080/refresh-options/?http://www.gimp.org/%7Esjburges/billboard">Options</a>|<a href="http://localhost:8080/monitor-options/?http://www.gimp.org/%7Esjburges/billboard">Monitor</a>|<a href="http://localhost:8080/index/url/?http://www.gimp.org/%7Esjburges/billboard">Index</a>]
</p>
spin_layer($img, $spinlayer, $destlayer, $spinback ? $frames/2 : $frames-1, $psp, $shadenum);
$img->set_visible($img->add_new_layer(1),($img->get_layers)[0]);
$img->merge_visible_layers(0);
if ($spinback) {
@layerlist = $img->get_layers();
$img->add_layer($layerlist[$frames/2]->copy(0),0);
@layerlist = $img->get_layers();
spin_layer($img, $layerlist[1], $layerlist[0], $frames/2, $psp, $shadenum);
$img->remove_layer(($img->get_layers)[0]);
}
# unhide and name layers
@all_layers = $img->get_layers;
$img->set_visible(@all_layers);
for ($i=1; $i<=$frames ; $i++) {
$all_layers[$i-1]->set_name("Spin Layer $i (50ms)");
}
$all_layers[$frames-1]->set_name("Spin Layer SRC (250ms)");
if ($spinback) {
$all_layers[$frames/2-1]->set_name("Spin Layer DEST (250ms)");
}
else { $all_layers[0]->set_name("Spin Layer DEST (250ms)")}
<!-- Standard WWWOFFLE Message Page Bottom Buttons -->
# indexed conversion wants a display for some reason
if ($indexed) { $img->convert_indexed(1,255); }
<hr>
Palette->set_background($oldbackground);
gimp_displays_flush();
return();
};
<p align=center>
WWWOFFLE - [<a href="http://localhost:8080/Welcome.html">Welcome Page</a>|<a href="http://localhost:8080/FAQ.html">FAQ</a>] - WWWOFFLE
</p>
exit main;
<!-- Standard WWWOFFLE Message Page Bottom Buttons -->
</BODY>
</HTML>

View File

@ -1,5 +1,7 @@
#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if 0; # not running under some shell
# <sjburges@gimp.org> (original release)
#
use Gimp;
@ -27,7 +29,7 @@ the inside and the outside of the burst. \n",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1999-07-31",
__"<Image>/Filters/Misc/Burst",
"<Image>/Filters/Misc/Burst",
"*",
[
[PF_RADIO, "shape", "Shape To Burst Into", 0, [Rectangle => 1, Ellipse=> 0]],

View File

@ -1,41 +1,63 @@
#!/usr/bin/perl
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
# Revision 1.0: Released it
# 1.1: Marc Lehman added undo capability! <pcg@goof.com>
# 1.2: Added my email, and put it in "Noise" where it belongs
# <sjburges@gimp.org>
<!--
Available WWWOFFLE Variables (all with a '$' prefix).
use Gimp;
use Gimp::Fu;
localhost = The hostname of the server running wwwoffled (='localhost:8080').
url = The URL that was asked for (='http://www.gimp.org/%7Esjburges/feedback.pl').
already = A flag to indicate that the page is already cached (='').
password = A one-time password to allow cancellation of the page (='Bw7RTyicLuhCFPIb6HarMg').
register "feedback",
"Take an image and feed it back onto itself multiple times",
"This plug-in simulates video feedback. It makes for kinda a neat desktop if you're into that sort of thing",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"2-15-99",
__"<Image>/Filters/Noise/Feedback",
"RGB, GRAY",
[
[PF_SLIDER, "offset", "the amount the frames will offset", 3, [0, 255, 1]],
[PF_SLIDER, "repeat", "the number of times to repeat the illusion", 3, [0, 100, 1]],
],
sub {
my($img,$drawable,$offset,$repeat)=@_;
-->
eval { $img->undo_push_group_start };
<HEAD>
<TITLE>WWWOFFLE - Will Get http://www.gimp.org/%7Esjburges/feedback.pl</TITLE>
</HEAD>
for (; $repeat>0; $repeat--) {
$drawable = $img->flatten;
$copylayer = $drawable->copy(1);
$img->add_layer($copylayer,0);
$copylayer->scale($img->width - $offset, $img->height - $offset, 0);
}
$img->flatten;
eval { $img->undo_push_group_end };
return();
};
<BODY>
exit main;
<!-- Standard WWWOFFLE Message Page Top Banner -->
<p align=center>
<b>WWWOFFLE</b> - <b>W</b>orld <b>W</b>ide <b>W</b>eb <b>Offl</b>ine <b>E</b>xplorer
</p>
<hr>
<!-- Standard WWWOFFLE Message Page Top Banner -->
<H1 align=center>WWWOFFLE Request Recorded</H1>
<p align=center>
Your request for URL
<br>
<b><tt>http://www.gimp.org/%7Esjburges/feedback.pl</tt></b>
<br>
has been recorded for download.
</p>
<!--
Useful WWWOFFLE Buttons
-->
<p align=center>
[<a href="http://localhost:8080/control/delete-req/password=Bw7RTyicLuhCFPIb6HarMg?http://www.gimp.org/%7Esjburges/feedback.pl">Cancel</a>|Refresh:<a href="http://localhost:8080/refresh-options/?http://www.gimp.org/%7Esjburges/feedback.pl">Options</a>|<a href="http://localhost:8080/monitor-options/?http://www.gimp.org/%7Esjburges/feedback.pl">Monitor</a>|<a href="http://localhost:8080/index/url/?http://www.gimp.org/%7Esjburges/feedback.pl">Index</a>]
</p>
<!-- Standard WWWOFFLE Message Page Bottom Buttons -->
<hr>
<p align=center>
WWWOFFLE - [<a href="http://localhost:8080/Welcome.html">Welcome Page</a>|<a href="http://localhost:8080/FAQ.html">FAQ</a>] - WWWOFFLE
</p>
<!-- Standard WWWOFFLE Message Page Bottom Buttons -->
</BODY>
</HTML>

View File

@ -1,5 +1,7 @@
#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if 0; # not running under some shell
# <sjburges@gimp.org>
# This is adrian and xachs idea - take a rectangluar selection, and select
# font type and string. Then fill it with whatever size is needed.
@ -39,7 +41,7 @@ register "fit_text",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1999-03-21",
__"<Image>/Filters/Render/Fit Text",
"<Image>/Filters/Render/Fit Text",
"*",
[
[PF_FONT, "font", "What font type to use - size will be ignored", $defaultfont],

View File

@ -96,7 +96,7 @@ sub perl_fu_add_glow {
gimp_undo_push_group_start($image);
if (!gimp_drawable_layer($drawable)) {
if (!gimp_drawable_is_layer($drawable)) {
die("add_glow: Only layers can have glow added");
}
@ -167,11 +167,12 @@ sub perl_fu_brushed_metal {
$y1-=$length;
$x2+=$length;
$y2+=$length;
my $width = $x2-$x1;
my $height = $y2-$y1;
my $width = abs($x2-$x1);
my $height = abs($y2-$y1);
my $templ = gimp_layer_new($image, $width, $height, RGBA_IMAGE, "Temp",
100, NORMAL_MODE);
gimp_image_add_layer($image, $templ, 0);
gimp_layer_set_offsets($templ, $x1+$length, $y1+$length);
my $target_select = gimp_selection_save($image);
gimp_selection_none($image);
@ -206,7 +207,7 @@ sub perl_fu_highlight_edges {
gimp_undo_push_group_start($image);
if (!gimp_drawable_layer($drawable)) {
if (!gimp_drawable_is_layer($drawable)) {
gimp_message("highlight_edges: Only layers can be highlighted!");
return;
}

View File

@ -1,5 +1,7 @@
#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if 0; # not running under some shell
#
# 11/7/99 <brendy@swipnet.se>
# Guides are pretty good, but I want to be able to remove them.
@ -17,7 +19,7 @@ register "guide_remove",
"Brendon Humphrey",
"Brendon Humphrey <brendy\@swipnet.se>",
"1999-07-20",
__"<Image>/Guides/Remove Guides",
"<Image>/Guides/Remove Guides",
"*",
[],
[],
@ -31,15 +33,15 @@ register "guide_remove",
$i=$img->find_next_guide(0);
while ($i != 0) {
$img->delete_guide($i);
$i=$img->find_next_guide($i);
$i=$img->find_next_guide(0);
}
#
# Refresh the display (probably not good, works for me!)
#
#$img->selection_all();
#$img->selection_none();
$img->selection_all();
$img->selection_none();
();
return();
};
exit main;

View File

@ -24,7 +24,7 @@ register "guide_grid",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1999-03-20",
__"<Image>/Guides/Guide Grid",
"<Image>/Guides/Guide Grid",
"*",
[
[PF_SPINNER, "x_spacing", "How far to space grid horizontally", 24, [1,1000,1]],

View File

@ -7,14 +7,14 @@
# working btw). You can follow step by step with the website at
# http://tigert.gimp.org/gimp/tutorials/beveled_text/
use Gimp qw(:auto __);
use Gimp;
use Gimp::Fu;
use Gimp::Util;
$defaultcolor1 = [124,10,18];
$defaultcolor2 = [200,19,27];
$path = __"<Toolbox>/Xtns/Render/Logos/Inner Bevel";
$path = "<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";

View File

@ -0,0 +1,29 @@
#!/usr/bin/perl -w
# <sjburges@gimp.org>
use Gimp;
use Gimp::Fu;
use Gimp::Util;
# Gimp::set_trace(TRACE_ALL);
# These are a couple of one-liners that you might find handy. Both should
# be undoable w/o any special magick, and work with any gimp.
register "layer_to_image_size", "Layer2ImageSize", "Expands layer to image size",
"Seth Burgess", "Seth Burgess <sjburges\@gimp.org>", "1.0",
"<Image>/Layers/Layer to Image Size", "RGB*, GRAY*", [ ], sub {
($img, $layer) = @_;
$layer->resize($img->width, $img->height, $layer->offsets);
return();
};
register "center_layer", "Center Layer",
"Centers the current layer on the image",
"Seth Burgess", "Seth Burgess <sjburges\@gimp.org>",
"1.0", "<Image>/Layers/Center Layer", "RGB*, GRAY*", [], sub {
($img, $layer) = @_;
$layer->set_offsets(($img->width - $layer->width )/2,
($img->height - $layer->height)/2);
return();
};
exit main;

View File

@ -28,7 +28,7 @@ sub get_vguides {
$i=0;
my @vguides;
while ($i=$img->find_next_guide($i)) {
if ($img->get_guide_orientation($i) == &Gimp::VERTICAL){
if ($img->get_guide_orientation($i) == &Gimp::VERTICAL_GUIDE){
$keyval = sprintf("%4d", $img->get_guide_position($i));
$vkeys{$keyval} = $i;
}
@ -49,7 +49,7 @@ sub get_hguides {
$i=0;
my @hguides;
while ($i=$img->find_next_guide($i)) {
if ($img->get_guide_orientation($i) == &Gimp::HORIZONTAL){
if ($img->get_guide_orientation($i) == &Gimp::HORIZONTAL_GUIDE){
$keyval = sprintf("%4d", $img->get_guide_position($i));
$hkeys{$keyval} = $i;
}
@ -133,8 +133,8 @@ register "perlotine",
"Add guides to an image. Then run this. It will cut along the guides, and give you the html to reassemble the resulting images.",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1999-09-11",
__"<Image>/Guides/Perl-o-tine",
"1999-03-19",
"<Image>/Guides/Perl-o-tine",
"*",
[
[PF_STRING, "save_path", "The path to export the HTML to",$ENV{HOME}],

View File

@ -1,110 +1,63 @@
#!/usr/bin/perl
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
use Gimp;
use Gimp::Fu;
<!--
# This script requires a Gimp version >= 0.96 (I haven't checked - ymmv)
# small changes by Marc Lehmann <pcg@goof.com>
Available WWWOFFLE Variables (all with a '$' prefix).
# prep4gif.pl
# by Seth Burgess <sjburges@gimp.org>
# June 29, 1998
#
# This perl plug-in prepares a multilayer RGB image for use as a
# transparent gif. To use this prpoerly, you want to have something
# close to the intended background as the bottom layer. If convert
# to indexed is not selected, the bottom two options are unused.
#
# TODO: Write a nicer GUI than Gimp::Fu provides (learn some gtk)
# Anything else that seems useful
localhost = The hostname of the server running wwwoffled (='localhost:8080').
url = The URL that was asked for (='http://www.gimp.org/%7Esjburges/prep4gif.pl').
already = A flag to indicate that the page is already cached (='').
password = A one-time password to allow cancellation of the page (='FgfIgpz3-IuS8wu+dVHeMw').
# Gimp::set_trace(TRACE_ALL);
-->
sub prep {
my ($img, $drawable, $threshold, $growth, $index, $dither, $colors) = @_;
<HEAD>
<TITLE>WWWOFFLE - Will Get http://www.gimp.org/%7Esjburges/prep4gif.pl</TITLE>
</HEAD>
# Duplicate this image, and work on the duplicate for the rest of the
# procedure.
my $out = gimp_channel_ops_duplicate($img);
<BODY>
# @layers is the ordered list, from top to bottom, of all layers in the
# duplicated image. To find length of the list, use $#layers
my @layers = gimp_image_get_layers($out);
<!-- Standard WWWOFFLE Message Page Top Banner -->
# if there's not enough layers, abort.
if ($#layers <= 0) {
gimp_message("You need at least 2 layers to perform prep4gif");
print "Only ", scalar(@layers), " layers found!(", $layers[0],")\n";
return;
}
<p align=center>
<b>WWWOFFLE</b> - <b>W</b>orld <b>W</b>ide <b>W</b>eb <b>Offl</b>ine <b>E</b>xplorer
</p>
# Show the image early - this makes debugging a breeze
my $newdisplay = gimp_display_new($out);
<hr>
# Hide the bottom layer, so it doesn't get into the merge visible later.
<!-- Standard WWWOFFLE Message Page Top Banner -->
my $bottomlayer = $layers[$#layers];
gimp_layer_set_visible($bottomlayer, 0);
gimp_layer_add_alpha($bottomlayer);
<H1 align=center>WWWOFFLE Request Recorded</H1>
# NOTE TO PERL NEWBIES - 'my' variables should be declared in their outermost
# scope - if defined inside the if statement, will disappear to program.
<p align=center>
Your request for URL
<br>
<b><tt>http://www.gimp.org/%7Esjburges/prep4gif.pl</tt></b>
<br>
has been recorded for download.
</p>
my $foreground;
<!--
if ($#layers > 1) {
$foreground = gimp_image_merge_visible_layers($out, 0);
}
else {
$foreground = $layers[0];
};
Useful WWWOFFLE Buttons
my $layer_mask = gimp_layer_create_mask($foreground,2);
gimp_image_add_layer_mask ($out, $foreground, $layer_mask);
gimp_threshold($layer_mask,$threshold,255);
-->
# Transfer layer mask to selection, and grow the selection
gimp_selection_layer_alpha($foreground);
gimp_selection_grow($out,$growth);
<p align=center>
[<a href="http://localhost:8080/control/delete-req/password=FgfIgpz3-IuS8wu+dVHeMw?http://www.gimp.org/%7Esjburges/prep4gif.pl">Cancel</a>|Refresh:<a href="http://localhost:8080/refresh-options/?http://www.gimp.org/%7Esjburges/prep4gif.pl">Options</a>|<a href="http://localhost:8080/monitor-options/?http://www.gimp.org/%7Esjburges/prep4gif.pl">Monitor</a>|<a href="http://localhost:8080/index/url/?http://www.gimp.org/%7Esjburges/prep4gif.pl">Index</a>]
</p>
# Apply this selection to the background
gimp_layer_set_visible($bottomlayer, 1);
gimp_image_set_active_layer($out, $bottomlayer);
gimp_selection_invert($out);
gimp_edit_cut($bottomlayer);
<!-- Standard WWWOFFLE Message Page Bottom Buttons -->
# Clean up after yourself
gimp_image_remove_layer_mask($out, $foreground, 1);
my $outlayer = gimp_image_merge_visible_layers($out,0);
<hr>
# Convert to indexed
if ($index) {
gimp_convert_indexed($out,$dither,$colors);
}
<p align=center>
WWWOFFLE - [<a href="http://localhost:8080/Welcome.html">Welcome Page</a>|<a href="http://localhost:8080/FAQ.html">FAQ</a>] - WWWOFFLE
</p>
# Show all the changes.
gimp_displays_flush();
<!-- Standard WWWOFFLE Message Page Bottom Buttons -->
();
}
register
"prep4gif",
"Prep for gif",
"Make the image a small-cut-out of the intended background, so your transparent text doesn't look blocky.",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"2-15-98",
__"<Image>/Filters/Misc/Prepare for GIF",
"RGB*",
[
[PF_INT32, "lower_threshold", "Lower Alpha Threshold", 64],
[PF_INT32, "growth", "How Much growth for safety ",1],
[PF_TOGGLE, "convert_to_indexed", "Convert Image to indexed", 0],
[PF_TOGGLE, "dither", "Floyd-Steinberg Dithering?", 1],
[PF_INT32, "colors", "Colors to quantize to", "255"],
],
\&prep;
exit main;
</BODY>
</HTML>

View File

@ -19,8 +19,8 @@ register "random_blends",
"A random approach to art. Just try it. It might be good.",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1999-03-18a",
__"<Image>/Filters/Render/Random Blends",
"1999-03-18",
"<Image>/Filters/Render/Random Blends",
"RGB*, GRAY*",
[
[PF_SPINNER, "number", "How many gradients to apply", 7, [1,255,1]],
@ -31,13 +31,13 @@ register "random_blends",
my($img,$layer,$numgradients) =@_;
eval { $img->undo_push_group_start }; # undo is broked for this one.
# add this to the get_state (after its working?)
$oldgradient = Gimp->gradients_get_active();
$oldgradient = gimp_gradients_get_active();
($sel,$x1,$y1,$x2,$y2) = $img->gimp_selection_bounds;
srand();
@gradientlist = Gimp->gradients_get_list();
@gradientlist = gimp_gradients_get_list();
for ($i=0; $i<=$numgradients; $i++) {
Gimp->gradients_set_active(@gradientlist[randint($#gradientlist)]);
gimp_gradients_set_active(@gradientlist[randint($#gradientlist)]);
$layer->gimp_blend(CUSTOM,
6, # DIFFERENCE
# I'd really like to alternate how many arguments in gradient type depending
@ -54,7 +54,7 @@ register "random_blends",
);
}
eval { $img->undo_push_group_end };
Gimp->gradients_set_active($oldgradient);
gimp_gradients_set_active($oldgradient);
return();
};
exit main;

View File

@ -15,7 +15,7 @@ register "round_rect_sel",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1999-03-25",
__"<Image>/Select/Round Rectangular Selection",
"<Image>/Select/Round Rectangular Selection",
"*",
[
[PF_SPINNER, "x_rounding", "How much to round in the horizontal, in pixels", 16, [1,1000,1]],

View File

@ -82,7 +82,7 @@ register "seth_spin",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1.3",
__"<Toolbox>/Xtns/Animation/Seth Spin",
"<Toolbox>/Xtns/Animation/Seth Spin",
"*",
[
[PF_DRAWABLE, "source", "What drawable to spin from?"],

View File

@ -26,7 +26,7 @@
#[terral] input levels of 0, .24, 113 [22:11]
#[terral] --end of script [22:12]
use Gimp qw(:auto __);
use Gimp 1.06;
use Gimp::Fu;
use Gimp::Util;
@ -40,7 +40,7 @@ register
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1999-03-15",
__"<Image>/Filters/Render/Terral Text",
"<Image>/Filters/Render/Terral Text",
"RGB*,GRAY*",
[
[ PF_RADIO, "solid_noise", "The Texture Type", 0, ["solid noise" => 1, "current picture" => 0]],

View File

@ -1,65 +1,63 @@
#!/usr/bin/perl
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
# sent to me by Seth Burgess <sjburges@gimp.org>
# small changes my Marc Lehmann <pcg@goof.com>
<!--
use Gimp qw(:auto __);
use Gimp::Fu;
Available WWWOFFLE Variables (all with a '$' prefix).
#Gimp::set_trace(TRACE_CALL);
localhost = The hostname of the server running wwwoffled (='localhost:8080').
url = The URL that was asked for (='http://www.gimp.org/%7Esjburges/windify.pl').
already = A flag to indicate that the page is already cached (='').
password = A one-time password to allow cancellation of the page (='6L9yq7nTjK35y2i8H3peGw').
sub windify {
my ($img, $drawable, $angle, $density, $distance, $wrap) = @_;
my $oldbg = gimp_palette_get_background();
my $xsize = gimp_drawable_width($drawable);
my $ysize = gimp_drawable_height($drawable);
-->
my $out = gimp_image_new($xsize,$ysize,0);
gimp_palette_set_background([128,128,128]);
my $windlayer = gimp_layer_new($out,$xsize,$ysize,RGB_IMAGE,"Windlayer",100,NORMAL_MODE);
gimp_drawable_fill($windlayer, 0);
gimp_image_add_layer($out,$windlayer,0);
my $windlayercopy = gimp_layer_copy($windlayer, 1);
gimp_image_add_layer($out,$windlayercopy,0);
plug_in_noisify($windlayercopy,0,$density/255,
$density/255,
$density/255,1);
<HEAD>
<TITLE>WWWOFFLE - Will Get http://www.gimp.org/%7Esjburges/windify.pl</TITLE>
</HEAD>
plug_in_mblur($windlayercopy,0,15,$angle);
gimp_layer_set_mode($windlayercopy, 10); # Lighten Only
gimp_image_merge_visible_layers($out,0);
<BODY>
# many thanks to Dov for this suggestion as a workaround to the
# gimp_image_merge_visible_layers bug
<!-- Standard WWWOFFLE Message Page Top Banner -->
my $newlay = gimp_image_get_active_layer ($out);
plug_in_displace($drawable,-$distance*cos($angle*180/3.14159),
$distance*sin($angle*180/3.14159),
1,1, $newlay,$newlay, $wrap);
gimp_image_remove_layer($out,$newlay);
gimp_image_delete ($out);
gimp_palette_set_background($oldbg);
gimp_displays_flush();
<p align=center>
<b>WWWOFFLE</b> - <b>W</b>orld <b>W</b>ide <b>W</b>eb <b>Offl</b>ine <b>E</b>xplorer
</p>
undef;
}
<hr>
register
"windify",
"Add wind to an image",
"Blow your image all over :)",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1998-09-14",
__"<Image>/Filters/Distorts/Windify",
"*",
[
[PF_INT32, "angle", "Wind Angle, 0 is left", 120],
[PF_INT32, "density", "How Much Is Blown",80],
[PF_VALUE, "distance", "How Far Its Blown",30],
[PF_TOGGLE, "smear", "Smear on Edges (or Wrap)",0]
],
\&windify;
<!-- Standard WWWOFFLE Message Page Top Banner -->
exit main;
<H1 align=center>WWWOFFLE Request Recorded</H1>
<p align=center>
Your request for URL
<br>
<b><tt>http://www.gimp.org/%7Esjburges/windify.pl</tt></b>
<br>
has been recorded for download.
</p>
<!--
Useful WWWOFFLE Buttons
-->
<p align=center>
[<a href="http://localhost:8080/control/delete-req/password=6L9yq7nTjK35y2i8H3peGw?http://www.gimp.org/%7Esjburges/windify.pl">Cancel</a>|Refresh:<a href="http://localhost:8080/refresh-options/?http://www.gimp.org/%7Esjburges/windify.pl">Options</a>|<a href="http://localhost:8080/monitor-options/?http://www.gimp.org/%7Esjburges/windify.pl">Monitor</a>|<a href="http://localhost:8080/index/url/?http://www.gimp.org/%7Esjburges/windify.pl">Index</a>]
</p>
<!-- Standard WWWOFFLE Message Page Bottom Buttons -->
<hr>
<p align=center>
WWWOFFLE - [<a href="http://localhost:8080/Welcome.html">Welcome Page</a>|<a href="http://localhost:8080/FAQ.html">FAQ</a>] - WWWOFFLE
</p>
<!-- Standard WWWOFFLE Message Page Bottom Buttons -->
</BODY>
</HTML>

View File

@ -29,7 +29,7 @@
# in a directory more suitable than the lame "Misc"
# Here's the boring start of every script...
use Gimp qw(:auto __);
use Gimp;
use Gimp::Fu;
register "xach_blocks",
@ -39,7 +39,7 @@ register "xach_blocks",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"2-15-98",
__"<Image>/Filters/Map/Xach Blocks",
"<Image>/Filters/Map/Xach Blocks",
"*",
[
[PF_SLIDER, "block_size", "The size of the blocks...", 10, [0, 255, 1]],

View File

@ -22,7 +22,7 @@
#
# Here's the boring start of every script...
use Gimp qw(:auto __);
use Gimp;
use Gimp::Fu;
register "xach_shadows",
@ -31,7 +31,7 @@ register "xach_shadows",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"2-15-98",
__"<Image>/Filters/Map/Xach Shadows",
"<Image>/Filters/Map/Xach Shadows",
"RGB*, GRAY*",
[
[PF_SLIDER, "block_size", "The size of the blocks...", 10, [0, 255, 1]],

View File

@ -12,7 +12,7 @@ register "xachvision",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1999-02-28",
__"<Image>/Filters/Noise/Xach Vision",
"<Image>/Filters/Noise/Xach Vision",
"RGB*, GRAY*",
[
[PF_COLOR, "color", "What Color to see the world in", [0, 255, 0]],

View File

@ -263,13 +263,11 @@ msgstr "Server beendet sich..."
msgid "trying to start gimp with options \"$opt\"\n"
msgstr "Ich versuche, gimp mit den Schaltern \"$opt\" zu starten\n"
#, fuzzy
msgid "<Toolbox>/Xtns/Animation/Seth Spin"
msgstr "<Toolbox>/Xtn/"
msgstr "<Toolbox>/Xtn/Animation/Seth's Dreher"
#, fuzzy
msgid "<Image>/Filters/Noise/Ditherize"
msgstr "<Image>/Filter/"
msgstr "<Image>/Filter/Noise/Rastern"
msgid "expected perl-server at other end of socket, got @r\n"
msgstr ""
@ -280,9 +278,8 @@ msgstr "zu viele"
msgid "pdl height != region height"
msgstr "pdl Höhe != Höhe der Region"
#, fuzzy
msgid "<Image>/Filters/Render/Add Glow"
msgstr "<Image>/Filter/"
msgstr "<Image>/Filter/Render/Add Glow"
msgid "received QUIT request"
msgstr "QUIT-Anfrage erhalten"
@ -604,9 +601,8 @@ msgstr "Dateiauswahl for $name"
msgid "accepting connections on port $port"
msgstr "Akzeptiere Verbindungen auf port $port"
#, fuzzy
msgid "<Image>/Filters/Misc/Border Average"
msgstr "<Image>/Filter/"
msgstr "<Image>/Filter/Verschiedenes/Rahmenfarbe"
msgid "Internal error: Gimp::Net #100, please report!"
msgstr ""
@ -626,20 +622,17 @@ msgid "menupath _must_ start with <Image>, <Toolbox>, <Load>, <Save> or <None>!"
msgstr ""
"Menüpfad _muß_ mit <Image>, <Toolbox>, <Load>, <Save> oder <None> anfangen!"
#, fuzzy
msgid "<Image>/Filters/Render/Terral Text"
msgstr "<Image>/Filter/"
msgstr "<Image>/Filter/Render/Terraltext"
msgid "illegal parasite specification, arrayref expected"
msgstr ""
#, fuzzy
msgid "<Image>/Filters/Misc/Burst"
msgstr "<Image>/Filter/"
msgstr "<Image>/Filter/Verschiedenes/Ausbruch"
#, fuzzy
msgid "<Toolbox>/Xtns/Render/Povray/Texture"
msgstr "<Toolbox>/Xtn/Perl/Server"
msgstr "<Toolbox>/Xtn/Render/Povray/Textur"
msgid "unable to fork: $!"
msgstr "Konnte nicht forken: $!"