16#ifndef QGSGCPTRANSFORMER_H
17#define QGSGCPTRANSFORMER_H
21#include "qgis_analysis.h"
51 InvalidTransform = 65535
53 Q_ENUM( TransformMethod )
86 virtual
int minimumGcpCount() const = 0;
100 bool transform(
double &x
SIP_INOUT,
double &y
SIP_INOUT,
bool inverseTransform = false ) const;
157 bool getOriginScale(
QgsPointXY &origin,
double &scaleX,
double &scaleY )
const;
160 bool updateParametersFromGcps(
const QVector<QgsPointXY> &sourceCoordinates,
const QVector<QgsPointXY> &destinationCoordinates,
bool invertYAxis =
false )
override;
161 int minimumGcpCount()
const override;
162 GDALTransformerFunc GDALTransformer()
const override;
163 void *GDALTransformerArgs()
const override;
167 struct LinearParameters
172 bool invertYAxis =
false;
175 static int linearTransform(
void *pTransformerArg,
int bDstToSrc,
int nPointCount,
double *x,
double *y,
double *z,
int *panSuccess );
192 bool getOriginScaleRotation(
QgsPointXY &origin,
double &scale,
double &rotation )
const;
195 bool updateParametersFromGcps(
const QVector<QgsPointXY> &sourceCoordinates,
const QVector<QgsPointXY> &destinationCoordinates,
bool invertYAxis =
false )
override;
196 int minimumGcpCount()
const override;
197 GDALTransformerFunc GDALTransformer()
const override;
198 void *GDALTransformerArgs()
const override;
202 struct HelmertParameters
207 bool invertYAxis =
false;
209 HelmertParameters mHelmertParameters;
211 static int helmertTransform(
void *pTransformerArg,
int bDstToSrc,
int nPointCount,
double *x,
double *y,
double *z,
int *panSuccess );
228 bool updateParametersFromGcps(
const QVector<QgsPointXY> &sourceCoordinates,
const QVector<QgsPointXY> &destinationCoordinates,
bool invertYAxis =
false )
override;
229 int minimumGcpCount()
const override;
230 GDALTransformerFunc GDALTransformer()
const override;
231 void *GDALTransformerArgs()
const override;
235 void destroyGdalArgs();
237 QVector<QgsPointXY> mSourceCoords;
238 QVector<QgsPointXY> mDestCoordinates;
239 bool mInvertYAxis =
false;
241 const int mPolynomialOrder;
242 const bool mIsTPSTransform;
244 void *mGDALTransformerArgs =
nullptr;
262 bool updateParametersFromGcps(
const QVector<QgsPointXY> &sourceCoordinates,
const QVector<QgsPointXY> &destinationCoordinates,
bool invertYAxis =
false )
override;
263 int minimumGcpCount()
const override;
264 GDALTransformerFunc GDALTransformer()
const override;
265 void *GDALTransformerArgs()
const override;
269 struct ProjectiveParameters
276 static int projectiveTransform(
void *pTransformerArg,
int bDstToSrc,
int nPointCount,
double *x,
double *y,
double *z,
int *panSuccess );
Custom exception class which is raised when an operation is not supported.
A class to represent a 2D point.
#define SIP_THROW(name,...)