org.jaitools.imageutils
Class ImageLayout2

java.lang.Object
  extended by javax.media.jai.ImageLayout
      extended by org.jaitools.imageutils.ImageLayout2
All Implemented Interfaces:
Serializable, Cloneable

public class ImageLayout2
extends javax.media.jai.ImageLayout

Extends the standard JAI ImageLayout to provide a reliable hash function. ImageLayout has a bug that will cause an application to crash if doing hashing when some fields have not been initialized.

Since:
1.1
Version:
$Id$
Author:
Simone Giannecchini, GeoSolutions S.A.S., Daniele Romagnoli, GeoSolutions S.A.S.
See Also:
ImageLayout, Serialized Form

Field Summary
 
Fields inherited from class javax.media.jai.ImageLayout
COLOR_MODEL_MASK, HEIGHT_MASK, MIN_X_MASK, MIN_Y_MASK, SAMPLE_MODEL_MASK, TILE_GRID_X_OFFSET_MASK, TILE_GRID_Y_OFFSET_MASK, TILE_HEIGHT_MASK, TILE_WIDTH_MASK, validMask, WIDTH_MASK
 
Constructor Summary
ImageLayout2()
          Default constructor.
ImageLayout2(int minX, int minY, int width, int height)
          Construct an ImageLayout2 with only the image's properties set.
ImageLayout2(int minX, int minY, int width, int height, int tileGridXOffset, int tileGridYOffset, int tileWidth, int tileHeight, SampleModel sampleModel, ColorModel colorModel)
          Construct an ImageLayout2 with the parameter set.
ImageLayout2(int tileGridXOffset, int tileGridYOffset, int tileWidth, int tileHeight, SampleModel sampleModel, ColorModel colorModel)
          Construct an ImageLayout2 with only tiling layout properties, sampleModel and colorModel set.
ImageLayout2(RenderedImage im)
          Construct an ImageLayout2 on top of a RenderedImage.
 
Method Summary
 boolean equals(Object obj)
           
 int hashCode()
          Returns the hash code for this ImageLayout2.
 
Methods inherited from class javax.media.jai.ImageLayout
clone, getColorModel, getHeight, getMinX, getMinY, getSampleModel, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getValidMask, getWidth, isValid, setColorModel, setHeight, setMinX, setMinY, setSampleModel, setTileGridXOffset, setTileGridYOffset, setTileHeight, setTileWidth, setValid, setWidth, toString, unsetImageBounds, unsetTileLayout, unsetValid
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImageLayout2

public ImageLayout2()
Default constructor. Constructs an ImageLayout2 without any parameter set.


ImageLayout2

public ImageLayout2(int minX,
                    int minY,
                    int width,
                    int height,
                    int tileGridXOffset,
                    int tileGridYOffset,
                    int tileWidth,
                    int tileHeight,
                    SampleModel sampleModel,
                    ColorModel colorModel)
Construct an ImageLayout2 with the parameter set.

Parameters:
minX - the image's minimum X coordinate.
minY - the image's minimum X coordinate.
width - the image's width.
height - the image's height.
tileGridXOffset - the x coordinate of the tile (0,0)
tileGridYOffset - the y coordinate of the tile (0,0)
tileWidth - the tile's width.
tileHeight - the tile's height.
sampleModel - the image's SampleModel
colorModel - the image's ColorModel

ImageLayout2

public ImageLayout2(int tileGridXOffset,
                    int tileGridYOffset,
                    int tileWidth,
                    int tileHeight,
                    SampleModel sampleModel,
                    ColorModel colorModel)
Construct an ImageLayout2 with only tiling layout properties, sampleModel and colorModel set.

Parameters:
tileGridXOffset - the x coordinate of the tile (0,0)
tileGridYOffset - the y coordinate of the tile (0,0)
tileWidth - the tile's width.
tileHeight - the tile's height.
sampleModel - the image's SampleModel
colorModel - the image's ColorModel

ImageLayout2

public ImageLayout2(int minX,
                    int minY,
                    int width,
                    int height)
Construct an ImageLayout2 with only the image's properties set.

Parameters:
minX - the image's minimum X coordinate.
minY - the image's minimum X coordinate.
width - the image's width.
height - the image's height.

ImageLayout2

public ImageLayout2(RenderedImage im)
Construct an ImageLayout2 on top of a RenderedImage. The layout parameters are set from the related values of the input image.

Parameters:
im - a RenderedImage whose layout will be copied.
Method Detail

hashCode

public int hashCode()
Returns the hash code for this ImageLayout2. With respect to the super ImageLayout, this method also does validity check on the parameters during hashing.

Overrides:
hashCode in class javax.media.jai.ImageLayout

equals

public boolean equals(Object obj)
Overrides:
equals in class javax.media.jai.ImageLayout


Copyright © 2009-2013. All Rights Reserved.