16#ifndef QGSGCPTRANSFORMER_H
17#define QGSGCPTRANSFORMER_H
21#include "qgis_analysis.h"
51 InvalidTransform = 65535
53 Q_ENUM( TransformMethod )
87 virtual
int minimumGcpCount() const = 0;
101 bool transform(
double &x
SIP_INOUT,
double &y
SIP_INOUT,
bool inverseTransform = false ) const;
161 bool getOriginScale(
QgsPointXY &origin,
double &scaleX,
double &scaleY )
const;
164 bool updateParametersFromGcps(
const QVector<QgsPointXY> &sourceCoordinates,
const QVector<QgsPointXY> &destinationCoordinates,
bool invertYAxis =
false )
override;
165 int minimumGcpCount()
const override;
166 GDALTransformerFunc GDALTransformer()
const override;
167 void *GDALTransformerArgs()
const override;
171 struct LinearParameters
176 bool invertYAxis =
false;
179 static int linearTransform(
void *pTransformerArg,
int bDstToSrc,
int nPointCount,
180 double *x,
double *y,
double *z,
int *panSuccess );
200 bool getOriginScaleRotation(
QgsPointXY &origin,
double &scale,
double &rotation )
const;
203 bool updateParametersFromGcps(
const QVector<QgsPointXY> &sourceCoordinates,
const QVector<QgsPointXY> &destinationCoordinates,
bool invertYAxis =
false )
override;
204 int minimumGcpCount()
const override;
205 GDALTransformerFunc GDALTransformer()
const override;
206 void *GDALTransformerArgs()
const override;
211 struct HelmertParameters
216 bool invertYAxis =
false;
218 HelmertParameters mHelmertParameters;
220 static int helmertTransform(
void *pTransformerArg,
int bDstToSrc,
int nPointCount,
221 double *x,
double *y,
double *z,
int *panSuccess );
240 bool updateParametersFromGcps(
const QVector<QgsPointXY> &sourceCoordinates,
const QVector<QgsPointXY> &destinationCoordinates,
bool invertYAxis =
false )
override;
241 int minimumGcpCount()
const override;
242 GDALTransformerFunc GDALTransformer()
const override;
243 void *GDALTransformerArgs()
const override;
247 void destroyGdalArgs();
249 QVector<QgsPointXY> mSourceCoords;
250 QVector<QgsPointXY> mDestCoordinates;
251 bool mInvertYAxis =
false;
253 const int mPolynomialOrder;
254 const bool mIsTPSTransform;
256 void *mGDALTransformerArgs =
nullptr;
277 bool updateParametersFromGcps(
const QVector<QgsPointXY> &sourceCoordinates,
const QVector<QgsPointXY> &destinationCoordinates,
bool invertYAxis =
false )
override;
278 int minimumGcpCount()
const override;
279 GDALTransformerFunc GDALTransformer()
const override;
280 void *GDALTransformerArgs()
const override;
284 struct ProjectiveParameters
291 static int projectiveTransform(
void *pTransformerArg,
int bDstToSrc,
int nPointCount,
292 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.
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
#define SIP_THROW(name,...)