|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.fx.RGBImageData
This class can be used to wrap up an IImage or ImageData of any type to act as an ImageData of type TYPE_ARGB or TYPE_RGB and, which uses int[] scan lines.
It can also be used to wrap up an ImageData of any type to act as an IImage.
| Field Summary | |
protected boolean |
canWrite
|
protected boolean |
deferToImageData
|
protected int |
height
|
protected IImage |
image
|
protected ImageData |
imageData
|
protected boolean |
usesAlpha
|
protected int |
width
|
| Fields inherited from interface ewe.fx.ImageData |
IS_AN_IMAGE_DATA_TYPE, SCAN_LINE_BYTE_ARRAY, SCAN_LINE_INT_ARRAY, TYPE_ARGB, TYPE_GRAY_SCALE_16, TYPE_GRAY_SCALE_2, TYPE_GRAY_SCALE_256, TYPE_GRAY_SCALE_4, TYPE_INDEXED_16, TYPE_INDEXED_2, TYPE_INDEXED_256, TYPE_INDEXED_4, TYPE_MONO, TYPE_RGB, TYPE_UNKNOWN |
| Fields inherited from interface ewe.fx.IImage |
DISABLED, OUTLINED |
| Constructor Summary | |
RGBImageData()
If you use this constructor, make sure you call one of the set() method before using any of the other methods. |
|
RGBImageData(Object image)
|
|
RGBImageData(Object image,
boolean useImageDataOverIImage)
|
|
| Method Summary | |
static boolean |
actsAsRGBImageData(ImageData image)
Return true if the specified ImageData acts in the same way that an RGBImageData would act. |
void |
draw(Graphics g,
int x,
int y,
int options)
Draw the full image at the specified co-ordinates in the graphics provided. |
void |
free()
This frees system resources associated with the Image. |
Color |
getBackground()
This returns a background color if one is set for the image. |
int |
getHeight()
This returns the height of the image. |
int[] |
getImageColorTable()
This always returns null. |
int |
getImageHeight()
|
int |
getImageScanLineLength()
This always returns the width of the original image. |
void |
getImageScanLines(int startLine,
int numLines,
Object destArray,
int offset,
int destScanLineLength)
Get the image scan lines, always as ARGB integer values. |
int |
getImageScanLineType()
This always returns SCAN_LINE_INT_ARRAY; |
int |
getImageType()
This returns either TYPE_ARGB or TYPE_RGB. |
int |
getImageWidth()
|
int[] |
getPixels(int[] dest,
int offset,
int x,
int y,
int width,
int height,
int options)
Retrieve the pixels from the Image in encoded ARGB values. |
int |
getWidth()
This returns the width of the image. |
boolean |
isWritableImage()
Returns if you can write data to the Image. |
void |
set(Object newImage)
|
void |
set(Object newImage,
boolean useImageDataOverIImage)
This can be used to set or change the image the RGBImageData is using. |
void |
setImageScanLines(int startLine,
int numLines,
Object sourceArray,
int offset,
int sourceScanLineLength)
Set the image scan lines, always as ARGB integer values. |
static IImage |
toIImage(Object image,
RGBImageData wrapper)
|
Image |
toImage()
|
static ImageData |
toImageData(Object image,
RGBImageData wrapper)
If the specified Image implements RGBImageData in exactly the same way as an RGBImageData does, then return the Image itself. |
boolean |
usesAlpha()
Returns whether the image uses the Alpha channel. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
protected IImage image
protected ImageData imageData
protected boolean deferToImageData
protected boolean usesAlpha
protected boolean canWrite
protected int width
protected int height
| Constructor Detail |
public RGBImageData()
public RGBImageData(Object image)
public RGBImageData(Object image,
boolean useImageDataOverIImage)
| Method Detail |
public static boolean actsAsRGBImageData(ImageData image)
public static ImageData toImageData(Object image,
RGBImageData wrapper)
public static IImage toIImage(Object image,
RGBImageData wrapper)
public void set(Object newImage)
public void set(Object newImage,
boolean useImageDataOverIImage)
public int getImageType()
getImageType in interface ImageDatapublic int getImageScanLineType()
getImageScanLineType in interface ImageDatapublic int getImageScanLineLength()
getImageScanLineLength in interface ImageData
public void getImageScanLines(int startLine,
int numLines,
Object destArray,
int offset,
int destScanLineLength)
getImageScanLines in interface ImageData
public void setImageScanLines(int startLine,
int numLines,
Object sourceArray,
int offset,
int sourceScanLineLength)
throws IllegalStateException
setImageScanLines in interface ImageDataIllegalStateExceptionpublic int getImageWidth()
getImageWidth in interface ImageDatapublic int getImageHeight()
getImageHeight in interface ImageDatapublic int[] getImageColorTable()
getImageColorTable in interface ImageDatapublic boolean isWritableImage()
isWritableImage in interface ImageDatapublic Color getBackground()
IImage
getBackground in interface IImage
public void draw(Graphics g,
int x,
int y,
int options)
IImage
draw in interface IImagepublic void free()
IImage
free in interface IImagepublic boolean usesAlpha()
IImage
usesAlpha in interface IImagepublic int getWidth()
IImage
getWidth in interface IImagepublic int getHeight()
IImage
getHeight in interface IImage
public int[] getPixels(int[] dest,
int offset,
int x,
int y,
int width,
int height,
int options)
IImage
getPixels in interface IImagedest - 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.options - options for retrieving pixels - currently unused.
public Image toImage()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||