Isis Developer 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. More...
 
 ~JP2Encoder ()
 JP2Encoder destructor. More...
 
JP2Errorkakadu_error () const
 
void OpenFile ()
 Open the JPEG2000 file and initialize it. More...
 
void Write (unsigned char **inbuf)
 Write 8-bit data to JP2 file. More...
 
void Write (short int **inbuf)
 Write 16-bit data to JP2 file. More...
 

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);
jp2buf = new char* [1];
jp2buf[0] = new char[icube->Samples()];
p.SetOutputRange(1.0,255.0);
JP2_encoder = new JP2Encoder(ui.GetFileName("TO"),icube->Samples(),
icube->Lines(),icube->Bands(),Isis::UnsignedByte);
JP2_encoder->OpenFile();
p.StartProcess(toJP2);
delete JP2_encoder;
IO Handler for Isis Cubes.
Definition: Cube.h:168
JPEG2000 encoder class.
Definition: JP2Encoder.h:67
void OpenFile()
Open the JPEG2000 file and initialize it.
Definition: JP2Encoder.cpp:108
Process class for exporting cubes.
Definition: ProcessExport.h:111
void SetOutputNull(const double value)
Set output special pixel value for NULL.
Definition: ProcessExport.cpp:476
void SetOutputType(Isis::PixelType pixelIn)
Set output pixel bit type in Buffer.
Definition: ProcessExport.cpp:608
virtual void StartProcess(void funct(Isis::Buffer &in))
This method invokes the process operation over a single input cube.
Definition: ProcessExport.cpp:790
void SetInputRange()
Set input pixel range from user.
Definition: ProcessExport.cpp:359
@ BIL
Band interleaved by line.
Definition: ProcessExport.h:118
void setFormat(ExportFormat format)
Sets the storage order of the output file.
Definition: ProcessExport.h:170
void SetOutputRange(const double minimum, const double maximum)
Set output pixel range in Buffer.
Definition: ProcessExport.cpp:454
virtual void EndProcess()
End the processing sequence and cleans up by closing cubes, freeing memory, etc.
Definition: Process.cpp:462
virtual Isis::Cube * SetInputCube(const QString &parameter, const int requirements=0)
Opens an input cube specified by the user and verifies requirements are met.
Definition: Process.cpp:139
const int OneBand
Definition: Process.h:22
@ UnsignedByte
Definition: PixelType.h:29

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

Author
2009-01-11 Janet Barrett

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.

References _FILEINFO_, Isis::IException::Programmer, Isis::SignedWord, Isis::UnsignedByte, and Isis::UnsignedWord.

◆ ~JP2Encoder()

Isis::JP2Encoder::~JP2Encoder ( )

JP2Encoder destructor.

Member Function Documentation

◆ kakadu_error()

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

◆ OpenFile()

void Isis::JP2Encoder::OpenFile ( )

Open the JPEG2000 file and initialize it.

References INCREMENTAL_FLUSH_BYTES, MAX_STRIPE_HEIGHT, and MIN_STRIPE_HEIGHT.

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.

◆ 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.

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


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