Represents a color with red, green, blue, and alpha channels.
More...
#include <image_data.hpp>
|
| | Color () |
| | Default constructor. Initializes to black with full opacity.
|
| | Color (uint8_t iR, uint8_t iG, uint8_t iB) |
| | Constructs a fully opaque RGB color.
|
| | Color (uint8_t iR, uint8_t iG, uint8_t iB, uint8_t iA) |
| | Constructs a color with specified RGBA channels.
|
| bool | operator== (Color const &rhs) const |
| | Equality operator for comparing two colors.
|
|
| uint8_t | r = 0 |
| uint8_t | g = 0 |
| uint8_t | b = 0 |
| uint8_t | a = 255 |
Represents a color with red, green, blue, and alpha channels.
Definition at line 20 of file image_data.hpp.
◆ Color() [1/3]
| rendering_engine::Color::Color |
( |
| ) |
|
|
inline |
Default constructor. Initializes to black with full opacity.
Definition at line 25 of file image_data.hpp.
26 :
27 Color( uint8_t{0U}, uint8_t{0U}, uint8_t{0U}, uint8_t{255U} )
28 {}
Color()
Default constructor. Initializes to black with full opacity.
◆ Color() [2/3]
| rendering_engine::Color::Color |
( |
uint8_t | iR, |
|
|
uint8_t | iG, |
|
|
uint8_t | iB ) |
|
inline |
Constructs a fully opaque RGB color.
- Parameters
-
| iR | Red channel [0�255] |
| iG | Green channel [0�255] |
| iB | Blue channel [0�255] |
Definition at line 35 of file image_data.hpp.
36 :
37 Color( iR, iG, iB, uint8_t{255U} )
38 {}
◆ Color() [3/3]
| rendering_engine::Color::Color |
( |
uint8_t | iR, |
|
|
uint8_t | iG, |
|
|
uint8_t | iB, |
|
|
uint8_t | iA ) |
|
inline |
Constructs a color with specified RGBA channels.
- Parameters
-
| iR | Red channel [0�255] |
| iG | Green channel [0�255] |
| iB | Blue channel [0�255] |
| iA | Alpha channel [0�255] |
Definition at line 46 of file image_data.hpp.
47 :
48 r(std::clamp(iR, uint8_t{0U}, uint8_t{255U})),
49 g(std::clamp(iG, uint8_t{0U}, uint8_t{255U})),
50 b(std::clamp(iB, uint8_t{0U}, uint8_t{255U})),
51 a(std::clamp(iA, uint8_t{0U}, uint8_t{255U}))
52 {}
◆ operator==()
| bool rendering_engine::Color::operator== |
( |
Color const & | rhs | ) |
const |
|
inline |
Equality operator for comparing two colors.
Definition at line 57 of file image_data.hpp.
58 {
59 return (this->
r == rhs.r) && (this->
g == rhs.g) && (this->
b == rhs.b) && (this->
a == rhs.a);
60 }
| uint8_t rendering_engine::Color::a = 255 |
| uint8_t rendering_engine::Color::b = 0 |
| uint8_t rendering_engine::Color::g = 0 |
| uint8_t rendering_engine::Color::r = 0 |
The documentation for this struct was generated from the following file: