RawSubFile¶
-
class RawSubFile¶
Class to read a singe subfile written in .raw format. Used from RawFile to read the entire detector. Can be used directly to read part of the image.
Public Functions
-
RawSubFile(const std::filesystem::path &fname, DetectorType detector, size_t rows, size_t cols, size_t bitdepth, uint32_t pos_row = 0, uint32_t pos_col = 0)¶
SubFile constructor.
- Parameters:
fname – path to the subfile
detector – detector type
rows – number of rows in the subfile
cols – number of columns in the subfile
bitdepth – bitdepth of the subfile
- Throws:
std::invalid_argument – if the detector,type pair is not supported
-
~RawSubFile() = default¶
-
void seek(size_t frame_index)¶
Seek to the given frame number.
Note
Puts the file pointer at the start of the header, not the start of the data
- Parameters:
frame_index – frame position in file to seek to
- Throws:
std::runtime_error – if the frame number is out of range
-
size_t tell()¶
-
void read_into(std::byte *image_buf, DetectorHeader *header = nullptr)¶
-
void get_part(std::byte *buffer, size_t frame_index)¶
-
void read_header(DetectorHeader *header)¶
-
size_t rows() const¶
-
size_t cols() const¶
-
size_t frame_number(size_t frame_index)¶
-
inline size_t bytes_per_frame() const¶
-
inline size_t pixels_per_frame() const¶
-
inline size_t bytes_per_pixel() const¶
-
RawSubFile(const std::filesystem::path &fname, DetectorType detector, size_t rows, size_t cols, size_t bitdepth, uint32_t pos_row = 0, uint32_t pos_col = 0)¶