public class TagTreeDecoder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
cols
Number of columns
Negative values are not allowed |
private int |
levels
Number of levels
Negative values are not allowed |
private PacketHeaderDataInputStream |
PHDataInputStream
Is an input stream where the bit will be read from.
|
private int |
rows
Number of rows
Negative values are not allowed |
private int[][][] |
states
Tag Tree States.
|
private int[][][] |
tagTree
Tag Tree values.
|
Constructor and Description |
---|
TagTreeDecoder(int rows,
int cols)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
Decoder(int t,
int m,
int n,
PacketHeaderDataInputStream PHDataInputStream)
Decode a value of the matrix
|
private int |
getBit()
Returns the bit readed from the file.
|
int |
getValue(int m,
int n) |
void |
list(java.io.PrintStream out)
Prints this Tag Tree out to the specified output stream.
|
void |
reset()
Sets the
state and tagTree internal
attributes to its initial values. |
java.lang.String |
toString() |
private int rows
private int cols
private PacketHeaderDataInputStream PHDataInputStream
private int levels
private int[][][] tagTree
private int[][][] states
TagTreeDecoder(int rows, int cols)
rows
- matrix rowscols
- matrix columnsErrorException
- when a codeblock row or column values are wrongpublic int Decoder(int t, int m, int n, PacketHeaderDataInputStream PHDataInputStream) throws java.io.EOFException, java.io.IOException
t
- thresholdm
- coordintes of the value to codifyn
- coordintes of the value to codifyPHDataInputStream
- data input stream with the packet header.ErrorException
- when codeblock coordinates are wrong or the bitstream is insuficient for decoding the tag tree informationjava.io.EOFException
java.io.IOException
public void reset()
state
and tagTree
internal
attributes to its initial values.public int getValue(int m, int n) throws ErrorException
m
- coordinates of the value to codifyn
- coordinates of the value to codifyErrorException
- when the codeblock coordinates are wrongpublic java.lang.String toString()
toString
in class java.lang.Object
public void list(java.io.PrintStream out)
out
- an output stream.private int getBit() throws java.io.EOFException, java.io.IOException
java.io.EOFException
java.io.IOException
CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Group on Interactive Coding of Images (GICI) (contact)