public class ScreenData
extends java.lang.Object
Constructor and Description |
---|
ScreenData()
The class constructor.
|
ScreenData(ScreenData screenData)
The class constructor that creates pixel information of the game screen
by using the specified data.
|
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
getDisplayByteBuffer()
Obtains RGB data of the screen in the form of ByteBuffer.
Warning: If the window is disabled, will just return a black buffer. |
byte[] |
getDisplayByteBufferAsBytes()
Obtains RGB data of the screen in the form of byte[].
Warning: If the window is disabled, will just return a black buffer. |
byte[] |
getDisplayByteBufferAsBytes(int newWidth,
int newHeight,
boolean grayScale)
Obtains RGB data or the grayScale data of the screen in the form of
byte[].
Warning: This method doesn't return exactly the same buffer as getDisplayByteBufferAsBytes(). |
public ScreenData()
public ScreenData(ScreenData screenData)
screenData
- an instance of ScreenData classpublic java.nio.ByteBuffer getDisplayByteBuffer()
public byte[] getDisplayByteBufferAsBytes()
public byte[] getDisplayByteBufferAsBytes(int newWidth, int newHeight, boolean grayScale)
newWidth
- the width in pixel for the scaled imagenewHeight
- the height in pixel for the scaled imagegrayScale
- true to use grayScale for the scaled image (1 byte per pixel
instead of 3 bytes per pixel with RGB)