Package com.idrsolutions.image.jpeg
Class JpegDecoder
- java.lang.Object
-
- com.idrsolutions.image.JDeliImage
-
- com.idrsolutions.image.jpeg.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 com.idrsolutions.image.jpeg.data.Info
getInfo()
Returns the JPEG information objectBufferedImage
read(byte[] jpegRawData)
Make NO assumptions about BufferedImage type returned as it may changeBufferedImage
read(File file)
Make NO assumptions about BufferedImage type returned as it may changebyte[]
readAsUnconvertedBytes(byte[] jpegRawData, int adobeColorTransform)
Not recommended for external use.byte[]
readComponentsAsRawBytes(byte[] jpegRawData)
Not recommended for external use.void
setInverted(boolean inverted)
Not recommended for external use.
-
-
-
Method Detail
-
read
public BufferedImage read(byte[] jpegRawData) throws Exception
Make NO assumptions about BufferedImage type returned as it may changeDecodes and returns the JPEG image as a BufferedImage from bytes
- Specified by:
read
in interfacecom.idrsolutions.image.Decoder
- Parameters:
jpegRawData
- byte[] containing the JPEG data to be decoded- Returns:
- BufferedImage The decoded image
- Throws:
Exception
-
read
public BufferedImage read(File file) throws Exception
Make NO assumptions about BufferedImage type returned as it may changeDecodes and returns the JPEG image as a BufferedImage from bytes
- Parameters:
file
- file containing the JPEG data to be decoded- Returns:
- BufferedImage The decoded image
- Throws:
Exception
-
readComponentsAsRawBytes
public byte[] readComponentsAsRawBytes(byte[] jpegRawData) throws 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:
Exception
- Provides for different exceptions thrown under Java Lang package
-
readAsUnconvertedBytes
public byte[] readAsUnconvertedBytes(byte[] jpegRawData, int adobeColorTransform) throws 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 bytesadobeColorTransform
-- Returns:
- converted JPEG byte[]
- Throws:
Exception
- Provides for different exceptions thrown under java Lang package
-
setInverted
public void setInverted(boolean inverted)
Not recommended for external use. Inverts CMYK- Parameters:
inverted
- set true for CMYK inversion
-
getInfo
public com.idrsolutions.image.jpeg.data.Info getInfo()
Returns the JPEG information object- Returns:
- JPEG information object
-
-