Struct bayer::RasterMut [] [src]

pub struct RasterMut<'a> { /* fields omitted */ }

Mutable raster structure.

Methods

impl<'a> RasterMut<'a>
[src]

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);

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);

Borrow a mutable u8 row slice.

Panics

Panics if the raster is not 8-bpp.

Borrow a mutable u16 row slice.

Panics

Panics if the raster is not 16-bpp.