save numpy files frame by frame (#37)

Co-authored-by: Bechir <bechir.brahem420@gmail.com>
This commit is contained in:
Bechir Braham
2024-04-02 11:35:58 +02:00
committed by GitHub
parent 643ea39670
commit 449c5119a4
23 changed files with 357 additions and 101 deletions

View File

@ -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) {

View File

@ -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() {