HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
uint_abgr8_pack.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 "../geometry/geometry.hpp"
12#include "../macros.hpp"
13#include <hikocpu/hikocpu.hpp>
14#include <algorithm>
15#include <array>
16#include <bit>
17#include <cstdint>
18
19hi_export_module(hikogui.image.uint_abgr8_pack);
20
21hi_export namespace hi::inline v1 {
22
28 uint32_t v = {};
29
30public:
31 constexpr uint_abgr8_pack() = default;
32 constexpr uint_abgr8_pack(uint_abgr8_pack const &rhs) noexcept = default;
33 constexpr uint_abgr8_pack(uint_abgr8_pack &&rhs) noexcept = default;
34 constexpr uint_abgr8_pack &operator=(uint_abgr8_pack const &rhs) noexcept = default;
35 constexpr uint_abgr8_pack &operator=(uint_abgr8_pack &&rhs) noexcept = default;
36
37 constexpr explicit uint_abgr8_pack(uint32_t const &rhs) noexcept : v(rhs) {}
38 constexpr uint_abgr8_pack &operator=(uint32_t const &rhs) noexcept
39 {
40 v = rhs;
41 return *this;
42 }
43 constexpr explicit operator uint32_t() noexcept
44 {
45 return v;
46 }
47
48 constexpr explicit uint_abgr8_pack(f32x4 const &rhs) noexcept : v(std::bit_cast<decltype(v)>(u8x4{rhs})) {}
49
50 constexpr uint_abgr8_pack &operator=(f32x4 const &rhs) noexcept
51 {
52 v = std::bit_cast<decltype(v)>(u8x4{rhs});
53 return *this;
54 }
55
56 constexpr explicit uint_abgr8_pack(corner_radii const &rhs) noexcept : uint_abgr8_pack(static_cast<f32x4>(rhs)) {}
57
58 [[nodiscard]] constexpr friend bool operator==(uint_abgr8_pack const &lhs, uint_abgr8_pack const &rhs) noexcept = default;
59};
60
61} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
4 x uint8_t pixel packed format.
Definition uint_abgr8_pack.hpp:27