|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jj2000.j2k.decoder.Decoder
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.
BitstreamReaderAgent
,
EntropyDecoder
,
ROIDeScaler
,
Dequantizer
,
InverseWT
,
ImgDataConverter
,
InvCompTransf
,
ImgWriter
,
BlkImgDataSrcImageProducer
,
ModuleSpec
,
DecoderSpecs
Field Summary | |
private ColorSpace |
csMap
Parses the inputstream to analyze the box structure of the JP2 file. |
private ParameterList |
defpl
The default parameter list (arguments) |
private int |
exitCode
The exit code of the run method |
private HeaderInfo |
hi
Information contained in the codestream's headers |
private boolean |
isChildProcess
False if the Decoder instance is self-contained process, false if thrown by another process (i.e by a GUI) |
private ImgScrollPane |
isp
The component where the image is to be displayed |
private static java.lang.String[][] |
pinfo
The parameter information for this class |
private ParameterList |
pl
The parameter list (arguments) |
(package private) TitleUpdater |
title
Reference to the TitleUpdater instance. |
private static char[] |
vprfxs
The valid list of options prefixes |
private java.awt.Frame |
win
Frame used to display decoded image |
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 | |
private void |
error(java.lang.String msg,
int code)
Prints the error message 'msg' to standard err, prepending "ERROR" to it, and sets the exitCode to 'code'. |
private void |
error(java.lang.String msg,
int code,
java.lang.Throwable ex)
Prints the error message 'msg' to standard err, prepending "ERROR" to it, and sets the exitCode to 'code'. |
void |
exit()
Exit the decoding process according to the isChildProcess variable |
static java.lang.String[][] |
getAllParameters()
Returns all the parameters used in the decoding chain. |
java.lang.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 java.lang.String[][] |
getParameterInfo()
Returns the parameters that are used in this class. |
private void |
printParamInfo(MsgLogger out,
java.lang.String[][] pinfo)
Prints the parameters in 'pinfo' to the provided output, 'out', showing the existing defaults. |
private void |
printUsage()
Prints the usage information to stdout. |
private void |
printVersionAndCopyright()
Prints version and copyright information to the logging facility returned by FacilityManager.getMsgLogger() |
void |
run()
Runs the decoder. |
void |
setChildProcess(boolean b)
Set isChildProcess variable. |
private void |
warning(java.lang.String msg)
Prints the warning message 'msg' to standard err, prepending "WARNING" to it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private ColorSpace csMap
TitleUpdater title
private boolean isChildProcess
private int exitCode
private ParameterList pl
private HeaderInfo hi
private ParameterList defpl
private static final char[] vprfxs
private java.awt.Frame win
private ImgScrollPane isp
private static final java.lang.String[][] pinfo
Constructor Detail |
public Decoder(ParameterList pl, ImgScrollPane isp)
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.public Decoder(ParameterList pl)
pl
- The ParameterList for this decoder (contains also defaults
values).Method Detail |
public int getExitCode()
public static java.lang.String[][] getParameterInfo()
public void run()
run
in interface java.lang.Runnable
getExitCode()
private void error(java.lang.String msg, int code)
msg
- The error messagecode
- The exit code to setprivate void error(java.lang.String msg, int code, java.lang.Throwable ex)
msg
- The error messagecode
- The exit code to setex
- The exception associated with the callpublic java.lang.String[] getCOMInfo()
public static java.lang.String[][] getAllParameters()
getParameterInfo()
private void warning(java.lang.String msg)
msg
- The error messageprivate void printVersionAndCopyright()
private void printUsage()
private void printParamInfo(MsgLogger out, java.lang.String[][] pinfo)
out
- Where to print.pinfo
- The parameter information to write.public void exit()
public void setChildProcess(boolean b)
b
- The boolean value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |