diff options
Diffstat (limited to 'vcl/source/bitmap/bitmap.cxx')
-rw-r--r-- | vcl/source/bitmap/bitmap.cxx | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx index b273bbfca983..23477b6e60ab 100644 --- a/vcl/source/bitmap/bitmap.cxx +++ b/vcl/source/bitmap/bitmap.cxx @@ -850,82 +850,6 @@ Bitmap Bitmap::CreateDisplayBitmap( OutputDevice* pDisplay ) return aDispBmp; } -bool Bitmap::MakeMonochrome(sal_uInt8 cThreshold) -{ - ScopedReadAccess pReadAcc(*this); - bool bRet = false; - - if( pReadAcc ) - { - Bitmap aNewBmp( GetSizePixel(), 1 ); - BitmapScopedWriteAccess pWriteAcc(aNewBmp); - - if( pWriteAcc ) - { - const BitmapColor aBlack( pWriteAcc->GetBestMatchingColor( COL_BLACK ) ); - const BitmapColor aWhite( pWriteAcc->GetBestMatchingColor( COL_WHITE ) ); - const long nWidth = pWriteAcc->Width(); - const long nHeight = pWriteAcc->Height(); - - if( pReadAcc->HasPalette() ) - { - for( long nY = 0; nY < nHeight; nY++ ) - { - Scanline pScanline = pWriteAcc->GetScanline(nY); - Scanline pScanlineRead = pReadAcc->GetScanline(nY); - for( long nX = 0; nX < nWidth; nX++ ) - { - const sal_uInt8 cIndex = pReadAcc->GetIndexFromData( pScanlineRead, nX ); - if( pReadAcc->GetPaletteColor( cIndex ).GetLuminance() >= - cThreshold ) - { - pWriteAcc->SetPixelOnData( pScanline, nX, aWhite ); - } - else - pWriteAcc->SetPixelOnData( pScanline, nX, aBlack ); - } - } - } - else - { - for( long nY = 0; nY < nHeight; nY++ ) - { - Scanline pScanline = pWriteAcc->GetScanline(nY); - Scanline pScanlineRead = pReadAcc->GetScanline(nY); - for( long nX = 0; nX < nWidth; nX++ ) - { - if( pReadAcc->GetPixelFromData( pScanlineRead, nX ).GetLuminance() >= - cThreshold ) - { - pWriteAcc->SetPixelOnData( pScanline, nX, aWhite ); - } - else - pWriteAcc->SetPixelOnData( pScanline, nX, aBlack ); - } - } - } - - pWriteAcc.reset(); - bRet = true; - } - - pReadAcc.reset(); - - if( bRet ) - { - const MapMode aMap( maPrefMapMode ); - const Size aSize( maPrefSize ); - - *this = aNewBmp; - - maPrefMapMode = aMap; - maPrefSize = aSize; - } - } - - return bRet; -} - bool Bitmap::GetSystemData( BitmapSystemData& rData ) const { bool bRet = false; |