Isis 3 Programmer Reference
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 
34 #define MIN_STRIPE_HEIGHT 256
35 #define MAX_STRIPE_HEIGHT 8192
36 #define INCREMENTAL_FLUSH_BYTES (256 * 1024 * 1024)
37 
38 namespace Isis {
39  class JP2Error;
40 
83  class JP2Encoder {
84  public:
85  JP2Encoder(const QString &jp2file, const unsigned int nsamps,
86  const unsigned int nlines, const unsigned int nbands,
87  const Isis::PixelType type);
88  ~JP2Encoder();
89 
90  // Register with the Kakadu error facility
91  JP2Error *kakadu_error() const {
92  return Kakadu_Error;
93  };
94 
95  // Open and initialize the JP2 file for writing
96  void OpenFile();
97 
98  // Write byte data to the JP2 file
99  void Write(unsigned char **inbuf);
100 
101  // Write 16-bit data to the JP2 file
102  void Write(short int **inbuf);
103 
104  private:
105  QString p_jp2File;
106  std::string p_progressionOrder;
107  std::vector<unsigned int> p_precinctSize;
109 
110 #if ENABLEJP2K
111  unsigned int p_sampleDimension;
112  unsigned int p_lineDimension;
113  unsigned int p_bandDimension;
114  unsigned int p_resolutionLevels;
115  unsigned int p_codeBlockSize;
116  bool p_signedData;
117  unsigned int p_tileSizeWidth;
119  unsigned int p_tileSizeHeight;
120  unsigned int p_pixelBits;
121  unsigned int p_pixelBytes;
122  int p_flushLines;
123  bool p_writeStripes;
125  int *p_stripeHeights;
126  int *p_maxStripeHeights;
128  int *p_precisions;
130  bool *p_isSigned;
132 
134  kdu_supp::jp2_family_tgt *JP2_Stream;
135  kdu_supp::jp2_target *JP2_Boxes;
136  kdu_core::kdu_codestream *JPEG2000_Codestream;
137  kdu_supp::kdu_stripe_compressor p_compressor;
138 #endif
140  };
141 };
142 #endif
std::string p_progressionOrder
Progression order used to create output file.
Definition: JP2Encoder.h:106
QString p_jp2File
Output file name.
Definition: JP2Encoder.h:105
Kakadu error messaging class.
Definition: JP2Error.h:54
JP2Error * Kakadu_Error
JP2 Error handling facility.
Definition: JP2Encoder.h:108
PixelType
Enumerations for Isis Pixel Types.
Definition: PixelType.h:43
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.
Definition: JP2Encoder.cpp:52
void OpenFile()
Open the JPEG2000 file and initialize it.
Definition: JP2Encoder.cpp:124
void Write(unsigned char **inbuf)
Write 8-bit data to JP2 file.
Definition: JP2Encoder.cpp:276
~JP2Encoder()
JP2Encoder destructor.
Definition: JP2Encoder.cpp:302
std::vector< unsigned int > p_precinctSize
Precinct size(s) used to create output file.
Definition: JP2Encoder.h:107
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
JPEG2000 encoder class.
Definition: JP2Encoder.h:83