class image_array.ImageArray(object)

An ImageArray is an indexed collection of images created by dividing up a master image into equal-sized subimages.

Image arrays can be one-dimensional or two-dimensional. A one-dimensional image array has its subimages arranged horizontally in the master image and is indexed by an integer. A two-dimensional image array is indexed by a tuple (row, col).


ImageArray(image, shape)
Constructs an image array from the given image, which should be a Surface. The shape is either an integer for a one-dimensional image array, or a tuple (num_rows, num_cols) for a two-dimensional image array.


Returns a subsurface for the image at index i of a one-dimensional image array.
image_array[row, column]
Returns a subsurface for the image at the given row and column of a two-dimensional image array.

Returns the shape of the image array (an integer if one-dimensional, or a 2-tuple if two-dimensional).


Creates and returns a bounding rectangle for one of the subimages, with top left corner (0, 0).


get_image_array(name, shape, **kwds)
Creates and returns an ImageArray from an image resource with the given name. The ImageArray is cached, and subsequent calls with the same name will return the cached object. Additional keyword arguments are passed on to get_image().