Enum ImageChannelConfiguration

java.lang.Object
java.lang.Enum<ImageChannelConfiguration>
com.itextpdf.pdfocr.onnx.ImageChannelConfiguration
All Implemented Interfaces:
Serializable, Comparable<ImageChannelConfiguration>, java.lang.constant.Constable

public enum ImageChannelConfiguration extends Enum<ImageChannelConfiguration>
Enumeration of supported image channel configuration for buffers. These are used, when we need to provide an input to an ML model from an image.
  • Enum Constant Details

    • GRAYSCALE

      public static final ImageChannelConfiguration GRAYSCALE
      Image is represented with a single channel, which contains the grayscale version of the image.
    • RGB

      public static final ImageChannelConfiguration RGB
      Image is represented with three channels: red, green, blue.
    • BGR

      public static final ImageChannelConfiguration BGR
      Image is represented with three channels: blue, green, red.
  • Method Details

    • values

      public static ImageChannelConfiguration[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ImageChannelConfiguration valueOf (String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • getChannelCount

      public int getChannelCount()
      Returns the amount of channels used to store the image.
      Returns:
      the amount of channels used to store the image
    • getRedChannelIndex

      public int getRedChannelIndex()
      Returns the index of the red channel in the resulting ML input buffer.
      Returns:
      the index of the red channel in the resulting ML input buffer
    • getGreenChannelIndex

      public int getGreenChannelIndex()
      Returns the index of the green channel in the resulting ML input buffer.
      Returns:
      the index of the green channel in the resulting ML input buffer
    • getBlueChannelIndex

      public int getBlueChannelIndex()
      Returns the index of the blue channel in the resulting ML input buffer.
      Returns:
      the index of the blue channel in the resulting ML input buffer