32 #ifndef GDAL_ALG_PRIV_H_INCLUDED
33 #define GDAL_ALG_PRIV_H_INCLUDED
48 { GBV_UserBurnValue = 0, GBV_Z = 1, GBV_M = 2
62 unsigned char *pabyChunkBuf;
73 const std::int64_t *int64_values;
74 const double *double_values;
76 GDALBurnValueSrc eBurnValueSource;
77 GDALRasterMergeAlg eMergeAlg;
78 bool bFillSetVisitedPoints;
79 std::set<uint64_t> *poSetVisitedPoints;
93 typedef void (*llScanlineFunc)(
void *, int, int, int, double);
94 typedef void (*llPointFunc)(
void *, int, int, double);
96 void GDALdllImagePoint(
int nRasterXSize,
int nRasterYSize,
int nPartCount,
97 const int *panPartSize,
const double *padfX,
98 const double *padfY,
const double *padfVariant,
99 llPointFunc pfnPointFunc,
void *pCBData);
101 void GDALdllImageLine(
int nRasterXSize,
int nRasterYSize,
int nPartCount,
102 const int *panPartSize,
const double *padfX,
103 const double *padfY,
const double *padfVariant,
104 llPointFunc pfnPointFunc,
void *pCBData);
106 void GDALdllImageLineAllTouched(
int nRasterXSize,
int nRasterYSize,
107 int nPartCount,
const int *panPartSize,
108 const double *padfX,
const double *padfY,
109 const double *padfVariant,
110 llPointFunc pfnPointFunc,
void *pCBData,
111 bool bAvoidBurningSamePoints,
112 bool bIntersectOnly);
114 void GDALdllImageFilledPolygon(
int nRasterXSize,
int nRasterYSize,
115 int nPartCount,
const int *panPartSize,
116 const double *padfX,
const double *padfY,
117 const double *padfVariant,
118 llScanlineFunc pfnScanlineFunc,
void *pCBData,
119 bool bAvoidBurningSamePoints);
127 #define GP_NODATA_MARKER -51502112
129 template <
class DataType,
class EqualityTest>
class GDALRasterPolygonEnumeratorT
133 void MergePolygon(
int nSrcId,
int nDstId);
134 int NewPolygon(DataType nValue);
139 GInt32 *panPolyIdMap =
nullptr;
140 DataType *panPolyValue =
nullptr;
142 int nNextPolygonId = 0;
145 int nConnectedness = 0;
148 explicit GDALRasterPolygonEnumeratorT(
int nConnectedness = 4);
149 ~GDALRasterPolygonEnumeratorT();
151 bool ProcessLine(DataType *panLastLineVal, DataType *panThisLineVal,
152 GInt32 *panLastLineId,
GInt32 *panThisLineId,
int nXSize);
154 void CompleteMerges();
159 struct IntEqualityTest
161 bool operator()(std::int64_t a, std::int64_t b)
const
167 typedef GDALRasterPolygonEnumeratorT<std::int64_t, IntEqualityTest>
168 GDALRasterPolygonEnumerator;
170 typedef void *(*GDALTransformDeserializeFunc)(
CPLXMLNode *psTree);
172 void CPL_DLL *GDALRegisterTransformDeserializer(
174 GDALTransformDeserializeFunc pfnDeserializeFunc);
175 void CPL_DLL GDALUnregisterTransformDeserializer(
void *pData);
177 void GDALCleanupTransformDeserializerMutex();
181 void *GDALCreateTPSTransformerInt(
int nGCPCount,
const GDAL_GCP *pasGCPList,
182 int bReversed,
char **papszOptions);
184 void CPL_DLL *GDALCloneTransformer(
void *pTransformerArg);
186 void GDALRefreshGenImgProjTransformer(
void *hTransformArg);
187 void GDALRefreshApproxTransformer(
void *hTransformArg);
189 int GDALTransformLonLatToDestGenImgProjTransformer(
void *hTransformArg,
190 double *pdfX,
double *pdfY);
191 int GDALTransformLonLatToDestApproxTransformer(
void *hTransformArg,
192 double *pdfX,
double *pdfY);
194 bool GDALTransformIsTranslationOnPixelBoundaries(
198 void *pTransformerArg);
204 GDALTransformerInfo sTI;
207 double dfOversampleFactor;
213 double adfBackMapGeoTransform[6];
241 double dfPIXEL_OFFSET;
243 double dfLINE_OFFSET;
246 bool bOriginIsTopLeftCorner;
247 bool bGeographicSRSWithMinus180Plus180LongRange;
250 char **papszGeolocationInfo;
252 } GDALGeoLocTransformInfo;
260 int GDALComputeMedianCutPCTInternal(
263 int (*pfnIncludePixel)(
int,
int,
void *),
int nColors,
int nBits,
264 T *panHistogram,
GDALColorTableH hColorTable, GDALProgressFunc pfnProgress,
270 GInt16 *pasDynamicColorMap,
int bDither,
271 GDALProgressFunc pfnProgress,
void *pProgressArg);
273 #define PRIME_FOR_65536 98317
278 #define MEDIAN_CUT_AND_DITHER_BUFFER_SIZE_65536 \
279 (6 * sizeof(int) * PRIME_FOR_65536)
293 GBool GDALFloatEquals(
float A,
float B);
295 struct FloatEqualityTest
297 bool operator()(
float a,
float b)
299 return GDALFloatEquals(a, b) == TRUE;
304 int nXSize,
int nYSize,
305 double &dfWestLongitudeDeg,
306 double &dfSouthLatitudeDeg,
307 double &dfEastLongitudeDeg,
308 double &dfNorthLatitudeDeg);
311 double dfY1,
double dfX2,
double dfY2,
312 double &dfWestLongitudeDeg,
313 double &dfSouthLatitudeDeg,
314 double &dfEastLongitudeDeg,
315 double &dfNorthLatitudeDeg);
318 const char *pszGeolocationDataset,
321 void *GDALCreateGeoLocTransformerEx(
GDALDatasetH hBaseDS,
323 int bReversed,
const char *pszSourceDataset,