|
JSR-209 (Final Approval Ballot) | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.image.DataBuffer
This class exists to wrap one or more data arrays. Each data array in the
DataBuffer is referred to as a bank. The data type of a data buffer
indicates the type of the data array(s). The data type may be TYPE_UNDEFINED
or one of the types defined below. DataBuffers cannot be created directly.
They can only be obtained from BufferedImages by querying their Rasters.
If an application needs to manipulate pixels directly, it can get the
int array holding the pixels via the DataBuffer which is guaranteed
to be a DataBufferInt when the BufferedImage is
TYPE_INT_ARGB_PRE.
Restrictions
Note that a BufferedImage obtained via the factory methods on
GraphicsConfiguration or through the ImageIO API are not guaranteed
to be of any particular type. If it is not TYPE_INT_ARGB_PRE, then
the API implementation is free to use some other subclass of DataBuffer,
which is opaque to the application. The pixel store for such a custom
DataBuffer might not be a Java array (int or otherwise).
| Field Summary | |
protected int |
dataType
The data type of this DataBuffer. |
protected int |
size
Usable size of all banks. |
static int |
TYPE_BYTE
Tag for unsigned byte data. |
static int |
TYPE_INT
Tag for int data. |
static int |
TYPE_UNDEFINED
Tag for undefined data. |
static int |
TYPE_USHORT
Tag for unsigned short data. |
| Constructor Summary | |
protected |
DataBuffer(int dataType,
int size)
Constructs a DataBuffer containing one bank of the specified data type and size. |
| Method Summary | |
int |
getDataType()
Returns the data type of this DataBuffer. |
int |
getSize()
Returns the size (in array elements) of the bank. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int TYPE_BYTE
public static final int TYPE_USHORT
public static final int TYPE_INT
public static final int TYPE_UNDEFINED
protected int dataType
protected int size
| Constructor Detail |
protected DataBuffer(int dataType,
int size)
dataType - the data type of this DataBuffersize - the size of the bank| Method Detail |
public int getDataType()
DataBuffer.public int getSize()
|
JSR-209 (Final Approval Ballot) | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||