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;
99 int nBandCount,
const int *panBandList)
override;
101 int nYOff,
int nXSize,
int nYSize,
102 int nBandCount,
const int *panBandList,
103 void **ppBuffer,
size_t *pnBufferSize,
104 char **ppszDetailedFormat)
override;
117 GDALProxyRasterBand()
122 RefUnderlyingRasterBand(
bool bForceOpen =
true)
const = 0;
124 UnrefUnderlyingRasterBand(
GDALRasterBand *poUnderlyingRasterBand)
const;
126 CPLErr IReadBlock(
int,
int,
void *)
override;
127 CPLErr IWriteBlock(
int,
int,
void *)
override;
134 char **
GetMetadata(
const char *pszDomain)
override;
137 const char *pszDomain)
override;
139 const char *pszDomain)
override;
141 char **GetCategoryNames()
override;
142 double GetNoDataValue(
int *pbSuccess =
nullptr)
override;
143 double GetMinimum(
int *pbSuccess =
nullptr)
override;
144 double GetMaximum(
int *pbSuccess =
nullptr)
override;
145 double GetOffset(
int *pbSuccess =
nullptr)
override;
146 double GetScale(
int *pbSuccess =
nullptr)
override;
147 const char *GetUnitType()
override;
150 CPLErr Fill(
double dfRealValue,
double dfImaginaryValue = 0)
override;
152 CPLErr SetCategoryNames(
char **)
override;
153 CPLErr SetNoDataValue(
double)
override;
154 CPLErr DeleteNoDataValue()
override;
157 CPLErr SetOffset(
double)
override;
158 CPLErr SetScale(
double)
override;
159 CPLErr SetUnitType(
const char *)
override;
161 CPLErr GetStatistics(
int bApproxOK,
int bForce,
double *pdfMin,
162 double *pdfMax,
double *pdfMean,
163 double *padfStdDev)
override;
164 CPLErr ComputeStatistics(
int bApproxOK,
double *pdfMin,
double *pdfMax,
165 double *pdfMean,
double *pdfStdDev,
166 GDALProgressFunc,
void *pProgressData)
override;
167 CPLErr SetStatistics(
double dfMin,
double dfMax,
double dfMean,
168 double dfStdDev)
override;
169 CPLErr ComputeRasterMinMax(
int,
double *)
override;
171 int HasArbitraryOverviews()
override;
172 int GetOverviewCount()
override;
180 char **papszOptions)
override;
182 CPLErr GetHistogram(
double dfMin,
double dfMax,
int nBuckets,
183 GUIntBig *panHistogram,
int bIncludeOutOfRange,
184 int bApproxOK, GDALProgressFunc,
185 void *pProgressData)
override;
187 CPLErr GetDefaultHistogram(
double *pdfMin,
double *pdfMax,
int *pnBuckets,
188 GUIntBig **ppanHistogram,
int bForce,
189 GDALProgressFunc,
void *pProgressData)
override;
190 CPLErr SetDefaultHistogram(
double dfMin,
double dfMax,
int nBuckets,
197 int GetMaskFlags()
override;
199 bool IsMaskBand()
const override;
204 char **papszOptions)
override;
214 typedef struct _GDALProxyPoolCacheEntry GDALProxyPoolCacheEntry;
215 class GDALProxyPoolRasterBand;
217 class CPL_DLL GDALProxyPoolDataset :
public GDALProxyDataset
222 mutable char *pszProjectionRef =
nullptr;
225 double adfGeoTransform[6]{0, 1, 0, 0, 0, 1};
226 bool m_bHasSrcSRS =
false;
227 bool bHasSrcGeoTransform =
false;
228 char *pszGCPProjection =
nullptr;
234 mutable GDALProxyPoolCacheEntry *cacheEntry =
nullptr;
235 char *m_pszOwner =
nullptr;
237 GDALDataset *RefUnderlyingDataset(
bool bForceOpen)
const;
239 GDALProxyPoolDataset(
const char *pszSourceDatasetDescription,
240 GDALAccess eAccess,
int bShared,
const char *pszOwner);
243 GDALDataset *RefUnderlyingDataset()
const override;
245 UnrefUnderlyingDataset(
GDALDataset *poUnderlyingDataset)
const override;
247 friend class GDALProxyPoolRasterBand;
250 GDALProxyPoolDataset(
const char *pszSourceDatasetDescription,
251 int nRasterXSize,
int nRasterYSize,
253 const char *pszProjectionRef =
nullptr,
254 double *padfGeoTransform =
nullptr,
255 const char *pszOwner =
nullptr);
257 static GDALProxyPoolDataset *Create(
const char *pszSourceDatasetDescription,
261 const char *pszOwner =
nullptr);
263 ~GDALProxyPoolDataset()
override;
271 void AddSrcBandDescription(
GDALDataType eDataType,
int nBlockXSize,
278 void AddSrcBand(
int nBand,
GDALDataType eDataType,
int nBlockXSize,
291 char **
GetMetadata(
const char *pszDomain)
override;
293 const char *pszDomain)
override;
308 class GDALProxyPoolOverviewRasterBand;
309 class GDALProxyPoolMaskBand;
311 class CPL_DLL GDALProxyPoolRasterBand :
public GDALProxyRasterBand
316 char *pszUnitType =
nullptr;
317 char **papszCategoryNames =
nullptr;
320 int nSizeProxyOverviewRasterBand = 0;
321 GDALProxyPoolOverviewRasterBand **papoProxyOverviewRasterBand =
nullptr;
322 GDALProxyPoolMaskBand *poProxyMaskBand =
nullptr;
326 RefUnderlyingRasterBand(
bool bForceOpen =
true)
const override;
327 void UnrefUnderlyingRasterBand(
330 friend class GDALProxyPoolOverviewRasterBand;
331 friend class GDALProxyPoolMaskBand;
334 GDALProxyPoolRasterBand(GDALProxyPoolDataset *poDS,
int nBand,
337 GDALProxyPoolRasterBand(GDALProxyPoolDataset *poDS,
339 ~GDALProxyPoolRasterBand()
override;
341 void AddSrcMaskBandDescription(
GDALDataType eDataType,
int nBlockXSize,
344 void AddSrcMaskBandDescriptionFromUnderlying();
349 char **
GetMetadata(
const char *pszDomain)
override;
351 const char *pszDomain)
override;
352 char **GetCategoryNames()
override;
353 const char *GetUnitType()
override;
357 GetRasterSampleOverview(
GUIntBig nDesiredSamples)
override;
370 class GDALProxyPoolOverviewRasterBand :
public GDALProxyPoolRasterBand
373 GDALProxyPoolRasterBand *poMainBand =
nullptr;
374 int nOverviewBand = 0;
377 mutable int nRefCountUnderlyingMainRasterBand = 0;
383 RefUnderlyingRasterBand(
bool bForceOpen =
true)
const override;
384 void UnrefUnderlyingRasterBand(
388 GDALProxyPoolOverviewRasterBand(GDALProxyPoolDataset *poDS,
390 GDALProxyPoolRasterBand *poMainBand,
392 ~GDALProxyPoolOverviewRasterBand()
override;
399 class GDALProxyPoolMaskBand :
public GDALProxyPoolRasterBand
402 GDALProxyPoolRasterBand *poMainBand =
nullptr;
405 mutable int nRefCountUnderlyingMainRasterBand = 0;
411 RefUnderlyingRasterBand(
bool bForceOpen =
true)
const override;
412 void UnrefUnderlyingRasterBand(
416 GDALProxyPoolMaskBand(GDALProxyPoolDataset *poDS,
418 GDALProxyPoolRasterBand *poMainBand);
419 GDALProxyPoolMaskBand(GDALProxyPoolDataset *poDS,
420 GDALProxyPoolRasterBand *poMainBand,
423 ~GDALProxyPoolMaskBand()
override;
425 bool IsMaskBand()
const override
439 typedef struct GDALProxyPoolDatasetHS *GDALProxyPoolDatasetH;
441 GDALProxyPoolDatasetH CPL_DLL GDALProxyPoolDatasetCreate(
442 const char *pszSourceDatasetDescription,
int nRasterXSize,
int nRasterYSize,
443 GDALAccess eAccess,
int bShared,
const char *pszProjectionRef,
444 double *padfGeoTransform);
447 GDALProxyPoolDatasetDelete(GDALProxyPoolDatasetH hProxyPoolDataset);
449 void CPL_DLL GDALProxyPoolDatasetAddSrcBandDescription(
450 GDALProxyPoolDatasetH hProxyPoolDataset,
GDALDataType eDataType,
451 int nBlockXSize,
int nBlockYSize);
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:449
A color table / palette.
Definition: gdal_priv.h:1348
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:503
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:3032
char ** GetMetadataDomainList() override
Fetch list of metadata domains.
Definition: gdaldataset.cpp:4697
virtual void * GetInternalHandle(const char *pszHandleName)
Fetch a format specific internally meaningful handle.
Definition: gdaldataset.cpp:1477
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:2125
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:3343
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:9800
virtual int GetGCPCount()
Get number of GCPs.
Definition: gdaldataset.cpp:1773
virtual CPLErr GetGeoTransform(double *padfTransform)
Fetch the affine transformation coefficients.
Definition: gdaldataset.cpp:1379
virtual const OGRSpatialReference * GetGCPSpatialRef() const
Get output spatial reference system for GCPs.
Definition: gdaldataset.cpp:1858
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:1300
virtual GDALDriver * GetDriver(void)
Fetch the driver to which this dataset relates.
Definition: gdaldataset.cpp:1515
virtual CPLErr FlushCache(bool bAtClosing=false)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:561
virtual CPLErr SetGeoTransform(double *padfTransform)
Set the affine transformation coefficients.
Definition: gdaldataset.cpp:1433
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition: gdaldataset.cpp:2022
virtual const OGRSpatialReference * GetSpatialRef() const
Fetch the spatial reference for this dataset.
Definition: gdaldataset.cpp:1195
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:4593
virtual const GDAL_GCP * GetGCPs()
Fetch GCPs.
Definition: gdaldataset.cpp:1915
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition: gdaldataset.cpp:3225
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:10030
Format specific driver.
Definition: gdal_priv.h:2001
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:1504
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:169
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:218
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:299
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:295
#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:1042
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1183
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:215
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:315
GDALAccess
Definition: gdal.h:125
@ GA_ReadOnly
Definition: gdal.h:126
GDALDataType
Definition: gdal.h:64
GDALColorInterp
Definition: gdal.h:227
GDALRWFlag
Definition: gdal.h:132
GDALMaskValueRange
Range of values found in a mask band.
Definition: gdal_priv.h:1475
Ground Control Point.
Definition: gdal.h:1075