See also: Main Index; Alphabetic; Misc; By Author; By Module; By Menu External Links: The Gimp; Gimp User Manual
The Gimp drawable functions
gimp_drawable_bytes
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| INT32 | bytes | Bytes per pixel |
This procedure returns the number of bytes per pixel (or the number of channels) for the specified drawable.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_fill
Input:
| DRAWABLE | drawable | The drawable |
| INT32 | fill_type | The type of fill: FG_IMAGE_FILL (0), BG_IMAGE_FILL (1), WHITE_IMAGE_FILL (2), TRANS_IMAGE_FILL (3), NO_IMAGE_FILL (4) |
Returns: nothing
This procedure fills the drawable with the fill mode. If the fill mode is foreground the current foreground color is used. If the fill mode is background, the current background color is used. If the fill type is white, then white is used. Transparent fill only affects layers with an alpha channel, in which case the alpha channel is set to transparent. If the drawable has no alpha channel, it is filled to white. No fill leaves the drawable's contents undefined. This procedure is unlike the bucket fill tool because it fills regardless of a selection
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_get_pixel
Input:
| DRAWABLE | drawable | The drawable |
| INT32 | x_coord | The x coordinate |
| INT32 | y_coord | The y coordinate |
Returns:
| INT32 | num_channels | The number of channels for the pixel |
| INT8ARRAY | pixel | The pixel value |
This procedure gets the pixel value at the specified coordinates. The 'num_channels' argument must always be equal to the bytes-per-pixel value for the specified drawable.
Spencer Kimball & Peter Mattis; 1997
gimp_drawable_has_alpha
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| INT32 | has_alpha | Does the drawable have an alpha channel? |
This procedure returns whether the specified drawable has an alpha channel. This can only be true for layers, and the associated type will be one of: { RGBA , GRAYA, INDEXEDA }.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_height
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| INT32 | height | Height of drawable |
This procedure returns the specified drawable's height in pixels.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_image
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| IMAGE | image | The drawable's image |
This procedure returns the drawable's image.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_is_channel
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| INT32 | channel | Non-zero if the drawable is a channel |
This procedure returns non-zero if the specified drawable is a channel.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_is_gray
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| INT32 | gray | non-zero if the drawable is a grayscale type |
This procedure returns non-zero if the specified drawable is of type { Gray, GrayA }.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_is_indexed
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| INT32 | indexed | non-zero if the drawable is an indexed type |
This procedure returns non-zero if the specified drawable is of type { Indexed, IndexedA }.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_is_layer
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| INT32 | layer | Non-zero if the drawable is a layer |
This procedure returns non-zero if the specified drawable is a layer.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_is_layer_mask
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| INT32 | layer_mask | Non-zero if the drawable is a layer mask |
This procedure returns non-zero if the specified drawable is a layer mask.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_is_rgb
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| INT32 | color | non-zero if the drawable is an RGB type |
This procedure returns non-zero if the specified drawable is of type { RGB, RGBA }.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_mask_bounds
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| INT32 | non_empty | TRUE if there is a selection |
| INT32 | x1 | x coordinate of the upper left corner of selection bounds |
| INT32 | y1 | y coordinate of the upper left corner of selection bounds |
| INT32 | x2 | x coordinate of the lower right corner of selection bounds |
| INT32 | y2 | y coordinate of the lower right corner of selection bounds |
This procedure returns the whether there is a selection. If there is one, the upper left and lower righthand corners of its bounding box are returned. These coordinates are specified relative to the drawable's origin, and bounded by the drawable's extents.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_merge_shadow
Input:
| DRAWABLE | drawable | The drawable |
| INT32 | undo | Push merge to undo stack? |
Returns: nothing
This procedure combines the contents of the image's shadow buffer (for temporary processing) with the specified drawable. The "undo" parameter specifies whether to add an undo step for the operation. Requesting no undo is useful for such applications as 'auto-apply'.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_offsets
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| INT32 | offset_x | x offset of drawable |
| INT32 | offset_y | y offset of drawable |
This procedure returns the specified drawable's offsets. This only makes sense if the drawable is a layer since channels are anchored. The offsets of a channel will be returned as 0.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_set_image
Input:
| DRAWABLE | drawable | The drawable |
| IMAGE | image | The image |
Returns: nothing
Set the image the drawable should be a part of (Use this before adding a drawable to another image).
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_set_pixel
Input:
| DRAWABLE | drawable | The drawable |
| INT32 | x_coord | The x coordinate |
| INT32 | y_coord | The y coordinate |
| INT32 | num_channels | The number of channels for the pixel |
| INT8ARRAY | pixel | The pixel value |
Returns: nothing
This procedure sets the pixel value at the specified coordinates. The 'num_channels' argument must always be equal to the bytes-per-pixel value for the spec ified drawable.
Spencer Kimball & Peter Mattis; 1997
gimp_drawable_thumbnail
Input:
| DRAWABLE | drawable | The drawable |
| INT32 | width | The thumbnail width |
| INT32 | height | The thumbnail height |
Returns:
| INT32 | width | The previews width |
| INT32 | height | The previews height |
| INT32 | bpp | The previews bpp |
| INT32 | thumbnail_data_count | The number of pixels in thumbnail data |
| INT8ARRAY | thumbnail_data | The thumbnail data |
This function gets data from which a thumbnail of a drawable preview can be created. Maximum x or y dimension is 128 pixels. The pixels are returned in the RGB[A] format. The bpp return value gives the number of bytes in the image. The alpha channel also returned if the drawable has one.
Andy Thomas; 1999
gimp_drawable_type
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| INT32 | type | The drawable's type: { RGB_IMAGE (0), RGBA_IMAGE (1), GRAY_IMAGE (2), GRAYA_IMAGE (3), INDEXED_IMAGE (4), INDEXEDA_IMAGE (5) } |
This procedure returns the drawable's type.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_type_with_alpha
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| INT32 | type_with_alpha | The drawable's type with alpha: { RGBA_IMAGE (1), GRAYA_IMAGE (3), INDEXEDA_IMAGE (5) } |
This procedure returns the drawable's type if an alpha channel were added. If the type is currently Gray, for instance, the returned type would be GrayA. If the drawable already has an alpha channel, the drawable's type is simply returned.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_update
Input:
| DRAWABLE | drawable | The drawable |
| INT32 | x | x coordinate of upper left corner of update region |
| INT32 | y | y coordinate of upper left corner of update region |
| INT32 | width | Width of update region |
| INT32 | height | Height of update region |
Returns: nothing
This procedure updates the specified region of the drawable. The (x, y) coordinate pair is relative to the drawable's origin, not to the image origin. Therefore, the entire drawable can be updated with: {x->0, y->0, w->width, h->height }.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_drawable_width
Input:
| DRAWABLE | drawable | The drawable |
Returns:
| INT32 | width | Width of drawable |
This procedure returns the specified drawable's width in pixels.
Spencer Kimball & Peter Mattis; 1995-1996
gimp_image_active_drawable
Input:
Returns:
| DRAWABLE | drawable | The active drawable |
This procedure returns the ID of the image's active drawable. This can be either a layer, a channel, or a layer mask. The active drawable is specified by the active image channel. If that is -1, then by the active image layer. If the active image layer has a layer mask and the layer mask is in edit mode, then the layer mask is the active drawable.
Spencer Kimball & Peter Mattis; 1995-1996
plug_in_drawable_compose
Input:
| INT32 | run_mode | Interactive, non-interactive |
| IMAGE | image1 | First input image (not used) |
| DRAWABLE | drawable1 | First input drawable |
| DRAWABLE | drawable2 | Second input drawable |
| DRAWABLE | drawable3 | Third input drawable |
| DRAWABLE | drawable4 | Fourth input drawable |
| STRING | compose_type | What to compose: RGB, RGBA, HSV, CMY, CMYK |
Returns:
| IMAGE | new_image | Output image |
This function creates a new image from multiple drawables of gray images
Peter Kirchgessner (peter@kirchgessner.net); 1998