Home > Articles > Programming > Java

  • Print
  • + Share This
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.

  • + Share This
  • 🔖 Save To Your Account