1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-09 01:07:16 +01:00
SqMod/source/Base/Color4.hpp

469 lines
14 KiB
C++
Raw Normal View History

2015-09-30 02:56:11 +02:00
#ifndef _BASE_COLOR4_HPP_
#define _BASE_COLOR4_HPP_
// ------------------------------------------------------------------------------------------------
#include "SqBase.hpp"
2015-09-30 02:56:11 +02:00
// ------------------------------------------------------------------------------------------------
namespace SqMod {
/* ------------------------------------------------------------------------------------------------
*
2015-09-30 02:56:11 +02:00
*/
struct Color4
{
/* --------------------------------------------------------------------------------------------
* ...
*/
typedef unsigned char Value;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
static const Color4 NIL;
static const Color4 MIN;
static const Color4 MAX;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
static SQChar Delim;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
Value r, g, b, a;
/* --------------------------------------------------------------------------------------------
*
*/
Color4();
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4(Value sv);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4(Value rv, Value gv, Value bv);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4(Value rv, Value gv, Value bv, Value av);
/* --------------------------------------------------------------------------------------------
*
*/
Color4(const Color4 & o);
/* --------------------------------------------------------------------------------------------
*
*/
2015-09-30 02:56:11 +02:00
~Color4();
/* --------------------------------------------------------------------------------------------
*
*/
Color4 & operator = (const Color4 & o);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator = (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator = (CSStr name);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator = (const Color3 & c);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator += (const Color4 & c);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator -= (const Color4 & c);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator *= (const Color4 & c);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator /= (const Color4 & c);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator %= (const Color4 & c);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator &= (const Color4 & c);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator |= (const Color4 & c);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator ^= (const Color4 & c);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator <<= (const Color4 & c);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator >>= (const Color4 & c);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator += (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator -= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator *= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator /= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator %= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator &= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator |= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator ^= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator <<= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator >>= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator ++ ();
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 & operator -- ();
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator ++ (int);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator -- (int);
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator + (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator - (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator * (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator / (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator % (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator & (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator | (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator ^ (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator << (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator >> (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator + (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator - (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator * (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator / (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator % (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator & (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator | (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator ^ (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator << (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator >> (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator + () const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator - () const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Color4 operator ~ () const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator == (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator != (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator < (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator > (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator <= (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator >= (const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
operator Color3 () const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Int32 Cmp(const Color4 & c) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
CSStr ToString() const;
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(Value ns);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(Value nr, Value ng, Value nb);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(Value nr, Value ng, Value nb, Value na);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(const Color4 & c);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(const Color3 & c);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(CSStr name, SQChar delim);
/* --------------------------------------------------------------------------------------------
* ...
*/
void SetCol(CSStr name);
/* --------------------------------------------------------------------------------------------
* ...
*/
Uint32 GetRGB() const;
/* --------------------------------------------------------------------------------------------
* ...
*/
void SetRGB(Uint32 p);
/* --------------------------------------------------------------------------------------------
* ...
*/
Uint32 GetRGBA() const;
/* --------------------------------------------------------------------------------------------
* ...
*/
void SetRGBA(Uint32 p);
/* --------------------------------------------------------------------------------------------
* ...
*/
Uint32 GetARGB() const;
/* --------------------------------------------------------------------------------------------
* ...
*/
void SetARGB(Uint32 p);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Generate();
/* --------------------------------------------------------------------------------------------
* ...
*/
void Generate(Value min, Value max);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Generate(Value rmin, Value rmax, Value gmin, Value gmax, Value bmin, Value bmax, Value amin, Value amax);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Clear()
{
r = 0, g = 0, b = 0, a = 0;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void Random();
/* --------------------------------------------------------------------------------------------
* ...
*/
void Inverse();
2015-09-30 02:56:11 +02:00
};
} // Namespace:: SqMod
#endif // _BASE_COLOR4_HPP_