Method Image.XPM._xpm_write_rows()


Method _xpm_write_rows

int(0) _xpm_write_rows(Image.Image img, Image.Image alpha, int bpc, array(string) colors, array(string) pixels)

Description

Fills in img and alpha according to xpm data in bpc, colors and pixels.

Parameter bpc

Bytes per color. Number of bytes used to encode each color in pixels.

Parameter colors

Array of color definitions.

A color definition is on the format "ee c #RRGGBB", where ee is a bpc long string used to encode the color, c is a literal "c", and RRGGBB is a hexadecimal RGB code.

Parameter pixels

Raw picture information.

Array
string 0

Size information on the format (sprintf("%d %d %d %d", h, w, ncolors, bpn)).

string 1..ncolors

Same as colors.

string ncolors_plus_one..ncolors_plus_h

Line information. Strings of length bpn*w with encoded pixels for each line.