USGS

Isis 3.0 Developer's Reference (API)

Home

JP2Encoder.h

Go to the documentation of this file.
00001 #ifndef JP2Encoder_h
00002 #define JP2Encoder_h
00003 
00025 #include <string>
00026 
00027 #include "PixelType.h"
00028 
00029 #if ENABLEJP2K
00030 #include "jp2.h"
00031 #include "kdu_stripe_compressor.h"
00032 #endif
00033 #define MIN_STRIPE_HEIGHT 256
00034 #define MAX_STRIPE_HEIGHT 8192
00035 #define INCREMENTAL_FLUSH_BYTES                         (256 * 1024 * 1024)
00036 
00037 namespace Isis {
00038   class JP2Error;
00039 
00080   class JP2Encoder {
00081     public:
00082       JP2Encoder(const QString &jp2file, const unsigned int nsamps,
00083                  const unsigned int nlines, const unsigned int nbands,
00084                  const Isis::PixelType type);
00085       ~JP2Encoder();
00086 
00087       // Register with the Kakadu error facility
00088       JP2Error *kakadu_error() const {
00089         return Kakadu_Error;
00090       };
00091 
00092       // Open and initialize the JP2 file for writing
00093       void OpenFile();
00094 
00095       // Write byte data to the JP2 file
00096       void Write(unsigned char **inbuf);
00097 
00098       // Write 16-bit data to the JP2 file
00099       void Write(short int **inbuf);
00100 
00101     private:
00102       QString p_jp2File;           
00103       unsigned int p_sampleDimension;  
00104       unsigned int p_lineDimension;    
00105       unsigned int p_bandDimension;    
00106       unsigned int p_resolutionLevels; 
00107       std::string p_progressionOrder;  
00108       unsigned int p_codeBlockSize;    
00109       bool p_signedData;               
00110 
00111       unsigned int p_tileSizeWidth;    
00112       unsigned int p_tileSizeHeight;   
00113       std::vector<unsigned int> p_precinctSize; 
00114       unsigned int p_pixelBits;        
00115       unsigned int p_pixelBytes;       
00116       int p_flushLines;                
00117 
00118       bool p_writeStripes;             
00119       int *p_stripeHeights;            
00120 
00121       int *p_maxStripeHeights;         
00122 
00123       int *p_precisions;               
00124 
00125       bool *p_isSigned;                
00126 
00127 
00128       JP2Error *Kakadu_Error;          
00129 #if ENABLEJP2K
00130       jp2_family_tgt *JP2_Stream;      
00131       jp2_target *JP2_Boxes;           
00132       kdu_codestream *JPEG2000_Codestream; 
00133       kdu_stripe_compressor p_compressor;  
00134 
00135 #endif
00136   };
00137 };
00138 #endif