diff options
-rw-r--r-- | src/hdf5-file.c | 6 | ||||
-rw-r--r-- | src/render.c | 32 |
2 files changed, 19 insertions, 19 deletions
diff --git a/src/hdf5-file.c b/src/hdf5-file.c index 379bd14e..94845025 100644 --- a/src/hdf5-file.c +++ b/src/hdf5-file.c @@ -127,13 +127,13 @@ static void *hdfile_bin(uint16_t *in, int inw, int inh, for ( xb=0; xb<binning; xb++ ) { for ( yb=0; yb<binning; yb++ ) { - total += in[inh*(binning*x+xb)+((inh-binning*y)+yb)]; + total += in[inh*(binning*x+xb)+binning*y+yb]; } } - data[x+w*y] = total / (binning * binning); - if ( data[x+w*y] > max ) max = data[x+w*y]; + data[y+h*(w-1-x)] = total / (binning * binning); + if ( data[y+h*(w-1-x)] > max ) max = data[y+h*(w-1-x)]; } } diff --git a/src/render.c b/src/render.c index 96e0b906..26deae91 100644 --- a/src/render.c +++ b/src/render.c @@ -114,26 +114,26 @@ GdkPixbuf *render_get_image(struct hdfile *hdfile, int binning, int boostint, /* These x,y coordinates are measured relative to the bottom-left * corner */ for ( y=0; y<h; y++ ) { - for ( x=0; x<w; x++ ) { + for ( x=0; x<w; x++ ) { - int val; - guchar r, g, b; + int val; + guchar r, g, b; - val = hdr[x+w*y]; - if ( !monochrome ) { - RENDER_RGB - } else { - RENDER_MONO - } + val = hdr[x+w*y]; + if ( !monochrome ) { + RENDER_RGB + } else { + RENDER_MONO + } - /* Stuff inside square brackets makes this pixel go to - * the expected location in the pixbuf (which measures - * from the top-left corner */ - data[3*( x+w*(h-1-y) )+0] = r; - data[3*( x+w*(h-1-y) )+1] = g; - data[3*( x+w*(h-1-y) )+2] = b; + /* Stuff inside square brackets makes this pixel go to + * the expected location in the pixbuf (which measures + * from the top-left corner */ + data[3*( x+w*(h-1-y) )+0] = r; + data[3*( x+w*(h-1-y) )+1] = g; + data[3*( x+w*(h-1-y) )+2] = b; - } + } } /* Finished with this */ |