GDAL
Classes | Macros | Typedefs | Enumerations | Functions
gdalwarper.h File Reference

GDAL warper related entry points and definitions. More...

#include "gdal_alg.h"
#include "cpl_minixml.h"

Go to the source code of this file.

Classes

struct  GDALWarpOptions
 Warp control options for use with GDALWarpOperation::Initialize() More...
 
class  GDALWarpKernel
 Low level image warping class. More...
 
class  GDALWarpOperation
 High level image warping class. More...
 

Macros

#define WARP_EXTRA_ELTS   1
 

Typedefs

typedef int(* GDALMaskFunc) (void *pMaskFuncArg, int nBandCount, GDALDataType eType, int nXOff, int nYOff, int nXSize, int nYSize, GByte **papabyImageData, int bMaskIsFloat, void *pMask)
 
typedef void * GDALWarpOperationH
 

Enumerations

enum  GDALResampleAlg {
  GRA_NearestNeighbour =0, GRA_Bilinear =1, GRA_Cubic =2, GRA_CubicSpline =3,
  GRA_Lanczos =4, GRA_Average =5, GRA_Mode =6
}
 

Functions

CPLErr GDALWarpNoDataMasker (void *pMaskFuncArg, int nBandCount, GDALDataType eType, int nXOff, int nYOff, int nXSize, int nYSize, GByte **papabyImageData, int bMaskIsFloat, void *pValidityMask)
 
CPLErr GDALWarpDstAlphaMasker (void *pMaskFuncArg, int nBandCount, GDALDataType eType, int nXOff, int nYOff, int nXSize, int nYSize, GByte **, int bMaskIsFloat, void *pValidityMask)
 
CPLErr GDALWarpSrcAlphaMasker (void *pMaskFuncArg, int nBandCount, GDALDataType eType, int nXOff, int nYOff, int nXSize, int nYSize, GByte **, int bMaskIsFloat, void *pValidityMask)
 
CPLErr GDALWarpSrcMaskMasker (void *pMaskFuncArg, int nBandCount, GDALDataType eType, int nXOff, int nYOff, int nXSize, int nYSize, GByte **, int bMaskIsFloat, void *pValidityMask)
 
CPLErr GDALWarpCutlineMasker (void *pMaskFuncArg, int nBandCount, GDALDataType eType, int nXOff, int nYOff, int nXSize, int nYSize, GByte **, int bMaskIsFloat, void *pValidityMask)
 
GDALWarpOptionsGDALCreateWarpOptions (void)
 
void GDALDestroyWarpOptions (GDALWarpOptions *)
 
GDALWarpOptionsGDALCloneWarpOptions (const GDALWarpOptions *)
 
CPLXMLNodeGDALSerializeWarpOptions (const GDALWarpOptions *)
 
GDALWarpOptionsGDALDeserializeWarpOptions (CPLXMLNode *)
 
CPLErr GDALReprojectImage (GDALDatasetH hSrcDS, const char *pszSrcWKT, GDALDatasetH hDstDS, const char *pszDstWKT, GDALResampleAlg eResampleAlg, double dfWarpMemoryLimit, double dfMaxError, GDALProgressFunc pfnProgress, void *pProgressArg, GDALWarpOptions *psOptions)
 
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)
 
GDALDatasetH GDALAutoCreateWarpedVRT (GDALDatasetH hSrcDS, const char *pszSrcWKT, const char *pszDstWKT, GDALResampleAlg eResampleAlg, double dfMaxError, const GDALWarpOptions *psOptions)
 Create virtual warped dataset automatically. More...
 
GDALDatasetH GDALCreateWarpedVRT (GDALDatasetH hSrcDS, int nPixels, int nLines, double *padfGeoTransform, GDALWarpOptions *psOptions)
 Create virtual warped dataset. More...
 
CPLErr GDALInitializeWarpedVRT (GDALDatasetH hDS, GDALWarpOptions *psWO)
 Set warp info on virtual warped dataset. More...
 
GDALWarpOperationH GDALCreateWarpOperation (const GDALWarpOptions *)
 
void GDALDestroyWarpOperation (GDALWarpOperationH)
 
CPLErr GDALChunkAndWarpImage (GDALWarpOperationH, int, int, int, int)
 
CPLErr GDALChunkAndWarpMulti (GDALWarpOperationH, int, int, int, int)
 
CPLErr GDALWarpRegion (GDALWarpOperationH, int, int, int, int, int, int, int, int)
 
CPLErr GDALWarpRegionToBuffer (GDALWarpOperationH, int, int, int, int, void *, GDALDataType, int, int, int, int)
 

Detailed Description

GDAL warper related entry points and definitions.

Eventually it is expected that this file will be mostly private to the implementation, and the public C entry points will be available in gdal_alg.h.

Enumeration Type Documentation

Warp Resampling Algorithm

Enumerator
GRA_NearestNeighbour 

Nearest neighbour (select on one input pixel)

GRA_Bilinear 

Bilinear (2x2 kernel)

GRA_Cubic 

Cubic Convolution Approximation (4x4 kernel)

GRA_CubicSpline 

Cubic B-Spline Approximation (4x4 kernel)

GRA_Lanczos 

Lanczos windowed sinc interpolation (6x6 kernel)

GRA_Average 

Average (computes the average of all non-NODATA contributing pixels)

GRA_Mode 

Mode (selects the value which appears most often of all the sampled points)

Function Documentation

GDALDatasetH GDALAutoCreateWarpedVRT ( GDALDatasetH  hSrcDS,
const char *  pszSrcWKT,
const char *  pszDstWKT,
GDALResampleAlg  eResampleAlg,
double  dfMaxError,
const GDALWarpOptions psOptionsIn 
)

Create virtual warped dataset automatically.

This function will create a warped virtual file representing the input image warped into the target coordinate system. A GenImgProj transformation is created to accomplish any required GCP/Geotransform warp and reprojection to the target coordinate system. The output virtual dataset will be "northup" in the target coordinate system. The GDALSuggestedWarpOutput() function is used to determine the bounds and resolution of the output virtual file which should be large enough to include all the input image

Note that the constructed GDALDatasetH will acquire one or more references to the passed in hSrcDS. Reference counting semantics on the source dataset should be honoured. That is, don't just GDALClose() it unless it was opened with GDALOpenShared().

The returned dataset will have no associated filename for itself. If you want to write the virtual dataset description to a file, use the GDALSetDescription() function (or SetDescription() method) on the dataset to assign a filename before it is closed.

Parameters
hSrcDSThe source dataset.
pszSrcWKTThe coordinate system of the source image. If NULL, it will be read from the source image.
pszDstWKTThe coordinate system to convert to. If NULL no change of coordinate system will take place.
eResampleAlgOne of GRA_NearestNeighbour, GRA_Bilinear, GRA_Cubic, GRA_CubicSpline, GRA_Lanczos, GRA_Average or GRA_Mode. Controls the sampling method used.
dfMaxErrorMaximum error measured in input pixels that is allowed in approximating the transformation (0.0 for exact calculations).
psOptionsInAdditional warp options, normally NULL.
Returns
NULL on failure, or a new virtual dataset handle on success.
CPLErr GDALChunkAndWarpImage ( GDALWarpOperationH  hOperation,
int  nDstXOff,
int  nDstYOff,
int  nDstXSize,
int  nDstYSize 
)
CPLErr GDALChunkAndWarpMulti ( GDALWarpOperationH  hOperation,
int  nDstXOff,
int  nDstYOff,
int  nDstXSize,
int  nDstYSize 
)
GDALDatasetH GDALCreateWarpedVRT ( GDALDatasetH  hSrcDS,
int  nPixels,
int  nLines,
double *  padfGeoTransform,
GDALWarpOptions psOptions 
)

Create virtual warped dataset.

This function will create a warped virtual file representing the input image warped based on a provided transformation. Output bounds and resolution are provided explicitly.

Note that the constructed GDALDatasetH will acquire one or more references to the passed in hSrcDS. Reference counting semantics on the source dataset should be honoured. That is, don't just GDALClose() it unless it was opened with GDALOpenShared().

Parameters
hSrcDSThe source dataset.
nPixelsWidth of the virtual warped dataset to create
nLinesHeight of the virtual warped dataset to create
padfGeoTransformGeotransform matrix of the virtual warped dataset to create
psOptionsWarp options. Must be different from NULL.
Returns
NULL on failure, or a new virtual dataset handle on success.
GDALWarpOperationH GDALCreateWarpOperation ( const GDALWarpOptions psNewOptions)
void GDALDestroyWarpOperation ( GDALWarpOperationH  hOperation)
See also
GDALWarpOperation::~GDALWarpOperation()
CPLErr GDALInitializeWarpedVRT ( GDALDatasetH  hDS,
GDALWarpOptions psWO 
)

Set warp info on virtual warped dataset.

Initializes all the warping information for a virtual warped dataset.

This method is the same as the C++ method VRTWarpedDataset::Initialize().

Parameters
hDSdataset previously created with the VRT driver, and a SUBCLASS of "VRTWarpedDataset".
psWOthe warp options to apply. Note that ownership of the transformation information is taken over by the function though everything else remains the property of the caller.
Returns
CE_None on success or CE_Failure if an error occurs.
CPLErr GDALWarpRegion ( GDALWarpOperationH  hOperation,
int  nDstXOff,
int  nDstYOff,
int  nDstXSize,
int  nDstYSize,
int  nSrcXOff,
int  nSrcYOff,
int  nSrcXSize,
int  nSrcYSize 
)
CPLErr GDALWarpRegionToBuffer ( GDALWarpOperationH  hOperation,
int  nDstXOff,
int  nDstYOff,
int  nDstXSize,
int  nDstYSize,
void *  pDataBuf,
GDALDataType  eBufDataType,
int  nSrcXOff,
int  nSrcYOff,
int  nSrcXSize,
int  nSrcYSize 
)

Generated for GDAL by doxygen 1.8.11.