Class JpegDecoder

  • All Implemented Interfaces:
    com.idrsolutions.image.Decoder

    public class JpegDecoder
    extends com.idrsolutions.image.JDeliImage
    implements com.idrsolutions.image.Decoder
    Class reads JPEG image as BufferedImage // Make NO assumptions about type of BufferedImage type returned (may change)

    Example:

    
     JpegDecoder decoder = new JpegDecoder();
     BufferedImage decodedImage = decoder.read(jpegByteData);
     
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static byte[] ZIGZAGORDER  
    • Constructor Summary

      Constructors 
      Constructor Description
      JpegDecoder()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.image.BufferedImage read​(byte[] jpegRawData)
      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
      byte[] readAsUnconvertedBytes​(byte[] jpegRawData, int adobeColorTransform, com.idrsolutions.image.jpeg.data.Info info)
      Not recommended for external use.
      byte[] readComponentsAsRawBytes​(byte[] jpegRawData)
      Not recommended for external use.
      • 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
    • Field Detail

      • ZIGZAGORDER

        public static final byte[] ZIGZAGORDER
    • Constructor Detail

      • JpegDecoder

        public JpegDecoder()
    • Method Detail

      • read

        public java.awt.image.BufferedImage read​(byte[] jpegRawData)
                                          throws java.lang.Exception
        Make NO assumptions about BufferedImage type returned as it may change

        Decodes and returns the JPEG image as a BufferedImage from bytes

        Specified by:
        read in interface com.idrsolutions.image.Decoder
        Parameters:
        jpegRawData - byte[] containing the JPEG data to be decoded
        Returns:
        BufferedImage The decoded image
        Throws:
        java.lang.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 JPEG image as a BufferedImage from bytes

        Specified by:
        read in interface com.idrsolutions.image.Decoder
        Parameters:
        file - file containing the JPEG data to be decoded
        Returns:
        BufferedImage The decoded image
        Throws:
        java.lang.Exception
      • readComponentsAsRawBytes

        public byte[] readComponentsAsRawBytes​(byte[] jpegRawData)
                                        throws java.lang.Exception
        Not recommended for external use.

        Decodes JPEG image data as non converted bytes. Please note this method does not perform YCBCR/CMYK/YCCK to RGB/gray conversion.

        Parameters:
        jpegRawData - byte[] containing the raw JPEG data
        Returns:
        byte[] YCBCR converted data of the JPEG
        Throws:
        java.lang.Exception - Provides for different exceptions thrown under Java Lang package
      • readAsUnconvertedBytes

        public byte[] readAsUnconvertedBytes​(byte[] jpegRawData,
                                             int adobeColorTransform,
                                             com.idrsolutions.image.jpeg.data.Info info)
                                      throws java.lang.Exception
        Not recommended for external use.

        Decodes JPEG image data as un-converted(RGB/gray) bytes

        Parameters:
        jpegRawData - byte[] array containing the un-converted JPEG bytes
        adobeColorTransform -
        Returns:
        converted JPEG byte[]
        Throws:
        java.lang.Exception - Provides for different exceptions thrown under java Lang package