g4tools  5.4.0
Public Types | Public Member Functions | List of all members
tools::colorf Class Reference
Inheritance diagram for tools::colorf:
Inheritance graph
[legend]
Collaboration diagram for tools::colorf:
Collaboration graph
[legend]

Public Types

typedef unsigned char uchar
 
- Public Types inherited from tools::vec4< float >
typedef float elem_t
 
typedef unsigned int size_type
 

Public Member Functions

 TOOLS_SCLASS (tools::colorf) public
 
 colorf (float a_r, float a_g, float a_b, float a_a=1)
 
virtual ~colorf ()
 
 colorf (const colorf &a_from)
 
colorfoperator= (const colorf &a_from)
 
float r () const
 
float g () const
 
float b () const
 
float a () const
 
void set_r (float a_v)
 
void set_g (float a_v)
 
void set_b (float a_v)
 
void set_a (float a_v)
 
uchar ruchar () const
 
uchar guchar () const
 
uchar buchar () const
 
uchar auchar () const
 
uchar rchar () const
 
uchar gchar () const
 
uchar bchar () const
 
- Public Member Functions inherited from tools::vec4f
 TOOLS_SCLASS (tools::vec4f) public
 
 vec4f (const float a_vec[4])
 
 vec4f (const float &a0, const float &a1, const float &a2, const float &a3)
 
virtual ~vec4f ()
 
 vec4f (const vec4f &a_from)
 
vec4foperator= (const vec4f &a_from)
 
vec4f operator* (float a_v) const
 
vec4f operator+ (const vec4f &a_v) const
 
vec4f operator- (const vec4f &a_v) const
 
vec4foperator+= (const vec4f &a_v)
 
vec4foperator*= (float a_v)
 
vec4f operator- () const
 
float length () const
 
float normalize ()
 
- Public Member Functions inherited from tools::vec4< float >
unsigned int dimension () const
 
 vec4 ()
 
 vec4 (const float a_vec[4])
 
 vec4 (const float &a0, const float &a1, const float &a2, const float &a3)
 
 vec4 (const vec4 &a_from)
 
virtual ~vec4 ()
 
vec4operator= (const vec4 &a_from)
 
const float & v0 () const
 
void v0 (const float &a_value)
 
const float & v1 () const
 
void v1 (const float &a_value)
 
const float & v2 () const
 
void v2 (const float &a_value)
 
const float & v3 () const
 
void v3 (const float &a_value)
 
const float & x () const
 
const float & y () const
 
const float & z () const
 
const float & t () const
 
void set_value (const float &a0, const float &a1, const float &a2, const float &a3)
 
void set_value (const float aV[4])
 
bool set_value (unsigned int a_index, const float &a_value)
 
void value (float &a0, float &a1, float &a2, float &a3) const
 
float length (float(*a_sqrt)(float)) const
 
float normalize (float(*a_sqrt)(float))
 
bool equal (const vec4 &a_vec) const
 
bool equal (const vec4 &a_vec, const float &a_epsil) const
 
bool is_proportional (const vec4 &a_vec, float &a_factor) const
 
void multiply (const float &a_T)
 
bool divide (const float &a_T)
 
void add (const vec4 &a_v)
 
void add (const float &a0, const float &a1, const float &a2, const float &a3)
 
void subtract (const vec4 &a_v)
 
void subtract (const float &a0, const float &a1, const float &a2, const float &a3)
 
float & operator[] (size_t a_index)
 
const float & operator[] (size_t a_index) const
 
vec4 operator+ (const vec4 &a_v) const
 
vec4 operator- (const vec4 &a_v) const
 
vec4 operator* (const float &a_v) const
 
bool operator== (const vec4 &a_v) const
 
bool operator!= (const vec4 &a_v) const
 
size_type size () const
 
const float * data () const
 

Additional Inherited Members

- Static Protected Member Functions inherited from tools::vec4< float >
static float zero ()
 
static float minus_one ()
 
- Protected Attributes inherited from tools::vec4< float >
float m_data [4]
 

Detailed Description

Definition at line 11 of file colorf.

Member Typedef Documentation

◆ uchar

typedef unsigned char tools::colorf::uchar

Definition at line 14 of file colorf.

Constructor & Destructor Documentation

◆ colorf() [1/2]

tools::colorf::colorf ( float  a_r,
float  a_g,
float  a_b,
float  a_a = 1 
)
inline

Definition at line 22 of file colorf.

22 :parent(a_r,a_g,a_b,a_a){}

◆ ~colorf()

virtual tools::colorf::~colorf ( )
inlinevirtual

Definition at line 24 of file colorf.

24 {}

◆ colorf() [2/2]

tools::colorf::colorf ( const colorf a_from)
inline

Definition at line 26 of file colorf.

26 :parent(a_from){}

Member Function Documentation

◆ a()

float tools::colorf::a ( ) const
inline

Definition at line 35 of file colorf.

35 {return v3();}

◆ auchar()

uchar tools::colorf::auchar ( ) const
inline

Definition at line 45 of file colorf.

45 {return uchar(255.0f*m_data[3]);}

◆ b()

float tools::colorf::b ( ) const
inline

Definition at line 34 of file colorf.

34 {return v2();}

◆ bchar()

uchar tools::colorf::bchar ( ) const
inline

Definition at line 51 of file colorf.

51 {return uchar(255.0f*m_data[2]);}

◆ buchar()

uchar tools::colorf::buchar ( ) const
inline

Definition at line 44 of file colorf.

44 {return uchar(255.0f*m_data[2]);}

◆ g()

float tools::colorf::g ( ) const
inline

Definition at line 33 of file colorf.

33 {return v1();}

◆ gchar()

uchar tools::colorf::gchar ( ) const
inline

Definition at line 50 of file colorf.

50 {return uchar(255.0f*m_data[1]);}

◆ guchar()

uchar tools::colorf::guchar ( ) const
inline

Definition at line 43 of file colorf.

43 {return uchar(255.0f*m_data[1]);}

◆ operator=()

colorf& tools::colorf::operator= ( const colorf a_from)
inline

Definition at line 27 of file colorf.

27  {
28  parent::operator=(a_from);
29  return *this;
30  }

◆ r()

float tools::colorf::r ( ) const
inline

Definition at line 32 of file colorf.

32 {return v0();}

◆ rchar()

uchar tools::colorf::rchar ( ) const
inline

Definition at line 49 of file colorf.

49 {return uchar(255.0f*m_data[0]);}

◆ ruchar()

uchar tools::colorf::ruchar ( ) const
inline

Definition at line 42 of file colorf.

42 {return uchar(255.0f*m_data[0]);}

◆ set_a()

void tools::colorf::set_a ( float  a_v)
inline

Definition at line 40 of file colorf.

40 {m_data[3] = a_v;}

◆ set_b()

void tools::colorf::set_b ( float  a_v)
inline

Definition at line 39 of file colorf.

39 {m_data[2] = a_v;}

◆ set_g()

void tools::colorf::set_g ( float  a_v)
inline

Definition at line 38 of file colorf.

38 {m_data[1] = a_v;}

◆ set_r()

void tools::colorf::set_r ( float  a_v)
inline

Definition at line 37 of file colorf.

37 {m_data[0] = a_v;}

◆ TOOLS_SCLASS()

tools::colorf::TOOLS_SCLASS ( tools::colorf  )
inline

Definition at line 16 of file colorf.

17  :
18  colorf():parent(0,0,0,1){}

The documentation for this class was generated from the following file:
tools::vec4< float >::v1
const float & v1() const
Definition: vec4:86
tools::vec4< float >::m_data
float m_data[4]
Definition: vec4:262
tools::vec4< float >::v0
const float & v0() const
Definition: vec4:85
tools::colorf::colorf
colorf(float a_r, float a_g, float a_b, float a_a=1)
Definition: colorf:22
tools::colorf::uchar
unsigned char uchar
Definition: colorf:14
tools::vec4< float >::v2
const float & v2() const
Definition: vec4:87
tools::vec4f::operator=
vec4f & operator=(const vec4f &a_from)
Definition: vec4f:28
tools::vec4< float >::v3
const float & v3() const
Definition: vec4:88