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 "../macros.hpp"
14#include <array>
15
16namespace hi::inline v1 {
17
23public:
24 constexpr sfloat_rgba32x4() = default;
25 constexpr sfloat_rgba32x4(sfloat_rgba32x4 const& rhs) noexcept = default;
26 constexpr sfloat_rgba32x4(sfloat_rgba32x4&& rhs) noexcept = default;
27 constexpr sfloat_rgba32x4& operator=(sfloat_rgba32x4 const& rhs) noexcept = default;
28 constexpr sfloat_rgba32x4& operator=(sfloat_rgba32x4&& rhs) noexcept = default;
29 [[nodiscard]] constexpr friend bool operator==(sfloat_rgba32x4 const&, sfloat_rgba32x4 const&) noexcept = default;
30
31 constexpr sfloat_rgba32x4(std::array<f32x4,4> const& rhs) noexcept
32 {
33 for (auto j = 0_uz; j != 4; ++j) {
34 for (auto i = 0_uz; i != 4; ++i) {
35 _v[j * 4 + i] = rhs[j][i];
36 }
37 }
38 }
39
40 constexpr sfloat_rgba32x4& operator=(std::array<f32x4, 4> const& rhs) noexcept
41 {
42 for (auto j = 0_uz; j != 4; ++j) {
43 for (auto i = 0_uz; i != 4; ++i) {
44 _v[j * 4 + i] = rhs[j][i];
45 }
46 }
47 return *this;
48 }
49
50 constexpr sfloat_rgba32x4(matrix3 const& rhs) noexcept : sfloat_rgba32x4(static_cast<std::array<f32x4, 4>>(rhs)) {}
51
52private:
54};
55
56} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm.hpp:16
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
4 x 4 x float32 pixel format.
Definition sfloat_rgba32x4.hpp:22