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.String
ADOBE
private static org.apache.commons.logging.Log
LOG
private static int
POS_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 int
clamp(float value)
DecodeResult
decode(java.io.InputStream encoded, java.io.OutputStream decoded, COSDictionary parameters, int index)
Decodes data, producing the original non-encoded data.DecodeResult
decode(java.io.InputStream encoded, java.io.OutputStream decoded, COSDictionary parameters, int index, DecodeOptions options)
Decodes data, with optional DecodeOptions.protected void
encode(java.io.InputStream input, java.io.OutputStream encoded, COSDictionary parameters)
private java.awt.image.WritableRaster
fromBGRtoRGB(java.awt.image.Raster raster)
private java.awt.image.WritableRaster
fromYCbCrtoCMYK(java.awt.image.Raster raster)
private java.awt.image.WritableRaster
fromYCCKtoCMYK(java.awt.image.Raster raster)
private java.lang.Integer
getAdobeTransform(javax.imageio.metadata.IIOMetadata metadata)
private int
getAdobeTransformByBruteForce(javax.imageio.stream.ImageInputStream iis)
private java.lang.String
getNumChannels(javax.imageio.ImageReader reader)
-
Methods inherited from class org.apache.pdfbox.filter.Filter
encode, findImageReader, 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:Filter
Decodes data, with optional DecodeOptions. Not all filters support all options, and so callers should check the options'honored
flag to test if they were applied.- Overrides:
decode
in 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
-
decode
public DecodeResult decode(java.io.InputStream encoded, java.io.OutputStream decoded, COSDictionary parameters, int index) throws java.io.IOException
Description copied from class:Filter
Decodes data, producing the original non-encoded data.- Specified by:
decode
in 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)
-
fromYCbCrtoCMYK
private java.awt.image.WritableRaster fromYCbCrtoCMYK(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
-
-