- java.lang.Object
-
- java.lang.Enum<ImageReadMethod>
-
- com.uddernetworks.newocr.train.ImageReadMethod
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ImageReadMethod>
,java.lang.constant.Constable
,java.util.function.Function<java.io.File,java.util.Optional<java.awt.image.BufferedImage>>
public enum ImageReadMethod extends java.lang.Enum<ImageReadMethod> implements java.util.function.Function<java.io.File,java.util.Optional<java.awt.image.BufferedImage>>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description IMAGE_ICON
This read method uses theOCRUtils.readImage(File)
to read the given file.IMAGEIO
This read method simply usesImageIO.read(File)
to read the given file.IMAGEIO_STREAM
This read method uses aFileInputStream
along withImageIO.read(InputStream)
to read the mage.
-
Method Summary
Modifier and Type Method Description static ImageReadMethod
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ImageReadMethod[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
IMAGEIO
public static final ImageReadMethod IMAGEIO
This read method simply usesImageIO.read(File)
to read the given file. This method does have unexpected caching during quick and repetitive reading the same image in some scenarios.
-
IMAGE_ICON
public static final ImageReadMethod IMAGE_ICON
This read method uses theOCRUtils.readImage(File)
to read the given file. It is the fastest of all 3 methods, but has unexpected caching during quick and repetitive reading of the same image in some scenarios.
-
IMAGEIO_STREAM
public static final ImageReadMethod IMAGEIO_STREAM
This read method uses aFileInputStream
along withImageIO.read(InputStream)
to read the mage. This method is the slowest, but does not produce the unexpected caching that the other read methods have.
-
-
Method Detail
-
values
public static ImageReadMethod[] 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 ImageReadMethod valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-