1.3.49
 
Loading...
Searching...
No Matches
helios::RGBcolor Struct Reference

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
 

Detailed Description

R-G-B color vector.

Definition at line 1287 of file helios_vector_types.h.

Constructor & Destructor Documentation

◆ RGBcolor() [1/5]

constexpr helios::RGBcolor::RGBcolor ( )
inlineconstexpr

Default constructor - initializes color to black.

Definition at line 1301 of file helios_vector_types.h.

◆ RGBcolor() [2/5]

constexpr helios::RGBcolor::RGBcolor ( float  red,
float  green,
float  blue 
)
inlineconstexpr

Constructor given three floats denoting R-G-B components.

Parameters
[in]redRed color component
[in]greenGreen color component
[in]blueBlue color component
Note
If arguments are outside of the range 0 to 1, values are clamped.

Definition at line 1311 of file helios_vector_types.h.

◆ RGBcolor() [3/5]

constexpr helios::RGBcolor::RGBcolor ( const float  C[3])
inlineexplicitconstexpr

Constructor given an array of three floats denoting R-G-B components.

Parameters
[in]CArray (3-elements) of R-G-B color components
Note
If arguments are outside of the range 0 to 1, values are clamped.

Definition at line 1319 of file helios_vector_types.h.

◆ RGBcolor() [4/5]

helios::RGBcolor::RGBcolor ( const std::vector< float > &  C)
inlineexplicit

Constructor given a vector of three floats denoting R-G-B components.

Parameters
[in]CVector (3-elements) of R-G-B color components
Note
If arguments are outside of the range 0 to 1, values are clamped.

Definition at line 1327 of file helios_vector_types.h.

◆ RGBcolor() [5/5]

constexpr helios::RGBcolor::RGBcolor ( const vec3 C)
inlineexplicitconstexpr

Constructor given a vec3 denoting R-G-B components.

Parameters
[in]Cvec3 of R-G-B color components
Note
If arguments are outside of the range 0 to 1, values are clamped.

Definition at line 1340 of file helios_vector_types.h.

Member Function Documentation

◆ operator!=()

constexpr bool helios::RGBcolor::operator!= ( const RGBcolor c) const
constexprnoexcept

check for inequality of two RGB colors

Definition at line 1414 of file helios_vector_types.h.

◆ operator+()

constexpr RGBcolor helios::RGBcolor::operator+ ( const RGBcolor c) const
constexprnoexcept

Add two RGB colors together color-by-color.

Definition at line 1400 of file helios_vector_types.h.

◆ operator-()

constexpr RGBcolor helios::RGBcolor::operator- ( const RGBcolor c) const
constexprnoexcept

Subtract two RGB colors color-by-color.

Definition at line 1404 of file helios_vector_types.h.

◆ operator==()

constexpr bool helios::RGBcolor::operator== ( const RGBcolor c) const
constexprnoexcept

check for equality of two RGB colors

Definition at line 1408 of file helios_vector_types.h.

◆ scale()

void helios::RGBcolor::scale ( float  scale_factor)
inline

Scale RGBcolor by some factor.

Parameters
[in]scale_factorPositive scaling factor

Definition at line 1347 of file helios_vector_types.h.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const helios::RGBcolor c 
)
friend

write RGBcolor to output stream

Definition at line 1357 of file helios_vector_types.h.

Field Documentation

◆ b

float helios::RGBcolor::b

Blue color component.

Takes a value between 0 and 1.

Definition at line 1298 of file helios_vector_types.h.

◆ g

float helios::RGBcolor::g

Green color component.

Takes a value between 0 and 1.

Definition at line 1295 of file helios_vector_types.h.

◆ r

float helios::RGBcolor::r

Red color component.

Takes a value between 0 and 1.

Definition at line 1292 of file helios_vector_types.h.


The documentation for this struct was generated from the following file: