CADI.Server.LogicalTarget.JPEG2000.Codestream
Class TagTreeEncoder

java.lang.Object
  extended by CADI.Server.LogicalTarget.JPEG2000.Codestream.TagTreeEncoder

public class TagTreeEncoder
extends java.lang.Object

This class codifies a matrix using a Tag Tree structure. Usage example:
  construct
  encoder

Version:
1.1 2008/12/27
Author:
Group on Interactive Coding of Images (GICI)

Field Summary
private  int cols
          Number of columns Negative values are not allowed
private  int levels
          Number of levels Negative values are not allowed
private  int rows
          Number of rows Negative values are not allowed
private  int[][][] states
          Tag Tree States.
private  int[][][] tagTree
          Tag Tree values.
 
Constructor Summary
TagTreeEncoder(int[][] matrix)
          Constructor with a matrix.
TagTreeEncoder(int rows, int cols)
          Constructor with an empty matrix.
 
Method Summary
 void encoder(PacketHeaderDataOutputStream packetHeaderDataOutputStream, int t, int m, int n)
          Encode a value of the matrix.
 void list(java.io.PrintStream out)
          Prints this Tag Tree out to the specified output stream.
 void reset()
          Sets attributes to its initial values;
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

levels

private int levels
Number of levels

Negative values are not allowed


rows

private int rows
Number of rows

Negative values are not allowed


cols

private int cols
Number of columns

Negative values are not allowed


tagTree

private int[][][] tagTree
Tag Tree values. The first value index indicates the level of the tree, where the value 0 is the matrix to encoder, and value levels-1 is the root. The second index is the rows, and the third is the columns

Negative values are not allowed


states

private int[][][] states
Tag Tree States. The first value index indicates the level of the tree, where the value 0 is the matrix to encoder, and value levels-1 is the root. The second index is the rows, and the third is the columns

Negative values are not allowed

Constructor Detail

TagTreeEncoder

public TagTreeEncoder(int rows,
                      int cols)
               throws ErrorException
Constructor with an empty matrix.

Parameters:
rows - matrix rows
cols - matrix columns
Throws:
ErrorException - when rows or cols are negative

TagTreeEncoder

public TagTreeEncoder(int[][] matrix)
               throws ErrorException
Constructor with a matrix.

Parameters:
matrix - matrix to code
Throws:
ErrorException - when rows or cols are negative
Method Detail

encoder

public void encoder(PacketHeaderDataOutputStream packetHeaderDataOutputStream,
                    int t,
                    int m,
                    int n)
             throws ErrorException,
                    java.io.IOException
Encode a value of the matrix.

Parameters:
packetHeaderDataOutputStream - data output stream.
t - threshold
m - row of the value to be coded
n - column of the value to be coded
Throws:
ErrorException - when invalid dimensions are passed
java.io.IOException

reset

public void reset()
Sets attributes to its initial values;


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

list

public void list(java.io.PrintStream out)
Prints this Tag Tree out to the specified output stream. This method is useful for debugging.

Parameters:
out - an output stream.


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)