45#ifndef UFO_VISION_COLOR_FLAGS_HPP
46#define UFO_VISION_COLOR_FLAGS_HPP
85 return static_cast<ColorFlags>(std::to_underlying(
a) | std::to_underlying(
b));
96 return static_cast<ColorFlags>(std::to_underlying(
a) & std::to_underlying(
b));
136 case None:
return "None";
137 case Alpha:
return "Alpha";
138 case Weight:
return "Weight";
147inline std::ostream& operator<<(std::ostream& os,
ColorFlags flags)
158struct std::formatter<
ufo::ColorFlags> : std::formatter<std::string_view> {
161 return std::formatter<std::string_view>::format(
ufo::toString(flags), ctx);
consteval bool alphaset(ColorFlags flags) noexcept
Returns true if the Alpha flag is set.
constexpr ColorFlags operator~(ColorFlags a) noexcept
Bitwise complement - inverts all valid ColorFlags bits.
ColorFlags
Bitmask controlling optional fields in a Color specialisation.
consteval bool weightset(ColorFlags flags) noexcept
Returns true if the Weight flag is set.
@ Alpha
Include an alpha channel.
@ None
No optional fields.
@ Weight
Include an accumulation weight.
@ All
All optional fields.
All vision-related classes and functions.
constexpr T b(Lab< T, Flags > color) noexcept
Returns the un-weighted blue–yellow axis value.
constexpr std::string_view toString(ScalarType type) noexcept
Returns a human-readable string for a ScalarType value.
constexpr T a(Lab< T, Flags > color) noexcept
Returns the un-weighted green–red axis value.
Represents a generic scalar weight as a single float value.