com.threerings.media.image
Class ClientImageManager

java.lang.Object
  extended by com.threerings.media.image.ImageManager
      extended by com.threerings.media.image.ClientImageManager
All Implemented Interfaces:
ImageUtil.ImageCreator

public class ClientImageManager
extends ImageManager

Provides a single point of access for image retrieval and caching - just like the ImageManager but adds a tie in to the RuntimeAdjust system to control caching and mirage creation.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.media.image.ImageManager
ImageManager.CacheRecord, ImageManager.ImageKey, ImageManager.OptimalImageCreator
 
Field Summary
protected static RuntimeAdjust.IntAdjust _cacheSize
          Register our image cache size with the runtime adjustments framework.
protected static RuntimeAdjust.BooleanAdjust _prepareImages
          Controls whether or not we prepare images or use raw versions.
protected static RuntimeAdjust.BooleanAdjust _runBlank
          A debug toggle for running entirely without rendering images.
protected static int _runCacheSize
          Cache size to be used in this run.
protected static boolean _runPrepareImages
          If images should be prepared for the graphics context in this run.
 
Fields inherited from class com.threerings.media.image.ImageManager
_cacheStatThrottle, _ccache, _defaultProvider, _icreator, _keySet, _providers, _rmgr, DEFAULT_CACHE_SIZE
 
Constructor Summary
ClientImageManager(ResourceManager rmgr, Component context)
           
ClientImageManager(ResourceManager rmgr, ImageManager.OptimalImageCreator icreator)
           
 
Method Summary
 int getCacheSize()
          Returns how much space we're willing to use for caching images.
 Mirage getMirage(ImageManager.ImageKey key, Rectangle bounds, Colorization[] zations)
          Like ImageManager.getMirage(ImageKey,Colorization[]) except that the mirage is created using only the specified subset of the original image.
static void setCacheSize(int cacheKilobytes)
          Sets the size of the image cache.
static void setPrepareImages(boolean prepareImages)
          Sets if images should be recreated in the graphics context's preferred format before rendering.
 
Methods inherited from class com.threerings.media.image.ImageManager
clearCache, createImage, getDataProvider, getImage, getImage, getImage, getImage, getImage, getImageCreator, getImageKey, getImageKey, getMirage, getMirage, getMirage, getMirage, getPreparedImage, getPreparedImage, getPreparedImage, loadImage, reportCachePerformance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_cacheSize

protected static RuntimeAdjust.IntAdjust _cacheSize
Register our image cache size with the runtime adjustments framework.


_runCacheSize

protected static int _runCacheSize
Cache size to be used in this run. Adjusted by setCacheSize without affecting the stored value.


_prepareImages

protected static RuntimeAdjust.BooleanAdjust _prepareImages
Controls whether or not we prepare images or use raw versions.


_runPrepareImages

protected static boolean _runPrepareImages
If images should be prepared for the graphics context in this run.


_runBlank

protected static RuntimeAdjust.BooleanAdjust _runBlank
A debug toggle for running entirely without rendering images.

Constructor Detail

ClientImageManager

public ClientImageManager(ResourceManager rmgr,
                          ImageManager.OptimalImageCreator icreator)

ClientImageManager

public ClientImageManager(ResourceManager rmgr,
                          Component context)
Method Detail

setCacheSize

public static void setCacheSize(int cacheKilobytes)
Sets the size of the image cache. This must be called before the ImageManager is created.


setPrepareImages

public static void setPrepareImages(boolean prepareImages)
Sets if images should be recreated in the graphics context's preferred format before rendering. This must be called before the ImageManager is created.


getCacheSize

public int getCacheSize()
Description copied from class: ImageManager
Returns how much space we're willing to use for caching images.

Overrides:
getCacheSize in class ImageManager

getMirage

public Mirage getMirage(ImageManager.ImageKey key,
                        Rectangle bounds,
                        Colorization[] zations)
Description copied from class: ImageManager
Like ImageManager.getMirage(ImageKey,Colorization[]) except that the mirage is created using only the specified subset of the original image.

Overrides:
getMirage in class ImageManager