summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-05 14:09:24 +0200
committerNoel Grandin <noel@peralex.com>2015-05-06 09:01:30 +0200
commitb13fbd19b7282a1210a2e14bb5ede9ecdf944c1c (patch)
tree3db528acc23250ddcc3dbdc9b1e35a817d8de9ee
parentba121a3269d17f87c6d09b9e46aaaf921af40ef6 (diff)
convert BMP_SCALE constant to scoped enum
Change-Id: Ibc9f88d2588c028cd71aa86c26d970a73025ef22
-rw-r--r--canvas/source/vcl/canvasbitmaphelper.cxx2
-rw-r--r--canvas/source/vcl/canvashelper.cxx2
-rw-r--r--cui/source/dialogs/cuigrfflt.cxx2
-rw-r--r--cui/source/tabpages/align.cxx2
-rw-r--r--cui/source/tabpages/border.cxx4
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx2
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx2
-rw-r--r--framework/source/fwe/classes/addonsoptions.cxx2
-rw-r--r--framework/source/uielement/imagebuttontoolbarcontroller.cxx2
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx2
-rw-r--r--include/svx/compressgraphicdialog.hxx2
-rw-r--r--include/vcl/bitmap.hxx29
-rw-r--r--include/vcl/bitmapex.hxx6
-rw-r--r--include/vcl/gdimtf.hxx2
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx4
-rw-r--r--sd/source/ui/presenter/SlideRenderer.cxx2
-rw-r--r--sd/source/ui/sidebar/LayoutMenu.cxx2
-rw-r--r--sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx2
-rw-r--r--sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx2
-rw-r--r--sd/source/ui/tools/PreviewRenderer.cxx2
-rw-r--r--sfx2/source/doc/graphhelp.cxx2
-rw-r--r--sfx2/source/sidebar/TabBar.cxx4
-rw-r--r--svx/source/dialog/compressgraphicdialog.cxx12
-rw-r--r--svx/source/dialog/dlgctrl.cxx2
-rw-r--r--svx/source/gallery2/galobj.cxx10
-rw-r--r--svx/source/stbctrls/modctrl.cxx2
-rw-r--r--svx/source/stbctrls/pszctrl.cxx4
-rw-r--r--svx/source/stbctrls/selctrl.cxx2
-rw-r--r--svx/source/stbctrls/xmlsecctrl.cxx2
-rw-r--r--svx/source/stbctrls/zoomsliderctrl.cxx2
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx2
-rw-r--r--svx/source/xoutdev/xtabdash.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx8
-rw-r--r--sw/source/uibase/utlui/content.cxx2
-rw-r--r--sw/source/uibase/utlui/viewlayoutctrl.cxx2
-rw-r--r--toolkit/source/awt/vclxmenu.cxx2
-rw-r--r--vcl/headless/svpbmp.cxx2
-rw-r--r--vcl/inc/headless/svpbmp.hxx2
-rw-r--r--vcl/inc/impbmp.hxx2
-rw-r--r--vcl/inc/opengl/salbmp.hxx4
-rw-r--r--vcl/inc/salbmp.hxx3
-rw-r--r--vcl/inc/unx/salbmp.h2
-rw-r--r--vcl/opengl/scale.cxx36
-rw-r--r--vcl/qa/cppunit/BitmapTest.cxx2
-rw-r--r--vcl/qa/cppunit/graphicfilter/filters-test.cxx2
-rw-r--r--vcl/source/gdi/bitmap3.cxx34
-rw-r--r--vcl/source/gdi/bitmapex.cxx8
-rw-r--r--vcl/source/gdi/gdimtf.cxx2
-rw-r--r--vcl/source/gdi/impbmp.cxx2
-rw-r--r--vcl/source/gdi/impgraph.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx2
-rw-r--r--vcl/source/helper/canvasbitmap.cxx2
-rw-r--r--vcl/source/window/menu.cxx2
-rw-r--r--vcl/source/window/printdlg.cxx2
-rw-r--r--vcl/source/window/toolbox2.cxx2
-rw-r--r--vcl/unx/generic/gdi/salbmp.cxx2
-rw-r--r--vcl/workben/vcldemo.cxx8
57 files changed, 130 insertions, 128 deletions
diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx
index 5c0a310d8d8e..d818ed862634 100644
--- a/canvas/source/vcl/canvasbitmaphelper.cxx
+++ b/canvas/source/vcl/canvasbitmaphelper.cxx
@@ -119,7 +119,7 @@ namespace vclcanvas
BitmapEx aRes( mpBackBuffer->getBitmapReference() );
aRes.Scale( vcl::unotools::sizeFromRealSize2D(newSize),
- beFast ? BMP_SCALE_DEFAULT : BMP_SCALE_BESTQUALITY );
+ beFast ? BmpScaleFlag::Default : BmpScaleFlag::BestQuality );
return uno::Reference< rendering::XBitmap >(
new CanvasBitmap( aRes, *mpDevice, mpOutDevReference ) );
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index 37a51769a888..867405698716 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -926,7 +926,7 @@ namespace vclcanvas
Bitmap aBitmap( rOutDev.GetBitmap(aEmptyPoint, aBmpSize) );
aBitmap.Scale( vcl::unotools::sizeFromRealSize2D(newSize),
- beFast ? BMP_SCALE_DEFAULT : BMP_SCALE_BESTQUALITY );
+ beFast ? BmpScaleFlag::Default : BmpScaleFlag::BestQuality );
return uno::Reference< rendering::XBitmap >(
new CanvasBitmap( aBitmap, *mpDevice, mpOutDev ) );
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 0623a45ac372..ea1d83c9c0a7 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -122,7 +122,7 @@ void GraphicPreviewWindow::ScaleImageToFit()
{
BitmapEx aBmpEx( mpOrigGraphic->GetBitmapEx() );
- if( aBmpEx.Scale( aGrfSize, BMP_SCALE_DEFAULT ) )
+ if( aBmpEx.Scale( aGrfSize, BmpScaleFlag::Default ) )
maScaledOrig = aBmpEx;
}
}
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index 0f19eefbd00d..55dd19c00f7a 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -360,7 +360,7 @@ void AlignmentTabPage::InitVsRefEgde()
{
OUString rImageName = aImageList.GetImageName(i);
BitmapEx b = aImageList.GetImage(rImageName).GetBitmapEx();
- b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST);
+ b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
aImageList.ReplaceImage(rImageName, Image(b));
}
}
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index b304afa3955a..01881fe816d4 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -137,7 +137,7 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
{
OUString rImageName = aBorderImgLst.GetImageName(i);
BitmapEx b = aBorderImgLst.GetImage(rImageName).GetBitmapEx();
- b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST);
+ b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
aBorderImgLst.ReplaceImage(rImageName, Image(b));
}
@@ -145,7 +145,7 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
{
OUString rImageName = aShadowImgLst.GetImageName(i);
BitmapEx b = aShadowImgLst.GetImage(rImageName).GetBitmapEx();
- b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST);
+ b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
aShadowImgLst.ReplaceImage(rImageName, Image(b));
}
}
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 9e6c5a6fcae5..a98726676fa0 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -519,7 +519,7 @@ namespace drawinglayer
aBitmapEx.Convert(BMP_CONVERSION_24BIT);
}
- aBitmapEx.Scale(aNeededBitmapSizePixel, BMP_SCALE_INTERPOLATE);
+ aBitmapEx.Scale(aNeededBitmapSizePixel, BmpScaleFlag::Interpolate);
}
bool bPainted(false);
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 20f6a2f9d1d3..53dec83b12f5 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -528,7 +528,7 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview )
{
Size aSizeBitmap( ( aSizePoint.Width() + 7 ) & ~7, aSizePoint.Height() );
Bitmap aTmpBitmap( pPreview->GetBitmap() );
- aTmpBitmap.Scale( aSizeBitmap, BMP_SCALE_BESTQUALITY );
+ aTmpBitmap.Scale( aSizeBitmap, BmpScaleFlag::BestQuality );
aTmpBitmap.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
BitmapReadAccess* pAcc = aTmpBitmap.AcquireReadAccess();
if ( pAcc )
diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx
index 31105e7ddb08..88922705e522 100644
--- a/framework/source/fwe/classes/addonsoptions.cxx
+++ b/framework/source/fwe/classes/addonsoptions.cxx
@@ -480,7 +480,7 @@ static Image ScaleImage( const Image &rImage, bool bBig )
BitmapEx aScaleBmp(rImage.GetBitmapEx());
SAL_INFO("fwk", "Addons: expensive scale image from "
<< aScaleBmp.GetSizePixel() << " to " << aSize);
- aScaleBmp.Scale(aSize, BMP_SCALE_BESTQUALITY);
+ aScaleBmp.Scale(aSize, BmpScaleFlag::BestQuality);
return Image(aScaleBmp);
}
diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx
index 820722b0d41b..34e761f22f6a 100644
--- a/framework/source/uielement/imagebuttontoolbarcontroller.cxx
+++ b/framework/source/uielement/imagebuttontoolbarcontroller.cxx
@@ -145,7 +145,7 @@ bool ImageButtonToolbarController::ReadImageFromURL( bool bBigImage, const OUStr
{
::Size aNoScaleSize( aBmpSize.Width(), aSize.Height() );
if ( aBmpSize != aNoScaleSize )
- aBitmapEx.Scale( aNoScaleSize, BMP_SCALE_BESTQUALITY );
+ aBitmapEx.Scale( aNoScaleSize, BmpScaleFlag::BestQuality );
aImage = Image( aBitmapEx );
return true;
}
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index c2e324717825..004db21f70de 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -569,7 +569,7 @@ void NewToolbarController::setItemImage( const OUString &rCommand )
if ( bBig && aImage.GetSizePixel() != aBigSize )
{
BitmapEx aScaleBmpEx( aImage.GetBitmapEx() );
- aScaleBmpEx.Scale( aBigSize, BMP_SCALE_INTERPOLATE );
+ aScaleBmpEx.Scale( aBigSize, BmpScaleFlag::Interpolate );
pToolBox->SetItemImage( m_nToolBoxId, Image( aScaleBmpEx ) );
}
else
diff --git a/include/svx/compressgraphicdialog.hxx b/include/svx/compressgraphicdialog.hxx
index ba5e51aa52c1..cf0c2acaa95c 100644
--- a/include/svx/compressgraphicdialog.hxx
+++ b/include/svx/compressgraphicdialog.hxx
@@ -78,7 +78,7 @@ private:
double GetViewWidthInch();
double GetViewHeightInch();
- sal_uLong GetSelectedInterpolationType();
+ BmpScaleFlag GetSelectedInterpolationType();
public:
CompressGraphicsDialog( vcl::Window* pParent, SdrGrafObj* pGraphicObj, SfxBindings& rBindings );
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index 9027a643deba..be7d4eb293d7 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -34,18 +34,21 @@
#define BMP_MIRROR_VERT 0x00000002UL
-#define BMP_SCALE_NONE 0x00000000UL
+enum class BmpScaleFlag
+{
+ NONE = 0,
// Try to preferably use these.
-#define BMP_SCALE_DEFAULT 0x00000001UL
-#define BMP_SCALE_FAST 0x00000002UL
-#define BMP_SCALE_BESTQUALITY 0x00000003UL
+ Default = 1,
+ Fast = 2,
+ BestQuality = 3,
// Specific algorithms, use only if you really need to.
-#define BMP_SCALE_INTERPOLATE 0x00000004UL
-#define BMP_SCALE_SUPER 0x00000005UL
-#define BMP_SCALE_LANCZOS 0x00000006UL
-#define BMP_SCALE_BICUBIC 0x00000007UL
-#define BMP_SCALE_BILINEAR 0x00000008UL
-#define BMP_SCALE_BOX 0x00000009UL
+ Interpolate = 4,
+ Super = 5,
+ Lanczos = 6,
+ BiCubic = 7,
+ BiLinear = 8,
+ Box = 9,
+};
#define BMP_DITHER_NONE 0x00000000UL
@@ -543,7 +546,7 @@ public:
@return true, if the operation was completed successfully.
*/
- bool Scale( const Size& rNewSize, sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT );
+ bool Scale( const Size& rNewSize, BmpScaleFlag nScaleFlag = BmpScaleFlag::Default );
/** Scale the bitmap
@@ -554,11 +557,11 @@ public:
The scale factor in y direction.
@param nScaleFlag
- Method of scaling - it is recommended that either BMP_SCALE_DEFAULT or BMP_SCALE_BESTQUALITY be used.
+ Method of scaling - it is recommended that either BmpScaleFlag::Default or BmpScaleFlag::BestQuality be used.
@return true, if the operation was completed successfully.
*/
- bool Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT );
+ bool Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag = BmpScaleFlag::Default );
/**
Returns true if bitmap scaling is considered to be fast.
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index eb9e4d60a911..d7b08e087779 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -83,7 +83,7 @@ public:
AlphaMask GetAlpha() const;
const Size& GetSizePixel() const { return aBitmapSize; }
- void SetSizePixel( const Size& rNewSize, sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT );
+ void SetSizePixel( const Size& rNewSize, BmpScaleFlag nScaleFlag = BmpScaleFlag::Default );
const Size& GetPrefSize() const { return aBitmap.GetPrefSize(); }
void SetPrefSize( const Size& rPrefSize ) { aBitmap.SetPrefSize( rPrefSize ); }
@@ -237,7 +237,7 @@ public:
*/
bool Scale(
const Size& rNewSize,
- sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT );
+ BmpScaleFlag nScaleFlag = BmpScaleFlag::Default );
/** Scale the bitmap
@@ -255,7 +255,7 @@ public:
bool Scale(
const double& rScaleX,
const double& rScaleY,
- sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT );
+ BmpScaleFlag nScaleFlag = BmpScaleFlag::Default );
/** Rotate bitmap by the specified angle
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index 43bfad95a0b6..bc8da88cdd9e 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -218,7 +218,7 @@ public:
bool CreateThumbnail(BitmapEx& rBitmapEx,
sal_uInt32 nMaximumExtent = 256,
BmpConversion nColorConversion = BMP_CONVERSION_24BIT,
- long nScaleFlag = BMP_SCALE_BESTQUALITY) const;
+ BmpScaleFlag nScaleFlag = BmpScaleFlag::BestQuality) const;
void UseCanvas( bool _bUseCanvas );
bool GetUseCanvas() const { return bUseCanvas; }
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 651008c50bb1..bbd90b12d311 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1097,7 +1097,7 @@ void ScCheckListMenuWindow::packWindow()
if (nScaleFactor != 1)
{
BitmapEx aBitmap = aSingleSelect.GetBitmapEx();
- aBitmap.Scale(nScaleFactor, nScaleFactor, BMP_SCALE_FAST);
+ aBitmap.Scale(nScaleFactor, nScaleFactor, BmpScaleFlag::Fast);
aSingleSelect = Image(aBitmap);
}
@@ -1112,7 +1112,7 @@ void ScCheckListMenuWindow::packWindow()
if (nScaleFactor != 1)
{
BitmapEx aBitmap = aSingleUnselect.GetBitmapEx();
- aBitmap.Scale(nScaleFactor, nScaleFactor, BMP_SCALE_FAST);
+ aBitmap.Scale(nScaleFactor, nScaleFactor, BmpScaleFlag::Fast);
aSingleUnselect = Image(aBitmap);
}
diff --git a/sd/source/ui/presenter/SlideRenderer.cxx b/sd/source/ui/presenter/SlideRenderer.cxx
index f64f6c515cc0..b60da234939a 100644
--- a/sd/source/ui/presenter/SlideRenderer.cxx
+++ b/sd/source/ui/presenter/SlideRenderer.cxx
@@ -192,7 +192,7 @@ BitmapEx SlideRenderer::CreatePreview (
BitmapEx aScaledPreview = aPreview.GetBitmapEx();
aScaledPreview.Scale(
Size(aPreviewSize.Width,aPreviewSize.Height),
- BMP_SCALE_BESTQUALITY);
+ BmpScaleFlag::BestQuality);
return aScaledPreview;
}
}
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx
index 53a66c8fa52b..f5aa025c7d73 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -551,7 +551,7 @@ void LayoutMenu::Fill()
BitmapEx aBmp(SdResId(pInfo->mnBmpResId));
if (GetDPIScaleFactor() > 1)
- aBmp.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST);
+ aBmp.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
if (bRightToLeft && (WritingMode_TB_RL != pInfo->meWritingMode))
aBmp.Mirror (BMP_MIRROR_HORZ);
diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx
index 14dd577c216b..d68ee263d57c 100644
--- a/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx
@@ -69,7 +69,7 @@ Bitmap BitmapFactory::CreateBitmap (
false).GetBitmapEx().GetBitmap());
if (bDoSuperSampling)
{
- aPreview.Scale(rPixelSize, BMP_SCALE_BESTQUALITY);
+ aPreview.Scale(rPixelSize, BmpScaleFlag::BestQuality);
}
return aPreview;
diff --git a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
index 2561c90c667c..cb237454d009 100644
--- a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
+++ b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
@@ -185,7 +185,7 @@ Point InsertionIndicatorOverlay::PaintRepresentatives (
// Paint the preview.
Bitmap aPreview (rRepresentatives[nIndex].maBitmap);
- aPreview.Scale(rPreviewSize, BMP_SCALE_BESTQUALITY);
+ aPreview.Scale(rPreviewSize, BmpScaleFlag::BestQuality);
rContent.DrawBitmapEx(aPageOffset, aPreview);
// When the page is marked as excluded from the slide show then
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index a9befddd82ef..774cf1d50d08 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -473,7 +473,7 @@ Image PreviewRenderer::ScaleBitmap (
// Paint the bitmap scaled to the desired width.
BitmapEx aScaledBitmap (rBitmapEx.GetBitmap());
- aScaledBitmap.Scale (aPreviewSize, BMP_SCALE_BESTQUALITY);
+ aScaledBitmap.Scale (aPreviewSize, BmpScaleFlag::BestQuality);
mpPreviewDevice->DrawBitmap (
Point(1,1),
aPreviewSize,
diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index e8ca9ef9209b..68fa2f974722 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -189,7 +189,7 @@ bool GraphicHelper::getThumbnailFormatFromGDI_Impl(GDIMetaFile* pMetaFile, const
BitmapEx aResultBitmap;
- bResult = pMetaFile->CreateThumbnail(aResultBitmap, 256, BMP_CONVERSION_8BIT_COLORS, BMP_SCALE_DEFAULT);
+ bResult = pMetaFile->CreateThumbnail(aResultBitmap, 256, BMP_CONVERSION_8BIT_COLORS, BmpScaleFlag::Default);
if (!bResult || aResultBitmap.IsEmpty())
return false;
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index fd8695ee0205..8a474c7d1220 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -148,7 +148,7 @@ void TabBar::UpdateButtonIcons()
if ( mpMenuButton->GetDPIScaleFactor() > 1 )
{
BitmapEx b = aImage.GetBitmapEx();
- b.Scale(mpMenuButton->GetDPIScaleFactor(), mpMenuButton->GetDPIScaleFactor(), BMP_SCALE_FAST);
+ b.Scale(mpMenuButton->GetDPIScaleFactor(), mpMenuButton->GetDPIScaleFactor(), BmpScaleFlag::Fast);
aImage = Image(b);
}
mpMenuButton->SetModeImage(aImage);
@@ -165,7 +165,7 @@ void TabBar::UpdateButtonIcons()
if ( mpMenuButton->GetDPIScaleFactor() > 1 )
{
BitmapEx b = aImage.GetBitmapEx();
- b.Scale(mpMenuButton->GetDPIScaleFactor(), mpMenuButton->GetDPIScaleFactor(), BMP_SCALE_FAST);
+ b.Scale(mpMenuButton->GetDPIScaleFactor(), mpMenuButton->GetDPIScaleFactor(), BmpScaleFlag::Fast);
aImage = Image(b);
}
diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx
index 53fc5635c587..0360ea2e4b0a 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -238,20 +238,20 @@ double CompressGraphicsDialog::GetViewHeightInch()
return (double) MetricField::ConvertValue(m_aViewSize100mm.Height(), 2, MAP_100TH_MM, FUNIT_INCH) / 100.0;
}
-sal_uLong CompressGraphicsDialog::GetSelectedInterpolationType()
+BmpScaleFlag CompressGraphicsDialog::GetSelectedInterpolationType()
{
OUString aSelectionText = OUString( m_pInterpolationCombo->GetSelectEntry() );
if( aSelectionText == "Lanczos" ) {
- return BMP_SCALE_LANCZOS;
+ return BmpScaleFlag::Lanczos;
} else if( aSelectionText == "Bilinear" ) {
- return BMP_SCALE_BILINEAR;
+ return BmpScaleFlag::BiLinear;
} else if( aSelectionText == "Bicubic" ) {
- return BMP_SCALE_BICUBIC;
+ return BmpScaleFlag::BiCubic;
} else if ( aSelectionText == "None" ) {
- return BMP_SCALE_FAST;
+ return BmpScaleFlag::Fast;
}
- return BMP_SCALE_BESTQUALITY;
+ return BmpScaleFlag::BestQuality;
}
void CompressGraphicsDialog::Compress(SvStream& aStream)
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index 4a0cf8dffb5c..94e6aaae819c 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1464,7 +1464,7 @@ namespace
if(rBitmapEx.GetSizePixel().Width() >= rSize.Width() && rBitmapEx.GetSizePixel().Height() >= rSize.Height())
{
- rBitmapEx.Scale(rSize, BMP_SCALE_DEFAULT);
+ rBitmapEx.Scale(rSize, BmpScaleFlag::Default);
pVirtualDevice->DrawBitmapEx(Point(0, 0), rBitmapEx);
}
else
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index 299abab1d28f..8a62689517e4 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -81,9 +81,7 @@ BitmapEx SgaObject::createPreviewBitmapEx(const Size& rSizePixel) const
// prevent scaling close to 1.0 which is not needed for pixel graphics
if(fScale < 1.0 && fabs(1.0 - fScale) > 0.005)
{
- static sal_uInt32 nScaleFlag = BMP_SCALE_BESTQUALITY;
-
- aRetval.Scale(fScale, fScale, nScaleFlag);
+ aRetval.Scale(fScale, fScale, BmpScaleFlag::BestQuality);
}
}
}
@@ -118,7 +116,7 @@ bool SgaObject::CreateThumb( const Graphic& rGraphic )
else
aBmpSize.Height() = FRound( aBmpSize.Width() / fFactorLog );
- aBmpEx.SetSizePixel( aBmpSize, BMP_SCALE_BESTQUALITY );
+ aBmpEx.SetSizePixel( aBmpSize, BmpScaleFlag::BestQuality );
}
}
@@ -138,7 +136,7 @@ bool SgaObject::CreateThumb( const Graphic& rGraphic )
if(aThumbBmp.Scale(
(double) aNewSize.Width() / aBmpSize.Width(),
(double) aNewSize.Height() / aBmpSize.Height(),
- BMP_SCALE_BESTQUALITY ) )
+ BmpScaleFlag::BestQuality ) )
{
aThumbBmp.Convert( BMP_CONVERSION_8BIT_COLORS );
bRet = true;
@@ -509,7 +507,7 @@ bool SgaObjectSvDraw::CreateThumb( const FmFormModel& rModel )
if(!!aThumbBmp)
{
- aThumbBmp.Scale(Size(nTargetSizeX, nTargetSizeY), BMP_SCALE_BESTQUALITY);
+ aThumbBmp.Scale(Size(nTargetSizeX, nTargetSizeY), BmpScaleFlag::BestQuality);
aThumbBmp.Convert(BMP_CONVERSION_8BIT_COLORS);
bRet = true;
}
diff --git a/svx/source/stbctrls/modctrl.cxx b/svx/source/stbctrls/modctrl.cxx
index 41d66e0c07f0..5374f369c5f7 100644
--- a/svx/source/stbctrls/modctrl.cxx
+++ b/svx/source/stbctrls/modctrl.cxx
@@ -72,7 +72,7 @@ SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, Status
for (int i = 0; i < mxImpl->MODIFICATION_STATE_SIZE; i++)
{
BitmapEx b = mxImpl->maImages[i].GetBitmapEx();
- b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BMP_SCALE_FAST);
+ b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BmpScaleFlag::Fast);
mxImpl->maImages[i] = Image(b);
}
}
diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index cde8ef5a3c10..e102a7f96455 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -174,11 +174,11 @@ SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( sal_uInt16 _nSlotId,
if ( rStb.GetDPIScaleFactor() > 1)
{
BitmapEx b = pImp->aPosImage.GetBitmapEx();
- b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BMP_SCALE_FAST);
+ b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BmpScaleFlag::Fast);
pImp->aPosImage = Image(b);
b = pImp->aSizeImage.GetBitmapEx();
- b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BMP_SCALE_FAST);
+ b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BmpScaleFlag::Fast);
pImp->aSizeImage = Image(b);
}
diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx
index b4c795b13811..9fe589ac85b8 100644
--- a/svx/source/stbctrls/selctrl.cxx
+++ b/svx/source/stbctrls/selctrl.cxx
@@ -81,7 +81,7 @@ SvxSelectionModeControl::SvxSelectionModeControl( sal_uInt16 _nSlotId,
if ( GetStatusBar().GetDPIScaleFactor() > 1 )
{
BitmapEx b = maImage.GetBitmapEx();
- b.Scale(GetStatusBar().GetDPIScaleFactor(), GetStatusBar().GetDPIScaleFactor(), BMP_SCALE_FAST);
+ b.Scale(GetStatusBar().GetDPIScaleFactor(), GetStatusBar().GetDPIScaleFactor(), BmpScaleFlag::Fast);
maImage = Image(b);
}
//#endif
diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx
index f49c25584738..8ae7cb8a8a19 100644
--- a/svx/source/stbctrls/xmlsecctrl.cxx
+++ b/svx/source/stbctrls/xmlsecctrl.cxx
@@ -67,7 +67,7 @@ XmlSecStatusBarControl::XmlSecStatusBarControl( sal_uInt16 _nSlotId, sal_uInt16
for (int i = 0; i < 3; i++)
{
BitmapEx b = arr[i].GetBitmapEx();
- b.Scale(_rStb.GetDPIScaleFactor(), _rStb.GetDPIScaleFactor(), BMP_SCALE_FAST);
+ b.Scale(_rStb.GetDPIScaleFactor(), _rStb.GetDPIScaleFactor(), BmpScaleFlag::Fast);
arr[i] = Image(b);
}
diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx
index 52ef58c81f30..0bb522c5d5dc 100644
--- a/svx/source/stbctrls/zoomsliderctrl.cxx
+++ b/svx/source/stbctrls/zoomsliderctrl.cxx
@@ -172,7 +172,7 @@ SvxZoomSliderControl::SvxZoomSliderControl( sal_uInt16 _nSlotId, sal_uInt16 _nI
{
BitmapEx aBitmap = arr[i].GetBitmapEx();
//Use Lanczos scaling for the slider button because it does a better job with circles
- aBitmap.Scale(nScaleFactor, nScaleFactor, i == 0 ? BMP_SCALE_LANCZOS : BMP_SCALE_FAST);
+ aBitmap.Scale(nScaleFactor, nScaleFactor, i == 0 ? BmpScaleFlag::Lanczos : BmpScaleFlag::Fast);
arr[i] = Image(aBitmap);
}
mxImpl->maSliderButton = arr[0];
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 26a7269d685a..4c91ae607d47 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -843,7 +843,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
{
BitmapEx aBmpEx( aGraphic.GetBitmapEx() );
// export: use highest quality
- aBmpEx.Scale( Size( rSettings.mnWidth, rSettings.mnHeight ), BMP_SCALE_LANCZOS );
+ aBmpEx.Scale( Size( rSettings.mnWidth, rSettings.mnHeight ), BmpScaleFlag::Lanczos );
aGraphic = aBmpEx;
}
diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx
index 4bfe888cca34..6dc7849917d0 100644
--- a/svx/source/xoutdev/xtabdash.cxx
+++ b/svx/source/xoutdev/xtabdash.cxx
@@ -176,7 +176,7 @@ Bitmap XDashList::ImpCreateBitmapForXDash(const XDash* pDash)
if(1 != nFactor)
{
- aRetval.Scale(Size((rSize.Width() * 5) / 2, rSize.Height()), BMP_SCALE_DEFAULT);
+ aRetval.Scale(Size((rSize.Width() * 5) / 2, rSize.Height()), BmpScaleFlag::Default);
}
return aRetval;
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index d7c8d214c232..c6b660c4e0c6 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -6193,7 +6193,7 @@ static void lcl_paintBitmapExToRect(OutputDevice *pOut, const Point& aPoint, con
const long nWidth = aPageRightShadow.GetSizePixel().Width();
const long nHeight = aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1);
if (aPageRightShadow.GetSizePixel().Height() < nHeight)
- aPageRightShadow.Scale(Size(nWidth, nHeight), BMP_SCALE_FAST);
+ aPageRightShadow.Scale(Size(nWidth, nHeight), BmpScaleFlag::Fast);
lcl_paintBitmapExToRect(pOut,
Point(aPaintRect.Right() + mnShadowPxWidth, aPagePxRect.Top() + mnShadowPxWidth - 1),
@@ -6214,7 +6214,7 @@ static void lcl_paintBitmapExToRect(OutputDevice *pOut, const Point& aPoint, con
const long nWidth = aPageLeftShadow.GetSizePixel().Width();
const long nHeight = aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1);
if (aPageLeftShadow.GetSizePixel().Height() < nHeight)
- aPageLeftShadow.Scale(Size(nWidth, nHeight), BMP_SCALE_FAST);
+ aPageLeftShadow.Scale(Size(nWidth, nHeight), BmpScaleFlag::Fast);
lcl_paintBitmapExToRect(pOut,
Point(lLeft, aPagePxRect.Top() + mnShadowPxWidth - 1),
@@ -6226,7 +6226,7 @@ static void lcl_paintBitmapExToRect(OutputDevice *pOut, const Point& aPoint, con
// Bottom shadow
const long nBottomHeight = aPageBottomShadow.GetSizePixel().Height();
if (aPageBottomShadow.GetSizePixel().Width() < aPaintRect.Width())
- aPageBottomShadow.Scale(Size(aPaintRect.Width(), nBottomHeight), BMP_SCALE_FAST);
+ aPageBottomShadow.Scale(Size(aPaintRect.Width(), nBottomHeight), BmpScaleFlag::Fast);
lcl_paintBitmapExToRect(pOut,
Point(aPaintRect.Left(), aPagePxRect.Bottom() + 2),
@@ -6236,7 +6236,7 @@ static void lcl_paintBitmapExToRect(OutputDevice *pOut, const Point& aPoint, con
// Top shadow
const long nTopHeight = aPageTopShadow.GetSizePixel().Height();
if (aPageTopShadow.GetSizePixel().Width() < aPaintRect.Width())
- aPageTopShadow.Scale(Size(aPaintRect.Width(), nTopHeight), BMP_SCALE_FAST);
+ aPageTopShadow.Scale(Size(aPaintRect.Width(), nTopHeight), BmpScaleFlag::Fast);
lcl_paintBitmapExToRect(pOut,
Point(aPaintRect.Left(), aPagePxRect.Top() - mnShadowPxWidth),
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 36ab74aa71a4..1a08cde77132 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1560,7 +1560,7 @@ void SwContentTree::Display( bool bActive )
OUString rImageName = aEntryImages.GetImageName(i);
BitmapEx b = aEntryImages.GetImage(rImageName).GetBitmapEx();
//Use Lanczos because it looks better with circles / diagonals
- b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_LANCZOS);
+ b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Lanczos);
aEntryImages.ReplaceImage(rImageName, Image(b));
}
}
diff --git a/sw/source/uibase/utlui/viewlayoutctrl.cxx b/sw/source/uibase/utlui/viewlayoutctrl.cxx
index 8ba1e3befd82..68f2559576e3 100644
--- a/sw/source/uibase/utlui/viewlayoutctrl.cxx
+++ b/sw/source/uibase/utlui/viewlayoutctrl.cxx
@@ -62,7 +62,7 @@ SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId,
for (int i = 0; i < 6; i++)
{
BitmapEx aBitmap = arr[i].GetBitmapEx();
- aBitmap.Scale(nScaleFactor, nScaleFactor, BMP_SCALE_FAST);
+ aBitmap.Scale(nScaleFactor, nScaleFactor, BmpScaleFlag::Fast);
arr[i] = Image(aBitmap);
}
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index 639cc594e588..bd76ce30d7bd 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -623,7 +623,7 @@ namespace
bool bModified( false );
BitmapEx aBitmapEx = aImage.GetBitmapEx();
- bModified = aBitmapEx.Scale( aNewSize, BMP_SCALE_BESTQUALITY );
+ bModified = aBitmapEx.Scale( aNewSize, BmpScaleFlag::BestQuality );
if ( bModified )
aImage = Image( aBitmapEx );
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index 23dae7e78352..901526ea7fea 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -360,7 +360,7 @@ bool SvpSalBitmap::Erase( const ::Color& /*rFillColor*/ )
return false;
}
-bool SvpSalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, sal_uInt32 /*nScaleFlag*/ )
+bool SvpSalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, BmpScaleFlag /*nScaleFlag*/ )
{
return false;
}
diff --git a/vcl/inc/headless/svpbmp.hxx b/vcl/inc/headless/svpbmp.hxx
index b0fc0769aa42..168852e3caf2 100644
--- a/vcl/inc/headless/svpbmp.hxx
+++ b/vcl/inc/headless/svpbmp.hxx
@@ -61,7 +61,7 @@ public:
virtual bool Crop( const Rectangle& rRectPixel ) SAL_OVERRIDE;
virtual bool Erase( const Color& rFillColor ) SAL_OVERRIDE;
- virtual bool Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) SAL_OVERRIDE;
+ virtual bool Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) SAL_OVERRIDE;
virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) SAL_OVERRIDE;
static sal_uInt32 getBitCountFromScanlineFormat( basebmp::Format nFormat );
diff --git a/vcl/inc/impbmp.hxx b/vcl/inc/impbmp.hxx
index aebc89f00338..0dc9ec8bc974 100644
--- a/vcl/inc/impbmp.hxx
+++ b/vcl/inc/impbmp.hxx
@@ -65,7 +65,7 @@ public:
inline void ImplSetChecksum( sal_uLong nChecksum ) { mnChecksum = nChecksum; }
inline sal_uLong ImplGetChecksum() const { return mnChecksum; }
- bool ImplScale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag );
+ bool ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag );
bool ImplReplace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol );
};
diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx
index 7536144e44ae..3df78c8b2051 100644
--- a/vcl/inc/opengl/salbmp.hxx
+++ b/vcl/inc/opengl/salbmp.hxx
@@ -81,7 +81,7 @@ public:
bool Crop( const Rectangle& rRectPixel ) SAL_OVERRIDE;
bool Erase( const Color& rFillColor ) SAL_OVERRIDE;
- bool Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) SAL_OVERRIDE;
+ bool Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) SAL_OVERRIDE;
bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) SAL_OVERRIDE;
public:
@@ -108,7 +108,7 @@ private:
public:
- bool ImplScale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag );
+ bool ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag );
};
#endif // INCLUDED_VCL_INC_OPENGL_SALBMP_H
diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx
index 432c4df72c2a..f89f4171072e 100644
--- a/vcl/inc/salbmp.hxx
+++ b/vcl/inc/salbmp.hxx
@@ -32,6 +32,7 @@ class Color;
class SalGraphics;
class BitmapPalette;
struct BitmapSystemData;
+enum class BmpScaleFlag;
class VCL_PLUGIN_PUBLIC SalBitmap
{
@@ -60,7 +61,7 @@ public:
virtual bool Crop( const Rectangle& rRectPixel ) = 0;
virtual bool Erase( const Color& rFillColor ) = 0;
- virtual bool Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) = 0;
+ virtual bool Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) = 0;
virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) = 0;
};
diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h
index 0dc5b362866f..65d85ba862e5 100644
--- a/vcl/inc/unx/salbmp.h
+++ b/vcl/inc/unx/salbmp.h
@@ -148,7 +148,7 @@ public:
virtual bool Crop( const Rectangle& rRectPixel ) SAL_OVERRIDE;
virtual bool Erase( const Color& rFillColor ) SAL_OVERRIDE;
- virtual bool Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) SAL_OVERRIDE;
+ virtual bool Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) SAL_OVERRIDE;
virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) SAL_OVERRIDE;
};
diff --git a/vcl/opengl/scale.cxx b/vcl/opengl/scale.cxx
index 741d973514ba..950aa5078fc1 100644
--- a/vcl/opengl/scale.cxx
+++ b/vcl/opengl/scale.cxx
@@ -34,10 +34,10 @@ private:
OpenGLSalBitmap* mpBitmap;
double mfScaleX;
double mfScaleY;
- sal_uInt32 mnScaleFlag;
+ BmpScaleFlag mnScaleFlag;
public:
- ScaleOp( OpenGLSalBitmap* pBitmap, const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag );
+ ScaleOp( OpenGLSalBitmap* pBitmap, const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag );
bool Execute() SAL_OVERRIDE;
void GetSize( Size& rSize ) const SAL_OVERRIDE;
@@ -261,32 +261,32 @@ bool OpenGLSalBitmap::ImplScaleArea( double rScaleX, double rScaleY )
return true;
}
-bool OpenGLSalBitmap::ImplScale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag )
+bool OpenGLSalBitmap::ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag )
{
SAL_INFO( "vcl.opengl", "::ImplScale" );
maUserBuffer.reset();
makeCurrent();
- if( nScaleFlag == BMP_SCALE_FAST )
+ if( nScaleFlag == BmpScaleFlag::Fast )
{
return ImplScaleFilter( rScaleX, rScaleY, GL_NEAREST );
}
- if( nScaleFlag == BMP_SCALE_BILINEAR )
+ if( nScaleFlag == BmpScaleFlag::BiLinear )
{
return ImplScaleFilter( rScaleX, rScaleY, GL_LINEAR );
}
- else if( nScaleFlag == BMP_SCALE_SUPER || nScaleFlag == BMP_SCALE_DEFAULT )
+ else if( nScaleFlag == BmpScaleFlag::Super || nScaleFlag == BmpScaleFlag::Default )
{
const Lanczos3Kernel aKernel;
return ImplScaleConvolution( rScaleX, rScaleY, aKernel );
}
- else if( nScaleFlag == BMP_SCALE_BESTQUALITY && rScaleX <= 1 && rScaleY <= 1 )
+ else if( nScaleFlag == BmpScaleFlag::BestQuality && rScaleX <= 1 && rScaleY <= 1 )
{ // Use are scaling for best quality, but only if downscaling.
return ImplScaleArea( rScaleX, rScaleY );
}
- else if( nScaleFlag == BMP_SCALE_LANCZOS || nScaleFlag == BMP_SCALE_BESTQUALITY )
+ else if( nScaleFlag == BmpScaleFlag::Lanczos || nScaleFlag == BmpScaleFlag::BestQuality )
{
const Lanczos3Kernel aKernel;
@@ -301,7 +301,7 @@ ScaleOp::ScaleOp(
OpenGLSalBitmap* pBitmap,
const double& rScaleX,
const double& rScaleY,
- sal_uInt32 nScaleFlag )
+ BmpScaleFlag nScaleFlag )
: mpBitmap( pBitmap )
, mfScaleX( rScaleX )
, mfScaleY( rScaleY )
@@ -322,16 +322,16 @@ void ScaleOp::GetSize( Size& rSize ) const
rSize.setHeight( rSize.Height() * mfScaleY );
}
-bool OpenGLSalBitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag )
+bool OpenGLSalBitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag )
{
- SAL_INFO( "vcl.opengl", "::Scale " << nScaleFlag );
-
- if( nScaleFlag == BMP_SCALE_FAST ||
- nScaleFlag == BMP_SCALE_BILINEAR ||
- nScaleFlag == BMP_SCALE_SUPER ||
- nScaleFlag == BMP_SCALE_LANCZOS ||
- nScaleFlag == BMP_SCALE_DEFAULT ||
- nScaleFlag == BMP_SCALE_BESTQUALITY )
+ SAL_INFO( "vcl.opengl", "::Scale " << static_cast<int>(nScaleFlag) );
+
+ if( nScaleFlag == BmpScaleFlag::Fast ||
+ nScaleFlag == BmpScaleFlag::BiLinear ||
+ nScaleFlag == BmpScaleFlag::Super ||
+ nScaleFlag == BmpScaleFlag::Lanczos ||
+ nScaleFlag == BmpScaleFlag::Default ||
+ nScaleFlag == BmpScaleFlag::BestQuality )
{
makeCurrent();
if( mpContext == NULL )
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx
index c52727bdfa61..306b0dfdbc2d 100644
--- a/vcl/qa/cppunit/BitmapTest.cxx
+++ b/vcl/qa/cppunit/BitmapTest.cxx
@@ -112,7 +112,7 @@ void BitmapTest::testScale()
rFilter.compressAsPNG(aBitmap24Bit, aStream, 9);
}
- aBitmap24Bit.Scale(2, 2, BMP_SCALE_FAST);
+ aBitmap24Bit.Scale(2, 2, BmpScaleFlag::Fast);
CPPUNIT_ASSERT_EQUAL(static_cast<long>(20), aBitmap24Bit.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL(static_cast<long>(20), aBitmap24Bit.GetSizePixel().Height());
diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
index 81706f85a600..9e5f79882cdd 100644
--- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
@@ -62,7 +62,7 @@ bool VclFiltersTest::load(const OUString &,
void VclFiltersTest::testScaling()
{
- for (unsigned int i = BMP_SCALE_NONE + 1; i <= BMP_SCALE_BOX; i++)
+ for (BmpScaleFlag i = BmpScaleFlag::Default; i <= BmpScaleFlag::Box; i = (BmpScaleFlag)((int)i + 1))
{
Bitmap aBitmap( Size( 413, 409 ), 24 );
BitmapEx aBitmapEx( aBitmap );
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index 9451b160969e..f3dc33e89565 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -864,7 +864,7 @@ bool Bitmap::ImplConvertGhosted()
return bRet;
}
-bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag )
+bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag )
{
bool bRetval(false);
@@ -904,7 +904,7 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nSc
//fdo#33455
//
//If we start with a 1 bit image, then after scaling it in any mode except
- //BMP_SCALE_FAST we have a 24bit image which is perfectly correct, but we
+ //BmpScaleFlag::Fast we have a 24bit image which is perfectly correct, but we
//are going to down-shift it to mono again and Bitmap::ImplMakeMono just
//has "Bitmap aNewBmp( GetSizePixel(), 1 );" to create a 1 bit bitmap which
//will default to black/white and the colors mapped to which ever is closer
@@ -914,28 +914,28 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nSc
//just use the fast scale rather than attempting to count unique colors in
//the other converters and pass all the info down through
//Bitmap::ImplMakeMono
- if (nStartCount == 1 && nScaleFlag != BMP_SCALE_NONE)
- nScaleFlag = BMP_SCALE_FAST;
+ if (nStartCount == 1 && nScaleFlag != BmpScaleFlag::NONE)
+ nScaleFlag = BmpScaleFlag::Fast;
switch(nScaleFlag)
{
- case BMP_SCALE_NONE :
+ case BmpScaleFlag::NONE :
{
bRetval = false;
break;
}
- case BMP_SCALE_FAST :
+ case BmpScaleFlag::Fast :
{
bRetval = ImplScaleFast( rScaleX, rScaleY );
break;
}
- case BMP_SCALE_INTERPOLATE :
+ case BmpScaleFlag::Interpolate :
{
bRetval = ImplScaleInterpolate( rScaleX, rScaleY );
break;
}
- case BMP_SCALE_SUPER:
- case BMP_SCALE_DEFAULT:
+ case BmpScaleFlag::Super:
+ case BmpScaleFlag::Default:
{
if (GetSizePixel().Width() < 2 || GetSizePixel().Height() < 2)
{
@@ -949,29 +949,29 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nSc
}
break;
}
- case BMP_SCALE_LANCZOS :
- case BMP_SCALE_BESTQUALITY:
+ case BmpScaleFlag::Lanczos :
+ case BmpScaleFlag::BestQuality:
{
const Lanczos3Kernel kernel;
bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
break;
}
- case BMP_SCALE_BICUBIC :
+ case BmpScaleFlag::BiCubic :
{
const BicubicKernel kernel;
bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
break;
}
- case BMP_SCALE_BILINEAR :
+ case BmpScaleFlag::BiLinear :
{
const BilinearKernel kernel;
bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
break;
}
- case BMP_SCALE_BOX :
+ case BmpScaleFlag::Box :
{
const BoxKernel kernel;
@@ -984,7 +984,7 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nSc
return bRetval;
}
-bool Bitmap::Scale( const Size& rNewSize, sal_uInt32 nScaleFlag )
+bool Bitmap::Scale( const Size& rNewSize, BmpScaleFlag nScaleFlag )
{
const Size aSize( GetSizePixel() );
bool bRet;
@@ -1556,8 +1556,8 @@ namespace
}
}
-// #i121233# Added BMP_SCALE_LANCZOS, BMP_SCALE_BICUBIC, BMP_SCALE_BILINEAR and
-// BMP_SCALE_BOX derived from the original commit from Tomas Vajngerl (see
+// #i121233# Added BmpScaleFlag::Lanczos, BmpScaleFlag::BiCubic, BmpScaleFlag::BiLinear and
+// BmpScaleFlag::Box derived from the original commit from Tomas Vajngerl (see
// bugzilla task for deitails) Thanks!
bool Bitmap::ImplScaleConvolution(
const double& rScaleX,
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 41f1e9254d4d..38a770d47138 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -336,7 +336,7 @@ sal_uLong BitmapEx::GetChecksum() const
return nCrc;
}
-void BitmapEx::SetSizePixel( const Size& rNewSize, sal_uInt32 nScaleFlag )
+void BitmapEx::SetSizePixel( const Size& rNewSize, BmpScaleFlag nScaleFlag )
{
if(GetSizePixel() != rNewSize)
{
@@ -374,7 +374,7 @@ bool BitmapEx::Mirror( sal_uLong nMirrorFlags )
return bRet;
}
-bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag )
+bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag )
{
bool bRet = false;
@@ -396,7 +396,7 @@ bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 n
return bRet;
}
-bool BitmapEx::Scale( const Size& rNewSize, sal_uInt32 nScaleFlag )
+bool BitmapEx::Scale( const Size& rNewSize, BmpScaleFlag nScaleFlag )
{
bool bRet;
@@ -695,7 +695,7 @@ BitmapEx BitmapEx:: AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize
}
aScaledSize = Size( imgNewWidth, imgNewHeight );
- aRet.Scale( aScaledSize, BMP_SCALE_BESTQUALITY );
+ aRet.Scale( aScaledSize, BmpScaleFlag::BestQuality );
}
else
{
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 0eafc4f67e38..f3a44928be90 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2887,7 +2887,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm )
return rOStm;
}
-bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, sal_uInt32 nMaximumExtent, BmpConversion eColorConversion, long nScaleFlag) const
+bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, sal_uInt32 nMaximumExtent, BmpConversion eColorConversion, BmpScaleFlag nScaleFlag) const
{
// initialization seems to be complicated but is used to avoid rounding errors
ScopedVclPtrInstance< VirtualDevice > aVDev;
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index 696ede09345c..298bfaa1cd0f 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -88,7 +88,7 @@ void ImpBitmap::ImplReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode
mnChecksum = 0;
}
-bool ImpBitmap::ImplScale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag )
+bool ImpBitmap::ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag )
{
return mpSalBitmap->Scale( rScaleX, rScaleY, nScaleFlag );
}
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 58bb314a1a10..7758c6d32161 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -568,7 +568,7 @@ BitmapEx ImpGraphic::ImplGetBitmapEx(const GraphicConversionParameters& rParamet
{
aRetBmpEx.Scale(
rParameters.getSizePixel(),
- rParameters.getScaleHighQuality() ? BMP_SCALE_INTERPOLATE : BMP_SCALE_FAST);
+ rParameters.getScaleHighQuality() ? BmpScaleFlag::Interpolate : BmpScaleFlag::Fast);
}
}
else if( ( meType != GRAPHIC_DEFAULT ) && ImplIsSupportedGraphic() )
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 09c8d1b27997..837d69f9aa19 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -128,7 +128,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz
if( aNewBmpSize.Width() && aNewBmpSize.Height() )
{
// #i121233# Use best quality for PDF exports
- aBitmapEx.Scale( aNewBmpSize, BMP_SCALE_BESTQUALITY );
+ aBitmapEx.Scale( aNewBmpSize, BmpScaleFlag::BestQuality );
}
else
{
diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx
index a1ebb5d39732..c532606b4eb8 100644
--- a/vcl/source/helper/canvasbitmap.cxx
+++ b/vcl/source/helper/canvasbitmap.cxx
@@ -448,7 +448,7 @@ uno::Reference< rendering::XBitmap > SAL_CALL VclCanvasBitmap::getScaledBitmap(
SolarMutexGuard aGuard;
BitmapEx aNewBmp( m_aBitmap );
- aNewBmp.Scale( sizeFromRealSize2D( newSize ), beFast ? BMP_SCALE_DEFAULT : BMP_SCALE_BESTQUALITY );
+ aNewBmp.Scale( sizeFromRealSize2D( newSize ), beFast ? BmpScaleFlag::Default : BmpScaleFlag::BestQuality );
return uno::Reference<rendering::XBitmap>( new VclCanvasBitmap( aNewBmp ) );
}
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index a70a3d0c1a17..5571d03ad70f 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1947,7 +1947,7 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI
if (nScaleFactor != 1)
{
BitmapEx aBitmap = aImage.GetBitmapEx();
- aBitmap.Scale(nScaleFactor, nScaleFactor, BMP_SCALE_FAST);
+ aBitmap.Scale(nScaleFactor, nScaleFactor, BmpScaleFlag::Fast);
aImage = Image(aBitmap);
}
aTmpPos = aOuterCheckRect.TopLeft();
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 2391f61ca8c2..ad18df4f507a 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -184,7 +184,7 @@ void PrintDialog::PrintPreviewWindow::Paint( vcl::RenderContext& /*rRenderContex
else
{
Bitmap aPreviewBitmap(maPreviewBitmap);
- aPreviewBitmap.Scale(maPreviewSize, BMP_SCALE_BESTQUALITY);
+ aPreviewBitmap.Scale(maPreviewSize, BmpScaleFlag::BestQuality);
DrawBitmap(aOffset, aPreviewBitmap);
}
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 4d3c80186d49..cedf3bd1b184 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1124,7 +1124,7 @@ void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
// FIXME find out what that code is & fix accordingly
if (aBitmap.GetSizePixel().Width() < 32)
{
- aBitmap.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST);
+ aBitmap.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
aImage = Image(aBitmap);
}
}
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index fb003fb7ce7a..8087b2245be0 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -870,7 +870,7 @@ bool X11SalBitmap::Erase( const ::Color& /*rFillColor*/ )
return false;
}
-bool X11SalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, sal_uInt32 /*nScaleFlag*/ )
+bool X11SalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, BmpScaleFlag /*nScaleFlag*/ )
{
return false;
}
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index db73f57fe3d5..8ddfca088ca3 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -660,7 +660,7 @@ public:
for (size_t i = 0; i < SAL_N_ELEMENTS(aSizes); i++)
{
aShadowStretch.Scale(Size(aShadowStretch.GetSizePixel().Width(), aSizes[i]),
- BMP_SCALE_FAST);
+ BmpScaleFlag::Fast);
rDev.DrawBitmapEx(aRenderPt, aShadowStretch);
aRenderPt.Move(aShadowStretch.GetSizePixel().Width() + 4, 0);
@@ -685,7 +685,7 @@ public:
const RenderContext &rCtx) SAL_OVERRIDE
{
Bitmap aBitmap(rCtx.mpDemoRenderer->maIntroBW);
- aBitmap.Scale(r.GetSize(), BMP_SCALE_BESTQUALITY);
+ aBitmap.Scale(r.GetSize(), BmpScaleFlag::BestQuality);
rDev.DrawBitmap(r.TopLeft(), aBitmap);
SimulateBorderStretch(rDev, r);
@@ -702,7 +702,7 @@ public:
maCheckered.RenderRegion(rDev, r, rCtx);
BitmapEx aBitmap(rCtx.mpDemoRenderer->maIntro);
- aBitmap.Scale(r.GetSize(), BMP_SCALE_BESTQUALITY);
+ aBitmap.Scale(r.GetSize(), BmpScaleFlag::BestQuality);
AlphaMask aSemiTransp(aBitmap.GetSizePixel());
aSemiTransp.Erase(64);
rDev.DrawBitmapEx(r.TopLeft(), BitmapEx(aBitmap.GetBitmap(),
@@ -1069,7 +1069,7 @@ public:
const RenderContext &) SAL_OVERRIDE
{
Bitmap aBitmap(rDev.GetBitmap(Point(0,0),rDev.GetOutputSizePixel()));
- aBitmap.Scale(r.GetSize(), BMP_SCALE_BESTQUALITY);
+ aBitmap.Scale(r.GetSize(), BmpScaleFlag::BestQuality);
rDev.DrawBitmap(r.TopLeft(), aBitmap);
}
};