yuv420_to_bgra

Function yuv420_to_bgra 

Source
pub fn yuv420_to_bgra(
    planar_image: &YuvPlanarImage<'_, u8>,
    bgra: &mut [u8],
    bgra_stride: u32,
    range: YuvRange,
    matrix: YuvStandardMatrix,
) -> Result<(), YuvError>
Expand description

Convert YUV 420 planar format to BGRA format.

This function takes YUV 420 planar format data with 8-bit precision, and converts it to BGRA format with 8-bit per channel precision.

§Arguments

  • planar_image - Source planar image.
  • bgra - A mutable slice to store the converted BGRA data.
  • bgra_stride - Elements per BGRA row.
  • 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 BGRA data are not valid based on the specified width, height, and strides, or if invalid YUV range or matrix is provided.