mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-1929 Improve rendering of San Francisco font of macOS Catalina
Added gamma correction to match grayscale rendering with subpixel one
(cherry picked from commit 5016db518a)
This commit is contained in:
committed by
alexey.ushakov@jetbrains.com
parent
f6e8f38bdb
commit
00fad44eb3
@@ -282,7 +282,13 @@ CGGI_CopyImageFromCanvasToRGBInfo(CGGI_GlyphCanvas *canvas, GlyphInfo *info)
|
||||
static inline UInt8
|
||||
CGGI_ConvertBWPixelToByteGray(UInt32 p)
|
||||
{
|
||||
return 0xFF - (((p >> 24 & 0xFF) + (p >> 16 & 0xFF) + (p >> 8 & 0xFF)) / 3);
|
||||
UInt8* lut = getReverseGammaLut();
|
||||
|
||||
UInt8 r = lut[0xFF - (p >> 24 & 0xFF)];
|
||||
UInt8 g = lut[0xFF - (p >> 16 & 0xFF)];
|
||||
UInt8 b = lut[0xFF - (p >> 8 & 0xFF)];
|
||||
|
||||
return ((r + g + b) / 3);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user