/usr/include/gdal/gdal_pam.h is in libgdal-dev 2.2.3+dfsg-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | /******************************************************************************
* $Id: gdal_pam.h 36501 2016-11-25 14:09:24Z rouault $
*
* Project: GDAL Core
* Purpose: Declaration for Peristable Auxiliary Metadata classes.
* Author: Frank Warmerdam, warmerdam@pobox.com
*
******************************************************************************
* Copyright (c) 2005, Frank Warmerdam <warmerdam@pobox.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
#ifndef GDAL_PAM_H_INCLUDED
#define GDAL_PAM_H_INCLUDED
//! @cond Doxygen_Suppress
#include "gdal_priv.h"
class GDALPamRasterBand;
/* Clone Info Flags */
#define GCIF_GEOTRANSFORM 0x01
#define GCIF_PROJECTION 0x02
#define GCIF_METADATA 0x04
#define GCIF_GCPS 0x08
#define GCIF_NODATA 0x001000
#define GCIF_CATEGORYNAMES 0x002000
#define GCIF_MINMAX 0x004000
#define GCIF_SCALEOFFSET 0x008000
#define GCIF_UNITTYPE 0x010000
#define GCIF_COLORTABLE 0x020000
#define GCIF_COLORINTERP 0x020000
#define GCIF_BAND_METADATA 0x040000
#define GCIF_RAT 0x080000
#define GCIF_MASK 0x100000
#define GCIF_BAND_DESCRIPTION 0x200000
#define GCIF_ONLY_IF_MISSING 0x10000000
#define GCIF_PROCESS_BANDS 0x20000000
#define GCIF_PAM_DEFAULT (GCIF_GEOTRANSFORM | GCIF_PROJECTION | \
GCIF_METADATA | GCIF_GCPS | \
GCIF_NODATA | GCIF_CATEGORYNAMES | \
GCIF_MINMAX | GCIF_SCALEOFFSET | \
GCIF_UNITTYPE | GCIF_COLORTABLE | \
GCIF_COLORINTERP | GCIF_BAND_METADATA | \
GCIF_RAT | GCIF_MASK | \
GCIF_ONLY_IF_MISSING | GCIF_PROCESS_BANDS|\
GCIF_BAND_DESCRIPTION)
/* GDAL PAM Flags */
/* ERO 2011/04/13 : GPF_AUXMODE seems to be unimplemented */
#define GPF_DIRTY 0x01 // .pam file needs to be written on close
#define GPF_TRIED_READ_FAILED 0x02 // no need to keep trying to read .pam.
#define GPF_DISABLED 0x04 // do not try any PAM stuff.
#define GPF_AUXMODE 0x08 // store info in .aux (HFA) file.
#define GPF_NOSAVE 0x10 // do not try to save pam info.
/* ==================================================================== */
/* GDALDatasetPamInfo */
/* */
/* We make these things a separate structure of information */
/* primarily so we can modify it without altering the size of */
/* the GDALPamDataset. It is an effort to reduce ABI churn for */
/* driver plugins. */
/* ==================================================================== */
class GDALDatasetPamInfo
{
public:
char *pszPamFilename;
char *pszProjection;
int bHaveGeoTransform;
double adfGeoTransform[6];
int nGCPCount;
GDAL_GCP *pasGCPList;
char *pszGCPProjection;
CPLString osPhysicalFilename;
CPLString osSubdatasetName;
CPLString osAuxFilename;
int bHasMetadata;
};
//! @endcond
/* ******************************************************************** */
/* GDALPamDataset */
/* ******************************************************************** */
/** PAM dataset */
class CPL_DLL GDALPamDataset : public GDALDataset
{
friend class GDALPamRasterBand;
private:
int IsPamFilenameAPotentialSiblingFile();
protected:
GDALPamDataset(void);
//! @cond Doxygen_Suppress
int nPamFlags;
GDALDatasetPamInfo *psPam;
virtual CPLXMLNode *SerializeToXML( const char *);
virtual CPLErr XMLInit( CPLXMLNode *, const char * );
virtual CPLErr TryLoadXML(char **papszSiblingFiles = NULL);
virtual CPLErr TrySaveXML();
CPLErr TryLoadAux(char **papszSiblingFiles = NULL);
CPLErr TrySaveAux();
virtual const char *BuildPamFilename();
void PamInitialize();
void PamClear();
void SetPhysicalFilename( const char * );
const char *GetPhysicalFilename();
void SetSubdatasetName( const char *);
const char *GetSubdatasetName();
//! @endcond
public:
virtual ~GDALPamDataset();
virtual void FlushCache(void) CPL_OVERRIDE;
virtual const char *GetProjectionRef(void) CPL_OVERRIDE;
virtual CPLErr SetProjection( const char * ) CPL_OVERRIDE;
virtual CPLErr GetGeoTransform( double * ) CPL_OVERRIDE;
virtual CPLErr SetGeoTransform( double * ) CPL_OVERRIDE;
virtual int GetGCPCount() CPL_OVERRIDE;
virtual const char *GetGCPProjection() CPL_OVERRIDE;
virtual const GDAL_GCP *GetGCPs() CPL_OVERRIDE;
virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
const char *pszGCPProjection ) CPL_OVERRIDE;
virtual CPLErr SetMetadata( char ** papszMetadata,
const char * pszDomain = "" ) CPL_OVERRIDE;
virtual CPLErr SetMetadataItem( const char * pszName,
const char * pszValue,
const char * pszDomain = "" ) CPL_OVERRIDE;
virtual char **GetMetadata( const char * pszDomain = "" ) CPL_OVERRIDE;
virtual const char *GetMetadataItem( const char * pszName,
const char * pszDomain = "" ) CPL_OVERRIDE;
virtual char **GetFileList(void) CPL_OVERRIDE;
//! @cond Doxygen_Suppress
virtual CPLErr CloneInfo( GDALDataset *poSrcDS, int nCloneInfoFlags );
virtual CPLErr IBuildOverviews( const char *pszResampling,
int nOverviews, int *panOverviewList,
int nListBands, int *panBandList,
GDALProgressFunc pfnProgress,
void * pProgressData ) CPL_OVERRIDE;
// "semi private" methods.
void MarkPamDirty() { nPamFlags |= GPF_DIRTY; }
GDALDatasetPamInfo *GetPamInfo() { return psPam; }
int GetPamFlags() { return nPamFlags; }
void SetPamFlags(int nValue ) { nPamFlags = nValue; }
//! @endcond
private:
CPL_DISALLOW_COPY_ASSIGN(GDALPamDataset)
};
//! @cond Doxygen_Suppress
/* ==================================================================== */
/* GDALRasterBandPamInfo */
/* */
/* We make these things a separate structure of information */
/* primarily so we can modify it without altering the size of */
/* the GDALPamDataset. It is an effort to reduce ABI churn for */
/* driver plugins. */
/* ==================================================================== */
typedef struct {
GDALPamDataset *poParentDS;
int bNoDataValueSet;
double dfNoDataValue;
GDALColorTable *poColorTable;
GDALColorInterp eColorInterp;
char *pszUnitType;
char **papszCategoryNames;
double dfOffset;
double dfScale;
int bHaveMinMax;
double dfMin;
double dfMax;
int bHaveStats;
double dfMean;
double dfStdDev;
CPLXMLNode *psSavedHistograms;
GDALRasterAttributeTable *poDefaultRAT;
} GDALRasterBandPamInfo;
//! @endcond
/* ******************************************************************** */
/* GDALPamRasterBand */
/* ******************************************************************** */
/** PAM raster band */
class CPL_DLL GDALPamRasterBand : public GDALRasterBand
{
friend class GDALPamDataset;
protected:
//! @cond Doxygen_Suppress
virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
virtual CPLErr XMLInit( CPLXMLNode *, const char * );
void PamInitialize();
void PamClear();
GDALRasterBandPamInfo *psPam;
//! @endcond
public:
GDALPamRasterBand();
//! @cond Doxygen_Suppress
explicit GDALPamRasterBand(int bForceCachedIO);
//! @endcond
virtual ~GDALPamRasterBand();
virtual void SetDescription( const char * ) CPL_OVERRIDE;
virtual CPLErr SetNoDataValue( double ) CPL_OVERRIDE;
virtual double GetNoDataValue( int *pbSuccess = NULL ) CPL_OVERRIDE;
virtual CPLErr DeleteNoDataValue() CPL_OVERRIDE;
virtual CPLErr SetColorTable( GDALColorTable * ) CPL_OVERRIDE;
virtual GDALColorTable *GetColorTable() CPL_OVERRIDE;
virtual CPLErr SetColorInterpretation( GDALColorInterp ) CPL_OVERRIDE;
virtual GDALColorInterp GetColorInterpretation() CPL_OVERRIDE;
virtual const char *GetUnitType() CPL_OVERRIDE;
CPLErr SetUnitType( const char * ) CPL_OVERRIDE;
virtual char **GetCategoryNames() CPL_OVERRIDE;
virtual CPLErr SetCategoryNames( char ** ) CPL_OVERRIDE;
virtual double GetOffset( int *pbSuccess = NULL ) CPL_OVERRIDE;
CPLErr SetOffset( double ) CPL_OVERRIDE;
virtual double GetScale( int *pbSuccess = NULL ) CPL_OVERRIDE;
CPLErr SetScale( double ) CPL_OVERRIDE;
virtual CPLErr GetHistogram( double dfMin, double dfMax,
int nBuckets, GUIntBig * panHistogram,
int bIncludeOutOfRange, int bApproxOK,
GDALProgressFunc, void *pProgressData ) CPL_OVERRIDE;
virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
int *pnBuckets, GUIntBig ** ppanHistogram,
int bForce,
GDALProgressFunc, void *pProgressData) CPL_OVERRIDE;
virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
int nBuckets, GUIntBig *panHistogram ) CPL_OVERRIDE;
virtual CPLErr SetMetadata( char ** papszMetadata,
const char * pszDomain = "" ) CPL_OVERRIDE;
virtual CPLErr SetMetadataItem( const char * pszName,
const char * pszValue,
const char * pszDomain = "" ) CPL_OVERRIDE;
virtual GDALRasterAttributeTable *GetDefaultRAT() CPL_OVERRIDE;
virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * ) CPL_OVERRIDE;
//! @cond Doxygen_Suppress
// new in GDALPamRasterBand.
virtual CPLErr CloneInfo( GDALRasterBand *poSrcBand, int nCloneInfoFlags );
// "semi private" methods.
GDALRasterBandPamInfo *GetPamInfo() { return psPam; }
//! @endcond
private:
CPL_DISALLOW_COPY_ASSIGN(GDALPamRasterBand)
};
//! @cond Doxygen_Suppress
// These are mainly helper functions for internal use.
int CPL_DLL PamParseHistogram( CPLXMLNode *psHistItem,
double *pdfMin, double *pdfMax,
int *pnBuckets, GUIntBig **ppanHistogram,
int *pbIncludeOutOfRange, int *pbApproxOK );
CPLXMLNode CPL_DLL *
PamFindMatchingHistogram( CPLXMLNode *psSavedHistograms,
double dfMin, double dfMax, int nBuckets,
int bIncludeOutOfRange, int bApproxOK );
CPLXMLNode CPL_DLL *
PamHistogramToXMLTree( double dfMin, double dfMax,
int nBuckets, GUIntBig * panHistogram,
int bIncludeOutOfRange, int bApprox );
// For managing the proxy file database.
const char CPL_DLL * PamGetProxy( const char * );
const char CPL_DLL * PamAllocateProxy( const char * );
const char CPL_DLL * PamDeallocateProxy( const char * );
void CPL_DLL PamCleanProxyDB( void );
//! @endcond
#endif /* ndef GDAL_PAM_H_INCLUDED */
|