MCPcopy Create free account
hub / github.com/daniel-e/rustml / draw_box

Method draw_box

src/opencv/mod.rs:500–514  ·  view source on GitHub ↗

TODO move this into trait

(&mut self, x: usize, y: usize, w: usize, h: usize, color: &Rgb)

Source from the content-addressed store, hash-verified

498
499 // TODO move this into trait
500 pub fn draw_box(&mut self, x: usize, y: usize, w: usize, h: usize, color: &Rgb) {
501
502 let p1 = CvPoint { x: x as c_int, y: y as c_int };
503 let p2 = CvPoint { x: (x + w - 1) as c_int, y: (y + h - 1) as c_int };
504 let c = CvScalar {
505 val: [color.b as c_double, color.g as c_double, color.r as c_double, 0 as c_double]
506 };
507 unsafe {
508 cvRectangle(
509 self.buffer() as *mut CvArr,
510 p1, p2, c,
511 1 as c_int, 8 as c_int, 0 as c_int
512 );
513 }
514 }
515
516 pub fn dup(&self) -> RgbImage {
517

Callers

nothing calls this directly

Calls 1

bufferMethod · 0.80

Tested by

no test coverage detected