00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef VIRTUALDATASET_H_INCLUDED
00031 #define VIRTUALDATASET_H_INCLUDED
00032
00033 #include "gdal_priv.h"
00034 #include "gdal_pam.h"
00035 #include "gdal_vrt.h"
00036 #include "cpl_hash_set.h"
00037
00038 int VRTApplyMetadata( CPLXMLNode *, GDALMajorObject * );
00039 CPLXMLNode *VRTSerializeMetadata( GDALMajorObject * );
00040
00041 int VRTWarpedOverviewTransform( void *pTransformArg, int bDstToSrc,
00042 int nPointCount,
00043 double *padfX, double *padfY, double *padfZ,
00044 int *panSuccess );
00045 void* VRTDeserializeWarpedOverviewTransformer( CPLXMLNode *psTree );
00046
00047
00048
00049
00050 class VRTOverviewInfo
00051 {
00052 public:
00053 CPLString osFilename;
00054 int nBand;
00055 GDALRasterBand *poBand;
00056 int bTriedToOpen;
00057
00058 VRTOverviewInfo() : poBand(NULL), bTriedToOpen(FALSE) {}
00059 ~VRTOverviewInfo() {
00060 if( poBand == NULL )
00061 ;
00062 else if( poBand->GetDataset()->GetShared() )
00063 GDALClose( (GDALDatasetH) poBand->GetDataset() );
00064 else
00065 poBand->GetDataset()->Dereference();
00066 }
00067 };
00068
00069
00070
00071
00072
00073
00074 class VRTSource
00075 {
00076 public:
00077 virtual ~VRTSource();
00078
00079 virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
00080 void *pData, int nBufXSize, int nBufYSize,
00081 GDALDataType eBufType,
00082 int nPixelSpace, int nLineSpace ) = 0;
00083
00084 virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) = 0;
00085 virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) = 0;
00086
00087 virtual CPLErr XMLInit( CPLXMLNode *psTree, const char * ) = 0;
00088 virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) = 0;
00089
00090 virtual void GetFileList(char*** ppapszFileList, int *pnSize,
00091 int *pnMaxSize, CPLHashSet* hSetFiles);
00092
00093 virtual int IsSimpleSource() { return FALSE; }
00094 };
00095
00096 typedef VRTSource *(*VRTSourceParser)(CPLXMLNode *, const char *);
00097
00098 VRTSource *VRTParseCoreSources( CPLXMLNode *psTree, const char * );
00099 VRTSource *VRTParseFilterSources( CPLXMLNode *psTree, const char * );
00100
00101
00102
00103
00104
00105 class VRTRasterBand;
00106
00107 class CPL_DLL VRTDataset : public GDALDataset
00108 {
00109 friend class VRTRasterBand;
00110
00111 char *pszProjection;
00112
00113 int bGeoTransformSet;
00114 double adfGeoTransform[6];
00115
00116 int nGCPCount;
00117 GDAL_GCP *pasGCPList;
00118 char *pszGCPProjection;
00119
00120 int bNeedsFlush;
00121 int bWritable;
00122
00123 char *pszVRTPath;
00124
00125 VRTRasterBand *poMaskBand;
00126
00127 int bCompatibleForDatasetIO;
00128 int CheckCompatibleForDatasetIO();
00129
00130 protected:
00131 virtual int CloseDependentDatasets();
00132
00133 public:
00134 VRTDataset(int nXSize, int nYSize);
00135 ~VRTDataset();
00136
00137 void SetNeedsFlush() { bNeedsFlush = TRUE; }
00138 virtual void FlushCache();
00139
00140 void SetWritable(int bWritable) { this->bWritable = bWritable; }
00141
00142 virtual CPLErr CreateMaskBand( int nFlags );
00143 void SetMaskBand(VRTRasterBand* poMaskBand);
00144
00145 virtual const char *GetProjectionRef(void);
00146 virtual CPLErr SetProjection( const char * );
00147 virtual CPLErr GetGeoTransform( double * );
00148 virtual CPLErr SetGeoTransform( double * );
00149
00150 virtual CPLErr SetMetadata( char **papszMD, const char *pszDomain = "" );
00151 virtual CPLErr SetMetadataItem( const char *pszName, const char *pszValue,
00152 const char *pszDomain = "" );
00153
00154 virtual int GetGCPCount();
00155 virtual const char *GetGCPProjection();
00156 virtual const GDAL_GCP *GetGCPs();
00157 virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
00158 const char *pszGCPProjection );
00159
00160 virtual CPLErr AddBand( GDALDataType eType,
00161 char **papszOptions=NULL );
00162
00163 virtual char **GetFileList();
00164
00165 virtual CPLErr IRasterIO( GDALRWFlag eRWFlag,
00166 int nXOff, int nYOff, int nXSize, int nYSize,
00167 void * pData, int nBufXSize, int nBufYSize,
00168 GDALDataType eBufType,
00169 int nBandCount, int *panBandMap,
00170 int nPixelSpace, int nLineSpace, int nBandSpace);
00171
00172 virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath);
00173 virtual CPLErr XMLInit( CPLXMLNode *, const char * );
00174
00175
00176 GDALDataset* GetSingleSimpleSource();
00177
00178 static int Identify( GDALOpenInfo * );
00179 static GDALDataset *Open( GDALOpenInfo * );
00180 static GDALDataset *OpenXML( const char *, const char * = NULL, GDALAccess eAccess = GA_ReadOnly );
00181 static GDALDataset *Create( const char * pszName,
00182 int nXSize, int nYSize, int nBands,
00183 GDALDataType eType, char ** papszOptions );
00184 static CPLErr Delete( const char * pszFilename );
00185 };
00186
00187
00188
00189
00190
00191 class GDALWarpOperation;
00192 class VRTWarpedRasterBand;
00193
00194 class CPL_DLL VRTWarpedDataset : public VRTDataset
00195 {
00196 int nBlockXSize;
00197 int nBlockYSize;
00198 GDALWarpOperation *poWarper;
00199
00200 friend class VRTWarpedRasterBand;
00201
00202 protected:
00203 virtual int CloseDependentDatasets();
00204
00205 public:
00206 int nOverviewCount;
00207 VRTWarpedDataset **papoOverviews;
00208
00209 public:
00210 VRTWarpedDataset( int nXSize, int nYSize );
00211 ~VRTWarpedDataset();
00212
00213 CPLErr Initialize( void * );
00214
00215 virtual CPLErr IBuildOverviews( const char *, int, int *,
00216 int, int *, GDALProgressFunc, void * );
00217
00218 virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
00219 virtual CPLErr XMLInit( CPLXMLNode *, const char * );
00220
00221 virtual CPLErr AddBand( GDALDataType eType,
00222 char **papszOptions=NULL );
00223
00224 virtual char **GetFileList();
00225
00226 CPLErr ProcessBlock( int iBlockX, int iBlockY );
00227
00228 void GetBlockSize( int *, int * );
00229 };
00230
00231
00232
00233
00234
00235
00236
00237
00238 class CPL_DLL VRTRasterBand : public GDALRasterBand
00239 {
00240 protected:
00241 int bIsMaskBand;
00242
00243 int bNoDataValueSet;
00244 int bHideNoDataValue;
00245 double dfNoDataValue;
00246
00247 GDALColorTable *poColorTable;
00248
00249 GDALColorInterp eColorInterp;
00250
00251 char *pszUnitType;
00252 char **papszCategoryNames;
00253
00254 double dfOffset;
00255 double dfScale;
00256
00257 CPLXMLNode *psSavedHistograms;
00258
00259 void Initialize( int nXSize, int nYSize );
00260
00261 std::vector<VRTOverviewInfo> apoOverviews;
00262
00263 VRTRasterBand *poMaskBand;
00264
00265 public:
00266
00267 VRTRasterBand();
00268 virtual ~VRTRasterBand();
00269
00270 virtual CPLErr XMLInit( CPLXMLNode *, const char * );
00271 virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath );
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 int GetOverviewCount();
00298 virtual GDALRasterBand *GetOverview(int);
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 virtual void GetFileList(char*** ppapszFileList, int *pnSize,
00316 int *pnMaxSize, CPLHashSet* hSetFiles);
00317
00318 virtual void SetDescription( const char * );
00319
00320 virtual GDALRasterBand *GetMaskBand();
00321 virtual int GetMaskFlags();
00322
00323 virtual CPLErr CreateMaskBand( int nFlags );
00324
00325 void SetMaskBand(VRTRasterBand* poMaskBand);
00326
00327 void SetIsMaskBand();
00328
00329 CPLErr UnsetNoDataValue();
00330
00331 virtual int CloseDependentDatasets();
00332
00333 virtual int IsSourcedRasterBand() { return FALSE; }
00334 };
00335
00336
00337
00338
00339
00340 class CPL_DLL VRTSourcedRasterBand : public VRTRasterBand
00341 {
00342 private:
00343 int bAntiRecursionFlag;
00344 CPLString osLastLocationInfo;
00345
00346 void Initialize( int nXSize, int nYSize );
00347
00348 public:
00349 int nSources;
00350 VRTSource **papoSources;
00351 int bEqualAreas;
00352
00353 VRTSourcedRasterBand( GDALDataset *poDS, int nBand );
00354 VRTSourcedRasterBand( GDALDataType eType,
00355 int nXSize, int nYSize );
00356 VRTSourcedRasterBand( GDALDataset *poDS, int nBand,
00357 GDALDataType eType,
00358 int nXSize, int nYSize );
00359 virtual ~VRTSourcedRasterBand();
00360
00361 virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
00362 void *, int, int, GDALDataType,
00363 int, int );
00364
00365 virtual const char *GetMetadataItem( const char * pszName,
00366 const char * pszDomain = "" );
00367 virtual char **GetMetadata( const char * pszDomain = "" );
00368 virtual CPLErr SetMetadata( char ** papszMetadata,
00369 const char * pszDomain = "" );
00370 virtual CPLErr SetMetadataItem( const char * pszName,
00371 const char * pszValue,
00372 const char * pszDomain = "" );
00373
00374 virtual CPLErr XMLInit( CPLXMLNode *, const char * );
00375 virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath );
00376
00377 virtual double GetMinimum( int *pbSuccess = NULL );
00378 virtual double GetMaximum(int *pbSuccess = NULL );
00379
00380 CPLErr AddSource( VRTSource * );
00381 CPLErr AddSimpleSource( GDALRasterBand *poSrcBand,
00382 int nSrcXOff=-1, int nSrcYOff=-1,
00383 int nSrcXSize=-1, int nSrcYSize=-1,
00384 int nDstXOff=-1, int nDstYOff=-1,
00385 int nDstXSize=-1, int nDstYSize=-1,
00386 const char *pszResampling = "near",
00387 double dfNoDataValue = VRT_NODATA_UNSET);
00388 CPLErr AddComplexSource( GDALRasterBand *poSrcBand,
00389 int nSrcXOff=-1, int nSrcYOff=-1,
00390 int nSrcXSize=-1, int nSrcYSize=-1,
00391 int nDstXOff=-1, int nDstYOff=-1,
00392 int nDstXSize=-1, int nDstYSize=-1,
00393 double dfScaleOff=0.0,
00394 double dfScaleRatio=1.0,
00395 double dfNoDataValue = VRT_NODATA_UNSET,
00396 int nColorTableComponent = 0);
00397
00398 CPLErr AddMaskBandSource( GDALRasterBand *poSrcBand,
00399 int nSrcXOff=-1, int nSrcYOff=-1,
00400 int nSrcXSize=-1, int nSrcYSize=-1,
00401 int nDstXOff=-1, int nDstYOff=-1,
00402 int nDstXSize=-1, int nDstYSize=-1 );
00403
00404 CPLErr AddFuncSource( VRTImageReadFunc pfnReadFunc, void *hCBData,
00405 double dfNoDataValue = VRT_NODATA_UNSET );
00406
00407
00408 virtual CPLErr IReadBlock( int, int, void * );
00409
00410 virtual void GetFileList(char*** ppapszFileList, int *pnSize,
00411 int *pnMaxSize, CPLHashSet* hSetFiles);
00412
00413 virtual int CloseDependentDatasets();
00414
00415 virtual int IsSourcedRasterBand() { return TRUE; }
00416 };
00417
00418
00419
00420
00421
00422 class CPL_DLL VRTWarpedRasterBand : public VRTRasterBand
00423 {
00424 public:
00425 VRTWarpedRasterBand( GDALDataset *poDS, int nBand,
00426 GDALDataType eType = GDT_Unknown );
00427 virtual ~VRTWarpedRasterBand();
00428
00429 virtual CPLErr XMLInit( CPLXMLNode *, const char * );
00430 virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath );
00431
00432 virtual CPLErr IReadBlock( int, int, void * );
00433 virtual CPLErr IWriteBlock( int, int, void * );
00434
00435 virtual int GetOverviewCount();
00436 virtual GDALRasterBand *GetOverview(int);
00437 };
00438
00439
00440
00441
00442
00443 class CPL_DLL VRTDerivedRasterBand : public VRTSourcedRasterBand
00444 {
00445
00446 public:
00447 char *pszFuncName;
00448 GDALDataType eSourceTransferType;
00449
00450 VRTDerivedRasterBand(GDALDataset *poDS, int nBand);
00451 VRTDerivedRasterBand(GDALDataset *poDS, int nBand,
00452 GDALDataType eType, int nXSize, int nYSize);
00453 virtual ~VRTDerivedRasterBand();
00454
00455 virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
00456 void *, int, int, GDALDataType,
00457 int, int );
00458
00459 static CPLErr AddPixelFunction
00460 (const char *pszFuncName, GDALDerivedPixelFunc pfnPixelFunc);
00461 static GDALDerivedPixelFunc GetPixelFunction(const char *pszFuncName);
00462
00463 void SetPixelFunctionName(const char *pszFuncName);
00464 void SetSourceTransferType(GDALDataType eDataType);
00465
00466 virtual CPLErr XMLInit( CPLXMLNode *, const char * );
00467 virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath );
00468
00469 };
00470
00471
00472
00473
00474
00475 class RawRasterBand;
00476
00477 class CPL_DLL VRTRawRasterBand : public VRTRasterBand
00478 {
00479 RawRasterBand *poRawRaster;
00480
00481 char *pszSourceFilename;
00482 int bRelativeToVRT;
00483
00484 public:
00485 VRTRawRasterBand( GDALDataset *poDS, int nBand,
00486 GDALDataType eType = GDT_Unknown );
00487 virtual ~VRTRawRasterBand();
00488
00489 virtual CPLErr XMLInit( CPLXMLNode *, const char * );
00490 virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath );
00491
00492 virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
00493 void *, int, int, GDALDataType,
00494 int, int );
00495
00496 virtual CPLErr IReadBlock( int, int, void * );
00497 virtual CPLErr IWriteBlock( int, int, void * );
00498
00499 CPLErr SetRawLink( const char *pszFilename,
00500 const char *pszVRTPath,
00501 int bRelativeToVRT,
00502 vsi_l_offset nImageOffset,
00503 int nPixelOffset, int nLineOffset,
00504 const char *pszByteOrder );
00505
00506 void ClearRawLink();
00507
00508 virtual void GetFileList(char*** ppapszFileList, int *pnSize,
00509 int *pnMaxSize, CPLHashSet* hSetFiles);
00510 };
00511
00512
00513
00514
00515
00516 class VRTDriver : public GDALDriver
00517 {
00518 void *pDeserializerData;
00519
00520 public:
00521 VRTDriver();
00522 ~VRTDriver();
00523
00524 char **papszSourceParsers;
00525
00526 virtual char **GetMetadata( const char * pszDomain = "" );
00527 virtual CPLErr SetMetadata( char ** papszMetadata,
00528 const char * pszDomain = "" );
00529
00530 VRTSource *ParseSource( CPLXMLNode *psSrc, const char *pszVRTPath );
00531 void AddSourceParser( const char *pszElementName,
00532 VRTSourceParser pfnParser );
00533 };
00534
00535
00536
00537
00538
00539 class VRTSimpleSource : public VRTSource
00540 {
00541 protected:
00542 GDALRasterBand *poRasterBand;
00543
00544
00545
00546 GDALRasterBand *poMaskBandMainBand;
00547
00548 int nSrcXOff;
00549 int nSrcYOff;
00550 int nSrcXSize;
00551 int nSrcYSize;
00552
00553 int nDstXOff;
00554 int nDstYOff;
00555 int nDstXSize;
00556 int nDstYSize;
00557
00558 int bNoDataSet;
00559 double dfNoDataValue;
00560
00561 public:
00562 VRTSimpleSource();
00563 virtual ~VRTSimpleSource();
00564
00565 virtual CPLErr XMLInit( CPLXMLNode *psTree, const char * );
00566 virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
00567
00568 void SetSrcBand( GDALRasterBand * );
00569 void SetSrcMaskBand( GDALRasterBand * );
00570 void SetSrcWindow( int, int, int, int );
00571 void SetDstWindow( int, int, int, int );
00572 void SetNoDataValue( double dfNoDataValue );
00573
00574 int GetSrcDstWindow( int, int, int, int, int, int,
00575 int *, int *, int *, int *,
00576 int *, int *, int *, int * );
00577
00578 virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
00579 void *pData, int nBufXSize, int nBufYSize,
00580 GDALDataType eBufType,
00581 int nPixelSpace, int nLineSpace );
00582
00583 virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess );
00584 virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess );
00585
00586 void DstToSrc( double dfX, double dfY,
00587 double &dfXOut, double &dfYOut );
00588 void SrcToDst( double dfX, double dfY,
00589 double &dfXOut, double &dfYOut );
00590
00591 virtual void GetFileList(char*** ppapszFileList, int *pnSize,
00592 int *pnMaxSize, CPLHashSet* hSetFiles);
00593
00594 virtual int IsSimpleSource() { return TRUE; }
00595 virtual const char* GetType() { return "SimpleSource"; }
00596
00597 GDALRasterBand* GetBand();
00598 int IsSameExceptBandNumber(VRTSimpleSource* poOtherSource);
00599 CPLErr DatasetRasterIO(
00600 int nXOff, int nYOff, int nXSize, int nYSize,
00601 void * pData, int nBufXSize, int nBufYSize,
00602 GDALDataType eBufType,
00603 int nBandCount, int *panBandMap,
00604 int nPixelSpace, int nLineSpace, int nBandSpace);
00605 };
00606
00607
00608
00609
00610
00611 class VRTAveragedSource : public VRTSimpleSource
00612 {
00613 public:
00614 VRTAveragedSource();
00615 virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
00616 void *pData, int nBufXSize, int nBufYSize,
00617 GDALDataType eBufType,
00618 int nPixelSpace, int nLineSpace );
00619
00620 virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess );
00621 virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess );
00622
00623 virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
00624 virtual const char* GetType() { return "AveragedSource"; }
00625 };
00626
00627
00628
00629
00630
00631 class VRTComplexSource : public VRTSimpleSource
00632 {
00633 public:
00634 VRTComplexSource();
00635 virtual ~VRTComplexSource();
00636
00637 virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
00638 void *pData, int nBufXSize, int nBufYSize,
00639 GDALDataType eBufType,
00640 int nPixelSpace, int nLineSpace );
00641
00642 virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess );
00643 virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess );
00644
00645 virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
00646 virtual CPLErr XMLInit( CPLXMLNode *, const char * );
00647 virtual const char* GetType() { return "ComplexSource"; }
00648
00649 double LookupValue( double dfInput );
00650
00651 int bDoScaling;
00652 double dfScaleOff;
00653 double dfScaleRatio;
00654 double *padfLUTInputs;
00655 double *padfLUTOutputs;
00656 int nLUTItemCount;
00657 int nColorTableComponent;
00658 };
00659
00660
00661
00662
00663
00664 class VRTFilteredSource : public VRTComplexSource
00665 {
00666 private:
00667 int IsTypeSupported( GDALDataType eType );
00668
00669 protected:
00670 int nSupportedTypesCount;
00671 GDALDataType aeSupportedTypes[20];
00672
00673 int nExtraEdgePixels;
00674
00675 public:
00676 VRTFilteredSource();
00677 virtual ~VRTFilteredSource();
00678
00679 void SetExtraEdgePixels( int );
00680 void SetFilteringDataTypesSupported( int, GDALDataType * );
00681
00682 virtual CPLErr FilterData( int nXSize, int nYSize, GDALDataType eType,
00683 GByte *pabySrcData, GByte *pabyDstData ) = 0;
00684
00685 virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
00686 void *pData, int nBufXSize, int nBufYSize,
00687 GDALDataType eBufType,
00688 int nPixelSpace, int nLineSpace );
00689 };
00690
00691
00692
00693
00694
00695 class VRTKernelFilteredSource : public VRTFilteredSource
00696 {
00697 protected:
00698 int nKernelSize;
00699
00700 double *padfKernelCoefs;
00701
00702 int bNormalized;
00703
00704 public:
00705 VRTKernelFilteredSource();
00706 virtual ~VRTKernelFilteredSource();
00707
00708 virtual CPLErr XMLInit( CPLXMLNode *psTree, const char * );
00709 virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
00710
00711 virtual CPLErr FilterData( int nXSize, int nYSize, GDALDataType eType,
00712 GByte *pabySrcData, GByte *pabyDstData );
00713
00714 CPLErr SetKernel( int nKernelSize, double *padfCoefs );
00715 void SetNormalized( int );
00716 };
00717
00718
00719
00720
00721
00722 class VRTAverageFilteredSource : public VRTKernelFilteredSource
00723 {
00724 public:
00725 VRTAverageFilteredSource( int nKernelSize );
00726 virtual ~VRTAverageFilteredSource();
00727
00728 virtual CPLErr XMLInit( CPLXMLNode *psTree, const char * );
00729 virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
00730 };
00731
00732
00733
00734
00735 class VRTFuncSource : public VRTSource
00736 {
00737 public:
00738 VRTFuncSource();
00739 virtual ~VRTFuncSource();
00740
00741 virtual CPLErr XMLInit( CPLXMLNode *, const char *) { return CE_Failure; }
00742 virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath );
00743
00744 virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
00745 void *pData, int nBufXSize, int nBufYSize,
00746 GDALDataType eBufType,
00747 int nPixelSpace, int nLineSpace );
00748
00749 virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess );
00750 virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess );
00751
00752 VRTImageReadFunc pfnReadFunc;
00753 void *pCBData;
00754 GDALDataType eType;
00755
00756 float fNoDataValue;
00757 };
00758
00759 #endif