Class RMImageReader

java.lang.Object
com.inductiveautomation.rm.graphics.RMImageReader
All Implemented Interfaces:
RMImageData.ImageReader

public class RMImageReader extends 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 Details

    • RMImageReader

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

    • canRead

      public static boolean canRead(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 String getType(byte[] bytes)
      Returns the type of the image bytes provided.
    • getImageData

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

      public void readBasicInfo(RMImageData anImageData)
      Reads basic image info.
      Specified by:
      readBasicInfo in interface RMImageData.ImageReader
    • readBasicInfoJPG

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

      public BufferedImage readImage(RMImageData anImageData)
      Reads the buffered image.
      Specified by:
      readImage in interface RMImageData.ImageReader
    • readBytesDecoded

      public void readBytesDecoded()
      Loads and sets the decoded bytes for the image data.
      Specified by:
      readBytesDecoded in interface RMImageData.ImageReader