vrtdataset.h

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

Generated for GDAL by doxygen 1.5.1.