mirror of
https://github.com/godotengine/godot
synced 2024-11-02 14:43:31 +00:00
16 lines
223 B
C++
16 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);
|
|
}
|
|
|
|
}
|