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

Method set_pixel

src/opencv/mod.rs:608–617  ·  view source on GitHub ↗

TODO test + bounce checking, duplicated code

(&mut self, x: usize, y: usize, newval: u8)

Source from the content-addressed store, hash-verified

606
607 // TODO test + bounce checking, duplicated code
608 pub fn set_pixel(&mut self, x: usize, y: usize, newval: u8) {
609
610 unsafe {
611 let img = &(*self.buffer());
612 let off = (y * self.widthstep() + x) as isize;
613
614 let p = img.imagedata.offset(off) as *mut u8;
615 *p = newval;
616 }
617 }
618
619
620 // TODO test

Callers 2

from_sliceMethod · 0.80
set_pixel_maskMethod · 0.80

Calls 2

bufferMethod · 0.80
widthstepMethod · 0.80

Tested by

no test coverage detected