com.threerings.media.image
Class CachedVolatileMirage

java.lang.Object
  extended by com.threerings.media.image.VolatileMirage
      extended by com.threerings.media.image.CachedVolatileMirage
All Implemented Interfaces:
Mirage

public class CachedVolatileMirage
extends VolatileMirage

A mirage implementation which allows the image to be maintained in video memory and refetched from the image manager in the event that our target screen resolution changes or we are flushed from video memory for some other reason.

These objects are never created directly, but always obtained from the ImageManager.


Field Summary
protected  ImageManager.ImageKey _source
          The key that identifies the image data used to create our volatile image.
protected  Colorization[] _zations
          Optional colorizations that are applied to our source image when creating our mirage.
 
Fields inherited from class com.threerings.media.image.VolatileMirage
_bounds, _image, _imgr, IMAGE_DEBUG
 
Constructor Summary
protected CachedVolatileMirage(ImageManager imgr, ImageManager.ImageKey source, Rectangle bounds, Colorization[] zations)
          Creates a mirage with the supplied regeneration informoation and prepared image.
 
Method Summary
protected  int getTransparency()
          Returns the transparency that should be used when creating our volatile image.
protected  void refreshVolatileImage()
          Rerenders our volatile image from the its source image data.
protected  void toString(StringBuilder buf)
          Generates a string representation of this instance.
 
Methods inherited from class com.threerings.media.image.VolatileMirage
createVolatileImage, getEstimatedMemoryUsage, getHeight, getSnapshot, getWidth, getX, getY, hitTest, paint, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_source

protected ImageManager.ImageKey _source
The key that identifies the image data used to create our volatile image.


_zations

protected Colorization[] _zations
Optional colorizations that are applied to our source image when creating our mirage.

Constructor Detail

CachedVolatileMirage

protected CachedVolatileMirage(ImageManager imgr,
                               ImageManager.ImageKey source,
                               Rectangle bounds,
                               Colorization[] zations)
Creates a mirage with the supplied regeneration informoation and prepared image.

Method Detail

getTransparency

protected int getTransparency()
Description copied from class: VolatileMirage
Returns the transparency that should be used when creating our volatile image.

Specified by:
getTransparency in class VolatileMirage

refreshVolatileImage

protected void refreshVolatileImage()
Description copied from class: VolatileMirage
Rerenders our volatile image from the its source image data.

Specified by:
refreshVolatileImage in class VolatileMirage

toString

protected void toString(StringBuilder buf)
Description copied from class: VolatileMirage
Generates a string representation of this instance.

Overrides:
toString in class VolatileMirage