diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-03-28 20:11:48 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-03-29 12:18:17 +0200 |
commit | b53a9c552a30a3aaa2b26ef8b1a3e8cf0f011a5c (patch) | |
tree | 0ab88d09fa5d7485f63959d13776858bf2dfb391 /include | |
parent | c44e2f95603866aca7c71ee9b066c5088745381c (diff) |
add convenience accessors to Matrix.hxx
Change-Id: Ifaaff3b1526aed111725a46c6cc64c189909a904
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91309
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/basegfx/matrix/Matrix.hxx | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/include/basegfx/matrix/Matrix.hxx b/include/basegfx/matrix/Matrix.hxx index b742d8cdf293..9224e2784b60 100644 --- a/include/basegfx/matrix/Matrix.hxx +++ b/include/basegfx/matrix/Matrix.hxx @@ -53,6 +53,29 @@ public: return *this; } + double get(sal_uInt16 nRow, sal_uInt16 nColumn) const + { + if (nRow == 0) + { + if (nColumn == 0) + return v00; + else if (nColumn == 1) + return v01; + else if (nColumn == 2) + return v02; + } + else if (nRow == 1) + { + if (nColumn == 0) + return v10; + else if (nColumn == 1) + return v11; + else if (nColumn == 2) + return v12; + } + return 0.0; + } + double a() const { return ma; } double b() const { return mb; } double c() const { return mc; } @@ -120,7 +143,27 @@ public: } private: - double ma, mb, mc, md, me, mf; + union { + struct + { + double ma; + double mb; + double mc; + double md; + double me; + double mf; + }; + + struct + { + double v00; + double v10; + double v01; + double v11; + double v02; + double v12; + }; + }; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |