Gimp/plug-ins/perl/examples/example-net.pl

33 lines
662 B
Perl
Raw Normal View History

1999-02-19 03:56:13 -08:00
#!/usr/bin/perl
1998-10-23 06:34:08 -07:00
# example for the gimp-perl-server (also called Net-Server)
use Gimp;
1999-12-01 20:55:44 -08:00
Gimp::on_lib {
1999-02-07 12:34:25 -08:00
print STDERR "$0: this script is not intended to be run from within the gimp!\n";
1999-12-01 20:55:44 -08:00
};
1999-02-07 12:34:25 -08:00
1999-12-01 20:55:44 -08:00
Gimp::on_net {
1998-10-23 06:34:08 -07:00
# simple benchmark ;)
1999-05-03 12:29:05 -07:00
1998-10-23 06:34:08 -07:00
$img=new Gimp::Image(600,300,RGB);
# the is the same as $img = new Image(600,300,RGB)
1999-05-03 12:29:05 -07:00
1998-10-23 06:34:08 -07:00
$bg=$img->layer_new(30,20,RGB_IMAGE,"Background",100,NORMAL_MODE);
1999-05-03 12:29:05 -07:00
1998-11-13 12:07:45 -08:00
$bg->add_layer(1);
1999-05-03 12:29:05 -07:00
1998-10-23 06:34:08 -07:00
new Gimp::Display($img);
1999-05-03 12:29:05 -07:00
1998-10-23 06:34:08 -07:00
for $i (0..255) {
Palette->set_background([$i,255-$i,$i]);
1998-11-13 12:07:45 -08:00
$bg->edit_fill;
1998-10-23 06:34:08 -07:00
Display->displays_flush ();
}
# Gimp::Net::server_quit; # kill the gimp-perl-server-extension (ugly name)
1999-12-01 20:55:44 -08:00
};
1998-10-23 06:34:08 -07:00
1999-02-22 13:51:18 -08:00
exit main;
1998-10-23 06:34:08 -07:00