AARE
Data analysis library for PSI hybrid detectors
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
aare::File Class Reference

RAII File class for reading and writing image files in various formats wrapper on a FileInterface to abstract the underlying file format. More...

#include <File.hpp>

Public Member Functions

 File (std::filesystem::path fname, std::string mode, FileConfig cfg={})
 Construct a new File object.
 
void write (Frame &frame)
 
Frame read ()
 
Frame iread (size_t frame_number)
 
std::vector< Frameread (size_t n_frames)
 
void read_into (std::byte *image_buf)
 
void read_into (std::byte *image_buf, size_t n_frames)
 
size_t frame_number (size_t frame_index)
 
size_t bytes_per_frame ()
 
size_t pixels ()
 
void seek (size_t frame_number)
 
size_t tell () const
 
size_t total_frames () const
 
ssize_t rows () const
 
ssize_t cols () const
 
ssize_t bitdepth () const
 
 File (File &&other)
 Move constructor.
 
 ~File ()
 destructor: will only delete the FileInterface object
 

Private Attributes

FileInterfacefile_impl
 

Detailed Description

RAII File class for reading and writing image files in various formats wrapper on a FileInterface to abstract the underlying file format.

Note
documentation for each function is in the FileInterface class

Constructor & Destructor Documentation

◆ File() [1/2]

aare::File::File ( std::filesystem::path  fname,
std::string  mode,
FileConfig  cfg = {} 
)

Construct a new File object.

Parameters
fnamepath to the file
modefile mode (r, w, a)
cfgfile configuration
Exceptions
std::runtime_errorif the file cannot be opened
std::invalid_argumentif the file mode is not supported

◆ File() [2/2]

aare::File::File ( File &&  other)

Move constructor.

Parameters
otherFile object to move from

◆ ~File()

aare::File::~File ( )

destructor: will only delete the FileInterface object

Member Function Documentation

◆ bitdepth()

ssize_t aare::File::bitdepth ( ) const

◆ bytes_per_frame()

size_t aare::File::bytes_per_frame ( )

◆ cols()

ssize_t aare::File::cols ( ) const

◆ frame_number()

size_t aare::File::frame_number ( size_t  frame_index)

◆ iread()

Frame aare::File::iread ( size_t  frame_number)

◆ pixels()

size_t aare::File::pixels ( )

◆ read() [1/2]

Frame aare::File::read ( )

◆ read() [2/2]

std::vector< Frame > aare::File::read ( size_t  n_frames)

◆ read_into() [1/2]

void aare::File::read_into ( std::byte *  image_buf)

◆ read_into() [2/2]

void aare::File::read_into ( std::byte *  image_buf,
size_t  n_frames 
)

◆ rows()

ssize_t aare::File::rows ( ) const

◆ seek()

void aare::File::seek ( size_t  frame_number)

◆ tell()

size_t aare::File::tell ( ) const

◆ total_frames()

size_t aare::File::total_frames ( ) const

◆ write()

void aare::File::write ( Frame frame)

Field Documentation

◆ file_impl

FileInterface* aare::File::file_impl
private

The documentation for this class was generated from the following files: