1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00
Files
godot/thirdparty/msdfgen/core/pixel-conversion.hpp
2025-01-09 22:03:43 +01:00

17 lines
229 B
C++

#pragma once
#include "arithmetics.hpp"
namespace msdfgen {
inline byte pixelFloatToByte(float x) {
return byte(~int(255.5f-255.f*clamp(x)));
}
inline float pixelByteToFloat(byte x) {
return 1.f/255.f*float(x);
}
}