Multiple blit operations in a single call
nr_blit_bulk(dst, src, config)destination native raster
list of native raster images.
data.frame of configuration information for each blit.
Columns in this data.frame match the arguments to nr_blit().
Requires columns:
idxThe index of the image in the src list i.e. src[[idx]]
x,ylocation in dst to place src[[idx]]
Optional columns which take a default value if not present:
xsrc,ysrcstart coordinates within src. Default: (0, 0)
w,hsize within src. Default: use whole width/height
hjust,vjustDefault: (0.5, 0.5)
angleDefault: 0
scaleZoom factor. Default: 1
use_alphaDefault: true
renderShould this given operation be rendered? Default: true
Invisibly return the supplied dst native raster image which was been
modified in-place
Other blitting functions:
nr_blit()
nr <- nr_new(90, 90, 'grey60')
config <- data.frame(
idx = c(1, 2, 3, 4),
x = c(10, 10, 40, 40) + 15,
y = c(10, 40, 40, 10) + 15,
xsrc = 0L,
ysrc = 0L,
w = -1L,
h = -1L,
hjust = 0.5,
vjust = 0.5,
angle = c(0, 0, 0, pi/4),
scale = c(0.5, 1, 1, 1),
use_alpha = TRUE,
render = TRUE
)
nr_blit_bulk(dst = nr, src = deer, config = config)
plot(nr)