diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/hdf5-file.c | 6 | ||||
-rw-r--r-- | src/process_images.c | 2 |
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; |