32 #ifndef GDAL_ALG_PRIV_H_INCLUDED
33 #define GDAL_ALG_PRIV_H_INCLUDED
46 { GBV_UserBurnValue = 0, GBV_Z = 1, GBV_M = 2
60 unsigned char *pabyChunkBuf;
71 const std::int64_t *int64_values;
72 const double *double_values;
74 GDALBurnValueSrc eBurnValueSource;
75 GDALRasterMergeAlg eMergeAlg;
89 typedef void (*llScanlineFunc)(
void *, int, int, int, double);
90 typedef void (*llPointFunc)(
void *, int, int, double);
92 void GDALdllImagePoint(
int nRasterXSize,
int nRasterYSize,
int nPartCount,
93 const int *panPartSize,
const double *padfX,
94 const double *padfY,
const double *padfVariant,
95 llPointFunc pfnPointFunc,
void *pCBData);
97 void GDALdllImageLine(
int nRasterXSize,
int nRasterYSize,
int nPartCount,
98 const int *panPartSize,
const double *padfX,
99 const double *padfY,
const double *padfVariant,
100 llPointFunc pfnPointFunc,
void *pCBData);
102 void GDALdllImageLineAllTouched(
int nRasterXSize,
int nRasterYSize,
103 int nPartCount,
const int *panPartSize,
104 const double *padfX,
const double *padfY,
105 const double *padfVariant,
106 llPointFunc pfnPointFunc,
void *pCBData,
107 int bAvoidBurningSamePoints,
108 bool bIntersectOnly);
110 void GDALdllImageFilledPolygon(
int nRasterXSize,
int nRasterYSize,
111 int nPartCount,
const int *panPartSize,
112 const double *padfX,
const double *padfY,
113 const double *padfVariant,
114 llScanlineFunc pfnScanlineFunc,
void *pCBData);
122 #define GP_NODATA_MARKER -51502112
124 template <
class DataType,
class EqualityTest>
class GDALRasterPolygonEnumeratorT
128 void MergePolygon(
int nSrcId,
int nDstId);
129 int NewPolygon(DataType nValue);
134 GInt32 *panPolyIdMap =
nullptr;
135 DataType *panPolyValue =
nullptr;
137 int nNextPolygonId = 0;
140 int nConnectedness = 0;
143 explicit GDALRasterPolygonEnumeratorT(
int nConnectedness = 4);
144 ~GDALRasterPolygonEnumeratorT();
146 bool ProcessLine(DataType *panLastLineVal, DataType *panThisLineVal,
147 GInt32 *panLastLineId,
GInt32 *panThisLineId,
int nXSize);
149 void CompleteMerges();
154 struct IntEqualityTest
156 bool operator()(std::int64_t a, std::int64_t b)
const
162 typedef GDALRasterPolygonEnumeratorT<std::int64_t, IntEqualityTest>
163 GDALRasterPolygonEnumerator;
165 typedef void *(*GDALTransformDeserializeFunc)(
CPLXMLNode *psTree);
167 void CPL_DLL *GDALRegisterTransformDeserializer(
169 GDALTransformDeserializeFunc pfnDeserializeFunc);
170 void CPL_DLL GDALUnregisterTransformDeserializer(
void *pData);
172 void GDALCleanupTransformDeserializerMutex();
176 void *GDALCreateTPSTransformerInt(
int nGCPCount,
const GDAL_GCP *pasGCPList,
177 int bReversed,
char **papszOptions);
179 void CPL_DLL *GDALCloneTransformer(
void *pTransformerArg);
181 void GDALRefreshGenImgProjTransformer(
void *hTransformArg);
182 void GDALRefreshApproxTransformer(
void *hTransformArg);
184 int GDALTransformLonLatToDestGenImgProjTransformer(
void *hTransformArg,
185 double *pdfX,
double *pdfY);
186 int GDALTransformLonLatToDestApproxTransformer(
void *hTransformArg,
187 double *pdfX,
double *pdfY);
189 bool GDALTransformIsTranslationOnPixelBoundaries(
193 void *pTransformerArg);
199 GDALTransformerInfo sTI;
202 double dfOversampleFactor;
208 double adfBackMapGeoTransform[6];
236 double dfPIXEL_OFFSET;
238 double dfLINE_OFFSET;
241 bool bOriginIsTopLeftCorner;
242 bool bGeographicSRSWithMinus180Plus180LongRange;
245 char **papszGeolocationInfo;
247 } GDALGeoLocTransformInfo;
255 int GDALComputeMedianCutPCTInternal(
258 int (*pfnIncludePixel)(
int,
int,
void *),
int nColors,
int nBits,
259 T *panHistogram,
GDALColorTableH hColorTable, GDALProgressFunc pfnProgress,
265 GInt16 *pasDynamicColorMap,
int bDither,
266 GDALProgressFunc pfnProgress,
void *pProgressArg);
268 #define PRIME_FOR_65536 98317
273 #define MEDIAN_CUT_AND_DITHER_BUFFER_SIZE_65536 \
274 (6 * sizeof(int) * PRIME_FOR_65536)
288 GBool GDALFloatEquals(
float A,
float B);
290 struct FloatEqualityTest
292 bool operator()(
float a,
float b)
294 return GDALFloatEquals(a, b) == TRUE;
299 int nXSize,
int nYSize,
300 double &dfWestLongitudeDeg,
301 double &dfSouthLatitudeDeg,
302 double &dfEastLongitudeDeg,
303 double &dfNorthLatitudeDeg);
306 double dfY1,
double dfX2,
double dfY2,
307 double &dfWestLongitudeDeg,
308 double &dfSouthLatitudeDeg,
309 double &dfEastLongitudeDeg,
310 double &dfNorthLatitudeDeg);
313 const char *pszGeolocationDataset,
316 void *GDALCreateGeoLocTransformerEx(
GDALDatasetH hBaseDS,
318 int bReversed,
const char *pszSourceDataset,