Files

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

2018-01-19 17:02:29 -10:00
#include "Common.hpp"
2018-01-21 13:07:34 -10:00
#include <cmath>
#include <numeric>
#include <thread>
2018-01-19 17:02:29 -10:00
2018-12-07 19:17:51 -10:00
namespace boo {
2018-01-19 17:02:29 -10:00
2018-12-07 19:17:51 -10:00
void UpdateGammaLUT(ITextureD* tex, float gamma) {
void* data = tex->map(65536 * 2);
for (int i = 0; i < 65536; ++i) {
float level = std::pow(i / 65535.f, gamma);
reinterpret_cast<uint16_t*>(data)[i] = level * 65535.f;
}
tex->unmap();
2018-01-19 17:02:29 -10:00
}
2018-12-07 19:17:51 -10:00
} // namespace boo