JPEG2000 decoder class.
This class is used to decode a JPEG2000 image.
Here is an example of how to use JP2Decoder
JP2_decoder =
new JP2Decoder(QString(ui.GetFileName(
"FROM")));
JP2_decoder->OpenFile();
int nsamps = JP2_decoder->GetSampleDimension();
int nlines = JP2_decoder->GetLineDimension();
int nbands = JP2_decoder->GetBandDimension();
int pixelbytes = JP2_decoder->GetPixelBytes();
bool is_signed = JP2_decoder->GetSignedData();
delete JP2_decoder;
if (pixelbytes == 1) {
} else if (pixelbytes == 2) {
if (is_signed) {
} else {
}
} else {
throw iException::Message(iException::User,
"The file [" + ui.GetFileName("FROM") + "] contains unsupported data type.",
}
jp.SetInputFile(QString(ui.GetFileName("FROM")));
jp.SetOutputCube("TO");
jp.StartProcess();
jp.EndProcess();
#define _FILEINFO_
Macro for the filename and line number.
Definition IException.h:24
JPEG2000 decoder class.
Definition JP2Decoder.h:83
JP2Decoder(const QString &jp2file)
Constructs a JPEG2000 decoder object.
Definition JP2Decoder.cpp:32
Byte swapper.
Definition ProcessImport.h:155
@ JP2
Jpeg 2000 Format (always band sequential).
Definition ProcessImport.h:280
void SetDimensions(const int ns, const int nl, const int nb)
Sets the physical size of the input cube.
Definition ProcessImport.cpp:304
@ SignedWord
Definition PixelType.h:32
@ UnsignedByte
Definition PixelType.h:29
@ UnsignedWord
Definition PixelType.h:31
If you would like to see JP2Decoder being used in implementation, see std2isis.cpp or for a class that implements JP2Decoder, see ProcessImport
- Author
- 2009-12-18 Janet Barrett