draw_rect: Draw rectangle on image

View source: R/drawing.R

draw_rectR Documentation

Draw rectangle on image

Description

Add a rectangle to an image. Like other native CImg drawing functions, this is meant to be basic but fast. Use implot for flexible drawing.

Usage

draw_rect(im, x0, y0, x1, y1, color = "white", opacity = 1, filled = TRUE)

Arguments

im

an image

x0

x coordinate of the bottom-left corner

y0

y coordinate of the bottom-left corner

x1

x coordinate of the top-right corner

y1

y coordinate of the top-right corner

color

either a vector, or a string (e.g. "blue")

opacity

0: transparent 1: opaque.

filled

fill rectangle (default TRUE)

Value

an image

Author(s)

Simon Barthelme

See Also

implot,draw_circle

Examples


draw_rect(boats,1,1,50,50,"darkgreen") %>% plot

imager documentation built on May 29, 2024, 1:38 a.m.