Realm

oa::image::draw_line

Draw a straight segment over a copy of the input, following line: each pixel whose center lies within thickness / 2 of the (x1, y1)-(x2, y2) segment takes color; all other pixels copy the input. Coordinates are continuous pixel units and color applies to every plane. No anti-aliasing is applied. Errors Returns an error unless the image is a nonempty FP32 NCHW/CHW image, all coordinates and color are finite, and thickness is positive and finite.

FnRust public API

Function Documentation

pub fn draw_line( input: &Image, x1: f32, y1: f32, x2: f32, y2: f32, color: f32, thickness: f32 ) -> Result<Image>
Draw a straight segment over a copy of the input, following line: each pixel whose center lies within thickness / 2 of the (x1, y1)-(x2, y2) segment takes color; all other pixels copy the input. Coordinates are continuous pixel units and color applies to every plane. No anti-aliasing is applied. Errors Returns an error unless the image is a nonempty FP32 NCHW/CHW image, all coordinates and color are finite, and thickness is positive and finite.