{
DEFINE_DIAMETER(radius);
int acc[4] = {0};
- DATA8 *d, *rs, *ls;
+ DATA8 *d, *sr, *sl;
int x, k;
int divider;
int left = MIN(radius, len);
int right = MIN(radius, (len - radius));
d = (DATA8 *) dst;
- ls = (DATA8 *) src;
- rs = (DATA8 *) src;
+ sl = (DATA8 *) src;
+ sr = (DATA8 *) src;
// Read-ahead
for (x = left; x; x--)
{
for (k = 0; k < 4; k++)
- acc[k] += rs[k];
- rs += step;
+ acc[k] += sr[k];
+ sr += step;
}
// Left
for (x = 0; x < left; x++)
{
for (k = 0; k < 4; k++)
- acc[k] += rs[k];
- rs += step;
+ acc[k] += sr[k];
+ sr += step;
divider = x + left + 1;
d[ALPHA] = acc[ALPHA] / divider;
for (x = len - (2 * radius); x > 0; x--)
{
for (k = 0; k < 4; k++)
- acc[k] += rs[k];
- rs += step;
+ acc[k] += sr[k];
+ sr += step;
d[ALPHA] = DIVIDE_BY_DIAMETER(acc[ALPHA]);
d[RED] = DIVIDE_BY_DIAMETER(acc[RED]);
d += step;
for (k = 0; k < 4; k++)
- acc[k] -= ls[k];
- ls += step;
+ acc[k] -= sl[k];
+ sl += step;
}
// Right part
d += step;
for (k = 0; k < 4; k++)
- acc[k] -= ls[k];
- ls += step;
+ acc[k] -= sl[k];
+ sl += step;
}
}
evas_filter_blur_cpu_func_get(Evas_Filter_Command *cmd)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(cmd, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->input, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->output, NULL);
EINA_SAFETY_ON_FALSE_RETURN_VAL(cmd->mode == EVAS_FILTER_MODE_BLUR, NULL);
switch (cmd->blur.type)
CRI("Unsupported operation: mixing RGBA and Alpha surfaces.");
return NULL;
default:
- CRI("Not implemented yet!");
+ CRI("Unsupported blur type %d", cmd->blur.type);
return NULL;
}
}