RGB colour stored as a 32-bit value with red in the least significant byte.
More...
RGB colour stored as a 32-bit value with red in the least significant byte.
|
| constexpr | win_colorref ()=default |
| | Construct black (all channels zero).
|
| constexpr | win_colorref (uint32_t v) noexcept |
| | Construct from a packed RGB value, discarding the high byte.
|
| constexpr | win_colorref (unsigned char R, unsigned char G, unsigned char B) noexcept |
| | Construct from 8-bit red, green and blue components.
|
| constexpr | win_colorref (double R, double G, double B) noexcept |
| | Construct from unit-range red, green and blue components.
|
| constexpr unsigned char | r () const noexcept |
| | Get the 8-bit red component.
|
| constexpr unsigned char | g () const noexcept |
| | Get the 8-bit green component.
|
| constexpr unsigned char | b () const noexcept |
| | Get the 8-bit blue component.
|
| constexpr double | r_d () const noexcept |
| | Get the red component in the range 0 to 1.
|
| constexpr double | g_d () const noexcept |
| | Get the green component in the range 0 to 1.
|
| constexpr double | b_d () const noexcept |
| | Get the blue component in the range 0 to 1.
|
| constexpr std::uint32_t | u32 () const noexcept |
| | Get the packed RGB value.
|
|
| static constexpr unsigned char | d_u8 (double v) noexcept |
| | Convert a unit-range colour component to an 8-bit component.
|
◆ win_colorref() [1/4]
| envitia::win_colorref::win_colorref |
( |
| ) |
|
|
constexprdefault |
Construct black (all channels zero).
◆ win_colorref() [2/4]
| envitia::win_colorref::win_colorref |
( |
uint32_t | v | ) |
|
|
inlineexplicitconstexprnoexcept |
Construct from a packed RGB value, discarding the high byte.
- Parameters
-
◆ win_colorref() [3/4]
| envitia::win_colorref::win_colorref |
( |
unsigned char | R, |
|
|
unsigned char | G, |
|
|
unsigned char | B ) |
|
inlineconstexprnoexcept |
Construct from 8-bit red, green and blue components.
- Parameters
-
| R | Red component. |
| G | Green component. |
| B | Blue component. |
◆ win_colorref() [4/4]
| envitia::win_colorref::win_colorref |
( |
double | R, |
|
|
double | G, |
|
|
double | B ) |
|
inlineconstexprnoexcept |
Construct from unit-range red, green and blue components.
- Parameters
-
| R | Red component in the range 0 to 1. |
| G | Green component in the range 0 to 1. |
| B | Blue component in the range 0 to 1. |
◆ b()
| unsigned char envitia::win_colorref::b |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the 8-bit blue component.
- Returns
- The blue component in the range 0 to 255.
◆ b_d()
| double envitia::win_colorref::b_d |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the blue component in the range 0 to 1.
- Returns
- The normalized blue component.
◆ d_u8()
| constexpr unsigned char envitia::win_colorref::d_u8 |
( |
double | v | ) |
|
|
inlinestaticconstexprnoexcept |
Convert a unit-range colour component to an 8-bit component.
- Parameters
-
| v | Component value in the range 0 to 1. |
- Returns
- The component scaled to an unsigned 8-bit value.
◆ g()
| unsigned char envitia::win_colorref::g |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the 8-bit green component.
- Returns
- The green component in the range 0 to 255.
◆ g_d()
| double envitia::win_colorref::g_d |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the green component in the range 0 to 1.
- Returns
- The normalized green component.
◆ r()
| unsigned char envitia::win_colorref::r |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the 8-bit red component.
- Returns
- The red component in the range 0 to 255.
◆ r_d()
| double envitia::win_colorref::r_d |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the red component in the range 0 to 1.
- Returns
- The normalized red component.
◆ u32()
| std::uint32_t envitia::win_colorref::u32 |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the packed RGB value.
- Returns
- The packed colour value with red in the least significant byte.