␡
- Applying Rendering Hints
- Managing Memory
- Scheduling Tiles
- Reformatting an Image
- Extending the Border
- A Rendering Example
- A Closer Look at the PlanarImage Class
- Using the RenderedOp Class
- Working with Tiles
- A Tiled-Image Viewer
- Writing to Pixels
- Creating an Aggregate Image
- A JAI Image Browser
- The Renderable Layer
- Conclusion
This chapter is from the book
Scheduling Tiles
Like TileCache, TileScheduler is an interface. It has three methods for managing the tile-scheduling computation:
public Raster scheduleTile(OpImage target, int tileX, int tileY)
public Raster[] scheduleTiles(OpImage target, Point[] tileIndices)
public void prefetchTiles(PlanarImage target, Point[] tileIndices)
Here's an example:
Point[] tileIndices = { new Point(0,0), new Point(1,0), new Point(2,0)}; TileCache tileCache = JAI.getDefaultInstance().getTileCache(); tileCache.prefetchTiles(image, tileIndices);
This example gives a hint to prefetch the first three tiles of an image.
Just as the setTileCache() method is used to set TileCache, you can use setTileScheduler() to set a TileScheduler object. Unlike TileCache, however, TileScheduler is not a rendering hint.