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;
239 GDALDataset *RefUnderlyingDataset()
const override;
240 void UnrefUnderlyingDataset(
GDALDataset* poUnderlyingDataset)
const override;
242 friend class GDALProxyPoolRasterBand;
245 GDALProxyPoolDataset(
const char* pszSourceDatasetDescription,
246 int nRasterXSize,
int nRasterYSize,
249 const char * pszProjectionRef =
nullptr,
250 double * padfGeoTransform =
nullptr,
251 const char* pszOwner =
nullptr );
252 ~GDALProxyPoolDataset()
override;
254 void SetOpenOptions(
char** papszOpenOptions );
260 void AddSrcBandDescription(
GDALDataType eDataType,
int nBlockXSize,
266 void AddSrcBand(
int nBand,
GDALDataType eDataType,
int nBlockXSize,
273 const char *_GetProjectionRef()
override;
274 CPLErr _SetProjection(
const char * )
override;
282 char **
GetMetadata(
const char * pszDomain )
override;
284 const char * pszDomain )
override;
288 const char *_GetGCPProjection()
override;
300 class GDALProxyPoolOverviewRasterBand;
301 class GDALProxyPoolMaskBand;
303 class CPL_DLL GDALProxyPoolRasterBand :
public GDALProxyRasterBand
308 char *pszUnitType =
nullptr;
309 char **papszCategoryNames =
nullptr;
312 int nSizeProxyOverviewRasterBand = 0;
313 GDALProxyPoolOverviewRasterBand **papoProxyOverviewRasterBand =
nullptr;
314 GDALProxyPoolMaskBand *poProxyMaskBand =
nullptr;
320 void UnrefUnderlyingRasterBand(
GDALRasterBand* poUnderlyingRasterBand )
323 friend class GDALProxyPoolOverviewRasterBand;
324 friend class GDALProxyPoolMaskBand;
327 GDALProxyPoolRasterBand( GDALProxyPoolDataset* poDS,
int nBand,
329 int nBlockXSize,
int nBlockYSize );
330 GDALProxyPoolRasterBand( GDALProxyPoolDataset* poDS,
332 ~GDALProxyPoolRasterBand()
override;
334 void AddSrcMaskBandDescription(
GDALDataType eDataType,
int nBlockXSize,
340 char **
GetMetadata(
const char * pszDomain )
override;
342 const char * pszDomain )
override;
343 char **GetCategoryNames()
override;
344 const char *GetUnitType()
override;
360 class GDALProxyPoolOverviewRasterBand :
public GDALProxyPoolRasterBand
363 GDALProxyPoolRasterBand *poMainBand =
nullptr;
364 int nOverviewBand = 0;
367 int nRefCountUnderlyingMainRasterBand = 0;
373 void UnrefUnderlyingRasterBand(
GDALRasterBand* poUnderlyingRasterBand )
377 GDALProxyPoolOverviewRasterBand( GDALProxyPoolDataset* poDS,
379 GDALProxyPoolRasterBand* poMainBand,
381 ~GDALProxyPoolOverviewRasterBand()
override;
388 class GDALProxyPoolMaskBand :
public GDALProxyPoolRasterBand
391 GDALProxyPoolRasterBand *poMainBand =
nullptr;
394 int nRefCountUnderlyingMainRasterBand = 0;
400 void UnrefUnderlyingRasterBand(
GDALRasterBand* poUnderlyingRasterBand )
404 GDALProxyPoolMaskBand( GDALProxyPoolDataset* poDS,
406 GDALProxyPoolRasterBand* poMainBand );
407 GDALProxyPoolMaskBand( GDALProxyPoolDataset* poDS,
408 GDALProxyPoolRasterBand* poMainBand,
410 int nBlockXSize,
int nBlockYSize );
411 ~GDALProxyPoolMaskBand()
override;
422 typedef struct GDALProxyPoolDatasetHS *GDALProxyPoolDatasetH;
424 GDALProxyPoolDatasetH CPL_DLL GDALProxyPoolDatasetCreate(
const char* pszSourceDatasetDescription,
425 int nRasterXSize,
int nRasterYSize,
427 const char * pszProjectionRef,
428 double * padfGeoTransform);
430 void CPL_DLL GDALProxyPoolDatasetDelete(GDALProxyPoolDatasetH hProxyPoolDataset);
432 void CPL_DLL GDALProxyPoolDatasetAddSrcBandDescription( GDALProxyPoolDatasetH hProxyPoolDataset,
434 int nBlockXSize,
int nBlockYSize);
A color table / palette.
Definition: gdal_priv.h:1006
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:2782
char ** GetMetadataDomainList() override
Fetch list of metadata domains.
Definition: gdaldataset.cpp:4229
virtual void * GetInternalHandle(const char *pszHandleName)
Fetch a format specific internally meaningful handle.
Definition: gdaldataset.cpp:1258
CPLErr BuildOverviews(const char *, int, int *, int, int *, GDALProgressFunc, void *)
Build raster overview(s)
Definition: gdaldataset.cpp:1929
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:3054
virtual int GetGCPCount()
Get number of GCPs.
Definition: gdaldataset.cpp:1500
virtual CPLErr GetGeoTransform(double *padfTransform)
Fetch the affine transformation coefficients.
Definition: gdaldataset.cpp:1158
virtual const OGRSpatialReference * GetGCPSpatialRef() const
Get output spatial reference system for GCPs.
Definition: gdaldataset.cpp:1595
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:1040
virtual GDALDriver * GetDriver(void)
Fetch the driver to which this dataset relates.
Definition: gdaldataset.cpp:1296
virtual CPLErr SetGeoTransform(double *padfTransform)
Set the affine transformation coefficients.
Definition: gdaldataset.cpp:1213
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition: gdaldataset.cpp:1783
virtual const OGRSpatialReference * GetSpatialRef() const
Fetch the spatial reference for this dataset.
Definition: gdaldataset.cpp:909
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
virtual void FlushCache(void)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:418
void static void char ** GetMetadata(const char *pszDomain="") override
Fetch metadata.
Definition: gdaldataset.cpp:4128
virtual const GDAL_GCP * GetGCPs()
Fetch GCPs.
Definition: gdaldataset.cpp:1678
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition: gdaldataset.cpp:2943
Format specific driver.
Definition: gdal_priv.h:1468
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:1112
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:251
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:339
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:337
#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:1007
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:248
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:276
GDALAccess
Definition: gdal.h:113
@ GA_ReadOnly
Definition: gdal.h:114
GDALDataType
Definition: gdal.h:60
GDALColorInterp
Definition: gdal.h:194
GDALRWFlag
Definition: gdal.h:119
Ground Control Point.
Definition: gdal.h:669