From 3cde410c88374e9bc05f0e6e9d34a665e10922e6 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 7 Feb 2023 15:55:57 +0100 Subject: Use approximate circles for reflections --- src/crystfelimageview.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/crystfelimageview.c b/src/crystfelimageview.c index 03350204..46ed13a5 100644 --- a/src/crystfelimageview.c +++ b/src/crystfelimageview.c @@ -512,6 +512,23 @@ static void render_overlined_indices(cairo_t *dctx, } +static double *circle_points(int n) +{ + double ang; + int i; + double *cp = malloc(2*n*sizeof(double)); + if ( cp == NULL ) return NULL; + + ang = 2.0*M_PI / n; + for ( i=0; ipixel_pitch*(p->cnx + p->fsx*fs + p->ssx*ss); y = p->pixel_pitch*(p->cny + p->fsy*fs + p->ssy*ss); - cairo_arc(cr, x, y, this_bs, 0, 2*M_PI); + cairo_move_to(cr, x+cp[0]*this_bs, y+cp[1]*this_bs); + for ( i=1; i