cairo_arc_vec: Draw lots of arcs (circles)

Description Usage Arguments Details See Also Examples

View source: R/cairo--bespoke.R

Description

This is a custom function to draw lots of circles within C with a single call from R. Use this function when you want to draw lots of circles and need to speed up the creation of the final image.

Usage

1
cairo_arc_vec(cr, xc, yc, radius, angle1, angle2, r, g, b, a, sr, sg, sb, sa)

Arguments

cr

cairo_t *

xc

double

yc

double

radius

double

angle1

double

angle2

double

r, g, b, a

fill colour values in range [0,1]. Set a = 0 to disable filling

sr, sg, sb, sa

stroke colour values in range [0,1]. Set sa = 0 to disable drawing the stroke

Details

Besides the cr context, all arguments should either be the same length as the initial argument (xc) or have a length of 1.

Vectors which have a length of 1 will be considered to have a constant value for all objects

See Also

Other bespoke: cairo_image_surface_create_from_array(), cairo_image_surface_get_array(), cairo_image_surface_get_raster(), cairo_image_surface_get_raw(), cairo_image_surface_write_array(), cairo_polygon_vec(), cairo_polygon(), cairo_rectangle_vec(), cairo_segment_vec()

Other vectorised: cairo_polygon_vec(), cairo_rectangle_vec(), cairo_segment_vec()

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# Draw 10 circles of the same radius, with red fill and no outline
N <- 10
xc <- runif(N)
yc <- runif(N)
radius <- 3
cairo_arc_vec(cr, xc, yc, radius, 0, 2*pi,   1, 0, 0, 1,   0, 0, 0, 0)

## End(Not run)

coolbutuseless/cairocore documentation built on Aug. 31, 2020, 12:43 a.m.