Enum PaddingStrategy

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

public enum PaddingStrategy extends Enum<PaddingStrategy>
Enumeration of implemented padding strategies for padding images. These are used, when we need to adapt the image to fit an input of a ML model.
  • Enum Constant Details

    • BOTTOM_RIGHT_BLACK

      public static final PaddingStrategy BOTTOM_RIGHT_BLACK
      Image will be put into the top-left corner. Remaining pixels are filled with #000000.
    • SYMMETRIC_BLACK

      public static final PaddingStrategy SYMMETRIC_BLACK
      Image will be put into the middle. Remaining pixels are filled with #000000.
    • BOTTOM_RIGHT_GRAY

      public static final PaddingStrategy BOTTOM_RIGHT_GRAY
      Image will be put into the top-left corner. Remaining pixels are filled with #808080.
    • SYMMETRIC_GRAY

      public static final PaddingStrategy SYMMETRIC_GRAY
      Image will be put into the middle. Remaining pixels are filled with #808080.
    • BOTTOM_RIGHT_WHITE

      public static final PaddingStrategy BOTTOM_RIGHT_WHITE
      Image will be put into the top-left corner. Remaining pixels are filled with #FFFFFF.
    • SYMMETRIC_WHITE

      public static final PaddingStrategy SYMMETRIC_WHITE
      Image will be put into the middle. Remaining pixels are filled with #FFFFFF.
    • BOTTOM_RIGHT_EDGE

      public static final PaddingStrategy BOTTOM_RIGHT_EDGE
      Image will be put into the top-left corner. Pixels to the right are repeats of the right-most pixel column of the image. Pixels to the top are repeats of the top-most pixel row of the image.
    • SYMMETRIC_EDGE

      public static final PaddingStrategy SYMMETRIC_EDGE
      Image will be put into the middle. Pixels to the left and to the right are repeats of the left-most and the right-most pixel columns of the image respectfully. Pixels to the bottom and to the top are repeats of the bottom-most and the top-most pixel rows of the image.
  • Method Details

    • values

      public static PaddingStrategy[] 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 PaddingStrategy 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
    • getSolidColor

      public Color getSolidColor()
      Returns the solid color used for padding. If the strategy doesn't use a solid color, returns null.
      Returns:
      the solid color used for padding, or null
    • usesSolidColor

      public boolean usesSolidColor()
      Returns whether the strategy uses a solid color for padding.
      Returns:
      whether the strategy uses a solid color for padding
    • usesImageEdge

      public boolean usesImageEdge()
      Returns whether the strategy uses the edge of the image for padding.
      Returns:
      whether the strategy uses the edge of the image for padding
    • usesSymmetricPadding

      public boolean usesSymmetricPadding()
      Returns whether the strategy uses symmetric padding.
      Returns:
      whether the strategy uses symmetric padding
    • usesBottomRightPadding

      public boolean usesBottomRightPadding()
      Returns whether the strategy uses bottom-right padding.
      Returns:
      whether the strategy uses bottom-right padding