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
|
|
|
|
2024-09-25 10:48:19 +02: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
|
|
|
|
2024-09-25 10:48:19 +02:00
|
|
|
std::array<T, Width * Height> array = {};
|
2020-02-17 10:33:56 -05:00
|
|
|
};
|