From 3ddd6cb3889c3cfbff96a1a61a12da61547b935e Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 11 Apr 2013 19:10:22 +0300 Subject: Add an accessor to get the offset of a subsetted BitmapDevice Change-Id: I8a4a588287a90c6953b367bb02e075ea58f13a96 --- basebmp/inc/basebmp/bitmapdevice.hxx | 7 +++++++ basebmp/source/bitmapdevice.cxx | 5 +++++ 2 files changed, 12 insertions(+) (limited to 'basebmp') 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; -- cgit