Class BasicMorphology

All Implemented Interfaces:
Cloneable, ArrayProcessor, ArrayProcessorWithContextSwitching, Morphology

public class BasicMorphology extends AbstractMorphology implements Morphology

The simplest complete implementation of Morphology interface. This implementation complies with the strict definition of dilation and erosion specified in comments to Morphology.dilation(Matrix, Pattern) and Morphology.erosion(Matrix, Pattern) methods.

This class provides essential optimization for non-"lazy" dilation and erosion, performed by Morphology.dilation(Matrix, Pattern) and Morphology.erosion(Matrix, Pattern) methods, for most types of patterns. So, usually you should use these method, but not Morphology.asDilation(Matrix, Pattern) and Morphology.asErosion(Matrix, Pattern).

Some methods of the returned object can throw TooLargeArrayException in a very improbable situation when the source matrix length (number of elements) is greater than Long.MAX_VALUE/2=262-1.

This class is immutable and thread-safe: there are no ways to modify settings of the created instance.

Author:
Daniel Alievsky