34 Vec2us(value_type
x, value_type
y) { _v[0] =
x; _v[1] =
y; }
40 if (_v[0]<v.
_v[0])
return true;
41 else if (_v[0]>v.
_v[0])
return false;
42 else return (_v[1]<v.
_v[1]);
45 inline value_type*
ptr() {
return _v; }
46 inline const value_type*
ptr()
const {
return _v; }
48 inline void set( value_type
x, value_type
y)
55 _v[0]=rhs.
_v[0]; _v[1]=rhs.
_v[1];
61 inline value_type&
x() {
return _v[0]; }
62 inline value_type&
y() {
return _v[1]; }
64 inline value_type
x()
const {
return _v[0]; }
65 inline value_type
y()
const {
return _v[1]; }
67 inline value_type&
r() {
return _v[0]; }
68 inline value_type&
g() {
return _v[1]; }
70 inline value_type
r()
const {
return _v[0]; }
71 inline value_type
g()
const {
return _v[1]; }
75 return Vec2us(_v[0]*rhs, _v[1]*rhs);
87 return Vec2us(_v[0]/rhs, _v[1]/rhs);
99 return Vec2us(_v[0]+rhs.
_v[0], _v[1]+rhs.
_v[1]);
111 return Vec2us(_v[0]-rhs.
_v[0], _v[1]-rhs.
_v[1]);
126 return Vec2us(lhs[0]*rhs[0], lhs[1]*rhs[1]);
132 return Vec2us(lhs[0]/rhs[0], lhs[1]/rhs[1]);
bool operator!=(const Vec2us &v) const
Vec2us & operator+=(const Vec2us &rhs)
unsigned short value_type
Vec2us operator*(value_type rhs) const
Vec2us & operator-=(const Vec2us &rhs)
Vec2us operator/(value_type rhs) const
Vec2d componentDivide(const Vec2d &lhs, const Vec2d &rhs)
void set(const Vec2us &rhs)
Vec2us operator+(const Vec2us &rhs) const
void set(value_type x, value_type y)
value_type & operator[](int i)
const value_type * ptr() const
Vec2us & operator/=(value_type rhs)
Vec2us operator-(const Vec2us &rhs) const
Vec2us(value_type x, value_type y)
bool operator==(const Vec2us &v) const
Vec2d componentMultiply(const Vec2d &lhs, const Vec2d &rhs)
bool operator<(const Vec2us &v) const
Vec2us & operator*=(value_type rhs)