Ephoto: Emboss filter play better with colors and remove unused vars.

This commit is contained in:
Stephen okra Houston 2016-06-22 16:46:18 -05:00
parent 293a821031
commit 84994e6a73
1 changed files with 5 additions and 9 deletions

View File

@ -1051,9 +1051,9 @@ _emboss(void *data)
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h;
int i, j, passes = 0; int i, j, passes = 0;
unsigned int *p; unsigned int *p;
float emboss[3][3] = {{1, 1, 1}, float emboss[3][3] = {{-2, -1, 0},
{1, -2, 1}, {-1, 1, 1},
{-1, -1, -1}}; {0, 1, 2}};
w = ef->w; w = ef->w;
h = ef->h; h = ef->h;
@ -1061,9 +1061,8 @@ _emboss(void *data)
{ {
p = ef->im_data_new + (y * w); p = ef->im_data_new + (y * w);
for (x = 0; x < w; x++) for (x = 0; x < w; x++)
{ {
int a, r, g , b; int a = 0, rr = 0, gg = 0, bb = 0;
int aa = 0, rr = 0, gg = 0, bb = 0;
if (y > 0 && x > 0 && y < (h - 2) && x < (w - 2)) if (y > 0 && x > 0 && y < (h - 2) && x < (w - 2))
{ {
for (i = -1; i <= 1; i++) for (i = -1; i <= 1; i++)
@ -1082,9 +1081,6 @@ _emboss(void *data)
} }
} }
} }
bb += 127;
gg += 127;
rr += 127;
bb = _normalize_color(bb); bb = _normalize_color(bb);
gg = _normalize_color(gg); gg = _normalize_color(gg);
rr = _normalize_color(rr); rr = _normalize_color(rr);