46#include <ufo/utility/enum.hpp>
58enum class MapType : std::uint64_t {
59 NONE = std::uint64_t(0),
61 ALL =
~std::uint64_t(0),
62 OCCUPANCY = std::uint64_t(1) << 0,
63 COLOR = std::uint64_t(1) << 1,
64 TIME = std::uint64_t(1) << 2,
65 COUNT = std::uint64_t(1) << 3,
66 REFLECTION = std::uint64_t(1) << 4,
67 INTENSITY = std::uint64_t(1) << 5,
68 SURFEL = std::uint64_t(1) << 6,
69 VOID_REGION = std::uint64_t(1) << 7,
70 DISTANCE = std::uint64_t(1) << 8,
71 LABEL = std::uint64_t(1) << 9,
72 SEMANTIC = std::uint64_t(1) << 10,
73 LABEL_SET = std::uint64_t(1) << 11,
74 SEMANTIC_SET = std::uint64_t(1) << 12,
75 COST = std::uint64_t(1) << 13,
78[[nodiscard]]
constexpr MapType operator|(MapType
a, MapType
b)
noexcept
80 return MapType(to_underlying(
a) | to_underlying(
b));
83[[nodiscard]]
constexpr MapType operator&(MapType
a, MapType
b)
noexcept
85 return MapType(to_underlying(
a) & to_underlying(
b));
88[[nodiscard]]
constexpr std::string_view to_string(MapType mt)
91 case MapType::ALL:
return std::string_view{
"all"};
92 case MapType::NONE:
return std::string_view{
"none"};
93 case MapType::OCCUPANCY:
return std::string_view{
"occupancy"};
94 case MapType::COLOR:
return std::string_view{
"color"};
95 case MapType::TIME:
return std::string_view{
"time"};
96 case MapType::COUNT:
return std::string_view{
"count"};
97 case MapType::REFLECTION:
return std::string_view{
"reflection"};
98 case MapType::INTENSITY:
return std::string_view{
"intensity"};
99 case MapType::SURFEL:
return std::string_view{
"surfel"};
100 case MapType::VOID_REGION:
return std::string_view{
"void_region"};
101 case MapType::DISTANCE:
return std::string_view{
"distance"};
102 case MapType::LABEL:
return std::string_view{
"label"};
103 case MapType::SEMANTIC:
return std::string_view{
"semantic"};
104 case MapType::LABEL_SET:
return std::string_view{
"label_set"};
105 case MapType::SEMANTIC_SET:
return std::string_view{
"semantic_set"};
106 case MapType::COST:
return std::string_view{
"cost"};
107 default:
return std::string_view{
"unknown"};
111[[nodiscard]]
inline std::vector<std::string> mapTypes(MapType mt)
113 constexpr std::size_t
const max_num_map_types =
114 std::numeric_limits<std::uint64_t>::digits;
116 std::vector<std::string> res;
117 for (std::size_t i{}; max_num_map_types > i; ++i) {
118 auto name = to_string(mt &
static_cast<MapType
>(std::uint64_t(1) << i));
119 if (std::string_view{
"none"} != name && std::string_view{
"unknown"} != name) {
120 res.emplace_back(name);
126inline std::ostream& operator<<(std::ostream& os, MapType mt)
128 constexpr std::size_t
const max_num_map_types =
129 std::numeric_limits<std::uint64_t>::digits;
132 for (std::size_t i{}; max_num_map_types > i; ++i) {
133 auto name = to_string(mt &
static_cast<MapType
>(std::uint64_t(1) << i));
134 if (std::string_view{
"none"} != name && std::string_view{
"unknown"} != name) {
All vision-related classes and functions.
constexpr T b(Lab< T, Flags > color) noexcept
Returns the un-weighted blue–yellow axis value.
constexpr T a(Lab< T, Flags > color) noexcept
Returns the un-weighted green–red axis value.