p210_to_bgra

Function p210_to_bgra 

Source
pub fn p210_to_bgra(
    bi_planar_image: &YuvBiPlanarImage<'_, u16>,
    rgba: &mut [u8],
    rgba_stride: u32,
    range: YuvRange,
    matrix: YuvStandardMatrix,
    mode: YuvConversionMode,
) -> Result<(), YuvError>
Expand description

Convert P210 format to BGRA format.

This function takes P210 data with 10-bit precision and converts it to BGRA format with 8-bit precision.

§Arguments

  • bi_planar_image - Source 10 image.
  • dst - A mutable slice to store the converted BGRA data.
  • dst_stride - The stride (components per row) for the BGRA image data.
  • range - range of YUV, see YuvRange for more info.
  • matrix - The YUV standard matrix (BT.601 or BT.709 or BT.2020 or other).
  • mode - See YuvConversionMode for more info.

§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.