new folder structure

This commit is contained in:
Erik Frojdh
2024-03-07 15:48:06 +01:00
parent 52865930c2
commit ef61e62238
34 changed files with 126 additions and 103 deletions

23
core/src/Frame.cpp Normal file
View File

@ -0,0 +1,23 @@
#include "aare/Frame.hpp"
#include <iostream>
template <typename DataType>
Frame<DataType>::Frame(std::byte* bytes, ssize_t rows, ssize_t cols):
rows(rows), cols(cols) {
data = new DataType[rows*cols];
std::memcpy(data, bytes, rows*cols*sizeof(DataType));
}
template <typename DataType>
DataType Frame<DataType>::get(int row, int col) {
if (row < 0 || row >= rows || col < 0 || col >= cols) {
std::cerr << "Invalid row or column index" << std::endl;
return 0;
}
return data[row*cols + col];
}
template class Frame<uint16_t>;