mirror of https://github.com/GNOME/gimp.git
33 lines
676 B
Perl
Executable File
33 lines
676 B
Perl
Executable File
#!/usr/bin/perl
|
|
|
|
# example for the gimp-perl-server (also called Net-Server)
|
|
|
|
use Gimp;
|
|
|
|
Gimp::on_lib {
|
|
print STDERR "$0: this script is not intended to be run from within the gimp!\n";
|
|
};
|
|
|
|
Gimp::on_net {
|
|
# simple benchmark ;)
|
|
|
|
$img=new Gimp::Image(600,300,RGB);
|
|
# the is the same as $img = new Image(600,300,RGB)
|
|
|
|
$bg=$img->layer_new(30,20,RGB_IMAGE,"Background",100,NORMAL_MODE);
|
|
|
|
$bg->add_layer(1);
|
|
|
|
new Gimp::Display($img);
|
|
|
|
for $i (0..255) {
|
|
Palette->set_background([$i,255-$i,$i]);
|
|
$bg->edit_fill(BG_IMAGE_FILL);
|
|
Display->displays_flush();
|
|
}
|
|
# Gimp::Net::server_quit; # kill the gimp-perl-server-extension (ugly name)
|
|
};
|
|
|
|
exit main;
|
|
|