com.threerings.cast
Class CompositedMaskedImage

java.lang.Object
  extended by com.threerings.cast.CompositedMultiFrameImage
      extended by com.threerings.cast.CompositedMaskedImage
All Implemented Interfaces:
TrimmedMultiFrameImage, MultiFrameImage

public class CompositedMaskedImage
extends CompositedMultiFrameImage

Used to composite action frames with mask frames.


Nested Class Summary
protected  class CompositedMaskedImage.MaskedMirage
          Combines the image in the first source with the masks in the rest.
 
Nested classes/interfaces inherited from class com.threerings.cast.CompositedMultiFrameImage
CompositedMultiFrameImage.CompositedVolatileMirage, CompositedMultiFrameImage.SubmirageForwarder
 
Field Summary
 
Fields inherited from class com.threerings.cast.CompositedMultiFrameImage
_action, _images, _imgr, _orient, _sources
 
Constructor Summary
CompositedMaskedImage(ImageManager imgr, CompositedActionFrames.ComponentFrames[] sources, String action, int orient)
           
 
Method Summary
protected  CompositedMirage createCompositedMirage(int index)
          Creates a composited image for the specified frame.
 int getHeight(int index)
          Returns the height of the specified frame image.
 void getTrimmedBounds(int index, Rectangle bounds)
          Fills in the minimum bounding rectangle for this image that contains all non-transparent pixels.
 int getWidth(int index)
          Returns the width of the specified frame image.
protected  int getX(int index)
           
 int getXOrigin(int index)
           
protected  int getY(int index)
           
 int getYOrigin(int index)
           
 boolean hitTest(int index, int x, int y)
          Returns true if the specified frame contains a non-transparent pixel at the specified coordinates.
 void paintFrame(Graphics2D g, int index, int x, int y)
          Renders the specified frame into the specified graphics object at the specified coordinates.
 
Methods inherited from class com.threerings.cast.CompositedMultiFrameImage
getEstimatedMemoryUsage, getFrame, getFrameCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositedMaskedImage

public CompositedMaskedImage(ImageManager imgr,
                             CompositedActionFrames.ComponentFrames[] sources,
                             String action,
                             int orient)
Method Detail

getWidth

public int getWidth(int index)
Description copied from interface: MultiFrameImage
Returns the width of the specified frame image.

Specified by:
getWidth in interface MultiFrameImage
Overrides:
getWidth in class CompositedMultiFrameImage

getHeight

public int getHeight(int index)
Description copied from interface: MultiFrameImage
Returns the height of the specified frame image.

Specified by:
getHeight in interface MultiFrameImage
Overrides:
getHeight in class CompositedMultiFrameImage

getXOrigin

public int getXOrigin(int index)
Overrides:
getXOrigin in class CompositedMultiFrameImage

getYOrigin

public int getYOrigin(int index)
Overrides:
getYOrigin in class CompositedMultiFrameImage

paintFrame

public void paintFrame(Graphics2D g,
                       int index,
                       int x,
                       int y)
Description copied from interface: MultiFrameImage
Renders the specified frame into the specified graphics object at the specified coordinates.

Specified by:
paintFrame in interface MultiFrameImage
Overrides:
paintFrame in class CompositedMultiFrameImage

hitTest

public boolean hitTest(int index,
                       int x,
                       int y)
Description copied from interface: MultiFrameImage
Returns true if the specified frame contains a non-transparent pixel at the specified coordinates.

Specified by:
hitTest in interface MultiFrameImage
Overrides:
hitTest in class CompositedMultiFrameImage

getTrimmedBounds

public void getTrimmedBounds(int index,
                             Rectangle bounds)
Description copied from interface: TrimmedMultiFrameImage
Fills in the minimum bounding rectangle for this image that contains all non-transparent pixels. If this information is unavailable, the bounds of the entire image may be returned in exchange for improved performance.

Specified by:
getTrimmedBounds in interface TrimmedMultiFrameImage
Overrides:
getTrimmedBounds in class CompositedMultiFrameImage

createCompositedMirage

protected CompositedMirage createCompositedMirage(int index)
Description copied from class: CompositedMultiFrameImage
Creates a composited image for the specified frame.

Overrides:
createCompositedMirage in class CompositedMultiFrameImage

getX

protected int getX(int index)
Returns:
the x offset into the source image for the image at index

getY

protected int getY(int index)
Returns:
the y offset into the source image for the image at index