svtools/source/graphic/transformer.cxx | 2 +- vcl/source/gdi/bitmap4.cxx | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-)
New commits: commit e06014e0db64ec36ec41dee542d2453c945fddd3 Author: Tor Lillqvist <[email protected]> Date: Tue Aug 26 16:29:46 2014 +0300 bnc#719994: We need the proper alpha mask Change-Id: Ic16dceaca431929238fcef6be31ee95e068b91e4 diff --git a/svtools/source/graphic/transformer.cxx b/svtools/source/graphic/transformer.cxx index 945d78b..06c2595 100644 --- a/svtools/source/graphic/transformer.cxx +++ b/svtools/source/graphic/transformer.cxx @@ -147,7 +147,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL GraphicTransformer::applyDuotone( ::Graphic aGraphic( *::unographic::Graphic::getImplementation( xIFace ) ); BitmapEx aBitmapEx( aGraphic.GetBitmapEx() ); - Bitmap aMask( aBitmapEx.GetMask() ); + AlphaMask aMask( aBitmapEx.GetAlpha() ); Bitmap aBitmap( aBitmapEx.GetBitmap() ); BmpFilterParam aFilter( (sal_uLong) nColorOne, (sal_uLong) nColorTwo ); aBitmap.Filter( BMP_FILTER_DUOTONE, &aFilter ); commit c03f7f2b427f7fe2b94dfb55ea64670426d1a957 Author: Tor Lillqvist <[email protected]> Date: Tue Aug 26 16:24:31 2014 +0300 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 diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx index 8ebf477..594247c 100644 --- a/vcl/source/gdi/bitmap4.cxx +++ b/vcl/source/gdi/bitmap4.cxx @@ -1190,10 +1190,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 ); } } _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
