- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

# gdal_priv.h

    00001 /******************************************************************************
    00002  * $Id: gdal_priv.h 18281 2009-12-14 17:57:05Z warmerdam $
    00003  *
    00004  * Name:     gdal_priv.h
    00005  * Project:  GDAL Core
    00006  * Purpose:  GDAL Core C++/Private declarations.
    00007  * Author:   Frank Warmerdam, warmerdam@pobox.com
    00008  *
    00009  ******************************************************************************
    00010  * Copyright (c) 1998, Frank Warmerdam
    00011  *
    00012  * Permission is hereby granted, free of charge, to any person obtaining a
    00013  * copy of this software and associated documentation files (the "Software"),
    00014  * to deal in the Software without restriction, including without limitation
    00015  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
    00016  * and/or sell copies of the Software, and to permit persons to whom the
    00017  * Software is furnished to do so, subject to the following conditions:
    00018  *
    00019  * The above copyright notice and this permission notice shall be included
    00020  * in all copies or substantial portions of the Software.
    00021  *
    00022  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    00023  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00024  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    00025  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00026  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    00027  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    00028  * DEALINGS IN THE SOFTWARE.
    00029  ****************************************************************************/
    00030
    00031 #ifndef GDAL_PRIV_H_INCLUDED
    00032 #define GDAL_PRIV_H_INCLUDED
    00033
    00034 /* -------------------------------------------------------------------- */
    00035 /*      Predeclare various classes before pulling in gdal.h, the        */
    00036 /*      public declarations.                                            */
    00037 /* -------------------------------------------------------------------- */
    00038 class GDALMajorObject;
    00039 class GDALDataset;
    00040 class GDALRasterBand;
    00041 class GDALDriver;
    00042 class GDALRasterAttributeTable;
    00043 class GDALProxyDataset;
    00044 class GDALProxyRasterBand;
    00045
    00046 /* -------------------------------------------------------------------- */
    00047 /*      Pull in the public declarations.  This gets the C apis, and     */
    00048 /*      also various constants.  However, we will still get to          */
    00049 /*      provide the real class definitions for the GDAL classes.        */
    00050 /* -------------------------------------------------------------------- */
    00051
    00052 #include "gdal.h"
    00053 #include "gdal_frmts.h"
    00054 #include "cpl_vsi.h"
    00055 #include "cpl_conv.h"
    00056 #include "cpl_string.h"
    00057 #include "cpl_minixml.h"
    00058 #include <vector>
    00059
    00060 #define GMO_VALID                0x0001
    00061 #define GMO_IGNORE_UNIMPLEMENTED 0x0002
    00062 #define GMO_SUPPORT_MD           0x0004
    00063 #define GMO_SUPPORT_MDMD         0x0008
    00064 #define GMO_MD_DIRTY             0x0010
    00065 #define GMO_PAM_CLASS            0x0020
    00066
    00067 /************************************************************************/
    00068 /*                       GDALMultiDomainMetadata                        */
    00069 /************************************************************************/
    00070
    00071 class CPL_DLL GDALMultiDomainMetadata
    00072 {
    00073 private:
    00074     char **papszDomainList;
    00075     char ***papapszMetadataLists;
    00076
    00077 public:
    00078     GDALMultiDomainMetadata();
    00079     ~GDALMultiDomainMetadata();
    00080
    00081     int         XMLInit( CPLXMLNode *psMetadata, int bMerge );
    00082     CPLXMLNode  *Serialize();
    00083
    00084     char      **GetDomainList() { return papszDomainList; }
    00085
    00086     char      **GetMetadata( const char * pszDomain = "" );
    00087     CPLErr      SetMetadata( char ** papszMetadata,
    00088                              const char * pszDomain = "" );
    00089     const char *GetMetadataItem( const char * pszName,
    00090                                  const char * pszDomain = "" );
    00091     CPLErr      SetMetadataItem( const char * pszName,
    00092                                  const char * pszValue,
    00093                                  const char * pszDomain = "" );
    00094
    00095     void        Clear();
    00096 };
    00097
    00098 /* ******************************************************************** */
    00099 /*                           GDALMajorObject                            */
    00100 /*                                                                      */
    00101 /*      Base class providing metadata, description and other            */
    00102 /*      services shared by major objects.                               */
    00103 /* ******************************************************************** */
    00104
    00106
    00107 class CPL_DLL GDALMajorObject
    00108 {
    00109   protected:
    00110     int                 nFlags; // GMO_* flags.
    00111     CPLString           sDescription;
    00112     GDALMultiDomainMetadata oMDMD;
    00113
    00114   public:
    00115                         GDALMajorObject();
    00116     virtual            ~GDALMajorObject();
    00117
    00118     int                 GetMOFlags();
    00119     void                SetMOFlags(int nFlags);
    00120
    00121     virtual const char *GetDescription() const;
    00122     virtual void        SetDescription( const char * );
    00123
    00124     virtual char      **GetMetadata( const char * pszDomain = "" );
    00125     virtual CPLErr      SetMetadata( char ** papszMetadata,
    00126                                      const char * pszDomain = "" );
    00127     virtual const char *GetMetadataItem( const char * pszName,
    00128                                          const char * pszDomain = "" );
    00129     virtual CPLErr      SetMetadataItem( const char * pszName,
    00130                                          const char * pszValue,
    00131                                          const char * pszDomain = "" );
    00132 };
    00133
    00134 /* ******************************************************************** */
    00135 /*                         GDALDefaultOverviews                         */
    00136 /* ******************************************************************** */
    00137 class CPL_DLL GDALDefaultOverviews
    00138 {
    00139     friend class GDALDataset;
    00140
    00141     GDALDataset *poDS;
    00142     GDALDataset *poODS;
    00143
    00144     CPLString   osOvrFilename;
    00145
    00146     int         bOvrIsAux;
    00147
    00148     int         bCheckedForMask;
    00149     int         bOwnMaskDS;
    00150     GDALDataset *poMaskDS;
    00151
    00152     // for "overview datasets" we record base level info so we can
    00153     // find our way back to get overview masks.
    00154     GDALDataset *poBaseDS;
    00155
    00156     // Stuff for deferred initialize/overviewscans...
    00157     bool        bCheckedForOverviews;
    00158     void        OverviewScan();
    00159     char       *pszInitName;
    00160     int         bInitNameIsOVR;
    00161     char      **papszInitSiblingFiles;
    00162
    00163   public:
    00164                GDALDefaultOverviews();
    00165                ~GDALDefaultOverviews();
    00166
    00167     void       Initialize( GDALDataset *poDS, const char *pszName = NULL,
    00168                            char **papszSiblingFiles = NULL,
    00169                            int bNameIsOVR = FALSE );
    00170
    00171     int        IsInitialized();
    00172
    00173     // Overview Related
    00174
    00175     int        GetOverviewCount(int);
    00176     GDALRasterBand *GetOverview(int,int);
    00177
    00178     CPLErr     BuildOverviews( const char * pszBasename,
    00179                                const char * pszResampling,
    00180                                int nOverviews, int * panOverviewList,
    00181                                int nBands, int * panBandList,
    00182                                GDALProgressFunc pfnProgress,
    00183                                void *pProgressData );
    00184
    00185     CPLErr     BuildOverviewsSubDataset( const char * pszPhysicalFile,
    00186                                          const char * pszResampling,
    00187                                          int nOverviews, int * panOverviewList,
    00188                                          int nBands, int * panBandList,
    00189                                          GDALProgressFunc pfnProgress,
    00190                                          void *pProgressData );
    00191
    00192     CPLErr     CleanOverviews();
    00193
    00194     // Mask Related
    00195
    00196     CPLErr     CreateMaskBand( int nFlags, int nBand = -1 );
    00197     GDALRasterBand *GetMaskBand( int nBand );
    00198     int        GetMaskFlags( int nBand );
    00199
    00200     int        HaveMaskFile( char **papszSiblings = NULL,
    00201                              const char *pszBasename = NULL );
    00202
    00203 };
    00204
    00205 /* ******************************************************************** */
    00206 /*                             GDALDataset                              */
    00207 /* ******************************************************************** */
    00208
    00210
    00211 class CPL_DLL GDALDataset : public GDALMajorObject
    00212 {
    00213     friend GDALDatasetH CPL_STDCALL GDALOpen( const char *, GDALAccess);
    00214     friend GDALDatasetH CPL_STDCALL GDALOpenShared( const char *, GDALAccess);
    00215     friend class GDALDriver;
    00216     friend class GDALDefaultOverviews;
    00217     friend class GDALProxyDataset;
    00218
    00219   protected:
    00220     GDALDriver  *poDriver;
    00221     GDALAccess  eAccess;
    00222
    00223     // Stored raster information.
    00224     int         nRasterXSize;
    00225     int         nRasterYSize;
    00226     int         nBands;
    00227     GDALRasterBand **papoBands;
    00228
    00229     int         bForceCachedIO;
    00230
    00231     int         nRefCount;
    00232     int         bShared;
    00233
    00234                 GDALDataset(void);
    00235     void        RasterInitialize( int, int );
    00236     void        SetBand( int, GDALRasterBand * );
    00237
    00238     GDALDefaultOverviews oOvManager;
    00239
    00240     virtual CPLErr IBuildOverviews( const char *, int, int *,
    00241                                     int, int *, GDALProgressFunc, void * );
    00242
    00243     virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
    00244                               void *, int, int, GDALDataType,
    00245                               int, int *, int, int, int );
    00246
    00247     CPLErr BlockBasedRasterIO( GDALRWFlag, int, int, int, int,
    00248                                void *, int, int, GDALDataType,
    00249                                int, int *, int, int, int );
    00250     void   BlockBasedFlushCache();
    00251
    00252     friend class GDALRasterBand;
    00253
    00254   public:
    00255     virtual     ~GDALDataset();
    00256
    00257     int         GetRasterXSize( void );
    00258     int         GetRasterYSize( void );
    00259     int         GetRasterCount( void );
    00260     GDALRasterBand *GetRasterBand( int );
    00261
    00262     virtual void FlushCache(void);
    00263
    00264     virtual const char *GetProjectionRef(void);
    00265     virtual CPLErr SetProjection( const char * );
    00266
    00267     virtual CPLErr GetGeoTransform( double * );
    00268     virtual CPLErr SetGeoTransform( double * );
    00269
    00270     virtual CPLErr        AddBand( GDALDataType eType,
    00271                                    char **papszOptions=NULL );
    00272
    00273     virtual void *GetInternalHandle( const char * );
    00274     virtual GDALDriver *GetDriver(void);
    00275     virtual char      **GetFileList(void);
    00276
    00277     virtual int    GetGCPCount();
    00278     virtual const char *GetGCPProjection();
    00279     virtual const GDAL_GCP *GetGCPs();
    00280     virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
    00281                             const char *pszGCPProjection );
    00282
    00283     virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
    00284                                int nBufXSize, int nBufYSize,
    00285                                GDALDataType eDT,
    00286                                int nBandCount, int *panBandList,
    00287                                char **papszOptions );
    00288
    00289     virtual CPLErr          CreateMaskBand( int nFlags );
    00290
    00291     CPLErr      RasterIO( GDALRWFlag, int, int, int, int,
    00292                           void *, int, int, GDALDataType,
    00293                           int, int *, int, int, int );
    00294
    00295     int           Reference();
    00296     int           Dereference();
    00297     GDALAccess    GetAccess() { return eAccess; }
    00298
    00299     int           GetShared();
    00300     void          MarkAsShared();
    00301
    00302     static GDALDataset **GetOpenDatasets( int *pnDatasetCount );
    00303
    00304     CPLErr BuildOverviews( const char *, int, int *,
    00305                            int, int *, GDALProgressFunc, void * );
    00306 };
    00307
    00308 /* ******************************************************************** */
    00309 /*                           GDALRasterBlock                            */
    00310 /* ******************************************************************** */
    00311
    00313
    00314 class CPL_DLL GDALRasterBlock
    00315 {
    00316     GDALDataType        eType;
    00317
    00318     int                 bDirty;
    00319     int                 nLockCount;
    00320
    00321     int                 nXOff;
    00322     int                 nYOff;
    00323
    00324     int                 nXSize;
    00325     int                 nYSize;
    00326
    00327     void                *pData;
    00328
    00329     GDALRasterBand      *poBand;
    00330
    00331     GDALRasterBlock     *poNext;
    00332     GDALRasterBlock     *poPrevious;
    00333
    00334   public:
    00335                 GDALRasterBlock( GDALRasterBand *, int, int );
    00336     virtual     ~GDALRasterBlock();
    00337
    00338     CPLErr      Internalize( void );
    00339     void        Touch( void );
    00340     void        MarkDirty( void );
    00341     void        MarkClean( void );
    00342     void        AddLock( void ) { nLockCount++; }
    00343     void        DropLock( void ) { nLockCount--; }
    00344     void        Detach();
    00345
    00346     CPLErr      Write();
    00347
    00348     GDALDataType GetDataType() { return eType; }
    00349     int         GetXOff() { return nXOff; }
    00350     int         GetYOff() { return nYOff; }
    00351     int         GetXSize() { return nXSize; }
    00352     int         GetYSize() { return nYSize; }
    00353     int         GetDirty() { return bDirty; }
    00354     int         GetLockCount() { return nLockCount; }
    00355
    00356     void        *GetDataRef( void ) { return pData; }
    00357
    00358     GDALRasterBand *GetBand() { return poBand; }
    00359
    00360     static int  FlushCacheBlock();
    00361     static void Verify();
    00362
    00363     static int  SafeLockBlock( GDALRasterBlock ** );
    00364 };
    00365
    00366 /* ******************************************************************** */
    00367 /*                             GDALColorTable                           */
    00368 /* ******************************************************************** */
    00369
    00372 class CPL_DLL GDALColorTable
    00373 {
    00374     GDALPaletteInterp eInterp;
    00375
    00376     std::vector<GDALColorEntry> aoEntries;
    00377
    00378 public:
    00379                 GDALColorTable( GDALPaletteInterp = GPI_RGB );
    00380                 ~GDALColorTable();
    00381
    00382     GDALColorTable *Clone() const;
    00383
    00384     GDALPaletteInterp GetPaletteInterpretation() const;
    00385
    00386     int           GetColorEntryCount() const;
    00387     const GDALColorEntry *GetColorEntry( int ) const;
    00388     int           GetColorEntryAsRGB( int, GDALColorEntry * ) const;
    00389     void          SetColorEntry( int, const GDALColorEntry * );
    00390     int           CreateColorRamp( int, const GDALColorEntry * ,
    00391                                    int, const GDALColorEntry * );
    00392 };
    00393
    00394 /* ******************************************************************** */
    00395 /*                            GDALRasterBand                            */
    00396 /* ******************************************************************** */
    00397
    00399
    00400 class CPL_DLL GDALRasterBand : public GDALMajorObject
    00401 {
    00402   protected:
    00403     GDALDataset *poDS;
    00404     int         nBand; /* 1 based */
    00405
    00406     int         nRasterXSize;
    00407     int         nRasterYSize;
    00408
    00409     GDALDataType eDataType;
    00410     GDALAccess  eAccess;
    00411
    00412     /* stuff related to blocking, and raster cache */
    00413     int         nBlockXSize;
    00414     int         nBlockYSize;
    00415     int         nBlocksPerRow;
    00416     int         nBlocksPerColumn;
    00417
    00418     int         bSubBlockingActive;
    00419     int         nSubBlocksPerRow;
    00420     int         nSubBlocksPerColumn;
    00421     GDALRasterBlock **papoBlocks;
    00422
    00423     int         nBlockReads;
    00424     int         bForceCachedIO;
    00425
    00426     GDALRasterBand *poMask;
    00427     bool        bOwnMask;
    00428     int         nMaskFlags;
    00429
    00430     friend class GDALDataset;
    00431     friend class GDALRasterBlock;
    00432     friend class GDALProxyRasterBand;
    00433
    00434   protected:
    00435     virtual CPLErr IReadBlock( int, int, void * ) = 0;
    00436     virtual CPLErr IWriteBlock( int, int, void * );
    00437     virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
    00438                               void *, int, int, GDALDataType,
    00439                               int, int );
    00440     CPLErr         OverviewRasterIO( GDALRWFlag, int, int, int, int,
    00441                                      void *, int, int, GDALDataType,
    00442                                      int, int );
    00443
    00444     int            InitBlockInfo();
    00445
    00446     CPLErr         AdoptBlock( int, int, GDALRasterBlock * );
    00447     GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff, int nYBlockYOff );
    00448
    00449   public:
    00450                 GDALRasterBand();
    00451
    00452     virtual     ~GDALRasterBand();
    00453
    00454     int         GetXSize();
    00455     int         GetYSize();
    00456     int         GetBand();
    00457     GDALDataset*GetDataset();
    00458
    00459     GDALDataType GetRasterDataType( void );
    00460     void        GetBlockSize( int *, int * );
    00461     GDALAccess  GetAccess();
    00462
    00463     CPLErr      RasterIO( GDALRWFlag, int, int, int, int,
    00464                           void *, int, int, GDALDataType,
    00465                           int, int );
    00466     CPLErr      ReadBlock( int, int, void * );
    00467
    00468     CPLErr      WriteBlock( int, int, void * );
    00469
    00470     GDALRasterBlock *GetLockedBlockRef( int nXBlockOff, int nYBlockOff,
    00471                                         int bJustInitialize = FALSE );
    00472     CPLErr      FlushBlock( int = -1, int = -1 );
    00473
    00474     unsigned char*  GetIndexColorTranslationTo(/* const */ GDALRasterBand* poReferenceBand,
    00475                                                unsigned char* pTranslationTable = NULL,
    00476                                                int* pApproximateMatching = NULL);
    00477
    00478     // New OpengIS CV_SampleDimension stuff.
    00479
    00480     virtual CPLErr FlushCache();
    00481     virtual char **GetCategoryNames();
    00482     virtual double GetNoDataValue( int *pbSuccess = NULL );
    00483     virtual double GetMinimum( int *pbSuccess = NULL );
    00484     virtual double GetMaximum(int *pbSuccess = NULL );
    00485     virtual double GetOffset( int *pbSuccess = NULL );
    00486     virtual double GetScale( int *pbSuccess = NULL );
    00487     virtual const char *GetUnitType();
    00488     virtual GDALColorInterp GetColorInterpretation();
    00489     virtual GDALColorTable *GetColorTable();
    00490     virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0);
    00491
    00492     virtual CPLErr SetCategoryNames( char ** );
    00493     virtual CPLErr SetNoDataValue( double );
    00494     virtual CPLErr SetColorTable( GDALColorTable * );
    00495     virtual CPLErr SetColorInterpretation( GDALColorInterp );
    00496     virtual CPLErr SetOffset( double );
    00497     virtual CPLErr SetScale( double );
    00498     virtual CPLErr SetUnitType( const char * );
    00499
    00500     virtual CPLErr GetStatistics( int bApproxOK, int bForce,
    00501                                   double *pdfMin, double *pdfMax,
    00502                                   double *pdfMean, double *padfStdDev );
    00503     virtual CPLErr ComputeStatistics( int bApproxOK,
    00504                                       double *pdfMin, double *pdfMax,
    00505                                       double *pdfMean, double *pdfStdDev,
    00506                                       GDALProgressFunc, void *pProgressData );
    00507     virtual CPLErr SetStatistics( double dfMin, double dfMax,
    00508                                   double dfMean, double dfStdDev );
    00509     virtual CPLErr ComputeRasterMinMax( int, double* );
    00510
    00511     virtual int HasArbitraryOverviews();
    00512     virtual int GetOverviewCount();
    00513     virtual GDALRasterBand *GetOverview(int);
    00514     virtual GDALRasterBand *GetRasterSampleOverview( int );
    00515     virtual CPLErr BuildOverviews( const char *, int, int *,
    00516                                    GDALProgressFunc, void * );
    00517
    00518     virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
    00519                                int nBufXSize, int nBufYSize,
    00520                                GDALDataType eDT, char **papszOptions );
    00521
    00522     virtual CPLErr  GetHistogram( double dfMin, double dfMax,
    00523                           int nBuckets, int * panHistogram,
    00524                           int bIncludeOutOfRange, int bApproxOK,
    00525                           GDALProgressFunc, void *pProgressData );
    00526
    00527     virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
    00528                                         int *pnBuckets, int ** ppanHistogram,
    00529                                         int bForce,
    00530                                         GDALProgressFunc, void *pProgressData);
    00531     virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
    00532                                         int nBuckets, int *panHistogram );
    00533
    00534     virtual const GDALRasterAttributeTable *GetDefaultRAT();
    00535     virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * );
    00536
    00537     virtual GDALRasterBand *GetMaskBand();
    00538     virtual int             GetMaskFlags();
    00539     virtual CPLErr          CreateMaskBand( int nFlags );
    00540 };
    00541
    00542 /* ******************************************************************** */
    00543 /*                         GDALAllValidMaskBand                         */
    00544 /* ******************************************************************** */
    00545
    00546 class CPL_DLL GDALAllValidMaskBand : public GDALRasterBand
    00547 {
    00548   protected:
    00549     virtual CPLErr IReadBlock( int, int, void * );
    00550
    00551   public:
    00552                 GDALAllValidMaskBand( GDALRasterBand * );
    00553     virtual     ~GDALAllValidMaskBand();
    00554
    00555     virtual GDALRasterBand *GetMaskBand();
    00556     virtual int             GetMaskFlags();
    00557 };
    00558
    00559 /* ******************************************************************** */
    00560 /*                         GDALNoDataMaskBand                           */
    00561 /* ******************************************************************** */
    00562
    00563 class CPL_DLL GDALNoDataMaskBand : public GDALRasterBand
    00564 {
    00565     double          dfNoDataValue;
    00566     GDALRasterBand *poParent;
    00567
    00568   protected:
    00569     virtual CPLErr IReadBlock( int, int, void * );
    00570
    00571   public:
    00572                 GDALNoDataMaskBand( GDALRasterBand * );
    00573     virtual     ~GDALNoDataMaskBand();
    00574 };
    00575
    00576 /* ******************************************************************** */
    00577 /*                  GDALNoDataValuesMaskBand                            */
    00578 /* ******************************************************************** */
    00579
    00580 class CPL_DLL GDALNoDataValuesMaskBand : public GDALRasterBand
    00581 {
    00582     double      *padfNodataValues;
    00583
    00584   protected:
    00585     virtual CPLErr IReadBlock( int, int, void * );
    00586
    00587   public:
    00588                 GDALNoDataValuesMaskBand( GDALDataset * );
    00589     virtual     ~GDALNoDataValuesMaskBand();
    00590 };
    00591
    00592 /* ******************************************************************** */
    00593 /*                             GDALOpenInfo                             */
    00594 /*                                                                      */
    00595 /*      Structure of data about dataset for open functions.             */
    00596 /* ******************************************************************** */
    00597
    00598 class CPL_DLL GDALOpenInfo
    00599 {
    00600   public:
    00601                 GDALOpenInfo( const char * pszFile, GDALAccess eAccessIn,
    00602                               char **papszSiblingFiles = NULL );
    00603                 ~GDALOpenInfo( void );
    00604
    00605     char        *pszFilename;
    00606     char        **papszSiblingFiles;
    00607
    00608     GDALAccess  eAccess;
    00609
    00610     int         bStatOK;
    00611     int         bIsDirectory;
    00612
    00613     FILE        *fp;
    00614
    00615     int         nHeaderBytes;
    00616     GByte       *pabyHeader;
    00617
    00618 };
    00619
    00620 /* ******************************************************************** */
    00621 /*                              GDALDriver                              */
    00622 /* ******************************************************************** */
    00623
    00624
    00636 class CPL_DLL GDALDriver : public GDALMajorObject
    00637 {
    00638   public:
    00639                         GDALDriver();
    00640                         ~GDALDriver();
    00641
    00642 /* -------------------------------------------------------------------- */
    00643 /*      Public C++ methods.                                             */
    00644 /* -------------------------------------------------------------------- */
    00645     GDALDataset         *Create( const char * pszName,
    00646                                  int nXSize, int nYSize, int nBands,
    00647                                  GDALDataType eType, char ** papszOptions );
    00648
    00649     CPLErr              Delete( const char * pszName );
    00650     CPLErr              Rename( const char * pszNewName,
    00651                                 const char * pszOldName );
    00652     CPLErr              CopyFiles( const char * pszNewName,
    00653                                    const char * pszOldName );
    00654
    00655     GDALDataset         *CreateCopy( const char *, GDALDataset *,
    00656                                      int, char **,
    00657                                      GDALProgressFunc pfnProgress,
    00658                                      void * pProgressData );
    00659
    00660 /* -------------------------------------------------------------------- */
    00661 /*      The following are semiprivate, not intended to be accessed      */
    00662 /*      by anyone but the formats instantiating and populating the      */
    00663 /*      drivers.                                                        */
    00664 /* -------------------------------------------------------------------- */
    00665     GDALDataset         *(*pfnOpen)( GDALOpenInfo * );
    00666
    00667     GDALDataset         *(*pfnCreate)( const char * pszName,
    00668                                        int nXSize, int nYSize, int nBands,
    00669                                        GDALDataType eType,
    00670                                        char ** papszOptions );
    00671
    00672     CPLErr              (*pfnDelete)( const char * pszName );
    00673
    00674     GDALDataset         *(*pfnCreateCopy)( const char *, GDALDataset *,
    00675                                            int, char **,
    00676                                            GDALProgressFunc pfnProgress,
    00677                                            void * pProgressData );
    00678
    00679     void                *pDriverData;
    00680
    00681     void                (*pfnUnloadDriver)(GDALDriver *);
    00682
    00683     int                 (*pfnIdentify)( GDALOpenInfo * );
    00684
    00685     CPLErr              (*pfnRename)( const char * pszNewName,
    00686                                       const char * pszOldName );
    00687     CPLErr              (*pfnCopyFiles)( const char * pszNewName,
    00688                                          const char * pszOldName );
    00689
    00690 /* -------------------------------------------------------------------- */
    00691 /*      Helper methods.                                                 */
    00692 /* -------------------------------------------------------------------- */
    00693     GDALDataset         *DefaultCreateCopy( const char *, GDALDataset *,
    00694                                             int, char **,
    00695                                             GDALProgressFunc pfnProgress,
    00696                                             void * pProgressData );
    00697     static CPLErr        DefaultCopyMasks( GDALDataset *poSrcDS,
    00698                                            GDALDataset *poDstDS,
    00699                                            int bStrict );
    00700     static CPLErr       QuietDelete( const char * pszName );
    00701 };
    00702
    00703 /* ******************************************************************** */
    00704 /*                          GDALDriverManager                           */
    00705 /* ******************************************************************** */
    00706
    00714 class CPL_DLL GDALDriverManager : public GDALMajorObject
    00715 {
    00716     int         nDrivers;
    00717     GDALDriver  **papoDrivers;
    00718
    00719     char        *pszHome;
    00720
    00721  public:
    00722                 GDALDriverManager();
    00723                 ~GDALDriverManager();
    00724
    00725     int         GetDriverCount( void );
    00726     GDALDriver  *GetDriver( int );
    00727     GDALDriver  *GetDriverByName( const char * );
    00728
    00729     int         RegisterDriver( GDALDriver * );
    00730     void        MoveDriver( GDALDriver *, int );
    00731     void        DeregisterDriver( GDALDriver * );
    00732
    00733     void        AutoLoadDrivers();
    00734     void        AutoSkipDrivers();
    00735
    00736     const char *GetHome();
    00737     void        SetHome( const char * );
    00738 };
    00739
    00740 /* Not a public symbol for the moment */
    00741 CPLErr
    00742 GDALRegenerateOverviewsMultiBand(int nBands, GDALRasterBand** papoSrcBands,
    00743                                  int nOverviews,
    00744                                  GDALRasterBand*** papapoOverviewBands,
    00745                                  const char * pszResampling,
    00746                                  GDALProgressFunc pfnProgress, void * pProgressData );
    00747
    00748 CPL_C_START
    00749 GDALDriverManager CPL_DLL * GetGDALDriverManager( void );
    00750 CPL_C_END
    00751
    00752 /* ==================================================================== */
    00753 /*      An assortment of overview related stuff.                        */
    00754 /* ==================================================================== */
    00755
    00756 CPL_C_START
    00757
    00758 #ifndef WIN32CE
    00759
    00760 CPLErr CPL_DLL
    00761 HFAAuxBuildOverviews( const char *pszOvrFilename, GDALDataset *poParentDS,
    00762                       GDALDataset **ppoDS,
    00763                       int nBands, int *panBandList,
    00764                       int nNewOverviews, int *panNewOverviewList,
    00765                       const char *pszResampling,
    00766                       GDALProgressFunc pfnProgress,
    00767                       void *pProgressData );
    00768
    00769 #endif /* WIN32CE */
    00770
    00771 CPLErr CPL_DLL
    00772 GTIFFBuildOverviews( const char * pszFilename,
    00773                      int nBands, GDALRasterBand **papoBandList,
    00774                      int nOverviews, int * panOverviewList,
    00775                      const char * pszResampling,
    00776                      GDALProgressFunc pfnProgress, void * pProgressData );
    00777
    00778 CPLErr CPL_DLL
    00779 GDALDefaultBuildOverviews( GDALDataset *hSrcDS, const char * pszBasename,
    00780                            const char * pszResampling,
    00781                            int nOverviews, int * panOverviewList,
    00782                            int nBands, int * panBandList,
    00783                            GDALProgressFunc pfnProgress, void * pProgressData);
    00784
    00785 int CPL_DLL GDALBandGetBestOverviewLevel(GDALRasterBand* poBand,
    00786                                          int &nXOff, int &nYOff,
    00787                                          int &nXSize, int &nYSize,
    00788                                          int nBufXSize, int nBufYSize);
    00789
    00790 int CPL_DLL GDALOvLevelAdjust( int nOvLevel, int nXSize );
    00791
    00792 GDALDataset CPL_DLL *
    00793 GDALFindAssociatedAuxFile( const char *pszBasefile, GDALAccess eAccess,
    00794                            GDALDataset *poDependentDS );
    00795
    00796 /* ==================================================================== */
    00797 /*      Misc functions.                                                 */
    00798 /* ==================================================================== */
    00799
    00800 CPLErr CPL_DLL GDALParseGMLCoverage( CPLXMLNode *psTree,
    00801                                      int *pnXSize, int *pnYSize,
    00802                                      double *padfGeoTransform,
    00803                                      char **ppszProjection );
    00804
    00805 /* ==================================================================== */
    00806 /*  Infrastructure to check that dataset characteristics are valid      */
    00807 /* ==================================================================== */
    00808
    00809 int CPL_DLL GDALCheckDatasetDimensions( int nXSize, int nYSize );
    00810 int CPL_DLL GDALCheckBandCount( int nBands, int bIsZeroAllowed );
    00811
    00812 CPL_C_END
    00813
    00814 #endif /* ndef GDAL_PRIV_H_INCLUDED */

Generated for GDAL by 1.5.7.1.