CADI.Client.ClientLogicalTarget.JPEG2000
Class BlockDecode

java.lang.Object
  extended by CADI.Client.ClientLogicalTarget.JPEG2000.BlockDecode

public class BlockDecode
extends java.lang.Object

This class receives image file sizes information and precincts structures and builds new ones without precincts. Usage example:
  construct
  run
  [get functions]

Version:
1.0.2 2008/12/13
Author:
Group on Interactive Coding of Images (GICI)

Field Summary
private  int[] blockHeights
          Definition in CODParameters.blockHeights
private  int[][] blocksPerPrecinctHeights
          Definition in GenerateImageStructure.blocksPerPrecinctHeights
private  int[][] blocksPerPrecinctWidths
          Definition in GenerateImageStructure.blocksPerPrecinctWidths
private  int[] blockWidths
          Definition in CODParameters.blockWidths
private  int[] componentIndexes
          Is an one-dimensional array with the component indexes.
private  int[][][][][][][] imageBlocks
          This multidimensional array of ints contains the image divided into blocks.
private  int[][] precinctHeights
          Definition in CODParameters.precinctHeights
private  java.util.Hashtable<java.lang.Long,ByteStream[][][][]> precinctsByteStreams
          Definition in JPEG2KLogicalTarget.precinctsByteStreams
private  int[][] precinctWidths
          Definition in CODParameters.precinctWidths
private  int[][][] QExponents
          Definition in QCDParameters.QExponents
private  int QGuardBits
          Definition in QCDParameters.QGuardBits
private  int resolutionLevelAchieved
          Is the suitable resolution level to be decoded.
private  int[] WTLevels
          Definition in CODParameters.WTTypes
private  int xSize
          Definition in SIZParameters.xSize
private  int ySize
          Definition in SIZParameters.ySize
private  java.util.Hashtable<java.lang.Long,int[][][]> zeroBitPlanes
          Definition in JPEG2KLogicalTarget.zeroBitPlanes
 
Constructor Summary
BlockDecode(SIZParameters sizParameters, CODParameters codParameters, QCDParameters qcdParameters, int[] componentIndexes, int[][] blocksPerPrecinctWidths, int[][] blocksPerPrecinctHeights, java.util.Hashtable<java.lang.Long,ByteStream[][][][]> precinctsByteStreams, java.util.Hashtable<java.lang.Long,int[][][]> zeroBitPlanes, int resolutionLevelAchieved)
          Constructor that receives image sizes information.
 
Method Summary
private  void dataStructuresFilling()
           
 int[][][][][][][] getImageBlocks()
           
 void list(java.io.PrintStream out)
          Prints this Block Decode out to the specified output stream.
private  void memoryAllocation()
           
 void run()
          Performs the block building.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

componentIndexes

private int[] componentIndexes
Is an one-dimensional array with the component indexes.


ySize

private int ySize
Definition in SIZParameters.ySize


xSize

private int xSize
Definition in SIZParameters.xSize


WTLevels

private int[] WTLevels
Definition in CODParameters.WTTypes


blockWidths

private int[] blockWidths
Definition in CODParameters.blockWidths


blockHeights

private int[] blockHeights
Definition in CODParameters.blockHeights


blocksPerPrecinctWidths

private int[][] blocksPerPrecinctWidths
Definition in GenerateImageStructure.blocksPerPrecinctWidths


blocksPerPrecinctHeights

private int[][] blocksPerPrecinctHeights
Definition in GenerateImageStructure.blocksPerPrecinctHeights


precinctsByteStreams

private java.util.Hashtable<java.lang.Long,ByteStream[][][][]> precinctsByteStreams
Definition in JPEG2KLogicalTarget.precinctsByteStreams


zeroBitPlanes

private java.util.Hashtable<java.lang.Long,int[][][]> zeroBitPlanes
Definition in JPEG2KLogicalTarget.zeroBitPlanes


QExponents

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


QGuardBits

private int QGuardBits
Definition in QCDParameters.QGuardBits


imageBlocks

private int[][][][][][][] imageBlocks
This multidimensional array of ints contains the image divided into blocks. The indices are imageBlocks[z][resolutionLevel][subband][yBlock][xBlock] in the next manner:
  zIndex: is a index on the image components
  resolutionLevel: 0 is the LL subband, and 1, 2, ... represents next starting with the little one
  subband: 0 - HL, 1 - LH, 2 - HH (if resolutionLevel == 0 --> 0 - LL)
  yBlock: block row in the subband
  xBlock: block column in the subband
  y: sample row
  x: sample column

Content is the image pixel coefficients.


resolutionLevelAchieved

private int resolutionLevelAchieved
Is the suitable resolution level to be decoded.


precinctWidths

private int[][] precinctWidths
Definition in CODParameters.precinctWidths


precinctHeights

private int[][] precinctHeights
Definition in CODParameters.precinctHeights

Constructor Detail

BlockDecode

public BlockDecode(SIZParameters sizParameters,
                   CODParameters codParameters,
                   QCDParameters qcdParameters,
                   int[] componentIndexes,
                   int[][] blocksPerPrecinctWidths,
                   int[][] blocksPerPrecinctHeights,
                   java.util.Hashtable<java.lang.Long,ByteStream[][][][]> precinctsByteStreams,
                   java.util.Hashtable<java.lang.Long,int[][][]> zeroBitPlanes,
                   int resolutionLevelAchieved)
Constructor that receives image sizes information.

Parameters:
sizParameters - definition in SIZParameters.
codParameters - definition in CODParameters.
qcdParameters - definition in QCDParameters.
componentIndexes - definition in componentIndexes
blocksPerPrecinctWidths - definition in blocksPerPrecinctWidths
blocksPerPrecinctHeights - definition in blocksPerPrecinctHeights
precinctsByteStreams - definition in precinctsByteStreams
resolutionLevelAchieved - definition in
Method Detail

run

public void run()
         throws ErrorException
Performs the block building.

Throws:
ErrorException

getImageBlocks

public int[][][][][][][] getImageBlocks()
Returns:
imageBlocks definition in imageBlocks

toString

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

list

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

Parameters:
out - an output stream.

memoryAllocation

private void memoryAllocation()

dataStructuresFilling

private void dataStructuresFilling()
                            throws WarningException,
                                   ErrorException
Throws:
ErrorException
WarningException


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)