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