bgr_to_yuv400

Function bgr_to_yuv400 

Source
pub fn bgr_to_yuv400(
    gray_image: &mut YuvGrayImageMut<'_, u8>,
    rgb: &[u8],
    rgb_stride: u32,
    range: YuvRange,
    matrix: YuvStandardMatrix,
) -> Result<(), YuvError>
Expand description

Convert BGR image data to YUV 400 planar format.

This function performs BGR to YUV conversion and stores the result in YUV400 planar format, with Y (luminance) plane

§Arguments

  • gray_image - Target gray image.
  • bgr - The input BGR image data slice.
  • bgr_stride - The stride (components per row) for the RGB image data.
  • range - The YUV range (limited or full).
  • matrix - The YUV standard matrix (BT.601 or BT.709 or BT.2020 or other).

§Panics

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