walberla::pe::raytracing::Color Class Reference

#include <Color.h>

+ Inheritance diagram for walberla::pe::raytracing::Color:

Constructors

 Color ()
 Instantiation constructor for the Color class. More...
 
 Color (real_t r, real_t g, real_t b)
 Instantiation constructor for the Color class. More...
 
 Color (const Vec3 &vector)
 Instantiation constructor for the Color class. More...
 
Color mulComponentWise (const Color &other) const
 Multiply this color with another component wise. More...
 
void clamp ()
 Clamps this colors component values between 0 and 1. More...
 
static Color colorFromHSV (real_t hue, real_t saturation, real_t value)
 Create a Color object from HSV values. More...
 

Additional Inherited Members

- Public Types inherited from walberla::math::Vector3< Type >
using Length = typename SqrtTrait< Type >::Type
 Return type of the Vector3<Type>::length function. More...
 
using value_type = Type
 
- Public Member Functions inherited from walberla::math::Vector3< Type >
constexpr Vector3 ()=default
 
constexpr Vector3 (Type init)
 Constructor for a homogenous initialization of all elements. More...
 
template<typename Other >
constexpr Vector3 (Other init)
 
constexpr Vector3 (Type x, Type y, Type z)
 Constructor for a direct initialization of all vector elements. More...
 
constexpr Vector3 (const Type *init)
 Constructor for an array initializer. More...
 
constexpr Vector3 (const Vector3 &v)=default
 
template<typename Other >
constexpr Vector3 (const Vector3< Other > &v)
 Conversion constructor from different Vector3 instances. More...
 
template<typename Other >
Vector3< Type > & operator= (const Vector3< Other > &v)
 
template<typename Other >
Vector3< Type > & operator%= (const Vector3< Other > &rhs)
 
template<typename Other >
Vector3< Type > & operator+= (const Vector3< Other > &rhs)
 
template<typename Other >
Vector3< Type > & operator-= (const Vector3< Other > &rhs)
 
template<typename Other >
Vector3< Type > & operator*= (Other rhs)
 
template<typename Other >
Vector3< Type > & operator/= (Other rhs)
 
Vector3operator= (const Vector3 &v)=default
 
template<typename Other >
Vector3operator= (const Vector3< Other > &v)
 Assignment operator for different Vector3 instances. More...
 
template<typename Other >
bool operator== (Other rhs) const
 Equality operator for the comparison of a vector and a scalar value. More...
 
template<typename Other >
bool operator== (const Vector3< Other > &rhs) const
 Equality operator for the comparison of two vectors. More...
 
template<typename Other >
bool operator!= (Other rhs) const
 Inequality operator for the comparison of a vector and a scalar value. More...
 
template<typename Other >
bool operator!= (const Vector3< Other > &rhs) const
 Inequality operator for the comparison of two vectors. More...
 
Type & operator[] (uint_t index)
 Subscript operator for the direct access to the vector elements. More...
 
const Type & operator[] (uint_t index) const
 Subscript operator for the direct access to the vector elements. More...
 
Vector3 operator- () const
 Unary minus operator for the inversion of a vector ( \( \vec{a} = -\vec{b} \)). More...
 
template<typename Other >
Vector3operator%= (const Vector3< Other > &rhs)
 Cross product (outer product) of two vectors ( \( \vec{a}=\vec{b}\times\vec{c} \)). More...
 
template<typename Other >
Vector3operator+= (const Vector3< Other > &rhs)
 Addition assignment operator for the addition of two vectors ( \( \vec{a}+=\vec{b} \)). More...
 
template<typename Other >
Vector3operator-= (const Vector3< Other > &rhs)
 Subtraction assignment operator for the subtraction of two vectors. More...
 
template<typename Other >
Vector3operator*= (Other rhs)
 Multiplication assignment operator for the multiplication between a vector and. More...
 
template<typename Other >
Vector3operator/= (Other rhs)
 Division assignment operator for the division of a vector by a scalar value. More...
 
template<typename Other >
Vector3< typename MathTrait< Type, Other >::High > operator% (const Vector3< Other > &rhs) const
 Cross product (outer product) of two vectors ( \( \vec{a}=\vec{b}\times\vec{c} \)). More...
 
template<typename Other >
Vector3< typename MathTrait< Type, Other >::High > operator+ (const Vector3< Other > &rhs) const
 Addition operator for the addition of two vectors ( \( \vec{a}=\vec{b}+\vec{c} \)). More...
 
template<typename Other >
Vector3< typename MathTrait< Type, Other >::High > operator- (const Vector3< Other > &rhs) const
 Subtraction operator for the subtraction of two vectors ( \( \vec{a}=\vec{b}-\vec{c} \)). More...
 
template<typename Other >
Vector3< typename MathTrait< Type, Other >::High > operator* (Other rhs) const
 Multiplication operator for the multiplication of a vector and a scalar value. More...
 
template<typename Other >
MathTrait< Type, Other >::High operator* (const Vector3< Other > &rhs) const
 Multiplication operator for the scalar product (inner product) of two vectors. More...
 
template<typename Other >
Vector3< typename MathTrait< Type, Other >::High > operator/ (Other rhs) const
 Division operator for the division of a vector by a scalar value. More...
 
uint_t indexOfMax () const
 Returns index of absolute maximum value. More...
 
uint_t indexOfMin () const
 Returns index of absolute minimum value. More...
 
Type max () const
 Returns maximum value. More...
 
Type min () const
 Returns minimum value. More...
 
void set (Type x, Type y, Type z)
 Set function for a direct assignment of all vector elements. More...
 
Length length () const
 Calculation of the vector length \(|\vec{a}|\). More...
 
Type sqrLength () const
 Calculation of the vector square length \(|\vec{a}|^2\). More...
 
Vector3< LengthgetNormalized () const
 Calculation of the normalized vector ( \(|\vec{a}|=1\)). More...
 
Vector3< LengthgetNormalizedOrZero () const
 Calculation of the normalized vector ( \(|\vec{a}|=1\)) without precondition. More...
 
Vector3< LengthgetNormalizedIfNotZero () const
 Calculation of the normalized vector ( \(|\vec{a}|=1\)) without precondition. More...
 
void reset ()
 Sets all components of the vector to 0. More...
 
Type * data ()
 
const Type * data () const
 

Constructor & Destructor Documentation

◆ Color() [1/3]

walberla::pe::raytracing::Color::Color ( )
inline

Instantiation constructor for the Color class.

Defaults to white.

◆ Color() [2/3]

walberla::pe::raytracing::Color::Color ( real_t  r,
real_t  g,
real_t  b 
)
inline

Instantiation constructor for the Color class.

Parameters
rRed component
gGreen component
bBlue component Instantiation constructor for the Color class with RGB components. Each value should be between 0 and 1 (soft limits)

◆ Color() [3/3]

walberla::pe::raytracing::Color::Color ( const Vec3 vector)
inline

Instantiation constructor for the Color class.

Parameters
vectorRGB vector Instantiation constructor for the Color class with RGB components. Each value should be between 0 and 1 (soft limits)

Member Function Documentation

◆ clamp()

void walberla::pe::raytracing::Color::clamp ( )
inline

Clamps this colors component values between 0 and 1.

◆ colorFromHSV()

Color walberla::pe::raytracing::Color::colorFromHSV ( real_t  hue,
real_t  saturation,
real_t  value 
)
static

Create a Color object from HSV values.

Parameters
hueHue value in degrees from 0-360
saturationSaturation value from 0-1
valueValue from 0-1

◆ mulComponentWise()

Color walberla::pe::raytracing::Color::mulComponentWise ( const Color other) const
inline

Multiply this color with another component wise.

Returns
Color with components of this and other multiplied.

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