CADI.Common.LogicalTarget.JPEG2000.Detransform
Class Dequantization

java.lang.Object
  extended by CADI.Common.LogicalTarget.JPEG2000.Detransform.Dequantization

public class Dequantization
extends java.lang.Object

This class receives an image and performs the dead zone dequantization defined in JPEG2000 standard. This class can be used for the ranging stage defined for lossless compression too.
Usage example:
  construct
  setParameters
  run

Version:
1.0 2007/12/08
Author:
Group on Interactive Coding of Images (GICI)

Field Summary
private  float[][][] finalImageSamples
           
private  int[] gain
          Log_2 gain bits for each subband (LL, HL, LH, HH).
private  int[][][] imageSamples
          Definition in JPEG2KLogicalTarget.imageSamplesFloat
private  boolean parametersSet
          To know if parameters are set.
private  int[] QComponentsBits
          Definition in SIZParameters.precision
private  int[][][] QExponents
          Definition in QCDParameters.QExponents
private  int[][][] QMantisas
          Definition in QCDParameters.QMantisas
private  float QReconstruction
          Reconstruction parameter used to adjust better the dequantitzation process (when QTypes == 1).
private  int[] QTypes
          Definition in QCDParameters.QTypes
private  int[] WTLevels
          Definition in CODParameters.WTLevels
private  int xSize
          Definition in SIZParameters.xSize
private  int ySize
          Definition in SIZParameters.ySize
private  int zSize
          Definition in SIZParameters.zSize
 
Constructor Summary
Dequantization(int[][][] imageSamples, float[][][] dstImageSamples)
          Constructor that receives the original image samples.
 
Method Summary
 void list(java.io.PrintStream out)
          Prints this Dequantization's fields to the specified output stream.
 float[][][] run()
          Performs the dequantization to desired components.
 void setParameters(int[] WTLevels, int[] QTypes, int[] QComponentsBits, int[][][] QExponents, int[][][] QMantisas, float QReconstruction)
          Set the parameters used to do the dequantization.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

imageSamples

private int[][][] imageSamples
Definition in JPEG2KLogicalTarget.imageSamplesFloat


zSize

private int zSize
Definition in SIZParameters.zSize


ySize

private int ySize
Definition in SIZParameters.ySize


xSize

private int xSize
Definition in SIZParameters.xSize


WTLevels

private int[] WTLevels
Definition in CODParameters.WTLevels


QTypes

private int[] QTypes
Definition in QCDParameters.QTypes


QComponentsBits

private int[] QComponentsBits
Definition in SIZParameters.precision


QExponents

private int[][][] QExponents
Definition in QCDParameters.QExponents


QMantisas

private int[][][] QMantisas
Definition in QCDParameters.QMantisas


QReconstruction

private float QReconstruction
Reconstruction parameter used to adjust better the dequantitzation process (when QTypes == 1).

Recommened values between 0 to 1.


gain

private final int[] gain
Log_2 gain bits for each subband (LL, HL, LH, HH).

Constant values.


parametersSet

private boolean parametersSet
To know if parameters are set.

True indicates that they are set otherwise false.


finalImageSamples

private float[][][] finalImageSamples
Constructor Detail

Dequantization

public Dequantization(int[][][] imageSamples,
                      float[][][] dstImageSamples)
Constructor that receives the original image samples.

Parameters:
imageSamples - definition in imageSamples
dstImageSamples - definition in finalImageSamples
Method Detail

setParameters

public void setParameters(int[] WTLevels,
                          int[] QTypes,
                          int[] QComponentsBits,
                          int[][][] QExponents,
                          int[][][] QMantisas,
                          float QReconstruction)
Set the parameters used to do the dequantization.

Parameters:
WTLevels - definition in WTLevels
QTypes - definition in QTypes
QComponentsBits - definition in QComponentsBits
QExponents - definition in QExponents
QMantisas - definition in QMantisas
QReconstruction - definition in QReconstruction

run

public float[][][] run()
                throws ErrorException
Performs the dequantization to desired components.

Returns:
a 3D float array that contains the dequantized image
Throws:
ErrorException - when parameters are not set or unrecognized colour transform is passed

toString

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

list

public void list(java.io.PrintStream out)
Prints this Dequantization's fields 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)