diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2018-04-20 22:22:44 +1000 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-05-09 05:17:42 +0200 |
commit | b781a6b6b2fc0a6688a6335a9408143fb120aa6e (patch) | |
tree | b3c3eb433001aac650de3ef00e889a901a7ff1ee /cui/source/dialogs/cuigrfflt.cxx | |
parent | 2af7daa18467cc7c3f4f435c58cd19ee682f754f (diff) |
vcl: get rid of Bitmap{Ex}::Filter() and Animation::Filter()
Change-Id: I510d7b286df732712aa9206b0a7c7910af34c83f
Reviewed-on: https://gerrit.libreoffice.org/53206
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'cui/source/dialogs/cuigrfflt.cxx')
-rw-r--r-- | cui/source/dialogs/cuigrfflt.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index 406e2b6a7f7f..f4959cd3af6c 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -17,6 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <vcl/BitmapMosaicFilter.hxx> +#include <vcl/BitmapSharpenFilter.hxx> +#include <vcl/BitmapEmbossGreyFilter.hxx> +#include <vcl/BitmapSepiaFilter.hxx> +#include <vcl/BitmapSmoothenFilter.hxx> +#include <vcl/BitmapSolarizeFilter.hxx> #include <vcl/BitmapColorQuantizationFilter.hxx> #include <vcl/builderfactory.hxx> #include <sfx2/viewfrm.hxx> @@ -234,16 +240,15 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic, long nTileHeight = static_cast<long>(mpMtrHeight->GetValue()); const Size aSize( std::max( FRound( nTileWidth * fScaleX ), 1L ), std::max( FRound( nTileHeight * fScaleY ), 1L ) ); - BmpFilterParam aParam( aSize ); if( rGraphic.IsAnimated() ) { Animation aAnim( rGraphic.GetAnimation() ); - if( aAnim.Filter( BmpFilter::Mosaic, &aParam ) ) + if (BitmapFilter::Filter(aAnim, BitmapMosaicFilter(aSize.getWidth(), aSize.getHeight()))) { if( IsEnhanceEdges() ) - aAnim.Filter( BmpFilter::Sharpen ); + BitmapFilter::Filter(aAnim, BitmapSharpenFilter()); aRet = aAnim; } @@ -252,10 +257,10 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic, { BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); - if( aBmpEx.Filter( BmpFilter::Mosaic, &aParam ) ) + if (BitmapFilter::Filter(aBmpEx, BitmapMosaicFilter(aSize.getWidth(), aSize.getHeight()))) { if( IsEnhanceEdges() ) - (void)aBmpEx.Filter( BmpFilter::Sharpen ); + BitmapFilter::Filter(aBmpEx, BitmapSharpenFilter()); aRet = aBmpEx; } @@ -300,13 +305,12 @@ Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double { Graphic aRet; double nRadius = mpMtrRadius->GetValue() / 10.0; - BmpFilterParam aParam( nRadius ); if( rGraphic.IsAnimated() ) { Animation aAnim( rGraphic.GetAnimation() ); - if( aAnim.Filter( BmpFilter::Smooth, &aParam ) ) + if (BitmapFilter::Filter(aAnim, BitmapSmoothenFilter(nRadius))) { aRet = aAnim; } @@ -315,7 +319,7 @@ Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double { BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); - if( aBmpEx.Filter( BmpFilter::Smooth, &aParam ) ) + if (BitmapFilter::Filter(aBmpEx, BitmapSmoothenFilter(nRadius))) { aRet = aBmpEx; } @@ -371,13 +375,12 @@ Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic, doub { Graphic aRet; sal_uInt8 nGreyThreshold = static_cast<sal_uInt8>(FRound( mpMtrThreshold->GetValue() * 2.55 )); - BmpFilterParam aParam( nGreyThreshold ); if( rGraphic.IsAnimated() ) { Animation aAnim( rGraphic.GetAnimation() ); - if( aAnim.Filter( BmpFilter::Solarize, &aParam ) ) + if (BitmapFilter::Filter(aAnim, BitmapSolarizeFilter(nGreyThreshold))) { if( IsInvert() ) aAnim.Invert(); @@ -389,7 +392,7 @@ Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic, doub { BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); - if( aBmpEx.Filter( BmpFilter::Solarize, &aParam ) ) + if (BitmapFilter::Filter(aBmpEx, BitmapSolarizeFilter(nGreyThreshold))) { if( IsInvert() ) aBmpEx.Invert(); @@ -433,20 +436,19 @@ Graphic GraphicFilterSepia::GetFilteredGraphic( const Graphic& rGraphic, double, { Graphic aRet; sal_uInt16 nSepiaPct = sal::static_int_cast< sal_uInt16 >(mpMtrSepia->GetValue()); - BmpFilterParam aParam( nSepiaPct ); if( rGraphic.IsAnimated() ) { Animation aAnim( rGraphic.GetAnimation() ); - if( aAnim.Filter( BmpFilter::Sepia, &aParam ) ) + if (BitmapFilter::Filter(aAnim, BitmapSepiaFilter(nSepiaPct))) aRet = aAnim; } else { BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); - if( aBmpEx.Filter( BmpFilter::Sepia, &aParam ) ) + if (BitmapFilter::Filter(aBmpEx, BitmapSepiaFilter(nSepiaPct))) aRet = aBmpEx; } @@ -576,20 +578,18 @@ Graphic GraphicFilterEmboss::GetFilteredGraphic( const Graphic& rGraphic, double case RectPoint::RB: nAzim = 22500; nElev = 4500; break; } - BmpFilterParam aParam( nAzim, nElev ); - if( rGraphic.IsAnimated() ) { Animation aAnim( rGraphic.GetAnimation() ); - if( aAnim.Filter( BmpFilter::EmbossGrey, &aParam ) ) + if (BitmapFilter::Filter(aAnim, BitmapEmbossGreyFilter(nAzim, nElev))) aRet = aAnim; } else { BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); - if( aBmpEx.Filter( BmpFilter::EmbossGrey, &aParam ) ) + if (BitmapFilter::Filter(aBmpEx, BitmapEmbossGreyFilter(nAzim, nElev))) aRet = aBmpEx; } |