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
This commit is contained in:
parent
2eff3574d5
commit
e756452c40
@ -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<pixel_type,
|
||||
Color,
|
||||
BaseValue,
|
||||
RedMask,
|
||||
GreenMask,
|
||||
BlueMask,
|
||||
@ -256,6 +260,7 @@ template< typename PixelType,
|
||||
// 16bpp MSB RGB
|
||||
typedef PixelFormatTraitsTemplate_RGBMask<
|
||||
sal_uInt16,
|
||||
0,
|
||||
0xF800,
|
||||
0x07E0,
|
||||
0x001F,
|
||||
@ -266,6 +271,7 @@ BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_RGB16_565_MSB::getter_type,
|
||||
// 16bpp LSB RGB
|
||||
typedef PixelFormatTraitsTemplate_RGBMask<
|
||||
sal_uInt16,
|
||||
0,
|
||||
0xF800,
|
||||
0x07E0,
|
||||
0x001F,
|
||||
@ -286,6 +292,7 @@ BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_RGB16_565_LSB::getter_type,
|
||||
|
||||
typedef PixelFormatTraitsTemplate_RGBMask<
|
||||
sal_uInt32,
|
||||
0xFF000000,
|
||||
0x00FF0000,
|
||||
0x0000FF00,
|
||||
0x000000FF,
|
||||
@ -297,6 +304,7 @@ BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_BGRX32_8888::getter_type,
|
||||
|
||||
typedef PixelFormatTraitsTemplate_RGBMask<
|
||||
sal_uInt32,
|
||||
0xFF000000,
|
||||
0x00FF0000,
|
||||
0x0000FF00,
|
||||
0x000000FF,
|
||||
@ -308,6 +316,7 @@ BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_XRGB32_8888::getter_type,
|
||||
|
||||
typedef PixelFormatTraitsTemplate_RGBMask<
|
||||
sal_uInt32,
|
||||
0x000000FF,
|
||||
0xFF000000,
|
||||
0x00FF0000,
|
||||
0x0000FF00,
|
||||
@ -317,6 +326,7 @@ BASEBMP_SPECIALIZE_ACCESSORTRAITS(PixelFormatTraits_XBGR32_8888::getter_type,
|
||||
|
||||
typedef PixelFormatTraitsTemplate_RGBMask<
|
||||
sal_uInt32,
|
||||
0x000000FF,
|
||||
0xFF000000,
|
||||
0x00FF0000,
|
||||
0x0000FF00,
|
||||
|
Loading…
x
Reference in New Issue
Block a user