[Libreoffice-commits] core.git: vcl/source
Caolán McNamara
caolanm at redhat.com
Thu May 10 13:45:42 UTC 2018
vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit 23a32cf68d624857fbe21a6c2634c50a2977b6b7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu May 10 12:30:05 2018 +0100
assert in vectorization dialog with wrong pixel type
regression from...
commit 900b1109a94c1d72c17ab429da1b6c6c2bf79ac6
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Tue Apr 17 22:06:20 2018 +1000
vcl: move Bitmap{Ex}::ReduceColors() to BitmapColorQuantizationFilter class
Change-Id: I32b58e8d451e7303e94788a546a5b5f9a5bb4590
Reviewed-on: https://gerrit.libreoffice.org/53037
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
where inexplicably the nBitCount related lines weren't moved
Change-Id: Ieca91d5c7c1b8a045d1019cf1b43218f8a2db508
Reviewed-on: https://gerrit.libreoffice.org/54078
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx b/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx
index 437d01137f0a..5436a227770e 100644
--- a/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx
+++ b/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx
@@ -35,6 +35,13 @@ BitmapEx BitmapSimpleColorQuantizationFilter::execute(BitmapEx const& aBitmapEx)
const sal_uInt16 nColorCount = std::min(mnNewColorCount, sal_uInt16(256));
sal_uInt16 nBitCount = 0;
+ if (nColorCount <= 2)
+ nBitCount = 1;
+ else if (nColorCount <= 16)
+ nBitCount = 4;
+ else
+ nBitCount = 8;
+
if (pRAcc)
{
Octree aOct(*pRAcc, nColorCount);
More information about the Libreoffice-commits
mailing list