deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.model.coverage.grid
Class ImageGridCoverage

java.lang.Object
  extended by org.deegree.model.coverage.AbstractCoverage
      extended by org.deegree.model.coverage.grid.AbstractGridCoverage
          extended by org.deegree.model.coverage.grid.ImageGridCoverage
All Implemented Interfaces:
java.io.Serializable, Coverage, GridCoverage

public class ImageGridCoverage
extends AbstractGridCoverage

GridCoverage implementation for holding grids stored in an BufferedImage or in a set of ImageGridCoverages

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
Author:
Andreas Poth, last edited by: $Author: mschneider $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.deegree.model.coverage.grid.AbstractGridCoverage
offset, scaleFactor
 
Fields inherited from class org.deegree.model.coverage.AbstractCoverage
coverageOffering, numSources, sources
 
Constructor Summary
ImageGridCoverage(CoverageOffering coverageOffering, Envelope envelope, boolean isEditable, java.awt.image.BufferedImage image)
           
ImageGridCoverage(CoverageOffering coverageOffering, Envelope envelope, java.awt.image.BufferedImage image)
           
ImageGridCoverage(CoverageOffering coverageOffering, Envelope envelope, CoordinateSystem crs, boolean isEditable, java.awt.image.BufferedImage image)
           
ImageGridCoverage(CoverageOffering coverageOffering, Envelope envelope, ImageGridCoverage[] sources)
           
 
Method Summary
 java.awt.image.BufferedImage getAsImage(int xAxis, int yAxis)
          this is a deegree convenience method which returns the source image of an ImageGridCoverage.
 int getNumSampleDimensions()
          The number of sample dimensions in the coverage.
 java.awt.image.renderable.RenderableImage getRenderableImage(int xAxis, int yAxis)
          Returns 2D view of this coverage as a renderable image.
 
Methods inherited from class org.deegree.model.coverage.grid.AbstractGridCoverage
getGridGeometry, isDataEditable, paintImage, paintImage
 
Methods inherited from class org.deegree.model.coverage.AbstractCoverage
getCoordinateReferenceSystem, getCoverageOffering, getDimensionNames, getEnvelope, getMetadataNames, getMetadataValue, getNumSources, getSampleDimension, getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.deegree.model.coverage.grid.GridCoverage
getSource
 
Methods inherited from interface org.deegree.model.coverage.Coverage
getCoordinateReferenceSystem, getDimensionNames, getEnvelope, getMetadataNames, getMetadataValue, getNumSources, getSampleDimension
 

Constructor Detail

ImageGridCoverage

public ImageGridCoverage(CoverageOffering coverageOffering,
                         Envelope envelope,
                         java.awt.image.BufferedImage image)
Parameters:
coverageOffering -
envelope -
image -

ImageGridCoverage

public ImageGridCoverage(CoverageOffering coverageOffering,
                         Envelope envelope,
                         boolean isEditable,
                         java.awt.image.BufferedImage image)
Parameters:
coverageOffering -
envelope -
isEditable -
image -

ImageGridCoverage

public ImageGridCoverage(CoverageOffering coverageOffering,
                         Envelope envelope,
                         CoordinateSystem crs,
                         boolean isEditable,
                         java.awt.image.BufferedImage image)
Parameters:
coverageOffering -
envelope -
crs -
isEditable -
image -

ImageGridCoverage

public ImageGridCoverage(CoverageOffering coverageOffering,
                         Envelope envelope,
                         ImageGridCoverage[] sources)
Parameters:
coverageOffering -
envelope -
sources -
Method Detail

getNumSampleDimensions

public int getNumSampleDimensions()
The number of sample dimensions in the coverage. For grid coverages, a sample dimension is a band.

Returns:
The number of sample dimensions in the coverage.

getRenderableImage

public java.awt.image.renderable.RenderableImage getRenderableImage(int xAxis,
                                                                    int yAxis)
                                                             throws java.lang.UnsupportedOperationException,
                                                                    java.lang.IndexOutOfBoundsException
Returns 2D view of this coverage as a renderable image. This optional operation allows interoperability with Java2D. If this coverage is a "org.opengis.coverage.grid.GridCoverage" backed by a RenderedImage, the underlying image can be obtained with: getRenderableImage(0,1).createDefaultRendering()

Specified by:
getRenderableImage in interface Coverage
Specified by:
getRenderableImage in class AbstractCoverage
Parameters:
xAxis - Dimension to use for the x axis.
yAxis - Dimension to use for the y axis.
Returns:
A 2D view of this coverage as a renderable image.
Throws:
java.lang.UnsupportedOperationException - if this optional operation is not supported.
java.lang.IndexOutOfBoundsException - if xAxis or yAxis is out of bounds.

getAsImage

public java.awt.image.BufferedImage getAsImage(int xAxis,
                                               int yAxis)
this is a deegree convenience method which returns the source image of an ImageGridCoverage. In procipal the same can be done with the getRenderableImage(int xAxis, int yAxis) method. but creating a RenderableImage image is very slow. I xAxis or yAxis <= 0 then the size of the returned image will be calculated from the source images of the coverage.

Specified by:
getAsImage in class AbstractGridCoverage
Parameters:
xAxis - Dimension to use for the x axis.
yAxis - Dimension to use for the y axis.
Returns:
the source image of an ImageGridCoverage.

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org