java.lang.Object
imagingbook.common.image.GridIndexer2D
imagingbook.common.image.GridIndexer2D.ExceptionIndexer
- All Implemented Interfaces:
Cloneable
- Enclosing class:
- 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
.-
Nested Class Summary
Nested classes/interfaces inherited from class imagingbook.common.image.GridIndexer2D
GridIndexer2D.ExceptionIndexer, GridIndexer2D.MirrorImageIndexer, GridIndexer2D.NearestBorderIndexer, GridIndexer2D.OutOfImageException, GridIndexer2D.ZeroValueIndexer
-
Field Summary
Fields inherited from class imagingbook.common.image.GridIndexer2D
DefaultOutOfBoundsStrategy
-
Method Summary
Modifier and TypeMethodDescriptionint
getIndex
(int u, int v) Returns the 1D array index for a given pair of image coordinates.Methods inherited from class imagingbook.common.image.GridIndexer2D
create, getHeight, getOutOfBoundsStrategy, getWidth
-
Method Details
-
getIndex
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 ofGridIndexer2D
. 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 classGridIndexer2D
- Parameters:
u
- x-coordinatev
- y-coordinate- Returns:
- 1D array index
- Throws:
GridIndexer2D.OutOfImageException
-