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

#include <spectrum.hpp>

Inheritance diagram for mage::RGBA:
mage::Array< F32, 4u >

Public Member Functions

constexpr RGBA (F32 rgba=0.0f) noexcept
 
constexpr RGBA (F32 r, F32 g, F32 b, F32 a=1.0f) noexcept
 
constexpr RGBA (const RGBA &rgba) noexcept=default
 
constexpr RGBA (RGBA &&rgba) noexcept=default
 
constexpr RGBA (const RGB &rgb, F32 a=1.0f) noexcept
 
 RGBA (const SRGBA &srgba) noexcept
 
 RGBA (const XYZA &xyza) noexcept
 
constexpr RGBA (F32x4 v) noexcept
 
 ~RGBA ()=default
 
RGBAoperator= (const RGBA &rgba) noexcept=default
 
RGBAoperator= (RGBA &&rgba) noexcept=default
 
F32R () noexcept
 
constexpr F32 R () const noexcept
 
F32G () noexcept
 
constexpr F32 G () const noexcept
 
F32B () noexcept
 
constexpr F32 B () const noexcept
 
F32A () noexcept
 
constexpr F32 A () const noexcept
 
- Public Member Functions inherited from mage::Array< F32, 4u >
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, 4u >
static constexpr std::size_t s_size
 

Detailed Description

A struct of RGBA color spectra.

Constructor & Destructor Documentation

◆ RGBA() [1/8]

constexpr mage::RGBA::RGBA ( F32  rgba = 0.0f)
explicitnoexcept

Constructs a RGBA spectrum from the given spectrum components.

Parameters
[in]rgbaThe red, green and blue and alpha component.

◆ RGBA() [2/8]

constexpr mage::RGBA::RGBA ( F32  r,
F32  g,
F32  b,
F32  a = 1.0f 
)
noexcept

Constructs a RGBA spectrum from the given spectrum components.

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

◆ RGBA() [3/8]

constexpr mage::RGBA::RGBA ( const RGBA rgba)
defaultnoexcept

Constructs a RGBA spectrum from the given RGBA spectrum.

Parameters
[in]rgbaA reference to the RGBA spectrum to copy.

◆ RGBA() [4/8]

constexpr mage::RGBA::RGBA ( RGBA &&  rgba)
defaultnoexcept

Constructs a RGBA spectrum by moving the given RGBA spectrum.

Parameters
[in]rgbaA reference to the RGBA spectrum to move.

◆ RGBA() [5/8]

constexpr mage::RGBA::RGBA ( const RGB rgb,
F32  a = 1.0f 
)
noexcept

Constructs a RGBA spectrum from the given RGB spectrum.

Parameters
[in]rgbA reference to the RGB spectrum.
[in]aThe alpha component.

◆ RGBA() [6/8]

mage::RGBA::RGBA ( const SRGBA srgba)
explicitnoexcept

Constructs a RGBA spectrum from the given SRGBA spectrum.

Parameters
[in]srgbaA reference to the SRGBA spectrum.

◆ RGBA() [7/8]

mage::RGBA::RGBA ( const XYZA xyza)
explicitnoexcept

Constructs a RGBA spectrum from the given XYZA spectrum.

Parameters
[in]xyzaA reference to the XYZA spectrum.

◆ RGBA() [8/8]

constexpr mage::RGBA::RGBA ( F32x4  v)
explicitnoexcept

Constructs a RGBA spectrum from the given components.

Parameters
[in]vThe components.

◆ ~RGBA()

mage::RGBA::~RGBA ( )
default

Destructs this RGBA spectrum.

Member Function Documentation

◆ A() [1/2]

F32& mage::RGBA::A ( )
noexcept

Returns the alpha component of this RGBA spectrum.

Returns
A reference to the alpha component of this RGBA spectrum.

◆ A() [2/2]

constexpr F32 mage::RGBA::A ( ) const
noexcept

Returns the alpha component of this RGBA spectrum.

Returns
The alpha component of this RGBA spectrum.

◆ B() [1/2]

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

Returns the blue component of this RGBA spectrum.

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

◆ B() [2/2]

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

Returns the blue component of this RGBA spectrum.

Returns
The blue component of this RGBA spectrum.

◆ G() [1/2]

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

Returns the green component of this RGBA spectrum.

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

◆ G() [2/2]

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

Returns the green component of this RGBA spectrum.

Returns
The green component of this RGBA spectrum.

◆ operator=() [1/2]

RGBA& mage::RGBA::operator= ( const RGBA rgba)
defaultnoexcept

Copies the given RGBA spectrum to this RGBA spectrum.

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

◆ operator=() [2/2]

RGBA& mage::RGBA::operator= ( RGBA &&  rgba)
defaultnoexcept

Moves the given RGBA spectrum to this RGBA spectrum.

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

◆ R() [1/2]

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

Returns the red component of this RGBA spectrum.

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

◆ R() [2/2]

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

Returns the red component of this RGBA spectrum.

Returns
The red component of this RGBA spectrum.