diff options
author | Thomas White <taw@physics.org> | 2011-02-25 17:23:15 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:15 +0100 |
commit | 0874634448299691ab5891dee45f0bf275dff07c (patch) | |
tree | 0f118f70a563ae6984f0d9646ed3f8182c3414b2 /src/detector.c | |
parent | ff5f60512263afac7059c2748511e4e0244f7940 (diff) |
hdfsee: Work on view using geometry
Diffstat (limited to 'src/detector.c')
-rw-r--r-- | src/detector.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/detector.c b/src/detector.c index 209958b1..633af6df 100644 --- a/src/detector.c +++ b/src/detector.c @@ -491,3 +491,27 @@ void free_detector_geometry(struct detector *det) free(det->panels); free(det); } + + +struct detector *simple_geometry(const struct image *image) +{ + struct detector *geom; + + geom = calloc(1, sizeof(struct detector)); + + geom->n_panels = 1; + geom->panels = calloc(1, sizeof(struct panel)); + + geom->panels[0].min_fs = 0; + geom->panels[0].max_fs = image->width-1; + geom->panels[0].min_ss = 0; + geom->panels[0].max_ss = image->height-1; + geom->panels[0].cx = -image->width / 2.0; + geom->panels[0].cy = -image->height / 2.0; + geom->panels[0].fsx = 1; + geom->panels[0].fsy = 0; + geom->panels[0].ssx = 0; + geom->panels[0].ssy = 1; + + return geom; +} |