ucar.jpeg.jj2000.j2k.decoder
Class Decoder

java.lang.Object
  extended by ucar.jpeg.jj2000.j2k.decoder.Decoder
All Implemented Interfaces:
Runnable

public class Decoder
extends Object
implements Runnable

This class is the main class of JJ2000's decoder. It instantiates all objects and performs the decoding operations. It then writes the image to the output file or displays it.

First the decoder should be initialized with a ParameterList object given through the constructor. The when the run() method is invoked and the decoder executes. The exit code of the class can be obtained with the getExitCode() method, after the constructor and after the run method. A non-zero value indicates that an error has ocurred.

The decoding chain corresponds to the following sequence of modules:

The 2 last modules cannot be used at the same time and corresponds respectively to the writing of decoded image into a file or the graphical display of this same image.

The behaviour of each module may be modified according to the current tile-component. All the specifications are kept in modules extending ModuleSpec and accessible through an instance of DecoderSpecs class.

See Also:
BitstreamReaderAgent, EntropyDecoder, ROIDeScaler, Dequantizer, InverseWT, ImgDataConverter, InvCompTransf, ImgWriter, BlkImgDataSrcImageProducer, ModuleSpec, DecoderSpecs

Constructor Summary
Decoder(ParameterList pl)
          Instantiates a decoder object, with the ParameterList object given as argument.
Decoder(ParameterList pl, ImgScrollPane isp)
          Instantiates a decoder object, with the ParameterList object given as argument and a component where to display the image if no output file is specified.
 
Method Summary
 void exit()
          Exit the decoding process according to the isChildProcess variable
static String[][] getAllParameters()
          Returns all the parameters used in the decoding chain.
 String[] getCOMInfo()
          Return the information found in the COM marker segments encountered in the decoded codestream.
 int getExitCode()
          Returns the exit code of the class.
static String[][] getParameterInfo()
          Returns the parameters that are used in this class.
 void run()
          Runs the decoder.
 void setChildProcess(boolean b)
          Set isChildProcess variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Decoder

public Decoder(ParameterList pl,
               ImgScrollPane isp)
Instantiates a decoder object, with the ParameterList object given as argument and a component where to display the image if no output file is specified. It also retrieves the default ParameterList.

Parameters:
pl - The ParameterList for this decoder (contains also defaults values).
isp - The component where the image is to be displayed if not output file is specified. If null a new frame will be created to display the image.

Decoder

public Decoder(ParameterList pl)
Instantiates a decoder object, with the ParameterList object given as argument. It also retrieves the default ParameterList.

Parameters:
pl - The ParameterList for this decoder (contains also defaults values).
Method Detail

getExitCode

public int getExitCode()
Returns the exit code of the class. This is only initialized after the constructor and when the run method returns.

Returns:
The exit code of the constructor and the run() method.

getParameterInfo

public static String[][] getParameterInfo()
Returns the parameters that are used in this class. It returns a 2D String array. Each of the 1D arrays is for a different option, and they have 3 elements. The first element is the option name, the second one is the synopsis and the third one is a long description of what the parameter is. The synopsis or description may be 'null', in which case it is assumed that there is no synopsis or description of the option, respectively.

Returns:
the options name, their synopsis and their explanation.

run

public void run()
Runs the decoder. After completion the exit code is set, a non-zero value indicates that an error ocurred.

Specified by:
run in interface Runnable
See Also:
getExitCode()

getCOMInfo

public String[] getCOMInfo()
Return the information found in the COM marker segments encountered in the decoded codestream.


getAllParameters

public static String[][] getAllParameters()
Returns all the parameters used in the decoding chain. It calls parameter from each module and store them in one array (one row per parameter and 4 columns).

Returns:
All decoding parameters
See Also:
getParameterInfo()

exit

public void exit()
Exit the decoding process according to the isChildProcess variable


setChildProcess

public void setChildProcess(boolean b)
Set isChildProcess variable.

Parameters:
b - The boolean value


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.