Package com.itextpdf.pdfocr.onnx
Enum PaddingStrategy
- All Implemented Interfaces:
-
Serializable,Comparable<PaddingStrategy>,java.lang.constant.Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionImage will be put into the top-left corner.Image will be put into the top-left corner.Image will be put into the top-left corner.Image will be put into the top-left corner.Image will be put into the middle.Image will be put into the middle.Image will be put into the middle.Image will be put into the middle. -
Method Summary
Modifier and TypeMethodDescriptionReturns the solid color used for padding.booleanReturns whether the strategy uses bottom-right padding.booleanReturns whether the strategy uses the edge of the image for padding.booleanReturns whether the strategy uses a solid color for padding.booleanReturns whether the strategy uses symmetric padding.static PaddingStrategyReturns the enum constant of this type with the specified name.static PaddingStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
BOTTOM_RIGHT_BLACK
Image will be put into the top-left corner. Remaining pixels are filled with#000000. -
SYMMETRIC_BLACK
Image will be put into the middle. Remaining pixels are filled with#000000. -
BOTTOM_RIGHT_GRAY
Image will be put into the top-left corner. Remaining pixels are filled with#808080. -
SYMMETRIC_GRAY
Image will be put into the middle. Remaining pixels are filled with#808080. -
BOTTOM_RIGHT_WHITE
Image will be put into the top-left corner. Remaining pixels are filled with#FFFFFF. -
SYMMETRIC_WHITE
Image will be put into the middle. Remaining pixels are filled with#FFFFFF. -
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
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
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
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
Returns the solid color used for padding. If the strategy doesn't use a solid color, returnsnull.- 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
-