LCOV - code coverage report
Current view: directory - gcore - gdal_priv.h (source / functions) Found Hit Coverage
Test: gdal_filtered.info Lines: 14 12 85.7 %
Date: 2010-01-09 Functions: 14 12 85.7 %

       1                 : /******************************************************************************
       2                 :  * $Id: gdal_priv.h 18501 2010-01-09 18:43:12Z mloskot $
       3                 :  *
       4                 :  * Name:     gdal_priv.h
       5                 :  * Project:  GDAL Core
       6                 :  * Purpose:  GDAL Core C++/Private declarations. 
       7                 :  * Author:   Frank Warmerdam, warmerdam@pobox.com
       8                 :  *
       9                 :  ******************************************************************************
      10                 :  * Copyright (c) 1998, Frank Warmerdam
      11                 :  *
      12                 :  * Permission is hereby granted, free of charge, to any person obtaining a
      13                 :  * copy of this software and associated documentation files (the "Software"),
      14                 :  * to deal in the Software without restriction, including without limitation
      15                 :  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
      16                 :  * and/or sell copies of the Software, and to permit persons to whom the
      17                 :  * Software is furnished to do so, subject to the following conditions:
      18                 :  *
      19                 :  * The above copyright notice and this permission notice shall be included
      20                 :  * in all copies or substantial portions of the Software.
      21                 :  *
      22                 :  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
      23                 :  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
      24                 :  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
      25                 :  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
      26                 :  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
      27                 :  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
      28                 :  * DEALINGS IN THE SOFTWARE.
      29                 :  ****************************************************************************/
      30                 : 
      31                 : #ifndef GDAL_PRIV_H_INCLUDED
      32                 : #define GDAL_PRIV_H_INCLUDED
      33                 : 
      34                 : /* -------------------------------------------------------------------- */
      35                 : /*      Predeclare various classes before pulling in gdal.h, the        */
      36                 : /*      public declarations.                                            */
      37                 : /* -------------------------------------------------------------------- */
      38                 : class GDALMajorObject;
      39                 : class GDALDataset;
      40                 : class GDALRasterBand;
      41                 : class GDALDriver;
      42                 : class GDALRasterAttributeTable;
      43                 : class GDALProxyDataset;
      44                 : class GDALProxyRasterBand;
      45                 : 
      46                 : /* -------------------------------------------------------------------- */
      47                 : /*      Pull in the public declarations.  This gets the C apis, and     */
      48                 : /*      also various constants.  However, we will still get to          */
      49                 : /*      provide the real class definitions for the GDAL classes.        */
      50                 : /* -------------------------------------------------------------------- */
      51                 : 
      52                 : #include "gdal.h"
      53                 : #include "gdal_frmts.h"
      54                 : #include "cpl_vsi.h"
      55                 : #include "cpl_conv.h"
      56                 : #include "cpl_string.h"
      57                 : #include "cpl_minixml.h"
      58                 : #include <vector>
      59                 : 
      60                 : #define GMO_VALID                0x0001
      61                 : #define GMO_IGNORE_UNIMPLEMENTED 0x0002
      62                 : #define GMO_SUPPORT_MD           0x0004
      63                 : #define GMO_SUPPORT_MDMD         0x0008
      64                 : #define GMO_MD_DIRTY             0x0010
      65                 : #define GMO_PAM_CLASS            0x0020
      66                 : 
      67                 : /************************************************************************/
      68                 : /*                       GDALMultiDomainMetadata                        */
      69                 : /************************************************************************/
      70                 : 
      71                 : class CPL_DLL GDALMultiDomainMetadata
      72                 : {
      73                 : private:
      74                 :     char **papszDomainList;
      75                 :     char ***papapszMetadataLists;
      76                 : 
      77                 : public:
      78                 :     GDALMultiDomainMetadata();
      79                 :     ~GDALMultiDomainMetadata();
      80                 : 
      81                 :     int         XMLInit( CPLXMLNode *psMetadata, int bMerge );
      82                 :     CPLXMLNode  *Serialize();
      83                 : 
      84          401314 :     char      **GetDomainList() { return papszDomainList; }
      85                 : 
      86                 :     char      **GetMetadata( const char * pszDomain = "" );
      87                 :     CPLErr      SetMetadata( char ** papszMetadata,
      88                 :                              const char * pszDomain = "" );
      89                 :     const char *GetMetadataItem( const char * pszName,
      90                 :                                  const char * pszDomain = "" );
      91                 :     CPLErr      SetMetadataItem( const char * pszName,
      92                 :                                  const char * pszValue,
      93                 :                                  const char * pszDomain = "" );
      94                 : 
      95                 :     void        Clear();
      96                 : };
      97                 : 
      98                 : /* ******************************************************************** */
      99                 : /*                           GDALMajorObject                            */
     100                 : /*                                                                      */
     101                 : /*      Base class providing metadata, description and other            */
     102                 : /*      services shared by major objects.                               */
     103                 : /* ******************************************************************** */
     104                 : 
     105                 : //! Object with metadata.
     106                 : 
     107                 : class CPL_DLL GDALMajorObject
     108                 : {
     109                 :   protected:
     110                 :     int                 nFlags; // GMO_* flags. 
     111                 :     CPLString           sDescription;
     112                 :     GDALMultiDomainMetadata oMDMD;
     113                 :     
     114                 :   public:
     115                 :                         GDALMajorObject();
     116                 :     virtual            ~GDALMajorObject();
     117                 : 
     118                 :     int                 GetMOFlags();
     119                 :     void                SetMOFlags(int nFlags);
     120                 :                         
     121                 :     virtual const char *GetDescription() const;
     122                 :     virtual void        SetDescription( const char * );
     123                 : 
     124                 :     virtual char      **GetMetadata( const char * pszDomain = "" );
     125                 :     virtual CPLErr      SetMetadata( char ** papszMetadata,
     126                 :                                      const char * pszDomain = "" );
     127                 :     virtual const char *GetMetadataItem( const char * pszName,
     128                 :                                          const char * pszDomain = "" );
     129                 :     virtual CPLErr      SetMetadataItem( const char * pszName,
     130                 :                                          const char * pszValue,
     131                 :                                          const char * pszDomain = "" );
     132                 : };
     133                 : 
     134                 : /* ******************************************************************** */
     135                 : /*                         GDALDefaultOverviews                         */
     136                 : /* ******************************************************************** */
     137                 : class CPL_DLL GDALDefaultOverviews
     138                 : {
     139                 :     friend class GDALDataset;
     140                 : 
     141                 :     GDALDataset *poDS;
     142                 :     GDALDataset *poODS;
     143                 :     
     144                 :     CPLString   osOvrFilename;
     145                 : 
     146                 :     int         bOvrIsAux;
     147                 : 
     148                 :     int         bCheckedForMask;
     149                 :     int         bOwnMaskDS;
     150                 :     GDALDataset *poMaskDS;
     151                 : 
     152                 :     // for "overview datasets" we record base level info so we can 
     153                 :     // find our way back to get overview masks.
     154                 :     GDALDataset *poBaseDS;
     155                 : 
     156                 :     // Stuff for deferred initialize/overviewscans...
     157                 :     bool        bCheckedForOverviews;
     158                 :     void        OverviewScan();
     159                 :     char       *pszInitName;
     160                 :     int         bInitNameIsOVR;
     161                 :     char      **papszInitSiblingFiles;
     162                 : 
     163                 :   public:
     164                 :                GDALDefaultOverviews();
     165                 :                ~GDALDefaultOverviews();
     166                 : 
     167                 :     void       Initialize( GDALDataset *poDS, const char *pszName = NULL, 
     168                 :                            char **papszSiblingFiles = NULL,
     169                 :                            int bNameIsOVR = FALSE );
     170                 : 
     171                 :     int        IsInitialized();
     172                 : 
     173                 :     // Overview Related
     174                 : 
     175                 :     int        GetOverviewCount(int);
     176                 :     GDALRasterBand *GetOverview(int,int);
     177                 : 
     178                 :     CPLErr     BuildOverviews( const char * pszBasename,
     179                 :                                const char * pszResampling, 
     180                 :                                int nOverviews, int * panOverviewList,
     181                 :                                int nBands, int * panBandList,
     182                 :                                GDALProgressFunc pfnProgress,
     183                 :                                void *pProgressData );
     184                 : 
     185                 :     CPLErr     BuildOverviewsSubDataset( const char * pszPhysicalFile,
     186                 :                                          const char * pszResampling, 
     187                 :                                          int nOverviews, int * panOverviewList,
     188                 :                                          int nBands, int * panBandList,
     189                 :                                          GDALProgressFunc pfnProgress,
     190                 :                                          void *pProgressData );
     191                 : 
     192                 :     CPLErr     CleanOverviews();
     193                 : 
     194                 :     // Mask Related
     195                 : 
     196                 :     CPLErr     CreateMaskBand( int nFlags, int nBand = -1 );
     197                 :     GDALRasterBand *GetMaskBand( int nBand );
     198                 :     int        GetMaskFlags( int nBand );
     199                 : 
     200                 :     int        HaveMaskFile( char **papszSiblings = NULL, 
     201                 :                              const char *pszBasename = NULL );
     202                 : 
     203                 : };
     204                 : 
     205                 : /* ******************************************************************** */
     206                 : /*                             GDALDataset                              */
     207                 : /* ******************************************************************** */
     208                 : 
     209                 : //! A set of associated raster bands, usually from one file.
     210                 : 
     211                 : class CPL_DLL GDALDataset : public GDALMajorObject
     212                 : {
     213                 :     friend GDALDatasetH CPL_STDCALL GDALOpen( const char *, GDALAccess);
     214                 :     friend GDALDatasetH CPL_STDCALL GDALOpenShared( const char *, GDALAccess);
     215                 :     friend class GDALDriver;
     216                 :     friend class GDALDefaultOverviews;
     217                 :     friend class GDALProxyDataset;
     218                 : 
     219                 :   protected:
     220                 :     GDALDriver  *poDriver;
     221                 :     GDALAccess  eAccess;
     222                 :     
     223                 :     // Stored raster information.
     224                 :     int         nRasterXSize;
     225                 :     int         nRasterYSize;
     226                 :     int         nBands;
     227                 :     GDALRasterBand **papoBands;
     228                 : 
     229                 :     int         bForceCachedIO;
     230                 : 
     231                 :     int         nRefCount;
     232                 :     int         bShared;
     233                 : 
     234                 :                 GDALDataset(void);
     235                 :     void        RasterInitialize( int, int );
     236                 :     void        SetBand( int, GDALRasterBand * );
     237                 : 
     238                 :     GDALDefaultOverviews oOvManager;
     239                 :     
     240                 :     virtual CPLErr IBuildOverviews( const char *, int, int *,
     241                 :                                     int, int *, GDALProgressFunc, void * );
     242                 :     
     243                 :     virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
     244                 :                               void *, int, int, GDALDataType,
     245                 :                               int, int *, int, int, int );
     246                 : 
     247                 :     CPLErr BlockBasedRasterIO( GDALRWFlag, int, int, int, int,
     248                 :                                void *, int, int, GDALDataType,
     249                 :                                int, int *, int, int, int );
     250                 :     void   BlockBasedFlushCache();
     251                 : 
     252                 :     friend class GDALRasterBand;
     253                 :     
     254                 :   public:
     255                 :     virtual     ~GDALDataset();
     256                 : 
     257                 :     int         GetRasterXSize( void );
     258                 :     int         GetRasterYSize( void );
     259                 :     int         GetRasterCount( void );
     260                 :     GDALRasterBand *GetRasterBand( int );
     261                 : 
     262                 :     virtual void FlushCache(void);
     263                 : 
     264                 :     virtual const char *GetProjectionRef(void);
     265                 :     virtual CPLErr SetProjection( const char * );
     266                 : 
     267                 :     virtual CPLErr GetGeoTransform( double * );
     268                 :     virtual CPLErr SetGeoTransform( double * );
     269                 : 
     270                 :     virtual CPLErr        AddBand( GDALDataType eType, 
     271                 :                                    char **papszOptions=NULL );
     272                 : 
     273                 :     virtual void *GetInternalHandle( const char * );
     274                 :     virtual GDALDriver *GetDriver(void);
     275                 :     virtual char      **GetFileList(void);
     276                 : 
     277                 :     virtual int    GetGCPCount();
     278                 :     virtual const char *GetGCPProjection();
     279                 :     virtual const GDAL_GCP *GetGCPs();
     280                 :     virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
     281                 :                             const char *pszGCPProjection );
     282                 : 
     283                 :     virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
     284                 :                                int nBufXSize, int nBufYSize, 
     285                 :                                GDALDataType eDT, 
     286                 :                                int nBandCount, int *panBandList,
     287                 :                                char **papszOptions );
     288                 : 
     289                 :     virtual CPLErr          CreateMaskBand( int nFlags );
     290                 : 
     291                 :     CPLErr      RasterIO( GDALRWFlag, int, int, int, int,
     292                 :                           void *, int, int, GDALDataType,
     293                 :                           int, int *, int, int, int );
     294                 : 
     295                 :     int           Reference();
     296                 :     int           Dereference();
     297           17357 :     GDALAccess    GetAccess() { return eAccess; }
     298                 : 
     299                 :     int           GetShared();
     300                 :     void          MarkAsShared();
     301                 : 
     302                 :     static GDALDataset **GetOpenDatasets( int *pnDatasetCount );
     303                 : 
     304                 :     CPLErr BuildOverviews( const char *, int, int *,
     305                 :                            int, int *, GDALProgressFunc, void * );
     306                 : };
     307                 : 
     308                 : /* ******************************************************************** */
     309                 : /*                           GDALRasterBlock                            */
     310                 : /* ******************************************************************** */
     311                 : 
     312                 : //! A single raster block in the block cache.
     313                 : 
     314                 : class CPL_DLL GDALRasterBlock
     315                 : {
     316                 :     GDALDataType        eType;
     317                 :     
     318                 :     int                 bDirty;
     319                 :     int                 nLockCount;
     320                 : 
     321                 :     int                 nXOff;
     322                 :     int                 nYOff;
     323                 :        
     324                 :     int                 nXSize;
     325                 :     int                 nYSize;
     326                 :     
     327                 :     void                *pData;
     328                 : 
     329                 :     GDALRasterBand      *poBand;
     330                 :     
     331                 :     GDALRasterBlock     *poNext;
     332                 :     GDALRasterBlock     *poPrevious;
     333                 : 
     334                 :   public:
     335                 :                 GDALRasterBlock( GDALRasterBand *, int, int );
     336                 :     virtual     ~GDALRasterBlock();
     337                 : 
     338                 :     CPLErr      Internalize( void );
     339                 :     void        Touch( void );      
     340                 :     void        MarkDirty( void );  
     341                 :     void        MarkClean( void );
     342         4329148 :     void        AddLock( void ) { nLockCount++; }
     343         4329148 :     void        DropLock( void ) { nLockCount--; }
     344                 :     void        Detach();
     345                 : 
     346                 :     CPLErr      Write();
     347                 : 
     348             174 :     GDALDataType GetDataType() { return eType; }
     349             428 :     int         GetXOff() { return nXOff; }
     350             428 :     int         GetYOff() { return nYOff; }
     351               0 :     int         GetXSize() { return nXSize; }
     352               0 :     int         GetYSize() { return nYSize; }
     353          291099 :     int         GetDirty() { return bDirty; }
     354             428 :     int         GetLockCount() { return nLockCount; }
     355                 : 
     356         4574980 :     void        *GetDataRef( void ) { return pData; }
     357                 : 
     358                 :     /// @brief Accessor to source GDALRasterBand object.
     359                 :     /// @return source raster band of the raster block.
     360             428 :     GDALRasterBand *GetBand() { return poBand; }
     361                 : 
     362                 :     static int  FlushCacheBlock();
     363                 :     static void Verify();
     364                 : 
     365                 :     static int  SafeLockBlock( GDALRasterBlock ** );
     366                 : };
     367                 : 
     368                 : /* ******************************************************************** */
     369                 : /*                             GDALColorTable                           */
     370                 : /* ******************************************************************** */
     371                 : 
     372                 : /*! A color table / palette. */
     373                 : 
     374                 : class CPL_DLL GDALColorTable
     375            1649 : {
     376                 :     GDALPaletteInterp eInterp;
     377                 : 
     378                 :     std::vector<GDALColorEntry> aoEntries;
     379                 : 
     380                 : public:
     381                 :                 GDALColorTable( GDALPaletteInterp = GPI_RGB );
     382                 :                 ~GDALColorTable();
     383                 : 
     384                 :     GDALColorTable *Clone() const;
     385                 : 
     386                 :     GDALPaletteInterp GetPaletteInterpretation() const;
     387                 : 
     388                 :     int           GetColorEntryCount() const;
     389                 :     const GDALColorEntry *GetColorEntry( int ) const;
     390                 :     int           GetColorEntryAsRGB( int, GDALColorEntry * ) const;
     391                 :     void          SetColorEntry( int, const GDALColorEntry * );
     392                 :     int           CreateColorRamp( int, const GDALColorEntry * ,
     393                 :                                    int, const GDALColorEntry * );
     394                 : };
     395                 : 
     396                 : /* ******************************************************************** */
     397                 : /*                            GDALRasterBand                            */
     398                 : /* ******************************************************************** */
     399                 : 
     400                 : //! A single raster band (or channel).
     401                 : 
     402                 : class CPL_DLL GDALRasterBand : public GDALMajorObject
     403                 : {
     404                 :   protected:
     405                 :     GDALDataset *poDS;
     406                 :     int         nBand; /* 1 based */
     407                 : 
     408                 :     int         nRasterXSize;
     409                 :     int         nRasterYSize;
     410                 :     
     411                 :     GDALDataType eDataType;
     412                 :     GDALAccess  eAccess;
     413                 : 
     414                 :     /* stuff related to blocking, and raster cache */
     415                 :     int         nBlockXSize;
     416                 :     int         nBlockYSize;
     417                 :     int         nBlocksPerRow;
     418                 :     int         nBlocksPerColumn;
     419                 : 
     420                 :     int         bSubBlockingActive;
     421                 :     int         nSubBlocksPerRow;
     422                 :     int         nSubBlocksPerColumn;
     423                 :     GDALRasterBlock **papoBlocks;
     424                 : 
     425                 :     int         nBlockReads;
     426                 :     int         bForceCachedIO;
     427                 : 
     428                 :     GDALRasterBand *poMask;
     429                 :     bool        bOwnMask;
     430                 :     int         nMaskFlags;
     431                 : 
     432                 :     friend class GDALDataset;
     433                 :     friend class GDALRasterBlock;
     434                 :     friend class GDALProxyRasterBand;
     435                 : 
     436                 :   protected:
     437                 :     virtual CPLErr IReadBlock( int, int, void * ) = 0;
     438                 :     virtual CPLErr IWriteBlock( int, int, void * );
     439                 :     virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
     440                 :                               void *, int, int, GDALDataType,
     441                 :                               int, int );
     442                 :     CPLErr         OverviewRasterIO( GDALRWFlag, int, int, int, int,
     443                 :                                      void *, int, int, GDALDataType,
     444                 :                                      int, int );
     445                 : 
     446                 :     int            InitBlockInfo();
     447                 : 
     448                 :     CPLErr         AdoptBlock( int, int, GDALRasterBlock * );
     449                 :     GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff, int nYBlockYOff );
     450                 : 
     451                 :   public:
     452                 :                 GDALRasterBand();
     453                 :                 
     454                 :     virtual     ~GDALRasterBand();
     455                 : 
     456                 :     int         GetXSize();
     457                 :     int         GetYSize();
     458                 :     int         GetBand();
     459                 :     GDALDataset*GetDataset();
     460                 : 
     461                 :     GDALDataType GetRasterDataType( void );
     462                 :     void        GetBlockSize( int *, int * );
     463                 :     GDALAccess  GetAccess();
     464                 :     
     465                 :     CPLErr      RasterIO( GDALRWFlag, int, int, int, int,
     466                 :                           void *, int, int, GDALDataType,
     467                 :                           int, int );
     468                 :     CPLErr      ReadBlock( int, int, void * );
     469                 : 
     470                 :     CPLErr      WriteBlock( int, int, void * );
     471                 : 
     472                 :     GDALRasterBlock *GetLockedBlockRef( int nXBlockOff, int nYBlockOff, 
     473                 :                                         int bJustInitialize = FALSE );
     474                 :     CPLErr      FlushBlock( int = -1, int = -1 );
     475                 : 
     476                 :     unsigned char*  GetIndexColorTranslationTo(/* const */ GDALRasterBand* poReferenceBand,
     477                 :                                                unsigned char* pTranslationTable = NULL,
     478                 :                                                int* pApproximateMatching = NULL);
     479                 : 
     480                 :     // New OpengIS CV_SampleDimension stuff.
     481                 : 
     482                 :     virtual CPLErr FlushCache();
     483                 :     virtual char **GetCategoryNames();
     484                 :     virtual double GetNoDataValue( int *pbSuccess = NULL );
     485                 :     virtual double GetMinimum( int *pbSuccess = NULL );
     486                 :     virtual double GetMaximum(int *pbSuccess = NULL );
     487                 :     virtual double GetOffset( int *pbSuccess = NULL );
     488                 :     virtual double GetScale( int *pbSuccess = NULL );
     489                 :     virtual const char *GetUnitType();
     490                 :     virtual GDALColorInterp GetColorInterpretation();
     491                 :     virtual GDALColorTable *GetColorTable();
     492                 :     virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0);
     493                 : 
     494                 :     virtual CPLErr SetCategoryNames( char ** );
     495                 :     virtual CPLErr SetNoDataValue( double );
     496                 :     virtual CPLErr SetColorTable( GDALColorTable * ); 
     497                 :     virtual CPLErr SetColorInterpretation( GDALColorInterp );
     498                 :     virtual CPLErr SetOffset( double );
     499                 :     virtual CPLErr SetScale( double );
     500                 :     virtual CPLErr SetUnitType( const char * );
     501                 : 
     502                 :     virtual CPLErr GetStatistics( int bApproxOK, int bForce,
     503                 :                                   double *pdfMin, double *pdfMax, 
     504                 :                                   double *pdfMean, double *padfStdDev );
     505                 :     virtual CPLErr ComputeStatistics( int bApproxOK, 
     506                 :                                       double *pdfMin, double *pdfMax, 
     507                 :                                       double *pdfMean, double *pdfStdDev,
     508                 :                                       GDALProgressFunc, void *pProgressData );
     509                 :     virtual CPLErr SetStatistics( double dfMin, double dfMax, 
     510                 :                                   double dfMean, double dfStdDev );
     511                 :     virtual CPLErr ComputeRasterMinMax( int, double* );
     512                 : 
     513                 :     virtual int HasArbitraryOverviews();
     514                 :     virtual int GetOverviewCount();
     515                 :     virtual GDALRasterBand *GetOverview(int);
     516                 :     virtual GDALRasterBand *GetRasterSampleOverview( int );
     517                 :     virtual CPLErr BuildOverviews( const char *, int, int *,
     518                 :                                    GDALProgressFunc, void * );
     519                 : 
     520                 :     virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
     521                 :                                int nBufXSize, int nBufYSize, 
     522                 :                                GDALDataType eDT, char **papszOptions );
     523                 : 
     524                 :     virtual CPLErr  GetHistogram( double dfMin, double dfMax,
     525                 :                           int nBuckets, int * panHistogram,
     526                 :                           int bIncludeOutOfRange, int bApproxOK,
     527                 :                           GDALProgressFunc, void *pProgressData );
     528                 : 
     529                 :     virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
     530                 :                                         int *pnBuckets, int ** ppanHistogram,
     531                 :                                         int bForce,
     532                 :                                         GDALProgressFunc, void *pProgressData);
     533                 :     virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
     534                 :                                         int nBuckets, int *panHistogram );
     535                 : 
     536                 :     virtual const GDALRasterAttributeTable *GetDefaultRAT();
     537                 :     virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * );
     538                 : 
     539                 :     virtual GDALRasterBand *GetMaskBand();
     540                 :     virtual int             GetMaskFlags();
     541                 :     virtual CPLErr          CreateMaskBand( int nFlags );
     542                 : };
     543                 : 
     544                 : /* ******************************************************************** */
     545                 : /*                         GDALAllValidMaskBand                         */
     546                 : /* ******************************************************************** */
     547                 : 
     548                 : class CPL_DLL GDALAllValidMaskBand : public GDALRasterBand
     549                 : {
     550                 :   protected:
     551                 :     virtual CPLErr IReadBlock( int, int, void * );
     552                 : 
     553                 :   public:
     554                 :                 GDALAllValidMaskBand( GDALRasterBand * );
     555                 :     virtual     ~GDALAllValidMaskBand();
     556                 : 
     557                 :     virtual GDALRasterBand *GetMaskBand();
     558                 :     virtual int             GetMaskFlags();
     559                 : };
     560                 : 
     561                 : /* ******************************************************************** */
     562                 : /*                         GDALNoDataMaskBand                           */
     563                 : /* ******************************************************************** */
     564                 : 
     565                 : class CPL_DLL GDALNoDataMaskBand : public GDALRasterBand
     566                 : {
     567                 :     double          dfNoDataValue;
     568                 :     GDALRasterBand *poParent;
     569                 : 
     570                 :   protected:
     571                 :     virtual CPLErr IReadBlock( int, int, void * );
     572                 : 
     573                 :   public:
     574                 :                 GDALNoDataMaskBand( GDALRasterBand * );
     575                 :     virtual     ~GDALNoDataMaskBand();
     576                 : };
     577                 : 
     578                 : /* ******************************************************************** */
     579                 : /*                  GDALNoDataValuesMaskBand                            */
     580                 : /* ******************************************************************** */
     581                 : 
     582                 : class CPL_DLL GDALNoDataValuesMaskBand : public GDALRasterBand
     583                 : {
     584                 :     double      *padfNodataValues;
     585                 : 
     586                 :   protected:
     587                 :     virtual CPLErr IReadBlock( int, int, void * );
     588                 : 
     589                 :   public:
     590                 :                 GDALNoDataValuesMaskBand( GDALDataset * );
     591                 :     virtual     ~GDALNoDataValuesMaskBand();
     592                 : };
     593                 : 
     594                 : /* ******************************************************************** */
     595                 : /*                             GDALOpenInfo                             */
     596                 : /*                                                                      */
     597                 : /*      Structure of data about dataset for open functions.             */
     598                 : /* ******************************************************************** */
     599                 : 
     600                 : class CPL_DLL GDALOpenInfo
     601                 : {
     602                 :   public:
     603                 :                 GDALOpenInfo( const char * pszFile, GDALAccess eAccessIn,
     604                 :                               char **papszSiblingFiles = NULL );
     605                 :                 ~GDALOpenInfo( void );
     606                 :     
     607                 :     char        *pszFilename;
     608                 :     char        **papszSiblingFiles;
     609                 : 
     610                 :     GDALAccess  eAccess;
     611                 : 
     612                 :     int         bStatOK;
     613                 :     int         bIsDirectory;
     614                 : 
     615                 :     FILE        *fp;
     616                 : 
     617                 :     int         nHeaderBytes;
     618                 :     GByte       *pabyHeader;
     619                 : 
     620                 : };
     621                 : 
     622                 : /* ******************************************************************** */
     623                 : /*                              GDALDriver                              */
     624                 : /* ******************************************************************** */
     625                 : 
     626                 : 
     627                 : /**
     628                 :  * \brief Format specific driver.
     629                 :  *
     630                 :  * An instance of this class is created for each supported format, and
     631                 :  * manages information about the format.
     632                 :  * 
     633                 :  * This roughly corresponds to a file format, though some          
     634                 :  * drivers may be gateways to many formats through a secondary     
     635                 :  * multi-library.                                                  
     636                 :  */
     637                 : 
     638                 : class CPL_DLL GDALDriver : public GDALMajorObject
     639                 : {
     640                 :   public:
     641                 :                         GDALDriver();
     642                 :                         ~GDALDriver();
     643                 : 
     644                 : /* -------------------------------------------------------------------- */
     645                 : /*      Public C++ methods.                                             */
     646                 : /* -------------------------------------------------------------------- */
     647                 :     GDALDataset         *Create( const char * pszName,
     648                 :                                  int nXSize, int nYSize, int nBands,
     649                 :                                  GDALDataType eType, char ** papszOptions );
     650                 : 
     651                 :     CPLErr              Delete( const char * pszName );
     652                 :     CPLErr              Rename( const char * pszNewName,
     653                 :                                 const char * pszOldName );
     654                 :     CPLErr              CopyFiles( const char * pszNewName,
     655                 :                                    const char * pszOldName );
     656                 : 
     657                 :     GDALDataset         *CreateCopy( const char *, GDALDataset *, 
     658                 :                                      int, char **,
     659                 :                                      GDALProgressFunc pfnProgress, 
     660                 :                                      void * pProgressData );
     661                 :     
     662                 : /* -------------------------------------------------------------------- */
     663                 : /*      The following are semiprivate, not intended to be accessed      */
     664                 : /*      by anyone but the formats instantiating and populating the      */
     665                 : /*      drivers.                                                        */
     666                 : /* -------------------------------------------------------------------- */
     667                 :     GDALDataset         *(*pfnOpen)( GDALOpenInfo * );
     668                 : 
     669                 :     GDALDataset         *(*pfnCreate)( const char * pszName,
     670                 :                                        int nXSize, int nYSize, int nBands,
     671                 :                                        GDALDataType eType,
     672                 :                                        char ** papszOptions );
     673                 : 
     674                 :     CPLErr              (*pfnDelete)( const char * pszName );
     675                 : 
     676                 :     GDALDataset         *(*pfnCreateCopy)( const char *, GDALDataset *, 
     677                 :                                            int, char **,
     678                 :                                            GDALProgressFunc pfnProgress, 
     679                 :                                            void * pProgressData );
     680                 : 
     681                 :     void                *pDriverData;
     682                 : 
     683                 :     void                (*pfnUnloadDriver)(GDALDriver *);
     684                 : 
     685                 :     int                 (*pfnIdentify)( GDALOpenInfo * );
     686                 : 
     687                 :     CPLErr              (*pfnRename)( const char * pszNewName,
     688                 :                                       const char * pszOldName );
     689                 :     CPLErr              (*pfnCopyFiles)( const char * pszNewName,
     690                 :                                          const char * pszOldName );
     691                 : 
     692                 : /* -------------------------------------------------------------------- */
     693                 : /*      Helper methods.                                                 */
     694                 : /* -------------------------------------------------------------------- */
     695                 :     GDALDataset         *DefaultCreateCopy( const char *, GDALDataset *, 
     696                 :                                             int, char **,
     697                 :                                             GDALProgressFunc pfnProgress, 
     698                 :                                             void * pProgressData );
     699                 :     static CPLErr        DefaultCopyMasks( GDALDataset *poSrcDS, 
     700                 :                                            GDALDataset *poDstDS, 
     701                 :                                            int bStrict );
     702                 :     static CPLErr       QuietDelete( const char * pszName );
     703                 : };
     704                 : 
     705                 : /* ******************************************************************** */
     706                 : /*                          GDALDriverManager                           */
     707                 : /* ******************************************************************** */
     708                 : 
     709                 : /**
     710                 :  * Class for managing the registration of file format drivers.
     711                 :  *
     712                 :  * Use GetGDALDriverManager() to fetch the global singleton instance of
     713                 :  * this class.
     714                 :  */
     715                 : 
     716                 : class CPL_DLL GDALDriverManager : public GDALMajorObject
     717                 : {
     718                 :     int         nDrivers;
     719                 :     GDALDriver  **papoDrivers;
     720                 : 
     721                 :     char        *pszHome;
     722                 :     
     723                 :  public:
     724                 :                 GDALDriverManager();
     725                 :                 ~GDALDriverManager();
     726                 :                 
     727                 :     int         GetDriverCount( void );
     728                 :     GDALDriver  *GetDriver( int );
     729                 :     GDALDriver  *GetDriverByName( const char * );
     730                 : 
     731                 :     int         RegisterDriver( GDALDriver * );
     732                 :     void        MoveDriver( GDALDriver *, int );
     733                 :     void        DeregisterDriver( GDALDriver * );
     734                 : 
     735                 :     void        AutoLoadDrivers();
     736                 :     void        AutoSkipDrivers();
     737                 : 
     738                 :     const char *GetHome();
     739                 :     void        SetHome( const char * );
     740                 : };
     741                 : 
     742                 : /* Not a public symbol for the moment */
     743                 : CPLErr 
     744                 : GDALRegenerateOverviewsMultiBand(int nBands, GDALRasterBand** papoSrcBands,
     745                 :                                  int nOverviews,
     746                 :                                  GDALRasterBand*** papapoOverviewBands,
     747                 :                                  const char * pszResampling, 
     748                 :                                  GDALProgressFunc pfnProgress, void * pProgressData );
     749                 : 
     750                 : CPL_C_START
     751                 : GDALDriverManager CPL_DLL * GetGDALDriverManager( void );
     752                 : CPL_C_END
     753                 : 
     754                 : /* ==================================================================== */
     755                 : /*      An assortment of overview related stuff.                        */
     756                 : /* ==================================================================== */
     757                 : 
     758                 : CPL_C_START
     759                 : 
     760                 : #ifndef WIN32CE
     761                 : 
     762                 : CPLErr CPL_DLL
     763                 : HFAAuxBuildOverviews( const char *pszOvrFilename, GDALDataset *poParentDS,
     764                 :                       GDALDataset **ppoDS,
     765                 :                       int nBands, int *panBandList,
     766                 :                       int nNewOverviews, int *panNewOverviewList, 
     767                 :                       const char *pszResampling, 
     768                 :                       GDALProgressFunc pfnProgress, 
     769                 :                       void *pProgressData );
     770                 : 
     771                 : #endif /* WIN32CE */
     772                 : 
     773                 : CPLErr CPL_DLL 
     774                 : GTIFFBuildOverviews( const char * pszFilename,
     775                 :                      int nBands, GDALRasterBand **papoBandList, 
     776                 :                      int nOverviews, int * panOverviewList,
     777                 :                      const char * pszResampling, 
     778                 :                      GDALProgressFunc pfnProgress, void * pProgressData );
     779                 : 
     780                 : CPLErr CPL_DLL
     781                 : GDALDefaultBuildOverviews( GDALDataset *hSrcDS, const char * pszBasename,
     782                 :                            const char * pszResampling, 
     783                 :                            int nOverviews, int * panOverviewList,
     784                 :                            int nBands, int * panBandList,
     785                 :                            GDALProgressFunc pfnProgress, void * pProgressData);
     786                 :                            
     787                 : int CPL_DLL GDALBandGetBestOverviewLevel(GDALRasterBand* poBand,
     788                 :                                          int &nXOff, int &nYOff,
     789                 :                                          int &nXSize, int &nYSize,
     790                 :                                          int nBufXSize, int nBufYSize);
     791                 : 
     792                 : int CPL_DLL GDALOvLevelAdjust( int nOvLevel, int nXSize );
     793                 : 
     794                 : GDALDataset CPL_DLL *
     795                 : GDALFindAssociatedAuxFile( const char *pszBasefile, GDALAccess eAccess,
     796                 :                            GDALDataset *poDependentDS );
     797                 : 
     798                 : /* ==================================================================== */
     799                 : /*      Misc functions.                                                 */
     800                 : /* ==================================================================== */
     801                 : 
     802                 : CPLErr CPL_DLL GDALParseGMLCoverage( CPLXMLNode *psTree, 
     803                 :                                      int *pnXSize, int *pnYSize,
     804                 :                                      double *padfGeoTransform,
     805                 :                                      char **ppszProjection );
     806                 : 
     807                 : /* ==================================================================== */
     808                 : /*  Infrastructure to check that dataset characteristics are valid      */
     809                 : /* ==================================================================== */
     810                 : 
     811                 : int CPL_DLL GDALCheckDatasetDimensions( int nXSize, int nYSize );
     812                 : int CPL_DLL GDALCheckBandCount( int nBands, int bIsZeroAllowed );
     813                 : 
     814                 : CPL_C_END
     815                 : 
     816                 : #endif /* ndef GDAL_PRIV_H_INCLUDED */

Generated by: LCOV version 1.7