Class ImageLayout2

Object
ImageLayout
ImageLayout2
All Implemented Interfaces:
Serializable, Cloneable

public class ImageLayout2 extends ImageLayout
Extends the standard ImageN 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
Author:
Simone Giannecchini, GeoSolutions S.A.S., Daniele Romagnoli, GeoSolutions S.A.S.
See Also:
  • Field Summary

    Fields inherited from class 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, WIDTH_MASK
  • Constructor Summary

    Constructors
    Constructor
    Description
    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.
    Construct an ImageLayout2 on top of a RenderedImage.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
    Returns the hash code for this ImageLayout2.

    Methods inherited from class 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 Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • 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 Details

    • 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 ImageLayout
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class ImageLayout