Class FileDicomJPEG.HuffTable

java.lang.Object
gov.nih.mipav.model.file.FileDicomJPEG.HuffTable
Enclosing class:
FileDicomJPEG

class FileDicomJPEG.HuffTable extends Object
This class reads and packs the bits appropriately for interpreting the huffman codes.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) int
    DOCUMENT ME!
    (package private) byte[]
    DOCUMENT ME!
    (package private) byte
    DOCUMENT ME!
    (package private) int
    DOCUMENT ME!
    (package private) boolean
    DOCUMENT ME!
    (package private) boolean
    DOCUMENT ME!
    (package private) byte
    DOCUMENT ME!
  • Constructor Summary

    Constructors
    Constructor
    Description
    HuffTable(byte[] image, int i)
    Creates a new table with the image and the index where we stopped reading the image so far.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns index that we're at.
    private byte
    Gets the next byte, skipping over 0s padded in after FF.
    int
    huffDecode(int tableNum)
    Returns the appropriate value after reading 8 bits and interpreting the Huffman code.
    boolean
    Returns flag indicating if we've read in a marker.
    void
    setIndex(int i)
    Sets index to parameter.

    Methods inherited from class java.lang.Object

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

    • bitCount

      int bitCount
      DOCUMENT ME!
    • buffer

      byte[] buffer
      DOCUMENT ME!
    • current

      byte current
      DOCUMENT ME!
    • index

      int index
      DOCUMENT ME!
    • marker

      boolean marker
      DOCUMENT ME!
    • padded

      boolean padded
      DOCUMENT ME!
    • previous

      byte previous
      DOCUMENT ME!
  • Constructor Details

    • HuffTable

      public HuffTable(byte[] image, int i)
      Creates a new table with the image and the index where we stopped reading the image so far.
      Parameters:
      image - Image.
      i - Index into image.
  • Method Details

    • getIndex

      public int getIndex()
      Returns index that we're at.
      Returns:
      index
    • huffDecode

      public int huffDecode(int tableNum)
      Returns the appropriate value after reading 8 bits and interpreting the Huffman code.
      Parameters:
      tableNum - DOCUMENT ME!
      Returns:
      value to add to predictor.
    • isMarker

      public boolean isMarker()
      Returns flag indicating if we've read in a marker. In that case we're off and we need to exit.
      Returns:
      true if marker has been read in.
    • setIndex

      public void setIndex(int i)
      Sets index to parameter.
      Parameters:
      i - Index to set to.
    • getNext

      private byte getNext()
      Gets the next byte, skipping over 0s padded in after FF. Sets marker flag if we read in a marker.
      Returns:
      The next byte.