Package gov.nih.mipav.model.file
Class FileDicomJPEG.HuffTable
- java.lang.Object
-
- gov.nih.mipav.model.file.FileDicomJPEG.HuffTable
-
- Enclosing class:
- FileDicomJPEG
class FileDicomJPEG.HuffTable extends java.lang.ObjectThis class reads and packs the bits appropriately for interpreting the huffman codes.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intbitCountDOCUMENT ME!(package private) byte[]bufferDOCUMENT ME!(package private) bytecurrentDOCUMENT ME!(package private) intindexDOCUMENT ME!(package private) booleanmarkerDOCUMENT ME!(package private) booleanpaddedDOCUMENT ME!(package private) bytepreviousDOCUMENT 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetIndex()Returns index that we're at.private bytegetNext()Gets the next byte, skipping over 0s padded in after FF.inthuffDecode(int tableNum)Returns the appropriate value after reading 8 bits and interpreting the Huffman code.booleanisMarker()Returns flag indicating if we've read in a marker.voidsetIndex(int i)Sets index to parameter.
-
-
-
Method Detail
-
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:
trueif 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.
-
-