opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
color_component.h
Go to the documentation of this file.
1#pragma once
2
3#include <concepts>
4
5namespace osc
6{
7 // Is satisfied when `T` can be used as a color component. In oscar,
8 // color components have to be fluid to interconvert between a normalized
9 // floating-point and unsigned integer representation. The reason why
10 // is application code can use either of the two. E.g:
11 //
12 // Color32{}.r = 0xff; // the 0xff byte means white
13 // Color{}.r = 1.0f; // the normalized float means white
14 // Color{}.r = 1.2f; // the normalized float means "more than white" (i.e. HDR)
15 // Color var = Color32{0xff}; // should be possible
16 template<typename T>
18 std::floating_point<T> or
19 (
20 std::constructible_from<T, float> and
21 std::assignable_from<T&, float> and
22 std::constructible_from<float, const T&>
23 );
24}
Definition color_component.h:17
Definition custom_decoration_generator.h:5
constexpr U to(T &&value)
Definition conversion.h:56
and
Definition algorithms.h:158