32 #ifndef GDAL_PRIV_H_INCLUDED
33 #define GDAL_PRIV_H_INCLUDED
50 class GDALProxyDataset;
51 class GDALProxyRasterBand;
61 #include "gdal_frmts.h"
66 #include "cpl_multiproc.h"
67 #include "cpl_atomic_ops.h"
73 #define GMO_VALID 0x0001
74 #define GMO_IGNORE_UNIMPLEMENTED 0x0002
75 #define GMO_SUPPORT_MD 0x0004
76 #define GMO_SUPPORT_MDMD 0x0008
77 #define GMO_MD_DIRTY 0x0010
78 #define GMO_PAM_CLASS 0x0020
86 class CPL_DLL GDALMultiDomainMetadata
89 char **papszDomainList;
93 GDALMultiDomainMetadata();
94 ~GDALMultiDomainMetadata();
96 int XMLInit(
CPLXMLNode *psMetadata,
int bMerge );
99 char **GetDomainList() {
return papszDomainList; }
101 char **GetMetadata(
const char * pszDomain =
"" );
102 CPLErr SetMetadata(
char ** papszMetadata,
103 const char * pszDomain =
"" );
104 const char *GetMetadataItem(
const char * pszName,
105 const char * pszDomain =
"" );
106 CPLErr SetMetadataItem(
const char * pszName,
107 const char * pszValue,
108 const char * pszDomain =
"" );
131 GDALMultiDomainMetadata oMDMD;
135 char **BuildMetadataDomainList(
char** papszList,
141 int GetMOFlags()
const;
142 void SetMOFlags(
int nFlagsIn );
144 virtual const char *GetDescription()
const;
145 virtual void SetDescription(
const char * );
147 virtual char **GetMetadataDomainList();
149 virtual char **GetMetadata(
const char * pszDomain =
"" );
150 virtual CPLErr SetMetadata(
char ** papszMetadata,
151 const char * pszDomain =
"" );
152 virtual const char *GetMetadataItem(
const char * pszName,
153 const char * pszDomain =
"" );
154 virtual CPLErr SetMetadataItem(
const char * pszName,
155 const char * pszValue,
156 const char * pszDomain =
"" );
164 class CPL_DLL GDALDefaultOverviews
175 bool bCheckedForMask;
184 bool bCheckedForOverviews;
188 char **papszInitSiblingFiles;
191 GDALDefaultOverviews();
192 ~GDALDefaultOverviews();
194 void Initialize(
GDALDataset *poDSIn,
const char *pszName = NULL,
195 char **papszSiblingFiles = NULL,
196 int bNameIsOVR = FALSE );
198 void TransferSiblingFiles(
char** papszSiblingFiles );
206 int GetOverviewCount(
int nBand );
210 const char * pszResampling,
211 int nOverviews,
int * panOverviewList,
212 int nBands,
int * panBandList,
213 GDALProgressFunc pfnProgress,
214 void *pProgressData );
216 CPLErr BuildOverviewsSubDataset(
const char * pszPhysicalFile,
217 const char * pszResampling,
218 int nOverviews,
int * panOverviewList,
219 int nBands,
int * panBandList,
220 GDALProgressFunc pfnProgress,
221 void *pProgressData );
229 int GetMaskFlags(
int nBand );
231 int HaveMaskFile(
char **papszSiblings = NULL,
232 const char *pszBasename = NULL );
234 char** GetSiblingFiles() {
return papszInitSiblingFiles; }
248 bool bHasGotSiblingFiles;
249 char **papszSiblingFiles;
250 int nHeaderBytesTried;
254 char **papszSiblingFiles = NULL );
283 int TryToIngest(
int nBytes);
284 char **GetSiblingFiles();
285 char **StealSiblingFiles();
286 bool AreSiblingFilesLoaded()
const;
301 class swq_select_parse_options;
304 typedef struct GDALSQLParseInfo GDALSQLParseInfo;
307 #ifdef DETECT_OLD_IRASTERIO
308 typedef void signature_changed;
312 #ifdef GDAL_COMPILATION
313 #define OPTIONAL_OUTSIDE_GDAL(val)
315 #define OPTIONAL_OUTSIDE_GDAL(val) = val
325 unsigned int nOpenFlags,
326 const char*
const* papszAllowedDrivers,
327 const char*
const* papszOpenOptions,
328 const char*
const* papszSiblingFiles );
332 friend class GDALDefaultOverviews;
333 friend class GDALProxyDataset;
336 void AddToDatasetOpenList();
338 void Init(
bool bForceCachedIO );
357 bool bSuppressOnClose;
362 void RasterInitialize(
int,
int );
365 GDALDefaultOverviews oOvManager;
367 virtual CPLErr IBuildOverviews(
const char *,
int,
int *,
368 int,
int *, GDALProgressFunc,
void * );
370 #ifdef DETECT_OLD_IRASTERIO
371 virtual signature_changed IRasterIO(
GDALRWFlag,
int,
int,
int,
int,
373 int,
int *,
int,
int,
int ) {};
385 void BlockBasedFlushCache();
388 int nXOff,
int nYOff,
int nXSize,
int nYSize,
389 void * pData,
int nBufXSize,
int nBufYSize,
391 int nBandCount,
int *panBandMap,
397 int nXOff,
int nYOff,
int nXSize,
int nYSize,
398 void * pData,
int nBufXSize,
int nBufYSize,
400 int nBandCount,
int *panBandMap,
405 CPLErr ValidateRasterIOOrAdviseReadParameters(
406 const char* pszCallingFunc,
407 int* pbStopProcessingOnCENone,
408 int nXOff,
int nYOff,
int nXSize,
int nYSize,
409 int nBufXSize,
int nBufYSize,
410 int nBandCount,
int *panBandMap);
413 int nXOff,
int nYOff,
int nXSize,
int nYSize,
414 void * pData,
int nBufXSize,
int nBufYSize,
416 int nBandCount,
int *panBandMap,
423 virtual int CloseDependentDatasets();
425 int ValidateLayerCreationOptions(
const char*
const* papszLCO );
427 char **papszOpenOptions;
434 void LeaveReadWrite();
437 void TemporarilyDropReadWriteLock();
438 void ReacquireReadWriteLock();
440 void DisableReadWriteMutex();
449 int GetRasterXSize(
void );
450 int GetRasterYSize(
void );
451 int GetRasterCount(
void );
456 virtual const char *GetProjectionRef(
void);
457 virtual CPLErr SetProjection(
const char * pszProjection );
459 virtual CPLErr GetGeoTransform(
double * padfTransform );
460 virtual CPLErr SetGeoTransform(
double * padfTransform );
463 char **papszOptions=NULL );
465 virtual void *GetInternalHandle(
const char * pszHandleName );
467 virtual char **GetFileList(
void);
469 virtual const char* GetDriverName();
471 virtual int GetGCPCount();
472 virtual const char *GetGCPProjection();
474 virtual CPLErr SetGCPs(
int nGCPCount,
const GDAL_GCP *pasGCPList,
475 const char *pszGCPProjection );
478 int nBufXSize,
int nBufYSize,
480 int nBandCount,
int *panBandList,
481 char **papszOptions );
486 BeginAsyncReader(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
487 void *pBuf,
int nBufXSize,
int nBufYSize,
489 int nBandCount,
int* panBandMap,
490 int nPixelSpace,
int nLineSpace,
int nBandSpace,
491 char **papszOptions);
499 OPTIONAL_OUTSIDE_GDAL(NULL)
512 int GetShared()
const;
523 static GDALDataset **GetOpenDatasets(
int *pnDatasetCount );
526 int,
int *, GDALProgressFunc,
void * );
539 const char * pszValue,
546 void *m_hPrivateData;
548 OGRLayer* BuildLayerFromSelectInfo(swq_select* psSelectInfo,
550 const
char *pszDialect,
551 swq_select_parse_options* poSelectParseOptions);
555 virtual
int GetLayerCount();
556 virtual
OGRLayer *GetLayer(
int iLayer);
557 virtual
OGRLayer *GetLayerByName(const
char *);
558 virtual
OGRErr DeleteLayer(
int iLayer);
560 virtual
void ResetReading();
562 double* pdfProgressPct,
563 GDALProgressFunc pfnProgress,
564 void* pProgressData );
566 virtual
int TestCapability( const
char * );
568 virtual
OGRLayer *CreateLayer( const
char *pszName,
571 char ** papszOptions = NULL );
573 const
char *pszNewName,
574 char **papszOptions = NULL );
577 virtual
void SetStyleTableDirectly(
OGRStyleTable *poStyleTable );
581 virtual
OGRLayer * ExecuteSQL( const
char *pszStatement,
583 const
char *pszDialect );
584 virtual
void ReleaseResultSet(
OGRLayer * poResultsSet );
586 int GetRefCount() const;
587 int GetSummaryRefCount() const;
590 virtual
OGRErr StartTransaction(
int bForce=FALSE);
591 virtual
OGRErr CommitTransaction();
592 virtual
OGRErr RollbackTransaction();
595 static
int IsGenericSQLDialect(const
char* pszDialect);
598 GDALSQLParseInfo* BuildParseInfo(swq_select* psSelectInfo,
599 swq_select_parse_options* poSelectParseOptions);
600 static
void DestroyParseInfo(GDALSQLParseInfo* psParseInfo );
601 OGRLayer * ExecuteSQL( const
char *pszStatement,
603 const
char *pszDialect,
604 swq_select_parse_options* poSelectParseOptions);
608 virtual
OGRLayer *ICreateLayer( const
char *pszName,
611 char ** papszOptions = NULL );
614 OGRErr ProcessSQLCreateIndex( const
char * );
615 OGRErr ProcessSQLDropIndex( const
char * );
616 OGRErr ProcessSQLDropTable( const
char * );
617 OGRErr ProcessSQLAlterTableAddColumn( const
char * );
618 OGRErr ProcessSQLAlterTableDropColumn( const
char * );
619 OGRErr ProcessSQLAlterTableAlterColumn( const
char * );
620 OGRErr ProcessSQLAlterTableRenameColumn( const
char * );
639 friend class GDALAbstractBandBlockCache;
644 volatile int nLockCount;
656 GDALRasterBlock *poNext;
657 GDALRasterBlock *poPrevious;
661 void Detach_unlocked(
void );
662 void Touch_unlocked(
void );
664 void RecycleFor(
int nXOffIn,
int nYOffIn );
668 GDALRasterBlock(
int nXOffIn,
int nYOffIn );
669 virtual ~GDALRasterBlock();
671 CPLErr Internalize(
void );
673 void MarkDirty(
void );
674 void MarkClean(
void );
676 int AddLock(
void ) {
return CPLAtomicInc(&nLockCount); }
678 int DropLock(
void ) {
return CPLAtomicDec(&nLockCount); }
718 int DropLockForRemovalFromStorage();
724 static void FlushDirtyBlocks();
725 static int FlushCacheBlock(
int bDirtyBlocksOnly = FALSE);
726 static void Verify();
731 static void DumpAll();
736 static void DestroyRBMutex();
753 std::vector<GDALColorEntry> aoEntries;
764 int GetColorEntryCount()
const;
782 class CPL_DLL GDALAbstractBandBlockCache
790 CPLMutex *hCondMutex;
791 volatile int nKeepAliveCounter;
796 void FreeDanglingBlocks();
797 void UnreferenceBlockBase();
798 void WaitKeepAliveCounter();
802 virtual ~GDALAbstractBandBlockCache();
807 virtual bool Init() = 0;
808 virtual bool IsInitOK() = 0;
809 virtual CPLErr FlushCache() = 0;
812 int nYBlockYOff ) = 0;
814 virtual CPLErr FlushBlock(
int nXBlockOff,
int nYBlockOff,
815 int bWriteDirtyBlock ) = 0;
818 GDALAbstractBandBlockCache* GDALArrayBandBlockCacheCreate(
GDALRasterBand* poBand);
819 GDALAbstractBandBlockCache* GDALHashSetBandBlockCacheCreate(
GDALRasterBand* poBand);
832 friend class GDALArrayBandBlockCache;
833 friend class GDALHashSetBandBlockCache;
837 GDALAbstractBandBlockCache* poBandBlockCache;
839 void SetFlushBlockErr(
CPLErr eErr );
842 void Init(
int bForceCachedIO);
859 int nBlocksPerColumn;
868 void InvalidateMaskBand();
871 friend class GDALProxyRasterBand;
872 friend class GDALDefaultOverviews;
879 void LeaveReadWrite();
884 virtual CPLErr IReadBlock(
int nBlockXOff,
int nBlockYOff,
void * pData ) = 0;
885 virtual CPLErr IWriteBlock(
int nBlockXOff,
int nBlockYOff,
void * pData );
887 #ifdef DETECT_OLD_IRASTERIO
888 virtual signature_changed IRasterIO(
GDALRWFlag,
int,
int,
int,
int,
897 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
898 int nXSize,
int nYSize,
907 int nXOff,
int nYOff,
int nXSize,
int nYSize,
908 void * pData,
int nBufXSize,
int nBufYSize,
919 GDALRasterBlock *TryGetLockedBlockRef(
int nXBlockOff,
int nYBlockYOff );
933 void GetBlockSize(
int *,
int * );
934 CPLErr GetActualBlockSize (
int,
int,
int *,
int * );
941 OPTIONAL_OUTSIDE_GDAL(NULL)
950 CPLErr FlushBlock(
int,
int,
int bWriteDirtyBlock = TRUE );
952 unsigned char* GetIndexColorTranslationTo(
GDALRasterBand* poReferenceBand,
953 unsigned char* pTranslationTable = NULL,
954 int* pApproximateMatching = NULL);
958 virtual CPLErr FlushCache();
959 virtual char **GetCategoryNames();
960 virtual double GetNoDataValue(
int *pbSuccess = NULL );
961 virtual double GetMinimum(
int *pbSuccess = NULL );
962 virtual double GetMaximum(
int *pbSuccess = NULL );
963 virtual double GetOffset(
int *pbSuccess = NULL );
964 virtual double GetScale(
int *pbSuccess = NULL );
965 virtual const char *GetUnitType();
968 virtual CPLErr Fill(
double dfRealValue,
double dfImaginaryValue = 0);
970 virtual CPLErr SetCategoryNames(
char ** papszNames );
971 virtual CPLErr SetNoDataValue(
double dfNoData );
972 virtual CPLErr DeleteNoDataValue();
975 virtual CPLErr SetOffset(
double dfNewOffset );
976 virtual CPLErr SetScale(
double dfNewScale );
977 virtual CPLErr SetUnitType(
const char * pszNewValue );
979 virtual CPLErr GetStatistics(
int bApproxOK,
int bForce,
980 double *pdfMin,
double *pdfMax,
981 double *pdfMean,
double *padfStdDev );
982 virtual CPLErr ComputeStatistics(
int bApproxOK,
983 double *pdfMin,
double *pdfMax,
984 double *pdfMean,
double *pdfStdDev,
985 GDALProgressFunc,
void *pProgressData );
986 virtual CPLErr SetStatistics(
double dfMin,
double dfMax,
987 double dfMean,
double dfStdDev );
988 virtual CPLErr ComputeRasterMinMax(
int,
double* );
998 const char * pszValue,
1002 virtual int HasArbitraryOverviews();
1003 virtual int GetOverviewCount();
1006 virtual CPLErr BuildOverviews(
const char * pszResampling,
1008 int * panOverviewList,
1009 GDALProgressFunc pfnProgress,
1010 void * pProgressData );
1012 virtual CPLErr AdviseRead(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
1013 int nBufXSize,
int nBufYSize,
1016 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
1017 int nBuckets,
GUIntBig * panHistogram,
1018 int bIncludeOutOfRange,
int bApproxOK,
1019 GDALProgressFunc,
void *pProgressData );
1021 virtual CPLErr GetDefaultHistogram(
double *pdfMin,
double *pdfMax,
1022 int *pnBuckets,
GUIntBig ** ppanHistogram,
1024 GDALProgressFunc,
void *pProgressData);
1025 virtual CPLErr SetDefaultHistogram(
double dfMin,
double dfMax,
1026 int nBuckets,
GUIntBig *panHistogram );
1032 virtual int GetMaskFlags();
1033 virtual CPLErr CreateMaskBand(
int nFlagsIn );
1040 int GetDataCoverageStatus(
int nXOff,
int nYOff,
1041 int nXSize,
int nYSize,
1042 int nMaskFlagStop = 0,
1043 double* pdfDataPct = NULL );
1063 virtual ~GDALAllValidMaskBand();
1065 virtual GDALRasterBand *GetMaskBand() CPL_OVERRIDE;
1066 virtual
int GetMaskFlags() CPL_OVERRIDE;
1073 class CPL_DLL GDALNoDataMaskBand : public GDALRasterBand
1075 double dfNoDataValue;
1076 GDALRasterBand *poParent;
1085 explicit GDALNoDataMaskBand( GDALRasterBand * );
1086 virtual ~GDALNoDataMaskBand();
1093 class CPL_DLL GDALNoDataValuesMaskBand : public GDALRasterBand
1095 double *padfNodataValues;
1101 explicit GDALNoDataValuesMaskBand(
GDALDataset * );
1102 virtual ~GDALNoDataValuesMaskBand();
1109 class GDALRescaledAlphaBand : public GDALRasterBand
1111 GDALRasterBand *poParent;
1116 virtual
CPLErr IRasterIO( GDALRWFlag,
int,
int,
int,
int,
1117 void *,
int,
int, GDALDataType,
1121 explicit GDALRescaledAlphaBand( GDALRasterBand * );
1122 virtual ~GDALRescaledAlphaBand();
1167 const char * pszValue,
1173 GDALDataset *Create(
const char * pszName,
1174 int nXSize,
int nYSize,
int nBands,
1177 CPLErr Delete(
const char * pszName );
1178 CPLErr Rename(
const char * pszNewName,
1179 const char * pszOldName );
1180 CPLErr CopyFiles(
const char * pszNewName,
1181 const char * pszOldName );
1183 GDALDataset *CreateCopy(
const char *, GDALDataset *,
1185 GDALProgressFunc pfnProgress,
1196 GDALDataset *(*pfnCreate)(
const char * pszName,
1197 int nXSize,
int nYSize,
int nBands,
1199 char ** papszOptions );
1201 CPLErr (*pfnDelete)(
const char * pszName );
1203 GDALDataset *(*pfnCreateCopy)(
const char *, GDALDataset *,
1205 GDALProgressFunc pfnProgress,
1206 void * pProgressData );
1221 CPLErr (*pfnRename)(
const char * pszNewName,
1222 const char * pszOldName );
1223 CPLErr (*pfnCopyFiles)(
const char * pszNewName,
1224 const char * pszOldName );
1228 GDALDataset *(*pfnCreateVectorOnly)( GDALDriver*,
1229 const char * pszName,
1230 char ** papszOptions );
1231 CPLErr (*pfnDeleteDataSource)( GDALDriver*,
1232 const char * pszName );
1239 GDALDataset *DefaultCreateCopy(
const char *, GDALDataset *,
1241 GDALProgressFunc pfnProgress,
1243 static CPLErr DefaultCopyMasks( GDALDataset *poSrcDS,
1244 GDALDataset *poDstDS,
1247 static CPLErr QuietDelete(
const char * pszName );
1250 static CPLErr DefaultRename(
const char * pszNewName,
1251 const char * pszOldName );
1252 static CPLErr DefaultCopyFiles(
const char * pszNewName,
1253 const char * pszOldName );
1274 std::map<CPLString, GDALDriver*> oMapNameToDrivers;
1276 GDALDriver *GetDriver_unlocked(
int iDriver )
1277 {
return (iDriver >= 0 && iDriver < nDrivers) ?
1278 papoDrivers[iDriver] : NULL; }
1280 GDALDriver *GetDriverByName_unlocked(
const char * pszName )
1287 int GetDriverCount(
void )
const;
1295 static void AutoLoadDrivers();
1296 void AutoSkipDrivers();
1324 GDALDataType eBufType;
1394 GetNextUpdatedRegion(
double dfTimeout,
1395 int* pnBufXOff,
int* pnBufYOff,
1396 int* pnBufXSize,
int* pnBufYSize) = 0;
1397 virtual int LockBuffer(
double dfTimeout = -1.0 );
1398 virtual void UnlockBuffer();
1408 GDALRegenerateOverviewsMultiBand(
int nBands, GDALRasterBand** papoSrcBands,
1410 GDALRasterBand*** papapoOverviewBands,
1411 const char * pszResampling,
1412 GDALProgressFunc pfnProgress,
void * pProgressData );
1414 typedef CPLErr (*GDALResampleFunction)
1415 (
double dfXRatioDstToSrc,
1416 double dfYRatioDstToSrc,
1419 GDALDataType eWrkDataType,
1421 GByte * pabyChunkNodataMask,
1422 int nChunkXOff,
int nChunkXSize,
1423 int nChunkYOff,
int nChunkYSize,
1424 int nDstXOff,
int nDstXOff2,
1425 int nDstYOff,
int nDstYOff2,
1426 GDALRasterBand * poOverview,
1427 const char * pszResampling,
1428 int bHasNoData,
float fNoDataValue,
1430 GDALDataType eSrcDataType,
1431 bool bPropagateNoData );
1433 GDALResampleFunction GDALGetResampleFunction(
const char* pszResampling,
1436 #ifdef GDAL_ENABLE_RESAMPLING_MULTIBAND
1437 typedef CPLErr (*GDALResampleFunctionMultiBands)
1438 (
double dfXRatioDstToSrc,
1439 double dfYRatioDstToSrc,
1442 GDALDataType eWrkDataType,
1443 void * pChunk,
int nBands,
1444 GByte * pabyChunkNodataMask,
1445 int nChunkXOff,
int nChunkXSize,
1446 int nChunkYOff,
int nChunkYSize,
1447 int nDstXOff,
int nDstXOff2,
1448 int nDstYOff,
int nDstYOff2,
1449 GDALRasterBand ** papoDstBands,
1450 const char * pszResampling,
1451 int bHasNoData,
float fNoDataValue,
1453 GDALDataType eSrcDataType);
1455 GDALResampleFunctionMultiBands GDALGetResampleFunctionMultiBands(
const char* pszResampling,
1459 GDALDataType GDALGetOvrWorkDataType(
const char* pszResampling,
1460 GDALDataType eSrcDataType);
1465 HFAAuxBuildOverviews(
const char *pszOvrFilename, GDALDataset *poParentDS,
1466 GDALDataset **ppoDS,
1467 int nBands,
int *panBandList,
1468 int nNewOverviews,
int *panNewOverviewList,
1469 const char *pszResampling,
1470 GDALProgressFunc pfnProgress,
1471 void *pProgressData );
1474 GTIFFBuildOverviews(
const char * pszFilename,
1475 int nBands, GDALRasterBand **papoBandList,
1476 int nOverviews,
int * panOverviewList,
1477 const char * pszResampling,
1478 GDALProgressFunc pfnProgress,
void * pProgressData );
1481 GDALDefaultBuildOverviews( GDALDataset *hSrcDS,
const char * pszBasename,
1482 const char * pszResampling,
1483 int nOverviews,
int * panOverviewList,
1484 int nBands,
int * panBandList,
1485 GDALProgressFunc pfnProgress,
void * pProgressData);
1487 int CPL_DLL GDALBandGetBestOverviewLevel(GDALRasterBand* poBand,
1488 int &nXOff,
int &nYOff,
1489 int &nXSize,
int &nYSize,
1490 int nBufXSize,
int nBufYSize) CPL_WARN_DEPRECATED(
"Use GDALBandGetBestOverviewLevel2 instead");
1491 int CPL_DLL GDALBandGetBestOverviewLevel2(GDALRasterBand* poBand,
1492 int &nXOff,
int &nYOff,
1493 int &nXSize,
int &nYSize,
1494 int nBufXSize,
int nBufYSize,
1497 int CPL_DLL GDALOvLevelAdjust(
int nOvLevel,
int nXSize ) CPL_WARN_DEPRECATED(
"Use GDALOvLevelAdjust2 instead");
1498 int CPL_DLL GDALOvLevelAdjust2(
int nOvLevel,
int nXSize,
int nYSize );
1499 int CPL_DLL GDALComputeOvFactor(
int nOvrXSize,
int nRasterXSize,
1500 int nOvrYSize,
int nRasterYSize );
1502 GDALDataset CPL_DLL *
1503 GDALFindAssociatedAuxFile(
const char *pszBasefile,
GDALAccess eAccess,
1504 GDALDataset *poDependentDS );
1511 int *pnXSize,
int *pnYSize,
1512 double *padfGeoTransform,
1513 char **ppszProjection );
1519 int CPL_DLL GDALCheckDatasetDimensions(
int nXSize,
int nYSize );
1520 int CPL_DLL GDALCheckBandCount(
int nBands,
int bIsZeroAllowed );
1524 #define ARE_REAL_EQUAL(dfVal1, dfVal2) \
1526 (((float)dfVal2 == (float)1.17549435e-38) ? ((float)dfVal1 == (float)dfVal2) : \
1528 (dfVal2 == 2.2250738585072014e-308) ? (dfVal1 == dfVal2) : \
1530 (dfVal1 == dfVal2 || fabs(dfVal1 - dfVal2) < 1e-10 || (dfVal2 != 0 && fabs(1 - dfVal1 / dfVal2) < 1e-10 )))
1535 int CPL_DLL GDALReadWorldFile2(
const char *pszBaseFilename,
const char *pszExtension,
1536 double *padfGeoTransform,
char** papszSiblingFiles,
1537 char** ppszWorldFileNameOut);
1538 int GDALReadTabFile2(
const char * pszBaseFilename,
1539 double *padfGeoTransform,
char **ppszWKT,
1540 int *pnGCPCount,
GDAL_GCP **ppasGCPs,
1541 char** papszSiblingFiles,
char** ppszTabFileNameOut );
1548 void GDALNullifyOpenDatasetsList();
1549 CPLMutex** GDALGetphDMMutex();
1550 CPLMutex** GDALGetphDLMutex();
1551 void GDALNullifyProxyPoolSingleton();
1553 void GDALSetResponsiblePIDForCurrentThread(
GIntBig responsiblePID);
1554 GIntBig GDALGetResponsiblePIDForCurrentThread();
1556 CPLString GDALFindAssociatedFile(
const char *pszBasename,
const char *pszExt,
1557 char **papszSiblingFiles,
int nFlags );
1559 CPLErr EXIFExtractMetadata(
char**& papszMetadata,
1560 void *fpL,
int nOffset,
1561 int bSwabflag,
int nTIFFHEADER,
1562 int& nExifOffset,
int& nInterOffset,
int& nGPSOffset);
1565 const char*
const* papszOptionOptions);
1566 int GDALValidateOptions(
const char* pszOptionList,
1567 const char*
const* papszOptionsToValidate,
1568 const char* pszErrorMessageOptionType,
1569 const char* pszErrorMessageContainerName);
1575 int nXSize,
int nYSize,
1576 int nBufXSize,
int nBufYSize);
1579 GDALDataset* GDALCreateOverviewDataset(GDALDataset* poDS,
int nOvrLevel,
1580 int bThisLevelOnly);
1582 #define DIV_ROUND_UP(a, b) ( ((a) % (b)) == 0 ? ((a) / (b)) : (((a) / (b)) + 1) )
1586 #define GDALSTAT_APPROX_NUMSAMPLES 2500
1591 void GDALSerializeGCPListToXML(
CPLXMLNode* psParentNode,
1594 const char* pszGCPProjection );
1595 void GDALDeserializeGCPListFromXML(
CPLXMLNode* psGCPList,
1598 char** ppszGCPProjection );
1601 void GDALSerializeOpenOptionsToXML(
CPLXMLNode* psParentNode,
char** papszOpenOptions);
1602 char** GDALDeserializeOpenOptionsFromXML(
CPLXMLNode* psParentNode );
1604 int GDALCanFileAcceptSidecarFile(
const char* pszFilename);
The GDALRasterAttributeTable (or RAT) class is used to encapsulate a table used to provide attribute ...
Definition: gdal_rat.h:46
GDALDatasetH GDALOpenEx(const char *pszFilename, unsigned int nOpenFlags, const char *const *papszAllowedDrivers, const char *const *papszOpenOptions, const char *const *papszSiblingFiles) CPL_WARN_UNUSED_RESULT
Open a raster or vector file as a GDALDataset.
Definition: gdaldataset.cpp:2662
GDALDataType
Definition: gdal.h:57
GDALDataType GetBufferType() const
Return buffer data type.
Definition: gdal_priv.h:1371
Identify could not determine if the file is recognized or not by the probed driver.
Definition: gdal_priv.h:1138
Document node structure.
Definition: cpl_minixml.h:66
Definitions for CPL mini XML Parser/Serializer.
int GetYOff() const
Return the y offset of the top-left corner of the block.
Definition: gdal_priv.h:694
GDALDataset * GetGDALDataset()
Return dataset.
Definition: gdal_priv.h:1339
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:352
#define CPL_OVERRIDE
To be used in public headers only.
Definition: cpl_port.h:1055
const char *const * papszAllowedDrivers
Allowed drivers (NULL for all)
Definition: gdal_priv.h:281
int * GetBandMap()
Return band map.
Definition: gdal_priv.h:1379
int DropLock(void)
Decrement the lock count.
Definition: gdal_priv.h:678
FILE VSILFILE
Opaque type for a FILE that implements the VSIVirtualHandle API.
Definition: cpl_vsi.h:154
char ** GetOpenOptions()
Return open options.
Definition: gdal_priv.h:521
void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt,...) CPL_PRINT_FUNC_FORMAT(4
Emits an error related to a raster band.
Definition: gdalrasterband.cpp:6501
GByte * pabyHeader
Buffer with first bytes of the file.
Definition: gdal_priv.h:278
int GetXOff() const
Return the x offset of the top-left corner of the block.
Definition: gdal_priv.h:690
GDALAccess eAccess
Access flag.
Definition: gdal_priv.h:263
GDALRIOResampleAlg
RasterIO() resampling method.
Definition: gdal.h:114
VSILFILE * fpL
Pointer to the file.
Definition: gdal_priv.h:273
int GetXSize() const
Return width.
Definition: gdal_priv.h:1351
GDALRWFlag
Definition: gdal.h:105
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition: gdal.h:241
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:207
char * pszFilename
Filename.
Definition: gdal_priv.h:258
Color tuple.
Definition: gdal.h:998
int nOpenFlags
Open flags.
Definition: gdal_priv.h:265
A single raster block in the block cache.
Definition: gdal_priv.h:637
virtual char ** GetMetadata(const char *pszDomain="")
Fetch metadata.
Definition: gdalmajorobject.cpp:249
virtual CPLErr BuildOverviews(const char *pszResampling, int nOverviews, int *panOverviewList, GDALProgressFunc pfnProgress, void *pProgressData)
Build raster overview(s)
Definition: gdalrasterband.cpp:2387
int AddLock(void)
Increment the lock count.
Definition: gdal_priv.h:676
Convenient string class based on std::string.
Definition: cpl_string.h:338
CPLErr RasterIO(GDALRWFlag, int, int, int, int, void *, int, int, GDALDataType, GSpacing, GSpacing, GDALRasterIOExtraArg *psExtraArg) CPL_WARN_UNUSED_RESULT
Read/write a region of image data for this band.
Definition: gdalrasterband.cpp:282
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
Tag a function to have printf() formatting.
Definition: cpl_port.h:967
unknown type, non-standard
Definition: ogr_core.h:314
int GetLineSpace() const
Return line spacing.
Definition: gdal_priv.h:1387
struct CPLVirtualMem CPLVirtualMem
Opaque type that represents a virtual memory mapping.
Definition: cpl_virtualmem.h:62
virtual CPLErr IReadBlock(int nBlockXOff, int nBlockYOff, void *pData)=0
Read a block of data.
CPLErr BuildOverviews(const char *, int, int *, int, int *, GDALProgressFunc, void *)
Build raster overview(s)
Definition: gdaldataset.cpp:1491
Various convenience functions for working with strings and string lists.
virtual CPLErr FlushCache()
Flush raster data cache.
Definition: gdalrasterband.cpp:1026
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition: gdal.h:259
int bIsDirectory
Whether the file is a directory.
Definition: gdal_priv.h:270
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition: gdalmajorobject.cpp:344
int GetYSize() const
Return the height of the block.
Definition: gdal_priv.h:702
int GetXSize() const
Return the width of the block.
Definition: gdal_priv.h:698
virtual CPLErr AdviseRead(int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, GDALDataType eBufType, char **papszOptions)
Advise driver of upcoming read requests.
Definition: gdalrasterband.cpp:3666
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:312
virtual char ** GetMetadata(const char *pszDomain="") CPL_OVERRIDE
Fetch metadata.
Public (C callable) GDAL entry points.
GDALAsyncStatusType
status of the asynchronous stream
Definition: gdal.h:86
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:118
virtual CPLErr SetMetadata(char **papszMetadata, const char *pszDomain="")
Set metadata.
Definition: gdalmajorobject.cpp:292
void * GetBuffer()
Return buffer.
Definition: gdal_priv.h:1359
GDALRasterBand * GetBand()
Accessor to source GDALRasterBand object.
Definition: gdal_priv.h:722
Class for dataset open functions.
Definition: gdal_priv.h:246
int GetYOffset() const
Return y offset.
Definition: gdal_priv.h:1347
void MarkSuppressOnClose()
Set that the dataset must be deleted on close.
Definition: gdal_priv.h:516
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:449
Identify determined the file is recognized by the probed driver.
Definition: gdal_priv.h:1142
GDALPaletteInterp
Definition: gdal.h:202
Core portability services for cross-platform OGR code.
int bStatOK
Whether stat()'ing the file was successful.
Definition: gdal_priv.h:268
int nHeaderBytes
Number of bytes in pabyHeader.
Definition: gdal_priv.h:276
virtual int CloseDependentDatasets()
Drop references to any other datasets referenced by this dataset.
Definition: gdaldataset.cpp:3413
void * GetDataRef(void)
Return the data buffer.
Definition: gdal_priv.h:710
int GetYSize() const
Return height.
Definition: gdal_priv.h:1355
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:2474
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:253
int CPLErrorNum
Error number.
Definition: cpl_error.h:95
Various convenience functions for CPL.
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:132
int GetBufferXSize() const
Return buffer width.
Definition: gdal_priv.h:1363
void * GDALDriverH
Opaque type used for the C bindings of the C++ GDALDriver class.
Definition: gdal.h:247
void GDALClose(GDALDatasetH)
Close GDAL dataset.
Definition: gdaldataset.cpp:3040
char ** papszOpenOptions
Open options.
Definition: gdal_priv.h:260
Object with metadata.
Definition: gdal_priv.h:125
int GetBufferYSize() const
Return buffer height.
Definition: gdal_priv.h:1367
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:68
int GetDirty() const
Return the dirty flag.
Definition: gdal_priv.h:706
A single raster band (or channel).
Definition: gdal_priv.h:829
GDALAccess
Definition: gdal.h:99
int GetPixelSpace() const
Return pixel spacing.
Definition: gdal_priv.h:1383
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:279
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the current band.
Definition: gdalrasterband.cpp:6265
int GetBandSpace() const
Return band spacing.
Definition: gdal_priv.h:1391
This class represents a style table.
Definition: ogr_featurestyle.h:83
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:322
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:354
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:250
int GetXOffset() const
Return x offset.
Definition: gdal_priv.h:1343
Class for managing the registration of file format drivers.
Definition: gdal_priv.h:1270
#define CPL_NULL_TERMINATED
Null terminated variadic.
Definition: cpl_port.h:957
CPLString & toupper(void)
Convert to upper case in place.
Definition: cplstring.cpp:312
GDALIdentifyEnum
Enumeration used by GDALDriver::pfnIdentify().
Definition: gdal_priv.h:1135
int OGRErr
Simple container for a bounding region.
Definition: ogr_core.h:285
GDALColorInterp
Definition: gdal.h:176
int GDALGetDataTypeSizeBytes(GDALDataType)
Get data type size in bytes.
Definition: gdal_misc.cpp:222
virtual CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain="")
Set single metadata item.
Definition: gdalmajorobject.cpp:388
GDALDataType GetDataType() const
Return the data type.
Definition: gdal_priv.h:686
Identify determined the file is not recognized by the probed driver.
Definition: gdal_priv.h:1140
int GetBandCount() const
Return band count.
Definition: gdal_priv.h:1375
Format specific driver.
Definition: gdal_priv.h:1160
int GetBlockSize() const
Return the block size in bytes.
Definition: gdal_priv.h:714
A color table / palette.
Definition: gdal_priv.h:749
virtual char ** GetMetadataDomainList()
Fetch list of metadata domains.
Definition: gdalmajorobject.cpp:161
GDALAccess GetAccess() const
Return access mode.
Definition: gdal_priv.h:510
Ground Control Point.
Definition: gdal.h:514
CPLErr
Error category.
Definition: cpl_error.h:52
GDALDriverManager * GetGDALDriverManager(void)
Fetch the global GDAL driver manager.
Definition: gdaldrivermanager.cpp:96
#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:1085
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition: cpl_port.h:999
Class used as a session object for asynchronous requests.
Definition: gdal_priv.h:1312