extracted general blending function

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10920 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2005-01-20 23:24:02 +00:00
parent fd78338f60
commit 34651df507

View File

@ -11,6 +11,15 @@
class PatternHandler;
inline void
blend(uint8* d1, uint8* d2, uint8* d3, uint8* da,
uint8 s1, uint8 s2, uint8 s3, uint8 a)
{
*d1 = (uint8)((((s1 - *d1) * a) + (*d1 << 8)) >> 8);
*d2 = (uint8)((((s2 - *d2) * a) + (*d2 << 8)) >> 8);
*d3 = (uint8)((((s3 - *d3) * a) + (*d3 << 8)) >> 8);
}
namespace agg
{
//====================================================DrawingMode