Class Jpeg2000Decoder

java.lang.Object
com.idrsolutions.image.JDeliImage
com.idrsolutions.image.jpeg2000.Jpeg2000Decoder
All Implemented Interfaces:
com.idrsolutions.image.Decoder

public class Jpeg2000Decoder extends com.idrsolutions.image.JDeliImage implements com.idrsolutions.image.Decoder
Class reads JPEG2000 images as BufferedImage //Make NO assumptions about type of BufferedImage type returned as this may change Example:

 Jpeg2000Decoder decoder = new Jpeg2000Decoder();
 BufferedImage decodedImage = decoder.read(jpxByteData);
 
  • Field Summary

    Fields inherited from class com.idrsolutions.image.JDeliImage

    bb
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.idrsolutions.image.jpeg2000.data.Info
     
    read(byte[] jpxRawData)
    Make NO assumptions about BufferedImage type returned as it may change
    read(File file)
    Make NO assumptions about BufferedImage type returned as it may change
    byte[]
    Not recommended for external use.
    readDimension(byte[] jp2RawData)
    Decodes and returns the width and height of jpeg2000 image
    Decodes and returns the width and height of jpeg2000 image
    static void
    updatePrecinctInfo(com.idrsolutions.image.jpeg2000.data.TileResolution resolution, int r, int ppx, int ppy)
     

    Methods inherited from class com.idrsolutions.image.JDeliImage

    optimiseImage

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.idrsolutions.image.Decoder

    getImageCount, getImageCount, readEmbeddedThumbnail, readEmbeddedThumbnail, readImageAt, readImageAt, readImageSpecificMetaData, readImageSpecificMetaData, setMetadata
  • Constructor Details

    • Jpeg2000Decoder

      public Jpeg2000Decoder()
  • Method Details

    • read

      public BufferedImage read(byte[] jpxRawData) throws Exception
      Make NO assumptions about BufferedImage type returned as it may change

      Decodes and returns the JPEG2000 image as a BufferedImage.

      Specified by:
      read in interface com.idrsolutions.image.Decoder
      Parameters:
      jpxRawData - byte[] array containing the JPEG2000 data to be decoded
      Returns:
      BufferedImage The decoded image
      Throws:
      Exception - A Exception
    • readDimension

      public Rectangle readDimension(File file) throws Exception
      Decodes and returns the width and height of jpeg2000 image
      Specified by:
      readDimension in interface com.idrsolutions.image.Decoder
      Parameters:
      file - image image contained in raw data if present
      Returns:
      width and height of image
      Throws:
      Exception - if problem reading image
    • readDimension

      public Rectangle readDimension(byte[] jp2RawData) throws Exception
      Decodes and returns the width and height of jpeg2000 image
      Specified by:
      readDimension in interface com.idrsolutions.image.Decoder
      Parameters:
      jp2RawData - image image contained in raw data if present
      Returns:
      Rectangle width and height of image
      Throws:
      Exception - if problem reading image
    • getInfo

      public com.idrsolutions.image.jpeg2000.data.Info getInfo()
    • read

      public BufferedImage read(File file) throws Exception
      Make NO assumptions about BufferedImage type returned as it may change

      Decodes and returns the JPEG2000 image as a BufferedImage.

      Specified by:
      read in interface com.idrsolutions.image.Decoder
      Parameters:
      file - file containing the JPEG2000 data to be decoded
      Returns:
      BufferedImage The decoded image
      Throws:
      Exception - A Exception
    • updatePrecinctInfo

      public static void updatePrecinctInfo(com.idrsolutions.image.jpeg2000.data.TileResolution resolution, int r, int ppx, int ppy)
    • readComponentsAsUnConvertedBytes

      public byte[] readComponentsAsUnConvertedBytes(byte[] jpxRawData) throws Exception
      Not recommended for external use.

      Decodes JPEG2000 image data as un-converted RGB/gray image bytes

      Parameters:
      jpxRawData - byte[] array containing the raw JPEG data
      Returns:
      un-converted byte[]
      Throws:
      Exception - Provides for different exceptions thrown under java Lang package