opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
liboscar
graphics
color32.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
liboscar/graphics/rgba.h
>
4
#include <
liboscar/graphics/unorm8.h
>
5
6
#include <bit>
7
#include <concepts>
8
#include <cstdint>
9
10
namespace
osc
11
{
12
using
Color32
=
Rgba<Unorm8>
;
13
14
template
<std::
int
egral T>
15
constexpr
T
to_integer
(
const
Color32
&
color32
)
16
{
17
return
std::bit_cast<T>(
color32
);
18
}
19
}
20
21
// specialized hashing function for `Color32`
22
template
<>
23
struct
std::hash<
osc
::Color32> final {
24
size_t
operator()
(
const
osc::Color32
& color32)
const
noexcept
25
{
26
return
std::hash<uint32_t>{}(std::bit_cast<uint32_t>(color32));
27
}
28
};
osc
Definition
custom_decoration_generator.h:5
osc::Key::T
@ T
osc::to
constexpr U to(T &&value)
Definition
conversion.h:56
osc::to_integer
constexpr T to_integer(const Color32 &color32)
Definition
color32.h:15
rgba.h
osc::Rgba
Definition
rgba.h:20
std::hash< osc::Color32 >::operator()
size_t operator()(const osc::Color32 &color32) const noexcept
Definition
color32.h:24
unorm8.h
Generated by
1.9.8