00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef GDAL_PRIV_H_INCLUDED
00032 #define GDAL_PRIV_H_INCLUDED
00033
00034
00035
00036
00037
00038 class GDALMajorObject;
00039 class GDALDataset;
00040 class GDALRasterBand;
00041 class GDALDriver;
00042 class GDALRasterAttributeTable;
00043 class GDALProxyDataset;
00044 class GDALProxyRasterBand;
00045 class GDALAsyncReader;
00046
00047
00048
00049
00050
00051
00052
00053 #include "gdal.h"
00054 #include "gdal_frmts.h"
00055 #include "cpl_vsi.h"
00056 #include "cpl_conv.h"
00057 #include "cpl_string.h"
00058 #include "cpl_minixml.h"
00059 #include <vector>
00060
00061 #define GMO_VALID 0x0001
00062 #define GMO_IGNORE_UNIMPLEMENTED 0x0002
00063 #define GMO_SUPPORT_MD 0x0004
00064 #define GMO_SUPPORT_MDMD 0x0008
00065 #define GMO_MD_DIRTY 0x0010
00066 #define GMO_PAM_CLASS 0x0020
00067
00068
00069
00070
00071
00072 class CPL_DLL GDALMultiDomainMetadata
00073 {
00074 private:
00075 char **papszDomainList;
00076 CPLStringList **papoMetadataLists;
00077
00078 public:
00079 GDALMultiDomainMetadata();
00080 ~GDALMultiDomainMetadata();
00081
00082 int XMLInit( CPLXMLNode *psMetadata, int bMerge );
00083 CPLXMLNode *Serialize();
00084
00085 char **GetDomainList() { return papszDomainList; }
00086
00087 char **GetMetadata( const char * pszDomain = "" );
00088 CPLErr SetMetadata( char ** papszMetadata,
00089 const char * pszDomain = "" );
00090 const char *GetMetadataItem( const char * pszName,
00091 const char * pszDomain = "" );
00092 CPLErr SetMetadataItem( const char * pszName,
00093 const char * pszValue,
00094 const char * pszDomain = "" );
00095
00096 void Clear();
00097 };
00098
00099
00100
00101
00102
00103
00104
00105
00107
00108 class CPL_DLL GDALMajorObject
00109 {
00110 protected:
00111 int nFlags;
00112 CPLString sDescription;
00113 GDALMultiDomainMetadata oMDMD;
00114
00115 public:
00116 GDALMajorObject();
00117 virtual ~GDALMajorObject();
00118
00119 int GetMOFlags();
00120 void SetMOFlags(int nFlags);
00121
00122 virtual const char *GetDescription() const;
00123 virtual void SetDescription( const char * );
00124
00125 virtual char **GetMetadata( const char * pszDomain = "" );
00126 virtual CPLErr SetMetadata( char ** papszMetadata,
00127 const char * pszDomain = "" );
00128 virtual const char *GetMetadataItem( const char * pszName,
00129 const char * pszDomain = "" );
00130 virtual CPLErr SetMetadataItem( const char * pszName,
00131 const char * pszValue,
00132 const char * pszDomain = "" );
00133 };
00134
00135
00136
00137
00138 class CPL_DLL GDALDefaultOverviews
00139 {
00140 friend class GDALDataset;
00141
00142 GDALDataset *poDS;
00143 GDALDataset *poODS;
00144
00145 CPLString osOvrFilename;
00146
00147 int bOvrIsAux;
00148
00149 int bCheckedForMask;
00150 int bOwnMaskDS;
00151 GDALDataset *poMaskDS;
00152
00153
00154
00155 GDALDataset *poBaseDS;
00156
00157
00158 bool bCheckedForOverviews;
00159 void OverviewScan();
00160 char *pszInitName;
00161 int bInitNameIsOVR;
00162 char **papszInitSiblingFiles;
00163
00164 public:
00165 GDALDefaultOverviews();
00166 ~GDALDefaultOverviews();
00167
00168 void Initialize( GDALDataset *poDS, const char *pszName = NULL,
00169 char **papszSiblingFiles = NULL,
00170 int bNameIsOVR = FALSE );
00171
00172 int IsInitialized();
00173
00174 int CloseDependentDatasets();
00175
00176
00177
00178 int GetOverviewCount(int);
00179 GDALRasterBand *GetOverview(int,int);
00180
00181 CPLErr BuildOverviews( const char * pszBasename,
00182 const char * pszResampling,
00183 int nOverviews, int * panOverviewList,
00184 int nBands, int * panBandList,
00185 GDALProgressFunc pfnProgress,
00186 void *pProgressData );
00187
00188 CPLErr BuildOverviewsSubDataset( const char * pszPhysicalFile,
00189 const char * pszResampling,
00190 int nOverviews, int * panOverviewList,
00191 int nBands, int * panBandList,
00192 GDALProgressFunc pfnProgress,
00193 void *pProgressData );
00194
00195 CPLErr CleanOverviews();
00196
00197
00198
00199 CPLErr CreateMaskBand( int nFlags, int nBand = -1 );
00200 GDALRasterBand *GetMaskBand( int nBand );
00201 int GetMaskFlags( int nBand );
00202
00203 int HaveMaskFile( char **papszSiblings = NULL,
00204 const char *pszBasename = NULL );
00205
00206 char** GetSiblingFiles() { return papszInitSiblingFiles; }
00207 };
00208
00209
00210
00211
00212
00213
00214
00215 class CPL_DLL GDALOpenInfo
00216 {
00217 public:
00218 GDALOpenInfo( const char * pszFile, GDALAccess eAccessIn,
00219 char **papszSiblingFiles = NULL );
00220 ~GDALOpenInfo( void );
00221
00222 char *pszFilename;
00223 char **papszSiblingFiles;
00224
00225 GDALAccess eAccess;
00226
00227 int bStatOK;
00228 int bIsDirectory;
00229
00230 FILE *fp;
00231
00232 int nHeaderBytes;
00233 GByte *pabyHeader;
00234
00235 };
00236
00237
00238
00239
00240
00241
00242 GDALDatasetH GDALOpenInternal( const char * pszFilename, GDALAccess eAccess,
00243 const char* const * papszAllowedDrivers);
00244 GDALDatasetH GDALOpenInternal( GDALOpenInfo& oOpenInfo,
00245 const char* const * papszAllowedDrivers);
00246
00248
00249 class CPL_DLL GDALDataset : public GDALMajorObject
00250 {
00251 friend GDALDatasetH CPL_STDCALL GDALOpen( const char *, GDALAccess);
00252 friend GDALDatasetH CPL_STDCALL GDALOpenShared( const char *, GDALAccess);
00253
00254
00255 friend GDALDatasetH GDALOpenInternal( const char *, GDALAccess, const char* const * papszAllowedDrivers);
00256 friend GDALDatasetH GDALOpenInternal( GDALOpenInfo& oOpenInfo,
00257 const char* const * papszAllowedDrivers);
00258
00259 friend class GDALDriver;
00260 friend class GDALDefaultOverviews;
00261 friend class GDALProxyDataset;
00262 friend class GDALDriverManager;
00263
00264 protected:
00265 GDALDriver *poDriver;
00266 GDALAccess eAccess;
00267
00268
00269 int nRasterXSize;
00270 int nRasterYSize;
00271 int nBands;
00272 GDALRasterBand **papoBands;
00273
00274 int bForceCachedIO;
00275
00276 int nRefCount;
00277 int bShared;
00278
00279 GDALDataset(void);
00280 void RasterInitialize( int, int );
00281 void SetBand( int, GDALRasterBand * );
00282
00283 GDALDefaultOverviews oOvManager;
00284
00285 virtual CPLErr IBuildOverviews( const char *, int, int *,
00286 int, int *, GDALProgressFunc, void * );
00287
00288 virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
00289 void *, int, int, GDALDataType,
00290 int, int *, int, int, int );
00291
00292 CPLErr BlockBasedRasterIO( GDALRWFlag, int, int, int, int,
00293 void *, int, int, GDALDataType,
00294 int, int *, int, int, int );
00295 void BlockBasedFlushCache();
00296
00297 CPLErr ValidateRasterIOOrAdviseReadParameters(
00298 const char* pszCallingFunc,
00299 int nXOff, int nYOff, int nXSize, int nYSize,
00300 int nBufXSize, int nBufYSize,
00301 int nBandCount, int *panBandMap);
00302
00303 virtual int CloseDependentDatasets();
00304
00305 friend class GDALRasterBand;
00306
00307 public:
00308 virtual ~GDALDataset();
00309
00310 int GetRasterXSize( void );
00311 int GetRasterYSize( void );
00312 int GetRasterCount( void );
00313 GDALRasterBand *GetRasterBand( int );
00314
00315 virtual void FlushCache(void);
00316
00317 virtual const char *GetProjectionRef(void);
00318 virtual CPLErr SetProjection( const char * );
00319
00320 virtual CPLErr GetGeoTransform( double * );
00321 virtual CPLErr SetGeoTransform( double * );
00322
00323 virtual CPLErr AddBand( GDALDataType eType,
00324 char **papszOptions=NULL );
00325
00326 virtual void *GetInternalHandle( const char * );
00327 virtual GDALDriver *GetDriver(void);
00328 virtual char **GetFileList(void);
00329
00330 virtual int GetGCPCount();
00331 virtual const char *GetGCPProjection();
00332 virtual const GDAL_GCP *GetGCPs();
00333 virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
00334 const char *pszGCPProjection );
00335
00336 virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
00337 int nBufXSize, int nBufYSize,
00338 GDALDataType eDT,
00339 int nBandCount, int *panBandList,
00340 char **papszOptions );
00341
00342 virtual CPLErr CreateMaskBand( int nFlags );
00343
00344 virtual GDALAsyncReader*
00345 BeginAsyncReader(int nXOff, int nYOff, int nXSize, int nYSize,
00346 void *pBuf, int nBufXSize, int nBufYSize,
00347 GDALDataType eBufType,
00348 int nBandCount, int* panBandMap,
00349 int nPixelSpace, int nLineSpace, int nBandSpace,
00350 char **papszOptions);
00351 virtual void EndAsyncReader(GDALAsyncReader *);
00352
00353 CPLErr RasterIO( GDALRWFlag, int, int, int, int,
00354 void *, int, int, GDALDataType,
00355 int, int *, int, int, int );
00356
00357 int Reference();
00358 int Dereference();
00359 GDALAccess GetAccess() { return eAccess; }
00360
00361 int GetShared();
00362 void MarkAsShared();
00363
00364 static GDALDataset **GetOpenDatasets( int *pnDatasetCount );
00365
00366 CPLErr BuildOverviews( const char *, int, int *,
00367 int, int *, GDALProgressFunc, void * );
00368
00369 void ReportError(CPLErr eErrClass, int err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5);
00370 };
00371
00372
00373
00374
00375
00377
00378 class CPL_DLL GDALRasterBlock
00379 {
00380 GDALDataType eType;
00381
00382 int bDirty;
00383 int nLockCount;
00384
00385 int nXOff;
00386 int nYOff;
00387
00388 int nXSize;
00389 int nYSize;
00390
00391 void *pData;
00392
00393 GDALRasterBand *poBand;
00394
00395 GDALRasterBlock *poNext;
00396 GDALRasterBlock *poPrevious;
00397
00398 public:
00399 GDALRasterBlock( GDALRasterBand *, int, int );
00400 virtual ~GDALRasterBlock();
00401
00402 CPLErr Internalize( void );
00403 void Touch( void );
00404 void MarkDirty( void );
00405 void MarkClean( void );
00406 void AddLock( void ) { nLockCount++; }
00407 void DropLock( void ) { nLockCount--; }
00408 void Detach();
00409
00410 CPLErr Write();
00411
00412 GDALDataType GetDataType() { return eType; }
00413 int GetXOff() { return nXOff; }
00414 int GetYOff() { return nYOff; }
00415 int GetXSize() { return nXSize; }
00416 int GetYSize() { return nYSize; }
00417 int GetDirty() { return bDirty; }
00418 int GetLockCount() { return nLockCount; }
00419
00420 void *GetDataRef( void ) { return pData; }
00421
00424 GDALRasterBand *GetBand() { return poBand; }
00425
00426 static int FlushCacheBlock();
00427 static void Verify();
00428
00429 static int SafeLockBlock( GDALRasterBlock ** );
00430 };
00431
00432
00433
00434
00435
00438 class CPL_DLL GDALColorTable
00439 {
00440 GDALPaletteInterp eInterp;
00441
00442 std::vector<GDALColorEntry> aoEntries;
00443
00444 public:
00445 GDALColorTable( GDALPaletteInterp = GPI_RGB );
00446 ~GDALColorTable();
00447
00448 GDALColorTable *Clone() const;
00449
00450 GDALPaletteInterp GetPaletteInterpretation() const;
00451
00452 int GetColorEntryCount() const;
00453 const GDALColorEntry *GetColorEntry( int ) const;
00454 int GetColorEntryAsRGB( int, GDALColorEntry * ) const;
00455 void SetColorEntry( int, const GDALColorEntry * );
00456 int CreateColorRamp( int, const GDALColorEntry * ,
00457 int, const GDALColorEntry * );
00458 };
00459
00460
00461
00462
00463
00465
00466 class CPL_DLL GDALRasterBand : public GDALMajorObject
00467 {
00468 private:
00469 CPLErr eFlushBlockErr;
00470
00471 void SetFlushBlockErr( CPLErr eErr );
00472
00473 friend class GDALRasterBlock;
00474
00475 protected:
00476 GDALDataset *poDS;
00477 int nBand;
00478
00479 int nRasterXSize;
00480 int nRasterYSize;
00481
00482 GDALDataType eDataType;
00483 GDALAccess eAccess;
00484
00485
00486 int nBlockXSize;
00487 int nBlockYSize;
00488 int nBlocksPerRow;
00489 int nBlocksPerColumn;
00490
00491 int bSubBlockingActive;
00492 int nSubBlocksPerRow;
00493 int nSubBlocksPerColumn;
00494 GDALRasterBlock **papoBlocks;
00495
00496 int nBlockReads;
00497 int bForceCachedIO;
00498
00499 GDALRasterBand *poMask;
00500 bool bOwnMask;
00501 int nMaskFlags;
00502
00503 friend class GDALDataset;
00504 friend class GDALProxyRasterBand;
00505
00506 protected:
00507 virtual CPLErr IReadBlock( int, int, void * ) = 0;
00508 virtual CPLErr IWriteBlock( int, int, void * );
00509 virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
00510 void *, int, int, GDALDataType,
00511 int, int );
00512 CPLErr OverviewRasterIO( GDALRWFlag, int, int, int, int,
00513 void *, int, int, GDALDataType,
00514 int, int );
00515
00516 int InitBlockInfo();
00517
00518 CPLErr AdoptBlock( int, int, GDALRasterBlock * );
00519 GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff, int nYBlockYOff );
00520
00521 public:
00522 GDALRasterBand();
00523
00524 virtual ~GDALRasterBand();
00525
00526 int GetXSize();
00527 int GetYSize();
00528 int GetBand();
00529 GDALDataset*GetDataset();
00530
00531 GDALDataType GetRasterDataType( void );
00532 void GetBlockSize( int *, int * );
00533 GDALAccess GetAccess();
00534
00535 CPLErr RasterIO( GDALRWFlag, int, int, int, int,
00536 void *, int, int, GDALDataType,
00537 int, int );
00538 CPLErr ReadBlock( int, int, void * );
00539
00540 CPLErr WriteBlock( int, int, void * );
00541
00542 GDALRasterBlock *GetLockedBlockRef( int nXBlockOff, int nYBlockOff,
00543 int bJustInitialize = FALSE );
00544 CPLErr FlushBlock( int = -1, int = -1, int bWriteDirtyBlock = TRUE );
00545
00546 unsigned char* GetIndexColorTranslationTo( GDALRasterBand* poReferenceBand,
00547 unsigned char* pTranslationTable = NULL,
00548 int* pApproximateMatching = NULL);
00549
00550
00551
00552 virtual CPLErr FlushCache();
00553 virtual char **GetCategoryNames();
00554 virtual double GetNoDataValue( int *pbSuccess = NULL );
00555 virtual double GetMinimum( int *pbSuccess = NULL );
00556 virtual double GetMaximum(int *pbSuccess = NULL );
00557 virtual double GetOffset( int *pbSuccess = NULL );
00558 virtual double GetScale( int *pbSuccess = NULL );
00559 virtual const char *GetUnitType();
00560 virtual GDALColorInterp GetColorInterpretation();
00561 virtual GDALColorTable *GetColorTable();
00562 virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0);
00563
00564 virtual CPLErr SetCategoryNames( char ** );
00565 virtual CPLErr SetNoDataValue( double );
00566 virtual CPLErr SetColorTable( GDALColorTable * );
00567 virtual CPLErr SetColorInterpretation( GDALColorInterp );
00568 virtual CPLErr SetOffset( double );
00569 virtual CPLErr SetScale( double );
00570 virtual CPLErr SetUnitType( const char * );
00571
00572 virtual CPLErr GetStatistics( int bApproxOK, int bForce,
00573 double *pdfMin, double *pdfMax,
00574 double *pdfMean, double *padfStdDev );
00575 virtual CPLErr ComputeStatistics( int bApproxOK,
00576 double *pdfMin, double *pdfMax,
00577 double *pdfMean, double *pdfStdDev,
00578 GDALProgressFunc, void *pProgressData );
00579 virtual CPLErr SetStatistics( double dfMin, double dfMax,
00580 double dfMean, double dfStdDev );
00581 virtual CPLErr ComputeRasterMinMax( int, double* );
00582
00583 virtual int HasArbitraryOverviews();
00584 virtual int GetOverviewCount();
00585 virtual GDALRasterBand *GetOverview(int);
00586 virtual GDALRasterBand *GetRasterSampleOverview( int );
00587 virtual CPLErr BuildOverviews( const char *, int, int *,
00588 GDALProgressFunc, void * );
00589
00590 virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
00591 int nBufXSize, int nBufYSize,
00592 GDALDataType eDT, char **papszOptions );
00593
00594 virtual CPLErr GetHistogram( double dfMin, double dfMax,
00595 int nBuckets, int * panHistogram,
00596 int bIncludeOutOfRange, int bApproxOK,
00597 GDALProgressFunc, void *pProgressData );
00598
00599 virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
00600 int *pnBuckets, int ** ppanHistogram,
00601 int bForce,
00602 GDALProgressFunc, void *pProgressData);
00603 virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
00604 int nBuckets, int *panHistogram );
00605
00606 virtual const GDALRasterAttributeTable *GetDefaultRAT();
00607 virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * );
00608
00609 virtual GDALRasterBand *GetMaskBand();
00610 virtual int GetMaskFlags();
00611 virtual CPLErr CreateMaskBand( int nFlags );
00612
00613 void ReportError(CPLErr eErrClass, int err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5);
00614 };
00615
00616
00617
00618
00619
00620 class CPL_DLL GDALAllValidMaskBand : public GDALRasterBand
00621 {
00622 protected:
00623 virtual CPLErr IReadBlock( int, int, void * );
00624
00625 public:
00626 GDALAllValidMaskBand( GDALRasterBand * );
00627 virtual ~GDALAllValidMaskBand();
00628
00629 virtual GDALRasterBand *GetMaskBand();
00630 virtual int GetMaskFlags();
00631 };
00632
00633
00634
00635
00636
00637 class CPL_DLL GDALNoDataMaskBand : public GDALRasterBand
00638 {
00639 double dfNoDataValue;
00640 GDALRasterBand *poParent;
00641
00642 protected:
00643 virtual CPLErr IReadBlock( int, int, void * );
00644 virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
00645 void *, int, int, GDALDataType,
00646 int, int );
00647
00648 public:
00649 GDALNoDataMaskBand( GDALRasterBand * );
00650 virtual ~GDALNoDataMaskBand();
00651 };
00652
00653
00654
00655
00656
00657 class CPL_DLL GDALNoDataValuesMaskBand : public GDALRasterBand
00658 {
00659 double *padfNodataValues;
00660
00661 protected:
00662 virtual CPLErr IReadBlock( int, int, void * );
00663
00664 public:
00665 GDALNoDataValuesMaskBand( GDALDataset * );
00666 virtual ~GDALNoDataValuesMaskBand();
00667 };
00668
00669
00670
00671
00672
00673
00685 class CPL_DLL GDALDriver : public GDALMajorObject
00686 {
00687 public:
00688 GDALDriver();
00689 ~GDALDriver();
00690
00691
00692
00693
00694 GDALDataset *Create( const char * pszName,
00695 int nXSize, int nYSize, int nBands,
00696 GDALDataType eType, char ** papszOptions ) CPL_WARN_UNUSED_RESULT;
00697
00698 CPLErr Delete( const char * pszName );
00699 CPLErr Rename( const char * pszNewName,
00700 const char * pszOldName );
00701 CPLErr CopyFiles( const char * pszNewName,
00702 const char * pszOldName );
00703
00704 GDALDataset *CreateCopy( const char *, GDALDataset *,
00705 int, char **,
00706 GDALProgressFunc pfnProgress,
00707 void * pProgressData ) CPL_WARN_UNUSED_RESULT;
00708
00709
00710
00711
00712
00713
00714 GDALDataset *(*pfnOpen)( GDALOpenInfo * );
00715
00716 GDALDataset *(*pfnCreate)( const char * pszName,
00717 int nXSize, int nYSize, int nBands,
00718 GDALDataType eType,
00719 char ** papszOptions );
00720
00721 CPLErr (*pfnDelete)( const char * pszName );
00722
00723 GDALDataset *(*pfnCreateCopy)( const char *, GDALDataset *,
00724 int, char **,
00725 GDALProgressFunc pfnProgress,
00726 void * pProgressData );
00727
00728 void *pDriverData;
00729
00730 void (*pfnUnloadDriver)(GDALDriver *);
00731
00732 int (*pfnIdentify)( GDALOpenInfo * );
00733
00734 CPLErr (*pfnRename)( const char * pszNewName,
00735 const char * pszOldName );
00736 CPLErr (*pfnCopyFiles)( const char * pszNewName,
00737 const char * pszOldName );
00738
00739
00740
00741
00742 GDALDataset *DefaultCreateCopy( const char *, GDALDataset *,
00743 int, char **,
00744 GDALProgressFunc pfnProgress,
00745 void * pProgressData ) CPL_WARN_UNUSED_RESULT;
00746 static CPLErr DefaultCopyMasks( GDALDataset *poSrcDS,
00747 GDALDataset *poDstDS,
00748 int bStrict );
00749 static CPLErr QuietDelete( const char * pszName );
00750
00751 CPLErr DefaultRename( const char * pszNewName,
00752 const char * pszOldName );
00753 CPLErr DefaultCopyFiles( const char * pszNewName,
00754 const char * pszOldName );
00755 };
00756
00757
00758
00759
00760
00768 class CPL_DLL GDALDriverManager : public GDALMajorObject
00769 {
00770 int nDrivers;
00771 GDALDriver **papoDrivers;
00772
00773 char *pszHome;
00774
00775 public:
00776 GDALDriverManager();
00777 ~GDALDriverManager();
00778
00779 int GetDriverCount( void );
00780 GDALDriver *GetDriver( int );
00781 GDALDriver *GetDriverByName( const char * );
00782
00783 int RegisterDriver( GDALDriver * );
00784 void MoveDriver( GDALDriver *, int );
00785 void DeregisterDriver( GDALDriver * );
00786
00787 void AutoLoadDrivers();
00788 void AutoSkipDrivers();
00789
00790 const char *GetHome();
00791 void SetHome( const char * );
00792 };
00793
00794 CPL_C_START
00795 GDALDriverManager CPL_DLL * GetGDALDriverManager( void );
00796 CPL_C_END
00797
00798
00799
00800
00801
00807 class CPL_DLL GDALAsyncReader
00808 {
00809 protected:
00810 GDALDataset* poDS;
00811 int nXOff;
00812 int nYOff;
00813 int nXSize;
00814 int nYSize;
00815 void * pBuf;
00816 int nBufXSize;
00817 int nBufYSize;
00818 GDALDataType eBufType;
00819 int nBandCount;
00820 int* panBandMap;
00821 int nPixelSpace;
00822 int nLineSpace;
00823 int nBandSpace;
00824
00825 public:
00826 GDALAsyncReader();
00827 virtual ~GDALAsyncReader();
00828
00829 GDALDataset* GetGDALDataset() {return poDS;}
00830 int GetXOffset() {return nXOff;}
00831 int GetYOffset() {return nYOff;}
00832 int GetXSize() {return nXSize;}
00833 int GetYSize() {return nYSize;}
00834 void * GetBuffer() {return pBuf;}
00835 int GetBufferXSize() {return nBufXSize;}
00836 int GetBufferYSize() {return nBufYSize;}
00837 GDALDataType GetBufferType() {return eBufType;}
00838 int GetBandCount() {return nBandCount;}
00839 int* GetBandMap() {return panBandMap;}
00840 int GetPixelSpace() {return nPixelSpace;}
00841 int GetLineSpace() {return nLineSpace;}
00842 int GetBandSpace() {return nBandSpace;}
00843
00844 virtual GDALAsyncStatusType
00845 GetNextUpdatedRegion(double dfTimeout,
00846 int* pnBufXOff, int* pnBufYOff,
00847 int* pnBufXSize, int* pnBufYSize) = 0;
00848 virtual int LockBuffer( double dfTimeout = -1.0 );
00849 virtual void UnlockBuffer();
00850 };
00851
00852
00853
00854
00855
00856
00857 CPLErr
00858 GDALRegenerateOverviewsMultiBand(int nBands, GDALRasterBand** papoSrcBands,
00859 int nOverviews,
00860 GDALRasterBand*** papapoOverviewBands,
00861 const char * pszResampling,
00862 GDALProgressFunc pfnProgress, void * pProgressData );
00863
00864 CPL_C_START
00865
00866 #ifndef WIN32CE
00867
00868 CPLErr CPL_DLL
00869 HFAAuxBuildOverviews( const char *pszOvrFilename, GDALDataset *poParentDS,
00870 GDALDataset **ppoDS,
00871 int nBands, int *panBandList,
00872 int nNewOverviews, int *panNewOverviewList,
00873 const char *pszResampling,
00874 GDALProgressFunc pfnProgress,
00875 void *pProgressData );
00876
00877 #endif
00878
00879 CPLErr CPL_DLL
00880 GTIFFBuildOverviews( const char * pszFilename,
00881 int nBands, GDALRasterBand **papoBandList,
00882 int nOverviews, int * panOverviewList,
00883 const char * pszResampling,
00884 GDALProgressFunc pfnProgress, void * pProgressData );
00885
00886 CPLErr CPL_DLL
00887 GDALDefaultBuildOverviews( GDALDataset *hSrcDS, const char * pszBasename,
00888 const char * pszResampling,
00889 int nOverviews, int * panOverviewList,
00890 int nBands, int * panBandList,
00891 GDALProgressFunc pfnProgress, void * pProgressData);
00892
00893 int CPL_DLL GDALBandGetBestOverviewLevel(GDALRasterBand* poBand,
00894 int &nXOff, int &nYOff,
00895 int &nXSize, int &nYSize,
00896 int nBufXSize, int nBufYSize);
00897
00898 int CPL_DLL GDALOvLevelAdjust( int nOvLevel, int nXSize );
00899
00900 GDALDataset CPL_DLL *
00901 GDALFindAssociatedAuxFile( const char *pszBasefile, GDALAccess eAccess,
00902 GDALDataset *poDependentDS );
00903
00904
00905
00906
00907
00908 CPLErr CPL_DLL GDALParseGMLCoverage( CPLXMLNode *psTree,
00909 int *pnXSize, int *pnYSize,
00910 double *padfGeoTransform,
00911 char **ppszProjection );
00912
00913
00914
00915
00916
00917 int CPL_DLL GDALCheckDatasetDimensions( int nXSize, int nYSize );
00918 int CPL_DLL GDALCheckBandCount( int nBands, int bIsZeroAllowed );
00919
00920
00921
00922
00923 #define ARE_REAL_EQUAL(dfVal1, dfVal2) \
00924 (dfVal1 == dfVal2 || fabs(dfVal1 - dfVal2) < 1e-10 || (dfVal2 != 0 && fabs(1 - dfVal1 / dfVal2) < 1e-10 ))
00925
00926
00927
00928
00929 int CPL_DLL GDALReadWorldFile2( const char *pszBaseFilename, const char *pszExtension,
00930 double *padfGeoTransform, char** papszSiblingFiles,
00931 char** ppszWorldFileNameOut);
00932 int GDALReadTabFile2( const char * pszBaseFilename,
00933 double *padfGeoTransform, char **ppszWKT,
00934 int *pnGCPCount, GDAL_GCP **ppasGCPs,
00935 char** papszSiblingFiles, char** ppszTabFileNameOut );
00936
00937 CPL_C_END
00938
00939 void GDALNullifyOpenDatasetsList();
00940 void** GDALGetphDMMutex();
00941 void** GDALGetphDLMutex();
00942 void GDALNullifyProxyPoolSingleton();
00943 GDALDriver* GDALGetAPIPROXYDriver();
00944 void GDALSetResponsiblePIDForCurrentThread(GIntBig responsiblePID);
00945 GIntBig GDALGetResponsiblePIDForCurrentThread();
00946
00947 CPLString GDALFindAssociatedFile( const char *pszBasename, const char *pszExt,
00948 char **papszSiblingFiles, int nFlags );
00949
00950 CPLErr EXIFExtractMetadata(char**& papszMetadata,
00951 void *fpL, int nOffset,
00952 int bSwabflag, int nTIFFHEADER,
00953 int& nExifOffset, int& nInterOffset, int& nGPSOffset);
00954
00955 #define DIV_ROUND_UP(a, b) ( ((a) % (b)) == 0 ? ((a) / (b)) : (((a) / (b)) + 1) )
00956
00957
00958
00959 #define GDALSTAT_APPROX_NUMSAMPLES 2500
00960
00961 #endif