public class TagTreeDecoder extends Object
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.
TagTreeEncoder
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
TagTreeDecoder(int h,
int w)
Creates a tag tree decoder with 'w' elements along the
horizontal dimension and 'h' elements along the vertical
direction.
|
Modifier and Type | Method and Description |
---|---|
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,
PktHeaderBitReader in)
Decodes information for the specified element of the tree,
given the threshold, and updates its value.
|
protected int w
protected int h
protected int lvls
protected int[][] treeV
protected int[][] treeS
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.public final int getWidth()
public final int getHeight()
public int update(int m, int n, int t, 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, jj2000.j2k.codestream.reader.PktHeaderBitReader)
Copyright © 2017 Open Microscopy Environment