summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-08-26 16:24:31 +0300
committerAndras Timar <andras.timar@collabora.com>2014-09-15 17:07:44 +0200
commitc82f43f207ffb902f293389d346ec0ab83dd1dfc (patch)
tree22143ae943a9772f980616e66e52f5d88c8c5f77 /vcl
parent905eefcdf0c96496089925795de6ce40611b2853 (diff)
bnc#719994: Fix the duotone filter to actually produce duotone
Not sure what it tried to do earlier, but it was obviously wrong. Change-Id: I0b377c4baa88205a9a7ad7c134ec5bc2223e6205 (cherry picked from commit c03f7f2b427f7fe2b94dfb55ea64670426d1a957) Reviewed-on: https://gerrit.libreoffice.org/11127 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/bitmap4.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx
index dbda9e68d4e8..04ca76da5ba9 100644
--- a/vcl/source/gdi/bitmap4.cxx
+++ b/vcl/source/gdi/bitmap4.cxx
@@ -1192,10 +1192,11 @@ bool Bitmap::ImplDuotoneFilter( const sal_uLong nColorOne, const sal_uLong nColo
for( int y = 0; y < nHeight; y++ )
{
BitmapColor aColor = pReadAcc->GetColor( y, x );
+ sal_uInt8 luminance = aColor.GetLuminance();
BitmapColor aResultColor(
- lcl_getDuotoneColorComponent( aColor.GetRed(), aColorOne.GetRed(), aColorTwo.GetRed() ) ,
- lcl_getDuotoneColorComponent( aColor.GetGreen(), aColorOne.GetGreen(), aColorTwo.GetGreen() ) ,
- lcl_getDuotoneColorComponent( aColor.GetBlue(), aColorOne.GetBlue(), aColorTwo.GetBlue() ) );
+ lcl_getDuotoneColorComponent( luminance, aColorOne.GetRed(), aColorTwo.GetRed() ) ,
+ lcl_getDuotoneColorComponent( luminance, aColorOne.GetGreen(), aColorTwo.GetGreen() ) ,
+ lcl_getDuotoneColorComponent( luminance, aColorOne.GetBlue(), aColorTwo.GetBlue() ) );
pWriteAcc->SetPixel( y, x, aResultColor );
}
}