aboutsummaryrefslogtreecommitdiff
path: root/src
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
parenta9adb8fc595b232524fad7101d3c17af6347d959 (diff)
Fix orientation of images
Diffstat (limited to 'src')
-rw-r--r--src/hdf5-file.c6
-rw-r--r--src/process_images.c2
2 files changed, 4 insertions, 4 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];
}
}
diff --git a/src/process_images.c b/src/process_images.c
index 90f51528..6695db2b 100644
--- a/src/process_images.c
+++ b/src/process_images.c
@@ -50,7 +50,7 @@ static int sum_of_peaks(struct image *image)
int val;
- val = image->data[y+image->height*(image->width-1-x)];
+ val = image->data[x+image->height*y];
if ( val > 1000 ) integr+=val;