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 inherited from class com.idrsolutions.image.JDeliImage
bb
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
decodeSamplesWithOutputBytes
(com.idrsolutions.image.jpeg.data.Info info, byte[] output) read
(byte[] jpegRawData) Make NO assumptions about BufferedImage type returned as it may changeMake NO assumptions about BufferedImage type returned as it may changebyte[]
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.readDimension
(byte[] jpegRawData) Decodes and returns the width and height of jpeg imagereadDimension
(File file) Decodes and returns the width and height of jpeg imagereadEmbeddedThumbnail
(byte[] data) Decodes and returns the thumbnail heic image as BufferedImage if there is an thumbnail otherwise returns nullreadEmbeddedThumbnail
(File file) Decodes and returns the thumbnail heic image as BufferedImage if there is an thumbnail otherwise returns nullMethods 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, readImageAt, readImageAt, readImageSpecificMetaData, readImageSpecificMetaData, setMetadata
-
Field Details
-
ZIGZAGORDER
public static final byte[] ZIGZAGORDER
-
-
Constructor Details
-
JpegDecoder
public JpegDecoder()
-
-
Method Details
-
read
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
- if an error occurs in reading image
-
read
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:
file
- file containing the JPEG data to be decoded- Returns:
- BufferedImage The decoded image
- Throws:
Exception
- if an error occurs in reading image
-
readDimension
Decodes and returns the width and height of jpeg image- Specified by:
readDimension
in interfacecom.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
Decodes and returns the width and height of jpeg image- Specified by:
readDimension
in interfacecom.idrsolutions.image.Decoder
- Parameters:
jpegRawData
- image image contained in raw data if present- Returns:
- Rectangle width and height of image
- Throws:
Exception
- if problem reading image
-
readEmbeddedThumbnail
Decodes and returns the thumbnail heic image as BufferedImage if there is an thumbnail otherwise returns null- Specified by:
readEmbeddedThumbnail
in interfacecom.idrsolutions.image.Decoder
- Parameters:
file
- jpeg file- Returns:
- BufferedImage thumbnail image
- Throws:
Exception
- if problem reading image
-
readEmbeddedThumbnail
Decodes and returns the thumbnail heic image as BufferedImage if there is an thumbnail otherwise returns null- Specified by:
readEmbeddedThumbnail
in interfacecom.idrsolutions.image.Decoder
- Parameters:
data
- jpeg bytes- Returns:
- BufferedImage thumbnail image
- Throws:
Exception
- if problem reading image
-
readComponentsAsRawBytes
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 the Java.Lang package
-
readAsUnconvertedBytes
public byte[] readAsUnconvertedBytes(byte[] jpegRawData, int adobeColorTransform, com.idrsolutions.image.jpeg.data.Info info) 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
- colorspace as defined by Adobe specinfo
- values found in image header- Returns:
- converted JPEG byte[]
- Throws:
Exception
- Provides for different exceptions thrown under java Lang package
-
decodeSamplesWithOutputBytes
public static void decodeSamplesWithOutputBytes(com.idrsolutions.image.jpeg.data.Info info, byte[] output)
-