Isis 3 Programmer Reference
JP2Encoder.h
1 #ifndef JP2Encoder_h
2 #define JP2Encoder_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include <string>
10 
11 #include "PixelType.h"
12 
13 #if ENABLEJP2K
14 #include "jp2.h"
15 #include "kdu_stripe_compressor.h"
16 #endif
17 
18 #define MIN_STRIPE_HEIGHT 256
19 #define MAX_STRIPE_HEIGHT 8192
20 #define INCREMENTAL_FLUSH_BYTES (256 * 1024 * 1024)
21 
22 namespace Isis {
23  class JP2Error;
24 
67  class JP2Encoder {
68  public:
69  JP2Encoder(const QString &jp2file, const unsigned int nsamps,
70  const unsigned int nlines, const unsigned int nbands,
71  const Isis::PixelType type);
72  ~JP2Encoder();
73 
74  // Register with the Kakadu error facility
75  JP2Error *kakadu_error() const {
76  return Kakadu_Error;
77  };
78 
79  // Open and initialize the JP2 file for writing
80  void OpenFile();
81 
82  // Write byte data to the JP2 file
83  void Write(unsigned char **inbuf);
84 
85  // Write 16-bit data to the JP2 file
86  void Write(short int **inbuf);
87 
88  private:
89  QString p_jp2File;
90  std::string p_progressionOrder;
91  std::vector<unsigned int> p_precinctSize;
93 
94 #if ENABLEJP2K
95  unsigned int p_sampleDimension;
96  unsigned int p_lineDimension;
97  unsigned int p_bandDimension;
98  unsigned int p_resolutionLevels;
99  unsigned int p_codeBlockSize;
100  bool p_signedData;
101  unsigned int p_tileSizeWidth;
103  unsigned int p_tileSizeHeight;
104  unsigned int p_pixelBits;
105  unsigned int p_pixelBytes;
106  int p_flushLines;
107  bool p_writeStripes;
109  int *p_stripeHeights;
110  int *p_maxStripeHeights;
112  int *p_precisions;
114  bool *p_isSigned;
116 
118  kdu_supp::jp2_family_tgt *JP2_Stream;
119  kdu_supp::jp2_target *JP2_Boxes;
120  kdu_core::kdu_codestream *JPEG2000_Codestream;
121  kdu_supp::kdu_stripe_compressor p_compressor;
122 #endif
124  };
125 };
126 #endif
Isis::JP2Encoder::p_precinctSize
std::vector< unsigned int > p_precinctSize
Precinct size(s) used to create output file.
Definition: JP2Encoder.h:91
Isis::JP2Encoder::OpenFile
void OpenFile()
Open the JPEG2000 file and initialize it.
Definition: JP2Encoder.cpp:108
Isis::JP2Encoder::~JP2Encoder
~JP2Encoder()
JP2Encoder destructor.
Definition: JP2Encoder.cpp:286
Isis::JP2Encoder::p_jp2File
QString p_jp2File
Output file name.
Definition: JP2Encoder.h:89
Isis::JP2Error
Kakadu error messaging class.
Definition: JP2Error.h:38
Isis::JP2Encoder::Kakadu_Error
JP2Error * Kakadu_Error
JP2 Error handling facility.
Definition: JP2Encoder.h:92
Isis::JP2Encoder
JPEG2000 encoder class.
Definition: JP2Encoder.h:67
Isis::PixelType
PixelType
Enumerations for Isis Pixel Types.
Definition: PixelType.h:27
Isis::JP2Encoder::p_progressionOrder
std::string p_progressionOrder
Progression order used to create output file.
Definition: JP2Encoder.h:90
Isis::JP2Encoder::Write
void Write(unsigned char **inbuf)
Write 8-bit data to JP2 file.
Definition: JP2Encoder.cpp:260
Isis::JP2Encoder::JP2Encoder
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:36
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16