Package com.idrsolutions.image.jpegxl
Class JpegXLDecoder
java.lang.Object
com.idrsolutions.image.JDeliImage
com.idrsolutions.image.jpegxl.JpegXLDecoder
- All Implemented Interfaces:
com.idrsolutions.image.Decoder
public class JpegXLDecoder
extends com.idrsolutions.image.JDeliImage
implements com.idrsolutions.image.Decoder
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intOutput samples are sRGB gray, one byte per pixelstatic final intOutput samples are sRGB, three bytes per pixel in RGB orderFields inherited from class com.idrsolutions.image.JDeliImage
bb -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the colour space of the samples returned by the last call toreadComponentsAsBytes(byte[]),CS_GRAYSCALEorCS_SRGB, or -1 if not yet called.booleanisReadable(byte[] data) Checks whether the jpeg xl image data can be decoded, by validating its structure without decoding the pixelsbooleanisReadable(File imageFile) Checks whether the jpeg xl image file can be decoded, by validating its structure without decoding the pixelsread(byte[] jpegxlRawData) Make NO assumptions about BufferedImage type returned as it may changeMake NO assumptions about BufferedImage type returned as it may changebyte[]readComponentsAsBytes(byte[] jpegxlRawData) Decodes the JPEG XL image to interleaved 8 bit samples converted to sRGB, without creating a BufferedImage.readDimension(byte[] data) readDimension(File imageFile) Methods inherited from class com.idrsolutions.image.JDeliImage
optimiseImageMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.idrsolutions.image.Decoder
getImageCount, getImageCount, readEmbeddedThumbnail, readEmbeddedThumbnail, readImageAt, readImageAt, readImageSpecificMetaData, readImageSpecificMetaData, setMetadata
-
Field Details
-
CS_GRAYSCALE
public static final int CS_GRAYSCALEOutput samples are sRGB gray, one byte per pixel- See Also:
-
CS_SRGB
public static final int CS_SRGBOutput samples are sRGB, three bytes per pixel in RGB order- See Also:
-
-
Constructor Details
-
JpegXLDecoder
public JpegXLDecoder()
-
-
Method Details
-
readComponentsAsBytes
Decodes the JPEG XL image to interleaved 8 bit samples converted to sRGB, without creating a BufferedImage. Gray images have one byte per pixel and colour images three bytes per pixel in RGB order, usegetColorSpace()afterwards to find out which.- Parameters:
jpegxlRawData- byte[] containing the JPEG XL data to be decoded- Returns:
- byte[] of the decoded samples
- Throws:
Exception- if an error occurs in reading image
-
getColorSpace
public int getColorSpace()Returns the colour space of the samples returned by the last call toreadComponentsAsBytes(byte[]),CS_GRAYSCALEorCS_SRGB, or -1 if not yet called.- Returns:
- the colour space of the samples returned by the last call to
readComponentsAsBytes(byte[]),CS_GRAYSCALEorCS_SRGB, or -1 if not yet called
-
read
Make NO assumptions about BufferedImage type returned as it may changeDecodes and returns the JPEG XL image as a BufferedImage from bytes
- Specified by:
readin interfacecom.idrsolutions.image.Decoder- Parameters:
jpegxlRawData- byte[] containing the JPEG XL 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 XL image as a BufferedImage
- Specified by:
readin interfacecom.idrsolutions.image.Decoder- Parameters:
file- file containing the JPEG XL data to be decoded- Returns:
- BufferedImage The decoded image
- Throws:
Exception- if an error occurs in reading image
-
readDimension
- Specified by:
readDimensionin interfacecom.idrsolutions.image.Decoder- Throws:
Exception
-
isReadable
Checks whether the jpeg xl image data can be decoded, by validating its structure without decoding the pixels- Specified by:
isReadablein interfacecom.idrsolutions.image.Decoder- Parameters:
data- jpeg xl image data- Returns:
- true if the image can be decoded
- Throws:
Exception- if problem reading image
-
isReadable
Checks whether the jpeg xl image file can be decoded, by validating its structure without decoding the pixels- Specified by:
isReadablein interfacecom.idrsolutions.image.Decoder- Parameters:
imageFile- jpeg xl image file- Returns:
- true if the image can be decoded
- Throws:
Exception- if problem reading image
-
readDimension
- Specified by:
readDimensionin interfacecom.idrsolutions.image.Decoder- Throws:
Exception
-