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

R-G-B-A color vector. More...

#include <helios_vector_types.h>

Public Member Functions

constexpr RGBAcolor ()
 Default constructor - initializes color to black.
 
constexpr RGBAcolor (float red, float green, float blue, float alpha)
 Constructor given three floats denoting R-G-B components.
 
constexpr RGBAcolor (const float C[4])
 Constructor given an array of three floats denoting R-G-B-A components.
 
 RGBAcolor (const std::vector< float > &C)
 Constructor given a vector of three floats denoting R-G-B-A components.
 
void scale (float scale_factor)
 Scale RGBAcolor by some factor.
 
constexpr RGBAcolor operator+ (const RGBAcolor &c) const noexcept
 Add two RGBA colors together color-by-color.
 
constexpr RGBAcolor operator- (const RGBAcolor &c) const noexcept
 Subtract two RGBA colors color-by-color.
 
constexpr bool operator== (const helios::RGBAcolor &c) const noexcept
 check for equality of two RGBA colors
 
constexpr bool operator!= (const helios::RGBAcolor &c) const noexcept
 check for inequality of two RGBA colors
 

Data Fields

float r
 Red color component.
 
float g
 Green color component.
 
float b
 Blue color component.
 
float a
 Alpha (transparency) component.
 

Friends

std::ostream & operator<< (std::ostream &os, const helios::RGBAcolor &c)
 write RGBAcolor to output stream
 

Detailed Description

R-G-B-A color vector.

Definition at line 1468 of file helios_vector_types.h.

Constructor & Destructor Documentation

◆ RGBAcolor() [1/4]

constexpr helios::RGBAcolor::RGBAcolor ( )
inlineconstexpr

Default constructor - initializes color to black.

Definition at line 1484 of file helios_vector_types.h.

◆ RGBAcolor() [2/4]

constexpr helios::RGBAcolor::RGBAcolor ( float  red,
float  green,
float  blue,
float  alpha 
)
inlineconstexpr

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

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

Definition at line 1495 of file helios_vector_types.h.

◆ RGBAcolor() [3/4]

constexpr helios::RGBAcolor::RGBAcolor ( const float  C[4])
inlineexplicitconstexpr

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

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

Definition at line 1503 of file helios_vector_types.h.

◆ RGBAcolor() [4/4]

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

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

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

Definition at line 1511 of file helios_vector_types.h.

Member Function Documentation

◆ operator!=()

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

check for inequality of two RGBA colors

Definition at line 1596 of file helios_vector_types.h.

◆ operator+()

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

Add two RGBA colors together color-by-color.

Definition at line 1600 of file helios_vector_types.h.

◆ operator-()

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

Subtract two RGBA colors color-by-color.

Definition at line 1604 of file helios_vector_types.h.

◆ operator==()

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

check for equality of two RGBA colors

Definition at line 1590 of file helios_vector_types.h.

◆ scale()

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

Scale RGBAcolor by some factor.

Parameters
[in]scale_factorPositive scaling factor

Definition at line 1525 of file helios_vector_types.h.

Friends And Related Symbol Documentation

◆ operator<<

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

write RGBAcolor to output stream

Definition at line 1536 of file helios_vector_types.h.

Field Documentation

◆ a

float helios::RGBAcolor::a

Alpha (transparency) component.

Takes a value between 0 and 1.

Definition at line 1481 of file helios_vector_types.h.

◆ b

float helios::RGBAcolor::b

Blue color component.

Takes a value between 0 and 1.

Definition at line 1478 of file helios_vector_types.h.

◆ g

float helios::RGBAcolor::g

Green color component.

Takes a value between 0 and 1.

Definition at line 1475 of file helios_vector_types.h.

◆ r

float helios::RGBAcolor::r

Red color component.

Takes a value between 0 and 1.

Definition at line 1472 of file helios_vector_types.h.


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