Function nokhwa::mjpeg_to_rgb888[][src]

pub fn mjpeg_to_rgb888(data: &[u8]) -> Result<Vec<u8>, NokhwaError>
Expand description

Converts a MJPEG stream of u8 into a Vec of RGB888. (R,G,B,R,G,B,…)

Errors

If mozjpeg fails to read scanlines or setup the decompressor, this will error.

Safety

This function uses unsafe. The caller must ensure that:

  • The input data is of the right size, does not exceed bounds, and/or the final size matches with the initial size.