|
vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
|
Holds the image formats that can be written, selects the most suitable of them for a file, and creates the file with it. More...
#include <vitrio/image_file_write_format_selector.hpp>
Public Member Functions | |
| image_file_write_format_selector () | |
| Construct a selector with no formats. | |
| image_file_write_format_selector (const image_file_write_format_selector &other)=delete | |
| image_file_write_format_selector (image_file_write_format_selector &&other)=delete | |
| image_file_write_format_selector & | operator= (const image_file_write_format_selector &other)=delete |
| image_file_write_format_selector & | operator= (image_file_write_format_selector &&other)=delete |
| void | register_builtin_formats () |
| Register the formats bundled with the library. | |
| bool | register_format (std::unique_ptr< image_file_write_format > format) |
| Register a new image write format. | |
| std::shared_ptr< image_writer > | open (const std::string &path, const image_descriptor &descriptor, const image_metadata &metadata) const |
| Create a file with the most suitable format. | |
| const image_file_write_format * | get_most_suitable_format (const image_file_probe &probe) const |
| Get the format that would create a file, without creating it. | |
Static Public Member Functions | |
| static const std::shared_ptr< image_file_write_format_selector > & | get_shared () |
| Get the selector every use may share. | |
Holds the image formats that can be written, selects the most suitable of them for a file, and creates 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_write_format * vitrio::image_file_write_format_selector::get_most_suitable_format | ( | const image_file_probe & | probe | ) | const |
Get the format that would create a file, without creating 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_writer > vitrio::image_file_write_format_selector::open | ( | const std::string & | path, |
| const image_descriptor & | descriptor, | ||
| const image_metadata & | metadata | ||
| ) | const |
Create a file with the most suitable format.
The file named by path need not exist, in which case the choice rests on its extension. Any file already there is replaced.
| path | Path to the file to create. |
| descriptor | What the file holds. |
| metadata | How its samples map onto physical space. |
| unsupported_operation_error | If no registered format recognizes the file, or if the chosen one can not represent the requested file. |
| image_file_error | If the file could not be created. |
| bool vitrio::image_file_write_format_selector::register_format | ( | std::unique_ptr< image_file_write_format > | format | ) |
Register a new image write format.
| format | The format to be registered. |