CADI.Common.LogicalTarget.JPEG2000
Class CalculateRequiredComponentsDPCM

java.lang.Object
  extended by CADI.Common.LogicalTarget.JPEG2000.CalculateRequiredComponentsDPCM

public class CalculateRequiredComponentsDPCM
extends java.lang.Object

This class is useful to calculate which are the necessary components to invert a DPCM transform.

Version:
1.0.1 2008/10/12
Author:
Group on Interactive Coding of Images (GICI)

Field Summary
static int CLASSIC
          Is the classical DPCM, where each component (apart from first one) is obtained as a difference from the previous one.
private  int[] compsArray
          Is an one-dimensional array with the inital components values.
private  int maxNumComps
          Is the maximum number of components.
private  int[] requiredCompsArray
          Contains the required components which will be necessary to invert the compsArray components.
static int RESTART_ARBITRARY
          Is a clustered DPCM where the indexes for the restart can take each value from the value ranges, with and without regular recurrence.
static int RESTART_PERIODIC
          Is a clustered DPCM where the restart index is fixed.
private  int restartIndex
          Is the component index used in the RESTART_PERIODIC mode.
private  int[] restartIndexes
          Is a one-dimensional array with component indexes for the 3 mode.
private  int type
          Indicates the type of DPCM.
 
Constructor Summary
CalculateRequiredComponentsDPCM(int[][] comps, int maxNumComps)
          Constructor.
CalculateRequiredComponentsDPCM(int[] compsArray, int maxNumComps)
          Constructor.
 
Method Summary
private  int[] calculateRequiredComponentsWithRestartFixed()
          Calculates which are the necessary components to invert a DPCM transform using fixed restart components.
private  int[] calculateRequiredComponentsWithRestartPeriodical()
          Calculates which are the necessary components to inver a DPCM transform using periodical components.
 int[][] getRequiredComps()
          Returns the requiredCompsArray as a range of components.
 int[] getRequiredCompsArray()
          Returns the requiredCompsArray attribute.
 void list(java.io.PrintStream out)
          Prints this Client Capabilities and Preferences fields out to the specified output stream.
 void run()
          Performs the calculus of the required components.
 void setClassical()
          Sets the DPCM type to classic.
 void setRestartArbitrary(int[] restartIndexes)
          Sets the DPCM type to the restart fixed mode.
 void setRestartPeriodic(int restartIndex)
          Sets the DPCM type to the restart periodical mode.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

private int type
Indicates the type of DPCM. Allowed values are: CLASSIC, RESTART_PERIODIC, and RESTART_ARBITRARY.


CLASSIC

public static final int CLASSIC
Is the classical DPCM, where each component (apart from first one) is obtained as a difference from the previous one.

See Also:
Constant Field Values

RESTART_PERIODIC

public static final int RESTART_PERIODIC
Is a clustered DPCM where the restart index is fixed.

See Also:
Constant Field Values

RESTART_ARBITRARY

public static final int RESTART_ARBITRARY
Is a clustered DPCM where the indexes for the restart can take each value from the value ranges, with and without regular recurrence.

See Also:
Constant Field Values

compsArray

private int[] compsArray
Is an one-dimensional array with the inital components values.


maxNumComps

private int maxNumComps
Is the maximum number of components.


restartIndex

private int restartIndex
Is the component index used in the RESTART_PERIODIC mode.


restartIndexes

private int[] restartIndexes
Is a one-dimensional array with component indexes for the 3 mode.


requiredCompsArray

private int[] requiredCompsArray
Contains the required components which will be necessary to invert the compsArray components.

Constructor Detail

CalculateRequiredComponentsDPCM

public CalculateRequiredComponentsDPCM(int[] compsArray,
                                       int maxNumComps)
Constructor.

Parameters:
compsArray - definition compsArray.
maxNumComps - definition in maxNumComps.

CalculateRequiredComponentsDPCM

public CalculateRequiredComponentsDPCM(int[][] comps,
                                       int maxNumComps)
Constructor.

Parameters:
comps - definition in ViewWindowField.comps.
maxNumComps - definition in maxNumComps.
Method Detail

setClassical

public void setClassical()
Sets the DPCM type to classic. Further information, see CLASSIC.


setRestartPeriodic

public void setRestartPeriodic(int restartIndex)
Sets the DPCM type to the restart periodical mode. Further information, see RESTART_PERIODIC.

Parameters:
restartIndex - definition in restartIndex.

setRestartArbitrary

public void setRestartArbitrary(int[] restartIndexes)
Sets the DPCM type to the restart fixed mode. Further information, see RESTART_ARBITRARY.

Parameters:
restartIndexes - defintion in restartIndexes.

run

public void run()
         throws java.lang.IllegalAccessException
Performs the calculus of the required components.

Throws:
java.lang.IllegalAccessException

getRequiredCompsArray

public int[] getRequiredCompsArray()
Returns the requiredCompsArray attribute.

Returns:
the requiredCompsArray attribute.

getRequiredComps

public int[][] getRequiredComps()
Returns the requiredCompsArray as a range of components.

Returns:
the requiredCompsArray as a range of components.

toString

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

list

public void list(java.io.PrintStream out)
Prints this Client Capabilities and Preferences fields out to the specified output stream. This method is useful for debugging.

Parameters:
out - an output stream.

calculateRequiredComponentsWithRestartPeriodical

private int[] calculateRequiredComponentsWithRestartPeriodical()
Calculates which are the necessary components to inver a DPCM transform using periodical components.

Returns:
an one-dimensional array with the necessary components.

calculateRequiredComponentsWithRestartFixed

private int[] calculateRequiredComponentsWithRestartFixed()
Calculates which are the necessary components to invert a DPCM transform using fixed restart components.

Returns:
an one-dimensional array with the necessary components.


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)