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 | |
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')
-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 | ||||
-rw-r--r-- | basebmp/source/bitmapdevice.cxx | 225 | ||||
-rw-r--r-- | basebmp/test/bmpdemo.cxx | 4 | ||||
-rw-r--r-- | basebmp/test/bmpmasktest.cxx | 10 | ||||
-rw-r--r-- | basebmp/test/bmptest.cxx | 22 | ||||
-rw-r--r-- | basebmp/test/cliptest.cxx | 8 | ||||
-rw-r--r-- | basebmp/test/masktest.cxx | 4 | ||||
-rw-r--r-- | basebmp/test/polytest.cxx | 4 |
11 files changed, 184 insertions, 189 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), diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx index 04829832af73..5ac1550df157 100644 --- a/basebmp/source/bitmapdevice.cxx +++ b/basebmp/source/bitmapdevice.cxx @@ -26,10 +26,6 @@ * ************************************************************************/ -// FIXME: in vigra -#if defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x580) -#include <math.h> // needed for fabs, hypot -#endif #include "basebmp/bitmapdevice.hxx" #include "basebmp/compositeiterator.hxx" @@ -64,6 +60,8 @@ #include <osl/diagnose.h> #include <basegfx/tools/tools.hxx> +#include <basegfx/tools/canvastools.hxx> +#include <basegfx/range/b2ibox.hxx> #include <basegfx/range/b2irange.hxx> #include <basegfx/range/b2drange.hxx> #include <basegfx/polygon/b2dpolygon.hxx> @@ -292,7 +290,7 @@ namespace // ------------------------------------------------------- - BitmapRenderer( const basegfx::B2IRange& rBounds, + BitmapRenderer( const basegfx::B2IBox& rBounds, sal_Int32 nScanlineFormat, sal_Int32 nScanlineStride, sal_uInt8* pFirstScanline, @@ -325,19 +323,19 @@ namespace private: - void damaged( const basegfx::B2IRange& rDamageRect ) const + void damaged( const basegfx::B2IBox& rDamageRect ) const { if( mpDamage ) mpDamage->damaged( rDamageRect ); } void damagedPointSize( const basegfx::B2IPoint& rPoint, - const basegfx::B2IRange& rSize ) const + const basegfx::B2IBox& rSize ) const { if( mpDamage ) { basegfx::B2IPoint aLower( rPoint.getX() + rSize.getWidth(), rPoint.getY() + rSize.getHeight() ); - damaged( basegfx::B2IRange( rPoint, aLower ) ); + damaged( basegfx::B2IBox( rPoint, aLower ) ); } } @@ -347,7 +345,7 @@ namespace return; basegfx::B2IPoint aEnd( rDamagePoint.getX() + 1, rDamagePoint.getY() + 1 ); - damaged( basegfx::B2IRange( rDamagePoint, aEnd ) ); + damaged( basegfx::B2IBox( rDamagePoint, aEnd ) ); } boost::shared_ptr<BitmapRenderer> getCompatibleBitmap( const BitmapDeviceSharedPtr& bmp ) const @@ -394,8 +392,8 @@ namespace return getCompatibleAlphaMask( bmp ).get() != NULL; } - virtual void clear_i( Color fillColor, - const basegfx::B2IRange& rBounds ) + virtual void clear_i( Color fillColor, + const basegfx::B2IBox& rBounds ) { fillImage(destIterRange(maBegin, maRawAccessor, @@ -465,7 +463,7 @@ namespace template< typename Iterator, typename Col, typename RawAcc > void implRenderLine2( const basegfx::B2IPoint& rPt1, const basegfx::B2IPoint& rPt2, - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, Col col, const Iterator& begin, const RawAcc& rawAcc ) @@ -478,13 +476,13 @@ namespace rawAcc ); // TODO(P2): perhaps this needs pushing up the stack a bit // to make more complex polygons more efficient ... - damaged( basegfx::B2IRange( rPt1, rPt2 ) ); + damaged( basegfx::B2IBox( rPt1, rPt2 ) ); } template< typename Iterator, typename Accessor, typename RawAcc > void implRenderLine( const basegfx::B2IPoint& rPt1, const basegfx::B2IPoint& rPt2, - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, Color col, const Iterator& begin, const Accessor& acc, @@ -500,7 +498,7 @@ namespace template< typename Iterator, typename RawAcc, typename XorAcc > void implDrawLine( const basegfx::B2IPoint& rPt1, const basegfx::B2IPoint& rPt2, - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, Color col, const Iterator& begin, const RawAcc& rawAcc, @@ -517,7 +515,7 @@ namespace virtual void drawLine_i(const basegfx::B2IPoint& rPt1, const basegfx::B2IPoint& rPt2, - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, Color lineColor, DrawMode drawMode ) { @@ -537,7 +535,7 @@ namespace 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 ) @@ -550,7 +548,7 @@ namespace template< typename Iterator, typename RawAcc > void implDrawPolygon( const basegfx::B2DPolygon& rPoly, - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, Color col, const Iterator& begin, const RawAcc& acc ) @@ -581,7 +579,7 @@ namespace } virtual void drawPolygon_i(const basegfx::B2DPolygon& rPoly, - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, Color lineColor, DrawMode drawMode ) { @@ -596,7 +594,7 @@ namespace } virtual void drawPolygon_i(const basegfx::B2DPolygon& rPoly, - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, Color lineColor, DrawMode drawMode, const BitmapDeviceSharedPtr& rClip ) @@ -616,7 +614,7 @@ namespace Color col, const Iterator& begin, const RawAcc& acc, - const basegfx::B2IRange& rBounds ) + const basegfx::B2IBox& rBounds ) { basegfx::B2DPolyPolygon aPoly( rPoly ); if( rPoly.areControlPointsUsed() ) @@ -633,14 +631,14 @@ namespace if( mpDamage ) { basegfx::B2DRange const aPolyBounds( basegfx::tools::getRange(aPoly) ); - damaged( basegfx::fround( aPolyBounds ) ); + damaged( basegfx::unotools::b2ISurroundingBoxFromB2DRange( aPolyBounds ) ); } } virtual void fillPolyPolygon_i(const basegfx::B2DPolyPolygon& rPoly, Color fillColor, DrawMode drawMode, - const basegfx::B2IRange& rBounds ) + const basegfx::B2IBox& rBounds ) { if( drawMode == DrawMode_XOR ) implFillPolyPolygon( rPoly, fillColor, @@ -657,7 +655,7 @@ namespace virtual void fillPolyPolygon_i(const basegfx::B2DPolyPolygon& rPoly, Color fillColor, DrawMode drawMode, - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, const BitmapDeviceSharedPtr& rClip ) { if( drawMode == DrawMode_XOR ) @@ -674,8 +672,8 @@ namespace template< typename Iterator, typename RawAcc > void implDrawBitmap(const BitmapDeviceSharedPtr& rSrcBitmap, - const basegfx::B2IRange& rSrcRect, - const basegfx::B2IRange& rDstRect, + const basegfx::B2IBox& rSrcRect, + const basegfx::B2IBox& rDstRect, const Iterator& begin, const RawAcc& acc) { @@ -695,8 +693,8 @@ namespace template< typename Iterator, typename Acc > void implDrawBitmapGeneric(const BitmapDeviceSharedPtr& rSrcBitmap, - const basegfx::B2IRange& rSrcRect, - const basegfx::B2IRange& rDstRect, + const basegfx::B2IBox& rSrcRect, + const basegfx::B2IBox& rDstRect, const Iterator& begin, const Acc& acc) { @@ -713,8 +711,8 @@ namespace } 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 ) { if( isCompatibleBitmap( rSrcBitmap ) ) @@ -743,8 +741,8 @@ namespace } 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 ) { @@ -775,7 +773,7 @@ namespace virtual void drawMaskedColor_i(Color aSrcColor, const BitmapDeviceSharedPtr& rAlphaMask, - const basegfx::B2IRange& rSrcRect, + const basegfx::B2IBox& rSrcRect, const basegfx::B2IPoint& rDstPoint ) { boost::shared_ptr<mask_bitmap_type> pMask( getCompatibleClipMask(rAlphaMask) ); @@ -824,7 +822,7 @@ namespace virtual void drawMaskedColor_i(Color aSrcColor, const BitmapDeviceSharedPtr& rAlphaMask, - const basegfx::B2IRange& rSrcRect, + const basegfx::B2IBox& rSrcRect, const basegfx::B2IPoint& rDstPoint, const BitmapDeviceSharedPtr& rClip ) { @@ -888,8 +886,8 @@ namespace template< typename Iterator, typename Acc > void implDrawMaskedBitmap(const BitmapDeviceSharedPtr& rSrcBitmap, const BitmapDeviceSharedPtr& rMask, - const basegfx::B2IRange& rSrcRect, - const basegfx::B2IRange& rDstRect, + const basegfx::B2IBox& rSrcRect, + const basegfx::B2IBox& rDstRect, const Iterator& begin, const Acc& acc) { @@ -919,8 +917,8 @@ namespace template< typename Iterator, typename Acc > void implDrawMaskedBitmapGeneric(const BitmapDeviceSharedPtr& rSrcBitmap, const BitmapDeviceSharedPtr& rMask, - const basegfx::B2IRange& rSrcRect, - const basegfx::B2IRange& rDstRect, + const basegfx::B2IBox& rSrcRect, + const basegfx::B2IBox& rDstRect, const Iterator& begin, const Acc& acc) { @@ -952,8 +950,8 @@ namespace 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 ) { if( isCompatibleClipMask(rMask) && @@ -988,8 +986,8 @@ namespace 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 ) { @@ -1052,7 +1050,7 @@ struct ImplBitmapDevice area under the excluding-bottommost-and-rightmost-pixels fill rule) */ - basegfx::B2IRange maBounds; + basegfx::B2IBox maBounds; /** Bounds of the device. @@ -1064,7 +1062,7 @@ struct ImplBitmapDevice The member is used to clip line stroking against the device bounds. */ - basegfx::B2IRange maLineClipRect; + basegfx::B2IBox maLineClipRect; /// Scanline format, as provided at the constructor sal_Int32 mnScanlineFormat; @@ -1093,7 +1091,7 @@ struct ImplBitmapDevice }; -BitmapDevice::BitmapDevice( const basegfx::B2IRange& rBounds, +BitmapDevice::BitmapDevice( const basegfx::B2IBox& rBounds, sal_Int32 nScanlineFormat, sal_Int32 nScanlineStride, sal_uInt8* pFirstScanline, @@ -1104,10 +1102,7 @@ BitmapDevice::BitmapDevice( const basegfx::B2IRange& rBounds, mpImpl->mpMem = rMem; mpImpl->mpPalette = rPalette; mpImpl->maBounds = rBounds; - mpImpl->maLineClipRect = basegfx::B2IRange( rBounds.getMinX(), - rBounds.getMinY(), - rBounds.getMaxX()-1, - rBounds.getMaxY()-1 ); + mpImpl->maLineClipRect = rBounds; mpImpl->mnScanlineFormat = nScanlineFormat; mpImpl->mnScanlineStride = nScanlineStride; mpImpl->mpFirstScanline = pFirstScanline; @@ -1315,17 +1310,17 @@ void BitmapDevice::fillPolyPolygon( const basegfx::B2DPolyPolygon& rPoly, namespace { void assertImagePoint( const basegfx::B2IPoint& rPt, - const basegfx::B2IRange& rPermittedRange ) + const basegfx::B2IBox& rPermittedRange ) { (void)rPt; (void)rPermittedRange; OSL_ASSERT( rPermittedRange.isInside(rPt) ); } - void assertImageRange( const basegfx::B2IRange& rRange, - const basegfx::B2IRange& rPermittedRange ) + void assertImageRange( const basegfx::B2IBox& rRange, + const basegfx::B2IBox& rPermittedRange ) { #if OSL_DEBUG_LEVEL > 0 - basegfx::B2IRange aRange( rRange ); + basegfx::B2IBox aRange( rRange ); aRange.intersect( rPermittedRange ); OSL_ASSERT( aRange == rRange ); @@ -1336,15 +1331,15 @@ namespace // TODO(Q3): Move canvas/canvastools.hxx clipBlit() down // to basegfx, and use here! - bool clipAreaImpl( ::basegfx::B2IRange& io_rSourceArea, - ::basegfx::B2IPoint& io_rDestPoint, - const ::basegfx::B2IRange& rSourceBounds, - const ::basegfx::B2IRange& rDestBounds ) + bool clipAreaImpl( ::basegfx::B2IBox& io_rSourceArea, + ::basegfx::B2IPoint& io_rDestPoint, + const ::basegfx::B2IBox& rSourceBounds, + const ::basegfx::B2IBox& rDestBounds ) { const ::basegfx::B2IPoint aSourceTopLeft( io_rSourceArea.getMinimum() ); - ::basegfx::B2IRange aLocalSourceArea( io_rSourceArea ); + ::basegfx::B2IBox aLocalSourceArea( io_rSourceArea ); // clip source area (which must be inside rSourceBounds) aLocalSourceArea.intersect( rSourceBounds ); @@ -1359,8 +1354,8 @@ namespace const ::basegfx::B2IVector aLowerRightOffset( aLocalSourceArea.getMaximum()-aSourceTopLeft ); - ::basegfx::B2IRange aLocalDestArea( io_rDestPoint + aUpperLeftOffset, - io_rDestPoint + aLowerRightOffset ); + ::basegfx::B2IBox aLocalDestArea( io_rDestPoint + aUpperLeftOffset, + io_rDestPoint + aLowerRightOffset ); // clip dest area (which must be inside rDestBounds) aLocalDestArea.intersect( rDestBounds ); @@ -1375,8 +1370,8 @@ namespace const ::basegfx::B2IVector aDestLowerRightOffset( aLocalDestArea.getMaximum()-io_rDestPoint ); - io_rSourceArea = ::basegfx::B2IRange( aSourceTopLeft + aDestUpperLeftOffset, - aSourceTopLeft + aDestLowerRightOffset ); + io_rSourceArea = ::basegfx::B2IBox( aSourceTopLeft + aDestUpperLeftOffset, + aSourceTopLeft + aDestLowerRightOffset ); io_rDestPoint = aLocalDestArea.getMinimum(); return true; @@ -1384,10 +1379,10 @@ namespace // TODO(Q3): Move canvas/canvastools.hxx clipBlit() down // to basegfx, and use here! - bool clipAreaImpl( ::basegfx::B2IRange& io_rDestArea, - ::basegfx::B2IRange& io_rSourceArea, - const ::basegfx::B2IRange& rDestBounds, - const ::basegfx::B2IRange& rSourceBounds ) + bool clipAreaImpl( ::basegfx::B2IBox& io_rDestArea, + ::basegfx::B2IBox& io_rSourceArea, + const ::basegfx::B2IBox& rDestBounds, + const ::basegfx::B2IBox& rSourceBounds ) { // extract inherent scale const double nScaleX( io_rDestArea.getWidth() / (double)io_rSourceArea.getWidth() ); @@ -1399,7 +1394,7 @@ namespace const ::basegfx::B2IPoint aSourceTopLeft( io_rSourceArea.getMinimum() ); - ::basegfx::B2IRange aLocalSourceArea( io_rSourceArea ); + ::basegfx::B2IBox aLocalSourceArea( io_rSourceArea ); // clip source area (which must be inside rSourceBounds) aLocalSourceArea.intersect( rSourceBounds ); @@ -1414,10 +1409,10 @@ namespace const ::basegfx::B2IVector aLowerRightOffset( aLocalSourceArea.getMaximum()-aSourceTopLeft ); - ::basegfx::B2IRange aLocalDestArea( basegfx::fround(aDestTopLeft.getX() + nScaleX*aUpperLeftOffset.getX()), - basegfx::fround(aDestTopLeft.getY() + nScaleY*aUpperLeftOffset.getY()), - basegfx::fround(aDestTopLeft.getX() + nScaleX*aLowerRightOffset.getX()), - basegfx::fround(aDestTopLeft.getY() + nScaleY*aLowerRightOffset.getY()) ); + ::basegfx::B2IBox aLocalDestArea( basegfx::fround(aDestTopLeft.getX() + nScaleX*aUpperLeftOffset.getX()), + basegfx::fround(aDestTopLeft.getY() + nScaleY*aUpperLeftOffset.getY()), + basegfx::fround(aDestTopLeft.getX() + nScaleX*aLowerRightOffset.getX()), + basegfx::fround(aDestTopLeft.getY() + nScaleY*aLowerRightOffset.getY()) ); // clip dest area (which must be inside rDestBounds) aLocalDestArea.intersect( rDestBounds ); @@ -1432,10 +1427,10 @@ namespace const ::basegfx::B2IVector aDestLowerRightOffset( aLocalDestArea.getMaximum()-aDestTopLeft ); - io_rSourceArea = ::basegfx::B2IRange( basegfx::fround(aSourceTopLeft.getX() + aDestUpperLeftOffset.getX()/nScaleX), - basegfx::fround(aSourceTopLeft.getY() + aDestUpperLeftOffset.getY()/nScaleY), - basegfx::fround(aSourceTopLeft.getX() + aDestLowerRightOffset.getX()/nScaleX), - basegfx::fround(aSourceTopLeft.getY() + aDestLowerRightOffset.getY()/nScaleY) ); + io_rSourceArea = ::basegfx::B2IBox( basegfx::fround(aSourceTopLeft.getX() + aDestUpperLeftOffset.getX()/nScaleX), + basegfx::fround(aSourceTopLeft.getY() + aDestUpperLeftOffset.getY()/nScaleY), + basegfx::fround(aSourceTopLeft.getX() + aDestLowerRightOffset.getX()/nScaleX), + basegfx::fround(aSourceTopLeft.getY() + aDestLowerRightOffset.getY()/nScaleY) ); io_rDestArea = aLocalDestArea; // final source area clip (chopping round-offs) @@ -1450,14 +1445,14 @@ namespace } void BitmapDevice::drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap, - const basegfx::B2IRange& rSrcRect, - const basegfx::B2IRange& rDstRect, + const basegfx::B2IBox& rSrcRect, + const basegfx::B2IBox& rDstRect, DrawMode drawMode ) { const basegfx::B2IVector& rSrcSize( rSrcBitmap->getSize() ); - const basegfx::B2IRange aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() ); - basegfx::B2IRange aSrcRange( rSrcRect ); - basegfx::B2IRange aDestRange( rDstRect ); + const basegfx::B2IBox aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() ); + basegfx::B2IBox aSrcRange( rSrcRect ); + basegfx::B2IBox aDestRange( rDstRect ); if( clipAreaImpl( aDestRange, aSrcRange, @@ -1472,8 +1467,8 @@ void BitmapDevice::drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap, } void BitmapDevice::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 ) { @@ -1484,9 +1479,9 @@ void BitmapDevice::drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap, } const basegfx::B2IVector& rSrcSize( rSrcBitmap->getSize() ); - const basegfx::B2IRange aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() ); - basegfx::B2IRange aSrcRange( rSrcRect ); - basegfx::B2IRange aDestRange( rDstRect ); + const basegfx::B2IBox aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() ); + basegfx::B2IBox aSrcRange( rSrcRect ); + basegfx::B2IBox aDestRange( rDstRect ); if( clipAreaImpl( aDestRange, aSrcRange, @@ -1510,12 +1505,12 @@ void BitmapDevice::drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap, void BitmapDevice::drawMaskedColor( Color aSrcColor, const BitmapDeviceSharedPtr& rAlphaMask, - const basegfx::B2IRange& rSrcRect, + const basegfx::B2IBox& rSrcRect, const basegfx::B2IPoint& rDstPoint ) { const basegfx::B2IVector& rSrcSize( rAlphaMask->getSize() ); - const basegfx::B2IRange aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() ); - basegfx::B2IRange aSrcRange( rSrcRect ); + const basegfx::B2IBox aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() ); + basegfx::B2IBox aSrcRange( rSrcRect ); basegfx::B2IPoint aDestPoint( rDstPoint ); if( clipAreaImpl( aSrcRange, @@ -1537,8 +1532,8 @@ void BitmapDevice::drawMaskedColor( Color aSrcColor, cloneBitmapDevice( aSize, shared_from_this()) ); basegfx::B2ITuple aGcc3WorkaroundTemporary; - const basegfx::B2IRange aAlphaRange( aGcc3WorkaroundTemporary, - aSize ); + const basegfx::B2IBox aAlphaRange( aGcc3WorkaroundTemporary, + aSize ); pAlphaCopy->drawBitmap(rAlphaMask, aSrcRange, aAlphaRange, @@ -1554,7 +1549,7 @@ void BitmapDevice::drawMaskedColor( Color aSrcColor, void BitmapDevice::drawMaskedColor( Color aSrcColor, const BitmapDeviceSharedPtr& rAlphaMask, - const basegfx::B2IRange& rSrcRect, + const basegfx::B2IBox& rSrcRect, const basegfx::B2IPoint& rDstPoint, const BitmapDeviceSharedPtr& rClip ) { @@ -1565,8 +1560,8 @@ void BitmapDevice::drawMaskedColor( Color aSrcColor, } const basegfx::B2IVector& rSrcSize( rAlphaMask->getSize() ); - const basegfx::B2IRange aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() ); - basegfx::B2IRange aSrcRange( rSrcRect ); + const basegfx::B2IBox aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() ); + basegfx::B2IBox aSrcRange( rSrcRect ); basegfx::B2IPoint aDestPoint( rDstPoint ); if( clipAreaImpl( aSrcRange, @@ -1590,8 +1585,8 @@ void BitmapDevice::drawMaskedColor( Color aSrcColor, cloneBitmapDevice( aSize, shared_from_this()) ); basegfx::B2ITuple aGcc3WorkaroundTemporary; - const basegfx::B2IRange aAlphaRange( aGcc3WorkaroundTemporary, - aSize ); + const basegfx::B2IBox aAlphaRange( aGcc3WorkaroundTemporary, + aSize ); pAlphaCopy->drawBitmap(rAlphaMask, aSrcRange, aAlphaRange, @@ -1613,16 +1608,16 @@ void BitmapDevice::drawMaskedColor( Color aSrcColor, void BitmapDevice::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 ) { OSL_ASSERT( rMask->getSize() == rSrcBitmap->getSize() ); const basegfx::B2IVector& rSrcSize( rSrcBitmap->getSize() ); - const basegfx::B2IRange aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() ); - basegfx::B2IRange aSrcRange( rSrcRect ); - basegfx::B2IRange aDestRange( rDstRect ); + const basegfx::B2IBox aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() ); + basegfx::B2IBox aSrcRange( rSrcRect ); + basegfx::B2IBox aDestRange( rDstRect ); if( clipAreaImpl( aDestRange, aSrcRange, @@ -1638,8 +1633,8 @@ void BitmapDevice::drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap, void BitmapDevice::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 ) { @@ -1652,9 +1647,9 @@ void BitmapDevice::drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap, OSL_ASSERT( rMask->getSize() == rSrcBitmap->getSize() ); const basegfx::B2IVector& rSrcSize( rSrcBitmap->getSize() ); - const basegfx::B2IRange aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() ); - basegfx::B2IRange aSrcRange( rSrcRect ); - basegfx::B2IRange aDestRange( rDstRect ); + const basegfx::B2IBox aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() ); + basegfx::B2IBox aSrcRange( rSrcRect ); + basegfx::B2IBox aDestRange( rDstRect ); if( clipAreaImpl( aDestRange, aSrcRange, @@ -1703,7 +1698,7 @@ struct StdMasks /// Produces a specialized renderer for the given pixel format template< class FormatTraits, class MaskTraits > BitmapDeviceSharedPtr createRenderer( - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, sal_Int32 nScanlineFormat, sal_Int32 nScanlineStride, sal_uInt8* pFirstScanline, @@ -1717,7 +1712,7 @@ BitmapDeviceSharedPtr createRenderer( template< class FormatTraits, class MaskTraits, class Accessor > BitmapDeviceSharedPtr createRenderer( - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, sal_Int32 nScanlineFormat, sal_Int32 nScanlineStride, sal_uInt8* pFirstScanline, @@ -1774,7 +1769,7 @@ PaletteMemorySharedVector createStandardPalette( template< class FormatTraits, class MaskTraits > BitmapDeviceSharedPtr createRenderer( - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, sal_Int32 nScanlineFormat, sal_Int32 nScanlineStride, sal_uInt8* pFirstScanline, @@ -1798,7 +1793,7 @@ BitmapDeviceSharedPtr createRenderer( template< class FormatTraits, class MaskTraits > BitmapDeviceSharedPtr createRenderer( - const basegfx::B2IRange& rBounds, + const basegfx::B2IBox& rBounds, sal_Int32 nScanlineFormat, sal_Int32 nScanlineStride, sal_uInt8* pFirstScanline, @@ -1860,7 +1855,7 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector& sal_Int32 nScanlineFormat, boost::shared_array< sal_uInt8 > pMem, PaletteMemorySharedVector pPal, - const basegfx::B2IRange* pSubset, + const basegfx::B2IBox* pSubset, const IBitmapDeviceDamageTrackerSharedPtr& rDamage ) { if( nScanlineFormat <= Format::NONE || @@ -1917,7 +1912,7 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector& pMem.get() + nMemSize + nScanlineStride : pMem.get(); // shrink render area to given subset, if given - basegfx::B2IRange aBounds(0,0,rSize.getX(),rSize.getY()); + basegfx::B2IBox aBounds(0,0,rSize.getX(),rSize.getY()); if( pSubset ) aBounds.intersect( *pSubset ); @@ -2074,8 +2069,8 @@ BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize IBitmapDeviceDamageTrackerSharedPtr() ); } -BitmapDeviceSharedPtr subsetBitmapDevice( const BitmapDeviceSharedPtr& rProto, - const basegfx::B2IRange& rSubset ) +BitmapDeviceSharedPtr subsetBitmapDevice( const BitmapDeviceSharedPtr& rProto, + const basegfx::B2IBox& rSubset ) { return createBitmapDeviceImpl( rProto->getSize(), rProto->isTopDown(), @@ -2086,8 +2081,8 @@ BitmapDeviceSharedPtr subsetBitmapDevice( const BitmapDeviceSharedPtr& rProt rProto->getDamageTracker() ); } -BitmapDeviceSharedPtr cloneBitmapDevice( const basegfx::B2IVector& rSize, - const BitmapDeviceSharedPtr& rProto ) +BitmapDeviceSharedPtr cloneBitmapDevice( const basegfx::B2IVector& rSize, + const BitmapDeviceSharedPtr& rProto ) { return createBitmapDeviceImpl( rSize, rProto->isTopDown(), diff --git a/basebmp/test/bmpdemo.cxx b/basebmp/test/bmpdemo.cxx index b3e7096c0da9..4f53c3c5f40e 100644 --- a/basebmp/test/bmpdemo.cxx +++ b/basebmp/test/bmpdemo.cxx @@ -56,7 +56,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/numeric/ftools.hxx> -#include <basegfx/range/b2irange.hxx> +#include <basegfx/range/b2ibox.hxx> #include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2enums.hxx> #include <basegfx/point/b2ipoint.hxx> @@ -1109,7 +1109,7 @@ void TestWindow::Paint( const Rectangle& /*rRect*/ ) basebmp::BitmapDeviceSharedPtr pSubsetDevice = basebmp::subsetBitmapDevice( pDevice, - basegfx::B2IRange(3,3,7,7) ); + basegfx::B2IBox(3,3,7,7) ); const basegfx::B2IPoint aPt1(0,0); const basegfx::B2IPoint aPt2(1,9); diff --git a/basebmp/test/bmpmasktest.cxx b/basebmp/test/bmpmasktest.cxx index 755128b303f1..e44aaeda0c8f 100644 --- a/basebmp/test/bmpmasktest.cxx +++ b/basebmp/test/bmpmasktest.cxx @@ -36,7 +36,7 @@ #include "cppunit/extensions/HelperMacros.h" #include <basegfx/vector/b2isize.hxx> -#include <basegfx/range/b2irange.hxx> +#include <basegfx/range/b2ibox.hxx> #include <basegfx/point/b2ipoint.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> @@ -67,8 +67,8 @@ private: rDevice->clear(Color(0)); const Color aCol(0xFFFFFFFF); - const basegfx::B2IRange aSourceRect(0,0,10,10); - const basegfx::B2IRange aDestAll(0,0,10,10); + const basegfx::B2IBox aSourceRect(0,0,10,10); + const basegfx::B2IBox aDestAll(0,0,10,10); rDevice->drawMaskedBitmap( rBmp, @@ -86,8 +86,8 @@ private: rDevice->clear(Color(0)); const Color aCol(0xFFFFFFFF); - const basegfx::B2IRange aSourceRect(0,0,10,10); - const basegfx::B2IRange aDestLeftTop(0,0,6,6); + const basegfx::B2IBox aSourceRect(0,0,10,10); + const basegfx::B2IBox aDestLeftTop(0,0,6,6); rDevice->drawMaskedBitmap( rBmp, diff --git a/basebmp/test/bmptest.cxx b/basebmp/test/bmptest.cxx index 6a42c6149f50..65109239e42b 100644 --- a/basebmp/test/bmptest.cxx +++ b/basebmp/test/bmptest.cxx @@ -36,7 +36,7 @@ #include "cppunit/extensions/HelperMacros.h" #include <basegfx/vector/b2isize.hxx> -#include <basegfx/range/b2irange.hxx> +#include <basegfx/range/b2ibox.hxx> #include <basegfx/point/b2ipoint.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> @@ -66,11 +66,11 @@ private: rDevice->clear(Color(0)); const Color aCol(0xFFFFFFFF); - const basegfx::B2IRange aSourceRect(0,0,10,10); - const basegfx::B2IRange aDestLeftTop(0,0,4,4); - const basegfx::B2IRange aDestRightTop(6,0,10,4); - const basegfx::B2IRange aDestLeftBottom(0,6,4,10); - const basegfx::B2IRange aDestRightBottom(6,6,10,10); + const basegfx::B2IBox aSourceRect(0,0,10,10); + const basegfx::B2IBox aDestLeftTop(0,0,4,4); + const basegfx::B2IBox aDestRightTop(6,0,10,4); + const basegfx::B2IBox aDestLeftBottom(0,6,4,10); + const basegfx::B2IBox aDestRightBottom(6,6,10,10); rDevice->drawBitmap( rBmp, @@ -111,11 +111,11 @@ private: rDevice->clear(Color(0)); const Color aCol(0xFFFFFFFF); - const basegfx::B2IRange aSourceRect(0,0,10,10); - const basegfx::B2IRange aDestLeftTop(-2,-2,2,2); - const basegfx::B2IRange aDestRightTop(8,-2,12,2); - const basegfx::B2IRange aDestLeftBottom(-2,8,2,12); - const basegfx::B2IRange aDestRightBottom(8,8,12,12); + const basegfx::B2IBox aSourceRect(0,0,10,10); + const basegfx::B2IBox aDestLeftTop(-2,-2,2,2); + const basegfx::B2IBox aDestRightTop(8,-2,12,2); + const basegfx::B2IBox aDestLeftBottom(-2,8,2,12); + const basegfx::B2IBox aDestRightBottom(8,8,12,12); rDevice->drawBitmap( rBmp, diff --git a/basebmp/test/cliptest.cxx b/basebmp/test/cliptest.cxx index 08812a9354ce..dd5ff85f44d9 100644 --- a/basebmp/test/cliptest.cxx +++ b/basebmp/test/cliptest.cxx @@ -38,7 +38,7 @@ #include <basegfx/vector/b2isize.hxx> #include <basegfx/point/b2ipoint.hxx> #include <basegfx/range/b2drange.hxx> -#include <basegfx/range/b2irange.hxx> +#include <basegfx/range/b2ibox.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> @@ -155,8 +155,8 @@ private: rDevice->clear(aCol1); rDevice->drawBitmap(pBmp, - basegfx::B2IRange(0,0,3,3), - basegfx::B2IRange(-1,-1,4,4), + basegfx::B2IBox(0,0,3,3), + basegfx::B2IBox(-1,-1,4,4), DrawMode_PAINT, mpClipMask); @@ -183,7 +183,7 @@ private: aCol, basebmp::DrawMode_PAINT ); - const basegfx::B2IRange aSourceRect(0,0,10,10); + const basegfx::B2IBox aSourceRect(0,0,10,10); const basegfx::B2IPoint aDestLeftTop(0,0); const Color aCol2(0xF0F0F0F0); rDevice->drawMaskedColor( diff --git a/basebmp/test/masktest.cxx b/basebmp/test/masktest.cxx index 3847d60c3657..8918a7a53e28 100644 --- a/basebmp/test/masktest.cxx +++ b/basebmp/test/masktest.cxx @@ -36,7 +36,7 @@ #include "cppunit/extensions/HelperMacros.h" #include <basegfx/vector/b2isize.hxx> -#include <basegfx/range/b2irange.hxx> +#include <basegfx/range/b2ibox.hxx> #include <basegfx/point/b2ipoint.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> @@ -65,7 +65,7 @@ private: const Color aCol(0); const Color aCol2(0xF0F0F0F0); - const basegfx::B2IRange aSourceRect(0,0,10,10); + const basegfx::B2IBox aSourceRect(0,0,10,10); const basegfx::B2IPoint aDestLeftTop(0,0); const basegfx::B2IPoint aDestRightTop(5,0); const basegfx::B2IPoint aDestLeftBottom(0,5); diff --git a/basebmp/test/polytest.cxx b/basebmp/test/polytest.cxx index 0be253ead882..177557cec565 100644 --- a/basebmp/test/polytest.cxx +++ b/basebmp/test/polytest.cxx @@ -36,7 +36,7 @@ #include "cppunit/extensions/HelperMacros.h" #include <basegfx/vector/b2isize.hxx> -#include <basegfx/range/b2irange.hxx> +#include <basegfx/range/b2ibox.hxx> #include <basegfx/point/b2ipoint.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolygon.hxx> @@ -191,7 +191,7 @@ private: BitmapDeviceSharedPtr pClippedDevice( subsetBitmapDevice( rDevice, - basegfx::B2IRange(3,3,5,8) )); + basegfx::B2IBox(3,3,5,8) )); rDevice->clear(aBgCol); pClippedDevice->fillPolyPolygon( |