bgr_to_gbr

Function bgr_to_gbr 

Source
pub fn bgr_to_gbr(
    image: &mut YuvPlanarImageMut<'_, u8>,
    bgr: &[u8],
    bgr_stride: u32,
    range: YuvRange,
) -> Result<(), YuvError>
Expand description

Convert BGR8 to GBR

This function takes BGR image format data with 8-bit precision, and converts it to GBR YUV format.

§Arguments

  • image - Target GBR image.
  • rgb - A slice to load BGR8 data.
  • rgb_stride - The stride (components per row) for the BGR8 plane.
  • range - Yuv values range.

§Panics

This function panics if the lengths of the planes or the input BGR8 data are not valid based on the specified width, height, and strides is provided.