Class LZWCodec

java.lang.Object
org.eclipse.swt.internal.image.LZWCodec

final class LZWCodec extends Object
  • Field Details

    • bitsPerPixel

      int bitsPerPixel
    • blockSize

      int blockSize
    • blockIndex

      int blockIndex
    • currentByte

      int currentByte
    • bitsLeft

      int bitsLeft
    • codeSize

      int codeSize
    • clearCode

      int clearCode
    • endCode

      int endCode
    • newCodes

      int newCodes
    • topSlot

      int topSlot
    • currentSlot

      int currentSlot
    • imageWidth

      int imageWidth
    • imageHeight

      int imageHeight
    • imageX

      int imageX
    • imageY

      int imageY
    • pass

      int pass
    • line

      int line
    • codeMask

      int codeMask
    • block

      byte[] block
    • lineArray

      byte[] lineArray
    • stack

      int[] stack
    • suffix

      int[] suffix
    • prefix

      int[] prefix
    • nodeStack

      LZWNode[] nodeStack
    • inputStream

      LEDataInputStream inputStream
    • outputStream

      LEDataOutputStream outputStream
    • image

      ImageData image
    • loader

      ImageLoader loader
    • interlaced

      boolean interlaced
    • MASK_TABLE

      static final int[] MASK_TABLE
  • Constructor Details

    • LZWCodec

      LZWCodec()
  • Method Details

    • decode

      void decode()
      Decode the input.
    • decode

      public void decode(LEDataInputStream inputStream, ImageLoader loader, ImageData image, boolean interlaced, int depth)
      Decode the LZW-encoded bytes in the given byte stream into the given DeviceIndependentImage.
    • encode

      void encode()
      Encode the image.
    • encode

      public void encode(LEDataOutputStream byteStream, ImageData image)
      Encode the bytes into the given byte stream from the given DeviceIndependentImage.
    • encodeLoop

      int encodeLoop()
      Encoding loop broken out to allow early return.
    • initializeForDecoding

      void initializeForDecoding()
      Initialize the receiver for decoding the given byte array.
    • initializeForEncoding

      void initializeForEncoding()
      Initialize the receiver for encoding the given byte array.
    • nextCode

      int nextCode()
      Answer the next code from the input byte array.
    • nextPixel

      int nextPixel()
      Answer the next pixel to encode in the image
    • nextPixels

      void nextPixels(byte[] buf, int lineWidth)
      Copy a row of pixel values from the image.
    • nextPutCode

      void nextPutCode(int aCode)
      Output aCode to the output stream.
    • nextPutPixels

      void nextPutPixels(byte[] buf)
      Copy a row of pixel values to the image.
    • copyRow

      void copyRow(byte[] buf, int copies)
      Copy duplicate rows of pixel values to the image. This is to fill in rows if the image is interlaced.
    • readBlock

      int readBlock()
      Read a block from the byte stream. Return the number of bytes read. Throw an exception if the block could not be read.
    • writeBlock

      void writeBlock()
      Write a block to the byte stream. Throw an exception if the block could not be written.