Skip to content
Evil Engine
home
how
devlogs
docs
contact
Theme
Light
Evil
Dark
source code
Evil Engine
/
Engine
/
thirdparty
/
msdfgen
/
core
/
pixel-conversion.hpp
0.2.0-dev
Download ZIP
16 lines ·229 B
Raw
1
2
#pragma
once
3
4
#include
"arithmetics.hpp"
5
6
namespace
msdfgen
{
7
8
inline
byte
pixelFloatToByte
(
float
x
) {
9
return
byte
(
~int
(
255.5
f-
255.
f*
clamp
(x)));
10
}
11
12
inline
float
pixelByteToFloat
(
byte
x
) {
13
return
1.
f/
255.
f*float
(x);
14
}
15
16
}