Uses Bresenham's algorithm to draw lines. No antialiasing.

nr_line(nr, x0, y0, x1, y1, colour = "black", op = 2L)

Arguments

nr

nativeRaster image

x0, y0, x1, y1

Coordinates of endpoints of line. [vector]

colour

Color as a character string. Either a standard R color or a hex colour of the form #rrggbbaa or #rrggbb

op

Drawing mode. Default: 2. Possible values: 0, 1, 2

0

Draw the integer value as-is into the nativeRaster. This mode is useful when you are using an indexed palette like many old school games (like AnotherWorld) and do not want the value interpreted as a colour and alpha blended when drawing etc

1

This operation performs a bitwise logical-or with the current value. This is needed for rendering in the AnotherWorld game engine.

2 (default)

Regular colour handing for standard pixel handling