30 #ifndef GDAL_PROXY_H_INCLUDED 31 #define GDAL_PROXY_H_INCLUDED 51 virtual GDALDataset *RefUnderlyingDataset()
const = 0;
52 virtual void UnrefUnderlyingDataset(
GDALDataset* poUnderlyingDataset)
const;
54 CPLErr IBuildOverviews(
const char *,
int,
int *,
55 int,
int *, GDALProgressFunc,
void * )
override;
63 char **
GetMetadata(
const char * pszDomain )
override;
65 const char * pszDomain )
override;
67 const char * pszDomain )
override;
69 const char * pszValue,
70 const char * pszDomain )
override;
91 int nBufXSize,
int nBufYSize,
93 int nBandCount,
int *panBandList,
94 char **papszOptions )
override;
99 const char *_GetProjectionRef(
void)
override;
100 CPLErr _SetProjection(
const char * )
override;
101 const char *_GetGCPProjection()
override;
103 const char *pszGCPProjection )
override;
116 GDALProxyRasterBand() {}
119 virtual void UnrefUnderlyingRasterBand(
GDALRasterBand* poUnderlyingRasterBand);
129 char **
GetMetadata(
const char * pszDomain )
override;
131 const char * pszDomain )
override;
133 const char * pszDomain )
override;
135 const char * pszValue,
136 const char * pszDomain )
override;
140 double GetMinimum(
int *pbSuccess =
nullptr )
override;
141 double GetMaximum(
int *pbSuccess =
nullptr )
override;
142 double GetOffset(
int *pbSuccess =
nullptr )
override;
143 double GetScale(
int *pbSuccess =
nullptr )
override;
147 CPLErr Fill(
double dfRealValue,
double dfImaginaryValue = 0)
override;
159 double *pdfMin,
double *pdfMax,
160 double *pdfMean,
double *padfStdDev )
override;
162 double *pdfMin,
double *pdfMax,
163 double *pdfMean,
double *pdfStdDev,
164 GDALProgressFunc,
void *pProgressData )
override;
166 double dfMean,
double dfStdDev )
override;
174 GDALProgressFunc,
void * )
override;
177 int nBufXSize,
int nBufYSize,
181 int nBuckets,
GUIntBig * panHistogram,
182 int bIncludeOutOfRange,
int bApproxOK,
183 GDALProgressFunc,
void *pProgressData )
override;
186 int *pnBuckets,
GUIntBig ** ppanHistogram,
188 GDALProgressFunc,
void *pProgressData)
override;
190 int nBuckets,
GUIntBig *panHistogram )
override;
202 char **papszOptions )
override;
212 typedef struct _GDALProxyPoolCacheEntry GDALProxyPoolCacheEntry;
213 class GDALProxyPoolRasterBand;
215 class CPL_DLL GDALProxyPoolDataset :
public GDALProxyDataset
220 mutable char *pszProjectionRef =
nullptr;
223 double adfGeoTransform[6]{0,1,0,0,0,1};
224 bool bHasSrcProjection =
false;
225 bool m_bHasSrcSRS =
false;
226 bool bHasSrcGeoTransform =
false;
227 char *pszGCPProjection =
nullptr;
233 mutable GDALProxyPoolCacheEntry* cacheEntry =
nullptr;
234 char *m_pszOwner =
nullptr;
236 GDALDataset *RefUnderlyingDataset(
bool bForceOpen)
const;
238 GDALProxyPoolDataset(
const char* pszSourceDatasetDescription,
241 const char* pszOwner );
244 GDALDataset *RefUnderlyingDataset()
const override;
245 void UnrefUnderlyingDataset(
GDALDataset* poUnderlyingDataset)
const override;
247 friend class GDALProxyPoolRasterBand;
250 GDALProxyPoolDataset(
const char* pszSourceDatasetDescription,
251 int nRasterXSize,
int nRasterYSize,
254 const char * pszProjectionRef =
nullptr,
255 double * padfGeoTransform =
nullptr,
256 const char* pszOwner =
nullptr );
259 static GDALProxyPoolDataset* Create(
const char* pszSourceDatasetDescription,
263 const char* pszOwner =
nullptr );
265 ~GDALProxyPoolDataset()
override;
273 void AddSrcBandDescription(
GDALDataType eDataType,
int nBlockXSize,
279 void AddSrcBand(
int nBand,
GDALDataType eDataType,
int nBlockXSize,
281 void FlushCache(
bool bAtClosing)
override;
286 const char *_GetProjectionRef()
override;
287 CPLErr _SetProjection(
const char * )
override;
289 CPLErr GetGeoTransform(
double * )
override;
290 CPLErr SetGeoTransform(
double * )
override;
295 char **GetMetadata(
const char * pszDomain )
override;
296 const char *GetMetadataItem(
const char * pszName,
297 const char * pszDomain )
override;
299 void *GetInternalHandle(
const char * pszRequest )
override;
301 const char *_GetGCPProjection()
override;
313 class GDALProxyPoolOverviewRasterBand;
314 class GDALProxyPoolMaskBand;
316 class CPL_DLL GDALProxyPoolRasterBand :
public GDALProxyRasterBand
321 char *pszUnitType =
nullptr;
322 char **papszCategoryNames =
nullptr;
325 int nSizeProxyOverviewRasterBand = 0;
326 GDALProxyPoolOverviewRasterBand **papoProxyOverviewRasterBand =
nullptr;
327 GDALProxyPoolMaskBand *poProxyMaskBand =
nullptr;
333 void UnrefUnderlyingRasterBand(
GDALRasterBand* poUnderlyingRasterBand )
336 friend class GDALProxyPoolOverviewRasterBand;
337 friend class GDALProxyPoolMaskBand;
340 GDALProxyPoolRasterBand( GDALProxyPoolDataset* poDS,
int nBand,
342 int nBlockXSize,
int nBlockYSize );
343 GDALProxyPoolRasterBand( GDALProxyPoolDataset* poDS,
345 ~GDALProxyPoolRasterBand()
override;
347 void AddSrcMaskBandDescription(
GDALDataType eDataType,
int nBlockXSize,
350 void AddSrcMaskBandDescriptionFromUnderlying();
355 char **GetMetadata(
const char * pszDomain )
override;
356 const char *GetMetadataItem(
const char * pszName,
357 const char * pszDomain )
override;
358 char **GetCategoryNames()
override;
359 const char *GetUnitType()
override;
365 CPLErr FlushCache(
bool bAtClosing)
override;
375 class GDALProxyPoolOverviewRasterBand :
public GDALProxyPoolRasterBand
378 GDALProxyPoolRasterBand *poMainBand =
nullptr;
379 int nOverviewBand = 0;
382 int nRefCountUnderlyingMainRasterBand = 0;
388 void UnrefUnderlyingRasterBand(
GDALRasterBand* poUnderlyingRasterBand )
392 GDALProxyPoolOverviewRasterBand( GDALProxyPoolDataset* poDS,
394 GDALProxyPoolRasterBand* poMainBand,
396 ~GDALProxyPoolOverviewRasterBand()
override;
403 class GDALProxyPoolMaskBand :
public GDALProxyPoolRasterBand
406 GDALProxyPoolRasterBand *poMainBand =
nullptr;
409 int nRefCountUnderlyingMainRasterBand = 0;
415 void UnrefUnderlyingRasterBand(
GDALRasterBand* poUnderlyingRasterBand )
419 GDALProxyPoolMaskBand( GDALProxyPoolDataset* poDS,
421 GDALProxyPoolRasterBand* poMainBand );
422 GDALProxyPoolMaskBand( GDALProxyPoolDataset* poDS,
423 GDALProxyPoolRasterBand* poMainBand,
425 int nBlockXSize,
int nBlockYSize );
426 ~GDALProxyPoolMaskBand()
override;
437 typedef struct GDALProxyPoolDatasetHS *GDALProxyPoolDatasetH;
439 GDALProxyPoolDatasetH CPL_DLL GDALProxyPoolDatasetCreate(
const char* pszSourceDatasetDescription,
440 int nRasterXSize,
int nRasterYSize,
442 const char * pszProjectionRef,
443 double * padfGeoTransform);
445 void CPL_DLL GDALProxyPoolDatasetDelete(GDALProxyPoolDatasetH hProxyPoolDataset);
447 void CPL_DLL GDALProxyPoolDatasetAddSrcBandDescription( GDALProxyPoolDatasetH hProxyPoolDataset,
449 int nBlockXSize,
int nBlockYSize);
The GDALRasterAttributeTable (or RAT) class is used to encapsulate a table used to provide attribute ...
Definition: gdal_rat.h:47
virtual GDALDriver * GetDriver(void)
Fetch the driver to which this dataset relates.
Definition: gdaldataset.cpp:1315
virtual CPLErr GetGeoTransform(double *padfTransform)
Fetch the affine transformation coefficients.
Definition: gdaldataset.cpp:1177
virtual CPLVirtualMem * GetVirtualMemAuto(GDALRWFlag eRWFlag, int *pnPixelSpace, GIntBig *pnLineSpace, char **papszOptions)
Create a CPLVirtualMem object from a GDAL raster band object.
Definition: gdalrasterband.cpp:6658
GDALDataType
Definition: gdal.h:62
virtual CPLErr SetCategoryNames(char **papszNames)
Set the category names for this band.
Definition: gdalrasterband.cpp:1573
virtual GDALRasterBand * GetMaskBand()
Return the mask band associated with the band.
Definition: gdalrasterband.cpp:5957
virtual char ** GetCategoryNames()
Fetch the list of category names for this raster.
Definition: gdalrasterband.cpp:1525
virtual int HasArbitraryOverviews()
Check for arbitrary overviews.
Definition: gdalrasterband.cpp:2157
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:329
virtual GDALRasterBand * GetOverview(int)
Fetch overview raster band object.
Definition: gdalrasterband.cpp:2236
virtual CPLErr GetDefaultHistogram(double *pdfMin, double *pdfMax, int *pnBuckets, GUIntBig **ppanHistogram, int bForce, GDALProgressFunc, void *pProgressData)
Fetch default raster histogram.
Definition: gdalrasterband.cpp:3479
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:2841
virtual GDALColorInterp GetColorInterpretation()
How should this band be interpreted as color?
Definition: gdalrasterband.cpp:1968
virtual CPLErr SetDefaultRAT(const GDALRasterAttributeTable *poRAT)
Set default Raster Attribute Table.
Definition: gdalrasterband.cpp:5872
GDALRWFlag
Definition: gdal.h:121
virtual CPLErr SetStatistics(double dfMin, double dfMax, double dfMean, double dfStdDev)
Set statistics on band.
Definition: gdalrasterband.cpp:5423
virtual void * GetInternalHandle(const char *pszHandleName)
Fetch a format specific internally meaningful handle.
Definition: gdaldataset.cpp:1277
virtual int GetMaskFlags()
Return the status flags of the mask band associated with the band.
Definition: gdalrasterband.cpp:6222
virtual GDALRasterAttributeTable * GetDefaultRAT()
Fetch default Raster Attribute Table.
Definition: gdalrasterband.cpp:5824
virtual char ** GetMetadata(const char *pszDomain="")
Fetch metadata.
Definition: gdalmajorobject.cpp:249
virtual CPLErr BuildOverviews(const char *pszResampling, int nOverviews, int *panOverviewList, GDALProgressFunc pfnProgress, void *pProgressData)
Build raster overview(s)
Definition: gdalrasterband.cpp:2394
virtual CPLErr GetHistogram(double dfMin, double dfMax, int nBuckets, GUIntBig *panHistogram, int bIncludeOutOfRange, int bApproxOK, GDALProgressFunc, void *pProgressData)
Compute raster histogram.
Definition: gdalrasterband.cpp:2937
virtual CPLErr ComputeStatistics(int bApproxOK, double *pdfMin, double *pdfMax, double *pdfMean, double *pdfStdDev, GDALProgressFunc, void *pProgressData)
Compute image statistics.
Definition: gdalrasterband.cpp:4927
virtual CPLErr SetOffset(double dfNewOffset)
Set scaling offset.
Definition: gdalrasterband.cpp:2484
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
struct CPLVirtualMem CPLVirtualMem
Opaque type that represents a virtual memory mapping.
Definition: cpl_virtualmem.h:62
void static void char ** GetMetadata(const char *pszDomain="") override
Fetch metadata.
Definition: gdaldataset.cpp:4229
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
virtual CPLErr IReadBlock(int nBlockXOff, int nBlockYOff, void *pData)=0
Read a block of data.
virtual CPLErr FlushCache(bool bAtClosing=false)
Flush raster data cache.
Definition: gdalrasterband.cpp:1022
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition: gdal.h:286
virtual CPLErr SetDefaultHistogram(double dfMin, double dfMax, int nBuckets, GUIntBig *panHistogram)
Set default histogram.
Definition: gdalrasterband.cpp:5725
virtual double GetScale(int *pbSuccess=nullptr)
Fetch the raster value scale.
Definition: gdalrasterband.cpp:2541
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition: gdalmajorobject.cpp:344
virtual CPLErr AdviseRead(int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, GDALDataType eBufType, char **papszOptions)
Advise driver of upcoming read requests.
Definition: gdalrasterband.cpp:3694
virtual const GDAL_GCP * GetGCPs()
Fetch GCPs.
Definition: gdaldataset.cpp:1729
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition: gdaldataset.cpp:1834
Public (C callable) GDAL entry points.
virtual CPLErr DeleteNoDataValue()
Remove the no data value for this band.
Definition: gdalrasterband.cpp:1738
virtual CPLErr SetSpatialRef(const OGRSpatialReference *poSRS)
Set the spatial reference system for this dataset.
Definition: gdaldataset.cpp:1059
virtual const OGRSpatialReference * GetSpatialRef() const
Fetch the spatial reference for this dataset.
Definition: gdaldataset.cpp:928
virtual CPLErr SetGeoTransform(double *padfTransform)
Set the affine transformation coefficients.
Definition: gdaldataset.cpp:1232
virtual double GetNoDataValue(int *pbSuccess=nullptr)
Fetch the no data value for this band.
Definition: gdalrasterband.cpp:1625
virtual int GetGCPCount()
Get number of GCPs.
Definition: gdaldataset.cpp:1549
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1169
virtual void FlushCache(bool bAtClosing=false)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:435
virtual CPLErr ComputeRasterMinMax(int, double *)
Compute the min/max values for a band.
Definition: gdalrasterband.cpp:5490
virtual CPLErr SetColorInterpretation(GDALColorInterp eColorInterp)
Set color interpretation of a band.
Definition: gdalrasterband.cpp:2013
virtual const char * GetUnitType()
Return raster unit type.
Definition: gdalrasterband.cpp:2637
virtual const OGRSpatialReference * GetGCPSpatialRef() const
Get output spatial reference system for GCPs.
Definition: gdaldataset.cpp:1646
virtual CPLErr SetColorTable(GDALColorTable *poCT)
Set the raster color table.
Definition: gdalrasterband.cpp:2109
virtual double GetMinimum(int *pbSuccess=nullptr)
Fetch the minimum value for this band.
Definition: gdalrasterband.cpp:1881
virtual GDALColorTable * GetColorTable()
Fetch the color table associated with band.
Definition: gdalrasterband.cpp:2060
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:3147
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:247
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition: gdaldataset.cpp:3026
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:157
virtual CPLErr SetScale(double dfNewScale)
Set scaling ratio.
Definition: gdalrasterband.cpp:2590
virtual CPLErr IWriteBlock(int nBlockXOff, int nBlockYOff, void *pData)
Write a block of data.
Definition: gdalrasterband.cpp:616
virtual double GetOffset(int *pbSuccess=nullptr)
Fetch the raster value offset.
Definition: gdalrasterband.cpp:2435
virtual int GetOverviewCount()
Return the number of overview layers available.
Definition: gdalrasterband.cpp:2194
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
virtual CPLErr SetUnitType(const char *pszNewValue)
Set unit type.
Definition: gdalrasterband.cpp:2685
A single raster band (or channel).
Definition: gdal_priv.h:1133
GDALAccess
Definition: gdal.h:115
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the current band.
Definition: gdalrasterband.cpp:6303
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:339
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:331
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:244
virtual CPLErr IRasterIO(GDALRWFlag, int, int, int, int, void *, int, int, GDALDataType, GSpacing, GSpacing, GDALRasterIOExtraArg *psExtraArg)
Read/write a region of image data for this band.
Definition: rasterio.cpp:209
virtual double GetMaximum(int *pbSuccess=nullptr)
Fetch the maximum value for this band.
Definition: gdalrasterband.cpp:1788
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
virtual GDALRasterBand * GetRasterSampleOverview(GUIntBig)
Fetch best sampling overview.
Definition: gdalrasterband.cpp:2286
char ** GetMetadataDomainList() override
Fetch list of metadata domains.
Definition: gdaldataset.cpp:4330
GDALColorInterp
Definition: gdal.h:203
virtual CPLErr SetNoDataValue(double dfNoData)
Set the no data value for this band.
Definition: gdalrasterband.cpp:1684
struct _CPLHashSet CPLHashSet
Opaque type for a hash set.
Definition: cpl_hash_set.h:52
virtual CPLErr GetStatistics(int bApproxOK, int bForce, double *pdfMin, double *pdfMax, double *pdfMean, double *padfStdDev)
Fetch image statistics.
Definition: gdalrasterband.cpp:3774
Format specific driver.
Definition: gdal_priv.h:1488
A color table / palette.
Definition: gdal_priv.h:1024
virtual char ** GetMetadataDomainList()
Fetch list of metadata domains.
Definition: gdalmajorobject.cpp:161
virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue=0)
Fill this band with a constant value.
Definition: gdalrasterband.cpp:1379
Ground Control Point.
Definition: gdal.h:710
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:955