forked from enlightenment/efl
Evas filters: Fix padding in blur filter
The wrong value was used for the command's padding. Also, remove mention of "motion" blur which is not implemented.
This commit is contained in:
parent
126cbbc7a9
commit
ddf267e506
|
@ -1017,14 +1017,13 @@ _blur_padding_update(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr,
|
||||||
{
|
{
|
||||||
Eina_Bool yset;
|
Eina_Bool yset;
|
||||||
int rx, ry, ox, oy, l, r, t, b;
|
int rx, ry, ox, oy, l, r, t, b;
|
||||||
const char *typestr, *inbuf, *outbuf;
|
const char *inbuf, *outbuf;
|
||||||
Buffer *in, *out;
|
Buffer *in, *out;
|
||||||
|
|
||||||
rx = _instruction_param_geti(instr, "rx", NULL);
|
rx = _instruction_param_geti(instr, "rx", NULL);
|
||||||
ry = _instruction_param_geti(instr, "ry", &yset);
|
ry = _instruction_param_geti(instr, "ry", &yset);
|
||||||
ox = _instruction_param_geti(instr, "ox", NULL);
|
ox = _instruction_param_geti(instr, "ox", NULL);
|
||||||
oy = _instruction_param_geti(instr, "oy", NULL);
|
oy = _instruction_param_geti(instr, "oy", NULL);
|
||||||
typestr = _instruction_param_gets(instr, "type", NULL);
|
|
||||||
inbuf = _instruction_param_gets(instr, "src", NULL);
|
inbuf = _instruction_param_gets(instr, "src", NULL);
|
||||||
outbuf = _instruction_param_gets(instr, "dst", NULL);
|
outbuf = _instruction_param_gets(instr, "dst", NULL);
|
||||||
|
|
||||||
|
@ -1033,37 +1032,24 @@ _blur_padding_update(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr,
|
||||||
EINA_SAFETY_ON_NULL_RETURN(in);
|
EINA_SAFETY_ON_NULL_RETURN(in);
|
||||||
EINA_SAFETY_ON_NULL_RETURN(out);
|
EINA_SAFETY_ON_NULL_RETURN(out);
|
||||||
|
|
||||||
if (typestr && !strcasecmp(typestr, "motion"))
|
if (!yset) ry = rx;
|
||||||
{
|
if (rx < 0) rx = 0;
|
||||||
CRI("Motion blur not implemented yet!");
|
if (ry < 0) ry = 0;
|
||||||
/*
|
|
||||||
instr->pad.l = (rx < 0) ? (-rx) : 0;
|
|
||||||
instr->pad.r = (rx > 0) ? (rx) : 0;
|
|
||||||
instr->pad.t = (ry < 0) ? (-ry) : 0;
|
|
||||||
instr->pad.b = (ry > 0) ? (ry) : 0;
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!yset) ry = rx;
|
|
||||||
if (rx < 0) rx = 0;
|
|
||||||
if (ry < 0) ry = 0;
|
|
||||||
|
|
||||||
l = rx + in->pad.l - ox;
|
l = rx + in->pad.l - ox;
|
||||||
r = rx + in->pad.r + ox;
|
r = rx + in->pad.r + ox;
|
||||||
t = ry + in->pad.t - oy;
|
t = ry + in->pad.t - oy;
|
||||||
b = ry + in->pad.b + oy;
|
b = ry + in->pad.b + oy;
|
||||||
|
|
||||||
if (out->pad.l < l) out->pad.l = l;
|
if (out->pad.l < l) out->pad.l = l;
|
||||||
if (out->pad.r < r) out->pad.r = r;
|
if (out->pad.r < r) out->pad.r = r;
|
||||||
if (out->pad.t < t) out->pad.t = t;
|
if (out->pad.t < t) out->pad.t = t;
|
||||||
if (out->pad.b < b) out->pad.b = b;
|
if (out->pad.b < b) out->pad.b = b;
|
||||||
|
|
||||||
if (padl) *padl = rx - ox;
|
if (padl) *padl = l;
|
||||||
if (padr) *padr = rx + ox;
|
if (padr) *padr = r;
|
||||||
if (padt) *padt = ry - oy;
|
if (padt) *padt = t;
|
||||||
if (padb) *padb = ry + oy;
|
if (padb) *padb = b;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue