AnimatLab  2
Test
StdColor.h
Go to the documentation of this file.
1 
7 #pragma once
8 
14 namespace StdUtils
15 {
22 class STD_UTILS_PORT CStdColor
23 {
24 protected:
26  float m_fltR;
27 
29  float m_fltB;
30 
32  float m_fltG;
33 
35  float m_fltA;
36 
39 
40 public:
41 
48  CStdColor();
49 
58  CStdColor(float fltMaxRange);
59 
72  CStdColor(float valr, float valg, float valb, float vala, float fltMaxRange);
73 
74  void r(float fltR, bool bThrowError = true);
75  float r();
76 
77  void g(float fltG, bool bThrowError = true);
78  float g();
79 
80  void b(float fltB, bool bThrowError = true);
81  float b();
82 
83  void a(float fltA, bool bThrowError = true);
84  float a();
85 
86  void Set(float R, float G, float B, float A);
87  bool operator==(const CStdColor &oPoint);
88  bool operator!=(const CStdColor &oPoint);
89  void operator=(const CStdColor &oPoint);
90  void operator+=(const CStdColor &oPoint);
91  void operator-=(const CStdColor &oPoint);
92  CStdColor operator+(const CStdColor &oPoint);
93  CStdColor operator-(const CStdColor &oPoint);
94  void operator+=(const float fltVal);
95  void operator-=(const float fltVal);
96  void operator*=(const float fltVal);
97  void operator/=(const float fltVal);
98 
99  CStdColor operator+(const float fltVal);
100  CStdColor operator-(const float fltVal);
101  CStdColor operator*(const float fltVal);
102  CStdColor operator/(const float fltVal);
103  double Magnitude();
104  void Normalize();
105  void ClearNearZero(float fltTolerance = 1e-5f);
106  float operator[](const int iIndex);
107  void Load(CStdXml &oXml, std::string strParamName, bool bThrowError = true);
108  void Load(std::string strXml, std::string strParamName, bool bThrowError = true);
109 
110 };
111 
112 } //StdUtils
Standard color class.
Definition: StdColor.h:22
float m_fltG
The green component of the color.
Definition: StdColor.h:32
float m_fltR
The red component of the color.
Definition: StdColor.h:26
float m_fltMaxRange
some colors are 0-255, others are 0-1. This specifies the max range for these colors ...
Definition: StdColor.h:38
A standard xml manipulation class.
Definition: StdXml.h:19
float m_fltB
The blue component of the color.
Definition: StdColor.h:29
Namespace for the standard utility objects.
Definition: MarkupSTL.cpp:19
float m_fltA
The alpha component of the color.
Definition: StdColor.h:35