21 RawFile(
const std::filesystem::path &fname,
const std::string &mode =
"r",
const FileConfig &
cfg = {});
27 void write(
Frame &frame)
override {
throw std::runtime_error(
"Not implemented"); };
29 std::vector<Frame>
read(
size_t n_frames)
override;
31 void read_into(std::byte *image_buf,
size_t n_frames)
override;
86 inline std::filesystem::path
data_fname(
int mod_id,
int file_id);
FileInterface class to define the interface for file operations.
Definition FileInterface.hpp:33
ssize_t m_bitdepth
Definition FileInterface.hpp:177
size_t m_total_frames
Definition FileInterface.hpp:171
size_t current_frame
Definition FileInterface.hpp:178
ssize_t m_cols
Definition FileInterface.hpp:176
ssize_t m_rows
Definition FileInterface.hpp:175
RawFile class to read .raw and .json files.
Definition RawFile.hpp:13
void parse_metadata()
parse the metadata from the file
Definition RawFile.cpp:95
std::vector< std::vector< SubFile * > > subfiles
Definition RawFile.hpp:152
TimingMode timing_mode
Definition RawFile.hpp:157
std::filesystem::path data_fname(int mod_id, int file_id)
get the data file name path for the RawFile with the given module id and file id
Definition RawFile.cpp:65
size_t frame_number(size_t frame_index) override
get the frame number at the given frame index
Definition RawFile.cpp:251
ssize_t rows() const override
get the number of rows in the file
Definition RawFile.hpp:94
void parse_fname()
parse the file name to get the extension, base name and index
Definition RawFile.cpp:182
void seek(size_t frame_number) override
seek to the given frame number
Definition RawFile.hpp:47
RawFileConfig cfg
Definition RawFile.hpp:156
void open_subfiles()
open the subfiles
Definition RawFile.cpp:29
Frame get_frame(size_t frame_number)
get the frame at the given frame number
Definition RawFile.cpp:192
sls_detector_header read_header(const std::filesystem::path &fname)
read the header of the file
Definition RawFile.cpp:39
size_t total_frames() const override
get the total number of frames in the file
Definition RawFile.hpp:93
ssize_t cols() const override
get the number of columns in the file
Definition RawFile.hpp:95
std::vector< xy > positions
Definition RawFile.hpp:155
xy geometry
Definition RawFile.hpp:154
size_t tell() override
get the current position of the file pointer
Definition RawFile.hpp:50
static bool is_master_file(std::filesystem::path fpath)
check if the file is a master file
Definition RawFile.cpp:51
int subfile_rows
Definition RawFile.hpp:153
~RawFile()
destructor: will delete the subfiles
Definition RawFile.cpp:259
size_t pixels() override
get the number of pixels in the frame
Definition RawFile.hpp:44
size_t n_subfile_parts
Definition RawFile.hpp:151
size_t bytes_per_frame() override
get the number of bytess per frame
Definition RawFile.hpp:38
void get_frame_into(size_t frame_number, std::byte *image_buf)
read the frame at the given frame number into the image buffer
Definition RawFile.cpp:199
void find_geometry()
finds the geometry of the file
Definition RawFile.cpp:73
size_t n_subfiles
Definition RawFile.hpp:150
bool quad
Definition RawFile.hpp:158
std::filesystem::path master_fname()
get the master file name path for the RawFile
Definition RawFile.cpp:69
void parse_raw_metadata()
parse the metadata of a .raw file
Definition RawFile.cpp:139
void find_number_of_subfiles()
get the number of subfiles for the RawFile
Definition RawFile.cpp:59
int subfile_cols
Definition RawFile.hpp:153
ssize_t bitdepth() const override
get the bitdepth of the file
Definition RawFile.hpp:96
void parse_json_metadata()
parse the metadata of a .json file
Definition RawFile.cpp:115
void write(Frame &frame) override
write function is not implemented for RawFile
Definition RawFile.hpp:27
void set_config(int row, int col)
set the module gap row and column
Definition RawFile.hpp:63
void read_into(std::byte *image_buf) override
read one frame from the file at the current position and store it in the provided buffer
Definition RawFile.hpp:30
Frame read() override
write a vector of frames to the file
Definition RawFile.hpp:28
Frame class to represent a single frame of data model class should be able to work with streams comin...
Definition CircularFifo.hpp:11
TimingMode
Definition defs.hpp:43
FileConfig structure to store the configuration of a file dtype: data type of the file rows: number o...
Definition FileInterface.hpp:17
int module_gap_col
Definition defs.hpp:58
int module_gap_row
Definition defs.hpp:57