GDAL

gdalwarper.h
Go to the documentation of this file.
1/******************************************************************************
2 * $Id$
3 *
4 * Project: GDAL High Performance Warper
5 * Purpose: Prototypes, and definitions for warping related work.
6 * Author: Frank Warmerdam, warmerdam@pobox.com
7 *
8 ******************************************************************************
9 * Copyright (c) 2003, Frank Warmerdam
10 * Copyright (c) 2009-2012, Even Rouault <even dot rouault at spatialys.com>
11 *
12 * SPDX-License-Identifier: MIT
13 ****************************************************************************/
14
15#ifndef GDALWARPER_H_INCLUDED
16#define GDALWARPER_H_INCLUDED
17
26#include "gdal_alg.h"
27#include "cpl_minixml.h"
28#include "cpl_multiproc.h"
29
30 CPL_C_START
31
32/* Note: values are selected to be consistent with GDALRIOResampleAlg of
33 * gcore/gdal.h */
35 typedef enum
36{
GRA_NearestNeighbour =
38 0,
GRA_Bilinear = 1, GRA_Cubic = 2, GRA_CubicSpline = 3, GRA_Lanczos = 4,
45 GRA_Average = 5,
48 GRA_Mode = 6,
49 /* GRA_Gauss=7 reserved. */
GRA_Max =
51 8,
GRA_Min =
53 9,
GRA_Med =
55 10,
57 GRA_Q1 = 11,
59 GRA_Q3 = 12,
62 GRA_Sum = 13,
65 GRA_RMS = 14,
67 GRA_LAST_VALUE = GRA_RMS
69} GDALResampleAlg;
70
72 typedef int (*GDALMaskFunc)(void *pMaskFuncArg, int nBandCount,
73 GDALDataType eType, int nXOff, int nYOff,
74 int nXSize, int nYSize, GByte **papabyImageData,
75 int bMaskIsFloat, void *pMask);
76
77 CPLErr CPL_DLL GDALWarpNoDataMasker(void *pMaskFuncArg, int nBandCount,
78 GDALDataType eType, int nXOff, int nYOff,
79 int nXSize, int nYSize,
80 GByte **papabyImageData, int bMaskIsFloat,
81 void *pValidityMask, int *pbOutAllValid);
82
83 CPLErr CPL_DLL GDALWarpDstAlphaMasker(void *pMaskFuncArg, int nBandCount,
84 GDALDataType eType, int nXOff, int nYOff,
85 int nXSize, int nYSize,
86 GByte ** /*ppImageData */,
87 int bMaskIsFloat, void *pValidityMask);
88 CPLErr CPL_DLL GDALWarpSrcAlphaMasker(void *pMaskFuncArg, int nBandCount,
89 GDALDataType eType, int nXOff, int nYOff,
90 int nXSize, int nYSize,
91 GByte ** /*ppImageData */,
92 int bMaskIsFloat, void *pValidityMask,
93 int *pbOutAllOpaque);
94
95 CPLErr CPL_DLL GDALWarpSrcMaskMasker(void *pMaskFuncArg, int nBandCount,
96 GDALDataType eType, int nXOff, int nYOff,
97 int nXSize, int nYSize,
98 GByte ** /*ppImageData */,
99 int bMaskIsFloat, void *pValidityMask);
100
101 CPLErr CPL_DLL GDALWarpCutlineMasker(void *pMaskFuncArg, int nBandCount,
102 GDALDataType eType, int nXOff, int nYOff,
103 int nXSize, int nYSize,
104 GByte ** /* ppImageData */,
105 int bMaskIsFloat, void *pValidityMask);
106
107/* GCMVF stands for GDALWARP_CUTLINE_MASKER_VALIDITY_FLAG */
108#define GCMVF_PARTIAL_INTERSECTION 0
109#define GCMVF_NO_INTERSECTION 1
110#define GCMVF_CHUNK_FULLY_WITHIN_CUTLINE 2
111 CPLErr CPL_DLL GDALWarpCutlineMaskerEx(void *pMaskFuncArg, int nBandCount,
112 GDALDataType eType, int nXOff, int nYOff,
113 int nXSize, int nYSize,
114 GByte ** /* ppImageData */,
115 int bMaskIsFloat, void *pValidityMask,
116 int *pnValidityFlag);
117
121 typedef enum
122{
123 /* Choose the first value encountered */ GWKTS_First = 1,
124 /* Choose the minimal value */ GWKTS_Min = 2,
125 /* Choose the maximum value */ GWKTS_Max = 3,
126} GWKTieStrategy;
127
128/************************************************************************/
129/* GDALWarpOptions */
130/************************************************************************/
131
133 typedef struct
134{
135
136 char **papszWarpOptions;
137
139 double dfWarpMemoryLimit;
140
142 GDALResampleAlg eResampleAlg;
143
146 GDALDataType eWorkingDataType;
147
149 GDALDatasetH hSrcDS;
150
153 GDALDatasetH hDstDS;
154
156 int nBandCount;
157
159 int *panSrcBands;
160
162 int *panDstBands;
163
165 int nSrcAlphaBand;
166
168 int nDstAlphaBand;
169
172 double *padfSrcNoDataReal;
176 double *padfSrcNoDataImag;
177
180 double *padfDstNoDataReal;
184 double *padfDstNoDataImag;
185
188 GDALProgressFunc pfnProgress;
189
191 void *pProgressArg;
192
194 GDALTransformerFunc pfnTransformer;
195
197 void *pTransformerArg;
198
200 GDALMaskFunc *papfnSrcPerBandValidityMaskFunc;
202 void **papSrcPerBandValidityMaskFuncArg;
203
205 GDALMaskFunc pfnSrcValidityMaskFunc;
207 void *pSrcValidityMaskFuncArg;
208
210 GDALMaskFunc pfnSrcDensityMaskFunc;
212 void *pSrcDensityMaskFuncArg;
213
215 GDALMaskFunc pfnDstDensityMaskFunc;
217 void *pDstDensityMaskFuncArg;
218
220 GDALMaskFunc pfnDstValidityMaskFunc;
222 void *pDstValidityMaskFuncArg;
223
225 CPLErr (*pfnPreWarpChunkProcessor)(void *pKern, void *pArg);
227 void *pPreWarpProcessorArg;
228
230 CPLErr (*pfnPostWarpChunkProcessor)(void *pKern, void *pArg);
232 void *pPostWarpProcessorArg;
233
235 void *hCutline;
236
239 double dfCutlineBlendDist;
240
242 GWKTieStrategy eTieStrategy;
243} GDALWarpOptions;
244
245 const char CPL_DLL *GDALWarpGetOptionList(void);
246
247 GDALWarpOptions CPL_DLL *CPL_STDCALL GDALCreateWarpOptions(void);
248 void CPL_DLL CPL_STDCALL GDALDestroyWarpOptions(GDALWarpOptions *);
249 GDALWarpOptions CPL_DLL *CPL_STDCALL
250 GDALCloneWarpOptions(const GDALWarpOptions *);
251
252 void CPL_DLL CPL_STDCALL GDALWarpInitDstNoDataReal(GDALWarpOptions *,
253 double dNoDataReal);
254
255 void CPL_DLL CPL_STDCALL GDALWarpInitSrcNoDataReal(GDALWarpOptions *,
256 double dNoDataReal);
257
258 void CPL_DLL CPL_STDCALL GDALWarpInitNoDataReal(GDALWarpOptions *,
259 double dNoDataReal);
260
261 void CPL_DLL CPL_STDCALL GDALWarpInitDstNoDataImag(GDALWarpOptions *,
262 double dNoDataImag);
263
264 void CPL_DLL CPL_STDCALL GDALWarpInitSrcNoDataImag(GDALWarpOptions *,
265 double dNoDataImag);
266
267 void CPL_DLL CPL_STDCALL GDALWarpResolveWorkingDataType(GDALWarpOptions *);
268
269 void CPL_DLL CPL_STDCALL GDALWarpInitDefaultBandMapping(GDALWarpOptions *,
270 int nBandCount);
271
273 CPLXMLNode CPL_DLL *CPL_STDCALL
274GDALSerializeWarpOptions(const GDALWarpOptions *);
275 GDALWarpOptions CPL_DLL *CPL_STDCALL GDALDeserializeWarpOptions(CPLXMLNode *);
278/************************************************************************/
279/* GDALReprojectImage() */
280/************************************************************************/
281
282 CPLErr CPL_DLL CPL_STDCALL GDALReprojectImage(
283 GDALDatasetH hSrcDS, const char *pszSrcWKT, GDALDatasetH hDstDS,
284 const char *pszDstWKT, GDALResampleAlg eResampleAlg,
285 double dfWarpMemoryLimit, double dfMaxError, GDALProgressFunc pfnProgress,
286 void *pProgressArg, GDALWarpOptions *psOptions);
287
288 CPLErr CPL_DLL CPL_STDCALL GDALCreateAndReprojectImage(
289 GDALDatasetH hSrcDS, const char *pszSrcWKT, const char *pszDstFilename,
290 const char *pszDstWKT, GDALDriverH hDstDriver, char **papszCreateOptions,
291 GDALResampleAlg eResampleAlg, double dfWarpMemoryLimit, double dfMaxError,
292 GDALProgressFunc pfnProgress, void *pProgressArg,
293 GDALWarpOptions *psOptions);
294
295/************************************************************************/
296/* VRTWarpedDataset */
297/************************************************************************/
298
299 GDALDatasetH CPL_DLL CPL_STDCALL
300 GDALAutoCreateWarpedVRT(GDALDatasetH hSrcDS, const char *pszSrcWKT,
301 const char *pszDstWKT, GDALResampleAlg eResampleAlg,
302 double dfMaxError, const GDALWarpOptions *psOptions);
303
304 GDALDatasetH CPL_DLL CPL_STDCALL GDALAutoCreateWarpedVRTEx(
305 GDALDatasetH hSrcDS, const char *pszSrcWKT, const char *pszDstWKT,
306 GDALResampleAlg eResampleAlg, double dfMaxError,
307 const GDALWarpOptions *psOptions, CSLConstList papszTransformerOptions);
308
309 GDALDatasetH CPL_DLL CPL_STDCALL
310 GDALCreateWarpedVRT(GDALDatasetH hSrcDS, int nPixels, int nLines,
311 const double *padfGeoTransform, GDALWarpOptions *psOptions);
312
313 CPLErr CPL_DLL CPL_STDCALL GDALInitializeWarpedVRT(GDALDatasetH hDS,
314 GDALWarpOptions *psWO);
315
316 CPL_C_END
317
318#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
319
320#include <vector>
321#include <utility>
322
323 bool GDALGetWarpResampleAlg(const char *pszResampling,
324 GDALResampleAlg &eResampleAlg, bool bThrow = false);
325
326/************************************************************************/
327/* GDALWarpKernel */
328/* */
329
335#define WARP_EXTRA_ELTS 1
336
344 class CPL_DLL GDALWarpKernel
345{
346 CPL_DISALLOW_COPY_ASSIGN(GDALWarpKernel)
347
348 public:
350 char **papszWarpOptions;
351
353 GDALResampleAlg eResample;
355 GDALDataType eWorkingDataType;
357 int nBands;
358
360 int nSrcXSize;
362 int nSrcYSize;
365 double dfSrcXExtraSize;
368 double dfSrcYExtraSize;
371 GByte **papabySrcImage;
372
375 GUInt32 **papanBandSrcValid;
378 GUInt32 *panUnifiedSrcValid;
381 float *pafUnifiedSrcDensity;
382
384 int nDstXSize;
386 int nDstYSize;
388 GByte **papabyDstImage;
390 GUInt32 *panDstValid;
392 float *pafDstDensity;
393
395 double dfXScale;
397 double dfYScale;
399 double dfXFilter;
401 double dfYFilter;
403 int nXRadius;
405 int nYRadius;
407 int nFiltInitX;
409 int nFiltInitY;
410
413 int nSrcXOff;
416 int nSrcYOff;
417
420 int nDstXOff;
423 int nDstYOff;
424
426 GDALTransformerFunc pfnTransformer;
428 void *pTransformerArg;
429
431 GDALProgressFunc pfnProgress;
433 void *pProgress;
434
436 double dfProgressBase;
438 double dfProgressScale;
439
441 double *padfDstNoDataReal;
442
445 void *psThreadData;
446
447 bool bApplyVerticalShift = false;
448
449 double dfMultFactorVerticalShift = 1.0;
450
451 // Tuples of values (e.g. "<R>,<G>,<B>" or "(<R1>,<G1>,<B1>),(<R2>,<G2>,<B2>)") that must
452 // be ignored as contributing source pixels during resampling. Only taken into account by
453 // Average currently
454 std::vector<std::vector<double>> m_aadfExcludedValues{};
455
456 GWKTieStrategy eTieStrategy;
457
458 bool bWarnedAboutDstNoDataReplacement = false;
459
462 GDALWarpKernel();
463 ~GDALWarpKernel();
464
465 CPLErr Validate();
466 CPLErr PerformWarp();
467};
468
470 void *GWKThreadsCreate(char **papszWarpOptions,
471 GDALTransformerFunc pfnTransformer,
472 void *pTransformerArg);
473 void GWKThreadsEnd(void *psThreadDataIn);
476/************************************************************************/
477/* GDALWarpOperation() */
478/* */
479/* This object is application created, or created by a higher */
480/* level convenience function. It is responsible for */
481/* subdividing the operation into chunks, loading and saving */
482/* imagery, and establishing the various validity and density */
483/* masks. Actual resampling is done by the GDALWarpKernel. */
484/************************************************************************/
485
487 typedef struct _GDALWarpChunk GDALWarpChunk;
488
489 struct GDALTransformerUniquePtrReleaser
490{
491 void operator()(void *p)
492 {
493 GDALDestroyTransformer(p);
494 }
495};
496
500 using GDALTransformerArgUniquePtr =
501 std::unique_ptr<void, GDALTransformerUniquePtrReleaser>;
502
503 class CPL_DLL GDALWarpOperation final
504{
505
506 CPL_DISALLOW_COPY_ASSIGN(GDALWarpOperation)
507
508 private:
509 GDALWarpOptions *psOptions = nullptr;
510 GDALTransformerArgUniquePtr m_psOwnedTransformerArg{nullptr};
511
512 void WipeOptions();
513 int ValidateOptions();
514
515 bool ComputeSourceWindowTransformPoints(
516 int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize, bool bUseGrid,
517 bool bAll, int nStepCount, bool bTryWithCheckWithInvertProj,
518 double &dfMinXOut, double &dfMinYOut, double &dfMaxXOut,
519 double &dfMaxYOut, int &nSamplePoints, int &nFailedCount);
520
521 void ComputeSourceWindowStartingFromSource(int nDstXOff, int nDstYOff,
522 int nDstXSize, int nDstYSize,
523 double *padfSrcMinX,
524 double *padfSrcMinY,
525 double *padfSrcMaxX,
526 double *padfSrcMaxY);
527
528 static CPLErr CreateKernelMask(GDALWarpKernel *, int iBand,
529 const char *pszType);
530
531 CPLMutex *hIOMutex = nullptr;
532 CPLMutex *hWarpMutex = nullptr;
533
534 int nChunkListCount = 0;
535 int nChunkListMax = 0;
536 GDALWarpChunk *pasChunkList = nullptr;
537
538 bool bReportTimings = false;
539 unsigned long nLastTimeReported = 0;
540
541 void *psThreadData = nullptr;
542
543 // Coordinates a few special points in target image space, to determine
544 // if ComputeSourceWindow() must use a grid based sampling.
545 std::vector<std::pair<double, double>> aDstXYSpecialPoints{};
546
547 bool m_bIsTranslationOnPixelBoundaries = false;
548
549 void WipeChunkList();
550 CPLErr CollectChunkListInternal(int nDstXOff, int nDstYOff, int nDstXSize,
551 int nDstYSize);
552 void CollectChunkList(int nDstXOff, int nDstYOff, int nDstXSize,
553 int nDstYSize);
554 void ReportTiming(const char *);
555
556 public:
557 GDALWarpOperation();
558 ~GDALWarpOperation();
559
560 CPLErr Initialize(const GDALWarpOptions *psNewOptions,
561 GDALTransformerFunc pfnTransformer = nullptr,
562 GDALTransformerArgUniquePtr psOwnedTransformerArg =
563 GDALTransformerArgUniquePtr{nullptr});
564 void *CreateDestinationBuffer(int nDstXSize, int nDstYSize,
565 int *pbWasInitialized = nullptr);
566 CPLErr InitializeDestinationBuffer(void *pDstBuffer, int nDstXSize,
567 int nDstYSize,
568 int *pbWasInitialized = nullptr) const;
569 static void DestroyDestinationBuffer(void *pDstBuffer);
570
571 const GDALWarpOptions *GetOptions();
572
573 CPLErr ChunkAndWarpImage(int nDstXOff, int nDstYOff, int nDstXSize,
574 int nDstYSize);
575 CPLErr ChunkAndWarpMulti(int nDstXOff, int nDstYOff, int nDstXSize,
576 int nDstYSize);
577 CPLErr WarpRegion(int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize,
578 int nSrcXOff = 0, int nSrcYOff = 0, int nSrcXSize = 0,
579 int nSrcYSize = 0, double dfProgressBase = 0.0,
580 double dfProgressScale = 1.0);
581 CPLErr WarpRegion(int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize,
582 int nSrcXOff, int nSrcYOff, int nSrcXSize, int nSrcYSize,
583 double dfSrcXExtraSize, double dfSrcYExtraSize,
584 double dfProgressBase, double dfProgressScale);
585 CPLErr WarpRegionToBuffer(int nDstXOff, int nDstYOff, int nDstXSize,
586 int nDstYSize, void *pDataBuf,
587 GDALDataType eBufDataType, int nSrcXOff = 0,
588 int nSrcYOff = 0, int nSrcXSize = 0,
589 int nSrcYSize = 0, double dfProgressBase = 0.0,
590 double dfProgressScale = 1.0);
591 CPLErr WarpRegionToBuffer(int nDstXOff, int nDstYOff, int nDstXSize,
592 int nDstYSize, void *pDataBuf,
593 GDALDataType eBufDataType, int nSrcXOff,
594 int nSrcYOff, int nSrcXSize, int nSrcYSize,
595 double dfSrcXExtraSize, double dfSrcYExtraSize,
596 double dfProgressBase, double dfProgressScale);
597
598 protected:
599 friend class VRTWarpedDataset;
600 CPLErr ComputeSourceWindow(int nDstXOff, int nDstYOff, int nDstXSize,
601 int nDstYSize, int *pnSrcXOff, int *pnSrcYOff,
602 int *pnSrcXSize, int *pnSrcYSize,
603 double *pdfSrcXExtraSize,
604 double *pdfSrcYExtraSize,
605 double *pdfSrcFillRatio);
606
607 double GetWorkingMemoryForWindow(int nSrcXSize, int nSrcYSize,
608 int nDstXSize, int nDstYSize) const;
609};
610
611#endif /* def __cplusplus */
612
613 CPL_C_START
614
616 typedef void *GDALWarpOperationH;
617
618 GDALWarpOperationH CPL_DLL GDALCreateWarpOperation(const GDALWarpOptions *);
619 void CPL_DLL GDALDestroyWarpOperation(GDALWarpOperationH);
620 CPLErr CPL_DLL GDALChunkAndWarpImage(GDALWarpOperationH, int, int, int, int);
621 CPLErr CPL_DLL GDALChunkAndWarpMulti(GDALWarpOperationH, int, int, int, int);
622 CPLErr CPL_DLL GDALWarpRegion(GDALWarpOperationH, int, int, int, int, int, int,
623 int, int);
624 CPLErr CPL_DLL GDALWarpRegionToBuffer(GDALWarpOperationH, int, int, int, int,
625 void *, GDALDataType, int, int, int, int);
626
627/************************************************************************/
628/* Warping kernel functions */
629/************************************************************************/
630
632 int GWKGetFilterRadius(GDALResampleAlg eResampleAlg);
633
634 typedef double (*FilterFuncType)(double dfX);
635FilterFuncType GWKGetFilterFunc(GDALResampleAlg eResampleAlg);
636
637// TODO(schwehr): Can padfVals be a const pointer?
638 typedef double (*FilterFunc4ValuesType)(double *padfVals);
639FilterFunc4ValuesType GWKGetFilterFunc4Values(GDALResampleAlg eResampleAlg);
642 CPL_C_END
643
644#endif /* ndef GDAL_ALG_H_INCLUDED */
GDALWarpKernel
This class represents the lowest level of abstraction of warping.
Definition gdalwarper.h:345
GDALWarpKernel::nXRadius
int nXRadius
X size of window to filter.
Definition gdalwarper.h:403
GDALWarpKernel::nSrcYSize
int nSrcYSize
Height of the source image.
Definition gdalwarper.h:362
GDALWarpKernel::papszWarpOptions
char ** papszWarpOptions
Warp options.
Definition gdalwarper.h:350
GDALWarpKernel::nFiltInitX
int nFiltInitX
X filtering offset.
Definition gdalwarper.h:407
GDALWarpKernel::dfXScale
double dfXScale
X resampling scale, i.e.
Definition gdalwarper.h:395
GDALWarpKernel::dfYFilter
double dfYFilter
Y size of filter kernel.
Definition gdalwarper.h:401
GDALWarpKernel::nDstXSize
int nDstXSize
Width of the destination image.
Definition gdalwarper.h:384
GDALWarpKernel::dfSrcXExtraSize
double dfSrcXExtraSize
Extra pixels (included in nSrcXSize) reserved for filter window.
Definition gdalwarper.h:365
GDALWarpKernel::padfDstNoDataReal
double * padfDstNoDataReal
Array of nBands value for destination nodata.
Definition gdalwarper.h:441
GDALWarpKernel::nDstXOff
int nDstXOff
X offset of the destination buffer regarding the top-left corner of the image.
Definition gdalwarper.h:420
GDALWarpKernel::eResample
GDALResampleAlg eResample
Resample algorithm.
Definition gdalwarper.h:353
GDALWarpKernel::pfnTransformer
GDALTransformerFunc pfnTransformer
Pixel transformation function.
Definition gdalwarper.h:426
GDALWarpKernel::panUnifiedSrcValid
GUInt32 * panUnifiedSrcValid
Unified validity mask of size (nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS) / 8.
Definition gdalwarper.h:378
GDALWarpKernel::nDstYSize
int nDstYSize
Height of the destination image.
Definition gdalwarper.h:386
GDALWarpKernel::nBands
int nBands
Number of input and output bands (excluding alpha bands)
Definition gdalwarper.h:357
GDALWarpKernel::dfProgressBase
double dfProgressBase
Base/offset value for progress computation.
Definition gdalwarper.h:436
GDALWarpKernel::eWorkingDataType
GDALDataType eWorkingDataType
Working data type.
Definition gdalwarper.h:355
GDALWarpKernel::dfSrcYExtraSize
double dfSrcYExtraSize
Extra pixels (included in nSrcYSize) reserved for filter window.
Definition gdalwarper.h:368
GDALWarpKernel::nSrcXOff
int nSrcXOff
X offset of the source buffer regarding the top-left corner of the image.
Definition gdalwarper.h:413
GDALWarpKernel::nSrcYOff
int nSrcYOff
Y offset of the source buffer regarding the top-left corner of the image.
Definition gdalwarper.h:416
GDALWarpKernel::nDstYOff
int nDstYOff
Y offset of the destination buffer regarding the top-left corner of the image.
Definition gdalwarper.h:423
GDALWarpKernel::nFiltInitY
int nFiltInitY
Y filtering offset.
Definition gdalwarper.h:409
GDALWarpKernel::pfnProgress
GDALProgressFunc pfnProgress
Progress function.
Definition gdalwarper.h:431
GDALWarpKernel::papanBandSrcValid
GUInt32 ** papanBandSrcValid
Array of nBands validity mask of size (nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS) / 8.
Definition gdalwarper.h:375
GDALWarpKernel::pProgress
void * pProgress
User data provided to pfnProgress.
Definition gdalwarper.h:433
GDALWarpKernel::pafUnifiedSrcDensity
float * pafUnifiedSrcDensity
Unified source density of size nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS.
Definition gdalwarper.h:381
GDALWarpKernel::nYRadius
int nYRadius
Y size of window to filter.
Definition gdalwarper.h:405
GDALWarpKernel::pafDstDensity
float * pafDstDensity
Destination density of size nDstXSize * nDstYSize.
Definition gdalwarper.h:392
GDALWarpKernel::dfXFilter
double dfXFilter
X size of filter kernel.
Definition gdalwarper.h:399
GDALWarpKernel::dfYScale
double dfYScale
Y resampling scale, i.e.
Definition gdalwarper.h:397
GDALWarpKernel::papabyDstImage
GByte ** papabyDstImage
Array of nBands destination images of size nDstXSize * nDstYSize.
Definition gdalwarper.h:388
GDALWarpKernel::dfProgressScale
double dfProgressScale
Scale value for progress computation.
Definition gdalwarper.h:438
GDALWarpKernel::nSrcXSize
int nSrcXSize
Width of the source image.
Definition gdalwarper.h:360
GDALWarpKernel::pTransformerArg
void * pTransformerArg
User data provided to pfnTransformer.
Definition gdalwarper.h:428
GDALWarpKernel::papabySrcImage
GByte ** papabySrcImage
Array of nBands source images of size nSrcXSize * nSrcYSize.
Definition gdalwarper.h:371
GDALWarpKernel::panDstValid
GUInt32 * panDstValid
Validify mask of size (nDstXSize * nDstYSize) / 8.
Definition gdalwarper.h:390
GDALWarpOperation
High level image warping class.
Definition gdalwarper.h:504
CPLErr
CPLErr
Error category.
Definition cpl_error.h:37
cpl_minixml.h
Definitions for CPL mini XML Parser/Serializer.
CPL_C_END
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:289
CPL_C_START
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:285
GUInt32
unsigned int GUInt32
Unsigned int32 type.
Definition cpl_port.h:167
CPL_DISALLOW_COPY_ASSIGN
#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
CSLConstList
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1087
GByte
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:175
GDALDataType
GDALDataType
Definition gdal.h:48
gdal_alg.h
Public (C callable) GDAL algorithm entry points, and definitions.
GDALTransformerFunc
int(* GDALTransformerFunc)(void *pTransformerArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Definition gdal_alg.h:79
GDALDatasetH
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition gdal_fwd.h:42
GDALDriverH
void * GDALDriverH
Opaque type used for the C bindings of the C++ GDALDriver class.
Definition gdal_fwd.h:51
GDALWarpRegion
CPLErr GDALWarpRegion(GDALWarpOperationH, int, int, int, int, int, int, int, int)
Definition gdalwarpoperation.cpp:1831
GDALDestroyWarpOperation
void GDALDestroyWarpOperation(GDALWarpOperationH)
Definition gdalwarpoperation.cpp:933
GDALCreateWarpOperation
GDALWarpOperationH GDALCreateWarpOperation(const GDALWarpOptions *)
Definition gdalwarpoperation.cpp:913
GWKTieStrategy
GWKTieStrategy
Definition gdalwarper.h:122
GDALWarpInitDstNoDataImag
void GDALWarpInitDstNoDataImag(GDALWarpOptions *, double dNoDataImag)
Initialize padfDstNoDataImag with specified value.
Definition gdalwarper.cpp:1710
GDALResampleAlg
GDALResampleAlg
Definition gdalwarper.h:36
GRA_CubicSpline
@ GRA_CubicSpline
Definition gdalwarper.h:41
GRA_Q1
@ GRA_Q1
Definition gdalwarper.h:57
GRA_Sum
@ GRA_Sum
Definition gdalwarper.h:62
GRA_Max
@ GRA_Max
Definition gdalwarper.h:50
GRA_Cubic
@ GRA_Cubic
Definition gdalwarper.h:40
GRA_Min
@ GRA_Min
Definition gdalwarper.h:52
GRA_RMS
@ GRA_RMS
Definition gdalwarper.h:65
GRA_Lanczos
@ GRA_Lanczos
Definition gdalwarper.h:42
GRA_Mode
@ GRA_Mode
Definition gdalwarper.h:48
GRA_NearestNeighbour
@ GRA_NearestNeighbour
Definition gdalwarper.h:37
GRA_Q3
@ GRA_Q3
Definition gdalwarper.h:59
GRA_Med
@ GRA_Med
Definition gdalwarper.h:54
GRA_Average
@ GRA_Average
Definition gdalwarper.h:45
GRA_Bilinear
@ GRA_Bilinear
Definition gdalwarper.h:39
GDALDestroyWarpOptions
void GDALDestroyWarpOptions(GDALWarpOptions *)
Destroy a warp options structure.
Definition gdalwarper.cpp:1544
GDALWarpOperationH
void * GDALWarpOperationH
Opaque type representing a GDALWarpOperation object.
Definition gdalwarper.h:616
GDALWarpRegionToBuffer
CPLErr GDALWarpRegionToBuffer(GDALWarpOperationH, int, int, int, int, void *, GDALDataType, int, int, int, int)
Definition gdalwarpoperation.cpp:2469
GDALCreateAndReprojectImage
CPLErr GDALCreateAndReprojectImage(GDALDatasetH hSrcDS, const char *pszSrcWKT, const char *pszDstFilename, const char *pszDstWKT, GDALDriverH hDstDriver, char **papszCreateOptions, GDALResampleAlg eResampleAlg, double dfWarpMemoryLimit, double dfMaxError, GDALProgressFunc pfnProgress, void *pProgressArg, GDALWarpOptions *psOptions)
Reproject an image and create the target reprojected image.
Definition gdalwarper.cpp:221
GDALCreateWarpedVRT
GDALDatasetH GDALCreateWarpedVRT(GDALDatasetH hSrcDS, int nPixels, int nLines, const double *padfGeoTransform, GDALWarpOptions *psOptions)
Create virtual warped dataset.
Definition vrtwarped.cpp:372
GDALChunkAndWarpImage
CPLErr GDALChunkAndWarpImage(GDALWarpOperationH, int, int, int, int)
Definition gdalwarpoperation.cpp:1099
GDALAutoCreateWarpedVRTEx
GDALDatasetH GDALAutoCreateWarpedVRTEx(GDALDatasetH hSrcDS, const char *pszSrcWKT, const char *pszDstWKT, GDALResampleAlg eResampleAlg, double dfMaxError, const GDALWarpOptions *psOptions, CSLConstList papszTransformerOptions)
Create virtual warped dataset automatically.
Definition vrtwarped.cpp:139
GDALTransformerArgUniquePtr
std::unique_ptr< void, GDALTransformerUniquePtrReleaser > GDALTransformerArgUniquePtr
Unique pointer for the argument of a GDALTransformerFunc.
Definition gdalwarper.h:501
GDALWarpInitDefaultBandMapping
void GDALWarpInitDefaultBandMapping(GDALWarpOptions *, int nBandCount)
Init src and dst band mappings such that Bands[i] = i+1 for nBandCount Does nothing if psOptionsIn->n...
Definition gdalwarper.cpp:1882
GDALAutoCreateWarpedVRT
GDALDatasetH GDALAutoCreateWarpedVRT(GDALDatasetH hSrcDS, const char *pszSrcWKT, const char *pszDstWKT, GDALResampleAlg eResampleAlg, double dfMaxError, const GDALWarpOptions *psOptions)
Create virtual warped dataset automatically.
Definition vrtwarped.cpp:118
GDALWarpInitSrcNoDataImag
void GDALWarpInitSrcNoDataImag(GDALWarpOptions *, double dNoDataImag)
Initialize padfSrcNoDataImag with specified value.
Definition gdalwarper.cpp:1729
GDALInitializeWarpedVRT
CPLErr GDALInitializeWarpedVRT(GDALDatasetH hDS, GDALWarpOptions *psWO)
Set warp info on virtual warped dataset.
Definition vrtwarped.cpp:1340
GDALWarpInitSrcNoDataReal
void GDALWarpInitSrcNoDataReal(GDALWarpOptions *, double dNoDataReal)
Initialize padfSrcNoDataReal with specified value.
Definition gdalwarper.cpp:1672
GDALWarpInitDstNoDataReal
void GDALWarpInitDstNoDataReal(GDALWarpOptions *, double dNoDataReal)
Initialize padfDstNoDataReal with specified value.
Definition gdalwarper.cpp:1653
GDALReprojectImage
CPLErr GDALReprojectImage(GDALDatasetH hSrcDS, const char *pszSrcWKT, GDALDatasetH hDstDS, const char *pszDstWKT, GDALResampleAlg eResampleAlg, double dfWarpMemoryLimit, double dfMaxError, GDALProgressFunc pfnProgress, void *pProgressArg, GDALWarpOptions *psOptions)
Reproject image.
Definition gdalwarper.cpp:84
GDALChunkAndWarpMulti
CPLErr GDALChunkAndWarpMulti(GDALWarpOperationH, int, int, int, int)
Definition gdalwarpoperation.cpp:1349
GDALWarpGetOptionList
const char * GDALWarpGetOptionList(void)
Return a XML string describing options accepted by GDALWarpOptions::papszWarpOptions.
Definition gdalwarper.cpp:1084
GDALCreateWarpOptions
GDALWarpOptions * GDALCreateWarpOptions(void)
Create a warp options structure.
Definition gdalwarper.cpp:1524
GDALWarpInitNoDataReal
void GDALWarpInitNoDataReal(GDALWarpOptions *, double dNoDataReal)
Initialize padfSrcNoDataReal and padfDstNoDataReal with specified value.
Definition gdalwarper.cpp:1692
GDALGetWarpResampleAlg
bool GDALGetWarpResampleAlg(const char *pszResampling, GDALResampleAlg &eResampleAlg, bool bThrow=false)
Return a GDALResampleAlg from a string.
Definition gdalwarper.cpp:2452
GDALCloneWarpOptions
GDALWarpOptions * GDALCloneWarpOptions(const GDALWarpOptions *)
Clone a warp options structure.
Definition gdalwarper.cpp:1589
GDALWarpResolveWorkingDataType
void GDALWarpResolveWorkingDataType(GDALWarpOptions *)
If the working data type is unknown, this method will determine a valid working data type to support ...
Definition gdalwarper.cpp:1749
CPLXMLNode
Document node structure.
Definition cpl_minixml.h:54
GDALWarpOptions
Warp control options for use with GDALWarpOperation::Initialize()
Definition gdalwarper.h:134
GDALWarpOptions::nSrcAlphaBand
int nSrcAlphaBand
Definition gdalwarper.h:165
GDALWarpOptions::hDstDS
GDALDatasetH hDstDS
Definition gdalwarper.h:153
GDALWarpOptions::papszWarpOptions
char ** papszWarpOptions
A string list of additional options controlling the warp operation in name=value format.
Definition gdalwarper.h:136
GDALWarpOptions::padfDstNoDataImag
double * padfDstNoDataImag
Definition gdalwarper.h:184
GDALWarpOptions::pfnDstValidityMaskFunc
GDALMaskFunc pfnDstValidityMaskFunc
Unused.
Definition gdalwarper.h:220
GDALWarpOptions::padfSrcNoDataReal
double * padfSrcNoDataReal
Definition gdalwarper.h:172
GDALWarpOptions::pTransformerArg
void * pTransformerArg
Definition gdalwarper.h:197
GDALWarpOptions::eWorkingDataType
GDALDataType eWorkingDataType
Definition gdalwarper.h:146
GDALWarpOptions::pSrcValidityMaskFuncArg
void * pSrcValidityMaskFuncArg
Unused.
Definition gdalwarper.h:207
GDALWarpOptions::pDstDensityMaskFuncArg
void * pDstDensityMaskFuncArg
Unused.
Definition gdalwarper.h:217
GDALWarpOptions::panDstBands
int * panDstBands
Definition gdalwarper.h:162
GDALWarpOptions::dfCutlineBlendDist
double dfCutlineBlendDist
Definition gdalwarper.h:239
GDALWarpOptions::pfnProgress
GDALProgressFunc pfnProgress
Definition gdalwarper.h:188
GDALWarpOptions::pfnSrcDensityMaskFunc
GDALMaskFunc pfnSrcDensityMaskFunc
Unused.
Definition gdalwarper.h:210
GDALWarpOptions::hSrcDS
GDALDatasetH hSrcDS
Definition gdalwarper.h:149
GDALWarpOptions::pfnDstDensityMaskFunc
GDALMaskFunc pfnDstDensityMaskFunc
Unused.
Definition gdalwarper.h:215
GDALWarpOptions::pPreWarpProcessorArg
void * pPreWarpProcessorArg
Unused.
Definition gdalwarper.h:227
GDALWarpOptions::pProgressArg
void * pProgressArg
Definition gdalwarper.h:191
GDALWarpOptions::nDstAlphaBand
int nDstAlphaBand
Definition gdalwarper.h:168
GDALWarpOptions::panSrcBands
int * panSrcBands
Definition gdalwarper.h:159
GDALWarpOptions::pfnTransformer
GDALTransformerFunc pfnTransformer
Definition gdalwarper.h:194
GDALWarpOptions::nBandCount
int nBandCount
Definition gdalwarper.h:156
GDALWarpOptions::dfWarpMemoryLimit
double dfWarpMemoryLimit
Definition gdalwarper.h:139
GDALWarpOptions::pSrcDensityMaskFuncArg
void * pSrcDensityMaskFuncArg
Unused.
Definition gdalwarper.h:212
GDALWarpOptions::papfnSrcPerBandValidityMaskFunc
GDALMaskFunc * papfnSrcPerBandValidityMaskFunc
Unused.
Definition gdalwarper.h:200
GDALWarpOptions::eResampleAlg
GDALResampleAlg eResampleAlg
Definition gdalwarper.h:142
GDALWarpOptions::pfnSrcValidityMaskFunc
GDALMaskFunc pfnSrcValidityMaskFunc
Unused.
Definition gdalwarper.h:205
GDALWarpOptions::hCutline
void * hCutline
Definition gdalwarper.h:235
GDALWarpOptions::pDstValidityMaskFuncArg
void * pDstValidityMaskFuncArg
Unused.
Definition gdalwarper.h:222
GDALWarpOptions::eTieStrategy
GWKTieStrategy eTieStrategy
Tie-breaking method.
Definition gdalwarper.h:242
GDALWarpOptions::papSrcPerBandValidityMaskFuncArg
void ** papSrcPerBandValidityMaskFuncArg
Unused.
Definition gdalwarper.h:202
GDALWarpOptions::padfDstNoDataReal
double * padfDstNoDataReal
Definition gdalwarper.h:180
GDALWarpOptions::padfSrcNoDataImag
double * padfSrcNoDataImag
Definition gdalwarper.h:176
GDALWarpOptions::pPostWarpProcessorArg
void * pPostWarpProcessorArg
Unused.
Definition gdalwarper.h:232