UFO 1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
label.hpp
1
41#ifndef UFO_CORE_LABEL_HPP
42#define UFO_CORE_LABEL_HPP
43
44// STL
45#include <cstdint>
46#include <format>
47#include <ostream>
48
49namespace ufo
50{
72struct Label {
76 using value_type = std::uint32_t;
77
82
90 [[nodiscard]] constexpr operator value_type() const noexcept { return label; }
91
99 [[nodiscard]] friend constexpr auto operator<=>(Label lhs,
100 Label rhs) noexcept = default;
101
109 [[nodiscard]] friend constexpr bool operator==(Label lhs, Label rhs) noexcept = default;
110};
111
124inline std::ostream& operator<<(std::ostream& out, Label l) { return out << l.label; }
125} // namespace ufo
126
127template <>
128struct std::formatter<ufo::Label> : std::formatter<ufo::Label::value_type> {
129 auto format(ufo::Label l, std::format_context& ctx) const
130 {
131 return std::formatter<ufo::Label::value_type>::format(l.label, ctx);
132 }
133};
134#endif // UFO_CORE_LABEL_HPP
All vision-related classes and functions.
Definition cloud.hpp:49
Represents a semantic class label as a single unsigned integer value.
Definition label.hpp:72
friend constexpr bool operator==(Label lhs, Label rhs) noexcept=default
Equality comparison.
friend constexpr auto operator<=>(Label lhs, Label rhs) noexcept=default
Three-way comparison (total order on the underlying integer).
value_type label
The raw class label identifier.
Definition label.hpp:81
std::uint32_t value_type
Underlying integer type.
Definition label.hpp:76