31 #ifndef GDAL_JP2READER_H_INCLUDED 32 #define GDAL_JP2READER_H_INCLUDED 46 class CPL_DLL GDALJP2Box
65 explicit GDALJP2Box(
VSILFILE * =
nullptr );
68 int SetOffset(
GIntBig nNewOffset );
74 int ReadFirstChild( GDALJP2Box *poSuperBox );
75 int ReadNextChild( GDALJP2Box *poSuperBox );
77 GIntBig GetBoxOffset()
const {
return nBoxOffset; }
78 GIntBig GetBoxLength()
const {
return nBoxLength; }
80 GIntBig GetDataOffset()
const {
return nDataOffset; }
83 const char *GetType() {
return szBoxType; }
89 int DumpReadable( FILE *,
int nIndentLevel = 0 );
91 VSILFILE *GetFILE() {
return fpVSIL; }
93 const GByte *GetUUID() {
return abyUUID; }
96 void SetType(
const char * );
97 void SetWritableData(
int nLength,
const GByte *pabyData );
98 void AppendWritableData(
int nLength,
const void *pabyDataIn );
99 void AppendUInt32(
GUInt32 nVal );
100 void AppendUInt16(
GUInt16 nVal );
101 void AppendUInt8(
GByte nVal );
102 const GByte*GetWritableData() {
return pabyData; }
105 static GDALJP2Box *CreateSuperBox(
const char* pszType,
106 int nCount, GDALJP2Box **papoBoxes );
107 static GDALJP2Box *CreateAsocBox(
int nCount, GDALJP2Box **papoBoxes );
108 static GDALJP2Box *CreateLblBox(
const char *pszLabel );
109 static GDALJP2Box *CreateLabelledXMLAssoc(
const char *pszLabel,
110 const char *pszXML );
111 static GDALJP2Box *CreateUUIDBox(
const GByte *pabyUUID,
112 int nDataSize,
const GByte *pabyData );
119 typedef struct _GDALJP2GeoTIFFBox GDALJP2GeoTIFFBox;
121 class CPL_DLL GDALJP2Metadata
125 void CollectGMLData( GDALJP2Box * );
126 int GMLSRSLookup(
const char *pszURN );
128 int nGeoTIFFBoxesCount;
129 GDALJP2GeoTIFFBox *pasGeoTIFFBoxes;
134 int GetGMLJP2GeoreferencingInfo(
int& nEPSGCode,
136 double adfXVector[2],
137 double adfYVector[2],
138 const char*& pszComment,
140 int& bNeedAxisFlip );
141 static CPLXMLNode* CreateGDALMultiDomainMetadataXML(
143 int bMainMDDomainOnly );
148 char **papszGMLMetadata;
150 bool bHaveGeoTransform;
151 double adfGeoTransform[6];
161 char **papszMetadata;
162 char *pszXMPMetadata;
163 char *pszGDALMultiDomainMetadata;
172 int ParseJP2GeoTIFF();
174 int ParseGMLCoverageDesc();
176 int ReadAndParse(
VSILFILE * fpVSIL,
177 int nGEOJP2Index = 0,
int nGMLJP2Index = 1,
178 int nMSIGIndex = 2,
int *pnIndexUsed =
nullptr );
179 int ReadAndParse(
const char *pszFilename,
int nGEOJP2Index = 0,
180 int nGMLJP2Index = 1,
int nMSIGIndex = 2,
181 int nWorldFileIndex = 3,
int *pnIndexUsed =
nullptr );
184 void SetProjection(
const char *pszWKT );
185 void SetGeoTransform(
double * );
186 void SetGCPs(
int,
const GDAL_GCP * );
187 void SetRPCMD(
char** papszRPCMDIn );
189 GDALJP2Box *CreateJP2GeoTIFF();
190 GDALJP2Box *CreateGMLJP2(
int nXSize,
int nYSize );
191 GDALJP2Box *CreateGMLJP2V2(
int nXSize,
int nYSize,
192 const char* pszDefFilename,
195 static GDALJP2Box* CreateGDALMultiDomainMetadataXMLBox(
197 int bMainMDDomainOnly );
198 static GDALJP2Box** CreateXMLBoxes(
GDALDataset* poSrcDS,
200 static GDALJP2Box *CreateXMPBox (
GDALDataset* poSrcDS );
201 static GDALJP2Box *CreateIPRBox (
GDALDataset* poSrcDS );
202 static int IsUUID_MSI(
const GByte *abyUUID);
203 static int IsUUID_XMP(
const GByte *abyUUID);
Document node structure.
Definition: cpl_minixml.h:66
Definitions for CPL mini XML Parser/Serializer.
FILE VSILFILE
Opaque type for a FILE that implements the VSIVirtualHandle API.
Definition: cpl_vsi.h:156
unsigned int GUInt32
Unsigned int32 type.
Definition: cpl_port.h:207
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:215
Convenient string class based on std::string.
Definition: cpl_string.h:329
Public (C callable) GDAL entry points.
Various convenience functions for CPL.
unsigned short GUInt16
Unsigned int16 type.
Definition: cpl_port.h:213
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:335
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:248
Ground Control Point.
Definition: gdal.h:560
#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:989