diff options
-rw-r--r-- | include/vcl/bitmap.hxx | 19 | ||||
-rw-r--r-- | sd/source/ui/dlg/vectdlg.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/impvect.cxx | 14 | ||||
-rw-r--r-- | vcl/source/gdi/impvect.hxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/text.cxx | 2 |
6 files changed, 26 insertions, 19 deletions
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 8ee2c872fd7b..a9f2146280c7 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -71,10 +71,17 @@ namespace o3tl template<> struct typed_flags<BmpDitherFlags> : is_typed_flags<BmpDitherFlags, 0x07> {}; } -#define BMP_VECTORIZE_INNER 0x00000001UL -#define BMP_VECTORIZE_OUTER 0x00000002UL -#define BMP_VECTORIZE_BOUND_ONLY 0x00000004UL -#define BMP_VECTORIZE_REDUCE_EDGES 0x00000008UL +enum class BmpVectorizeFlags +{ + Inner = 0x0001, + Outer = 0x0002, + BoundOnly = 0x0004, + ReduceEdges = 0x0008, +}; +namespace o3tl +{ + template<> struct typed_flags<BmpVectorizeFlags> : is_typed_flags<BmpVectorizeFlags, 0x0f> {}; +} #define BMP_COL_TRANS Color( 252, 3, 251 ) @@ -721,7 +728,7 @@ public: */ bool Vectorize( tools::PolyPolygon& rPolyPoly, - sal_uLong nFlags = BMP_VECTORIZE_OUTER, + BmpVectorizeFlags nFlags = BmpVectorizeFlags::Outer, const Link<>* pProgress = NULL ); /** Convert the bitmap to a meta file @@ -748,7 +755,7 @@ public: bool Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce = 0, - sal_uLong nFlags = BMP_VECTORIZE_INNER, + BmpVectorizeFlags nFlags = BmpVectorizeFlags::Inner, const Link<>* pProgress = NULL ); /** Change various global color characteristics diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index 99271d207f90..1865ac53f17f 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -159,7 +159,7 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf ) if( !!aTmp ) { const Link<> aPrgsHdl( LINK( this, SdVectorizeDlg, ProgressHdl ) ); - aTmp.Vectorize( rMtf, (sal_uInt8) m_pMtReduce->GetValue(), BMP_VECTORIZE_OUTER | BMP_VECTORIZE_REDUCE_EDGES, &aPrgsHdl ); + aTmp.Vectorize( rMtf, (sal_uInt8) m_pMtReduce->GetValue(), BmpVectorizeFlags::Outer | BmpVectorizeFlags::ReduceEdges, &aPrgsHdl ); if( m_pCbFillHoles->IsChecked() ) { diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 4ed1aab1143f..9a656d60daa6 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -2445,12 +2445,12 @@ void Bitmap::ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal, } } -bool Bitmap::Vectorize( tools::PolyPolygon& rPolyPoly, sal_uLong nFlags, const Link<>* pProgress ) +bool Bitmap::Vectorize( tools::PolyPolygon& rPolyPoly, BmpVectorizeFlags nFlags, const Link<>* pProgress ) { return ImplVectorizer::ImplVectorize( *this, rPolyPoly, nFlags, pProgress ); } -bool Bitmap::Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce, sal_uLong nFlags, const Link<>* pProgress ) +bool Bitmap::Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce, BmpVectorizeFlags nFlags, const Link<>* pProgress ) { return ImplVectorizer::ImplVectorize( *this, rMtf, cReduce, nFlags, pProgress ); } diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index fb640216d483..166f0be37148 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -52,7 +52,7 @@ class ImplChain; namespace ImplVectorizer { ImplVectMap* ImplExpand( BitmapReadAccess* pRAcc, const Color& rColor ); - void ImplCalculate( ImplVectMap* pMap, tools::PolyPolygon& rPolyPoly, sal_uInt8 cReduce, sal_uLong nFlags ); + void ImplCalculate( ImplVectMap* pMap, tools::PolyPolygon& rPolyPoly, sal_uInt8 cReduce, BmpVectorizeFlags nFlags ); bool ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain ); bool ImplIsUp( ImplVectMap* pMap, long nY, long nX ); void ImplLimitPolyPoly( tools::PolyPolygon& rPolyPoly ); @@ -634,7 +634,7 @@ void ImplChain::ImplPostProcess( const ImplPointArray& rArr ) namespace ImplVectorizer { bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf, - sal_uInt8 cReduce, sal_uLong nFlags, const Link<>* pProgress ) + sal_uInt8 cReduce, BmpVectorizeFlags nFlags, const Link<>* pProgress ) { bool bRet = false; @@ -697,7 +697,7 @@ bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf, { ImplLimitPolyPoly( aPolyPoly ); - if( nFlags & BMP_VECTORIZE_REDUCE_EDGES ) + if( nFlags & BmpVectorizeFlags::ReduceEdges ) aPolyPoly.Optimize( PolyOptimizeFlags::EDGES ); if( aPolyPoly.Count() ) @@ -737,7 +737,7 @@ bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf, bool ImplVectorize( const Bitmap& rMonoBmp, tools::PolyPolygon& rPolyPoly, - sal_uLong nFlags, const Link<>* pProgress ) + BmpVectorizeFlags nFlags, const Link<>* pProgress ) { std::unique_ptr<Bitmap> xBmp(new Bitmap( rMonoBmp )); BitmapReadAccess* pRAcc; @@ -764,7 +764,7 @@ bool ImplVectorize( const Bitmap& rMonoBmp, xMap.reset(); ImplLimitPolyPoly( rPolyPoly ); - if( nFlags & BMP_VECTORIZE_REDUCE_EDGES ) + if( nFlags & BmpVectorizeFlags::ReduceEdges ) rPolyPoly.Optimize( PolyOptimizeFlags::EDGES ); // #i14895#:setting the correct direction for polygons @@ -948,7 +948,7 @@ ImplVectMap* ImplExpand( BitmapReadAccess* pRAcc, const Color& rColor ) return pMap; } -void ImplCalculate( ImplVectMap* pMap, tools::PolyPolygon& rPolyPoly, sal_uInt8 cReduce, sal_uLong nFlags ) +void ImplCalculate( ImplVectMap* pMap, tools::PolyPolygon& rPolyPoly, sal_uInt8 cReduce, BmpVectorizeFlags nFlags ) { const long nWidth = pMap->Width(), nHeight= pMap->Height(); @@ -976,7 +976,7 @@ void ImplCalculate( ImplVectMap* pMap, tools::PolyPolygon& rPolyPoly, sal_uInt8 aChain.ImplBeginAdd( aStartPt ); ImplGetChain( pMap, aStartPt, aChain ); - if( nFlags & BMP_VECTORIZE_INNER ) + if( nFlags & BmpVectorizeFlags::Inner ) aChain.ImplEndAdd( bInner ? VECT_POLY_INLINE_INNER : VECT_POLY_INLINE_OUTER ); else aChain.ImplEndAdd( bInner ? VECT_POLY_OUTLINE_INNER : VECT_POLY_OUTLINE_OUTER ); diff --git a/vcl/source/gdi/impvect.hxx b/vcl/source/gdi/impvect.hxx index c2e7a48b7e43..297023dbaf88 100644 --- a/vcl/source/gdi/impvect.hxx +++ b/vcl/source/gdi/impvect.hxx @@ -27,9 +27,9 @@ namespace ImplVectorizer { bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf, - sal_uInt8 cReduce, sal_uLong nFlags, const Link<>* pProgress ); + sal_uInt8 cReduce, BmpVectorizeFlags nFlags, const Link<>* pProgress ); bool ImplVectorize( const Bitmap& rMonoBmp, tools::PolyPolygon& rPolyPoly, - sal_uLong nFlags, const Link<>* pProgress ); + BmpVectorizeFlags nFlags, const Link<>* pProgress ); }; #endif diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 79588dd1fdd7..7d2e65f91610 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -2797,7 +2797,7 @@ bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector, Bitmap aBmp( aVDev->GetBitmap(Point(0, 0), aSize)); tools::PolyPolygon aPolyPoly; - bool bVectorized = aBmp.Vectorize(aPolyPoly, BMP_VECTORIZE_OUTER | BMP_VECTORIZE_REDUCE_EDGES); + bool bVectorized = aBmp.Vectorize(aPolyPoly, BmpVectorizeFlags::Outer | BmpVectorizeFlags::ReduceEdges); if( !bVectorized ) bSuccess = false; else |