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
25
26#include "gdal_alg.h"
27#include "cpl_minixml.h"
28#include "cpl_multiproc.h"
29
31
32/* Note: values are selected to be consistent with GDALRIOResampleAlg of
33 * gcore/gdal.h */
35typedef enum
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
70
72typedef 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
77CPLErr 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
83CPLErr 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);
88CPLErr 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
95CPLErr 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
101CPLErr 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
111CPLErr 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
119
121typedef 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,
127
128/************************************************************************/
129/* GDALWarpOptions */
130/************************************************************************/
131
244
245const char CPL_DLL *GDALWarpGetOptionList(void);
246
247GDALWarpOptions CPL_DLL *CPL_STDCALL GDALCreateWarpOptions(void);
248void CPL_DLL CPL_STDCALL GDALDestroyWarpOptions(GDALWarpOptions *);
249GDALWarpOptions CPL_DLL *CPL_STDCALL
251
252void CPL_DLL CPL_STDCALL GDALWarpInitDstNoDataReal(GDALWarpOptions *,
253 double dNoDataReal);
254
255void CPL_DLL CPL_STDCALL GDALWarpInitSrcNoDataReal(GDALWarpOptions *,
256 double dNoDataReal);
257
258void CPL_DLL CPL_STDCALL GDALWarpInitNoDataReal(GDALWarpOptions *,
259 double dNoDataReal);
260
261void CPL_DLL CPL_STDCALL GDALWarpInitDstNoDataImag(GDALWarpOptions *,
262 double dNoDataImag);
263
264void CPL_DLL CPL_STDCALL GDALWarpInitSrcNoDataImag(GDALWarpOptions *,
265 double dNoDataImag);
266
267void CPL_DLL CPL_STDCALL GDALWarpResolveWorkingDataType(GDALWarpOptions *);
268
269void CPL_DLL CPL_STDCALL GDALWarpInitDefaultBandMapping(GDALWarpOptions *,
270 int nBandCount);
271
273CPLXMLNode CPL_DLL *CPL_STDCALL
274GDALSerializeWarpOptions(const GDALWarpOptions *);
275GDALWarpOptions CPL_DLL *CPL_STDCALL GDALDeserializeWarpOptions(CPLXMLNode *);
277
278/************************************************************************/
279/* GDALReprojectImage() */
280/************************************************************************/
281
282CPLErr 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
288CPLErr 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
299GDALDatasetH CPL_DLL CPL_STDCALL
300GDALAutoCreateWarpedVRT(GDALDatasetH hSrcDS, const char *pszSrcWKT,
301 const char *pszDstWKT, GDALResampleAlg eResampleAlg,
302 double dfMaxError, const GDALWarpOptions *psOptions);
303
304GDALDatasetH 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
309GDALDatasetH CPL_DLL CPL_STDCALL
310GDALCreateWarpedVRT(GDALDatasetH hSrcDS, int nPixels, int nLines,
311 const double *padfGeoTransform, GDALWarpOptions *psOptions);
312
313CPLErr CPL_DLL CPL_STDCALL GDALInitializeWarpedVRT(GDALDatasetH hDS,
314 GDALWarpOptions *psWO);
315
317
318#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
319
320#include <vector>
321#include <utility>
322
323bool GDALGetWarpResampleAlg(const char *pszResampling,
324 GDALResampleAlg &eResampleAlg, bool bThrow = false);
325
326/************************************************************************/
327/* GDALWarpKernel */
328/* */
329
335#define WARP_EXTRA_ELTS 1
336
344class CPL_DLL GDALWarpKernel
345{
346 CPL_DISALLOW_COPY_ASSIGN(GDALWarpKernel)
347
348 public:
351
358
372
382
393
395 double dfXScale;
397 double dfYScale;
399 double dfXFilter;
401 double dfYFilter;
410
417
424
429
431 GDALProgressFunc pfnProgress;
434
439
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
461
464
465 CPLErr Validate();
466 CPLErr PerformWarp();
467};
468
470void *GWKThreadsCreate(char **papszWarpOptions,
471 GDALTransformerFunc pfnTransformer,
472 void *pTransformerArg);
473void GWKThreadsEnd(void *psThreadDataIn);
475
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
487typedef struct _GDALWarpChunk GDALWarpChunk;
488
489struct GDALTransformerUniquePtrReleaser
490{
491 void operator()(void *p)
492 {
493 GDALDestroyTransformer(p);
494 }
495};
496
498
501 std::unique_ptr<void, GDALTransformerUniquePtrReleaser>;
502
503class 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 =
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
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
614
616typedef void *GDALWarpOperationH;
617
620CPLErr CPL_DLL GDALChunkAndWarpImage(GDALWarpOperationH, int, int, int, int);
621CPLErr CPL_DLL GDALChunkAndWarpMulti(GDALWarpOperationH, int, int, int, int);
622CPLErr CPL_DLL GDALWarpRegion(GDALWarpOperationH, int, int, int, int, int, int,
623 int, int);
624CPLErr CPL_DLL GDALWarpRegionToBuffer(GDALWarpOperationH, int, int, int, int,
625 void *, GDALDataType, int, int, int, int);
626
627/************************************************************************/
628/* Warping kernel functions */
629/************************************************************************/
630
632int GWKGetFilterRadius(GDALResampleAlg eResampleAlg);
633
634typedef double (*FilterFuncType)(double dfX);
635FilterFuncType GWKGetFilterFunc(GDALResampleAlg eResampleAlg);
636
637// TODO(schwehr): Can padfVals be a const pointer?
638typedef double (*FilterFunc4ValuesType)(double *padfVals);
639FilterFunc4ValuesType GWKGetFilterFunc4Values(GDALResampleAlg eResampleAlg);
641
643
644#endif /* ndef GDAL_ALG_H_INCLUDED */
This class represents the lowest level of abstraction of warping.
Definition gdalwarper.h:345
int nXRadius
X size of window to filter.
Definition gdalwarper.h:403
int nSrcYSize
Height of the source image.
Definition gdalwarper.h:362
char ** papszWarpOptions
Warp options.
Definition gdalwarper.h:350
GByte ** papabySrcImage
Array of nBands source images of size nSrcXSize * nSrcYSize.
Definition gdalwarper.h:371
int nFiltInitX
X filtering offset.
Definition gdalwarper.h:407
double dfXScale
X resampling scale, i.e.
Definition gdalwarper.h:395
void * pTransformerArg
User data provided to pfnTransformer.
Definition gdalwarper.h:428
double dfYFilter
Y size of filter kernel.
Definition gdalwarper.h:401
int nDstXSize
Width of the destination image.
Definition gdalwarper.h:384
double dfSrcXExtraSize
Extra pixels (included in nSrcXSize) reserved for filter window.
Definition gdalwarper.h:365
double * padfDstNoDataReal
Array of nBands value for destination nodata.
Definition gdalwarper.h:441
int nDstXOff
X offset of the destination buffer regarding the top-left corner of the image.
Definition gdalwarper.h:420
GDALResampleAlg eResample
Resample algorithm.
Definition gdalwarper.h:353
GDALTransformerFunc pfnTransformer
Pixel transformation function.
Definition gdalwarper.h:426
int nDstYSize
Height of the destination image.
Definition gdalwarper.h:386
int nBands
Number of input and output bands (excluding alpha bands).
Definition gdalwarper.h:357
double dfProgressBase
Base/offset value for progress computation.
Definition gdalwarper.h:436
GDALDataType eWorkingDataType
Working data type.
Definition gdalwarper.h:355
double dfSrcYExtraSize
Extra pixels (included in nSrcYSize) reserved for filter window.
Definition gdalwarper.h:368
int nSrcXOff
X offset of the source buffer regarding the top-left corner of the image.
Definition gdalwarper.h:413
float * pafDstDensity
Destination density of size nDstXSize * nDstYSize.
Definition gdalwarper.h:392
void * pProgress
User data provided to pfnProgress.
Definition gdalwarper.h:433
GUInt32 ** papanBandSrcValid
Array of nBands validity mask of size (nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS) / 8.
Definition gdalwarper.h:375
int nSrcYOff
Y offset of the source buffer regarding the top-left corner of the image.
Definition gdalwarper.h:416
float * pafUnifiedSrcDensity
Unified source density of size nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS.
Definition gdalwarper.h:381
int nDstYOff
Y offset of the destination buffer regarding the top-left corner of the image.
Definition gdalwarper.h:423
int nFiltInitY
Y filtering offset.
Definition gdalwarper.h:409
GDALProgressFunc pfnProgress
Progress function.
Definition gdalwarper.h:431
GUInt32 * panDstValid
Validify mask of size (nDstXSize * nDstYSize) / 8.
Definition gdalwarper.h:390
GUInt32 * panUnifiedSrcValid
Unified validity mask of size (nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS) / 8.
Definition gdalwarper.h:378
int nYRadius
Y size of window to filter.
Definition gdalwarper.h:405
GByte ** papabyDstImage
Array of nBands destination images of size nDstXSize * nDstYSize.
Definition gdalwarper.h:388
double dfXFilter
X size of filter kernel.
Definition gdalwarper.h:399
double dfYScale
Y resampling scale, i.e.
Definition gdalwarper.h:397
double dfProgressScale
Scale value for progress computation.
Definition gdalwarper.h:438
int nSrcXSize
Width of the source image.
Definition gdalwarper.h:360
CPLErr Initialize(const GDALWarpOptions *psNewOptions, GDALTransformerFunc pfnTransformer=nullptr, GDALTransformerArgUniquePtr psOwnedTransformerArg=GDALTransformerArgUniquePtr{nullptr})
This method initializes the GDALWarpOperation's concept of the warp options in effect.
Definition gdalwarpoperation.cpp:558
CPLErr WarpRegionToBuffer(int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize, void *pDataBuf, GDALDataType eBufDataType, int nSrcXOff=0, int nSrcYOff=0, int nSrcXSize=0, int nSrcYSize=0, double dfProgressBase=0.0, double dfProgressScale=1.0)
This method requests that a particular window of the output dataset be warped and the result put into...
Definition gdalwarpoperation.cpp:1875
CPLErr ChunkAndWarpImage(int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize)
This method does a complete warp of the source image to the destination image for the indicated regio...
Definition gdalwarpoperation.cpp:1032
static void DestroyDestinationBuffer(void *pDstBuffer)
This method destroys a buffer previously retrieved from CreateDestinationBuffer.
Definition gdalwarpoperation.cpp:900
const GDALWarpOptions * GetOptions()
Return warp options.
Definition gdalwarpoperation.cpp:193
CPLErr WarpRegion(int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize, int nSrcXOff=0, int nSrcYOff=0, int nSrcXSize=0, int nSrcYSize=0, double dfProgressBase=0.0, double dfProgressScale=1.0)
This method requests the indicated region of the output file be generated.
Definition gdalwarpoperation.cpp:1670
double GetWorkingMemoryForWindow(int nSrcXSize, int nSrcYSize, int nDstXSize, int nDstYSize) const
Returns the amount of working memory, in bytes, required to process a warped window of source dimensi...
Definition gdalwarpoperation.cpp:1379
CPLErr ChunkAndWarpMulti(int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize)
This method does a complete warp of the source image to the destination image for the indicated regio...
Definition gdalwarpoperation.cpp:1200
CPLErr InitializeDestinationBuffer(void *pDstBuffer, int nDstXSize, int nDstYSize, int *pbWasInitialized=nullptr) const
This method initializes a destination buffer for use with WarpRegionToBuffer.
Definition gdalwarpoperation.cpp:789
void * CreateDestinationBuffer(int nDstXSize, int nDstYSize, int *pbWasInitialized=nullptr)
This method creates a destination buffer for use with WarpRegionToBuffer.
Definition gdalwarpoperation.cpp:744
CPLErr ComputeSourceWindow(int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize, int *pnSrcXOff, int *pnSrcYOff, int *pnSrcXSize, int *pnSrcYSize, double *pdfSrcXExtraSize, double *pdfSrcYExtraSize, double *pdfSrcFillRatio)
Given a target window starting at pixel (nDstOff, nDstYOff) and of dimension (nDstXSize,...
Definition gdalwarpoperation.cpp:3000
CPLErr
Error category.
Definition cpl_error.h:37
Definitions for CPL mini XML Parser/Serializer.
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:289
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:285
unsigned int GUInt32
Unsigned int32 type.
Definition cpl_port.h:167
#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
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1087
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:175
GDALDataType
Definition gdal.h:48
Public (C callable) GDAL algorithm entry points, and definitions.
int(* GDALTransformerFunc)(void *pTransformerArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Definition gdal_alg.h:79
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition gdal_fwd.h:42
void * GDALDriverH
Opaque type used for the C bindings of the C++ GDALDriver class.
Definition gdal_fwd.h:51
CPLErr GDALWarpRegion(GDALWarpOperationH, int, int, int, int, int, int, int, int)
Definition gdalwarpoperation.cpp:1831
void GDALDestroyWarpOperation(GDALWarpOperationH)
Definition gdalwarpoperation.cpp:933
GDALWarpOperationH GDALCreateWarpOperation(const GDALWarpOptions *)
Definition gdalwarpoperation.cpp:913
GWKTieStrategy
Definition gdalwarper.h:122
void GDALWarpInitDstNoDataImag(GDALWarpOptions *, double dNoDataImag)
Initialize padfDstNoDataImag with specified value.
Definition gdalwarper.cpp:1710
GDALResampleAlg
Definition gdalwarper.h:36
@ GRA_CubicSpline
Definition gdalwarper.h:41
@ GRA_Q1
Definition gdalwarper.h:57
@ GRA_Sum
Definition gdalwarper.h:62
@ GRA_Max
Definition gdalwarper.h:50
@ GRA_Cubic
Definition gdalwarper.h:40
@ GRA_Min
Definition gdalwarper.h:52
@ GRA_RMS
Definition gdalwarper.h:65
@ GRA_Lanczos
Definition gdalwarper.h:42
@ GRA_Mode
Definition gdalwarper.h:48
@ GRA_NearestNeighbour
Definition gdalwarper.h:37
@ GRA_Q3
Definition gdalwarper.h:59
@ GRA_Med
Definition gdalwarper.h:54
@ GRA_Average
Definition gdalwarper.h:45
@ GRA_Bilinear
Definition gdalwarper.h:39
void GDALDestroyWarpOptions(GDALWarpOptions *)
Destroy a warp options structure.
Definition gdalwarper.cpp:1544
void * GDALWarpOperationH
Opaque type representing a GDALWarpOperation object.
Definition gdalwarper.h:616
CPLErr GDALWarpRegionToBuffer(GDALWarpOperationH, int, int, int, int, void *, GDALDataType, int, int, int, int)
Definition gdalwarpoperation.cpp:2469
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
GDALDatasetH GDALCreateWarpedVRT(GDALDatasetH hSrcDS, int nPixels, int nLines, const double *padfGeoTransform, GDALWarpOptions *psOptions)
Create virtual warped dataset.
Definition vrtwarped.cpp:372
CPLErr GDALChunkAndWarpImage(GDALWarpOperationH, int, int, int, int)
Definition gdalwarpoperation.cpp:1099
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
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
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
void GDALWarpInitSrcNoDataImag(GDALWarpOptions *, double dNoDataImag)
Initialize padfSrcNoDataImag with specified value.
Definition gdalwarper.cpp:1729
CPLErr GDALInitializeWarpedVRT(GDALDatasetH hDS, GDALWarpOptions *psWO)
Set warp info on virtual warped dataset.
Definition vrtwarped.cpp:1340
void GDALWarpInitSrcNoDataReal(GDALWarpOptions *, double dNoDataReal)
Initialize padfSrcNoDataReal with specified value.
Definition gdalwarper.cpp:1672
std::unique_ptr< void, GDALTransformerUniquePtrReleaser > GDALTransformerArgUniquePtr
Unique pointer for the argument of a GDALTransformerFunc.
Definition gdalwarper.h:500
void GDALWarpInitDstNoDataReal(GDALWarpOptions *, double dNoDataReal)
Initialize padfDstNoDataReal with specified value.
Definition gdalwarper.cpp:1653
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
CPLErr GDALChunkAndWarpMulti(GDALWarpOperationH, int, int, int, int)
Definition gdalwarpoperation.cpp:1349
const char * GDALWarpGetOptionList(void)
Return a XML string describing options accepted by GDALWarpOptions::papszWarpOptions.
Definition gdalwarper.cpp:1084
GDALWarpOptions * GDALCreateWarpOptions(void)
Create a warp options structure.
Definition gdalwarper.cpp:1524
void GDALWarpInitNoDataReal(GDALWarpOptions *, double dNoDataReal)
Initialize padfSrcNoDataReal and padfDstNoDataReal with specified value.
Definition gdalwarper.cpp:1692
bool GDALGetWarpResampleAlg(const char *pszResampling, GDALResampleAlg &eResampleAlg, bool bThrow=false)
Return a GDALResampleAlg from a string.
Definition gdalwarper.cpp:2452
GDALWarpOptions * GDALCloneWarpOptions(const GDALWarpOptions *)
Clone a warp options structure.
Definition gdalwarper.cpp:1589
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
Document node structure.
Definition cpl_minixml.h:54
Warp control options for use with GDALWarpOperation::Initialize().
Definition gdalwarper.h:134
int nSrcAlphaBand
Definition gdalwarper.h:165
GDALDatasetH hDstDS
Definition gdalwarper.h:153
double * padfDstNoDataImag
Definition gdalwarper.h:184
GDALMaskFunc pfnDstValidityMaskFunc
Unused.
Definition gdalwarper.h:220
double * padfSrcNoDataReal
Definition gdalwarper.h:172
void * pTransformerArg
Definition gdalwarper.h:197
GDALDataType eWorkingDataType
Definition gdalwarper.h:146
void * pSrcValidityMaskFuncArg
Unused.
Definition gdalwarper.h:207
void * pDstDensityMaskFuncArg
Unused.
Definition gdalwarper.h:217
int * panDstBands
Definition gdalwarper.h:162
double dfCutlineBlendDist
Definition gdalwarper.h:239
GDALProgressFunc pfnProgress
Definition gdalwarper.h:188
GDALMaskFunc pfnSrcDensityMaskFunc
Unused.
Definition gdalwarper.h:210
GDALDatasetH hSrcDS
Definition gdalwarper.h:149
GDALMaskFunc pfnDstDensityMaskFunc
Unused.
Definition gdalwarper.h:215
void * pPreWarpProcessorArg
Unused.
Definition gdalwarper.h:227
void * pProgressArg
Definition gdalwarper.h:191
int nDstAlphaBand
Definition gdalwarper.h:168
int * panSrcBands
Definition gdalwarper.h:159
GDALTransformerFunc pfnTransformer
Definition gdalwarper.h:194
int nBandCount
Definition gdalwarper.h:156
double dfWarpMemoryLimit
Definition gdalwarper.h:139
void * pSrcDensityMaskFuncArg
Unused.
Definition gdalwarper.h:212
GDALMaskFunc * papfnSrcPerBandValidityMaskFunc
Unused.
Definition gdalwarper.h:200
GDALResampleAlg eResampleAlg
Definition gdalwarper.h:142
CPLErr(* pfnPostWarpChunkProcessor)(void *pKern, void *pArg)
Unused.
Definition gdalwarper.h:230
GDALMaskFunc pfnSrcValidityMaskFunc
Unused.
Definition gdalwarper.h:205
char ** papszWarpOptions
A string list of additional options controlling the warp operation in name=value format.
Definition gdalwarper.h:136
void * hCutline
Definition gdalwarper.h:235
void * pDstValidityMaskFuncArg
Unused.
Definition gdalwarper.h:222
GWKTieStrategy eTieStrategy
Tie-breaking method.
Definition gdalwarper.h:242
void ** papSrcPerBandValidityMaskFuncArg
Unused.
Definition gdalwarper.h:202
CPLErr(* pfnPreWarpChunkProcessor)(void *pKern, void *pArg)
Unused.
Definition gdalwarper.h:225
double * padfDstNoDataReal
Definition gdalwarper.h:180
double * padfSrcNoDataImag
Definition gdalwarper.h:176
void * pPostWarpProcessorArg
Unused.
Definition gdalwarper.h:232