HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
sfloat_rgba32x4.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 <array>
14
15namespace hi::inline v1 {
16
22public:
23 constexpr sfloat_rgba32x4() = default;
24 constexpr sfloat_rgba32x4(sfloat_rgba32x4 const& rhs) noexcept = default;
25 constexpr sfloat_rgba32x4(sfloat_rgba32x4&& rhs) noexcept = default;
26 constexpr sfloat_rgba32x4& operator=(sfloat_rgba32x4 const& rhs) noexcept = default;
27 constexpr sfloat_rgba32x4& operator=(sfloat_rgba32x4&& rhs) noexcept = default;
28 [[nodiscard]] constexpr friend bool operator==(sfloat_rgba32x4 const&, sfloat_rgba32x4 const&) noexcept = default;
29
30 constexpr sfloat_rgba32x4(std::array<f32x4,4> const& rhs) noexcept
31 {
32 for (auto j = 0_uz; j != 4; ++j) {
33 for (auto i = 0_uz; i != 4; ++i) {
34 _v[j * 4 + i] = rhs[j][i];
35 }
36 }
37 }
38
39 constexpr sfloat_rgba32x4& operator=(std::array<f32x4, 4> const& rhs) noexcept
40 {
41 for (auto j = 0_uz; j != 4; ++j) {
42 for (auto i = 0_uz; i != 4; ++i) {
43 _v[j * 4 + i] = rhs[j][i];
44 }
45 }
46 return *this;
47 }
48
49 constexpr sfloat_rgba32x4(matrix3 const& rhs) noexcept : sfloat_rgba32x4(static_cast<std::array<f32x4, 4>>(rhs)) {}
50
51private:
53};
54
55} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm.hpp:13
4 x 4 x float32 pixel format.
Definition sfloat_rgba32x4.hpp:21