pub struct RasterMut<'a> { /* private fields */ }
Expand description
Mutable raster structure.
Implementations§
source§impl<'a> RasterMut<'a>
impl<'a> RasterMut<'a>
sourcepub fn new(w: usize, h: usize, depth: RasterDepth, buf: &'a mut [u8]) -> Self
pub fn new(w: usize, h: usize, depth: RasterDepth, buf: &'a mut [u8]) -> Self
Allocate a new raster for the given destination buffer slice.
§Examples
const IMG_W: usize = 320;
const IMG_H: usize = 200;
let mut buf = [0; 3 * IMG_W * IMG_H];
bayer::RasterMut::new(
IMG_W, IMG_H, bayer::RasterDepth::Depth8,
&mut buf);
sourcepub fn with_offset(
x: usize,
y: usize,
w: usize,
h: usize,
stride: usize,
depth: RasterDepth,
buf: &'a mut [u8]
) -> Self
pub fn with_offset( x: usize, y: usize, w: usize, h: usize, stride: usize, depth: RasterDepth, buf: &'a mut [u8] ) -> Self
Allocate a new raster for the given destination buffer slice. Stride is in number of bytes.
§Examples
const IMG_W: usize = 320;
const IMG_H: usize = 200;
let mut buf = [0; 3 * IMG_W * IMG_H];
bayer::RasterMut::with_offset(
0, 0, IMG_W, IMG_H, 3 * IMG_W, bayer::RasterDepth::Depth8,
&mut buf);
sourcepub fn borrow_row_u8_mut(&mut self, y: usize) -> &mut [u8] ⓘ
pub fn borrow_row_u8_mut(&mut self, y: usize) -> &mut [u8] ⓘ
sourcepub fn borrow_row_u16_mut(&mut self, y: usize) -> &mut [u16]
pub fn borrow_row_u16_mut(&mut self, y: usize) -> &mut [u16]
Auto Trait Implementations§
impl<'a> Freeze for RasterMut<'a>
impl<'a> RefUnwindSafe for RasterMut<'a>
impl<'a> Send for RasterMut<'a>
impl<'a> Sync for RasterMut<'a>
impl<'a> Unpin for RasterMut<'a>
impl<'a> !UnwindSafe for RasterMut<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more