summaryrefslogtreecommitdiff
path: root/include/basebmp
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-06-10 17:15:49 +0100
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-06-25 13:04:30 +0100
commite756452c40b39fc0fc7ea15b446b88c6c8736c90 (patch)
tree33294b89d78dd51f83c74271d9a2cdf5786eadcd /include/basebmp
parent2eff3574d519d7bf5c668b8f5cd5d516b3f02d8f (diff)
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
Diffstat (limited to 'include/basebmp')
-rw-r--r--include/basebmp/rgbmaskpixelformats.hxx10
1 files changed, 10 insertions, 0 deletions
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<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,