USGS

Isis 3.0 Developer's Reference (API)

Home

JP2Encoder.h
Go to the documentation of this file.
1 #ifndef JP2Encoder_h
2 #define JP2Encoder_h
3 
25 #include <string>
26 
27 #include "PixelType.h"
28 
29 #if ENABLEJP2K
30 #include "jp2.h"
31 #include "kdu_stripe_compressor.h"
32 #endif
33 #define MIN_STRIPE_HEIGHT 256
34 #define MAX_STRIPE_HEIGHT 8192
35 #define INCREMENTAL_FLUSH_BYTES (256 * 1024 * 1024)
36 
37 namespace Isis {
38  class JP2Error;
39 
80  class JP2Encoder {
81  public:
82  JP2Encoder(const QString &jp2file, const unsigned int nsamps,
83  const unsigned int nlines, const unsigned int nbands,
84  const Isis::PixelType type);
85  ~JP2Encoder();
86 
87  // Register with the Kakadu error facility
89  return Kakadu_Error;
90  };
91 
92  // Open and initialize the JP2 file for writing
93  void OpenFile();
94 
95  // Write byte data to the JP2 file
96  void Write(unsigned char **inbuf);
97 
98  // Write 16-bit data to the JP2 file
99  void Write(short int **inbuf);
100 
101  private:
102  QString p_jp2File;
103  unsigned int p_sampleDimension;
104  unsigned int p_lineDimension;
105  unsigned int p_bandDimension;
106  unsigned int p_resolutionLevels;
107  std::string p_progressionOrder;
108  unsigned int p_codeBlockSize;
109  bool p_signedData;
110 
111  unsigned int p_tileSizeWidth;
112  unsigned int p_tileSizeHeight;
113  std::vector<unsigned int> p_precinctSize;
114  unsigned int p_pixelBits;
115  unsigned int p_pixelBytes;
116  int p_flushLines;
117 
118  bool p_writeStripes;
119  int *p_stripeHeights;
120 
121  int *p_maxStripeHeights;
122 
123  int *p_precisions;
124 
125  bool *p_isSigned;
126 
127 
128  JP2Error *Kakadu_Error;
129 #if ENABLEJP2K
130  jp2_family_tgt *JP2_Stream;
131  jp2_target *JP2_Boxes;
132  kdu_codestream *JPEG2000_Codestream;
133  kdu_stripe_compressor p_compressor;
134 
135 #endif
136  };
137 };
138 #endif