16#ifndef GDAL_ALG_PRIV_H_INCLUDED
17#define GDAL_ALG_PRIV_H_INCLUDED
32{ GBV_UserBurnValue = 0, GBV_Z = 1, GBV_M = 2
46 unsigned char *pabyChunkBuf;
58 const std::int64_t *int64_values;
59 const double *double_values;
62 GDALBurnValueSrc eBurnValueSource;
63 GDALRasterMergeAlg eMergeAlg;
64 bool bFillSetVisitedPoints;
65 std::set<uint64_t> *poSetVisitedPoints;
79typedef void (*llScanlineFunc)(
void *, int, int, int, double);
80typedef void (*llPointFunc)(
void *, int, int, double);
82void GDALdllImagePoint(
int nRasterXSize,
int nRasterYSize,
int nPartCount,
83 const int *panPartSize,
const double *padfX,
84 const double *padfY,
const double *padfVariant,
85 llPointFunc pfnPointFunc,
void *pCBData);
87void GDALdllImageLine(
int nRasterXSize,
int nRasterYSize,
int nPartCount,
88 const int *panPartSize,
const double *padfX,
89 const double *padfY,
const double *padfVariant,
90 llPointFunc pfnPointFunc,
void *pCBData);
92void GDALdllImageLineAllTouched(
int nRasterXSize,
int nRasterYSize,
93 int nPartCount,
const int *panPartSize,
94 const double *padfX,
const double *padfY,
95 const double *padfVariant,
96 llPointFunc pfnPointFunc,
void *pCBData,
97 bool bAvoidBurningSamePoints,
100void GDALdllImageFilledPolygon(
int nRasterXSize,
int nRasterYSize,
101 int nPartCount,
const int *panPartSize,
102 const double *padfX,
const double *padfY,
103 const double *padfVariant,
104 llScanlineFunc pfnScanlineFunc,
void *pCBData,
105 bool bAvoidBurningSamePoints);
113#define GP_NODATA_MARKER -51502112
115template <
class DataType,
class EqualityTest>
class GDALRasterPolygonEnumeratorT
119 void MergePolygon(
int nSrcId,
int nDstId);
120 int NewPolygon(DataType nValue);
125 GInt32 *panPolyIdMap =
nullptr;
126 DataType *panPolyValue =
nullptr;
128 int nNextPolygonId = 0;
131 int nConnectedness = 0;
134 explicit GDALRasterPolygonEnumeratorT(
int nConnectedness = 4);
135 ~GDALRasterPolygonEnumeratorT();
137 bool ProcessLine(DataType *panLastLineVal, DataType *panThisLineVal,
138 GInt32 *panLastLineId,
GInt32 *panThisLineId,
int nXSize);
140 void CompleteMerges();
145struct IntEqualityTest
147 bool operator()(std::int64_t a, std::int64_t b)
const
153typedef GDALRasterPolygonEnumeratorT<std::int64_t, IntEqualityTest>
154 GDALRasterPolygonEnumerator;
156constexpr const char *GDAL_APPROX_TRANSFORMER_CLASS_NAME =
157 "GDALApproxTransformer";
158constexpr const char *GDAL_GEN_IMG_TRANSFORMER_CLASS_NAME =
159 "GDALGenImgProjTransformer";
160constexpr const char *GDAL_RPC_TRANSFORMER_CLASS_NAME =
"GDALRPCTransformer";
162bool GDALIsTransformer(
void *hTransformerArg,
const char *pszClassName);
164typedef void *(*GDALTransformDeserializeFunc)(
CPLXMLNode *psTree);
166void CPL_DLL *GDALRegisterTransformDeserializer(
168 GDALTransformDeserializeFunc pfnDeserializeFunc);
169void CPL_DLL GDALUnregisterTransformDeserializer(
void *pData);
171void GDALCleanupTransformDeserializerMutex();
175void *GDALCreateTPSTransformerInt(
int nGCPCount,
const GDAL_GCP *pasGCPList,
176 int bReversed,
char **papszOptions);
178void CPL_DLL *GDALCloneTransformer(
void *pTransformerArg);
180void GDALRefreshGenImgProjTransformer(
void *hTransformArg);
181void GDALRefreshApproxTransformer(
void *hTransformArg);
183int GDALTransformLonLatToDestGenImgProjTransformer(
void *hTransformArg,
184 double *pdfX,
double *pdfY);
185int GDALTransformLonLatToDestApproxTransformer(
void *hTransformArg,
186 double *pdfX,
double *pdfY);
188bool GDALTransformIsTranslationOnPixelBoundaries(
192 void *pTransformerArg);
194bool GDALTransformHasFastClone(
void *pTransformerArg);
200 GDALTransformerInfo sTI;
203 double dfOversampleFactor;
209 double adfBackMapGeoTransform[6];
237 double dfPIXEL_OFFSET;
239 double dfLINE_OFFSET;
242 bool bOriginIsTopLeftCorner;
243 bool bGeographicSRSWithMinus180Plus180LongRange;
246 char **papszGeolocationInfo;
248} GDALGeoLocTransformInfo;
256struct GDALReprojectionTransformInfo
258 GDALTransformerInfo sTI;
259 char **papszOptions =
nullptr;
265 GDALReprojectionTransformInfo() : sTI()
267 memset(&sTI, 0,
sizeof(sTI));
270 GDALReprojectionTransformInfo(
const GDALReprojectionTransformInfo &) =
272 GDALReprojectionTransformInfo &
273 operator=(
const GDALReprojectionTransformInfo &) =
delete;
285 GDALTransformerInfo sTI;
287 double adfSrcGeoTransform[6];
288 double adfSrcInvGeoTransform[6];
290 void *pSrcTransformArg;
296 double adfDstGeoTransform[6];
297 double adfDstInvGeoTransform[6];
299 void *pDstTransformArg;
305 bool bCheckWithInvertPROJ;
308 bool bHasCustomTransformationPipeline;
310} GDALGenImgProjTransformInfo;
318int GDALComputeMedianCutPCTInternal(
321 int (*pfnIncludePixel)(
int,
int,
void *),
int nColors,
int nBits,
322 T *panHistogram,
GDALColorTableH hColorTable, GDALProgressFunc pfnProgress,
328 GInt16 *pasDynamicColorMap,
int bDither,
329 GDALProgressFunc pfnProgress,
void *pProgressArg);
331#define PRIME_FOR_65536 98317
336#define MEDIAN_CUT_AND_DITHER_BUFFER_SIZE_65536 \
337 (6 * sizeof(int) * PRIME_FOR_65536)
351GBool GDALFloatEquals(
float A,
float B);
353struct FloatEqualityTest
355 bool operator()(
float a,
float b)
357 return GDALFloatEquals(a, b) == TRUE;
362 int nXSize,
int nYSize,
363 double &dfWestLongitudeDeg,
364 double &dfSouthLatitudeDeg,
365 double &dfEastLongitudeDeg,
366 double &dfNorthLatitudeDeg);
369 double dfY1,
double dfX2,
double dfY2,
370 double &dfWestLongitudeDeg,
371 double &dfSouthLatitudeDeg,
372 double &dfEastLongitudeDeg,
373 double &dfNorthLatitudeDeg);
376 const char *pszGeolocationDataset,
379void *GDALCreateGeoLocTransformerEx(
GDALDatasetH hBaseDS,
381 int bReversed,
const char *pszSourceDataset,
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:436
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:153
short GInt16
Int16 type.
Definition: cpl_port.h:165
#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
int GBool
Type for boolean values (alias to int)
Definition: cpl_port.h:180
#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
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:169
int GInt32
Int32 type.
Definition: cpl_port.h:159
struct _CPLQuadTree CPLQuadTree
Opaque type for a quad tree.
Definition: cpl_quad_tree.h:49
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition: gdal.h:400
GDALDataType
Definition: gdal.h:48
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition: gdal.h:376
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition: gdal.h:379
void * GDALColorTableH
Opaque type used for the C bindings of the C++ GDALColorTable class.
Definition: gdal.h:385
Public (C callable) GDAL algorithm entry points, and definitions.
int(* GDALTransformerFunc)(void *pTransformerArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Definition: gdal_alg.h:79
Coordinate systems services.
Document node structure.
Definition: cpl_minixml.h:55
Ground Control Point.
Definition: gdal.h:1168