diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2016-06-05 18:58:58 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-10-05 12:06:13 +0200 |
commit | 1fefdd6f3b4165491af433a815e6c82aa5ac8204 (patch) | |
tree | 60e809adaf2f6ec1c5204a385b8ef397184686c2 /vcl/source/bitmap/BitmapTools.cxx | |
parent | 2ddc6186930b8538ced47df8bff4b79b9f65efb4 (diff) |
Alpha channel in BitmapColor - change bIndex to alpha
We want to store the alpha channel in BitmapColor. To achieve this
we can repurpose bIndex attribute for alpha. Generally we don't
need bIndex at all as we can infer if we use index colors or not
from the context (using palette or not)
Change-Id: I18fe748beeca59e2869368a1c3c2ee9d2062b41e
Reviewed-on: https://gerrit.libreoffice.org/61057
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/source/bitmap/BitmapTools.cxx')
-rw-r--r-- | vcl/source/bitmap/BitmapTools.cxx | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx index aaa678b888dd..13a133295b06 100644 --- a/vcl/source/bitmap/BitmapTools.cxx +++ b/vcl/source/bitmap/BitmapTools.cxx @@ -652,18 +652,7 @@ css::uno::Sequence< sal_Int8 > GetMaskDIB(BitmapEx const & aBmpEx) static sal_uInt8 lcl_GetColor(BitmapColor const& rColor) { - sal_uInt8 nTemp(0); - if (rColor.IsIndex()) - { - nTemp = rColor.GetIndex(); - } - else - { - nTemp = rColor.GetBlue(); - // greyscale expected here, or what would non-grey colors mean? - assert(rColor.GetRed() == nTemp && rColor.GetGreen() == nTemp); - } - return nTemp; + return rColor.GetBlueOrIndex(); } |