Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qopenvgmatrix.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QOPENVGMATRIX_H
5#define QOPENVGMATRIX_H
6
7#include <QtCore/qdebug.h>
8#include <QtCore/QDataStream>
9#include <QtCore/QPointF>
10
11QT_BEGIN_NAMESPACE
12
13class QOpenVGMatrix
14{
15public:
16 QOpenVGMatrix();
17 explicit QOpenVGMatrix(const float *values);
18
19 const float& operator()(int row, int column) const;
20 float& operator()(int row, int column);
21
22 bool isIdentity() const;
23 void setToIdentity();
24
25 bool isAffine() const;
26
27 QPointF map(const QPointF& point) const;
28
29 void fill(float value);
30
31 QOpenVGMatrix transposed() const;
32
33 QOpenVGMatrix& operator+=(const QOpenVGMatrix& other);
34 QOpenVGMatrix& operator-=(const QOpenVGMatrix& other);
35 QOpenVGMatrix& operator*=(const QOpenVGMatrix& other);
36 QOpenVGMatrix& operator*=(float factor);
37 QOpenVGMatrix& operator/=(float divisor);
38 friend QOpenVGMatrix operator*(const QOpenVGMatrix& m1, const QOpenVGMatrix& m2);
39 friend QPointF operator*(const QPointF& point, const QOpenVGMatrix& matrix);
40 friend QPointF operator*(const QOpenVGMatrix& matrix, const QPointF& point);
41#ifndef QT_NO_DEBUG_STREAM
42 friend QDebug operator<<(QDebug dbg, const QOpenVGMatrix &m);
43#endif
44 bool operator==(const QOpenVGMatrix& other) const;
45 bool operator!=(const QOpenVGMatrix& other) const;
46
47 void copyDataTo(float *values) const;
48
49 float *data() { return *m; }
50 const float *data() const { return *m; }
51 const float *constData() const { return *m; }
52
53private:
54 float m[3][3];
55};
56
57QOpenVGMatrix operator*(const QOpenVGMatrix& m1, const QOpenVGMatrix& m2);
58QPointF operator*(const QPointF& point, const QOpenVGMatrix& matrix);
59QPointF operator*(const QOpenVGMatrix& matrix, const QPointF& point);
60
61#ifndef QT_NO_DEBUG_STREAM
62QDebug operator<<(QDebug dbg, const QOpenVGMatrix &m);
63#endif
64
65#ifndef QT_NO_DATASTREAM
66QDataStream &operator<<(QDataStream &, const QOpenVGMatrix &);
67QDataStream &operator>>(QDataStream &, QOpenVGMatrix &);
68#endif
69
70QT_END_NAMESPACE
71
72#endif // QOPENVGMATRIX_H
QPointF operator*(const QOpenVGMatrix &matrix, const QPointF &point)
QDataStream & operator<<(QDataStream &stream, const QOpenVGMatrix &matrix)
QOpenVGMatrix operator*(const QOpenVGMatrix &m1, const QOpenVGMatrix &m2)
QDebug operator<<(QDebug dbg, const QOpenVGMatrix &m)
QDataStream & operator>>(QDataStream &stream, QOpenVGMatrix &matrix)
QPointF operator*(const QPointF &point, const QOpenVGMatrix &matrix)