ewe.fx
Interface ImageData

All Known Implementing Classes:
ArrayImageData, Image, RGBImageData

public interface ImageData

This is a Interface that provides image scan line data and can optionally accept image scan line data.

An ewe.fx.Image class implements this interface so you can access its image data directly.


Field Summary
static int IS_AN_IMAGE_DATA_TYPE
           
static int SCAN_LINE_BYTE_ARRAY
          A Scan line type that is always used by TYPE_MONO 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
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 - one byte per pixel indexed color.
static int TYPE_INDEXED_256
          An image type - 2 bits per pixel indexed color.
static int TYPE_INDEXED_4
          An image type - one byte per pixel indexed color.
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
 
Method Summary
 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()
           
 boolean isWritableImage()
          Returns if you can write data to the Image.
 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.
 

Field Detail

IS_AN_IMAGE_DATA_TYPE

public static final int IS_AN_IMAGE_DATA_TYPE
See Also:
Constant Field Values

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN
An image type - the type could not be determined

See Also:
Constant Field Values

TYPE_MONO

public static final int TYPE_MONO
An image type - one bit per pixel.

See Also:
Constant Field Values

TYPE_GRAY_SCALE_2

public static final int TYPE_GRAY_SCALE_2
An image type - one bit per pixel - the same as TYPE_MONO.

See Also:
Constant Field Values

TYPE_GRAY_SCALE_256

public static final int TYPE_GRAY_SCALE_256
An image type - one byte per pixel gray scale.

See Also:
Constant Field Values

TYPE_GRAY_SCALE_16

public static final int TYPE_GRAY_SCALE_16
An image type - 4 bits per pixel gray scale.

See Also:
Constant Field Values

TYPE_GRAY_SCALE_4

public static final int TYPE_GRAY_SCALE_4
An image type - 2 bits per pixel gray scale.

See Also:
Constant Field Values

TYPE_INDEXED_2

public static final int TYPE_INDEXED_2
An image type - one byte per pixel indexed color.

See Also:
Constant Field Values

TYPE_INDEXED_4

public static final int TYPE_INDEXED_4
An image type - one byte per pixel indexed color.

See Also:
Constant Field Values

TYPE_INDEXED_16

public static final int TYPE_INDEXED_16
An image type - 4 bits per pixel indexed color.

See Also:
Constant Field Values

TYPE_INDEXED_256

public static final int TYPE_INDEXED_256
An image type - 2 bits per pixel indexed color.

See Also:
Constant Field Values

TYPE_RGB

public static final int TYPE_RGB
An image type - one byte per color component, three bytes per pixel.

See Also:
Constant Field Values

TYPE_ARGB

public static final int TYPE_ARGB
An image type - one byte per color component, four bytes per pixel.

See Also:
Constant Field Values

SCAN_LINE_BYTE_ARRAY

public static final int SCAN_LINE_BYTE_ARRAY
A Scan line type that is always used by TYPE_MONO and TYPE_GRAY_SCALE_XXX. MAY be used by TYPE_RGB and TYPE_ARGB

See Also:
Constant Field Values

SCAN_LINE_INT_ARRAY

public static final int SCAN_LINE_INT_ARRAY
A Scan line type that may be used by TYPE_RGB and TYPE_ARGB

See Also:
Constant Field Values
Method Detail

getImageType

public int getImageType()
This returns one of the TYPE_XXX values


getImageScanLineType

public int getImageScanLineType()
Get the type of scan line used by the image - either SCAN_LINE_BYTE_ARRAY or SCAN_LINE_INT_ARRAY


getImageScanLineLength

public 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.


getImageScanLines

public void getImageScanLines(int startLine,
                              int numLines,
                              Object destArray,
                              int offset,
                              int destScanLineLength)
Place a set of scan lines into a destination array. The type of the destination array must be either byte[] or int[] depending on the value of getImageScanLineType().


setImageScanLines

public void setImageScanLines(int startLine,
                              int numLines,
                              Object sourceArray,
                              int offset,
                              int sourceScanLineLength)
                       throws IllegalStateException
Place a set of scan lines from a source Array into the ImageData. The type of the destination array must be either byte[] or int[] depending on the value of getImageScanLineType().

Throws:
IllegalStateException

getImageWidth

public int getImageWidth()

getImageHeight

public int getImageHeight()

getImageColorTable

public int[] getImageColorTable()
For indexed images, this retrieves the color table as an array of ARGB integers. If the image type is not TYPE_INDEXED_XXX, then null will be returned.


isWritableImage

public boolean isWritableImage()
Returns if you can write data to the Image.