public interface ImageData
Modifier and Type | Field and Description |
---|---|
static int |
CREATE_OPTION_DONT_SCALE_UP
An option that may be used when creating images/pictures that
will be scaled.
|
static int |
CREATE_OPTION_IGNORE_ALPHA
An option that may be used when creating images/pictures.
|
static int |
CREATE_OPTION_KEEP_ASPECT_RATIO
An option that may be used when creating images/pictures that
will be scaled.
|
static int |
CREATE_OPTION_ROUGH_SCALING
An option that may be used when creating images/pictures that
will be scaled.
|
static int |
SCAN_LINE_BYTE_ARRAY
A Scan line type that is always used by TYPE_MONO, TYPE_INDEXED_XXX and TYPE_GRAY_SCALE_XXX.
|
static int |
SCAN_LINE_INT_ARRAY
A Scan line type that may be used by TYPE_RGB and TYPE_ARGB, but not by any other types.
|
static int |
TYPE_ARGB
An image type - one byte per color component, four bytes per pixel.
|
static int |
TYPE_GRAY_SCALE_16
An image type - 4 bits per pixel gray scale.
|
static int |
TYPE_GRAY_SCALE_2
An image type - one bit per pixel - the same as TYPE_MONO.
|
static int |
TYPE_GRAY_SCALE_256
An image type - one byte per pixel gray scale.
|
static int |
TYPE_GRAY_SCALE_4
An image type - 2 bits per pixel gray scale.
|
static int |
TYPE_INDEXED_16
An image type - 4 bits per pixel indexed color.
|
static int |
TYPE_INDEXED_2
An image type - 1 bit per pixel indexed color.
|
static int |
TYPE_INDEXED_256
An image type - one byte per pixel indexed color.
|
static int |
TYPE_INDEXED_4
An image type - 2 bits per pixel indexed color.
|
static int |
TYPE_MASK
This is a mask you can use to determine TYPE_XXX values
|
static int |
TYPE_MONO
An image type - one bit per pixel.
|
static int |
TYPE_RGB
An image type - one byte per color component, three bytes per pixel.
|
static int |
TYPE_UNKNOWN
An image type - the type could not be determined
|
Modifier and Type | Method and Description |
---|---|
void |
freeImage()
Free any resource associated with the ImageData object.
|
int[] |
getImageColorTable()
For indexed images, this retrieves the color table as an array of ARGB integers.
|
int |
getImageHeight() |
int |
getImageScanLineLength()
If the scan line type is SCAN_LINE_BYTE_ARRAY then this indicates
the number of bytes is needed for one complete scan line.
|
void |
getImageScanLines(int startLine,
int numLines,
Object destArray,
int offset,
int destScanLineLength)
Place a set of scan lines into a destination array.
|
int |
getImageScanLineType()
Get the type of scan line used by the image - either SCAN_LINE_BYTE_ARRAY or SCAN_LINE_INT_ARRAY
|
int |
getImageType()
This returns one of the TYPE_XXX values
|
int |
getImageWidth() |
int[] |
getPixels(int[] dest,
int offset,
int x,
int y,
int width,
int height,
int rowStride)
Retrieve the pixels from the Image in encoded ARGB values.
|
boolean |
isReadableImage()
Returns if you can read data from the ImageData.
|
boolean |
isWriteableImage()
Returns if you can write data to the ImageData.
|
void |
setImageScanLines(int startLine,
int numLines,
Object sourceArray,
int offset,
int sourceScanLineLength)
Place a set of scan lines from a source Array into the ImageData.
|
boolean |
setPixels(int[] src,
int offset,
int x,
int y,
int width,
int height,
int rowStride)
Set the pixels in the IImage in encoded ARGB values.
|
static final int CREATE_OPTION_KEEP_ASPECT_RATIO
static final int CREATE_OPTION_IGNORE_ALPHA
static final int CREATE_OPTION_ROUGH_SCALING
static final int CREATE_OPTION_DONT_SCALE_UP
static final int TYPE_UNKNOWN
static final int TYPE_RGB
static final int TYPE_ARGB
static final int TYPE_MONO
static final int TYPE_GRAY_SCALE_2
static final int TYPE_GRAY_SCALE_4
static final int TYPE_GRAY_SCALE_16
static final int TYPE_GRAY_SCALE_256
static final int TYPE_INDEXED_2
static final int TYPE_INDEXED_4
static final int TYPE_INDEXED_16
static final int TYPE_INDEXED_256
static final int TYPE_MASK
static final int SCAN_LINE_BYTE_ARRAY
static final int SCAN_LINE_INT_ARRAY
int getImageType()
int getImageScanLineType()
int getImageScanLineLength()
void getImageScanLines(int startLine, int numLines, Object destArray, int offset, int destScanLineLength) throws IllegalStateException
IllegalStateException
void setImageScanLines(int startLine, int numLines, Object sourceArray, int offset, int sourceScanLineLength) throws IllegalStateException
IllegalStateException
int getImageWidth()
int getImageHeight()
int[] getImageColorTable()
boolean isWriteableImage()
boolean isReadableImage()
void freeImage()
int[] getPixels(int[] dest, int offset, int x, int y, int width, int height, int rowStride)
dest
- The destination int array. If this is null then a new array should be created.offset
- The offset into the array to start placing pixels.x
- the x co-ordinate within the image.y
- the y co-ordinate within the image.width
- the width of the pixel block to get.height
- the height of the pixel block to get.rowStride
- the number of int values between each row in the destination int array. If this is 0 it
will be assumed to be equal to width.boolean setPixels(int[] src, int offset, int x, int y, int width, int height, int rowStride)
src
- The source int array.offset
- The offset into the array to start retrieving pixels.x
- the x co-ordinate within the image.y
- the y co-ordinate within the image.width
- the width of the pixel block to get.height
- the height of the pixel block to get.rowStride
- the number of int values between each row in the source int array. If this is 0 it
will be assumed to be equal to width.