summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-08 16:18:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-09 08:42:06 +0000
commitb5699cd01b6a52906880c107bac6f3802ea7353d (patch)
tree131315b3755ddf31d56a5359b24a387d9e1ec2e0 /vcl
parentf1c844fed0fdf898fd6d027529cb2570eb52bec5 (diff)
convert BmpConversion to scoped enum
and drop unused 4BIT_TRANS and 1BIT_MATRIX enumerators Also fix a bug in x11::convertBitmapDepth where we were incorrectly passing BmpConversion enumeratirs to ReduceColors Change-Id: I903c6866750e46ee752e10a17c05fcaaf6b11242 Reviewed-on: https://gerrit.libreoffice.org/34062 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/BitmapTest.cxx2
-rw-r--r--vcl/qa/cppunit/jpeg/JpegReaderTest.cxx2
-rw-r--r--vcl/source/filter/graphicfilter.cxx6
-rw-r--r--vcl/source/filter/jpeg/JpegWriter.cxx2
-rw-r--r--vcl/source/filter/wmf/winmtf.cxx2
-rw-r--r--vcl/source/gdi/alpha.cxx6
-rw-r--r--vcl/source/gdi/bitmap.cxx12
-rw-r--r--vcl/source/gdi/bitmap3.cxx43
-rw-r--r--vcl/source/gdi/bitmap4.cxx2
-rw-r--r--vcl/source/gdi/bitmapex.cxx2
-rw-r--r--vcl/source/gdi/gdimtf.cxx2
-rw-r--r--vcl/source/gdi/impbmp.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx8
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx4
-rw-r--r--vcl/source/gdi/pngwrite.cxx4
-rw-r--r--vcl/source/gdi/print.cxx2
-rw-r--r--vcl/source/gdi/print2.cxx4
-rw-r--r--vcl/source/outdev/bitmap.cxx10
-rw-r--r--vcl/source/outdev/transparent.cxx2
-rw-r--r--vcl/unx/generic/dtrans/bmp.cxx8
-rw-r--r--vcl/workben/fftester.cxx34
-rw-r--r--vcl/workben/vcldemo.cxx2
22 files changed, 73 insertions, 88 deletions
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx
index 8259ba4b80d4..f6d69d6cba5d 100644
--- a/vcl/qa/cppunit/BitmapTest.cxx
+++ b/vcl/qa/cppunit/BitmapTest.cxx
@@ -70,7 +70,7 @@ void BitmapTest::testConvert()
CPPUNIT_ASSERT_EQUAL(sal_Int32(255), sal_Int32(rColor.GetBlue()));
}
- aBitmap.Convert(BMP_CONVERSION_24BIT);
+ aBitmap.Convert(BmpConversion::N24Bit);
CPPUNIT_ASSERT_EQUAL(sal_uInt16(24), aBitmap.GetBitCount());
{
diff --git a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx
index 8fcba6ee929e..573d3639b0ae 100644
--- a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx
+++ b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx
@@ -122,7 +122,7 @@ void JpegReaderTest::testReadGray()
CPPUNIT_ASSERT_EQUAL(12L, aSize.Width());
CPPUNIT_ASSERT_EQUAL(12L, aSize.Height());
- aBitmap.Convert(BmpConversion::BMP_CONVERSION_24BIT); // convert to 24bit so we don't need to deal with palette
+ aBitmap.Convert(BmpConversion::N24Bit); // convert to 24bit so we don't need to deal with palette
int nMaxDelta = 1;
CPPUNIT_ASSERT(checkRect(aBitmap, 0, 8, 8, Color(0xff, 0xff, 0xff), nMaxDelta));
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 4bf9efce66fa..7251a687a0db 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -1900,10 +1900,10 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString
if( aFilterName.equalsIgnoreAsciiCase( EXP_BMP ) )
{
Bitmap aBmp( aGraphic.GetBitmap() );
- sal_Int32 nColorRes = aConfigItem.ReadInt32( "Colors", 0 );
- if ( nColorRes && ( nColorRes <= (sal_uInt16)BMP_CONVERSION_24BIT) )
+ BmpConversion nColorRes = (BmpConversion) aConfigItem.ReadInt32( "Colors", 0 );
+ if ( nColorRes != BmpConversion::NNONE && ( nColorRes <= BmpConversion::N24Bit) )
{
- if( !aBmp.Convert( (BmpConversion) nColorRes ) )
+ if( !aBmp.Convert( nColorRes ) )
aBmp = aGraphic.GetBitmap();
}
bool bRleCoding = aConfigItem.ReadBool( "RLE_Coding", true );
diff --git a/vcl/source/filter/jpeg/JpegWriter.cxx b/vcl/source/filter/jpeg/JpegWriter.cxx
index c2b5308ce50a..6ffa172c3018 100644
--- a/vcl/source/filter/jpeg/JpegWriter.cxx
+++ b/vcl/source/filter/jpeg/JpegWriter.cxx
@@ -193,7 +193,7 @@ bool JPEGWriter::Write( const Graphic& rGraphic )
if ( mbGreys )
{
- if ( !aGraphicBmp.Convert( BMP_CONVERSION_8BIT_GREYS ) )
+ if ( !aGraphicBmp.Convert( BmpConversion::N8BitGreys ) )
aGraphicBmp = rGraphic.GetBitmap();
}
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index b824a1a2edde..d51db44b11ae 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -1800,7 +1800,7 @@ void WinMtfOutput::ResolveBitmapActions( std::vector<std::unique_ptr<BSaveStruct
Bitmap aMask( aBitmap );
if ( ( nUsed & 1 ) && ( nRasterOperation & 0xb0 ) == 0xb0 ) // pattern used
{
- aBitmap.Convert( BMP_CONVERSION_24BIT );
+ aBitmap.Convert( BmpConversion::N24Bit );
aBitmap.Erase( maFillStyle.aFillColor );
}
BitmapEx aBmpEx( aBitmap, aMask );
diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx
index dc4b50797030..0ece422f591d 100644
--- a/vcl/source/gdi/alpha.cxx
+++ b/vcl/source/gdi/alpha.cxx
@@ -30,7 +30,7 @@ AlphaMask::AlphaMask( const Bitmap& rBitmap ) :
Bitmap( rBitmap )
{
if( !!rBitmap )
- Convert( BMP_CONVERSION_8BIT_GREYS );
+ Convert( BmpConversion::N8BitGreys );
}
AlphaMask::AlphaMask( const AlphaMask& rAlphaMask ) :
@@ -59,7 +59,7 @@ AlphaMask& AlphaMask::operator=( const Bitmap& rBitmap )
*static_cast<Bitmap*>(this) = rBitmap;
if( !!rBitmap )
- Convert( BMP_CONVERSION_8BIT_GREYS );
+ Convert( BmpConversion::N8BitGreys );
return *this;
}
@@ -154,7 +154,7 @@ void AlphaMask::ReleaseAccess( BitmapReadAccess* pAccess )
if( pAccess )
{
Bitmap::ReleaseAccess( pAccess );
- Convert( BMP_CONVERSION_8BIT_GREYS );
+ Convert( BmpConversion::N8BitGreys );
}
}
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index 2ace729f1f0c..2931f7c1d8dc 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -785,15 +785,15 @@ bool Bitmap::CopyPixel( const Rectangle& rRectDst,
int nNextIndex = 0;
if( ( nSrcBitCount == 24 ) && ( nDstBitCount < 24 ) )
- Convert( BMP_CONVERSION_24BIT );
+ Convert( BmpConversion::N24Bit );
else if( ( nSrcBitCount == 8 ) && ( nDstBitCount < 8 ) )
{
- Convert( BMP_CONVERSION_8BIT_COLORS );
+ Convert( BmpConversion::N8BitColors );
nNextIndex = 16;
}
else if( ( nSrcBitCount == 4 ) && ( nDstBitCount < 4 ) )
{
- Convert( BMP_CONVERSION_4BIT_COLORS );
+ Convert( BmpConversion::N4BitColors );
nNextIndex = 2;
}
@@ -1531,7 +1531,7 @@ bool Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal
// Bitmaps with 1 bit color depth can cause problems
// if they have other entries than black/white in their palette
if( 1 == GetBitCount() )
- Convert( BMP_CONVERSION_4BIT_COLORS );
+ Convert( BmpConversion::N4BitColors );
ScopedWriteAccess pAcc(*this);
bool bRet = false;
@@ -1593,7 +1593,7 @@ bool Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
// Bitmaps with 1 bit color depth can cause problems
// if they have other entries than black/white in their palette
if( 1 == GetBitCount() )
- Convert( BMP_CONVERSION_4BIT_COLORS );
+ Convert( BmpConversion::N4BitColors );
ScopedWriteAccess pAcc(*this);
bool bRet = false;
@@ -1760,7 +1760,7 @@ bool Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor )
// Convert to a truecolor bitmap, if we're a paletted one. There's
// room for tradeoff decision here, maybe later for an overload (or a flag)
if( GetBitCount() <= 8 )
- Convert( BMP_CONVERSION_24BIT );
+ Convert( BmpConversion::N24Bit );
AlphaMask::ScopedReadAccess pAlphaAcc(const_cast<AlphaMask&>(rAlpha));
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index b59543a20e17..7d42865214b0 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -263,19 +263,15 @@ bool Bitmap::Convert( BmpConversion eConversion )
switch( eConversion )
{
- case BMP_CONVERSION_1BIT_THRESHOLD:
+ case BmpConversion::N1BitThreshold:
bRet = ImplMakeMono( 128 );
break;
- case BMP_CONVERSION_1BIT_MATRIX:
- bRet = ImplMakeMonoDither();
- break;
-
- case BMP_CONVERSION_4BIT_GREYS:
+ case BmpConversion::N4BitGreys:
bRet = ImplMakeGreyscales( 16 );
break;
- case BMP_CONVERSION_4BIT_COLORS:
+ case BmpConversion::N4BitColors:
{
if( nBitCount < 4 )
bRet = ImplConvertUp( 4 );
@@ -286,22 +282,11 @@ bool Bitmap::Convert( BmpConversion eConversion )
}
break;
- case BMP_CONVERSION_4BIT_TRANS:
- {
- Color aTrans( BMP_COL_TRANS );
-
- if( nBitCount < 4 )
- bRet = ImplConvertUp( 4, &aTrans );
- else
- bRet = ImplConvertDown( 4, &aTrans );
- }
- break;
-
- case BMP_CONVERSION_8BIT_GREYS:
+ case BmpConversion::N8BitGreys:
bRet = ImplMakeGreyscales( 256 );
break;
- case BMP_CONVERSION_8BIT_COLORS:
+ case BmpConversion::N8BitColors:
{
if( nBitCount < 8 )
bRet = ImplConvertUp( 8 );
@@ -312,7 +297,7 @@ bool Bitmap::Convert( BmpConversion eConversion )
}
break;
- case BMP_CONVERSION_8BIT_TRANS:
+ case BmpConversion::N8BitTrans:
{
Color aTrans( BMP_COL_TRANS );
@@ -323,7 +308,7 @@ bool Bitmap::Convert( BmpConversion eConversion )
}
break;
- case BMP_CONVERSION_24BIT:
+ case BmpConversion::N24Bit:
{
if( nBitCount < 24 )
bRet = ImplConvertUp( 24 );
@@ -332,7 +317,7 @@ bool Bitmap::Convert( BmpConversion eConversion )
}
break;
- case BMP_CONVERSION_GHOSTED:
+ case BmpConversion::Ghosted:
bRet = ImplConvertGhosted();
break;
@@ -1018,18 +1003,18 @@ void Bitmap::ImplAdaptBitCount(Bitmap& rNew) const
{
case 1:
{
- rNew.Convert(BMP_CONVERSION_1BIT_THRESHOLD);
+ rNew.Convert(BmpConversion::N1BitThreshold);
break;
}
case 4:
{
if(HasGreyPalette())
{
- rNew.Convert(BMP_CONVERSION_4BIT_GREYS);
+ rNew.Convert(BmpConversion::N4BitGreys);
}
else
{
- rNew.Convert(BMP_CONVERSION_4BIT_COLORS);
+ rNew.Convert(BmpConversion::N4BitColors);
}
break;
}
@@ -1037,17 +1022,17 @@ void Bitmap::ImplAdaptBitCount(Bitmap& rNew) const
{
if(HasGreyPalette())
{
- rNew.Convert(BMP_CONVERSION_8BIT_GREYS);
+ rNew.Convert(BmpConversion::N8BitGreys);
}
else
{
- rNew.Convert(BMP_CONVERSION_8BIT_COLORS);
+ rNew.Convert(BmpConversion::N8BitColors);
}
break;
}
case 24:
{
- rNew.Convert(BMP_CONVERSION_24BIT);
+ rNew.Convert(BmpConversion::N24Bit);
break;
}
default:
diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx
index b60644fb439a..30c33bcd36b1 100644
--- a/vcl/source/gdi/bitmap4.cxx
+++ b/vcl/source/gdi/bitmap4.cxx
@@ -983,7 +983,7 @@ extern "C" int SAL_CALL ImplPopArtCmpFnc( const void* p1, const void* p2 )
bool Bitmap::ImplPopArt()
{
/* note: GetBitCount() after that is no more than 8 */
- bool bRet = ( GetBitCount() <= 8 ) || Convert( BMP_CONVERSION_8BIT_COLORS );
+ bool bRet = ( GetBitCount() <= 8 ) || Convert( BmpConversion::N8BitColors );
if( bRet )
{
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 0124ae16808f..218aac477265 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -170,7 +170,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) :
// X11SalGraphics::drawAlphaBitmap()'s render acceleration
// can handle the bitmap depth mismatch directly
if( aBitmap.GetBitCount() < aMask.GetBitCount() )
- aBitmap.Convert( BMP_CONVERSION_24BIT );
+ aBitmap.Convert( BmpConversion::N24Bit );
}
BitmapEx::BitmapEx( const Bitmap& rBmp, const Color& rTransparentColor ) :
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 1bbeba443760..160410313690 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2194,7 +2194,7 @@ void GDIMetaFile::Convert( MtfConversion eConversion )
ImplBmpConvertParam aBmpParam;
aColParam.eConversion = eConversion;
- aBmpParam.eConversion = ( MtfConversion::N1BitThreshold == eConversion ) ? BMP_CONVERSION_1BIT_THRESHOLD : BMP_CONVERSION_8BIT_GREYS;
+ aBmpParam.eConversion = ( MtfConversion::N1BitThreshold == eConversion ) ? BmpConversion::N1BitThreshold : BmpConversion::N8BitGreys;
ImplExchangeColors( ImplColConvertFnc, &aColParam, ImplBmpConvertFnc, &aBmpParam );
}
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index 13386856ac12..25ebb604d0f1 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -115,7 +115,7 @@ bool ImpBitmap::ImplReplace( const Color& rSearchColor, const Color& rReplaceCol
bool ImpBitmap::ImplConvert( BmpConversion eConversion )
{
// avoid large chunk of obsolete and hopefully rarely used conversions.
- if (eConversion != BMP_CONVERSION_8BIT_GREYS)
+ if (eConversion != BmpConversion::N8BitGreys)
return false;
// frequently used conversion for creating alpha masks
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 73aa7f2febef..0c4be9bb3491 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -10951,13 +10951,13 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
if( m_aContext.Version < PDFWriter::PDF_1_4 || ! rObject.m_aBitmap.IsAlpha() )
{
aBitmap = getExportBitmap(rObject.m_aBitmap.GetMask());
- aBitmap.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
+ aBitmap.Convert( BmpConversion::N1BitThreshold );
SAL_WARN_IF( aBitmap.GetBitCount() != 1, "vcl.pdfwriter", "mask conversion failed" );
}
else if( aBitmap.GetBitCount() != 8 )
{
aBitmap = getExportBitmap(rObject.m_aBitmap.GetAlpha().GetBitmap());
- aBitmap.Convert( BMP_CONVERSION_8BIT_GREYS );
+ aBitmap.Convert( BmpConversion::N8BitGreys );
SAL_WARN_IF( aBitmap.GetBitCount() != 8, "vcl.pdfwriter", "alpha mask conversion failed" );
}
}
@@ -11328,10 +11328,10 @@ const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx
BitmapEx aBitmap( i_rBitmap );
if( m_aContext.ColorMode == PDFWriter::DrawGreyscale )
{
- BmpConversion eConv = BMP_CONVERSION_8BIT_GREYS;
+ BmpConversion eConv = BmpConversion::N8BitGreys;
int nDepth = aBitmap.GetBitmap().GetBitCount();
if( nDepth <= 4 )
- eConv = BMP_CONVERSION_4BIT_GREYS;
+ eConv = BmpConversion::N4BitGreys;
if( nDepth > 1 )
aBitmap.Convert( eConv );
}
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index a06b9b945da2..bc96f0b2cff0 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -152,10 +152,10 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz
{
if( m_aContext.ColorMode == PDFWriter::DrawGreyscale )
{
- BmpConversion eConv = BMP_CONVERSION_8BIT_GREYS;
+ BmpConversion eConv = BmpConversion::N8BitGreys;
int nDepth = aBitmapEx.GetBitmap().GetBitCount();
if( nDepth <= 4 )
- eConv = BMP_CONVERSION_4BIT_GREYS;
+ eConv = BmpConversion::N4BitGreys;
if( nDepth > 1 )
aBitmapEx.Convert( eConv );
}
diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx
index 433b97beedc1..affe3de0e695 100644
--- a/vcl/source/gdi/pngwrite.cxx
+++ b/vcl/source/gdi/pngwrite.cxx
@@ -147,13 +147,13 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
{
if (mnBitsPerPixel <= 8 && rBmpEx.IsAlpha())
{
- aBmp.Convert( BMP_CONVERSION_24BIT );
+ aBmp.Convert( BmpConversion::N24Bit );
mnBitsPerPixel = 24;
}
if (mnBitsPerPixel <= 8) // transparent palette
{
- aBmp.Convert(BMP_CONVERSION_8BIT_TRANS);
+ aBmp.Convert(BmpConversion::N8BitTrans);
aBmp.Replace(rBmpEx.GetMask(), BMP_COL_TRANS);
mnBitsPerPixel = 8;
mpAccess = Bitmap::ScopedReadAccess(aBmp);
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 91fbd64ca29d..d20345e30e5a 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -749,7 +749,7 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
BmpMirrorFlags nMirrFlags = BmpMirrorFlags::NONE;
if( aMask.GetBitCount() > 1 )
- aMask.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
+ aMask.Convert( BmpConversion::N1BitThreshold );
// mirrored horizontically
if( aDestSz.Width() < 0 )
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index 0e909a01da9d..e794c07c6a4f 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -231,7 +231,7 @@ void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
if( aActualColor.GetColorError( aBgColor ) )
{
// no, create truecolor bitmap, then
- aBmp.Convert( BMP_CONVERSION_24BIT );
+ aBmp.Convert( BmpConversion::N24Bit );
// fill masked out areas white
aBmp.Replace( aBmpEx.GetMask(), aBgColor );
@@ -245,7 +245,7 @@ void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
else
{
// blend with alpha channel
- aBmp.Convert( BMP_CONVERSION_24BIT );
+ aBmp.Convert( BmpConversion::N24Bit );
aBmp.Blend(aBmpEx.GetAlpha(),aBgColor);
}
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 36fea7a49301..8593a3f3f7ca 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -100,10 +100,10 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize,
else if( !!aBmp )
{
if ( mnDrawMode & DrawModeFlags::GrayBitmap )
- aBmp.Convert( BMP_CONVERSION_8BIT_GREYS );
+ aBmp.Convert( BmpConversion::N8BitGreys );
if ( mnDrawMode & DrawModeFlags::GhostedBitmap )
- aBmp.Convert( BMP_CONVERSION_GHOSTED );
+ aBmp.Convert( BmpConversion::Ghosted );
}
}
@@ -337,10 +337,10 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
else if( !!aBmpEx )
{
if ( mnDrawMode & DrawModeFlags::GrayBitmap )
- aBmpEx.Convert( BMP_CONVERSION_8BIT_GREYS );
+ aBmpEx.Convert( BmpConversion::N8BitGreys );
if ( mnDrawMode & DrawModeFlags::GhostedBitmap )
- aBmpEx.Convert( BMP_CONVERSION_GHOSTED );
+ aBmpEx.Convert( BmpConversion::Ghosted );
}
}
@@ -486,7 +486,7 @@ BitmapEx OutputDevice::GetBitmapEx( const Point& rSrcPt, const Size& rSize ) con
// ensure 8 bit alpha
if( aAlphaBitmap.GetBitCount() > 8 )
- aAlphaBitmap.Convert( BMP_CONVERSION_8BIT_GREYS );
+ aAlphaBitmap.Convert( BmpConversion::N8BitGreys );
return BitmapEx(GetBitmap( rSrcPt, rSize ), AlphaMask( aAlphaBitmap ) );
}
diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx
index a4733434fea4..1329ac1d9ffe 100644
--- a/vcl/source/outdev/transparent.cxx
+++ b/vcl/source/outdev/transparent.cxx
@@ -129,7 +129,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
BmpMirrorFlags nMirrFlags = BmpMirrorFlags::NONE;
if( aMask.GetBitCount() > 1 )
- aMask.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
+ aMask.Convert( BmpConversion::N1BitThreshold );
// mirrored horizontically
if( aDestSz.Width() < 0L )
diff --git a/vcl/unx/generic/dtrans/bmp.cxx b/vcl/unx/generic/dtrans/bmp.cxx
index daf538c696d9..2c68ed952c50 100644
--- a/vcl/unx/generic/dtrans/bmp.cxx
+++ b/vcl/unx/generic/dtrans/bmp.cxx
@@ -750,16 +750,16 @@ css::uno::Sequence<sal_Int8> x11::convertBitmapDepth(
if (bm.GetBitCount() != depth) {
switch (depth) {
case 1:
- bm.Convert(BMP_CONVERSION_1BIT_THRESHOLD);
+ bm.Convert(BmpConversion::N1BitThreshold);
break;
case 4:
- bm.ReduceColors(BMP_CONVERSION_4BIT_COLORS);
+ bm.ReduceColors(1<<4);
break;
case 8:
- bm.ReduceColors(BMP_CONVERSION_8BIT_COLORS);
+ bm.ReduceColors(1<<8);
break;
case 24:
- bm.Convert(BMP_CONVERSION_24BIT);
+ bm.Convert(BmpConversion::N24Bit);
break;
}
}
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index d967541c012a..d1b9cf0ef7d1 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -120,7 +120,7 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) ImportJPEG(aFileStream, aGraphic, nullptr, GraphicFilterImportFlags::NONE);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "gif") == 0)
{
@@ -128,7 +128,7 @@ try_again:
Graphic aGraphic;
ret = (int) ImportGIF(aFileStream, aGraphic);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "xbm") == 0)
{
@@ -136,7 +136,7 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) ImportXBM(aFileStream, aGraphic);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "xpm") == 0)
{
@@ -144,21 +144,21 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) ImportXPM(aFileStream, aGraphic);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "png") == 0)
{
SvFileStream aFileStream(out, StreamMode::READ);
vcl::PNGReader aReader(aFileStream);
BitmapEx aTarget = aReader.Read();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "bmp") == 0)
{
Bitmap aTarget;
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) ReadDIB(aTarget, aFileStream, true);
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "svm") == 0)
{
@@ -182,7 +182,7 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "dxf") == 0)
{
@@ -199,7 +199,7 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "met") == 0)
{
@@ -216,7 +216,7 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if ((strcmp(argv[2], "pbm") == 0) || strcmp(argv[2], "ppm") == 0)
{
@@ -233,7 +233,7 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "psd") == 0)
{
@@ -250,7 +250,7 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "eps") == 0)
{
@@ -267,7 +267,7 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "pct") == 0)
{
@@ -284,7 +284,7 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "pcx") == 0)
{
@@ -301,7 +301,7 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "ras") == 0)
{
@@ -318,7 +318,7 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "tga") == 0)
{
@@ -335,7 +335,7 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if (strcmp(argv[2], "tif") == 0)
{
@@ -352,7 +352,7 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
BitmapEx aTarget = aGraphic.GetBitmapEx();
- aTarget.Convert(BMP_CONVERSION_24BIT);
+ aTarget.Convert(BmpConversion::N24Bit);
}
else if ( (strcmp(argv[2], "doc") == 0) ||
(strcmp(argv[2], "ww8") == 0) ||
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index f48265365f4e..a41337a3c1b5 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1398,7 +1398,7 @@ public:
rDev.DrawBitmapEx(aBelow, aResult);
Bitmap aGrey = aSrc.GetBitmap();
- aGrey.Convert(BMP_CONVERSION_8BIT_GREYS);
+ aGrey.Convert(BmpConversion::N8BitGreys);
rDev.DrawBitmap(aBelow, aGrey);
aBelow.Move(aGrey.GetSizePixel().Width(),0);