public class DCTDecode extends Object
Constructor and Description |
---|
DCTDecode() |
Modifier and Type | Method and Description |
---|---|
protected static ByteBuffer |
decode(PDFObject dict,
ByteBuffer buf,
PDFObject params)
decode an array of bytes in DCT format.
|
protected static ByteBuffer decode(PDFObject dict, ByteBuffer buf, PDFObject params) throws PDFParseException
DCT is the format used by JPEG images, so this class simply loads the DCT-format bytes as an image, then reads the bytes out of the image to create the array. Unfortunately, their most likely use is to get turned BACK into an image, so this isn't terribly efficient... but is is general... don't hit, please.
The DCT-encoded stream may have 1, 3 or 4 samples per pixel, depending on the colorspace of the image. In decoding, we look for the colorspace in the stream object's dictionary to decide how to decode this image. If no colorspace is present, we guess 3 samples per pixel.
dict
- the stream dictionarybuf
- the DCT-encoded bufferparams
- the parameters to the decoder (ignored)PDFParseException
Copyright © 2024. All rights reserved.