Represents a color with red, green, blue, and alpha channels.
More...
#include <image_data.hpp>
|
| | Color () |
| | Default constructor. Initializes to black with full opacity. More...
|
| |
| | Color (uint8_t iR, uint8_t iG, uint8_t iB) |
| | Constructs a fully opaque RGB color. More...
|
| |
| | Color (uint8_t iR, uint8_t iG, uint8_t iB, uint8_t iA) |
| | Constructs a color with specified RGBA channels. More...
|
| |
| bool | operator== (Color const &rhs) const |
| | Equality operator for comparing two colors. More...
|
| |
|
| 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 22 of file image_data.hpp.
◆ Color() [1/3]
| rendering_engine::Color::Color |
( |
| ) |
|
|
inline |
Default constructor. Initializes to black with full opacity.
Definition at line 27 of file image_data.hpp.
28 :
29 Color( uint8_t{0U}, uint8_t{0U}, uint8_t{0U}, uint8_t{255U} )
30 {}
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 37 of file image_data.hpp.
38 :
39 Color( iR, iG, iB, uint8_t{255U} )
40 {}
◆ 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 48 of file image_data.hpp.
49 :
50 r(std::clamp(iR, uint8_t{0U}, uint8_t{255U})),
51 g(std::clamp(iG, uint8_t{0U}, uint8_t{255U})),
52 b(std::clamp(iB, uint8_t{0U}, uint8_t{255U})),
53 a(std::clamp(iA, uint8_t{0U}, uint8_t{255U}))
54 {}
◆ operator==()
| bool rendering_engine::Color::operator== |
( |
Color const & |
rhs | ) |
const |
|
inline |
Equality operator for comparing two colors.
Definition at line 59 of file image_data.hpp.
60 {
61 return (this->
r == rhs.r) && (this->
g == rhs.g) && (this->
b == rhs.b) && (this->
a == rhs.a);
62 }
| 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: