38 Vec4b() { _v[0]=0; _v[1]=0; _v[2]=0; _v[3]=0; }
40 Vec4b(value_type
x, value_type
y, value_type
z, value_type
w)
48 inline bool operator == (
const Vec4b& v)
const {
return _v[0]==v.
_v[0] && _v[1]==v.
_v[1] && _v[2]==v.
_v[2] && _v[3]==v.
_v[3]; }
50 inline bool operator != (
const Vec4b& v)
const {
return _v[0]!=v.
_v[0] || _v[1]!=v.
_v[1] || _v[2]!=v.
_v[2] || _v[3]!=v.
_v[3]; }
54 if (_v[0]<v.
_v[0])
return true;
55 else if (_v[0]>v.
_v[0])
return false;
56 else if (_v[1]<v.
_v[1])
return true;
57 else if (_v[1]>v.
_v[1])
return false;
58 else if (_v[2]<v.
_v[2])
return true;
59 else if (_v[2]>v.
_v[2])
return false;
60 else return (_v[3]<v.
_v[3]);
63 inline value_type*
ptr() {
return _v; }
64 inline const value_type*
ptr()
const {
return _v; }
66 inline void set( value_type
x, value_type
y, value_type
z, value_type
w)
68 _v[0]=
x; _v[1]=
y; _v[2]=
z; _v[3]=
w;
71 inline value_type&
operator [] (
unsigned int i) {
return _v[i]; }
72 inline value_type
operator [] (
unsigned int i)
const {
return _v[i]; }
74 inline value_type&
x() {
return _v[0]; }
75 inline value_type&
y() {
return _v[1]; }
76 inline value_type&
z() {
return _v[2]; }
77 inline value_type&
w() {
return _v[3]; }
79 inline value_type
x()
const {
return _v[0]; }
80 inline value_type
y()
const {
return _v[1]; }
81 inline value_type
z()
const {
return _v[2]; }
82 inline value_type
w()
const {
return _v[3]; }
84 inline value_type&
r() {
return _v[0]; }
85 inline value_type&
g() {
return _v[1]; }
86 inline value_type&
b() {
return _v[2]; }
87 inline value_type&
a() {
return _v[3]; }
89 inline value_type
r()
const {
return _v[0]; }
90 inline value_type
g()
const {
return _v[1]; }
91 inline value_type
b()
const {
return _v[2]; }
92 inline value_type
a()
const {
return _v[3]; }
123 float div = 1.0f/rhs;
131 return Vec4b(_v[0]+rhs.
_v[0], _v[1]+rhs.
_v[1],
132 _v[2]+rhs.
_v[2], _v[3]+rhs.
_v[3]);
150 return Vec4b(_v[0]-rhs.
_v[0], _v[1]-rhs.
_v[1],
151 _v[2]-rhs.
_v[2], _v[3]-rhs.
_v[3]);
Vec4b operator*(float rhs) const
Vec4b(value_type x, value_type y, value_type z, value_type w)
Vec4b operator/(float rhs) const
void set(value_type x, value_type y, value_type z, value_type w)
const value_type * ptr() const
Vec4b & operator-=(const Vec4b &rhs)
value_type & operator[](unsigned int i)
bool operator<(const Vec4b &v) const
bool operator==(const Vec4b &v) const
Vec4b operator-(const Vec4b &rhs) const
bool operator!=(const Vec4b &v) const
Vec4b operator+(const Vec4b &rhs) const
Vec4b & operator+=(const Vec4b &rhs)
Vec4b & operator*=(float rhs)
Vec4b & operator/=(float rhs)