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