Class 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);
     
    • Constructor Summary

      Constructors 
      Constructor Description
      Jpeg2000Decoder()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.image.BufferedImage read​(byte[] jpxRawData)
      Make NO assumptions about BufferedImage type returned as it may change
      java.awt.image.BufferedImage read​(java.io.File file)
      Make NO assumptions about BufferedImage type returned as it may change
      static byte[] readComponentsAsConvertedBytes​(byte[] jpxRawData)
      Not recommended for external use.
      static byte[] readComponentsAsUnConvertedBytes​(byte[] jpxRawData)
      Not recommended for external use.
      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, readImageAt, setMetadata
    • Constructor Detail

      • Jpeg2000Decoder

        public Jpeg2000Decoder()
    • Method Detail

      • read

        public java.awt.image.BufferedImage read​(byte[] jpxRawData)
                                          throws java.lang.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:
        java.lang.Exception - A Exception
      • read

        public java.awt.image.BufferedImage read​(java.io.File file)
                                          throws java.lang.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:
        java.lang.Exception - A Exception
      • updatePrecinctInfo

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

        public static byte[] readComponentsAsConvertedBytes​(byte[] jpxRawData)
                                                     throws java.lang.Exception
        Not recommended for external use.

        Decodes JPEG2000 image data as RGB/gray image bytes

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

        public static byte[] readComponentsAsUnConvertedBytes​(byte[] jpxRawData)
                                                       throws java.lang.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:
        java.lang.Exception - Provides for different exceptions thrown under java Lang package