From 86dd71e8640394f4e4f5aa71b2e5f51f5fea4a11 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 26 Feb 2010 10:58:13 +0100 Subject: Handle images as floats rather than int16_t Also, remove bloom - it's not a useful model for what really happens and takes too long (this isn't a detector simulation..) --- src/render.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/render.c') diff --git a/src/render.c b/src/render.c index 9bdb9a75..b02469f6 100644 --- a/src/render.c +++ b/src/render.c @@ -24,25 +24,23 @@ #include "filters.h" -static void *render_bin(int16_t *in, int inw, int inh, - int binning, int16_t *maxp) +static void *render_bin(float *in, int inw, int inh, int binning, float *maxp) { - int16_t *data; + float *data; int x, y; int w, h; - int16_t max; + float max; w = inw / binning; h = inh / binning; /* Some pixels might get discarded */ - data = malloc(w*h*sizeof(int16_t)); - max = 0; + data = malloc(w*h*sizeof(float)); + max = 0.0; for ( x=0; ximage == NULL) || (dw->image_dirty) ) { @@ -85,6 +83,7 @@ int16_t *render_get_image_binned(DisplayWindow *dw, int binning, int16_t *max) if ( dw->image != NULL ) { image->features = dw->image->features; if ( dw->image->data != NULL ) free(dw->image->data); + free(dw->image); } dw->image = image; @@ -209,9 +208,9 @@ GdkPixbuf *render_get_image(DisplayWindow *dw) { int mw, mh, w, h; guchar *data; - int16_t *hdr; + float *hdr; size_t x, y; - int16_t max; + float max; mw = hdfile_get_width(dw->hdfile); mh = hdfile_get_height(dw->hdfile); -- cgit v1.2.3