diff options
Diffstat (limited to 'vcl/source/gdi/bitmapex.cxx')
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 12cb2958b43c..43589e3813f7 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,25 +50,25 @@ BitmapEx::BitmapEx() : eTransparent( TRANSPARENT_NONE ), - bAlpha ( FALSE ) + bAlpha ( FALSE ) { } // ------------------------------------------------------------------ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx ) : - aBitmap ( rBitmapEx.aBitmap ), - aMask ( rBitmapEx.aMask ), - aBitmapSize ( rBitmapEx.aBitmapSize ), - aTransparentColor ( rBitmapEx.aTransparentColor ), - eTransparent ( rBitmapEx.eTransparent ), - bAlpha ( rBitmapEx.bAlpha ) + aBitmap ( rBitmapEx.aBitmap ), + aMask ( rBitmapEx.aMask ), + aBitmapSize ( rBitmapEx.aBitmapSize ), + aTransparentColor ( rBitmapEx.aTransparentColor ), + eTransparent ( rBitmapEx.eTransparent ), + bAlpha ( rBitmapEx.bAlpha ) { } BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) : eTransparent( TRANSPARENT_NONE ), - bAlpha ( FALSE ) + bAlpha ( FALSE ) { if( rBitmapEx.IsEmpty() ) return; @@ -82,7 +82,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) : } else if( rBitmapEx.IsTransparent() ) aMask = Bitmap( aSize, rBitmapEx.aMask.GetBitCount() ); - + Rectangle aDestRect( Point( 0, 0 ), aSize ); Rectangle aSrcRect( aSrc, aSize ); CopyPixel( aDestRect, aSrcRect, &rBitmapEx ); @@ -92,21 +92,21 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) : BitmapEx::BitmapEx( const ResId& rResId ) : eTransparent( TRANSPARENT_NONE ), - bAlpha ( FALSE ) + bAlpha ( FALSE ) { - static ImplImageTreeSingletonRef aImageTree; - ResMgr* pResMgr = NULL; + static ImplImageTreeSingletonRef aImageTree; + ResMgr* pResMgr = NULL; ResMgr::GetResourceSkipHeader( rResId.SetRT( RSC_BITMAP ), &pResMgr ); pResMgr->ReadLong(); pResMgr->ReadLong(); - + const String aFileName( pResMgr->ReadString() ); ::rtl::OUString aCurrentSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName(); - + if( !aImageTree->loadImage( aFileName, aCurrentSymbolsStyle, *this ) ) { -#ifdef DBG_UTIL +#ifdef DBG_UTIL ByteString aErrorStr( "BitmapEx::BitmapEx( const ResId& rResId ): could not load image <" ); DBG_ERROR( ( ( aErrorStr += ByteString( aFileName, RTL_TEXTENCODING_ASCII_US ) ) += '>' ).GetBuffer() ); #endif @@ -116,21 +116,21 @@ BitmapEx::BitmapEx( const ResId& rResId ) : // ------------------------------------------------------------------ BitmapEx::BitmapEx( const Bitmap& rBmp ) : - aBitmap ( rBmp ), - aBitmapSize ( aBitmap.GetSizePixel() ), + aBitmap ( rBmp ), + aBitmapSize ( aBitmap.GetSizePixel() ), eTransparent( TRANSPARENT_NONE ), - bAlpha ( FALSE ) + bAlpha ( FALSE ) { } // ------------------------------------------------------------------ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) : - aBitmap ( rBmp ), - aMask ( rMask ), - aBitmapSize ( aBitmap.GetSizePixel() ), - eTransparent ( !rMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ), - bAlpha ( FALSE ) + aBitmap ( rBmp ), + aMask ( rMask ), + aBitmapSize ( aBitmap.GetSizePixel() ), + eTransparent ( !rMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ), + bAlpha ( FALSE ) { DBG_ASSERT( !rMask || rBmp.GetSizePixel() == rMask.GetSizePixel(), "BitmapEx::BitmapEx(): size mismatch for bitmap and mask." ); @@ -146,18 +146,18 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) : // ------------------------------------------------------------------ BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) : - aBitmap ( rBmp ), - aMask ( rAlphaMask.ImplGetBitmap() ), - aBitmapSize ( aBitmap.GetSizePixel() ), - eTransparent ( !rAlphaMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ), - bAlpha ( !rAlphaMask ? FALSE : TRUE ) + aBitmap ( rBmp ), + aMask ( rAlphaMask.ImplGetBitmap() ), + aBitmapSize ( aBitmap.GetSizePixel() ), + eTransparent ( !rAlphaMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ), + bAlpha ( !rAlphaMask ? FALSE : TRUE ) { DBG_ASSERT( !rAlphaMask || rBmp.GetSizePixel() == rAlphaMask.GetSizePixel(), "BitmapEx::BitmapEx(): size mismatch for bitmap and alpha mask." ); // #i75531# the workaround below can go when // X11SalGraphics::drawAlphaBitmap()'s render acceleration - // can handle the bitmap depth mismatch directly + // can handle the bitmap depth mismatch directly if( aBitmap.GetBitCount() < aMask.GetBitCount() ) aBitmap.Convert( BMP_CONVERSION_24BIT ); } @@ -165,11 +165,11 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) : // ------------------------------------------------------------------ BitmapEx::BitmapEx( const Bitmap& rBmp, const Color& rTransparentColor ) : - aBitmap ( rBmp ), - aBitmapSize ( aBitmap.GetSizePixel() ), - aTransparentColor ( rTransparentColor ), - eTransparent ( TRANSPARENT_BITMAP ), - bAlpha ( FALSE ) + aBitmap ( rBmp ), + aBitmapSize ( aBitmap.GetSizePixel() ), + aTransparentColor ( rTransparentColor ), + eTransparent ( TRANSPARENT_BITMAP ), + bAlpha ( FALSE ) { aMask = aBitmap.CreateMask( aTransparentColor ); @@ -301,7 +301,7 @@ Bitmap BitmapEx::GetBitmap( const Color* pTransReplaceColor ) const BitmapEx BitmapEx::GetColorTransformedBitmapEx( BmpColorMode eColorMode ) const { BitmapEx aRet; - + if( BMP_COLOR_HIGHCONTRAST == eColorMode ) { aRet = *this; @@ -312,7 +312,7 @@ BitmapEx BitmapEx::GetColorTransformedBitmapEx( BmpColorMode eColorMode ) const { aRet = *this; aRet.aBitmap = aRet.aBitmap.GetColorTransformedBitmap( eColorMode ); - + if( !aRet.aMask.IsEmpty() ) { aRet.aMask.CombineSimple( aRet.aBitmap, BMP_COMBINE_OR ); @@ -368,8 +368,8 @@ ULONG BitmapEx::GetSizeBytes() const ULONG BitmapEx::GetChecksum() const { - sal_uInt32 nCrc = aBitmap.GetChecksum(); - SVBT32 aBT32; + sal_uInt32 nCrc = aBitmap.GetChecksum(); + SVBT32 aBT32; UInt32ToSVBT32( (long) eTransparent, aBT32 ); nCrc = rtl_crc32( nCrc, aBT32, 4 ); @@ -615,8 +615,8 @@ BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc, } else { - sal_uInt8 cBlack = 0; - AlphaMask* pAlpha = new AlphaMask( GetSizePixel(), &cBlack ); + sal_uInt8 cBlack = 0; + AlphaMask* pAlpha = new AlphaMask( GetSizePixel(), &cBlack ); aMask = pAlpha->ImplGetBitmap(); delete pAlpha; @@ -644,7 +644,7 @@ BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc, } else if( IsAlpha() ) { - sal_uInt8 cBlack = 0; + sal_uInt8 cBlack = 0; const AlphaMask aAlphaSrc( pBmpExSrc->GetSizePixel(), &cBlack ); aMask.CopyPixel( rRectDst, rRectSrc, &aAlphaSrc.ImplGetBitmap() ); @@ -911,8 +911,8 @@ SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx ) if( !rIStm.GetError() ) { const ULONG nStmPos = rIStm.Tell(); - UINT32 nMagic1 = 0; - UINT32 nMagic2 = 0; + UINT32 nMagic1 = 0; + UINT32 nMagic2 = 0; rIStm >> nMagic1 >> nMagic2; |