USGS

Isis 3.0 Developer's Reference (API)

Home

Isis::JP2Encoder Class Reference
[High Level Cube I/O]

JPEG2000 encoder class. More...

#include <JP2Encoder.h>

List of all members.

Public Member Functions

 JP2Encoder (const std::string &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.

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;
   ProcessExport p;
   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;

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

Author:
2009-01-11 Janet Barrett

Constructor & Destructor Documentation

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

Constructs a JPEG2000 encoder object.

Parameters:
jp2file Name of file where the encoded JP2 data will be stored.
nsamps Sample dimension of image that will be encoded.
nlines Line dimension of image that will be encoded.
nbands Band dimension of image that will be encoded.
type Pixel type of data that will be encoded.

References _FILEINFO_, Isis::iException::Message(), Isis::iException::Programmer, Isis::SignedWord, Isis::iException::System, Isis::UnsignedByte, and Isis::UnsignedWord.

Isis::JP2Encoder::~JP2Encoder (  ) 

JP2Encoder destructor.


Member Function Documentation

JP2Error* Isis::JP2Encoder::kakadu_error (  )  const [inline]
void Isis::JP2Encoder::OpenFile (  ) 

Open the JPEG2000 file and initialize it.

References INCREMENTAL_FLUSH_BYTES, MAX_STRIPE_HEIGHT, MIN_STRIPE_HEIGHT, and size.

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

Write 16-bit data to JP2 file.

Parameters:
inbuf The 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.
void Isis::JP2Encoder::Write ( unsigned char **  inbuf  ) 

Write 8-bit data to JP2 file.

Parameters:
inbuf The 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.

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