15#ifndef GDAL_JP2READER_H_INCLUDED
16#define GDAL_JP2READER_H_INCLUDED
30class CPL_DLL GDALJP2Box
35 char szBoxType[5]{0, 0, 0, 0, 0};
42 GByte abyUUID[16]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
44 GByte *pabyData =
nullptr;
46 bool m_bAllowGetFileSize =
true;
51 explicit GDALJP2Box(
VSILFILE * =
nullptr);
54 void SetAllowGetFileSize(
bool b)
56 m_bAllowGetFileSize = b;
59 int SetOffset(
GIntBig nNewOffset);
65 int ReadFirstChild(GDALJP2Box *poSuperBox);
66 int ReadNextChild(GDALJP2Box *poSuperBox);
94 int DumpReadable(FILE *,
int nIndentLevel = 0);
101 const GByte *GetUUID()
107 void SetType(
const char *);
108 void SetWritableData(
int nLength,
const GByte *pabyData);
109 void AppendWritableData(
int nLength,
const void *pabyDataIn);
110 void AppendUInt32(
GUInt32 nVal);
111 void AppendUInt16(
GUInt16 nVal);
112 void AppendUInt8(
GByte nVal);
114 const GByte *GetWritableData()
const
119 GByte *GetWritableBoxData()
const;
122 static GDALJP2Box *CreateSuperBox(
const char *pszType,
int nCount,
123 const GDALJP2Box *
const *papoBoxes);
124 static GDALJP2Box *CreateAsocBox(
int nCount,
125 const GDALJP2Box *
const *papoBoxes);
126 static GDALJP2Box *CreateLblBox(
const char *pszLabel);
127 static GDALJP2Box *CreateLabelledXMLAssoc(
const char *pszLabel,
129 static GDALJP2Box *CreateUUIDBox(
const GByte *pabyUUID,
int nDataSize,
130 const GByte *pabyData);
133 static GDALJP2Box *CreateJUMBFDescriptionBox(
const GByte *pabyUUIDType,
134 const char *pszLabel);
135 static GDALJP2Box *CreateJUMBFBox(
const GDALJP2Box *poJUMBFDescriptionBox,
137 const GDALJP2Box *
const *papoBoxes);
144typedef struct _GDALJP2GeoTIFFBox GDALJP2GeoTIFFBox;
146class CPL_DLL GDALJP2Metadata
150 void CollectGMLData(GDALJP2Box *);
151 int GMLSRSLookup(
const char *pszURN);
153 int nGeoTIFFBoxesCount;
154 GDALJP2GeoTIFFBox *pasGeoTIFFBoxes;
159 void GetGMLJP2GeoreferencingInfo(
int &nEPSGCode,
double adfOrigin[2],
160 double adfXVector[2],
double adfYVector[2],
161 const char *&pszComment,
162 CPLString &osDictBox,
bool &bNeedAxisFlip);
164 int bMainMDDomainOnly);
169 char **papszGMLMetadata;
171 bool bHaveGeoTransform;
172 double adfGeoTransform[6];
182 char **papszMetadata;
183 char *pszXMPMetadata;
184 char *pszGDALMultiDomainMetadata;
187 void ReadBox(
VSILFILE *fpVSIL, GDALJP2Box &oBox,
int &iBox);
195 int ParseJP2GeoTIFF();
197 int ParseGMLCoverageDesc();
199 int ReadAndParse(
VSILFILE *fpVSIL,
int nGEOJP2Index = 0,
200 int nGMLJP2Index = 1,
int nMSIGIndex = 2,
201 int *pnIndexUsed =
nullptr);
202 int ReadAndParse(
const char *pszFilename,
int nGEOJP2Index = 0,
203 int nGMLJP2Index = 1,
int nMSIGIndex = 2,
204 int nWorldFileIndex = 3,
int *pnIndexUsed =
nullptr);
208 void SetGeoTransform(
double *);
209 void SetGCPs(
int,
const GDAL_GCP *);
210 void SetRPCMD(
char **papszRPCMDIn);
212 GDALJP2Box *CreateJP2GeoTIFF();
213 GDALJP2Box *CreateGMLJP2(
int nXSize,
int nYSize);
214 GDALJP2Box *CreateGMLJP2V2(
int nXSize,
int nYSize,
215 const char *pszDefFilename,
219 CreateGDALMultiDomainMetadataXMLBox(
GDALDataset *poSrcDS,
220 int bMainMDDomainOnly);
221 static GDALJP2Box **CreateXMLBoxes(
GDALDataset *poSrcDS,
int *pnBoxes);
222 static GDALJP2Box *CreateXMPBox(
GDALDataset *poSrcDS);
223 static GDALJP2Box *CreateIPRBox(
GDALDataset *poSrcDS);
224 static int IsUUID_MSI(
const GByte *abyUUID);
225 static int IsUUID_XMP(
const GByte *abyUUID);
233const char CPL_DLL *GDALGetJPEG2000Reversibility(
const char *pszFilename,
Convenient string class based on std::string.
Definition: cpl_string.h:307
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:495
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:153
Various convenience functions for CPL.
Definitions for CPL mini XML Parser/Serializer.
unsigned int GUInt32
Unsigned int32 type.
Definition: cpl_port.h:161
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition: cpl_port.h:1030
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1179
unsigned short GUInt16
Unsigned int16 type.
Definition: cpl_port.h:167
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:169
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:199
Public (C callable) GDAL entry points.
CPLXMLNode * GDALGetJPEG2000Structure(const char *pszFilename, CSLConstList papszOptions)
Dump the structure of a JPEG2000 file as a XML tree.
Definition: gdaljp2structure.cpp:2344
Document node structure.
Definition: cpl_minixml.h:55
Ground Control Point.
Definition: gdal.h:1168
Virtual file handle.
Definition: cpl_vsi_virtual.h:47