convert BMP_SCALE constant to scoped enum
Change-Id: Ibc9f88d2588c028cd71aa86c26d970a73025ef22
This commit is contained in:
parent
ba121a3269
commit
b13fbd19b7
@ -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 ) );
|
||||
|
@ -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 ) );
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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 )
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -78,7 +78,7 @@ private:
|
||||
double GetViewWidthInch();
|
||||
double GetViewHeightInch();
|
||||
|
||||
sal_uLong GetSelectedInterpolationType();
|
||||
BmpScaleFlag GetSelectedInterpolationType();
|
||||
|
||||
public:
|
||||
CompressGraphicsDialog( vcl::Window* pParent, SdrGrafObj* pGraphicObj, SfxBindings& rBindings );
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
||||
|
@ -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; }
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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];
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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),
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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 );
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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 );
|
||||
|
@ -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 );
|
||||
};
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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 );
|
||||
SAL_INFO( "vcl.opengl", "::Scale " << static_cast<int>(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 )
|
||||
if( nScaleFlag == BmpScaleFlag::Fast ||
|
||||
nScaleFlag == BmpScaleFlag::BiLinear ||
|
||||
nScaleFlag == BmpScaleFlag::Super ||
|
||||
nScaleFlag == BmpScaleFlag::Lanczos ||
|
||||
nScaleFlag == BmpScaleFlag::Default ||
|
||||
nScaleFlag == BmpScaleFlag::BestQuality )
|
||||
{
|
||||
makeCurrent();
|
||||
if( mpContext == NULL )
|
||||
|
@ -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());
|
||||
|
@ -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 );
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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 );
|
||||
}
|
||||
|
@ -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() )
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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 ) );
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user