Class CCITTG4Encoder

java.lang.Object
com.itextpdf.io.codec.CCITTG4Encoder

public class CCITTG4Encoder extends Object
Encodes data in the CCITT G4 FAX format.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CCITTG4Encoder(int width)
    Creates a new encoder.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    close()
    Closes the encoder and returns the encoded data.
    static byte[]
    compress(byte[] data, int width, int height)
    Encodes a full image.
    void
    fax4Encode(byte[] data, int height)
    Encodes a number of lines.
    void
    fax4Encode(byte[] data, int offset, int size)
    Encodes a number of lines.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CCITTG4Encoder

      public CCITTG4Encoder (int width)
      Creates a new encoder.
      Parameters:
      width - the line width
  • Method Details

    • fax4Encode

      public void fax4Encode (byte[] data, int offset, int size)
      Encodes a number of lines.
      Parameters:
      data - the data to be encoded
      offset - the offset into the data
      size - the size of the data to be encoded
    • compress

      public static byte[] compress (byte[] data, int width, int height)
      Encodes a full image.
      Parameters:
      data - the data to encode
      width - the image width
      height - the image height
      Returns:
      the encoded image
    • fax4Encode

      public void fax4Encode (byte[] data, int height)
      Encodes a number of lines.
      Parameters:
      data - the data to be encoded
      height - the number of lines to encode
    • close

      public byte[] close()
      Closes the encoder and returns the encoded data.
      Returns:
      the encoded data