HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
src
ttauri
geometry
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
7
namespace
tt {
8
9
enum 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
24
[[nodiscard]]
constexpr
axis operator&(axis
const
&lhs, axis
const
&rhs)
noexcept
25
{
26
return
static_cast<
axis
>
(
static_cast<
unsigned
char
>
(lhs) &
static_cast<
unsigned
char
>
(rhs));
27
}
28
29
[[nodiscard]]
constexpr
axis
operator|
(axis
const
&lhs, axis
const
&rhs)
noexcept
30
{
31
return
static_cast<
axis
>
(
static_cast<
unsigned
char
>
(lhs) |
static_cast<
unsigned
char
>
(rhs));
32
}
33
34
[[nodiscard]]
constexpr
bool
any(axis
const
&rhs)
noexcept
35
{
36
return
static_cast<
bool
>
(
static_cast<
unsigned
char
>
(rhs));
37
}
38
39
}
tt::operator|
constexpr alignment operator|(vertical_alignment lhs, horizontal_alignment rhs) noexcept
Combine vertical and horizontal alignment.
Definition
alignment.hpp:91
Generated on Mon Apr 22 2024 12:53:30 for HikoGUI by
1.10.0