|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjsky.image.MyTileCache
public class MyTileCache
Implements the JAI TileCache interface.
| Constructor Summary | |
|---|---|
MyTileCache(int imageWidth,
int imageHeight,
int tileWidth,
int tileHeight,
int bytesPerPixel)
Create a new tile cache for an image with the given size. |
|
MyTileCache(int imageWidth,
int imageHeight,
int tileWidth,
int tileHeight,
int bytesPerPixel,
int memoryCapacity)
Create a new tile cache for an image with the given size. |
|
| Method Summary | |
|---|---|
void |
add(int tileX,
int tileY,
java.awt.image.Raster tile)
Adds a tile to the cache. |
void |
clear()
Clear the tile cache, so that the memory may be reclaimed |
long |
getMemoryCapacity()
Returns the memory capacity in bytes. |
java.awt.image.Raster |
getTile(int tileX,
int tileY)
Retrieves a tile. |
int |
getTileCapacity()
Returns the tile capacity in tiles. |
void |
remove(int tileX,
int tileY)
Advises the cache that a tile is no longer needed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MyTileCache(int imageWidth,
int imageHeight,
int tileWidth,
int tileHeight,
int bytesPerPixel,
int memoryCapacity)
imageWidth - The width of the image in pixelsimageHeight - The height of the image in pixelstileWidth - The width of a tile in pixelstileHeight - The height of a tile in pixelsbytesPerPixel - The number of bytes required for one pixelmemoryCapacity - The maximum number of bytes to allocate before discarding old tiles
public MyTileCache(int imageWidth,
int imageHeight,
int tileWidth,
int tileHeight,
int bytesPerPixel)
imageWidth - The width of the image in pixelsimageHeight - The height of the image in pixelstileWidth - The width of a tile in pixelstileHeight - The height of a tile in pixelsbytesPerPixel - The number of bytes required for one pixel| Method Detail |
|---|
public void add(int tileX,
int tileY,
java.awt.image.Raster tile)
tileX - The X index of the tile in the tile grid.tileY - The Y index of the tile in the tile grid.tile - A Raster containging the tile data.
public void remove(int tileX,
int tileY)
tileX - The X index of the tile in the tile grid.tileY - The Y index of the tile in the tile grid.public void clear()
public java.awt.image.Raster getTile(int tileX,
int tileY)
null if the tile is not
present in the cache.
tileX - The X index of the tile in the tile grid.tileY - The Y index of the tile in the tile grid.public int getTileCapacity()
public long getMemoryCapacity()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||