public abstract void getPixels (int x, int y, int w, int h, WritablePixelFormat<ByteBuffer> pixelformat, byte[] buffer, int offset, int scanlineStride)

Reads pixel data from a rectangular region of the surface into the specified byte array. The format to be used for pixels in the buffer is defined by the PixelFormat object and pixel format conversions will be performed as needed to store the data in the indicated format. The pixelformat must be a compatible PixelFormat<ByteBuffer> type. The data for the first pixel at location (x, y) will be read into the array index specified by the offset parameter. Pixel data for a row will be stored in adjacent locations within the array packed as tightly as possible for increasing X coordinates. Pixel data for adjacent rows will be stored offset from each other by the number of byte array elements defined by scanlineStride.

Parameters:
x    the X coordinate of the rectangular region to read
y    the Y coordinate of the rectangular region to read
w    the width of the rectangular region to read
h    the height of the rectangular region to read
pixelformat    the PixelFormat<ByteBuffer> object defining the byte format to store the pixels into buffer
buffer    a byte array to store the returned pixel data
offset    the offset into buffer to store the first pixel data
scanlineStride    the distance between the pixel data for the start of one row of data in the buffer to the start of the next row of data