The data written is in the format specified by the IMG_ColorModel and IMG_DataType parameters in the open. The size of the tile is smaller or equal to the sizes specified in the open. If the device was opened using openMulti(), the data is provided as a sequence of planes - first all pixels for plane 0, then all pixels for plane 1, etc.
The rectangle spectified by x0
, x1
, y0
and y1
is an inclusive rectangle. That is, the number of pixels in data
is:
(x1-x0+1)*(y1-y0+1).
The first pixel in the data buffer is the bottom left corner of the tile (i.e.
(x0,y0)).
The rectangle specified is also relative to the data window. So, to offset to get the absolute pixel location you need to take the data window (getDataWindow()) into account. You can also use the convenience methods getDataX()
and getDataY(). For example:
Implements IMG_TileDevice.