30#ifndef GDAL_PROXY_H_INCLUDED
31#define GDAL_PROXY_H_INCLUDED
53 virtual GDALDataset *RefUnderlyingDataset()
const = 0;
54 virtual void UnrefUnderlyingDataset(
GDALDataset *poUnderlyingDataset)
const;
56 CPLErr IBuildOverviews(
const char *,
int,
const int *,
int,
const int *,
57 GDALProgressFunc,
void *,
68 const char *pszDomain)
override;
70 const char *pszDomain)
override;
92 int nBandCount,
int *panBandList,
93 char **papszOptions)
override;
108 GDALProxyRasterBand()
114 UnrefUnderlyingRasterBand(
GDALRasterBand *poUnderlyingRasterBand)
const;
116 CPLErr IReadBlock(
int,
int,
void *)
override;
117 CPLErr IWriteBlock(
int,
int,
void *)
override;
124 char **
GetMetadata(
const char *pszDomain)
override;
127 const char *pszDomain)
override;
129 const char *pszDomain)
override;
131 char **GetCategoryNames()
override;
132 double GetNoDataValue(
int *pbSuccess =
nullptr)
override;
133 double GetMinimum(
int *pbSuccess =
nullptr)
override;
134 double GetMaximum(
int *pbSuccess =
nullptr)
override;
135 double GetOffset(
int *pbSuccess =
nullptr)
override;
136 double GetScale(
int *pbSuccess =
nullptr)
override;
137 const char *GetUnitType()
override;
140 CPLErr Fill(
double dfRealValue,
double dfImaginaryValue = 0)
override;
142 CPLErr SetCategoryNames(
char **)
override;
143 CPLErr SetNoDataValue(
double)
override;
144 CPLErr DeleteNoDataValue()
override;
147 CPLErr SetOffset(
double)
override;
148 CPLErr SetScale(
double)
override;
149 CPLErr SetUnitType(
const char *)
override;
151 CPLErr GetStatistics(
int bApproxOK,
int bForce,
double *pdfMin,
152 double *pdfMax,
double *pdfMean,
153 double *padfStdDev)
override;
154 CPLErr ComputeStatistics(
int bApproxOK,
double *pdfMin,
double *pdfMax,
155 double *pdfMean,
double *pdfStdDev,
156 GDALProgressFunc,
void *pProgressData)
override;
157 CPLErr SetStatistics(
double dfMin,
double dfMax,
double dfMean,
158 double dfStdDev)
override;
159 CPLErr ComputeRasterMinMax(
int,
double *)
override;
161 int HasArbitraryOverviews()
override;
162 int GetOverviewCount()
override;
170 char **papszOptions)
override;
172 CPLErr GetHistogram(
double dfMin,
double dfMax,
int nBuckets,
173 GUIntBig *panHistogram,
int bIncludeOutOfRange,
174 int bApproxOK, GDALProgressFunc,
175 void *pProgressData)
override;
177 CPLErr GetDefaultHistogram(
double *pdfMin,
double *pdfMax,
int *pnBuckets,
178 GUIntBig **ppanHistogram,
int bForce,
179 GDALProgressFunc,
void *pProgressData)
override;
180 CPLErr SetDefaultHistogram(
double dfMin,
double dfMax,
int nBuckets,
187 int GetMaskFlags()
override;
189 bool IsMaskBand()
const override;
194 char **papszOptions)
override;
204typedef struct _GDALProxyPoolCacheEntry GDALProxyPoolCacheEntry;
205class GDALProxyPoolRasterBand;
207class CPL_DLL GDALProxyPoolDataset :
public GDALProxyDataset
212 mutable char *pszProjectionRef =
nullptr;
215 double adfGeoTransform[6]{0, 1, 0, 0, 0, 1};
216 bool m_bHasSrcSRS =
false;
217 bool bHasSrcGeoTransform =
false;
218 char *pszGCPProjection =
nullptr;
224 mutable GDALProxyPoolCacheEntry *cacheEntry =
nullptr;
225 char *m_pszOwner =
nullptr;
227 GDALDataset *RefUnderlyingDataset(
bool bForceOpen)
const;
229 GDALProxyPoolDataset(
const char *pszSourceDatasetDescription,
230 GDALAccess eAccess,
int bShared,
const char *pszOwner);
233 GDALDataset *RefUnderlyingDataset()
const override;
235 UnrefUnderlyingDataset(
GDALDataset *poUnderlyingDataset)
const override;
237 friend class GDALProxyPoolRasterBand;
240 GDALProxyPoolDataset(
const char *pszSourceDatasetDescription,
241 int nRasterXSize,
int nRasterYSize,
243 const char *pszProjectionRef =
nullptr,
244 double *padfGeoTransform =
nullptr,
245 const char *pszOwner =
nullptr);
247 static GDALProxyPoolDataset *Create(
const char *pszSourceDatasetDescription,
251 const char *pszOwner =
nullptr);
253 ~GDALProxyPoolDataset()
override;
261 void AddSrcBandDescription(
GDALDataType eDataType,
int nBlockXSize,
268 void AddSrcBand(
int nBand,
GDALDataType eDataType,
int nBlockXSize,
281 char **
GetMetadata(
const char *pszDomain)
override;
283 const char *pszDomain)
override;
298class GDALProxyPoolOverviewRasterBand;
299class GDALProxyPoolMaskBand;
301class CPL_DLL GDALProxyPoolRasterBand :
public GDALProxyRasterBand
306 char *pszUnitType =
nullptr;
307 char **papszCategoryNames =
nullptr;
310 int nSizeProxyOverviewRasterBand = 0;
311 GDALProxyPoolOverviewRasterBand **papoProxyOverviewRasterBand =
nullptr;
312 GDALProxyPoolMaskBand *poProxyMaskBand =
nullptr;
318 void UnrefUnderlyingRasterBand(
321 friend class GDALProxyPoolOverviewRasterBand;
322 friend class GDALProxyPoolMaskBand;
325 GDALProxyPoolRasterBand(GDALProxyPoolDataset *poDS,
int nBand,
328 GDALProxyPoolRasterBand(GDALProxyPoolDataset *poDS,
330 ~GDALProxyPoolRasterBand()
override;
332 void AddSrcMaskBandDescription(
GDALDataType eDataType,
int nBlockXSize,
335 void AddSrcMaskBandDescriptionFromUnderlying();
340 char **
GetMetadata(
const char *pszDomain)
override;
342 const char *pszDomain)
override;
343 char **GetCategoryNames()
override;
344 const char *GetUnitType()
override;
348 GetRasterSampleOverview(
GUIntBig nDesiredSamples)
override;
361class GDALProxyPoolOverviewRasterBand :
public GDALProxyPoolRasterBand
364 GDALProxyPoolRasterBand *poMainBand =
nullptr;
365 int nOverviewBand = 0;
368 mutable int nRefCountUnderlyingMainRasterBand = 0;
374 void UnrefUnderlyingRasterBand(
378 GDALProxyPoolOverviewRasterBand(GDALProxyPoolDataset *poDS,
380 GDALProxyPoolRasterBand *poMainBand,
382 ~GDALProxyPoolOverviewRasterBand()
override;
389class GDALProxyPoolMaskBand :
public GDALProxyPoolRasterBand
392 GDALProxyPoolRasterBand *poMainBand =
nullptr;
395 mutable int nRefCountUnderlyingMainRasterBand = 0;
401 void UnrefUnderlyingRasterBand(
405 GDALProxyPoolMaskBand(GDALProxyPoolDataset *poDS,
407 GDALProxyPoolRasterBand *poMainBand);
408 GDALProxyPoolMaskBand(GDALProxyPoolDataset *poDS,
409 GDALProxyPoolRasterBand *poMainBand,
412 ~GDALProxyPoolMaskBand()
override;
414 bool IsMaskBand()
const override
428typedef struct GDALProxyPoolDatasetHS *GDALProxyPoolDatasetH;
430GDALProxyPoolDatasetH CPL_DLL GDALProxyPoolDatasetCreate(
431 const char *pszSourceDatasetDescription,
int nRasterXSize,
int nRasterYSize,
432 GDALAccess eAccess,
int bShared,
const char *pszProjectionRef,
433 double *padfGeoTransform);
436GDALProxyPoolDatasetDelete(GDALProxyPoolDatasetH hProxyPoolDataset);
438void CPL_DLL GDALProxyPoolDatasetAddSrcBandDescription(
439 GDALProxyPoolDatasetH hProxyPoolDataset,
GDALDataType eDataType,
440 int nBlockXSize,
int nBlockYSize);
A color table / palette.
Definition gdal_priv.h:1093
A set of associated raster bands, usually from one file.
Definition gdal_priv.h:348
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:2729
char ** GetMetadataDomainList() override
Fetch list of metadata domains.
Definition gdaldataset.cpp:4236
virtual void * GetInternalHandle(const char *pszHandleName)
Fetch a format specific internally meaningful handle.
Definition gdaldataset.cpp:1203
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition gdaldataset.cpp:3041
virtual void FlushCache(bool bAtClosing=false)
Flush all write cached data to disk.
Definition gdaldataset.cpp:435
virtual int GetGCPCount()
Get number of GCPs.
Definition gdaldataset.cpp:1486
virtual CPLErr GetGeoTransform(double *padfTransform)
Fetch the affine transformation coefficients.
Definition gdaldataset.cpp:1105
virtual const OGRSpatialReference * GetGCPSpatialRef() const
Get output spatial reference system for GCPs.
Definition gdaldataset.cpp:1572
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:1026
virtual GDALDriver * GetDriver(void)
Fetch the driver to which this dataset relates.
Definition gdaldataset.cpp:1241
virtual CPLErr SetGeoTransform(double *padfTransform)
Set the affine transformation coefficients.
Definition gdaldataset.cpp:1159
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition gdaldataset.cpp:1736
virtual const OGRSpatialReference * GetSpatialRef() const
Fetch the spatial reference for this dataset.
Definition gdaldataset.cpp:921
CPLErr BuildOverviews(const char *, int, const int *, int, const int *, GDALProgressFunc, void *, CSLConstList papszOptions)
Build raster overview(s)
Definition gdaldataset.cpp:1839
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
void static void char ** GetMetadata(const char *pszDomain="") override
Fetch metadata.
Definition gdaldataset.cpp:4135
virtual const GDAL_GCP * GetGCPs()
Fetch GCPs.
Definition gdaldataset.cpp:1629
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition gdaldataset.cpp:2920
Format specific driver.
Definition gdal_priv.h:1641
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition gdalmajorobject.cpp:341
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_priv.h:1238
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:167
CPLErr
Error category.
Definition cpl_error.h:53
struct _CPLHashSet CPLHashSet
Opaque type for a hash set.
Definition cpl_hash_set.h:52
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition cpl_port.h:236
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:317
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:313
#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:1049
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1190
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition cpl_port.h:233
struct CPLVirtualMem CPLVirtualMem
Opaque type that represents a virtual memory mapping.
Definition cpl_virtualmem.h:62
Public (C callable) GDAL entry points.
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition gdal.h:314
GDALAccess
Definition gdal.h:124
@ GA_ReadOnly
Definition gdal.h:125
GDALDataType
Definition gdal.h:64
GDALColorInterp
Definition gdal.h:226
GDALRWFlag
Definition gdal.h:131
GDALMaskValueRange
Range of values found in a mask band.
Definition gdal_priv.h:1209
Ground Control Point.
Definition gdal.h:959