aboutsummaryrefslogtreecommitdiff
path: root/src/displaywindow.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-01-12 14:17:13 +0100
committerThomas White <taw@physics.org>2010-01-12 14:17:13 +0100
commit0b17be9c96c4082b7cf2334c6a2cc35bb6a5814c (patch)
tree6702c7a63f06c988e740736026b18a74760c7803 /src/displaywindow.c
parent419d5533423ca402ffce44e2e2a05d62c5ba1804 (diff)
Complete indexing functionality
Diffstat (limited to 'src/displaywindow.c')
-rw-r--r--src/displaywindow.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/displaywindow.c b/src/displaywindow.c
index 9a65fb16..008aa19f 100644
--- a/src/displaywindow.c
+++ b/src/displaywindow.c
@@ -415,13 +415,21 @@ static void load_features_from_file(struct image *image, const char *filename)
do {
char line[1024];
- int x, y;
- int r;
+ int x, y, r, d;
+ float df;
rval = fgets(line, 1023, fh);
if ( rval == NULL ) continue;
chomp(line);
+ /* Try long format (output of pattern_sim --near-bragg) */
+ r = sscanf(line, "%i %i %i %f (at %i,%i)",
+ &d, &d, &d, &df, &x, &y);
+ if ( r == 6 ) {
+ image_add_feature(image->features, x, y, image, 1.0);
+ continue;
+ }
+
r = sscanf(line, "%i %i", &x, &y);
if ( r != 2 ) continue;