Floating point color description class (for float). More...
#include <color.h>
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 (const Vec4f &color) | |
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... | |
![]() | |
Vec4 () | |
Vec4 (const Type &p1, const Type &p2, const Type &p3, const Type &p4) | |
Vec4 (const Type &p1, const Type &p2, const Vec2< Type > ©34) | |
Vec4 (const Type &scalar) | |
Vec4 (const Type *array_xyzw) | |
Vec4 (const Vec2< Type > ©, const Type &p3, const Type &p4) | |
Vec4 (const Vec2< Type > ©, const Vec2< Type > ©34) | |
Vec4 (const Vec3< Type > ©, const Type &p4) | |
double | length3 () const |
float | length3 () const |
double | length4 () const |
float | length4 () const |
void | set_xy (const Vec2< Type > &new_v) |
void | set_zw (const Vec2< Type > &new_v) |
Type | length3 () const |
Returns the length (magnitude) of this vector (not taking into account the w ordinate). More... | |
Type | length4 () const |
Returns the length (magnitude) of this vector (taking into account the w ordinate). More... | |
Vec4< Type > & | normalize3 () |
Normalizes this vector (not taking into account the w ordinate) More... | |
Vec4< Type > & | normalize4 () |
Normalizes this vector (taking into account the w ordinate) More... | |
Type | dot3 (const Vec4< Type > &vector) const |
Dot products this vector with an other vector (not taking into account the w ordinate). More... | |
Type | dot4 (const Vec4< Type > &vector) const |
Dot products this vector with an other vector (taking into account the w ordinate). More... | |
Angle | angle3 (const Vec4< Type > &vector) const |
Calculate the angle between this vector and an other vector (not taking into account the w ordinate). More... | |
Type | distance3 (const Vec4< Type > &vector) const |
Calculate the distance between this vector and an other vector (not taking into account the w ordinate). More... | |
Type | distance4 (const Vec4< Type > &vector) const |
Calculate the distance between this vector and an other vector (taking into account the w ordinate). More... | |
Vec4< Type > & | cross3 (const Vec4< Type > &vector) |
Calculate the cross product between this vector and an other vector (not taking into account the w ordinate). More... | |
Vec4< Type > & | rotate3 (const Angle &angle, const Vec4< Type > &axis) |
Rotate this vector around an axis. Same as glRotate[f|d](angle, a);. More... | |
Vec4< Type > & | round () |
Rounds all components on this vector. More... | |
bool | is_equal (const Vec4< Type > &other, Type epsilon) const |
Returns true if equal within the bounds of an epsilon. More... | |
void | operator+= (const Vec4< Type > &vector) |
+= operator. More... | |
void | operator+= (Type value) |
+= operator. More... | |
void | operator-= (const Vec4< Type > &vector) |
-= operator. More... | |
void | operator-= (Type value) |
-= operator. More... | |
Vec4< Type > | operator- () const |
| |
void | operator*= (const Vec4< Type > &vector) |
*= operator. More... | |
void | operator*= (Type value) |
*= operator. More... | |
void | operator/= (const Vec4< Type > &vector) |
/= operator. More... | |
void | operator/= (Type value) |
/= operator. More... | |
Vec4< Type > & | operator= (const Vec4< Type > &vector) |
= operator. More... | |
bool | operator== (const Vec4< Type > &vector) const |
== operator. More... | |
bool | operator!= (const Vec4< Type > &vector) const |
!= operator. More... | |
bool | operator< (const Vec4< Type > &vector) const |
< operator. More... | |
Additional Inherited Members | |
![]() | |
typedef Type | datatype |
![]() | |
static Vec4< Type > | cross3 (const Vec4< Type > &vector1, const Vec4< Type > &vector2) |
Calculate the cross product between two vectors (not taking into account the w ordinate). More... | |
static Type | dot3 (const Vec4< Type > &vector1, const Vec4< Type > &vector2) |
Dot products between two vectors (not taking into account the w ordinate). More... | |
static Type | dot4 (const Vec4< Type > &vector1, const Vec4< Type > &vector2) |
Dot products between two vectors (taking into account the w ordinate). More... | |
static bool | is_equal (const Vec4< Type > &first, const Vec4< Type > &second, Type epsilon) |
Returns true if equal within the bounds of an epsilon. More... | |
static Vec4< Type > | normalize3 (const Vec4< Type > &vector) |
Normalizes a vector (not taking into account the w ordinate) More... | |
static Vec4< Type > | normalize4 (const Vec4< Type > &vector) |
Normalizes a vector (taking into account the w ordinate) More... | |
static Vec4< Type > | rotate3 (const Vec4< Type > &vector, const Angle &angle, const Vec4< Type > &axis) |
Rotate a vector around an axis. Same as glRotate[f|d](angle, a);. More... | |
static Vec4< Type > | round (const Vec4< Type > &vector) |
Rounds all components on a vector. More... | |
![]() | |
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 | |
}; | |
Floating point color description class (for float).