1
Fork 0
raytracer/include/image.h

18 lines
345 B
C
Raw Normal View History

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