class RegionImageCache
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
RegionImageCache.CachedImage |
| Modifier and Type | Field and Description |
|---|---|
private RTTexture |
backingStore |
private static int |
HEIGHT |
private RectanglePacker |
hPacker |
private java.util.HashMap<java.lang.Integer,RegionImageCache.CachedImage> |
imageMap |
private static int |
MAX_SIZE |
private RectanglePacker |
vPacker |
private static int |
WIDTH |
| Constructor and Description |
|---|
RegionImageCache(ResourceFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
(package private) RTTexture |
getBackingStore() |
(package private) boolean |
getImageLocation(java.lang.Integer key,
Rectangle rect,
Background background,
Shape shape,
Graphics g)
Search the cache for a background image representing the arguments.
|
(package private) boolean |
isImageCachable(int w,
int h)
Check if the image size is to big to be stored in the cache
|
private static final int MAX_SIZE
private static final int WIDTH
private static final int HEIGHT
private java.util.HashMap<java.lang.Integer,RegionImageCache.CachedImage> imageMap
private RTTexture backingStore
private RectanglePacker hPacker
private RectanglePacker vPacker
RegionImageCache(ResourceFactory factory)
boolean isImageCachable(int w,
int h)
w - The image widthh - The image heightRTTexture getBackingStore()
boolean getImageLocation(java.lang.Integer key,
Rectangle rect,
Background background,
Shape shape,
Graphics g)
key - the hash key for the imagerect - the rect image. On input, width and height determine the requested
texture space. On ouput, the x and y the location in the texturebackground - the background used to validated if the correct image was foundshape - the shape used to validated if the correct image was foundg - the graphics to flush if the texture needs to be restarted