commit x64 compilation from lulu cause the other branch dont seems to compile properly at home
This commit is contained in:
25
include/framework/picture/pict_draw.cpp
Normal file
25
include/framework/picture/pict_draw.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
/* -----------------------------------------------------------------------------
|
||||
GSFramework
|
||||
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
|
||||
----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
#include "picture/pict.h"
|
||||
|
||||
using namespace GS;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
uchar Picture::AlphaCompositeAlpha(uchar a, uchar b)
|
||||
{ return (uchar)Types::Clamp <int> (a + b - ((a * b) >> 8), 0, 255); }
|
||||
uchar Picture::AlphaCompositeColor(uchar u, uchar v, uchar a, uchar b, uchar k)
|
||||
{ return (uchar)Types::Clamp <int> (k ? (u * a + v * b - ((u * b * a) >> 8)) / k : 0, 0, 255); }
|
||||
void Picture::AlphaCompositePixel(uchar *data, uchar r, uchar g, uchar b, uchar a)
|
||||
{
|
||||
uchar a_blend = AlphaCompositeAlpha(data[3], a);
|
||||
data[0] = AlphaCompositeColor(data[0], r, data[3], a, a_blend);
|
||||
data[1] = AlphaCompositeColor(data[1], g, data[3], a, a_blend);
|
||||
data[2] = AlphaCompositeColor(data[2], b, data[3], a, a_blend);
|
||||
data[3] = a_blend;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user