Package org.apache.pdfbox.filter
Class DCTFilter
java.lang.Object
org.apache.pdfbox.filter.Filter
org.apache.pdfbox.filter.DCTFilter
Decompresses data encoded using a DCT (discrete cosine transform)
technique based on the JPEG standard.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final org.apache.commons.logging.Logprivate static final intprivate static XPathExpressionFields inherited from class org.apache.pdfbox.filter.Filter
SYSPROP_DEFLATELEVEL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intclamp(float value) decode(InputStream encoded, OutputStream decoded, COSDictionary parameters, int index) Decodes data, producing the original non-encoded data.decode(InputStream encoded, OutputStream decoded, COSDictionary parameters, int index, DecodeOptions options) Decodes data, with optional DecodeOptions.protected voidencode(InputStream input, OutputStream encoded, COSDictionary parameters) private WritableRasterfromBGRtoRGB(Raster raster) private WritableRasterfromYCbCrtoCMYK(Raster raster) private WritableRasterfromYCCKtoCMYK(Raster raster) private IntegergetAdobeTransform(IIOMetadata metadata) private intprivate StringgetNumChannels(ImageReader reader) Methods inherited from class org.apache.pdfbox.filter.Filter
encode, findImageReader, getCompressionLevel, getDecodeParams
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOG -
POS_TRANSFORM
private static final int POS_TRANSFORM- See Also:
-
ADOBE
- See Also:
-
xPathExpression
-
-
Constructor Details
-
DCTFilter
DCTFilter()
-
-
Method Details
-
decode
public DecodeResult decode(InputStream encoded, OutputStream decoded, COSDictionary parameters, int index, DecodeOptions options) throws 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:
IOException- if the stream cannot be decoded
-
decode
public DecodeResult decode(InputStream encoded, OutputStream decoded, COSDictionary parameters, int index) throws 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:
IOException- if the stream cannot be decoded
-
getAdobeTransform
-
getAdobeTransformByBruteForce
- Throws:
IOException
-
fromYCCKtoCMYK
-
fromYCbCrtoCMYK
-
fromBGRtoRGB
-
getNumChannels
-
clamp
private int clamp(float value) -
encode
protected void encode(InputStream input, OutputStream encoded, COSDictionary parameters) throws IOException - Specified by:
encodein classFilter- Throws:
IOException
-