org.geotools.image
Class ImageDimension

Object
  extended by Dimension2D
      extended by Dimension
          extended by ImageDimension
All Implemented Interfaces:
Serializable, Cloneable

public class ImageDimension
extends Dimension

An image dimension, including the number of bands.

Since:
2.4
Author:
Martin Desruisseaux
See Also:
Serialized Form
Module:

Field Summary
 int numBands
          The number of bands in the image or raster.
 
Fields inherited from class Dimension
height, width
 
Constructor Summary
ImageDimension(Raster raster)
          Creates a new dimension initialized to the dimension of the given raster.
ImageDimension(RenderedImage image)
          Creates a new dimension initialized to the dimension of the given image.
 
Method Summary
 boolean equals(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.
 String toString()
          Returns a string representation of this dimension.
 
Methods inherited from class Dimension
getHeight, getSize, getWidth, setSize, setSize, setSize
 
Methods inherited from class Dimension2D
clone, setSize
 
Methods inherited from class 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(RenderedImage image)
Creates a new dimension initialized to the dimension of the given image.


ImageDimension

public ImageDimension(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(Object object)
Checks whether two dimension objects have equal values.

Overrides:
equals in class Dimension

hashCode

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

Overrides:
hashCode in class Dimension

toString

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

Overrides:
toString in class Dimension


Copyright © 1996-2009 Geotools. All Rights Reserved.