HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
src
hikogui
image
sfloat_rgba32.hpp
Go to the documentation of this file.
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
9
#pragma once
10
11
#include "../SIMD/module.hpp"
12
#include "../geometry/module.hpp"
13
#include "../color/module.hpp"
14
#include <algorithm>
15
16
namespace
hi::inline
v1
{
17
22
class
sfloat_rgba32
{
23
// Red, Green, Blue, Alpha in binary32 (native endian).
24
std::array<float, 4>
v;
25
26
public
:
27
sfloat_rgba32
() =
default
;
28
sfloat_rgba32
(
sfloat_rgba32
const
&rhs)
noexcept
=
default
;
29
sfloat_rgba32
(
sfloat_rgba32
&&rhs)
noexcept
=
default
;
30
sfloat_rgba32
&operator=(
sfloat_rgba32
const
&rhs)
noexcept
=
default
;
31
sfloat_rgba32
&operator=(
sfloat_rgba32
&&rhs)
noexcept
=
default
;
32
33
sfloat_rgba32
(f32x4
const
&rhs) noexcept : v(
static_cast<
std::array<float, 4>
>
(rhs)) {}
34
35
sfloat_rgba32
&operator=(f32x4
const
&rhs)
noexcept
36
{
37
v =
static_cast<
std::array<float, 4>
>
(rhs);
38
return
*
this
;
39
}
40
41
operator
f32x4()
const
noexcept
42
{
43
return
f32x4{v};
44
}
45
46
sfloat_rgba32
(
point3
const
&rhs) noexcept :
sfloat_rgba32
(f32x4{rhs}) {}
47
48
sfloat_rgba32
(aarectangle
const
&rhs) noexcept :
sfloat_rgba32
(f32x4{rhs}) {}
49
50
sfloat_rgba32
(corner_radii
const
&rhs) noexcept :
sfloat_rgba32
(f32x4{rhs}) {}
51
52
operator
aarectangle()
const
noexcept
53
{
54
return
aarectangle{f32x4{v}};
55
}
56
57
[[nodiscard]]
friend
bool
operator==(
sfloat_rgba32
const
&lhs,
sfloat_rgba32
const
&rhs)
noexcept
=
default
;
58
};
59
60
}
// namespace hi::inline v1
v1
DOXYGEN BUG.
Definition
algorithm.hpp:13
v1::geo::point< float, 3 >
v1::sfloat_rgba32
4 x float32 pixel format.
Definition
sfloat_rgba32.hpp:22
std::array
Generated on Mon Apr 22 2024 12:52:51 for HikoGUI by
1.10.0