vitrio 0.3.1
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
image_transfer_shape.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2
3#pragma once
4
5#include <vitrio/export.hpp>
6#include <vitrio/span.hpp>
7
8#include <cstddef>
9#include <vector>
10
11namespace vitrio
12{
13
32{
33public:
44 VITRIO_API
46 std::vector<std::size_t> extents,
47 std::size_t file_rank,
48 std::size_t array_rank
49 );
50
51 VITRIO_API
53 VITRIO_API
55 VITRIO_API
57
58 VITRIO_API
59 image_transfer_shape& operator=(const image_transfer_shape &other);
60 VITRIO_API
61 image_transfer_shape& operator=(image_transfer_shape &&other) noexcept;
62
69 VITRIO_API
71
77 VITRIO_API
78 std::size_t get_rank() const noexcept;
79
85 VITRIO_API
86 std::size_t get_file_rank() const noexcept;
87
93 VITRIO_API
94 std::size_t get_array_rank() const noexcept;
95
103 VITRIO_API
104 std::size_t get_leading_rank(std::size_t rank) const noexcept;
105
114 VITRIO_API
115 std::size_t get_extent(std::size_t rank, std::size_t axis) const noexcept;
116
117private:
118 std::vector<std::size_t> m_extents;
119 std::size_t m_file_rank;
120 std::size_t m_array_rank;
121};
122
123} // namespace vitrio
image_transfer_shape(std::vector< std::size_t > extents, std::size_t file_rank, std::size_t array_rank)
Construct a shape from its components.
std::size_t get_file_rank() const noexcept
Get the rank of the file side.
std::size_t get_rank() const noexcept
Get the rank of one region.
std::size_t get_array_rank() const noexcept
Get the rank of the array side.
span< const std::size_t > get_extents() const noexcept
Get the extents of one region.
std::size_t get_leading_rank(std::size_t rank) const noexcept
Get how many leading axes of a side a region spans a single position along.
std::size_t get_extent(std::size_t rank, std::size_t axis) const noexcept
Get the extent a region spans along one axis of a side.
A view of a contiguous sequence of elements.
Definition span.hpp:29