Major media subsystem revamp:

- All images are loaded through the image manager
- Architected to allow the use of prepared or unprepared images (and
  volatile images when the day comes that they support alpha)
- Tunable caches for images and tiles
- Resource manager caches unpacked resources on the filesystem
- Various and sundry other cleanups


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2116 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-01-13 22:49:47 +00:00
parent 8743be2131
commit 100aa3ace3
46 changed files with 1602 additions and 888 deletions
@@ -1,26 +1,45 @@
//
// $Id: ImageProvider.java,v 1.2 2001/12/07 01:33:29 mdb Exp $
// $Id: ImageProvider.java,v 1.3 2003/01/13 22:49:46 mdb Exp $
package com.threerings.media.tile;
import java.awt.Image;
import java.io.IOException;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import com.threerings.media.image.Colorization;
import com.threerings.media.image.Mirage;
/**
* A tileset needs to load its images from some location. That will
* generally either be via the {@link TileManager} that constructed it or
* the {@link TileSetRepository} that constructed it. The tile manager
* loads images via the resource manager, whereas the tileset repository
* will likely obtain images via its own resource bundles.
* Provides a generic interface via which tileset images may be loaded. In
* most cases, a running application will want to obtain images via the
* {@link ImageManager}, but in some circumstances a simpler image
* provider may be desirable to avoid the overhead of the image manager
* infrastructure when simple image loading is all that is desired.
*/
public interface ImageProvider
{
/**
* Loads the image with the specified path.
* Returns the raw tileset image with the specified path.
*
* @exception IOException thrown if an error occurs loading the image
* data.
* @param path the path that identifies the desired image (corresponds
* to the image path from the tileset).
* @param zations if non-null, colorizations to apply to the source
* image before returning it.
*/
public Image loadImage (String path)
throws IOException;
public BufferedImage getTileSetImage (String path, Colorization[] zations);
/**
* Obtains the tile image with the specified path in the form of a
* {@link Mirage}. It should be cropped from the tileset image
* identified by the supplied path.
*
* @param path the path that identifies the desired image (corresponds
* to the image path from the tileset).
* @param bounds if non-null, the region of the image to be returned
* as a mirage. If null, the entire image should be returned.
* @param zations if non-null, colorizations to apply to the image
* before converting it into a mirage.
*/
public Mirage getTileImage (String path, Rectangle bounds,
Colorization[] zations);
}