it.geosolutions.jaiext.translate
Class TranslateIntOpImage

java.lang.Object
  extended by javax.media.jai.PlanarImage
      extended by javax.media.jai.OpImage
          extended by it.geosolutions.jaiext.translate.TranslateIntOpImage
All Implemented Interfaces:
RenderedImage, javax.media.jai.ImageJAI, javax.media.jai.PropertyChangeEmitter, javax.media.jai.PropertySource, javax.media.jai.WritablePropertySource

public final class TranslateIntOpImage
extends javax.media.jai.OpImage

An OpImage to translate an image by in integral number of pixels.


Field Summary
 
Fields inherited from class javax.media.jai.OpImage
cache, cobbleSources, OP_COMPUTE_BOUND, OP_IO_BOUND, OP_NETWORK_BOUND, tileCacheMetric, tileRecycler
 
Fields inherited from class javax.media.jai.PlanarImage
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width
 
Constructor Summary
TranslateIntOpImage(RenderedImage source, Map config, int transX, int transY)
          Construct an TranslateIntOpImage.
 
Method Summary
 boolean computesUniqueTiles()
          Returns false as computeTile() invocations return child Rasters of the RenderedImage source and are therefore not unique objects in the global sense.
 Raster computeTile(int tileX, int tileY)
          Override computeTile() simply to invoke getTile().
 Raster getTile(int tileX, int tileY)
          Get a tile.
 Rectangle mapDestRect(Rectangle destRect, int sourceIndex)
          Returns a conservative estimate of the region of a specified source that is required in order to compute the pixels of a given destination rectangle.
 Rectangle mapSourceRect(Rectangle sourceRect, int sourceIndex)
          Returns a conservative estimate of the destination region that can potentially be affected by the pixels of a rectangle of a given source.
 
Methods inherited from class javax.media.jai.OpImage
addTileToCache, cancelTiles, computeRect, computeRect, createTile, dispose, getExpandedNumBands, getFormatTags, getOperationComputeType, getTileCache, getTileCacheMetric, getTileDependencies, getTileFromCache, getTileRecycler, getTiles, hasExtender, mapDestPoint, mapSourcePoint, prefetchTiles, queueTiles, recycleTile, setTileCache, vectorize, vectorize, vectorize
 
Methods inherited from class javax.media.jai.PlanarImage
addPropertyChangeListener, addPropertyChangeListener, addSink, addSink, addSource, addTileComputationListener, copyData, copyData, copyExtendedData, createColorModel, createSnapshot, createWritableRaster, finalize, getAsBufferedImage, getAsBufferedImage, getBounds, getColorModel, getData, getData, getDefaultColorModel, getExtendedData, getGraphics, getHeight, getImageID, getMaxTileX, getMaxTileY, getMaxX, getMaxY, getMinTileX, getMinTileY, getMinX, getMinY, getNumBands, getNumSources, getNumXTiles, getNumYTiles, getProperties, getProperty, getPropertyClass, getPropertyNames, getPropertyNames, getSampleModel, getSinks, getSource, getSourceImage, getSourceObject, getSources, getSplits, getTileComputationListeners, getTileFactory, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileIndices, getTileRect, getTiles, getTileWidth, getWidth, overlapsMultipleTiles, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeSink, removeSink, removeSinks, removeSource, removeSources, removeTileComputationListener, setImageLayout, setProperties, setProperty, setSource, setSources, tileXToX, tileXToX, tileYToY, tileYToY, toString, wrapRenderedImage, XToTileX, XToTileX, YToTileY, YToTileY
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TranslateIntOpImage

public TranslateIntOpImage(RenderedImage source,
                           Map config,
                           int transX,
                           int transY)
Construct an TranslateIntOpImage.

Parameters:
source - a RenderedImage.
config - Configurable attributes of the image including configuration variables indexed by RenderingHints.Keys and image properties indexed by Strings or CaselessStringKeys. This is simply forwarded to the superclass constructor.
transX - the number of pixels of horizontal translation.
transY - the number of pixels of vertical translation.
Method Detail

computesUniqueTiles

public boolean computesUniqueTiles()
Returns false as computeTile() invocations return child Rasters of the RenderedImage source and are therefore not unique objects in the global sense.

Overrides:
computesUniqueTiles in class javax.media.jai.OpImage

computeTile

public Raster computeTile(int tileX,
                          int tileY)
Override computeTile() simply to invoke getTile(). Required so that the TileScheduler may invoke computeTile(). This appens because the computation of the tile is inside the getTile() method.

Overrides:
computeTile in class javax.media.jai.OpImage

getTile

public Raster getTile(int tileX,
                      int tileY)
Get a tile.

Specified by:
getTile in interface RenderedImage
Overrides:
getTile in class javax.media.jai.OpImage
Parameters:
tileX - The X index of the tile.
tileY - The Y index of the tile.

mapSourceRect

public Rectangle mapSourceRect(Rectangle sourceRect,
                               int sourceIndex)
Returns a conservative estimate of the destination region that can potentially be affected by the pixels of a rectangle of a given source.

Specified by:
mapSourceRect in class javax.media.jai.OpImage
Parameters:
sourceRect - the Rectangle in source coordinates.
sourceIndex - the index of the source image.
Returns:
a Rectangle indicating the potentially affected destination region. or null if the region is unknown.
Throws:
IllegalArgumentException - if the source index is negative or greater than that of the last source.
IllegalArgumentException - if sourceRect is null.

mapDestRect

public Rectangle mapDestRect(Rectangle destRect,
                             int sourceIndex)
Returns a conservative estimate of the region of a specified source that is required in order to compute the pixels of a given destination rectangle.

Specified by:
mapDestRect in class javax.media.jai.OpImage
Parameters:
destRect - the Rectangle in destination coordinates.
sourceIndex - the index of the source image.
Returns:
a Rectangle indicating the required source region.
Throws:
IllegalArgumentException - if the source index is negative or greater than that of the last source.
IllegalArgumentException - if destRect is null.


Copyright © 2006–2014 GeoSolutions. All rights reserved.