From 07e4bfec11b9dc569727a8223b0c36cea6b05181 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 24 Nov 2009 16:35:26 +0100 Subject: Only bloom if required --- src/detector.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/detector.c b/src/detector.c index ef2be5a8..f4de05ff 100644 --- a/src/detector.c +++ b/src/detector.c @@ -139,6 +139,7 @@ void record_image(struct image *image) int x, y; double ph_per_e; double sa_per_pixel; + const int do_bloom = 0; /* How many photons are scattered per electron? */ ph_per_e = PULSE_ENERGY_DENSITY * pow(THOMSON_LENGTH, 2.0) @@ -173,5 +174,17 @@ void record_image(struct image *image) } } - image->data = bloom(image->hdr, image->width, image->height); + if ( do_bloom ) { + image->data = bloom(image->hdr, image->width, image->height); + } else { + image->data = malloc(image->width * image->height + * sizeof(uint16_t)); + for ( x=0; xwidth; x++ ) { + for ( y=0; yheight; y++ ) { + double val; + val = image->hdr[x + image->width*y]; + image->data[x + image->width*y] = (uint16_t)val; + } + } + } } -- cgit v1.2.3