diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-07-25 09:18:51 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-07-25 09:18:51 +0000 |
| commit | cd492f54e1f4137d9d2395d54dbb208c0cee552c (patch) | |
| tree | cf8ad108a056a4bf99e4debcae45ffca85c11bfd | |
| parent | 1aecc644de9e2cb81e3f2fd6c8abc86f37debad7 (diff) | |
| download | zcatch-cd492f54e1f4137d9d2395d54dbb208c0cee552c.tar.gz zcatch-cd492f54e1f4137d9d2395d54dbb208c0cee552c.zip | |
fixed dilate.c
| -rw-r--r-- | src/tools/dilate.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tools/dilate.c b/src/tools/dilate.c index f53e7656..ab1a196f 100644 --- a/src/tools/dilate.c +++ b/src/tools/dilate.c @@ -19,6 +19,8 @@ static void dilate(int w, int h, pixel *src, pixel *dst) { int x, y, k, m, c; int ix, iy; + const int xo[] = {0, -1, 1, 0}; + const int yo[] = {-1, 0, 0, 1}; m = 0; for(y = 0; y < h; y++) @@ -29,8 +31,6 @@ static void dilate(int w, int h, pixel *src, pixel *dst) if(src[m].a) continue; - const int xo[] = {0, -1, 1, 0}; - const int yo[] = {-1, 0, 0, 1}; for(c = 0; c < 4; c++) { ix = clamp(x + xo[c], 0, w-1); @@ -51,6 +51,7 @@ static void copy_alpha(int w, int h, pixel *src, pixel *dst) { int x, y, m; + m = 0; for(y = 0; y < h; y++) for(x = 0; x < w; x++, m++) dst[m].a = src[m].a; |