Draw rectangles on a native raster image
nr_rect(
nr,
x,
y,
w,
h,
fill = "black",
color = NA,
hjust = 0,
vjust = 0,
linewidth = 1,
use_alpha = TRUE
)native raster image
coordinates of lower left corner of rectangle. [vector]
width and height of rectangle. [vector]
interior fill color [vector]
outline color. Default: NA. [vector]
specify horizontal and vertical justification of the
handle on the src image to be placed at (x, y) within
the dst image.
Default (0, 0) is to use the top-left corner of the image as the
handle.
Use (0.5, 0.5) to centre the src image at the dst
location (x, y)
Line linewidth. Default: 1. If linewidth = 1 then a
naive version of Bresenham is used to draw the points. If linewidth
is greater than 1, then the line is convert to a triangle strip and
rendered as polygons.
Use alpha channel when drawing? Logical. Default: TRUE
Invisibly return the supplied native raster image which was been modified in-place
Other drawing functions:
nr_circle(),
nr_polygon(),
nr_polyline(),
nr_tri_mesh()