Package org.apache.pdfbox.filter
Class DCTFilter
- java.lang.Object
-
- org.apache.pdfbox.filter.Filter
-
- org.apache.pdfbox.filter.DCTFilter
-
final class DCTFilter extends Filter
Decompresses data encoded using a DCT (discrete cosine transform) technique based on the JPEG standard.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringADOBEprivate static org.apache.commons.logging.LogLOGprivate static intPOS_TRANSFORM-
Fields inherited from class org.apache.pdfbox.filter.Filter
SYSPROP_DEFLATELEVEL
-
-
Constructor Summary
Constructors Constructor Description DCTFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private intclamp(float value)DecodeResultdecode(java.io.InputStream encoded, java.io.OutputStream decoded, COSDictionary parameters, int index)Decodes data, producing the original non-encoded data.DecodeResultdecode(java.io.InputStream encoded, java.io.OutputStream decoded, COSDictionary parameters, int index, DecodeOptions options)Decodes data, with optional DecodeOptions.protected voidencode(java.io.InputStream input, java.io.OutputStream encoded, COSDictionary parameters)private java.awt.image.WritableRasterfromBGRtoRGB(java.awt.image.Raster raster)private java.awt.image.WritableRasterfromYCCKtoCMYK(java.awt.image.Raster raster)private java.lang.IntegergetAdobeTransform(javax.imageio.metadata.IIOMetadata metadata)private intgetAdobeTransformByBruteForce(javax.imageio.stream.ImageInputStream iis)private java.lang.StringgetNumChannels(javax.imageio.ImageReader reader)private java.awt.image.RasterreadImageRaster(javax.imageio.ImageReader reader, javax.imageio.ImageReadParam irp)-
Methods inherited from class org.apache.pdfbox.filter.Filter
decode, encode, findImageReader, findRasterReader, getCompressionLevel, getDecodeParams
-
-
-
-
Field Detail
-
LOG
private static final org.apache.commons.logging.Log LOG
-
POS_TRANSFORM
private static final int POS_TRANSFORM
- See Also:
- Constant Field Values
-
ADOBE
private static final java.lang.String ADOBE
- See Also:
- Constant Field Values
-
-
Method Detail
-
decode
public DecodeResult decode(java.io.InputStream encoded, java.io.OutputStream decoded, COSDictionary parameters, int index, DecodeOptions options) throws java.io.IOException
Description copied from class:FilterDecodes data, with optional DecodeOptions. Not all filters support all options, and so callers should check the options'honoredflag to test if they were applied.- Overrides:
decodein classFilter- Parameters:
encoded- the encoded byte streamdecoded- the stream where decoded data will be writtenparameters- the parameters used for decodingindex- the index to the filter being decodedoptions- additional options for decoding- Returns:
- repaired parameters dictionary, or the original parameters dictionary
- Throws:
java.io.IOException- if the stream cannot be decoded
-
readImageRaster
private java.awt.image.Raster readImageRaster(javax.imageio.ImageReader reader, javax.imageio.ImageReadParam irp) throws java.io.IOException- Throws:
java.io.IOException
-
decode
public DecodeResult decode(java.io.InputStream encoded, java.io.OutputStream decoded, COSDictionary parameters, int index) throws java.io.IOException
Description copied from class:FilterDecodes data, producing the original non-encoded data.- Specified by:
decodein classFilter- Parameters:
encoded- the encoded byte streamdecoded- the stream where decoded data will be writtenparameters- the parameters used for decodingindex- the index to the filter being decoded- Returns:
- repaired parameters dictionary, or the original parameters dictionary
- Throws:
java.io.IOException- if the stream cannot be decoded
-
getAdobeTransform
private java.lang.Integer getAdobeTransform(javax.imageio.metadata.IIOMetadata metadata)
-
getAdobeTransformByBruteForce
private int getAdobeTransformByBruteForce(javax.imageio.stream.ImageInputStream iis) throws java.io.IOException- Throws:
java.io.IOException
-
fromYCCKtoCMYK
private java.awt.image.WritableRaster fromYCCKtoCMYK(java.awt.image.Raster raster)
-
fromBGRtoRGB
private java.awt.image.WritableRaster fromBGRtoRGB(java.awt.image.Raster raster)
-
getNumChannels
private java.lang.String getNumChannels(javax.imageio.ImageReader reader)
-
clamp
private int clamp(float value)
-
encode
protected void encode(java.io.InputStream input, java.io.OutputStream encoded, COSDictionary parameters) throws java.io.IOException
-
-