1
Fork 0
raytracer/include/image.h

23 lines
412 B
C
Raw Normal View History

2020-02-17 10:33:56 -05:00
#pragma once
#include <glm/glm.hpp>
2020-05-13 17:19:21 -04:00
#include <array>
2020-02-17 10:33:56 -05:00
template<class T, int Width, int Height>
class Image {
public:
2020-05-13 17:19:21 -04:00
void reset() {
array = {};
}
2020-02-17 10:33:56 -05:00
T& get(const int32_t x, const int32_t y) {
return array[y * Width + x];
}
T get(const int32_t x, const int32_t y) const {
return array[y * Width + x];
}
2020-05-13 17:19:21 -04:00
std::array<T, Width * Height> array = {};
2020-02-17 10:33:56 -05:00
};