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 Details

  • 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 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:
      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 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:
      IOException - if the stream cannot be decoded
    • getAdobeTransform

      private Integer getAdobeTransform(IIOMetadata metadata)
    • getAdobeTransformByBruteForce

      private int getAdobeTransformByBruteForce(ImageInputStream iis) throws IOException
      Throws:
      IOException
    • fromYCCKtoCMYK

      private WritableRaster fromYCCKtoCMYK(Raster raster)
    • fromYCbCrtoCMYK

      private WritableRaster fromYCbCrtoCMYK(Raster raster)
    • fromBGRtoRGB

      private WritableRaster fromBGRtoRGB(Raster raster)
    • getNumChannels

      private String getNumChannels(ImageReader reader)
    • clamp

      private int clamp(float value)
    • encode

      protected void encode(InputStream input, OutputStream encoded, COSDictionary parameters) throws IOException
      Specified by:
      encode in class Filter
      Throws:
      IOException