vitrio 0.3.1
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
image_file_read_format_selector.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2
3#pragma once
4
5#include <vitrio/export.hpp>
6#include <vitrio/image_metadata.hpp>
7#include <vitrio/image_reader.hpp>
8#include <vitrio/platform.hpp>
9
10#include <memory>
11#include <string>
12
13namespace vitrio
14{
15
19
33class VITRIO_API image_file_read_format_selector final
34{
35public:
42 ) = delete;
45 ) = delete;
47
49 operator=(const image_file_read_format_selector &other) = delete;
51 operator=(image_file_read_format_selector &&other) = delete;
52
62 static const std::shared_ptr<image_file_read_format_selector>& get_shared();
63
68
76 bool register_format(std::unique_ptr<image_file_read_format> format);
77
95 std::shared_ptr<image_reader> open(
96 const std::string &path,
97 const file_transfer_pool &transfers
98 ) const;
99
117 image_metadata read_metadata(const std::string &path) const;
118
131
132private:
133 class implementation;
134 VITRIO_STD_MEMBER_INTERFACE
135 std::unique_ptr<implementation> m_implementation;
136};
137
138} // namespace vitrio
Threads that carry out the reads and writes of files, each many at once, and hand the computations th...
Definition file_transfer_pool.hpp:30
Inmutable brief representation of a file.
Definition image_file_probe.hpp:33
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.
void register_builtin_formats()
Register the formats bundled with the library.
std::shared_ptr< image_reader > open(const std::string &path, const file_transfer_pool &transfers) const
Open a file for reading with the most suitable format.
bool register_format(std::unique_ptr< image_file_read_format > format)
Register a new image read format.
static const std::shared_ptr< image_file_read_format_selector > & get_shared()
Get the selector every use may share.
image_file_read_format_selector()
Construct a selector with no formats.
image_metadata read_metadata(const std::string &path) const
Read what a file states beyond its shape and data type, with the most suitable format.
The ability of one image file format to be read.
Definition image_file_read_format.hpp:29
What an image file states beyond its shape and data type, such as the distance between its samples.
Definition image_metadata.hpp:35