C++ (Qt)inline const ARGB operator+(const ARGB &c1, const ARGB &c2){ ARGB res; float x = 0.5f * (1.0 - c1.alpha + c2.alpha); res.alpha = 0.5f * (c1.alpha + c2.alpha); res.r = c1.r * (1.0f - x) + x * c2.r; res.g = c1.g * (1.0f - x) + x * c2.g; res.b = c1.b * (1.0f - x) + x * c2.b; return res;}
C++ (Qt)inline const ARGB operator+(const ARGB &c1, const ARGB &c2){ ARGB res; float x = 0.5f * (1.0 - c1.alpha + c2.alpha); res.alpha = c1.alpha * (1.0f - x) + x * c2.alpha; // <--- вот здесь)) res.r = c1.r * (1.0f - x) + x * c2.r; res.g = c1.g * (1.0f - x) + x * c2.g; res.b = c1.b * (1.0f - x) + x * c2.b; return res;}
new_value = (value1 * k1 + value2 * k2 + value3 * k3 + ...) / (k1 + k2 + k3 + ..);
ARGB Interpolate( const ARGB * src, float * k, int count );
C++ (Qt)inline const ARGB operator+(const ARGB &c1, const ARGB &c2){ ARGB res; float x = 0.5f * (1.0f - c1.alpha + c2.alpha); res.alpha = 0.5f * (c1.alpha + c2.alpha); res.r = c1.r * (1.0f - x) + x * c2.r; res.g = c1.g * (1.0f - x) + x * c2.g; res.b = c1.b * (1.0f - x) + x * c2.b; return res;}