diff options
author | Tapish Ojha <tapishojha2000@gmail.com> | 2022-01-27 08:34:48 +0100 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2022-01-27 08:43:19 +0100 |
commit | 3d77756e73c61ab37eb020a32730cda8efab79ff (patch) | |
tree | e40a423618623b92d5d774480099b5418b613c48 | |
parent | 9476cb7eb3b025c70445c85277b5bad96e434bd4 (diff) | |
download | freetype2-3d77756e73c61ab37eb020a32730cda8efab79ff.tar.gz |
[sfnt] Improve sRGB constants.
* src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use slightly
more precise values.
Fixes #1018.
-rw-r--r-- | src/base/ftbitmap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c index 8a419c221..7825895ad 100644 --- a/src/base/ftbitmap.c +++ b/src/base/ftbitmap.c @@ -480,7 +480,7 @@ * A gamma of 2.2 is fair to assume. And then, we need to * undo the premultiplication too. * - * https://accessibility.kde.org/hsl-adjusted.php + * http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html#SideNotes * * We do the computation with integers only, applying a gamma of 2.0. * We guarantee 32-bit arithmetic to avoid overflow but the resulting @@ -488,9 +488,9 @@ * */ - l = ( 4732UL /* 0.0722 * 65536 */ * bgra[0] * bgra[0] + - 46871UL /* 0.7152 * 65536 */ * bgra[1] * bgra[1] + - 13933UL /* 0.2126 * 65536 */ * bgra[2] * bgra[2] ) >> 16; + l = ( 4731UL /* 0.072186 * 65536 */ * bgra[0] * bgra[0] + + 46868UL /* 0.715158 * 65536 */ * bgra[1] * bgra[1] + + 13937UL /* 0.212656 * 65536 */ * bgra[2] * bgra[2] ) >> 16; /* * Final transparency can be determined as follows. |