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 /canvas | |
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 'canvas')
-rw-r--r-- | canvas/source/cairo/cairo_canvashelper.cxx | 18 | ||||
-rw-r--r-- | canvas/source/directx/dx_vcltools.cxx | 98 | ||||
-rw-r--r-- | canvas/source/vcl/canvasbitmaphelper.cxx | 16 | ||||
-rw-r--r-- | canvas/source/vcl/canvashelper.cxx | 6 |
4 files changed, 69 insertions, 69 deletions
diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index 6ab701b8012f..9518f0feb940 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.cxx @@ -355,7 +355,7 @@ namespace cairocanvas switch( pAlphaReadAcc->GetScanlineFormat() ) { - case BMP_FORMAT_8BIT_TC_MASK: + case ScanlineFormat::N8BitTcMask: pReadScan = pAlphaReadAcc->GetScanline( nY ); for( nX = 0; nX < nWidth; nX++ ) { @@ -365,7 +365,7 @@ namespace cairocanvas nOff += 4; } break; - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N8BitPal: pReadScan = pAlphaReadAcc->GetScanline( nY ); for( nX = 0; nX < nWidth; nX++ ) { @@ -379,7 +379,7 @@ namespace cairocanvas } break; default: - SAL_INFO( "canvas.cairo", "fallback to GetColor for alpha - slow, format: " << pAlphaReadAcc->GetScanlineFormat() ); + SAL_INFO( "canvas.cairo", "fallback to GetColor for alpha - slow, format: " << (int)pAlphaReadAcc->GetScanlineFormat() ); for( nX = 0; nX < nWidth; nX++ ) { nAlpha = data[ nOff ] = 255 - pAlphaReadAcc->GetColor( nY, nX ).GetIndex(); @@ -451,7 +451,7 @@ namespace cairocanvas switch( pBitmapReadAcc->GetScanlineFormat() ) { - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N8BitPal: pReadScan = pBitmapReadAcc->GetScanline( nY ); if( pAlphaReadAcc ) if( readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) ) @@ -484,7 +484,7 @@ namespace cairocanvas #endif } break; - case BMP_FORMAT_24BIT_TC_BGR: + case ScanlineFormat::N24BitTcBgr: pReadScan = pBitmapReadAcc->GetScanline( nY ); if( pAlphaReadAcc ) if( readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) ) @@ -513,7 +513,7 @@ namespace cairocanvas #endif } break; - case BMP_FORMAT_24BIT_TC_RGB: + case ScanlineFormat::N24BitTcRgb: pReadScan = pBitmapReadAcc->GetScanline( nY ); if( pAlphaReadAcc ) if( readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) ) @@ -542,7 +542,7 @@ namespace cairocanvas #endif } break; - case BMP_FORMAT_32BIT_TC_BGRA: + case ScanlineFormat::N32BitTcBgra: pReadScan = pBitmapReadAcc->GetScanline( nY ); if( pAlphaReadAcc ) if( readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) ) @@ -572,7 +572,7 @@ namespace cairocanvas #endif } break; - case BMP_FORMAT_32BIT_TC_RGBA: + case ScanlineFormat::N32BitTcRgba: pReadScan = pBitmapReadAcc->GetScanline( nY ); if( pAlphaReadAcc ) if( readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) ) @@ -603,7 +603,7 @@ namespace cairocanvas } break; default: - SAL_INFO( "canvas.cairo", "fallback to GetColor - slow, format: " << pBitmapReadAcc->GetScanlineFormat() ); + SAL_INFO( "canvas.cairo", "fallback to GetColor - slow, format: " << (int)pBitmapReadAcc->GetScanlineFormat() ); if( pAlphaReadAcc ) if( readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) ) diff --git a/canvas/source/directx/dx_vcltools.cxx b/canvas/source/directx/dx_vcltools.cxx index fb11fcff8918..41d03f66f989 100644 --- a/canvas/source/directx/dx_vcltools.cxx +++ b/canvas/source/directx/dx_vcltools.cxx @@ -178,14 +178,14 @@ namespace dxcanvas // By convention, the access buffer always has // one of the following formats: - // BMP_FORMAT_1BIT_MSB_PAL - // BMP_FORMAT_4BIT_MSN_PAL - // BMP_FORMAT_8BIT_PAL - // BMP_FORMAT_16BIT_TC_LSB_MASK - // BMP_FORMAT_24BIT_TC_BGR - // BMP_FORMAT_32BIT_TC_MASK + // ScanlineFormat::N1BitMsbPal + // ScanlineFormat::N4BitMsnPal + // ScanlineFormat::N8BitPal + // ScanlineFormat::N16BitTcLsbMask + // ScanlineFormat::N24BitTcBgr + // ScanlineFormat::N32BitTcMask - // and is always BMP_FORMAT_BOTTOM_UP + // and is always ScanlineFormat::BottomUp // This is the way // WinSalBitmap::AcquireBuffer() sets up the @@ -195,8 +195,8 @@ namespace dxcanvas "::dxcanvas::tools::bitmapFromVCLBitmapEx(): " "Unable to acquire read access to alpha" ); - ENSURE_OR_THROW( pAlphaReadAccess->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL || - pAlphaReadAccess->GetScanlineFormat() == BMP_FORMAT_8BIT_TC_MASK, + ENSURE_OR_THROW( pAlphaReadAccess->GetScanlineFormat() == ScanlineFormat::N8BitPal || + pAlphaReadAccess->GetScanlineFormat() == ScanlineFormat::N8BitTcMask, "::dxcanvas::tools::bitmapFromVCLBitmapEx(): " "Unsupported alpha scanline format" ); @@ -208,7 +208,7 @@ namespace dxcanvas { switch( pReadAccess->GetScanlineFormat() ) { - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N8BitPal: { Scanline pScan = pReadAccess->GetScanline( y ); Scanline pAScan = pAlphaReadAccess->GetScanline( y ); @@ -229,7 +229,7 @@ namespace dxcanvas } break; - case BMP_FORMAT_24BIT_TC_BGR: + case ScanlineFormat::N24BitTcBgr: { Scanline pScan = pReadAccess->GetScanline( y ); Scanline pAScan = pAlphaReadAccess->GetScanline( y ); @@ -252,13 +252,13 @@ namespace dxcanvas // TODO(P2): Might be advantageous // to hand-formulate the following // formats, too. - case BMP_FORMAT_1BIT_MSB_PAL: + case ScanlineFormat::N1BitMsbPal: // FALLTHROUGH intended - case BMP_FORMAT_4BIT_MSN_PAL: + case ScanlineFormat::N4BitMsnPal: // FALLTHROUGH intended - case BMP_FORMAT_16BIT_TC_LSB_MASK: + case ScanlineFormat::N16BitTcLsbMask: // FALLTHROUGH intended - case BMP_FORMAT_32BIT_TC_MASK: + case ScanlineFormat::N32BitTcMask: { Scanline pAScan = pAlphaReadAccess->GetScanline( y ); @@ -281,25 +281,25 @@ namespace dxcanvas } break; - case BMP_FORMAT_1BIT_LSB_PAL: + case ScanlineFormat::N1BitLsbPal: // FALLTHROUGH intended - case BMP_FORMAT_4BIT_LSN_PAL: + case ScanlineFormat::N4BitLsnPal: // FALLTHROUGH intended - case BMP_FORMAT_8BIT_TC_MASK: + case ScanlineFormat::N8BitTcMask: // FALLTHROUGH intended - case BMP_FORMAT_24BIT_TC_RGB: + case ScanlineFormat::N24BitTcRgb: // FALLTHROUGH intended - case BMP_FORMAT_24BIT_TC_MASK: + case ScanlineFormat::N24BitTcMask: // FALLTHROUGH intended - case BMP_FORMAT_16BIT_TC_MSB_MASK: + case ScanlineFormat::N16BitTcMsbMask: // FALLTHROUGH intended - case BMP_FORMAT_32BIT_TC_ABGR: + case ScanlineFormat::N32BitTcAbgr: // FALLTHROUGH intended - case BMP_FORMAT_32BIT_TC_ARGB: + case ScanlineFormat::N32BitTcArgb: // FALLTHROUGH intended - case BMP_FORMAT_32BIT_TC_BGRA: + case ScanlineFormat::N32BitTcBgra: // FALLTHROUGH intended - case BMP_FORMAT_32BIT_TC_RGBA: + case ScanlineFormat::N32BitTcRgba: // FALLTHROUGH intended default: ENSURE_OR_THROW( false, @@ -318,14 +318,14 @@ namespace dxcanvas // By convention, the access buffer always has // one of the following formats: - // BMP_FORMAT_1BIT_MSB_PAL - // BMP_FORMAT_4BIT_MSN_PAL - // BMP_FORMAT_8BIT_PAL - // BMP_FORMAT_16BIT_TC_LSB_MASK - // BMP_FORMAT_24BIT_TC_BGR - // BMP_FORMAT_32BIT_TC_MASK + // ScanlineFormat::N1BitMsbPal + // ScanlineFormat::N4BitMsnPal + // ScanlineFormat::N8BitPal + // ScanlineFormat::N16BitTcLsbMask + // ScanlineFormat::N24BitTcBgr + // ScanlineFormat::N32BitTcMask - // and is always BMP_FORMAT_BOTTOM_UP + // and is always ScanlineFormat::BottomUp // This is the way // WinSalBitmap::AcquireBuffer() sets up the @@ -335,7 +335,7 @@ namespace dxcanvas "::dxcanvas::tools::bitmapFromVCLBitmapEx(): " "Unable to acquire read access to mask" ); - ENSURE_OR_THROW( pMaskReadAccess->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL, + ENSURE_OR_THROW( pMaskReadAccess->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal, "::dxcanvas::tools::bitmapFromVCLBitmapEx(): " "Unsupported mask scanline format" ); @@ -365,7 +365,7 @@ namespace dxcanvas { switch( pReadAccess->GetScanlineFormat() ) { - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N8BitPal: { Scanline pScan = pReadAccess->GetScanline( y ); Scanline pMScan = pMaskReadAccess->GetScanline( y ); @@ -384,7 +384,7 @@ namespace dxcanvas } break; - case BMP_FORMAT_24BIT_TC_BGR: + case ScanlineFormat::N24BitTcBgr: { Scanline pScan = pReadAccess->GetScanline( y ); Scanline pMScan = pMaskReadAccess->GetScanline( y ); @@ -405,13 +405,13 @@ namespace dxcanvas // TODO(P2): Might be advantageous // to hand-formulate the following // formats, too. - case BMP_FORMAT_1BIT_MSB_PAL: + case ScanlineFormat::N1BitMsbPal: // FALLTHROUGH intended - case BMP_FORMAT_4BIT_MSN_PAL: + case ScanlineFormat::N4BitMsnPal: // FALLTHROUGH intended - case BMP_FORMAT_16BIT_TC_LSB_MASK: + case ScanlineFormat::N16BitTcLsbMask: // FALLTHROUGH intended - case BMP_FORMAT_32BIT_TC_MASK: + case ScanlineFormat::N32BitTcMask: { Scanline pMScan = pMaskReadAccess->GetScanline( y ); @@ -433,25 +433,25 @@ namespace dxcanvas } break; - case BMP_FORMAT_1BIT_LSB_PAL: + case ScanlineFormat::N1BitLsbPal: // FALLTHROUGH intended - case BMP_FORMAT_4BIT_LSN_PAL: + case ScanlineFormat::N4BitLsnPal: // FALLTHROUGH intended - case BMP_FORMAT_8BIT_TC_MASK: + case ScanlineFormat::N8BitTcMask: // FALLTHROUGH intended - case BMP_FORMAT_24BIT_TC_RGB: + case ScanlineFormat::N24BitTcRgb: // FALLTHROUGH intended - case BMP_FORMAT_24BIT_TC_MASK: + case ScanlineFormat::N24BitTcMask: // FALLTHROUGH intended - case BMP_FORMAT_16BIT_TC_MSB_MASK: + case ScanlineFormat::N16BitTcMsbMask: // FALLTHROUGH intended - case BMP_FORMAT_32BIT_TC_ABGR: + case ScanlineFormat::N32BitTcAbgr: // FALLTHROUGH intended - case BMP_FORMAT_32BIT_TC_ARGB: + case ScanlineFormat::N32BitTcArgb: // FALLTHROUGH intended - case BMP_FORMAT_32BIT_TC_BGRA: + case ScanlineFormat::N32BitTcBgra: // FALLTHROUGH intended - case BMP_FORMAT_32BIT_TC_RGBA: + case ScanlineFormat::N32BitTcRgba: // FALLTHROUGH intended default: ENSURE_OR_THROW( false, diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx index 3f388e125541..e9754dc2850d 100644 --- a/canvas/source/vcl/canvasbitmaphelper.cxx +++ b/canvas/source/vcl/canvasbitmaphelper.cxx @@ -218,8 +218,8 @@ namespace vclcanvas if( pAlphaWriteAccess.get() ) { - DBG_ASSERT( pAlphaWriteAccess->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL || - pAlphaWriteAccess->GetScanlineFormat() == BMP_FORMAT_8BIT_TC_MASK, + DBG_ASSERT( pAlphaWriteAccess->GetScanlineFormat() == ScanlineFormat::N8BitPal || + pAlphaWriteAccess->GetScanlineFormat() == ScanlineFormat::N8BitTcMask, "non-8bit alpha not supported!" ); } @@ -239,7 +239,7 @@ namespace vclcanvas { switch( pWriteAccess->GetScanlineFormat() ) { - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N8BitPal: { Scanline pScan = pWriteAccess->GetScanline( y ); Scanline pAScan = pAlphaWriteAccess->GetScanline( y ); @@ -262,7 +262,7 @@ namespace vclcanvas } break; - case BMP_FORMAT_24BIT_TC_BGR: + case ScanlineFormat::N24BitTcBgr: { Scanline pScan = pWriteAccess->GetScanline( y ); Scanline pAScan = pAlphaWriteAccess->GetScanline( y ); @@ -284,7 +284,7 @@ namespace vclcanvas } break; - case BMP_FORMAT_24BIT_TC_RGB: + case ScanlineFormat::N24BitTcRgb: { Scanline pScan = pWriteAccess->GetScanline( y ); Scanline pAScan = pAlphaWriteAccess->GetScanline( y ); @@ -333,7 +333,7 @@ namespace vclcanvas // canvashelper.cxx, unify! switch( pWriteAccess->GetScanlineFormat() ) { - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N8BitPal: { Scanline pScan = pWriteAccess->GetScanline( y ); @@ -351,7 +351,7 @@ namespace vclcanvas } break; - case BMP_FORMAT_24BIT_TC_BGR: + case ScanlineFormat::N24BitTcBgr: { Scanline pScan = pWriteAccess->GetScanline( y ); @@ -368,7 +368,7 @@ namespace vclcanvas } break; - case BMP_FORMAT_24BIT_TC_RGB: + case ScanlineFormat::N24BitTcRgb: { Scanline pScan = pWriteAccess->GetScanline( y ); diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index 9596172fdf79..0dc936043476 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -1049,7 +1049,7 @@ namespace vclcanvas { switch( pWriteAccess->GetScanlineFormat() ) { - case BMP_FORMAT_8BIT_PAL: + case ScanlineFormat::N8BitPal: { Scanline pScan = pWriteAccess->GetScanline( y ); @@ -1065,7 +1065,7 @@ namespace vclcanvas } break; - case BMP_FORMAT_24BIT_TC_BGR: + case ScanlineFormat::N24BitTcBgr: { Scanline pScan = pWriteAccess->GetScanline( y ); @@ -1080,7 +1080,7 @@ namespace vclcanvas } break; - case BMP_FORMAT_24BIT_TC_RGB: + case ScanlineFormat::N24BitTcRgb: { Scanline pScan = pWriteAccess->GetScanline( y ); |