vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
detector_event_position_view.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2
3#pragma once
4
5#include <vitrio/span.hpp>
6
7#include <cstddef>
8#include <cstdint>
9
10namespace vitrio
11{
12
27{
28public:
39 span<const std::uint32_t> coordinates,
40 std::size_t rank
41 );
42
48 std::size_t get_rank() const noexcept;
49
55 std::size_t get_event_count() const noexcept;
56
63 bool empty() const noexcept;
64
72 span<const std::uint32_t> get(std::size_t event) const noexcept;
73
81 std::uint32_t operator()(std::size_t event, std::size_t axis)
82 const noexcept;
83
94 get_events(std::size_t first, std::size_t count) const noexcept;
95
105 span<const std::uint32_t> get_coordinates() const noexcept;
106
107private:
108 struct unchecked_tag {};
109
111 span<const std::uint32_t> coordinates,
112 std::size_t rank,
113 unchecked_tag
114 ) noexcept;
115
116 span<const std::uint32_t> m_coordinates;
117 std::size_t m_rank;
118};
119
120} // namespace vitrio
121
122#include "detector_event_position_view.inl"
A view of the positions of a sequence of events, as a matrix of one row per event and one column per ...
Definition detector_event_position_view.hpp:27
std::size_t get_event_count() const noexcept
Get the number of events viewed.
span< const std::uint32_t > get_coordinates() const noexcept
Get every coordinate viewed, row after row.
detector_event_position_view(span< const std::uint32_t > coordinates, std::size_t rank)
Construct a view of coordinates held row after row.
span< const std::uint32_t > get(std::size_t event) const noexcept
Get the position of one event.
detector_event_position_view get_events(std::size_t first, std::size_t count) const noexcept
Get the positions of a run of the events viewed.
bool empty() const noexcept
Check whether no event is viewed.
std::size_t get_rank() const noexcept
Get the number of coordinates each event carries.
A view of a contiguous sequence of elements.
Definition span.hpp:29