2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_common.h"
|
|
|
|
|
|
|
|
#ifdef BUILD_MMX
|
|
|
|
#include "evas_mmx.h"
|
|
|
|
#endif
|
|
|
|
|
2004-05-09 23:40:51 -07:00
|
|
|
DATA8 *_evas_pow_lut = NULL;
|
2003-05-11 19:26:27 -07:00
|
|
|
const DATA16 _evas_const_c1[4] = {1, 1, 1, 1};
|
2002-11-08 00:02:15 -08:00
|
|
|
|
|
|
|
void
|
2002-11-13 21:38:10 -08:00
|
|
|
evas_common_blend_init(void)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
static int initialised = 0;
|
|
|
|
static int mmx = 0;
|
|
|
|
static int sse = 0;
|
|
|
|
static int sse2 = 0;
|
|
|
|
|
|
|
|
if (initialised) return;
|
|
|
|
initialised = 1;
|
|
|
|
|
2002-11-13 21:38:10 -08:00
|
|
|
evas_common_cpu_can_do(&mmx, &sse, &sse2);
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2004-05-09 23:40:51 -07:00
|
|
|
/* evas_common_blend_init_evas_pow_lut(); */
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2004-05-09 23:40:51 -07:00
|
|
|
evas_common_blend_init_evas_pow_lut(void)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
int i, j;
|
2004-05-09 23:40:51 -07:00
|
|
|
|
|
|
|
_evas_pow_lut = malloc(256 * 256);
|
|
|
|
if (!_evas_pow_lut) return;
|
2002-11-08 00:02:15 -08:00
|
|
|
for (i = 0; i < 256; i++)
|
|
|
|
{
|
|
|
|
for (j = 0; j < 256; j++)
|
|
|
|
{
|
|
|
|
int divisor;
|
|
|
|
|
|
|
|
divisor = (i + (j * (255 - i)) / 255);
|
2004-05-09 23:40:51 -07:00
|
|
|
if (divisor > 0) _evas_pow_lut[(i << 8) | j] = (i * 255) / divisor;
|
|
|
|
else _evas_pow_lut[(i << 8) | j] = 0;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|