diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-20 09:40:34 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-25 13:19:25 +0000 |
commit | d9ac7def8ba320853e8865535a7a14f9af77521e (patch) | |
tree | 4aef3ff57b2208fd01633f838c83afe727c26544 /vcl/source | |
parent | 102196f06400864ef49af961352b5c285ee1f3ab (diff) |
Convert BMP_FORMAT to scoped enum
Change-Id: I751ab762b6e6f961e9e73a8a2ca92a3f5a5eb1c8
Reviewed-on: https://gerrit.libreoffice.org/25189
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/bitmap/BitmapProcessor.cxx | 2 | ||||
-rw-r--r-- | vcl/source/bitmap/bitmapscalesuper.cxx | 6 | ||||
-rw-r--r-- | vcl/source/filter/jpeg/JpegReader.cxx | 10 | ||||
-rw-r--r-- | vcl/source/filter/jpeg/JpegWriter.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/alpha.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap.cxx | 28 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 12 | ||||
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/bmpacc.cxx | 150 | ||||
-rw-r--r-- | vcl/source/gdi/bmpacc2.cxx | 64 | ||||
-rw-r--r-- | vcl/source/gdi/bmpfast.cxx | 376 | ||||
-rw-r--r-- | vcl/source/gdi/dibtools.cxx | 22 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pngread.cxx | 18 | ||||
-rw-r--r-- | vcl/source/gdi/salmisc.cxx | 110 | ||||
-rw-r--r-- | vcl/source/helper/canvasbitmap.cxx | 34 | ||||
-rw-r--r-- | vcl/source/outdev/bitmap.cxx | 20 | ||||
-rw-r--r-- | vcl/source/outdev/transparent.cxx | 8 |
18 files changed, 438 insertions, 432 deletions
diff --git a/vcl/source/bitmap/BitmapProcessor.cxx b/vcl/source/bitmap/BitmapProcessor.cxx index a80e36693b68..acbac9a83211 100644 --- a/vcl/source/bitmap/BitmapProcessor.cxx +++ b/vcl/source/bitmap/BitmapProcessor.cxx @@ -165,7 +165,7 @@ void BitmapProcessor::colorizeImage(BitmapEx& rBitmapEx, Color aColor) pWriteAccess->SetPaletteColor(i, aBitmapColor); } } - else if (pWriteAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR) + else if (pWriteAccess->GetScanlineFormat() == ScanlineFormat::N24BitTcBgr) { for (nY = 0; nY < nH; ++nY) { diff --git a/vcl/source/bitmap/bitmapscalesuper.cxx b/vcl/source/bitmap/bitmapscalesuper.cxx index 33645f618129..9fb1f44a0f9c 100644 --- a/vcl/source/bitmap/bitmapscalesuper.cxx +++ b/vcl/source/bitmap/bitmapscalesuper.cxx @@ -958,7 +958,7 @@ bool BitmapScaleSuper::filter(Bitmap& rBitmap) { switch( pReadAccess->GetScanlineFormat() ) { - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N8BitPal: pScaleRangeFn = bScaleUp ? scalePallete8bit : scalePallete8bit2; break; default: @@ -971,10 +971,10 @@ bool BitmapScaleSuper::filter(Bitmap& rBitmap) { switch( pReadAccess->GetScanlineFormat() ) { - case BMP_FORMAT_24BIT_TC_BGR: + case ScanlineFormat::N24BitTcBgr: pScaleRangeFn = bScaleUp ? scale24bitBGR : scale24bitBGR2; break; - case BMP_FORMAT_24BIT_TC_RGB: + case ScanlineFormat::N24BitTcRgb: pScaleRangeFn = bScaleUp ? scale24bitRGB : scale24bitRGB2; break; default: diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx index eb019128c10e..3f3487633c4f 100644 --- a/vcl/source/filter/jpeg/JpegReader.cxx +++ b/vcl/source/filter/jpeg/JpegReader.cxx @@ -271,11 +271,11 @@ unsigned char * JPEGReader::CreateBitmap(JPEGCreateBitmapParam& rParam) if( mpAcc ) { - const sal_uLong nFormat = mpAcc->GetScanlineFormat(); + const ScanlineFormat nFormat = mpAcc->GetScanlineFormat(); if( - ( bGray && ( BMP_FORMAT_8BIT_PAL == nFormat ) ) || - ( !bGray && ( BMP_FORMAT_24BIT_TC_RGB == nFormat ) ) + ( bGray && ( ScanlineFormat::N8BitPal == nFormat ) ) || + ( !bGray && ( ScanlineFormat::N24BitTcRgb == nFormat ) ) ) { pBmpBuf = mpAcc->GetBuffer(); @@ -347,7 +347,7 @@ void JPEGReader::FillBitmap() // #i122985# Trying to copy the RGB data from jpeg import to make things faster. Unfortunately // it has no GBR format, so RGB three-byte groups need to be 'flipped' to GBR first, // then CopyScanline can use a memcpy to do the data transport. CopyScanline can also - // do the needed conversion from BMP_FORMAT_24BIT_TC_RGB (and it works well), but this + // do the needed conversion from ScanlineFormat::N24BitTcRgb (and it works well), but this // is not faster that the old loop below using SetPixel. sal_uInt8* aSource(mpBuffer + nY * nAlignedWidth); sal_uInt8* aEnd(aSource + (nWidth * 3)); @@ -357,7 +357,7 @@ void JPEGReader::FillBitmap() ::std::swap(*aTmp, *(aTmp + 2)); } - mpAcc->CopyScanline(nY, aSource, BMP_FORMAT_24BIT_TC_BGR, nWidth * 3); + mpAcc->CopyScanline(nY, aSource, ScanlineFormat::N24BitTcBgr, nWidth * 3); } else { diff --git a/vcl/source/filter/jpeg/JpegWriter.cxx b/vcl/source/filter/jpeg/JpegWriter.cxx index 35c04797c07f..27fd6f23a96c 100644 --- a/vcl/source/filter/jpeg/JpegWriter.cxx +++ b/vcl/source/filter/jpeg/JpegWriter.cxx @@ -222,7 +222,7 @@ bool JPEGWriter::Write( const Graphic& rGraphic ) if( mpExpWasGrey ) *mpExpWasGrey = mbGreys; - mbNative = ( mpReadAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB ); + mbNative = ( mpReadAccess->GetScanlineFormat() == ScanlineFormat::N24BitTcRgb ); if( !mbNative ) mpBuffer = new sal_uInt8[ AlignedWidth4Bytes( mbGreys ? mpReadAccess->Width() * 8L : mpReadAccess->Width() * 24L ) ]; diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx index 614eb404705f..01a57f61e0ed 100644 --- a/vcl/source/gdi/alpha.cxx +++ b/vcl/source/gdi/alpha.cxx @@ -115,7 +115,7 @@ bool AlphaMask::Replace( sal_uInt8 cSearchTransparency, sal_uInt8 cReplaceTransp { const long nWidth = pAcc->Width(), nHeight = pAcc->Height(); - if( pAcc->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL ) + if( pAcc->GetScanlineFormat() == ScanlineFormat::N8BitPal ) { for( long nY = 0L; nY < nHeight; nY++ ) { diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index e60d77c10acd..b30c71e4894d 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -372,14 +372,14 @@ bool Bitmap::Erase(const Color& rFillColor) if (pWriteAcc) { - const sal_uLong nFormat = pWriteAcc->GetScanlineFormat(); + const ScanlineFormat nFormat = pWriteAcc->GetScanlineFormat(); sal_uInt8 cIndex = 0; bool bFast = false; switch (nFormat) { - case BMP_FORMAT_1BIT_MSB_PAL: - case BMP_FORMAT_1BIT_LSB_PAL: + case ScanlineFormat::N1BitMsbPal: + case ScanlineFormat::N1BitLsbPal: { cIndex = static_cast<sal_uInt8>(pWriteAcc->GetBestPaletteIndex(rFillColor)); cIndex = (cIndex ? 255 : 0); @@ -387,8 +387,8 @@ bool Bitmap::Erase(const Color& rFillColor) } break; - case BMP_FORMAT_4BIT_MSN_PAL: - case BMP_FORMAT_4BIT_LSN_PAL: + case ScanlineFormat::N4BitMsnPal: + case ScanlineFormat::N4BitLsnPal: { cIndex = static_cast<sal_uInt8>(pWriteAcc->GetBestPaletteIndex(rFillColor)); cIndex = cIndex | ( cIndex << 4 ); @@ -396,15 +396,15 @@ bool Bitmap::Erase(const Color& rFillColor) } break; - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N8BitPal: { cIndex = static_cast<sal_uInt8>(pWriteAcc->GetBestPaletteIndex(rFillColor)); bFast = true; } break; - case BMP_FORMAT_24BIT_TC_BGR: - case BMP_FORMAT_24BIT_TC_RGB: + case ScanlineFormat::N24BitTcBgr: + case ScanlineFormat::N24BitTcRgb: { if (rFillColor.GetRed() == rFillColor.GetGreen() && rFillColor.GetRed() == rFillColor.GetBlue()) @@ -1124,14 +1124,14 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const const BitmapColor aTest( pReadAcc->GetBestMatchingColor( rTransColor ) ); long nX, nY; - if( pReadAcc->GetScanlineFormat() == BMP_FORMAT_4BIT_MSN_PAL || - pReadAcc->GetScanlineFormat() == BMP_FORMAT_4BIT_LSN_PAL ) + if( pReadAcc->GetScanlineFormat() == ScanlineFormat::N4BitMsnPal || + pReadAcc->GetScanlineFormat() == ScanlineFormat::N4BitLsnPal ) { // optimized for 4Bit-MSN/LSN source palette const sal_uInt8 cTest = aTest.GetIndex(); - const long nShiftInit = ( ( pReadAcc->GetScanlineFormat() == BMP_FORMAT_4BIT_MSN_PAL ) ? 4 : 0 ); + const long nShiftInit = ( ( pReadAcc->GetScanlineFormat() == ScanlineFormat::N4BitMsnPal ) ? 4 : 0 ); - if( pWriteAcc->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL && + if( pWriteAcc->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal && aWhite.GetIndex() == 1 ) { // optimized for 1Bit-MSB destination palette @@ -1165,12 +1165,12 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const } } } - else if( pReadAcc->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL ) + else if( pReadAcc->GetScanlineFormat() == ScanlineFormat::N8BitPal ) { // optimized for 8Bit source palette const sal_uInt8 cTest = aTest.GetIndex(); - if( pWriteAcc->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL && + if( pWriteAcc->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal && aWhite.GetIndex() == 1 ) { // optimized for 1Bit-MSB destination palette diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 46826ad50362..9e5af0edb930 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -529,8 +529,8 @@ bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys ) } } } - else if( pReadAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR && - pWriteAcc->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL ) + else if( pReadAcc->GetScanlineFormat() == ScanlineFormat::N24BitTcBgr && + pWriteAcc->GetScanlineFormat() == ScanlineFormat::N8BitPal ) { nShift += 8; @@ -549,8 +549,8 @@ bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys ) } } } - else if( pReadAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB && - pWriteAcc->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL ) + else if( pReadAcc->GetScanlineFormat() == ScanlineFormat::N24BitTcRgb && + pWriteAcc->GetScanlineFormat() == ScanlineFormat::N8BitPal ) { nShift += 8; @@ -2208,7 +2208,7 @@ bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent, pAcc->SetPaletteColor( i, aNewCol ); } } - else if( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR ) + else if( pAcc->GetScanlineFormat() == ScanlineFormat::N24BitTcBgr ) { for( long nY = 0L; nY < nH; nY++ ) { @@ -2222,7 +2222,7 @@ bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent, } } } - else if( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB ) + else if( pAcc->GetScanlineFormat() == ScanlineFormat::N24BitTcRgb ) { for( long nY = 0L; nY < nH; nY++ ) { diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 03ad08eba2b1..ed911d0bdd1f 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -1068,7 +1068,7 @@ BitmapEx BitmapEx::ModifyBitmapEx(const basegfx::BColorModifierStack& rBColorMod xContent->SetPaletteColor(b, BitmapColor(Color(aBDest))); } } - else if(BMP_FORMAT_24BIT_TC_BGR == xContent->GetScanlineFormat()) + else if(ScanlineFormat::N24BitTcBgr == xContent->GetScanlineFormat()) { for(sal_uInt32 y(0L); y < (sal_uInt32)xContent->Height(); y++) { @@ -1087,7 +1087,7 @@ BitmapEx BitmapEx::ModifyBitmapEx(const basegfx::BColorModifierStack& rBColorMod } } } - else if(BMP_FORMAT_24BIT_TC_RGB == xContent->GetScanlineFormat()) + else if(ScanlineFormat::N24BitTcRgb == xContent->GetScanlineFormat()) { for(sal_uInt32 y(0L); y < (sal_uInt32)xContent->Height(); y++) { diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx index e18f242030dc..3bc0a55895b7 100644 --- a/vcl/source/gdi/bmpacc.cxx +++ b/vcl/source/gdi/bmpacc.cxx @@ -139,7 +139,7 @@ void BitmapReadAccess::ImplInitScanBuffer( Bitmap& rBitmap ) try { mpScanBuf = new Scanline[ nHeight ]; - if( BMP_SCANLINE_ADJUSTMENT( mpBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) + if( mpBuffer->mnFormat & ScanlineFormat::TopDown ) { for( long nY = 0L; nY < nHeight; nY++, pTmpLine += mpBuffer->mnScanlineSize ) mpScanBuf[ nY ] = pTmpLine; @@ -149,7 +149,7 @@ void BitmapReadAccess::ImplInitScanBuffer( Bitmap& rBitmap ) for( long nY = nHeight - 1; nY >= 0; nY--, pTmpLine += mpBuffer->mnScanlineSize ) mpScanBuf[ nY ] = pTmpLine; } - bOk = ImplSetAccessPointers(BMP_SCANLINE_FORMAT(mpBuffer->mnFormat)); + bOk = ImplSetAccessPointers(RemoveScanline(mpBuffer->mnFormat)); } catch (const std::bad_alloc&) { @@ -172,106 +172,106 @@ void BitmapReadAccess::ImplClearScanBuffer() mpScanBuf = nullptr; } -bool BitmapReadAccess::ImplSetAccessPointers( sal_uLong nFormat ) +bool BitmapReadAccess::ImplSetAccessPointers( ScanlineFormat nFormat ) { bool bRet = true; switch( nFormat ) { - case BMP_FORMAT_1BIT_MSB_PAL: + case ScanlineFormat::N1BitMsbPal: { - mFncGetPixel = GetPixelFor_1BIT_MSB_PAL; - mFncSetPixel = SetPixelFor_1BIT_MSB_PAL; + mFncGetPixel = GetPixelForN1BitMsbPal; + mFncSetPixel = SetPixelForN1BitMsbPal; } break; - case BMP_FORMAT_1BIT_LSB_PAL: + case ScanlineFormat::N1BitLsbPal: { - mFncGetPixel = GetPixelFor_1BIT_LSB_PAL; - mFncSetPixel = SetPixelFor_1BIT_LSB_PAL; + mFncGetPixel = GetPixelForN1BitLsbPal; + mFncSetPixel = SetPixelForN1BitLsbPal; } break; - case BMP_FORMAT_4BIT_MSN_PAL: + case ScanlineFormat::N4BitMsnPal: { - mFncGetPixel = GetPixelFor_4BIT_MSN_PAL; - mFncSetPixel = SetPixelFor_4BIT_MSN_PAL; + mFncGetPixel = GetPixelForN4BitMsnPal; + mFncSetPixel = SetPixelForN4BitMsnPal; } break; - case BMP_FORMAT_4BIT_LSN_PAL: + case ScanlineFormat::N4BitLsnPal: { - mFncGetPixel = GetPixelFor_4BIT_LSN_PAL; - mFncSetPixel = SetPixelFor_4BIT_LSN_PAL; + mFncGetPixel = GetPixelForN4BitLsnPal; + mFncSetPixel = SetPixelForN4BitLsnPal; } break; - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N8BitPal: { - mFncGetPixel = GetPixelFor_8BIT_PAL; - mFncSetPixel = SetPixelFor_8BIT_PAL; + mFncGetPixel = GetPixelForN8BitPal; + mFncSetPixel = SetPixelForN8BitPal; } break; - case BMP_FORMAT_8BIT_TC_MASK: + case ScanlineFormat::N8BitTcMask: { - mFncGetPixel = GetPixelFor_8BIT_TC_MASK; - mFncSetPixel = SetPixelFor_8BIT_TC_MASK; + mFncGetPixel = GetPixelForN8BitTcMask; + mFncSetPixel = SetPixelForN8BitTcMask; } break; - case BMP_FORMAT_16BIT_TC_MSB_MASK: + case ScanlineFormat::N16BitTcMsbMask: { - mFncGetPixel = GetPixelFor_16BIT_TC_MSB_MASK; - mFncSetPixel = SetPixelFor_16BIT_TC_MSB_MASK; + mFncGetPixel = GetPixelForN16BitTcMsbMask; + mFncSetPixel = SetPixelForN16BitTcMsbMask; } break; - case BMP_FORMAT_16BIT_TC_LSB_MASK: + case ScanlineFormat::N16BitTcLsbMask: { - mFncGetPixel = GetPixelFor_16BIT_TC_LSB_MASK; - mFncSetPixel = SetPixelFor_16BIT_TC_LSB_MASK; + mFncGetPixel = GetPixelForN16BitTcLsbMask; + mFncSetPixel = SetPixelForN16BitTcLsbMask; } break; - case BMP_FORMAT_24BIT_TC_BGR: + case ScanlineFormat::N24BitTcBgr: { - mFncGetPixel = GetPixelFor_24BIT_TC_BGR; - mFncSetPixel = SetPixelFor_24BIT_TC_BGR; + mFncGetPixel = GetPixelForN24BitTcBgr; + mFncSetPixel = SetPixelForN24BitTcBgr; } break; - case BMP_FORMAT_24BIT_TC_RGB: + case ScanlineFormat::N24BitTcRgb: { - mFncGetPixel = GetPixelFor_24BIT_TC_RGB; - mFncSetPixel = SetPixelFor_24BIT_TC_RGB; + mFncGetPixel = GetPixelForN24BitTcRgb; + mFncSetPixel = SetPixelForN24BitTcRgb; } break; - case BMP_FORMAT_24BIT_TC_MASK: + case ScanlineFormat::N24BitTcMask: { - mFncGetPixel = GetPixelFor_24BIT_TC_MASK; - mFncSetPixel = SetPixelFor_24BIT_TC_MASK; + mFncGetPixel = GetPixelForN24BitTcMask; + mFncSetPixel = SetPixelForN24BitTcMask; } break; - case BMP_FORMAT_32BIT_TC_ABGR: + case ScanlineFormat::N32BitTcAbgr: { - mFncGetPixel = GetPixelFor_32BIT_TC_ABGR; - mFncSetPixel = SetPixelFor_32BIT_TC_ABGR; + mFncGetPixel = GetPixelForN32BitTcAbgr; + mFncSetPixel = SetPixelForN32BitTcAbgr; } break; - case BMP_FORMAT_32BIT_TC_ARGB: + case ScanlineFormat::N32BitTcArgb: { - mFncGetPixel = GetPixelFor_32BIT_TC_ARGB; - mFncSetPixel = SetPixelFor_32BIT_TC_ARGB; + mFncGetPixel = GetPixelForN32BitTcArgb; + mFncSetPixel = SetPixelForN32BitTcArgb; } break; - case BMP_FORMAT_32BIT_TC_BGRA: + case ScanlineFormat::N32BitTcBgra: { - mFncGetPixel = GetPixelFor_32BIT_TC_BGRA; - mFncSetPixel = SetPixelFor_32BIT_TC_BGRA; + mFncGetPixel = GetPixelForN32BitTcBgra; + mFncSetPixel = SetPixelForN32BitTcBgra; } break; - case BMP_FORMAT_32BIT_TC_RGBA: + case ScanlineFormat::N32BitTcRgba: { - mFncGetPixel = GetPixelFor_32BIT_TC_RGBA; - mFncSetPixel = SetPixelFor_32BIT_TC_RGBA; + mFncGetPixel = GetPixelForN32BitTcRgba; + mFncSetPixel = SetPixelForN32BitTcRgba; } break; - case BMP_FORMAT_32BIT_TC_MASK: + case ScanlineFormat::N32BitTcMask: { - mFncGetPixel = GetPixelFor_32BIT_TC_MASK; - mFncSetPixel = SetPixelFor_32BIT_TC_MASK; + mFncGetPixel = GetPixelForN32BitTcMask; + mFncSetPixel = SetPixelForN32BitTcMask; } break; @@ -419,26 +419,26 @@ void BitmapWriteAccess::CopyScanline( long nY, const BitmapReadAccess& rReadAcc } void BitmapWriteAccess::CopyScanline( long nY, ConstScanline aSrcScanline, - sal_uLong nSrcScanlineFormat, sal_uLong nSrcScanlineSize ) + ScanlineFormat nSrcScanlineFormat, sal_uLong nSrcScanlineSize ) { - const sal_uLong nFormat = BMP_SCANLINE_FORMAT( nSrcScanlineFormat ); + const ScanlineFormat nFormat = RemoveScanline( nSrcScanlineFormat ); assert(nY >= 0 && nY < mpBuffer->mnHeight && "y-coordinate in destination out of range!"); - DBG_ASSERT( ( HasPalette() && nFormat <= BMP_FORMAT_8BIT_PAL ) || - ( !HasPalette() && nFormat > BMP_FORMAT_8BIT_PAL ), + DBG_ASSERT( ( HasPalette() && nFormat <= ScanlineFormat::N8BitPal ) || + ( !HasPalette() && nFormat > ScanlineFormat::N8BitPal ), "No copying possible between palette and non palette scanlines!" ); const sal_uLong nCount = std::min( GetScanlineSize(), nSrcScanlineSize ); if( nCount ) { - if( GetScanlineFormat() == BMP_SCANLINE_FORMAT( nSrcScanlineFormat ) ) + if( GetScanlineFormat() == RemoveScanline( nSrcScanlineFormat ) ) memcpy( mpScanBuf[ nY ], aSrcScanline, nCount ); else { - DBG_ASSERT( nFormat != BMP_FORMAT_8BIT_TC_MASK && - nFormat != BMP_FORMAT_16BIT_TC_MSB_MASK && nFormat != BMP_FORMAT_16BIT_TC_LSB_MASK && - nFormat != BMP_FORMAT_24BIT_TC_MASK && nFormat != BMP_FORMAT_32BIT_TC_MASK, + DBG_ASSERT( nFormat != ScanlineFormat::N8BitTcMask && + nFormat != ScanlineFormat::N16BitTcMsbMask && nFormat != ScanlineFormat::N16BitTcLsbMask && + nFormat != ScanlineFormat::N24BitTcMask && nFormat != ScanlineFormat::N32BitTcMask, "No support for pixel formats with color masks yet!" ); // TODO: use fastbmp infrastructure @@ -446,22 +446,22 @@ void BitmapWriteAccess::CopyScanline( long nY, ConstScanline aSrcScanline, switch( nFormat ) { - case BMP_FORMAT_1BIT_MSB_PAL: pFncGetPixel = GetPixelFor_1BIT_MSB_PAL; break; - case BMP_FORMAT_1BIT_LSB_PAL: pFncGetPixel = GetPixelFor_1BIT_LSB_PAL; break; - case BMP_FORMAT_4BIT_MSN_PAL: pFncGetPixel = GetPixelFor_4BIT_MSN_PAL; break; - case BMP_FORMAT_4BIT_LSN_PAL: pFncGetPixel = GetPixelFor_4BIT_LSN_PAL; break; - case BMP_FORMAT_8BIT_PAL: pFncGetPixel = GetPixelFor_8BIT_PAL; break; - case BMP_FORMAT_8BIT_TC_MASK: pFncGetPixel = GetPixelFor_8BIT_TC_MASK; break; - case BMP_FORMAT_16BIT_TC_MSB_MASK: pFncGetPixel = GetPixelFor_16BIT_TC_MSB_MASK; break; - case BMP_FORMAT_16BIT_TC_LSB_MASK: pFncGetPixel = GetPixelFor_16BIT_TC_LSB_MASK; break; - case BMP_FORMAT_24BIT_TC_BGR: pFncGetPixel = GetPixelFor_24BIT_TC_BGR; break; - case BMP_FORMAT_24BIT_TC_RGB: pFncGetPixel = GetPixelFor_24BIT_TC_RGB; break; - case BMP_FORMAT_24BIT_TC_MASK: pFncGetPixel = GetPixelFor_24BIT_TC_MASK; break; - case BMP_FORMAT_32BIT_TC_ABGR: pFncGetPixel = GetPixelFor_32BIT_TC_ABGR; break; - case BMP_FORMAT_32BIT_TC_ARGB: pFncGetPixel = GetPixelFor_32BIT_TC_ARGB; break; - case BMP_FORMAT_32BIT_TC_BGRA: pFncGetPixel = GetPixelFor_32BIT_TC_BGRA; break; - case BMP_FORMAT_32BIT_TC_RGBA: pFncGetPixel = GetPixelFor_32BIT_TC_RGBA; break; - case BMP_FORMAT_32BIT_TC_MASK: pFncGetPixel = GetPixelFor_32BIT_TC_MASK; break; + case ScanlineFormat::N1BitMsbPal: pFncGetPixel = GetPixelForN1BitMsbPal; break; + case ScanlineFormat::N1BitLsbPal: pFncGetPixel = GetPixelForN1BitLsbPal; break; + case ScanlineFormat::N4BitMsnPal: pFncGetPixel = GetPixelForN4BitMsnPal; break; + case ScanlineFormat::N4BitLsnPal: pFncGetPixel = GetPixelForN4BitLsnPal; break; + case ScanlineFormat::N8BitPal: pFncGetPixel = GetPixelForN8BitPal; break; + case ScanlineFormat::N8BitTcMask: pFncGetPixel = GetPixelForN8BitTcMask; break; + case ScanlineFormat::N16BitTcMsbMask: pFncGetPixel = GetPixelForN16BitTcMsbMask; break; + case ScanlineFormat::N16BitTcLsbMask: pFncGetPixel = GetPixelForN16BitTcLsbMask; break; + case ScanlineFormat::N24BitTcBgr: pFncGetPixel = GetPixelForN24BitTcBgr; break; + case ScanlineFormat::N24BitTcRgb: pFncGetPixel = GetPixelForN24BitTcRgb; break; + case ScanlineFormat::N24BitTcMask: pFncGetPixel = GetPixelForN24BitTcMask; break; + case ScanlineFormat::N32BitTcAbgr: pFncGetPixel = GetPixelForN32BitTcAbgr; break; + case ScanlineFormat::N32BitTcArgb: pFncGetPixel = GetPixelForN32BitTcArgb; break; + case ScanlineFormat::N32BitTcBgra: pFncGetPixel = GetPixelForN32BitTcBgra; break; + case ScanlineFormat::N32BitTcRgba: pFncGetPixel = GetPixelForN32BitTcRgba; break; + case ScanlineFormat::N32BitTcMask: pFncGetPixel = GetPixelForN32BitTcMask; break; default: pFncGetPixel = nullptr; diff --git a/vcl/source/gdi/bmpacc2.cxx b/vcl/source/gdi/bmpacc2.cxx index 9d447500af59..089a24643a26 100644 --- a/vcl/source/gdi/bmpacc2.cxx +++ b/vcl/source/gdi/bmpacc2.cxx @@ -20,12 +20,12 @@ #include <vcl/salbtype.hxx> #include <vcl/bitmapaccess.hxx> -BitmapColor BitmapReadAccess::GetPixelFor_1BIT_MSB_PAL(ConstScanline pScanline, long nX, const ColorMask&) +BitmapColor BitmapReadAccess::GetPixelForN1BitMsbPal(ConstScanline pScanline, long nX, const ColorMask&) { return BitmapColor( pScanline[ nX >> 3 ] & ( 1 << ( 7 - ( nX & 7 ) ) ) ? 1 : 0 ); } -void BitmapReadAccess::SetPixelFor_1BIT_MSB_PAL(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) +void BitmapReadAccess::SetPixelForN1BitMsbPal(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) { sal_uInt8& rByte = pScanline[ nX >> 3 ]; @@ -33,12 +33,12 @@ void BitmapReadAccess::SetPixelFor_1BIT_MSB_PAL(Scanline pScanline, long nX, con ( rByte &= ~( 1 << ( 7 - ( nX & 7 ) ) ) ); } -BitmapColor BitmapReadAccess::GetPixelFor_1BIT_LSB_PAL(ConstScanline pScanline, long nX, const ColorMask&) +BitmapColor BitmapReadAccess::GetPixelForN1BitLsbPal(ConstScanline pScanline, long nX, const ColorMask&) { return BitmapColor( pScanline[ nX >> 3 ] & ( 1 << ( nX & 7 ) ) ? 1 : 0 ); } -void BitmapReadAccess::SetPixelFor_1BIT_LSB_PAL(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) +void BitmapReadAccess::SetPixelForN1BitLsbPal(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) { sal_uInt8& rByte = pScanline[ nX >> 3 ]; @@ -46,12 +46,12 @@ void BitmapReadAccess::SetPixelFor_1BIT_LSB_PAL(Scanline pScanline, long nX, con ( rByte &= ~( 1 << ( nX & 7 ) ) ); } -BitmapColor BitmapReadAccess::GetPixelFor_4BIT_MSN_PAL(ConstScanline pScanline, long nX, const ColorMask&) +BitmapColor BitmapReadAccess::GetPixelForN4BitMsnPal(ConstScanline pScanline, long nX, const ColorMask&) { return BitmapColor( ( pScanline[ nX >> 1 ] >> ( nX & 1 ? 0 : 4 ) ) & 0x0f ); } -void BitmapReadAccess::SetPixelFor_4BIT_MSN_PAL(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) +void BitmapReadAccess::SetPixelForN4BitMsnPal(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) { sal_uInt8& rByte = pScanline[ nX >> 1 ]; @@ -59,12 +59,12 @@ void BitmapReadAccess::SetPixelFor_4BIT_MSN_PAL(Scanline pScanline, long nX, con ( rByte &= 0x0f, rByte |= ( rBitmapColor.GetIndex() << 4 ) ); } -BitmapColor BitmapReadAccess::GetPixelFor_4BIT_LSN_PAL(ConstScanline pScanline, long nX, const ColorMask&) +BitmapColor BitmapReadAccess::GetPixelForN4BitLsnPal(ConstScanline pScanline, long nX, const ColorMask&) { return BitmapColor( ( pScanline[ nX >> 1 ] >> ( nX & 1 ? 4 : 0 ) ) & 0x0f ); } -void BitmapReadAccess::SetPixelFor_4BIT_LSN_PAL(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) +void BitmapReadAccess::SetPixelForN4BitLsnPal(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) { sal_uInt8& rByte = pScanline[ nX >> 1 ]; @@ -72,12 +72,12 @@ void BitmapReadAccess::SetPixelFor_4BIT_LSN_PAL(Scanline pScanline, long nX, con ( rByte &= 0xf0, rByte |= ( rBitmapColor.GetIndex() & 0x0f ) ); } -BitmapColor BitmapReadAccess::GetPixelFor_8BIT_PAL(ConstScanline pScanline, long nX, const ColorMask&) +BitmapColor BitmapReadAccess::GetPixelForN8BitPal(ConstScanline pScanline, long nX, const ColorMask&) { return BitmapColor( pScanline[ nX ] ); } -void BitmapReadAccess::SetPixelFor_8BIT_PAL(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) +void BitmapReadAccess::SetPixelForN8BitPal(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) { if (rBitmapColor.IsIndex()) pScanline[ nX ] = rBitmapColor.GetIndex(); @@ -86,44 +86,44 @@ void BitmapReadAccess::SetPixelFor_8BIT_PAL(Scanline pScanline, long nX, const B pScanline[ nX ] = rBitmapColor.GetBlueOrIndex(); } -BitmapColor BitmapReadAccess::GetPixelFor_8BIT_TC_MASK(ConstScanline pScanline, long nX, const ColorMask& rMask) +BitmapColor BitmapReadAccess::GetPixelForN8BitTcMask(ConstScanline pScanline, long nX, const ColorMask& rMask) { BitmapColor aColor; rMask.GetColorFor8Bit( aColor, pScanline + nX ); return aColor; } -void BitmapReadAccess::SetPixelFor_8BIT_TC_MASK(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask) +void BitmapReadAccess::SetPixelForN8BitTcMask(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask) { rMask.SetColorFor8Bit( rBitmapColor, pScanline + nX ); } -BitmapColor BitmapReadAccess::GetPixelFor_16BIT_TC_MSB_MASK(ConstScanline pScanline, long nX, const ColorMask& rMask) +BitmapColor BitmapReadAccess::GetPixelForN16BitTcMsbMask(ConstScanline pScanline, long nX, const ColorMask& rMask) { BitmapColor aColor; rMask.GetColorFor16BitMSB( aColor, pScanline + ( nX << 1UL ) ); return aColor; } -void BitmapReadAccess::SetPixelFor_16BIT_TC_MSB_MASK(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask) +void BitmapReadAccess::SetPixelForN16BitTcMsbMask(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask) { rMask.SetColorFor16BitMSB( rBitmapColor, pScanline + ( nX << 1UL ) ); } -BitmapColor BitmapReadAccess::GetPixelFor_16BIT_TC_LSB_MASK(ConstScanline pScanline, long nX, const ColorMask& rMask) +BitmapColor BitmapReadAccess::GetPixelForN16BitTcLsbMask(ConstScanline pScanline, long nX, const ColorMask& rMask) { BitmapColor aColor; rMask.GetColorFor16BitLSB( aColor, pScanline + ( nX << 1UL ) ); return aColor; } -void BitmapReadAccess::SetPixelFor_16BIT_TC_LSB_MASK(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask) +void BitmapReadAccess::SetPixelForN16BitTcLsbMask(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask) { rMask.SetColorFor16BitLSB( rBitmapColor, pScanline + ( nX << 1UL ) ); } -BitmapColor BitmapReadAccess::GetPixelFor_24BIT_TC_BGR(ConstScanline pScanline, long nX, const ColorMask&) +BitmapColor BitmapReadAccess::GetPixelForN24BitTcBgr(ConstScanline pScanline, long nX, const ColorMask&) { BitmapColor aBitmapColor; @@ -134,14 +134,14 @@ BitmapColor BitmapReadAccess::GetPixelFor_24BIT_TC_BGR(ConstScanline pScanline, return aBitmapColor; } -void BitmapReadAccess::SetPixelFor_24BIT_TC_BGR(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) +void BitmapReadAccess::SetPixelForN24BitTcBgr(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) { *( pScanline = pScanline + nX * 3 )++ = rBitmapColor.GetBlue(); *pScanline++ = rBitmapColor.GetGreen(); *pScanline = rBitmapColor.GetRed(); } -BitmapColor BitmapReadAccess::GetPixelFor_24BIT_TC_RGB(ConstScanline pScanline, long nX, const ColorMask&) +BitmapColor BitmapReadAccess::GetPixelForN24BitTcRgb(ConstScanline pScanline, long nX, const ColorMask&) { BitmapColor aBitmapColor; @@ -152,26 +152,26 @@ BitmapColor BitmapReadAccess::GetPixelFor_24BIT_TC_RGB(ConstScanline pScanline, return aBitmapColor; } -void BitmapReadAccess::SetPixelFor_24BIT_TC_RGB(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) +void BitmapReadAccess::SetPixelForN24BitTcRgb(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) { *( pScanline = pScanline + nX * 3 )++ = rBitmapColor.GetRed(); *pScanline++ = rBitmapColor.GetGreen(); *pScanline = rBitmapColor.GetBlue(); } -BitmapColor BitmapReadAccess::GetPixelFor_24BIT_TC_MASK(ConstScanline pScanline, long nX, const ColorMask& rMask) +BitmapColor BitmapReadAccess::GetPixelForN24BitTcMask(ConstScanline pScanline, long nX, const ColorMask& rMask) { BitmapColor aColor; rMask.GetColorFor24Bit( aColor, pScanline + nX * 3L ); return aColor; } -void BitmapReadAccess::SetPixelFor_24BIT_TC_MASK(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask) +void BitmapReadAccess::SetPixelForN24BitTcMask(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask) { rMask.SetColorFor24Bit( rBitmapColor, pScanline + nX * 3L ); } -BitmapColor BitmapReadAccess::GetPixelFor_32BIT_TC_ABGR(ConstScanline pScanline, long nX, const ColorMask&) +BitmapColor BitmapReadAccess::GetPixelForN32BitTcAbgr(ConstScanline pScanline, long nX, const ColorMask&) { BitmapColor aBitmapColor; @@ -182,7 +182,7 @@ BitmapColor BitmapReadAccess::GetPixelFor_32BIT_TC_ABGR(ConstScanline pScanline, return aBitmapColor; } -void BitmapReadAccess::SetPixelFor_32BIT_TC_ABGR(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) +void BitmapReadAccess::SetPixelForN32BitTcAbgr(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) { *( pScanline = pScanline + ( nX << 2 ) )++ = 0xFF; *pScanline++ = rBitmapColor.GetBlue(); @@ -190,7 +190,7 @@ void BitmapReadAccess::SetPixelFor_32BIT_TC_ABGR(Scanline pScanline, long nX, co *pScanline = rBitmapColor.GetRed(); } -BitmapColor BitmapReadAccess::GetPixelFor_32BIT_TC_ARGB(ConstScanline pScanline, long nX, const ColorMask&) +BitmapColor BitmapReadAccess::GetPixelForN32BitTcArgb(ConstScanline pScanline, long nX, const ColorMask&) { BitmapColor aBitmapColor; @@ -201,7 +201,7 @@ BitmapColor BitmapReadAccess::GetPixelFor_32BIT_TC_ARGB(ConstScanline pScanline, return aBitmapColor; } -void BitmapReadAccess::SetPixelFor_32BIT_TC_ARGB(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) +void BitmapReadAccess::SetPixelForN32BitTcArgb(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) { *( pScanline = pScanline + ( nX << 2 ) )++ = 0xFF; *pScanline++ = rBitmapColor.GetRed(); @@ -209,7 +209,7 @@ void BitmapReadAccess::SetPixelFor_32BIT_TC_ARGB(Scanline pScanline, long nX, co *pScanline = rBitmapColor.GetBlue(); } -BitmapColor BitmapReadAccess::GetPixelFor_32BIT_TC_BGRA(ConstScanline pScanline, long nX, const ColorMask&) +BitmapColor BitmapReadAccess::GetPixelForN32BitTcBgra(ConstScanline pScanline, long nX, const ColorMask&) { BitmapColor aBitmapColor; @@ -220,7 +220,7 @@ BitmapColor BitmapReadAccess::GetPixelFor_32BIT_TC_BGRA(ConstScanline pScanline, return aBitmapColor; } -void BitmapReadAccess::SetPixelFor_32BIT_TC_BGRA(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) +void BitmapReadAccess::SetPixelForN32BitTcBgra(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) { *( pScanline = pScanline + ( nX << 2 ) )++ = rBitmapColor.GetBlue(); *pScanline++ = rBitmapColor.GetGreen(); @@ -228,7 +228,7 @@ void BitmapReadAccess::SetPixelFor_32BIT_TC_BGRA(Scanline pScanline, long nX, co *pScanline = 0xFF; } -BitmapColor BitmapReadAccess::GetPixelFor_32BIT_TC_RGBA(ConstScanline pScanline, long nX, const ColorMask&) +BitmapColor BitmapReadAccess::GetPixelForN32BitTcRgba(ConstScanline pScanline, long nX, const ColorMask&) { BitmapColor aBitmapColor; @@ -239,7 +239,7 @@ BitmapColor BitmapReadAccess::GetPixelFor_32BIT_TC_RGBA(ConstScanline pScanline, return aBitmapColor; } -void BitmapReadAccess::SetPixelFor_32BIT_TC_RGBA(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) +void BitmapReadAccess::SetPixelForN32BitTcRgba(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask&) { *( pScanline = pScanline + ( nX << 2 ) )++ = rBitmapColor.GetRed(); *pScanline++ = rBitmapColor.GetGreen(); @@ -247,14 +247,14 @@ void BitmapReadAccess::SetPixelFor_32BIT_TC_RGBA(Scanline pScanline, long nX, co *pScanline = 0xFF; } -BitmapColor BitmapReadAccess::GetPixelFor_32BIT_TC_MASK(ConstScanline pScanline, long nX, const ColorMask& rMask) +BitmapColor BitmapReadAccess::GetPixelForN32BitTcMask(ConstScanline pScanline, long nX, const ColorMask& rMask) { BitmapColor aColor; rMask.GetColorFor32Bit( aColor, pScanline + ( nX << 2UL ) ); return aColor; } -void BitmapReadAccess::SetPixelFor_32BIT_TC_MASK(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask) +void BitmapReadAccess::SetPixelForN32BitTcMask(Scanline pScanline, long nX, const BitmapColor& rBitmapColor, const ColorMask& rMask) { rMask.SetColorFor32Bit( rBitmapColor, pScanline + ( nX << 2UL ) ); } diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx index e912310c252d..6dd2c96a0431 100644 --- a/vcl/source/gdi/bmpfast.cxx +++ b/vcl/source/gdi/bmpfast.cxx @@ -39,7 +39,7 @@ protected: PIXBYTE* mpPixel; }; -template <sal_uLong PIXFMT> +template <ScanlineFormat PIXFMT> class TrueColorPixelPtr : public BasePixelPtr { public: @@ -54,7 +54,7 @@ public: // template specializations for truecolor pixel formats template <> -class TrueColorPixelPtr<BMP_FORMAT_24BIT_TC_RGB> : public BasePixelPtr +class TrueColorPixelPtr<ScanlineFormat::N24BitTcRgb> : public BasePixelPtr { public: void operator++() { mpPixel += 3; } @@ -74,7 +74,7 @@ public: }; template <> -class TrueColorPixelPtr<BMP_FORMAT_24BIT_TC_BGR> : public BasePixelPtr +class TrueColorPixelPtr<ScanlineFormat::N24BitTcBgr> : public BasePixelPtr { public: void operator++() { mpPixel += 3; } @@ -94,7 +94,7 @@ public: }; template <> -class TrueColorPixelPtr<BMP_FORMAT_32BIT_TC_ARGB> : public BasePixelPtr +class TrueColorPixelPtr<ScanlineFormat::N32BitTcArgb> : public BasePixelPtr { public: void operator++() { mpPixel += 4; } @@ -114,7 +114,7 @@ public: }; template <> -class TrueColorPixelPtr<BMP_FORMAT_32BIT_TC_ABGR> : public BasePixelPtr +class TrueColorPixelPtr<ScanlineFormat::N32BitTcAbgr> : public BasePixelPtr { public: void operator++() { mpPixel += 4; } @@ -134,7 +134,7 @@ public: }; template <> -class TrueColorPixelPtr<BMP_FORMAT_32BIT_TC_RGBA> : public BasePixelPtr +class TrueColorPixelPtr<ScanlineFormat::N32BitTcRgba> : public BasePixelPtr { public: void operator++() { mpPixel += 4; } @@ -154,7 +154,7 @@ public: }; template <> -class TrueColorPixelPtr<BMP_FORMAT_32BIT_TC_BGRA> : public BasePixelPtr +class TrueColorPixelPtr<ScanlineFormat::N32BitTcBgra> : public BasePixelPtr { public: void operator++() { mpPixel += 4; } @@ -174,7 +174,7 @@ public: }; template <> -class TrueColorPixelPtr<BMP_FORMAT_16BIT_TC_MSB_MASK> : public BasePixelPtr +class TrueColorPixelPtr<ScanlineFormat::N16BitTcMsbMask> : public BasePixelPtr { public: void operator++() { mpPixel += 2; } @@ -194,7 +194,7 @@ public: }; template <> -class TrueColorPixelPtr<BMP_FORMAT_16BIT_TC_LSB_MASK> : public BasePixelPtr +class TrueColorPixelPtr<ScanlineFormat::N16BitTcLsbMask> : public BasePixelPtr { public: void operator++() { mpPixel += 2; } @@ -214,7 +214,7 @@ public: }; template <> -class TrueColorPixelPtr<BMP_FORMAT_8BIT_TC_MASK> : public BasePixelPtr +class TrueColorPixelPtr<ScanlineFormat::N8BitTcMask> : public BasePixelPtr { public: void operator++() { mpPixel += 1; } @@ -222,15 +222,15 @@ public: void SetAlpha( PIXBYTE a ) const { mpPixel[0] = a; } }; -// TODO: for some reason many Alpha maps are BMP_FORMAT_8BIT_PAL -// they should be BMP_FORMAT_8BIT_TC_MASK +// TODO: for some reason many Alpha maps are ScanlineFormat::N8BitPal +// they should be ScanlineFormat::N8BitTcMask template <> -class TrueColorPixelPtr<BMP_FORMAT_8BIT_PAL> -: public TrueColorPixelPtr<BMP_FORMAT_8BIT_TC_MASK> +class TrueColorPixelPtr<ScanlineFormat::N8BitPal> +: public TrueColorPixelPtr<ScanlineFormat::N8BitTcMask> {}; // converting truecolor formats -template <sal_uLong SRCFMT, sal_uLong DSTFMT> +template <ScanlineFormat SRCFMT, ScanlineFormat DSTFMT> inline void ImplConvertPixel( const TrueColorPixelPtr<DSTFMT>& rDst, const TrueColorPixelPtr<SRCFMT>& rSrc ) { @@ -239,9 +239,9 @@ inline void ImplConvertPixel( const TrueColorPixelPtr<DSTFMT>& rDst, } template <> -inline void ImplConvertPixel<BMP_FORMAT_16BIT_TC_LSB_MASK, BMP_FORMAT_16BIT_TC_MSB_MASK> ( - const TrueColorPixelPtr<BMP_FORMAT_16BIT_TC_MSB_MASK>& rDst, - const TrueColorPixelPtr<BMP_FORMAT_16BIT_TC_LSB_MASK>& rSrc ) +inline void ImplConvertPixel<ScanlineFormat::N16BitTcLsbMask, ScanlineFormat::N16BitTcMsbMask> ( + const TrueColorPixelPtr<ScanlineFormat::N16BitTcMsbMask>& rDst, + const TrueColorPixelPtr<ScanlineFormat::N16BitTcLsbMask>& rSrc ) { // byte swapping const PIXBYTE* pSrc = rSrc.GetRawPtr(); @@ -250,7 +250,7 @@ inline void ImplConvertPixel<BMP_FORMAT_16BIT_TC_LSB_MASK, BMP_FORMAT_16BIT_TC_M pDst[0] = pSrc[1]; } -template <sal_uLong SRCFMT, sal_uLong DSTFMT> +template <ScanlineFormat SRCFMT, ScanlineFormat DSTFMT> inline void ImplConvertLine( const TrueColorPixelPtr<DSTFMT>& rDst, const TrueColorPixelPtr<SRCFMT>& rSrc, int nPixelCount ) { @@ -265,7 +265,7 @@ inline void ImplConvertLine( const TrueColorPixelPtr<DSTFMT>& rDst, } // alpha blending truecolor pixels -template <sal_uLong SRCFMT, sal_uLong DSTFMT> +template <ScanlineFormat SRCFMT, ScanlineFormat DSTFMT> inline void ImplBlendPixels( const TrueColorPixelPtr<DSTFMT>& rDst, const TrueColorPixelPtr<SRCFMT>& rSrc, unsigned nAlphaVal ) { @@ -292,7 +292,7 @@ inline void ImplBlendPixels( const TrueColorPixelPtr<DSTFMT>& rDst, } } -template <sal_uLong MASKFMT, sal_uLong SRCFMT, sal_uLong DSTFMT> +template <ScanlineFormat MASKFMT, ScanlineFormat SRCFMT, ScanlineFormat DSTFMT> inline void ImplBlendLines( const TrueColorPixelPtr<DSTFMT>& rDst, const TrueColorPixelPtr<SRCFMT>& rSrc, const TrueColorPixelPtr<MASKFMT>& rMsk, int nPixelCount ) @@ -318,7 +318,7 @@ static bool ImplCopyImage( BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuf PIXBYTE* pRawDst = rDstBuffer.mpBits; // source and destination don't match upside down - if( BMP_FORMAT_TOP_DOWN & (rSrcBuffer.mnFormat ^ rDstBuffer.mnFormat) ) + if( ScanlineFormat::TopDown & (rSrcBuffer.mnFormat ^ rDstBuffer.mnFormat) ) { pRawDst += (rSrcBuffer.mnHeight - 1) * nDstLinestep; nDstLinestep = -rDstBuffer.mnScanlineSize; @@ -343,7 +343,7 @@ static bool ImplCopyImage( BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuf return true; } -template <sal_uLong DSTFMT,sal_uLong SRCFMT> +template <ScanlineFormat DSTFMT,ScanlineFormat SRCFMT> bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer ) { @@ -358,7 +358,7 @@ bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, TrueColorPixelPtr<DSTFMT> aDstLine; aDstLine.SetRawPtr( rDstBuffer.mpBits ); // source and destination don't match upside down - if( BMP_FORMAT_TOP_DOWN & (rSrcBuffer.mnFormat ^ rDstBuffer.mnFormat) ) + if( ScanlineFormat::TopDown & (rSrcBuffer.mnFormat ^ rDstBuffer.mnFormat) ) { aDstLine.AddByteOffset( (rSrcBuffer.mnHeight - 1) * nDstLinestep ); nDstLinestep = -nDstLinestep; @@ -374,55 +374,56 @@ bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, return true; } -template <sal_uLong SRCFMT> +template <ScanlineFormat SRCFMT> inline bool ImplConvertFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc ) { TrueColorPixelPtr<SRCFMT> aSrcType; aSrcType.SetRawPtr( rSrc.mpBits ); // select the matching instantiation for the destination's bitmap format - switch( rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN ) + switch( rDst.mnFormat & ~ScanlineFormat::TopDown ) { - case BMP_FORMAT_1BIT_MSB_PAL: - case BMP_FORMAT_1BIT_LSB_PAL: - case BMP_FORMAT_4BIT_MSN_PAL: - case BMP_FORMAT_4BIT_LSN_PAL: - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N1BitMsbPal: + case ScanlineFormat::N1BitLsbPal: + case ScanlineFormat::N4BitMsnPal: + case ScanlineFormat::N4BitLsnPal: + case ScanlineFormat::N8BitPal: break; - case BMP_FORMAT_8BIT_TC_MASK: -// return ImplConvertToBitmap<BMP_FORMAT_8BIT_TC_MASK>( aSrcType, rDst, rSrc ); - case BMP_FORMAT_24BIT_TC_MASK: -// return ImplConvertToBitmap<BMP_FORMAT_24BIT_TC_MASK>( aSrcType, rDst, rSrc ); - case BMP_FORMAT_32BIT_TC_MASK: -// return ImplConvertToBitmap<BMP_FORMAT_32BIT_TC_MASK>( aSrcType, rDst, rSrc ); + case ScanlineFormat::N8BitTcMask: +// return ImplConvertToBitmap<ScanlineFormat::N8BitTcMask>( aSrcType, rDst, rSrc ); + case ScanlineFormat::N24BitTcMask: +// return ImplConvertToBitmap<ScanlineFormat::N24BitTcMask>( aSrcType, rDst, rSrc ); + case ScanlineFormat::N32BitTcMask: +// return ImplConvertToBitmap<ScanlineFormat::N32BitTcMask>( aSrcType, rDst, rSrc ); break; - case BMP_FORMAT_16BIT_TC_MSB_MASK: - return ImplConvertToBitmap<BMP_FORMAT_16BIT_TC_MSB_MASK>( aSrcType, rDst, rSrc ); - case BMP_FORMAT_16BIT_TC_LSB_MASK: - return ImplConvertToBitmap<BMP_FORMAT_16BIT_TC_LSB_MASK>( aSrcType, rDst, rSrc ); + case ScanlineFormat::N16BitTcMsbMask: + return ImplConvertToBitmap<ScanlineFormat::N16BitTcMsbMask>( aSrcType, rDst, rSrc ); + case ScanlineFormat::N16BitTcLsbMask: + return ImplConvertToBitmap<ScanlineFormat::N16BitTcLsbMask>( aSrcType, rDst, rSrc ); - case BMP_FORMAT_24BIT_TC_BGR: - return ImplConvertToBitmap<BMP_FORMAT_24BIT_TC_BGR>( aSrcType, rDst, rSrc ); - case BMP_FORMAT_24BIT_TC_RGB: - return ImplConvertToBitmap<BMP_FORMAT_24BIT_TC_RGB>( aSrcType, rDst, rSrc ); + case ScanlineFormat::N24BitTcBgr: + return ImplConvertToBitmap<ScanlineFormat::N24BitTcBgr>( aSrcType, rDst, rSrc ); + case ScanlineFormat::N24BitTcRgb: + return ImplConvertToBitmap<ScanlineFormat::N24BitTcRgb>( aSrcType, rDst, rSrc ); - case BMP_FORMAT_32BIT_TC_ABGR: - return ImplConvertToBitmap<BMP_FORMAT_32BIT_TC_ABGR>( aSrcType, rDst, rSrc ); + case ScanlineFormat::N32BitTcAbgr: + return ImplConvertToBitmap<ScanlineFormat::N32BitTcAbgr>( aSrcType, rDst, rSrc ); #ifdef FAST_ARGB_BGRA - case BMP_FORMAT_32BIT_TC_ARGB: - return ImplConvertToBitmap<BMP_FORMAT_32BIT_TC_ARGB>( aSrcType, rDst, rSrc ); - case BMP_FORMAT_32BIT_TC_BGRA: - return ImplConvertToBitmap<BMP_FORMAT_32BIT_TC_BGRA>( aSrcType, rDst, rSrc ); + case ScanlineFormat::N32BitTcArgb: + return ImplConvertToBitmap<ScanlineFormat::N32BitTcArgb>( aSrcType, rDst, rSrc ); + case ScanlineFormat::N32BitTcBgra: + return ImplConvertToBitmap<ScanlineFormat::N32BitTcBgra>( aSrcType, rDst, rSrc ); #endif - case BMP_FORMAT_32BIT_TC_RGBA: - return ImplConvertToBitmap<BMP_FORMAT_32BIT_TC_RGBA>( aSrcType, rDst, rSrc ); + case ScanlineFormat::N32BitTcRgba: + return ImplConvertToBitmap<ScanlineFormat::N32BitTcRgba>( aSrcType, rDst, rSrc ); + default: break; } static int nNotAccelerated = 0; SAL_WARN_IF( rSrc.mnWidth * rSrc.mnHeight >= 4000 && ++nNotAccelerated == 100, "vcl.gdi", - "ImplConvertFromBitmap for not accelerated case (" << std::hex << rSrc.mnFormat << "->" << rDst.mnFormat << ")" ); + "ImplConvertFromBitmap for not accelerated case (" << std::hex << (int)rSrc.mnFormat << "->" << (int)rDst.mnFormat << ")" ); return false; } @@ -437,7 +438,7 @@ bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc, return false; // vertical mirroring if( rTR.mnDestHeight < 0 ) - // TODO: rDst.mnFormat ^= BMP_FORMAT_TOP_DOWN; + // TODO: rDst.mnFormat ^= ScanlineFormat::TopDown; return false; // offseted conversion is not implemented yet @@ -464,16 +465,16 @@ bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc, if( rDst.mnHeight < rTR.mnDestY + rTR.mnDestHeight ) return false; - const sal_uLong nSrcFormat = rSrc.mnFormat & ~BMP_FORMAT_TOP_DOWN; - const sal_uLong nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN; + const ScanlineFormat nSrcFormat = rSrc.mnFormat & ~ScanlineFormat::TopDown; + const ScanlineFormat nDstFormat = rDst.mnFormat & ~ScanlineFormat::TopDown; // TODO: also implement conversions for 16bit colormasks with non-565 format - if( nSrcFormat & (BMP_FORMAT_16BIT_TC_LSB_MASK | BMP_FORMAT_16BIT_TC_MSB_MASK) ) + if( nSrcFormat & (ScanlineFormat::N16BitTcLsbMask | ScanlineFormat::N16BitTcMsbMask) ) if( rSrc.maColorMask.GetRedMask() != 0xF800 || rSrc.maColorMask.GetGreenMask()!= 0x07E0 || rSrc.maColorMask.GetBlueMask() != 0x001F ) return false; - if( nDstFormat & (BMP_FORMAT_16BIT_TC_LSB_MASK | BMP_FORMAT_16BIT_TC_MSB_MASK) ) + if( nDstFormat & (ScanlineFormat::N16BitTcLsbMask | ScanlineFormat::N16BitTcMsbMask) ) if( rDst.maColorMask.GetRedMask() != 0xF800 || rDst.maColorMask.GetGreenMask()!= 0x07E0 || rDst.maColorMask.GetBlueMask() != 0x001F ) @@ -491,63 +492,64 @@ bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc, // select the matching instantiation for the source's bitmap format switch( nSrcFormat ) { - case BMP_FORMAT_1BIT_MSB_PAL: - case BMP_FORMAT_1BIT_LSB_PAL: - case BMP_FORMAT_4BIT_MSN_PAL: - case BMP_FORMAT_4BIT_LSN_PAL: - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N1BitMsbPal: + case ScanlineFormat::N1BitLsbPal: + case ScanlineFormat::N4BitMsnPal: + case ScanlineFormat::N4BitLsnPal: + case ScanlineFormat::N8BitPal: break; - case BMP_FORMAT_8BIT_TC_MASK: -// return ImplConvertFromBitmap<BMP_FORMAT_8BIT_TC_MASK>( rDst, rSrc ); - case BMP_FORMAT_24BIT_TC_MASK: -// return ImplConvertFromBitmap<BMP_FORMAT_24BIT_TC_MASK>( rDst, rSrc ); - case BMP_FORMAT_32BIT_TC_MASK: -// return ImplConvertFromBitmap<BMP_FORMAT_32BIT_TC_MASK>( rDst, rSrc ); + case ScanlineFormat::N8BitTcMask: +// return ImplConvertFromBitmap<ScanlineFormat::N8BitTcMask>( rDst, rSrc ); + case ScanlineFormat::N24BitTcMask: +// return ImplConvertFromBitmap<ScanlineFormat::N24BitTcMask>( rDst, rSrc ); + case ScanlineFormat::N32BitTcMask: +// return ImplConvertFromBitmap<ScanlineFormat::N32BitTcMask>( rDst, rSrc ); break; - case BMP_FORMAT_16BIT_TC_MSB_MASK: - return ImplConvertFromBitmap<BMP_FORMAT_16BIT_TC_MSB_MASK>( rDst, rSrc ); - case BMP_FORMAT_16BIT_TC_LSB_MASK: - return ImplConvertFromBitmap<BMP_FORMAT_16BIT_TC_LSB_MASK>( rDst, rSrc ); + case ScanlineFormat::N16BitTcMsbMask: + return ImplConvertFromBitmap<ScanlineFormat::N16BitTcMsbMask>( rDst, rSrc ); + case ScanlineFormat::N16BitTcLsbMask: + return ImplConvertFromBitmap<ScanlineFormat::N16BitTcLsbMask>( rDst, rSrc ); - case BMP_FORMAT_24BIT_TC_BGR: - return ImplConvertFromBitmap<BMP_FORMAT_24BIT_TC_BGR>( rDst, rSrc ); - case BMP_FORMAT_24BIT_TC_RGB: - return ImplConvertFromBitmap<BMP_FORMAT_24BIT_TC_RGB>( rDst, rSrc ); + case ScanlineFormat::N24BitTcBgr: + return ImplConvertFromBitmap<ScanlineFormat::N24BitTcBgr>( rDst, rSrc ); + case ScanlineFormat::N24BitTcRgb: + return ImplConvertFromBitmap<ScanlineFormat::N24BitTcRgb>( rDst, rSrc ); - case BMP_FORMAT_32BIT_TC_ABGR: - return ImplConvertFromBitmap<BMP_FORMAT_32BIT_TC_ABGR>( rDst, rSrc ); + case ScanlineFormat::N32BitTcAbgr: + return ImplConvertFromBitmap<ScanlineFormat::N32BitTcAbgr>( rDst, rSrc ); #ifdef FAST_ARGB_BGRA - case BMP_FORMAT_32BIT_TC_ARGB: - return ImplConvertFromBitmap<BMP_FORMAT_32BIT_TC_ARGB>( rDst, rSrc ); - case BMP_FORMAT_32BIT_TC_BGRA: - return ImplConvertFromBitmap<BMP_FORMAT_32BIT_TC_BGRA>( rDst, rSrc ); + case ScanlineFormat::N32BitTcArgb: + return ImplConvertFromBitmap<ScanlineFormat::N32BitTcArgb>( rDst, rSrc ); + case ScanlineFormat::N32BitTcBgra: + return ImplConvertFromBitmap<ScanlineFormat::N32BitTcBgra>( rDst, rSrc ); #endif - case BMP_FORMAT_32BIT_TC_RGBA: - return ImplConvertFromBitmap<BMP_FORMAT_32BIT_TC_RGBA>( rDst, rSrc ); + case ScanlineFormat::N32BitTcRgba: + return ImplConvertFromBitmap<ScanlineFormat::N32BitTcRgba>( rDst, rSrc ); + default: break; } static int nNotAccelerated = 0; SAL_WARN_IF( rSrc.mnWidth * rSrc.mnHeight >= 4000 && ++nNotAccelerated == 100, "vcl.gdi", - "ImplFastBitmapConversion for not accelerated case (" << std::hex << rSrc.mnFormat << "->" << rDst.mnFormat << ")" ); + "ImplFastBitmapConversion for not accelerated case (" << std::hex << (int)rSrc.mnFormat << "->" << (int)rDst.mnFormat << ")" ); return false; } -template <sal_uLong DSTFMT,sal_uLong SRCFMT> //,sal_uLong MSKFMT> +template <ScanlineFormat DSTFMT, ScanlineFormat SRCFMT> //,sal_uLong MSKFMT> bool ImplBlendToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer, const BitmapBuffer& rMskBuffer ) { - DBG_ASSERT( rMskBuffer.mnFormat == BMP_FORMAT_8BIT_PAL, "FastBmp BlendImage: unusual MSKFMT" ); + DBG_ASSERT( rMskBuffer.mnFormat == ScanlineFormat::N8BitPal, "FastBmp BlendImage: unusual MSKFMT" ); const int nSrcLinestep = rSrcBuffer.mnScanlineSize; int nMskLinestep = rMskBuffer.mnScanlineSize; int nDstLinestep = rDstBuffer.mnScanlineSize; - TrueColorPixelPtr<BMP_FORMAT_8BIT_PAL> aMskLine; aMskLine.SetRawPtr( rMskBuffer.mpBits ); + TrueColorPixelPtr<ScanlineFormat::N8BitPal> aMskLine; aMskLine.SetRawPtr( rMskBuffer.mpBits ); TrueColorPixelPtr<DSTFMT> aDstLine; aDstLine.SetRawPtr( rDstBuffer.mpBits ); // special case for single line masks @@ -555,14 +557,14 @@ bool ImplBlendToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, nMskLinestep = 0; // source and mask don't match: upside down - if( (rSrcBuffer.mnFormat ^ rMskBuffer.mnFormat) & BMP_FORMAT_TOP_DOWN ) + if( (rSrcBuffer.mnFormat ^ rMskBuffer.mnFormat) & ScanlineFormat::TopDown ) { aMskLine.AddByteOffset( (rSrcBuffer.mnHeight - 1) * nMskLinestep ); nMskLinestep = -nMskLinestep; } // source and destination don't match: upside down - if( (rSrcBuffer.mnFormat ^ rDstBuffer.mnFormat) & BMP_FORMAT_TOP_DOWN ) + if( (rSrcBuffer.mnFormat ^ rDstBuffer.mnFormat) & ScanlineFormat::TopDown ) { aDstLine.AddByteOffset( (rDstBuffer.mnHeight - 1) * nDstLinestep ); nDstLinestep = -nDstLinestep; @@ -582,84 +584,85 @@ bool ImplBlendToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, // some specializations to reduce the code size template <> -inline bool ImplBlendToBitmap<BMP_FORMAT_24BIT_TC_BGR,BMP_FORMAT_24BIT_TC_BGR>( - TrueColorPixelPtr<BMP_FORMAT_24BIT_TC_BGR>&, +inline bool ImplBlendToBitmap<ScanlineFormat::N24BitTcBgr,ScanlineFormat::N24BitTcBgr>( + TrueColorPixelPtr<ScanlineFormat::N24BitTcBgr>&, BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer, const BitmapBuffer& rMskBuffer ) { - TrueColorPixelPtr<BMP_FORMAT_24BIT_TC_RGB> aSrcType; aSrcType.SetRawPtr( rSrcBuffer.mpBits ); - return ImplBlendToBitmap<BMP_FORMAT_24BIT_TC_RGB>( aSrcType, rDstBuffer, rSrcBuffer, rMskBuffer ); + TrueColorPixelPtr<ScanlineFormat::N24BitTcRgb> aSrcType; aSrcType.SetRawPtr( rSrcBuffer.mpBits ); + return ImplBlendToBitmap<ScanlineFormat::N24BitTcRgb>( aSrcType, rDstBuffer, rSrcBuffer, rMskBuffer ); } template <> -inline bool ImplBlendToBitmap<BMP_FORMAT_32BIT_TC_ABGR,BMP_FORMAT_32BIT_TC_ABGR>( - TrueColorPixelPtr<BMP_FORMAT_32BIT_TC_ABGR>&, +inline bool ImplBlendToBitmap<ScanlineFormat::N32BitTcAbgr,ScanlineFormat::N32BitTcAbgr>( + TrueColorPixelPtr<ScanlineFormat::N32BitTcAbgr>&, BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer, const BitmapBuffer& rMskBuffer ) { - TrueColorPixelPtr<BMP_FORMAT_32BIT_TC_ARGB> aSrcType; aSrcType.SetRawPtr( rSrcBuffer.mpBits ); - return ImplBlendToBitmap<BMP_FORMAT_32BIT_TC_ARGB>( aSrcType, rDstBuffer, rSrcBuffer, rMskBuffer ); + TrueColorPixelPtr<ScanlineFormat::N32BitTcArgb> aSrcType; aSrcType.SetRawPtr( rSrcBuffer.mpBits ); + return ImplBlendToBitmap<ScanlineFormat::N32BitTcArgb>( aSrcType, rDstBuffer, rSrcBuffer, rMskBuffer ); } template <> -inline bool ImplBlendToBitmap<BMP_FORMAT_32BIT_TC_BGRA,BMP_FORMAT_32BIT_TC_BGRA>( - TrueColorPixelPtr<BMP_FORMAT_32BIT_TC_BGRA>&, +inline bool ImplBlendToBitmap<ScanlineFormat::N32BitTcBgra,ScanlineFormat::N32BitTcBgra>( + TrueColorPixelPtr<ScanlineFormat::N32BitTcBgra>&, BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer, const BitmapBuffer& rMskBuffer ) { - TrueColorPixelPtr<BMP_FORMAT_32BIT_TC_RGBA> aSrcType; aSrcType.SetRawPtr( rSrcBuffer.mpBits ); - return ImplBlendToBitmap<BMP_FORMAT_32BIT_TC_RGBA>( aSrcType, rDstBuffer, rSrcBuffer, rMskBuffer ); + TrueColorPixelPtr<ScanlineFormat::N32BitTcRgba> aSrcType; aSrcType.SetRawPtr( rSrcBuffer.mpBits ); + return ImplBlendToBitmap<ScanlineFormat::N32BitTcRgba>( aSrcType, rDstBuffer, rSrcBuffer, rMskBuffer ); } -template <sal_uLong SRCFMT> +template <ScanlineFormat SRCFMT> bool ImplBlendFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc, const BitmapBuffer& rMsk ) { TrueColorPixelPtr<SRCFMT> aSrcType; aSrcType.SetRawPtr( rSrc.mpBits ); // select the matching instantiation for the destination's bitmap format - switch( rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN ) + switch( rDst.mnFormat & ~ScanlineFormat::TopDown ) { - case BMP_FORMAT_1BIT_MSB_PAL: - case BMP_FORMAT_1BIT_LSB_PAL: - case BMP_FORMAT_4BIT_MSN_PAL: - case BMP_FORMAT_4BIT_LSN_PAL: - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N1BitMsbPal: + case ScanlineFormat::N1BitLsbPal: + case ScanlineFormat::N4BitMsnPal: + case ScanlineFormat::N4BitLsnPal: + case ScanlineFormat::N8BitPal: break; - case BMP_FORMAT_8BIT_TC_MASK: -// return ImplBlendToBitmap<BMP_FORMAT_8BIT_TC_MASK>( aSrcType, rDst, rSrc, rMsk ); - case BMP_FORMAT_24BIT_TC_MASK: -// return ImplBlendToBitmap<BMP_FORMAT_24BIT_TC_MASK>( aSrcType, rDst, rSrc, rMsk ); - case BMP_FORMAT_32BIT_TC_MASK: -// return ImplBlendToBitmap<BMP_FORMAT_32BIT_TC_MASK>( aSrcType, rDst, rSrc, rMsk ); + case ScanlineFormat::N8BitTcMask: +// return ImplBlendToBitmap<ScanlineFormat::N8BitTcMask>( aSrcType, rDst, rSrc, rMsk ); + case ScanlineFormat::N24BitTcMask: +// return ImplBlendToBitmap<ScanlineFormat::N24BitTcMask>( aSrcType, rDst, rSrc, rMsk ); + case ScanlineFormat::N32BitTcMask: +// return ImplBlendToBitmap<ScanlineFormat::N32BitTcMask>( aSrcType, rDst, rSrc, rMsk ); break; - case BMP_FORMAT_16BIT_TC_MSB_MASK: - return ImplBlendToBitmap<BMP_FORMAT_16BIT_TC_MSB_MASK>( aSrcType, rDst, rSrc, rMsk ); - case BMP_FORMAT_16BIT_TC_LSB_MASK: - return ImplBlendToBitmap<BMP_FORMAT_16BIT_TC_LSB_MASK>( aSrcType, rDst, rSrc, rMsk ); + case ScanlineFormat::N16BitTcMsbMask: + return ImplBlendToBitmap<ScanlineFormat::N16BitTcMsbMask>( aSrcType, rDst, rSrc, rMsk ); + case ScanlineFormat::N16BitTcLsbMask: + return ImplBlendToBitmap<ScanlineFormat::N16BitTcLsbMask>( aSrcType, rDst, rSrc, rMsk ); - case BMP_FORMAT_24BIT_TC_BGR: - return ImplBlendToBitmap<BMP_FORMAT_24BIT_TC_BGR>( aSrcType, rDst, rSrc, rMsk ); - case BMP_FORMAT_24BIT_TC_RGB: - return ImplBlendToBitmap<BMP_FORMAT_24BIT_TC_RGB>( aSrcType, rDst, rSrc, rMsk ); + case ScanlineFormat::N24BitTcBgr: + return ImplBlendToBitmap<ScanlineFormat::N24BitTcBgr>( aSrcType, rDst, rSrc, rMsk ); + case ScanlineFormat::N24BitTcRgb: + return ImplBlendToBitmap<ScanlineFormat::N24BitTcRgb>( aSrcType, rDst, rSrc, rMsk ); - case BMP_FORMAT_32BIT_TC_ABGR: - return ImplBlendToBitmap<BMP_FORMAT_32BIT_TC_ABGR>( aSrcType, rDst, rSrc, rMsk ); + case ScanlineFormat::N32BitTcAbgr: + return ImplBlendToBitmap<ScanlineFormat::N32BitTcAbgr>( aSrcType, rDst, rSrc, rMsk ); #ifdef FAST_ARGB_BGRA - case BMP_FORMAT_32BIT_TC_ARGB: - return ImplBlendToBitmap<BMP_FORMAT_32BIT_TC_ARGB>( aSrcType, rDst, rSrc, rMsk ); - case BMP_FORMAT_32BIT_TC_BGRA: - return ImplBlendToBitmap<BMP_FORMAT_32BIT_TC_BGRA>( aSrcType, rDst, rSrc, rMsk ); + case ScanlineFormat::N32BitTcArgb: + return ImplBlendToBitmap<ScanlineFormat::N32BitTcArgb>( aSrcType, rDst, rSrc, rMsk ); + case ScanlineFormat::N32BitTcBgra: + return ImplBlendToBitmap<ScanlineFormat::N32BitTcBgra>( aSrcType, rDst, rSrc, rMsk ); #endif - case BMP_FORMAT_32BIT_TC_RGBA: - return ImplBlendToBitmap<BMP_FORMAT_32BIT_TC_RGBA>( aSrcType, rDst, rSrc, rMsk ); + case ScanlineFormat::N32BitTcRgba: + return ImplBlendToBitmap<ScanlineFormat::N32BitTcRgba>( aSrcType, rDst, rSrc, rMsk ); + default: break; } static int nNotAccelerated = 0; SAL_WARN_IF( rSrc.mnWidth * rSrc.mnHeight >= 4000 && ++nNotAccelerated == 100, "vcl.gdi", - "ImplBlendFromBitmap for not accelerated case (" << std::hex << rSrc.mnFormat << "*" << rMsk.mnFormat << "->" << rDst.mnFormat ); + "ImplBlendFromBitmap for not accelerated case (" << std::hex << (int)rSrc.mnFormat << "*" << (int)rMsk.mnFormat << "->" << (int)rDst.mnFormat ); return false; } @@ -679,7 +682,7 @@ bool ImplFastBitmapBlending( BitmapWriteAccess& rDstWA, return false; // vertical mirroring if( rTR.mnDestHeight < 0 ) - // TODO: rDst.mnFormat ^= BMP_FORMAT_TOP_DOWN; + // TODO: rDst.mnFormat ^= ScanlineFormat::TopDown; return false; // offseted blending is not implemented yet @@ -717,16 +720,16 @@ bool ImplFastBitmapBlending( BitmapWriteAccess& rDstWA, const BitmapBuffer& rSrc = *rSrcRA.ImplGetBitmapBuffer(); const BitmapBuffer& rMsk = *rMskRA.ImplGetBitmapBuffer(); - const sal_uLong nSrcFormat = rSrc.mnFormat & ~BMP_FORMAT_TOP_DOWN; - const sal_uLong nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN; + const ScanlineFormat nSrcFormat = rSrc.mnFormat & ~ScanlineFormat::TopDown; + const ScanlineFormat nDstFormat = rDst.mnFormat & ~ScanlineFormat::TopDown; // accelerated conversions for 16bit colormasks with non-565 format are not yet implemented - if( nSrcFormat & (BMP_FORMAT_16BIT_TC_LSB_MASK | BMP_FORMAT_16BIT_TC_MSB_MASK) ) + if( nSrcFormat & (ScanlineFormat::N16BitTcLsbMask | ScanlineFormat::N16BitTcMsbMask) ) if( rSrc.maColorMask.GetRedMask() != 0xF800 || rSrc.maColorMask.GetGreenMask()!= 0x07E0 || rSrc.maColorMask.GetBlueMask() != 0x001F) return false; - if( nDstFormat & (BMP_FORMAT_16BIT_TC_LSB_MASK | BMP_FORMAT_16BIT_TC_MSB_MASK) ) + if( nDstFormat & (ScanlineFormat::N16BitTcLsbMask | ScanlineFormat::N16BitTcMsbMask) ) if( rDst.maColorMask.GetRedMask() != 0xF800 || rDst.maColorMask.GetGreenMask()!= 0x07E0 || rDst.maColorMask.GetBlueMask() != 0x001F) @@ -735,54 +738,55 @@ bool ImplFastBitmapBlending( BitmapWriteAccess& rDstWA, // select the matching instantiation for the source's bitmap format switch( nSrcFormat ) { - case BMP_FORMAT_1BIT_MSB_PAL: - case BMP_FORMAT_1BIT_LSB_PAL: - case BMP_FORMAT_4BIT_MSN_PAL: - case BMP_FORMAT_4BIT_LSN_PAL: - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N1BitMsbPal: + case ScanlineFormat::N1BitLsbPal: + case ScanlineFormat::N4BitMsnPal: + case ScanlineFormat::N4BitLsnPal: + case ScanlineFormat::N8BitPal: break; - case BMP_FORMAT_8BIT_TC_MASK: -// return ImplBlendFromBitmap<BMP_FORMAT_8BIT_TC_MASK>( rDst, rSrc ); - case BMP_FORMAT_24BIT_TC_MASK: -// return ImplBlendFromBitmap<BMP_FORMAT_24BIT_TC_MASK>( rDst, rSrc ); - case BMP_FORMAT_32BIT_TC_MASK: -// return ImplBlendFromBitmap<BMP_FORMAT_32BIT_TC_MASK>( rDst, rSrc ); + case ScanlineFormat::N8BitTcMask: +// return ImplBlendFromBitmap<ScanlineFormat::N8BitTcMask>( rDst, rSrc ); + case ScanlineFormat::N24BitTcMask: +// return ImplBlendFromBitmap<ScanlineFormat::N24BitTcMask>( rDst, rSrc ); + case ScanlineFormat::N32BitTcMask: +// return ImplBlendFromBitmap<ScanlineFormat::N32BitTcMask>( rDst, rSrc ); break; - case BMP_FORMAT_16BIT_TC_MSB_MASK: - return ImplBlendFromBitmap<BMP_FORMAT_16BIT_TC_MSB_MASK>( rDst, rSrc, rMsk ); - case BMP_FORMAT_16BIT_TC_LSB_MASK: - return ImplBlendFromBitmap<BMP_FORMAT_16BIT_TC_LSB_MASK>( rDst, rSrc, rMsk ); + case ScanlineFormat::N16BitTcMsbMask: + return ImplBlendFromBitmap<ScanlineFormat::N16BitTcMsbMask>( rDst, rSrc, rMsk ); + case ScanlineFormat::N16BitTcLsbMask: + return ImplBlendFromBitmap<ScanlineFormat::N16BitTcLsbMask>( rDst, rSrc, rMsk ); - case BMP_FORMAT_24BIT_TC_BGR: - return ImplBlendFromBitmap<BMP_FORMAT_24BIT_TC_BGR>( rDst, rSrc, rMsk ); - case BMP_FORMAT_24BIT_TC_RGB: - return ImplBlendFromBitmap<BMP_FORMAT_24BIT_TC_RGB>( rDst, rSrc, rMsk ); + case ScanlineFormat::N24BitTcBgr: + return ImplBlendFromBitmap<ScanlineFormat::N24BitTcBgr>( rDst, rSrc, rMsk ); + case ScanlineFormat::N24BitTcRgb: + return ImplBlendFromBitmap<ScanlineFormat::N24BitTcRgb>( rDst, rSrc, rMsk ); - case BMP_FORMAT_32BIT_TC_ABGR: - return ImplBlendFromBitmap<BMP_FORMAT_32BIT_TC_ABGR>( rDst, rSrc, rMsk ); + case ScanlineFormat::N32BitTcAbgr: + return ImplBlendFromBitmap<ScanlineFormat::N32BitTcAbgr>( rDst, rSrc, rMsk ); #ifdef FAST_ARGB_BGRA - case BMP_FORMAT_32BIT_TC_ARGB: - return ImplBlendFromBitmap<BMP_FORMAT_32BIT_TC_ARGB>( rDst, rSrc, rMsk ); - case BMP_FORMAT_32BIT_TC_BGRA: - return ImplBlendFromBitmap<BMP_FORMAT_32BIT_TC_BGRA>( rDst, rSrc, rMsk ); + case ScanlineFormat::N32BitTcArgb: + return ImplBlendFromBitmap<ScanlineFormat::N32BitTcArgb>( rDst, rSrc, rMsk ); + case ScanlineFormat::N32BitTcBgra: + return ImplBlendFromBitmap<ScanlineFormat::N32BitTcBgra>( rDst, rSrc, rMsk ); #endif - case BMP_FORMAT_32BIT_TC_RGBA: - return ImplBlendFromBitmap<BMP_FORMAT_32BIT_TC_RGBA>( rDst, rSrc, rMsk ); + case ScanlineFormat::N32BitTcRgba: + return ImplBlendFromBitmap<ScanlineFormat::N32BitTcRgba>( rDst, rSrc, rMsk ); + default: break; } static int nNotAccelerated = 0; SAL_WARN_IF( rSrc.mnWidth * rSrc.mnHeight >= 4000 && ++nNotAccelerated == 100, "vcl.gdi", - "ImplFastBlend for not accelerated case (" << std::hex << rSrc.mnFormat << "*" << rMsk.mnFormat << "->" << rDst.mnFormat << ")" ); + "ImplFastBlend for not accelerated case (" << std::hex << (int)rSrc.mnFormat << "*" << (int)rMsk.mnFormat << "->" << (int)rDst.mnFormat << ")" ); return false; } bool ImplFastEraseBitmap( BitmapBuffer& rDst, const BitmapColor& rColor ) { - const sal_uLong nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN; + const ScanlineFormat nDstFormat = rDst.mnFormat & ~ScanlineFormat::TopDown; // erasing a bitmap is often just a byte-wise memory fill bool bByteFill = true; @@ -790,25 +794,25 @@ bool ImplFastEraseBitmap( BitmapBuffer& rDst, const BitmapColor& rColor ) switch( nDstFormat ) { - case BMP_FORMAT_1BIT_MSB_PAL: - case BMP_FORMAT_1BIT_LSB_PAL: + case ScanlineFormat::N1BitMsbPal: + case ScanlineFormat::N1BitLsbPal: nFillByte = rColor.GetIndex(); nFillByte = static_cast<sal_uInt8>( -(nFillByte & 1) ); // 0x00 or 0xFF break; - case BMP_FORMAT_4BIT_MSN_PAL: - case BMP_FORMAT_4BIT_LSN_PAL: + case ScanlineFormat::N4BitMsnPal: + case ScanlineFormat::N4BitLsnPal: nFillByte = rColor.GetIndex(); nFillByte &= 0x0F; nFillByte |= (nFillByte << 4); break; - case BMP_FORMAT_8BIT_PAL: - case BMP_FORMAT_8BIT_TC_MASK: + case ScanlineFormat::N8BitPal: + case ScanlineFormat::N8BitTcMask: nFillByte = rColor.GetIndex(); break; - case BMP_FORMAT_24BIT_TC_MASK: - case BMP_FORMAT_24BIT_TC_BGR: - case BMP_FORMAT_24BIT_TC_RGB: + case ScanlineFormat::N24BitTcMask: + case ScanlineFormat::N24BitTcBgr: + case ScanlineFormat::N24BitTcRgb: nFillByte = rColor.GetRed(); if( (nFillByte != rColor.GetGreen()) || (nFillByte != rColor.GetBlue()) ) @@ -831,19 +835,19 @@ bool ImplFastEraseBitmap( BitmapBuffer& rDst, const BitmapColor& rColor ) // TODO: handle other bitmap formats switch( nDstFormat ) { - case BMP_FORMAT_32BIT_TC_MASK: - case BMP_FORMAT_16BIT_TC_MSB_MASK: - case BMP_FORMAT_16BIT_TC_LSB_MASK: + case ScanlineFormat::N32BitTcMask: + case ScanlineFormat::N16BitTcMsbMask: + case ScanlineFormat::N16BitTcLsbMask: - case BMP_FORMAT_24BIT_TC_BGR: - case BMP_FORMAT_24BIT_TC_RGB: + case ScanlineFormat::N24BitTcBgr: + case ScanlineFormat::N24BitTcRgb: - case BMP_FORMAT_32BIT_TC_ABGR: + case ScanlineFormat::N32BitTcAbgr: #ifdef FAST_ARGB_BGRA - case BMP_FORMAT_32BIT_TC_ARGB: - case BMP_FORMAT_32BIT_TC_BGRA: + case ScanlineFormat::N32BitTcArgb: + case ScanlineFormat::N32BitTcBgra: #endif - case BMP_FORMAT_32BIT_TC_RGBA: + case ScanlineFormat::N32BitTcRgba: break; default: diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index b242ceefc1c5..75e39e6f018e 100644 --- a/vcl/source/gdi/dibtools.cxx +++ b/vcl/source/gdi/dibtools.cxx @@ -153,9 +153,9 @@ namespace ( nInputCount <= 8 ) ? 8 : 24; } - inline bool isBitfieldCompression( sal_uLong nScanlineFormat ) + inline bool isBitfieldCompression( ScanlineFormat nScanlineFormat ) { - return (BMP_FORMAT_16BIT_TC_LSB_MASK == nScanlineFormat) || (BMP_FORMAT_32BIT_TC_MASK == nScanlineFormat); + return (ScanlineFormat::N16BitTcLsbMask == nScanlineFormat) || (ScanlineFormat::N32BitTcMask == nScanlineFormat); } } @@ -480,10 +480,10 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r // Is native format? switch(rAcc.GetScanlineFormat()) { - case BMP_FORMAT_1BIT_MSB_PAL: - case BMP_FORMAT_4BIT_MSN_PAL: - case BMP_FORMAT_8BIT_PAL: - case BMP_FORMAT_24BIT_TC_BGR: + case ScanlineFormat::N1BitMsbPal: + case ScanlineFormat::N4BitMsnPal: + case ScanlineFormat::N8BitPal: + case ScanlineFormat::N24BitTcBgr: { bNative = ( ( static_cast< bool >(rAcc.IsBottomUp()) != bTopDown ) && !bRLE && !bTCMask && ( rAcc.GetScanlineSize() == nAlignedWidth ) ); break; @@ -1180,10 +1180,10 @@ bool ImplWriteDIBBits(SvStream& rOStm, BitmapReadAccess& rAcc, BitmapReadAccess* switch(rAcc.GetScanlineFormat()) { - case BMP_FORMAT_1BIT_MSB_PAL: - case BMP_FORMAT_4BIT_MSN_PAL: - case BMP_FORMAT_8BIT_PAL: - case BMP_FORMAT_24BIT_TC_BGR: + case ScanlineFormat::N1BitMsbPal: + case ScanlineFormat::N4BitMsnPal: + case ScanlineFormat::N8BitPal: + case ScanlineFormat::N24BitTcBgr: { if(!pAccAlpha && rAcc.IsBottomUp() && (rAcc.GetScanlineSize() == nAlignedWidth)) { @@ -1340,7 +1340,7 @@ bool ImplWriteDIBBody(const Bitmap& rBitmap, SvStream& rOStm, BitmapReadAccess& if(!pAccAlpha && isBitfieldCompression(rAcc.GetScanlineFormat())) { - aHeader.nBitCount = (BMP_FORMAT_16BIT_TC_LSB_MASK == rAcc.GetScanlineFormat()) ? 16 : 32; + aHeader.nBitCount = (ScanlineFormat::N16BitTcLsbMask == rAcc.GetScanlineFormat()) ? 16 : 32; aHeader.nSizeImage = rAcc.Height() * rAcc.GetScanlineSize(); nCompression = BITFIELDS; } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index f42f4ef76bc2..3101d98e5ffb 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -11364,7 +11364,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) #endif { beginCompression(); - if( ! bTrueColor || pAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB ) + if( ! bTrueColor || pAccess->GetScanlineFormat() == ScanlineFormat::N24BitTcRgb ) { //With PDF bitmaps, each row is padded to a BYTE boundary (multiple of 8 bits). const int nScanLineBytes = ((pAccess->GetBitCount() * pAccess->Width()) + 7U) / 8U; diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx index 3c260f126ce1..377d41be6df6 100644 --- a/vcl/source/gdi/pngread.cxx +++ b/vcl/source/gdi/pngread.cxx @@ -1160,7 +1160,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd ) } } else - { // BMP_FORMAT_1BIT_MSB_PAL + { // ScanlineFormat::N1BitMsbPal for ( sal_Int32 nX = nXStart, nShift = 0; nX < maOrigSize.Width(); nX += nXAdd ) { nShift = (nShift - 1) & 7; @@ -1232,7 +1232,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd ) else { if ( mnPngDepth == 4 ) // maybe the source is a two bitmap graphic - { // BMP_FORMAT_4BIT_LSN_PAL + { // ScanlineFormat::N4BitLsnPal for ( sal_Int32 nX = nXStart, nXIndex = 0; nX < maOrigSize.Width(); nX += nXAdd, nXIndex++ ) { if( nXIndex & 1 ) @@ -1304,7 +1304,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd ) if( nXAdd == 1 && mnPreviewShift == 0 ) // copy raw line data if possible { int nLineBytes = maOrigSize.Width(); - mpAcc->CopyScanline( nY, pTmp, BMP_FORMAT_8BIT_PAL, nLineBytes ); + mpAcc->CopyScanline( nY, pTmp, ScanlineFormat::N8BitPal, nLineBytes ); } else { @@ -1336,7 +1336,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd ) // has RGB + alpha if ( mnPngDepth == 8 ) // maybe the source has 16 bit per sample { - // BMP_FORMAT_32BIT_TC_RGBA + // ScanlineFormat::N32BitTcRgba // only use DirectScanline when we have no preview shifting stuff and accesses to content and alpha const bool bDoDirectScanline( bCkeckDirectScanline && !nXStart && 1 == nXAdd && !mnPreviewShift && mpMaskAcc); @@ -1395,8 +1395,8 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd ) // copy scanlines directly to bitmaps for content and alpha; use the formats which // are able to copy directly to BitmapBuffer - mpAcc->CopyScanline(nY, mpScanline, BMP_FORMAT_24BIT_TC_BGR, maOrigSize.Width() * 3); - mpMaskAcc->CopyScanline(nY, mpScanlineAlpha, BMP_FORMAT_8BIT_PAL, maOrigSize.Width()); + mpAcc->CopyScanline(nY, mpScanline, ScanlineFormat::N24BitTcBgr, maOrigSize.Width() * 3); + mpMaskAcc->CopyScanline(nY, mpScanlineAlpha, ScanlineFormat::N8BitPal, maOrigSize.Width()); } else { @@ -1445,7 +1445,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd ) } else if( mbTransparent ) // has RGB + transparency { - // BMP_FORMAT_24BIT_TC_RGB + // ScanlineFormat::N24BitTcRgb // no support currently for DirectScanline, found no real usages in current PNGs, may be added on demand if ( mnPngDepth == 8 ) // maybe the source has 16 bit per sample { @@ -1483,7 +1483,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd ) } else // has RGB but neither alpha nor transparency { - // BMP_FORMAT_24BIT_TC_RGB + // ScanlineFormat::N24BitTcRgb // only use DirectScanline when we have no preview shifting stuff and access to content const bool bDoDirectScanline( bCkeckDirectScanline && !nXStart && 1 == nXAdd && !mnPreviewShift); @@ -1527,7 +1527,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd ) // copy scanline directly to bitmap for content; use the format which is able to // copy directly to BitmapBuffer - mpAcc->CopyScanline(nY, mpScanline, BMP_FORMAT_24BIT_TC_BGR, maOrigSize.Width() * 3); + mpAcc->CopyScanline(nY, mpScanline, ScanlineFormat::N24BitTcBgr, maOrigSize.Width() * 3); } else { diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx index b7abeb466a96..bcc75e01bf78 100644 --- a/vcl/source/gdi/salmisc.cxx +++ b/vcl/source/gdi/salmisc.cxx @@ -24,12 +24,12 @@ #include <memory> #define IMPL_CASE_GET_FORMAT( Format ) \ -case( BMP_FORMAT##Format ): \ +case( ScanlineFormat::Format ): \ pFncGetPixel = BitmapReadAccess::GetPixelFor##Format; \ break #define IMPL_CASE_SET_FORMAT( Format, BitCount ) \ -case( BMP_FORMAT##Format ): \ +case( ScanlineFormat::Format ): \ { \ pFncSetPixel = BitmapReadAccess::SetPixelFor##Format; \ pDstBuffer->mnBitCount = BitCount; \ @@ -104,7 +104,7 @@ static void ImplPALToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe const ColorMask& rDstMask = rDstBuffer.maColorMask; const BitmapColor* pColBuf = rSrcBuffer.maPalette.ImplGetColorBuffer(); - if( BMP_SCANLINE_FORMAT( rSrcBuffer.mnFormat ) == BMP_FORMAT_1BIT_MSB_PAL ) + if( RemoveScanline( rSrcBuffer.mnFormat ) == ScanlineFormat::N1BitMsbPal ) { const BitmapColor aCol0( pColBuf[ 0 ] ); const BitmapColor aCol1( pColBuf[ 1 ] ); @@ -126,7 +126,7 @@ static void ImplPALToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe DOUBLE_SCANLINES(); } } - else if( BMP_SCANLINE_FORMAT( rSrcBuffer.mnFormat ) == BMP_FORMAT_4BIT_MSN_PAL ) + else if( RemoveScanline( rSrcBuffer.mnFormat ) == ScanlineFormat::N4BitMsnPal ) { long nMapX; @@ -146,7 +146,7 @@ static void ImplPALToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe DOUBLE_SCANLINES(); } } - else if( BMP_SCANLINE_FORMAT( rSrcBuffer.mnFormat ) == BMP_FORMAT_8BIT_PAL ) + else if( RemoveScanline( rSrcBuffer.mnFormat ) == ScanlineFormat::N8BitPal ) { for (long nActY = 0; nActY < rDstBuffer.mnHeight; ++nActY) { @@ -182,7 +182,7 @@ static void ImplTCToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer const ColorMask& rSrcMask = rSrcBuffer.maColorMask; const ColorMask& rDstMask = rDstBuffer.maColorMask; - if( BMP_SCANLINE_FORMAT( rSrcBuffer.mnFormat ) == BMP_FORMAT_24BIT_TC_BGR ) + if( RemoveScanline( rSrcBuffer.mnFormat ) == ScanlineFormat::N24BitTcBgr ) { BitmapColor aCol; sal_uInt8* pPixel = nullptr; @@ -260,67 +260,67 @@ static void ImplTCToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect, - sal_uLong nDstBitmapFormat, const BitmapPalette* pDstPal, const ColorMask* pDstMask ) + ScanlineFormat nDstBitmapFormat, const BitmapPalette* pDstPal, const ColorMask* pDstMask ) { FncGetPixel pFncGetPixel; FncSetPixel pFncSetPixel; BitmapBuffer* pDstBuffer = new BitmapBuffer; // set function for getting pixels - switch( BMP_SCANLINE_FORMAT( rSrcBuffer.mnFormat ) ) + switch( RemoveScanline( rSrcBuffer.mnFormat ) ) { - IMPL_CASE_GET_FORMAT( _1BIT_MSB_PAL ); - IMPL_CASE_GET_FORMAT( _1BIT_LSB_PAL ); - IMPL_CASE_GET_FORMAT( _4BIT_MSN_PAL ); - IMPL_CASE_GET_FORMAT( _4BIT_LSN_PAL ); - IMPL_CASE_GET_FORMAT( _8BIT_PAL ); - IMPL_CASE_GET_FORMAT( _8BIT_TC_MASK ); - IMPL_CASE_GET_FORMAT( _16BIT_TC_MSB_MASK ); - IMPL_CASE_GET_FORMAT( _16BIT_TC_LSB_MASK ); - IMPL_CASE_GET_FORMAT( _24BIT_TC_BGR ); - IMPL_CASE_GET_FORMAT( _24BIT_TC_RGB ); - IMPL_CASE_GET_FORMAT( _24BIT_TC_MASK ); - IMPL_CASE_GET_FORMAT( _32BIT_TC_ABGR ); - IMPL_CASE_GET_FORMAT( _32BIT_TC_ARGB ); - IMPL_CASE_GET_FORMAT( _32BIT_TC_BGRA ); - IMPL_CASE_GET_FORMAT( _32BIT_TC_RGBA ); - IMPL_CASE_GET_FORMAT( _32BIT_TC_MASK ); + IMPL_CASE_GET_FORMAT( N1BitMsbPal ); + IMPL_CASE_GET_FORMAT( N1BitLsbPal ); + IMPL_CASE_GET_FORMAT( N4BitMsnPal ); + IMPL_CASE_GET_FORMAT( N4BitLsnPal ); + IMPL_CASE_GET_FORMAT( N8BitPal ); + IMPL_CASE_GET_FORMAT( N8BitTcMask ); + IMPL_CASE_GET_FORMAT( N16BitTcMsbMask ); + IMPL_CASE_GET_FORMAT( N16BitTcLsbMask ); + IMPL_CASE_GET_FORMAT( N24BitTcBgr ); + IMPL_CASE_GET_FORMAT( N24BitTcRgb ); + IMPL_CASE_GET_FORMAT( N24BitTcMask ); + IMPL_CASE_GET_FORMAT( N32BitTcAbgr ); + IMPL_CASE_GET_FORMAT( N32BitTcArgb ); + IMPL_CASE_GET_FORMAT( N32BitTcBgra ); + IMPL_CASE_GET_FORMAT( N32BitTcRgba ); + IMPL_CASE_GET_FORMAT( N32BitTcMask ); default: // should never come here // initialize pFncGetPixel to something valid that is // least likely to crash - pFncGetPixel = BitmapReadAccess::GetPixelFor_1BIT_MSB_PAL; + pFncGetPixel = BitmapReadAccess::GetPixelForN1BitMsbPal; OSL_FAIL( "unknown read format" ); break; } // set function for setting pixels - const sal_uLong nDstScanlineFormat = BMP_SCANLINE_FORMAT( nDstBitmapFormat ); + const ScanlineFormat nDstScanlineFormat = RemoveScanline( nDstBitmapFormat ); switch( nDstScanlineFormat ) { - IMPL_CASE_SET_FORMAT( _1BIT_MSB_PAL, 1 ); - IMPL_CASE_SET_FORMAT( _1BIT_LSB_PAL, 1 ); - IMPL_CASE_SET_FORMAT( _4BIT_MSN_PAL, 1 ); - IMPL_CASE_SET_FORMAT( _4BIT_LSN_PAL, 4 ); - IMPL_CASE_SET_FORMAT( _8BIT_PAL, 8 ); - IMPL_CASE_SET_FORMAT( _8BIT_TC_MASK, 8 ); - IMPL_CASE_SET_FORMAT( _16BIT_TC_MSB_MASK, 16 ); - IMPL_CASE_SET_FORMAT( _16BIT_TC_LSB_MASK, 16 ); - IMPL_CASE_SET_FORMAT( _24BIT_TC_BGR, 24 ); - IMPL_CASE_SET_FORMAT( _24BIT_TC_RGB, 24 ); - IMPL_CASE_SET_FORMAT( _24BIT_TC_MASK, 24 ); - IMPL_CASE_SET_FORMAT( _32BIT_TC_ABGR, 32 ); - IMPL_CASE_SET_FORMAT( _32BIT_TC_ARGB, 32 ); - IMPL_CASE_SET_FORMAT( _32BIT_TC_BGRA, 32 ); - IMPL_CASE_SET_FORMAT( _32BIT_TC_RGBA, 32 ); - IMPL_CASE_SET_FORMAT( _32BIT_TC_MASK, 32 ); + IMPL_CASE_SET_FORMAT( N1BitMsbPal, 1 ); + IMPL_CASE_SET_FORMAT( N1BitLsbPal, 1 ); + IMPL_CASE_SET_FORMAT( N4BitMsnPal, 1 ); + IMPL_CASE_SET_FORMAT( N4BitLsnPal, 4 ); + IMPL_CASE_SET_FORMAT( N8BitPal, 8 ); + IMPL_CASE_SET_FORMAT( N8BitTcMask, 8 ); + IMPL_CASE_SET_FORMAT( N16BitTcMsbMask, 16 ); + IMPL_CASE_SET_FORMAT( N16BitTcLsbMask, 16 ); + IMPL_CASE_SET_FORMAT( N24BitTcBgr, 24 ); + IMPL_CASE_SET_FORMAT( N24BitTcRgb, 24 ); + IMPL_CASE_SET_FORMAT( N24BitTcMask, 24 ); + IMPL_CASE_SET_FORMAT( N32BitTcAbgr, 32 ); + IMPL_CASE_SET_FORMAT( N32BitTcArgb, 32 ); + IMPL_CASE_SET_FORMAT( N32BitTcBgra, 32 ); + IMPL_CASE_SET_FORMAT( N32BitTcRgba, 32 ); + IMPL_CASE_SET_FORMAT( N32BitTcMask, 32 ); default: // should never come here // initialize pFncSetPixel to something valid that is // least likely to crash - pFncSetPixel = BitmapReadAccess::SetPixelFor_1BIT_MSB_PAL; + pFncSetPixel = BitmapReadAccess::SetPixelForN1BitMsbPal; pDstBuffer->mnBitCount = 1; OSL_FAIL( "unknown write format" ); break; @@ -344,11 +344,11 @@ BitmapBuffer* StretchAndConvert( } // do we need a destination palette or color mask? - if( ( nDstScanlineFormat == BMP_FORMAT_1BIT_MSB_PAL ) || - ( nDstScanlineFormat == BMP_FORMAT_1BIT_LSB_PAL ) || - ( nDstScanlineFormat == BMP_FORMAT_4BIT_MSN_PAL ) || - ( nDstScanlineFormat == BMP_FORMAT_4BIT_LSN_PAL ) || - ( nDstScanlineFormat == BMP_FORMAT_8BIT_PAL ) ) + if( ( nDstScanlineFormat == ScanlineFormat::N1BitMsbPal ) || + ( nDstScanlineFormat == ScanlineFormat::N1BitLsbPal ) || + ( nDstScanlineFormat == ScanlineFormat::N4BitMsnPal ) || + ( nDstScanlineFormat == ScanlineFormat::N4BitLsnPal ) || + ( nDstScanlineFormat == ScanlineFormat::N8BitPal ) ) { assert(pDstPal && "destination buffer requires palette"); if (!pDstPal) @@ -358,11 +358,11 @@ BitmapBuffer* StretchAndConvert( } pDstBuffer->maPalette = *pDstPal; } - else if( ( nDstScanlineFormat == BMP_FORMAT_8BIT_TC_MASK ) || - ( nDstScanlineFormat == BMP_FORMAT_16BIT_TC_MSB_MASK ) || - ( nDstScanlineFormat == BMP_FORMAT_16BIT_TC_LSB_MASK ) || - ( nDstScanlineFormat == BMP_FORMAT_24BIT_TC_MASK ) || - ( nDstScanlineFormat == BMP_FORMAT_32BIT_TC_MASK ) ) + else if( ( nDstScanlineFormat == ScanlineFormat::N8BitTcMask ) || + ( nDstScanlineFormat == ScanlineFormat::N16BitTcMsbMask ) || + ( nDstScanlineFormat == ScanlineFormat::N16BitTcLsbMask ) || + ( nDstScanlineFormat == ScanlineFormat::N24BitTcMask ) || + ( nDstScanlineFormat == ScanlineFormat::N32BitTcMask ) ) { assert(pDstMask && "destination buffer requires color mask"); if (!pDstMask) @@ -430,7 +430,7 @@ BitmapBuffer* StretchAndConvert( // source scanline buffer Scanline pTmpScan; long nOffset; - if( BMP_SCANLINE_ADJUSTMENT( rSrcBuffer.mnFormat ) == BMP_FORMAT_TOP_DOWN ) + if( rSrcBuffer.mnFormat & ScanlineFormat::TopDown ) { pTmpScan = rSrcBuffer.mpBits; nOffset = rSrcBuffer.mnScanlineSize; @@ -445,7 +445,7 @@ BitmapBuffer* StretchAndConvert( pSrcScan[ i ] = pTmpScan; // destination scanline buffer - if( BMP_SCANLINE_ADJUSTMENT( pDstBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) + if( pDstBuffer->mnFormat & ScanlineFormat::TopDown ) { pTmpScan = pDstBuffer->mpBits; nOffset = pDstBuffer->mnScanlineSize; diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx index ae7b2ac581c2..60f4686fdc8a 100644 --- a/vcl/source/helper/canvasbitmap.cxx +++ b/vcl/source/helper/canvasbitmap.cxx @@ -136,42 +136,42 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : switch( m_pBmpAcc->GetScanlineFormat() ) { - case BMP_FORMAT_1BIT_MSB_PAL: + case ScanlineFormat::N1BitMsbPal: m_bPalette = true; m_nBitsPerInputPixel = 1; m_nEndianness = util::Endianness::LITTLE; // doesn't matter m_aLayout.IsMsbFirst = true; break; - case BMP_FORMAT_1BIT_LSB_PAL: + case ScanlineFormat::N1BitLsbPal: m_bPalette = true; m_nBitsPerInputPixel = 1; m_nEndianness = util::Endianness::LITTLE; // doesn't matter m_aLayout.IsMsbFirst = false; break; - case BMP_FORMAT_4BIT_MSN_PAL: + case ScanlineFormat::N4BitMsnPal: m_bPalette = true; m_nBitsPerInputPixel = 4; m_nEndianness = util::Endianness::LITTLE; // doesn't matter m_aLayout.IsMsbFirst = true; break; - case BMP_FORMAT_4BIT_LSN_PAL: + case ScanlineFormat::N4BitLsnPal: m_bPalette = true; m_nBitsPerInputPixel = 4; m_nEndianness = util::Endianness::LITTLE; // doesn't matter m_aLayout.IsMsbFirst = false; break; - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N8BitPal: m_bPalette = true; m_nBitsPerInputPixel = 8; m_nEndianness = util::Endianness::LITTLE; // doesn't matter m_aLayout.IsMsbFirst = false; // doesn't matter break; - case BMP_FORMAT_8BIT_TC_MASK: + case ScanlineFormat::N8BitTcMask: m_bPalette = false; m_nBitsPerInputPixel = 8; m_nEndianness = util::Endianness::LITTLE; // doesn't matter @@ -181,7 +181,7 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : m_pBmpAcc->GetColorMask().GetBlueMask() ); break; - case BMP_FORMAT_16BIT_TC_MSB_MASK: + case ScanlineFormat::N16BitTcMsbMask: m_bPalette = false; m_nBitsPerInputPixel = 16; m_nEndianness = util::Endianness::BIG; @@ -191,7 +191,7 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : m_pBmpAcc->GetColorMask().GetBlueMask() ); break; - case BMP_FORMAT_16BIT_TC_LSB_MASK: + case ScanlineFormat::N16BitTcLsbMask: m_bPalette = false; m_nBitsPerInputPixel = 16; m_nEndianness = util::Endianness::LITTLE; @@ -201,7 +201,7 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : m_pBmpAcc->GetColorMask().GetBlueMask() ); break; - case BMP_FORMAT_24BIT_TC_BGR: + case ScanlineFormat::N24BitTcBgr: m_bPalette = false; m_nBitsPerInputPixel = 24; m_nEndianness = util::Endianness::LITTLE; @@ -211,7 +211,7 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : static_cast<sal_uInt32>(0x0000ffUL) ); break; - case BMP_FORMAT_24BIT_TC_RGB: + case ScanlineFormat::N24BitTcRgb: m_bPalette = false; m_nBitsPerInputPixel = 24; m_nEndianness = util::Endianness::LITTLE; @@ -221,7 +221,7 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : static_cast<sal_uInt32>(0xff0000UL) ); break; - case BMP_FORMAT_24BIT_TC_MASK: + case ScanlineFormat::N24BitTcMask: m_bPalette = false; m_nBitsPerInputPixel = 24; m_nEndianness = util::Endianness::LITTLE; @@ -231,7 +231,7 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : m_pBmpAcc->GetColorMask().GetBlueMask() ); break; - case BMP_FORMAT_32BIT_TC_ABGR: + case ScanlineFormat::N32BitTcAbgr: { m_bPalette = false; m_nBitsPerInputPixel = 32; @@ -259,7 +259,7 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : } break; - case BMP_FORMAT_32BIT_TC_ARGB: + case ScanlineFormat::N32BitTcArgb: { m_bPalette = false; m_nBitsPerInputPixel = 32; @@ -287,7 +287,7 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : } break; - case BMP_FORMAT_32BIT_TC_BGRA: + case ScanlineFormat::N32BitTcBgra: { m_bPalette = false; m_nBitsPerInputPixel = 32; @@ -315,7 +315,7 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : } break; - case BMP_FORMAT_32BIT_TC_RGBA: + case ScanlineFormat::N32BitTcRgba: { m_bPalette = false; m_nBitsPerInputPixel = 32; @@ -343,7 +343,7 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : } break; - case BMP_FORMAT_32BIT_TC_MASK: + case ScanlineFormat::N32BitTcMask: m_bPalette = false; m_nBitsPerInputPixel = 32; m_nEndianness = util::Endianness::LITTLE; @@ -495,7 +495,7 @@ uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getData( rendering::IntegerB bitmapLayout.ScanLineStride= aRequestedBytes.getWidth(); sal_Int32 nScanlineStride=bitmapLayout.ScanLineStride; - if( !(m_pBmpAcc->GetScanlineFormat() & BMP_FORMAT_TOP_DOWN) ) + if( !(m_pBmpAcc->GetScanlineFormat() & ScanlineFormat::TopDown) ) { pOutBuf += bitmapLayout.ScanLineStride*(aRequestedBytes.getHeight()-1); nScanlineStride *= -1; diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index f538ca03a5c2..a3e05715b239 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -766,21 +766,23 @@ public: { if (pSource && pSourceAlpha && pDestination) { - unsigned long nSourceFormat = pSource->GetScanlineFormat(); - unsigned long nDestinationFormat = pDestination->GetScanlineFormat(); + ScanlineFormat nSourceFormat = pSource->GetScanlineFormat(); + ScanlineFormat nDestinationFormat = pDestination->GetScanlineFormat(); switch (nSourceFormat) { - case BMP_FORMAT_24BIT_TC_RGB: - case BMP_FORMAT_24BIT_TC_BGR: + case ScanlineFormat::N24BitTcRgb: + case ScanlineFormat::N24BitTcBgr: { - if ( (nSourceFormat == BMP_FORMAT_24BIT_TC_BGR && nDestinationFormat == BMP_FORMAT_32BIT_TC_BGRA) - || (nSourceFormat == BMP_FORMAT_24BIT_TC_RGB && nDestinationFormat == BMP_FORMAT_32BIT_TC_RGBA)) + if ( (nSourceFormat == ScanlineFormat::N24BitTcBgr && nDestinationFormat == ScanlineFormat::N32BitTcBgra) + || (nSourceFormat == ScanlineFormat::N24BitTcRgb && nDestinationFormat == ScanlineFormat::N32BitTcRgba)) { blendBitmap24(pDestination, pSource, pSourceAlpha, nDstWidth, nDstHeight); return true; } } + break; + default: break; } } return false; @@ -971,8 +973,8 @@ void OutputDevice::DrawDeviceAlphaBitmapSlowPath(const Bitmap& rBitmap, const Al Bitmap::ScopedReadAccess pBitmapReadAccess(const_cast<Bitmap&>(rBitmap)); AlphaMask::ScopedReadAccess pAlphaReadAccess(const_cast<AlphaMask&>(rAlpha)); - DBG_ASSERT( pAlphaReadAccess->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL || - pAlphaReadAccess->GetScanlineFormat() == BMP_FORMAT_8BIT_TC_MASK, + DBG_ASSERT( pAlphaReadAccess->GetScanlineFormat() == ScanlineFormat::N8BitPal || + pAlphaReadAccess->GetScanlineFormat() == ScanlineFormat::N8BitTcMask, "OutputDevice::ImplDrawAlpha(): non-8bit alpha no longer supported!" ); // #i38887# reading from screen may sometimes fail @@ -1553,7 +1555,7 @@ Bitmap OutputDevice::BlendBitmap( { switch( pP->GetScanlineFormat() ) { - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N8BitPal: { for( nY = 0; nY < nDstHeight; nY++ ) { diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index addf0d634708..0f06d065e33c 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -494,8 +494,8 @@ void OutputDevice::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly, pMap[ i ] = BitmapColor( (sal_uInt8) rPal.GetBestIndex( aCol.Merge( aFillCol, cTrans ) ) ); } - if( pR->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL && - pW->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL ) + if( pR->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal && + pW->GetScanlineFormat() == ScanlineFormat::N8BitPal ) { const sal_uInt8 cBlack = aBlack.GetIndex(); @@ -536,8 +536,8 @@ void OutputDevice::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly, } else { - if( pR->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL && - pW->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR ) + if( pR->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal && + pW->GetScanlineFormat() == ScanlineFormat::N24BitTcBgr ) { const sal_uInt8 cBlack = aBlack.GetIndex(); |