| Extracted from Pike v7.8 release 700 at 2013-06-08.

[Top]
Image
Image.Layer

# Method Image.Layer()->create()

Method create

  `void Image.Layer(object image, object alpha, string mode)`
  `void Image.Layer(mapping info)`
  `void Image.Layer()`
  `void Image.Layer(int xsize, int ysize, object color)`
  `void Image.Layer(object color)`

Description

  The Layer construct either three arguments, the image object, alpha channel and mode, or a mapping with optional elements:

      "image":image,
              // default: black

      "alpha":alpha,
              // alpha channel object
              // default: full opaque

      "mode":string mode,
              // layer mode, see mode .
              // default: "normal"

      "alpha_value":float(0.0-1.0),
              // layer general alpha value
              // default is 1.0; this is multiplied
              // with the alpha channel.

      "xoffset":int,
      "yoffset":int,
              // offset of this layer

      "fill":Color,
      "fill_alpha":Color,
              // fill color, ie what color is used
              // "outside" the image. default: black
              // and black (full transparency).

      "tiled":int(0|1),
              // select tiling; if 1, the image
              // will be tiled. deafult: 0, off

  The layer can also be created "empty", either giving a size and color - this will give a filled opaque square, or a color, which will set the "fill" values and fill the whole layer with an opaque color.

  All values can be modified after object creation.

Note

  image and alpha channel must be of the same size.