Fix GNU C++ version check
[LibreOffice.git] / vcl / inc / pdf / Matrix3.hxx
blob226235f5264f23ead0046541fa2215fa22647ec1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 */
11 #pragma once
13 #include <basegfx/point/b2dpoint.hxx>
14 #include <tools/gen.hxx>
16 namespace vcl::pdf
18 // matrix helper class
19 // TODO: use basegfx matrix class instead or derive from it
21 /* for sparse matrices of the form (2D linear transformations)
22 * f[0] f[1] 0
23 * f[2] f[3] 0
24 * f[4] f[5] 1
26 class Matrix3
28 double f[6];
30 void set(const double* pn)
32 for (int i = 0; i < 6; i++)
33 f[i] = pn[i];
36 public:
37 Matrix3();
39 void skew(double alpha, double beta);
40 void scale(double sx, double sy);
41 void rotate(double angle);
42 void translate(double tx, double ty);
43 void invert();
45 double get(size_t i) const { return f[i]; }
47 Point transform(const Point& rPoint) const;
48 basegfx::B2DPoint transform(const basegfx::B2DPoint& rPoint) const;
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */