31 #ifndef GDAL_JP2READER_H_INCLUDED 32 #define GDAL_JP2READER_H_INCLUDED 46 class CPL_DLL GDALJP2Box
63 explicit GDALJP2Box(
VSILFILE * = NULL );
66 int SetOffset(
GIntBig nNewOffset );
72 int ReadFirstChild( GDALJP2Box *poSuperBox );
73 int ReadNextChild( GDALJP2Box *poSuperBox );
75 GIntBig GetBoxOffset()
const {
return nBoxOffset; }
76 GIntBig GetBoxLength()
const {
return nBoxLength; }
78 GIntBig GetDataOffset()
const {
return nDataOffset; }
81 const char *GetType() {
return szBoxType; }
87 int DumpReadable( FILE *,
int nIndentLevel = 0 );
89 VSILFILE *GetFILE() {
return fpVSIL; }
91 const GByte *GetUUID() {
return abyUUID; }
94 void SetType(
const char * );
95 void SetWritableData(
int nLength,
const GByte *pabyData );
96 void AppendWritableData(
int nLength,
const void *pabyDataIn );
97 void AppendUInt32(
GUInt32 nVal );
98 void AppendUInt16(
GUInt16 nVal );
99 void AppendUInt8(
GByte nVal );
100 const GByte*GetWritableData() {
return pabyData; }
103 static GDALJP2Box *CreateSuperBox(
const char* pszType,
104 int nCount, GDALJP2Box **papoBoxes );
105 static GDALJP2Box *CreateAsocBox(
int nCount, GDALJP2Box **papoBoxes );
106 static GDALJP2Box *CreateLblBox(
const char *pszLabel );
107 static GDALJP2Box *CreateLabelledXMLAssoc(
const char *pszLabel,
108 const char *pszXML );
109 static GDALJP2Box *CreateUUIDBox(
const GByte *pabyUUID,
110 int nDataSize,
const GByte *pabyData );
117 typedef struct _GDALJP2GeoTIFFBox GDALJP2GeoTIFFBox;
119 class CPL_DLL GDALJP2Metadata
123 void CollectGMLData( GDALJP2Box * );
124 int GMLSRSLookup(
const char *pszURN );
126 int nGeoTIFFBoxesCount;
127 GDALJP2GeoTIFFBox *pasGeoTIFFBoxes;
132 int GetGMLJP2GeoreferencingInfo(
int& nEPSGCode,
134 double adfXVector[2],
135 double adfYVector[2],
136 const char*& pszComment,
138 int& bNeedAxisFlip );
139 static CPLXMLNode* CreateGDALMultiDomainMetadataXML(
141 int bMainMDDomainOnly );
144 char **papszGMLMetadata;
146 bool bHaveGeoTransform;
147 double adfGeoTransform[6];
157 char **papszMetadata;
158 char *pszXMPMetadata;
159 char *pszGDALMultiDomainMetadata;
168 int ParseJP2GeoTIFF();
170 int ParseGMLCoverageDesc();
172 int ReadAndParse(
VSILFILE * fpVSIL,
173 int nGEOJP2Index = 0,
int nGMLJP2Index = 1,
174 int nMSIGIndex = 2,
int *pnIndexUsed = NULL );
175 int ReadAndParse(
const char *pszFilename,
int nGEOJP2Index = 0,
176 int nGMLJP2Index = 1,
int nMSIGIndex = 2,
177 int nWorldFileIndex = 3,
int *pnIndexUsed = NULL );
180 void SetProjection(
const char *pszWKT );
181 void SetGeoTransform(
double * );
182 void SetGCPs(
int,
const GDAL_GCP * );
183 void SetRPCMD(
char** papszRPCMDIn );
185 GDALJP2Box *CreateJP2GeoTIFF();
186 GDALJP2Box *CreateGMLJP2(
int nXSize,
int nYSize );
187 GDALJP2Box *CreateGMLJP2V2(
int nXSize,
int nYSize,
188 const char* pszDefFilename,
191 static GDALJP2Box* CreateGDALMultiDomainMetadataXMLBox(
193 int bMainMDDomainOnly );
194 static GDALJP2Box** CreateXMLBoxes(
GDALDataset* poSrcDS,
196 static GDALJP2Box *CreateXMPBox (
GDALDataset* poSrcDS );
197 static GDALJP2Box *CreateIPRBox (
GDALDataset* poSrcDS );
198 static int IsUUID_MSI(
const GByte *abyUUID);
199 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:154
unsigned int GUInt32
Unsigned int32 type.
Definition: cpl_port.h:199
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:207
Convenient string class based on std::string.
Definition: cpl_string.h:338
Public (C callable) GDAL entry points.
Various convenience functions for CPL.
unsigned short GUInt16
Unsigned int16 type.
Definition: cpl_port.h:205
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:322
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:250
Ground Control Point.
Definition: gdal.h:514