14#ifndef GDAL_PROXY_H_INCLUDED
15#define GDAL_PROXY_H_INCLUDED
37 virtual GDALDataset *RefUnderlyingDataset()
const = 0;
38 virtual void UnrefUnderlyingDataset(
GDALDataset *poUnderlyingDataset)
const;
40 CPLErr IBuildOverviews(
const char *,
int,
const int *,
int,
const int *,
41 GDALProgressFunc,
void *,
47 int nXSize,
int nYSize,
void *pData,
48 int nBufXSize,
int nBufYSize,
50 const int *panBandMap,
GSpacing nPixelSpace,
59 const char *pszDomain)
override;
61 const char *pszDomain)
override;
83 int nBandCount,
int *panBandList,
84 char **papszOptions)
override;
90 int nBandCount,
const int *panBandList)
override;
92 int nYOff,
int nXSize,
int nYSize,
93 int nBandCount,
const int *panBandList,
94 void **ppBuffer,
size_t *pnBufferSize,
95 char **ppszDetailedFormat)
override;
108 GDALProxyRasterBand()
113 RefUnderlyingRasterBand(
bool bForceOpen =
true)
const = 0;
115 UnrefUnderlyingRasterBand(
GDALRasterBand *poUnderlyingRasterBand)
const;
117 CPLErr IReadBlock(
int,
int,
void *)
override;
118 CPLErr IWriteBlock(
int,
int,
void *)
override;
123 int IGetDataCoverageStatus(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
124 int nMaskFlagStop,
double *pdfDataPct)
override;
128 char **
GetMetadata(
const char *pszDomain)
override;
131 const char *pszDomain)
override;
133 const char *pszDomain)
override;
136 int bJustInitialize)
override;
139 int nYBlockYOff)
override;
141 CPLErr FlushBlock(
int nXBlockOff,
int nYBlockOff,
142 int bWriteDirtyBlock)
override;
145 char **GetCategoryNames()
override;
146 double GetNoDataValue(
int *pbSuccess =
nullptr)
override;
147 double GetMinimum(
int *pbSuccess =
nullptr)
override;
148 double GetMaximum(
int *pbSuccess =
nullptr)
override;
149 double GetOffset(
int *pbSuccess =
nullptr)
override;
150 double GetScale(
int *pbSuccess =
nullptr)
override;
151 const char *GetUnitType()
override;
154 CPLErr Fill(
double dfRealValue,
double dfImaginaryValue = 0)
override;
156 CPLErr SetCategoryNames(
char **)
override;
157 CPLErr SetNoDataValue(
double)
override;
158 CPLErr DeleteNoDataValue()
override;
161 CPLErr SetOffset(
double)
override;
162 CPLErr SetScale(
double)
override;
163 CPLErr SetUnitType(
const char *)
override;
165 CPLErr GetStatistics(
int bApproxOK,
int bForce,
double *pdfMin,
166 double *pdfMax,
double *pdfMean,
167 double *padfStdDev)
override;
168 CPLErr ComputeStatistics(
int bApproxOK,
double *pdfMin,
double *pdfMax,
169 double *pdfMean,
double *pdfStdDev,
170 GDALProgressFunc,
void *pProgressData)
override;
171 CPLErr SetStatistics(
double dfMin,
double dfMax,
double dfMean,
172 double dfStdDev)
override;
173 CPLErr ComputeRasterMinMax(
int,
double *)
override;
175 int HasArbitraryOverviews()
override;
176 int GetOverviewCount()
override;
184 char **papszOptions)
override;
186 CPLErr GetHistogram(
double dfMin,
double dfMax,
int nBuckets,
187 GUIntBig *panHistogram,
int bIncludeOutOfRange,
188 int bApproxOK, GDALProgressFunc,
189 void *pProgressData)
override;
191 CPLErr GetDefaultHistogram(
double *pdfMin,
double *pdfMax,
int *pnBuckets,
192 GUIntBig **ppanHistogram,
int bForce,
193 GDALProgressFunc,
void *pProgressData)
override;
194 CPLErr SetDefaultHistogram(
double dfMin,
double dfMax,
int nBuckets,
201 int GetMaskFlags()
override;
203 bool IsMaskBand()
const override;
208 char **papszOptions)
override;
210 CPLErr InterpolateAtPoint(
double dfPixel,
double dfLine,
212 double *pdfRealValue,
213 double *pdfImagValue)
const override;
215 void EnablePixelTypeSignedByteWarning(
bool b)
override;
225typedef struct _GDALProxyPoolCacheEntry GDALProxyPoolCacheEntry;
226class GDALProxyPoolRasterBand;
228class CPL_DLL GDALProxyPoolDataset :
public GDALProxyDataset
233 mutable char *pszProjectionRef =
nullptr;
236 double adfGeoTransform[6]{0, 1, 0, 0, 0, 1};
237 bool m_bHasSrcSRS =
false;
238 bool bHasSrcGeoTransform =
false;
239 char *pszGCPProjection =
nullptr;
245 mutable GDALProxyPoolCacheEntry *cacheEntry =
nullptr;
246 char *m_pszOwner =
nullptr;
248 GDALDataset *RefUnderlyingDataset(
bool bForceOpen)
const;
250 GDALProxyPoolDataset(
const char *pszSourceDatasetDescription,
251 GDALAccess eAccess,
int bShared,
const char *pszOwner);
254 GDALDataset *RefUnderlyingDataset()
const override;
256 UnrefUnderlyingDataset(
GDALDataset *poUnderlyingDataset)
const override;
258 friend class GDALProxyPoolRasterBand;
261 GDALProxyPoolDataset(
const char *pszSourceDatasetDescription,
262 int nRasterXSize,
int nRasterYSize,
264 const char *pszProjectionRef =
nullptr,
265 double *padfGeoTransform =
nullptr,
266 const char *pszOwner =
nullptr);
268 static GDALProxyPoolDataset *Create(
const char *pszSourceDatasetDescription,
272 const char *pszOwner =
nullptr);
274 ~GDALProxyPoolDataset()
override;
282 void AddSrcBandDescription(
GDALDataType eDataType,
int nBlockXSize,
289 void AddSrcBand(
int nBand,
GDALDataType eDataType,
int nBlockXSize,
302 char **
GetMetadata(
const char *pszDomain)
override;
304 const char *pszDomain)
override;
319class GDALProxyPoolOverviewRasterBand;
320class GDALProxyPoolMaskBand;
322class CPL_DLL GDALProxyPoolRasterBand :
public GDALProxyRasterBand
327 char *pszUnitType =
nullptr;
328 char **papszCategoryNames =
nullptr;
331 int nSizeProxyOverviewRasterBand = 0;
332 GDALProxyPoolOverviewRasterBand **papoProxyOverviewRasterBand =
nullptr;
333 GDALProxyPoolMaskBand *poProxyMaskBand =
nullptr;
337 RefUnderlyingRasterBand(
bool bForceOpen =
true)
const override;
338 void UnrefUnderlyingRasterBand(
341 friend class GDALProxyPoolOverviewRasterBand;
342 friend class GDALProxyPoolMaskBand;
345 GDALProxyPoolRasterBand(GDALProxyPoolDataset *poDS,
int nBand,
348 GDALProxyPoolRasterBand(GDALProxyPoolDataset *poDS,
350 ~GDALProxyPoolRasterBand()
override;
352 void AddSrcMaskBandDescription(
GDALDataType eDataType,
int nBlockXSize,
355 void AddSrcMaskBandDescriptionFromUnderlying();
360 char **
GetMetadata(
const char *pszDomain)
override;
362 const char *pszDomain)
override;
363 char **GetCategoryNames()
override;
364 const char *GetUnitType()
override;
368 GetRasterSampleOverview(
GUIntBig nDesiredSamples)
override;
381class GDALProxyPoolOverviewRasterBand :
public GDALProxyPoolRasterBand
384 GDALProxyPoolRasterBand *poMainBand =
nullptr;
385 int nOverviewBand = 0;
388 mutable int nRefCountUnderlyingMainRasterBand = 0;
394 RefUnderlyingRasterBand(
bool bForceOpen =
true)
const override;
395 void UnrefUnderlyingRasterBand(
399 GDALProxyPoolOverviewRasterBand(GDALProxyPoolDataset *poDS,
401 GDALProxyPoolRasterBand *poMainBand,
403 ~GDALProxyPoolOverviewRasterBand()
override;
410class GDALProxyPoolMaskBand :
public GDALProxyPoolRasterBand
413 GDALProxyPoolRasterBand *poMainBand =
nullptr;
416 mutable int nRefCountUnderlyingMainRasterBand = 0;
422 RefUnderlyingRasterBand(
bool bForceOpen =
true)
const override;
423 void UnrefUnderlyingRasterBand(
427 GDALProxyPoolMaskBand(GDALProxyPoolDataset *poDS,
429 GDALProxyPoolRasterBand *poMainBand);
430 GDALProxyPoolMaskBand(GDALProxyPoolDataset *poDS,
431 GDALProxyPoolRasterBand *poMainBand,
434 ~GDALProxyPoolMaskBand()
override;
436 bool IsMaskBand()
const override
450typedef struct GDALProxyPoolDatasetHS *GDALProxyPoolDatasetH;
452GDALProxyPoolDatasetH CPL_DLL GDALProxyPoolDatasetCreate(
453 const char *pszSourceDatasetDescription,
int nRasterXSize,
int nRasterYSize,
454 GDALAccess eAccess,
int bShared,
const char *pszProjectionRef,
455 double *padfGeoTransform);
458GDALProxyPoolDatasetDelete(GDALProxyPoolDatasetH hProxyPoolDataset);
460void CPL_DLL GDALProxyPoolDatasetAddSrcBandDescription(
461 GDALProxyPoolDatasetH hProxyPoolDataset,
GDALDataType eDataType,
462 int nBlockXSize,
int nBlockYSize);
464int CPL_DLL GDALGetMaxDatasetPoolSize(
void);
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:436
A color table / palette.
Definition: gdal_priv.h:1362
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:495
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:3038
char ** GetMetadataDomainList() override
Fetch list of metadata domains.
Definition: gdaldataset.cpp:4774
virtual void * GetInternalHandle(const char *pszHandleName)
Fetch a format specific internally meaningful handle.
Definition: gdaldataset.cpp:1478
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:2131
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:3349
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:9878
virtual int GetGCPCount()
Get number of GCPs.
Definition: gdaldataset.cpp:1774
virtual CPLErr GetGeoTransform(double *padfTransform)
Fetch the affine transformation coefficients.
Definition: gdaldataset.cpp:1380
virtual const OGRSpatialReference * GetGCPSpatialRef() const
Get output spatial reference system for GCPs.
Definition: gdaldataset.cpp:1864
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:1301
virtual GDALDriver * GetDriver(void)
Fetch the driver to which this dataset relates.
Definition: gdaldataset.cpp:1516
virtual CPLErr FlushCache(bool bAtClosing=false)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:550
virtual CPLErr SetGeoTransform(double *padfTransform)
Set the affine transformation coefficients.
Definition: gdaldataset.cpp:1434
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition: gdaldataset.cpp:2028
virtual const OGRSpatialReference * GetSpatialRef() const
Fetch the spatial reference for this dataset.
Definition: gdaldataset.cpp:1196
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:4668
virtual const GDAL_GCP * GetGCPs()
Fetch GCPs.
Definition: gdaldataset.cpp:1921
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition: gdaldataset.cpp:3231
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:10108
Format specific driver.
Definition: gdal_priv.h:2124
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition: gdalmajorobject.cpp:325
The GDALRasterAttributeTable (or RAT) class is used to encapsulate a table used to provide attribute ...
Definition: gdal_rat.h:32
A single raster band (or channel).
Definition: gdal_priv.h:1519
A single raster block in the block cache.
Definition: gdal_priv.h:1204
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:153
CPLErr
Error category.
Definition: cpl_error.h:37
struct _CPLHashSet CPLHashSet
Opaque type for a hash set.
Definition: cpl_hash_set.h:36
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:202
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:283
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:279
#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:1030
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1179
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:199
struct CPLVirtualMem CPLVirtualMem
Opaque type that represents a virtual memory mapping.
Definition: cpl_virtualmem.h:46
Public (C callable) GDAL entry points.
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition: gdal.h:400
GDALAccess
Definition: gdal.h:110
@ GA_ReadOnly
Definition: gdal.h:111
GDALDataType
Definition: gdal.h:48
GDALRIOResampleAlg
RasterIO() resampling method.
Definition: gdal.h:128
GDALColorInterp
Types of color interpretation for raster bands.
Definition: gdal.h:257
GDALRWFlag
Definition: gdal.h:117
GDALMaskValueRange
Range of values found in a mask band.
Definition: gdal_priv.h:1490
Ground Control Point.
Definition: gdal.h:1168