aboutsummaryrefslogtreecommitdiff
path: root/src/hdf5-file.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-01-06 16:45:37 +0100
committerThomas White <taw@physics.org>2010-01-06 16:45:37 +0100
commit091685f97b125556ab41a921659c8e5bc5af4845 (patch)
tree1ead26a892dc37f7d89c43bc4afb208b4167d438 /src/hdf5-file.c
parenta9adb8fc595b232524fad7101d3c17af6347d959 (diff)
Fix orientation of images
Diffstat (limited to 'src/hdf5-file.c')
-rw-r--r--src/hdf5-file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hdf5-file.c b/src/hdf5-file.c
index 22dd0925..eac70012 100644
--- a/src/hdf5-file.c
+++ b/src/hdf5-file.c
@@ -128,13 +128,13 @@ static void *hdfile_bin(int16_t *in, int inw, int inh,
for ( xb=0; xb<binning; xb++ ) {
for ( yb=0; yb<binning; yb++ ) {
- total += in[inh*(binning*x+xb)+binning*y+yb];
+ total += in[binning*x+xb + (binning*y+yb)*(w*binning)];
}
}
- data[y+h*(w-1-x)] = total / (binning * binning);
- if ( data[y+h*(w-1-x)] > max ) max = data[y+h*(w-1-x)];
+ data[x+w*y] = total / (binning * binning);
+ if ( data[x+w*y] > max ) max = data[x+w*y];
}
}