Use BMP_SCALE_LANCZOS instead of BMP_SCALE_INTERPOLATE.

Where we explicitly ask for better quality, use BMP_SCALE_LANCZOS, instead of
BMP_SCALE_INTERPOLATE.

Change-Id: I28ddf3290204532a8660e09ee9ab0949b6ce1c73
This commit is contained in:
Jan Holesovsky
2012-06-04 14:47:18 +02:00
parent 6428bef05a
commit 9afb6e1e38
17 changed files with 19 additions and 19 deletions

View File

@@ -129,7 +129,7 @@ namespace vclcanvas
BitmapEx aRes( mpBackBuffer->getBitmapReference() );
aRes.Scale( ::vcl::unotools::sizeFromRealSize2D(newSize),
beFast ? BMP_SCALE_FAST : BMP_SCALE_INTERPOLATE );
beFast ? BMP_SCALE_FAST : BMP_SCALE_LANCZOS );
return uno::Reference< rendering::XBitmap >(
new CanvasBitmap( aRes, *mpDevice, mpOutDevReference ) );

View File

@@ -927,7 +927,7 @@ namespace vclcanvas
Bitmap aBitmap( rOutDev.GetBitmap(aEmptyPoint, aBmpSize) );
aBitmap.Scale( ::vcl::unotools::sizeFromRealSize2D(newSize),
beFast ? BMP_SCALE_FAST : BMP_SCALE_INTERPOLATE );
beFast ? BMP_SCALE_FAST : BMP_SCALE_LANCZOS );
return uno::Reference< rendering::XBitmap >(
new CanvasBitmap( aBitmap, *mpDevice, mpOutDev ) );

View File

@@ -126,7 +126,7 @@ GraphicFilterDialog::GraphicFilterDialog( Window* pParent, const ResId& rResId,
{
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
if( aBmpEx.Scale( aGrfSize, BMP_SCALE_INTERPOLATE ) )
if( aBmpEx.Scale( aGrfSize, BMP_SCALE_LANCZOS ) )
maGraphic = aBmpEx;
}
}

View File

@@ -499,7 +499,7 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview )
{
Size aSizeBitmap( ( aSizePoint.Width() + 7 ) & ~7, aSizePoint.Height() );
Bitmap aTmpBitmap( pPreview->GetBitmap() );
aTmpBitmap.Scale( aSizeBitmap, BMP_SCALE_INTERPOLATE );
aTmpBitmap.Scale( aSizeBitmap, BMP_SCALE_LANCZOS );
aTmpBitmap.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
BitmapReadAccess* pAcc = aTmpBitmap.AcquireReadAccess();
if ( pAcc )

View File

@@ -1358,13 +1358,13 @@ void AddonsOptions_Impl::ReadImageFromURL( ImageSize nImageSize, const ::rtl::OU
if ( aBmpSize != aNoScaleSize )
{
BitmapEx aNoScaleBmp( aBitmapEx );
aNoScaleBmp.Scale( aNoScaleSize, BMP_SCALE_INTERPOLATE );
aNoScaleBmp.Scale( aNoScaleSize, BMP_SCALE_LANCZOS );
}
else
aImageNoScale = Image( aBitmapEx );
if ( aBmpSize != aSize )
aBitmapEx.Scale( aSize, BMP_SCALE_INTERPOLATE );
aBitmapEx.Scale( aSize, BMP_SCALE_LANCZOS );
aImage = Image( aBitmapEx );
}
@@ -1512,7 +1512,7 @@ sal_Bool AddonsOptions_Impl::CreateImageFromSequence( Image& rImage, sal_Bool bB
// Scale bitmap to fit the correct size for the menu/toolbar. Use best quality
if ( aBitmapEx.GetSizePixel() != aSize )
aBitmapEx.Scale( aSize, BMP_SCALE_INTERPOLATE );
aBitmapEx.Scale( aSize, BMP_SCALE_LANCZOS );
if( !aBitmapEx.IsTransparent() )
{

View File

@@ -214,7 +214,7 @@ sal_Bool ImageButtonToolbarController::ReadImageFromURL( sal_Bool bBigImage, con
{
::Size aNoScaleSize( aBmpSize.Width(), aSize.Height() );
if ( aBmpSize != aNoScaleSize )
aBitmapEx.Scale( aNoScaleSize, BMP_SCALE_INTERPOLATE );
aBitmapEx.Scale( aNoScaleSize, BMP_SCALE_LANCZOS );
aImage = Image( aBitmapEx );
return sal_True;
}

View File

@@ -92,7 +92,7 @@ void InterpolateFixedBitmap( FixedBitmap * pBitmap )
{
Bitmap aBmp( pBitmap->GetBitmap() );
Size aSize = pBitmap->GetSizePixel();
aBmp.Scale( aSize, BMP_SCALE_INTERPOLATE );
aBmp.Scale( aSize, BMP_SCALE_LANCZOS );
pBitmap->SetBitmap( aBmp );
}

View File

@@ -233,7 +233,7 @@ BitmapEx SlideRenderer::CreatePreview (
BitmapEx aScaledPreview = aPreview.GetBitmapEx();
aScaledPreview.Scale(
Size(aPreviewSize.Width,aPreviewSize.Height),
BMP_SCALE_INTERPOLATE);
BMP_SCALE_LANCZOS);
return aScaledPreview;
}
}

View File

@@ -87,7 +87,7 @@ Bitmap BitmapFactory::CreateBitmap (
false).GetBitmapEx().GetBitmap());
if (bDoSuperSampling && gbAllowSuperSampling)
{
aPreview.Scale(rPixelSize, BMP_SCALE_INTERPOLATE);
aPreview.Scale(rPixelSize, BMP_SCALE_LANCZOS);
}
return aPreview;

View File

@@ -216,7 +216,7 @@ Point InsertionIndicatorOverlay::PaintRepresentatives (
const Size aSuperSampleSize(
aPreviewSize.Width()*gnSuperScaleFactor,
aPreviewSize.Height()*gnSuperScaleFactor);
aPreview.Scale(aPreviewSize, BMP_SCALE_INTERPOLATE);
aPreview.Scale(aPreviewSize, BMP_SCALE_LANCZOS);
rContent.DrawBitmapEx(aPageOffset, aPreview);
// When the page is marked as excluded from the slide show then

View File

@@ -512,7 +512,7 @@ Image PreviewRenderer::ScaleBitmap (
// Paint the bitmap scaled to the desired width.
BitmapEx aScaledBitmap (rBitmapEx.GetBitmap());
aScaledBitmap.Scale (aPreviewSize, BMP_SCALE_INTERPOLATE);
aScaledBitmap.Scale (aPreviewSize, BMP_SCALE_LANCZOS);
mpPreviewDevice->DrawBitmap (
Point(1,1),
aPreviewSize,

View File

@@ -1550,7 +1550,7 @@ void SfxAppToolBoxControl_Impl::SetImage( const String &rURL )
if ( bBig && aImage.GetSizePixel() != aBigSize )
{
BitmapEx aScaleBmpEx( aImage.GetBitmapEx() );
aScaleBmpEx.Scale( aBigSize, BMP_SCALE_INTERPOLATE );
aScaleBmpEx.Scale( aBigSize, BMP_SCALE_LANCZOS );
GetToolBox().SetItemImage( GetId(), Image( aScaleBmpEx ) );
}
else

View File

@@ -111,7 +111,7 @@ sal_Bool SgaObject::CreateThumb( const Graphic& rGraphic )
Max( (long) (fFactor < 1. ? S_THUMB : S_THUMB / fFactor), 8L ) );
if( aThumbBmp.Scale( (double) aNewSize.Width() / aBmpSize.Width(),
(double) aNewSize.Height() / aBmpSize.Height(), BMP_SCALE_INTERPOLATE ) )
(double) aNewSize.Height() / aBmpSize.Height(), BMP_SCALE_LANCZOS ) )
{
aThumbBmp.Convert( BMP_CONVERSION_8BIT_COLORS );
bRet = sal_True;

View File

@@ -680,7 +680,7 @@ namespace
sal_Bool bModified( sal_False );
BitmapEx aBitmapEx = aImage.GetBitmapEx();
bModified = aBitmapEx.Scale( aNewSize, BMP_SCALE_INTERPOLATE );
bModified = aBitmapEx.Scale( aNewSize, BMP_SCALE_LANCZOS );
if ( bModified )
aImage = Image( aBitmapEx );

View File

@@ -754,7 +754,7 @@ BitmapEx BitmapEx:: AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize
}
aScaledSize = Size( imgNewWidth, imgNewHeight );
aRet.Scale( aScaledSize, BMP_SCALE_INTERPOLATE );
aRet.Scale( aScaledSize, BMP_SCALE_LANCZOS );
}
else
{

View File

@@ -139,7 +139,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz
aNewBmpSize.Height() = FRound( fMaxPixelX / fBmpWH);
}
if( aNewBmpSize.Width() && aNewBmpSize.Height() )
aBitmapEx.Scale( aNewBmpSize, BMP_SCALE_INTERPOLATE );
aBitmapEx.Scale( aNewBmpSize, BMP_SCALE_LANCZOS );
else
aBitmapEx.SetEmpty();
}

View File

@@ -460,7 +460,7 @@ uno::Reference< rendering::XBitmap > SAL_CALL VclCanvasBitmap::getScaledBitmap(
SolarMutexGuard aGuard;
BitmapEx aNewBmp( m_aBitmap );
aNewBmp.Scale( sizeFromRealSize2D( newSize ), beFast ? BMP_SCALE_FAST : BMP_SCALE_INTERPOLATE );
aNewBmp.Scale( sizeFromRealSize2D( newSize ), beFast ? BMP_SCALE_FAST : BMP_SCALE_LANCZOS );
return uno::Reference<rendering::XBitmap>( new VclCanvasBitmap( aNewBmp ) );
}