diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-04-11 19:10:22 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-04-11 19:14:49 +0300 |
commit | 3ddd6cb3889c3cfbff96a1a61a12da61547b935e (patch) | |
tree | a48bafba6565302678695aa12a09c7871707cdfc /basebmp | |
parent | 2729a77b49a9f5d2d827df67674c93847d5261ef (diff) |
Add an accessor to get the offset of a subsetted BitmapDevice
Change-Id: I8a4a588287a90c6953b367bb02e075ea58f13a96
Diffstat (limited to 'basebmp')
-rw-r--r-- | basebmp/inc/basebmp/bitmapdevice.hxx | 7 | ||||
-rw-r--r-- | basebmp/source/bitmapdevice.cxx | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/basebmp/inc/basebmp/bitmapdevice.hxx b/basebmp/inc/basebmp/bitmapdevice.hxx index 98e032597f07..389265e21ef5 100644 --- a/basebmp/inc/basebmp/bitmapdevice.hxx +++ b/basebmp/inc/basebmp/bitmapdevice.hxx @@ -92,6 +92,13 @@ public: */ bool isTopDown() const; + /** Query the offset from the start of the memory buffer + + @ return the offset, which is (0,0) unless this is a subset + device. + */ + basegfx::B2IVector getOffset() const; + /** Query type of scanline memory format */ sal_Int32 getScanlineFormat() const; diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx index d49a18d2e2af..c090b456cabc 100644 --- a/basebmp/source/bitmapdevice.cxx +++ b/basebmp/source/bitmapdevice.cxx @@ -1105,6 +1105,11 @@ bool BitmapDevice::isTopDown() const return mpImpl->mnScanlineStride >= 0; } +basegfx::B2IVector BitmapDevice::getOffset() const +{ + return basegfx::B2IVector(mpImpl->maBounds.getMinX(), mpImpl->maBounds.getMinY()); +} + sal_Int32 BitmapDevice::getScanlineFormat() const { return mpImpl->mnScanlineFormat; |