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/unx/generic | |
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/unx/generic')
-rw-r--r-- | vcl/unx/generic/print/genpspgraphics.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx index f74ecffdb990..88e7fcdf901a 100644 --- a/vcl/unx/generic/print/genpspgraphics.cxx +++ b/vcl/unx/generic/print/genpspgraphics.cxx @@ -192,7 +192,7 @@ SalPrinterBmp::GetPixelRGB (sal_uInt32 nRow, sal_uInt32 nColumn) const Scanline pScan = mpScanAccess + nRow * mnScanOffset; BitmapColor aColor = mpFncGetPixel (pScan, nColumn, mpBmpBuffer->maColorMask); - if (aColor.IsIndex()) + if (!!mpBmpBuffer->maPalette) GetPaletteColor(aColor.GetIndex()); return ((aColor.GetBlue()) & 0x000000ff) @@ -206,7 +206,7 @@ SalPrinterBmp::GetPixelGray (sal_uInt32 nRow, sal_uInt32 nColumn) const Scanline pScan = mpScanAccess + nRow * mnScanOffset; BitmapColor aColor = mpFncGetPixel (pScan, nColumn, mpBmpBuffer->maColorMask); - if (aColor.IsIndex()) + if (!!mpBmpBuffer->maPalette) aColor = mpBmpBuffer->maPalette[aColor.GetIndex()]; return ( aColor.GetBlue() * 28UL @@ -221,7 +221,7 @@ SalPrinterBmp::GetPixelIdx (sal_uInt32 nRow, sal_uInt32 nColumn) const Scanline pScan = mpScanAccess + nRow * mnScanOffset; BitmapColor aColor = mpFncGetPixel (pScan, nColumn, mpBmpBuffer->maColorMask); - if (aColor.IsIndex()) + if (!!mpBmpBuffer->maPalette) return aColor.GetIndex(); else return 0; |