Browse Source

GPU-like pixel conversion

Chlumsky 1 year ago
parent
commit
75813f37b3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/pixel-conversion.hpp

+ 1 - 1
core/pixel-conversion.hpp

@@ -6,7 +6,7 @@
 namespace msdfgen {
 
 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) {