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

public static enum Morphology.SubtractionMode extends Enum<Morphology.SubtractionMode>

Subtraction mode for some methods of Morphology interface.

The following morphology methods:

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.

  • Enum Constant Details

  • Method Details

    • values

      public static Morphology.SubtractionMode[] 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

      public static Morphology.SubtractionMode valueOf(String name)
      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 name
      NullPointerException - if the argument is null