Class GridIndexer2D.NearestBorderIndexer

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

This indexer returns the closest border pixel for coordinates outside the image bounds. This is the most common method. There is no public constructor. To instantiate use method GridIndexer2D.create(int, int, OutOfBoundsStrategy) with OutOfBoundsStrategy.NearestBorder.
  • 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