mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-14 08:17:13 +02:00
fix ci and add formatting (#48)
* add dependency * dont run blocking zmq example and add formatting * format files
This commit is contained in:
@ -1,31 +1,27 @@
|
||||
#include "aare/Frame.hpp"
|
||||
#include "aare/utils/logger.hpp"
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
|
||||
namespace aare {
|
||||
|
||||
Frame::Frame(std::byte* bytes, ssize_t rows, ssize_t cols, ssize_t bitdepth):
|
||||
m_rows(rows), m_cols(cols), m_bitdepth(bitdepth) {
|
||||
m_data = new std::byte[rows*cols*bitdepth/8];
|
||||
std::memcpy(m_data, bytes, rows*cols*bitdepth/8);
|
||||
}
|
||||
|
||||
Frame::Frame(ssize_t rows, ssize_t cols, ssize_t bitdepth):
|
||||
m_rows(rows), m_cols(cols), m_bitdepth(bitdepth) {
|
||||
m_data = new std::byte[rows*cols*bitdepth/8];
|
||||
std::memset(m_data, 0, rows*cols*bitdepth/8);
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::byte* Frame::get(int row, int col) {
|
||||
if (row < 0 || row >= m_rows || col < 0 || col >= m_cols) {
|
||||
std::cerr << "Invalid row or column index" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
return m_data+(row*m_cols + col)*(m_bitdepth/8);
|
||||
Frame::Frame(std::byte *bytes, ssize_t rows, ssize_t cols, ssize_t bitdepth)
|
||||
: m_rows(rows), m_cols(cols), m_bitdepth(bitdepth) {
|
||||
m_data = new std::byte[rows * cols * bitdepth / 8];
|
||||
std::memcpy(m_data, bytes, rows * cols * bitdepth / 8);
|
||||
}
|
||||
|
||||
Frame::Frame(ssize_t rows, ssize_t cols, ssize_t bitdepth) : m_rows(rows), m_cols(cols), m_bitdepth(bitdepth) {
|
||||
m_data = new std::byte[rows * cols * bitdepth / 8];
|
||||
std::memset(m_data, 0, rows * cols * bitdepth / 8);
|
||||
}
|
||||
|
||||
std::byte *Frame::get(int row, int col) {
|
||||
if (row < 0 || row >= m_rows || col < 0 || col >= m_cols) {
|
||||
std::cerr << "Invalid row or column index" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
return m_data + (row * m_cols + col) * (m_bitdepth / 8);
|
||||
}
|
||||
|
||||
} // namespace aare
|
||||
|
Reference in New Issue
Block a user