blob: 3463e655777fa0e28c1b1f83f7f3a1ef3aec7af2 [file] [log] [blame]
#ifndef _RIVE_PATH_SPACE_HPP_
#define _RIVE_PATH_SPACE_HPP_
#include <type_traits>
namespace rive
{
enum class PathSpace : unsigned char
{
Neither = 0,
Local = 1 << 1,
World = 1 << 2,
Difference = 1 << 3,
Clipping = 1 << 4
};
inline constexpr PathSpace operator&(PathSpace lhs, PathSpace rhs)
{
return static_cast<PathSpace>(
static_cast<std::underlying_type<PathSpace>::type>(lhs) &
static_cast<std::underlying_type<PathSpace>::type>(rhs));
}
inline constexpr PathSpace operator^(PathSpace lhs, PathSpace rhs)
{
return static_cast<PathSpace>(
static_cast<std::underlying_type<PathSpace>::type>(lhs) ^
static_cast<std::underlying_type<PathSpace>::type>(rhs));
}
inline constexpr PathSpace operator|(PathSpace lhs, PathSpace rhs)
{
return static_cast<PathSpace>(
static_cast<std::underlying_type<PathSpace>::type>(lhs) |
static_cast<std::underlying_type<PathSpace>::type>(rhs));
}
inline constexpr PathSpace operator~(PathSpace rhs)
{
return static_cast<PathSpace>(
~static_cast<std::underlying_type<PathSpace>::type>(rhs));
}
inline PathSpace& operator|=(PathSpace& lhs, PathSpace rhs)
{
lhs = static_cast<PathSpace>(
static_cast<std::underlying_type<PathSpace>::type>(lhs) |
static_cast<std::underlying_type<PathSpace>::type>(rhs));
return lhs;
}
inline PathSpace& operator&=(PathSpace& lhs, PathSpace rhs)
{
lhs = static_cast<PathSpace>(
static_cast<std::underlying_type<PathSpace>::type>(lhs) &
static_cast<std::underlying_type<PathSpace>::type>(rhs));
return lhs;
}
inline PathSpace& operator^=(PathSpace& lhs, PathSpace rhs)
{
lhs = static_cast<PathSpace>(
static_cast<std::underlying_type<PathSpace>::type>(lhs) ^
static_cast<std::underlying_type<PathSpace>::type>(rhs));
return lhs;
}
} // namespace rive
#endif