|
vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
|
Holds the image formats that can be read, selects the most suitable of them for a file, and opens the file with it. More...
#include <vitrio/image_file_read_format_selector.hpp>
Public Member Functions | |
| image_file_read_format_selector () | |
| Construct a selector with no formats. | |
| image_file_read_format_selector (const image_file_read_format_selector &other)=delete | |
| image_file_read_format_selector (image_file_read_format_selector &&other)=delete | |
| image_file_read_format_selector & | operator= (const image_file_read_format_selector &other)=delete |
| image_file_read_format_selector & | operator= (image_file_read_format_selector &&other)=delete |
| void | register_builtin_formats () |
| Register the formats bundled with the library. | |
| bool | register_format (std::unique_ptr< image_file_read_format > format) |
| Register a new image read format. | |
| std::shared_ptr< image_reader > | open (const std::string &path) const |
| Open a file for reading with the most suitable format. | |
| const image_file_read_format * | get_most_suitable_format (const image_file_probe &probe) const |
| Get the format that would open a file, without opening it. | |
Static Public Member Functions | |
| static const std::shared_ptr< image_file_read_format_selector > & | get_shared () |
| Get the selector every use may share. | |
Holds the image formats 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 image_file_read_format * vitrio::image_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.
Answers which format claims a file, and whether any does at all, without the cost or the failure modes of 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< image_reader > vitrio::image_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::image_file_read_format_selector::register_format | ( | std::unique_ptr< image_file_read_format > | format | ) |
Register a new image read format.
| format | The format to be registered. |