UFO 1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
intensity.hpp
1
41#ifndef UFO_CORE_INTENSITY_HPP
42#define UFO_CORE_INTENSITY_HPP
43
44// STL
45#include <format>
46#include <ostream>
47
48namespace ufo
49{
66struct Intensity {
70 using value_type = float;
71
76
84 [[nodiscard]] constexpr operator value_type() const noexcept { return intensity; }
85
93 [[nodiscard]] friend constexpr auto operator<=>(Intensity lhs,
94 Intensity rhs) noexcept = default;
95
103 [[nodiscard]] friend constexpr bool operator==(Intensity lhs,
104 Intensity rhs) noexcept = default;
105};
106
119inline std::ostream& operator<<(std::ostream& out, Intensity i)
120{
121 return out << i.intensity;
122}
123} // namespace ufo
124
125template <>
126struct std::formatter<ufo::Intensity> : std::formatter<ufo::Intensity::value_type> {
127 auto format(ufo::Intensity i, std::format_context& ctx) const
128 {
129 return std::formatter<ufo::Intensity::value_type>::format(i.intensity, ctx);
130 }
131};
132
133#endif // UFO_CORE_INTENSITY_HPP
All vision-related classes and functions.
Definition cloud.hpp:49
Represents LiDAR/sensor return intensity as a single float value.
Definition intensity.hpp:66
friend constexpr bool operator==(Intensity lhs, Intensity rhs) noexcept=default
Equality comparison.
value_type intensity
The raw intensity value.
Definition intensity.hpp:75
float value_type
Underlying scalar type.
Definition intensity.hpp:70
friend constexpr auto operator<=>(Intensity lhs, Intensity rhs) noexcept=default
Three-way comparison (total order on the underlying float).