- Main Page
- Classes
- Files
- Related Pages

- File List
- File Members

# vrtdataset.h

    00001 /******************************************************************************
    00002  * $Id: vrtdataset.h,v 1.23 2006/09/09 04:18:36 fwarmerdam Exp $
    00003  *
    00004  * Project:  Virtual GDAL Datasets
    00005  * Purpose:  Declaration of virtual gdal dataset classes.
    00006  * Author:   Frank Warmerdam, warmerdam@pobox.com
    00007  *
    00008  ******************************************************************************
    00009  * Copyright (c) 2001, Frank Warmerdam <warmerdam@pobox.com>
    00010  *
    00011  * Permission is hereby granted, free of charge, to any person obtaining a
    00012  * copy of this software and associated documentation files (the "Software"),
    00013  * to deal in the Software without restriction, including without limitation
    00014  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
    00015  * and/or sell copies of the Software, and to permit persons to whom the
    00016  * Software is furnished to do so, subject to the following conditions:
    00017  *
    00018  * The above copyright notice and this permission notice shall be included
    00019  * in all copies or substantial portions of the Software.
    00020  *
    00021  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    00022  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00023  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    00024  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00025  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    00026  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    00027  * DEALINGS IN THE SOFTWARE.
    00028  ******************************************************************************
    00029  *
    00030  * $Log: vrtdataset.h,v $
    00031  * Revision 1.23  2006/09/09 04:18:36  fwarmerdam
    00032  * implement SetMetadataItem() support for sources
    00033  *
    00034  * Revision 1.22  2006/02/08 06:12:08  fwarmerdam
    00035  * Override SetMetadata methods so that metadata can be preserved.
    00036  * Support saving histograms in VRT per bug 1060.
    00037  *
    00038  * Revision 1.21  2005/10/28 16:59:51  pnagy
    00039  * Added VRTDerivedBand support
    00040  *
    00041  * Revision 1.20  2005/05/05 13:56:53  fwarmerdam
    00042  * include gdal_pam.h
    00043  *
    00044  * Revision 1.19  2005/04/07 17:27:33  fwarmerdam
    00045  * Default path in OpenXML to NULL.
    00046  *
    00047  * Revision 1.18  2004/08/12 08:24:26  warmerda
    00048  * added overview support
    00049  *
    00050  * Revision 1.17  2004/08/11 18:51:48  warmerda
    00051  * added warped dataset support
    00052  *
    00053  * Revision 1.16  2004/07/30 21:51:00  warmerda
    00054  * added support for VRTRawRasterBand
    00055  *
    00056  * Revision 1.15  2004/07/28 17:47:33  warmerda
    00057  * Disable VRTWarpedRasterBand for now.
    00058  *
    00059  * Revision 1.14  2004/07/28 16:56:02  warmerda
    00060  * added VRTSourcedRasterBand
    00061  *
    00062  * Revision 1.13  2004/04/15 18:54:38  warmerda
    00063  * added UnitType, Offset, Scale and CategoryNames support
    00064  *
    00065  * Revision 1.12  2004/03/16 18:34:35  warmerda
    00066  * added support for relativeToVRT attribute on SourceFilename
    00067  *
    00068  * Revision 1.11  2003/09/11 23:00:04  aamici
    00069  * add class constructors and destructors where needed in order to
    00070  * let the mingw/cygwin binutils produce sensible partially linked objet files
    00071  * with 'ld -r'.
    00072  *
    00073  * Revision 1.10  2003/08/07 17:11:21  warmerda
    00074  * added normalized flag for kernel based filters
    00075  *
    00076  * Revision 1.9  2003/07/17 20:30:24  warmerda
    00077  * Added custom VRTDriver and moved all the sources class declarations in here.
    00078  *
    00079  * Revision 1.8  2003/06/10 19:59:33  warmerda
    00080  * added new Func based source type for passthrough to a callback
    00081  *
    00082  * Revision 1.7  2003/03/13 20:38:30  dron
    00083  * bNoDataValueSet added to VRTRasterBand class.
    00084  *
    00085  * Revision 1.6  2002/11/30 16:55:49  warmerda
    00086  * added OpenXML method
    00087  *
    00088  * Revision 1.5  2002/11/24 04:29:02  warmerda
    00089  * Substantially rewrote VRTSimpleSource.  Now VRTSource is base class, and
    00090  * sources do their own SerializeToXML(), and XMLInit().  New VRTComplexSource
    00091  * supports scaling and nodata values.
    00092  *
    00093  * Revision 1.4  2002/05/29 18:13:44  warmerda
    00094  * added nodata handling for averager
    00095  *
    00096  * Revision 1.3  2002/05/29 16:06:05  warmerda
    00097  * complete detailed band metadata
    00098  *
    00099  * Revision 1.2  2001/11/18 15:46:45  warmerda
    00100  * added SRS and GeoTransform
    00101  *
    00102  * Revision 1.1  2001/11/16 21:14:31  warmerda
    00103  * New
    00104  *
    00105  */
    00106
    00107 #ifndef VIRTUALDATASET_H_INCLUDED
    00108 #define VIRTUALDATASET_H_INCLUDED
    00109
    00110 #include "gdal_priv.h"
    00111 #include "gdal_pam.h"
    00112 #include "cpl_minixml.h"
    00113
    00114 CPL_C_START
    00115 void    GDALRegister_VRT(void);
    00116 typedef CPLErr
    00117 (*VRTImageReadFunc)( void *hCBData,
    00118                      int nXOff, int nYOff, int nXSize, int nYSize,
    00119                      void *pData );
    00120 CPL_C_END
    00121
    00122 int VRTApplyMetadata( CPLXMLNode *, GDALMajorObject * );
    00123 CPLXMLNode *VRTSerializeMetadata( GDALMajorObject * );
    00124
    00125 /************************************************************************/
    00126 /*                              VRTSource                               */
    00127 /************************************************************************/
    00128
    00129 class VRTSource
    00130 {
    00131 public:
    00132     virtual ~VRTSource();
    00133
    00134     virtual CPLErr  RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
    00135                               void *pData, int nBufXSize, int nBufYSize,
    00136                               GDALDataType eBufType,
    00137                               int nPixelSpace, int nLineSpace ) = 0;
    00138
    00139     virtual CPLErr  XMLInit( CPLXMLNode *psTree, const char * ) = 0;
    00140     virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) = 0;
    00141 };
    00142
    00143 typedef VRTSource *(*VRTSourceParser)(CPLXMLNode *, const char *);
    00144
    00145 VRTSource *VRTParseCoreSources( CPLXMLNode *psTree, const char * );
    00146 VRTSource *VRTParseFilterSources( CPLXMLNode *psTree, const char * );
    00147
    00148 /************************************************************************/
    00149 /*                              VRTDataset                              */
    00150 /************************************************************************/
    00151
    00152 class CPL_DLL VRTDataset : public GDALDataset
    00153 {
    00154     char           *pszProjection;
    00155
    00156     int            bGeoTransformSet;
    00157     double         adfGeoTransform[6];
    00158
    00159     int           nGCPCount;
    00160     GDAL_GCP      *pasGCPList;
    00161     char          *pszGCPProjection;
    00162
    00163     int            bNeedsFlush;
    00164
    00165     char          *pszVRTPath;
    00166
    00167   public:
    00168                  VRTDataset(int nXSize, int nYSize);
    00169                 ~VRTDataset();
    00170
    00171     void          SetNeedsFlush() { bNeedsFlush = TRUE; }
    00172     virtual void  FlushCache();
    00173
    00174     virtual const char *GetProjectionRef(void);
    00175     virtual CPLErr SetProjection( const char * );
    00176     virtual CPLErr GetGeoTransform( double * );
    00177     virtual CPLErr SetGeoTransform( double * );
    00178
    00179     virtual CPLErr SetMetadata( char **papszMD, const char *pszDomain = "" );
    00180     virtual CPLErr SetMetadataItem( const char *pszName, const char *pszValue,
    00181                                     const char *pszDomain = "" );
    00182
    00183     virtual int    GetGCPCount();
    00184     virtual const char *GetGCPProjection();
    00185     virtual const GDAL_GCP *GetGCPs();
    00186     virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
    00187                             const char *pszGCPProjection );
    00188
    00189     virtual CPLErr AddBand( GDALDataType eType,
    00190                             char **papszOptions=NULL );
    00191
    00192     virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath);
    00193     virtual CPLErr      XMLInit( CPLXMLNode *, const char * );
    00194
    00195     static GDALDataset *Open( GDALOpenInfo * );
    00196     static GDALDataset *OpenXML( const char *, const char * = NULL );
    00197     static GDALDataset *Create( const char * pszName,
    00198                                 int nXSize, int nYSize, int nBands,
    00199                                 GDALDataType eType, char ** papszOptions );
    00200 };
    00201
    00202 /************************************************************************/
    00203 /*                           VRTWarpedDataset                           */
    00204 /************************************************************************/
    00205
    00206 class GDALWarpOperation;
    00207 class VRTWarpedRasterBand;
    00208
    00209 class CPL_DLL VRTWarpedDataset : public VRTDataset
    00210 {
    00211     int               nBlockXSize;
    00212     int               nBlockYSize;
    00213     GDALWarpOperation *poWarper;
    00214
    00215 public:
    00216     int               nOverviewCount;
    00217     VRTWarpedDataset  **papoOverviews;
    00218
    00219 public:
    00220                       VRTWarpedDataset( int nXSize, int nYSize );
    00221                      ~VRTWarpedDataset();
    00222
    00223     CPLErr            Initialize( /* GDALWarpOptions */ void * );
    00224
    00225     virtual CPLErr IBuildOverviews( const char *, int, int *,
    00226                                     int, int *, GDALProgressFunc, void * );
    00227
    00228     virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
    00229     virtual CPLErr    XMLInit( CPLXMLNode *, const char * );
    00230
    00231     virtual CPLErr AddBand( GDALDataType eType,
    00232                             char **papszOptions=NULL );
    00233
    00234     CPLErr            ProcessBlock( int iBlockX, int iBlockY );
    00235
    00236     void              GetBlockSize( int *, int * );
    00237 };
    00238
    00239 /************************************************************************/
    00240 /*                            VRTRasterBand                             */
    00241 /*                                                                      */
    00242 /*      Provides support for all the various kinds of metadata but      */
    00243 /*      no raster access.  That is handled by derived classes.          */
    00244 /************************************************************************/
    00245
    00246 class CPL_DLL VRTRasterBand : public GDALRasterBand
    00247 {
    00248   protected:
    00249     int            bNoDataValueSet;
    00250     double         dfNoDataValue;
    00251
    00252     GDALColorTable *poColorTable;
    00253
    00254     GDALColorInterp eColorInterp;
    00255
    00256     char           *pszUnitType;
    00257     char           **papszCategoryNames;
    00258
    00259     double         dfOffset;
    00260     double         dfScale;
    00261
    00262     CPLXMLNode    *psSavedHistograms;
    00263
    00264     void           Initialize( int nXSize, int nYSize );
    00265
    00266   public:
    00267
    00268                    VRTRasterBand();
    00269     virtual        ~VRTRasterBand();
    00270
    00271     virtual CPLErr         XMLInit( CPLXMLNode *, const char * );
    00272     virtual CPLXMLNode *   SerializeToXML( const char *pszVRTPath );
    00273
    00274 #define VRT_NODATA_UNSET -1234.56
    00275
    00276     virtual CPLErr SetNoDataValue( double );
    00277     virtual double GetNoDataValue( int *pbSuccess = NULL );
    00278
    00279     virtual CPLErr SetColorTable( GDALColorTable * );
    00280     virtual GDALColorTable *GetColorTable();
    00281
    00282     virtual CPLErr SetColorInterpretation( GDALColorInterp );
    00283     virtual GDALColorInterp GetColorInterpretation();
    00284
    00285     virtual const char *GetUnitType();
    00286     CPLErr SetUnitType( const char * );
    00287
    00288     virtual char **GetCategoryNames();
    00289     virtual CPLErr SetCategoryNames( char ** );
    00290
    00291     virtual CPLErr SetMetadata( char **papszMD, const char *pszDomain = "" );
    00292     virtual CPLErr SetMetadataItem( const char *pszName, const char *pszValue,
    00293                                     const char *pszDomain = "" );
    00294
    00295     virtual double GetOffset( int *pbSuccess = NULL );
    00296     CPLErr SetOffset( double );
    00297     virtual double GetScale( int *pbSuccess = NULL );
    00298     CPLErr SetScale( double );
    00299
    00300     virtual CPLErr  GetHistogram( double dfMin, double dfMax,
    00301                           int nBuckets, int * panHistogram,
    00302                           int bIncludeOutOfRange, int bApproxOK,
    00303                           GDALProgressFunc, void *pProgressData );
    00304
    00305     virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
    00306                                         int *pnBuckets, int ** ppanHistogram,
    00307                                         int bForce,
    00308                                         GDALProgressFunc, void *pProgressData);
    00309
    00310     virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
    00311                                         int nBuckets, int *panHistogram );
    00312
    00313     CPLErr         CopyCommonInfoFrom( GDALRasterBand * );
    00314 };
    00315
    00316 /************************************************************************/
    00317 /*                         VRTSourcedRasterBand                         */
    00318 /************************************************************************/
    00319
    00320 class CPL_DLL VRTSourcedRasterBand : public VRTRasterBand
    00321 {
    00322
    00323     void           Initialize( int nXSize, int nYSize );
    00324
    00325   public:
    00326     int            nSources;
    00327     VRTSource    **papoSources;
    00328     int            bEqualAreas;
    00329
    00330                    VRTSourcedRasterBand( GDALDataset *poDS, int nBand );
    00331                    VRTSourcedRasterBand( GDALDataType eType,
    00332                                          int nXSize, int nYSize );
    00333                    VRTSourcedRasterBand( GDALDataset *poDS, int nBand,
    00334                                          GDALDataType eType,
    00335                                          int nXSize, int nYSize );
    00336     virtual        ~VRTSourcedRasterBand();
    00337
    00338     virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
    00339                               void *, int, int, GDALDataType,
    00340                               int, int );
    00341
    00342     virtual char      **GetMetadata( const char * pszDomain = "" );
    00343     virtual CPLErr      SetMetadata( char ** papszMetadata,
    00344                                      const char * pszDomain = "" );
    00345     virtual CPLErr      SetMetadataItem( const char * pszName,
    00346                                          const char * pszValue,
    00347                                          const char * pszDomain = "" );
    00348
    00349     virtual CPLErr         XMLInit( CPLXMLNode *, const char * );
    00350     virtual CPLXMLNode *   SerializeToXML( const char *pszVRTPath );
    00351
    00352     CPLErr         AddSource( VRTSource * );
    00353     CPLErr         AddSimpleSource( GDALRasterBand *poSrcBand,
    00354                                     int nSrcXOff=-1, int nSrcYOff=-1,
    00355                                     int nSrcXSize=-1, int nSrcYSize=-1,
    00356                                     int nDstXOff=-1, int nDstYOff=-1,
    00357                                     int nDstXSize=-1, int nDstYSize=-1,
    00358                                     const char *pszResampling = "near",
    00359                                     double dfNoDataValue = VRT_NODATA_UNSET);
    00360     CPLErr         AddComplexSource( GDALRasterBand *poSrcBand,
    00361                                      int nSrcXOff=-1, int nSrcYOff=-1,
    00362                                      int nSrcXSize=-1, int nSrcYSize=-1,
    00363                                      int nDstXOff=-1, int nDstYOff=-1,
    00364                                      int nDstXSize=-1, int nDstYSize=-1,
    00365                                      double dfScaleOff=0.0,
    00366                                      double dfScaleRatio=1.0,
    00367                                      double dfNoDataValue = VRT_NODATA_UNSET);
    00368
    00369     CPLErr         AddFuncSource( VRTImageReadFunc pfnReadFunc, void *hCBData,
    00370                                   double dfNoDataValue = VRT_NODATA_UNSET );
    00371
    00372
    00373     virtual CPLErr IReadBlock( int, int, void * );
    00374 };
    00375
    00376 /************************************************************************/
    00377 /*                         VRTWarpedRasterBand                          */
    00378 /************************************************************************/
    00379
    00380 class CPL_DLL VRTWarpedRasterBand : public VRTRasterBand
    00381 {
    00382   public:
    00383                    VRTWarpedRasterBand( GDALDataset *poDS, int nBand,
    00384                                      GDALDataType eType = GDT_Unknown );
    00385     virtual        ~VRTWarpedRasterBand();
    00386
    00387     virtual CPLErr         XMLInit( CPLXMLNode *, const char * );
    00388     virtual CPLXMLNode *   SerializeToXML( const char *pszVRTPath );
    00389
    00390     virtual CPLErr IReadBlock( int, int, void * );
    00391
    00392     virtual int GetOverviewCount();
    00393     virtual GDALRasterBand *GetOverview(int);
    00394 };
    00395
    00396 /************************************************************************/
    00397 /*                         VRTDerivedRasterBand                         */
    00398 /************************************************************************/
    00399
    00400 class CPL_DLL VRTDerivedRasterBand : public VRTSourcedRasterBand
    00401 {
    00402
    00403  public:
    00404     char *pszFuncName;
    00405     GDALDataType eSourceTransferType;
    00406
    00407     VRTDerivedRasterBand(GDALDataset *poDS, int nBand);
    00408     VRTDerivedRasterBand(GDALDataset *poDS, int nBand,
    00409                          GDALDataType eType, int nXSize, int nYSize);
    00410     virtual        ~VRTDerivedRasterBand();
    00411
    00412     virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
    00413                               void *, int, int, GDALDataType,
    00414                               int, int );
    00415
    00416     static CPLErr AddPixelFunction
    00417         (const char *pszFuncName, GDALDerivedPixelFunc pfnPixelFunc);
    00418     static GDALDerivedPixelFunc GetPixelFunction(const char *pszFuncName);
    00419
    00420     void SetPixelFunctionName(const char *pszFuncName);
    00421     void SetSourceTransferType(GDALDataType eDataType);
    00422
    00423     virtual CPLErr         XMLInit( CPLXMLNode *, const char * );
    00424     virtual CPLXMLNode *   SerializeToXML( const char *pszVRTPath );
    00425
    00426 };
    00427
    00428 /************************************************************************/
    00429 /*                           VRTRawRasterBand                           */
    00430 /************************************************************************/
    00431
    00432 class RawRasterBand;
    00433
    00434 class CPL_DLL VRTRawRasterBand : public VRTRasterBand
    00435 {
    00436     RawRasterBand  *poRawRaster;
    00437
    00438     char           *pszSourceFilename;
    00439     int            bRelativeToVRT;
    00440
    00441   public:
    00442                    VRTRawRasterBand( GDALDataset *poDS, int nBand,
    00443                                      GDALDataType eType = GDT_Unknown );
    00444     virtual        ~VRTRawRasterBand();
    00445
    00446     virtual CPLErr         XMLInit( CPLXMLNode *, const char * );
    00447     virtual CPLXMLNode *   SerializeToXML( const char *pszVRTPath );
    00448
    00449     virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
    00450                               void *, int, int, GDALDataType,
    00451                               int, int );
    00452
    00453     virtual CPLErr IReadBlock( int, int, void * );
    00454     virtual CPLErr IWriteBlock( int, int, void * );
    00455
    00456     CPLErr         SetRawLink( const char *pszFilename,
    00457                                const char *pszVRTPath,
    00458                                int bRelativeToVRT,
    00459                                vsi_l_offset nImageOffset,
    00460                                int nPixelOffset, int nLineOffset,
    00461                                const char *pszByteOrder );
    00462
    00463     void           ClearRawLink();
    00464
    00465 };
    00466
    00467 /************************************************************************/
    00468 /*                              VRTDriver                               */
    00469 /************************************************************************/
    00470
    00471 class VRTDriver : public GDALDriver
    00472 {
    00473   public:
    00474                  VRTDriver();
    00475                  ~VRTDriver();
    00476
    00477     char         **papszSourceParsers;
    00478
    00479     virtual char      **GetMetadata( const char * pszDomain = "" );
    00480     virtual CPLErr      SetMetadata( char ** papszMetadata,
    00481                                      const char * pszDomain = "" );
    00482
    00483     VRTSource   *ParseSource( CPLXMLNode *psSrc, const char *pszVRTPath );
    00484     void         AddSourceParser( const char *pszElementName,
    00485                                   VRTSourceParser pfnParser );
    00486 };
    00487
    00488 /************************************************************************/
    00489 /*                           VRTSimpleSource                            */
    00490 /************************************************************************/
    00491
    00492 class VRTSimpleSource : public VRTSource
    00493 {
    00494 protected:
    00495     GDALRasterBand      *poRasterBand;
    00496
    00497     int                 nSrcXOff;
    00498     int                 nSrcYOff;
    00499     int                 nSrcXSize;
    00500     int                 nSrcYSize;
    00501
    00502     int                 nDstXOff;
    00503     int                 nDstYOff;
    00504     int                 nDstXSize;
    00505     int                 nDstYSize;
    00506
    00507     int                 bNoDataSet;
    00508     double              dfNoDataValue;
    00509
    00510 public:
    00511             VRTSimpleSource();
    00512     virtual ~VRTSimpleSource();
    00513
    00514     virtual CPLErr  XMLInit( CPLXMLNode *psTree, const char * );
    00515     virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
    00516
    00517     void           SetSrcBand( GDALRasterBand * );
    00518     void           SetSrcWindow( int, int, int, int );
    00519     void           SetDstWindow( int, int, int, int );
    00520     void           SetNoDataValue( double dfNoDataValue );
    00521
    00522     int            GetSrcDstWindow( int, int, int, int, int, int,
    00523                                     int *, int *, int *, int *,
    00524                                     int *, int *, int *, int * );
    00525
    00526     virtual CPLErr  RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
    00527                               void *pData, int nBufXSize, int nBufYSize,
    00528                               GDALDataType eBufType,
    00529                               int nPixelSpace, int nLineSpace );
    00530
    00531     void            DstToSrc( double dfX, double dfY,
    00532                               double &dfXOut, double &dfYOut );
    00533     void            SrcToDst( double dfX, double dfY,
    00534                               double &dfXOut, double &dfYOut );
    00535
    00536 };
    00537
    00538 /************************************************************************/
    00539 /*                          VRTAveragedSource                           */
    00540 /************************************************************************/
    00541
    00542 class VRTAveragedSource : public VRTSimpleSource
    00543 {
    00544 public:
    00545                     VRTAveragedSource();
    00546     virtual CPLErr  RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
    00547                               void *pData, int nBufXSize, int nBufYSize,
    00548                               GDALDataType eBufType,
    00549                               int nPixelSpace, int nLineSpace );
    00550     virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
    00551 };
    00552
    00553 /************************************************************************/
    00554 /*                           VRTComplexSource                           */
    00555 /************************************************************************/
    00556
    00557 class VRTComplexSource : public VRTSimpleSource
    00558 {
    00559 public:
    00560                    VRTComplexSource();
    00561     virtual        ~VRTComplexSource();
    00562
    00563     virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
    00564                              void *pData, int nBufXSize, int nBufYSize,
    00565                              GDALDataType eBufType,
    00566                              int nPixelSpace, int nLineSpace );
    00567     virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
    00568     virtual CPLErr XMLInit( CPLXMLNode *, const char * );
    00569
    00570     int            bDoScaling;
    00571     double         dfScaleOff;
    00572     double         dfScaleRatio;
    00573
    00574 };
    00575
    00576 /************************************************************************/
    00577 /*                           VRTFilteredSource                          */
    00578 /************************************************************************/
    00579
    00580 class VRTFilteredSource : public VRTComplexSource
    00581 {
    00582 private:
    00583     int          IsTypeSupported( GDALDataType eType );
    00584
    00585 protected:
    00586     int          nSupportedTypesCount;
    00587     GDALDataType aeSupportedTypes[20];
    00588
    00589     int          nExtraEdgePixels;
    00590
    00591 public:
    00592             VRTFilteredSource();
    00593     virtual ~VRTFilteredSource();
    00594
    00595     void    SetExtraEdgePixels( int );
    00596     void    SetFilteringDataTypesSupported( int, GDALDataType * );
    00597
    00598     virtual CPLErr  FilterData( int nXSize, int nYSize, GDALDataType eType,
    00599                                 GByte *pabySrcData, GByte *pabyDstData ) = 0;
    00600
    00601     virtual CPLErr  RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
    00602                               void *pData, int nBufXSize, int nBufYSize,
    00603                               GDALDataType eBufType,
    00604                               int nPixelSpace, int nLineSpace );
    00605 };
    00606
    00607 /************************************************************************/
    00608 /*                       VRTKernelFilteredSource                        */
    00609 /************************************************************************/
    00610
    00611 class VRTKernelFilteredSource : public VRTFilteredSource
    00612 {
    00613 protected:
    00614     int     nKernelSize;
    00615
    00616     double  *padfKernelCoefs;
    00617
    00618     int     bNormalized;
    00619
    00620 public:
    00621             VRTKernelFilteredSource();
    00622     virtual ~VRTKernelFilteredSource();
    00623
    00624     virtual CPLErr  XMLInit( CPLXMLNode *psTree, const char * );
    00625     virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
    00626
    00627     virtual CPLErr  FilterData( int nXSize, int nYSize, GDALDataType eType,
    00628                                 GByte *pabySrcData, GByte *pabyDstData );
    00629
    00630     CPLErr          SetKernel( int nKernelSize, double *padfCoefs );
    00631     void            SetNormalized( int );
    00632 };
    00633
    00634 /************************************************************************/
    00635 /*                       VRTAverageFilteredSource                       */
    00636 /************************************************************************/
    00637
    00638 class VRTAverageFilteredSource : public VRTKernelFilteredSource
    00639 {
    00640 public:
    00641             VRTAverageFilteredSource( int nKernelSize );
    00642     virtual ~VRTAverageFilteredSource();
    00643
    00644     virtual CPLErr  XMLInit( CPLXMLNode *psTree, const char * );
    00645     virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
    00646 };
    00647
    00648 /************************************************************************/
    00649 /*                            VRTFuncSource                             */
    00650 /************************************************************************/
    00651 class VRTFuncSource : public VRTSource
    00652 {
    00653 public:
    00654             VRTFuncSource();
    00655     virtual ~VRTFuncSource();
    00656
    00657     virtual CPLErr  XMLInit( CPLXMLNode *, const char *) { return CE_Failure; }
    00658     virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
    00659
    00660     virtual CPLErr  RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
    00661                               void *pData, int nBufXSize, int nBufYSize,
    00662                               GDALDataType eBufType,
    00663                               int nPixelSpace, int nLineSpace );
    00664
    00665     VRTImageReadFunc    pfnReadFunc;
    00666     void               *pCBData;
    00667     GDALDataType        eType;
    00668
    00669     float               fNoDataValue;
    00670 };
    00671
    00672 #endif /* ndef VIRTUALDATASET_H_INCLUDED */

Generated for GDAL by 1.5.1.