Class ImageTiler


  • public class ImageTiler
    extends java.lang.Object
    Subdivides an image into tiles and computes the corresponding sectors. The width and height of the returned tiles can be specified but default to 1024. If the base image width or height is not evenly divisible by the corresponding desired tile dimension, tiles along the right and bottom of the base image may contain pixels that do not correspond to pixels in the image. These pixels will have an alpha component of 0 and the corresponding tile will have an alpha channel. Otherwise tiles will not have an alpha channel. If the input image is already the desired subimage size, it is returned without being copied.
    • Field Detail

      • DEFAULT_IMAGE_TILE_SIZE

        public static int DEFAULT_IMAGE_TILE_SIZE
    • Constructor Detail

      • ImageTiler

        public ImageTiler()
    • Method Detail

      • getTileWidth

        public int getTileWidth()
      • setTileWidth

        public void setTileWidth​(int tileWidth)
      • getTileHeight

        public int getTileHeight()
      • setTileHeight

        public void setTileHeight​(int tileHeight)
      • getTransparencyColor

        public java.awt.Color getTransparencyColor()
      • setTransparencyColor

        public void setTransparencyColor​(java.awt.Color transparencyColor)
      • tileImage

        public void tileImage​(java.awt.image.BufferedImage baseImage,
                              Sector baseSector,
                              ImageTiler.ImageTilerListener listener)
        Performs a subdivision according to the current parameters and assuming that the image corresponds with a Sector rather than a quadrilateral or other shape. Conveys each tile created to the caller via a listener callback.
        Parameters:
        baseImage - the image to tile.
        baseSector - the sector defining the geographic extent of the base image.
        listener - the listener to invoke when each new tile is created.
        See Also:
        ImageTiler.ImageTilerListener