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);
121 CPLErr IReadBlock(
int,
int,
void * )
override;
122 CPLErr IWriteBlock(
int,
int,
void * )
override;
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;
138 char **GetCategoryNames()
override;
139 double GetNoDataValue(
int *pbSuccess =
nullptr )
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;
144 const char *GetUnitType()
override;
147 CPLErr Fill(
double dfRealValue,
double dfImaginaryValue = 0)
override;
149 CPLErr SetCategoryNames(
char ** )
override;
150 CPLErr SetNoDataValue(
double )
override;
151 CPLErr DeleteNoDataValue()
override;
154 CPLErr SetOffset(
double )
override;
155 CPLErr SetScale(
double )
override;
156 CPLErr SetUnitType(
const char * )
override;
158 CPLErr GetStatistics(
int bApproxOK,
int bForce,
159 double *pdfMin,
double *pdfMax,
160 double *pdfMean,
double *padfStdDev )
override;
161 CPLErr ComputeStatistics(
int bApproxOK,
162 double *pdfMin,
double *pdfMax,
163 double *pdfMean,
double *pdfStdDev,
164 GDALProgressFunc,
void *pProgressData )
override;
165 CPLErr SetStatistics(
double dfMin,
double dfMax,
166 double dfMean,
double dfStdDev )
override;
167 CPLErr ComputeRasterMinMax(
int,
double* )
override;
169 int HasArbitraryOverviews()
override;
170 int GetOverviewCount()
override;
174 GDALProgressFunc,
void * )
override;
177 int nBufXSize,
int nBufYSize,
180 CPLErr GetHistogram(
double dfMin,
double dfMax,
181 int nBuckets,
GUIntBig * panHistogram,
182 int bIncludeOutOfRange,
int bApproxOK,
183 GDALProgressFunc,
void *pProgressData )
override;
185 CPLErr GetDefaultHistogram(
double *pdfMin,
double *pdfMax,
186 int *pnBuckets,
GUIntBig ** ppanHistogram,
188 GDALProgressFunc,
void *pProgressData)
override;
189 CPLErr SetDefaultHistogram(
double dfMin,
double dfMax,
190 int nBuckets,
GUIntBig *panHistogram )
override;
196 int GetMaskFlags()
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,
286 const char *_GetProjectionRef()
override;
287 CPLErr _SetProjection(
const char * )
override;
295 char **
GetMetadata(
const char * pszDomain )
override;
297 const char * pszDomain )
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;
357 const char * pszDomain )
override;
358 char **GetCategoryNames()
override;
359 const char *GetUnitType()
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);
A color table / palette.
Definition: gdal_priv.h:1023
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:340
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:2811
char ** GetMetadataDomainList() override
Fetch list of metadata domains.
Definition: gdaldataset.cpp:4300
virtual void * GetInternalHandle(const char *pszHandleName)
Fetch a format specific internally meaningful handle.
Definition: gdaldataset.cpp:1277
CPLErr BuildOverviews(const char *, int, int *, int, int *, GDALProgressFunc, void *)
Build raster overview(s)
Definition: gdaldataset.cpp:1950
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:3117
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:1519
virtual CPLErr GetGeoTransform(double *padfTransform)
Fetch the affine transformation coefficients.
Definition: gdaldataset.cpp:1177
virtual const OGRSpatialReference * GetGCPSpatialRef() const
Get output spatial reference system for GCPs.
Definition: gdaldataset.cpp:1616
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:1059
virtual GDALDriver * GetDriver(void)
Fetch the driver to which this dataset relates.
Definition: gdaldataset.cpp:1315
virtual CPLErr SetGeoTransform(double *padfTransform)
Set the affine transformation coefficients.
Definition: gdaldataset.cpp:1232
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition: gdaldataset.cpp:1804
virtual const OGRSpatialReference * GetSpatialRef() const
Fetch the spatial reference for this dataset.
Definition: gdaldataset.cpp:928
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:4199
virtual const GDAL_GCP * GetGCPs()
Fetch GCPs.
Definition: gdaldataset.cpp:1699
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition: gdaldataset.cpp:2996
Format specific driver.
Definition: gdal_priv.h:1486
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition: gdalmajorobject.cpp:344
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:1131
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:158
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:247
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:331
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:329
#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
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1169
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:244
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:286
GDALAccess
Definition: gdal.h:115
@ GA_ReadOnly
Definition: gdal.h:116
GDALDataType
Definition: gdal.h:62
GDALColorInterp
Definition: gdal.h:204
GDALRWFlag
Definition: gdal.h:121
Ground Control Point.
Definition: gdal.h:711