31 #ifndef VIRTUALDATASET_H_INCLUDED
32 #define VIRTUALDATASET_H_INCLUDED
48 CPLErr GDALRegisterDefaultPixelFunc();
51 int VRTWarpedOverviewTransform(
void *pTransformArg,
int bDstToSrc,
53 double *padfX,
double *padfY,
double *padfZ,
55 void* VRTDeserializeWarpedOverviewTransformer(
CPLXMLNode *psTree );
69 VRTOverviewInfo() : nBand(0), poBand(nullptr), bTriedToOpen(FALSE) {}
71 if( poBand ==
nullptr )
84 class CPL_DLL VRTSource
90 int nXOff,
int nYOff,
int nXSize,
int nYSize,
91 void *pData,
int nBufXSize,
int nBufYSize,
96 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess ) = 0;
97 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess ) = 0;
98 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
99 double* adfMinMax ) = 0;
100 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
102 double *pdfMin,
double *pdfMax,
103 double *pdfMean,
double *pdfStdDev,
104 GDALProgressFunc pfnProgress,
105 void *pProgressData ) = 0;
106 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
107 double dfMin,
double dfMax,
108 int nBuckets,
GUIntBig * panHistogram,
109 int bIncludeOutOfRange,
int bApproxOK,
110 GDALProgressFunc pfnProgress,
111 void *pProgressData ) = 0;
114 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath ) = 0;
116 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
119 virtual int IsSimpleSource() {
return FALSE; }
120 virtual CPLErr FlushCache() {
return CE_None; }
123 typedef VRTSource *(*VRTSourceParser)(
CPLXMLNode *,
const char *,
void* pUniqueHandle);
125 VRTSource *VRTParseCoreSources( CPLXMLNode *psTree,
const char *,
void* pUniqueHandle );
126 VRTSource *VRTParseFilterSources( CPLXMLNode *psTree,
const char *,
void* pUniqueHandle );
136 friend class VRTRasterBand;
138 char *m_pszProjection;
140 int m_bGeoTransformSet;
141 double m_adfGeoTransform[6];
145 char *m_pszGCPProjection;
152 VRTRasterBand *m_poMaskBand;
154 int m_bCompatibleForDatasetIO;
155 int CheckCompatibleForDatasetIO();
156 std::vector<GDALDataset*> m_apoOverviews;
157 std::vector<GDALDataset*> m_apoOverviewsBak;
158 char **m_papszXMLVRTMetadata;
160 VRTRasterBand* InitBand(
const char* pszSubclass,
int nBand,
161 bool bAllowPansharpened);
167 VRTDataset(
int nXSize,
int nYSize);
168 virtual ~VRTDataset();
170 void SetNeedsFlush() { m_bNeedsFlush = TRUE; }
173 void SetWritable(
int bWritableIn) { m_bWritable = bWritableIn; }
176 void SetMaskBand(VRTRasterBand* poMaskBand);
184 const char *pszDomain =
"" )
override;
186 const char *pszDomain =
"" )
override;
188 virtual char**
GetMetadata(
const char *pszDomain =
"" )
override;
194 const char *pszGCPProjection )
override;
197 char **papszOptions=
nullptr )
override;
202 int nXOff,
int nYOff,
int nXSize,
int nYSize,
203 void * pData,
int nBufXSize,
int nBufYSize,
205 int nBandCount,
int *panBandMap,
211 int nBufXSize,
int nBufYSize,
213 int nBandCount,
int *panBandList,
214 char **papszOptions )
override;
216 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath);
217 virtual CPLErr XMLInit( CPLXMLNode *,
const char * );
219 virtual CPLErr IBuildOverviews(
const char *,
int,
int *,
220 int,
int *, GDALProgressFunc,
void * )
override;
224 void BuildVirtualOverviews();
226 void UnsetPreservedRelativeFilenames();
230 static GDALDataset *OpenXML(
const char *,
const char * =
nullptr,
233 int nXSize,
int nYSize,
int nBands,
235 static CPLErr Delete(
const char * pszFilename );
243 class VRTWarpedRasterBand;
245 class CPL_DLL VRTWarpedDataset :
public VRTDataset
251 int m_nOverviewCount;
252 VRTWarpedDataset **m_papoOverviews;
255 void CreateImplicitOverviews();
257 struct VerticalShiftGrid
262 double dfToMeterDest;
265 std::vector<VerticalShiftGrid> m_aoVerticalShiftGrids;
267 friend class VRTWarpedRasterBand;
270 virtual int CloseDependentDatasets()
override;
273 VRTWarpedDataset(
int nXSize,
int nYSize );
274 virtual ~VRTWarpedDataset();
276 CPLErr Initialize(
void * );
278 virtual CPLErr IBuildOverviews(
const char *,
int,
int *,
279 int,
int *, GDALProgressFunc,
void * )
override;
281 virtual CPLErr SetMetadataItem(
const char *pszName,
const char *pszValue,
282 const char *pszDomain =
"" )
override;
284 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
285 virtual CPLErr XMLInit( CPLXMLNode *,
const char * )
override;
288 char **papszOptions=
nullptr )
override;
290 virtual char **GetFileList()
override;
292 CPLErr ProcessBlock(
int iBlockX,
int iBlockY );
294 void GetBlockSize(
int *,
int * )
const;
296 void SetApplyVerticalShiftGrid(
const char* pszVGrids,
299 double dfToMeterDest,
300 char** papszOptions );
312 GTAdjust_Intersection,
314 GTAdjust_NoneWithoutWarning
317 class VRTPansharpenedDataset :
public VRTDataset
319 friend class VRTPansharpenedRasterBand;
324 VRTPansharpenedDataset* m_poMainDataset;
325 std::vector<VRTPansharpenedDataset*> m_apoOverviewDatasets;
327 std::map<CPLString,CPLString> m_oMapToRelativeFilenames;
329 int m_bLoadingOtherBands;
331 GByte *m_pabyLastBufferBandRasterIO;
332 int m_nLastBandRasterIOXOff;
333 int m_nLastBandRasterIOYOff;
334 int m_nLastBandRasterIOXSize;
335 int m_nLastBandRasterIOYSize;
338 GTAdjustment m_eGTAdjustment;
339 int m_bNoDataDisabled;
341 std::vector<GDALDataset*> m_apoDatasetsToClose;
344 virtual int CloseDependentDatasets()
override;
347 VRTPansharpenedDataset(
int nXSize,
int nYSize );
348 virtual ~VRTPansharpenedDataset();
350 virtual CPLErr XMLInit( CPLXMLNode *,
const char * )
override;
351 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
353 CPLErr XMLInit( CPLXMLNode *psTree,
const char *pszVRTPath,
355 int nInputSpectralBandsIn,
359 char **papszOptions=
nullptr )
override;
361 virtual char **GetFileList()
override;
364 int nXOff,
int nYOff,
int nXSize,
int nYSize,
365 void * pData,
int nBufXSize,
int nBufYSize,
367 int nBandCount,
int *panBandMap,
372 void GetBlockSize(
int *,
int * )
const;
389 int m_bNoDataValueSet;
391 int m_bHideNoDataValue;
392 double m_dfNoDataValue;
394 std::unique_ptr<GDALColorTable> m_poColorTable;
399 char **m_papszCategoryNames;
404 CPLXMLNode *m_psSavedHistograms;
406 void Initialize(
int nXSize,
int nYSize );
408 std::vector<VRTOverviewInfo> m_apoOverviews;
410 VRTRasterBand *m_poMaskBand;
412 std::unique_ptr<GDALRasterAttributeTable> m_poRAT;
417 virtual ~VRTRasterBand();
419 virtual CPLErr XMLInit( CPLXMLNode *,
const char *,
void* );
420 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath );
423 virtual double GetNoDataValue(
int *pbSuccess =
nullptr )
override;
441 virtual CPLErr SetMetadata(
char **papszMD,
const char *pszDomain =
"" )
override;
443 const char *pszDomain =
"" )
override;
445 virtual double GetOffset(
int *pbSuccess =
nullptr )
override;
447 virtual double GetScale(
int *pbSuccess =
nullptr )
override;
454 int nBuckets,
GUIntBig * panHistogram,
455 int bIncludeOutOfRange,
int bApproxOK,
456 GDALProgressFunc,
void *pProgressData )
override;
459 int *pnBuckets,
GUIntBig ** ppanHistogram,
461 GDALProgressFunc,
void *pProgressData)
override;
464 int nBuckets,
GUIntBig *panHistogram )
override;
468 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
478 void SetMaskBand(VRTRasterBand* poMaskBand);
480 void SetIsMaskBand();
482 CPLErr UnsetNoDataValue();
484 virtual int CloseDependentDatasets();
486 virtual int IsSourcedRasterBand() {
return FALSE; }
487 virtual int IsPansharpenRasterBand() {
return FALSE; }
494 class VRTSimpleSource;
496 class CPL_DLL VRTSourcedRasterBand :
public VRTRasterBand
499 int m_nRecursionCounter;
501 char **m_papszSourceList;
503 bool CanUseSourcesMinMaxImplementations();
504 void CheckSource( VRTSimpleSource *poSS );
508 VRTSource **papoSources;
509 int bSkipBufferInitialization;
511 VRTSourcedRasterBand(
GDALDataset *poDS,
int nBand );
513 int nXSize,
int nYSize );
514 VRTSourcedRasterBand(
GDALDataset *poDS,
int nBand,
516 int nXSize,
int nYSize );
517 virtual ~VRTSourcedRasterBand();
524 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
525 int nXSize,
int nYSize,
527 double* pdfDataPct)
override;
529 virtual char **GetMetadataDomainList()
override;
530 virtual const char *GetMetadataItem(
const char * pszName,
531 const char * pszDomain =
"" )
override;
532 virtual char **GetMetadata(
const char * pszDomain =
"" )
override;
533 virtual CPLErr SetMetadata(
char ** papszMetadata,
534 const char * pszDomain =
"" )
override;
535 virtual CPLErr SetMetadataItem(
const char * pszName,
536 const char * pszValue,
537 const char * pszDomain =
"" )
override;
539 virtual CPLErr XMLInit( CPLXMLNode *,
const char *,
void* )
override;
540 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
542 virtual double GetMinimum(
int *pbSuccess =
nullptr )
override;
543 virtual double GetMaximum(
int *pbSuccess =
nullptr )
override;
544 virtual CPLErr ComputeRasterMinMax(
int bApproxOK,
double* adfMinMax )
override;
545 virtual CPLErr ComputeStatistics(
int bApproxOK,
546 double *pdfMin,
double *pdfMax,
547 double *pdfMean,
double *pdfStdDev,
548 GDALProgressFunc pfnProgress,
549 void *pProgressData )
override;
550 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
551 int nBuckets,
GUIntBig * panHistogram,
552 int bIncludeOutOfRange,
int bApproxOK,
553 GDALProgressFunc pfnProgress,
554 void *pProgressData )
override;
556 CPLErr AddSource( VRTSource * );
558 double dfSrcXOff=-1,
double dfSrcYOff=-1,
559 double dfSrcXSize=-1,
double dfSrcYSize=-1,
560 double dfDstXOff=-1,
double dfDstYOff=-1,
561 double dfDstXSize=-1,
double dfDstYSize=-1,
562 const char *pszResampling =
"near",
565 double dfSrcXOff=-1,
double dfSrcYOff=-1,
566 double dfSrcXSize=-1,
double dfSrcYSize=-1,
567 double dfDstXOff=-1,
double dfDstYOff=-1,
568 double dfDstXSize=-1,
double dfDstYSize=-1,
569 double dfScaleOff=0.0,
570 double dfScaleRatio=1.0,
572 int nColorTableComponent = 0);
575 double dfSrcXOff=-1,
double dfSrcYOff=-1,
576 double dfSrcXSize=-1,
577 double dfSrcYSize=-1,
578 double dfDstXOff=-1,
double dfDstYOff=-1,
579 double dfDstXSize=-1,
580 double dfDstYSize=-1 );
585 void ConfigureSource(VRTSimpleSource *poSimpleSource,
588 double dfSrcXOff,
double dfSrcYOff,
589 double dfSrcXSize,
double dfSrcYSize,
590 double dfDstXOff,
double dfDstYOff,
591 double dfDstXSize,
double dfDstYSize );
593 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
595 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
596 int *pnMaxSize,
CPLHashSet* hSetFiles)
override;
598 virtual int CloseDependentDatasets()
override;
600 virtual int IsSourcedRasterBand()
override {
return TRUE; }
602 virtual CPLErr FlushCache()
override;
609 class CPL_DLL VRTWarpedRasterBand :
public VRTRasterBand
614 virtual ~VRTWarpedRasterBand();
616 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
618 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
619 virtual CPLErr IWriteBlock(
int,
int,
void * )
override;
621 virtual int GetOverviewCount()
override;
628 class VRTPansharpenedRasterBand :
public VRTRasterBand
630 int m_nIndexAsPansharpenedBand;
633 VRTPansharpenedRasterBand(
636 virtual ~VRTPansharpenedRasterBand();
638 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
640 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
643 int nXOff,
int nYOff,
int nXSize,
int nYSize,
644 void * pData,
int nBufXSize,
int nBufYSize,
649 virtual int GetOverviewCount()
override;
652 virtual int IsPansharpenRasterBand()
override {
return TRUE; }
654 void SetIndexAsPansharpenedBand(
int nIdx )
655 { m_nIndexAsPansharpenedBand = nIdx; }
656 int GetIndexAsPansharpenedBand()
const
657 {
return m_nIndexAsPansharpenedBand; }
664 class VRTDerivedRasterBandPrivateData;
666 class CPL_DLL VRTDerivedRasterBand :
public VRTSourcedRasterBand
668 VRTDerivedRasterBandPrivateData* m_poPrivate;
669 bool InitializePython();
677 VRTDerivedRasterBand(
GDALDataset *poDS,
int nBand );
678 VRTDerivedRasterBand(
GDALDataset *poDS,
int nBand,
680 virtual ~VRTDerivedRasterBand();
687 virtual
int IGetDataCoverageStatus(
int nXOff,
int nYOff,
688 int nXSize,
int nYSize,
690 double* pdfDataPct) override;
692 static
CPLErr AddPixelFunction( const
char *pszFuncName,
696 void SetPixelFunctionName( const
char *pszFuncName );
697 void SetSourceTransferType( GDALDataType eDataType );
698 void SetPixelFunctionLanguage( const
char* pszLanguage );
700 virtual
CPLErr XMLInit( CPLXMLNode *, const
char *,
void* ) override;
701 virtual CPLXMLNode * SerializeToXML( const
char *pszVRTPath ) override;
703 virtual
double GetMinimum(
int *pbSuccess =
nullptr ) override;
704 virtual
double GetMaximum(
int *pbSuccess =
nullptr ) override;
705 virtual
CPLErr ComputeRasterMinMax(
int bApproxOK,
double* adfMinMax ) override;
706 virtual
CPLErr ComputeStatistics(
int bApproxOK,
707 double *pdfMin,
double *pdfMax,
708 double *pdfMean,
double *pdfStdDev,
709 GDALProgressFunc pfnProgress,
710 void *pProgressData ) override;
711 virtual
CPLErr GetHistogram(
double dfMin,
double dfMax,
712 int nBuckets,
GUIntBig * panHistogram,
713 int bIncludeOutOfRange,
int bApproxOK,
714 GDALProgressFunc pfnProgress,
715 void *pProgressData ) override;
717 static
void Cleanup();
726 class CPL_DLL VRTRawRasterBand : public VRTRasterBand
728 RawRasterBand *m_poRawRaster;
730 char *m_pszSourceFilename;
731 int m_bRelativeToVRT;
736 virtual ~VRTRawRasterBand();
738 virtual CPLErr XMLInit( CPLXMLNode *,
const char *,
void* )
override;
739 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
741 virtual CPLErr IRasterIO( GDALRWFlag,
int,
int,
int,
int,
742 void *,
int,
int, GDALDataType,
746 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
747 virtual CPLErr IWriteBlock(
int,
int,
void * )
override;
749 CPLErr SetRawLink(
const char *pszFilename,
750 const char *pszVRTPath,
753 int nPixelOffset,
int nLineOffset,
754 const char *pszByteOrder );
758 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
759 int *pnMaxSize,
CPLHashSet* hSetFiles )
override;
770 virtual ~VRTDriver();
772 char **papszSourceParsers;
774 virtual char **GetMetadataDomainList()
override;
775 virtual char **GetMetadata(
const char * pszDomain =
"" )
override;
776 virtual CPLErr SetMetadata(
char ** papszMetadata,
777 const char * pszDomain =
"" )
override;
779 VRTSource *ParseSource( CPLXMLNode *psSrc,
const char *pszVRTPath,
780 void* pUniqueHandle );
781 void AddSourceParser(
const char *pszElementName,
782 VRTSourceParser pfnParser );
789 class CPL_DLL VRTSimpleSource :
public VRTSource
792 friend class VRTSourcedRasterBand;
811 double m_dfNoDataValue;
816 int m_bRelativeToVRTOri;
818 int m_nExplicitSharedStatus;
820 int NeedMaxValAdjustment()
const;
824 VRTSimpleSource(
const VRTSimpleSource* poSrcSource,
825 double dfXDstRatio,
double dfYDstRatio );
826 virtual ~VRTSimpleSource();
828 virtual CPLErr XMLInit( CPLXMLNode *psTree,
const char *,
void* )
override;
829 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
833 void SetSrcWindow(
double,
double,
double,
double );
834 void SetDstWindow(
double,
double,
double,
double );
835 void SetNoDataValue(
double dfNoDataValue );
836 const CPLString& GetResampling()
const {
return m_osResampling; }
837 void SetResampling(
const char* pszResampling );
839 int GetSrcDstWindow(
int,
int,
int,
int,
int,
int,
840 double *pdfReqXOff,
double *pdfReqYOff,
841 double *pdfReqXSize,
double *pdfReqYSize,
842 int *,
int *,
int *,
int *,
843 int *,
int *,
int *,
int * );
846 int nXOff,
int nYOff,
int nXSize,
int nYSize,
847 void *pData,
int nBufXSize,
int nBufYSize,
852 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
853 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
854 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
855 double* adfMinMax )
override;
856 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
858 double *pdfMin,
double *pdfMax,
859 double *pdfMean,
double *pdfStdDev,
860 GDALProgressFunc pfnProgress,
861 void *pProgressData )
override;
862 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
863 double dfMin,
double dfMax,
864 int nBuckets,
GUIntBig * panHistogram,
865 int bIncludeOutOfRange,
int bApproxOK,
866 GDALProgressFunc pfnProgress,
867 void *pProgressData )
override;
869 void DstToSrc(
double dfX,
double dfY,
870 double &dfXOut,
double &dfYOut )
const;
871 void SrcToDst(
double dfX,
double dfY,
872 double &dfXOut,
double &dfYOut )
const;
874 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
875 int *pnMaxSize,
CPLHashSet* hSetFiles )
override;
877 virtual int IsSimpleSource()
override {
return TRUE; }
878 virtual const char* GetType() {
return "SimpleSource"; }
879 virtual CPLErr FlushCache()
override;
882 int IsSameExceptBandNumber( VRTSimpleSource* poOtherSource );
885 int nXOff,
int nYOff,
int nXSize,
int nYSize,
886 void * pData,
int nBufXSize,
int nBufYSize,
888 int nBandCount,
int *panBandMap,
893 void UnsetPreservedRelativeFilenames();
895 void SetMaxValue(
int nVal ) { m_nMaxValue = nVal; }
902 class VRTAveragedSource :
public VRTSimpleSource
907 int nXOff,
int nYOff,
int nXSize,
int nYSize,
908 void *pData,
int nBufXSize,
int nBufYSize,
913 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
914 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
915 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
916 double* adfMinMax )
override;
917 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
919 double *pdfMin,
double *pdfMax,
920 double *pdfMean,
double *pdfStdDev,
921 GDALProgressFunc pfnProgress,
922 void *pProgressData )
override;
923 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
924 double dfMin,
double dfMax,
925 int nBuckets,
GUIntBig * panHistogram,
926 int bIncludeOutOfRange,
int bApproxOK,
927 GDALProgressFunc pfnProgress,
928 void *pProgressData )
override;
930 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
931 virtual const char* GetType()
override {
return "AveragedSource"; }
942 VRT_SCALING_EXPONENTIAL,
943 } VRTComplexSourceScaling;
945 class CPL_DLL VRTComplexSource :
public VRTSimpleSource
948 VRTComplexSourceScaling m_eScalingType;
950 double m_dfScaleRatio;
953 int m_bSrcMinMaxDefined;
960 int m_nColorTableComponent;
962 template <
class WorkingDT>
963 CPLErr RasterIOInternal(
int nReqXOff,
int nReqYOff,
964 int nReqXSize,
int nReqYSize,
965 void *pData,
int nOutXSize,
int nOutYSize,
973 VRTComplexSource(
const VRTComplexSource* poSrcSource,
974 double dfXDstRatio,
double dfYDstRatio);
975 virtual ~VRTComplexSource();
978 int nXOff,
int nYOff,
int nXSize,
int nYSize,
979 void *pData,
int nBufXSize,
int nBufYSize,
984 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
985 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
986 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
987 double* adfMinMax )
override;
988 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
990 double *pdfMin,
double *pdfMax,
991 double *pdfMean,
double *pdfStdDev,
992 GDALProgressFunc pfnProgress,
993 void *pProgressData )
override;
994 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
995 double dfMin,
double dfMax,
996 int nBuckets,
GUIntBig * panHistogram,
997 int bIncludeOutOfRange,
int bApproxOK,
998 GDALProgressFunc pfnProgress,
999 void *pProgressData )
override;
1001 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1002 virtual CPLErr XMLInit( CPLXMLNode *,
const char *,
void* )
override;
1003 virtual const char* GetType()
override {
return "ComplexSource"; }
1005 double LookupValue(
double dfInput );
1007 void SetLinearScaling(
double dfOffset,
double dfScale );
1008 void SetPowerScaling(
double dfExponent,
1013 void SetColorTableComponent(
int nComponent );
1015 double *m_padfLUTInputs;
1016 double *m_padfLUTOutputs;
1017 int m_nLUTItemCount;
1024 class VRTFilteredSource :
public VRTComplexSource
1030 int m_nSupportedTypesCount;
1033 int m_nExtraEdgePixels;
1036 VRTFilteredSource();
1037 virtual ~VRTFilteredSource();
1039 void SetExtraEdgePixels(
int );
1040 void SetFilteringDataTypesSupported(
int,
GDALDataType * );
1043 GByte *pabySrcData,
GByte *pabyDstData ) = 0;
1046 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1047 void *pData,
int nBufXSize,
int nBufYSize,
1057 class VRTKernelFilteredSource :
public VRTFilteredSource
1064 double *m_padfKernelCoefs;
1069 VRTKernelFilteredSource();
1070 virtual ~VRTKernelFilteredSource();
1072 virtual CPLErr XMLInit( CPLXMLNode *psTree,
const char *,
void* )
override;
1073 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1076 GByte *pabySrcData,
GByte *pabyDstData )
override;
1078 CPLErr SetKernel(
int nKernelSize,
bool bSeparable,
double *padfCoefs );
1079 void SetNormalized(
int );
1086 class VRTAverageFilteredSource :
public VRTKernelFilteredSource
1089 explicit VRTAverageFilteredSource(
int nKernelSize );
1090 virtual ~VRTAverageFilteredSource();
1092 virtual CPLErr XMLInit( CPLXMLNode *psTree,
const char *,
void* )
override;
1093 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1099 class VRTFuncSource :
public VRTSource
1103 virtual ~VRTFuncSource();
1105 virtual CPLErr XMLInit( CPLXMLNode *,
const char *,
void* )
override {
return CE_Failure; }
1106 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1109 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1110 void *pData,
int nBufXSize,
int nBufYSize,
1115 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1116 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1117 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
1118 double* adfMinMax )
override;
1119 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
1121 double *pdfMin,
double *pdfMax,
1122 double *pdfMean,
double *pdfStdDev,
1123 GDALProgressFunc pfnProgress,
1124 void *pProgressData )
override;
1125 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
1126 double dfMin,
double dfMax,
1127 int nBuckets,
GUIntBig * panHistogram,
1128 int bIncludeOutOfRange,
int bApproxOK,
1129 GDALProgressFunc pfnProgress,
1130 void *pProgressData )
override;
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
The GDALRasterAttributeTable (or RAT) class is used to encapsulate a table used to provide attribute ...
Definition: gdal_rat.h:47
virtual CPLErr GetGeoTransform(double *padfTransform)
Fetch the affine transformation coefficients.
Definition: gdaldataset.cpp:954
GDALDataType
Definition: gdal.h:60
virtual CPLErr SetCategoryNames(char **papszNames)
Set the category names for this band.
Definition: gdalrasterband.cpp:1579
Document node structure.
Definition: cpl_minixml.h:66
virtual GDALRasterBand * GetMaskBand()
Return the mask band associated with the band.
Definition: gdalrasterband.cpp:5880
virtual CPLErr AddBand(GDALDataType eType, char **papszOptions=nullptr)
Add a band to a dataset.
Definition: gdaldataset.cpp:580
virtual char ** GetCategoryNames()
Fetch the list of category names for this raster.
Definition: gdalrasterband.cpp:1531
virtual void SetDescription(const char *)
Set object description.
Definition: gdalmajorobject.cpp:120
virtual void FlushCache(void)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:428
virtual GDALRasterBand * GetOverview(int)
Fetch overview raster band object.
Definition: gdalrasterband.cpp:2242
virtual CPLErr GetDefaultHistogram(double *pdfMin, double *pdfMax, int *pnBuckets, GUIntBig **ppanHistogram, int bForce, GDALProgressFunc, void *pProgressData)
Fetch default raster histogram.
Definition: gdalrasterband.cpp:3468
virtual CPLErr AdviseRead(int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, GDALDataType eDT, int nBandCount, int *panBandList, char **papszOptions)
Advise driver of upcoming read requests.
Definition: gdaldataset.cpp:2295
virtual GDALColorInterp GetColorInterpretation()
How should this band be interpreted as color?
Definition: gdalrasterband.cpp:1974
virtual const char * GetProjectionRef(void)
Fetch the projection definition string for this dataset.
Definition: gdaldataset.cpp:856
virtual CPLErr SetDefaultRAT(const GDALRasterAttributeTable *poRAT)
Set default Raster Attribute Table.
Definition: gdalrasterband.cpp:5798
GDALRWFlag
Definition: gdal.h:119
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:766
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:213
virtual int GetMaskFlags()
Return the status flags of the mask band associated with the band.
Definition: gdalrasterband.cpp:6127
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition: gdal.h:258
virtual GDALRasterAttributeTable * GetDefaultRAT()
Fetch default Raster Attribute Table.
Definition: gdalrasterband.cpp:5750
virtual CPLErr GetHistogram(double dfMin, double dfMax, int nBuckets, GUIntBig *panHistogram, int bIncludeOutOfRange, int bApproxOK, GDALProgressFunc, void *pProgressData)
Compute raster histogram.
Definition: gdalrasterband.cpp:2921
Pansharpening operation class.
Definition: gdalpansharpen.h:188
Convenient string class based on std::string.
Definition: cpl_string.h:336
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const char *pszGCPProjection)
Assign GCPs.
Definition: gdaldataset.cpp:1414
virtual CPLErr SetOffset(double dfNewOffset)
Set scaling offset.
Definition: gdalrasterband.cpp:2490
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
void char ** GetMetadata(const char *pszDomain="") override
Fetch metadata.
Definition: gdaldataset.cpp:3484
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
#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:273
virtual CPLErr SetDefaultHistogram(double dfMin, double dfMax, int nBuckets, GUIntBig *panHistogram)
Set default histogram.
Definition: gdalrasterband.cpp:5651
int Dereference()
Subtract one from dataset reference count.
Definition: gdaldataset.cpp:1162
virtual double GetScale(int *pbSuccess=nullptr)
Fetch the raster value scale.
Definition: gdalrasterband.cpp:2547
virtual const GDAL_GCP * GetGCPs()
Fetch GCPs.
Definition: gdaldataset.cpp:1364
static GDALDataset * Open(const char *pszFilename, unsigned int nOpenFlags=0, const char *const *papszAllowedDrivers=nullptr, const char *const *papszOpenOptions=nullptr, const char *const *papszSiblingFiles=nullptr)
Definition: gdal_priv.h:614
virtual CPLErr DeleteNoDataValue()
Remove the no data value for this band.
Definition: gdalrasterband.cpp:1744
virtual CPLErr SetGeoTransform(double *padfTransform)
Set the affine transformation coefficients.
Definition: gdaldataset.cpp:1009
virtual double GetNoDataValue(int *pbSuccess=nullptr)
Fetch the no data value for this band.
Definition: gdalrasterband.cpp:1631
virtual int GetGCPCount()
Get number of GCPs.
Definition: gdaldataset.cpp:1296
Class for dataset open functions.
Definition: gdal_priv.h:265
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:447
virtual CPLErr SetColorInterpretation(GDALColorInterp eColorInterp)
Set color interpretation of a band.
Definition: gdalrasterband.cpp:2019
virtual const char * GetUnitType()
Return raster unit type.
Definition: gdalrasterband.cpp:2643
High level image warping class.
Definition: gdalwarper.h:438
virtual CPLErr SetColorTable(GDALColorTable *poCT)
Set the raster color table.
Definition: gdalrasterband.cpp:2115
virtual GDALColorTable * GetColorTable()
Fetch the color table associated with band.
Definition: gdalrasterband.cpp:2066
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:249
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition: gdaldataset.cpp:2377
virtual CPLErr SetProjection(const char *pszProjection)
Set the projection reference string for this dataset.
Definition: gdaldataset.cpp:896
virtual const char * GetGCPProjection()
Get output projection for GCPs.
Definition: gdaldataset.cpp:1331
void GDALClose(GDALDatasetH)
Close GDAL dataset.
Definition: gdaldataset.cpp:3059
virtual CPLErr SetScale(double dfNewScale)
Set scaling ratio.
Definition: gdalrasterband.cpp:2596
virtual double GetOffset(int *pbSuccess=nullptr)
Fetch the raster value offset.
Definition: gdalrasterband.cpp:2441
Object with metadata.
Definition: gdal_priv.h:132
virtual int GetOverviewCount()
Return the number of overview layers available.
Definition: gdalrasterband.cpp:2200
GDALDataset * GetDataset()
Fetch the owning dataset handle.
Definition: gdalrasterband.cpp:2853
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
GUIntBig vsi_l_offset
Type for a file offset.
Definition: cpl_vsi.h:139
virtual CPLErr SetUnitType(const char *pszNewValue)
Set unit type.
Definition: gdalrasterband.cpp:2691
A single raster band (or channel).
Definition: gdal_priv.h:1042
GDALAccess
Definition: gdal.h:113
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the current band.
Definition: gdalrasterband.cpp:6208
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:339
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
GDALColorInterp
Definition: gdal.h:190
virtual CPLErr SetNoDataValue(double dfNoData)
Set the no data value for this band.
Definition: gdalrasterband.cpp:1690
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:1234
Format specific driver.
Definition: gdal_priv.h:1386
A color table / palette.
Definition: gdal_priv.h:949
Ground Control Point.
Definition: gdal.h:560
CPLErr
Error category.
Definition: cpl_error.h:52
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition: cpl_port.h:987