diff options
author | Thomas White <taw@physics.org> | 2009-11-24 16:35:26 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2009-11-24 16:35:26 +0100 |
commit | 07e4bfec11b9dc569727a8223b0c36cea6b05181 (patch) | |
tree | 1bb180c6ce494604317bb7c81bba05423e1af0b8 /src | |
parent | 182125d8087cd8d2de73d8156af0fc8c602363a9 (diff) |
Only bloom if required
Diffstat (limited to 'src')
-rw-r--r-- | src/detector.c | 15 |
1 files changed, 14 insertions, 1 deletions
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; x<image->width; x++ ) { + for ( y=0; y<image->height; y++ ) { + double val; + val = image->hdr[x + image->width*y]; + image->data[x + image->width*y] = (uint16_t)val; + } + } + } } |