31 #ifndef GDALWARPER_H_INCLUDED
32 #define GDALWARPER_H_INCLUDED
44 #include "cpl_multiproc.h"
77 (*GDALMaskFunc)(
void *pMaskFuncArg,
80 int nXSize,
int nYSize,
81 GByte **papabyImageData,
82 int bMaskIsFloat,
void *pMask );
85 GDALWarpNoDataMasker(
void *pMaskFuncArg,
int nBandCount,
GDALDataType eType,
86 int nXOff,
int nYOff,
int nXSize,
int nYSize,
87 GByte **papabyImageData,
int bMaskIsFloat,
88 void *pValidityMask,
int* pbOutAllValid );
91 GDALWarpDstAlphaMasker(
void *pMaskFuncArg,
int nBandCount,
GDALDataType eType,
92 int nXOff,
int nYOff,
int nXSize,
int nYSize,
94 int bMaskIsFloat,
void *pValidityMask );
96 GDALWarpSrcAlphaMasker(
void *pMaskFuncArg,
int nBandCount,
GDALDataType eType,
97 int nXOff,
int nYOff,
int nXSize,
int nYSize,
99 int bMaskIsFloat,
void *pValidityMask,
int* pbOutAllOpaque );
102 GDALWarpSrcMaskMasker(
void *pMaskFuncArg,
int nBandCount,
GDALDataType eType,
103 int nXOff,
int nYOff,
int nXSize,
int nYSize,
105 int bMaskIsFloat,
void *pValidityMask );
108 GDALWarpCutlineMasker(
void *pMaskFuncArg,
int nBandCount,
GDALDataType eType,
109 int nXOff,
int nYOff,
int nXSize,
int nYSize,
111 int bMaskIsFloat,
void *pValidityMask );
178 GDALMaskFunc *papfnSrcPerBandValidityMaskFunc;
179 void **papSrcPerBandValidityMaskFuncArg;
181 GDALMaskFunc pfnSrcValidityMaskFunc;
182 void *pSrcValidityMaskFuncArg;
184 GDALMaskFunc pfnSrcDensityMaskFunc;
185 void *pSrcDensityMaskFuncArg;
187 GDALMaskFunc pfnDstDensityMaskFunc;
188 void *pDstDensityMaskFuncArg;
190 GDALMaskFunc pfnDstValidityMaskFunc;
191 void *pDstValidityMaskFuncArg;
193 CPLErr (*pfnPreWarpChunkProcessor)(
void *pKern,
void *pArg );
194 void *pPreWarpProcessorArg;
196 CPLErr (*pfnPostWarpChunkProcessor)(
void *pKern,
void *pArg);
197 void *pPostWarpProcessorArg;
221 CPLErr CPL_DLL CPL_STDCALL
226 GDALProgressFunc pfnProgress,
void *pProgressArg,
229 CPLErr CPL_DLL CPL_STDCALL
230 GDALCreateAndReprojectImage(
GDALDatasetH hSrcDS,
const char *pszSrcWKT,
231 const char *pszDstFilename,
const char *pszDstWKT,
235 GDALProgressFunc pfnProgress,
void *pProgressArg,
244 const char *pszSrcWKT,
const char *pszDstWKT,
250 int nPixels,
int nLines,
double *padfGeoTransform,
253 CPLErr CPL_DLL CPL_STDCALL
276 #define WARP_EXTRA_ELTS 1
281 char **papszWarpOptions;
324 double dfProgressBase;
325 double dfProgressScale;
327 double *padfDstNoDataReal;
335 CPLErr PerformWarp();
338 void* GWKThreadsCreate(
char** papszWarpOptions,
340 void* pTransformerArg);
341 void GWKThreadsEnd(
void* psThreadDataIn);
353 typedef struct _GDALWarpChunk GDALWarpChunk;
360 int ValidateOptions();
362 CPLErr ComputeSourceWindow(
int nDstXOff,
int nDstYOff,
363 int nDstXSize,
int nDstYSize,
364 int *pnSrcXOff,
int *pnSrcYOff,
365 int *pnSrcXSize,
int *pnSrcYSize,
366 int *pnSrcXExtraSize,
int *pnSrcYExtraSize,
367 double* pdfSrcFillRatio );
370 const char *pszType );
373 CPLMutex *hWarpMutex;
377 GDALWarpChunk *pasChunkList;
380 unsigned long nLastTimeReported;
384 void WipeChunkList();
385 CPLErr CollectChunkList(
int nDstXOff,
int nDstYOff,
386 int nDstXSize,
int nDstYSize );
387 void ReportTiming(
const char * );
397 CPLErr ChunkAndWarpImage(
int nDstXOff,
int nDstYOff,
398 int nDstXSize,
int nDstYSize );
399 CPLErr ChunkAndWarpMulti(
int nDstXOff,
int nDstYOff,
400 int nDstXSize,
int nDstYSize );
401 CPLErr WarpRegion(
int nDstXOff,
int nDstYOff,
402 int nDstXSize,
int nDstYSize,
403 int nSrcXOff=0,
int nSrcYOff=0,
404 int nSrcXSize=0,
int nSrcYSize=0,
405 double dfProgressBase=0.0,
double dfProgressScale=1.0);
406 CPLErr WarpRegion(
int nDstXOff,
int nDstYOff,
407 int nDstXSize,
int nDstYSize,
408 int nSrcXOff,
int nSrcYOff,
409 int nSrcXSize,
int nSrcYSize,
410 int nSrcXExtraSize,
int nSrcYExtraSize,
411 double dfProgressBase,
double dfProgressScale);
412 CPLErr WarpRegionToBuffer(
int nDstXOff,
int nDstYOff,
413 int nDstXSize,
int nDstYSize,
416 int nSrcXOff=0,
int nSrcYOff=0,
417 int nSrcXSize=0,
int nSrcYSize=0,
418 double dfProgressBase=0.0,
double dfProgressScale=1.0);
419 CPLErr WarpRegionToBuffer(
int nDstXOff,
int nDstYOff,
420 int nDstXSize,
int nDstYSize,
423 int nSrcXOff,
int nSrcYOff,
424 int nSrcXSize,
int nSrcYSize,
425 int nSrcXExtraSize,
int nSrcYExtraSize,
426 double dfProgressBase,
double dfProgressScale);
433 typedef void * GDALWarpOperationH;
440 int,
int,
int,
int,
int,
int,
int,
int );
443 int,
int,
int,
int );
451 typedef double (*FilterFuncType)(
double dfX);
454 typedef double (*FilterFunc4ValuesType)(
double* padfVals);
455 FilterFunc4ValuesType GWKGetFilterFunc4Values(
GDALResampleAlg eResampleAlg);
int nSrcXOff
X offset to source pixel coordinates for transformation.
Definition: gdalwarper.h:312
int nSrcXExtraSize
Number of pixels included in nSrcXSize that are present on the edges of the area of interest to take ...
Definition: gdalwarper.h:289
GDALDataType
Definition: gdal.h:57
Document node structure.
Definition: cpl_minixml.h:65
Low level image warping class.
Definition: gdalwarper.h:278
Definitions for CPL mini XML Parser/Serializer.
Definition: gdalwarper.h:54
GByte ** papabySrcImage
Array of source image band data.
Definition: gdalwarper.h:291
Definition: gdalwarper.h:72
CPLErr GDALInitializeWarpedVRT(GDALDatasetH hDS, GDALWarpOptions *psWO)
Set warp info on virtual warped dataset.
Definition: vrtwarped.cpp:1018
GUInt32 * panUnifiedSrcValid
Per pixel validity mask for source pixels.
Definition: gdalwarper.h:294
int nDstXSize
Width of destination image in pixels.
Definition: gdalwarper.h:297
int * panDstBands
Definition: gdalwarper.h:145
void * pProgressArg
Definition: gdalwarper.h:170
int nDstXOff
X offset to destination pixel coordinates for transformation.
Definition: gdalwarper.h:315
double dfWarpMemoryLimit
Definition: gdalwarper.h:123
int nSrcAlphaBand
Definition: gdalwarper.h:148
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition: gdal.h:230
CPLErr GDALWarpRegionToBuffer(GDALWarpOperationH, int, int, int, int, void *, GDALDataType, int, int, int, int)
Definition: gdalwarpoperation.cpp:1965
Definition: gdalwarper.h:55
Definition: gdalwarper.h:56
GUInt32 * panDstValid
Per pixel validity mask for destination pixels.
Definition: gdalwarper.h:300
double * padfDstNoDataReal
Definition: gdalwarper.h:160
GWKAverageOrModeAlg
Definition: gdalwarper.h:67
GDALDataType eWorkingDataType
Working pixel data type.
Definition: gdalwarper.h:284
float * pafUnifiedSrcDensity
Per pixel density mask for source pixels.
Definition: gdalwarper.h:295
double * padfSrcNoDataImag
Definition: gdalwarper.h:157
GDALResampleAlg eResampleAlg
Definition: gdalwarper.h:126
CPLErr GDALChunkAndWarpMulti(GDALWarpOperationH, int, int, int, int)
Definition: gdalwarpoperation.cpp:976
CPLErr GDALWarpRegion(GDALWarpOperationH, int, int, int, int, int, int, int, int)
Definition: gdalwarpoperation.cpp:1430
GDALDatasetH GDALCreateWarpedVRT(GDALDatasetH hSrcDS, int nPixels, int nLines, double *padfGeoTransform, GDALWarpOptions *psOptions)
Create virtual warped dataset.
Definition: vrtwarped.cpp:230
Definition: gdalwarper.h:68
GDALTransformerFunc pfnTransformer
Definition: gdalwarper.h:173
void GDALDestroyWarpOperation(GDALWarpOperationH)
Definition: gdalwarpoperation.cpp:623
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:80
double * padfDstNoDataImag
Definition: gdalwarper.h:163
Definition: gdalwarper.h:69
Definition: gdalwarper.h:71
int nDstYOff
Y offset to destination pixel coordinates for transformation.
Definition: gdalwarper.h:316
GDALResampleAlg eResample
Resampling algorithm.
Definition: gdalwarper.h:283
GDALResampleAlg
Definition: gdalwarper.h:50
Warp control options for use with GDALWarpOperation::Initialize()
Definition: gdalwarper.h:118
GDALProgressFunc pfnProgress
Definition: gdalwarper.h:167
Definition: gdalwarper.h:53
int nSrcYExtraSize
Number of pixels included in nSrcYExtraSize that are present on the edges of the area of interest to ...
Definition: gdalwarper.h:290
High level image warping class.
Definition: gdalwarper.h:355
void * pTransformerArg
Definition: gdalwarper.h:176
int nSrcYSize
Source image height in pixels.
Definition: gdalwarper.h:288
GDALProgressFunc pfnProgress
The function to call to report progress of the algorithm, and to check for a requested termination of...
Definition: gdalwarper.h:321
Definition: gdalwarper.h:52
int * panSrcBands
Definition: gdalwarper.h:142
int(* GDALTransformerFunc)(void *pTransformerArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Definition: gdal_alg.h:114
void * GDALDriverH
Opaque type used for the C bindings of the C++ GDALDriver class.
Definition: gdal.h:236
char ** papszWarpOptions
A string list of additional options controlling the warp operation in name=value format.
Definition: gdalwarper.h:120
int nDstYSize
Height of destination image in pixels.
Definition: gdalwarper.h:298
Definition: gdalwarper.h:73
int nBands
Number of bands.
Definition: gdalwarper.h:285
CPLErr GDALChunkAndWarpImage(GDALWarpOperationH, int, int, int, int)
Definition: gdalwarpoperation.cpp:743
Definition: gdalwarper.h:51
Public (C callable) GDAL algorithm entry points, and definitions.
void * pTransformerArg
Callback data for pfnTransformer.
Definition: gdalwarper.h:319
int nSrcXSize
Source image width in pixels.
Definition: gdalwarper.h:287
GDALDatasetH hSrcDS
Definition: gdalwarper.h:133
int nBandCount
Definition: gdalwarper.h:139
float * pafDstDensity
Per pixel density mask for destination pixels.
Definition: gdalwarper.h:301
GDALDataType eWorkingDataType
Definition: gdalwarper.h:130
GDALTransformerFunc pfnTransformer
Source/destination location transformer.
Definition: gdalwarper.h:318
GDALDatasetH hDstDS
Definition: gdalwarper.h:136
Definition: gdalwarper.h:57
void * hCutline
Definition: gdalwarper.h:200
double dfCutlineBlendDist
Definition: gdalwarper.h:203
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:90
double * padfSrcNoDataReal
Definition: gdalwarper.h:154
void * pProgress
Callback data for pfnProgress.
Definition: gdalwarper.h:322
int nSrcYOff
Y offset to source pixel coordinates for transformation.
Definition: gdalwarper.h:313
Definition: gdalwarper.h:70
GDALWarpOperationH GDALCreateWarpOperation(const GDALWarpOptions *)
Definition: gdalwarpoperation.cpp:600
GByte ** papabyDstImage
Array of destination image band data.
Definition: gdalwarper.h:299
int nDstAlphaBand
Definition: gdalwarper.h:151
GUInt32 ** papanBandSrcValid
Per band validity mask for source pixels.
Definition: gdalwarper.h:293