9#ifndef _KIS_PERSPECTIVE_MATH_H_
10#define _KIS_PERSPECTIVE_MATH_H_
14#include <Eigen/Geometry>
21#include <kritaimage_export.h>
30 static Matrix3qreal computeMatrixTransfo(
const QPointF& topLeft1,
const QPointF& topRight1,
const QPointF& bottomLeft1,
const QPointF& bottomRight1,
const QPointF& topLeft2,
const QPointF& topRight2,
const QPointF& bottomLeft2,
const QPointF& bottomRight2);
31 static Matrix3qreal computeMatrixTransfoToPerspective(
const QPointF& topLeft,
const QPointF& topRight,
const QPointF& bottomLeft,
const QPointF& bottomRight,
const QRect& r);
32 static Matrix3qreal computeMatrixTransfoFromPerspective(
const QRect& r,
const QPointF& topLeft,
const QPointF& topRight,
const QPointF& bottomLeft,
const QPointF& bottomRight);
35 qreal s = qreal(1) / (
p.x() * m.coeff(2, 0) +
p.y() * m.coeff(2, 1) + 1.0);
36 return QPointF((
p.x() * m.coeff(0, 0) +
p.y() * m.coeff(0, 1) + m.coeff(0, 2)) * s,
37 (
p.x() * m.coeff(1, 0) +
p.y() * m.coeff(1, 1) + m.coeff(1, 2)) * s);
static QPointF matProd(const Matrix3qreal &m, const QPointF &p)
TODO: get rid of this in 2.0.
Eigen::Matrix< qreal, 9, 9 > Matrix9qreal
Eigen::Matrix< qreal, 3, 3 > Matrix3qreal
Eigen::Matrix< qreal, 9, 1 > Vector9qreal
Eigen::Hyperplane< qreal, 2 > LineEquation