gdal_priv.h

00001 /******************************************************************************
00002  * $Id: gdal_priv.h,v 1.76 2006/11/28 12:56:53 mloskot Exp $
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  * $Log: gdal_priv.h,v $
00032  * Revision 1.76  2006/11/28 12:56:53  mloskot
00033  * Excluded HFAAuxBuildOverviews function for Windows CE.
00034  *
00035  * Revision 1.75  2006/10/27 03:39:05  fwarmerdam
00036  * added GDALParseGMLCoverage
00037  *
00038  * Revision 1.74  2006/07/13 15:27:14  fwarmerdam
00039  * Implement ComputeStatistics method
00040  *
00041  * Revision 1.73  2006/05/24 22:25:33  fwarmerdam
00042  * split off DefaultCreateCopy() method.
00043  *
00044  * Revision 1.72  2006/04/13 03:16:01  fwarmerdam
00045  * keep track if an object is PAM enabled, bug 1135
00046  *
00047  * Revision 1.71  2006/02/07 19:07:07  fwarmerdam
00048  * applied some strategic improved outofmemory checking
00049  *
00050  * Revision 1.70  2005/11/17 22:02:32  fwarmerdam
00051  * avoid overwriting existing .aux file, overview filename now CPLString
00052  *
00053  * Revision 1.69  2005/10/13 01:19:57  fwarmerdam
00054  * moved GDALMultiDomainMetadata into GDALMajorObject
00055  *
00056  * Revision 1.68  2005/09/26 15:52:03  fwarmerdam
00057  * centralized .aux opening logic
00058  *
00059  * Revision 1.67  2005/09/23 20:52:21  fwarmerdam
00060  * added the GMO flags on GDALMajorObject
00061  *
00062  * Revision 1.66  2005/09/23 16:55:39  fwarmerdam
00063  * use CPLString instead of std::string
00064  *
00065  * Revision 1.65  2005/09/17 04:04:16  fwarmerdam
00066  * provide default implementation for RAT functions
00067  *
00068  * Revision 1.64  2005/09/17 03:46:37  fwarmerdam
00069  * added HFAAuxBuildOverviews
00070  *
00071  * Revision 1.63  2005/09/16 20:31:15  fwarmerdam
00072  * added bOvrIsAux, and RAT methods
00073  *
00074  * Revision 1.62  2005/07/25 21:24:28  ssoule
00075  * Changed GDALColorTable's "GDALColorEntry *paoEntries" to
00076  * "std::vector<GDALColorEntry> aoEntries".
00077  *
00078  * Revision 1.61  2005/07/25 19:52:43  ssoule
00079  * Changed GDALMajorObject's char *pszDescription to std::string sDescription.
00080  *
00081  * Revision 1.60  2005/07/11 21:08:17  fwarmerdam
00082  * Removed GetAge() method.
00083  *
00084  * Revision 1.59  2005/07/11 19:07:02  fwarmerdam
00085  * removed GDALRasterBlock nAge.
00086  *
00087  * Revision 1.58  2005/05/23 06:44:48  fwarmerdam
00088  * blockrefs now fetched locked
00089  *
00090  * Revision 1.57  2005/05/13 18:19:15  fwarmerdam
00091  * Added SetDefaultHistogram
00092  *
00093  * Revision 1.56  2005/05/10 15:30:28  fwarmerdam
00094  * export some overview functions
00095  *
00096  * Revision 1.55  2005/05/10 04:49:24  fwarmerdam
00097  * added getdefaulthistogram and GDALOvLevelAdjust
00098  *
00099  * Revision 1.54  2005/04/27 16:29:33  fwarmerdam
00100  * GetHistogram() made virtual.  Added methods for getting and setting
00101  * statistics.  Added SetUnitType method.
00102  *
00103  * Revision 1.53  2005/04/07 17:31:00  fwarmerdam
00104  * added some brief descriptions of classes
00105  *
00106  * Revision 1.52  2005/04/04 15:24:48  fwarmerdam
00107  * Most C entry points now CPL_STDCALL
00108  *
00109  * Revision 1.51  2005/02/17 22:16:12  fwarmerdam
00110  * changed to use two level block cache
00111  *
00112  * Revision 1.50  2005/01/15 16:09:37  fwarmerdam
00113  * added SetOffset, SetScale methods
00114  *
00115  * Revision 1.49  2005/01/04 21:14:01  fwarmerdam
00116  * added GDAL_FORCE_CACHING config variable
00117  */
00118 
00119 #ifndef GDAL_PRIV_H_INCLUDED
00120 #define GDAL_PRIV_H_INCLUDED
00121 
00122 /* -------------------------------------------------------------------- */
00123 /*      Predeclare various classes before pulling in gdal.h, the        */
00124 /*      public declarations.                                            */
00125 /* -------------------------------------------------------------------- */
00126 class GDALMajorObject;
00127 class GDALDataset;
00128 class GDALRasterBand;
00129 class GDALDriver;
00130 class GDALRasterAttributeTable;
00131 
00132 /* -------------------------------------------------------------------- */
00133 /*      Pull in the public declarations.  This gets the C apis, and     */
00134 /*      also various constants.  However, we will still get to          */
00135 /*      provide the real class definitions for the GDAL classes.        */
00136 /* -------------------------------------------------------------------- */
00137 
00138 #include "gdal.h"
00139 #include "gdal_frmts.h"
00140 #include "cpl_vsi.h"
00141 #include "cpl_conv.h"
00142 #include "cpl_string.h"
00143 #include "cpl_minixml.h"
00144 #include <vector>
00145 
00146 #define GMO_VALID                0x0001
00147 #define GMO_IGNORE_UNIMPLEMENTED 0x0002
00148 #define GMO_SUPPORT_MD           0x0004
00149 #define GMO_SUPPORT_MDMD         0x0008
00150 #define GMO_MD_DIRTY             0x0010
00151 #define GMO_PAM_CLASS            0x0020
00152 
00153 /************************************************************************/
00154 /*                       GDALMultiDomainMetadata                        */
00155 /************************************************************************/
00156 
00157 class CPL_DLL GDALMultiDomainMetadata
00158 {
00159 private:
00160     char **papszDomainList;
00161     char ***papapszMetadataLists;
00162 
00163 public:
00164     GDALMultiDomainMetadata();
00165     ~GDALMultiDomainMetadata();
00166 
00167     int         XMLInit( CPLXMLNode *psMetadata, int bMerge );
00168     CPLXMLNode  *Serialize();
00169 
00170     char      **GetDomainList() { return papszDomainList; }
00171 
00172     char      **GetMetadata( const char * pszDomain = "" );
00173     CPLErr      SetMetadata( char ** papszMetadata,
00174                              const char * pszDomain = "" );
00175     const char *GetMetadataItem( const char * pszName,
00176                                  const char * pszDomain = "" );
00177     CPLErr      SetMetadataItem( const char * pszName,
00178                                  const char * pszValue,
00179                                  const char * pszDomain = "" );
00180 
00181     void        Clear();
00182 };
00183 
00184 /* ******************************************************************** */
00185 /*                           GDALMajorObject                            */
00186 /*                                                                      */
00187 /*      Base class providing metadata, description and other            */
00188 /*      services shared by major objects.                               */
00189 /* ******************************************************************** */
00190 
00192 
00193 class CPL_DLL GDALMajorObject
00194 {
00195   protected:
00196     int                 nFlags; // GMO_* flags. 
00197     CPLString           sDescription;
00198     GDALMultiDomainMetadata oMDMD;
00199     
00200   public:
00201                         GDALMajorObject();
00202     virtual            ~GDALMajorObject();
00203 
00204     int                 GetMOFlags();
00205     void                SetMOFlags(int nFlags);
00206                         
00207     virtual const char *GetDescription() const;
00208     virtual void        SetDescription( const char * );
00209 
00210     virtual char      **GetMetadata( const char * pszDomain = "" );
00211     virtual CPLErr      SetMetadata( char ** papszMetadata,
00212                                      const char * pszDomain = "" );
00213     virtual const char *GetMetadataItem( const char * pszName,
00214                                          const char * pszDomain = "" );
00215     virtual CPLErr      SetMetadataItem( const char * pszName,
00216                                          const char * pszValue,
00217                                          const char * pszDomain = "" );
00218 };
00219 
00220 /* ******************************************************************** */
00221 /*                         GDALDefaultOverviews                         */
00222 /* ******************************************************************** */
00223 class CPL_DLL GDALDefaultOverviews
00224 {
00225     GDALDataset *poDS;
00226     GDALDataset *poODS;
00227     
00228     CPLString  osOvrFilename;
00229 
00230     int        bOvrIsAux;
00231     
00232   public:
00233                GDALDefaultOverviews();
00234                ~GDALDefaultOverviews();
00235 
00236     void       Initialize( GDALDataset *poDS, const char *pszName = NULL, 
00237                            int bNameIsOVR = FALSE );
00238     int        IsInitialized() { return poDS != NULL; }
00239 
00240     int        GetOverviewCount(int);
00241     GDALRasterBand *GetOverview(int,int);
00242 
00243     CPLErr     BuildOverviews( const char * pszBasename,
00244                                const char * pszResampling, 
00245                                int nOverviews, int * panOverviewList,
00246                                int nBands, int * panBandList,
00247                                GDALProgressFunc pfnProgress,
00248                                void *pProgressData );
00249 };
00250 
00251 /* ******************************************************************** */
00252 /*                             GDALDataset                              */
00253 /* ******************************************************************** */
00254 
00256 
00257 class CPL_DLL GDALDataset : public GDALMajorObject
00258 {
00259     friend GDALDatasetH CPL_STDCALL GDALOpen( const char *, GDALAccess);
00260     friend GDALDatasetH CPL_STDCALL GDALOpenShared( const char *, GDALAccess);
00261     friend class GDALDriver;
00262 
00263   protected:
00264     GDALDriver  *poDriver;
00265     GDALAccess  eAccess;
00266     
00267     // Stored raster information.
00268     int         nRasterXSize;
00269     int         nRasterYSize;
00270     int         nBands;
00271     GDALRasterBand **papoBands;
00272 
00273     int         bForceCachedIO;
00274 
00275     int         nRefCount;
00276     int         bShared;
00277 
00278                 GDALDataset(void);
00279     void        RasterInitialize( int, int );
00280     void        SetBand( int, GDALRasterBand * );
00281 
00282     GDALDefaultOverviews oOvManager;
00283     
00284     virtual CPLErr IBuildOverviews( const char *, int, int *,
00285                                     int, int *, GDALProgressFunc, void * );
00286     
00287     virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
00288                               void *, int, int, GDALDataType,
00289                               int, int *, int, int, int );
00290 
00291     CPLErr BlockBasedRasterIO( GDALRWFlag, int, int, int, int,
00292                                void *, int, int, GDALDataType,
00293                                int, int *, int, int, int );
00294     void   BlockBasedFlushCache();
00295 
00296     friend class GDALRasterBand;
00297     
00298   public:
00299     virtual     ~GDALDataset();
00300 
00301     int         GetRasterXSize( void );
00302     int         GetRasterYSize( void );
00303     int         GetRasterCount( void );
00304     GDALRasterBand *GetRasterBand( int );
00305 
00306     virtual void FlushCache(void);
00307 
00308     virtual const char *GetProjectionRef(void);
00309     virtual CPLErr SetProjection( const char * );
00310 
00311     virtual CPLErr GetGeoTransform( double * );
00312     virtual CPLErr SetGeoTransform( double * );
00313 
00314     virtual CPLErr        AddBand( GDALDataType eType, 
00315                                    char **papszOptions=NULL );
00316 
00317     virtual void *GetInternalHandle( const char * );
00318     virtual GDALDriver *GetDriver(void);
00319 
00320     virtual int    GetGCPCount();
00321     virtual const char *GetGCPProjection();
00322     virtual const GDAL_GCP *GetGCPs();
00323     virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
00324                             const char *pszGCPProjection );
00325 
00326     virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
00327                                int nBufXSize, int nBufYSize, 
00328                                GDALDataType eDT, 
00329                                int nBandCount, int *panBandList,
00330                                char **papszOptions );
00331 
00332     CPLErr      RasterIO( GDALRWFlag, int, int, int, int,
00333                           void *, int, int, GDALDataType,
00334                           int, int *, int, int, int );
00335 
00336     int           Reference();
00337     int           Dereference();
00338     GDALAccess    GetAccess() { return eAccess; }
00339 
00340     int           GetShared();
00341     void          MarkAsShared();
00342 
00343     static GDALDataset **GetOpenDatasets( int *pnDatasetCount );
00344 
00345     CPLErr BuildOverviews( const char *, int, int *,
00346                            int, int *, GDALProgressFunc, void * );
00347 };
00348 
00349 /* ******************************************************************** */
00350 /*                           GDALRasterBlock                            */
00351 /* ******************************************************************** */
00352 
00355 class CPL_DLL GDALRasterBlock
00356 {
00357     GDALDataType        eType;
00358     
00359     int                 bDirty;
00360     int                 nLockCount;
00361 
00362     int                 nXOff;
00363     int                 nYOff;
00364        
00365     int                 nXSize;
00366     int                 nYSize;
00367     
00368     void                *pData;
00369 
00370     GDALRasterBand      *poBand;
00371     
00372     GDALRasterBlock     *poNext;
00373     GDALRasterBlock     *poPrevious;
00374 
00375   public:
00376                 GDALRasterBlock( GDALRasterBand *, int, int );
00377     virtual     ~GDALRasterBlock();
00378 
00379     CPLErr      Internalize( void );    /* make copy of data */
00380     void        Touch( void );          /* update age */
00381     void        MarkDirty( void );      /* data has been modified since read */
00382     void        MarkClean( void );
00383     void        AddLock( void ) { nLockCount++; }
00384     void        DropLock( void ) { nLockCount--; }
00385     void        Detach();
00386 
00387     CPLErr      Write();
00388 
00389     GDALDataType GetDataType() { return eType; }
00390     int         GetXOff() { return nXOff; }
00391     int         GetYOff() { return nYOff; }
00392     int         GetXSize() { return nXSize; }
00393     int         GetYSize() { return nYSize; }
00394     int         GetDirty() { return bDirty; }
00395     int         GetLockCount() { return nLockCount; }
00396 
00397     void        *GetDataRef( void ) { return pData; }
00398 
00399     GDALRasterBand *GetBand() { return poBand; }
00400 
00401     static int  FlushCacheBlock();
00402     static void Verify();
00403 
00404     static int  SafeLockBlock( GDALRasterBlock ** );
00405 };
00406 
00407 /* ******************************************************************** */
00408 /*                             GDALColorTable                           */
00409 /* ******************************************************************** */
00410 
00411 class CPL_DLL GDALColorTable
00412 {
00413     GDALPaletteInterp eInterp;
00414 
00415     std::vector<GDALColorEntry> aoEntries;
00416 
00417 public:
00418                 GDALColorTable( GDALPaletteInterp = GPI_RGB );
00419                 ~GDALColorTable();
00420 
00421     GDALColorTable *Clone() const;
00422 
00423     GDALPaletteInterp GetPaletteInterpretation() const;
00424 
00425     int           GetColorEntryCount() const;
00426     const GDALColorEntry *GetColorEntry( int ) const;
00427     int           GetColorEntryAsRGB( int, GDALColorEntry * ) const;
00428     void          SetColorEntry( int, const GDALColorEntry * );
00429 };
00430 
00431 /* ******************************************************************** */
00432 /*                            GDALRasterBand                            */
00433 /* ******************************************************************** */
00434 
00436 
00437 class CPL_DLL GDALRasterBand : public GDALMajorObject
00438 {
00439   protected:
00440     GDALDataset *poDS;
00441     int         nBand; /* 1 based */
00442 
00443     int         nRasterXSize;
00444     int         nRasterYSize;
00445     
00446     GDALDataType eDataType;
00447     GDALAccess  eAccess;
00448 
00449     /* stuff related to blocking, and raster cache */
00450     int         nBlockXSize;
00451     int         nBlockYSize;
00452     int         nBlocksPerRow;
00453     int         nBlocksPerColumn;
00454 
00455     int         bSubBlockingActive;
00456     int         nSubBlocksPerRow;
00457     int         nSubBlocksPerColumn;
00458     GDALRasterBlock **papoBlocks;
00459 
00460     int         nBlockReads;
00461     int         bForceCachedIO;
00462 
00463     friend class GDALDataset;
00464     friend class GDALRasterBlock;
00465 
00466   protected:
00467     virtual CPLErr IReadBlock( int, int, void * ) = 0;
00468     virtual CPLErr IWriteBlock( int, int, void * );
00469     virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
00470                               void *, int, int, GDALDataType,
00471                               int, int );
00472     CPLErr         OverviewRasterIO( GDALRWFlag, int, int, int, int,
00473                                      void *, int, int, GDALDataType,
00474                                      int, int );
00475 
00476     int            InitBlockInfo();
00477 
00478     CPLErr         AdoptBlock( int, int, GDALRasterBlock * );
00479     GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff, int nYBlockYOff );
00480 
00481   public:
00482                 GDALRasterBand();
00483                 
00484     virtual     ~GDALRasterBand();
00485 
00486     int         GetXSize();
00487     int         GetYSize();
00488     int         GetBand();
00489     GDALDataset*GetDataset();
00490 
00491     GDALDataType GetRasterDataType( void );
00492     void        GetBlockSize( int *, int * );
00493     GDALAccess  GetAccess();
00494     
00495     CPLErr      RasterIO( GDALRWFlag, int, int, int, int,
00496                           void *, int, int, GDALDataType,
00497                           int, int );
00498     CPLErr      ReadBlock( int, int, void * );
00499 
00500     CPLErr      WriteBlock( int, int, void * );
00501 
00502     GDALRasterBlock *GetLockedBlockRef( int nXBlockOff, int nYBlockOff, 
00503                                         int bJustInitialize = FALSE );
00504     CPLErr      FlushBlock( int = -1, int = -1 );
00505 
00506     // New OpengIS CV_SampleDimension stuff.
00507 
00508     virtual CPLErr FlushCache();
00509     virtual char **GetCategoryNames();
00510     virtual double GetNoDataValue( int *pbSuccess = NULL );
00511     virtual double GetMinimum( int *pbSuccess = NULL );
00512     virtual double GetMaximum(int *pbSuccess = NULL );
00513     virtual double GetOffset( int *pbSuccess = NULL );
00514     virtual double GetScale( int *pbSuccess = NULL );
00515     virtual const char *GetUnitType();
00516     virtual GDALColorInterp GetColorInterpretation();
00517     virtual GDALColorTable *GetColorTable();
00518     virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0);
00519 
00520     virtual CPLErr SetCategoryNames( char ** );
00521     virtual CPLErr SetNoDataValue( double );
00522     virtual CPLErr SetColorTable( GDALColorTable * ); 
00523     virtual CPLErr SetColorInterpretation( GDALColorInterp );
00524     virtual CPLErr SetOffset( double );
00525     virtual CPLErr SetScale( double );
00526     virtual CPLErr SetUnitType( const char * );
00527 
00528     virtual CPLErr GetStatistics( int bApproxOK, int bForce,
00529                                   double *pdfMin, double *pdfMax, 
00530                                   double *pdfMean, double *padfStdDev );
00531     virtual CPLErr ComputeStatistics( int bApproxOK, 
00532                                       double *pdfMin, double *pdfMax, 
00533                                       double *pdfMean, double *padfStdDev,
00534                                       GDALProgressFunc, void *pProgressData );
00535     virtual CPLErr SetStatistics( double dfMin, double dfMax, 
00536                                   double dfMean, double dfStdDev );
00537 
00538     virtual int HasArbitraryOverviews();
00539     virtual int GetOverviewCount();
00540     virtual GDALRasterBand *GetOverview(int);
00541     virtual CPLErr BuildOverviews( const char *, int, int *,
00542                                    GDALProgressFunc, void * );
00543 
00544     virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
00545                                int nBufXSize, int nBufYSize, 
00546                                GDALDataType eDT, char **papszOptions );
00547 
00548     virtual CPLErr  GetHistogram( double dfMin, double dfMax,
00549                           int nBuckets, int * panHistogram,
00550                           int bIncludeOutOfRange, int bApproxOK,
00551                           GDALProgressFunc, void *pProgressData );
00552 
00553     virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
00554                                         int *pnBuckets, int ** ppanHistogram,
00555                                         int bForce,
00556                                         GDALProgressFunc, void *pProgressData);
00557     virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
00558                                         int nBuckets, int *panHistogram );
00559 
00560     virtual const GDALRasterAttributeTable *GetDefaultRAT();
00561     virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * );
00562 };
00563 
00564 /* ******************************************************************** */
00565 /*                             GDALOpenInfo                             */
00566 /*                                                                      */
00567 /*      Structure of data about dataset for open functions.             */
00568 /* ******************************************************************** */
00569 
00570 class CPL_DLL GDALOpenInfo
00571 {
00572   public:
00573 
00574                 GDALOpenInfo( const char * pszFile, GDALAccess eAccessIn );
00575                 ~GDALOpenInfo( void );
00576     
00577     char        *pszFilename;
00578 
00579     GDALAccess  eAccess;
00580 
00581     int         bStatOK;
00582     int         bIsDirectory;
00583 
00584     FILE        *fp;
00585 
00586     int         nHeaderBytes;
00587     GByte       *pabyHeader;
00588 
00589 };
00590 
00591 /* ******************************************************************** */
00592 /*                              GDALDriver                              */
00593 /* ******************************************************************** */
00594 
00595 
00607 class CPL_DLL GDALDriver : public GDALMajorObject
00608 {
00609   public:
00610                         GDALDriver();
00611                         ~GDALDriver();
00612 
00613 /* -------------------------------------------------------------------- */
00614 /*      Public C++ methods.                                             */
00615 /* -------------------------------------------------------------------- */
00616     GDALDataset         *Create( const char * pszName,
00617                                  int nXSize, int nYSize, int nBands,
00618                                  GDALDataType eType, char ** papszOptions );
00619 
00620     CPLErr              Delete( const char * pszName );
00621 
00622     GDALDataset         *CreateCopy( const char *, GDALDataset *, 
00623                                      int, char **,
00624                                      GDALProgressFunc pfnProgress, 
00625                                      void * pProgressData );
00626     
00627     GDALDataset         *DefaultCreateCopy( const char *, GDALDataset *, 
00628                                             int, char **,
00629                                             GDALProgressFunc pfnProgress, 
00630                                             void * pProgressData );
00631     
00632 /* -------------------------------------------------------------------- */
00633 /*      The following are semiprivate, not intended to be accessed      */
00634 /*      by anyone but the formats instantiating and populating the      */
00635 /*      drivers.                                                        */
00636 /* -------------------------------------------------------------------- */
00637     GDALDataset         *(*pfnOpen)( GDALOpenInfo * );
00638 
00639     GDALDataset         *(*pfnCreate)( const char * pszName,
00640                                        int nXSize, int nYSize, int nBands,
00641                                        GDALDataType eType,
00642                                        char ** papszOptions );
00643 
00644     CPLErr              (*pfnDelete)( const char * pszName );
00645 
00646     GDALDataset         *(*pfnCreateCopy)( const char *, GDALDataset *, 
00647                                            int, char **,
00648                                            GDALProgressFunc pfnProgress, 
00649                                            void * pProgressData );
00650 
00651     void                *pDriverData;
00652 
00653     void                (*pfnUnloadDriver)(GDALDriver *);
00654 };
00655 
00656 /* ******************************************************************** */
00657 /*                          GDALDriverManager                           */
00658 /* ******************************************************************** */
00659 
00667 class CPL_DLL GDALDriverManager : public GDALMajorObject
00668 {
00669     int         nDrivers;
00670     GDALDriver  **papoDrivers;
00671 
00672     char        *pszHome;
00673     
00674  public:
00675                 GDALDriverManager();
00676                 ~GDALDriverManager();
00677                 
00678     int         GetDriverCount( void );
00679     GDALDriver  *GetDriver( int );
00680     GDALDriver  *GetDriverByName( const char * );
00681 
00682     int         RegisterDriver( GDALDriver * );
00683     void        MoveDriver( GDALDriver *, int );
00684     void        DeregisterDriver( GDALDriver * );
00685 
00686     void        AutoLoadDrivers();
00687     void        AutoSkipDrivers();
00688 
00689     const char *GetHome();
00690     void        SetHome( const char * );
00691 };
00692 
00693 CPL_C_START
00694 GDALDriverManager CPL_DLL * GetGDALDriverManager( void );
00695 CPL_C_END
00696 
00697 /* ==================================================================== */
00698 /*      An assortment of overview related stuff.                        */
00699 /* ==================================================================== */
00700 
00701 CPL_C_START
00702 
00703 #ifndef WIN32CE
00704 
00705 CPLErr CPL_DLL
00706 HFAAuxBuildOverviews( const char *pszOvrFilename, GDALDataset *poParentDS,
00707                       GDALDataset **ppoDS,
00708                       int nBands, int *panBandList,
00709                       int nNewOverviews, int *panNewOverviewList, 
00710                       const char *pszResampling, 
00711                       GDALProgressFunc pfnProgress, 
00712                       void *pProgressData );
00713 
00714 #endif /* WIN32CE */
00715 
00716 CPLErr CPL_DLL 
00717 GTIFFBuildOverviews( const char * pszFilename,
00718                      int nBands, GDALRasterBand **papoBandList, 
00719                      int nOverviews, int * panOverviewList,
00720                      const char * pszResampling, 
00721                      GDALProgressFunc pfnProgress, void * pProgressData );
00722 
00723 CPLErr CPL_DLL
00724 GDALDefaultBuildOverviews( GDALDataset *hSrcDS, const char * pszBasename,
00725                            const char * pszResampling, 
00726                            int nOverviews, int * panOverviewList,
00727                            int nBands, int * panBandList,
00728                            GDALProgressFunc pfnProgress, void * pProgressData);
00729                            
00730 
00731 CPLErr CPL_DLL 
00732 GDALRegenerateOverviews( GDALRasterBand *, int, GDALRasterBand **,
00733                          const char *, GDALProgressFunc, void * );
00734 
00735 int CPL_DLL GDALOvLevelAdjust( int nOvLevel, int nXSize );
00736 
00737 GDALDataset CPL_DLL *
00738 GDALFindAssociatedAuxFile( const char *pszBasefile, GDALAccess eAccess );
00739 
00740 /* ==================================================================== */
00741 /*      Misc functions.                                                 */
00742 /* ==================================================================== */
00743 
00744 CPLErr CPL_DLL GDALParseGMLCoverage( CPLXMLNode *psTree, 
00745                                      int *pnXSize, int *pnYSize,
00746                                      double *padfGeoTransform,
00747                                      char **ppszProjection );
00748                                   
00749 CPL_C_END
00750 
00751 #endif /* ndef GDAL_PRIV_H_INCLUDED */

Generated for GDAL by doxygen 1.5.1.