godot/thirdparty/msdfgen/core/pixel-conversion.hpp
2024-03-13 09:12:50 +02:00

17 lines
223 B
C++

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