summaryrefslogtreecommitdiff
path: root/vcl/source/bitmap/bitmap.cxx
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2018-04-22 22:33:40 +1000
committerTomaž Vajngerl <quikee@gmail.com>2018-05-13 08:28:43 +0200
commit1f6af5c409105562edf2a034f4841c1aeb5a38b5 (patch)
tree28b62c6b4807bf135c0a066d8ee85412548366e4 /vcl/source/bitmap/bitmap.cxx
parent48cf194a1bdd7625c58edd201a7d5191fcd0f934 (diff)
vcl: move Bitmap::MakeMonochrome() to BitmapMonochromeFilter
Change-Id: Iefe5be4349475a4aa0138534cf6bfe87ff7df245 Reviewed-on: https://gerrit.libreoffice.org/53280 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/source/bitmap/bitmap.cxx')
-rw-r--r--vcl/source/bitmap/bitmap.cxx76
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;