GPU-like pixel conversion

This commit is contained in:
Chlumsky 2024-04-21 19:04:58 +02:00
parent d034a702eb
commit 75813f37b3
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@
namespace msdfgen { namespace msdfgen {
inline byte pixelFloatToByte(float x) { inline byte pixelFloatToByte(float x) {
return byte(clamp(256.f*x, 255.f)); return byte(~int(255.5f-255.f*clamp(x)));
} }
inline float pixelByteToFloat(byte x) { inline float pixelByteToFloat(byte x) {