Isis 3 Programmer Reference
Isis::JP2Encoder Class Reference

JPEG2000 encoder class. More...

#include <JP2Encoder.h>

Collaboration diagram for Isis::JP2Encoder:
Collaboration graph

Public Member Functions

 JP2Encoder (const QString &jp2file, const unsigned int nsamps, const unsigned int nlines, const unsigned int nbands, const Isis::PixelType type)
 Constructs a JPEG2000 encoder object.
 
 ~JP2Encoder ()
 JP2Encoder destructor.
 
JP2Errorkakadu_error () const
 
void OpenFile ()
 Open the JPEG2000 file and initialize it.
 
void Write (unsigned char **inbuf)
 Write 8-bit data to JP2 file.
 
void Write (short int **inbuf)
 Write 16-bit data to JP2 file.
 

Private Attributes

QString p_jp2File
 Output file name.
 
std::string p_progressionOrder
 Progression order used to create output file.
 
std::vector< unsigned int > p_precinctSize
 Precinct size(s) used to create output file.
 
JP2ErrorKakadu_Error
 JP2 Error handling facility.
 

Detailed Description

JPEG2000 encoder class.

This class is used to convert image data into JPEG2000 format.

Here is an example of how to use JP2Encoder

char **jp2buf;
Cube *icube;
JP2Encoder *JP2_encoder;
icube = p.SetInputCube("FROM",Isis::OneBand);
p.SetInputRange();
p.setFormat(ProcessExport::BIL);
jp2buf = new char* [1];
jp2buf[0] = new char[icube->Samples()];
p.SetOutputType(Isis::UnsignedByte);
p.SetOutputRange(1.0,255.0);
p.SetOutputNull(0.0);
JP2_encoder = new JP2Encoder(ui.GetFileName("TO"),icube->Samples(),
icube->Lines(),icube->Bands(),Isis::UnsignedByte);
JP2_encoder->OpenFile();
p.StartProcess(toJP2);
p.EndProcess();
delete JP2_encoder;
IO Handler for Isis Cubes.
Definition Cube.h:168
JPEG2000 encoder class.
Definition JP2Encoder.h:67
JP2Encoder(const QString &jp2file, const unsigned int nsamps, const unsigned int nlines, const unsigned int nbands, const Isis::PixelType type)
Constructs a JPEG2000 encoder object.
Process class for exporting cubes.
@ BIL
Band interleaved by line.

If you would like to see JP2Encoder being used in implementation, see isis2std.cpp

Author
2009-01-11 Janet Barrett
History

2009-01-11 Janet Barrett - Original version.

2012-04-06 Kris Becker - Fixed condition compilation where support for JP2K is disabled

2017-08-21 Tyler Wilson, Ian Humphrey, Summer Stapleton - Added support for new kakadu libraries. References #4809.

Definition at line 67 of file JP2Encoder.h.

Constructor & Destructor Documentation

◆ JP2Encoder()

Isis::JP2Encoder::JP2Encoder ( const QString & jp2file,
const unsigned int nsamps,
const unsigned int nlines,
const unsigned int nbands,
const Isis::PixelType type )

Constructs a JPEG2000 encoder object.

Parameters
jp2fileName of file where the encoded JP2 data will be stored.
nsampsSample dimension of image that will be encoded.
nlinesLine dimension of image that will be encoded.
nbandsBand dimension of image that will be encoded.
typePixel type of data that will be encoded.

Definition at line 36 of file JP2Encoder.cpp.

References Kakadu_Error, p_jp2File, p_precinctSize, p_progressionOrder, and Isis::IException::Programmer.

◆ ~JP2Encoder()

Isis::JP2Encoder::~JP2Encoder ( )

JP2Encoder destructor.

Definition at line 286 of file JP2Encoder.cpp.

Member Function Documentation

◆ kakadu_error()

JP2Error * Isis::JP2Encoder::kakadu_error ( ) const
inline

Definition at line 75 of file JP2Encoder.h.

◆ OpenFile()

void Isis::JP2Encoder::OpenFile ( )

Open the JPEG2000 file and initialize it.

Definition at line 108 of file JP2Encoder.cpp.

References p_jp2File, p_precinctSize, and p_progressionOrder.

Referenced by Isis::JP2Exporter::write().

◆ Write() [1/2]

void Isis::JP2Encoder::Write ( short int ** inbuf)

Write 16-bit data to JP2 file.

Parameters
inbufThe array of pointers to byte buffers that will be used to write out the image data. One byte buffer is required for each band in the image. Kakadu writes in a BIL manner.

Definition at line 275 of file JP2Encoder.cpp.

◆ Write() [2/2]

void Isis::JP2Encoder::Write ( unsigned char ** inbuf)

Write 8-bit data to JP2 file.

Parameters
inbufThe array of pointers to byte buffers that will be used to write out the image data. One byte buffer is required for each band in the image. Kakadu writes in a BIL manner.

Definition at line 260 of file JP2Encoder.cpp.

Referenced by Isis::JP2Exporter::writeLine().

Member Data Documentation

◆ Kakadu_Error

JP2Error* Isis::JP2Encoder::Kakadu_Error
private

JP2 Error handling facility.

Definition at line 92 of file JP2Encoder.h.

Referenced by JP2Encoder().

◆ p_jp2File

QString Isis::JP2Encoder::p_jp2File
private

Output file name.

Definition at line 89 of file JP2Encoder.h.

Referenced by JP2Encoder(), and OpenFile().

◆ p_precinctSize

std::vector<unsigned int> Isis::JP2Encoder::p_precinctSize
private

Precinct size(s) used to create output file.

Definition at line 91 of file JP2Encoder.h.

Referenced by JP2Encoder(), and OpenFile().

◆ p_progressionOrder

std::string Isis::JP2Encoder::p_progressionOrder
private

Progression order used to create output file.

Definition at line 90 of file JP2Encoder.h.

Referenced by JP2Encoder(), and OpenFile().


The documentation for this class was generated from the following files: