MAGE  v0.171.0
Matthias Advanced Game Engine
mage::RGB Struct Reference

#include <spectrum.hpp>

Inheritance diagram for mage::RGB:
mage::Array< T, N, A, typename >

Public Member Functions

constexpr RGB (F32 rgb=0.0f) noexcept
 
constexpr RGB (F32 r, F32 g, F32 b) noexcept
 
constexpr RGB (const RGB &rgb) noexcept=default
 
constexpr RGB (RGB &&rgb) noexcept=default
 
 RGB (const SRGB &srgb) noexcept
 
 RGB (const XYZ &xyz) noexcept
 
constexpr RGB (F32x3 v) noexcept
 
 ~RGB ()=default
 
RGBoperator= (const RGB &rgb) noexcept=default
 
RGBoperator= (RGB &&rgb) noexcept=default
 
F32R () noexcept
 
constexpr F32 R () const noexcept
 
F32G () noexcept
 
constexpr F32 G () const noexcept
 
F32B () noexcept
 
constexpr F32 B () const noexcept
 
- Public Member Functions inherited from mage::Array< T, N, A, typename >
constexpr Array () noexcept
 
constexpr Array (const T &value) noexcept
 
template<typename... ArgsT, typename = std::enable_if_t< (N == sizeof...(ArgsT)) >>
constexpr Array (ArgsT &&... args) noexcept
 
template<std::size_t FromN>
constexpr Array (const Array< T, FromN, A > &a) noexcept
 
template<std::size_t FromN, std::size_t FromA>
constexpr Array (const Array< T, FromN, FromA > &a) noexcept
 
template<std::size_t FromN, typename... ArgsT>
constexpr Array (const Array< T, FromN, A > &a, ArgsT &&... args) noexcept
 
template<std::size_t FromN, std::size_t FromA, typename... ArgsT>
constexpr Array (const Array< T, FromN, FromA > &a, ArgsT &&... args) noexcept
 
constexpr Array (const Array &a) noexcept=default
 
constexpr Array (Array &&a) noexcept=default
 
template<typename FromT , std::size_t FromA, typename = std::enable_if_t< std::is_convertible_v< FromT, T > >>
constexpr Array (const Array< FromT, N, FromA > &a) noexcept
 
 ~Array ()=default
 
Arrayoperator= (const Array &a) noexcept=default
 
Arrayoperator= (Array &&a) noexcept=default
 

Additional Inherited Members

- Static Public Attributes inherited from mage::Array< T, N, A, typename >
static constexpr std::size_t s_size = N
 

Detailed Description

A struct of RGB color spectra.

Constructor & Destructor Documentation

◆ RGB() [1/7]

constexpr mage::RGB::RGB ( F32  rgb = 0.0f)
explicitnoexcept

Constructs a RGB spectrum from the given spectrum components.

Parameters
[in]rgbThe red, green and blue component.

◆ RGB() [2/7]

constexpr mage::RGB::RGB ( F32  r,
F32  g,
F32  b 
)
noexcept

Constructs a RGB spectrum from the given spectrum components.

Parameters
[in]rThe red component.
[in]gThe green component.
[in]bThe blue component.

◆ RGB() [3/7]

constexpr mage::RGB::RGB ( const RGB rgb)
defaultnoexcept

Constructs a RGB spectrum from the given RGB spectrum.

Parameters
[in]rgbA reference to the RGB spectrum to copy.

◆ RGB() [4/7]

constexpr mage::RGB::RGB ( RGB &&  rgb)
defaultnoexcept

Constructs a RGB spectrum by moving the given RGB spectrum.

Parameters
[in]rgbA reference to the RGB spectrum to move.

◆ RGB() [5/7]

mage::RGB::RGB ( const SRGB srgb)
explicitnoexcept

Constructs a RGB spectrum from the given sRGB spectrum.

Parameters
[in]srgbA reference to the sRGB spectrum to copy.

◆ RGB() [6/7]

mage::RGB::RGB ( const XYZ xyz)
explicitnoexcept

Constructs a RGB spectrum from the given XYZ spectrum.

Parameters
[in]xyzA reference to the XYZ spectrum to copy.

◆ RGB() [7/7]

constexpr mage::RGB::RGB ( F32x3  v)
explicitnoexcept

Constructs a RGB spectrum from the given components.

Parameters
[in]vThe components.

◆ ~RGB()

mage::RGB::~RGB ( )
default

Destructs this RGB spectrum.

Member Function Documentation

◆ B() [1/2]

F32& mage::RGB::B ( )
noexcept

Returns the blue component of this RGB spectrum.

Returns
A reference to the blue component of this RGB spectrum.

◆ B() [2/2]

constexpr F32 mage::RGB::B ( ) const
noexcept

Returns the blue component of this RGB spectrum.

Returns
The blue component of this RGB spectrum.

◆ G() [1/2]

F32& mage::RGB::G ( )
noexcept

Returns the green component of this RGB spectrum.

Returns
A reference to the green component of this RGB spectrum.

◆ G() [2/2]

constexpr F32 mage::RGB::G ( ) const
noexcept

Returns the green component of this RGB spectrum.

Returns
The green component of this RGB spectrum.

◆ operator=() [1/2]

RGB& mage::RGB::operator= ( const RGB rgb)
defaultnoexcept

Copies the given RGB spectrum to this RGB spectrum.

Parameters
[in]rgbA reference to the RGB spectrum to copy.
Returns
A reference to the copy of the given RGB spectrum (i.e. this RGB spectrum).

◆ operator=() [2/2]

RGB& mage::RGB::operator= ( RGB &&  rgb)
defaultnoexcept

Moves the given RGB spectrum to this RGB spectrum.

Parameters
[in]rgbA reference to the RGB spectrum to move.
Returns
A reference to the moved RGB spectrum (i.e. this RGB spectrum).

◆ R() [1/2]

F32& mage::RGB::R ( )
noexcept

Returns the red component of this RGB spectrum.

Returns
A reference to the red component of this RGB spectrum.

◆ R() [2/2]

constexpr F32 mage::RGB::R ( ) const
noexcept

Returns the red component of this RGB spectrum.

Returns
The red component of this RGB spectrum.