summaryrefslogtreecommitdiff
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-04-01 16:19:08 +0200
commit28419b6655c3ab4a11de8cbad4001a26dd3b8dc7 (patch)
tree9fe23416ddca37b41d75a1a57aaeec60dd1c6c33
parentd95dab5c7fcc030886b9d7b7e9ba910422536223 (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> (cherry picked from commit b53a9c552a30a3aaa2b26ef8b1a3e8cf0f011a5c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91449 Tested-by: Tomaž Vajngerl <quikee@gmail.com>
-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: */