This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, generate has been updated via 76d600658de2a46ded4ba41e6f16802eef40a794 (commit) from dc66cb62d3bed90a28854b0b566af6f45daf0b94 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/76d600658de2a46ded4ba41e6f16802eef40a...
commit 76d600658de2a46ded4ba41e6f16802eef40a794 Author: Cyril Hrubis metan@ucw.cz Date: Wed Sep 28 14:12:30 2011 +0200
Count the coeficients before we round the coordinate.
- Behaves better at the bitmap borders
diff --git a/config.mk b/config.mk index 962c414..226cc5e 100644 --- a/config.mk +++ b/config.mk @@ -1,4 +1,4 @@ -CFLAGS+=-W -Wall -Wextra -fPIC -ggdb -O2 -std=gnu99 +CFLAGS+=-W -Wall -Wextra -fPIC -O2 -std=gnu99 CFLAGS+=-I$(TOPDIR)/include/ LDLIBS+=-ldl
diff --git a/libs/filters/GP_ScaleDown.c b/libs/filters/GP_ScaleDown.c index 0d49950..f4bcf70 100644 --- a/libs/filters/GP_ScaleDown.c +++ b/libs/filters/GP_ScaleDown.c @@ -97,17 +97,17 @@ GP_Context *GP_Scale(GP_Context *src, GP_Size w, GP_Size h) float x = (1.00 * i / w) * src->w + 0.5; v4f cvx; int xi = x - 1; - - if (xi < 0) - xi = 0; - - if (xi > (int)src->w - 4) - xi = src->w - 4; cvx.f[0] = cubic(x - xi); cvx.f[1] = cubic(x - xi - 1); cvx.f[2] = cubic(x - xi - 2); cvx.f[3] = cubic(x - xi - 3); + + if (xi < 0) + xi = 0; + + if (xi > (int)src->w - 4) + xi = src->w - 4; /* Generate interpolated column */ for (j = 0; j < src->h; j++) { @@ -149,6 +149,11 @@ GP_Context *GP_Scale(GP_Context *src, GP_Size w, GP_Size h) v4f cvy, rv, gv, bv; float r, g, b; int yi = y - 1; + + cvy.f[0] = cubic(y - yi); + cvy.f[1] = cubic(y - yi - 1); + cvy.f[2] = cubic(y - yi - 2); + cvy.f[3] = cubic(y - yi - 3); if (yi < 0) yi = 0; @@ -171,11 +176,6 @@ GP_Context *GP_Scale(GP_Context *src, GP_Size w, GP_Size h) bv.f[2] = col_b[yi + 2]; bv.f[3] = col_b[yi + 3]; - cvy.f[0] = cubic(y - yi); - cvy.f[1] = cubic(y - yi - 1); - cvy.f[2] = cubic(y - yi - 2); - cvy.f[3] = cubic(y - yi - 3); - rv = MUL_V4SF(rv, cvy); gv = MUL_V4SF(gv, cvy); bv = MUL_V4SF(bv, cvy);
-----------------------------------------------------------------------
Summary of changes: config.mk | 2 +- libs/filters/GP_ScaleDown.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.