From e756452c40b39fc0fc7ea15b446b88c6c8736c90 Mon Sep 17 00:00:00 2001 From: Andrzej Hunt Date: Tue, 10 Jun 2014 17:15:49 +0100 Subject: [PATCH] Add base value to set alpha channel for 32 bit colourspaces. Currently the alpha channel is completely ignored by basebmp. However this results in completely "transparent" output, meaning the client has to manually overwrite the alpha channel -- instead we now set it automatically when writing colourdata. Unfortunately this doesn't quite work -- it seems that drawing a non-opaque bitmap/image on top of the existing bitmap can erase the alpha channel information (i.e. these areas will once again be transparent -- for example document borders seem to have a transition effect overlayed onto them): presumably there is some method that bypasses our RGBMaskSetter (probably some form of direct manipulation of raw values?). manipulation in basebmp Change-Id: Ia4be6a748cc30191a4422121f9ec347d9198b225 --- include/basebmp/rgbmaskpixelformats.hxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/basebmp/rgbmaskpixelformats.hxx b/include/basebmp/rgbmaskpixelformats.hxx index d1d9b8464e49..696f35aac846 100644 --- a/include/basebmp/rgbmaskpixelformats.hxx +++ b/include/basebmp/rgbmaskpixelformats.hxx @@ -148,6 +148,7 @@ template< typename PixelType, template< typename PixelType, typename ColorType, + unsigned int BaseValue, unsigned int RedMask, unsigned int GreenMask, unsigned int BlueMask, @@ -174,6 +175,7 @@ template< typename PixelType, const typename base_type::unsigned_pixel_type blue (c.getBlue()); typename base_type::unsigned_pixel_type res( + BaseValue | (shiftLeft(red, base_type::red_shift-8* (signed)sizeof(typename base_type::component_type)+ @@ -194,6 +196,7 @@ template< typename PixelType, template< typename PixelType, + unsigned int BaseValue, unsigned int RedMask, unsigned int GreenMask, unsigned int BlueMask, @@ -209,6 +212,7 @@ template< typename PixelType, SwapBytes> getter_type; typedef RGBMaskSetter