MaterialX 1.39.1
Loading...
Searching...
No Matches
Color3 Class Reference

A three-component color value. More...

#include <Types.h>

Inheritance diagram for Color3:
VectorN< Color3, float, 3 > VectorBase

Public Member Functions

 Color3 (float r, float g, float b)
 
Color3 linearToSrgb () const
 Transform the given color from linear RGB to the sRGB encoding, returning the result as a new value.
 
Color3 srgbToLinear () const
 Transform the given color from the sRGB encoding to linear RGB, returning the result as a new value.
 
- Public Member Functions inherited from VectorN< Color3, float, 3 >
 VectorN (Uninit)
 
 VectorN (float s)
 
 VectorN (const std::array< float, N > &arr)
 
 VectorN (const vector< float > &vec)
 
 VectorN (const float *begin, const float *end)
 
bool operator== (const Color3 &rhs) const
 Return true if the given vector is identical to this one.
 
bool operator!= (const Color3 &rhs) const
 Return true if the given vector differs from this one.
 
bool operator< (const Color3 &rhs) const
 Compare two vectors lexicographically.
 
float & operator[] (size_t i)
 Return the scalar value at the given index.
 
const float & operator[] (size_t i) const
 Return the const scalar value at the given index.
 
Color3 operator+ (const Color3 &rhs) const
 Component-wise addition of two vectors.
 
VectorNoperator+= (const Color3 &rhs)
 Component-wise addition of two vectors.
 
Color3 operator- (const Color3 &rhs) const
 Component-wise subtraction of two vectors.
 
Color3 operator- () const
 Unary negation of a vector.
 
VectorNoperator-= (const Color3 &rhs)
 Component-wise subtraction of two vectors.
 
Color3 operator* (const Color3 &rhs) const
 Component-wise multiplication of two vectors.
 
Color3 operator* (float s) const
 Component-wise multiplication of a vector by a scalar.
 
VectorNoperator*= (const Color3 &rhs)
 Component-wise multiplication of two vectors.
 
VectorNoperator*= (float s)
 Component-wise multiplication of a vector by a scalar.
 
Color3 operator/ (const Color3 &rhs) const
 Component-wise division of two vectors.
 
Color3 operator/ (float s) const
 Component-wise division of a vector by a scalar.
 
VectorNoperator/= (const Color3 &rhs)
 Component-wise division of two vectors.
 
VectorNoperator/= (float s)
 Component-wise division of a vector by a scalar.
 
float getMagnitude () const
 Return the magnitude of the vector.
 
Color3 getNormalized () const
 Return a normalized vector.
 
float dot (const Color3 &rhs) const
 Return the dot product of two vectors.
 
Iterator begin ()
 
ConstIterator begin () const
 
Iterator end ()
 
ConstIterator end () const
 
float * data ()
 Return a pointer to the underlying data array.
 
const float * data () const
 Return a const pointer to the underlying data array.
 

Additional Inherited Members

- Public Types inherited from VectorN< Color3, float, 3 >
using Iterator = typename std::array< float, N >::iterator
 
using ConstIterator = typename std::array< float, N >::const_iterator
 
- Static Public Member Functions inherited from VectorN< Color3, float, 3 >
static constexpr size_t numElements ()
 Return the number of scalar elements for the vector.
 
- Protected Attributes inherited from VectorN< Color3, float, 3 >
std::array< float, N > _arr
 

Detailed Description

A three-component color value.


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