aboutsummaryrefslogtreecommitdiff
path: root/src/render.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-01-26 19:37:17 +0100
committerThomas White <taw@physics.org>2010-01-26 19:37:17 +0100
commit877643855058da348bf5a42692788b0d1717511e (patch)
tree1b9c8c45b2e4c50f59d8684cdae72ee7bdd2bff1 /src/render.c
parentae41da676011401453580029d83407f008ae8745 (diff)
Fix binning
Dividing a number down then multiplying it up again, with integer arithmetic, and expecting the result to be the same as the original is not cool.
Diffstat (limited to 'src/render.c')
-rw-r--r--src/render.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/render.c b/src/render.c
index e3fec53d..ca86f28c 100644
--- a/src/render.c
+++ b/src/render.c
@@ -49,7 +49,7 @@ static void *render_bin(int16_t *in, int inw, int inh,
for ( xb=0; xb<binning; xb++ ) {
for ( yb=0; yb<binning; yb++ ) {
- total += in[binning*x+xb + (binning*y+yb)*(w*binning)];
+ total += in[binning*x+xb + (binning*y+yb)*inw];
}
}