summaryrefslogtreecommitdiffstats
path: root/include/basegfx/matrix
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-03-28 20:11:48 +0100
committerTomaž Vajngerl <quikee@gmail.com>2020-03-29 12:18:17 +0200
commitb53a9c552a30a3aaa2b26ef8b1a3e8cf0f011a5c (patch)
tree0ab88d09fa5d7485f63959d13776858bf2dfb391 /include/basegfx/matrix
parentbasegfx: export B2DRange operator*= (diff)
downloadcore-b53a9c552a30a3aaa2b26ef8b1a3e8cf0f011a5c.tar.gz
core-b53a9c552a30a3aaa2b26ef8b1a3e8cf0f011a5c.zip
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/basegfx/matrix')
-rw-r--r--include/basegfx/matrix/Matrix.hxx45
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: */