digiKam
perspectivematrix.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2005-02-17
7  * Description : a matrix implementation for image
8  * perspective adjustment.
9  *
10  * Copyright (C) 2005-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2006-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_EDITOR_PERSPECTIVE_MATRIX_H
27 #define DIGIKAM_EDITOR_PERSPECTIVE_MATRIX_H
28 
30 {
31 
33 {
34 public:
35 
41  explicit PerspectiveMatrix();
42 
50  void translate(double x, double y);
51 
59  void scale(double x, double y);
60 
66  void invert();
67 
74  void multiply(const PerspectiveMatrix& matrix1);
75 
85  void transformPoint(double x, double y, double* newx, double* newy) const;
86 
94  double determinant() const;
95 
96 public:
97 
103  double coeff[3][3];
104 };
105 
106 } // namespace DigikamEditorPerspectiveToolPlugin
107 
108 #endif // DIGIKAM_EDITOR_PERSPECTIVE_MATRIX_H
void translate(double x, double y)
Definition: perspectivematrix.cpp:50
double coeff[3][3]
Definition: perspectivematrix.h:103
PerspectiveMatrix()
Definition: perspectivematrix.cpp:45
double determinant() const
Definition: perspectivematrix.cpp:162
void invert()
Definition: perspectivematrix.cpp:120
void multiply(const PerspectiveMatrix &matrix1)
Definition: perspectivematrix.cpp:77
void scale(double x, double y)
Definition: perspectivematrix.cpp:66
void transformPoint(double x, double y, double *newx, double *newy) const
Definition: perspectivematrix.cpp:99
Definition: perspectivematrix.cpp:36