HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
sfloat_rgba32x4.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#include "numeric_array.hpp"
9#include <array>
10
11namespace hi::inline v1 {
12
14public:
15 constexpr sfloat_rgba32x4() = default;
16 constexpr sfloat_rgba32x4(sfloat_rgba32x4 const& rhs) noexcept = default;
17 constexpr sfloat_rgba32x4(sfloat_rgba32x4&& rhs) noexcept = default;
18 constexpr sfloat_rgba32x4& operator=(sfloat_rgba32x4 const& rhs) noexcept = default;
19 constexpr sfloat_rgba32x4& operator=(sfloat_rgba32x4&& rhs) noexcept = default;
20 [[nodiscard]] constexpr friend bool operator==(sfloat_rgba32x4 const&, sfloat_rgba32x4 const&) noexcept = default;
21
22 constexpr sfloat_rgba32x4(std::array<f32x4,4> const& rhs) noexcept
23 {
24 for (auto j = 0; j != 4; ++j) {
25 for (auto i = 0; i != 4; ++i) {
26 _v[j*4 + i] = rhs[j][i];
27 }
28 }
29 }
30
31 constexpr sfloat_rgba32x4& operator=(std::array<f32x4, 4> const& rhs) noexcept
32 {
33 for (auto j = 0; j != 4; ++j) {
34 for (auto i = 0; i != 4; ++i) {
35 _v[j * 4 + i] = rhs[j][i];
36 }
37 }
38 return *this;
39 }
40
41 constexpr sfloat_rgba32x4(matrix3 const& rhs) noexcept : sfloat_rgba32x4(static_cast<std::array<f32x4, 4>>(rhs)) {}
42
43private:
45};
46
47} // namespace hi::inline v1
Defines geo::matrix, matrix2 and matrix3.
DOXYGEN BUG.
Definition algorithm.hpp:15
Definition sfloat_rgba32x4.hpp:13