mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-22 19:47:58 +02:00
remove templates
This commit is contained in:
@ -12,17 +12,18 @@
|
||||
* should be able to work with streams coming from files or network
|
||||
*/
|
||||
|
||||
template <class DataType> class Frame {
|
||||
class Frame {
|
||||
ssize_t m_rows;
|
||||
ssize_t m_cols;
|
||||
DataType *m_data;
|
||||
ssize_t m_bitdepth = sizeof(DataType) * 8;
|
||||
ssize_t m_bitdepth;
|
||||
std::byte* m_data;
|
||||
|
||||
|
||||
public:
|
||||
Frame(ssize_t rows, ssize_t cols);
|
||||
Frame(std::byte *fp, ssize_t rows, ssize_t cols);
|
||||
DataType get(int row, int col);
|
||||
std::vector<std::vector<DataType>> get_array();
|
||||
Frame(ssize_t rows, ssize_t cols,ssize_t m_bitdepth);
|
||||
Frame(std::byte *fp, ssize_t rows, ssize_t cols,ssize_t m_bitdepth);
|
||||
std::byte* get(int row, int col);
|
||||
// std::vector<std::vector<DataType>> get_array();
|
||||
ssize_t rows() const{
|
||||
return m_rows;
|
||||
}
|
||||
@ -32,13 +33,17 @@ template <class DataType> class Frame {
|
||||
ssize_t bitdepth() const{
|
||||
return m_bitdepth;
|
||||
}
|
||||
DataType* _get_data(){
|
||||
std::byte* _get_data(){
|
||||
return m_data;
|
||||
}
|
||||
Frame& operator=(Frame& other){
|
||||
m_rows = other.rows();
|
||||
m_cols = other.cols();
|
||||
m_bitdepth = other.bitdepth();
|
||||
m_data = new std::byte[m_rows*m_cols*m_bitdepth/8];
|
||||
std::memcpy(m_data, other.m_data, m_rows*m_cols*m_bitdepth/8);
|
||||
return *this;
|
||||
}
|
||||
|
||||
~Frame() { delete[] m_data; }
|
||||
};
|
||||
|
||||
typedef Frame<uint16_t> Frame16;
|
||||
typedef Frame<uint8_t> Frame8;
|
||||
typedef Frame<uint32_t> Frame32;
|
Reference in New Issue
Block a user