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 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
21 *
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28 * DEALINGS IN THE SOFTWARE.
29 ****************************************************************************/
30
31#ifndef GDALWARPER_H_INCLUDED
32#define GDALWARPER_H_INCLUDED
33
42#include "gdal_alg.h"
43#include "cpl_minixml.h"
44#include "cpl_multiproc.h"
45
46 CPL_C_START
47
48/* Note: values are selected to be consistent with GDALRIOResampleAlg of
49 * gcore/gdal.h */
51 typedef enum
52{ GRA_NearestNeighbour =
54 0, GRA_Bilinear = 1, GRA_Cubic = 2, GRA_CubicSpline = 3, GRA_Lanczos = 4,
61 GRA_Average = 5,
64 GRA_Mode = 6,
65 /* GRA_Gauss=7 reserved. */ GRA_Max =
67 8, GRA_Min =
69 9, GRA_Med =
71 10,
73 GRA_Q1 = 11,
75 GRA_Q3 = 12,
78 GRA_Sum = 13,
81 GRA_RMS = 14,
83 GRA_LAST_VALUE = GRA_RMS
85} GDALResampleAlg;
86
88 typedef enum
89{ GWKAOM_Average = 1, GWKAOM_Fmode = 2, GWKAOM_Imode = 3, GWKAOM_Max = 4, GWKAOM_Min = 5, GWKAOM_Quant = 6, GWKAOM_Sum = 7, GWKAOM_RMS = 8
98} GWKAverageOrModeAlg;
99
101typedef int (*GDALMaskFunc)(void *pMaskFuncArg, int nBandCount,
102 GDALDataType eType, int nXOff, int nYOff,
103 int nXSize, int nYSize, GByte **papabyImageData,
104 int bMaskIsFloat, void *pMask);
105
106 CPLErr CPL_DLL GDALWarpNoDataMasker(void *pMaskFuncArg, int nBandCount,
107 GDALDataType eType, int nXOff, int nYOff,
108 int nXSize, int nYSize,
109 GByte **papabyImageData, int bMaskIsFloat,
110 void *pValidityMask, int *pbOutAllValid);
111
112 CPLErr CPL_DLL GDALWarpDstAlphaMasker(void *pMaskFuncArg, int nBandCount,
113 GDALDataType eType, int nXOff, int nYOff,
114 int nXSize, int nYSize,
115 GByte ** /*ppImageData */,
116 int bMaskIsFloat, void *pValidityMask);
117 CPLErr CPL_DLL GDALWarpSrcAlphaMasker(void *pMaskFuncArg, int nBandCount,
118 GDALDataType eType, int nXOff, int nYOff,
119 int nXSize, int nYSize,
120 GByte ** /*ppImageData */,
121 int bMaskIsFloat, void *pValidityMask,
122 int *pbOutAllOpaque);
123
124 CPLErr CPL_DLL GDALWarpSrcMaskMasker(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
130 CPLErr CPL_DLL GDALWarpCutlineMasker(void *pMaskFuncArg, int nBandCount,
131 GDALDataType eType, int nXOff, int nYOff,
132 int nXSize, int nYSize,
133 GByte ** /* ppImageData */,
134 int bMaskIsFloat, void *pValidityMask);
135
136/* GCMVF stands for GDALWARP_CUTLINE_MASKER_VALIDITY_FLAG */
137#define GCMVF_PARTIAL_INTERSECTION 0
138#define GCMVF_NO_INTERSECTION 1
139#define GCMVF_CHUNK_FULLY_WITHIN_CUTLINE 2
140 CPLErr CPL_DLL GDALWarpCutlineMaskerEx(void *pMaskFuncArg, int nBandCount,
141 GDALDataType eType, int nXOff, int nYOff,
142 int nXSize, int nYSize,
143 GByte ** /* ppImageData */,
144 int bMaskIsFloat, void *pValidityMask,
145 int *pnValidityFlag);
146
149/************************************************************************/
150/* GDALWarpOptions */
151/************************************************************************/
152
154 typedef struct
155{
156
157 char **papszWarpOptions;
158
160 double dfWarpMemoryLimit;
161
163 GDALResampleAlg eResampleAlg;
164
167 GDALDataType eWorkingDataType;
168
170 GDALDatasetH hSrcDS;
171
174 GDALDatasetH hDstDS;
175
177 int nBandCount;
178
180 int *panSrcBands;
181
183 int *panDstBands;
184
186 int nSrcAlphaBand;
187
189 int nDstAlphaBand;
190
193 double *padfSrcNoDataReal;
197 double *padfSrcNoDataImag;
198
201 double *padfDstNoDataReal;
205 double *padfDstNoDataImag;
206
209 GDALProgressFunc pfnProgress;
210
212 void *pProgressArg;
213
215 GDALTransformerFunc pfnTransformer;
216
218 void *pTransformerArg;
219
221 GDALMaskFunc *papfnSrcPerBandValidityMaskFunc;
223 void **papSrcPerBandValidityMaskFuncArg;
224
226 GDALMaskFunc pfnSrcValidityMaskFunc;
228 void *pSrcValidityMaskFuncArg;
229
231 GDALMaskFunc pfnSrcDensityMaskFunc;
233 void *pSrcDensityMaskFuncArg;
234
236 GDALMaskFunc pfnDstDensityMaskFunc;
238 void *pDstDensityMaskFuncArg;
239
241 GDALMaskFunc pfnDstValidityMaskFunc;
243 void *pDstValidityMaskFuncArg;
244
246 CPLErr (*pfnPreWarpChunkProcessor)(void *pKern, void *pArg);
248 void *pPreWarpProcessorArg;
249
251 CPLErr (*pfnPostWarpChunkProcessor)(void *pKern, void *pArg);
253 void *pPostWarpProcessorArg;
254
256 void *hCutline;
257
260 double dfCutlineBlendDist;
261
262} GDALWarpOptions;
263
264 GDALWarpOptions CPL_DLL *CPL_STDCALL GDALCreateWarpOptions(void);
265void CPL_DLL CPL_STDCALL GDALDestroyWarpOptions(GDALWarpOptions *);
266 GDALWarpOptions CPL_DLL *CPL_STDCALL
267 GDALCloneWarpOptions(const GDALWarpOptions *);
268
269void CPL_DLL CPL_STDCALL GDALWarpInitDstNoDataReal(GDALWarpOptions *,
270 double dNoDataReal);
271
272void CPL_DLL CPL_STDCALL GDALWarpInitSrcNoDataReal(GDALWarpOptions *,
273 double dNoDataReal);
274
275void CPL_DLL CPL_STDCALL GDALWarpInitNoDataReal(GDALWarpOptions *,
276 double dNoDataReal);
277
278void CPL_DLL CPL_STDCALL GDALWarpInitDstNoDataImag(GDALWarpOptions *,
279 double dNoDataImag);
280
281void CPL_DLL CPL_STDCALL GDALWarpInitSrcNoDataImag(GDALWarpOptions *,
282 double dNoDataImag);
283
284void CPL_DLL CPL_STDCALL GDALWarpResolveWorkingDataType(GDALWarpOptions *);
285
286void CPL_DLL CPL_STDCALL GDALWarpInitDefaultBandMapping(GDALWarpOptions *,
287 int nBandCount);
288
290 CPLXMLNode CPL_DLL *CPL_STDCALL
291GDALSerializeWarpOptions(const GDALWarpOptions *);
292 GDALWarpOptions CPL_DLL *CPL_STDCALL GDALDeserializeWarpOptions(CPLXMLNode *);
295/************************************************************************/
296/* GDALReprojectImage() */
297/************************************************************************/
298
299 CPLErr CPL_DLL CPL_STDCALL GDALReprojectImage(
300 GDALDatasetH hSrcDS, const char *pszSrcWKT, GDALDatasetH hDstDS,
301 const char *pszDstWKT, GDALResampleAlg eResampleAlg,
302 double dfWarpMemoryLimit, double dfMaxError, GDALProgressFunc pfnProgress,
303 void *pProgressArg, GDALWarpOptions *psOptions);
304
305 CPLErr CPL_DLL CPL_STDCALL GDALCreateAndReprojectImage(
306 GDALDatasetH hSrcDS, const char *pszSrcWKT, const char *pszDstFilename,
307 const char *pszDstWKT, GDALDriverH hDstDriver, char **papszCreateOptions,
308 GDALResampleAlg eResampleAlg, double dfWarpMemoryLimit, double dfMaxError,
309 GDALProgressFunc pfnProgress, void *pProgressArg,
310 GDALWarpOptions *psOptions);
311
312/************************************************************************/
313/* VRTWarpedDataset */
314/************************************************************************/
315
316 GDALDatasetH CPL_DLL CPL_STDCALL
317 GDALAutoCreateWarpedVRT(GDALDatasetH hSrcDS, const char *pszSrcWKT,
318 const char *pszDstWKT, GDALResampleAlg eResampleAlg,
319 double dfMaxError, const GDALWarpOptions *psOptions);
320
321 GDALDatasetH CPL_DLL CPL_STDCALL GDALAutoCreateWarpedVRTEx(
322 GDALDatasetH hSrcDS, const char *pszSrcWKT, const char *pszDstWKT,
323 GDALResampleAlg eResampleAlg, double dfMaxError,
324 const GDALWarpOptions *psOptions, CSLConstList papszTransformerOptions);
325
326 GDALDatasetH CPL_DLL CPL_STDCALL
327 GDALCreateWarpedVRT(GDALDatasetH hSrcDS, int nPixels, int nLines,
328 double *padfGeoTransform, GDALWarpOptions *psOptions);
329
330 CPLErr CPL_DLL CPL_STDCALL GDALInitializeWarpedVRT(GDALDatasetH hDS,
331 GDALWarpOptions *psWO);
332
333 CPL_C_END
334
335#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
336
337#include <vector>
338#include <utility>
339
340/************************************************************************/
341/* GDALWarpKernel */
342/* */
343
349#define WARP_EXTRA_ELTS 1
350
358 class CPL_DLL GDALWarpKernel
359{
360 CPL_DISALLOW_COPY_ASSIGN(GDALWarpKernel)
361
362 public:
364 char **papszWarpOptions;
365
367 GDALResampleAlg eResample;
369 GDALDataType eWorkingDataType;
371 int nBands;
372
374 int nSrcXSize;
376 int nSrcYSize;
379 double dfSrcXExtraSize;
382 double dfSrcYExtraSize;
385 GByte **papabySrcImage;
386
389 GUInt32 **papanBandSrcValid;
392 GUInt32 *panUnifiedSrcValid;
395 float *pafUnifiedSrcDensity;
396
398 int nDstXSize;
400 int nDstYSize;
402 GByte **papabyDstImage;
404 GUInt32 *panDstValid;
406 float *pafDstDensity;
407
409 double dfXScale;
411 double dfYScale;
413 double dfXFilter;
415 double dfYFilter;
417 int nXRadius;
419 int nYRadius;
421 int nFiltInitX;
423 int nFiltInitY;
424
427 int nSrcXOff;
430 int nSrcYOff;
431
434 int nDstXOff;
437 int nDstYOff;
438
440 GDALTransformerFunc pfnTransformer;
442 void *pTransformerArg;
443
445 GDALProgressFunc pfnProgress;
447 void *pProgress;
448
450 double dfProgressBase;
452 double dfProgressScale;
453
455 double *padfDstNoDataReal;
456
459 void *psThreadData;
460
461 bool bApplyVerticalShift = false;
462
463 double dfMultFactorVerticalShift = 1.0;
464
465 // Tuples of values (e.g. "<R>,<G>,<B>" or "(<R1>,<G1>,<B1>),(<R2>,<G2>,<B2>)") that must
466 // be ignored as contributing source pixels during resampling. Only taken into account by
467 // Average currently
468 std::vector<std::vector<double>> m_aadfExcludedValues{};
469
472 GDALWarpKernel();
473 virtual ~GDALWarpKernel();
474
475 CPLErr Validate();
476 CPLErr PerformWarp();
477};
478
480void *GWKThreadsCreate(char **papszWarpOptions,
481 GDALTransformerFunc pfnTransformer,
482 void *pTransformerArg);
483void GWKThreadsEnd(void *psThreadDataIn);
486/************************************************************************/
487/* GDALWarpOperation() */
488/* */
489/* This object is application created, or created by a higher */
490/* level convenience function. It is responsible for */
491/* subdividing the operation into chunks, loading and saving */
492/* imagery, and establishing the varios validity and density */
493/* masks. Actual resampling is done by the GDALWarpKernel. */
494/************************************************************************/
495
497typedef struct _GDALWarpChunk GDALWarpChunk;
498
501 class CPL_DLL GDALWarpOperation
502{
503
504 CPL_DISALLOW_COPY_ASSIGN(GDALWarpOperation)
505
506 private:
507 GDALWarpOptions *psOptions;
508
509 void WipeOptions();
510 int ValidateOptions();
511
512 bool ComputeSourceWindowTransformPoints(
513 int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize, bool bUseGrid,
514 bool bAll, int nStepCount, bool bTryWithCheckWithInvertProj,
515 double &dfMinXOut, double &dfMinYOut, double &dfMaxXOut,
516 double &dfMaxYOut, int &nSamplePoints, int &nFailedCount);
517
518 void ComputeSourceWindowStartingFromSource(int nDstXOff, int nDstYOff,
519 int nDstXSize, int nDstYSize,
520 double *padfSrcMinX,
521 double *padfSrcMinY,
522 double *padfSrcMaxX,
523 double *padfSrcMaxY);
524
525 static CPLErr CreateKernelMask(GDALWarpKernel *, int iBand,
526 const char *pszType);
527
528 CPLMutex *hIOMutex;
529 CPLMutex *hWarpMutex;
530
531 int nChunkListCount;
532 int nChunkListMax;
533 GDALWarpChunk *pasChunkList;
534
535 int bReportTimings;
536 unsigned long nLastTimeReported;
537
538 void *psThreadData;
539
540 // Coordinates a few special points in target image space, to determine
541 // if ComputeSourceWindow() must use a grid based sampling.
542 std::vector<std::pair<double, double>> aDstXYSpecialPoints{};
543
544 bool m_bIsTranslationOnPixelBoundaries = false;
545
546 void WipeChunkList();
547 CPLErr CollectChunkListInternal(int nDstXOff, int nDstYOff, int nDstXSize,
548 int nDstYSize);
549 void CollectChunkList(int nDstXOff, int nDstYOff, int nDstXSize,
550 int nDstYSize);
551 void ReportTiming(const char *);
552
553 public:
554 GDALWarpOperation();
555 virtual ~GDALWarpOperation();
556
557 CPLErr Initialize(const GDALWarpOptions *psNewOptions);
558 void *CreateDestinationBuffer(int nDstXSize, int nDstYSize,
559 int *pbWasInitialized = nullptr);
560 static void DestroyDestinationBuffer(void *pDstBuffer);
561
562 const GDALWarpOptions *GetOptions();
563
564 CPLErr ChunkAndWarpImage(int nDstXOff, int nDstYOff, int nDstXSize,
565 int nDstYSize);
566 CPLErr ChunkAndWarpMulti(int nDstXOff, int nDstYOff, int nDstXSize,
567 int nDstYSize);
568 CPLErr WarpRegion(int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize,
569 int nSrcXOff = 0, int nSrcYOff = 0, int nSrcXSize = 0,
570 int nSrcYSize = 0, double dfProgressBase = 0.0,
571 double dfProgressScale = 1.0);
572 CPLErr WarpRegion(int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize,
573 int nSrcXOff, int nSrcYOff, int nSrcXSize, int nSrcYSize,
574 double dfSrcXExtraSize, double dfSrcYExtraSize,
575 double dfProgressBase, double dfProgressScale);
576 CPLErr WarpRegionToBuffer(int nDstXOff, int nDstYOff, int nDstXSize,
577 int nDstYSize, void *pDataBuf,
578 GDALDataType eBufDataType, int nSrcXOff = 0,
579 int nSrcYOff = 0, int nSrcXSize = 0,
580 int nSrcYSize = 0, double dfProgressBase = 0.0,
581 double dfProgressScale = 1.0);
582 CPLErr WarpRegionToBuffer(int nDstXOff, int nDstYOff, int nDstXSize,
583 int nDstYSize, void *pDataBuf,
584 GDALDataType eBufDataType, int nSrcXOff,
585 int nSrcYOff, int nSrcXSize, int nSrcYSize,
586 double dfSrcXExtraSize, double dfSrcYExtraSize,
587 double dfProgressBase, double dfProgressScale);
588
589 protected:
590 friend class VRTWarpedDataset;
591 CPLErr ComputeSourceWindow(int nDstXOff, int nDstYOff, int nDstXSize,
592 int nDstYSize, int *pnSrcXOff, int *pnSrcYOff,
593 int *pnSrcXSize, int *pnSrcYSize,
594 double *pdfSrcXExtraSize,
595 double *pdfSrcYExtraSize,
596 double *pdfSrcFillRatio);
597
598 double GetWorkingMemoryForWindow(int nSrcXSize, int nSrcYSize,
599 int nDstXSize, int nDstYSize) const;
600};
601
602#endif /* def __cplusplus */
603
604 CPL_C_START
605
607 typedef void *GDALWarpOperationH;
608
609 GDALWarpOperationH CPL_DLL GDALCreateWarpOperation(const GDALWarpOptions *);
610void CPL_DLL GDALDestroyWarpOperation(GDALWarpOperationH);
611 CPLErr CPL_DLL GDALChunkAndWarpImage(GDALWarpOperationH, int, int, int, int);
612 CPLErr CPL_DLL GDALChunkAndWarpMulti(GDALWarpOperationH, int, int, int, int);
613 CPLErr CPL_DLL GDALWarpRegion(GDALWarpOperationH, int, int, int, int, int, int,
614 int, int);
615 CPLErr CPL_DLL GDALWarpRegionToBuffer(GDALWarpOperationH, int, int, int, int,
616 void *, GDALDataType, int, int, int, int);
617
618/************************************************************************/
619/* Warping kernel functions */
620/************************************************************************/
621
623int GWKGetFilterRadius(GDALResampleAlg eResampleAlg);
624
625typedef double (*FilterFuncType)(double dfX);
626FilterFuncType GWKGetFilterFunc(GDALResampleAlg eResampleAlg);
627
628// TODO(schwehr): Can padfVals be a const pointer?
629typedef double (*FilterFunc4ValuesType)(double *padfVals);
630FilterFunc4ValuesType GWKGetFilterFunc4Values(GDALResampleAlg eResampleAlg);
633 CPL_C_END
634
635#endif /* ndef GDAL_ALG_H_INCLUDED */
GDALWarpKernel
This class represents the lowest level of abstraction of warping.
Definition: gdalwarper.h:359
GDALWarpKernel::nXRadius
int nXRadius
X size of window to filter.
Definition: gdalwarper.h:417
GDALWarpKernel::nSrcYSize
int nSrcYSize
Height of the source image.
Definition: gdalwarper.h:376
GDALWarpKernel::papszWarpOptions
char ** papszWarpOptions
Warp options.
Definition: gdalwarper.h:364
GDALWarpKernel::nFiltInitX
int nFiltInitX
X filtering offset.
Definition: gdalwarper.h:421
GDALWarpKernel::dfXScale
double dfXScale
X resampling scale, i.e.
Definition: gdalwarper.h:409
GDALWarpKernel::dfYFilter
double dfYFilter
Y size of filter kernel.
Definition: gdalwarper.h:415
GDALWarpKernel::nDstXSize
int nDstXSize
Width of the destination image.
Definition: gdalwarper.h:398
GDALWarpKernel::dfSrcXExtraSize
double dfSrcXExtraSize
Extra pixels (included in nSrcXSize) reserved for filter window.
Definition: gdalwarper.h:379
GDALWarpKernel::padfDstNoDataReal
double * padfDstNoDataReal
Array of nBands value for destination nodata.
Definition: gdalwarper.h:455
GDALWarpKernel::nDstXOff
int nDstXOff
X offset of the destination buffer regarding the top-left corner of the image.
Definition: gdalwarper.h:434
GDALWarpKernel::eResample
GDALResampleAlg eResample
Resample algorithm.
Definition: gdalwarper.h:367
GDALWarpKernel::pfnTransformer
GDALTransformerFunc pfnTransformer
Pixel transformation function.
Definition: gdalwarper.h:440
GDALWarpKernel::panUnifiedSrcValid
GUInt32 * panUnifiedSrcValid
Unified validity mask of size (nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS) / 8.
Definition: gdalwarper.h:392
GDALWarpKernel::nDstYSize
int nDstYSize
Height of the destination image.
Definition: gdalwarper.h:400
GDALWarpKernel::nBands
int nBands
Number of input and output bands (excluding alpha bands)
Definition: gdalwarper.h:371
GDALWarpKernel::dfProgressBase
double dfProgressBase
Base/offset value for progress computation.
Definition: gdalwarper.h:450
GDALWarpKernel::eWorkingDataType
GDALDataType eWorkingDataType
Working data type.
Definition: gdalwarper.h:369
GDALWarpKernel::dfSrcYExtraSize
double dfSrcYExtraSize
Extra pixels (included in nSrcYSize) reserved for filter window.
Definition: gdalwarper.h:382
GDALWarpKernel::nSrcXOff
int nSrcXOff
X offset of the source buffer regarding the top-left corner of the image.
Definition: gdalwarper.h:427
GDALWarpKernel::nSrcYOff
int nSrcYOff
Y offset of the source buffer regarding the top-left corner of the image.
Definition: gdalwarper.h:430
GDALWarpKernel::nDstYOff
int nDstYOff
Y offset of the destination buffer regarding the top-left corner of the image.
Definition: gdalwarper.h:437
GDALWarpKernel::nFiltInitY
int nFiltInitY
Y filtering offset.
Definition: gdalwarper.h:423
GDALWarpKernel::pfnProgress
GDALProgressFunc pfnProgress
Progress function.
Definition: gdalwarper.h:445
GDALWarpKernel::papanBandSrcValid
GUInt32 ** papanBandSrcValid
Array of nBands validity mask of size (nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS) / 8.
Definition: gdalwarper.h:389
GDALWarpKernel::pProgress
void * pProgress
User data provided to pfnProgress.
Definition: gdalwarper.h:447
GDALWarpKernel::pafUnifiedSrcDensity
float * pafUnifiedSrcDensity
Unified source density of size nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS.
Definition: gdalwarper.h:395
GDALWarpKernel::nYRadius
int nYRadius
Y size of window to filter.
Definition: gdalwarper.h:419
GDALWarpKernel::pafDstDensity
float * pafDstDensity
Destination density of size nDstXSize * nDstYSize.
Definition: gdalwarper.h:406
GDALWarpKernel::dfXFilter
double dfXFilter
X size of filter kernel.
Definition: gdalwarper.h:413
GDALWarpKernel::dfYScale
double dfYScale
Y resampling scale, i.e.
Definition: gdalwarper.h:411
GDALWarpKernel::papabyDstImage
GByte ** papabyDstImage
Array of nBands destination images of size nDstXSize * nDstYSize.
Definition: gdalwarper.h:402
GDALWarpKernel::dfProgressScale
double dfProgressScale
Scale value for progress computation.
Definition: gdalwarper.h:452
GDALWarpKernel::nSrcXSize
int nSrcXSize
Width of the source image.
Definition: gdalwarper.h:374
GDALWarpKernel::pTransformerArg
void * pTransformerArg
User data provided to pfnTransformer.
Definition: gdalwarper.h:442
GDALWarpKernel::papabySrcImage
GByte ** papabySrcImage
Array of nBands source images of size nSrcXSize * nSrcYSize.
Definition: gdalwarper.h:385
GDALWarpKernel::panDstValid
GUInt32 * panDstValid
Validify mask of size (nDstXSize * nDstYSize) / 8.
Definition: gdalwarper.h:404
GDALWarpOperation
High level image warping class.
Definition: gdalwarper.h:502
CPLErr
CPLErr
Error category.
Definition: cpl_error.h:53
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:299
CPL_C_START
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:295
GUInt32
unsigned int GUInt32
Unsigned int32 type.
Definition: cpl_port.h:177
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:1042
CSLConstList
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1183
GByte
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:185
GDALDataType
GDALDataType
Definition: gdal.h:64
GDALDatasetH
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition: gdal.h:291
GDALDriverH
void * GDALDriverH
Opaque type used for the C bindings of the C++ GDALDriver class.
Definition: gdal.h:297
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:95
GDALWarpRegion
CPLErr GDALWarpRegion(GDALWarpOperationH, int, int, int, int, int, int, int, int)
Definition: gdalwarpoperation.cpp:1702
GDALDestroyWarpOperation
void GDALDestroyWarpOperation(GDALWarpOperationH)
Definition: gdalwarpoperation.cpp:825
GDALCreateWarpOperation
GDALWarpOperationH GDALCreateWarpOperation(const GDALWarpOptions *)
Definition: gdalwarpoperation.cpp:805
GWKAverageOrModeAlg
GWKAverageOrModeAlg
Definition: gdalwarper.h:89
GWKAOM_Fmode
@ GWKAOM_Fmode
Definition: gdalwarper.h:91
GWKAOM_Min
@ GWKAOM_Min
Definition: gdalwarper.h:94
GWKAOM_RMS
@ GWKAOM_RMS
Definition: gdalwarper.h:97
GWKAOM_Quant
@ GWKAOM_Quant
Definition: gdalwarper.h:95
GWKAOM_Sum
@ GWKAOM_Sum
Definition: gdalwarper.h:96
GWKAOM_Imode
@ GWKAOM_Imode
Definition: gdalwarper.h:92
GWKAOM_Average
@ GWKAOM_Average
Definition: gdalwarper.h:90
GWKAOM_Max
@ GWKAOM_Max
Definition: gdalwarper.h:93
GDALWarpInitDstNoDataImag
void GDALWarpInitDstNoDataImag(GDALWarpOptions *, double dNoDataImag)
Initialize padfDstNoDataImag with specified value.
Definition: gdalwarper.cpp:1476
GDALResampleAlg
GDALResampleAlg
Definition: gdalwarper.h:52
GRA_CubicSpline
@ GRA_CubicSpline
Definition: gdalwarper.h:57
GRA_Q1
@ GRA_Q1
Definition: gdalwarper.h:73
GRA_Sum
@ GRA_Sum
Definition: gdalwarper.h:78
GRA_Max
@ GRA_Max
Definition: gdalwarper.h:66
GRA_Cubic
@ GRA_Cubic
Definition: gdalwarper.h:56
GRA_Min
@ GRA_Min
Definition: gdalwarper.h:68
GRA_RMS
@ GRA_RMS
Definition: gdalwarper.h:81
GRA_Lanczos
@ GRA_Lanczos
Definition: gdalwarper.h:58
GRA_Mode
@ GRA_Mode
Definition: gdalwarper.h:64
GRA_NearestNeighbour
@ GRA_NearestNeighbour
Definition: gdalwarper.h:53
GRA_Q3
@ GRA_Q3
Definition: gdalwarper.h:75
GRA_Med
@ GRA_Med
Definition: gdalwarper.h:70
GRA_Average
@ GRA_Average
Definition: gdalwarper.h:61
GRA_Bilinear
@ GRA_Bilinear
Definition: gdalwarper.h:55
GDALCreateWarpedVRT
GDALDatasetH GDALCreateWarpedVRT(GDALDatasetH hSrcDS, int nPixels, int nLines, double *padfGeoTransform, GDALWarpOptions *psOptions)
Create virtual warped dataset.
Definition: vrtwarped.cpp:365
GDALDestroyWarpOptions
void GDALDestroyWarpOptions(GDALWarpOptions *)
Destroy a warp options structure.
Definition: gdalwarper.cpp:1310
GDALWarpOperationH
void * GDALWarpOperationH
Opaque type representing a GDALWarpOperation object.
Definition: gdalwarper.h:607
GDALWarpRegionToBuffer
CPLErr GDALWarpRegionToBuffer(GDALWarpOperationH, int, int, int, int, void *, GDALDataType, int, int, int, int)
Definition: gdalwarpoperation.cpp:2331
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:233
GDALChunkAndWarpImage
CPLErr GDALChunkAndWarpImage(GDALWarpOperationH, int, int, int, int)
Definition: gdalwarpoperation.cpp:999
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:155
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:1621
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:134
GDALWarpInitSrcNoDataImag
void GDALWarpInitSrcNoDataImag(GDALWarpOptions *, double dNoDataImag)
Initialize padfSrcNoDataImag with specified value.
Definition: gdalwarper.cpp:1495
GDALInitializeWarpedVRT
CPLErr GDALInitializeWarpedVRT(GDALDatasetH hDS, GDALWarpOptions *psWO)
Set warp info on virtual warped dataset.
Definition: vrtwarped.cpp:1271
GDALWarpInitSrcNoDataReal
void GDALWarpInitSrcNoDataReal(GDALWarpOptions *, double dNoDataReal)
Initialize padfSrcNoDataReal with specified value.
Definition: gdalwarper.cpp:1438
GDALWarpInitDstNoDataReal
void GDALWarpInitDstNoDataReal(GDALWarpOptions *, double dNoDataReal)
Initialize padfDstNoDataReal with specified value.
Definition: gdalwarper.cpp:1419
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:96
GDALChunkAndWarpMulti
CPLErr GDALChunkAndWarpMulti(GDALWarpOperationH, int, int, int, int)
Definition: gdalwarpoperation.cpp:1241
GDALCreateWarpOptions
GDALWarpOptions * GDALCreateWarpOptions(void)
Create a warp options structure.
Definition: gdalwarper.cpp:1291
GDALWarpInitNoDataReal
void GDALWarpInitNoDataReal(GDALWarpOptions *, double dNoDataReal)
Initialize padfSrcNoDataReal and padfDstNoDataReal with specified value.
Definition: gdalwarper.cpp:1458
GDALCloneWarpOptions
GDALWarpOptions * GDALCloneWarpOptions(const GDALWarpOptions *)
Clone a warp options structure.
Definition: gdalwarper.cpp:1355
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:1515
CPLXMLNode
Document node structure.
Definition: cpl_minixml.h:71
GDALWarpOptions
Warp control options for use with GDALWarpOperation::Initialize()
Definition: gdalwarper.h:155
GDALWarpOptions::nSrcAlphaBand
int nSrcAlphaBand
Definition: gdalwarper.h:186
GDALWarpOptions::hDstDS
GDALDatasetH hDstDS
Definition: gdalwarper.h:174
GDALWarpOptions::papszWarpOptions
char ** papszWarpOptions
A string list of additional options controlling the warp operation in name=value format.
Definition: gdalwarper.h:157
GDALWarpOptions::padfDstNoDataImag
double * padfDstNoDataImag
Definition: gdalwarper.h:205
GDALWarpOptions::pfnDstValidityMaskFunc
GDALMaskFunc pfnDstValidityMaskFunc
Unused.
Definition: gdalwarper.h:241
GDALWarpOptions::padfSrcNoDataReal
double * padfSrcNoDataReal
Definition: gdalwarper.h:193
GDALWarpOptions::pTransformerArg
void * pTransformerArg
Definition: gdalwarper.h:218
GDALWarpOptions::eWorkingDataType
GDALDataType eWorkingDataType
Definition: gdalwarper.h:167
GDALWarpOptions::pSrcValidityMaskFuncArg
void * pSrcValidityMaskFuncArg
Unused.
Definition: gdalwarper.h:228
GDALWarpOptions::pDstDensityMaskFuncArg
void * pDstDensityMaskFuncArg
Unused.
Definition: gdalwarper.h:238
GDALWarpOptions::panDstBands
int * panDstBands
Definition: gdalwarper.h:183
GDALWarpOptions::dfCutlineBlendDist
double dfCutlineBlendDist
Definition: gdalwarper.h:260
GDALWarpOptions::pfnProgress
GDALProgressFunc pfnProgress
Definition: gdalwarper.h:209
GDALWarpOptions::pfnSrcDensityMaskFunc
GDALMaskFunc pfnSrcDensityMaskFunc
Unused.
Definition: gdalwarper.h:231
GDALWarpOptions::hSrcDS
GDALDatasetH hSrcDS
Definition: gdalwarper.h:170
GDALWarpOptions::pfnDstDensityMaskFunc
GDALMaskFunc pfnDstDensityMaskFunc
Unused.
Definition: gdalwarper.h:236
GDALWarpOptions::pPreWarpProcessorArg
void * pPreWarpProcessorArg
Unused.
Definition: gdalwarper.h:248
GDALWarpOptions::pProgressArg
void * pProgressArg
Definition: gdalwarper.h:212
GDALWarpOptions::nDstAlphaBand
int nDstAlphaBand
Definition: gdalwarper.h:189
GDALWarpOptions::panSrcBands
int * panSrcBands
Definition: gdalwarper.h:180
GDALWarpOptions::pfnTransformer
GDALTransformerFunc pfnTransformer
Definition: gdalwarper.h:215
GDALWarpOptions::nBandCount
int nBandCount
Definition: gdalwarper.h:177
GDALWarpOptions::dfWarpMemoryLimit
double dfWarpMemoryLimit
Definition: gdalwarper.h:160
GDALWarpOptions::pSrcDensityMaskFuncArg
void * pSrcDensityMaskFuncArg
Unused.
Definition: gdalwarper.h:233
GDALWarpOptions::papfnSrcPerBandValidityMaskFunc
GDALMaskFunc * papfnSrcPerBandValidityMaskFunc
Unused.
Definition: gdalwarper.h:221
GDALWarpOptions::eResampleAlg
GDALResampleAlg eResampleAlg
Definition: gdalwarper.h:163
GDALWarpOptions::pfnSrcValidityMaskFunc
GDALMaskFunc pfnSrcValidityMaskFunc
Unused.
Definition: gdalwarper.h:226
GDALWarpOptions::hCutline
void * hCutline
Definition: gdalwarper.h:256
GDALWarpOptions::pDstValidityMaskFuncArg
void * pDstValidityMaskFuncArg
Unused.
Definition: gdalwarper.h:243
GDALWarpOptions::papSrcPerBandValidityMaskFuncArg
void ** papSrcPerBandValidityMaskFuncArg
Unused.
Definition: gdalwarper.h:223
GDALWarpOptions::padfDstNoDataReal
double * padfDstNoDataReal
Definition: gdalwarper.h:201
GDALWarpOptions::padfSrcNoDataImag
double * padfSrcNoDataImag
Definition: gdalwarper.h:197
GDALWarpOptions::pPostWarpProcessorArg
void * pPostWarpProcessorArg
Unused.
Definition: gdalwarper.h:253