Isis 3.0 Programmer Reference
Back | 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
88  JP2Error *kakadu_error() const {
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  std::string p_progressionOrder;
104  std::vector<unsigned int> p_precinctSize;
106 
107 #if ENABLEJP2K
108  unsigned int p_sampleDimension;
109  unsigned int p_lineDimension;
110  unsigned int p_bandDimension;
111  unsigned int p_resolutionLevels;
112  unsigned int p_codeBlockSize;
113  bool p_signedData;
114  unsigned int p_tileSizeWidth;
116  unsigned int p_tileSizeHeight;
117  unsigned int p_pixelBits;
118  unsigned int p_pixelBytes;
119  int p_flushLines;
120  bool p_writeStripes;
122  int *p_stripeHeights;
123  int *p_maxStripeHeights;
125  int *p_precisions;
127  bool *p_isSigned;
129 
131  jp2_family_tgt *JP2_Stream;
132  jp2_target *JP2_Boxes;
133  kdu_codestream *JPEG2000_Codestream;
134  kdu_stripe_compressor p_compressor;
135 #endif
137  };
138 };
139 #endif
std::string p_progressionOrder
Progression order used to create output file.
Definition: JP2Encoder.h:103
QString p_jp2File
Output file name.
Definition: JP2Encoder.h:102
Kakadu error messaging class.
Definition: JP2Error.h:52
JP2Error * Kakadu_Error
JP2 Error handling facility.
Definition: JP2Encoder.h:105
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:46
void OpenFile()
Open the JPEG2000 file and initialize it.
Definition: JP2Encoder.cpp:118
void Write(unsigned char **inbuf)
Write 8-bit data to JP2 file.
Definition: JP2Encoder.cpp:270
~JP2Encoder()
JP2Encoder destructor.
Definition: JP2Encoder.cpp:296
std::vector< unsigned int > p_precinctSize
Precinct size(s) used to create output file.
Definition: JP2Encoder.h:104
JPEG2000 encoder class.
Definition: JP2Encoder.h:80

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:21:23