Color description class. More...
#include <color.h>
Public Member Functions | |
Construction | |
Color () | |
Constructs a color. More... | |
Color (const Colorf &) | |
Color (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255) | |
Constructs a color. More... | |
Color (const std::string &hexstr) | |
Constructs a color. More... | |
Attributes | |
unsigned char | get_alpha () const |
Returns the alpha color component, in the range 0-255. More... | |
unsigned char | get_red () const |
Returns the red color component, in the range 0-255. More... | |
unsigned char | get_green () const |
Returns the green color component, in the range 0-255. More... | |
unsigned char | get_blue () const |
Returns the blue color component, in the range 0-255. More... | |
float | get_alpha_f () const |
Returns the alpha color component, in the range 0-1. More... | |
float | get_red_f () const |
Returns the red color component, in the range 0-1. More... | |
float | get_green_f () const |
Returns the green color component, in the range 0-1. More... | |
float | get_blue_f () const |
Returns the blue color component, in the range 0-1. More... | |
unsigned int | get_argb8 () const |
Returns the color in ARGB8888 format. More... | |
unsigned int | get_abgr8 () const |
Returns the color in ABGR8888 format. More... | |
unsigned int | get_rgba8 () const |
Returns the color in RGBA8888 format. More... | |
unsigned int | get_bgra8 () const |
Returns the color in BGRA8888 format. More... | |
bool | operator== (const Color &c) const |
Color == Color operator (deep compare) More... | |
bool | operator!= (const Color &c) const |
Color != Color operator (deep compare) More... | |
Operations | |
void | set_alpha (unsigned char value) |
Set alpha color component, in the range 0-255. More... | |
void | set_red (unsigned char value) |
Set red color component, in the range 0-255. More... | |
void | set_green (unsigned char value) |
Set green color component, in the range 0-255. More... | |
void | set_blue (unsigned char value) |
Set blue color component, in the range 0-255. More... | |
void | set_alpha_f (float value) |
Set alpha color component, in the range 0-1. More... | |
void | set_red_f (float value) |
Set red color component, in the range 0-1. More... | |
void | set_green_f (float value) |
Set green color component, in the range 0-1. More... | |
void | set_blue_f (float value) |
Set blue color component, in the range 0-1. More... | |
void | set_color (unsigned char new_red, unsigned char new_green, unsigned char new_blue, unsigned char new_alpha=255) |
Set color based on rgba color components in the range 0-255. More... | |
void | set_rgba8 (unsigned int color) |
Set color based on rgba color components. More... | |
void | set_bgra8 (unsigned int color) |
Set color based on rgba color components. More... | |
void | set_rgb8 (unsigned int color) |
Set color based on rgb color components. Alpha is set to 255. More... | |
void | set_argb8 (unsigned int color) |
Set color based on argb color components. More... | |
void | set_colorf (float new_red, float new_green, float new_blue, float new_alpha=1.0f) |
Set color based on rgba color components in the range 0-1. 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 | |
}; | |
Color description class.