HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
axis.hpp
1// Copyright Take Vos 2021.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7namespace hi::inline v1 {
8
9enum class axis : unsigned char {
10 none = 0,
11 x = 1,
12 y = 2,
13 z = 4,
14 both = x | y,
15 all = x | y | z,
16
17 row = x,
18 column = y,
19
20 horizontal = x,
21 vertical = y,
22
23 width = x,
24 height = y,
25 depth = z,
26};
27
28[[nodiscard]] constexpr axis operator&(axis const& lhs, axis const& rhs) noexcept
29{
30 return static_cast<axis>(static_cast<unsigned char>(lhs) & static_cast<unsigned char>(rhs));
31}
32
33[[nodiscard]] constexpr axis operator|(axis const& lhs, axis const& rhs) noexcept
34{
35 return static_cast<axis>(static_cast<unsigned char>(lhs) | static_cast<unsigned char>(rhs));
36}
37
38[[nodiscard]] constexpr axis& operator&=(axis& lhs, axis const& rhs) noexcept
39{
40 return lhs = lhs & rhs;
41}
42
43[[nodiscard]] constexpr axis& operator|=(axis& lhs, axis const& rhs) noexcept
44{
45 return lhs = lhs | rhs;
46}
47
48[[nodiscard]] constexpr bool to_bool(axis const& rhs) noexcept
49{
50 return to_bool(static_cast<unsigned char>(rhs));
51}
52
53} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm.hpp:15
constexpr alignment operator|(horizontal_alignment lhs, vertical_alignment rhs) noexcept
Combine vertical and horizontal alignment.
Definition alignment.hpp:216