summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-12-21 17:06:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-12-22 06:43:35 +0000
commit41f7878ccbc457ef0431c999d38d9d77265d5dc7 (patch)
treee0b6700f1019b5537ca1629d82fd65cfd1a7f626
parentconvert VclButtonBoxStyle to scoped enum (diff)
downloadcore-41f7878ccbc457ef0431c999d38d9d77265d5dc7.tar.gz
core-41f7878ccbc457ef0431c999d38d9d77265d5dc7.zip
convert BmpFilter to scoped enum
Change-Id: I22c5b49f108d4ce103dea5098a2a0dc9d6bc854c Reviewed-on: https://gerrit.libreoffice.org/32292 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--cui/source/dialogs/cuigrfflt.cxx24
-rw-r--r--include/vcl/bitmap.hxx38
-rw-r--r--svtools/source/graphic/transformer.cxx2
-rw-r--r--svx/source/dialog/grfflt.cxx16
-rw-r--r--vcl/source/gdi/bitmap4.cxx32
-rw-r--r--vcl/workben/outdevgrind.cxx2
-rw-r--r--vcl/workben/vcldemo.cxx2
7 files changed, 58 insertions, 58 deletions
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index f90faf9a0a74..947a7e843b56 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -242,10 +242,10 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic,
{
Animation aAnim( rGraphic.GetAnimation() );
- if( aAnim.Filter( BMP_FILTER_MOSAIC, &aParam ) )
+ if( aAnim.Filter( BmpFilter::Mosaic, &aParam ) )
{
if( IsEnhanceEdges() )
- aAnim.Filter( BMP_FILTER_SHARPEN );
+ aAnim.Filter( BmpFilter::Sharpen );
aRet = aAnim;
}
@@ -254,10 +254,10 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic,
{
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
- if( aBmpEx.Filter( BMP_FILTER_MOSAIC, &aParam ) )
+ if( aBmpEx.Filter( BmpFilter::Mosaic, &aParam ) )
{
if( IsEnhanceEdges() )
- (void)aBmpEx.Filter( BMP_FILTER_SHARPEN );
+ (void)aBmpEx.Filter( BmpFilter::Sharpen );
aRet = aBmpEx;
}
@@ -308,7 +308,7 @@ Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double
{
Animation aAnim( rGraphic.GetAnimation() );
- if( aAnim.Filter( BMP_FILTER_SMOOTH, &aParam ) )
+ if( aAnim.Filter( BmpFilter::Smooth, &aParam ) )
{
aRet = aAnim;
}
@@ -317,7 +317,7 @@ Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double
{
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
- if( aBmpEx.Filter( BMP_FILTER_SMOOTH, &aParam ) )
+ if( aBmpEx.Filter( BmpFilter::Smooth, &aParam ) )
{
aRet = aBmpEx;
}
@@ -379,7 +379,7 @@ Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic, doub
{
Animation aAnim( rGraphic.GetAnimation() );
- if( aAnim.Filter( BMP_FILTER_SOLARIZE, &aParam ) )
+ if( aAnim.Filter( BmpFilter::Solarize, &aParam ) )
{
if( IsInvert() )
aAnim.Invert();
@@ -391,7 +391,7 @@ Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic, doub
{
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
- if( aBmpEx.Filter( BMP_FILTER_SOLARIZE, &aParam ) )
+ if( aBmpEx.Filter( BmpFilter::Solarize, &aParam ) )
{
if( IsInvert() )
aBmpEx.Invert();
@@ -441,14 +441,14 @@ Graphic GraphicFilterSepia::GetFilteredGraphic( const Graphic& rGraphic, double,
{
Animation aAnim( rGraphic.GetAnimation() );
- if( aAnim.Filter( BMP_FILTER_SEPIA, &aParam ) )
+ if( aAnim.Filter( BmpFilter::Sepia, &aParam ) )
aRet = aAnim;
}
else
{
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
- if( aBmpEx.Filter( BMP_FILTER_SEPIA, &aParam ) )
+ if( aBmpEx.Filter( BmpFilter::Sepia, &aParam ) )
aRet = aBmpEx;
}
@@ -584,14 +584,14 @@ Graphic GraphicFilterEmboss::GetFilteredGraphic( const Graphic& rGraphic, double
{
Animation aAnim( rGraphic.GetAnimation() );
- if( aAnim.Filter( BMP_FILTER_EMBOSS_GREY, &aParam ) )
+ if( aAnim.Filter( BmpFilter::EmbossGrey, &aParam ) )
aRet = aAnim;
}
else
{
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
- if( aBmpEx.Filter( BMP_FILTER_EMBOSS_GREY, &aParam ) )
+ if( aBmpEx.Filter( BmpFilter::EmbossGrey, &aParam ) )
aRet = aBmpEx;
}
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index 95f715d5f7e5..751fa9a08ad6 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -106,20 +106,20 @@ enum BmpReduce
BMP_REDUCE_POPULAR = 1
};
-enum BmpFilter
+enum class BmpFilter
{
- BMP_FILTER_SMOOTH = 0,
- BMP_FILTER_SHARPEN = 1,
- BMP_FILTER_REMOVENOISE = 2,
- BMP_FILTER_SOBEL_GREY = 3,
- BMP_FILTER_EMBOSS_GREY = 4,
- BMP_FILTER_SOLARIZE = 5,
- BMP_FILTER_SEPIA = 6,
- BMP_FILTER_MOSAIC = 7,
- BMP_FILTER_POPART = 8,
- BMP_FILTER_DUOTONE = 9,
-
- BMP_FILTER_UNKNOWN = 65535
+ Smooth = 0,
+ Sharpen = 1,
+ RemoveNoise = 2,
+ SobelGrey = 3,
+ EmbossGrey = 4,
+ Solarize = 5,
+ Sepia = 6,
+ Mosaic = 7,
+ PopArt = 8,
+ DuoTone = 9,
+
+ Unknown = 65535
};
class VCL_DLLPUBLIC BmpFilterParam
@@ -127,32 +127,32 @@ class VCL_DLLPUBLIC BmpFilterParam
public:
BmpFilterParam( sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
- meFilter( BMP_FILTER_UNKNOWN ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ) {}
+ meFilter( BmpFilter::Unknown ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ) {}
BmpFilterParam( sal_uInt8 cSolarGreyThreshold, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
- meFilter( BMP_FILTER_SOLARIZE ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
+ meFilter( BmpFilter::Solarize ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
mcSolarGreyThreshold( cSolarGreyThreshold ) {}
BmpFilterParam( double nRadius, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
- meFilter( BMP_FILTER_SMOOTH ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
+ meFilter( BmpFilter::Smooth ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
mnRadius( nRadius ) {}
BmpFilterParam( sal_uInt16 nSepiaPercent, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
- meFilter( BMP_FILTER_SEPIA ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
+ meFilter( BmpFilter::Sepia ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
mnSepiaPercent( nSepiaPercent )
{
assert(nSepiaPercent<=100);
}
BmpFilterParam( const Size& rMosaicTileSize, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
- meFilter( BMP_FILTER_MOSAIC ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd )
+ meFilter( BmpFilter::Mosaic ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd )
{
maMosaicTileSize.mnTileWidth = rMosaicTileSize.Width();
maMosaicTileSize.mnTileHeight= rMosaicTileSize.Height();
}
BmpFilterParam( sal_uInt16 nEmbossAzimuthAngle100, sal_uInt16 nEmbossElevationAngle100,
sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
- meFilter( BMP_FILTER_EMBOSS_GREY ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd )
+ meFilter( BmpFilter::EmbossGrey ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd )
{
maEmbossAngles.mnAzimuthAngle100 = nEmbossAzimuthAngle100;
maEmbossAngles.mnElevationAngle100 = nEmbossElevationAngle100;
diff --git a/svtools/source/graphic/transformer.cxx b/svtools/source/graphic/transformer.cxx
index 0de58a36dd84..4375caeb4efa 100644
--- a/svtools/source/graphic/transformer.cxx
+++ b/svtools/source/graphic/transformer.cxx
@@ -145,7 +145,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL GraphicTransformer::applyDuotone(
AlphaMask aMask( aBitmapEx.GetAlpha() );
Bitmap aBitmap( aBitmapEx.GetBitmap() );
BmpFilterParam aFilter( (sal_uLong) nColorOne, (sal_uLong) nColorTwo );
- aBitmap.Filter( BMP_FILTER_DUOTONE, &aFilter );
+ aBitmap.Filter( BmpFilter::DuoTone, &aFilter );
aGraphic = ::Graphic( BitmapEx( aBitmap, aMask ) );
::unographic::Graphic* pUnoGraphic = new ::unographic::Graphic();
diff --git a/svx/source/dialog/grfflt.cxx b/svx/source/dialog/grfflt.cxx
index df6eb0846eff..c8858fd16487 100644
--- a/svx/source/dialog/grfflt.cxx
+++ b/svx/source/dialog/grfflt.cxx
@@ -91,14 +91,14 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj
{
Animation aAnimation( rGraphic.GetAnimation() );
- if( aAnimation.Filter( BMP_FILTER_SHARPEN ) )
+ if( aAnimation.Filter( BmpFilter::Sharpen ) )
aGraphic = aAnimation;
}
else
{
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
- if( aBmpEx.Filter( BMP_FILTER_SHARPEN ) )
+ if( aBmpEx.Filter( BmpFilter::Sharpen ) )
aGraphic = aBmpEx;
}
@@ -116,14 +116,14 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj
{
Animation aAnimation( rGraphic.GetAnimation() );
- if( aAnimation.Filter( BMP_FILTER_REMOVENOISE ) )
+ if( aAnimation.Filter( BmpFilter::RemoveNoise ) )
aGraphic = aAnimation;
}
else
{
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
- if( aBmpEx.Filter( BMP_FILTER_REMOVENOISE ) )
+ if( aBmpEx.Filter( BmpFilter::RemoveNoise ) )
aGraphic = aBmpEx;
}
@@ -141,14 +141,14 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj
{
Animation aAnimation( rGraphic.GetAnimation() );
- if( aAnimation.Filter( BMP_FILTER_SOBEL_GREY ) )
+ if( aAnimation.Filter( BmpFilter::SobelGrey ) )
aGraphic = aAnimation;
}
else
{
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
- if( aBmpEx.Filter( BMP_FILTER_SOBEL_GREY ) )
+ if( aBmpEx.Filter( BmpFilter::SobelGrey ) )
aGraphic = aBmpEx;
}
@@ -205,14 +205,14 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj
{
Animation aAnimation( rGraphic.GetAnimation() );
- if( aAnimation.Filter( BMP_FILTER_POPART ) )
+ if( aAnimation.Filter( BmpFilter::PopArt ) )
aGraphic = aAnimation;
}
else
{
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
- if( aBmpEx.Filter( BMP_FILTER_POPART ) )
+ if( aBmpEx.Filter( BmpFilter::PopArt ) )
aGraphic = aBmpEx;
}
diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx
index 63940bd73f7f..e516541148af 100644
--- a/vcl/source/gdi/bitmap4.cxx
+++ b/vcl/source/gdi/bitmap4.cxx
@@ -44,7 +44,7 @@ bool Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam )
switch( eFilter )
{
- case BMP_FILTER_SMOOTH:
+ case BmpFilter::Smooth:
{
// Blur for positive values of mnRadius
if (pFilterParam->mnRadius > 0.0)
@@ -63,42 +63,42 @@ bool Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam )
}
break;
- case BMP_FILTER_SHARPEN:
+ case BmpFilter::Sharpen:
{
const long pSharpenMatrix[] = { -1, -1, -1, -1, 16, -1, -1, -1, -1 };
bRet = ImplConvolute3( &pSharpenMatrix[ 0 ] );
}
break;
- case BMP_FILTER_REMOVENOISE:
+ case BmpFilter::RemoveNoise:
bRet = ImplMedianFilter();
break;
- case BMP_FILTER_SOBEL_GREY:
+ case BmpFilter::SobelGrey:
bRet = ImplSobelGrey();
break;
- case BMP_FILTER_SOLARIZE:
+ case BmpFilter::Solarize:
bRet = ImplSolarize( pFilterParam );
break;
- case BMP_FILTER_SEPIA:
+ case BmpFilter::Sepia:
bRet = ImplSepia( pFilterParam );
break;
- case BMP_FILTER_MOSAIC:
+ case BmpFilter::Mosaic:
bRet = ImplMosaic( pFilterParam );
break;
- case BMP_FILTER_EMBOSS_GREY:
+ case BmpFilter::EmbossGrey:
bRet = ImplEmbossGrey( pFilterParam );
break;
- case BMP_FILTER_POPART:
+ case BmpFilter::PopArt:
bRet = ImplPopArt();
break;
- case BMP_FILTER_DUOTONE:
+ case BmpFilter::DuoTone:
bRet = ImplDuotoneFilter( pFilterParam->mnProgressStart, pFilterParam->mnProgressEnd );
break;
@@ -576,9 +576,9 @@ bool Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam )
long nGrey11, nGrey12, nGrey13;
long nGrey21, nGrey22, nGrey23;
long nGrey31, nGrey32, nGrey33;
- double fAzim = ( ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_EMBOSS_GREY ) ?
+ double fAzim = ( ( pFilterParam && pFilterParam->meFilter == BmpFilter::EmbossGrey ) ?
( pFilterParam->maEmbossAngles.mnAzimuthAngle100 * 0.01 ) : 0.0 ) * F_PI180;
- double fElev = ( ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_EMBOSS_GREY ) ?
+ double fElev = ( ( pFilterParam && pFilterParam->meFilter == BmpFilter::EmbossGrey ) ?
( pFilterParam->maEmbossAngles.mnElevationAngle100 * 0.01 ) : 90.0 ) * F_PI180;
long* pHMap = new long[ nWidth + 2 ];
long* pVMap = new long[ nHeight + 2 ];
@@ -672,7 +672,7 @@ bool Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam )
if( pWriteAcc )
{
- const sal_uInt8 cThreshold = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_SOLARIZE ) ?
+ const sal_uInt8 cThreshold = ( pFilterParam && pFilterParam->meFilter == BmpFilter::Solarize ) ?
pFilterParam->mcSolarGreyThreshold : 128;
if( pWriteAcc->HasPalette() )
@@ -720,7 +720,7 @@ bool Bitmap::ImplSepia( const BmpFilterParam* pFilterParam )
if( pReadAcc )
{
- long nSepiaPercent = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_SEPIA ) ?
+ long nSepiaPercent = ( pFilterParam && pFilterParam->meFilter == BmpFilter::Sepia ) ?
pFilterParam->mnSepiaPercent : 10;
const long nSepia = 10000 - 100 * SAL_BOUND( nSepiaPercent, 0, 100 );
BitmapPalette aSepiaPal( 256 );
@@ -798,9 +798,9 @@ bool Bitmap::ImplSepia( const BmpFilterParam* pFilterParam )
bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam )
{
- sal_uLong nTileWidth = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
+ sal_uLong nTileWidth = ( pFilterParam && pFilterParam->meFilter == BmpFilter::Mosaic ) ?
pFilterParam->maMosaicTileSize.mnTileWidth : 4;
- sal_uLong nTileHeight = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
+ sal_uLong nTileHeight = ( pFilterParam && pFilterParam->meFilter == BmpFilter::Mosaic ) ?
pFilterParam->maMosaicTileSize.mnTileHeight : 4;
bool bRet = false;
diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx
index 562f4d1f27d3..0e0e19df2519 100644
--- a/vcl/workben/outdevgrind.cxx
+++ b/vcl/workben/outdevgrind.cxx
@@ -127,7 +127,7 @@ void setupMethodStubs( functor_vector_type& res )
const Bitmap aBitmap( aIntro.GetBitmap() );
Bitmap aBitmapBW( aBitmap );
- aBitmapBW.Filter( BMP_FILTER_EMBOSS_GREY );
+ aBitmapBW.Filter( BmpFilter::EmbossGrey );
Bitmap aBitmapAlien( Size( 100, 100 ), 8 );
aBitmapAlien.Erase( COL_RED );
#endif
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 964904fdf71f..40e2e7d94e33 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -143,7 +143,7 @@ public:
Application::Abort("Failed to load intro image");
maIntroBW = maIntro.GetBitmap();
- maIntroBW.Filter(BMP_FILTER_EMBOSS_GREY);
+ maIntroBW.Filter(BmpFilter::EmbossGrey);
InitRenderers();
mnSegmentsY = rtl::math::round(std::sqrt(maRenderers.size()), 0,