Package com.ribs.pdf

Class RBCodecCCITTFaxDecode

java.lang.Object
com.ribs.pdf.RBCodec
com.ribs.pdf.RBCodecCCITTFaxDecode

public class RBCodecCCITTFaxDecode extends RBCodec
  • Field Details

  • Constructor Details

    • RBCodecCCITTFaxDecode

      public RBCodecCCITTFaxDecode(byte[] bits, int offset, int k, int rows, int columns, int numdamagedrows, boolean aligned, boolean eolrequired, boolean eoblockrequired, boolean blackisone)
      main constructor
  • Method Details

    • bytesForCCITTFaxDecode

      public static byte[] bytesForCCITTFaxDecode(byte[] bytes, int offset, int len, int K, int rows, int columns, boolean byteAligned, boolean eolRequired, boolean eoblockRequired, boolean blackIsOne, int allowedDamagedRows)
      convenience method to decode a single image
    • getNextCodeword

      public int getNextCodeword(int[] table)
    • getNextInt

      public int getNextInt(int[] table)
      Interprets next n codewords as an integer. Rules are: numbers less than 64 are low digits. numbers between 64 and 2559 require one additional low digit. 2560 requires an additional number, containing any number of digits.
    • byteAlignStream

      public void byteAlignStream()
      Skips over any extra padding bits at the end of a byte.
    • mark

      public void mark()
      Mark the current point in the bitstream. Use backup() to return to this point.
    • backup

      public void backup()
      Back the stream up to the marked position
    • decodeStream

      public byte[] decodeStream()
      Decode the entire image
    • decodeScanline1D

      public boolean decodeScanline1D(byte[] outdata)
    • locateReferenceMarks

      public void locateReferenceMarks(byte[] scanline, int a0, byte a0color, int[] b)
    • decodeScanline2D

      public boolean decodeScanline2D(byte[] outdata)
      2D decoder. outdata is a buffer which the new scanline will be written to. On input, however, outdata should have the bits for the previous scanline. The 2D encoder will include codewords which make reference to the previous scanline. For the very first scaneline, outdata should be initialized to all white.
    • writeScanline

      public void writeScanline(OutputStream out, byte[] scanline) throws IOException
      Write the decoded scanline to a stream.
      Throws:
      IOException