diff options
author | Thomas White <taw@physics.org> | 2013-02-05 11:36:44 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2013-02-05 11:36:44 +0100 |
commit | 29cca07716b48f9e433087f5dbb202165b1897e1 (patch) | |
tree | 43c2eb55de6ac540d70308c9c6cbb9c01738b635 /libcrystfel/src/image.c | |
parent | e132f0a215392b13bf289cad55f2fece6e193625 (diff) |
WIP on bringing programs up to date
Diffstat (limited to 'libcrystfel/src/image.c')
-rw-r--r-- | libcrystfel/src/image.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c index 093e20f2..6e4fd40a 100644 --- a/libcrystfel/src/image.c +++ b/libcrystfel/src/image.c @@ -159,3 +159,21 @@ void image_remove_feature(ImageFeatureList *flist, int idx) { flist->features[idx].valid = 0; } + + +void image_add_crystal(struct image *image, Crystal *cryst) +{ + Crystal **crs; + int n; + + n = image->n_crystals; + crs = realloc(image->crystals, (n+1)*sizeof(Crystal *)); + if ( crs == NULL ) { + ERROR("Failed to allocate memory for crystals.\n"); + return; + } + + crs[n] = cryst; + image->crystals = crs; + image->n_crystals = n+1; +} |