Skip to content

OutOfBoundsStrategy

Wilhelm Burger edited this page May 12, 2023 · 6 revisions

Purpose

The enum type OutOfBoundsStrategy defines the following options for handling pixel coordinates that are outside the image:

  • DefaultValue: Replace out-of-bounds pixels by some default value.
  • NearestBorder: Replace out-of-bounds pixels with the nearest border pixel.
  • MirrorImage: Treat the image as being infinitely mirrored at its borders.
  • PeriodicImage: Treat the image as repeating ininitely in x/y directions.
  • ThrowException: Throw an exception when out-of-boundary coordinates are accessed.

Examples

The following examples show how the original image (marked by the green rectangle) is extended by the different out-of-bounds strategies. The resulting effective images extend to infinity in all directions.

DefaultValue (0)
NearestBorder
MirrorImage
PeriodicImage

See Also

ImagingBook Wiki

Image Processing

2D Geometry

Clone this wiki locally