Uses Bresenham's algorithm to draw lines. No antialiasing.
nr_line(nr, x1, y1, x2, y2, color = "black", linewidth = 1)
nativeRaster
Vectors of coordinates of endpoints of line
Color as a character string. Either a standard R color
(e.g. 'blue', 'white')
or a hex color of the form #rrggbbaa
, #rrggbb
, #rgba
or #rgb
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.
Original nativeRaster
modified in-place