reading multi port files (PR#2) (#31)

* works, not tested well on multi columns


---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
This commit is contained in:
Bechir Braham
2024-03-26 17:53:11 +01:00
committed by GitHub
parent e280742a6c
commit 937acd1138
11 changed files with 208 additions and 66 deletions

View File

@ -10,9 +10,11 @@ class JsonFile : public File {
public:
Frame get_frame(size_t frame_number);
int n_subfiles;
std::vector<SubFile *> subfiles;
size_t n_subfiles;
size_t n_subfile_parts;
std::vector<std::vector<SubFile *>> subfiles;
int subfile_rows, subfile_cols;
xy geometry;
std::vector<xy> positions;
config cfg{0, 0};

View File

@ -32,10 +32,10 @@ class SubFile {
SubFile(std::filesystem::path fname,DetectorType detector, ssize_t rows, ssize_t cols, uint16_t bitdepth);
size_t get_frame(std::byte *buffer, int frame_number);
size_t get_part(std::byte *buffer, int frame_number);
// TODO: define the inlines as variables and assign them in constructor
inline size_t bytes_per_frame() { return (m_bitdepth / 8) * m_rows * m_cols; }
inline size_t pixels_per_frame() { return m_rows * m_cols; }
inline size_t bytes_per_part() { return (m_bitdepth / 8) * m_rows * m_cols; }
inline size_t pixels_per_part() { return m_rows * m_cols; }
};