Package gov.nih.mipav.model.file
Class FileDicomJPEG.HuffTable
java.lang.Object
gov.nih.mipav.model.file.FileDicomJPEG.HuffTable
- Enclosing class:
FileDicomJPEG
This class reads and packs the bits appropriately for interpreting the huffman codes.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) intDOCUMENT ME!(package private) byte[]DOCUMENT ME!(package private) byteDOCUMENT ME!(package private) intDOCUMENT ME!(package private) booleanDOCUMENT ME!(package private) booleanDOCUMENT ME!(package private) byteDOCUMENT ME! -
Constructor Summary
ConstructorsConstructorDescriptionHuffTable(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 TypeMethodDescriptionintgetIndex()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.
-
Field Details
-
bitCount
int bitCountDOCUMENT ME! -
buffer
byte[] bufferDOCUMENT ME! -
current
byte currentDOCUMENT ME! -
index
int indexDOCUMENT ME! -
marker
boolean markerDOCUMENT ME! -
padded
boolean paddedDOCUMENT ME! -
previous
byte previousDOCUMENT 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:
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.
-