Realm

oa::image::draw_rectangle

Draw a rectangle border or fill over a copy of the input, following rectangle: (x, y) gives the top-left corner in pixel units and width/height the extent. A positive thickness draws a border band that many pixels wide measured inward from the rectangle edge; a nonpositive thickness fills the rectangle. color applies to every plane. Errors Returns an error unless the image is a nonempty FP32 NCHW/CHW image, all coordinates and color are finite, width and height are positive, and thickness is finite and nonzero.

FnRust public API

Function Documentation

pub fn draw_rectangle( input: &Image, x: f32, y: f32, width: f32, height: f32, color: f32, thickness: f32 ) -> Result<Image>
Draw a rectangle border or fill over a copy of the input, following rectangle: (x, y) gives the top-left corner in pixel units and width/height the extent. A positive thickness draws a border band that many pixels wide measured inward from the rectangle edge; a nonpositive thickness fills the rectangle. color applies to every plane. Errors Returns an error unless the image is a nonempty FP32 NCHW/CHW image, all coordinates and color are finite, width and height are positive, and thickness is finite and nonzero.