man Gimp::Util () - some handy routines for Gimp-Perl users

NAME

 Gimp::Util - some handy routines for Gimp-Perl users

SYNOPSIS

 use Gimp;
 use Gimp::Util;

DESCRIPTION

Gimp-Perl is nice, but when you have to write everytime 10 lines just to get some simple functions done, it very quickly becomes tedious :-/

This module tries to define some functions that aim to automate frequently used tasks, i.e. its a sort of catch-all-bag for (possibly) useful macro functions. If you want to add a function just mail the author of the Gimp-Perl extension (see below).

In Gimp-Perl (but not in Gimp as seen by the enduser) it is possible to have layers that are NOT attached to an image. This is, IMHO a bad idea, you end up with them and the user cannot see them or delete them. So we always attach our created layers to an image here, too avoid memory leaks and debugging times.

These functions try to preserve the current settings like colors, but not all do.

These functions can also be handled in exactly the same way as PDB-Functions, i.e. the (hypothetical) function CWgimp_image_xyzzy can be called as CW$image->xyzzy, if the module is available.

The need to explicitly CWuse Gimp::Util will go away in the future.

FUNCTIONS

CWget_state returns a scalar representing most of gimps global state (at the moment foreground colour, background colour, active gradient, pattern and brush). The state can later be restored by a call to CWset_state. This is ideal for library functions such as the ones used here, at least when it includes more state in the future. create a colored layer, insert into image and return layer Create a colored text, draw over a background, add to img, ret img. Create an image, add colored text layer on a background layer, return img. Take a layer and add it as a mask to another layer, return mask. returns the width and height of the $text of the given font (XLFD format) returns the corresponding layer type for an image, alpha controls wether the layer type is with alpha or not. Example: imagetype: RGB -> RGB_IMAGE (or RGBA_IMAGE). returns the corresponding layer type for an image, alpha controls wether the layer type is with alpha or not. Example: imagetype: RGB -> RGB_IMAGE (or RGBA_IMAGE). creates a new layer and adds it at position CW$index (default 0) to the image, after filling it with gimp_drawable_fill CW$fill_type (default BG_IMAGE_FILL). If CW$alpha is non-zero (default 1), the new layer has alpha. mark the given layers visible (invisible) and all others invisible (visible). return the position the layer has in the image layer stack. moves the layer to a new position in the layer stack.

AUTHOR

Various, version 1.000 written mainly by Tels (http://bloodgate.com/). The author of the Gimp-Perl extension (contact him to include new functions) is Marc Lehmann <pcg@goof.com>