7#ifndef SE_COMMON_RGB_HPP
8#define SE_COMMON_RGB_HPP
19 std::uint8_t
r = 0x00;
20 std::uint8_t
g = 0x00;
21 std::uint8_t
b = 0x00;
33 assert(
lhs.r +
rhs.r <= std::numeric_limits<std::uint8_t>::max() &&
"Avoid overflow.");
34 assert(
lhs.g +
rhs.g <= std::numeric_limits<std::uint8_t>::max() &&
"Avoid overflow.");
35 assert(
lhs.b +
rhs.b <= std::numeric_limits<std::uint8_t>::max() &&
"Avoid overflow.");
47 assert(
t >= 0.0f &&
"Avoid under/overflow.");
48 assert(
t <= 1.0f &&
"Avoid under/overflow.");
Helper wrapper to allocate and de-allocate octants in the octree.
Definition bounded_vector.hpp:14
A colour represented as a Red-Green-Blue tuple with 8-bits per channel.
Definition rgb.hpp:18
friend bool operator<(const RGB lhs, const RGB rhs)
Definition rgb.hpp:72
friend bool operator!=(const RGB lhs, const RGB rhs)
Definition rgb.hpp:67
friend RGB operator*(const float t, RGB rhs)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition rgb.hpp:56
std::uint8_t b
Definition rgb.hpp:21
friend bool operator==(const RGB lhs, const RGB rhs)
Definition rgb.hpp:62
std::uint8_t r
Definition rgb.hpp:19
friend RGB operator*(RGB lhs, const float t)
Scale all channels of rhs by the factor t in the interval [0, 1] inclusive.
Definition rgb.hpp:45
friend bool operator>=(const RGB lhs, const RGB rhs)
Definition rgb.hpp:88
friend bool operator>(const RGB lhs, const RGB rhs)
Definition rgb.hpp:78
friend bool operator<=(const RGB lhs, const RGB rhs)
Definition rgb.hpp:83
std::uint8_t g
Definition rgb.hpp:20
friend RGB operator+(RGB lhs, const RGB rhs)
Add lhs and rhs channel-wise.
Definition rgb.hpp:30