opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
liboscar
graphics
unorm8.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
liboscar/graphics/unorm.h
>
4
#include <
liboscar/utilities/conversion.h
>
5
6
#include <cstddef>
7
#include <cstdint>
8
9
namespace
osc
10
{
11
// A normalized unsigned 8-bit integer that can be used to store a floating-point
12
// number in the (clamped) range [0.0f, 1.0f]
13
//
14
// see: https://www.khronos.org/opengl/wiki/Normalized_Integer
15
using
Unorm8
=
Unorm<uint8_t>
;
16
17
template
<>
18
struct
Converter
<std::
byte
,
Unorm8
>
final
{
19
constexpr
Unorm8
operator()
(std::byte raw_value)
const
20
{
21
return
Unorm8
{
static_cast<
uint8_t
>
(raw_value)};
22
}
23
};
24
25
template
<>
26
struct
Converter
<
Unorm8
, std::
byte
>
final
{
27
constexpr
std::byte
operator()
(
Unorm8
unorm
)
const
28
{
29
return
static_cast<
std::byte
>
(
unorm
.raw_value());
30
}
31
};
32
}
osc::Unorm
Definition
unorm.h:20
conversion.h
osc
Definition
custom_decoration_generator.h:5
osc::to
constexpr U to(T &&value)
Definition
conversion.h:56
osc::Converter< Unorm8, std::byte >::operator()
constexpr std::byte operator()(Unorm8 unorm) const
Definition
unorm8.h:27
osc::Converter< std::byte, Unorm8 >::operator()
constexpr Unorm8 operator()(std::byte raw_value) const
Definition
unorm8.h:19
osc::Converter
Definition
conversion.h:30
unorm.h
Generated by
1.9.8