gdal_priv.h

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

Generated on Sun Jul 2 22:18:26 2006 for GDAL by  doxygen 1.4.6