Floating point color description class (for float). More...
#include <color.h>
Inheritance diagram for clan::Colorf:Public Types | |
| typedef float | datatype |
Public Member Functions | |
Construction | |
| Colorf () | |
| Constructs a color. More... | |
| Colorf (float r, float g, float b, float a=1.0f) | |
| Constructs a color. More... | |
| Colorf (const float *array_rgba) | |
| Constructs a color. More... | |
| Colorf (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) | |
| Constructs a color. More... | |
| Colorf (int r, int g, int b, int a=255) | |
| Constructs a color. More... | |
| Colorf (const Color &color) | |
| Colorf (const std::string &hexstr) | |
| Constructs a color. More... | |
Attributes | |
| float | get_red () const |
| Get Red. More... | |
| float | get_green () const |
| Get Green. More... | |
| float | get_blue () const |
| Get Blue. More... | |
| float | get_alpha () const |
| Get Alpha. More... | |
Operations | |
| void | normalize () |
| Normalize the color by ensuring that all color values lie inbetween (0.0, 1.0) More... | |
| void | set_alpha (float value) |
| Set alpha color component, in the range 0-1. More... | |
| void | set_red (float value) |
| Set red color component, in the range 0-1. More... | |
| void | set_green (float value) |
| Set green color component, in the range 0-1. More... | |
| void | set_blue (float value) |
| Set blue color component, in the range 0-1. More... | |
| bool | operator== (const Colorf &c) const |
| Color == Color operator (deep compare) More... | |
| bool | operator!= (const Colorf &c) const |
| Color != Color operator (deep compare) More... | |
| operator Color () const | |
| Type conversion operator. More... | |
Attributes | |
| Vec4< float > & | normalize3 () |
| Normalizes this vector (not taking into account the w ordinate) More... | |
| Vec4< float > & | normalize4 () |
| Normalizes this vector (taking into account the w ordinate) More... | |
| float | dot3 (const Vec4< float > &vector) const |
| Dot products this vector with an other vector (not taking into account the w ordinate). More... | |
| float | dot4 (const Vec4< float > &vector) const |
| Dot products this vector with an other vector (taking into account the w ordinate). More... | |
| Vec4< float > & | cross3 (const Vec4< float > &vector) |
| Calculate the cross product between this vector and an other vector (not taking into account the w ordinate). More... | |
| Vec4< float > & | rotate3 (const Angle &angle, const Vec4< float > &axis) |
| Rotate this vector around an axis. Same as glRotate[f|d](angle, a);. More... | |
| Vec4< float > & | round () |
| Rounds all components on this vector. More... | |
| bool | is_equal (const Vec4< float > &other, floatepsilon) const |
| Returns true if equal within the bounds of an epsilon. More... | |
| *float | length3 () const |
| Returns the length (magnitude) of this vector (not taking into account the w ordinate). More... | |
| *float | length4 () const |
| Returns the length (magnitude) of this vector (taking into account the w ordinate). More... | |
| Angle | angle3 (const Vec4< float > &vector) const |
| Calculate the angle between this vector and an other vector (not taking into account the w ordinate). More... | |
| float | distance3 (const Vec4< float > &vector) const |
| Calculate the distance between this vector and an other vector (not taking into account the w ordinate). More... | |
| float | distance4 (const Vec4< float > &vector) const |
| Calculate the distance between this vector and an other vector (taking into account the w ordinate). More... | |
Operators | |
| void | operator+= (const Vec4< float > &vector) |
| += operator. More... | |
| void | operator+= (floatvalue) |
| += operator. More... | |
| void | operator-= (const Vec4< float > &vector) |
| -= operator. More... | |
| void | operator-= (floatvalue) |
| -= operator. More... | |
| Vec4< float > | operator- () const |
| |
| void | operator*= (const Vec4< float > &vector) |
| *= operator. More... | |
| void | operator*= (floatvalue) |
| *= operator. More... | |
| void | operator/= (const Vec4< float > &vector) |
| /= operator. More... | |
| void | operator/= (floatvalue) |
| /= operator. More... | |
| bool | operator== (const Vec4< float > &vector) const |
| == operator. More... | |
| bool | operator!= (const Vec4< float > &vector) const |
| != operator. More... | |
| bool | operator< (const Vec4< float > &vector) const |
| < operator. More... | |
Static Public Member Functions | |
| static Vec4< float > | cross3 (const Vec4< float > &vector1, const Vec4< float > &vector2) |
| Calculate the cross product between two vectors (not taking into account the w ordinate). More... | |
| static float | dot3 (const Vec4< float > &vector1, const Vec4< float > &vector2) |
| Dot products between two vectors (not taking into account the w ordinate). More... | |
| static float | dot4 (const Vec4< float > &vector1, const Vec4< float > &vector2) |
| Dot products between two vectors (taking into account the w ordinate). More... | |
| static bool | is_equal (const Vec4< float > &first, const Vec4< float > &second, floatepsilon) |
| Returns true if equal within the bounds of an epsilon. More... | |
| static Vec4< float > | normalize3 (const Vec4< float > &vector) |
| Normalizes a vector (not taking into account the w ordinate) More... | |
| static Vec4< float > | normalize4 (const Vec4< float > &vector) |
| Normalizes a vector (taking into account the w ordinate) More... | |
| static Vec4< float > | rotate3 (const Vec4< float > &vector, const Angle &angle, const Vec4< float > &axis) |
| Rotate a vector around an axis. Same as glRotate[f|d](angle, a);. More... | |
| static Vec4< float > | round (const Vec4< float > &vector) |
| Rounds all components on a vector. More... | |
Public Attributes | |
| union { | |
| Type clan::Vec4< Type >::r | |
| Type clan::Vec4< Type >::s | |
| Type clan::Vec4< Type >::x | |
| }; | |
| union { | |
| Type clan::Vec4< Type >::g | |
| Type clan::Vec4< Type >::t | |
| Type clan::Vec4< Type >::y | |
| }; | |
| union { | |
| Type clan::Vec4< Type >::b | |
| Type clan::Vec4< Type >::u | |
| Type clan::Vec4< Type >::z | |
| }; | |
| union { | |
| Type clan::Vec4< Type >::a | |
| Type clan::Vec4< Type >::v | |
| Type clan::Vec4< Type >::w | |
| }; | |
| float | a |
| float | b |
| float | g |
| float | r |
| float | s |
| float | t |
| float | u |
| float | v |
| float | w |
| float | x |
| float | y |
| float | z |
Floating point color description class (for float).
|
inherited |
|
inherited |
Calculate the angle between this vector and an other vector (not taking into account the w ordinate).
| vector | = Second vector used to calculate angle. |
|
staticinherited |
Calculate the cross product between two vectors (not taking into account the w ordinate).
= The first vector = The second vector
|
inherited |
Calculate the cross product between this vector and an other vector (not taking into account the w ordinate).
Operates in the native datatype
| vector | Second vector used to perform the calculation. |
|
inherited |
Calculate the distance between this vector and an other vector (not taking into account the w ordinate).
| vector | = Second vector used to calculate distance. |
|
inherited |
Calculate the distance between this vector and an other vector (taking into account the w ordinate).
| vector | = Second vector used to calculate distance. |
|
inlinestaticinherited |
Dot products between two vectors (not taking into account the w ordinate).
Operates in the native datatype
| vector1 | First vector used for the dot product. |
| vector2 | Second vector used for the dot product. |
|
inlineinherited |
Dot products this vector with an other vector (not taking into account the w ordinate).
Operates in the native datatype
| vector | Second vector used for the dot product. |
References clan::Vec4< Type >::x, clan::Vec4< Type >::y, and clan::Vec4< Type >::z.
|
inlinestaticinherited |
Dot products between two vectors (taking into account the w ordinate).
Operates in the native datatype
| vector1 | First vector used for the dot product. |
| vector2 | Second vector used for the dot product. |
|
inlineinherited |
Dot products this vector with an other vector (taking into account the w ordinate).
Operates in the native datatype
| vector | Second vector used for the dot product. |
References clan::Vec4< Type >::w, clan::Vec4< Type >::x, clan::Vec4< Type >::y, and clan::Vec4< Type >::z.
|
inlinestaticinherited |
Returns true if equal within the bounds of an epsilon.
| first | = Value A |
| second | = Value B |
| epsilon | = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) |
|
inlineinherited |
Returns true if equal within the bounds of an epsilon.
| other | = Other value |
| epsilon | = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) |
References clan::Vec4< Type >::is_equal().
|
inherited |
Returns the length (magnitude) of this vector (not taking into account the w ordinate).
Operates in the native datatype
|
inherited |
Returns the length (magnitude) of this vector (taking into account the w ordinate).
Operates in the native datatype
|
staticinherited |
Normalizes a vector (not taking into account the w ordinate)
Operates in the native datatype
| vector | = The vector to use |
|
inherited |
Normalizes this vector (not taking into account the w ordinate)
Operates in the native datatype
|
staticinherited |
Normalizes a vector (taking into account the w ordinate)
Operates in the native datatype
| vector | = The vector to use |
|
inherited |
Normalizes this vector (taking into account the w ordinate)
Operates in the native datatype
|
inlineinherited |
!= operator.
References clan::Vec4< Type >::w, clan::Vec4< Type >::x, clan::Vec4< Type >::y, and clan::Vec4< Type >::z.
|
inlineinherited |
*= operator.
References clan::Vec4< Type >::w, clan::Vec4< Type >::x, clan::Vec4< Type >::y, and clan::Vec4< Type >::z.
|
inlineinherited |
*= operator.
References clan::Vec4< Type >::w, clan::Vec4< Type >::x, clan::Vec4< Type >::y, and clan::Vec4< Type >::z.
|
inlineinherited |
+= operator.
References clan::Vec4< Type >::w, clan::Vec4< Type >::x, clan::Vec4< Type >::y, and clan::Vec4< Type >::z.
|
inlineinherited |
+= operator.
References clan::Vec4< Type >::w, clan::Vec4< Type >::x, clan::Vec4< Type >::y, and clan::Vec4< Type >::z.
|
inlineinherited |
References clan::Vec4< Type >::w, clan::Vec4< Type >::x, clan::Vec4< Type >::y, and clan::Vec4< Type >::z.
|
inlineinherited |
-= operator.
References clan::Vec4< Type >::w, clan::Vec4< Type >::x, clan::Vec4< Type >::y, and clan::Vec4< Type >::z.
|
inlineinherited |
-= operator.
References clan::Vec4< Type >::w, clan::Vec4< Type >::x, clan::Vec4< Type >::y, and clan::Vec4< Type >::z.
|
inlineinherited |
/= operator.
References clan::Vec4< Type >::w, clan::Vec4< Type >::x, clan::Vec4< Type >::y, and clan::Vec4< Type >::z.
|
inlineinherited |
/= operator.
References clan::Vec4< Type >::w, clan::Vec4< Type >::x, clan::Vec4< Type >::y, and clan::Vec4< Type >::z.
|
inlineinherited |
< operator.
References clan::Vec4< Type >::w, clan::Vec4< Type >::x, clan::Vec4< Type >::y, and clan::Vec4< Type >::z.
|
inlineinherited |
== operator.
References clan::Vec4< Type >::w, clan::Vec4< Type >::x, clan::Vec4< Type >::y, and clan::Vec4< Type >::z.
|
staticinherited |
Rotate a vector around an axis. Same as glRotate[f|d](angle, a);.
Not taking into account the w ordinate
The w ordinate is not modified
| vector | = The vector to use |
| angle | Angle to rotate |
| axis | Rotation axis. |
|
inherited |
Rotate this vector around an axis. Same as glRotate[f|d](angle, a);.
Not taking into account the w ordinate
The w ordinate is not modified
| angle | Angle to rotate |
| axis | Rotation axis. |
|
staticinherited |
Rounds all components on a vector.
Includes the w ordinate
Uses Asymmetric Arithmetic Rounding
| vector | = The vector to use |
|
inherited |
Rounds all components on this vector.
Includes the w ordinate
Uses Asymmetric Arithmetic Rounding
| union { ... } |
| union { ... } |
| union { ... } |
| union { ... } |
|
inherited |
Referenced by get_alpha(), normalize(), operator!=(), operator==(), and set_alpha().
|
inherited |
Referenced by get_blue(), normalize(), operator!=(), operator==(), and set_blue().
|
inherited |
Referenced by get_green(), normalize(), operator!=(), operator==(), and set_green().
|
inherited |
Referenced by get_red(), normalize(), operator!=(), operator==(), and set_red().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |