| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
Image.Component.OperationResult |
Describes results of color component–related operations.
|
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
ImageFormat.ComponentType |
componentType |
Indicates the color component type defined in
ImageFormat.ComponentType. |
int |
pixelStride |
Indicates the distance in bytes between adjacent pixels in a row.
|
int |
rowStride |
Indicates the distance in bytes between adjacent pixel rows.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
ByteBuffer |
getBuffer() |
Obtains the
ByteBuffer object of the current color component. |
int |
read() |
Reads color component data of one byte.
|
int |
read(byte[] dstArray) |
Reads color component data of multiple consecutive bytes.
|
int |
read(byte[] dstArray,
int offset,
int length) |
Reads color component data of multiple consecutive bytes and write the data in an
array with specified offsets and length.
|
void |
release() |
Releases native resources associated with the color component.
|
int |
remaining() |
Obtains the remaining data size (in bytes) of the color component.
|
int |
seek(int newPosition) |
Sets a position of the current color component data to read.
|
int |
tell() |
Obtains the position of the current color component data to read.
|
public final ImageFormat.ComponentType componentType
ImageFormat.ComponentType.public final int pixelStride
public final int rowStride
public int read()
OperationResult#FAILURE
constant if the reading fails; returns the OperationResult#RELEASED constant if the
image or component data is released.public int read(byte[] dstArray)
dstArray - Indicates an array to store the data.OperationResult#SUCCESS constant if the reading is successful;
returns the OperationResult#FAILURE constant if the reading fails; returns the
OperationResult#RELEASED constant if the image or component data is released.public int read(byte[] dstArray,
int offset,
int length)
dstArray - Indicates an array to store the data.offset - Indicates where to write the data in the target array.length - Indicates the maximum length allowed to write data into the target array.OperationResult#SUCCESS constant if the reading is successful;
returns the OperationResult#FAILURE constant if the reading fails; returns the
OperationResult#RELEASED constant if the image or component data is released.public int tell()
OperationResult#RELEASED if the image or component data is released.public int seek(int newPosition)
newPosition - Indicates a new position of the current color component data to read.OperationResult#SUCCESS constant if the reading position is set;
returns the OperationResult#FAILURE constant if the setting fails; returns the
OperationResult#RELEASED constant if the image or component data is released.public int remaining()
OperationResult#RELEASED
if the image or component data is released.public ByteBuffer getBuffer()
ByteBuffer object of the current color component. Note that the object directly
maps to the native resource buffer. After the receiver or image resource is released, the object should
not be used to read or write data.ByteBuffer object of the current color component.IllegalStateException - Throws this exception if the operation is not supported,
for example, if native resources associated with the receiver or image are released.public void release()
After this method is called, color component-related operations will no longer be supported.