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

#include <spectrum.hpp>

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

Public Member Functions

constexpr SRGBA (F32 rgba=0.0f) noexcept
 
constexpr SRGBA (F32 r, F32 g, F32 b, F32 a=1.0f) noexcept
 
constexpr SRGBA (const SRGBA &rgba) noexcept=default
 
constexpr SRGBA (SRGBA &&rgba) noexcept=default
 
constexpr SRGBA (const SRGB &srgb, F32 a=1.0f) noexcept
 
 SRGBA (const RGBA &rgba) noexcept
 
constexpr SRGBA (F32x4 v) noexcept
 
 ~SRGBA ()=default
 
SRGBAoperator= (const SRGBA &rgba) noexcept=default
 
SRGBAoperator= (SRGBA &&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< 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 sRGBA color spectra.

Constructor & Destructor Documentation

◆ SRGBA() [1/7]

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

Constructs a sRGBA spectrum from the given spectrum components.

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

◆ SRGBA() [2/7]

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

Constructs a sRGBA spectrum from the given spectrum components.

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

◆ SRGBA() [3/7]

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

Constructs a sRGBA spectrum from the given sRGBA spectrum.

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

◆ SRGBA() [4/7]

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

Constructs a sRGBA spectrum by moving the given sRGBA spectrum.

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

◆ SRGBA() [5/7]

constexpr mage::SRGBA::SRGBA ( const SRGB srgb,
F32  a = 1.0f 
)
noexcept

Constructs a sRGBA spectrum from the given sRGB spectrum.

Parameters
[in]srgbA reference to the sRGB spectrum.
[in]aThe alpha component.

◆ SRGBA() [6/7]

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

Constructs a sRGBA spectrum from the given RGBA spectrum.

Parameters
[in]rgbaA reference to the RGBA spectrum.

◆ SRGBA() [7/7]

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

Constructs a sRGBA spectrum from the given components.

Parameters
[in]vThe components.

◆ ~SRGBA()

mage::SRGBA::~SRGBA ( )
default

Destructs this sRGBA spectrum.

Member Function Documentation

◆ A() [1/2]

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

Returns the alpha component of this sRGBA spectrum.

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

◆ A() [2/2]

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

Returns the alpha component of this sRGBA spectrum.

Returns
The alpha component of this sRGBA spectrum.

◆ B() [1/2]

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

Returns the blue component of this sRGBA spectrum.

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

◆ B() [2/2]

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

Returns the blue component of this sRGBA spectrum.

Returns
The blue component of this sRGBA spectrum.

◆ G() [1/2]

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

Returns the green component of this sRGBA spectrum.

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

◆ G() [2/2]

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

Returns the green component of this sRGBA spectrum.

Returns
The green component of this sRGBA spectrum.

◆ operator=() [1/2]

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

Copies the given sRGBA spectrum to this sRGBA spectrum.

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

◆ operator=() [2/2]

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

Moves the given sRGBA spectrum to this sRGBA spectrum.

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

◆ R() [1/2]

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

Returns the red component of this sRGBA spectrum.

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

◆ R() [2/2]

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

Returns the red component of this sRGBA spectrum.

Returns
The red component of this sRGBA spectrum.