gooderp18绿色标准版
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

1219 行
51KB

  1. /******************************************************************************
  2. * $Id: vrtdataset.h 977f2da59e46852f49534361860bb92f9c6ad1fd 2019-03-14 21:46:14 +0100 Even 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. #ifndef VIRTUALDATASET_H_INCLUDED
  31. #define VIRTUALDATASET_H_INCLUDED
  32. #ifndef DOXYGEN_SKIP
  33. #include "cpl_hash_set.h"
  34. #include "gdal_pam.h"
  35. #include "gdal_priv.h"
  36. #include "gdal_rat.h"
  37. #include "gdal_vrt.h"
  38. #include "gdal_rat.h"
  39. #include <map>
  40. #include <memory>
  41. #include <vector>
  42. int VRTApplyMetadata( CPLXMLNode *, GDALMajorObject * );
  43. CPLXMLNode *VRTSerializeMetadata( GDALMajorObject * );
  44. CPLErr GDALRegisterDefaultPixelFunc();
  45. #if 0
  46. int VRTWarpedOverviewTransform( void *pTransformArg, int bDstToSrc,
  47. int nPointCount,
  48. double *padfX, double *padfY, double *padfZ,
  49. int *panSuccess );
  50. void* VRTDeserializeWarpedOverviewTransformer( CPLXMLNode *psTree );
  51. #endif
  52. /************************************************************************/
  53. /* VRTOverviewInfo() */
  54. /************************************************************************/
  55. class VRTOverviewInfo
  56. {
  57. CPL_DISALLOW_COPY_ASSIGN(VRTOverviewInfo)
  58. public:
  59. CPLString osFilename{};
  60. int nBand = 0;
  61. GDALRasterBand *poBand = nullptr;
  62. int bTriedToOpen = FALSE;
  63. VRTOverviewInfo() = default;
  64. VRTOverviewInfo(VRTOverviewInfo&& oOther) noexcept:
  65. osFilename(std::move(oOther.osFilename)),
  66. nBand(oOther.nBand),
  67. poBand(oOther.poBand),
  68. bTriedToOpen(oOther.bTriedToOpen)
  69. {
  70. oOther.poBand = nullptr;
  71. }
  72. ~VRTOverviewInfo() {
  73. if( poBand == nullptr )
  74. /* do nothing */;
  75. else if( poBand->GetDataset()->GetShared() )
  76. GDALClose( /* (GDALDatasetH) */ poBand->GetDataset() );
  77. else
  78. poBand->GetDataset()->Dereference();
  79. }
  80. };
  81. /************************************************************************/
  82. /* VRTSource */
  83. /************************************************************************/
  84. class CPL_DLL VRTSource
  85. {
  86. public:
  87. virtual ~VRTSource();
  88. virtual CPLErr RasterIO( GDALDataType eBandDataType,
  89. int nXOff, int nYOff, int nXSize, int nYSize,
  90. void *pData, int nBufXSize, int nBufYSize,
  91. GDALDataType eBufType,
  92. GSpacing nPixelSpace, GSpacing nLineSpace,
  93. GDALRasterIOExtraArg* psExtraArg ) = 0;
  94. virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) = 0;
  95. virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) = 0;
  96. virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK,
  97. double* adfMinMax ) = 0;
  98. virtual CPLErr ComputeStatistics( int nXSize, int nYSize,
  99. int bApproxOK,
  100. double *pdfMin, double *pdfMax,
  101. double *pdfMean, double *pdfStdDev,
  102. GDALProgressFunc pfnProgress,
  103. void *pProgressData ) = 0;
  104. virtual CPLErr GetHistogram( int nXSize, int nYSize,
  105. double dfMin, double dfMax,
  106. int nBuckets, GUIntBig * panHistogram,
  107. int bIncludeOutOfRange, int bApproxOK,
  108. GDALProgressFunc pfnProgress,
  109. void *pProgressData ) = 0;
  110. virtual CPLErr XMLInit( CPLXMLNode *psTree, const char *, void*,
  111. std::map<CPLString, GDALDataset*>& ) = 0;
  112. virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) = 0;
  113. virtual void GetFileList(char*** ppapszFileList, int *pnSize,
  114. int *pnMaxSize, CPLHashSet* hSetFiles);
  115. virtual int IsSimpleSource() { return FALSE; }
  116. virtual CPLErr FlushCache() { return CE_None; }
  117. };
  118. typedef VRTSource *(*VRTSourceParser)(CPLXMLNode *, const char *, void* pUniqueHandle,
  119. std::map<CPLString, GDALDataset*>& oMapSharedSources);
  120. VRTSource *VRTParseCoreSources( CPLXMLNode *psTree, const char *, void* pUniqueHandle,
  121. std::map<CPLString, GDALDataset*>& oMapSharedSources);
  122. VRTSource *VRTParseFilterSources( CPLXMLNode *psTree, const char *, void* pUniqueHandle,
  123. std::map<CPLString, GDALDataset*>& oMapSharedSources );
  124. /************************************************************************/
  125. /* VRTDataset */
  126. /************************************************************************/
  127. class VRTRasterBand;
  128. template<class T> struct VRTFlushCacheStruct
  129. {
  130. static void FlushCache(T& obj);
  131. };
  132. class VRTWarpedDataset;
  133. class VRTPansharpenedDataset;
  134. class CPL_DLL VRTDataset : public GDALDataset
  135. {
  136. friend class VRTRasterBand;
  137. friend struct VRTFlushCacheStruct<VRTDataset>;
  138. friend struct VRTFlushCacheStruct<VRTWarpedDataset>;
  139. friend struct VRTFlushCacheStruct<VRTPansharpenedDataset>;
  140. friend class VRTSourcedRasterBand;
  141. OGRSpatialReference* m_poSRS = nullptr;
  142. int m_bGeoTransformSet;
  143. double m_adfGeoTransform[6];
  144. int m_nGCPCount;
  145. GDAL_GCP *m_pasGCPList;
  146. OGRSpatialReference *m_poGCP_SRS = nullptr;
  147. int m_bNeedsFlush;
  148. int m_bWritable;
  149. char *m_pszVRTPath;
  150. VRTRasterBand *m_poMaskBand;
  151. int m_bCompatibleForDatasetIO;
  152. int CheckCompatibleForDatasetIO();
  153. void ExpandProxyBands();
  154. std::vector<GDALDataset*> m_apoOverviews;
  155. std::vector<GDALDataset*> m_apoOverviewsBak;
  156. char **m_papszXMLVRTMetadata;
  157. std::map<CPLString, GDALDataset*> m_oMapSharedSources;
  158. VRTRasterBand* InitBand(const char* pszSubclass, int nBand,
  159. bool bAllowPansharpened);
  160. CPL_DISALLOW_COPY_ASSIGN(VRTDataset)
  161. protected:
  162. virtual int CloseDependentDatasets() override;
  163. public:
  164. VRTDataset(int nXSize, int nYSize);
  165. virtual ~VRTDataset();
  166. void SetNeedsFlush() { m_bNeedsFlush = TRUE; }
  167. virtual void FlushCache() override;
  168. void SetWritable(int bWritableIn) { m_bWritable = bWritableIn; }
  169. virtual CPLErr CreateMaskBand( int nFlags ) override;
  170. void SetMaskBand(VRTRasterBand* poMaskBand);
  171. const OGRSpatialReference* GetSpatialRef() const override { return m_poSRS; }
  172. CPLErr SetSpatialRef(const OGRSpatialReference* poSRS) override;
  173. virtual CPLErr GetGeoTransform( double * ) override;
  174. virtual CPLErr SetGeoTransform( double * ) override;
  175. virtual CPLErr SetMetadata( char **papszMetadata,
  176. const char *pszDomain = "" ) override;
  177. virtual CPLErr SetMetadataItem( const char *pszName, const char *pszValue,
  178. const char *pszDomain = "" ) override;
  179. virtual char** GetMetadata( const char *pszDomain = "" ) override;
  180. virtual int GetGCPCount() override;
  181. const OGRSpatialReference* GetGCPSpatialRef() const override { return m_poGCP_SRS; }
  182. virtual const GDAL_GCP *GetGCPs() override;
  183. using GDALDataset::SetGCPs;
  184. CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
  185. const OGRSpatialReference* poSRS ) override;
  186. virtual CPLErr AddBand( GDALDataType eType,
  187. char **papszOptions=nullptr ) override;
  188. virtual char **GetFileList() override;
  189. virtual CPLErr IRasterIO( GDALRWFlag eRWFlag,
  190. int nXOff, int nYOff, int nXSize, int nYSize,
  191. void * pData, int nBufXSize, int nBufYSize,
  192. GDALDataType eBufType,
  193. int nBandCount, int *panBandMap,
  194. GSpacing nPixelSpace, GSpacing nLineSpace,
  195. GSpacing nBandSpace,
  196. GDALRasterIOExtraArg* psExtraArg) override;
  197. virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
  198. int nBufXSize, int nBufYSize,
  199. GDALDataType eDT,
  200. int nBandCount, int *panBandList,
  201. char **papszOptions ) override;
  202. virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath);
  203. virtual CPLErr XMLInit( CPLXMLNode *, const char * );
  204. virtual CPLErr IBuildOverviews( const char *, int, int *,
  205. int, int *, GDALProgressFunc, void * ) override;
  206. /* Used by PDF driver for example */
  207. GDALDataset* GetSingleSimpleSource();
  208. void BuildVirtualOverviews();
  209. void UnsetPreservedRelativeFilenames();
  210. static int Identify( GDALOpenInfo * );
  211. static GDALDataset *Open( GDALOpenInfo * );
  212. static GDALDataset *OpenXML( const char *, const char * = nullptr,
  213. GDALAccess eAccess = GA_ReadOnly );
  214. static GDALDataset *Create( const char * pszName,
  215. int nXSize, int nYSize, int nBands,
  216. GDALDataType eType, char ** papszOptions );
  217. static CPLErr Delete( const char * pszFilename );
  218. };
  219. /************************************************************************/
  220. /* VRTWarpedDataset */
  221. /************************************************************************/
  222. class GDALWarpOperation;
  223. class VRTWarpedRasterBand;
  224. class CPL_DLL VRTWarpedDataset : public VRTDataset
  225. {
  226. int m_nBlockXSize;
  227. int m_nBlockYSize;
  228. GDALWarpOperation *m_poWarper;
  229. int m_nOverviewCount;
  230. VRTWarpedDataset **m_papoOverviews;
  231. int m_nSrcOvrLevel;
  232. void CreateImplicitOverviews();
  233. struct VerticalShiftGrid
  234. {
  235. CPLString osVGrids;
  236. int bInverse;
  237. double dfToMeterSrc;
  238. double dfToMeterDest;
  239. CPLStringList aosOptions;
  240. };
  241. std::vector<VerticalShiftGrid> m_aoVerticalShiftGrids;
  242. friend class VRTWarpedRasterBand;
  243. CPL_DISALLOW_COPY_ASSIGN(VRTWarpedDataset)
  244. protected:
  245. virtual int CloseDependentDatasets() override;
  246. public:
  247. VRTWarpedDataset( int nXSize, int nYSize );
  248. virtual ~VRTWarpedDataset();
  249. virtual void FlushCache() override;
  250. CPLErr Initialize( /* GDALWarpOptions */ void * );
  251. virtual CPLErr IBuildOverviews( const char *, int, int *,
  252. int, int *, GDALProgressFunc, void * ) override;
  253. virtual CPLErr SetMetadataItem( const char *pszName, const char *pszValue,
  254. const char *pszDomain = "" ) override;
  255. virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) override;
  256. virtual CPLErr XMLInit( CPLXMLNode *, const char * ) override;
  257. virtual CPLErr AddBand( GDALDataType eType,
  258. char **papszOptions=nullptr ) override;
  259. virtual char **GetFileList() override;
  260. CPLErr ProcessBlock( int iBlockX, int iBlockY );
  261. void GetBlockSize( int *, int * ) const;
  262. void SetApplyVerticalShiftGrid(const char* pszVGrids,
  263. int bInverse,
  264. double dfToMeterSrc,
  265. double dfToMeterDest,
  266. char** papszOptions );
  267. };
  268. /************************************************************************/
  269. /* VRTPansharpenedDataset */
  270. /************************************************************************/
  271. class GDALPansharpenOperation;
  272. typedef enum
  273. {
  274. GTAdjust_Union,
  275. GTAdjust_Intersection,
  276. GTAdjust_None,
  277. GTAdjust_NoneWithoutWarning
  278. } GTAdjustment;
  279. class VRTPansharpenedDataset : public VRTDataset
  280. {
  281. friend class VRTPansharpenedRasterBand;
  282. int m_nBlockXSize;
  283. int m_nBlockYSize;
  284. GDALPansharpenOperation* m_poPansharpener;
  285. VRTPansharpenedDataset* m_poMainDataset;
  286. std::vector<VRTPansharpenedDataset*> m_apoOverviewDatasets;
  287. // Map from absolute to relative.
  288. std::map<CPLString,CPLString> m_oMapToRelativeFilenames;
  289. int m_bLoadingOtherBands;
  290. GByte *m_pabyLastBufferBandRasterIO;
  291. int m_nLastBandRasterIOXOff;
  292. int m_nLastBandRasterIOYOff;
  293. int m_nLastBandRasterIOXSize;
  294. int m_nLastBandRasterIOYSize;
  295. GDALDataType m_eLastBandRasterIODataType;
  296. GTAdjustment m_eGTAdjustment;
  297. int m_bNoDataDisabled;
  298. std::vector<GDALDataset*> m_apoDatasetsToClose;
  299. CPL_DISALLOW_COPY_ASSIGN(VRTPansharpenedDataset)
  300. protected:
  301. virtual int CloseDependentDatasets() override;
  302. public:
  303. VRTPansharpenedDataset( int nXSize, int nYSize );
  304. virtual ~VRTPansharpenedDataset();
  305. virtual void FlushCache() override;
  306. virtual CPLErr XMLInit( CPLXMLNode *, const char * ) override;
  307. virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) override;
  308. CPLErr XMLInit( CPLXMLNode *psTree, const char *pszVRTPath,
  309. GDALRasterBandH hPanchroBandIn,
  310. int nInputSpectralBandsIn,
  311. GDALRasterBandH* pahInputSpectralBandsIn );
  312. virtual CPLErr AddBand( GDALDataType eType,
  313. char **papszOptions=nullptr ) override;
  314. virtual char **GetFileList() override;
  315. virtual CPLErr IRasterIO( GDALRWFlag eRWFlag,
  316. int nXOff, int nYOff, int nXSize, int nYSize,
  317. void * pData, int nBufXSize, int nBufYSize,
  318. GDALDataType eBufType,
  319. int nBandCount, int *panBandMap,
  320. GSpacing nPixelSpace, GSpacing nLineSpace,
  321. GSpacing nBandSpace,
  322. GDALRasterIOExtraArg* psExtraArg) override;
  323. void GetBlockSize( int *, int * ) const;
  324. GDALPansharpenOperation* GetPansharpener() { return m_poPansharpener; }
  325. };
  326. /************************************************************************/
  327. /* VRTRasterBand */
  328. /* */
  329. /* Provides support for all the various kinds of metadata but */
  330. /* no raster access. That is handled by derived classes. */
  331. /************************************************************************/
  332. class CPL_DLL VRTRasterBand : public GDALRasterBand
  333. {
  334. protected:
  335. int m_bIsMaskBand;
  336. int m_bNoDataValueSet;
  337. // If set to true, will not report the existence of nodata.
  338. int m_bHideNoDataValue;
  339. double m_dfNoDataValue;
  340. std::unique_ptr<GDALColorTable> m_poColorTable;
  341. GDALColorInterp m_eColorInterp;
  342. char *m_pszUnitType;
  343. char **m_papszCategoryNames;
  344. double m_dfOffset;
  345. double m_dfScale;
  346. CPLXMLNode *m_psSavedHistograms;
  347. void Initialize( int nXSize, int nYSize );
  348. std::vector<VRTOverviewInfo> m_apoOverviews;
  349. VRTRasterBand *m_poMaskBand;
  350. std::unique_ptr<GDALRasterAttributeTable> m_poRAT;
  351. CPL_DISALLOW_COPY_ASSIGN(VRTRasterBand)
  352. public:
  353. VRTRasterBand();
  354. virtual ~VRTRasterBand();
  355. virtual CPLErr XMLInit( CPLXMLNode *, const char *, void*,
  356. std::map<CPLString, GDALDataset*>& );
  357. virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath );
  358. virtual CPLErr SetNoDataValue( double ) override;
  359. virtual double GetNoDataValue( int *pbSuccess = nullptr ) override;
  360. virtual CPLErr DeleteNoDataValue() override;
  361. virtual CPLErr SetColorTable( GDALColorTable * ) override;
  362. virtual GDALColorTable *GetColorTable() override;
  363. virtual GDALRasterAttributeTable *GetDefaultRAT() override;
  364. virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * poRAT ) override;
  365. virtual CPLErr SetColorInterpretation( GDALColorInterp ) override;
  366. virtual GDALColorInterp GetColorInterpretation() override;
  367. virtual const char *GetUnitType() override;
  368. CPLErr SetUnitType( const char * ) override;
  369. virtual char **GetCategoryNames() override;
  370. virtual CPLErr SetCategoryNames( char ** ) override;
  371. virtual CPLErr SetMetadata( char **papszMD, const char *pszDomain = "" ) override;
  372. virtual CPLErr SetMetadataItem( const char *pszName, const char *pszValue,
  373. const char *pszDomain = "" ) override;
  374. virtual double GetOffset( int *pbSuccess = nullptr ) override;
  375. CPLErr SetOffset( double ) override;
  376. virtual double GetScale( int *pbSuccess = nullptr ) override;
  377. CPLErr SetScale( double ) override;
  378. virtual int GetOverviewCount() override;
  379. virtual GDALRasterBand *GetOverview(int) override;
  380. virtual CPLErr GetHistogram( double dfMin, double dfMax,
  381. int nBuckets, GUIntBig * panHistogram,
  382. int bIncludeOutOfRange, int bApproxOK,
  383. GDALProgressFunc, void *pProgressData ) override;
  384. virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
  385. int *pnBuckets, GUIntBig ** ppanHistogram,
  386. int bForce,
  387. GDALProgressFunc, void *pProgressData) override;
  388. virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
  389. int nBuckets, GUIntBig *panHistogram ) override;
  390. CPLErr CopyCommonInfoFrom( GDALRasterBand * );
  391. virtual void GetFileList(char*** ppapszFileList, int *pnSize,
  392. int *pnMaxSize, CPLHashSet* hSetFiles);
  393. virtual void SetDescription( const char * ) override;
  394. virtual GDALRasterBand *GetMaskBand() override;
  395. virtual int GetMaskFlags() override;
  396. virtual CPLErr CreateMaskBand( int nFlagsIn ) override;
  397. void SetMaskBand(VRTRasterBand* poMaskBand);
  398. void SetIsMaskBand();
  399. CPLErr UnsetNoDataValue();
  400. virtual int CloseDependentDatasets();
  401. virtual int IsSourcedRasterBand() { return FALSE; }
  402. virtual int IsPansharpenRasterBand() { return FALSE; }
  403. };
  404. /************************************************************************/
  405. /* VRTSourcedRasterBand */
  406. /************************************************************************/
  407. class VRTSimpleSource;
  408. class CPL_DLL VRTSourcedRasterBand : public VRTRasterBand
  409. {
  410. private:
  411. int m_nRecursionCounter;
  412. CPLString m_osLastLocationInfo;
  413. char **m_papszSourceList;
  414. bool CanUseSourcesMinMaxImplementations();
  415. void CheckSource( VRTSimpleSource *poSS );
  416. CPL_DISALLOW_COPY_ASSIGN(VRTSourcedRasterBand)
  417. public:
  418. int nSources;
  419. VRTSource **papoSources;
  420. int bSkipBufferInitialization;
  421. VRTSourcedRasterBand( GDALDataset *poDS, int nBand );
  422. VRTSourcedRasterBand( GDALDataType eType,
  423. int nXSize, int nYSize );
  424. VRTSourcedRasterBand( GDALDataset *poDS, int nBand,
  425. GDALDataType eType,
  426. int nXSize, int nYSize );
  427. virtual ~VRTSourcedRasterBand();
  428. virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
  429. void *, int, int, GDALDataType,
  430. GSpacing nPixelSpace, GSpacing nLineSpace,
  431. GDALRasterIOExtraArg* psExtraArg) override;
  432. virtual int IGetDataCoverageStatus( int nXOff, int nYOff,
  433. int nXSize, int nYSize,
  434. int nMaskFlagStop,
  435. double* pdfDataPct) override;
  436. virtual char **GetMetadataDomainList() override;
  437. virtual const char *GetMetadataItem( const char * pszName,
  438. const char * pszDomain = "" ) override;
  439. virtual char **GetMetadata( const char * pszDomain = "" ) override;
  440. virtual CPLErr SetMetadata( char ** papszMetadata,
  441. const char * pszDomain = "" ) override;
  442. virtual CPLErr SetMetadataItem( const char * pszName,
  443. const char * pszValue,
  444. const char * pszDomain = "" ) override;
  445. virtual CPLErr XMLInit( CPLXMLNode *, const char *, void*,
  446. std::map<CPLString, GDALDataset*>& ) override;
  447. virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) override;
  448. virtual double GetMinimum( int *pbSuccess = nullptr ) override;
  449. virtual double GetMaximum(int *pbSuccess = nullptr ) override;
  450. virtual CPLErr ComputeRasterMinMax( int bApproxOK, double* adfMinMax ) override;
  451. virtual CPLErr ComputeStatistics( int bApproxOK,
  452. double *pdfMin, double *pdfMax,
  453. double *pdfMean, double *pdfStdDev,
  454. GDALProgressFunc pfnProgress,
  455. void *pProgressData ) override;
  456. virtual CPLErr GetHistogram( double dfMin, double dfMax,
  457. int nBuckets, GUIntBig * panHistogram,
  458. int bIncludeOutOfRange, int bApproxOK,
  459. GDALProgressFunc pfnProgress,
  460. void *pProgressData ) override;
  461. CPLErr AddSource( VRTSource * );
  462. CPLErr AddSimpleSource( GDALRasterBand *poSrcBand,
  463. double dfSrcXOff=-1, double dfSrcYOff=-1,
  464. double dfSrcXSize=-1, double dfSrcYSize=-1,
  465. double dfDstXOff=-1, double dfDstYOff=-1,
  466. double dfDstXSize=-1, double dfDstYSize=-1,
  467. const char *pszResampling = "near",
  468. double dfNoDataValue = VRT_NODATA_UNSET);
  469. CPLErr AddComplexSource( GDALRasterBand *poSrcBand,
  470. double dfSrcXOff=-1, double dfSrcYOff=-1,
  471. double dfSrcXSize=-1, double dfSrcYSize=-1,
  472. double dfDstXOff=-1, double dfDstYOff=-1,
  473. double dfDstXSize=-1, double dfDstYSize=-1,
  474. double dfScaleOff=0.0,
  475. double dfScaleRatio=1.0,
  476. double dfNoDataValue = VRT_NODATA_UNSET,
  477. int nColorTableComponent = 0);
  478. CPLErr AddMaskBandSource( GDALRasterBand *poSrcBand,
  479. double dfSrcXOff=-1, double dfSrcYOff=-1,
  480. double dfSrcXSize=-1,
  481. double dfSrcYSize=-1,
  482. double dfDstXOff=-1, double dfDstYOff=-1,
  483. double dfDstXSize=-1,
  484. double dfDstYSize=-1 );
  485. CPLErr AddFuncSource( VRTImageReadFunc pfnReadFunc, void *hCBData,
  486. double dfNoDataValue = VRT_NODATA_UNSET );
  487. void ConfigureSource(VRTSimpleSource *poSimpleSource,
  488. GDALRasterBand *poSrcBand,
  489. int bAddAsMaskBand,
  490. double dfSrcXOff, double dfSrcYOff,
  491. double dfSrcXSize, double dfSrcYSize,
  492. double dfDstXOff, double dfDstYOff,
  493. double dfDstXSize, double dfDstYSize );
  494. virtual CPLErr IReadBlock( int, int, void * ) override;
  495. virtual void GetFileList(char*** ppapszFileList, int *pnSize,
  496. int *pnMaxSize, CPLHashSet* hSetFiles) override;
  497. virtual int CloseDependentDatasets() override;
  498. virtual int IsSourcedRasterBand() override { return TRUE; }
  499. virtual CPLErr FlushCache() override;
  500. };
  501. /************************************************************************/
  502. /* VRTWarpedRasterBand */
  503. /************************************************************************/
  504. class CPL_DLL VRTWarpedRasterBand : public VRTRasterBand
  505. {
  506. public:
  507. VRTWarpedRasterBand( GDALDataset *poDS, int nBand,
  508. GDALDataType eType = GDT_Unknown );
  509. virtual ~VRTWarpedRasterBand();
  510. virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) override;
  511. virtual CPLErr IReadBlock( int, int, void * ) override;
  512. virtual CPLErr IWriteBlock( int, int, void * ) override;
  513. virtual int GetOverviewCount() override;
  514. virtual GDALRasterBand *GetOverview(int) override;
  515. };
  516. /************************************************************************/
  517. /* VRTPansharpenedRasterBand */
  518. /************************************************************************/
  519. class VRTPansharpenedRasterBand : public VRTRasterBand
  520. {
  521. int m_nIndexAsPansharpenedBand;
  522. public:
  523. VRTPansharpenedRasterBand(
  524. GDALDataset *poDS, int nBand,
  525. GDALDataType eDataType = GDT_Unknown );
  526. virtual ~VRTPansharpenedRasterBand();
  527. virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) override;
  528. virtual CPLErr IReadBlock( int, int, void * ) override;
  529. virtual CPLErr IRasterIO( GDALRWFlag eRWFlag,
  530. int nXOff, int nYOff, int nXSize, int nYSize,
  531. void * pData, int nBufXSize, int nBufYSize,
  532. GDALDataType eBufType,
  533. GSpacing nPixelSpace, GSpacing nLineSpace,
  534. GDALRasterIOExtraArg* psExtraArg) override;
  535. virtual int GetOverviewCount() override;
  536. virtual GDALRasterBand *GetOverview(int) override;
  537. virtual int IsPansharpenRasterBand() override { return TRUE; }
  538. void SetIndexAsPansharpenedBand( int nIdx )
  539. { m_nIndexAsPansharpenedBand = nIdx; }
  540. int GetIndexAsPansharpenedBand() const
  541. { return m_nIndexAsPansharpenedBand; }
  542. };
  543. /************************************************************************/
  544. /* VRTDerivedRasterBand */
  545. /************************************************************************/
  546. class VRTDerivedRasterBandPrivateData;
  547. class CPL_DLL VRTDerivedRasterBand : public VRTSourcedRasterBand
  548. {
  549. VRTDerivedRasterBandPrivateData* m_poPrivate;
  550. bool InitializePython();
  551. CPL_DISALLOW_COPY_ASSIGN(VRTDerivedRasterBand)
  552. public:
  553. char *pszFuncName;
  554. GDALDataType eSourceTransferType;
  555. VRTDerivedRasterBand( GDALDataset *poDS, int nBand );
  556. VRTDerivedRasterBand( GDALDataset *poDS, int nBand,
  557. GDALDataType eType, int nXSize, int nYSize );
  558. virtual ~VRTDerivedRasterBand();
  559. virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
  560. void *, int, int, GDALDataType,
  561. GSpacing nPixelSpace, GSpacing nLineSpace,
  562. GDALRasterIOExtraArg* psExtraArg ) override;
  563. virtual int IGetDataCoverageStatus( int nXOff, int nYOff,
  564. int nXSize, int nYSize,
  565. int nMaskFlagStop,
  566. double* pdfDataPct) override;
  567. static CPLErr AddPixelFunction( const char *pszFuncName,
  568. GDALDerivedPixelFunc pfnPixelFunc );
  569. static GDALDerivedPixelFunc GetPixelFunction( const char *pszFuncName );
  570. void SetPixelFunctionName( const char *pszFuncName );
  571. void SetSourceTransferType( GDALDataType eDataType );
  572. void SetPixelFunctionLanguage( const char* pszLanguage );
  573. virtual CPLErr XMLInit( CPLXMLNode *, const char *, void*,
  574. std::map<CPLString, GDALDataset*>& ) override;
  575. virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) override;
  576. virtual double GetMinimum( int *pbSuccess = nullptr ) override;
  577. virtual double GetMaximum(int *pbSuccess = nullptr ) override;
  578. virtual CPLErr ComputeRasterMinMax( int bApproxOK, double* adfMinMax ) override;
  579. virtual CPLErr ComputeStatistics( int bApproxOK,
  580. double *pdfMin, double *pdfMax,
  581. double *pdfMean, double *pdfStdDev,
  582. GDALProgressFunc pfnProgress,
  583. void *pProgressData ) override;
  584. virtual CPLErr GetHistogram( double dfMin, double dfMax,
  585. int nBuckets, GUIntBig * panHistogram,
  586. int bIncludeOutOfRange, int bApproxOK,
  587. GDALProgressFunc pfnProgress,
  588. void *pProgressData ) override;
  589. static void Cleanup();
  590. };
  591. /************************************************************************/
  592. /* VRTRawRasterBand */
  593. /************************************************************************/
  594. class RawRasterBand;
  595. class CPL_DLL VRTRawRasterBand : public VRTRasterBand
  596. {
  597. RawRasterBand *m_poRawRaster;
  598. char *m_pszSourceFilename;
  599. int m_bRelativeToVRT;
  600. CPL_DISALLOW_COPY_ASSIGN(VRTRawRasterBand)
  601. public:
  602. VRTRawRasterBand( GDALDataset *poDS, int nBand,
  603. GDALDataType eType = GDT_Unknown );
  604. virtual ~VRTRawRasterBand();
  605. virtual CPLErr XMLInit( CPLXMLNode *, const char *, void*,
  606. std::map<CPLString, GDALDataset*>& ) override;
  607. virtual CPLXMLNode * SerializeToXML( const char *pszVRTPath ) override;
  608. virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
  609. void *, int, int, GDALDataType,
  610. GSpacing nPixelSpace, GSpacing nLineSpace,
  611. GDALRasterIOExtraArg* psExtraArg ) override;
  612. virtual CPLErr IReadBlock( int, int, void * ) override;
  613. virtual CPLErr IWriteBlock( int, int, void * ) override;
  614. CPLErr SetRawLink( const char *pszFilename,
  615. const char *pszVRTPath,
  616. int bRelativeToVRT,
  617. vsi_l_offset nImageOffset,
  618. int nPixelOffset, int nLineOffset,
  619. const char *pszByteOrder );
  620. void ClearRawLink();
  621. virtual void GetFileList( char*** ppapszFileList, int *pnSize,
  622. int *pnMaxSize, CPLHashSet* hSetFiles ) override;
  623. };
  624. /************************************************************************/
  625. /* VRTDriver */
  626. /************************************************************************/
  627. class VRTDriver : public GDALDriver
  628. {
  629. CPL_DISALLOW_COPY_ASSIGN(VRTDriver)
  630. public:
  631. VRTDriver();
  632. virtual ~VRTDriver();
  633. char **papszSourceParsers;
  634. virtual char **GetMetadataDomainList() override;
  635. virtual char **GetMetadata( const char * pszDomain = "" ) override;
  636. virtual CPLErr SetMetadata( char ** papszMetadata,
  637. const char * pszDomain = "" ) override;
  638. VRTSource *ParseSource( CPLXMLNode *psSrc, const char *pszVRTPath,
  639. void* pUniqueHandle,
  640. std::map<CPLString, GDALDataset*>& oMapSharedSources );
  641. void AddSourceParser( const char *pszElementName,
  642. VRTSourceParser pfnParser );
  643. };
  644. /************************************************************************/
  645. /* VRTSimpleSource */
  646. /************************************************************************/
  647. class CPL_DLL VRTSimpleSource : public VRTSource
  648. {
  649. CPL_DISALLOW_COPY_ASSIGN(VRTSimpleSource)
  650. protected:
  651. friend class VRTSourcedRasterBand;
  652. GDALRasterBand *m_poRasterBand;
  653. // When poRasterBand is a mask band, poMaskBandMainBand is the band
  654. // from which the mask band is taken.
  655. GDALRasterBand *m_poMaskBandMainBand;
  656. double m_dfSrcXOff;
  657. double m_dfSrcYOff;
  658. double m_dfSrcXSize;
  659. double m_dfSrcYSize;
  660. double m_dfDstXOff;
  661. double m_dfDstYOff;
  662. double m_dfDstXSize;
  663. double m_dfDstYSize;
  664. int m_bNoDataSet;
  665. double m_dfNoDataValue;
  666. CPLString m_osResampling;
  667. int m_nMaxValue;
  668. int m_bRelativeToVRTOri;
  669. CPLString m_osSourceFileNameOri;
  670. int m_nExplicitSharedStatus; // -1 unknown, 0 = unshared, 1 = shared
  671. int NeedMaxValAdjustment() const;
  672. public:
  673. VRTSimpleSource();
  674. VRTSimpleSource( const VRTSimpleSource* poSrcSource,
  675. double dfXDstRatio, double dfYDstRatio );
  676. virtual ~VRTSimpleSource();
  677. virtual CPLErr XMLInit( CPLXMLNode *psTree, const char *, void*,
  678. std::map<CPLString, GDALDataset*>& ) override;
  679. virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) override;
  680. void SetSrcBand( GDALRasterBand * );
  681. void SetSrcMaskBand( GDALRasterBand * );
  682. void SetSrcWindow( double, double, double, double );
  683. void SetDstWindow( double, double, double, double );
  684. void SetNoDataValue( double dfNoDataValue );
  685. const CPLString& GetResampling() const { return m_osResampling; }
  686. void SetResampling( const char* pszResampling );
  687. int GetSrcDstWindow( int, int, int, int, int, int,
  688. double *pdfReqXOff, double *pdfReqYOff,
  689. double *pdfReqXSize, double *pdfReqYSize,
  690. int *, int *, int *, int *,
  691. int *, int *, int *, int * );
  692. virtual CPLErr RasterIO( GDALDataType eBandDataType,
  693. int nXOff, int nYOff, int nXSize, int nYSize,
  694. void *pData, int nBufXSize, int nBufYSize,
  695. GDALDataType eBufType,
  696. GSpacing nPixelSpace, GSpacing nLineSpace,
  697. GDALRasterIOExtraArg* psExtraArgIn ) override;
  698. virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) override;
  699. virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) override;
  700. virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK,
  701. double* adfMinMax ) override;
  702. virtual CPLErr ComputeStatistics( int nXSize, int nYSize,
  703. int bApproxOK,
  704. double *pdfMin, double *pdfMax,
  705. double *pdfMean, double *pdfStdDev,
  706. GDALProgressFunc pfnProgress,
  707. void *pProgressData ) override;
  708. virtual CPLErr GetHistogram( int nXSize, int nYSize,
  709. double dfMin, double dfMax,
  710. int nBuckets, GUIntBig * panHistogram,
  711. int bIncludeOutOfRange, int bApproxOK,
  712. GDALProgressFunc pfnProgress,
  713. void *pProgressData ) override;
  714. void DstToSrc( double dfX, double dfY,
  715. double &dfXOut, double &dfYOut ) const;
  716. void SrcToDst( double dfX, double dfY,
  717. double &dfXOut, double &dfYOut ) const;
  718. virtual void GetFileList( char*** ppapszFileList, int *pnSize,
  719. int *pnMaxSize, CPLHashSet* hSetFiles ) override;
  720. virtual int IsSimpleSource() override { return TRUE; }
  721. virtual const char* GetType() { return "SimpleSource"; }
  722. virtual CPLErr FlushCache() override;
  723. GDALRasterBand* GetBand();
  724. int IsSameExceptBandNumber( VRTSimpleSource* poOtherSource );
  725. CPLErr DatasetRasterIO(
  726. GDALDataType eBandDataType,
  727. int nXOff, int nYOff, int nXSize, int nYSize,
  728. void * pData, int nBufXSize, int nBufYSize,
  729. GDALDataType eBufType,
  730. int nBandCount, int *panBandMap,
  731. GSpacing nPixelSpace, GSpacing nLineSpace,
  732. GSpacing nBandSpace,
  733. GDALRasterIOExtraArg* psExtraArg );
  734. void UnsetPreservedRelativeFilenames();
  735. void SetMaxValue( int nVal ) { m_nMaxValue = nVal; }
  736. };
  737. /************************************************************************/
  738. /* VRTAveragedSource */
  739. /************************************************************************/
  740. class VRTAveragedSource : public VRTSimpleSource
  741. {
  742. CPL_DISALLOW_COPY_ASSIGN(VRTAveragedSource)
  743. public:
  744. VRTAveragedSource();
  745. virtual CPLErr RasterIO( GDALDataType eBandDataType,
  746. int nXOff, int nYOff, int nXSize, int nYSize,
  747. void *pData, int nBufXSize, int nBufYSize,
  748. GDALDataType eBufType,
  749. GSpacing nPixelSpace, GSpacing nLineSpace,
  750. GDALRasterIOExtraArg* psExtraArgIn ) override;
  751. virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) override;
  752. virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) override;
  753. virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK,
  754. double* adfMinMax ) override;
  755. virtual CPLErr ComputeStatistics( int nXSize, int nYSize,
  756. int bApproxOK,
  757. double *pdfMin, double *pdfMax,
  758. double *pdfMean, double *pdfStdDev,
  759. GDALProgressFunc pfnProgress,
  760. void *pProgressData ) override;
  761. virtual CPLErr GetHistogram( int nXSize, int nYSize,
  762. double dfMin, double dfMax,
  763. int nBuckets, GUIntBig * panHistogram,
  764. int bIncludeOutOfRange, int bApproxOK,
  765. GDALProgressFunc pfnProgress,
  766. void *pProgressData ) override;
  767. virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) override;
  768. virtual const char* GetType() override { return "AveragedSource"; }
  769. };
  770. /************************************************************************/
  771. /* VRTComplexSource */
  772. /************************************************************************/
  773. typedef enum
  774. {
  775. VRT_SCALING_NONE,
  776. VRT_SCALING_LINEAR,
  777. VRT_SCALING_EXPONENTIAL,
  778. } VRTComplexSourceScaling;
  779. class CPL_DLL VRTComplexSource : public VRTSimpleSource
  780. {
  781. CPL_DISALLOW_COPY_ASSIGN(VRTComplexSource)
  782. bool AreValuesUnchanged() const;
  783. protected:
  784. VRTComplexSourceScaling m_eScalingType;
  785. double m_dfScaleOff; // For linear scaling.
  786. double m_dfScaleRatio; // For linear scaling.
  787. // For non-linear scaling with a power function.
  788. int m_bSrcMinMaxDefined;
  789. double m_dfSrcMin;
  790. double m_dfSrcMax;
  791. double m_dfDstMin;
  792. double m_dfDstMax;
  793. double m_dfExponent;
  794. int m_nColorTableComponent;
  795. template <class WorkingDT>
  796. CPLErr RasterIOInternal( int nReqXOff, int nReqYOff,
  797. int nReqXSize, int nReqYSize,
  798. void *pData, int nOutXSize, int nOutYSize,
  799. GDALDataType eBufType,
  800. GSpacing nPixelSpace, GSpacing nLineSpace,
  801. GDALRasterIOExtraArg* psExtraArg,
  802. GDALDataType eWrkDataType );
  803. public:
  804. VRTComplexSource();
  805. VRTComplexSource(const VRTComplexSource* poSrcSource,
  806. double dfXDstRatio, double dfYDstRatio);
  807. virtual ~VRTComplexSource();
  808. virtual CPLErr RasterIO( GDALDataType eBandDataType,
  809. int nXOff, int nYOff, int nXSize, int nYSize,
  810. void *pData, int nBufXSize, int nBufYSize,
  811. GDALDataType eBufType,
  812. GSpacing nPixelSpace, GSpacing nLineSpace,
  813. GDALRasterIOExtraArg* psExtraArgIn ) override;
  814. virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) override;
  815. virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) override;
  816. virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK,
  817. double* adfMinMax ) override;
  818. virtual CPLErr ComputeStatistics( int nXSize, int nYSize,
  819. int bApproxOK,
  820. double *pdfMin, double *pdfMax,
  821. double *pdfMean, double *pdfStdDev,
  822. GDALProgressFunc pfnProgress,
  823. void *pProgressData ) override;
  824. virtual CPLErr GetHistogram( int nXSize, int nYSize,
  825. double dfMin, double dfMax,
  826. int nBuckets, GUIntBig * panHistogram,
  827. int bIncludeOutOfRange, int bApproxOK,
  828. GDALProgressFunc pfnProgress,
  829. void *pProgressData ) override;
  830. virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) override;
  831. virtual CPLErr XMLInit( CPLXMLNode *, const char *, void*,
  832. std::map<CPLString, GDALDataset*>& ) override;
  833. virtual const char* GetType() override { return "ComplexSource"; }
  834. double LookupValue( double dfInput );
  835. void SetLinearScaling( double dfOffset, double dfScale );
  836. void SetPowerScaling( double dfExponent,
  837. double dfSrcMin,
  838. double dfSrcMax,
  839. double dfDstMin,
  840. double dfDstMax );
  841. void SetColorTableComponent( int nComponent );
  842. double *m_padfLUTInputs;
  843. double *m_padfLUTOutputs;
  844. int m_nLUTItemCount;
  845. };
  846. /************************************************************************/
  847. /* VRTFilteredSource */
  848. /************************************************************************/
  849. class VRTFilteredSource : public VRTComplexSource
  850. {
  851. private:
  852. int IsTypeSupported( GDALDataType eTestType ) const;
  853. CPL_DISALLOW_COPY_ASSIGN(VRTFilteredSource)
  854. protected:
  855. int m_nSupportedTypesCount;
  856. GDALDataType m_aeSupportedTypes[20];
  857. int m_nExtraEdgePixels;
  858. public:
  859. VRTFilteredSource();
  860. virtual ~VRTFilteredSource();
  861. void SetExtraEdgePixels( int );
  862. void SetFilteringDataTypesSupported( int, GDALDataType * );
  863. virtual CPLErr FilterData( int nXSize, int nYSize, GDALDataType eType,
  864. GByte *pabySrcData, GByte *pabyDstData ) = 0;
  865. virtual CPLErr RasterIO( GDALDataType eBandDataType,
  866. int nXOff, int nYOff, int nXSize, int nYSize,
  867. void *pData, int nBufXSize, int nBufYSize,
  868. GDALDataType eBufType,
  869. GSpacing nPixelSpace, GSpacing nLineSpace,
  870. GDALRasterIOExtraArg* psExtraArg ) override;
  871. };
  872. /************************************************************************/
  873. /* VRTKernelFilteredSource */
  874. /************************************************************************/
  875. class VRTKernelFilteredSource : public VRTFilteredSource
  876. {
  877. CPL_DISALLOW_COPY_ASSIGN(VRTKernelFilteredSource)
  878. protected:
  879. int m_nKernelSize;
  880. bool m_bSeparable;
  881. double *m_padfKernelCoefs;
  882. int m_bNormalized;
  883. public:
  884. VRTKernelFilteredSource();
  885. virtual ~VRTKernelFilteredSource();
  886. virtual CPLErr XMLInit( CPLXMLNode *psTree, const char *, void*,
  887. std::map<CPLString, GDALDataset*>& ) override;
  888. virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) override;
  889. virtual CPLErr FilterData( int nXSize, int nYSize, GDALDataType eType,
  890. GByte *pabySrcData, GByte *pabyDstData ) override;
  891. CPLErr SetKernel( int nKernelSize, bool bSeparable, double *padfCoefs );
  892. void SetNormalized( int );
  893. };
  894. /************************************************************************/
  895. /* VRTAverageFilteredSource */
  896. /************************************************************************/
  897. class VRTAverageFilteredSource : public VRTKernelFilteredSource
  898. {
  899. CPL_DISALLOW_COPY_ASSIGN(VRTAverageFilteredSource)
  900. public:
  901. explicit VRTAverageFilteredSource( int nKernelSize );
  902. virtual ~VRTAverageFilteredSource();
  903. virtual CPLErr XMLInit( CPLXMLNode *psTree, const char *, void*,
  904. std::map<CPLString, GDALDataset*>& ) override;
  905. virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) override;
  906. };
  907. /************************************************************************/
  908. /* VRTFuncSource */
  909. /************************************************************************/
  910. class VRTFuncSource : public VRTSource
  911. {
  912. CPL_DISALLOW_COPY_ASSIGN(VRTFuncSource)
  913. public:
  914. VRTFuncSource();
  915. virtual ~VRTFuncSource();
  916. virtual CPLErr XMLInit( CPLXMLNode *, const char *, void*,
  917. std::map<CPLString, GDALDataset*>& ) override { return CE_Failure; }
  918. virtual CPLXMLNode *SerializeToXML( const char *pszVRTPath ) override;
  919. virtual CPLErr RasterIO( GDALDataType eBandDataType,
  920. int nXOff, int nYOff, int nXSize, int nYSize,
  921. void *pData, int nBufXSize, int nBufYSize,
  922. GDALDataType eBufType,
  923. GSpacing nPixelSpace, GSpacing nLineSpace,
  924. GDALRasterIOExtraArg* psExtraArg ) override;
  925. virtual double GetMinimum( int nXSize, int nYSize, int *pbSuccess ) override;
  926. virtual double GetMaximum( int nXSize, int nYSize, int *pbSuccess ) override;
  927. virtual CPLErr ComputeRasterMinMax( int nXSize, int nYSize, int bApproxOK,
  928. double* adfMinMax ) override;
  929. virtual CPLErr ComputeStatistics( int nXSize, int nYSize,
  930. int bApproxOK,
  931. double *pdfMin, double *pdfMax,
  932. double *pdfMean, double *pdfStdDev,
  933. GDALProgressFunc pfnProgress,
  934. void *pProgressData ) override;
  935. virtual CPLErr GetHistogram( int nXSize, int nYSize,
  936. double dfMin, double dfMax,
  937. int nBuckets, GUIntBig * panHistogram,
  938. int bIncludeOutOfRange, int bApproxOK,
  939. GDALProgressFunc pfnProgress,
  940. void *pProgressData ) override;
  941. VRTImageReadFunc pfnReadFunc;
  942. void *pCBData;
  943. GDALDataType eType;
  944. float fNoDataValue;
  945. };
  946. #endif /* #ifndef DOXYGEN_SKIP */
  947. #endif /* ndef VIRTUALDATASET_H_INCLUDED */
上海开阖软件有限公司 沪ICP备12045867号-1