13#ifndef GDAL_PROXY_H_INCLUDED
14#define GDAL_PROXY_H_INCLUDED
36 virtual GDALDataset *RefUnderlyingDataset()
const = 0;
37 virtual void UnrefUnderlyingDataset(
GDALDataset *poUnderlyingDataset)
const;
39 CPLErr IBuildOverviews(
const char *,
int,
const int *,
int,
const int *,
40 GDALProgressFunc,
void *,
46 int nXSize,
int nYSize,
void *pData,
47 int nBufXSize,
int nBufYSize,
49 const int *panBandMap,
GSpacing nPixelSpace,
60 const char *pszDomain)
override;
62 const char *pszDomain)
override;
64 const char *pszDomain)
override;
86 int nBandCount,
int *panBandList,
93 int nBandCount,
const int *panBandList)
override;
95 int nYOff,
int nXSize,
int nYSize,
96 int nBandCount,
const int *panBandList,
97 void **ppBuffer,
size_t *pnBufferSize,
98 char **ppszDetailedFormat)
override;
111 GDALProxyRasterBand()
116 RefUnderlyingRasterBand(
bool bForceOpen =
true)
const = 0;
118 UnrefUnderlyingRasterBand(
GDALRasterBand *poUnderlyingRasterBand)
const;
120 CPLErr IReadBlock(
int,
int,
void *)
override;
121 CPLErr IWriteBlock(
int,
int,
void *)
override;
126 int IGetDataCoverageStatus(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
127 int nMaskFlagStop,
double *pdfDataPct)
override;
133 const char *pszDomain)
override;
135 const char *pszDomain)
override;
137 const char *pszDomain)
override;
140 int bJustInitialize)
override;
143 int nYBlockYOff)
override;
145 CPLErr FlushBlock(
int nXBlockOff,
int nYBlockOff,
146 int bWriteDirtyBlock)
override;
149 char **GetCategoryNames()
override;
150 double GetNoDataValue(
int *pbSuccess =
nullptr)
override;
151 double GetMinimum(
int *pbSuccess =
nullptr)
override;
152 double GetMaximum(
int *pbSuccess =
nullptr)
override;
153 double GetOffset(
int *pbSuccess =
nullptr)
override;
154 double GetScale(
int *pbSuccess =
nullptr)
override;
155 const char *GetUnitType()
override;
158 CPLErr Fill(
double dfRealValue,
double dfImaginaryValue = 0)
override;
160 CPLErr SetCategoryNames(
char **)
override;
161 CPLErr SetNoDataValue(
double)
override;
162 CPLErr DeleteNoDataValue()
override;
165 CPLErr SetOffset(
double)
override;
166 CPLErr SetScale(
double)
override;
167 CPLErr SetUnitType(
const char *)
override;
169 CPLErr GetStatistics(
int bApproxOK,
int bForce,
double *pdfMin,
170 double *pdfMax,
double *pdfMean,
171 double *padfStdDev)
override;
172 CPLErr ComputeStatistics(
int bApproxOK,
double *pdfMin,
double *pdfMax,
173 double *pdfMean,
double *pdfStdDev,
174 GDALProgressFunc,
void *pProgressData)
override;
175 CPLErr SetStatistics(
double dfMin,
double dfMax,
double dfMean,
176 double dfStdDev)
override;
177 CPLErr ComputeRasterMinMax(
int,
double *)
override;
179 int HasArbitraryOverviews()
override;
180 int GetOverviewCount()
override;
190 CPLErr GetHistogram(
double dfMin,
double dfMax,
int nBuckets,
191 GUIntBig *panHistogram,
int bIncludeOutOfRange,
192 int bApproxOK, GDALProgressFunc,
193 void *pProgressData)
override;
195 CPLErr GetDefaultHistogram(
double *pdfMin,
double *pdfMax,
int *pnBuckets,
196 GUIntBig **ppanHistogram,
int bForce,
197 GDALProgressFunc,
void *pProgressData)
override;
198 CPLErr SetDefaultHistogram(
double dfMin,
double dfMax,
int nBuckets,
205 int GetMaskFlags()
override;
207 bool IsMaskBand()
const override;
208 GDALMaskValueRange GetMaskValueRange()
const override;
214 CPLErr InterpolateAtPoint(
double dfPixel,
double dfLine,
216 double *pdfRealValue,
217 double *pdfImagValue)
const override;
219 void EnablePixelTypeSignedByteWarning(
bool b)
override;
229typedef struct _GDALProxyPoolCacheEntry GDALProxyPoolCacheEntry;
230class GDALProxyPoolRasterBand;
232class CPL_DLL GDALProxyPoolDataset :
public GDALProxyDataset
237 mutable char *pszProjectionRef =
nullptr;
241 bool m_bHasSrcSRS =
false;
242 bool m_bHasSrcGeoTransform =
false;
243 char *pszGCPProjection =
nullptr;
249 mutable GDALProxyPoolCacheEntry *cacheEntry =
nullptr;
250 char *m_pszOwner =
nullptr;
252 GDALDataset *RefUnderlyingDataset(
bool bForceOpen)
const;
254 GDALProxyPoolDataset(
const char *pszSourceDatasetDescription,
255 GDALAccess eAccess,
int bShared,
const char *pszOwner);
258 GDALDataset *RefUnderlyingDataset()
const override;
260 UnrefUnderlyingDataset(
GDALDataset *poUnderlyingDataset)
const override;
262 friend class GDALProxyPoolRasterBand;
265 GDALProxyPoolDataset(
const char *pszSourceDatasetDescription,
266 int nRasterXSize,
int nRasterYSize,
268 const char *pszProjectionRef =
nullptr,
270 const char *pszOwner =
nullptr);
272 static GDALProxyPoolDataset *Create(
const char *pszSourceDatasetDescription,
276 const char *pszOwner =
nullptr);
278 ~GDALProxyPoolDataset()
override;
286 void AddSrcBandDescription(
GDALDataType eDataType,
int nBlockXSize,
293 void AddSrcBand(
int nBand,
GDALDataType eDataType,
int nBlockXSize,
308 const char *pszDomain)
override;
323class GDALProxyPoolOverviewRasterBand;
324class GDALProxyPoolMaskBand;
327 GDALProxyPoolRasterBand :
public GDALProxyRasterBand
332 char *pszUnitType =
nullptr;
333 char **papszCategoryNames =
nullptr;
336 int nSizeProxyOverviewRasterBand = 0;
337 GDALProxyPoolOverviewRasterBand **papoProxyOverviewRasterBand =
nullptr;
338 GDALProxyPoolMaskBand *poProxyMaskBand =
nullptr;
342 RefUnderlyingRasterBand(
bool bForceOpen =
true)
const override;
343 void UnrefUnderlyingRasterBand(
346 friend class GDALProxyPoolOverviewRasterBand;
347 friend class GDALProxyPoolMaskBand;
350 GDALProxyPoolRasterBand(GDALProxyPoolDataset *poDS,
int nBand,
353 GDALProxyPoolRasterBand(GDALProxyPoolDataset *poDS,
355 ~GDALProxyPoolRasterBand()
override;
357 void AddSrcMaskBandDescription(
GDALDataType eDataType,
int nBlockXSize,
360 void AddSrcMaskBandDescriptionFromUnderlying();
367 const char *pszDomain)
override;
368 char **GetCategoryNames()
override;
369 const char *GetUnitType()
override;
373 GetRasterSampleOverview(
GUIntBig nDesiredSamples)
override;
386class GDALProxyPoolOverviewRasterBand final :
public GDALProxyPoolRasterBand
389 GDALProxyPoolRasterBand *poMainBand =
nullptr;
390 int nOverviewBand = 0;
393 mutable int nRefCountUnderlyingMainRasterBand = 0;
399 RefUnderlyingRasterBand(
bool bForceOpen =
true)
const override;
400 void UnrefUnderlyingRasterBand(
404 GDALProxyPoolOverviewRasterBand(GDALProxyPoolDataset *poDS,
406 GDALProxyPoolRasterBand *poMainBand,
408 ~GDALProxyPoolOverviewRasterBand()
override;
415class GDALProxyPoolMaskBand final :
public GDALProxyPoolRasterBand
418 GDALProxyPoolRasterBand *poMainBand =
nullptr;
421 mutable int nRefCountUnderlyingMainRasterBand = 0;
427 RefUnderlyingRasterBand(
bool bForceOpen =
true)
const override;
428 void UnrefUnderlyingRasterBand(
432 GDALProxyPoolMaskBand(GDALProxyPoolDataset *poDS,
434 GDALProxyPoolRasterBand *poMainBand);
435 GDALProxyPoolMaskBand(GDALProxyPoolDataset *poDS,
436 GDALProxyPoolRasterBand *poMainBand,
439 ~GDALProxyPoolMaskBand()
override;
441 bool IsMaskBand()
const override
455typedef struct GDALProxyPoolDatasetHS *GDALProxyPoolDatasetH;
457GDALProxyPoolDatasetH CPL_DLL GDALProxyPoolDatasetCreate(
458 const char *pszSourceDatasetDescription,
int nRasterXSize,
int nRasterYSize,
459 GDALAccess eAccess,
int bShared,
const char *pszProjectionRef,
460 const double *padfGeoTransform);
463GDALProxyPoolDatasetDelete(GDALProxyPoolDatasetH hProxyPoolDataset);
465void CPL_DLL GDALProxyPoolDatasetAddSrcBandDescription(
466 GDALProxyPoolDatasetH hProxyPoolDataset,
GDALDataType eDataType,
467 int nBlockXSize,
int nBlockYSize);
469int CPL_DLL GDALGetMaxDatasetPoolSize(
void);
String list class designed around our use of C "char**" string lists.
Definition cpl_string.h:476
A color table / palette.
Definition gdal_colortable.h:32
A set of associated raster bands, usually from one file.
Definition gdal_dataset.h:77
char ** GetMetadataDomainList() override
Fetch list of metadata domains.
Definition gdaldataset.cpp:5323
virtual void * GetInternalHandle(const char *pszHandleName)
Fetch a format specific internally meaningful handle.
Definition gdaldataset.cpp:1791
CPLErr BuildOverviews(const char *pszResampling, int nOverviews, const int *panOverviewList, int nListBands, const int *panBandList, GDALProgressFunc pfnProgress, void *pProgressData, CSLConstList papszOptions)
Build raster overview(s)
Definition gdaldataset.cpp:2466
virtual bool GetCloseReportsProgress() const
Returns whether the Close() operation will report progress / is a potential lengthy operation.
Definition gdaldataset.cpp:592
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition gdaldataset.cpp:3807
virtual CPLStringList GetCompressionFormats(int nXOff, int nYOff, int nXSize, int nYSize, int nBandCount, const int *panBandList)
Return the compression formats that can be natively obtained for the window of interest and requested...
Definition gdaldataset.cpp:10944
virtual int GetGCPCount()
Get number of GCPs.
Definition gdaldataset.cpp:2106
virtual const OGRSpatialReference * GetGCPSpatialRef() const
Get output spatial reference system for GCPs.
Definition gdaldataset.cpp:2196
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
virtual CPLErr SetSpatialRef(const OGRSpatialReference *poSRS)
Set the spatial reference system for this dataset.
Definition gdaldataset.cpp:1548
virtual CPLErr GetGeoTransform(GDALGeoTransform >) const
Fetch the affine transformation coefficients.
Definition gdaldataset.cpp:1629
virtual CPLErr AdviseRead(int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, GDALDataType eDT, int nBandCount, int *panBandList, CSLConstList papszOptions)
Advise driver of upcoming read requests.
Definition gdaldataset.cpp:3487
virtual CPLErr FlushCache(bool bAtClosing=false)
Flush all write cached data to disk.
Definition gdaldataset.cpp:723
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition gdaldataset.cpp:2360
virtual const OGRSpatialReference * GetSpatialRef() const
Fetch the spatial reference for this dataset.
Definition gdaldataset.cpp:1374
virtual GDALDriver * GetDriver(void) const
Fetch the driver to which this dataset relates.
Definition gdaldataset.cpp:1829
virtual CPLErr Close(GDALProgressFunc pfnProgress=nullptr, void *pProgressData=nullptr)
Do final cleanup before a dataset is destroyed.
Definition gdaldataset.cpp:473
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
virtual const GDAL_GCP * GetGCPs()
Fetch GCPs.
Definition gdaldataset.cpp:2253
void static void CSLConstList GetMetadata(const char *pszDomain="") override
Fetch metadata.
Definition gdaldataset.cpp:5217
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition gdaldataset.cpp:3690
virtual CPLErr ReadCompressedData(const char *pszFormat, int nXOff, int nYOff, int nXSize, int nYSize, int nBands, const int *panBandList, void **ppBuffer, size_t *pnBufferSize, char **ppszDetailedFormat)
Return the compressed content that can be natively obtained for the window of interest and requested ...
Definition gdaldataset.cpp:11174
virtual CPLErr SetGeoTransform(const GDALGeoTransform >)
Set the affine transformation coefficients.
Definition gdaldataset.cpp:1717
Format specific driver.
Definition gdal_driver.h:63
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition gdalmajorobject.cpp:322
The GDALRasterAttributeTable (or RAT) class is used to encapsulate a table used to provide attribute ...
Definition gdal_rat.h:48
A single raster band (or channel).
Definition gdal_rasterband.h:108
A single raster block in the block cache.
Definition gdal_rasterblock.h:33
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:152
CPLErr
Error category / error level.
Definition cpl_error.h:45
struct _CPLHashSet CPLHashSet
Opaque type for a hash set.
Definition cpl_hash_set.h:35
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition cpl_port.h:198
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:279
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:275
#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:1101
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1252
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition cpl_port.h:195
struct CPLVirtualMem CPLVirtualMem
Opaque type that represents a virtual memory mapping.
Definition cpl_virtualmem.h:45
Public (C callable) GDAL entry points.
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition gdal.h:412
GDALAccess
Definition gdal.h:120
@ GA_ReadOnly
Definition gdal.h:121
GDALDataType
Definition gdal.h:48
GDALRIOResampleAlg
RasterIO() resampling method.
Definition gdal.h:137
GDALColorInterp
Types of color interpretation for raster bands.
Definition gdal.h:294
GDALRWFlag
Definition gdal.h:127
This file is legacy since GDAL 3.12, but will be kept at least in the whole GDAL 3....
Ground Control Point.
Definition gdal.h:1261