Class RMImageReader

  • All Implemented Interfaces:
    RMImageData.ImageReader

    public class RMImageReader
    extends java.lang.Object
    implements RMImageData.ImageReader
    Uses ImageIO or JAI to read an image, its basic info and its decoded bytes. The reader tries to provide basic info without loading the entire image file into memory. Decoded bytes are only needed by things like PDF and Flash writers.
    • Constructor Summary

      Constructors 
      Constructor Description
      RMImageReader​(RMImageData anImageData)
      Creates a new image reader for given image data.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean canRead​(byte[] bytes)
      Returns whether image reader can read the file provided in the byte array.
      static boolean canRead​(java.lang.String anExt)
      Returns whether image reader can read files with given extension.
      RMImageData getImageData()
      Returns the image data.
      static java.lang.String getType​(byte[] bytes)
      Returns the type of the image bytes provided.
      void readBasicInfo​(RMImageData anImageData)
      Reads basic image info.
      void readBasicInfoJPG()
      Reads basic image info specifically optimized for JPEG images (without having to create Java RenderedImage).
      void readBytesDecoded()
      Loads and sets the decoded bytes for the image data.
      java.awt.image.BufferedImage readImage​(RMImageData anImageData)
      Reads the buffered image.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RMImageReader

        public RMImageReader​(RMImageData anImageData)
        Creates a new image reader for given image data.
    • Method Detail

      • canRead

        public static boolean canRead​(java.lang.String anExt)
        Returns whether image reader can read files with given extension.
      • canRead

        public static boolean canRead​(byte[] bytes)
        Returns whether image reader can read the file provided in the byte array.
      • getType

        public static java.lang.String getType​(byte[] bytes)
        Returns the type of the image bytes provided.
      • getImageData

        public RMImageData getImageData()
        Returns the image data.
      • readBasicInfoJPG

        public void readBasicInfoJPG()
        Reads basic image info specifically optimized for JPEG images (without having to create Java RenderedImage).