38 Vec3b() { _v[0]=0; _v[1]=0; _v[2]=0; }
40 Vec3b(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 Vec3b(_v[0]+rhs.
_v[0], _v[1]+rhs.
_v[1],
141 return Vec3b(_v[0]-rhs.
_v[0], _v[1]-rhs.
_v[1],
Vec3b operator-(const Vec3b &rhs) const
bool operator<(const Vec3b &v) const
Vec3b & operator+=(const Vec3b &rhs)
value_type & operator[](unsigned int i)
Vec3b(value_type r, value_type g, value_type b)
Vec3b operator/(float rhs) const
bool operator==(const Vec3b &v) const
void set(value_type r, value_type g, value_type b)
Vec3b operator+(const Vec3b &rhs) const
Vec3b & operator-=(const Vec3b &rhs)
void set(const Vec3b &rhs)
bool operator!=(const Vec3b &v) const
Vec3b & operator/=(float rhs)
Vec3b operator*(float rhs) const
const value_type * ptr() const
Vec3b & operator*=(float rhs)