com.threerings.media.tile
Class SimpleCachingImageProvider
java.lang.Object
com.threerings.media.tile.SimpleCachingImageProvider
- All Implemented Interfaces:
- ImageProvider
public abstract class SimpleCachingImageProvider
- extends Object
- implements ImageProvider
An image provider that can be used by command line tools to load images and provide them to
tilesets when doing things like preprocessing tileset images.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_cache
protected Map<String,BufferedImage> _cache
SimpleCachingImageProvider
public SimpleCachingImageProvider()
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.
loadImage
protected abstract BufferedImage loadImage(String path)
throws IOException
- Derived classes must implement this method to actually load the raw source images.
- Throws:
IOException