FileInterface class to define the interface for file operations.
More...
#include <FileInterface.hpp>
|
virtual void | write (Frame &frame)=0 |
| write a frame to the file
|
|
virtual Frame | read ()=0 |
| write a vector of frames to the file
|
|
virtual std::vector< Frame > | read (size_t n_frames)=0 |
| read n_frames from the file at the current position
|
|
virtual void | read_into (std::byte *image_buf)=0 |
| read one frame from the file at the current position and store it in the provided buffer
|
|
virtual void | read_into (std::byte *image_buf, size_t n_frames)=0 |
| read n_frames from the file at the current position and store them in the provided buffer
|
|
virtual size_t | frame_number (size_t frame_index)=0 |
| get the frame number at the given frame index
|
|
virtual size_t | bytes_per_frame ()=0 |
| get the size of one frame in bytes
|
|
virtual size_t | pixels ()=0 |
| get the number of pixels in one frame
|
|
virtual void | seek (size_t frame_number)=0 |
| seek to the given frame number
|
|
virtual size_t | tell ()=0 |
| get the current position of the file pointer
|
|
virtual size_t | total_frames () const =0 |
| get the total number of frames in the file
|
|
virtual ssize_t | rows () const =0 |
| get the number of rows in the file
|
|
virtual ssize_t | cols () const =0 |
| get the number of columns in the file
|
|
virtual ssize_t | bitdepth () const =0 |
| get the bitdepth of the file
|
|
Frame | iread (size_t frame_number) |
| read one frame from the file at the given frame number
|
|
std::vector< Frame > | iread (size_t frame_number, size_t n_frames) |
| read n_frames from the file starting at the given frame number
|
|
virtual | ~FileInterface () |
|
FileInterface class to define the interface for file operations.
- Note
- parent class for NumpyFile and RawFile
-
all functions are pure virtual and must be implemented by the derived classes
◆ ~FileInterface()
virtual aare::FileInterface::~FileInterface |
( |
| ) |
|
|
inlinevirtual |
◆ bitdepth()
virtual ssize_t aare::FileInterface::bitdepth |
( |
| ) |
const |
|
pure virtual |
◆ bytes_per_frame()
virtual size_t aare::FileInterface::bytes_per_frame |
( |
| ) |
|
|
pure virtual |
◆ cols()
virtual ssize_t aare::FileInterface::cols |
( |
| ) |
const |
|
pure virtual |
◆ frame_number()
virtual size_t aare::FileInterface::frame_number |
( |
size_t |
frame_index | ) |
|
|
pure virtual |
get the frame number at the given frame index
- Parameters
-
frame_index | index of the frame |
- Returns
- frame number
Implemented in aare::NumpyFile, and aare::RawFile.
◆ iread() [1/2]
Frame aare::FileInterface::iread |
( |
size_t |
frame_number | ) |
|
|
inline |
read one frame from the file at the given frame number
- Parameters
-
frame_number | frame number to read |
- Returns
- frame
◆ iread() [2/2]
std::vector< Frame > aare::FileInterface::iread |
( |
size_t |
frame_number, |
|
|
size_t |
n_frames |
|
) |
| |
|
inline |
read n_frames from the file starting at the given frame number
- Parameters
-
frame_number | frame number to start reading from |
n_frames | number of frames to read |
- Returns
- vector of frames
◆ pixels()
virtual size_t aare::FileInterface::pixels |
( |
| ) |
|
|
pure virtual |
◆ read() [1/2]
virtual Frame aare::FileInterface::read |
( |
| ) |
|
|
pure virtual |
write a vector of frames to the file
- Parameters
-
frames | vector of frames to write |
- Returns
- void
read one frame from the file at the current position
- Returns
- Frame
Implemented in aare::NumpyFile, and aare::RawFile.
◆ read() [2/2]
virtual std::vector< Frame > aare::FileInterface::read |
( |
size_t |
n_frames | ) |
|
|
pure virtual |
read n_frames from the file at the current position
- Parameters
-
n_frames | number of frames to read |
- Returns
- vector of frames
Implemented in aare::NumpyFile, and aare::RawFile.
◆ read_into() [1/2]
virtual void aare::FileInterface::read_into |
( |
std::byte * |
image_buf | ) |
|
|
pure virtual |
read one frame from the file at the current position and store it in the provided buffer
- Parameters
-
image_buf | buffer to store the frame |
- Returns
- void
Implemented in aare::NumpyFile, and aare::RawFile.
◆ read_into() [2/2]
virtual void aare::FileInterface::read_into |
( |
std::byte * |
image_buf, |
|
|
size_t |
n_frames |
|
) |
| |
|
pure virtual |
read n_frames from the file at the current position and store them in the provided buffer
- Parameters
-
image_buf | buffer to store the frames |
n_frames | number of frames to read |
- Returns
- void
Implemented in aare::NumpyFile, and aare::RawFile.
◆ rows()
virtual ssize_t aare::FileInterface::rows |
( |
| ) |
const |
|
pure virtual |
◆ seek()
virtual void aare::FileInterface::seek |
( |
size_t |
frame_number | ) |
|
|
pure virtual |
seek to the given frame number
- Parameters
-
frame_number | frame number to seek to |
- Returns
- void
Implemented in aare::NumpyFile, and aare::RawFile.
◆ tell()
virtual size_t aare::FileInterface::tell |
( |
| ) |
|
|
pure virtual |
◆ total_frames()
virtual size_t aare::FileInterface::total_frames |
( |
| ) |
const |
|
pure virtual |
◆ write()
virtual void aare::FileInterface::write |
( |
Frame & |
frame | ) |
|
|
pure virtual |
write a frame to the file
- Parameters
-
- Returns
- void
- Exceptions
-
std::runtime_error | if the function is not implemented |
Implemented in aare::NumpyFile, and aare::RawFile.
◆ current_frame
size_t aare::FileInterface::current_frame {} |
◆ m_base_name
std::string aare::FileInterface::m_base_name |
◆ m_base_path
std::filesystem::path aare::FileInterface::m_base_path |
◆ m_bitdepth
ssize_t aare::FileInterface::m_bitdepth {} |
◆ m_cols
ssize_t aare::FileInterface::m_cols {} |
◆ m_ext
std::string aare::FileInterface::m_ext |
◆ m_findex
int aare::FileInterface::m_findex |
◆ m_fname
std::filesystem::path aare::FileInterface::m_fname |
◆ m_mode
std::string aare::FileInterface::m_mode |
◆ m_rows
ssize_t aare::FileInterface::m_rows {} |
◆ m_total_frames
size_t aare::FileInterface::m_total_frames {} |
◆ m_type
◆ max_frames_per_file
size_t aare::FileInterface::max_frames_per_file {} |
◆ version
std::string aare::FileInterface::version |
The documentation for this class was generated from the following file: