Class GridIndexer2D.ExceptionIndexer

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

public static class GridIndexer2D.ExceptionIndexer extends GridIndexer2D
This indexer throws an exception if coordinates outside image bounds are accessed. There is no public constructor. To instantiate use method GridIndexer2D.create(int, int, OutOfBoundsStrategy) with OutOfBoundsStrategy.ThrowException.
  • Method Details

    • getIndex

      public int getIndex(int u, int v) throws GridIndexer2D.OutOfImageException
      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
      Throws:
      GridIndexer2D.OutOfImageException