Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis Developer Reference
JP2Decoder.h
Go to the documentation of this file.
1#ifndef JP2Decoder_h
2#define JP2Decoder_h
7
8/* SPDX-License-Identifier: CC0-1.0 */
9
10#include <string>
11
12#include "gdal_priv.h"
13
14namespace Isis {
15
79 class JP2Decoder {
80 public:
81 JP2Decoder(const QString &jp2file);
83
84 // Open and initialize the JP2 file for reading
85 void OpenFile();
86
87 // Get the sample dimension of the JP2 file
88 inline int GetSampleDimension() const {
89 return (int)p_numSamples;
90 }
91
92 // Get the line dimension of the JP2 file
93 inline int GetLineDimension() const {
94 return (int)p_numLines;
95 }
96
97 // Get the band dimension of the JP2 file
98 inline int GetBandDimension() const {
99 return (int)p_numBands;
100 }
101
102 // Get number of bytes per pixel in the JP2 file
103 inline int GetPixelBytes() const {
104 return p_pixelBytes;
105 }
106
107 // Determine if data in JP2 file is signed
108 inline bool GetSignedData() const {
109 return p_signedData;
110 }
111
112 // Read byte data from the JP2 file
113 void Read(unsigned char **inbuf);
114
115 // Read 16-bit data from the JP2 file
116 void Read(short int **inbuf);
117
118 static bool IsJP2(QString filename);
119
120 private:
121 QString p_jp2File;
122 unsigned int p_numSamples = 0;
123 unsigned int p_numLines = 0;
124 unsigned int p_numBands = 0;
125 unsigned int p_pixelBytes = 0;
126 bool p_signedData = false;
127
128 GDALDataset *p_dataset = nullptr;
129 int p_currentLine = 0;
130 };
131};
132#endif
bool GetSignedData() const
Definition JP2Decoder.h:108
static bool IsJP2(QString filename)
Check if a file is a valid JP2 file.
Definition JP2Decoder.cpp:167
void OpenFile()
Open the JPEG2000 file.
Definition JP2Decoder.cpp:33
JP2Decoder(const QString &jp2file)
Constructs a JPEG2000 decoder object.
Definition JP2Decoder.cpp:25
int GetSampleDimension() const
Definition JP2Decoder.h:88
int GetPixelBytes() const
Definition JP2Decoder.h:103
void Read(unsigned char **inbuf)
Read data from JP2 file containing 8-bit data.
Definition JP2Decoder.cpp:105
int GetLineDimension() const
Definition JP2Decoder.h:93
~JP2Decoder()
JP2Decoder destructor.
Definition JP2Decoder.cpp:157
int GetBandDimension() const
Definition JP2Decoder.h:98
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16