ewe.fx
Interface IImage

All Known Subinterfaces:
OnScreenImage
All Known Implementing Classes:
IconAndText, Image, mImage, PixelBuffer, RGBImageData

public interface IImage

This is an interface that is implemented by objects that can draw themselves onto a Graphics context.


Field Summary
static int DISABLED
          This is an option that tells the image that it should draw itself in a disabled (usually "grayed") state.
static int OUTLINED
          This is an option that tells the image that it should draw an outline around itself.
 
Method Summary
 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[] 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 usesAlpha()
          Returns whether the image uses the Alpha channel.
 

Field Detail

DISABLED

public static final int DISABLED
This is an option that tells the image that it should draw itself in a disabled (usually "grayed") state.

See Also:
Constant Field Values

OUTLINED

public static final int OUTLINED
This is an option that tells the image that it should draw an outline around itself.

See Also:
Constant Field Values
Method Detail

draw

public void draw(Graphics g,
                 int x,
                 int y,
                 int options)
Draw the full image at the specified co-ordinates in the graphics provided.


getWidth

public int getWidth()
This returns the width of the image.


getHeight

public int getHeight()
This returns the height of the image.


getBackground

public Color getBackground()
This returns a background color if one is set for the image.


free

public void free()
This frees system resources associated with the Image.


getPixels

public 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. If the usesAlpha() method returns false, then the A component of each pixel value (the top 8 bits) should be ignored.

Parameters:
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.
options - options for retrieving pixels - currently unused.
Returns:
The array containing the pixels, or null if getting pixels is not supported.

usesAlpha

public boolean usesAlpha()
Returns whether the image uses the Alpha channel.