HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
R32G32SFloat.hpp
1// Copyright 2020 Pokitec
2// All rights reserved.
3
4#pragma once
5
6#include "TTauri/Foundation/vec.hpp"
7#include <immintrin.h>
8#include <emmintrin.h>
9#include <algorithm>
10
11namespace tt {
12
14 alignas(sizeof(float) * 2)
15 // Red, Green, Blue, Alpha in binary32 (native endian).
17
18public:
19 tt_force_inline R32G32SFloat() = default;
20 tt_force_inline R32G32SFloat(R32G32SFloat const &rhs) noexcept = default;
21 tt_force_inline R32G32SFloat(R32G32SFloat &&rhs) noexcept = default;
22 tt_force_inline R32G32SFloat &operator=(R32G32SFloat const &rhs) noexcept = default;
23 tt_force_inline R32G32SFloat &operator=(R32G32SFloat &&rhs) noexcept = default;
24
25 tt_force_inline R32G32SFloat(vec const &rhs) noexcept :
26 v(static_cast<decltype(v)>(rhs)) {}
27
28 tt_force_inline R32G32SFloat &operator=(vec const &rhs) noexcept {
29 v = static_cast<decltype(v)>(rhs);
30 return *this;
31 }
32
33 tt_force_inline operator vec () const noexcept {
34 return vec{v};
35 }
36
37 [[nodiscard]] tt_force_inline friend bool operator==(R32G32SFloat const &lhs, R32G32SFloat const &rhs) noexcept {
38 return lhs.v == rhs.v;
39 }
40 [[nodiscard]] tt_force_inline friend bool operator!=(R32G32SFloat const &lhs, R32G32SFloat const &rhs) noexcept {
41 return !(lhs == rhs);
42 }
43};
44
45}
Definition R32G32SFloat.hpp:13
A 4D vector.
Definition vec.hpp:37