mn_color.hpp
Go to the documentation of this file.
119 : r((T)(pComponent[0]) * colorcon), g((T)(pComponent[1]) * colorcon), b((T)(pComponent[2]) * colorcon), a((T)(pComponent[3]) * colorcon) {}
124 : r(colorcon * (T)(c >> 16)), g(colorcon * (T)(c >> 8)), b(colorcon * (T)(c)), a(colorcon * (T)(c >> 24)) {}
128 self_type& operator += (const self_type& c) {r += c.r; g += c.g; b += c.b; a += c.a; return *this;}
129 self_type& operator -= (const self_type& c) {r -= c.r; g -= c.g; b -= c.b; a -= c.a; return *this;}
130 self_type& operator *= (const self_type& c) {r *= c.r; g *= c.g; b *= c.b; a *= c.a; return *this;}
132 self_type& operator /= (const self_type& c) {r /= c.r; g /= c.g; b /= c.b; a /= c.a; return *this;}
181 if(a.r != b.r) return false; if(a.g != b.g) return false; if(a.b != b.b) return false; return a.a == b.a;}
212 inline basic_color<T> interpolate(const basic_color<T>& c1, const basic_color<T>& c2, const T p) {
221 return basic_color<T>(mn::min<T>(c1.r, c2.r), mn::min<T>(c1.g, c2.g), mn::min<T>(c1.b, c2.b), mn::min<T>(c1.a, c2.a));}
229 return basic_color<T>(mn::max<T>(c1.r, c2.r), mn::max<T>(c1.g, c2.g), mn::max<T>(c1.b, c2.b), mn::max<T>(c1.a, c2.a));}
basic_color(void)
Construct a new basic color object.
Definition: mn_color.hpp:66
basic_color(const int _r, const int _g, const int _b)
Construct a new basic color object.
Definition: mn_color.hpp:101
basic_color(value_type *com)
Construct a new basic color object.
Definition: mn_color.hpp:92
basic_color(value_type _r, value_type _g, value_type _b)
Construct a new basic color object.
Definition: mn_color.hpp:85
self_type & operator+=(const self_type &c)
Definition: mn_color.hpp:128
self_type & operator/=(const self_type &c)
Definition: mn_color.hpp:132
self_type & operator=(const self_type &c)
Definition: mn_color.hpp:127
basic_color(const int c)
Construct a new basic color object.
Definition: mn_color.hpp:123
basic_color(const int _r, const int _g, const int _b, const int _a)
Construct a new basic color object.
Definition: mn_color.hpp:111
self_type & operator*=(const self_type &c)
Definition: mn_color.hpp:130
basic_color(value_type _r, value_type _g, value_type _b, value_type _a)
Construct a new basic color object.
Definition: mn_color.hpp:76
self_type & operator-=(const self_type &c)
Definition: mn_color.hpp:129
basic_color(const int *pComponent)
Construct a new basic color object.
Definition: mn_color.hpp:118
basic_color< T > operator/(const basic_color< T > &a, const basic_color< T > &b)
Definition: mn_color.hpp:171
bool operator!=(const basic_color< T > &a, const basic_color< T > &b)
Definition: mn_color.hpp:184
basic_color< T > interpolate(const basic_color< T > &c1, const basic_color< T > &c2, const T p)
interpolate
Definition: mn_color.hpp:212
basic_color< T > min(const basic_color< T > &c1, const basic_color< T > &c2)
Get the min color.
Definition: mn_color.hpp:220
basic_color< T > operator-(const basic_color< T > &a, const basic_color< T > &b)
Definition: mn_color.hpp:152
basic_color< T > max(const basic_color< T > &c1, const basic_color< T > &c2)
Get the max color.
Definition: mn_color.hpp:228
basic_color< T > operator+(const basic_color< T > &a, const basic_color< T > &b)
Definition: mn_color.hpp:148
basic_color< T > negate(const basic_color< T > &c)
negate
Definition: mn_color.hpp:194
bool operator==(const basic_color< T > &a, const basic_color< T > &b)
Definition: mn_color.hpp:180
basic_color< T > from_cmy(const T c, const T m, const T y)
Create a RGBA color object from a cmy.
Definition: mn_color.hpp:245
basic_color< T > from_hsv(const T h, const T s, const T v)
Create a RGBA color object from a hsv.
Definition: mn_color.hpp:253
basic_color< T > from_yuv(const T y, const T u, const T v)
Create a RGBA color object from a yuv.
Definition: mn_color.hpp:235
basic_color< T > operator*(const basic_color< T > &a, const basic_color< T > &b)
Definition: mn_color.hpp:159
struct mn::memory::detail::ptr_difference T
Definition: mn_atomic_singleton.hpp:38
Definition: mn_allocator_typetraits.hpp:25