TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
G3D::Color1 Class Reference

#include <Color1.h>

Public Member Functions

 Color1 ()
 
 Color1 (class BinaryInput &bi)
 
 Color1 (float v)
 
 Color1 (unorm8 v)
 
bool isZero () const
 
bool isOne () const
 
class Color3 rgb () const
 
 Color1 (const class Color1unorm8 &other)
 
void serialize (class BinaryOutput &bo) const
 
void deserialize (class BinaryInput &bi)
 
Color1 operator+ (const Color1 &other) const
 
Color1 operator+ (const float other) const
 
Color1operator+= (const Color1 other)
 
Color1operator-= (const Color1 other)
 
Color1 operator- (const Color1 &other) const
 
Color1 operator- (const float other) const
 
Color1 operator- () const
 
Color1 operator* (const Color1 &other) const
 
Color1operator*= (const Color1 other)
 
Color1operator*= (const float other)
 
Color1operator/= (const float other)
 
Color1operator/= (const Color1 other)
 
Color1 operator* (const float other) const
 
Color1 operator/ (const Color1 &other) const
 
Color1 operator/ (const float other) const
 
Color1 max (const Color1 &other) const
 
Color1 min (const Color1 &other) const
 
Color1 lerp (const Color1 &other, float a) const
 
size_t hashCode () const
 

Static Public Member Functions

static const Color1one ()
 
static const Color1zero ()
 

Public Attributes

float value
 

Private Member Functions

bool operator< (const Color1 &) const
 
bool operator> (const Color1 &) const
 
bool operator<= (const Color1 &) const
 
bool operator>= (const Color1 &) const
 

Detailed Description

Monochrome color.

Constructor & Destructor Documentation

G3D::Color1::Color1 ( )
inline

Initializes to 0

42 : value(0) {}
float value
Definition: Color1.h:37

+ Here is the caller graph for this function:

G3D::Color1::Color1 ( class BinaryInput bi)
33  {
34  deserialize(bi);
35 }
void deserialize(class BinaryInput &bi)
Definition: Color1.cpp:43

+ Here is the call graph for this function:

G3D::Color1::Color1 ( float  v)
inlineexplicit
46  : value(v) {
47  }
float value
Definition: Color1.h:37
G3D::Color1::Color1 ( unorm8  v)
inlineexplicit
49  : value(v) {
50  }
float value
Definition: Color1.h:37
G3D::Color1::Color1 ( const class Color1unorm8 &  other)
explicit
53  {
54  value = other.value;
55 }
float value
Definition: Color1.h:37

Member Function Documentation

void G3D::Color1::deserialize ( class BinaryInput bi)
43  {
44  value = bi.readFloat32();
45 }
float value
Definition: Color1.h:37

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t G3D::Color1::hashCode ( ) const
inline
153  {
154  return (size_t)(value * 0xFFFFFF);
155  }
float value
Definition: Color1.h:37

+ Here is the caller graph for this function:

bool G3D::Color1::isOne ( ) const
inline
56  {
57  return value == 1.0f;
58  }
float value
Definition: Color1.h:37
bool G3D::Color1::isZero ( ) const
inline
52  {
53  return value == 0.0f;
54  }
float value
Definition: Color1.h:37
Color1 G3D::Color1::lerp ( const Color1 other,
float  a 
) const
inline
148  {
149  return Color1(value + (other.value - value) * a);
150 
151  }
Color1()
Definition: Color1.h:42
float value
Definition: Color1.h:37

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Color1 G3D::Color1::max ( const Color1 other) const
inline
140  {
141  return Color1(G3D::max(value, other.value));
142  }
Color1()
Definition: Color1.h:42
T max(const T &x, const T &y)
Definition: g3dmath.h:320
float value
Definition: Color1.h:37

+ Here is the call graph for this function:

Color1 G3D::Color1::min ( const Color1 other) const
inline
144  {
145  return Color1(G3D::min(value, other.value));
146  }
Color1()
Definition: Color1.h:42
T min(const T &x, const T &y)
Definition: g3dmath.h:305
float value
Definition: Color1.h:37

+ Here is the call graph for this function:

const Color1 & G3D::Color1::one ( )
static
21  {
22  static const Color1 x(1.0f);
23  return x;
24 }
Color1()
Definition: Color1.h:42
G3D::int16 x
Definition: Vector2int16.h:37
Color1 G3D::Color1::operator* ( const Color1 other) const
inline
104  {
105  return Color1(value * other.value);
106  }
Color1()
Definition: Color1.h:42
float value
Definition: Color1.h:37

+ Here is the call graph for this function:

Color1 G3D::Color1::operator* ( const float  other) const
inline
128  {
129  return Color1(value * other);
130  }
Color1()
Definition: Color1.h:42
float value
Definition: Color1.h:37

+ Here is the call graph for this function:

Color1& G3D::Color1::operator*= ( const Color1  other)
inline
108  {
109  value *= other.value;
110  return *this;
111  }
float value
Definition: Color1.h:37
Color1& G3D::Color1::operator*= ( const float  other)
inline
113  {
114  value *= other;
115  return *this;
116  }
float value
Definition: Color1.h:37
Color1 G3D::Color1::operator+ ( const Color1 other) const
inline
72  {
73  return Color1(value + other.value);
74  }
Color1()
Definition: Color1.h:42
float value
Definition: Color1.h:37

+ Here is the call graph for this function:

Color1 G3D::Color1::operator+ ( const float  other) const
inline
Deprecated:
77  {
78  return Color1(value + other);
79  }
Color1()
Definition: Color1.h:42
float value
Definition: Color1.h:37

+ Here is the call graph for this function:

Color1& G3D::Color1::operator+= ( const Color1  other)
inline
81  {
82  value += other.value;
83  return *this;
84  }
float value
Definition: Color1.h:37
Color1 G3D::Color1::operator- ( const Color1 other) const
inline
91  {
92  return Color1(value - other.value);
93  }
Color1()
Definition: Color1.h:42
float value
Definition: Color1.h:37

+ Here is the call graph for this function:

Color1 G3D::Color1::operator- ( const float  other) const
inline
Deprecated:
96  {
97  return Color1(value - other);
98  }
Color1()
Definition: Color1.h:42
float value
Definition: Color1.h:37

+ Here is the call graph for this function:

Color1 G3D::Color1::operator- ( ) const
inline
100  {
101  return Color1(-value);
102  }
Color1()
Definition: Color1.h:42
float value
Definition: Color1.h:37

+ Here is the call graph for this function:

Color1& G3D::Color1::operator-= ( const Color1  other)
inline
86  {
87  value -= other.value;
88  return *this;
89  }
float value
Definition: Color1.h:37
Color1 G3D::Color1::operator/ ( const Color1 other) const
inline
132  {
133  return Color1(value / other.value);
134  }
Color1()
Definition: Color1.h:42
float value
Definition: Color1.h:37

+ Here is the call graph for this function:

Color1 G3D::Color1::operator/ ( const float  other) const
inline
136  {
137  return Color1(value / other);
138  }
Color1()
Definition: Color1.h:42
float value
Definition: Color1.h:37

+ Here is the call graph for this function:

Color1& G3D::Color1::operator/= ( const float  other)
inline
118  {
119  value /= other;
120  return *this;
121  }
float value
Definition: Color1.h:37
Color1& G3D::Color1::operator/= ( const Color1  other)
inline
123  {
124  value /= other.value;
125  return *this;
126  }
float value
Definition: Color1.h:37
bool G3D::Color1::operator< ( const Color1 ) const
private
bool G3D::Color1::operator<= ( const Color1 ) const
private
bool G3D::Color1::operator> ( const Color1 ) const
private
bool G3D::Color1::operator>= ( const Color1 ) const
private
Color3 G3D::Color1::rgb ( ) const

Returns the value three times

38  {
39  return Color3(value, value, value);
40 }
float value
Definition: Color1.h:37
void G3D::Color1::serialize ( class BinaryOutput bo) const
48  {
49  bo.writeFloat32(value);
50 }
float value
Definition: Color1.h:37

+ Here is the call graph for this function:

const Color1 & G3D::Color1::zero ( )
static
27  {
28  const static Color1 x(0.0f);
29  return x;
30 }
Color1()
Definition: Color1.h:42
G3D::int16 x
Definition: Vector2int16.h:37

Member Data Documentation

float G3D::Color1::value

The documentation for this class was generated from the following files: