Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

gdal_priv.h

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

Generated on Mon Aug 29 04:05:35 2005 for GDAL by doxygen 1.3.6