diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-07 16:28:27 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-27 08:20:43 +0000 |
commit | 644487a1152c7586a7f20c7f372572a71d8494d5 (patch) | |
tree | 683cdbd755ec1660e75f930e5be4cd6867e3e734 /vcl/source/gdi/bmpacc.cxx | |
parent | 1b4dff2c371d31c99f34324c3f6f31888bdc34d7 (diff) |
loplugin:unusedmethods
Change-Id: I161cd52606c11b6008f5d8b1d8ee391692f91861
Reviewed-on: https://gerrit.libreoffice.org/19231
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source/gdi/bmpacc.cxx')
-rw-r--r-- | vcl/source/gdi/bmpacc.cxx | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx index 9917203f565a..87bc60f1be46 100644 --- a/vcl/source/gdi/bmpacc.cxx +++ b/vcl/source/gdi/bmpacc.cxx @@ -286,114 +286,6 @@ bool BitmapReadAccess::ImplSetAccessPointers( sal_uLong nFormat ) return bRet; } -void BitmapReadAccess::ImplZeroInitUnusedBits() -{ - const sal_uInt32 nWidth = Width(), nHeight = Height(), nScanSize = GetScanlineSize(); - - if( nWidth && nHeight && nScanSize && GetBuffer() ) - { - sal_uInt32 nBits; - bool bMsb; - - const sal_uLong nScanlineFormat = GetScanlineFormat(); - switch( nScanlineFormat ) - { - case( BMP_FORMAT_1BIT_MSB_PAL ): - nBits = 1; - bMsb = true; - break; - - case( BMP_FORMAT_1BIT_LSB_PAL ): - nBits = 1; - bMsb = false; - break; - - case( BMP_FORMAT_4BIT_MSN_PAL ): - nBits = 4; - bMsb = true; - break; - - case( BMP_FORMAT_4BIT_LSN_PAL ): - nBits = 4; - bMsb = false; - break; - - case( BMP_FORMAT_8BIT_PAL ): - case( BMP_FORMAT_8BIT_TC_MASK ): - bMsb = true; - nBits = 8; - break; - - case( BMP_FORMAT_16BIT_TC_MSB_MASK ): - case( BMP_FORMAT_16BIT_TC_LSB_MASK ): - bMsb = true; - nBits = 16; - break; - - case( BMP_FORMAT_24BIT_TC_BGR ): - case( BMP_FORMAT_24BIT_TC_RGB ): - case( BMP_FORMAT_24BIT_TC_MASK ): - bMsb = true; - nBits = 24; - break; - - case( BMP_FORMAT_32BIT_TC_ABGR ): - case( BMP_FORMAT_32BIT_TC_ARGB ): - case( BMP_FORMAT_32BIT_TC_BGRA ): - case( BMP_FORMAT_32BIT_TC_RGBA ): - case( BMP_FORMAT_32BIT_TC_MASK ): - bMsb = true; - nBits = 32; - break; - - default: - { - OSL_FAIL( "BitmapWriteAccess::ZeroInitUnusedBits: Unsupported pixel format"); - nBits = 0; - bMsb = true; - } - break; - } - - nBits *= nWidth; - if( nScanSize % 4 || !bMsb ) - { - DBG_ASSERT( 8*nScanSize >= nBits, - "BitmapWriteAccess::ZeroInitUnusedBits: span size smaller than width?!"); - const sal_uInt32 nLeftOverBits = 8*sizeof(sal_uInt8)*nScanSize - nBits; - if( nLeftOverBits != 0 ) // else there is really nothing to do - { - const sal_uInt32 nBytes = (nLeftOverBits + 7U) >> 3U; - sal_uInt8 nMask; - - if( bMsb ) - nMask = static_cast<sal_uInt8>(0xffU << (nLeftOverBits & 3UL)); - else - nMask = static_cast<sal_uInt8>(0xffU >> (nLeftOverBits & 3UL)); - - sal_uInt8* pLastBytes = reinterpret_cast<sal_uInt8*>(GetBuffer()) + ( nScanSize - nBytes ); - for( sal_uInt32 i = 0; i < nHeight; i++, pLastBytes += nScanSize ) - { - *pLastBytes &= nMask; - for( sal_uInt32 j = 1; j < nBytes; j++ ) - pLastBytes[j] = 0; - } - } - } - else if( nBits & 0x1f ) - { - sal_uInt32 nMask = 0xffffffff << ( ( nScanSize << 3 ) - nBits ); - sal_uInt8* pLast4Bytes = reinterpret_cast<sal_uInt8*>(GetBuffer()) + ( nScanSize - 4 ); - -#ifdef OSL_LITENDIAN - nMask = OSL_SWAPDWORD( nMask ); -#endif - for( sal_uInt32 i = 0; i < nHeight; i++, pLast4Bytes += nScanSize ) - *reinterpret_cast<sal_uInt32*>(pLast4Bytes) &= nMask; - } - } -} - BitmapColor BitmapReadAccess::GetInterpolatedColorWithFallback( double fY, double fX, const BitmapColor& rFallback ) const { // ask directly doubles >= 0.0 here to avoid rounded values of 0 at small negative |