MathLib
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
BasicUnitRGB< 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

constexpr bool isNormalized () const
 
Constructors
constexpr BasicUnitRGB ()=default
 
constexpr BasicUnitRGB (value_type r, value_type g, value_type b)
 
constexpr BasicUnitRGB (const std::tuple< value_type, value_type, value_type > &init_value)
 
constexpr BasicUnitRGB (const BasicUnitRGB< T > &other)
 
template<std::integral OtherT>
constexpr BasicUnitRGB (const BasicRGB< OtherT > &other)
 
Assignment
constexpr BasicUnitRGB< T > & operator= (const BasicUnitRGB< T > &other)
 
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)
 
Invalid Value Check
constexpr bool isNaN () const
 
constexpr bool isInf () const
 
Conversion Operators
constexpr operator std::tuple< value_type, value_type, value_type > () const
 

Static Public Member Functions

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

Protected Member Functions

constexpr bool _isInBounds (value_type component) const
 

Protected Attributes

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

Friends

constexpr bool approximately_equal_to (const BasicUnitRGB< T > &value_to_test, const BasicUnitRGB< T > &value_it_should_be, T tolerance=T{0.0002})
 
constexpr T min (const BasicUnitRGB< T > &input)
 
constexpr T max (const BasicUnitRGB< T > &input)
 
Operators
constexpr BasicUnitRGB< T > operator+ (const BasicUnitRGB< T > &left, const BasicUnitRGB< T > &right)
 
constexpr BasicUnitRGB< T > operator- (const BasicUnitRGB< T > &left, const BasicUnitRGB< T > &right)
 
constexpr BasicUnitRGB< T > operator* (const BasicUnitRGB< T > &left, const BasicUnitRGB< T > &right)
 
constexpr BasicUnitRGB< T > operator* (const BasicUnitRGB< T > &left, T right)
 

Detailed Description

template<std::floating_point T>
class Color::BasicUnitRGB< T >

The definition of an RGB color triple with normalized members between 0.0 and 1.0

See also
BasicRGB

Definition at line 202 of file Types.hpp.

Member Typedef Documentation

◆ value_type

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

The type of the underlying implementation for each color.

Definition at line 208 of file Types.hpp.

Constructor & Destructor Documentation

◆ BasicUnitRGB() [1/5]

template<std::floating_point T>
constexpr BasicUnitRGB ( )
constexprdefault

◆ BasicUnitRGB() [2/5]

template<std::floating_point T>
constexpr BasicUnitRGB ( value_type  r,
value_type  g,
value_type  b 
)
inlineconstexpr

Definition at line 216 of file Types.hpp.

◆ BasicUnitRGB() [3/5]

template<std::floating_point T>
constexpr BasicUnitRGB ( const std::tuple< value_type, value_type, value_type > &  init_value)
inlineconstexpr

Definition at line 224 of file Types.hpp.

◆ BasicUnitRGB() [4/5]

template<std::floating_point T>
constexpr BasicUnitRGB ( const BasicUnitRGB< T > &  other)
inlineconstexpr

Definition at line 233 of file Types.hpp.

◆ BasicUnitRGB() [5/5]

template<std::floating_point T>
template<std::integral OtherT>
constexpr BasicUnitRGB ( const BasicRGB< OtherT > &  other)
inlineconstexpr

Definition at line 243 of file Types.hpp.

Member Function Documentation

◆ _isInBounds()

template<std::floating_point T>
constexpr bool _isInBounds ( value_type  component) const
inlineconstexprprotected

Definition at line 360 of file Types.hpp.

◆ b() [1/2]

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

Definition at line 296 of file Types.hpp.

◆ b() [2/2]

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

Definition at line 329 of file Types.hpp.

◆ blue() [1/2]

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

Definition at line 292 of file Types.hpp.

◆ blue() [2/2]

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

Definition at line 312 of file Types.hpp.

◆ g() [1/2]

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

Definition at line 295 of file Types.hpp.

◆ g() [2/2]

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

Definition at line 324 of file Types.hpp.

◆ green() [1/2]

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

Definition at line 291 of file Types.hpp.

◆ green() [2/2]

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

Definition at line 305 of file Types.hpp.

◆ isInf()

template<std::floating_point T>
constexpr bool isInf ( ) const
inlineconstexpr

Definition at line 347 of file Types.hpp.

◆ isNaN()

template<std::floating_point T>
constexpr bool isNaN ( ) const
inlineconstexpr

Definition at line 345 of file Types.hpp.

◆ isNormalized()

template<std::floating_point T>
constexpr bool isNormalized ( ) const
inlineconstexpr

Definition at line 335 of file Types.hpp.

◆ max()

template<std::floating_point T>
static constexpr BasicUnitRGB< T > max ( )
inlinestaticconstexpr

Definition at line 282 of file Types.hpp.

◆ min()

template<std::floating_point T>
static constexpr BasicUnitRGB< T > min ( )
inlinestaticconstexpr

Definition at line 280 of file Types.hpp.

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

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

Definition at line 353 of file Types.hpp.

◆ operator=()

template<std::floating_point T>
constexpr BasicUnitRGB< T > & operator= ( const BasicUnitRGB< T > &  other)
inlineconstexpr

Definition at line 262 of file Types.hpp.

◆ r() [1/2]

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

Definition at line 294 of file Types.hpp.

◆ r() [2/2]

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

Definition at line 319 of file Types.hpp.

◆ red() [1/2]

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

Definition at line 290 of file Types.hpp.

◆ red() [2/2]

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

Definition at line 298 of file Types.hpp.

◆ zero()

template<std::floating_point T>
static constexpr BasicUnitRGB< T > zero ( )
inlinestaticconstexpr

Definition at line 284 of file Types.hpp.

Friends And Related Symbol Documentation

◆ max

template<std::floating_point T>
constexpr T max ( const BasicUnitRGB< T > &  input)
friend

Definition at line 438 of file Types.hpp.

◆ min

template<std::floating_point T>
constexpr T min ( const BasicUnitRGB< T > &  input)
friend

Definition at line 433 of file Types.hpp.

Member Data Documentation

◆ _blue

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

Definition at line 358 of file Types.hpp.

◆ _green

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

Definition at line 357 of file Types.hpp.

◆ _red

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

Definition at line 356 of file Types.hpp.


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