summaryrefslogtreecommitdiff
path: root/basebmp/source
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@suse.com>2011-11-04 10:30:56 +0100
committerThorsten Behrens <tbehrens@suse.com>2011-11-04 10:40:08 +0100
commita6a391da8d6e3aa2b9f30c9f8b664014dc2ae02c (patch)
treeaab357789436339cc6f65910822aa2ec7597a206 /basebmp/source
parent504b384dd1c74838f34d5caa27f3e916bb309a8c (diff)
Put BitmapDevice::getPixelData() back.
Slight tweak of d0d62edf3f398e9ddb2fd0f1f5fbe1dd0393ff47 - getPixel() and getPixelData() are complementary functions, similar in spirit to const and non-const getters. Added unit test for it to avoid flagging it for removal again.
Diffstat (limited to 'basebmp/source')
-rw-r--r--basebmp/source/bitmapdevice.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx
index 958b8755d49e..6f208cf25ca7 100644
--- a/basebmp/source/bitmapdevice.cxx
+++ b/basebmp/source/bitmapdevice.cxx
@@ -452,6 +452,14 @@ namespace
return maAccessor(pixel);
}
+ virtual sal_uInt32 getPixelData_i( const basegfx::B2IPoint& rPt )
+ {
+ const DestIterator pixel( maBegin +
+ vigra::Diff2D(rPt.getX(),
+ rPt.getY()) );
+ return maToUInt32Converter(maRawAccessor(pixel));
+ }
+
template< typename Iterator, typename Col, typename RawAcc >
void implRenderLine2( const basegfx::B2IPoint& rPt1,
const basegfx::B2IPoint& rPt2,
@@ -1176,6 +1184,14 @@ Color BitmapDevice::getPixel( const basegfx::B2IPoint& rPt )
return Color();
}
+sal_uInt32 BitmapDevice::getPixelData( const basegfx::B2IPoint& rPt )
+{
+ if( mpImpl->maBounds.isInside(rPt) )
+ return getPixelData_i(rPt);
+
+ return 0;
+}
+
void BitmapDevice::drawLine( const basegfx::B2IPoint& rPt1,
const basegfx::B2IPoint& rPt2,
Color lineColor,