Extracted from Pike v7.6 release 61 at 2005-12-30.
pike.ida.liu.se
[Top]
Image
Image.Image

Method Image.Image()->create()


Method create

void Image.Image()
void Image.Image(int xsize, int ysize)
void Image.Image(int xsize, int ysize, Color color)
void Image.Image(int xsize, int ysize, int r, int g, int b)
void Image.Image(int xsize, int ysize, int r, int g, int b, int alpha)
void Image.Image(int xsize, int ysize, string method, method ...)

Description

Initializes a new image object.

Image.Image
(XSIZE,YSIZE)
Image.Image
(XSIZE,YSIZE,255,128,0)

The image can also be calculated from some special methods, for convinience:

channel modes; followed by a number of 1-char-per-pixel strings
or image objects (where red channel will be used),
or an integer value:
  "grey" : make a grey image (needs 1 source: grey)
  "rgb"  : make an rgb image (needs 3 sources: red, green and blue)
  "cmyk" : make a rgb image from cmyk (cyan, magenta, yellow, black)
 
generate modes; all extra arguments is given to the
generation function. These has the same name as the method:
  "test ,"
  "gradients "
  "noise "
  "turbulence "
  "random "
  "randomgrey "
specials cases:
  "tuned_box " (coordinates is automatic)

Parameter xsize
Parameter ysize

size of (new) image in pixels

Parameter color
Parameter r
Parameter g
Parameter b

background color (will also be current color), default color is black

Parameter alpha

default alpha channel value

Bugs

SIGSEGVS can be caused if the size is too big, due to unchecked overflow - (xsize*ysize)&MAXINT is small enough to allocate.

See also

copy , clone , Image.Image