38 Vec3ub() { _v[0]=0; _v[1]=0; _v[2]=0; }
40 Vec3ub(value_type
r, value_type
g, value_type
b) { _v[0]=
r; _v[1]=
g; _v[2]=
b; }
48 if (_v[0]<v.
_v[0])
return true;
49 else if (_v[0]>v.
_v[0])
return false;
50 else if (_v[1]<v.
_v[1])
return true;
51 else if (_v[1]>v.
_v[1])
return false;
52 else return (_v[2]<v.
_v[2]);
55 inline value_type*
ptr() {
return _v; }
56 inline const value_type*
ptr()
const {
return _v; }
58 inline void set(value_type
r, value_type
g, value_type
b)
60 _v[0]=
r; _v[1]=
g; _v[2]=
b;
65 _v[0]=rhs.
_v[0]; _v[1]=rhs.
_v[1]; _v[2]=rhs.
_v[2];
68 inline value_type&
operator [] (
unsigned int i) {
return _v[i]; }
69 inline value_type
operator [] (
unsigned int i)
const {
return _v[i]; }
71 inline value_type&
x() {
return _v[0]; }
72 inline value_type&
y() {
return _v[1]; }
73 inline value_type&
z() {
return _v[2]; }
75 inline value_type
x()
const {
return _v[0]; }
76 inline value_type
y()
const {
return _v[1]; }
77 inline value_type
z()
const {
return _v[2]; }
79 inline value_type&
r() {
return _v[0]; }
80 inline value_type&
g() {
return _v[1]; }
81 inline value_type&
b() {
return _v[2]; }
83 inline value_type
r()
const {
return _v[0]; }
84 inline value_type
g()
const {
return _v[1]; }
85 inline value_type
b()
const {
return _v[2]; }
115 float div = 1.0f/rhs;
123 return Vec3ub(_v[0]+rhs.
_v[0], _v[1]+rhs.
_v[1],
141 return Vec3ub(_v[0]-rhs.
_v[0], _v[1]-rhs.
_v[1],
159 return Vec3ub(lhs[0]*rhs[0], lhs[1]*rhs[1], lhs[2]*rhs[2]);
165 return Vec3ub(lhs[0]/rhs[0], lhs[1]/rhs[1], lhs[2]/rhs[2]);
const value_type * ptr() const
Vec3ub operator-(const Vec3ub &rhs) const
Vec3ub(value_type r, value_type g, value_type b)
bool operator!=(const Vec3ub &v) const
Vec3ub operator/(float rhs) const
bool operator<(const Vec3ub &v) const
Vec2d componentDivide(const Vec2d &lhs, const Vec2d &rhs)
Vec3ub & operator+=(const Vec3ub &rhs)
Vec3ub & operator*=(float rhs)
void set(value_type r, value_type g, value_type b)
Vec3ub & operator/=(float rhs)
Vec3ub & operator-=(const Vec3ub &rhs)
void set(const Vec3ub &rhs)
Vec3ub operator+(const Vec3ub &rhs) const
Vec3ub operator*(float rhs) const
bool operator==(const Vec3ub &v) const
value_type & operator[](unsigned int i)
Vec2d componentMultiply(const Vec2d &lhs, const Vec2d &rhs)