GDAL
vrtdataset.h
1 /******************************************************************************
2  * $Id: vrtdataset.h 39769 2017-08-07 14:22:04Z 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 CPLXMLNode *SerializeToXML( const char *pszVRTPath);
204  virtual CPLErr XMLInit( CPLXMLNode *, const char * );
205 
206  virtual CPLErr IBuildOverviews( const char *, int, int *,
207  int, int *, GDALProgressFunc, void * ) CPL_OVERRIDE;
208 
209  /* Used by PDF driver for example */
210  GDALDataset* GetSingleSimpleSource();
211  void BuildVirtualOverviews();
212 
213  void UnsetPreservedRelativeFilenames();
214 
215  static int Identify( GDALOpenInfo * );
216  static GDALDataset *Open( GDALOpenInfo * );
217  static GDALDataset *OpenXML( const char *, const char * = NULL,
218  GDALAccess eAccess = GA_ReadOnly );
219  static GDALDataset *Create( const char * pszName,
220  int nXSize, int nYSize, int nBands,
221  GDALDataType eType, char ** papszOptions );
222  static CPLErr Delete( const char * pszFilename );
223 };
224 
225 /************************************************************************/
226 /* VRTWarpedDataset */
227 /************************************************************************/
228 
229 class GDALWarpOperation;
230 class VRTWarpedRasterBand;
231 
232 class CPL_DLL VRTWarpedDataset : public VRTDataset
233 {
234  int m_nBlockXSize;
235  int m_nBlockYSize;
236  GDALWarpOperation *m_poWarper;
237 
238  int m_nOverviewCount;
239  VRTWarpedDataset **m_papoOverviews;
240  int m_nSrcOvrLevel;
241 
242  void CreateImplicitOverviews();
243 
244  struct VerticalShiftGrid
245  {
246  CPLString osVGrids;
247  int bInverse;
248  double dfToMeterSrc;
249  double dfToMeterDest;
250  CPLStringList aosOptions;
251  };
252  std::vector<VerticalShiftGrid> m_aoVerticalShiftGrids;
253 
254  friend class VRTWarpedRasterBand;
255 
256  protected:
257  virtual int CloseDependentDatasets() CPL_OVERRIDE;
258 
259 public:
260  VRTWarpedDataset( int nXSize, int nYSize );
261  virtual ~VRTWarpedDataset();
262 
263  CPLErr Initialize( /* GDALWarpOptions */ void * );
264 
265  virtual CPLErr IBuildOverviews( const char *, int, int *,
266  int, int *, GDALProgressFunc, void * ) CPL_OVERRIDE;
267 
268  virtual CPLErr SetMetadataItem( const char *pszName, const char *pszValue,
269  const char *pszDomain = "" ) CPL_OVERRIDE;
270 
271  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
272  virtual CPLErr XMLInit( CPLXMLNode *, const char * ) CPL_OVERRIDE;
273 
274  virtual CPLErr AddBand( GDALDataType eType,
275  char **papszOptions=NULL ) CPL_OVERRIDE;
276 
277  virtual char **GetFileList() CPL_OVERRIDE;
278 
279  CPLErr ProcessBlock( int iBlockX, int iBlockY );
280 
281  void GetBlockSize( int *, int * );
282 
283  void SetApplyVerticalShiftGrid(const char* pszVGrids,
284  int bInverse,
285  double dfToMeterSrc,
286  double dfToMeterDest,
287  char** papszOptions );
288 };
289 
290 /************************************************************************/
291 /* VRTPansharpenedDataset */
292 /************************************************************************/
293 
295 
296 typedef enum
297 {
298  GTAdjust_Union,
299  GTAdjust_Intersection,
300  GTAdjust_None,
301  GTAdjust_NoneWithoutWarning
302 } GTAdjustment;
303 
304 class VRTPansharpenedDataset : public VRTDataset
305 {
306  friend class VRTPansharpenedRasterBand;
307 
308  int m_nBlockXSize;
309  int m_nBlockYSize;
310  GDALPansharpenOperation* m_poPansharpener;
311  VRTPansharpenedDataset* m_poMainDataset;
312  std::vector<VRTPansharpenedDataset*> m_apoOverviewDatasets;
313  // Map from absolute to relative.
314  std::map<CPLString,CPLString> m_oMapToRelativeFilenames;
315 
316  int m_bLoadingOtherBands;
317 
318  GByte *m_pabyLastBufferBandRasterIO;
319  int m_nLastBandRasterIOXOff;
320  int m_nLastBandRasterIOYOff;
321  int m_nLastBandRasterIOXSize;
322  int m_nLastBandRasterIOYSize;
323  GDALDataType m_eLastBandRasterIODataType;
324 
325  GTAdjustment m_eGTAdjustment;
326  int m_bNoDataDisabled;
327 
328  std::vector<GDALDataset*> m_apoDatasetsToClose;
329 
330  protected:
331  virtual int CloseDependentDatasets() CPL_OVERRIDE;
332 
333 public:
334  VRTPansharpenedDataset( int nXSize, int nYSize );
335  virtual ~VRTPansharpenedDataset();
336 
337  virtual CPLErr XMLInit( CPLXMLNode *, const char * ) CPL_OVERRIDE;
338  virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
339 
340  CPLErr XMLInit( CPLXMLNode *psTree, const char *pszVRTPath,
341  GDALRasterBandH hPanchroBandIn,
342  int nInputSpectralBandsIn,
343  GDALRasterBandH* pahInputSpectralBandsIn );
344 
345  virtual CPLErr AddBand( GDALDataType eType,
346  char **papszOptions=NULL ) CPL_OVERRIDE;
347 
348  virtual char **GetFileList() CPL_OVERRIDE;
349 
350  virtual CPLErr IRasterIO( GDALRWFlag eRWFlag,
351  int nXOff, int nYOff, int nXSize, int nYSize,
352  void * pData, int nBufXSize, int nBufYSize,
353  GDALDataType eBufType,
354  int nBandCount, int *panBandMap,
355  GSpacing nPixelSpace, GSpacing nLineSpace,
356  GSpacing nBandSpace,
357  GDALRasterIOExtraArg* psExtraArg) CPL_OVERRIDE;
358 
359  void GetBlockSize( int *, int * );
360 
361  GDALPansharpenOperation* GetPansharpener() { return m_poPansharpener; }
362 };
363 
364 /************************************************************************/
365 /* VRTRasterBand */
366 /* */
367 /* Provides support for all the various kinds of metadata but */
368 /* no raster access. That is handled by derived classes. */
369 /************************************************************************/
370 
371 class CPL_DLL VRTRasterBand : public GDALRasterBand
372 {
373  protected:
374  int m_bIsMaskBand;
375 
376  int m_bNoDataValueSet;
377  // If set to true, will not report the existence of nodata.
378  int m_bHideNoDataValue;
379  double m_dfNoDataValue;
380 
381  GDALColorTable *m_poColorTable;
382 
383  GDALColorInterp m_eColorInterp;
384 
385  char *m_pszUnitType;
386  char **m_papszCategoryNames;
387 
388  double m_dfOffset;
389  double m_dfScale;
390 
391  CPLXMLNode *m_psSavedHistograms;
392 
393  void Initialize( int nXSize, int nYSize );
394 
395  std::vector<VRTOverviewInfo> m_apoOverviews;
396 
397  VRTRasterBand *m_poMaskBand;
398 
399  public:
400 
401  VRTRasterBand();
402  virtual ~VRTRasterBand();
403 
404  virtual CPLErr XMLInit( CPLXMLNode *, const char *, void* );
405  virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath );
406 
407  virtual CPLErr SetNoDataValue( double ) CPL_OVERRIDE;
408  virtual double GetNoDataValue( int *pbSuccess = NULL ) CPL_OVERRIDE;
409  virtual CPLErr DeleteNoDataValue() CPL_OVERRIDE;
410 
411  virtual CPLErr SetColorTable( GDALColorTable * ) CPL_OVERRIDE;
412  virtual GDALColorTable *GetColorTable() CPL_OVERRIDE;
413 
414  virtual CPLErr SetColorInterpretation( GDALColorInterp ) CPL_OVERRIDE;
415  virtual GDALColorInterp GetColorInterpretation() CPL_OVERRIDE;
416 
417  virtual const char *GetUnitType() CPL_OVERRIDE;
418  CPLErr SetUnitType( const char * ) CPL_OVERRIDE;
419 
420  virtual char **GetCategoryNames() CPL_OVERRIDE;
421  virtual CPLErr SetCategoryNames( char ** ) CPL_OVERRIDE;
422 
423  virtual CPLErr SetMetadata( char **papszMD, const char *pszDomain = "" ) CPL_OVERRIDE;
424  virtual CPLErr SetMetadataItem( const char *pszName, const char *pszValue,
425  const char *pszDomain = "" ) CPL_OVERRIDE;
426 
427  virtual double GetOffset( int *pbSuccess = NULL ) CPL_OVERRIDE;
428  CPLErr SetOffset( double ) CPL_OVERRIDE;
429  virtual double GetScale( int *pbSuccess = NULL ) CPL_OVERRIDE;
430  CPLErr SetScale( double ) CPL_OVERRIDE;
431 
432  virtual int GetOverviewCount() CPL_OVERRIDE;
433  virtual GDALRasterBand *GetOverview(int) CPL_OVERRIDE;
434 
435  virtual CPLErr GetHistogram( double dfMin, double dfMax,
436  int nBuckets, GUIntBig * panHistogram,
437  int bIncludeOutOfRange, int bApproxOK,
438  GDALProgressFunc, void *pProgressData ) CPL_OVERRIDE;
439 
440  virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
441  int *pnBuckets, GUIntBig ** ppanHistogram,
442  int bForce,
443  GDALProgressFunc, void *pProgressData) CPL_OVERRIDE;
444 
445  virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
446  int nBuckets, GUIntBig *panHistogram ) CPL_OVERRIDE;
447 
448  CPLErr CopyCommonInfoFrom( GDALRasterBand * );
449 
450  virtual void GetFileList(char*** ppapszFileList, int *pnSize,
451  int *pnMaxSize, CPLHashSet* hSetFiles);
452 
453  virtual void SetDescription( const char * ) CPL_OVERRIDE;
454 
455  virtual GDALRasterBand *GetMaskBand() CPL_OVERRIDE;
456  virtual int GetMaskFlags() CPL_OVERRIDE;
457 
458  virtual CPLErr CreateMaskBand( int nFlags ) CPL_OVERRIDE;
459 
460  void SetMaskBand(VRTRasterBand* poMaskBand);
461 
462  void SetIsMaskBand();
463 
464  CPLErr UnsetNoDataValue();
465 
466  virtual int CloseDependentDatasets();
467 
468  virtual int IsSourcedRasterBand() { return FALSE; }
469  virtual int IsPansharpenRasterBand() { return FALSE; }
470 };
471 
472 /************************************************************************/
473 /* VRTSourcedRasterBand */
474 /************************************************************************/
475 
476 class VRTSimpleSource;
477 
478 class CPL_DLL VRTSourcedRasterBand : public VRTRasterBand
479 {
480  private:
481  int m_nRecursionCounter;
482  CPLString m_osLastLocationInfo;
483  char **m_papszSourceList;
484 
485  bool CanUseSourcesMinMaxImplementations();
486  void CheckSource( VRTSimpleSource *poSS );
487 
488  public:
489  int nSources;
490  VRTSource **papoSources;
491  int bSkipBufferInitialization;
492 
493  VRTSourcedRasterBand( GDALDataset *poDS, int nBand );
494  VRTSourcedRasterBand( GDALDataType eType,
495  int nXSize, int nYSize );
496  VRTSourcedRasterBand( GDALDataset *poDS, int nBand,
497  GDALDataType eType,
498  int nXSize, int nYSize );
499  virtual ~VRTSourcedRasterBand();
500 
501  virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
502  void *, int, int, GDALDataType,
503  GSpacing nPixelSpace, GSpacing nLineSpace,
504  GDALRasterIOExtraArg* psExtraArg) CPL_OVERRIDE;
505 
506  virtual int IGetDataCoverageStatus( int nXOff, int nYOff,
507  int nXSize, int nYSize,
508  int nMaskFlagStop,
509  double* pdfDataPct) CPL_OVERRIDE;
510 
511  virtual char **GetMetadataDomainList() CPL_OVERRIDE;
512  virtual const char *GetMetadataItem( const char * pszName,
513  const char * pszDomain = "" ) CPL_OVERRIDE;
514  virtual char **GetMetadata( const char * pszDomain = "" ) CPL_OVERRIDE;
515  virtual CPLErr SetMetadata( char ** papszMetadata,
516  const char * pszDomain = "" ) CPL_OVERRIDE;
517  virtual CPLErr SetMetadataItem( const char * pszName,
518  const char * pszValue,
519  const char * pszDomain = "" ) CPL_OVERRIDE;
520 
521  virtual CPLErr XMLInit( CPLXMLNode *, const char *, void* ) CPL_OVERRIDE;
522  virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
523 
524  virtual double GetMinimum( int *pbSuccess = NULL ) CPL_OVERRIDE;
525  virtual double GetMaximum(int *pbSuccess = NULL ) CPL_OVERRIDE;
526  virtual CPLErr ComputeRasterMinMax( int bApproxOK, double* adfMinMax ) CPL_OVERRIDE;
527  virtual CPLErr ComputeStatistics( int bApproxOK,
528  double *pdfMin, double *pdfMax,
529  double *pdfMean, double *pdfStdDev,
530  GDALProgressFunc pfnProgress,
531  void *pProgressData ) CPL_OVERRIDE;
532  virtual CPLErr GetHistogram( double dfMin, double dfMax,
533  int nBuckets, GUIntBig * panHistogram,
534  int bIncludeOutOfRange, int bApproxOK,
535  GDALProgressFunc pfnProgress,
536  void *pProgressData ) CPL_OVERRIDE;
537 
538  CPLErr AddSource( VRTSource * );
539  CPLErr AddSimpleSource( GDALRasterBand *poSrcBand,
540  double dfSrcXOff=-1, double dfSrcYOff=-1,
541  double dfSrcXSize=-1, double dfSrcYSize=-1,
542  double dfDstXOff=-1, double dfDstYOff=-1,
543  double dfDstXSize=-1, double dfDstYSize=-1,
544  const char *pszResampling = "near",
545  double dfNoDataValue = VRT_NODATA_UNSET);
546  CPLErr AddComplexSource( GDALRasterBand *poSrcBand,
547  double dfSrcXOff=-1, double dfSrcYOff=-1,
548  double dfSrcXSize=-1, double dfSrcYSize=-1,
549  double dfDstXOff=-1, double dfDstYOff=-1,
550  double dfDstXSize=-1, double dfDstYSize=-1,
551  double dfScaleOff=0.0,
552  double dfScaleRatio=1.0,
553  double dfNoDataValue = VRT_NODATA_UNSET,
554  int nColorTableComponent = 0);
555 
556  CPLErr AddMaskBandSource( GDALRasterBand *poSrcBand,
557  double dfSrcXOff=-1, double dfSrcYOff=-1,
558  double dfSrcXSize=-1,
559  double dfSrcYSize=-1,
560  double dfDstXOff=-1, double dfDstYOff=-1,
561  double dfDstXSize=-1,
562  double dfDstYSize=-1 );
563 
564  CPLErr AddFuncSource( VRTImageReadFunc pfnReadFunc, void *hCBData,
565  double dfNoDataValue = VRT_NODATA_UNSET );
566 
567  void ConfigureSource(VRTSimpleSource *poSimpleSource,
568  GDALRasterBand *poSrcBand,
569  int bAddAsMaskBand,
570  double dfSrcXOff, double dfSrcYOff,
571  double dfSrcXSize, double dfSrcYSize,
572  double dfDstXOff, double dfDstYOff,
573  double dfDstXSize, double dfDstYSize );
574 
575  virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
576 
577  virtual void GetFileList(char*** ppapszFileList, int *pnSize,
578  int *pnMaxSize, CPLHashSet* hSetFiles) CPL_OVERRIDE;
579 
580  virtual int CloseDependentDatasets() CPL_OVERRIDE;
581 
582  virtual int IsSourcedRasterBand() CPL_OVERRIDE { return TRUE; }
583 
584  virtual CPLErr FlushCache() CPL_OVERRIDE;
585 };
586 
587 /************************************************************************/
588 /* VRTWarpedRasterBand */
589 /************************************************************************/
590 
591 class CPL_DLL VRTWarpedRasterBand : public VRTRasterBand
592 {
593  public:
594  VRTWarpedRasterBand( GDALDataset *poDS, int nBand,
595  GDALDataType eType = GDT_Unknown );
596  virtual ~VRTWarpedRasterBand();
597 
598  virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
599 
600  virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
601  virtual CPLErr IWriteBlock( int, int, void * ) CPL_OVERRIDE;
602 
603  virtual int GetOverviewCount() CPL_OVERRIDE;
604  virtual GDALRasterBand *GetOverview(int) CPL_OVERRIDE;
605 };
606 /************************************************************************/
607 /* VRTPansharpenedRasterBand */
608 /************************************************************************/
609 
610 class VRTPansharpenedRasterBand : public VRTRasterBand
611 {
612  int m_nIndexAsPansharpenedBand;
613 
614  public:
615  VRTPansharpenedRasterBand(
616  GDALDataset *poDS, int nBand,
617  GDALDataType eDataType = GDT_Unknown );
618  virtual ~VRTPansharpenedRasterBand();
619 
620  virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
621 
622  virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
623 
624  virtual CPLErr IRasterIO( GDALRWFlag eRWFlag,
625  int nXOff, int nYOff, int nXSize, int nYSize,
626  void * pData, int nBufXSize, int nBufYSize,
627  GDALDataType eBufType,
628  GSpacing nPixelSpace, GSpacing nLineSpace,
629  GDALRasterIOExtraArg* psExtraArg) CPL_OVERRIDE;
630 
631  virtual int GetOverviewCount() CPL_OVERRIDE;
632  virtual GDALRasterBand *GetOverview(int) CPL_OVERRIDE;
633 
634  virtual int IsPansharpenRasterBand() CPL_OVERRIDE { return TRUE; }
635 
636  void SetIndexAsPansharpenedBand( int nIdx )
637  { m_nIndexAsPansharpenedBand = nIdx; }
638  int GetIndexAsPansharpenedBand() const
639  { return m_nIndexAsPansharpenedBand; }
640 };
641 
642 /************************************************************************/
643 /* VRTDerivedRasterBand */
644 /************************************************************************/
645 
646 class VRTDerivedRasterBandPrivateData;
647 
648 class CPL_DLL VRTDerivedRasterBand : public VRTSourcedRasterBand
649 {
650  VRTDerivedRasterBandPrivateData* m_poPrivate;
651  bool InitializePython();
652 
653  public:
654  char *pszFuncName;
655  GDALDataType eSourceTransferType;
656 
657  VRTDerivedRasterBand( GDALDataset *poDS, int nBand );
658  VRTDerivedRasterBand( GDALDataset *poDS, int nBand,
659  GDALDataType eType, int nXSize, int nYSize );
660  virtual ~VRTDerivedRasterBand();
661 
662  virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
663  void *, int, int, GDALDataType,
664  GSpacing nPixelSpace, GSpacing nLineSpace,
665  GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
666 
667  virtual int IGetDataCoverageStatus( int nXOff, int nYOff,
668  int nXSize, int nYSize,
669  int nMaskFlagStop,
670  double* pdfDataPct) CPL_OVERRIDE;
671 
672  static CPLErr AddPixelFunction( const char *pszFuncName,
673  GDALDerivedPixelFunc pfnPixelFunc );
674  static GDALDerivedPixelFunc GetPixelFunction( const char *pszFuncName );
675 
676  void SetPixelFunctionName( const char *pszFuncName );
677  void SetSourceTransferType( GDALDataType eDataType );
678 
679  virtual CPLErr XMLInit( CPLXMLNode *, const char *, void* ) CPL_OVERRIDE;
680  virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
681 
682  virtual double GetMinimum( int *pbSuccess = NULL ) CPL_OVERRIDE;
683  virtual double GetMaximum(int *pbSuccess = NULL ) CPL_OVERRIDE;
684  virtual CPLErr ComputeRasterMinMax( int bApproxOK, double* adfMinMax ) CPL_OVERRIDE;
685  virtual CPLErr ComputeStatistics( int bApproxOK,
686  double *pdfMin, double *pdfMax,
687  double *pdfMean, double *pdfStdDev,
688  GDALProgressFunc pfnProgress,
689  void *pProgressData ) CPL_OVERRIDE;
690  virtual CPLErr GetHistogram( double dfMin, double dfMax,
691  int nBuckets, GUIntBig * panHistogram,
692  int bIncludeOutOfRange, int bApproxOK,
693  GDALProgressFunc pfnProgress,
694  void *pProgressData ) CPL_OVERRIDE;
695 
696  static void Cleanup();
697 };
698 
699 /************************************************************************/
700 /* VRTRawRasterBand */
701 /************************************************************************/
702 
703 class RawRasterBand;
704 
705 class CPL_DLL VRTRawRasterBand : public VRTRasterBand
706 {
707  RawRasterBand *m_poRawRaster;
708 
709  char *m_pszSourceFilename;
710  int m_bRelativeToVRT;
711 
712  public:
713  VRTRawRasterBand( GDALDataset *poDS, int nBand,
714  GDALDataType eType = GDT_Unknown );
715  virtual ~VRTRawRasterBand();
716 
717  virtual CPLErr XMLInit( CPLXMLNode *, const char *, void* ) CPL_OVERRIDE;
718  virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
719 
720  virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
721  void *, int, int, GDALDataType,
722  GSpacing nPixelSpace, GSpacing nLineSpace,
723  GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
724 
725  virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
726  virtual CPLErr IWriteBlock( int, int, void * ) CPL_OVERRIDE;
727 
728  CPLErr SetRawLink( const char *pszFilename,
729  const char *pszVRTPath,
730  int bRelativeToVRT,
731  vsi_l_offset nImageOffset,
732  int nPixelOffset, int nLineOffset,
733  const char *pszByteOrder );
734 
735  void ClearRawLink();
736 
737  virtual void GetFileList( char*** ppapszFileList, int *pnSize,
738  int *pnMaxSize, CPLHashSet* hSetFiles ) CPL_OVERRIDE;
739 };
740 
741 /************************************************************************/
742 /* VRTDriver */
743 /************************************************************************/
744 
745 class VRTDriver : public GDALDriver
746 {
747  public:
748  VRTDriver();
749  virtual ~VRTDriver();
750 
751  char **papszSourceParsers;
752 
753  virtual char **GetMetadataDomainList() CPL_OVERRIDE;
754  virtual char **GetMetadata( const char * pszDomain = "" ) CPL_OVERRIDE;
755  virtual CPLErr SetMetadata( char ** papszMetadata,
756  const char * pszDomain = "" ) CPL_OVERRIDE;
757 
758  VRTSource *ParseSource( CPLXMLNode *psSrc, const char *pszVRTPath,
759  void* pUniqueHandle );
760  void AddSourceParser( const char *pszElementName,
761  VRTSourceParser pfnParser );
762 };
763 
764 /************************************************************************/
765 /* VRTSimpleSource */
766 /************************************************************************/
767 
768 class CPL_DLL VRTSimpleSource : public VRTSource
769 {
770 protected:
771  friend class VRTSourcedRasterBand;
772 
773  GDALRasterBand *m_poRasterBand;
774 
775  // When poRasterBand is a mask band, poMaskBandMainBand is the band
776  // from which the mask band is taken.
777  GDALRasterBand *m_poMaskBandMainBand;
778 
779  double m_dfSrcXOff;
780  double m_dfSrcYOff;
781  double m_dfSrcXSize;
782  double m_dfSrcYSize;
783 
784  double m_dfDstXOff;
785  double m_dfDstYOff;
786  double m_dfDstXSize;
787  double m_dfDstYSize;
788 
789  int m_bNoDataSet;
790  double m_dfNoDataValue;
791  CPLString m_osResampling;
792 
793  int m_nMaxValue;
794 
795  int m_bRelativeToVRTOri;
796  CPLString m_osSourceFileNameOri;
797  int m_nExplicitSharedStatus; // -1 unknown, 0 = unshared, 1 = shared
798 
799  int NeedMaxValAdjustment() const;
800 
801 public:
802  VRTSimpleSource();
803  VRTSimpleSource( const VRTSimpleSource* poSrcSource,
804  double dfXDstRatio, double dfYDstRatio );
805  virtual ~VRTSimpleSource();
806 
807  virtual CPLErr XMLInit( CPLXMLNode *psTree, const char *, void* ) CPL_OVERRIDE;
808  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
809 
810  void SetSrcBand( GDALRasterBand * );
811  void SetSrcMaskBand( GDALRasterBand * );
812  void SetSrcWindow( double, double, double, double );
813  void SetDstWindow( double, double, double, double );
814  void SetNoDataValue( double dfNoDataValue );
815  const CPLString& GetResampling() const { return m_osResampling; }
816  void SetResampling( const char* pszResampling );
817 
818  int GetSrcDstWindow( int, int, int, int, int, int,
819  double *pdfReqXOff, double *pdfReqYOff,
820  double *pdfReqXSize, double *pdfReqYSize,
821  int *, int *, int *, int *,
822  int *, int *, int *, int * );
823 
824  virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
825  void *pData, int nBufXSize, int nBufYSize,
826  GDALDataType eBufType,
827  GSpacing nPixelSpace, GSpacing nLineSpace,
828  GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
829 
830  virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
831  virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
832  virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK,
833  double* adfMinMax ) CPL_OVERRIDE;
834  virtual CPLErr ComputeStatistics( int nXSize, int nYSize,
835  int bApproxOK,
836  double *pdfMin, double *pdfMax,
837  double *pdfMean, double *pdfStdDev,
838  GDALProgressFunc pfnProgress,
839  void *pProgressData ) CPL_OVERRIDE;
840  virtual CPLErr GetHistogram( int nXSize, int nYSize,
841  double dfMin, double dfMax,
842  int nBuckets, GUIntBig * panHistogram,
843  int bIncludeOutOfRange, int bApproxOK,
844  GDALProgressFunc pfnProgress,
845  void *pProgressData ) CPL_OVERRIDE;
846 
847  void DstToSrc( double dfX, double dfY,
848  double &dfXOut, double &dfYOut );
849  void SrcToDst( double dfX, double dfY,
850  double &dfXOut, double &dfYOut );
851 
852  virtual void GetFileList( char*** ppapszFileList, int *pnSize,
853  int *pnMaxSize, CPLHashSet* hSetFiles ) CPL_OVERRIDE;
854 
855  virtual int IsSimpleSource() CPL_OVERRIDE { return TRUE; }
856  virtual const char* GetType() { return "SimpleSource"; }
857  virtual CPLErr FlushCache() CPL_OVERRIDE;
858 
859  GDALRasterBand* GetBand();
860  int IsSameExceptBandNumber( VRTSimpleSource* poOtherSource );
861  CPLErr DatasetRasterIO(
862  int nXOff, int nYOff, int nXSize, int nYSize,
863  void * pData, int nBufXSize, int nBufYSize,
864  GDALDataType eBufType,
865  int nBandCount, int *panBandMap,
866  GSpacing nPixelSpace, GSpacing nLineSpace,
867  GSpacing nBandSpace,
868  GDALRasterIOExtraArg* psExtraArg );
869 
870  void UnsetPreservedRelativeFilenames();
871 
872  void SetMaxValue( int nVal ) { m_nMaxValue = nVal; }
873 };
874 
875 /************************************************************************/
876 /* VRTAveragedSource */
877 /************************************************************************/
878 
879 class VRTAveragedSource : public VRTSimpleSource
880 {
881 public:
882  VRTAveragedSource();
883  virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
884  void *pData, int nBufXSize, int nBufYSize,
885  GDALDataType eBufType,
886  GSpacing nPixelSpace, GSpacing nLineSpace,
887  GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
888 
889  virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
890  virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
891  virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK,
892  double* adfMinMax ) CPL_OVERRIDE;
893  virtual CPLErr ComputeStatistics( int nXSize, int nYSize,
894  int bApproxOK,
895  double *pdfMin, double *pdfMax,
896  double *pdfMean, double *pdfStdDev,
897  GDALProgressFunc pfnProgress,
898  void *pProgressData ) CPL_OVERRIDE;
899  virtual CPLErr GetHistogram( int nXSize, int nYSize,
900  double dfMin, double dfMax,
901  int nBuckets, GUIntBig * panHistogram,
902  int bIncludeOutOfRange, int bApproxOK,
903  GDALProgressFunc pfnProgress,
904  void *pProgressData ) CPL_OVERRIDE;
905 
906  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
907  virtual const char* GetType() CPL_OVERRIDE { return "AveragedSource"; }
908 };
909 
910 /************************************************************************/
911 /* VRTComplexSource */
912 /************************************************************************/
913 
914 typedef enum
915 {
916  VRT_SCALING_NONE,
917  VRT_SCALING_LINEAR,
918  VRT_SCALING_EXPONENTIAL,
919 } VRTComplexSourceScaling;
920 
921 class CPL_DLL VRTComplexSource : public VRTSimpleSource
922 {
923 protected:
924  VRTComplexSourceScaling m_eScalingType;
925  double m_dfScaleOff; // For linear scaling.
926  double m_dfScaleRatio; // For linear scaling.
927 
928  // For non-linear scaling with a power function.
929  int m_bSrcMinMaxDefined;
930  double m_dfSrcMin;
931  double m_dfSrcMax;
932  double m_dfDstMin;
933  double m_dfDstMax;
934  double m_dfExponent;
935 
936  int m_nColorTableComponent;
937 
938  template <class WorkingDT>
939  CPLErr RasterIOInternal( int nReqXOff, int nReqYOff,
940  int nReqXSize, int nReqYSize,
941  void *pData, int nOutXSize, int nOutYSize,
942  GDALDataType eBufType,
943  GSpacing nPixelSpace, GSpacing nLineSpace,
944  GDALRasterIOExtraArg* psExtraArg,
945  GDALDataType eWrkDataType );
946 
947 public:
948  VRTComplexSource();
949  VRTComplexSource(const VRTComplexSource* poSrcSource,
950  double dfXDstRatio, double dfYDstRatio);
951  virtual ~VRTComplexSource();
952 
953  virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
954  void *pData, int nBufXSize, int nBufYSize,
955  GDALDataType eBufType,
956  GSpacing nPixelSpace, GSpacing nLineSpace,
957  GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
958 
959  virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
960  virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
961  virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK,
962  double* adfMinMax ) CPL_OVERRIDE;
963  virtual CPLErr ComputeStatistics( int nXSize, int nYSize,
964  int bApproxOK,
965  double *pdfMin, double *pdfMax,
966  double *pdfMean, double *pdfStdDev,
967  GDALProgressFunc pfnProgress,
968  void *pProgressData ) CPL_OVERRIDE;
969  virtual CPLErr GetHistogram( int nXSize, int nYSize,
970  double dfMin, double dfMax,
971  int nBuckets, GUIntBig * panHistogram,
972  int bIncludeOutOfRange, int bApproxOK,
973  GDALProgressFunc pfnProgress,
974  void *pProgressData ) CPL_OVERRIDE;
975 
976  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
977  virtual CPLErr XMLInit( CPLXMLNode *, const char *, void* ) CPL_OVERRIDE;
978  virtual const char* GetType() CPL_OVERRIDE { return "ComplexSource"; }
979 
980  double LookupValue( double dfInput );
981 
982  void SetLinearScaling( double dfOffset, double dfScale );
983  void SetPowerScaling( double dfExponent,
984  double dfSrcMin,
985  double dfSrcMax,
986  double dfDstMin,
987  double dfDstMax );
988  void SetColorTableComponent( int nComponent );
989 
990  double *m_padfLUTInputs;
991  double *m_padfLUTOutputs;
992  int m_nLUTItemCount;
993 };
994 
995 /************************************************************************/
996 /* VRTFilteredSource */
997 /************************************************************************/
998 
999 class VRTFilteredSource : public VRTComplexSource
1000 {
1001 private:
1002  int IsTypeSupported( GDALDataType eType );
1003 
1004 protected:
1005  int m_nSupportedTypesCount;
1006  GDALDataType m_aeSupportedTypes[20];
1007 
1008  int m_nExtraEdgePixels;
1009 
1010 public:
1011  VRTFilteredSource();
1012  virtual ~VRTFilteredSource();
1013 
1014  void SetExtraEdgePixels( int );
1015  void SetFilteringDataTypesSupported( int, GDALDataType * );
1016 
1017  virtual CPLErr FilterData( int nXSize, int nYSize, GDALDataType eType,
1018  GByte *pabySrcData, GByte *pabyDstData ) = 0;
1019 
1020  virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
1021  void *pData, int nBufXSize, int nBufYSize,
1022  GDALDataType eBufType,
1023  GSpacing nPixelSpace, GSpacing nLineSpace,
1024  GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
1025 };
1026 
1027 /************************************************************************/
1028 /* VRTKernelFilteredSource */
1029 /************************************************************************/
1030 
1031 class VRTKernelFilteredSource : public VRTFilteredSource
1032 {
1033 protected:
1034  int m_nKernelSize;
1035 
1036  bool m_bSeparable;
1037 
1038  double *m_padfKernelCoefs;
1039 
1040  int m_bNormalized;
1041 
1042 public:
1043  VRTKernelFilteredSource();
1044  virtual ~VRTKernelFilteredSource();
1045 
1046  virtual CPLErr XMLInit( CPLXMLNode *psTree, const char *, void* ) CPL_OVERRIDE;
1047  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
1048 
1049  virtual CPLErr FilterData( int nXSize, int nYSize, GDALDataType eType,
1050  GByte *pabySrcData, GByte *pabyDstData ) CPL_OVERRIDE;
1051 
1052  CPLErr SetKernel( int nKernelSize, bool bSeparable, double *padfCoefs );
1053  void SetNormalized( int );
1054 };
1055 
1056 /************************************************************************/
1057 /* VRTAverageFilteredSource */
1058 /************************************************************************/
1059 
1060 class VRTAverageFilteredSource : public VRTKernelFilteredSource
1061 {
1062 public:
1063  explicit VRTAverageFilteredSource( int nKernelSize );
1064  virtual ~VRTAverageFilteredSource();
1065 
1066  virtual CPLErr XMLInit( CPLXMLNode *psTree, const char *, void* ) CPL_OVERRIDE;
1067  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
1068 };
1069 
1070 /************************************************************************/
1071 /* VRTFuncSource */
1072 /************************************************************************/
1073 class VRTFuncSource : public VRTSource
1074 {
1075 public:
1076  VRTFuncSource();
1077  virtual ~VRTFuncSource();
1078 
1079  virtual CPLErr XMLInit( CPLXMLNode *, const char *, void* ) CPL_OVERRIDE { return CE_Failure; }
1080  virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) CPL_OVERRIDE;
1081 
1082  virtual CPLErr RasterIO( int nXOff, int nYOff, int nXSize, int nYSize,
1083  void *pData, int nBufXSize, int nBufYSize,
1084  GDALDataType eBufType,
1085  GSpacing nPixelSpace, GSpacing nLineSpace,
1086  GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
1087 
1088  virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
1089  virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) CPL_OVERRIDE;
1090  virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK,
1091  double* adfMinMax ) CPL_OVERRIDE;
1092  virtual CPLErr ComputeStatistics( int nXSize, int nYSize,
1093  int bApproxOK,
1094  double *pdfMin, double *pdfMax,
1095  double *pdfMean, double *pdfStdDev,
1096  GDALProgressFunc pfnProgress,
1097  void *pProgressData ) CPL_OVERRIDE;
1098  virtual CPLErr GetHistogram( int nXSize, int nYSize,
1099  double dfMin, double dfMax,
1100  int nBuckets, GUIntBig * panHistogram,
1101  int bIncludeOutOfRange, int bApproxOK,
1102  GDALProgressFunc pfnProgress,
1103  void *pProgressData ) CPL_OVERRIDE;
1104 
1105  VRTImageReadFunc pfnReadFunc;
1106  void *pCBData;
1107  GDALDataType eType;
1108 
1109  float fNoDataValue;
1110 };
1111 
1112 #endif /* #ifndef DOXYGEN_SKIP */
1113 
1114 #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:1055
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:743
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:3429
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:2474
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:253
void GDALClose(GDALDatasetH)
Close GDAL dataset.
Definition: gdaldataset.cpp:3056
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:537
CPLErr
Error category.
Definition: cpl_error.h:52

Generated for GDAL by doxygen 1.8.8.