39 Vec4us() { _v[0]=0; _v[1]=0; _v[2]=0; _v[3]=0; }
41 Vec4us(value_type
x, value_type
y, value_type
z, value_type
w)
53 if (_v[0]<v.
_v[0])
return true;
54 else if (_v[0]>v.
_v[0])
return false;
55 else if (_v[1]<v.
_v[1])
return true;
56 else if (_v[1]>v.
_v[1])
return false;
57 else if (_v[2]<v.
_v[2])
return true;
58 else if (_v[2]>v.
_v[2])
return false;
59 else return (_v[3]<v.
_v[3]);
62 inline value_type*
ptr() {
return _v; }
63 inline const value_type*
ptr()
const {
return _v; }
65 inline void set( value_type
x, value_type
y, value_type
z, value_type
w)
67 _v[0]=
x; _v[1]=
y; _v[2]=
z; _v[3]=
w;
70 inline value_type&
operator [] (
unsigned int i) {
return _v[i]; }
71 inline value_type
operator [] (
unsigned int i)
const {
return _v[i]; }
73 inline value_type&
x() {
return _v[0]; }
74 inline value_type&
y() {
return _v[1]; }
75 inline value_type&
z() {
return _v[2]; }
76 inline value_type&
w() {
return _v[3]; }
78 inline value_type
x()
const {
return _v[0]; }
79 inline value_type
y()
const {
return _v[1]; }
80 inline value_type
z()
const {
return _v[2]; }
81 inline value_type
w()
const {
return _v[3]; }
83 inline value_type&
r() {
return _v[0]; }
84 inline value_type&
g() {
return _v[1]; }
85 inline value_type&
b() {
return _v[2]; }
86 inline value_type&
a() {
return _v[3]; }
88 inline value_type
r()
const {
return _v[0]; }
89 inline value_type
g()
const {
return _v[1]; }
90 inline value_type
b()
const {
return _v[2]; }
91 inline value_type
a()
const {
return _v[3]; }
96 return Vec4us(_v[0]*rhs, _v[1]*rhs, _v[2]*rhs, _v[3]*rhs);
112 return Vec4us(_v[0]/rhs, _v[1]/rhs, _v[2]/rhs, _v[3]/rhs);
129 return Vec4us(_v[0]*rhs.
_v[0], _v[1]*rhs.
_v[1],
130 _v[2]*rhs.
_v[2], _v[3]*rhs.
_v[3]);
136 return Vec4us(_v[0]+rhs.
_v[0], _v[1]+rhs.
_v[1],
137 _v[2]+rhs.
_v[2], _v[3]+rhs.
_v[3]);
155 return Vec4us(_v[0]-rhs.
_v[0], _v[1]-rhs.
_v[1],
156 _v[2]-rhs.
_v[2], _v[3]-rhs.
_v[3] );
174 return Vec4us(lhs[0]*rhs[0], lhs[1]*rhs[1], lhs[2]*rhs[2], lhs[3]*rhs[3]);
180 return Vec4us(lhs[0]/rhs[0], lhs[1]/rhs[1], lhs[2]/rhs[2], lhs[3]/rhs[3]);
bool operator!=(const Vec4us &v) const
unsigned short value_type
Vec4us & operator/=(value_type rhs)
bool operator<(const Vec4us &v) const
Vec4us operator/(value_type rhs) const
Vec4us(value_type x, value_type y, value_type z, value_type w)
Vec2d componentDivide(const Vec2d &lhs, const Vec2d &rhs)
bool operator==(const Vec4us &v) const
Vec4us operator*(value_type rhs) const
Vec4us operator+(const Vec4us &rhs) const
void set(value_type x, value_type y, value_type z, value_type w)
Vec4us & operator-=(const Vec4us &rhs)
const value_type * ptr() const
Vec4us & operator*=(value_type rhs)
value_type & operator[](unsigned int i)
Vec4us operator-(const Vec4us &rhs) const
Vec4us & operator+=(const Vec4us &rhs)
Vec2d componentMultiply(const Vec2d &lhs, const Vec2d &rhs)