vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
vitrio::image_file_write_format Class Referenceabstract

The ability of one image file format to be written. More...

#include <vitrio/image_file_write_format.hpp>

Public Member Functions

 image_file_write_format (const image_file_write_format &other)=delete
 
 image_file_write_format (image_file_write_format &&other)=delete
 
image_file_write_format & operator= (const image_file_write_format &other)=delete
 
image_file_write_format & operator= (image_file_write_format &&other)=delete
 
virtual std::string get_name () const =0
 Get the name of this format.
 
virtual image_file_format_suitability get_suitability (const image_file_probe &probe) const =0
 Report how well this format fits a file.
 
virtual std::shared_ptr< image_writer > open (const image_file_probe &probe, const image_descriptor &descriptor, const image_metadata &metadata) const =0
 Create a file and open it for writing.
 

Detailed Description

The ability of one image file format to be written.

Judges from an image_file_probe how well it fits a file, and creates a file it fits, returning an image_writer for it.

See also
image_file_read_format

Member Function Documentation

◆ get_name()

virtual std::string vitrio::image_file_write_format::get_name ( ) const
pure virtual

Get the name of this format.

Returns
std::string The name, which identifies the format.

◆ get_suitability()

virtual image_file_format_suitability vitrio::image_file_write_format::get_suitability ( const image_file_probe &  probe) const
pure virtual

Report how well this format fits a file.

The file named by probe need not exist, in which case the probe carries no leading bytes and the decision rests on the extension alone. Check image_file_probe::exists rather than assuming there are leading bytes to read.

Parameters
probeThe file under consideration.
Returns
image_file_format_suitability How well this format fits probe.

◆ open()

virtual std::shared_ptr< image_writer > vitrio::image_file_write_format::open ( const image_file_probe &  probe,
const image_descriptor &  descriptor,
const image_metadata &  metadata 
) const
pure virtual

Create a file and open it for writing.

The descriptor is complete, so the file may be laid out in full before anything is written. Any file already at that path is replaced.

How the file lays its samples out is the format's own decision, so the shape comes as an image_descriptor, with no strides or offset.

Parameters
probeThe file to create.
descriptorWhat the file holds. Its data type is what the file stores rather than what a write will supply, since a write converts.
metadataHow its samples map onto physical space. A format writes what of it it can carry and ignores the rest.
Returns
std::shared_ptr<image_writer> The opened writer, never null.
Exceptions
unsupported_operation_errorIf this format can not represent the requested file, such as a rank or a data type it has no encoding for.
image_file_errorIf the file could not be created.

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