diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2011-11-02 23:36:36 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2011-11-02 23:58:28 +0100 |
commit | 1e297aef53ec79e2905cb9ca57d649b82bc3938d (patch) | |
tree | f5ec93d4b92881eb59ed50c2aee7200e25e5cbd2 /basebmp/inc | |
parent | aeee94cb587082430f3a277a24ae459829f6d384 (diff) |
Move BitmapDevice to use B2IBox instead of B2IRange.
Semantically, B2IBox represents a pixel rect much better than
B2IRange - replaced all occurences in and around the software
renderer, and client code.
Diffstat (limited to 'basebmp/inc')
-rw-r--r-- | basebmp/inc/basebmp/bitmapdevice.hxx | 78 | ||||
-rw-r--r-- | basebmp/inc/basebmp/clippedlinerenderer.hxx | 4 | ||||
-rw-r--r-- | basebmp/inc/basebmp/polypolygonrenderer.hxx | 4 | ||||
-rw-r--r-- | basebmp/inc/basebmp/tools.hxx | 10 |
4 files changed, 48 insertions, 48 deletions
diff --git a/basebmp/inc/basebmp/bitmapdevice.hxx b/basebmp/inc/basebmp/bitmapdevice.hxx index 99bb1b6a141a..1e6d73b92923 100644 --- a/basebmp/inc/basebmp/bitmapdevice.hxx +++ b/basebmp/inc/basebmp/bitmapdevice.hxx @@ -45,7 +45,7 @@ namespace basegfx class B2IPoint; class B2DPoint; class B2IVector; - class B2IRange; + class B2IBox; class B2DPolygon; class B2DPolyPolygon; } @@ -66,7 +66,7 @@ struct ImplBitmapDevice; struct IBitmapDeviceDamageTracker { /// gets called when said region is clobbered - virtual void damaged(const basegfx::B2IRange& rDamageRect) const = 0; + virtual void damaged(const basegfx::B2IBox& rDamageRect) const = 0; }; /** Definition of BitmapDevice interface @@ -82,7 +82,7 @@ struct IBitmapDeviceDamageTracker is accepted, but potentially slow. */ class BASEBMP_DLLPUBLIC BitmapDevice : public boost::enable_shared_from_this<BitmapDevice>, - private boost::noncopyable + private boost::noncopyable { public: /** Query size of device in pixel @@ -362,8 +362,8 @@ public: Draw mode to use when changing pixel values */ void drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap, - const basegfx::B2IRange& rSrcRect, - const basegfx::B2IRange& rDstRect, + const basegfx::B2IBox& rSrcRect, + const basegfx::B2IBox& rDstRect, DrawMode drawMode ); /** Draw another bitmap into this device @@ -395,8 +395,8 @@ public: pixel is 1 will not be modified. */ void drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap, - const basegfx::B2IRange& rSrcRect, - const basegfx::B2IRange& rDstRect, + const basegfx::B2IBox& rSrcRect, + const basegfx::B2IBox& rDstRect, DrawMode drawMode, const BitmapDeviceSharedPtr& rClip ); @@ -429,7 +429,7 @@ public: */ void drawMaskedColor( Color aSrcColor, const BitmapDeviceSharedPtr& rAlphaMask, - const basegfx::B2IRange& rSrcRect, + const basegfx::B2IBox& rSrcRect, const basegfx::B2IPoint& rDstPoint ); /** Draw a color with an alpha-modulation bitmap into this device @@ -465,7 +465,7 @@ public: */ void drawMaskedColor( Color aSrcColor, const BitmapDeviceSharedPtr& rAlphaMask, - const basegfx::B2IRange& rSrcRect, + const basegfx::B2IBox& rSrcRect, const basegfx::B2IPoint& rDstPoint, const BitmapDeviceSharedPtr& rClip ); @@ -506,8 +506,8 @@ public: */ void drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap, const BitmapDeviceSharedPtr& rMask, - const basegfx::B2IRange& rSrcRect, - const basegfx::B2IRange& rDstRect, + const basegfx::B2IBox& rSrcRect, + const basegfx::B2IBox& rDstRect, DrawMode drawMode ); /** Draw another bitmap through a mask into this device @@ -551,18 +551,18 @@ public: */ void drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap, const BitmapDeviceSharedPtr& rMask, - const basegfx::B2IRange& rSrcRect, - const basegfx::B2IRange& rDstRect, + const basegfx::B2IBox& rSrcRect, + const basegfx::B2IBox& rDstRect, DrawMode drawMode, const BitmapDeviceSharedPtr& rClip ); protected: - BitmapDevice( const basegfx::B2IRange& rBounds, - sal_Int32 nScanlineFormat, - sal_Int32 nScanlineStride, - sal_uInt8* pFirstScanline, - const RawMemorySharedArray& rMem, - const PaletteMemorySharedVector& rPalette ); + BitmapDevice( const basegfx::B2IBox& rBounds, + sal_Int32 nScanlineFormat, + sal_Int32 nScanlineStride, + sal_uInt8* pFirstScanline, + const RawMemorySharedArray& rMem, + const PaletteMemorySharedVector& rPalette ); virtual ~BitmapDevice(); @@ -571,8 +571,8 @@ private: virtual bool isCompatibleClipMask( const BitmapDeviceSharedPtr& bmp ) const = 0; virtual bool isCompatibleAlphaMask( const BitmapDeviceSharedPtr& bmp ) const = 0; - virtual void clear_i( Color fillColor, - const basegfx::B2IRange& rBounds ) = 0; + virtual void clear_i( Color fillColor, + const basegfx::B2IBox& rBounds ) = 0; virtual void setPixel_i( const basegfx::B2IPoint& rPt, Color lineColor, @@ -588,22 +588,22 @@ private: virtual void drawLine_i( const basegfx::B2IPoint& rPt1, const basegfx::B2IPoint& rPt2, - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, Color lineColor, DrawMode drawMode ) = 0; virtual void drawLine_i( const basegfx::B2IPoint& rPt1, const basegfx::B2IPoint& rPt2, - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, Color lineColor, DrawMode drawMode, const BitmapDeviceSharedPtr& rClip ) = 0; virtual void drawPolygon_i( const basegfx::B2DPolygon& rPoly, - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, Color lineColor, DrawMode drawMode ) = 0; virtual void drawPolygon_i( const basegfx::B2DPolygon& rPoly, - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, Color lineColor, DrawMode drawMode, const BitmapDeviceSharedPtr& rClip ) = 0; @@ -611,45 +611,45 @@ private: virtual void fillPolyPolygon_i( const basegfx::B2DPolyPolygon& rPoly, Color fillColor, DrawMode drawMode, - const basegfx::B2IRange& rBounds ) = 0; + const basegfx::B2IBox& rBounds ) = 0; virtual void fillPolyPolygon_i( const basegfx::B2DPolyPolygon& rPoly, Color fillColor, DrawMode drawMode, - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, const BitmapDeviceSharedPtr& rClip ) = 0; // must work with *this == rSrcBitmap! virtual void drawBitmap_i( const BitmapDeviceSharedPtr& rSrcBitmap, - const basegfx::B2IRange& rSrcRect, - const basegfx::B2IRange& rDstRect, + const basegfx::B2IBox& rSrcRect, + const basegfx::B2IBox& rDstRect, DrawMode drawMode ) = 0; virtual void drawBitmap_i( const BitmapDeviceSharedPtr& rSrcBitmap, - const basegfx::B2IRange& rSrcRect, - const basegfx::B2IRange& rDstRect, + const basegfx::B2IBox& rSrcRect, + const basegfx::B2IBox& rDstRect, DrawMode drawMode, const BitmapDeviceSharedPtr& rClip ) = 0; // must work with *this == rSrcBitmap! virtual void drawMaskedColor_i( Color rSrcColor, const BitmapDeviceSharedPtr& rAlphaMask, - const basegfx::B2IRange& rSrcRect, + const basegfx::B2IBox& rSrcRect, const basegfx::B2IPoint& rDstPoint ) = 0; virtual void drawMaskedColor_i( Color rSrcColor, const BitmapDeviceSharedPtr& rAlphaMask, - const basegfx::B2IRange& rSrcRect, + const basegfx::B2IBox& rSrcRect, const basegfx::B2IPoint& rDstPoint, const BitmapDeviceSharedPtr& rClip ) = 0; // must work with *this == rSrcBitmap! virtual void drawMaskedBitmap_i( const BitmapDeviceSharedPtr& rSrcBitmap, const BitmapDeviceSharedPtr& rMask, - const basegfx::B2IRange& rSrcRect, - const basegfx::B2IRange& rDstRect, + const basegfx::B2IBox& rSrcRect, + const basegfx::B2IBox& rDstRect, DrawMode drawMode ) = 0; virtual void drawMaskedBitmap_i( const BitmapDeviceSharedPtr& rSrcBitmap, const BitmapDeviceSharedPtr& rMask, - const basegfx::B2IRange& rSrcRect, - const basegfx::B2IRange& rDstRect, + const basegfx::B2IBox& rSrcRect, + const basegfx::B2IBox& rDstRect, DrawMode drawMode, const BitmapDeviceSharedPtr& rClip ) = 0; @@ -700,8 +700,8 @@ BASEBMP_DLLPUBLIC BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVe area. Useful to implement rectangular clips (usually faster than setting up a 1bpp clip mask). */ -BASEBMP_DLLPUBLIC BitmapDeviceSharedPtr subsetBitmapDevice( const BitmapDeviceSharedPtr& rProto, - const basegfx::B2IRange& rSubset ); +BASEBMP_DLLPUBLIC BitmapDeviceSharedPtr subsetBitmapDevice( const BitmapDeviceSharedPtr& rProto, + const basegfx::B2IBox& rSubset ); /** Factory method to clone a BitmapDevice from a given prototype. diff --git a/basebmp/inc/basebmp/clippedlinerenderer.hxx b/basebmp/inc/basebmp/clippedlinerenderer.hxx index e023581416d6..2fbf2f7acfe0 100644 --- a/basebmp/inc/basebmp/clippedlinerenderer.hxx +++ b/basebmp/inc/basebmp/clippedlinerenderer.hxx @@ -31,7 +31,7 @@ #include <basegfx/tools/rectcliptools.hxx> #include <basegfx/point/b2ipoint.hxx> -#include <basegfx/range/b2irange.hxx> +#include <basegfx/range/b2ibox.hxx> #include <vigra/diff2d.hxx> #include <vigra/iteratortraits.hxx> @@ -200,7 +200,7 @@ inline bool prepareClip( sal_Int32 a1, template< class Iterator, class Accessor > void renderClippedLine( basegfx::B2IPoint aPt1, basegfx::B2IPoint aPt2, - const basegfx::B2IRange& rClipRect, + const basegfx::B2IBox& rClipRect, typename Accessor::value_type color, Iterator begin, Accessor acc, diff --git a/basebmp/inc/basebmp/polypolygonrenderer.hxx b/basebmp/inc/basebmp/polypolygonrenderer.hxx index 6a7c391f31d0..37b568ea0b5b 100644 --- a/basebmp/inc/basebmp/polypolygonrenderer.hxx +++ b/basebmp/inc/basebmp/polypolygonrenderer.hxx @@ -31,7 +31,7 @@ #include <basegfx/point/b2dpoint.hxx> #include <basegfx/range/b2drange.hxx> -#include <basegfx/range/b2irange.hxx> +#include <basegfx/range/b2ibox.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/polygon/b2dpolypolygonfillrule.hxx> @@ -147,7 +147,7 @@ namespace basebmp void renderClippedPolyPolygon( DestIterator begin, DestAccessor ad, T fillColor, - const basegfx::B2IRange& rClipRect, + const basegfx::B2IBox& rClipRect, basegfx::B2DPolyPolygon const& rPoly, basegfx::FillRule eFillRule ) { diff --git a/basebmp/inc/basebmp/tools.hxx b/basebmp/inc/basebmp/tools.hxx index 0b5fcb87a693..403041d79163 100644 --- a/basebmp/inc/basebmp/tools.hxx +++ b/basebmp/inc/basebmp/tools.hxx @@ -29,24 +29,24 @@ #ifndef INCLUDED_BASEBMP_TOOLS_HXX #define INCLUDED_BASEBMP_TOOLS_HXX -#include <basegfx/range/b2irange.hxx> +#include <basegfx/range/b2ibox.hxx> #include <basegfx/point/b2ipoint.hxx> #include <vigra/tuple.hxx> #include <vigra/diff2d.hxx> namespace basebmp { - inline vigra::Diff2D topLeft( const basegfx::B2IRange& rRange ) + inline vigra::Diff2D topLeft( const basegfx::B2IBox& rRange ) { return vigra::Diff2D(rRange.getMinX(),rRange.getMinY()); } - inline vigra::Diff2D bottomRight( const basegfx::B2IRange& rRange ) + inline vigra::Diff2D bottomRight( const basegfx::B2IBox& rRange ) { return vigra::Diff2D(rRange.getMaxX(),rRange.getMaxY()); } template< class Iterator, class Accessor > inline vigra::triple<Iterator,Iterator,Accessor> destIterRange(Iterator const& begin, Accessor const& accessor, - const basegfx::B2IRange& rRange) + const basegfx::B2IBox& rRange) { return vigra::triple<Iterator,Iterator,Accessor>( begin + topLeft(rRange), @@ -58,7 +58,7 @@ namespace basebmp inline vigra::triple<Iterator,Iterator,Accessor> srcIterRange(Iterator const& begin, Accessor const& accessor, - const basegfx::B2IRange& rRange) + const basegfx::B2IBox& rRange) { return vigra::triple<Iterator,Iterator,Accessor>( begin + topLeft(rRange), |