diff options
author | tobrun <tobrun.van.nuland@gmail.com> | 2020-03-23 15:31:57 +0100 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2020-03-24 06:03:03 -0400 |
commit | 99dbb3eed50f1b89d23604916cee6de965e1f4cb (patch) | |
tree | 446b0177892eb871dd2083b7ecd0e246f97d96a7 | |
parent | 3f45b0a24b5b608dfa75c84308d1ab0deb6159ee (diff) | |
download | qtlocation-mapboxgl-99dbb3eed50f1b89d23604916cee6de965e1f4cb.tar.gz |
[android] - use RGB values instead of alpha values for local glyph generation
-rw-r--r-- | platform/android/src/text/local_glyph_rasterizer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/android/src/text/local_glyph_rasterizer.cpp b/platform/android/src/text/local_glyph_rasterizer.cpp index 0627eb109e..c65c3ae439 100644 --- a/platform/android/src/text/local_glyph_rasterizer.cpp +++ b/platform/android/src/text/local_glyph_rasterizer.cpp @@ -120,7 +120,9 @@ Glyph LocalGlyphRasterizer::rasterizeGlyph(const FontStack& fontStack, GlyphID g // Copy alpha values from RGBA bitmap into the AlphaImage output fixedMetrics.bitmap = AlphaImage(size); for (uint32_t i = 0; i < size.width * size.height; i++) { - fixedMetrics.bitmap.data[i] = rgbaBitmap.data[4 * i + 3]; + fixedMetrics.bitmap.data[i] = + 0xff - round(0.2126 * rgbaBitmap.data[4 * i] + 0.7152 * rgbaBitmap.data[4 * i + 1] + + 0.0722 * rgbaBitmap.data[4 * i + 2]); } return fixedMetrics; |