NGL
6.5
The NCCA Graphics Library
|
simple class to hold colour information and set the basic opengl colour state. also has overloaded methods to do basic math on colour values. More...
#include <Colour.h>
Public Member Functions | |
Colour (Real _r=0.0, Real _g=0.0, Real _b=0.0, Real _a=1.0) noexcept | |
constructor passing in r g b components More... | |
Colour (const Colour &_c) noexcept | |
copy constructor passing in a Colour More... | |
void | set (Real _r, Real _g, Real _b, Real _a=1.0f) noexcept |
set method to change the current values of the colour as well as the transparency More... | |
void | set (const Colour &_c) noexcept |
set method to set from another Colour More... | |
Colour | operator+ (const Colour &_c) const noexcept |
| |
Colour | operator- (const Colour &_c) const noexcept |
| |
const Colour & | operator+= (const Colour &_c) noexcept |
| |
Colour | operator* (const Colour &_c) const noexcept |
| |
Colour | operator* (const Real _c) const noexcept |
| |
const Colour & | operator*= (const Colour &_c) noexcept |
| |
const Colour & | operator*= (Real _c) noexcept |
| |
void | add (const Colour &_src, const Colour &_refl) noexcept |
Real * | openGL () noexcept |
accesor method to return a pointer to the colour array More... | |
void | clamp (Real _min, Real _max) noexcept |
clamp the colour to the given range from Eduard Zell MSc 2010 the input values >0 < 1.0 and _min <= _max More... | |
Public Attributes | |
Real | m_r |
red component of the colour tuple More... | |
Real | m_g |
green component of the colour tuple More... | |
Real | m_b |
blue component of the colour tuple More... | |
Real | m_a |
alpha the transparent element More... | |
Real | m_openGL [4] |
The data as an array of 4 floats useful for passing to OpenGL fv data types this is mapped as a union to the following m_r == m_openGL[0] m_g == m_openGL[1] m_b == m_openGL[2] m_a == m_openGL[3] . More... | |
Friends | |
class | Material |
simple class to hold colour information and set the basic opengl colour state. also has overloaded methods to do basic math on colour values.
|
inlinenoexcept |
add the product of source color and reflection coefficient
[in] | _src | the source colour |
[in] | _refl | the reflected colour |
Definition at line 27 of file Colour.cpp.
clamp the colour to the given range from Eduard Zell MSc 2010 the input values >0 < 1.0 and _min <= _max
_min[in] | the minimum colour clamp value |
_max[in] | the maximum colour clamp value |
Definition at line 104 of file Colour.cpp.
|
inlinenoexcept |
[in] | _c | the Colour to mult |
Definition at line 63 of file Colour.cpp.
[in] | _c | the scalar to multiply colour by |
Definition at line 73 of file Colour.cpp.
[in] | _c | the scalar to multiply colour by |
Definition at line 83 of file Colour.cpp.
References m_r.
[in] | _c | the scalar to multiply colour by |
Definition at line 93 of file Colour.cpp.
[in] | _c | the Colour to add |
Definition at line 36 of file Colour.cpp.
[in] | _c | the Colour to add |
Definition at line 54 of file Colour.cpp.
References m_r.
[in] | _c | the Colour to add |
Definition at line 45 of file Colour.cpp.
set method to set from another Colour
[in] | _c | the colour |
Definition at line 76 of file Colour.h.
References ngl::operator*().
|
friend |
Real ngl::Colour::m_openGL[4] |