Class GridIndexer2D.ZeroValueIndexer

java.lang.Object
imagingbook.common.image.GridIndexer2D
imagingbook.common.image.GridIndexer2D.ZeroValueIndexer
All Implemented Interfaces:
Cloneable
Enclosing class:
GridIndexer2D

public static class GridIndexer2D.ZeroValueIndexer extends GridIndexer2D
This indexer returns -1 for coordinates outside the image bounds, indicating that a (predefined) default value should be used. There is no public constructor. To instantiate use method GridIndexer2D.create(int, int, OutOfBoundsStrategy) with OutOfBoundsStrategy.ZeroValues.
  • Method Details

    • getIndex

      public int getIndex(int u, int v)
      Description copied from class: GridIndexer2D
      Returns the 1D array index for a given pair of image coordinates. For u, v coordinates outside the image, the returned index depends on the concrete sub-class of GridIndexer2D. As a general rule, this method either returns a valid 1D array index or throws an exception. Subclasses implement (override) this method.
      Specified by:
      getIndex in class GridIndexer2D
      Parameters:
      u - x-coordinate
      v - y-coordinate
      Returns:
      1D array index