rgb_to_gbr

Function rgb_to_gbr 

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

Convert RGB8 to GBR

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

§Arguments

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

§Panics

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