mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-23 03:57:57 +02:00
save numpy files frame by frame (#37)
Co-authored-by: Bechir <bechir.brahem420@gmail.com>
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
|
||||
namespace aare {
|
||||
|
||||
|
||||
DType::DType(const std::type_info &t) {
|
||||
if (t == typeid(int8_t))
|
||||
m_type = TypeIndex::INT8;
|
||||
@ -32,6 +33,32 @@ DType::DType(const std::type_info &t) {
|
||||
"Could not construct data type. Type not supported.");
|
||||
}
|
||||
|
||||
uint8_t DType::bitdepth()const {
|
||||
switch (m_type) {
|
||||
case TypeIndex::INT8:
|
||||
case TypeIndex::UINT8:
|
||||
return 8;
|
||||
case TypeIndex::INT16:
|
||||
case TypeIndex::UINT16:
|
||||
return 16;
|
||||
case TypeIndex::INT32:
|
||||
case TypeIndex::UINT32:
|
||||
return 32;
|
||||
case TypeIndex::INT64:
|
||||
case TypeIndex::UINT64:
|
||||
return 64;
|
||||
case TypeIndex::FLOAT:
|
||||
return 32;
|
||||
case TypeIndex::DOUBLE:
|
||||
return 64;
|
||||
case TypeIndex::ERROR:
|
||||
return 0;
|
||||
default:
|
||||
throw std::runtime_error(LOCATION+"Could not get bitdepth. Type not supported.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DType::DType(DType::TypeIndex ti):m_type(ti){}
|
||||
|
||||
DType::DType(std::string_view sv) {
|
||||
|
@ -34,6 +34,7 @@ void Frame::set(int row, int col, T data) {
|
||||
}
|
||||
|
||||
template void Frame::set(int row, int col, uint16_t data);
|
||||
template void Frame::set(int row, int col, uint32_t data);
|
||||
|
||||
|
||||
// std::vector<std::vector<DataType>> Frame<DataType>::get_array() {
|
||||
|
Reference in New Issue
Block a user