Package net.algart.matrices.morphology
Enum Class Morphology.SubtractionMode
java.lang.Object
java.lang.Enum<Morphology.SubtractionMode>
net.algart.matrices.morphology.Morphology.SubtractionMode
- All Implemented Interfaces:
Serializable
,Comparable<Morphology.SubtractionMode>
,Constable
- Enclosing interface:
Morphology
Subtraction mode for some methods of Morphology
interface.
The following morphology methods:
Morphology.dilation(Matrix, Pattern, Morphology.SubtractionMode)
,Morphology.erosion(Matrix, Pattern, Morphology.SubtractionMode)
,Morphology.dilationErosion(Matrix, Pattern, Pattern, Morphology.SubtractionMode)
,Morphology.erosionDilation(Matrix, Pattern, Pattern, Morphology.SubtractionMode)
,Morphology.closing(Matrix, Pattern, Morphology.SubtractionMode)
,Morphology.opening(Matrix, Pattern, Morphology.SubtractionMode)
,
vary their behaviour depending on the last argument of this type.
The usual behaviour, corresponding to names of the methods, obtains when this argument is NONE
.
However, if this argument is SUBTRACT_RESULT_FROM_SRC
or SUBTRACT_SRC_FROM_RESULT
,
every method, after calculating the result R by usual rules,
automatically performs elementwise subtraction
either the result R from the source matrix A (the 1st argument),
or the source matrix A from the result R.
Namely:
- if the last argument is
SUBTRACT_RESULT_FROM_SRC
, every of the listed methods returns the elementwise positive difference max(0,A-R); - if the last argument is
SUBTRACT_SRC_FROM_RESULT
, every of the listed methods returns the elementwise positive difference max(0,R-A); - if the last argument is
NONE
, no additional subtractions are performed: the method just returns R.
Note that the byte and short elements are considered to be unsigned integers while subtraction.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionNo subtractions are performed: standard behaviour.The result of calculations is subtracted from the source matrix, and the (positive) difference is returned.The source matrix is subtracted from the result of calculations, and the (positive) difference is returned. -
Method Summary
Modifier and TypeMethodDescriptionstatic Morphology.SubtractionMode
Returns the enum constant of this class with the specified name.static Morphology.SubtractionMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No subtractions are performed: standard behaviour. Seecomments to this enumeration
for more details. -
SUBTRACT_RESULT_FROM_SRC
The result of calculations is subtracted from the source matrix, and the (positive) difference is returned. Seecomments to this enumeration
for more details. -
SUBTRACT_SRC_FROM_RESULT
The source matrix is subtracted from the result of calculations, and the (positive) difference is returned. Seecomments to this enumeration
for more details.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-