1
/***************************************************************************
3
--------------------------------------
4
Date : Sun Sep 16 12:03:20 AKDT 2007
5
Copyright : (C) 2007 by Gary E. Sherman
6
Email : sherman at mrcc dot com
7
***************************************************************************
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
14
***************************************************************************/
1
16
#ifndef QGSIMAGEWARPER_H
2
17
#define QGSIMAGEWARPER_H
4
19
#include <gdalwarper.h>
11
enum ResamplingMethod {
12
NearestNeighbour = GRA_NearestNeighbour,
13
Bilinear = GRA_Bilinear,
18
QgsImageWarper(double angle) : mAngle(angle) { }
20
void warp(const QString& input, const QString& output,
21
double& xOffset, double& yOffset,
22
ResamplingMethod resampling = Bilinear, bool useZeroAsTrans = true);
26
struct TransformParameters {
33
static int transform(void *pTransformerArg, int bDstToSrc, int nPointCount,
34
double *x, double *y, double *z, int *panSuccess);
31
NearestNeighbour = GRA_NearestNeighbour,
32
Bilinear = GRA_Bilinear,
38
QgsImageWarper( double angle ) : mAngle( angle ) { };
40
void warp( const QString& input, const QString& output,
41
double& xOffset, double& yOffset,
42
ResamplingMethod resampling = Bilinear,
43
bool useZeroAsTrans = true,
44
const QString& compression = "NONE" );
46
bool warpgcp( const QString& input, const QString& output,
48
std::vector<QgsPoint> mapCoords,
49
std::vector<QgsPoint> pixelCoords,
50
const int nReqOrder = 1, ResamplingMethod resampling = Bilinear,
51
bool useZeroAsTrans = true, const QString& compression = "NONE",
52
bool bUseTPS = false );
56
struct TransformParameters
63
bool openSrcDSAndGetWarpOpt( const QString &input, const QString &output,
64
const ResamplingMethod &resampling, const GDALTransformerFunc &pfnTransform,
65
GDALDatasetH &hSrcDS, GDALWarpOptions *&psWarpOptions );
67
static int transform( void *pTransformerArg, int bDstToSrc, int nPointCount,
68
double *x, double *y, double *z, int *panSuccess );