|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.jpeg.jj2000.j2k.codestream.reader.TagTreeDecoder
public class TagTreeDecoder
This class implements the tag tree decoder. A tag tree codes a 2D matrix of integer elements in an efficient way. The decoding procedure 'update()' updates a value of the matrix from a stream of coded data, given a threshold. This procedure decodes enough information to identify whether or not the value is greater than or equal to the threshold, and updates the value accordingly.
In general the decoding procedure must follow the same sequence of elements and thresholds as the encoding one. The encoder is implemented by the TagTreeEncoder class.
Tag trees that have one dimension, or both, as 0 are allowed for convenience. Of course no values can be set or coded in such cases.
jj2000.j2k.codestream.writer.TagTreeEncoder
Field Summary | |
---|---|
protected int |
h
The vertical dimensions of the base level |
protected int |
lvls
The number of levels in the tag tree |
protected int[][] |
treeS
The tag tree state. |
protected int[][] |
treeV
The tag tree values. |
protected int |
w
The horizontal dimension of the base level |
Constructor Summary | |
---|---|
TagTreeDecoder(int h,
int w)
Creates a tag tree decoder with 'w' elements along the horizontal dimension and 'h' elements along the vertical direction. |
Method Summary | |
---|---|
int |
getHeight()
Returns the number of leafs along the vertical direction. |
int |
getValue(int m,
int n)
Returns the current value of the specified element in the tag tree. |
int |
getWidth()
Returns the number of leafs along the horizontal direction. |
int |
update(int m,
int n,
int t,
ucar.jpeg.jj2000.j2k.codestream.reader.PktHeaderBitReader in)
Decodes information for the specified element of the tree, given the threshold, and updates its value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int w
protected int h
protected int lvls
protected int[][] treeV
protected int[][] treeS
Constructor Detail |
---|
public TagTreeDecoder(int h, int w)
The values of all elements are initialized to Integer.MAX_VALUE (i.e. no information decoded so far). The states are initialized all to 0.
h
- The number of elements along the vertical direction.w
- The number of elements along the horizontal direction.Method Detail |
---|
public final int getWidth()
public final int getHeight()
public int update(int m, int n, int t, ucar.jpeg.jj2000.j2k.codestream.reader.PktHeaderBitReader in) throws IOException
m
- The vertical index of the element.n
- The horizontal index of the element.t
- The threshold to use in decoding. It must be non-negative.in
- The stream from where to read the coded information.
IOException
- If an I/O error occurs while reading from 'in'.
EOFException
- If the ned of the 'in' stream is reached before
getting all the necessary data.public int getValue(int m, int n)
m
- The vertical index of the element.n
- The horizontal index of the element.
update(int, int, int, ucar.jpeg.jj2000.j2k.codestream.reader.PktHeaderBitReader)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |