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

#include <spectrum.hpp>

Inheritance diagram for mage::SRGB:
mage::Array< F32, 3u >

Public Member Functions

constexpr SRGB (F32 srgb=0.0f) noexcept
 
constexpr SRGB (F32 r, F32 g, F32 b) noexcept
 
constexpr SRGB (const SRGB &srgb) noexcept=default
 
constexpr SRGB (SRGB &&srgb) noexcept=default
 
 SRGB (const RGB &rgb) noexcept
 
constexpr SRGB (F32x3 v) noexcept
 
 ~SRGB ()=default
 
SRGBoperator= (const SRGB &srgb) noexcept=default
 
SRGBoperator= (SRGB &&srgb) 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< F32, 3u >
constexpr Array () noexcept
 
constexpr Array (const F32 &value) noexcept
 
constexpr Array (ArgsT &&... args) noexcept
 
constexpr Array (const Array< F32, FromN, alignof(F32) > &a) noexcept
 
constexpr Array (const Array< F32, FromN, FromA > &a) noexcept
 
constexpr Array (const Array< F32, FromN, alignof(F32) > &a, ArgsT &&... args) noexcept
 
constexpr Array (const Array< F32, FromN, FromA > &a, ArgsT &&... args) noexcept
 
constexpr Array (const Array &a) noexcept=default
 
constexpr Array (Array &&a) noexcept=default
 
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< F32, 3u >
static constexpr std::size_t s_size
 

Detailed Description

A struct of sRGB color spectra.

Constructor & Destructor Documentation

◆ SRGB() [1/6]

constexpr mage::SRGB::SRGB ( F32  srgb = 0.0f)
explicitnoexcept

Constructs a sRGB spectrum from the given spectrum components.

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

◆ SRGB() [2/6]

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

Constructs a sRGB spectrum from the given spectrum components.

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

◆ SRGB() [3/6]

constexpr mage::SRGB::SRGB ( const SRGB srgb)
defaultnoexcept

Constructs a sRGB spectrum from the given sRGB spectrum.

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

◆ SRGB() [4/6]

constexpr mage::SRGB::SRGB ( SRGB &&  srgb)
defaultnoexcept

Constructs a sRGB spectrum by moving the given sRGB spectrum.

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

◆ SRGB() [5/6]

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

Constructs a sRGB spectrum from the given RGB spectrum.

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

◆ SRGB() [6/6]

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

Constructs a sRGB spectrum from the given components.

Parameters
[in]vThe components.

◆ ~SRGB()

mage::SRGB::~SRGB ( )
default

Destructs this sRGB spectrum.

Member Function Documentation

◆ B() [1/2]

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

Returns the blue component of this sRGB spectrum.

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

◆ B() [2/2]

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

Returns the blue component of this sRGB spectrum.

Returns
The blue component of this sRGB spectrum.

◆ G() [1/2]

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

Returns the green component of this sRGB spectrum.

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

◆ G() [2/2]

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

Returns the green component of this sRGB spectrum.

Returns
The green component of this sRGB spectrum.

◆ operator=() [1/2]

SRGB& mage::SRGB::operator= ( const SRGB srgb)
defaultnoexcept

Copies the given sRGB spectrum to this sRGB spectrum.

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

◆ operator=() [2/2]

SRGB& mage::SRGB::operator= ( SRGB &&  srgb)
defaultnoexcept

Moves the given sRGB spectrum to this sRGB spectrum.

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

◆ R() [1/2]

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

Returns the red component of this sRGB spectrum.

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

◆ R() [2/2]

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

Returns the red component of this sRGB spectrum.

Returns
The red component of this sRGB spectrum.