com.threerings.media.tile
Class IMImageProvider

java.lang.Object
  extended by com.threerings.media.tile.IMImageProvider
All Implemented Interfaces:
ImageProvider
Direct Known Subclasses:
BundledComponentRepository.ResourceBundleProvider

public class IMImageProvider
extends Object
implements ImageProvider

Provides images to a tileset given a reference to the image manager and an image data provider.


Field Summary
protected  ImageDataProvider _dprov
           
protected  ImageManager _imgr
           
protected  String _rset
           
 
Constructor Summary
IMImageProvider(ImageManager imgr, ImageDataProvider dprov)
           
IMImageProvider(ImageManager imgr, String rset)
           
 
Method Summary
protected  ImageManager.ImageKey getImageKey(String path)
           
 Mirage getTileImage(String path, Rectangle bounds, Colorization[] zations)
          Obtains the tile image with the specified path in the form of a Mirage.
 BufferedImage getTileSetImage(String path, Colorization[] zations)
          Returns the raw tileset image with the specified path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_imgr

protected ImageManager _imgr

_dprov

protected ImageDataProvider _dprov

_rset

protected String _rset
Constructor Detail

IMImageProvider

public IMImageProvider(ImageManager imgr,
                       ImageDataProvider dprov)

IMImageProvider

public IMImageProvider(ImageManager imgr,
                       String rset)
Method Detail

getTileSetImage

public BufferedImage getTileSetImage(String path,
                                     Colorization[] zations)
Description copied from interface: ImageProvider
Returns the raw tileset image with the specified path.

Specified by:
getTileSetImage in interface ImageProvider
Parameters:
path - the path that identifies the desired image (corresponds to the image path from the tileset).
zations - if non-null, colorizations to apply to the source image before returning it.

getTileImage

public Mirage getTileImage(String path,
                           Rectangle bounds,
                           Colorization[] zations)
Description copied from interface: ImageProvider
Obtains the tile image with the specified path in the form of a Mirage. It should be cropped from the tileset image identified by the supplied path.

Specified by:
getTileImage in interface ImageProvider
Parameters:
path - the path that identifies the desired image (corresponds to the image path from the tileset).
bounds - if non-null, the region of the image to be returned as a mirage. If null, the entire image should be returned.
zations - if non-null, colorizations to apply to the image before converting it into a mirage.

getImageKey

protected final ImageManager.ImageKey getImageKey(String path)