rgb12_to_i012

Function rgb12_to_i012 

Source
pub fn rgb12_to_i012(
    planar_image: &mut YuvPlanarImageMut<'_, u16>,
    rgba: &[u16],
    rgba_stride: u32,
    range: YuvRange,
    matrix: YuvStandardMatrix,
) -> Result<(), YuvError>
Expand description

Convert RGB12 image data to I012 format with 12 bit depth.

This function performs RGB1212 to I012 conversion and stores the result in I012 format, with separate planes for Y (luminance), U (chrominance), and V (chrominance) components.

§Arguments

  • planar_image - Target planar image.
  • rgb12 - The input RGB12 image data slice.
  • rgb12_stride - The stride (components per row) for the RGB12 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 RGBA data are not valid based on the specified width, height, and strides, or if invalid YUV range or matrix is provided.