Struct bayer::RasterMut
[−]
[src]
pub struct RasterMut<'a> { /* fields omitted */ }
Mutable raster structure.
Methods
impl<'a> RasterMut<'a>
[src]
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);
fn with_offset(
x: usize,
y: usize,
w: usize,
h: usize,
stride: usize,
depth: RasterDepth,
buf: &'a mut [u8]
) -> Self
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);