i212_to_bgr

Function i212_to_bgr 

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

Convert YUV 420 12-bit planar format with 12 bit pixel format to BGR 8-bit format.

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

§Arguments

  • planar_image - Source YUV 420 12-bit planar image.
  • bgr - A mutable slice to store the converted BGR 8 bit-depth format.
  • bgr_stride - The stride (components per row) for BGR 8 bit-depth format.
  • 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 BGR data are not valid based on the specified width, height, and strides, or if invalid YUV range or matrix is provided.