Utility and miscellaneous convenience functions.
These functions provide miscellaneous utilities for manipulating pixbufs. The pixel data in pixbufs may of course be manipulated directly by applications, but several common operations can be performed by these functions instead.
unsigned-char) ⇒ (ret
Takes an existing pixbuf and adds an alpha channel to it. If the existing pixbuf already had an alpha channel, the channel values are copied from the original; otherwise, the alpha channel is initialized to 255 (full opacity).
If substitute-color is ‘
#t’, then the color specified by (r, g, b) will be assigned zero opacity. That is, if you pass (255, 255, 255) for the substitute color, all white pixels will become fully transparent.
- Whether to set a color to zero opacity. If this is ‘
#f’, then the (r, g, b) arguments will be ignored.
- Red value to substitute.
- Green value to substitute.
- Blue value to substitute.
- A newly-created pixbuf with a reference count of 1.
Copies a rectangular area from src-pixbuf to dest-pixbuf. Conversion of pixbuf formats is done automatically.
- Source pixbuf.
- Source X coordinate within src-pixbuf.
- Source Y coordinate within src-pixbuf.
- Width of the area to copy.
- Height of the area to copy.
- Destination pixbuf.
- X coordinate within dest-pixbuf.
- Y coordinate within dest-pixbuf.
Modifies saturation and optionally pixelates src, placing the result in dest. src and dest may be the same pixbuf with no ill effects. If saturation is 1.0 then saturation is not changed. If it's less than 1.0, saturation is reduced (the image turns toward grayscale); if greater than 1.0, saturation is increased (the image gets more vivid colors). If pixelate is ‘
#t’, then pixels are faded in a checkerboard pattern to create a pixelated image. src and dest must have the same image format, size, and rowstride.
- source image
- place to write modified version of src
- saturation factor
- whether to pixelate
Clears a pixbuf to the given RGBA value, converting the RGBA value into the pixbuf's pixel format. The alpha will be ignored if the pixbuf doesn't have an alpha channel.
- RGBA pixel to clear to (0xffffffff is opaque white, 0x00000000 transparent black)