diff options
Diffstat (limited to 'vcl/source/gdi/bitmapex.cxx')
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 5e3145a541ee..743326df04d5 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -53,7 +53,7 @@ BitmapEx::BitmapEx() : eTransparent( TRANSPARENT_NONE ), - bAlpha ( FALSE ) + bAlpha ( sal_False ) { } @@ -71,7 +71,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx ) : BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) : eTransparent( TRANSPARENT_NONE ), - bAlpha ( FALSE ) + bAlpha ( sal_False ) { if( rBitmapEx.IsEmpty() ) return; @@ -80,7 +80,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) : aBitmapSize = aSize; if( rBitmapEx.IsAlpha() ) { - bAlpha = TRUE; + bAlpha = sal_True; aMask = AlphaMask( aSize ).ImplGetBitmap(); } else if( rBitmapEx.IsTransparent() ) @@ -95,7 +95,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) : BitmapEx::BitmapEx( const ResId& rResId ) : eTransparent( TRANSPARENT_NONE ), - bAlpha ( FALSE ) + bAlpha ( sal_False ) { static ImplImageTreeSingletonRef aImageTree; ResMgr* pResMgr = NULL; @@ -122,7 +122,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp ) : aBitmap ( rBmp ), aBitmapSize ( aBitmap.GetSizePixel() ), eTransparent( TRANSPARENT_NONE ), - bAlpha ( FALSE ) + bAlpha ( sal_False ) { } @@ -133,7 +133,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) : aMask ( rMask ), aBitmapSize ( aBitmap.GetSizePixel() ), eTransparent ( !rMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ), - bAlpha ( FALSE ) + bAlpha ( sal_False ) { DBG_ASSERT( !rMask || rBmp.GetSizePixel() == rMask.GetSizePixel(), "BitmapEx::BitmapEx(): size mismatch for bitmap and mask." ); @@ -153,7 +153,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) : aMask ( rAlphaMask.ImplGetBitmap() ), aBitmapSize ( aBitmap.GetSizePixel() ), eTransparent ( !rAlphaMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ), - bAlpha ( !rAlphaMask ? FALSE : TRUE ) + bAlpha ( !rAlphaMask ? sal_False : sal_True ) { DBG_ASSERT( !rAlphaMask || rBmp.GetSizePixel() == rAlphaMask.GetSizePixel(), "BitmapEx::BitmapEx(): size mismatch for bitmap and alpha mask." ); @@ -172,7 +172,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Color& rTransparentColor ) : aBitmapSize ( aBitmap.GetSizePixel() ), aTransparentColor ( rTransparentColor ), eTransparent ( TRANSPARENT_BITMAP ), - bAlpha ( FALSE ) + bAlpha ( sal_False ) { aMask = aBitmap.CreateMask( aTransparentColor ); @@ -207,19 +207,19 @@ BitmapEx& BitmapEx::operator=( const BitmapEx& rBitmapEx ) // ------------------------------------------------------------------ -BOOL BitmapEx::operator==( const BitmapEx& rBitmapEx ) const +sal_Bool BitmapEx::operator==( const BitmapEx& rBitmapEx ) const { if( eTransparent != rBitmapEx.eTransparent ) - return FALSE; + return sal_False; if( aBitmap != rBitmapEx.aBitmap ) - return FALSE; + return sal_False; if( aBitmapSize != rBitmapEx.aBitmapSize ) - return FALSE; + return sal_False; if( eTransparent == TRANSPARENT_NONE ) - return TRUE; + return sal_True; if( eTransparent == TRANSPARENT_COLOR ) return aTransparentColor == rBitmapEx.aTransparentColor; @@ -229,7 +229,7 @@ BOOL BitmapEx::operator==( const BitmapEx& rBitmapEx ) const // ------------------------------------------------------------------ -BOOL BitmapEx::IsEqual( const BitmapEx& rBmpEx ) const +sal_Bool BitmapEx::IsEqual( const BitmapEx& rBmpEx ) const { return( rBmpEx.eTransparent == eTransparent && rBmpEx.bAlpha == bAlpha && @@ -239,7 +239,7 @@ BOOL BitmapEx::IsEqual( const BitmapEx& rBmpEx ) const // ------------------------------------------------------------------ -BOOL BitmapEx::IsEmpty() const +sal_Bool BitmapEx::IsEmpty() const { return( aBitmap.IsEmpty() && aMask.IsEmpty() ); } @@ -251,7 +251,7 @@ void BitmapEx::SetEmpty() aBitmap.SetEmpty(); aMask.SetEmpty(); eTransparent = TRANSPARENT_NONE; - bAlpha = FALSE; + bAlpha = sal_False; } // ------------------------------------------------------------------ @@ -263,14 +263,14 @@ void BitmapEx::Clear() // ------------------------------------------------------------------ -BOOL BitmapEx::IsTransparent() const +sal_Bool BitmapEx::IsTransparent() const { return( eTransparent != TRANSPARENT_NONE ); } // ------------------------------------------------------------------ -BOOL BitmapEx::IsAlpha() const +sal_Bool BitmapEx::IsAlpha() const { return( IsTransparent() && bAlpha ); } @@ -357,9 +357,9 @@ AlphaMask BitmapEx::GetAlpha() const // ------------------------------------------------------------------ -ULONG BitmapEx::GetSizeBytes() const +sal_uLong BitmapEx::GetSizeBytes() const { - ULONG nSizeBytes = aBitmap.GetSizeBytes(); + sal_uLong nSizeBytes = aBitmap.GetSizeBytes(); if( eTransparent == TRANSPARENT_BITMAP ) nSizeBytes += aMask.GetSizeBytes(); @@ -369,7 +369,7 @@ ULONG BitmapEx::GetSizeBytes() const // ------------------------------------------------------------------ -ULONG BitmapEx::GetChecksum() const +sal_uLong BitmapEx::GetChecksum() const { sal_uInt32 nCrc = aBitmap.GetChecksum(); SVBT32 aBT32; @@ -398,9 +398,9 @@ void BitmapEx::SetSizePixel( const Size& rNewSize ) // ------------------------------------------------------------------ -BOOL BitmapEx::Invert() +sal_Bool BitmapEx::Invert() { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !!aBitmap ) { @@ -415,9 +415,9 @@ BOOL BitmapEx::Invert() // ------------------------------------------------------------------ -BOOL BitmapEx::Mirror( ULONG nMirrorFlags ) +sal_Bool BitmapEx::Mirror( sal_uLong nMirrorFlags ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !!aBitmap ) { @@ -432,9 +432,9 @@ BOOL BitmapEx::Mirror( ULONG nMirrorFlags ) // ------------------------------------------------------------------ -BOOL BitmapEx::Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag ) +sal_Bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !!aBitmap ) { @@ -454,9 +454,9 @@ BOOL BitmapEx::Scale( const double& rScaleX, const double& rScaleY, ULONG nScale // ------------------------------------------------------------------------ -BOOL BitmapEx::Scale( const Size& rNewSize, ULONG nScaleFlag ) +sal_Bool BitmapEx::Scale( const Size& rNewSize, sal_uLong nScaleFlag ) { - BOOL bRet; + sal_Bool bRet; if( aBitmapSize.Width() && aBitmapSize.Height() ) { @@ -465,20 +465,20 @@ BOOL BitmapEx::Scale( const Size& rNewSize, ULONG nScaleFlag ) nScaleFlag ); } else - bRet = TRUE; + bRet = sal_True; return bRet; } // ------------------------------------------------------------------ -BOOL BitmapEx::Rotate( long nAngle10, const Color& rFillColor ) +sal_Bool BitmapEx::Rotate( long nAngle10, const Color& rFillColor ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !!aBitmap ) { - const BOOL bTransRotate = ( Color( COL_TRANSPARENT ) == rFillColor ); + const sal_Bool bTransRotate = ( Color( COL_TRANSPARENT ) == rFillColor ); if( bTransRotate ) { @@ -518,9 +518,9 @@ BOOL BitmapEx::Rotate( long nAngle10, const Color& rFillColor ) // ------------------------------------------------------------------ -BOOL BitmapEx::Crop( const Rectangle& rRectPixel ) +sal_Bool BitmapEx::Crop( const Rectangle& rRectPixel ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !!aBitmap ) { @@ -540,23 +540,23 @@ BOOL BitmapEx::Crop( const Rectangle& rRectPixel ) // ------------------------------------------------------------------ -BOOL BitmapEx::Convert( BmpConversion eConversion ) +sal_Bool BitmapEx::Convert( BmpConversion eConversion ) { - return( !!aBitmap ? aBitmap.Convert( eConversion ) : FALSE ); + return( !!aBitmap ? aBitmap.Convert( eConversion ) : sal_False ); } // ------------------------------------------------------------------ -BOOL BitmapEx::ReduceColors( USHORT nNewColorCount, BmpReduce eReduce ) +sal_Bool BitmapEx::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce ) { - return( !!aBitmap ? aBitmap.ReduceColors( nNewColorCount, eReduce ) : FALSE ); + return( !!aBitmap ? aBitmap.ReduceColors( nNewColorCount, eReduce ) : sal_False ); } // ------------------------------------------------------------------ -BOOL BitmapEx::Expand( ULONG nDX, ULONG nDY, const Color* pInitColor, BOOL bExpandTransparent ) +sal_Bool BitmapEx::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor, sal_Bool bExpandTransparent ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !!aBitmap ) { @@ -579,10 +579,10 @@ BOOL BitmapEx::Expand( ULONG nDX, ULONG nDY, const Color* pInitColor, BOOL bExpa // ------------------------------------------------------------------ -BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc, +sal_Bool BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc, const BitmapEx* pBmpExSrc ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !pBmpExSrc || pBmpExSrc->IsEmpty() ) { @@ -613,7 +613,7 @@ BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc, aMask = pAlpha->ImplGetBitmap(); delete pAlpha; - bAlpha = TRUE; + bAlpha = sal_True; aMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->aMask ); } else @@ -624,7 +624,7 @@ BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc, aMask = pAlpha->ImplGetBitmap(); delete pAlpha; eTransparent = TRANSPARENT_BITMAP; - bAlpha = TRUE; + bAlpha = sal_True; aMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->aMask ); } } @@ -668,9 +668,9 @@ BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc, // ------------------------------------------------------------------ -BOOL BitmapEx::Erase( const Color& rFillColor ) +sal_Bool BitmapEx::Erase( const Color& rFillColor ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !!aBitmap ) { @@ -697,41 +697,41 @@ BOOL BitmapEx::Erase( const Color& rFillColor ) // ------------------------------------------------------------------ -BOOL BitmapEx::Dither( ULONG nDitherFlags ) +sal_Bool BitmapEx::Dither( sal_uLong nDitherFlags ) { - return( !!aBitmap ? aBitmap.Dither( nDitherFlags ) : FALSE ); + return( !!aBitmap ? aBitmap.Dither( nDitherFlags ) : sal_False ); } // ------------------------------------------------------------------ -BOOL BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol ) +sal_Bool BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) { - return( !!aBitmap ? aBitmap.Replace( rSearchColor, rReplaceColor, nTol ) : FALSE ); + return( !!aBitmap ? aBitmap.Replace( rSearchColor, rReplaceColor, nTol ) : sal_False ); } // ------------------------------------------------------------------ -BOOL BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, ULONG nColorCount, const ULONG* pTols ) +sal_Bool BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount, const sal_uLong* pTols ) { - return( !!aBitmap ? aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, (ULONG*) pTols ) : FALSE ); + return( !!aBitmap ? aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, (sal_uLong*) pTols ) : sal_False ); } // ------------------------------------------------------------------ -BOOL BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent, +sal_Bool BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent, short nChannelRPercent, short nChannelGPercent, short nChannelBPercent, - double fGamma, BOOL bInvert ) + double fGamma, sal_Bool bInvert ) { return( !!aBitmap ? aBitmap.Adjust( nLuminancePercent, nContrastPercent, nChannelRPercent, nChannelGPercent, nChannelBPercent, - fGamma, bInvert ) : FALSE ); + fGamma, bInvert ) : sal_False ); } // ------------------------------------------------------------------ -BOOL BitmapEx::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress ) +sal_Bool BitmapEx::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress ) { - return( !!aBitmap ? aBitmap.Filter( eFilter, pFilterParam, pProgress ) : FALSE ); + return( !!aBitmap ? aBitmap.Filter( eFilter, pFilterParam, pProgress ) : sal_False ); } // ------------------------------------------------------------------ @@ -836,9 +836,9 @@ SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx ) { rBitmapEx.aBitmap.Write( rOStm ); - rOStm << (UINT32) 0x25091962; - rOStm << (UINT32) 0xACB20201; - rOStm << (BYTE) rBitmapEx.eTransparent; + rOStm << (sal_uInt32) 0x25091962; + rOStm << (sal_uInt32) 0xACB20201; + rOStm << (sal_uInt8) rBitmapEx.eTransparent; if( rBitmapEx.eTransparent == TRANSPARENT_BITMAP ) rBitmapEx.aMask.Write( rOStm ); @@ -858,9 +858,9 @@ SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx ) if( !rIStm.GetError() ) { - const ULONG nStmPos = rIStm.Tell(); - UINT32 nMagic1 = 0; - UINT32 nMagic2 = 0; + const sal_uLong nStmPos = rIStm.Tell(); + sal_uInt32 nMagic1 = 0; + sal_uInt32 nMagic2 = 0; rIStm >> nMagic1 >> nMagic2; @@ -872,11 +872,11 @@ SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx ) } else { - BYTE bTransparent = false; + sal_uInt8 bTransparent = false; rIStm >> bTransparent; - if( bTransparent == (BYTE) TRANSPARENT_BITMAP ) + if( bTransparent == (sal_uInt8) TRANSPARENT_BITMAP ) { Bitmap aMask; @@ -899,7 +899,7 @@ SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx ) else rBitmapEx = aBmp; } - else if( bTransparent == (BYTE) TRANSPARENT_COLOR ) + else if( bTransparent == (sal_uInt8) TRANSPARENT_COLOR ) { Color aTransparentColor; |