Module NewOCR

Enum 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>>
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Enum

        java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      IMAGE_ICON
      This read method uses the OCRUtils.readImage(File) to read the given file.
      IMAGEIO
      This read method simply uses ImageIO.read(File) to read the given file.
      IMAGEIO_STREAM
      This read method uses a FileInputStream along with ImageIO.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.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.function.Function

        andThen, apply, compose
    • Enum Constant Detail

      • IMAGEIO

        public static final ImageReadMethod IMAGEIO
        This read method simply uses ImageIO.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 the OCRUtils.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 a FileInputStream along with ImageIO.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 name
        java.lang.NullPointerException - if the argument is null