public class ImageManager extends Object implements ImageUtil.ImageCreator
| Modifier and Type | Class and Description |
|---|---|
static class |
ImageManager.ImageKey
Used to identify an image for caching and reconstruction.
|
static interface |
ImageManager.OptimalImageCreator
This interface allows the image manager to create images that are in a format optimal for
rendering to the screen.
|
| Constructor and Description |
|---|
ImageManager(ResourceManager rmgr,
Component context)
A convenience constructor that creates an
AWTImageCreator for use by the image
manager. |
ImageManager(ResourceManager rmgr,
ImageManager.OptimalImageCreator icreator)
Construct an image manager with the specified
ResourceManager from which it will
obtain its data. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCache()
Clears all images out of the cache.
|
BufferedImage |
createImage(int width,
int height,
int transparency)
Creates a buffered image, optimized for display on our graphics device.
|
int |
getCacheSize()
Returns how much space we're willing to use for caching images.
|
BufferedImage |
getImage(ImageManager.ImageKey key,
Colorization[] zations)
Obtains the image identified by the specified key, caching if possible.
|
BufferedImage |
getImage(String path)
Loads (and caches) the specified image from the resource manager using the supplied path to
identify the image.
|
BufferedImage |
getImage(String path,
Colorization[] zations)
Like
getImage(String) but the specified colorizations are applied to the image
before it is returned. |
BufferedImage |
getImage(String rset,
String path)
Like
getImage(String) but the image is loaded from the specified resource set
rathern than the default resource set. |
BufferedImage |
getImage(String rset,
String path,
Colorization[] zations)
Like
getImage(String,String) but the specified colorizations are applied to the
image before it is returned. |
ImageManager.OptimalImageCreator |
getImageCreator()
Returns the image creator that can be used to create buffered images optimized for rendering
to the screen.
|
ImageManager.ImageKey |
getImageKey(ImageDataProvider daprov,
String path)
Returns an image key that can be used to fetch the image identified by the specified data
provider and image path.
|
ImageManager.ImageKey |
getImageKey(String rset,
String path)
Returns an image key that can be used to fetch the image identified by the specified
resource set and image path.
|
Mirage |
getMirage(ImageManager.ImageKey key)
Creates a mirage which is an image optimized for display on our current display device and
which will be stored into video memory if possible.
|
Mirage |
getMirage(ImageManager.ImageKey key,
Colorization[] zations)
Like
getMirage(ImageKey) but the supplied colorizations are applied to the source
image before creating the mirage. |
Mirage |
getMirage(ImageManager.ImageKey key,
Rectangle bounds)
Like
getMirage(ImageKey) but that only the specified subimage of the source image
is used to build the mirage. |
Mirage |
getMirage(ImageManager.ImageKey key,
Rectangle bounds,
Colorization[] zations)
Like
getMirage(ImageKey,Colorization[]) except that the mirage is created using
only the specified subset of the original image. |
Mirage |
getMirage(String rsrcPath)
Creates a mirage which is an image optimized for display on our current display device and
which will be stored into video memory if possible.
|
BufferedImage |
getPreparedImage(String path)
Loads (and caches) the specified image from the resource manager using the supplied path to
identify the image.
|
BufferedImage |
getPreparedImage(String rset,
String path)
Loads (and caches) the specified image from the resource manager, obtaining the image from
the supplied resource set.
|
BufferedImage |
getPreparedImage(String rset,
String path,
Colorization[] zations)
Loads (and caches) the specified image from the resource manager, obtaining the image from
the supplied resource set and applying the using the supplied path to identify the image.
|
public ImageManager(ResourceManager rmgr, ImageManager.OptimalImageCreator icreator)
ResourceManager from which it will
obtain its data.public ImageManager(ResourceManager rmgr, Component context)
AWTImageCreator for use by the image
manager.public int getCacheSize()
public void clearCache()
public BufferedImage createImage(int width, int height, int transparency)
createImage in interface ImageUtil.ImageCreatorpublic BufferedImage getImage(String path)
public BufferedImage getImage(String path, Colorization[] zations)
getImage(String) but the specified colorizations are applied to the image
before it is returned.public BufferedImage getImage(String rset, String path)
getImage(String) but the image is loaded from the specified resource set
rathern than the default resource set.public BufferedImage getImage(String rset, String path, Colorization[] zations)
getImage(String,String) but the specified colorizations are applied to the
image before it is returned.public BufferedImage getPreparedImage(String path)
Additionally the image is optimized for display in the current graphics
configuration. Consider using getMirage(ImageKey) instead of prepared images as
they (some day) will automatically use volatile images to increase performance.
public BufferedImage getPreparedImage(String rset, String path)
Additionally the image is optimized for display in the current graphics
configuration. Consider using getMirage(ImageKey) instead of prepared images as
they (some day) will automatically use volatile images to increase performance.
public BufferedImage getPreparedImage(String rset, String path, Colorization[] zations)
Additionally the image is optimized for display in the current graphics
configuration. Consider using getMirage(ImageKey,Colorization[]) instead of
prepared images as they (some day) will automatically use volatile images to increase
performance.
public ImageManager.ImageKey getImageKey(String rset, String path)
public ImageManager.ImageKey getImageKey(ImageDataProvider daprov, String path)
public BufferedImage getImage(ImageManager.ImageKey key, Colorization[] zations)
public Mirage getMirage(String rsrcPath)
public Mirage getMirage(ImageManager.ImageKey key)
public Mirage getMirage(ImageManager.ImageKey key, Rectangle bounds)
getMirage(ImageKey) but that only the specified subimage of the source image
is used to build the mirage.public Mirage getMirage(ImageManager.ImageKey key, Colorization[] zations)
getMirage(ImageKey) but the supplied colorizations are applied to the source
image before creating the mirage.public Mirage getMirage(ImageManager.ImageKey key, Rectangle bounds, Colorization[] zations)
getMirage(ImageKey,Colorization[]) except that the mirage is created using
only the specified subset of the original image.public ImageManager.OptimalImageCreator getImageCreator()
Copyright © 2015. All rights reserved.