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;
661 void Detach_unlocked(
void );
662 void Touch_unlocked(
void );
664 void RecycleFor(
int nXOffIn,
int nYOffIn );
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();
728 static void EnterDisableDirtyBlockFlush();
729 static void LeaveDisableDirtyBlockFlush();
734 static void DumpAll();
739 static void DestroyRBMutex();
756 std::vector<GDALColorEntry> aoEntries;
767 int GetColorEntryCount()
const;
785 class CPL_DLL GDALAbstractBandBlockCache
793 CPLMutex *hCondMutex;
794 volatile int nKeepAliveCounter;
799 void FreeDanglingBlocks();
800 void UnreferenceBlockBase();
801 void WaitKeepAliveCounter();
805 virtual ~GDALAbstractBandBlockCache();
810 virtual bool Init() = 0;
811 virtual bool IsInitOK() = 0;
812 virtual CPLErr FlushCache() = 0;
815 int nYBlockYOff ) = 0;
817 virtual CPLErr FlushBlock(
int nXBlockOff,
int nYBlockOff,
818 int bWriteDirtyBlock ) = 0;
821 GDALAbstractBandBlockCache* GDALArrayBandBlockCacheCreate(
GDALRasterBand* poBand);
822 GDALAbstractBandBlockCache* GDALHashSetBandBlockCacheCreate(
GDALRasterBand* poBand);
835 friend class GDALArrayBandBlockCache;
836 friend class GDALHashSetBandBlockCache;
840 GDALAbstractBandBlockCache* poBandBlockCache;
842 void SetFlushBlockErr(
CPLErr eErr );
845 void Init(
int bForceCachedIO);
862 int nBlocksPerColumn;
871 void InvalidateMaskBand();
874 friend class GDALProxyRasterBand;
875 friend class GDALDefaultOverviews;
882 void LeaveReadWrite();
887 virtual CPLErr IReadBlock(
int nBlockXOff,
int nBlockYOff,
void * pData ) = 0;
888 virtual CPLErr IWriteBlock(
int nBlockXOff,
int nBlockYOff,
void * pData );
890 #ifdef DETECT_OLD_IRASTERIO 891 virtual signature_changed IRasterIO(
GDALRWFlag,
int,
int,
int,
int,
900 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
901 int nXSize,
int nYSize,
910 int nXOff,
int nYOff,
int nXSize,
int nYSize,
911 void * pData,
int nBufXSize,
int nBufYSize,
922 GDALRasterBlock *TryGetLockedBlockRef(
int nXBlockOff,
int nYBlockYOff );
936 void GetBlockSize(
int *,
int * );
937 CPLErr GetActualBlockSize (
int,
int,
int *,
int * );
944 OPTIONAL_OUTSIDE_GDAL(NULL)
953 CPLErr FlushBlock(
int,
int,
int bWriteDirtyBlock = TRUE );
955 unsigned char* GetIndexColorTranslationTo(
GDALRasterBand* poReferenceBand,
956 unsigned char* pTranslationTable = NULL,
957 int* pApproximateMatching = NULL);
961 virtual CPLErr FlushCache();
962 virtual char **GetCategoryNames();
963 virtual double GetNoDataValue(
int *pbSuccess = NULL );
964 virtual double GetMinimum(
int *pbSuccess = NULL );
965 virtual double GetMaximum(
int *pbSuccess = NULL );
966 virtual double GetOffset(
int *pbSuccess = NULL );
967 virtual double GetScale(
int *pbSuccess = NULL );
968 virtual const char *GetUnitType();
971 virtual CPLErr Fill(
double dfRealValue,
double dfImaginaryValue = 0);
973 virtual CPLErr SetCategoryNames(
char ** papszNames );
974 virtual CPLErr SetNoDataValue(
double dfNoData );
975 virtual CPLErr DeleteNoDataValue();
978 virtual CPLErr SetOffset(
double dfNewOffset );
979 virtual CPLErr SetScale(
double dfNewScale );
980 virtual CPLErr SetUnitType(
const char * pszNewValue );
982 virtual CPLErr GetStatistics(
int bApproxOK,
int bForce,
983 double *pdfMin,
double *pdfMax,
984 double *pdfMean,
double *padfStdDev );
985 virtual CPLErr ComputeStatistics(
int bApproxOK,
986 double *pdfMin,
double *pdfMax,
987 double *pdfMean,
double *pdfStdDev,
988 GDALProgressFunc,
void *pProgressData );
989 virtual CPLErr SetStatistics(
double dfMin,
double dfMax,
990 double dfMean,
double dfStdDev );
991 virtual CPLErr ComputeRasterMinMax(
int,
double* );
1001 const char * pszValue,
1005 virtual int HasArbitraryOverviews();
1006 virtual int GetOverviewCount();
1009 virtual CPLErr BuildOverviews(
const char * pszResampling,
1011 int * panOverviewList,
1012 GDALProgressFunc pfnProgress,
1013 void * pProgressData );
1015 virtual CPLErr AdviseRead(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
1016 int nBufXSize,
int nBufYSize,
1019 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
1020 int nBuckets,
GUIntBig * panHistogram,
1021 int bIncludeOutOfRange,
int bApproxOK,
1022 GDALProgressFunc,
void *pProgressData );
1024 virtual CPLErr GetDefaultHistogram(
double *pdfMin,
double *pdfMax,
1025 int *pnBuckets,
GUIntBig ** ppanHistogram,
1027 GDALProgressFunc,
void *pProgressData);
1028 virtual CPLErr SetDefaultHistogram(
double dfMin,
double dfMax,
1029 int nBuckets,
GUIntBig *panHistogram );
1035 virtual int GetMaskFlags();
1036 virtual CPLErr CreateMaskBand(
int nFlagsIn );
1043 int GetDataCoverageStatus(
int nXOff,
int nYOff,
1044 int nXSize,
int nYSize,
1045 int nMaskFlagStop = 0,
1046 double* pdfDataPct = NULL );
1066 virtual ~GDALAllValidMaskBand();
1078 double dfNoDataValue;
1089 virtual ~GDALNoDataMaskBand();
1098 double *padfNodataValues;
1104 explicit GDALNoDataValuesMaskBand(
GDALDataset * );
1105 virtual ~GDALNoDataValuesMaskBand();
1125 virtual ~GDALRescaledAlphaBand();
1170 const char * pszValue,
1177 int nXSize,
int nYSize,
int nBands,
1180 CPLErr Delete(
const char * pszName );
1181 CPLErr Rename(
const char * pszNewName,
1182 const char * pszOldName );
1183 CPLErr CopyFiles(
const char * pszNewName,
1184 const char * pszOldName );
1188 GDALProgressFunc pfnProgress,
1200 int nXSize,
int nYSize,
int nBands,
1202 char ** papszOptions );
1204 CPLErr (*pfnDelete)(
const char * pszName );
1208 GDALProgressFunc pfnProgress,
1209 void * pProgressData );
1224 CPLErr (*pfnRename)(
const char * pszNewName,
1225 const char * pszOldName );
1226 CPLErr (*pfnCopyFiles)(
const char * pszNewName,
1227 const char * pszOldName );
1232 const char * pszName,
1233 char ** papszOptions );
1235 const char * pszName );
1244 GDALProgressFunc pfnProgress,
1250 static CPLErr QuietDelete(
const char * pszName );
1253 static CPLErr DefaultRename(
const char * pszNewName,
1254 const char * pszOldName );
1255 static CPLErr DefaultCopyFiles(
const char * pszNewName,
1256 const char * pszOldName );
1277 std::map<CPLString, GDALDriver*> oMapNameToDrivers;
1279 GDALDriver *GetDriver_unlocked(
int iDriver )
1280 {
return (iDriver >= 0 && iDriver < nDrivers) ?
1281 papoDrivers[iDriver] : NULL; }
1283 GDALDriver *GetDriverByName_unlocked(
const char * pszName )
1290 int GetDriverCount(
void )
const;
1298 static void AutoLoadDrivers();
1299 void AutoSkipDrivers();
1397 GetNextUpdatedRegion(
double dfTimeout,
1398 int* pnBufXOff,
int* pnBufYOff,
1399 int* pnBufXSize,
int* pnBufYSize) = 0;
1400 virtual int LockBuffer(
double dfTimeout = -1.0 );
1401 virtual void UnlockBuffer();
1411 GDALRegenerateOverviewsMultiBand(
int nBands,
GDALRasterBand** papoSrcBands,
1414 const char * pszResampling,
1415 GDALProgressFunc pfnProgress,
void * pProgressData );
1417 typedef CPLErr (*GDALResampleFunction)
1418 (
double dfXRatioDstToSrc,
1419 double dfYRatioDstToSrc,
1424 GByte * pabyChunkNodataMask,
1425 int nChunkXOff,
int nChunkXSize,
1426 int nChunkYOff,
int nChunkYSize,
1427 int nDstXOff,
int nDstXOff2,
1428 int nDstYOff,
int nDstYOff2,
1430 const char * pszResampling,
1431 int bHasNoData,
float fNoDataValue,
1434 bool bPropagateNoData );
1436 GDALResampleFunction GDALGetResampleFunction(
const char* pszResampling,
1439 #ifdef GDAL_ENABLE_RESAMPLING_MULTIBAND 1440 typedef CPLErr (*GDALResampleFunctionMultiBands)
1441 (
double dfXRatioDstToSrc,
1442 double dfYRatioDstToSrc,
1446 void * pChunk,
int nBands,
1447 GByte * pabyChunkNodataMask,
1448 int nChunkXOff,
int nChunkXSize,
1449 int nChunkYOff,
int nChunkYSize,
1450 int nDstXOff,
int nDstXOff2,
1451 int nDstYOff,
int nDstYOff2,
1453 const char * pszResampling,
1454 int bHasNoData,
float fNoDataValue,
1458 GDALResampleFunctionMultiBands GDALGetResampleFunctionMultiBands(
const char* pszResampling,
1462 GDALDataType GDALGetOvrWorkDataType(
const char* pszResampling,
1468 HFAAuxBuildOverviews(
const char *pszOvrFilename,
GDALDataset *poParentDS,
1470 int nBands,
int *panBandList,
1471 int nNewOverviews,
int *panNewOverviewList,
1472 const char *pszResampling,
1473 GDALProgressFunc pfnProgress,
1474 void *pProgressData );
1477 GTIFFBuildOverviews(
const char * pszFilename,
1479 int nOverviews,
int * panOverviewList,
1480 const char * pszResampling,
1481 GDALProgressFunc pfnProgress,
void * pProgressData );
1484 GDALDefaultBuildOverviews(
GDALDataset *hSrcDS,
const char * pszBasename,
1485 const char * pszResampling,
1486 int nOverviews,
int * panOverviewList,
1487 int nBands,
int * panBandList,
1488 GDALProgressFunc pfnProgress,
void * pProgressData);
1491 int &nXOff,
int &nYOff,
1492 int &nXSize,
int &nYSize,
1493 int nBufXSize,
int nBufYSize) CPL_WARN_DEPRECATED(
"Use GDALBandGetBestOverviewLevel2 instead");
1494 int CPL_DLL GDALBandGetBestOverviewLevel2(
GDALRasterBand* poBand,
1495 int &nXOff,
int &nYOff,
1496 int &nXSize,
int &nYSize,
1497 int nBufXSize,
int nBufYSize,
1500 int CPL_DLL GDALOvLevelAdjust(
int nOvLevel,
int nXSize ) CPL_WARN_DEPRECATED(
"Use GDALOvLevelAdjust2 instead");
1501 int CPL_DLL GDALOvLevelAdjust2(
int nOvLevel,
int nXSize,
int nYSize );
1502 int CPL_DLL GDALComputeOvFactor(
int nOvrXSize,
int nRasterXSize,
1503 int nOvrYSize,
int nRasterYSize );
1506 GDALFindAssociatedAuxFile(
const char *pszBasefile,
GDALAccess eAccess,
1514 int *pnXSize,
int *pnYSize,
1515 double *padfGeoTransform,
1516 char **ppszProjection );
1522 int CPL_DLL GDALCheckDatasetDimensions(
int nXSize,
int nYSize );
1523 int CPL_DLL GDALCheckBandCount(
int nBands,
int bIsZeroAllowed );
1527 #define ARE_REAL_EQUAL(dfVal1, dfVal2) \ 1529 (((float)dfVal2 == (float)1.17549435e-38) ? ((float)dfVal1 == (float)dfVal2) : \ 1531 (dfVal2 == 2.2250738585072014e-308) ? (dfVal1 == dfVal2) : \ 1533 (dfVal1 == dfVal2 || fabs(dfVal1 - dfVal2) < 1e-10 || (dfVal2 != 0 && fabs(1 - dfVal1 / dfVal2) < 1e-10 ))) 1538 int CPL_DLL GDALReadWorldFile2(
const char *pszBaseFilename,
const char *pszExtension,
1539 double *padfGeoTransform,
char** papszSiblingFiles,
1540 char** ppszWorldFileNameOut);
1541 int GDALReadTabFile2(
const char * pszBaseFilename,
1542 double *padfGeoTransform,
char **ppszWKT,
1543 int *pnGCPCount,
GDAL_GCP **ppasGCPs,
1544 char** papszSiblingFiles,
char** ppszTabFileNameOut );
1551 void GDALNullifyOpenDatasetsList();
1552 CPLMutex** GDALGetphDMMutex();
1553 CPLMutex** GDALGetphDLMutex();
1554 void GDALNullifyProxyPoolSingleton();
1556 void GDALSetResponsiblePIDForCurrentThread(
GIntBig responsiblePID);
1557 GIntBig GDALGetResponsiblePIDForCurrentThread();
1559 CPLString GDALFindAssociatedFile(
const char *pszBasename,
const char *pszExt,
1560 char **papszSiblingFiles,
int nFlags );
1562 CPLErr EXIFExtractMetadata(
char**& papszMetadata,
1563 void *fpL,
int nOffset,
1564 int bSwabflag,
int nTIFFHEADER,
1565 int& nExifOffset,
int& nInterOffset,
int& nGPSOffset);
1568 const char*
const* papszOptionOptions);
1569 int GDALValidateOptions(
const char* pszOptionList,
1570 const char*
const* papszOptionsToValidate,
1571 const char* pszErrorMessageOptionType,
1572 const char* pszErrorMessageContainerName);
1578 int nXSize,
int nYSize,
1579 int nBufXSize,
int nBufYSize);
1583 int bThisLevelOnly);
1585 #define DIV_ROUND_UP(a, b) ( ((a) % (b)) == 0 ? ((a) / (b)) : (((a) / (b)) + 1) ) 1589 #define GDALSTAT_APPROX_NUMSAMPLES 2500 1594 void GDALSerializeGCPListToXML(
CPLXMLNode* psParentNode,
1597 const char* pszGCPProjection );
1598 void GDALDeserializeGCPListFromXML(
CPLXMLNode* psGCPList,
1601 char** ppszGCPProjection );
1604 void GDALSerializeOpenOptionsToXML(
CPLXMLNode* psParentNode,
char** papszOpenOptions);
1605 char** GDALDeserializeOpenOptionsFromXML(
CPLXMLNode* psParentNode );
1607 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
int GetBlockSize() const
Return the block size in bytes.
Definition: gdal_priv.h:714
int GetYSize() const
Return height.
Definition: gdal_priv.h:1358
GDALDataType
Definition: gdal.h:57
Identify could not determine if the file is recognized or not by the probed driver.
Definition: gdal_priv.h:1141
Document node structure.
Definition: cpl_minixml.h:66
virtual GDALRasterBand * GetMaskBand()
Return the mask band associated with the band.
Definition: gdalrasterband.cpp:5937
Definitions for CPL mini XML Parser/Serializer.
GDALDataset * GetGDALDataset()
Return dataset.
Definition: gdal_priv.h:1342
int GetBandCount() const
Return band count.
Definition: gdal_priv.h:1378
#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:1049
const char *const * papszAllowedDrivers
Allowed drivers (NULL for all)
Definition: gdal_priv.h:281
int GetXOffset() const
Return x offset.
Definition: gdal_priv.h:1346
virtual CPLErr IRasterIO(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: rasterio.cpp:68
int * GetBandMap()
Return band map.
Definition: gdal_priv.h:1382
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 GetLineSpace() const
Return line spacing.
Definition: gdal_priv.h:1390
GDALAccess eAccess
Access flag.
Definition: gdal_priv.h:263
GDALDataType GetDataType() const
Return the data type.
Definition: gdal_priv.h:686
GDALRIOResampleAlg
RasterIO() resampling method.
Definition: gdal.h:114
VSILFILE * fpL
Pointer to the file.
Definition: gdal_priv.h:273
int GetBufferYSize() const
Return buffer height.
Definition: gdal_priv.h:1370
int GetBandSpace() const
Return band spacing.
Definition: gdal_priv.h:1394
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:999
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
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
int GetDirty() const
Return the dirty flag.
Definition: gdal_priv.h:706
int GetXOff() const
Return the x offset of the top-left corner of the block.
Definition: gdal_priv.h:690
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition: gdalmajorobject.cpp:344
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
int GetPixelSpace() const
Return pixel spacing.
Definition: gdal_priv.h:1386
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:1362
GDALRasterBand * GetBand()
Accessor to source GDALRasterBand object.
Definition: gdal_priv.h:722
Class for dataset open functions.
Definition: gdal_priv.h:246
GDALAccess GetAccess() const
Return access mode.
Definition: gdal_priv.h:510
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:1145
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
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 GetXSize() const
Return width.
Definition: gdal_priv.h:1354
void * GDALDriverH
Opaque type used for the C bindings of the C++ GDALDriver class.
Definition: gdal.h:247
int GetXSize() const
Return the width of the block.
Definition: gdal_priv.h:698
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 GetYSize() const
Return the height of the block.
Definition: gdal_priv.h:702
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:68
int GetYOffset() const
Return y offset.
Definition: gdal_priv.h:1350
A single raster band (or channel).
Definition: gdal_priv.h:832
GDALAccess
Definition: gdal.h:99
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
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
GDALDataType GetBufferType() const
Return buffer data type.
Definition: gdal_priv.h:1374
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:250
Class for managing the registration of file format drivers.
Definition: gdal_priv.h:1273
#define CPL_NULL_TERMINATED
Null terminated variadic.
Definition: cpl_port.h:957
int GetYOff() const
Return the y offset of the top-left corner of the block.
Definition: gdal_priv.h:694
CPLString & toupper(void)
Convert to upper case in place.
Definition: cplstring.cpp:316
GDALIdentifyEnum
Enumeration used by GDALDriver::pfnIdentify().
Definition: gdal_priv.h:1138
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
Identify determined the file is not recognized by the probed driver.
Definition: gdal_priv.h:1143
Format specific driver.
Definition: gdal_priv.h:1163
A color table / palette.
Definition: gdal_priv.h:752
virtual char ** GetMetadataDomainList()
Fetch list of metadata domains.
Definition: gdalmajorobject.cpp:161
Ground Control Point.
Definition: gdal.h:515
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:1073
int GetBufferXSize() const
Return buffer width.
Definition: gdal_priv.h:1366
#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:1315