Class DecoderRAW
- All Implemented Interfaces:
Runnable
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:
- BitstreamReaderAgent
- EntropyDecoder
- ROIDeScaler
- Dequantizer
- InverseWT
- ImgDataConverter
- EnumratedColorSpaceMapper, SyccColorSpaceMapper or ICCProfiler
- ComponentDemixer (if needed)
- ImgDataAdapter (if ComponentDemixer is needed)
- ImgWriter
- BlkImgDataSrcImageProducer
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate colorspace.ColorSpaceParses the inputstream to analyze the box structure of the JP2 file.private jj2000.j2k.util.ParameterListThe default parameter list (arguments)private intThe exit code of the run methodprivate jj2000.j2k.codestream.HeaderInfoInformation contained in the codestream's headersprivate booleanFalse if the DecoderRAW instance is self-contained process, false if thrown by another process (i.e by a GUI)private jj2000.disp.ImgScrollPaneThe component where the image is to be displayedprivate static final String[][]The parameter information for this classprivate jj2000.j2k.util.ParameterListThe parameter list (arguments)(package private) jj2000.disp.TitleUpdaterReference to the TitleUpdater instance.private static final char[]The valid list of options prefixesprivate FrameFrame used to display decoded image -
Constructor Summary
ConstructorsConstructorDescriptionDecoderRAW(jj2000.j2k.util.ParameterList pl) Instantiates a decoder object, with the ParameterList object given as argument.DecoderRAW(jj2000.j2k.util.ParameterList pl, jj2000.disp.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
Modifier and TypeMethodDescriptionprivate voidPrints the error message 'msg' to standard err, prepending "ERROR" to it, and sets the exitCode to 'code'.private voidPrints the error message 'msg' to standard err, prepending "ERROR" to it, and sets the exitCode to 'code'.voidexit()Exit the decoding process according to the isChildProcess variablestatic String[][]Returns all the parameters used in the decoding chain.String[]Return the information found in the COM marker segments encountered in the decoded codestream.intReturns the exit code of the class.static String[][]Returns the parameters that are used in this class.private voidprintParamInfo(jj2000.j2k.util.MsgLogger out, String[][] pinfo) Prints the parameters in 'pinfo' to the provided output, 'out', showing the existing defaults.private voidPrints the usage information to stdout.private voidPrints version and copyright information to the logging facility returned by FacilityManager.getMsgLogger()voidrun()Runs the decoder.jj2000.j2k.image.BlkImgDataSrcrun1Slice(jj2000.j2k.io.RandomAccessIO inBuff) voidvoidsetChildProcess(boolean b) Set isChildProcess variable.private voidPrints the warning message 'msg' to standard err, prepending "WARNING" to it.
-
Field Details
-
csMap
private colorspace.ColorSpace csMapParses the inputstream to analyze the box structure of the JP2 file. -
title
jj2000.disp.TitleUpdater titleReference to the TitleUpdater instance. Only used when decoded image is displayed -
isChildProcess
private boolean isChildProcessFalse if the DecoderRAW instance is self-contained process, false if thrown by another process (i.e by a GUI) -
exitCode
private int exitCodeThe exit code of the run method -
pl
private jj2000.j2k.util.ParameterList plThe parameter list (arguments) -
hi
private jj2000.j2k.codestream.HeaderInfo hiInformation contained in the codestream's headers -
defpl
private jj2000.j2k.util.ParameterList defplThe default parameter list (arguments) -
vprfxs
private static final char[] vprfxsThe valid list of options prefixes -
win
Frame used to display decoded image -
isp
private jj2000.disp.ImgScrollPane ispThe component where the image is to be displayed -
pinfo
The parameter information for this class
-
-
Constructor Details
-
DecoderRAW
public DecoderRAW(jj2000.j2k.util.ParameterList pl, jj2000.disp.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.
-
DecoderRAW
public DecoderRAW(jj2000.j2k.util.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 Details
-
getExitCode
public int getExitCode()Returns the exit code of the class. This is only initialized after the constructor and when the run method returns.- Overrides:
getExitCodein classjj2000.j2k.decoder.Decoder- Returns:
- The exit code of the constructor and the run() method.
-
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. -
run1Slice
public jj2000.j2k.image.BlkImgDataSrc run1Slice(jj2000.j2k.io.RandomAccessIO inBuff) -
runAllSlices
public void runAllSlices() -
error
Prints the error message 'msg' to standard err, prepending "ERROR" to it, and sets the exitCode to 'code'. An exit code different than 0 indicates that there where problems.- Parameters:
msg- The error messagecode- The exit code to set
-
error
Prints the error message 'msg' to standard err, prepending "ERROR" to it, and sets the exitCode to 'code'. An exit code different than 0 indicates that there where problems. Either the stacktrace or a "details" message is output depending on the data of the "debug" parameter.- Parameters:
msg- The error messagecode- The exit code to setex- The exception associated with the call
-
getCOMInfo
Return the information found in the COM marker segments encountered in the decoded codestream.- Overrides:
getCOMInfoin classjj2000.j2k.decoder.Decoder
-
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:
-
warning
Prints the warning message 'msg' to standard err, prepending "WARNING" to it.- Parameters:
msg- The error message
-
printVersionAndCopyright
private void printVersionAndCopyright()Prints version and copyright information to the logging facility returned by FacilityManager.getMsgLogger() -
printUsage
private void printUsage()Prints the usage information to stdout. The usage information is written for all modules in the decoder. -
printParamInfo
Prints the parameters in 'pinfo' to the provided output, 'out', showing the existing defaults. The message is printed to the logging facility returned by FacilityManager.getMsgLogger(). The 'pinfo' argument is a 2D String array. The first dimension contains String arrays, 1 for each parameter. Each of these arrays has 3 elements, the first element is the parameter name, the second element is the synopsis for the parameter and the third one is a long description of the parameter. If the synopsis or description is 'null' then no synopsis or description is printed, respectively. If there is a default value for a parameter it is also printed.- Parameters:
out- Where to print.pinfo- The parameter information to write.
-
exit
public void exit()Exit the decoding process according to the isChildProcess variable- Overrides:
exitin classjj2000.j2k.decoder.Decoder
-
setChildProcess
public void setChildProcess(boolean b) Set isChildProcess variable.- Overrides:
setChildProcessin classjj2000.j2k.decoder.Decoder- Parameters:
b- The boolean value
-