com.threerings.media.image
Interface Mirage

All Known Subinterfaces:
CompositedMirage
All Known Implementing Classes:
BackedVolatileMirage, BlankMirage, BufferedMirage, CachedVolatileMirage, CompositedMaskedImage.MaskedMirage, CompositedMultiFrameImage.CompositedVolatileMirage, CompositedMultiFrameImage.SubmirageForwarder, CompositeMirage, NinePatchMirage, SolidMirage, TransformedMirage, VolatileMirage

public interface Mirage

Provides an interface via which images can be accessed in a way that allows them to optionally be located in video memory where that affords performance improvements.


Method Summary
 long getEstimatedMemoryUsage()
          Returns an estimate of the memory consumed by this mirage's image raster data.
 int getHeight()
          Returns the height of this mirage.
 BufferedImage getSnapshot()
          Returns a snapshot of this mirage as a buffered image.
 int getWidth()
          Returns the width of this mirage.
 boolean hitTest(int x, int y)
          Returns true if this mirage contains a non-transparent pixel at the specified coordinate.
 void paint(Graphics2D gfx, int x, int y)
          Renders this mirage at the specified position in the supplied graphics context.
 

Method Detail

paint

void paint(Graphics2D gfx,
           int x,
           int y)
Renders this mirage at the specified position in the supplied graphics context.


getWidth

int getWidth()
Returns the width of this mirage.


getHeight

int getHeight()
Returns the height of this mirage.


hitTest

boolean hitTest(int x,
                int y)
Returns true if this mirage contains a non-transparent pixel at the specified coordinate.


getSnapshot

BufferedImage getSnapshot()
Returns a snapshot of this mirage as a buffered image. The snapshot should not be modified by the caller.


getEstimatedMemoryUsage

long getEstimatedMemoryUsage()
Returns an estimate of the memory consumed by this mirage's image raster data.