MathLib
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Attributes | Friends | List of all members
BasicHue< 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 BasicHue< T > modulo () const
 
Constructors
constexpr BasicHue ()=default
 
constexpr BasicHue (Math::BasicDegree< T > init_value)
 
constexpr BasicHue (T init_value)
 
Element Access
T value () const
 
Conversion Operators
 operator T () const
 
 operator Math::BasicDegree< T > () const
 
Invalid Value Check
constexpr bool isNaN () const
 
constexpr bool isInf () const
 

Static Public Member Functions

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

Protected Attributes

Math::BasicDegree< T > _value {}
 

Friends

constexpr bool approximately_equal_to (const BasicHue< T > &value_to_test, const BasicHue< T > &value_it_should_be, T tolerance=T{0.0002})
 
Comparison
constexpr auto operator<=> (const BasicHue< T > &left, const BasicHue< T > &right)=default
 
constexpr auto operator<=> (const BasicHue< T > &left, const Math::BasicDegree< T > &right)
 
constexpr auto operator<=> (const BasicHue< T > &left, const T &right)
 
Equality
constexpr bool operator== (const BasicHue< T > &left, const BasicHue< T > &right)=default
 
constexpr bool operator== (const BasicHue< T > &left, const Math::BasicDegree< T > &right)
 
constexpr bool operator== (const BasicHue< T > &left, const T &right)
 

Operators

constexpr BasicHue< T > & operator+= (BasicHue< T > other)
 
constexpr BasicHue< T > & operator+= (Math::BasicDegree< T > other)
 
constexpr BasicHue< T > & operator+= (T other)
 
constexpr BasicHue< T > & operator-= (BasicHue< T > other)
 
constexpr BasicHue< T > & operator-= (Math::BasicDegree< T > other)
 
constexpr BasicHue< T > & operator-= (T other)
 
constexpr BasicHue< T > & operator*= (BasicHue< T > other)
 
constexpr BasicHue< T > & operator*= (Math::BasicDegree< T > other)
 
constexpr BasicHue< T > & operator*= (T other)
 
constexpr BasicHue< T > & operator/= (BasicHue< T > other)
 
constexpr BasicHue< T > & operator/= (Math::BasicDegree< T > other)
 
constexpr BasicHue< T > & operator/= (T other)
 
constexpr BasicHue< T > operator+ (const BasicHue< T > &left, const BasicHue< T > &right)
 
constexpr BasicHue< T > operator+ (const BasicHue< T > &left, const Math::BasicDegree< T > &right)
 
constexpr BasicHue< T > operator+ (const Math::BasicDegree< T > &left, const BasicHue< T > &right)
 
constexpr BasicHue< T > operator- (const BasicHue< T > &left, const BasicHue< T > &right)
 
constexpr BasicHue< T > operator- (const BasicHue< T > &left, const Math::BasicDegree< T > &right)
 
constexpr BasicHue< T > operator- (const Math::BasicDegree< T > &left, const BasicHue< T > &right)
 
constexpr BasicHue< T > operator* (const BasicHue< T > &left, const BasicHue< T > &right)
 
constexpr BasicHue< T > operator* (const BasicHue< T > &left, const Math::BasicDegree< T > &right)
 
constexpr BasicHue< T > operator* (const Math::BasicDegree< T > &left, const BasicHue< T > &right)
 
constexpr BasicHue< T > operator/ (const BasicHue< T > &left, const BasicHue< T > &right)
 
constexpr BasicHue< T > operator/ (const BasicHue< T > &left, const Math::BasicDegree< T > &right)
 
constexpr BasicHue< T > operator/ (const Math::BasicDegree< T > &left, const BasicHue< T > &right)
 
constexpr BasicHue< T > operator+ (const BasicHue< T > &left, const T &right)
 
constexpr BasicHue< T > operator- (const BasicHue< T > &left, const T &right)
 
constexpr BasicHue< T > operator* (const BasicHue< T > &left, const T &right)
 
constexpr BasicHue< T > operator/ (const BasicHue< T > &left, const T &right)
 
constexpr BasicHue< T > operator- (const BasicHue< T > &input)
 

Detailed Description

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

The definition of a Hue color

Note
The natural range is 0.0 - 360.0
See also
BasicRGB

Definition at line 454 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 468 of file Types.hpp.

Constructor & Destructor Documentation

◆ BasicHue() [1/3]

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

◆ BasicHue() [2/3]

template<std::floating_point T>
constexpr BasicHue ( Math::BasicDegree< T >  init_value)
inlineconstexpr

Definition at line 475 of file Types.hpp.

◆ BasicHue() [3/3]

template<std::floating_point T>
constexpr BasicHue ( T  init_value)
inlineconstexpr

Definition at line 481 of file Types.hpp.

Member Function Documentation

◆ isInf()

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

Definition at line 522 of file Types.hpp.

◆ isNaN()

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

Definition at line 517 of file Types.hpp.

◆ max()

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

Definition at line 507 of file Types.hpp.

◆ min()

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

Definition at line 505 of file Types.hpp.

◆ modulo()

template<std::floating_point T>
constexpr BasicHue< T > modulo ( ) const
inlineconstexpr

Definition at line 512 of file Types.hpp.

◆ operator Math::BasicDegree< T >()

template<std::floating_point T>
operator Math::BasicDegree< T > ( ) const
inline

Definition at line 499 of file Types.hpp.

◆ operator T()

template<std::floating_point T>
operator T ( ) const
inline

Definition at line 497 of file Types.hpp.

◆ operator*=() [1/3]

template<std::floating_point T>
constexpr BasicHue< T > & operator*= ( BasicHue< T >  other)
inlineconstexpr

Definition at line 567 of file Types.hpp.

◆ operator*=() [2/3]

template<std::floating_point T>
constexpr BasicHue< T > & operator*= ( Math::BasicDegree< T >  other)
inlineconstexpr

Definition at line 573 of file Types.hpp.

◆ operator*=() [3/3]

template<std::floating_point T>
constexpr BasicHue< T > & operator*= ( T  other)
inlineconstexpr

Definition at line 579 of file Types.hpp.

◆ operator+=() [1/3]

template<std::floating_point T>
constexpr BasicHue< T > & operator+= ( BasicHue< T >  other)
inlineconstexpr

Definition at line 531 of file Types.hpp.

◆ operator+=() [2/3]

template<std::floating_point T>
constexpr BasicHue< T > & operator+= ( Math::BasicDegree< T >  other)
inlineconstexpr

Definition at line 537 of file Types.hpp.

◆ operator+=() [3/3]

template<std::floating_point T>
constexpr BasicHue< T > & operator+= ( T  other)
inlineconstexpr

Definition at line 543 of file Types.hpp.

◆ operator-=() [1/3]

template<std::floating_point T>
constexpr BasicHue< T > & operator-= ( BasicHue< T >  other)
inlineconstexpr

Definition at line 549 of file Types.hpp.

◆ operator-=() [2/3]

template<std::floating_point T>
constexpr BasicHue< T > & operator-= ( Math::BasicDegree< T >  other)
inlineconstexpr

Definition at line 555 of file Types.hpp.

◆ operator-=() [3/3]

template<std::floating_point T>
constexpr BasicHue< T > & operator-= ( T  other)
inlineconstexpr

Definition at line 561 of file Types.hpp.

◆ operator/=() [1/3]

template<std::floating_point T>
constexpr BasicHue< T > & operator/= ( BasicHue< T >  other)
inlineconstexpr

Definition at line 585 of file Types.hpp.

◆ operator/=() [2/3]

template<std::floating_point T>
constexpr BasicHue< T > & operator/= ( Math::BasicDegree< T >  other)
inlineconstexpr

Definition at line 591 of file Types.hpp.

◆ operator/=() [3/3]

template<std::floating_point T>
constexpr BasicHue< T > & operator/= ( T  other)
inlineconstexpr

Definition at line 597 of file Types.hpp.

◆ value()

template<std::floating_point T>
T value ( ) const
inline

Definition at line 491 of file Types.hpp.

◆ zero()

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

Definition at line 509 of file Types.hpp.

Friends And Related Symbol Documentation

◆ operator* [1/4]

template<std::floating_point T>
constexpr BasicHue< T > operator* ( const BasicHue< T > &  left,
const BasicHue< T > &  right 
)
friend

Definition at line 709 of file Types.hpp.

◆ operator* [2/4]

template<std::floating_point T>
constexpr BasicHue< T > operator* ( const BasicHue< T > &  left,
const Math::BasicDegree< T > &  right 
)
friend

Definition at line 714 of file Types.hpp.

◆ operator* [3/4]

template<std::floating_point T>
constexpr BasicHue< T > operator* ( const BasicHue< T > &  left,
const T &  right 
)
friend

Definition at line 749 of file Types.hpp.

◆ operator* [4/4]

template<std::floating_point T>
constexpr BasicHue< T > operator* ( const Math::BasicDegree< T > &  left,
const BasicHue< T > &  right 
)
friend

Definition at line 719 of file Types.hpp.

◆ operator+ [1/4]

template<std::floating_point T>
constexpr BasicHue< T > operator+ ( const BasicHue< T > &  left,
const BasicHue< T > &  right 
)
friend

Definition at line 679 of file Types.hpp.

◆ operator+ [2/4]

template<std::floating_point T>
constexpr BasicHue< T > operator+ ( const BasicHue< T > &  left,
const Math::BasicDegree< T > &  right 
)
friend

Definition at line 684 of file Types.hpp.

◆ operator+ [3/4]

template<std::floating_point T>
constexpr BasicHue< T > operator+ ( const BasicHue< T > &  left,
const T &  right 
)
friend

Definition at line 739 of file Types.hpp.

◆ operator+ [4/4]

template<std::floating_point T>
constexpr BasicHue< T > operator+ ( const Math::BasicDegree< T > &  left,
const BasicHue< T > &  right 
)
friend

Definition at line 689 of file Types.hpp.

◆ operator- [1/5]

template<std::floating_point T>
constexpr BasicHue< T > operator- ( const BasicHue< T > &  input)
friend

Definition at line 759 of file Types.hpp.

◆ operator- [2/5]

template<std::floating_point T>
constexpr BasicHue< T > operator- ( const BasicHue< T > &  left,
const BasicHue< T > &  right 
)
friend

Definition at line 694 of file Types.hpp.

◆ operator- [3/5]

template<std::floating_point T>
constexpr BasicHue< T > operator- ( const BasicHue< T > &  left,
const Math::BasicDegree< T > &  right 
)
friend

Definition at line 699 of file Types.hpp.

◆ operator- [4/5]

template<std::floating_point T>
constexpr BasicHue< T > operator- ( const BasicHue< T > &  left,
const T &  right 
)
friend

Definition at line 744 of file Types.hpp.

◆ operator- [5/5]

template<std::floating_point T>
constexpr BasicHue< T > operator- ( const Math::BasicDegree< T > &  left,
const BasicHue< T > &  right 
)
friend

Definition at line 704 of file Types.hpp.

◆ operator/ [1/4]

template<std::floating_point T>
constexpr BasicHue< T > operator/ ( const BasicHue< T > &  left,
const BasicHue< T > &  right 
)
friend

Definition at line 724 of file Types.hpp.

◆ operator/ [2/4]

template<std::floating_point T>
constexpr BasicHue< T > operator/ ( const BasicHue< T > &  left,
const Math::BasicDegree< T > &  right 
)
friend

Definition at line 729 of file Types.hpp.

◆ operator/ [3/4]

template<std::floating_point T>
constexpr BasicHue< T > operator/ ( const BasicHue< T > &  left,
const T &  right 
)
friend

Definition at line 754 of file Types.hpp.

◆ operator/ [4/4]

template<std::floating_point T>
constexpr BasicHue< T > operator/ ( const Math::BasicDegree< T > &  left,
const BasicHue< T > &  right 
)
friend

Definition at line 734 of file Types.hpp.

◆ operator<=> [1/3]

template<std::floating_point T>
constexpr auto operator<=> ( const BasicHue< T > &  left,
const BasicHue< T > &  right 
)
friend

Define the spaceship operator

Note
We define ONLY the <=> AND == operators in order to get all the other relational operators (C++20).

◆ operator<=> [2/3]

template<std::floating_point T>
constexpr auto operator<=> ( const BasicHue< T > &  left,
const Math::BasicDegree< T > &  right 
)
friend

Definition at line 615 of file Types.hpp.

◆ operator<=> [3/3]

template<std::floating_point T>
constexpr auto operator<=> ( const BasicHue< T > &  left,
const T &  right 
)
friend

Definition at line 619 of file Types.hpp.

◆ operator== [1/3]

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

Defines equality of two BasicHue objects

Note
Use C++20's ability to generate the operator !=() from operator ==()
See also
Equality

◆ operator== [2/3]

template<std::floating_point T>
constexpr bool operator== ( const BasicHue< T > &  left,
const Math::BasicDegree< T > &  right 
)
friend

Definition at line 638 of file Types.hpp.

◆ operator== [3/3]

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

Definition at line 642 of file Types.hpp.

Member Data Documentation

◆ _value

template<std::floating_point T>
Math::BasicDegree<T> _value {}
protected

Definition at line 650 of file Types.hpp.


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