Commit c8df9fce authored by Marc Lehmann's avatar Marc Lehmann

see plug-ins/perl/Changes

parent dd6f3d8d
Revision history for Gimp-Perl extension.
- updated burst <sjburges@gimp.org>
1.20
- image types updated to reflect gimp's reality.
- updated perlotine.
......@@ -29,6 +28,8 @@ Revision history for Gimp-Perl extension.
target.
- do not install scripts depending on Gtk.
- do not register menus when Gtk is needed for dialogs.
- updated examples/burst.
- fixed various old-syntax leftovers in Gimp::Util.
1.19 Thu Jan 6 00:21:58 CET 2000
- used N_ to mark all the menu paths, since gimp now tries to
......
......@@ -101,14 +101,14 @@ sub layer_create {
my $tcol; # scratch color
# create a colored layer
$layer = gimp_layer_new ($image,gimp_image_width($image),
gimp_image_height($image),
$layer = Gimp->layer_new ($image,Gimp->image_width($image),
Gimp->image_height($image),
RGB_IMAGE,$name,100,NORMAL_MODE);
$tcol = gimp_palette_get_background ();
gimp_palette_set_background ($color);
gimp_drawable_fill ($layer,BG_IMAGE_FILL);
gimp_image_add_layer($image, $layer, $pos);
gimp_palette_set_background ($tcol); # reset
$tcol = Gimp->palette_get_background ();
Gimp->palette_set_background ($color);
Gimp->drawable_fill ($layer,BG_IMAGE_FILL);
Gimp->image_add_layer($image, $layer, $pos);
Gimp->palette_set_background ($tcol); # reset
$layer;
}
......@@ -131,20 +131,20 @@ sub text_draw {
warn __"no font specified, using default" if $font eq "";
$font = "Helvetica" if ($font eq "");
$tcol = gimp_palette_get_foreground ();
gimp_palette_set_foreground ($fgcolor);
$tcol = Gimp->palette_get_foreground ();
Gimp->palette_set_foreground ($fgcolor);
# Create a layer for the text.
$text_layer = gimp_text($image,-1,0,0,$text,10,1,$size,
$text_layer = Gimp->text($image,-1,0,0,$text,10,1,$size,
PIXELS,"*",$font,"*","*","*","*");
# Do the fun stuff with the text.
gimp_layer_set_preserve_trans($text_layer, FALSE);
Gimp->layer_set_preserve_trans($text_layer, FALSE);
if ($resize == 0)
{
# Now figure out the size of $image
$width = gimp_image_width($text_layer);
$height = gimp_image_height($text_layer);
$width = Gimp->image_width($text_layer);
$height = Gimp->image_height($text_layer);
# and cut text layer
}
else
......@@ -152,11 +152,11 @@ sub text_draw {
}
# add text to image
gimp_image_add_layer($image, $text_layer, $pos);
Gimp->image_add_layer($image, $text_layer, $pos);
# merge white and text
gimp_image_merge_visible_layers ($image,1);
Gimp->image_merge_visible_layers ($image,1);
# cleanup the left over layer (!)
gimp_layer_delete($text_layer);
Gimp->layer_delete($text_layer);
$layer;
}
......@@ -182,24 +182,24 @@ sub image_create_text {
$font = "Helvetica" if ($font eq "");
# create an image. We'll just set whatever size here because we want
# to resize the image when we figure out how big the text is.
$image = gimp_image_new(64,64,RGB); # don't waste too much resources ;-/
$image = Gimp->image_new(64,64,RGB); # don't waste too much resources ;-/
$tcol = gimp_palette_get_foreground ();
gimp_palette_set_foreground ($fgcolor);
$tcol = Gimp->palette_get_foreground ();
Gimp->palette_set_foreground ($fgcolor);
# Create a layer for the text.
$text_layer = gimp_text($image,-1,0,0,$text,10,1,$size,
$text_layer = Gimp->text($image,-1,0,0,$text,10,1,$size,
PIXELS,"*",$font,"*","*","*","*");
gimp_palette_set_foreground ($tcol);
Gimp->palette_set_foreground ($tcol);
gimp_layer_set_preserve_trans($text_layer, FALSE);
Gimp->layer_set_preserve_trans($text_layer, FALSE);
# Resize the image based on size of text.
gimp_image_resize($image,gimp_drawable_width($text_layer),
gimp_drawable_height($text_layer),0,0);
Gimp->image_resize($image,Gimp->drawable_width($text_layer),
Gimp->drawable_height($text_layer),0,0);
# create background and merge them
$bg_layer = layer_create ($image,"text",$bgcolor,1);
gimp_image_merge_visible_layers ($image,1);
$bg_layer = Gimp->layer_create ($image,"text",$bgcolor,1);
Gimp->image_merge_visible_layers ($image,1);
# return
$image;
......@@ -219,22 +219,16 @@ sub layer_add_layer_as_mask {
my ($image,$layer,$layer_mask) = @_;
my $mask;
gimp_selection_all ($image);
Gimp->selection_all ($image);
$layer_mask->edit_copy ();
gimp_layer_add_alpha ($layer);
$mask = gimp_layer_create_mask ($layer,0);
Gimp->layer_add_alpha ($layer);
$mask = Gimp->layer_create_mask ($layer,0);
$mask->edit_paste (0);
gimp_floating_sel_anchor(gimp_image_floating_selection($image));
gimp_image_add_layer_mask ($image,$layer,$mask);
Gimp->floating_sel_anchor(Gimp->image_floating_selection($image));
Gimp->image_add_layer_mask ($image,$layer,$mask);
$mask;
}
# EOF, needed for package?
# Sure, consider a package just another kind of function, and
# require/use etc. check for a true return value
1;
##############################################################################
# all functions below are by Marc Lehmann
=pod
......
......@@ -2,7 +2,7 @@
# <sjburges@gimp.org>
#
use Gimp qw(:auto N_ __);
use Gimp;
use Gimp::Fu;
use Gimp::Util;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment