vitrio 0.1.4
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:
46 std::vector<std::size_t> extents,
47 std::size_t file_rank,
48 std::size_t array_rank
49 );
50
57
61 image_transfer_shape& operator=(image_transfer_shape &&other) noexcept;
62
71
78 std::size_t get_rank() const noexcept;
79
87
95
104 std::size_t get_leading_rank(std::size_t rank) const noexcept;
105
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
The shape every region of a transfer shares: the extents of one region and the ranks of the file and ...
Definition image_transfer_shape.hpp:32
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