Package gov.nasa.worldwind.util
Class ImageTiler
- java.lang.Object
-
- gov.nasa.worldwind.util.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImageTiler.ImageTilerListener
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_IMAGE_TILE_SIZE
-
Constructor Summary
Constructors Constructor Description ImageTiler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getTileHeight()
int
getTileWidth()
java.awt.Color
getTransparencyColor()
void
setTileHeight(int tileHeight)
void
setTileWidth(int tileWidth)
void
setTransparencyColor(java.awt.Color transparencyColor)
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 aSector
rather than a quadrilateral or other shape.void
tileImage(java.awt.image.BufferedImage image, java.util.List<? extends LatLon> corners, ImageTiler.ImageTilerListener listener)
-
-
-
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 aSector
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
-
tileImage
public void tileImage(java.awt.image.BufferedImage image, java.util.List<? extends LatLon> corners, ImageTiler.ImageTilerListener listener)
-
-