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 String
private static final org.apache.commons.logging.Log
private static final int
Fields inherited from class org.apache.pdfbox.filter.Filter
SYSPROP_DEFLATELEVEL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate int
clamp
(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 void
encode
(InputStream input, OutputStream encoded, COSDictionary parameters) private WritableRaster
fromBGRtoRGB
(Raster raster) private WritableRaster
fromYCbCrtoCMYK
(Raster raster) private WritableRaster
fromYCCKtoCMYK
(Raster raster) private Integer
getAdobeTransform
(IIOMetadata metadata) private int
private String
getNumChannels
(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:
-
-
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: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:
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: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:
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:
encode
in classFilter
- Throws:
IOException
-