| 1 | |
|---|---|
| 2 | #pragma once | 
| 3 | |
| 4 | #include "arithmetics.hpp" | 
| 5 | |
| 6 | namespace msdfgen { | 
| 7 | |
| 8 | typedef unsigned char byte; | 
| 9 | |
| 10 | inline byte pixelFloatToByte(float x) { | 
| 11 | return byte(clamp(256.f*x, 255.f)); | 
| 12 | } | 
| 13 | |
| 14 | inline float pixelByteToFloat(byte x) { | 
| 15 | return 1.f/255.f*float(x); | 
| 16 | } | 
| 17 | |
| 18 | } | 
| 19 | 
