41 Vec4ub() { _v[0]=0; _v[1]=0; _v[2]=0; _v[3]=0; }
43 Vec4ub(value_type x, value_type y, value_type z, value_type w)
57 if (_v[0]<v.
_v[0])
return true;
58 else if (_v[0]>v.
_v[0])
return false;
59 else if (_v[1]<v.
_v[1])
return true;
60 else if (_v[1]>v.
_v[1])
return false;
61 else if (_v[2]<v.
_v[2])
return true;
62 else if (_v[2]>v.
_v[2])
return false;
63 else return (_v[3]<v.
_v[3]);
66 inline value_type*
ptr() {
return _v; }
67 inline const value_type*
ptr()
const {
return _v; }
69 inline void set(value_type
r, value_type
g, value_type
b, value_type
a)
71 _v[0]=
r; _v[1]=
g; _v[2]=
b; _v[3]=
a;
74 inline value_type&
operator [] (
unsigned int i) {
return _v[i]; }
75 inline value_type
operator [] (
unsigned int i)
const {
return _v[i]; }
77 inline value_type&
r() {
return _v[0]; }
78 inline value_type&
g() {
return _v[1]; }
79 inline value_type&
b() {
return _v[2]; }
80 inline value_type&
a() {
return _v[3]; }
82 inline value_type
r()
const {
return _v[0]; }
83 inline value_type
g()
const {
return _v[1]; }
84 inline value_type
b()
const {
return _v[2]; }
85 inline value_type
a()
const {
return _v[3]; }
116 float div = 1.0f/rhs;
124 return Vec4ub(_v[0]+rhs.
_v[0], _v[1]+rhs.
_v[1],
125 _v[2]+rhs.
_v[2], _v[3]+rhs.
_v[3]);
143 return Vec4ub(_v[0]-rhs.
_v[0], _v[1]-rhs.
_v[1],
144 _v[2]-rhs.
_v[2], _v[3]-rhs.
_v[3] );
Vec4ub operator+(const Vec4ub &rhs) const
const value_type * ptr() const
bool operator!=(const Vec4ub &v) const
Vec4ub(value_type x, value_type y, value_type z, value_type w)
void set(value_type r, value_type g, value_type b, value_type a)
Vec4ub & operator-=(const Vec4ub &rhs)
bool operator<(const Vec4ub &v) const
Vec4ub & operator+=(const Vec4ub &rhs)
Vec4ub operator-(const Vec4ub &rhs) const
Vec4ub operator/(float rhs) const
value_type & operator[](unsigned int i)
Vec4ub operator*(float rhs) const
Vec4ub & operator*=(float rhs)
bool operator==(const Vec4ub &v) const
Vec4ub & operator/=(float rhs)