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)(GDALRasterizeInfo *, int, int, int, double);
80typedef void (*llPointFunc)(GDALRasterizeInfo *, 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, GDALRasterizeInfo *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, GDALRasterizeInfo *pCBData);
92void GDALdllImageLineAllTouched(
93 int nRasterXSize,
int nRasterYSize,
int nPartCount,
const int *panPartSize,
94 const double *padfX,
const double *padfY,
const double *padfVariant,
95 llPointFunc pfnPointFunc, GDALRasterizeInfo *pCBData,
96 bool bAvoidBurningSamePoints,
bool bIntersectOnly);
98void GDALdllImageFilledPolygon(
int nRasterXSize,
int nRasterYSize,
99 int nPartCount,
const int *panPartSize,
100 const double *padfX,
const double *padfY,
101 const double *padfVariant,
102 llScanlineFunc pfnScanlineFunc,
103 GDALRasterizeInfo *pCBData,
104 bool bAvoidBurningSamePoints);
112#define GP_NODATA_MARKER -51502112
114template <
class DataType,
class EqualityTest>
class GDALRasterPolygonEnumeratorT
118 void MergePolygon(
int nSrcId,
int nDstId);
119 int NewPolygon(DataType nValue);
124 GInt32 *panPolyIdMap =
nullptr;
125 DataType *panPolyValue =
nullptr;
127 int nNextPolygonId = 0;
130 int nConnectedness = 0;
133 explicit GDALRasterPolygonEnumeratorT(
int nConnectedness = 4);
134 ~GDALRasterPolygonEnumeratorT();
136 bool ProcessLine(DataType *panLastLineVal, DataType *panThisLineVal,
137 GInt32 *panLastLineId,
GInt32 *panThisLineId,
int nXSize);
139 void CompleteMerges();
144struct IntEqualityTest
146 bool operator()(std::int64_t a, std::int64_t b)
const
152typedef GDALRasterPolygonEnumeratorT<std::int64_t, IntEqualityTest>
153 GDALRasterPolygonEnumerator;
155constexpr const char *GDAL_APPROX_TRANSFORMER_CLASS_NAME =
156 "GDALApproxTransformer";
157constexpr const char *GDAL_GEN_IMG_TRANSFORMER_CLASS_NAME =
158 "GDALGenImgProjTransformer";
159constexpr const char *GDAL_RPC_TRANSFORMER_CLASS_NAME =
"GDALRPCTransformer";
160constexpr const char *GDAL_REPROJECTION_TRANSFORMER_CLASS_NAME =
161 "GDALReprojectionTransformer";
163bool GDALIsTransformer(
void *hTransformerArg,
const char *pszClassName);
165typedef void *(*GDALTransformDeserializeFunc)(
CPLXMLNode *psTree);
167void CPL_DLL *GDALRegisterTransformDeserializer(
169 GDALTransformDeserializeFunc pfnDeserializeFunc);
170void CPL_DLL GDALUnregisterTransformDeserializer(
void *pData);
172void GDALCleanupTransformDeserializerMutex();
176void *GDALCreateTPSTransformerInt(
int nGCPCount,
const GDAL_GCP *pasGCPList,
179void CPL_DLL *GDALCloneTransformer(
void *pTransformerArg);
181void GDALRefreshGenImgProjTransformer(
void *hTransformArg);
182void GDALRefreshApproxTransformer(
void *hTransformArg);
184int GDALTransformLonLatToDestGenImgProjTransformer(
void *hTransformArg,
185 double *pdfX,
double *pdfY);
186int GDALTransformLonLatToDestApproxTransformer(
void *hTransformArg,
187 double *pdfX,
double *pdfY);
189bool GDALTransformIsTranslationOnPixelBoundaries(
193 void *pTransformerArg);
195bool GDALTransformHasFastClone(
void *pTransformerArg);
201 GDALTransformerInfo sTI;
204 double dfOversampleFactor;
210 double adfBackMapGeoTransform[6];
238 double dfPIXEL_OFFSET;
240 double dfLINE_OFFSET;
243 bool bOriginIsTopLeftCorner;
244 bool bGeographicSRSWithMinus180Plus180LongRange;
247 char **papszGeolocationInfo;
249} GDALGeoLocTransformInfo;
257struct GDALReprojectionTransformInfo
259 GDALTransformerInfo sTI;
260 char **papszOptions =
nullptr;
263 OGRCoordinateTransformation *poForwardTransform =
nullptr;
264 OGRCoordinateTransformation *poReverseTransform =
nullptr;
266 GDALReprojectionTransformInfo() : sTI()
268 memset(&sTI, 0,
sizeof(sTI));
271 GDALReprojectionTransformInfo(
const GDALReprojectionTransformInfo &) =
273 GDALReprojectionTransformInfo &
274 operator=(
const GDALReprojectionTransformInfo &) =
delete;
283struct GDALApproxTransformInfo
285 GDALTransformerInfo sTI;
288 void *pBaseCBData =
nullptr;
289 double dfMaxErrorForward = 0;
290 double dfMaxErrorReverse = 0;
292 int bOwnSubtransformer = 0;
294 GDALApproxTransformInfo() : sTI()
296 memset(&sTI, 0,
sizeof(sTI));
299 GDALApproxTransformInfo(
const GDALApproxTransformInfo &) =
delete;
300 GDALApproxTransformInfo &
301 operator=(
const GDALApproxTransformInfo &) =
delete;
310struct GDALGenImgProjTransformPart
312 double adfGeoTransform[6];
313 double adfInvGeoTransform[6];
322 GDALTransformerInfo sTI;
324 GDALGenImgProjTransformPart sSrcParams;
329 GDALGenImgProjTransformPart sDstParams;
334 bool bCheckWithInvertPROJ;
337 bool bHasCustomTransformationPipeline;
339} GDALGenImgProjTransformInfo;
347int GDALComputeMedianCutPCTInternal(
350 int (*pfnIncludePixel)(
int,
int,
void *),
int nColors,
int nBits,
351 T *panHistogram,
GDALColorTableH hColorTable, GDALProgressFunc pfnProgress,
357 GInt16 *pasDynamicColorMap,
int bDither,
358 GDALProgressFunc pfnProgress,
void *pProgressArg);
360#define PRIME_FOR_65536 98317
365#define MEDIAN_CUT_AND_DITHER_BUFFER_SIZE_65536 \
366 (6 * sizeof(int) * PRIME_FOR_65536)
380bool CPL_DLL GDALFloatAlmostEquals(
float A,
float B,
381 unsigned maxUlps = MAX_ULPS);
383struct FloatEqualityTest
385 bool operator()(
float a,
float b)
387 return GDALFloatAlmostEquals(a, b);
391bool CPL_DLL GDALDoubleAlmostEquals(
double A,
double B,
392 unsigned maxUlps = MAX_ULPS);
394struct DoubleEqualityTest
396 bool operator()(
double a,
double b)
398 return GDALDoubleAlmostEquals(a, b);
403 double adfGT[6],
int nXSize,
int nYSize,
404 double &dfWestLongitudeDeg,
405 double &dfSouthLatitudeDeg,
406 double &dfEastLongitudeDeg,
407 double &dfNorthLatitudeDeg);
410 double dfY1,
double dfX2,
double dfY2,
411 double &dfWestLongitudeDeg,
412 double &dfSouthLatitudeDeg,
413 double &dfEastLongitudeDeg,
414 double &dfNorthLatitudeDeg);
417 const char *pszGeolocationDataset,
420void *GDALCreateGeoLocTransformerEx(
GDALDatasetH hBaseDS,
422 int bReversed,
const char *pszSourceDataset,
String list class designed around our use of C "char**" string lists.
Definition cpl_string.h:454
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:152
short GInt16
Int16 type.
Definition cpl_port.h:171
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:289
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:285
#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:936
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1087
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:175
int GInt32
Int32 type.
Definition cpl_port.h:165
struct _CPLQuadTree CPLQuadTree
Opaque type for a quad tree.
Definition cpl_quad_tree.h:48
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition gdal.h:386
GDALDataType
Definition gdal.h:48
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
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition gdal_fwd.h:42
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition gdal_fwd.h:45
void * GDALColorTableH
Opaque type used for the C bindings of the C++ GDALColorTable class.
Definition gdal_fwd.h:54
Coordinate systems services.
Document node structure.
Definition cpl_minixml.h:54
Ground Control Point.
Definition gdal.h:1221