|
vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
|
Holds the file formats of detector events that can be read, selects the most suitable of them for a file, and opens the file with it. More...
#include <vitrio/detector_event_timeline_file_read_format_selector.hpp>
Static Public Member Functions | |
| static const std::shared_ptr< detector_event_timeline_file_read_format_selector > & | get_shared () |
| Get the selector every use may share. | |
Holds the file formats of detector events that can be read, selects the most suitable of them for a file, and opens the file with it.
register_builtin_formats adds the formats bundled with the library, and register_format adds any other. get_shared is a selector that already holds the bundled ones.
| const detector_event_timeline_file_read_format * vitrio::detector_event_timeline_file_read_format_selector::get_most_suitable_format | ( | const image_file_probe & | probe | ) | const |
Get the format that would open a file, without opening it.
| probe | The file under consideration. |
probe.
|
static |
Get the selector every use may share.
It holds the formats bundled with the library. A format registered on it is seen by everyone that shares it.
| std::shared_ptr< detector_event_timeline_reader > vitrio::detector_event_timeline_file_read_format_selector::open | ( | const std::string & | path | ) | const |
Open a file for reading with the most suitable format.
Reads the head of the file once and shows it to every registered format, then opens the file with whichever reported the highest suitability.
| path | Path to the file to open, or any other locator a registered format claims, such as the address of a remote file. |
| image_file_error | If no registered format claims the path and no readable file exists there. |
| unsupported_operation_error | If no registered format recognizes the file, which exists. |
| image_file_format_error | If the file is malformed or truncated. |
| bool vitrio::detector_event_timeline_file_read_format_selector::register_format | ( | std::unique_ptr< detector_event_timeline_file_read_format > | format | ) |
Register a new format.
| format | The format to be registered. |