jaitools.media.jai.contour
Class ContourOpImage

java.lang.Object
  extended by javax.media.jai.PlanarImage
      extended by javax.media.jai.OpImage
          extended by jaitools.media.jai.AttributeOpImage
              extended by jaitools.media.jai.contour.ContourOpImage
All Implemented Interfaces:
RenderedImage, javax.media.jai.ImageJAI, javax.media.jai.PropertyChangeEmitter, javax.media.jai.PropertySource, javax.media.jai.WritablePropertySource

public class ContourOpImage
extends AttributeOpImage

Generates contours for user-specified levels of values in the source image. The contours are returned as a Collection of LineStrings.

The interpolation algorithm used is that of Paul Bourke: originally published in Byte magazine (1987) as the CONREC contouring subroutine written in FORTRAN. The implementation here was adapted from Paul Bourke's C code for the algorithm available at: http://local.wasp.uwa.edu.au/~pbourke/papers/conrec/

Since:
1.1
Version:
$Id: ContourOpImage.java 1610 2011-03-31 04:44:28Z michael.bedward $
Author:
Michael Bedward

Field Summary
 
Fields inherited from class jaitools.media.jai.AttributeOpImage
roi, srcBounds
 
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
ContourOpImage(RenderedImage source, javax.media.jai.ROI roi, int band, Collection<? extends Number> levels, Double interval, Collection<Object> noDataValues, boolean strictNodata, boolean simplify, boolean smooth)
          Constructor.
 
Method Summary
protected  Object getAttribute(String name)
          
protected  Class<?> getAttributeClass(String name)
          
protected  String[] getAttributeNames()
          
 
Methods inherited from class jaitools.media.jai.AttributeOpImage
computesUniqueTiles, computeTile, getProperty, getPropertyClass, getPropertyNames, getTile, getTiles, mapDestRect, mapSourceRect
 
Methods inherited from class javax.media.jai.OpImage
addTileToCache, cancelTiles, computeRect, computeRect, createTile, dispose, getExpandedNumBands, getFormatTags, getOperationComputeType, getTileCache, getTileCacheMetric, getTileDependencies, getTileFromCache, getTileRecycler, 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, 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

ContourOpImage

public ContourOpImage(RenderedImage source,
                      javax.media.jai.ROI roi,
                      int band,
                      Collection<? extends Number> levels,
                      Double interval,
                      Collection<Object> noDataValues,
                      boolean strictNodata,
                      boolean simplify,
                      boolean smooth)
Constructor. Note that one of levels or interval must be supplied. If both are supplied interval is ignored.

Parameters:
source - the source image
roi - an optional ROI to constrain the areas for which contours are generated
band - the band of the source image to process
levels - values for which to generate contours
interval - interval between contour levels (ignored if levels is supplied)
simplify - whether to simplify contour lines by removing colinear vertices
smooth - whether contour lines should be smoothed using Bezier interpolation
Method Detail

getAttribute

protected Object getAttribute(String name)

Specified by:
getAttribute in class AttributeOpImage

getAttributeNames

protected String[] getAttributeNames()

Specified by:
getAttributeNames in class AttributeOpImage

getAttributeClass

protected Class<?> getAttributeClass(String name)

Overrides:
getAttributeClass in class AttributeOpImage


Copyright © 2009-2011. All Rights Reserved.