org.geotools.image
Class ImageDimension

java.lang.Object
  extended by java.awt.geom.Dimension2D
      extended by java.awt.Dimension
          extended by org.geotools.image.ImageDimension
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ImageDimension
extends java.awt.Dimension

An image dimension, including the number of bands.

Since:
2.4
Version:
$Id: ImageDimension.java 30643 2008-06-12 18:27:03Z acuster $
Author:
Martin Desruisseaux
See Also:
Serialized Form

Field Summary
 int numBands
          The number of bands in the image or raster.
 
Fields inherited from class java.awt.Dimension
height, width
 
Constructor Summary
ImageDimension(java.awt.image.Raster raster)
          Creates a new dimension initialized to the dimension of the given raster.
ImageDimension(java.awt.image.RenderedImage image)
          Creates a new dimension initialized to the dimension of the given image.
 
Method Summary
 boolean equals(java.lang.Object object)
          Checks whether two dimension objects have equal values.
 long getMemoryUsage()
          Returns the number of bytes required in order to memorize all sample values.
 long getNumSampleValues()
          Returns the number of sample values.
 int hashCode()
          Returns the hash code for this dimension.
 java.lang.String toString()
          Returns a string representation of this dimension.
 
Methods inherited from class java.awt.Dimension
getHeight, getSize, getWidth, setSize, setSize, setSize
 
Methods inherited from class java.awt.geom.Dimension2D
clone, setSize
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

numBands

public int numBands
The number of bands in the image or raster.

Constructor Detail

ImageDimension

public ImageDimension(java.awt.image.RenderedImage image)
Creates a new dimension initialized to the dimension of the given image.


ImageDimension

public ImageDimension(java.awt.image.Raster raster)
Creates a new dimension initialized to the dimension of the given raster.

Method Detail

getNumSampleValues

public long getNumSampleValues()
Returns the number of sample values. This is the product of width, height and numBands.


getMemoryUsage

public long getMemoryUsage()
Returns the number of bytes required in order to memorize all sample values. The sample values size is determined by the image or raster given at construction time.


equals

public boolean equals(java.lang.Object object)
Checks whether two dimension objects have equal values.

Overrides:
equals in class java.awt.Dimension

hashCode

public int hashCode()
Returns the hash code for this dimension.

Overrides:
hashCode in class java.awt.Dimension

toString

public java.lang.String toString()
Returns a string representation of this dimension.

Overrides:
toString in class java.awt.Dimension


Copyright © 1996-2010 Geotools. All Rights Reserved.