Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/thirdparty/msdfgen/core/pixel-conversion.hpp
9903 views
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.5f-255.f*clamp(x)));
10
}
11
12
inline float pixelByteToFloat(byte x) {
13
return 1.f/255.f*float(x);
14
}
15
16
}
17
18