MathLib
Loading...
Searching...
No Matches
Protected Attributes | Friends | List of all members
BasicRGB< T > Class Template Reference

#include <color/Types.hpp>

Public Types

Types
using value_type = T
 The type of the underlying implementation for each color.
 

Public Member Functions

Constructors
constexpr BasicRGB ()=default
 Defaults to (0, 0, 0)
 
constexpr BasicRGB (value_type r, value_type g, value_type b)
 
constexpr BasicRGB (const std::tuple< T, T, T > &init_value)
 
Element Access
constexpr value_type red () const
 
constexpr value_type green () const
 
constexpr value_type blue () const
 
constexpr value_type r () const
 
constexpr value_type g () const
 
constexpr value_type b () const
 
constexpr void red (value_type input)
 
constexpr void green (value_type input)
 
constexpr void blue (value_type input)
 
constexpr void r (value_type input)
 
constexpr void g (value_type input)
 
constexpr void b (value_type input)
 
Conversion Operators
constexpr operator std::tuple< T, T, T > () const
 

Static Public Member Functions

Constants
static constexpr BasicRGB< T > min ()
 
static constexpr BasicRGB< T > max ()
 
static constexpr BasicRGB< T > zero ()
 

Protected Attributes

value_type _red {}
 
value_type _green {}
 
value_type _blue {}
 

Friends

constexpr T min (const BasicRGB< T > &input)
 
constexpr T max (const BasicRGB< T > &input)
 
template<std::floating_point OT>
BasicUnitRGB< OT > normalized (const BasicRGB< T > &input)
 
Operators
constexpr bool operator== (const BasicRGB< T > &left, const BasicRGB< T > &right)=default
 
constexpr BasicRGB< T > operator+ (const BasicRGB< T > &left, const BasicRGB< T > &right)
 
constexpr BasicRGB< T > operator- (const BasicRGB< T > &left, const BasicRGB< T > &right)
 
constexpr BasicRGB< T > operator* (const BasicRGB< T > &left, const BasicRGB< T > &right)
 
constexpr BasicRGB< T > operator* (const BasicRGB< T > &left, T right)
 

Detailed Description

template<std::integral T>
class Color::BasicRGB< T >

The definition of an RGB color triple

Definition at line 29 of file Types.hpp.

Member Typedef Documentation

◆ value_type

template<std::integral T>
using value_type = T

The type of the underlying implementation for each color.

Definition at line 35 of file Types.hpp.

Constructor & Destructor Documentation

◆ BasicRGB() [1/3]

template<std::integral T>
constexpr BasicRGB ( )
constexprdefault

Defaults to (0, 0, 0)

◆ BasicRGB() [2/3]

template<std::integral T>
constexpr BasicRGB ( value_type  r,
value_type  g,
value_type  b 
)
inlineconstexpr

Definition at line 42 of file Types.hpp.

◆ BasicRGB() [3/3]

template<std::integral T>
constexpr BasicRGB ( const std::tuple< T, T, T > &  init_value)
inlineconstexpr

Definition at line 43 of file Types.hpp.

Member Function Documentation

◆ b() [1/2]

template<std::integral T>
constexpr value_type b ( ) const
inlineconstexpr

Definition at line 82 of file Types.hpp.

◆ b() [2/2]

template<std::integral T>
constexpr void b ( value_type  input)
inlineconstexpr

Definition at line 109 of file Types.hpp.

◆ blue() [1/2]

template<std::integral T>
constexpr value_type blue ( ) const
inlineconstexpr

Definition at line 78 of file Types.hpp.

◆ blue() [2/2]

template<std::integral T>
constexpr void blue ( value_type  input)
inlineconstexpr

Definition at line 94 of file Types.hpp.

◆ g() [1/2]

template<std::integral T>
constexpr value_type g ( ) const
inlineconstexpr

Definition at line 81 of file Types.hpp.

◆ g() [2/2]

template<std::integral T>
constexpr void g ( value_type  input)
inlineconstexpr

Definition at line 104 of file Types.hpp.

◆ green() [1/2]

template<std::integral T>
constexpr value_type green ( ) const
inlineconstexpr

Definition at line 77 of file Types.hpp.

◆ green() [2/2]

template<std::integral T>
constexpr void green ( value_type  input)
inlineconstexpr

Definition at line 89 of file Types.hpp.

◆ max()

template<std::integral T>
static constexpr BasicRGB< T > max ( )
inlinestaticconstexpr

Definition at line 63 of file Types.hpp.

◆ min()

template<std::integral T>
static constexpr BasicRGB< T > min ( )
inlinestaticconstexpr

Definition at line 56 of file Types.hpp.

◆ operator std::tuple< T, T, T >()

template<std::integral T>
constexpr operator std::tuple< T, T, T > ( ) const
inlineconstexpr

Definition at line 118 of file Types.hpp.

◆ r() [1/2]

template<std::integral T>
constexpr value_type r ( ) const
inlineconstexpr

Definition at line 80 of file Types.hpp.

◆ r() [2/2]

template<std::integral T>
constexpr void r ( value_type  input)
inlineconstexpr

Definition at line 99 of file Types.hpp.

◆ red() [1/2]

template<std::integral T>
constexpr value_type red ( ) const
inlineconstexpr

Definition at line 76 of file Types.hpp.

◆ red() [2/2]

template<std::integral T>
constexpr void red ( value_type  input)
inlineconstexpr

Definition at line 84 of file Types.hpp.

◆ zero()

template<std::integral T>
static constexpr BasicRGB< T > zero ( )
inlinestaticconstexpr

Definition at line 70 of file Types.hpp.

Friends And Related Symbol Documentation

◆ max

template<std::integral T>
constexpr T max ( const BasicRGB< T > &  input)
friend

Definition at line 177 of file Types.hpp.

◆ min

template<std::integral T>
constexpr T min ( const BasicRGB< T > &  input)
friend

Definition at line 171 of file Types.hpp.

◆ normalized

template<std::integral T>
template<std::floating_point OT>
BasicUnitRGB< OT > normalized ( const BasicRGB< T > &  input)
friend

Definition at line 184 of file Types.hpp.

◆ operator==

template<std::integral T>
constexpr bool operator== ( const BasicRGB< T > &  left,
const BasicRGB< T > &  right 
)
friend

Member Data Documentation

◆ _blue

template<std::integral T>
value_type _blue {}
protected

Definition at line 124 of file Types.hpp.

◆ _green

template<std::integral T>
value_type _green {}
protected

Definition at line 123 of file Types.hpp.

◆ _red

template<std::integral T>
value_type _red {}
protected

Definition at line 122 of file Types.hpp.


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