Function framebuffer_drawer::draw_rectangle
source · pub fn draw_rectangle<P: Pixel>(
framebuffer: &mut Framebuffer<P>,
coordinate: Coord,
width: usize,
height: usize,
pixel: P
)
Expand description
Draws a rectangle in a framebuffer. The part exceeding the boundary of the framebuffer will be ignored.
Arguments
framebuffer
: the framebuffer to draw in.coordinate
: the left top coordinate of the rectangle relative to the origin(top-left point) of the framebuffer.width
: the width of the rectangle in number of pixels.height
: the height of the rectangle in number of pixels.color
: the color of the rectangle’s border.