R-G-B color vector. More...
#include <helios_vector_types.h>
Public Member Functions | |
constexpr | RGBcolor () |
Default constructor - initializes color to black. | |
constexpr | RGBcolor (float red, float green, float blue) |
Constructor given three floats denoting R-G-B components. | |
constexpr | RGBcolor (const float C[3]) |
Constructor given an array of three floats denoting R-G-B components. | |
RGBcolor (const std::vector< float > &C) | |
Constructor given a vector of three floats denoting R-G-B components. | |
constexpr | RGBcolor (const vec3 &C) |
Constructor given a vec3 denoting R-G-B components. | |
void | scale (float scale_factor) |
Scale RGBcolor by some factor. | |
constexpr RGBcolor | operator+ (const RGBcolor &c) const noexcept |
Add two RGB colors together color-by-color. | |
constexpr RGBcolor | operator- (const RGBcolor &c) const noexcept |
Subtract two RGB colors color-by-color. | |
constexpr bool | operator== (const RGBcolor &c) const noexcept |
check for equality of two RGB colors | |
constexpr bool | operator!= (const RGBcolor &c) const noexcept |
check for inequality of two RGB colors | |
Data Fields | |
float | r |
Red color component. | |
float | g |
Green color component. | |
float | b |
Blue color component. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const helios::RGBcolor &c) |
write RGBcolor to output stream | |
R-G-B color vector.
Definition at line 1287 of file helios_vector_types.h.
|
inlineconstexpr |
Default constructor - initializes color to black.
Definition at line 1301 of file helios_vector_types.h.
|
inlineconstexpr |
Constructor given three floats denoting R-G-B components.
[in] | red | Red color component |
[in] | green | Green color component |
[in] | blue | Blue color component |
Definition at line 1311 of file helios_vector_types.h.
|
inlineexplicitconstexpr |
Constructor given an array of three floats denoting R-G-B components.
[in] | C | Array (3-elements) of R-G-B color components |
Definition at line 1319 of file helios_vector_types.h.
|
inlineexplicit |
Constructor given a vector of three floats denoting R-G-B components.
[in] | C | Vector (3-elements) of R-G-B color components |
Definition at line 1327 of file helios_vector_types.h.
|
inlineexplicitconstexpr |
Constructor given a vec3 denoting R-G-B components.
[in] | C | vec3 of R-G-B color components |
Definition at line 1340 of file helios_vector_types.h.
|
constexprnoexcept |
check for inequality of two RGB colors
Definition at line 1414 of file helios_vector_types.h.
Add two RGB colors together color-by-color.
Definition at line 1400 of file helios_vector_types.h.
Subtract two RGB colors color-by-color.
Definition at line 1404 of file helios_vector_types.h.
|
constexprnoexcept |
check for equality of two RGB colors
Definition at line 1408 of file helios_vector_types.h.
|
inline |
Scale RGBcolor by some factor.
[in] | scale_factor | Positive scaling factor |
Definition at line 1347 of file helios_vector_types.h.
|
friend |
write RGBcolor to output stream
Definition at line 1357 of file helios_vector_types.h.
float helios::RGBcolor::b |
Blue color component.
Takes a value between 0 and 1.
Definition at line 1298 of file helios_vector_types.h.
float helios::RGBcolor::g |
Green color component.
Takes a value between 0 and 1.
Definition at line 1295 of file helios_vector_types.h.
float helios::RGBcolor::r |
Red color component.
Takes a value between 0 and 1.
Definition at line 1292 of file helios_vector_types.h.