diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2024-03-01 15:36:19 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-03-20 11:17:52 +0100 |
commit | 3ad680135c8852c896ec7ed7b8ff63fd63ed0621 (patch) | |
tree | 4b4e861d511c59efdfdae3f77881743045532c2f /sd | |
parent | 99bd13feb386587262c40d6c474d4fa817da31bd (diff) |
vcl: move Vectorize out of Bitmap - add Vectorizer class
Change-Id: I991b6e908d4139723c2d408d4ba3586676fded18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164693
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/dlg/vectdlg.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index 92961bb432a9..3ef7aa9ac494 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -19,6 +19,7 @@ #include <vcl/vclenum.hxx> #include <vcl/BitmapReadAccess.hxx> +#include <vcl/bitmap/Vectorizer.hxx> #include <vcl/metaact.hxx> #include <vcl/BitmapSimpleColorQuantizationFilter.hxx> #include <vcl/svapp.hxx> @@ -132,18 +133,21 @@ void SdVectorizeDlg::Calculate( Bitmap const & rBmp, GDIMetaFile& rMtf ) m_pDocSh->SetWaitCursor( true ); m_xPrgs->set_percentage(0); - Fraction aScale; - Bitmap aTmp( GetPreparedBitmap( rBmp, aScale ) ); + Fraction aScale; + BitmapEx aBitmapEx(GetPreparedBitmap(rBmp, aScale)); - if( !aTmp.IsEmpty() ) + if (!aBitmapEx.IsEmpty()) { const Link<::tools::Long,void> aPrgsHdl( LINK( this, SdVectorizeDlg, ProgressHdl ) ); - aTmp.Vectorize( rMtf, static_cast<sal_uInt8>(m_xMtReduce->get_value(FieldUnit::NONE)), &aPrgsHdl ); + sal_uInt8 nReduce = sal_uInt8(m_xMtReduce->get_value(FieldUnit::NONE)); + vcl::Vectorizer aVecotrizer(nReduce); + aVecotrizer.vectorize(aBitmapEx, rMtf); + aVecotrizer.setProgressCallback(&aPrgsHdl); if (m_xCbFillHoles->get_active()) { - GDIMetaFile aNewMtf; - BitmapScopedReadAccess pRAcc(aTmp); + GDIMetaFile aNewMtf; + BitmapScopedReadAccess pRAcc(aBitmapEx.GetBitmap()); if( pRAcc ) { |