30 #ifndef GDAL_PAM_H_INCLUDED
31 #define GDAL_PAM_H_INCLUDED
33 #include "gdal_priv.h"
39 #define GCIF_GEOTRANSFORM 0x01
40 #define GCIF_PROJECTION 0x02
41 #define GCIF_METADATA 0x04
42 #define GCIF_GCPS 0x08
44 #define GCIF_NODATA 0x001000
45 #define GCIF_CATEGORYNAMES 0x002000
46 #define GCIF_MINMAX 0x004000
47 #define GCIF_SCALEOFFSET 0x008000
48 #define GCIF_UNITTYPE 0x010000
49 #define GCIF_COLORTABLE 0x020000
50 #define GCIF_COLORINTERP 0x020000
51 #define GCIF_BAND_METADATA 0x040000
52 #define GCIF_RAT 0x080000
53 #define GCIF_MASK 0x100000
54 #define GCIF_BAND_DESCRIPTION 0x200000
56 #define GCIF_ONLY_IF_MISSING 0x10000000
57 #define GCIF_PROCESS_BANDS 0x20000000
59 #define GCIF_PAM_DEFAULT (GCIF_GEOTRANSFORM | GCIF_PROJECTION | \
60 GCIF_METADATA | GCIF_GCPS | \
61 GCIF_NODATA | GCIF_CATEGORYNAMES | \
62 GCIF_MINMAX | GCIF_SCALEOFFSET | \
63 GCIF_UNITTYPE | GCIF_COLORTABLE | \
64 GCIF_COLORINTERP | GCIF_BAND_METADATA | \
65 GCIF_RAT | GCIF_MASK | \
66 GCIF_ONLY_IF_MISSING | GCIF_PROCESS_BANDS|\
67 GCIF_BAND_DESCRIPTION)
71 #define GPF_DIRTY 0x01 // .pam file needs to be written on close
72 #define GPF_TRIED_READ_FAILED 0x02 // no need to keep trying to read .pam.
73 #define GPF_DISABLED 0x04 // do not try any PAM stuff.
74 #define GPF_AUXMODE 0x08 // store info in .aux (HFA) file.
75 #define GPF_NOSAVE 0x10 // do not try to save pam info.
92 int bHaveGeoTransform;
93 double adfGeoTransform[6];
97 char *pszGCPProjection;
113 int IsPamFilenameAPotentialSiblingFile();
121 virtual CPLXMLNode *SerializeToXML(
const char *);
122 virtual CPLErr XMLInit(
CPLXMLNode *,
const char * );
124 virtual CPLErr TryLoadXML(
char **papszSiblingFiles = NULL);
125 virtual CPLErr TrySaveXML();
127 CPLErr TryLoadAux(
char **papszSiblingFiles = NULL);
130 virtual const char *BuildPamFilename();
132 void PamInitialize();
135 void SetPhysicalFilename(
const char * );
136 const char *GetPhysicalFilename();
137 void SetSubdatasetName(
const char *);
138 const char *GetSubdatasetName();
155 const char *pszGCPProjection );
158 const char * pszDomain =
"" );
160 const char * pszValue,
161 const char * pszDomain =
"" );
162 virtual char **
GetMetadata(
const char * pszDomain =
"" );
164 const char * pszDomain =
"" );
168 virtual CPLErr CloneInfo(
GDALDataset *poSrcDS,
int nCloneInfoFlags );
170 virtual CPLErr IBuildOverviews(
const char *pszResampling,
171 int nOverviews,
int *panOverviewList,
172 int nListBands,
int *panBandList,
174 void * pProgressData );
178 void MarkPamDirty() { nPamFlags |= GPF_DIRTY; }
180 int GetPamFlags() {
return nPamFlags; }
181 void SetPamFlags(
int nValue ) { nPamFlags = nValue; }
196 double dfNoDataValue;
203 char **papszCategoryNames;
231 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath );
232 virtual CPLErr XMLInit(
CPLXMLNode *,
const char * );
234 void PamInitialize();
260 virtual double GetOffset(
int *pbSuccess = NULL );
262 virtual double GetScale(
int *pbSuccess = NULL );
265 virtual CPLErr
GetHistogram(
double dfMin,
double dfMax,
266 int nBuckets,
int * panHistogram,
267 int bIncludeOutOfRange,
int bApproxOK,
271 int *pnBuckets,
int ** ppanHistogram,
276 int nBuckets,
int *panHistogram );
279 const char * pszDomain =
"" );
281 const char * pszValue,
282 const char * pszDomain =
"" );
288 virtual CPLErr CloneInfo(
GDALRasterBand *poSrcBand,
int nCloneInfoFlags );
295 int CPL_DLL PamParseHistogram(
CPLXMLNode *psHistItem,
296 double *pdfMin,
double *pdfMax,
297 int *pnBuckets,
int **ppanHistogram,
298 int *pbIncludeOutOfRange,
int *pbApproxOK );
300 PamFindMatchingHistogram(
CPLXMLNode *psSavedHistograms,
301 double dfMin,
double dfMax,
int nBuckets,
302 int bIncludeOutOfRange,
int bApproxOK );
304 PamHistogramToXMLTree(
double dfMin,
double dfMax,
305 int nBuckets,
int * panHistogram,
306 int bIncludeOutOfRange,
int bApprox );
309 const char CPL_DLL * PamGetProxy(
const char * );
310 const char CPL_DLL * PamAllocateProxy(
const char * );
311 const char CPL_DLL * PamDeallocateProxy(
const char * );
312 void CPL_DLL PamCleanProxyDB(
void );