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 enum
73{
GWKAOM_Average = 1, GWKAOM_Fmode = 2, GWKAOM_Imode = 3, GWKAOM_Max = 4, GWKAOM_Min = 5, GWKAOM_Quant = 6, GWKAOM_Sum = 7, GWKAOM_RMS = 8
82} GWKAverageOrModeAlg;
83
85 typedef int (*GDALMaskFunc)(void *pMaskFuncArg, int nBandCount,
86 GDALDataType eType, int nXOff, int nYOff,
87 int nXSize, int nYSize, GByte **papabyImageData,
88 int bMaskIsFloat, void *pMask);
89
90 CPLErr CPL_DLL GDALWarpNoDataMasker(void *pMaskFuncArg, int nBandCount,
91 GDALDataType eType, int nXOff, int nYOff,
92 int nXSize, int nYSize,
93 GByte **papabyImageData, int bMaskIsFloat,
94 void *pValidityMask, int *pbOutAllValid);
95
96 CPLErr CPL_DLL GDALWarpDstAlphaMasker(void *pMaskFuncArg, int nBandCount,
97 GDALDataType eType, int nXOff, int nYOff,
98 int nXSize, int nYSize,
99 GByte ** /*ppImageData */,
100 int bMaskIsFloat, void *pValidityMask);
101 CPLErr CPL_DLL GDALWarpSrcAlphaMasker(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 int *pbOutAllOpaque);
107
108 CPLErr CPL_DLL GDALWarpSrcMaskMasker(void *pMaskFuncArg, int nBandCount,
109 GDALDataType eType, int nXOff, int nYOff,
110 int nXSize, int nYSize,
111 GByte ** /*ppImageData */,
112 int bMaskIsFloat, void *pValidityMask);
113
114 CPLErr CPL_DLL GDALWarpCutlineMasker(void *pMaskFuncArg, int nBandCount,
115 GDALDataType eType, int nXOff, int nYOff,
116 int nXSize, int nYSize,
117 GByte ** /* ppImageData */,
118 int bMaskIsFloat, void *pValidityMask);
119
120/* GCMVF stands for GDALWARP_CUTLINE_MASKER_VALIDITY_FLAG */
121#define GCMVF_PARTIAL_INTERSECTION 0
122#define GCMVF_NO_INTERSECTION 1
123#define GCMVF_CHUNK_FULLY_WITHIN_CUTLINE 2
124 CPLErr CPL_DLL GDALWarpCutlineMaskerEx(void *pMaskFuncArg, int nBandCount,
125 GDALDataType eType, int nXOff, int nYOff,
126 int nXSize, int nYSize,
127 GByte ** /* ppImageData */,
128 int bMaskIsFloat, void *pValidityMask,
129 int *pnValidityFlag);
130
133/************************************************************************/
134/* GDALWarpOptions */
135/************************************************************************/
136
138 typedef struct
139{
140
141 char **papszWarpOptions;
142
144 double dfWarpMemoryLimit;
145
147 GDALResampleAlg eResampleAlg;
148
151 GDALDataType eWorkingDataType;
152
154 GDALDatasetH hSrcDS;
155
158 GDALDatasetH hDstDS;
159
161 int nBandCount;
162
164 int *panSrcBands;
165
167 int *panDstBands;
168
170 int nSrcAlphaBand;
171
173 int nDstAlphaBand;
174
177 double *padfSrcNoDataReal;
181 double *padfSrcNoDataImag;
182
185 double *padfDstNoDataReal;
189 double *padfDstNoDataImag;
190
193 GDALProgressFunc pfnProgress;
194
196 void *pProgressArg;
197
199 GDALTransformerFunc pfnTransformer;
200
202 void *pTransformerArg;
203
205 GDALMaskFunc *papfnSrcPerBandValidityMaskFunc;
207 void **papSrcPerBandValidityMaskFuncArg;
208
210 GDALMaskFunc pfnSrcValidityMaskFunc;
212 void *pSrcValidityMaskFuncArg;
213
215 GDALMaskFunc pfnSrcDensityMaskFunc;
217 void *pSrcDensityMaskFuncArg;
218
220 GDALMaskFunc pfnDstDensityMaskFunc;
222 void *pDstDensityMaskFuncArg;
223
225 GDALMaskFunc pfnDstValidityMaskFunc;
227 void *pDstValidityMaskFuncArg;
228
230 CPLErr (*pfnPreWarpChunkProcessor)(void *pKern, void *pArg);
232 void *pPreWarpProcessorArg;
233
235 CPLErr (*pfnPostWarpChunkProcessor)(void *pKern, void *pArg);
237 void *pPostWarpProcessorArg;
238
240 void *hCutline;
241
244 double dfCutlineBlendDist;
245
246} GDALWarpOptions;
247
248 GDALWarpOptions CPL_DLL *CPL_STDCALL GDALCreateWarpOptions(void);
249 void CPL_DLL CPL_STDCALL GDALDestroyWarpOptions(GDALWarpOptions *);
250 GDALWarpOptions CPL_DLL *CPL_STDCALL
251 GDALCloneWarpOptions(const GDALWarpOptions *);
252
253 void CPL_DLL CPL_STDCALL GDALWarpInitDstNoDataReal(GDALWarpOptions *,
254 double dNoDataReal);
255
256 void CPL_DLL CPL_STDCALL GDALWarpInitSrcNoDataReal(GDALWarpOptions *,
257 double dNoDataReal);
258
259 void CPL_DLL CPL_STDCALL GDALWarpInitNoDataReal(GDALWarpOptions *,
260 double dNoDataReal);
261
262 void CPL_DLL CPL_STDCALL GDALWarpInitDstNoDataImag(GDALWarpOptions *,
263 double dNoDataImag);
264
265 void CPL_DLL CPL_STDCALL GDALWarpInitSrcNoDataImag(GDALWarpOptions *,
266 double dNoDataImag);
267
268 void CPL_DLL CPL_STDCALL GDALWarpResolveWorkingDataType(GDALWarpOptions *);
269
270 void CPL_DLL CPL_STDCALL GDALWarpInitDefaultBandMapping(GDALWarpOptions *,
271 int nBandCount);
272
274 CPLXMLNode CPL_DLL *CPL_STDCALL
275GDALSerializeWarpOptions(const GDALWarpOptions *);
276 GDALWarpOptions CPL_DLL *CPL_STDCALL GDALDeserializeWarpOptions(CPLXMLNode *);
279/************************************************************************/
280/* GDALReprojectImage() */
281/************************************************************************/
282
283 CPLErr CPL_DLL CPL_STDCALL GDALReprojectImage(
284 GDALDatasetH hSrcDS, const char *pszSrcWKT, GDALDatasetH hDstDS,
285 const char *pszDstWKT, GDALResampleAlg eResampleAlg,
286 double dfWarpMemoryLimit, double dfMaxError, GDALProgressFunc pfnProgress,
287 void *pProgressArg, GDALWarpOptions *psOptions);
288
289 CPLErr CPL_DLL CPL_STDCALL GDALCreateAndReprojectImage(
290 GDALDatasetH hSrcDS, const char *pszSrcWKT, const char *pszDstFilename,
291 const char *pszDstWKT, GDALDriverH hDstDriver, char **papszCreateOptions,
292 GDALResampleAlg eResampleAlg, double dfWarpMemoryLimit, double dfMaxError,
293 GDALProgressFunc pfnProgress, void *pProgressArg,
294 GDALWarpOptions *psOptions);
295
296/************************************************************************/
297/* VRTWarpedDataset */
298/************************************************************************/
299
300 GDALDatasetH CPL_DLL CPL_STDCALL
301 GDALAutoCreateWarpedVRT(GDALDatasetH hSrcDS, const char *pszSrcWKT,
302 const char *pszDstWKT, GDALResampleAlg eResampleAlg,
303 double dfMaxError, const GDALWarpOptions *psOptions);
304
305 GDALDatasetH CPL_DLL CPL_STDCALL GDALAutoCreateWarpedVRTEx(
306 GDALDatasetH hSrcDS, const char *pszSrcWKT, const char *pszDstWKT,
307 GDALResampleAlg eResampleAlg, double dfMaxError,
308 const GDALWarpOptions *psOptions, CSLConstList papszTransformerOptions);
309
310 GDALDatasetH CPL_DLL CPL_STDCALL
311 GDALCreateWarpedVRT(GDALDatasetH hSrcDS, int nPixels, int nLines,
312 double *padfGeoTransform, GDALWarpOptions *psOptions);
313
314 CPLErr CPL_DLL CPL_STDCALL GDALInitializeWarpedVRT(GDALDatasetH hDS,
315 GDALWarpOptions *psWO);
316
317 CPL_C_END
318
319#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
320
321#include <vector>
322#include <utility>
323
324/************************************************************************/
325/* GDALWarpKernel */
326/* */
327
333#define WARP_EXTRA_ELTS 1
334
342 class CPL_DLL GDALWarpKernel
343{
344 CPL_DISALLOW_COPY_ASSIGN(GDALWarpKernel)
345
346 public:
348 char **papszWarpOptions;
349
351 GDALResampleAlg eResample;
353 GDALDataType eWorkingDataType;
355 int nBands;
356
358 int nSrcXSize;
360 int nSrcYSize;
363 double dfSrcXExtraSize;
366 double dfSrcYExtraSize;
369 GByte **papabySrcImage;
370
373 GUInt32 **papanBandSrcValid;
376 GUInt32 *panUnifiedSrcValid;
379 float *pafUnifiedSrcDensity;
380
382 int nDstXSize;
384 int nDstYSize;
386 GByte **papabyDstImage;
388 GUInt32 *panDstValid;
390 float *pafDstDensity;
391
393 double dfXScale;
395 double dfYScale;
397 double dfXFilter;
399 double dfYFilter;
401 int nXRadius;
403 int nYRadius;
405 int nFiltInitX;
407 int nFiltInitY;
408
411 int nSrcXOff;
414 int nSrcYOff;
415
418 int nDstXOff;
421 int nDstYOff;
422
424 GDALTransformerFunc pfnTransformer;
426 void *pTransformerArg;
427
429 GDALProgressFunc pfnProgress;
431 void *pProgress;
432
434 double dfProgressBase;
436 double dfProgressScale;
437
439 double *padfDstNoDataReal;
440
443 void *psThreadData;
444
445 bool bApplyVerticalShift = false;
446
447 double dfMultFactorVerticalShift = 1.0;
448
449 // Tuples of values (e.g. "<R>,<G>,<B>" or "(<R1>,<G1>,<B1>),(<R2>,<G2>,<B2>)") that must
450 // be ignored as contributing source pixels during resampling. Only taken into account by
451 // Average currently
452 std::vector<std::vector<double>> m_aadfExcludedValues{};
453
456 GDALWarpKernel();
457 virtual ~GDALWarpKernel();
458
459 CPLErr Validate();
460 CPLErr PerformWarp();
461};
462
464 void *GWKThreadsCreate(char **papszWarpOptions,
465 GDALTransformerFunc pfnTransformer,
466 void *pTransformerArg);
467 void GWKThreadsEnd(void *psThreadDataIn);
470/************************************************************************/
471/* GDALWarpOperation() */
472/* */
473/* This object is application created, or created by a higher */
474/* level convenience function. It is responsible for */
475/* subdividing the operation into chunks, loading and saving */
476/* imagery, and establishing the varios validity and density */
477/* masks. Actual resampling is done by the GDALWarpKernel. */
478/************************************************************************/
479
481 typedef struct _GDALWarpChunk GDALWarpChunk;
482
485 class CPL_DLL GDALWarpOperation
486{
487
488 CPL_DISALLOW_COPY_ASSIGN(GDALWarpOperation)
489
490 private:
491 GDALWarpOptions *psOptions;
492
493 void WipeOptions();
494 int ValidateOptions();
495
496 bool ComputeSourceWindowTransformPoints(
497 int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize, bool bUseGrid,
498 bool bAll, int nStepCount, bool bTryWithCheckWithInvertProj,
499 double &dfMinXOut, double &dfMinYOut, double &dfMaxXOut,
500 double &dfMaxYOut, int &nSamplePoints, int &nFailedCount);
501
502 void ComputeSourceWindowStartingFromSource(int nDstXOff, int nDstYOff,
503 int nDstXSize, int nDstYSize,
504 double *padfSrcMinX,
505 double *padfSrcMinY,
506 double *padfSrcMaxX,
507 double *padfSrcMaxY);
508
509 static CPLErr CreateKernelMask(GDALWarpKernel *, int iBand,
510 const char *pszType);
511
512 CPLMutex *hIOMutex;
513 CPLMutex *hWarpMutex;
514
515 int nChunkListCount;
516 int nChunkListMax;
517 GDALWarpChunk *pasChunkList;
518
519 int bReportTimings;
520 unsigned long nLastTimeReported;
521
522 void *psThreadData;
523
524 // Coordinates a few special points in target image space, to determine
525 // if ComputeSourceWindow() must use a grid based sampling.
526 std::vector<std::pair<double, double>> aDstXYSpecialPoints{};
527
528 bool m_bIsTranslationOnPixelBoundaries = false;
529
530 void WipeChunkList();
531 CPLErr CollectChunkListInternal(int nDstXOff, int nDstYOff, int nDstXSize,
532 int nDstYSize);
533 void CollectChunkList(int nDstXOff, int nDstYOff, int nDstXSize,
534 int nDstYSize);
535 void ReportTiming(const char *);
536
537 public:
538 GDALWarpOperation();
539 virtual ~GDALWarpOperation();
540
541 CPLErr Initialize(const GDALWarpOptions *psNewOptions);
542 void *CreateDestinationBuffer(int nDstXSize, int nDstYSize,
543 int *pbWasInitialized = nullptr);
544 void InitializeDestinationBuffer(void *pDstBuffer, int nDstXSize,
545 int nDstYSize,
546 int *pbWasInitialized = nullptr);
547 static void DestroyDestinationBuffer(void *pDstBuffer);
548
549 const GDALWarpOptions *GetOptions();
550
551 CPLErr ChunkAndWarpImage(int nDstXOff, int nDstYOff, int nDstXSize,
552 int nDstYSize);
553 CPLErr ChunkAndWarpMulti(int nDstXOff, int nDstYOff, int nDstXSize,
554 int nDstYSize);
555 CPLErr WarpRegion(int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize,
556 int nSrcXOff = 0, int nSrcYOff = 0, int nSrcXSize = 0,
557 int nSrcYSize = 0, double dfProgressBase = 0.0,
558 double dfProgressScale = 1.0);
559 CPLErr WarpRegion(int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize,
560 int nSrcXOff, int nSrcYOff, int nSrcXSize, int nSrcYSize,
561 double dfSrcXExtraSize, double dfSrcYExtraSize,
562 double dfProgressBase, double dfProgressScale);
563 CPLErr WarpRegionToBuffer(int nDstXOff, int nDstYOff, int nDstXSize,
564 int nDstYSize, void *pDataBuf,
565 GDALDataType eBufDataType, int nSrcXOff = 0,
566 int nSrcYOff = 0, int nSrcXSize = 0,
567 int nSrcYSize = 0, double dfProgressBase = 0.0,
568 double dfProgressScale = 1.0);
569 CPLErr WarpRegionToBuffer(int nDstXOff, int nDstYOff, int nDstXSize,
570 int nDstYSize, void *pDataBuf,
571 GDALDataType eBufDataType, int nSrcXOff,
572 int nSrcYOff, int nSrcXSize, int nSrcYSize,
573 double dfSrcXExtraSize, double dfSrcYExtraSize,
574 double dfProgressBase, double dfProgressScale);
575
576 protected:
577 friend class VRTWarpedDataset;
578 CPLErr ComputeSourceWindow(int nDstXOff, int nDstYOff, int nDstXSize,
579 int nDstYSize, int *pnSrcXOff, int *pnSrcYOff,
580 int *pnSrcXSize, int *pnSrcYSize,
581 double *pdfSrcXExtraSize,
582 double *pdfSrcYExtraSize,
583 double *pdfSrcFillRatio);
584
585 double GetWorkingMemoryForWindow(int nSrcXSize, int nSrcYSize,
586 int nDstXSize, int nDstYSize) const;
587};
588
589#endif /* def __cplusplus */
590
591 CPL_C_START
592
594 typedef void *GDALWarpOperationH;
595
596 GDALWarpOperationH CPL_DLL GDALCreateWarpOperation(const GDALWarpOptions *);
597 void CPL_DLL GDALDestroyWarpOperation(GDALWarpOperationH);
598 CPLErr CPL_DLL GDALChunkAndWarpImage(GDALWarpOperationH, int, int, int, int);
599 CPLErr CPL_DLL GDALChunkAndWarpMulti(GDALWarpOperationH, int, int, int, int);
600 CPLErr CPL_DLL GDALWarpRegion(GDALWarpOperationH, int, int, int, int, int, int,
601 int, int);
602 CPLErr CPL_DLL GDALWarpRegionToBuffer(GDALWarpOperationH, int, int, int, int,
603 void *, GDALDataType, int, int, int, int);
604
605/************************************************************************/
606/* Warping kernel functions */
607/************************************************************************/
608
610 int GWKGetFilterRadius(GDALResampleAlg eResampleAlg);
611
612 typedef double (*FilterFuncType)(double dfX);
613FilterFuncType GWKGetFilterFunc(GDALResampleAlg eResampleAlg);
614
615// TODO(schwehr): Can padfVals be a const pointer?
616 typedef double (*FilterFunc4ValuesType)(double *padfVals);
617FilterFunc4ValuesType GWKGetFilterFunc4Values(GDALResampleAlg eResampleAlg);
620 CPL_C_END
621
622#endif /* ndef GDAL_ALG_H_INCLUDED */
GDALWarpKernel
This class represents the lowest level of abstraction of warping.
Definition gdalwarper.h:343
GDALWarpKernel::nXRadius
int nXRadius
X size of window to filter.
Definition gdalwarper.h:401
GDALWarpKernel::nSrcYSize
int nSrcYSize
Height of the source image.
Definition gdalwarper.h:360
GDALWarpKernel::papszWarpOptions
char ** papszWarpOptions
Warp options.
Definition gdalwarper.h:348
GDALWarpKernel::nFiltInitX
int nFiltInitX
X filtering offset.
Definition gdalwarper.h:405
GDALWarpKernel::dfXScale
double dfXScale
X resampling scale, i.e.
Definition gdalwarper.h:393
GDALWarpKernel::dfYFilter
double dfYFilter
Y size of filter kernel.
Definition gdalwarper.h:399
GDALWarpKernel::nDstXSize
int nDstXSize
Width of the destination image.
Definition gdalwarper.h:382
GDALWarpKernel::dfSrcXExtraSize
double dfSrcXExtraSize
Extra pixels (included in nSrcXSize) reserved for filter window.
Definition gdalwarper.h:363
GDALWarpKernel::padfDstNoDataReal
double * padfDstNoDataReal
Array of nBands value for destination nodata.
Definition gdalwarper.h:439
GDALWarpKernel::nDstXOff
int nDstXOff
X offset of the destination buffer regarding the top-left corner of the image.
Definition gdalwarper.h:418
GDALWarpKernel::eResample
GDALResampleAlg eResample
Resample algorithm.
Definition gdalwarper.h:351
GDALWarpKernel::pfnTransformer
GDALTransformerFunc pfnTransformer
Pixel transformation function.
Definition gdalwarper.h:424
GDALWarpKernel::panUnifiedSrcValid
GUInt32 * panUnifiedSrcValid
Unified validity mask of size (nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS) / 8.
Definition gdalwarper.h:376
GDALWarpKernel::nDstYSize
int nDstYSize
Height of the destination image.
Definition gdalwarper.h:384
GDALWarpKernel::nBands
int nBands
Number of input and output bands (excluding alpha bands)
Definition gdalwarper.h:355
GDALWarpKernel::dfProgressBase
double dfProgressBase
Base/offset value for progress computation.
Definition gdalwarper.h:434
GDALWarpKernel::eWorkingDataType
GDALDataType eWorkingDataType
Working data type.
Definition gdalwarper.h:353
GDALWarpKernel::dfSrcYExtraSize
double dfSrcYExtraSize
Extra pixels (included in nSrcYSize) reserved for filter window.
Definition gdalwarper.h:366
GDALWarpKernel::nSrcXOff
int nSrcXOff
X offset of the source buffer regarding the top-left corner of the image.
Definition gdalwarper.h:411
GDALWarpKernel::nSrcYOff
int nSrcYOff
Y offset of the source buffer regarding the top-left corner of the image.
Definition gdalwarper.h:414
GDALWarpKernel::nDstYOff
int nDstYOff
Y offset of the destination buffer regarding the top-left corner of the image.
Definition gdalwarper.h:421
GDALWarpKernel::nFiltInitY
int nFiltInitY
Y filtering offset.
Definition gdalwarper.h:407
GDALWarpKernel::pfnProgress
GDALProgressFunc pfnProgress
Progress function.
Definition gdalwarper.h:429
GDALWarpKernel::papanBandSrcValid
GUInt32 ** papanBandSrcValid
Array of nBands validity mask of size (nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS) / 8.
Definition gdalwarper.h:373
GDALWarpKernel::pProgress
void * pProgress
User data provided to pfnProgress.
Definition gdalwarper.h:431
GDALWarpKernel::pafUnifiedSrcDensity
float * pafUnifiedSrcDensity
Unified source density of size nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS.
Definition gdalwarper.h:379
GDALWarpKernel::nYRadius
int nYRadius
Y size of window to filter.
Definition gdalwarper.h:403
GDALWarpKernel::pafDstDensity
float * pafDstDensity
Destination density of size nDstXSize * nDstYSize.
Definition gdalwarper.h:390
GDALWarpKernel::dfXFilter
double dfXFilter
X size of filter kernel.
Definition gdalwarper.h:397
GDALWarpKernel::dfYScale
double dfYScale
Y resampling scale, i.e.
Definition gdalwarper.h:395
GDALWarpKernel::papabyDstImage
GByte ** papabyDstImage
Array of nBands destination images of size nDstXSize * nDstYSize.
Definition gdalwarper.h:386
GDALWarpKernel::dfProgressScale
double dfProgressScale
Scale value for progress computation.
Definition gdalwarper.h:436
GDALWarpKernel::nSrcXSize
int nSrcXSize
Width of the source image.
Definition gdalwarper.h:358
GDALWarpKernel::pTransformerArg
void * pTransformerArg
User data provided to pfnTransformer.
Definition gdalwarper.h:426
GDALWarpKernel::papabySrcImage
GByte ** papabySrcImage
Array of nBands source images of size nSrcXSize * nSrcYSize.
Definition gdalwarper.h:369
GDALWarpKernel::panDstValid
GUInt32 * panDstValid
Validify mask of size (nDstXSize * nDstYSize) / 8.
Definition gdalwarper.h:388
GDALWarpOperation
High level image warping class.
Definition gdalwarper.h:486
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:283
CPL_C_START
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:279
GUInt32
unsigned int GUInt32
Unsigned int32 type.
Definition cpl_port.h:161
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:1030
CSLConstList
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1179
GByte
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:169
GDALDataType
GDALDataType
Definition gdal.h:48
GDALDatasetH
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition gdal.h:376
GDALDriverH
void * GDALDriverH
Opaque type used for the C bindings of the C++ GDALDriver class.
Definition gdal.h:382
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
GDALWarpRegion
CPLErr GDALWarpRegion(GDALWarpOperationH, int, int, int, int, int, int, int, int)
Definition gdalwarpoperation.cpp:1725
GDALDestroyWarpOperation
void GDALDestroyWarpOperation(GDALWarpOperationH)
Definition gdalwarpoperation.cpp:836
GDALCreateWarpOperation
GDALWarpOperationH GDALCreateWarpOperation(const GDALWarpOptions *)
Definition gdalwarpoperation.cpp:816
GWKAverageOrModeAlg
GWKAverageOrModeAlg
Definition gdalwarper.h:73
GWKAOM_Fmode
@ GWKAOM_Fmode
Definition gdalwarper.h:75
GWKAOM_Min
@ GWKAOM_Min
Definition gdalwarper.h:78
GWKAOM_RMS
@ GWKAOM_RMS
Definition gdalwarper.h:81
GWKAOM_Quant
@ GWKAOM_Quant
Definition gdalwarper.h:79
GWKAOM_Sum
@ GWKAOM_Sum
Definition gdalwarper.h:80
GWKAOM_Imode
@ GWKAOM_Imode
Definition gdalwarper.h:76
GWKAOM_Average
@ GWKAOM_Average
Definition gdalwarper.h:74
GWKAOM_Max
@ GWKAOM_Max
Definition gdalwarper.h:77
GDALWarpInitDstNoDataImag
void GDALWarpInitDstNoDataImag(GDALWarpOptions *, double dNoDataImag)
Initialize padfDstNoDataImag with specified value.
Definition gdalwarper.cpp:1483
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
GDALCreateWarpedVRT
GDALDatasetH GDALCreateWarpedVRT(GDALDatasetH hSrcDS, int nPixels, int nLines, double *padfGeoTransform, GDALWarpOptions *psOptions)
Create virtual warped dataset.
Definition vrtwarped.cpp:372
GDALDestroyWarpOptions
void GDALDestroyWarpOptions(GDALWarpOptions *)
Destroy a warp options structure.
Definition gdalwarper.cpp:1317
GDALWarpOperationH
void * GDALWarpOperationH
Opaque type representing a GDALWarpOperation object.
Definition gdalwarper.h:594
GDALWarpRegionToBuffer
CPLErr GDALWarpRegionToBuffer(GDALWarpOperationH, int, int, int, int, void *, GDALDataType, int, int, int, int)
Definition gdalwarpoperation.cpp:2354
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:220
GDALChunkAndWarpImage
CPLErr GDALChunkAndWarpImage(GDALWarpOperationH, int, int, int, int)
Definition gdalwarpoperation.cpp:1002
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
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:1654
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:1502
GDALInitializeWarpedVRT
CPLErr GDALInitializeWarpedVRT(GDALDatasetH hDS, GDALWarpOptions *psWO)
Set warp info on virtual warped dataset.
Definition vrtwarped.cpp:1334
GDALWarpInitSrcNoDataReal
void GDALWarpInitSrcNoDataReal(GDALWarpOptions *, double dNoDataReal)
Initialize padfSrcNoDataReal with specified value.
Definition gdalwarper.cpp:1445
GDALWarpInitDstNoDataReal
void GDALWarpInitDstNoDataReal(GDALWarpOptions *, double dNoDataReal)
Initialize padfDstNoDataReal with specified value.
Definition gdalwarper.cpp:1426
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:83
GDALChunkAndWarpMulti
CPLErr GDALChunkAndWarpMulti(GDALWarpOperationH, int, int, int, int)
Definition gdalwarpoperation.cpp:1244
GDALCreateWarpOptions
GDALWarpOptions * GDALCreateWarpOptions(void)
Create a warp options structure.
Definition gdalwarper.cpp:1298
GDALWarpInitNoDataReal
void GDALWarpInitNoDataReal(GDALWarpOptions *, double dNoDataReal)
Initialize padfSrcNoDataReal and padfDstNoDataReal with specified value.
Definition gdalwarper.cpp:1465
GDALCloneWarpOptions
GDALWarpOptions * GDALCloneWarpOptions(const GDALWarpOptions *)
Clone a warp options structure.
Definition gdalwarper.cpp:1362
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:1522
CPLXMLNode
Document node structure.
Definition cpl_minixml.h:55
GDALWarpOptions
Warp control options for use with GDALWarpOperation::Initialize()
Definition gdalwarper.h:139
GDALWarpOptions::nSrcAlphaBand
int nSrcAlphaBand
Definition gdalwarper.h:170
GDALWarpOptions::hDstDS
GDALDatasetH hDstDS
Definition gdalwarper.h:158
GDALWarpOptions::papszWarpOptions
char ** papszWarpOptions
A string list of additional options controlling the warp operation in name=value format.
Definition gdalwarper.h:141
GDALWarpOptions::padfDstNoDataImag
double * padfDstNoDataImag
Definition gdalwarper.h:189
GDALWarpOptions::pfnDstValidityMaskFunc
GDALMaskFunc pfnDstValidityMaskFunc
Unused.
Definition gdalwarper.h:225
GDALWarpOptions::padfSrcNoDataReal
double * padfSrcNoDataReal
Definition gdalwarper.h:177
GDALWarpOptions::pTransformerArg
void * pTransformerArg
Definition gdalwarper.h:202
GDALWarpOptions::eWorkingDataType
GDALDataType eWorkingDataType
Definition gdalwarper.h:151
GDALWarpOptions::pSrcValidityMaskFuncArg
void * pSrcValidityMaskFuncArg
Unused.
Definition gdalwarper.h:212
GDALWarpOptions::pDstDensityMaskFuncArg
void * pDstDensityMaskFuncArg
Unused.
Definition gdalwarper.h:222
GDALWarpOptions::panDstBands
int * panDstBands
Definition gdalwarper.h:167
GDALWarpOptions::dfCutlineBlendDist
double dfCutlineBlendDist
Definition gdalwarper.h:244
GDALWarpOptions::pfnProgress
GDALProgressFunc pfnProgress
Definition gdalwarper.h:193
GDALWarpOptions::pfnSrcDensityMaskFunc
GDALMaskFunc pfnSrcDensityMaskFunc
Unused.
Definition gdalwarper.h:215
GDALWarpOptions::hSrcDS
GDALDatasetH hSrcDS
Definition gdalwarper.h:154
GDALWarpOptions::pfnDstDensityMaskFunc
GDALMaskFunc pfnDstDensityMaskFunc
Unused.
Definition gdalwarper.h:220
GDALWarpOptions::pPreWarpProcessorArg
void * pPreWarpProcessorArg
Unused.
Definition gdalwarper.h:232
GDALWarpOptions::pProgressArg
void * pProgressArg
Definition gdalwarper.h:196
GDALWarpOptions::nDstAlphaBand
int nDstAlphaBand
Definition gdalwarper.h:173
GDALWarpOptions::panSrcBands
int * panSrcBands
Definition gdalwarper.h:164
GDALWarpOptions::pfnTransformer
GDALTransformerFunc pfnTransformer
Definition gdalwarper.h:199
GDALWarpOptions::nBandCount
int nBandCount
Definition gdalwarper.h:161
GDALWarpOptions::dfWarpMemoryLimit
double dfWarpMemoryLimit
Definition gdalwarper.h:144
GDALWarpOptions::pSrcDensityMaskFuncArg
void * pSrcDensityMaskFuncArg
Unused.
Definition gdalwarper.h:217
GDALWarpOptions::papfnSrcPerBandValidityMaskFunc
GDALMaskFunc * papfnSrcPerBandValidityMaskFunc
Unused.
Definition gdalwarper.h:205
GDALWarpOptions::eResampleAlg
GDALResampleAlg eResampleAlg
Definition gdalwarper.h:147
GDALWarpOptions::pfnSrcValidityMaskFunc
GDALMaskFunc pfnSrcValidityMaskFunc
Unused.
Definition gdalwarper.h:210
GDALWarpOptions::hCutline
void * hCutline
Definition gdalwarper.h:240
GDALWarpOptions::pDstValidityMaskFuncArg
void * pDstValidityMaskFuncArg
Unused.
Definition gdalwarper.h:227
GDALWarpOptions::papSrcPerBandValidityMaskFuncArg
void ** papSrcPerBandValidityMaskFuncArg
Unused.
Definition gdalwarper.h:207
GDALWarpOptions::padfDstNoDataReal
double * padfDstNoDataReal
Definition gdalwarper.h:185
GDALWarpOptions::padfSrcNoDataImag
double * padfSrcNoDataImag
Definition gdalwarper.h:181
GDALWarpOptions::pPostWarpProcessorArg
void * pPostWarpProcessorArg
Unused.
Definition gdalwarper.h:237