diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2011-07-26 13:02:02 +0200 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2011-07-26 23:39:04 +0200 |
commit | b7442df1e96a6238425c5dc4ca2a92121fff094f (patch) | |
tree | dcb2c9d7f1dcc3c34e1bef8a5aef2854718736f8 /vcl | |
parent | bc34a22e76775799e068cfa2617152da4c608e7d (diff) |
callcatcher: clean up ImplImageBmp
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/image.h | 13 | ||||
-rw-r--r-- | vcl/source/gdi/impimage.cxx | 145 |
2 files changed, 0 insertions, 158 deletions
diff --git a/vcl/inc/image.h b/vcl/inc/image.h index 86f924993ed3..c7485dd4eb95 100644 --- a/vcl/inc/image.h +++ b/vcl/inc/image.h @@ -44,21 +44,8 @@ public: ImplImageBmp(); ~ImplImageBmp(); - void Create( long nItemWidth, long nItemHeight, sal_uInt16 nInitSize ); void Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight,sal_uInt16 nInitSize ); - - void Expand( sal_uInt16 nGrowSize ); - - void Replace( sal_uInt16 nPos, sal_uInt16 nSrcPos ); - void Replace( sal_uInt16 nPos, const ImplImageBmp& rImageBmp, sal_uInt16 nSrcPos ); - void Replace( sal_uInt16 nPos, const BitmapEx& rBmpEx ); - - void ReplaceColors( const Color* pSrcColors, const Color* pDstColors, sal_uIntPtr nColorCount ); void ColorTransform(); - void Invert(); - - BitmapEx GetBitmapEx( sal_uInt16 nPosCount, sal_uInt16* pPosAry ) const; - void Draw( sal_uInt16 nPos, OutputDevice* pDev, const Point& rPos, sal_uInt16 nStyle, const Size* pSize = NULL ); private: diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx index 2246058fb10f..4e979c815543 100644 --- a/vcl/source/gdi/impimage.cxx +++ b/vcl/source/gdi/impimage.cxx @@ -214,26 +214,6 @@ ImplImageBmp::~ImplImageBmp() // ----------------------------------------------------------------------- -void ImplImageBmp::Create( long nItemWidth, long nItemHeight, sal_uInt16 nInitSize ) -{ - const Size aTotalSize( nInitSize * nItemWidth, nItemHeight ); - - maBmpEx = Bitmap( aTotalSize, 24 ); - maDisabledBmpEx.SetEmpty(); - - delete mpDisplayBmp; - mpDisplayBmp = NULL; - - maSize = Size( nItemWidth, nItemHeight ); - mnSize = nInitSize; - - delete[] mpInfoAry; - mpInfoAry = new sal_uInt8[ mnSize ]; - memset( mpInfoAry, 0, mnSize ); -} - -// ----------------------------------------------------------------------- - void ImplImageBmp::Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight, sal_uInt16 nInitSize ) { maBmpEx = rBmpEx; @@ -254,131 +234,6 @@ void ImplImageBmp::Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHe // ----------------------------------------------------------------------- -void ImplImageBmp::Expand( sal_uInt16 nGrowSize ) -{ - const sal_uLong nDX = nGrowSize * maSize.Width(); - const sal_uInt16 nOldSize = mnSize; - sal_uInt8* pNewAry = new sal_uInt8[ mnSize = sal::static_int_cast<sal_uInt16>(mnSize+nGrowSize) ]; - - maBmpEx.Expand( nDX, 0UL ); - - if( !maDisabledBmpEx.IsEmpty() ) - maDisabledBmpEx.Expand( nDX, 0UL ); - - delete mpDisplayBmp; - mpDisplayBmp = NULL; - - memset( pNewAry, 0, mnSize ); - memcpy( pNewAry, mpInfoAry, nOldSize ); - delete[] mpInfoAry; - mpInfoAry = pNewAry; -} - -// ----------------------------------------------------------------------- - -void ImplImageBmp::Invert() -{ - delete mpDisplayBmp; - mpDisplayBmp = NULL; - - maBmpEx.Invert(); -} - -// ----------------------------------------------------------------------- - -void ImplImageBmp::Replace( sal_uInt16 nPos, sal_uInt16 nSrcPos ) -{ - const Point aSrcPos( nSrcPos * maSize.Width(), 0L ), aPos( nPos * maSize.Width(), 0L ); - const Rectangle aSrcRect( aSrcPos, maSize ); - const Rectangle aDstRect( aPos, maSize ); - - maBmpEx.CopyPixel( aDstRect, aSrcRect ); - - if( !maDisabledBmpEx.IsEmpty() ) - maDisabledBmpEx.CopyPixel( aDstRect, aSrcRect ); - - delete mpDisplayBmp; - mpDisplayBmp = NULL; - - mpInfoAry[ nPos ] = mpInfoAry[ nSrcPos ]; -} - -// ----------------------------------------------------------------------- - -void ImplImageBmp::Replace( sal_uInt16 nPos, const ImplImageBmp& rImageBmp, sal_uInt16 nSrcPos ) -{ - const Point aSrcPos( nSrcPos * maSize.Width(), 0L ), aPos( nPos * maSize.Width(), 0L ); - const Rectangle aSrcRect( aSrcPos, maSize ); - const Rectangle aDstRect( aPos, maSize ); - - maBmpEx.CopyPixel( aDstRect, aSrcRect, &rImageBmp.maBmpEx ); - - ImplUpdateDisabledBmpEx( nPos ); - delete mpDisplayBmp; - mpDisplayBmp = NULL; - - mpInfoAry[ nPos ] = rImageBmp.mpInfoAry[ nSrcPos ]; -} - -// ----------------------------------------------------------------------- - -void ImplImageBmp::Replace( sal_uInt16 nPos, const BitmapEx& rBmpEx ) -{ - const Point aNullPos, aPos( nPos * maSize.Width(), 0L ); - const Rectangle aSrcRect( aNullPos, maSize ); - const Rectangle aDstRect( aPos, maSize ); - - maBmpEx.CopyPixel( aDstRect, aSrcRect, &rBmpEx ); - - ImplUpdateDisabledBmpEx( nPos ); - delete mpDisplayBmp; - mpDisplayBmp = NULL; - - mpInfoAry[ nPos ] &= ~( IMPSYSIMAGEITEM_MASK | IMPSYSIMAGEITEM_ALPHA ); - mpInfoAry[ nPos ] |= ( rBmpEx.IsAlpha() ? IMPSYSIMAGEITEM_ALPHA : ( rBmpEx.IsTransparent() ? IMPSYSIMAGEITEM_MASK : 0 ) ); -} - -// ----------------------------------------------------------------------- - -void ImplImageBmp::ReplaceColors( const Color* pSrcColors, const Color* pDstColors, sal_uLong nColorCount ) -{ - maBmpEx.Replace( pSrcColors, pDstColors, nColorCount ); - delete mpDisplayBmp; - mpDisplayBmp = NULL; -} - -// ----------------------------------------------------------------------- - -BitmapEx ImplImageBmp::GetBitmapEx( sal_uInt16 nPosCount, sal_uInt16* pPosAry ) const -{ - const Bitmap aNewBmp( Size( nPosCount * maSize.Width(), maSize.Height() ), maBmpEx.GetBitmap().GetBitCount() ); - BitmapEx aRet; - if( maBmpEx.IsAlpha() ) - { - // initialize target bitmap with an empty alpha mask - // which allows for using an optimized copypixel later on (see AlphaMask::CopyPixel) - // that avoids palette lookups - AlphaMask aAlpha( Size( nPosCount * maSize.Width(), maSize.Height() ) ); - aRet = BitmapEx( aNewBmp, aAlpha ); - } - else - aRet = BitmapEx( aNewBmp ); - - for( sal_uInt16 i = 0; i < nPosCount; i++ ) - { - const Point aSrcPos( pPosAry[ i ] * maSize.Width(), 0L ); - const Point aPos( i * maSize.Width(), 0L ); - const Rectangle aSrcRect( aSrcPos, maSize ); - const Rectangle aDstRect( aPos, maSize ); - - aRet.CopyPixel( aDstRect, aSrcRect, &maBmpEx ); - } - - return aRet; -} - -// ----------------------------------------------------------------------- - void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev, const Point& rPos, sal_uInt16 nStyle, const Size* pSize ) |