virtualx-engine/thirdparty/msdfgen/core/pixel-conversion.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
252 B
C++
Raw Permalink Normal View History

2024-02-18 21:31:05 +01:00
#pragma once
#include "arithmetics.hpp"
namespace msdfgen {
typedef unsigned char byte;
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);
}
}