Enum Class StackRGBState

Object
Enum<StackRGBState>
StackRGBState
All Implemented Interfaces:
Serializable, Comparable<StackRGBState>, Constable

public enum StackRGBState extends Enum<StackRGBState>
Whether a stack is RGB or RGBA or neither.
Author:
Owen Feehan
  • Enum Constant Details

    • NOT_RGB

      public static final StackRGBState NOT_RGB
      Not a RGB image.
    • RGB_WITHOUT_ALPHA

      public static final StackRGBState RGB_WITHOUT_ALPHA
      RGB without any alpha channel.
    • RGB_WITH_ALPHA

      public static final StackRGBState RGB_WITH_ALPHA
      RGB with a alpha channel.
  • Method Details

    • values

      public static StackRGBState[] 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 StackRGBState 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
    • multiplex

      public static StackRGBState multiplex(boolean rgb, boolean withAlpha)
      Returns one of the three RGB_ states based upon two boolean flags.
      Parameters:
      rgb - true if RGB or RGBA, false otherwise.
      withAlpha - true if alpha is present, false if it is not. Ignored when rgb==false.
      Returns:
      RGB_WITHOUT_ALPHA or RGB_WITH_ALPHA as matches withAlpha.
    • multiplexAlpha

      public static StackRGBState multiplexAlpha(boolean withAlpha)
      Returns one of the two RGB_ states based upon a boolean flag.
      Parameters:
      withAlpha - true if alpha is present, false if it is not.
      Returns:
      RGB_WITHOUT_ALPHA or RGB_WITH_ALPHA as matches withAlpha.
    • min

      public StackRGBState min(StackRGBState other)
      Finds the minimum of this value and another, according to an ordering.

      The ordering is increasingly: NOT_RGB, RGB_WITHOUT_ALPHA, RGB_WITH_ALPHA.

      Parameters:
      other - the other.
      Returns:
      the minimum state among the two, according to the ordering.
    • max

      public StackRGBState max(StackRGBState other)
      Finds the maximum of this value and another, according to an ordering.

      The ordering is increasingly: NOT_RGB, RGB_WITHOUT_ALPHA, RGB_WITH_ALPHA.

      Parameters:
      other - the other.
      Returns:
      the maximum state among the two, according to the ordering.