vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
file_image_writer_provider.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2
3#pragma once
4
5#include <vitrio/export.hpp>
6#include <vitrio/image_writer_provider.hpp>
7#include <vitrio/platform.hpp>
8
9#include <cstddef>
10#include <memory>
11#include <string>
12
13namespace vitrio
14{
15
16class image_descriptor;
17class image_metadata;
18class image_file_write_format_selector;
19
49class VITRIO_API file_image_writer_provider final
51{
52public:
60 std::shared_ptr<const image_file_write_format_selector> formats
61 );
62
64
83 void declare(
84 std::string key,
85 image_descriptor descriptor,
86 const image_metadata &metadata
87 );
88
104 void close(const std::string &key);
105
116 void flush();
117
126 std::size_t get_file_count() const noexcept;
127
128 std::shared_ptr<image_writer> acquire(const std::string &key) override;
129
130private:
131 class implementation;
132 VITRIO_STD_MEMBER_INTERFACE
133 std::unique_ptr<implementation> m_implementation;
134};
135
136} // namespace vitrio
A provider that writes files. Its files are explicitly declared and closed by the client.
Definition file_image_writer_provider.hpp:51
void flush()
Make everything written to the files reach the storage.
void declare(std::string key, image_descriptor descriptor, const image_metadata &metadata)
Make a file writable.
file_image_writer_provider(std::shared_ptr< const image_file_write_format_selector > formats)
Construct a provider creating files through a format selector.
std::size_t get_file_count() const noexcept
Get how many files are declared.
void close(const std::string &key)
Finish a file.
The shape and data type of the values an image file holds.
Definition image_descriptor.hpp:28
What a file states beyond its shape and data type, such as how its samples map onto physical space.
Definition image_metadata.hpp:17
Interface to serve image_writer given a key.
Definition image_writer_provider.hpp:25
Abstract writable view of one image file.
Definition image_writer.hpp:26