Class DCTFilter


  • final class DCTFilter
    extends Filter
    Decompresses data encoded using a DCT (discrete cosine transform) technique based on the JPEG standard.
    • Field Detail

      • LOG

        private static final org.apache.commons.logging.Log LOG
    • Constructor Detail

      • DCTFilter

        DCTFilter()
    • 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 class Filter
        Parameters:
        encoded - the encoded byte stream
        decoded - the stream where decoded data will be written
        parameters - the parameters used for decoding
        index - the index to the filter being decoded
        options - 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 class Filter
        Parameters:
        encoded - the encoded byte stream
        decoded - the stream where decoded data will be written
        parameters - the parameters used for decoding
        index - 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
        Specified by:
        encode in class Filter
        Throws:
        java.io.IOException