GDAL
vrtdataset.h
1 /******************************************************************************
2  * $Id: vrtdataset.h 40400 2017-10-11 14:24:19Z rouault $
3  *
4  * Project: Virtual GDAL Datasets
5  * Purpose: Declaration of virtual gdal dataset classes.
6  * Author: Frank Warmerdam, warmerdam@pobox.com
7  *
8  ******************************************************************************
9  * Copyright (c) 2001, Frank Warmerdam <warmerdam@pobox.com>
10  * Copyright (c) 2007-2013, Even Rouault <even dot rouault at mines-paris dot org>
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 VIRTUALDATASET_H_INCLUDED
32 #define VIRTUALDATASET_H_INCLUDED
33 
34 #ifndef DOXYGEN_SKIP
35 
36 #include "cpl_hash_set.h"
37 #include "gdal_pam.h"
38 #include "gdal_priv.h"
39 #include "gdal_vrt.h"
40 
41 #include <map>
42 #include <vector>
43 
44 int VRTApplyMetadata( CPLXMLNode *, GDALMajorObject * );
45 CPLXMLNode *VRTSerializeMetadata( GDALMajorObject * );
46 CPLErr GDALRegisterDefaultPixelFunc();
47 
48 #if 0
49 int VRTWarpedOverviewTransform( void *pTransformArg, int bDstToSrc,
50  int nPointCount,
51  double *padfX, double *padfY, double *padfZ,
52  int *panSuccess );
53 void* VRTDeserializeWarpedOverviewTransformer( CPLXMLNode *psTree );
54 #endif
55 
56 /************************************************************************/
57 /* VRTOverviewInfo() */
58 /************************************************************************/
59 class VRTOverviewInfo
60 {
61 public:
62  CPLString osFilename;
63  int nBand;
64  GDALRasterBand *poBand;
65  int bTriedToOpen;
66 
67  VRTOverviewInfo() : nBand(0), poBand(NULL), bTriedToOpen(FALSE) {}
68  ~VRTOverviewInfo() {
69  if( poBand == NULL )
70  /* do nothing */;
71  else if( poBand->GetDataset()->GetShared() )
72  GDALClose( /* (GDALDatasetH) */ poBand->GetDataset() );
73  else
74  poBand->GetDataset()->Dereference();
75  }
76 };
77 
78 /************************************************************************/
79 /* VRTSource */
80 /************************************************************************/
81 
82 class CPL_DLL VRTSource
83 {
84 public:
85  virtual ~VRTSource();
86 
87  virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
88  void *pData, int nBufXSize, int nBufYSize,
89  GDALDataType eBufType,
90  GSpacing nPixelSpace, GSpacing nLineSpace,
91  GDALRasterIOExtraArg* psExtraArg ) = 0;
92 
93  virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) = 0;
94  virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) = 0;
95  virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK,
96  double* adfMinMax ) = 0;
97  virtual CPLErr ComputeStatistics( int nXSize, int nYSize,
98  int bApproxOK,
99  double *pdfMin, double *pdfMax,
100  double *pdfMean, double *pdfStdDev,
101  GDALProgressFunc pfnProgress,
102  void *pProgressData ) = 0;
103  virtual CPLErr GetHistogram( int nXSize, int nYSize,
104  double dfMin, double dfMax,
105  int nBuckets, GUIntBig * panHistogram,
106  int bIncludeOutOfRange, int bApproxOK,
107  GDALProgressFunc pfnProgress,
108  void *pProgressData ) = 0;
109 
110  virtual CPLErr XMLInit( CPLXMLNode *psTree, const char *, void* ) = 0;
111  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) = 0;
112 
113  virtual void GetFileList(char*** ppapszFileList, int *pnSize,
114  int *pnMaxSize, CPLHashSet* hSetFiles);
115 
116  virtual int IsSimpleSource() { return FALSE; }
117  virtual CPLErr FlushCache() { return CE_None; }
118 };
119 
120 typedef VRTSource *(*VRTSourceParser)(CPLXMLNode *, const char *, void* pUniqueHandle);
121 
122 VRTSource *VRTParseCoreSources( CPLXMLNode *psTree, const char *, void* pUniqueHandle );
123 VRTSource *VRTParseFilterSources( CPLXMLNode *psTree, const char *, void* pUniqueHandle );
124 
125 /************************************************************************/
126 /* VRTDataset */
127 /************************************************************************/
128 
129 class VRTRasterBand;
130 
131 class CPL_DLL VRTDataset : public GDALDataset
132 {
133  friend class VRTRasterBand;
134 
135  char *m_pszProjection;
136 
137  int m_bGeoTransformSet;
138  double m_adfGeoTransform[6];
139 
140  int m_nGCPCount;
141  GDAL_GCP *m_pasGCPList;
142  char *m_pszGCPProjection;
143 
144  int m_bNeedsFlush;
145  int m_bWritable;
146 
147  char *m_pszVRTPath;
148 
149  VRTRasterBand *m_poMaskBand;
150 
151  int m_bCompatibleForDatasetIO;
152  int CheckCompatibleForDatasetIO();
153  std::vector<GDALDataset*> m_apoOverviews;
154  std::vector<GDALDataset*> m_apoOverviewsBak;
155  char **m_papszXMLVRTMetadata;
156 
157  protected:
158  virtual int CloseDependentDatasets() CPL_OVERRIDE;
159 
160  public:
161  VRTDataset(int nXSize, int nYSize);
162  virtual ~VRTDataset();
163 
164  void SetNeedsFlush() { m_bNeedsFlush = TRUE; }
165  virtual void FlushCache() CPL_OVERRIDE;
166 
167  void SetWritable(int bWritableIn) { m_bWritable = bWritableIn; }
168 
169  virtual CPLErr CreateMaskBand( int nFlags ) CPL_OVERRIDE;
170  void SetMaskBand(VRTRasterBand* poMaskBand);
171 
172  virtual const char *GetProjectionRef() CPL_OVERRIDE;
173  virtual CPLErr SetProjection( const char * ) CPL_OVERRIDE;
174  virtual CPLErr GetGeoTransform( double * ) CPL_OVERRIDE;
175  virtual CPLErr SetGeoTransform( double * ) CPL_OVERRIDE;
176 
177  virtual CPLErr SetMetadata( char **papszMD, const char *pszDomain = "" ) CPL_OVERRIDE;
178  virtual CPLErr SetMetadataItem( const char *pszName, const char *pszValue,
179  const char *pszDomain = "" ) CPL_OVERRIDE;
180 
181  virtual char** GetMetadata( const char *pszDomain = "" ) CPL_OVERRIDE;
182 
183  virtual int GetGCPCount() CPL_OVERRIDE;
184  virtual const char *GetGCPProjection() CPL_OVERRIDE;
185  virtual const GDAL_GCP *GetGCPs() CPL_OVERRIDE;
186  virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
187  const char *pszGCPProjection ) CPL_OVERRIDE;
188 
189  virtual CPLErr AddBand( GDALDataType eType,
190  char **papszOptions=NULL ) CPL_OVERRIDE;
191 
192  virtual char **GetFileList() CPL_OVERRIDE;
193 
194  virtual CPLErr IRasterIO( GDALRWFlag eRWFlag,
195  int nXOff, int nYOff, int nXSize, int nYSize,
196  void * pData, int nBufXSize, int nBufYSize,
197  GDALDataType eBufType,
198  int nBandCount, int *panBandMap,
199  GSpacing nPixelSpace, GSpacing nLineSpace,
200  GSpacing nBandSpace,
201  GDALRasterIOExtraArg* psExtraArg) CPL_OVERRIDE;
202 
203  virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
204  int nBufXSize, int nBufYSize,
205  GDALDataType eDT,
206  int nBandCount, int *panBandList,
207  char **papszOptions ) CPL_OVERRIDE;
208 
209  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath);
210  virtual CPLErr XMLInit( CPLXMLNode *, const char * );
211 
212  virtual CPLErr IBuildOverviews( const char *, int, int *,
213  int, int *, GDALProgressFunc, void * ) CPL_OVERRIDE;
214 
215  /* Used by PDF driver for example */
216  GDALDataset* GetSingleSimpleSource();
217  void BuildVirtualOverviews();
218 
219  void UnsetPreservedRelativeFilenames();
220 
221  static int Identify( GDALOpenInfo * );
222  static GDALDataset *Open( GDALOpenInfo * );
223  static GDALDataset *OpenXML( const char *, const char * = NULL,
224  GDALAccess eAccess = GA_ReadOnly );
225  static GDALDataset *Create( const char * pszName,
226  int nXSize, int nYSize, int nBands,
227  GDALDataType eType, char ** papszOptions );
228  static CPLErr Delete( const char * pszFilename );
229 };
230 
231 /************************************************************************/
232 /* VRTWarpedDataset */
233 /************************************************************************/
234 
235 class GDALWarpOperation;
236 class VRTWarpedRasterBand;
237 
238 class CPL_DLL VRTWarpedDataset : public VRTDataset
239 {
240  int m_nBlockXSize;
241  int m_nBlockYSize;
242  GDALWarpOperation *m_poWarper;
243 
244  int m_nOverviewCount;
245  VRTWarpedDataset **m_papoOverviews;
246  int m_nSrcOvrLevel;
247 
248  void CreateImplicitOverviews();
249 
250  struct VerticalShiftGrid
251  {
252  CPLString osVGrids;
253  int bInverse;
254  double dfToMeterSrc;
255  double dfToMeterDest;
256  CPLStringList aosOptions;
257  };
258  std::vector<VerticalShiftGrid> m_aoVerticalShiftGrids;
259 
260  friend class VRTWarpedRasterBand;
261 
262  protected:
263  virtual int CloseDependentDatasets() CPL_OVERRIDE;
264 
265 public:
266  VRTWarpedDataset( int nXSize, int nYSize );
267  virtual ~VRTWarpedDataset();
268 
269  CPLErr Initialize( /* GDALWarpOptions */ void * );
270 
271  virtual CPLErr IBuildOverviews( const char *, int, int *,
272  int, int *, GDALProgressFunc, void * ) CPL_OVERRIDE;
273 
274  virtual CPLErr SetMetadataItem( const char *pszName, const char *pszValue,
275  const char *pszDomain = "" ) CPL_OVERRIDE;
276 
277  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
278  virtual CPLErr XMLInit( CPLXMLNode *, const char * ) CPL_OVERRIDE;
279 
280  virtual CPLErr AddBand( GDALDataType eType,
281  char **papszOptions=NULL ) CPL_OVERRIDE;
282 
283  virtual char **GetFileList() CPL_OVERRIDE;
284 
285  CPLErr ProcessBlock( int iBlockX, int iBlockY );
286 
287  void GetBlockSize( int *, int * );
288 
289  void SetApplyVerticalShiftGrid(const char* pszVGrids,
290  int bInverse,
291  double dfToMeterSrc,
292  double dfToMeterDest,
293  char** papszOptions );
294 };
295 
296 /************************************************************************/
297 /* VRTPansharpenedDataset */
298 /************************************************************************/
299 
301 
302 typedef enum
303 {
304  GTAdjust_Union,
305  GTAdjust_Intersection,
306  GTAdjust_None,
307  GTAdjust_NoneWithoutWarning
308 } GTAdjustment;
309 
310 class VRTPansharpenedDataset : public VRTDataset
311 {
312  friend class VRTPansharpenedRasterBand;
313 
314  int m_nBlockXSize;
315  int m_nBlockYSize;
316  GDALPansharpenOperation* m_poPansharpener;
317  VRTPansharpenedDataset* m_poMainDataset;
318  std::vector<VRTPansharpenedDataset*> m_apoOverviewDatasets;
319  // Map from absolute to relative.
320  std::map<CPLString,CPLString> m_oMapToRelativeFilenames;
321 
322  int m_bLoadingOtherBands;
323 
324  GByte *m_pabyLastBufferBandRasterIO;
325  int m_nLastBandRasterIOXOff;
326  int m_nLastBandRasterIOYOff;
327  int m_nLastBandRasterIOXSize;
328  int m_nLastBandRasterIOYSize;
329  GDALDataType m_eLastBandRasterIODataType;
330 
331  GTAdjustment m_eGTAdjustment;
332  int m_bNoDataDisabled;
333 
334  std::vector<GDALDataset*> m_apoDatasetsToClose;
335 
336  protected:
337  virtual int CloseDependentDatasets() CPL_OVERRIDE;
338 
339 public:
340  VRTPansharpenedDataset( int nXSize, int nYSize );
341  virtual ~VRTPansharpenedDataset();
342 
343  virtual CPLErr XMLInit( CPLXMLNode *, const char * ) CPL_OVERRIDE;
344  virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
345 
346  CPLErr XMLInit( CPLXMLNode *psTree, const char *pszVRTPath,
347  GDALRasterBandH hPanchroBandIn,
348  int nInputSpectralBandsIn,
349  GDALRasterBandH* pahInputSpectralBandsIn );
350 
351  virtual CPLErr AddBand( GDALDataType eType,
352  char **papszOptions=NULL ) CPL_OVERRIDE;
353 
354  virtual char **GetFileList() CPL_OVERRIDE;
355 
356  virtual CPLErr IRasterIO( GDALRWFlag eRWFlag,
357  int nXOff, int nYOff, int nXSize, int nYSize,
358  void * pData, int nBufXSize, int nBufYSize,
359  GDALDataType eBufType,
360  int nBandCount, int *panBandMap,
361  GSpacing nPixelSpace, GSpacing nLineSpace,
362  GSpacing nBandSpace,
363  GDALRasterIOExtraArg* psExtraArg) CPL_OVERRIDE;
364 
365  void GetBlockSize( int *, int * );
366 
367  GDALPansharpenOperation* GetPansharpener() { return m_poPansharpener; }
368 };
369 
370 /************************************************************************/
371 /* VRTRasterBand */
372 /* */
373 /* Provides support for all the various kinds of metadata but */
374 /* no raster access. That is handled by derived classes. */
375 /************************************************************************/
376 
377 class CPL_DLL VRTRasterBand : public GDALRasterBand
378 {
379  protected:
380  int m_bIsMaskBand;
381 
382  int m_bNoDataValueSet;
383  // If set to true, will not report the existence of nodata.
384  int m_bHideNoDataValue;
385  double m_dfNoDataValue;
386 
387  GDALColorTable *m_poColorTable;
388 
389  GDALColorInterp m_eColorInterp;
390 
391  char *m_pszUnitType;
392  char **m_papszCategoryNames;
393 
394  double m_dfOffset;
395  double m_dfScale;
396 
397  CPLXMLNode *m_psSavedHistograms;
398 
399  void Initialize( int nXSize, int nYSize );
400 
401  std::vector<VRTOverviewInfo> m_apoOverviews;
402 
403  VRTRasterBand *m_poMaskBand;
404 
405  public:
406 
407  VRTRasterBand();
408  virtual ~VRTRasterBand();
409 
410  virtual CPLErr XMLInit( CPLXMLNode *, const char *, void* );
411  virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath );
412 
413  virtual CPLErr SetNoDataValue( double ) CPL_OVERRIDE;
414  virtual double GetNoDataValue( int *pbSuccess = NULL ) CPL_OVERRIDE;
415  virtual CPLErr DeleteNoDataValue() CPL_OVERRIDE;
416 
417  virtual CPLErr SetColorTable( GDALColorTable * ) CPL_OVERRIDE;
418  virtual GDALColorTable *GetColorTable() CPL_OVERRIDE;
419 
420  virtual CPLErr SetColorInterpretation( GDALColorInterp ) CPL_OVERRIDE;
421  virtual GDALColorInterp GetColorInterpretation() CPL_OVERRIDE;
422 
423  virtual const char *GetUnitType() CPL_OVERRIDE;
424  CPLErr SetUnitType( const char * ) CPL_OVERRIDE;
425 
426  virtual char **GetCategoryNames() CPL_OVERRIDE;
427  virtual CPLErr SetCategoryNames( char ** ) CPL_OVERRIDE;
428 
429  virtual CPLErr SetMetadata( char **papszMD, const char *pszDomain = "" ) CPL_OVERRIDE;
430  virtual CPLErr SetMetadataItem( const char *pszName, const char *pszValue,
431  const char *pszDomain = "" ) CPL_OVERRIDE;
432 
433  virtual double GetOffset( int *pbSuccess = NULL ) CPL_OVERRIDE;
434  CPLErr SetOffset( double ) CPL_OVERRIDE;
435  virtual double GetScale( int *pbSuccess = NULL ) CPL_OVERRIDE;
436  CPLErr SetScale( double ) CPL_OVERRIDE;
437 
438  virtual int GetOverviewCount() CPL_OVERRIDE;
439  virtual GDALRasterBand *GetOverview(int) CPL_OVERRIDE;
440 
441  virtual CPLErr GetHistogram( double dfMin, double dfMax,
442  int nBuckets, GUIntBig * panHistogram,
443  int bIncludeOutOfRange, int bApproxOK,
444  GDALProgressFunc, void *pProgressData ) CPL_OVERRIDE;
445 
446  virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
447  int *pnBuckets, GUIntBig ** ppanHistogram,
448  int bForce,
449  GDALProgressFunc, void *pProgressData) CPL_OVERRIDE;
450 
451  virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
452  int nBuckets, GUIntBig *panHistogram ) CPL_OVERRIDE;
453 
454  CPLErr CopyCommonInfoFrom( GDALRasterBand * );
455 
456  virtual void GetFileList(char*** ppapszFileList, int *pnSize,
457  int *pnMaxSize, CPLHashSet* hSetFiles);
458 
459  virtual void SetDescription( const char * ) CPL_OVERRIDE;
460 
461  virtual GDALRasterBand *GetMaskBand() CPL_OVERRIDE;
462  virtual int GetMaskFlags() CPL_OVERRIDE;
463 
464  virtual CPLErr CreateMaskBand( int nFlags ) CPL_OVERRIDE;
465 
466  void SetMaskBand(VRTRasterBand* poMaskBand);
467 
468  void SetIsMaskBand();
469 
470  CPLErr UnsetNoDataValue();
471 
472  virtual int CloseDependentDatasets();
473 
474  virtual int IsSourcedRasterBand() { return FALSE; }
475  virtual int IsPansharpenRasterBand() { return FALSE; }
476 };
477 
478 /************************************************************************/
479 /* VRTSourcedRasterBand */
480 /************************************************************************/
481 
482 class VRTSimpleSource;
483 
484 class CPL_DLL VRTSourcedRasterBand : public VRTRasterBand
485 {
486  private:
487  int m_nRecursionCounter;
488  CPLString m_osLastLocationInfo;
489  char **m_papszSourceList;
490 
491  bool CanUseSourcesMinMaxImplementations();
492  void CheckSource( VRTSimpleSource *poSS );
493 
494  public:
495  int nSources;
496  VRTSource **papoSources;
497  int bSkipBufferInitialization;
498 
499  VRTSourcedRasterBand( GDALDataset *poDS, int nBand );
500  VRTSourcedRasterBand( GDALDataType eType,
501  int nXSize, int nYSize );
502  VRTSourcedRasterBand( GDALDataset *poDS, int nBand,
503  GDALDataType eType,
504  int nXSize, int nYSize );
505  virtual ~VRTSourcedRasterBand();
506 
507  virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
508  void *, int, int, GDALDataType,
509  GSpacing nPixelSpace, GSpacing nLineSpace,
510  GDALRasterIOExtraArg* psExtraArg) CPL_OVERRIDE;
511 
512  virtual int IGetDataCoverageStatus( int nXOff, int nYOff,
513  int nXSize, int nYSize,
514  int nMaskFlagStop,
515  double* pdfDataPct) CPL_OVERRIDE;
516 
517  virtual char **GetMetadataDomainList() CPL_OVERRIDE;
518  virtual const char *GetMetadataItem( const char * pszName,
519  const char * pszDomain = "" ) CPL_OVERRIDE;
520  virtual char **GetMetadata( const char * pszDomain = "" ) CPL_OVERRIDE;
521  virtual CPLErr SetMetadata( char ** papszMetadata,
522  const char * pszDomain = "" ) CPL_OVERRIDE;
523  virtual CPLErr SetMetadataItem( const char * pszName,
524  const char * pszValue,
525  const char * pszDomain = "" ) CPL_OVERRIDE;
526 
527  virtual CPLErr XMLInit( CPLXMLNode *, const char *, void* ) CPL_OVERRIDE;
528  virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
529 
530  virtual double GetMinimum( int *pbSuccess = NULL ) CPL_OVERRIDE;
531  virtual double GetMaximum(int *pbSuccess = NULL ) CPL_OVERRIDE;
532  virtual CPLErr ComputeRasterMinMax( int bApproxOK, double* adfMinMax ) CPL_OVERRIDE;
533  virtual CPLErr ComputeStatistics( int bApproxOK,
534  double *pdfMin, double *pdfMax,
535  double *pdfMean, double *pdfStdDev,
536  GDALProgressFunc pfnProgress,
537  void *pProgressData ) CPL_OVERRIDE;
538  virtual CPLErr GetHistogram( double dfMin, double dfMax,
539  int nBuckets, GUIntBig * panHistogram,
540  int bIncludeOutOfRange, int bApproxOK,
541  GDALProgressFunc pfnProgress,
542  void *pProgressData ) CPL_OVERRIDE;
543 
544  CPLErr AddSource( VRTSource * );
545  CPLErr AddSimpleSource( GDALRasterBand *poSrcBand,
546  double dfSrcXOff=-1, double dfSrcYOff=-1,
547  double dfSrcXSize=-1, double dfSrcYSize=-1,
548  double dfDstXOff=-1, double dfDstYOff=-1,
549  double dfDstXSize=-1, double dfDstYSize=-1,
550  const char *pszResampling = "near",
551  double dfNoDataValue = VRT_NODATA_UNSET);
552  CPLErr AddComplexSource( GDALRasterBand *poSrcBand,
553  double dfSrcXOff=-1, double dfSrcYOff=-1,
554  double dfSrcXSize=-1, double dfSrcYSize=-1,
555  double dfDstXOff=-1, double dfDstYOff=-1,
556  double dfDstXSize=-1, double dfDstYSize=-1,
557  double dfScaleOff=0.0,
558  double dfScaleRatio=1.0,
559  double dfNoDataValue = VRT_NODATA_UNSET,
560  int nColorTableComponent = 0);
561 
562  CPLErr AddMaskBandSource( GDALRasterBand *poSrcBand,
563  double dfSrcXOff=-1, double dfSrcYOff=-1,
564  double dfSrcXSize=-1,
565  double dfSrcYSize=-1,
566  double dfDstXOff=-1, double dfDstYOff=-1,
567  double dfDstXSize=-1,
568  double dfDstYSize=-1 );
569 
570  CPLErr AddFuncSource( VRTImageReadFunc pfnReadFunc, void *hCBData,
571  double dfNoDataValue = VRT_NODATA_UNSET );
572 
573  void ConfigureSource(VRTSimpleSource *poSimpleSource,
574  GDALRasterBand *poSrcBand,
575  int bAddAsMaskBand,
576  double dfSrcXOff, double dfSrcYOff,
577  double dfSrcXSize, double dfSrcYSize,
578  double dfDstXOff, double dfDstYOff,
579  double dfDstXSize, double dfDstYSize );
580 
581  virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
582 
583  virtual void GetFileList(char*** ppapszFileList, int *pnSize,
584  int *pnMaxSize, CPLHashSet* hSetFiles) CPL_OVERRIDE;
585 
586  virtual int CloseDependentDatasets() CPL_OVERRIDE;
587 
588  virtual int IsSourcedRasterBand() CPL_OVERRIDE { return TRUE; }
589 
590  virtual CPLErr FlushCache() CPL_OVERRIDE;
591 };
592 
593 /************************************************************************/
594 /* VRTWarpedRasterBand */
595 /************************************************************************/
596 
597 class CPL_DLL VRTWarpedRasterBand : public VRTRasterBand
598 {
599  public:
600  VRTWarpedRasterBand( GDALDataset *poDS, int nBand,
601  GDALDataType eType = GDT_Unknown );
602  virtual ~VRTWarpedRasterBand();
603 
604  virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
605 
606  virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
607  virtual CPLErr IWriteBlock( int, int, void * ) CPL_OVERRIDE;
608 
609  virtual int GetOverviewCount() CPL_OVERRIDE;
610  virtual GDALRasterBand *GetOverview(int) CPL_OVERRIDE;
611 };
612 /************************************************************************/
613 /* VRTPansharpenedRasterBand */
614 /************************************************************************/
615 
616 class VRTPansharpenedRasterBand : public VRTRasterBand
617 {
618  int m_nIndexAsPansharpenedBand;
619 
620  public:
621  VRTPansharpenedRasterBand(
622  GDALDataset *poDS, int nBand,
623  GDALDataType eDataType = GDT_Unknown );
624  virtual ~VRTPansharpenedRasterBand();
625 
626  virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
627 
628  virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
629 
630  virtual CPLErr IRasterIO( GDALRWFlag eRWFlag,
631  int nXOff, int nYOff, int nXSize, int nYSize,
632  void * pData, int nBufXSize, int nBufYSize,
633  GDALDataType eBufType,
634  GSpacing nPixelSpace, GSpacing nLineSpace,
635  GDALRasterIOExtraArg* psExtraArg) CPL_OVERRIDE;
636 
637  virtual int GetOverviewCount() CPL_OVERRIDE;
638  virtual GDALRasterBand *GetOverview(int) CPL_OVERRIDE;
639 
640  virtual int IsPansharpenRasterBand() CPL_OVERRIDE { return TRUE; }
641 
642  void SetIndexAsPansharpenedBand( int nIdx )
643  { m_nIndexAsPansharpenedBand = nIdx; }
644  int GetIndexAsPansharpenedBand() const
645  { return m_nIndexAsPansharpenedBand; }
646 };
647 
648 /************************************************************************/
649 /* VRTDerivedRasterBand */
650 /************************************************************************/
651 
652 class VRTDerivedRasterBandPrivateData;
653 
654 class CPL_DLL VRTDerivedRasterBand : public VRTSourcedRasterBand
655 {
656  VRTDerivedRasterBandPrivateData* m_poPrivate;
657  bool InitializePython();
658 
659  public:
660  char *pszFuncName;
661  GDALDataType eSourceTransferType;
662 
663  VRTDerivedRasterBand( GDALDataset *poDS, int nBand );
664  VRTDerivedRasterBand( GDALDataset *poDS, int nBand,
665  GDALDataType eType, int nXSize, int nYSize );
666  virtual ~VRTDerivedRasterBand();
667 
668  virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
669  void *, int, int, GDALDataType,
670  GSpacing nPixelSpace, GSpacing nLineSpace,
671  GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
672 
673  virtual int IGetDataCoverageStatus( int nXOff, int nYOff,
674  int nXSize, int nYSize,
675  int nMaskFlagStop,
676  double* pdfDataPct) CPL_OVERRIDE;
677 
678  static CPLErr AddPixelFunction( const char *pszFuncName,
679  GDALDerivedPixelFunc pfnPixelFunc );
680  static GDALDerivedPixelFunc GetPixelFunction( const char *pszFuncName );
681 
682  void SetPixelFunctionName( const char *pszFuncName );
683  void SetSourceTransferType( GDALDataType eDataType );
684 
685  virtual CPLErr XMLInit( CPLXMLNode *, const char *, void* ) CPL_OVERRIDE;
686  virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
687 
688  virtual double GetMinimum( int *pbSuccess = NULL ) CPL_OVERRIDE;
689  virtual double GetMaximum(int *pbSuccess = NULL ) CPL_OVERRIDE;
690  virtual CPLErr ComputeRasterMinMax( int bApproxOK, double* adfMinMax ) CPL_OVERRIDE;
691  virtual CPLErr ComputeStatistics( int bApproxOK,
692  double *pdfMin, double *pdfMax,
693  double *pdfMean, double *pdfStdDev,
694  GDALProgressFunc pfnProgress,
695  void *pProgressData ) CPL_OVERRIDE;
696  virtual CPLErr GetHistogram( double dfMin, double dfMax,
697  int nBuckets, GUIntBig * panHistogram,
698  int bIncludeOutOfRange, int bApproxOK,
699  GDALProgressFunc pfnProgress,
700  void *pProgressData ) CPL_OVERRIDE;
701 
702  static void Cleanup();
703 };
704 
705 /************************************************************************/
706 /* VRTRawRasterBand */
707 /************************************************************************/
708 
709 class RawRasterBand;
710 
711 class CPL_DLL VRTRawRasterBand : public VRTRasterBand
712 {
713  RawRasterBand *m_poRawRaster;
714 
715  char *m_pszSourceFilename;
716  int m_bRelativeToVRT;
717 
718  public:
719  VRTRawRasterBand( GDALDataset *poDS, int nBand,
720  GDALDataType eType = GDT_Unknown );
721  virtual ~VRTRawRasterBand();
722 
723  virtual CPLErr XMLInit( CPLXMLNode *, const char *, void* ) CPL_OVERRIDE;
724  virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
725 
726  virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
727  void *, int, int, GDALDataType,
728  GSpacing nPixelSpace, GSpacing nLineSpace,
729  GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
730 
731  virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
732  virtual CPLErr IWriteBlock( int, int, void * ) CPL_OVERRIDE;
733 
734  CPLErr SetRawLink( const char *pszFilename,
735  const char *pszVRTPath,
736  int bRelativeToVRT,
737  vsi_l_offset nImageOffset,
738  int nPixelOffset, int nLineOffset,
739  const char *pszByteOrder );
740 
741  void ClearRawLink();
742 
743  virtual void GetFileList( char*** ppapszFileList, int *pnSize,
744  int *pnMaxSize, CPLHashSet* hSetFiles ) CPL_OVERRIDE;
745 };
746 
747 /************************************************************************/
748 /* VRTDriver */
749 /************************************************************************/
750 
751 class VRTDriver : public GDALDriver
752 {
753  public:
754  VRTDriver();
755  virtual ~VRTDriver();
756 
757  char **papszSourceParsers;
758 
759  virtual char **GetMetadataDomainList() CPL_OVERRIDE;
760  virtual char **GetMetadata( const char * pszDomain = "" ) CPL_OVERRIDE;
761  virtual CPLErr SetMetadata( char ** papszMetadata,
762  const char * pszDomain = "" ) CPL_OVERRIDE;
763 
764  VRTSource *ParseSource( CPLXMLNode *psSrc, const char *pszVRTPath,
765  void* pUniqueHandle );
766  void AddSourceParser( const char *pszElementName,
767  VRTSourceParser pfnParser );
768 };
769 
770 /************************************************************************/
771 /* VRTSimpleSource */
772 /************************************************************************/
773 
774 class CPL_DLL VRTSimpleSource : public VRTSource
775 {
776 protected:
777  friend class VRTSourcedRasterBand;
778 
779  GDALRasterBand *m_poRasterBand;
780 
781  // When poRasterBand is a mask band, poMaskBandMainBand is the band
782  // from which the mask band is taken.
783  GDALRasterBand *m_poMaskBandMainBand;
784 
785  double m_dfSrcXOff;
786  double m_dfSrcYOff;
787  double m_dfSrcXSize;
788  double m_dfSrcYSize;
789 
790  double m_dfDstXOff;
791  double m_dfDstYOff;
792  double m_dfDstXSize;
793  double m_dfDstYSize;
794 
795  int m_bNoDataSet;
796  double m_dfNoDataValue;
797  CPLString m_osResampling;
798 
799  int m_nMaxValue;
800 
801  int m_bRelativeToVRTOri;
802  CPLString m_osSourceFileNameOri;
803  int m_nExplicitSharedStatus; // -1 unknown, 0 = unshared, 1 = shared
804 
805  int NeedMaxValAdjustment() const;
806 
807 public:
808  VRTSimpleSource();
809  VRTSimpleSource( const VRTSimpleSource* poSrcSource,
810  double dfXDstRatio, double dfYDstRatio );
811  virtual ~VRTSimpleSource();
812 
813  virtual CPLErr XMLInit( CPLXMLNode *psTree, const char *, void* ) CPL_OVERRIDE;
814  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
815 
816  void SetSrcBand( GDALRasterBand * );
817  void SetSrcMaskBand( GDALRasterBand * );
818  void SetSrcWindow( double, double, double, double );
819  void SetDstWindow( double, double, double, double );
820  void SetNoDataValue( double dfNoDataValue );
821  const CPLString& GetResampling() const { return m_osResampling; }
822  void SetResampling( const char* pszResampling );
823 
824  int GetSrcDstWindow( int, int, int, int, int, int,
825  double *pdfReqXOff, double *pdfReqYOff,
826  double *pdfReqXSize, double *pdfReqYSize,
827  int *, int *, int *, int *,
828  int *, int *, int *, int * );
829 
830  virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
831  void *pData, int nBufXSize, int nBufYSize,
832  GDALDataType eBufType,
833  GSpacing nPixelSpace, GSpacing nLineSpace,
834  GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
835 
836  virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
837  virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
838  virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK,
839  double* adfMinMax ) CPL_OVERRIDE;
840  virtual CPLErr ComputeStatistics( int nXSize, int nYSize,
841  int bApproxOK,
842  double *pdfMin, double *pdfMax,
843  double *pdfMean, double *pdfStdDev,
844  GDALProgressFunc pfnProgress,
845  void *pProgressData ) CPL_OVERRIDE;
846  virtual CPLErr GetHistogram( int nXSize, int nYSize,
847  double dfMin, double dfMax,
848  int nBuckets, GUIntBig * panHistogram,
849  int bIncludeOutOfRange, int bApproxOK,
850  GDALProgressFunc pfnProgress,
851  void *pProgressData ) CPL_OVERRIDE;
852 
853  void DstToSrc( double dfX, double dfY,
854  double &dfXOut, double &dfYOut );
855  void SrcToDst( double dfX, double dfY,
856  double &dfXOut, double &dfYOut );
857 
858  virtual void GetFileList( char*** ppapszFileList, int *pnSize,
859  int *pnMaxSize, CPLHashSet* hSetFiles ) CPL_OVERRIDE;
860 
861  virtual int IsSimpleSource() CPL_OVERRIDE { return TRUE; }
862  virtual const char* GetType() { return "SimpleSource"; }
863  virtual CPLErr FlushCache() CPL_OVERRIDE;
864 
865  GDALRasterBand* GetBand();
866  int IsSameExceptBandNumber( VRTSimpleSource* poOtherSource );
867  CPLErr DatasetRasterIO(
868  int nXOff, int nYOff, int nXSize, int nYSize,
869  void * pData, int nBufXSize, int nBufYSize,
870  GDALDataType eBufType,
871  int nBandCount, int *panBandMap,
872  GSpacing nPixelSpace, GSpacing nLineSpace,
873  GSpacing nBandSpace,
874  GDALRasterIOExtraArg* psExtraArg );
875 
876  void UnsetPreservedRelativeFilenames();
877 
878  void SetMaxValue( int nVal ) { m_nMaxValue = nVal; }
879 };
880 
881 /************************************************************************/
882 /* VRTAveragedSource */
883 /************************************************************************/
884 
885 class VRTAveragedSource : public VRTSimpleSource
886 {
887 public:
888  VRTAveragedSource();
889  virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
890  void *pData, int nBufXSize, int nBufYSize,
891  GDALDataType eBufType,
892  GSpacing nPixelSpace, GSpacing nLineSpace,
893  GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
894 
895  virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
896  virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
897  virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK,
898  double* adfMinMax ) CPL_OVERRIDE;
899  virtual CPLErr ComputeStatistics( int nXSize, int nYSize,
900  int bApproxOK,
901  double *pdfMin, double *pdfMax,
902  double *pdfMean, double *pdfStdDev,
903  GDALProgressFunc pfnProgress,
904  void *pProgressData ) CPL_OVERRIDE;
905  virtual CPLErr GetHistogram( int nXSize, int nYSize,
906  double dfMin, double dfMax,
907  int nBuckets, GUIntBig * panHistogram,
908  int bIncludeOutOfRange, int bApproxOK,
909  GDALProgressFunc pfnProgress,
910  void *pProgressData ) CPL_OVERRIDE;
911 
912  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
913  virtual const char* GetType() CPL_OVERRIDE { return "AveragedSource"; }
914 };
915 
916 /************************************************************************/
917 /* VRTComplexSource */
918 /************************************************************************/
919 
920 typedef enum
921 {
922  VRT_SCALING_NONE,
923  VRT_SCALING_LINEAR,
924  VRT_SCALING_EXPONENTIAL,
925 } VRTComplexSourceScaling;
926 
927 class CPL_DLL VRTComplexSource : public VRTSimpleSource
928 {
929 protected:
930  VRTComplexSourceScaling m_eScalingType;
931  double m_dfScaleOff; // For linear scaling.
932  double m_dfScaleRatio; // For linear scaling.
933 
934  // For non-linear scaling with a power function.
935  int m_bSrcMinMaxDefined;
936  double m_dfSrcMin;
937  double m_dfSrcMax;
938  double m_dfDstMin;
939  double m_dfDstMax;
940  double m_dfExponent;
941 
942  int m_nColorTableComponent;
943 
944  template <class WorkingDT>
945  CPLErr RasterIOInternal( int nReqXOff, int nReqYOff,
946  int nReqXSize, int nReqYSize,
947  void *pData, int nOutXSize, int nOutYSize,
948  GDALDataType eBufType,
949  GSpacing nPixelSpace, GSpacing nLineSpace,
950  GDALRasterIOExtraArg* psExtraArg,
951  GDALDataType eWrkDataType );
952 
953 public:
954  VRTComplexSource();
955  VRTComplexSource(const VRTComplexSource* poSrcSource,
956  double dfXDstRatio, double dfYDstRatio);
957  virtual ~VRTComplexSource();
958 
959  virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
960  void *pData, int nBufXSize, int nBufYSize,
961  GDALDataType eBufType,
962  GSpacing nPixelSpace, GSpacing nLineSpace,
963  GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
964 
965  virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
966  virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
967  virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK,
968  double* adfMinMax ) CPL_OVERRIDE;
969  virtual CPLErr ComputeStatistics( int nXSize, int nYSize,
970  int bApproxOK,
971  double *pdfMin, double *pdfMax,
972  double *pdfMean, double *pdfStdDev,
973  GDALProgressFunc pfnProgress,
974  void *pProgressData ) CPL_OVERRIDE;
975  virtual CPLErr GetHistogram( int nXSize, int nYSize,
976  double dfMin, double dfMax,
977  int nBuckets, GUIntBig * panHistogram,
978  int bIncludeOutOfRange, int bApproxOK,
979  GDALProgressFunc pfnProgress,
980  void *pProgressData ) CPL_OVERRIDE;
981 
982  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
983  virtual CPLErr XMLInit( CPLXMLNode *, const char *, void* ) CPL_OVERRIDE;
984  virtual const char* GetType() CPL_OVERRIDE { return "ComplexSource"; }
985 
986  double LookupValue( double dfInput );
987 
988  void SetLinearScaling( double dfOffset, double dfScale );
989  void SetPowerScaling( double dfExponent,
990  double dfSrcMin,
991  double dfSrcMax,
992  double dfDstMin,
993  double dfDstMax );
994  void SetColorTableComponent( int nComponent );
995 
996  double *m_padfLUTInputs;
997  double *m_padfLUTOutputs;
998  int m_nLUTItemCount;
999 };
1000 
1001 /************************************************************************/
1002 /* VRTFilteredSource */
1003 /************************************************************************/
1004 
1005 class VRTFilteredSource : public VRTComplexSource
1006 {
1007 private:
1008  int IsTypeSupported( GDALDataType eType );
1009 
1010 protected:
1011  int m_nSupportedTypesCount;
1012  GDALDataType m_aeSupportedTypes[20];
1013 
1014  int m_nExtraEdgePixels;
1015 
1016 public:
1017  VRTFilteredSource();
1018  virtual ~VRTFilteredSource();
1019 
1020  void SetExtraEdgePixels( int );
1021  void SetFilteringDataTypesSupported( int, GDALDataType * );
1022 
1023  virtual CPLErr FilterData( int nXSize, int nYSize, GDALDataType eType,
1024  GByte *pabySrcData, GByte *pabyDstData ) = 0;
1025 
1026  virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
1027  void *pData, int nBufXSize, int nBufYSize,
1028  GDALDataType eBufType,
1029  GSpacing nPixelSpace, GSpacing nLineSpace,
1030  GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
1031 };
1032 
1033 /************************************************************************/
1034 /* VRTKernelFilteredSource */
1035 /************************************************************************/
1036 
1037 class VRTKernelFilteredSource : public VRTFilteredSource
1038 {
1039 protected:
1040  int m_nKernelSize;
1041 
1042  bool m_bSeparable;
1043 
1044  double *m_padfKernelCoefs;
1045 
1046  int m_bNormalized;
1047 
1048 public:
1049  VRTKernelFilteredSource();
1050  virtual ~VRTKernelFilteredSource();
1051 
1052  virtual CPLErr XMLInit( CPLXMLNode *psTree, const char *, void* ) CPL_OVERRIDE;
1053  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
1054 
1055  virtual CPLErr FilterData( int nXSize, int nYSize, GDALDataType eType,
1056  GByte *pabySrcData, GByte *pabyDstData ) CPL_OVERRIDE;
1057 
1058  CPLErr SetKernel( int nKernelSize, bool bSeparable, double *padfCoefs );
1059  void SetNormalized( int );
1060 };
1061 
1062 /************************************************************************/
1063 /* VRTAverageFilteredSource */
1064 /************************************************************************/
1065 
1066 class VRTAverageFilteredSource : public VRTKernelFilteredSource
1067 {
1068 public:
1069  explicit VRTAverageFilteredSource( int nKernelSize );
1070  virtual ~VRTAverageFilteredSource();
1071 
1072  virtual CPLErr XMLInit( CPLXMLNode *psTree, const char *, void* ) CPL_OVERRIDE;
1073  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
1074 };
1075 
1076 /************************************************************************/
1077 /* VRTFuncSource */
1078 /************************************************************************/
1079 class VRTFuncSource : public VRTSource
1080 {
1081 public:
1082  VRTFuncSource();
1083  virtual ~VRTFuncSource();
1084 
1085  virtual CPLErr XMLInit( CPLXMLNode *, const char *, void* ) CPL_OVERRIDE { return CE_Failure; }
1086  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
1087 
1088  virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
1089  void *pData, int nBufXSize, int nBufYSize,
1090  GDALDataType eBufType,
1091  GSpacing nPixelSpace, GSpacing nLineSpace,
1092  GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
1093 
1094  virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
1095  virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
1096  virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK,
1097  double* adfMinMax ) CPL_OVERRIDE;
1098  virtual CPLErr ComputeStatistics( int nXSize, int nYSize,
1099  int bApproxOK,
1100  double *pdfMin, double *pdfMax,
1101  double *pdfMean, double *pdfStdDev,
1102  GDALProgressFunc pfnProgress,
1103  void *pProgressData ) CPL_OVERRIDE;
1104  virtual CPLErr GetHistogram( int nXSize, int nYSize,
1105  double dfMin, double dfMax,
1106  int nBuckets, GUIntBig * panHistogram,
1107  int bIncludeOutOfRange, int bApproxOK,
1108  GDALProgressFunc pfnProgress,
1109  void *pProgressData ) CPL_OVERRIDE;
1110 
1111  VRTImageReadFunc pfnReadFunc;
1112  void *pCBData;
1113  GDALDataType eType;
1114 
1115  float fNoDataValue;
1116 };
1117 
1118 #endif /* #ifndef DOXYGEN_SKIP */
1119 
1120 #endif /* ndef VIRTUALDATASET_H_INCLUDED */
CPLErr(* VRTImageReadFunc)(void *hCBData, int nXOff, int nYOff, int nXSize, int nYSize, void *pData)
Type for a function that returns the pixel data in a provided window.
Definition: gdal_vrt.h:51
GDALDataType
Definition: gdal.h:57
Document node structure.
Definition: cpl_minixml.h:66
virtual void FlushCache(void)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:430
C++ GDAL entry points.
#define CPL_OVERRIDE
To be used in public headers only.
Definition: cpl_port.h:1035
virtual const char * GetProjectionRef(void)
Fetch the projection definition string for this dataset.
Definition: gdaldataset.cpp:857
GDALRWFlag
Definition: gdal.h:113
CPLErr(* GDALDerivedPixelFunc)(void **papoSources, int nSources, void *pData, int nBufXSize, int nBufYSize, GDALDataType eSrcType, GDALDataType eBufType, int nPixelSpace, int nLineSpace)
Type of functions to pass to GDALAddDerivedBandPixelFunc.
Definition: gdal.h:755
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:207
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition: gdal.h:252
Pansharpening operation class.
Definition: gdalpansharpen.h:188
Convenient string class based on std::string.
Definition: cpl_string.h:338
Hash set implementation.
Definition: gdal.h:58
#define VRT_NODATA_UNSET
Special value to indicate that nodata is not set.
Definition: gdal_vrt.h:45
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition: gdal.h:267
int Dereference()
Subtract one from dataset reference count.
Definition: gdaldataset.cpp:1163
Class for dataset open functions.
Definition: gdal_priv.h:248
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:449
Structure to pass extra arguments to RasterIO() method.
Definition: gdal.h:141
High level image warping class.
Definition: gdalwarper.h:438
virtual int CloseDependentDatasets()
Drop references to any other datasets referenced by this dataset.
Definition: gdaldataset.cpp:3432
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:2477
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:233
void GDALClose(GDALDatasetH)
Close GDAL dataset.
Definition: gdaldataset.cpp:3059
Object with metadata.
Definition: gdal_priv.h:127
GDALDataset * GetDataset()
Fetch the owning dataset handle.
Definition: gdalrasterband.cpp:2841
GUIntBig vsi_l_offset
Type for a file offset.
Definition: cpl_vsi.h:138
A single raster band (or channel).
Definition: gdal_priv.h:834
GDALAccess
Definition: gdal.h:107
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:324
GDALColorInterp
Definition: gdal.h:184
virtual CPLErr SetNoDataValue(double dfNoData)
Set the no data value for this band.
Definition: gdalrasterband.cpp:1684
Public (C callable) entry points for virtual GDAL dataset objects.
struct _CPLHashSet CPLHashSet
Opaque type for a hash set.
Definition: cpl_hash_set.h:52
int GetShared() const
Returns shared flag.
Definition: gdaldataset.cpp:1237
Definition: gdal.h:108
Format specific driver.
Definition: gdal_priv.h:1165
A color table / palette.
Definition: gdal_priv.h:754
Ground Control Point.
Definition: gdal.h:549
CPLErr
Error category.
Definition: cpl_error.h:52

Generated for GDAL by doxygen 1.8.8.