Camera implemented

This commit is contained in:
2021-12-11 21:32:43 -05:00
parent 10e2b3c538
commit 2308ef4eb2
8 changed files with 170 additions and 22 deletions

View File

@@ -0,0 +1,34 @@
//
// Created by m on 12/11/21.
//
#ifndef RLA_IIPP_GRID2D_HPP
#define RLA_IIPP_GRID2D_HPP
#include <vector>
template<typename T>
class Grid2D {
private:
std::vector<std::vector<T>> grid{};
public:
Grid2D(int width, int height) {
grid = std::vector<std::vector<T>>(height, std::vector<T>(width));
}
int get_width() {
return grid[0].size();
}
int get_height() {
return grid.size();
}
void insert(int x, int y, T arg) {
grid[y][x] = arg;
}
T get(int x, int y) {
return grid[y][x];
}
};
#endif //RLA_IIPP_GRID2D_HPP