colorutils_rs

Function xyz_to_bgr

Source
pub fn xyz_to_bgr(
    src: &[f32],
    src_stride: u32,
    dst: &mut [u8],
    dst_stride: u32,
    width: u32,
    height: u32,
    matrix: &[[f32; 3]; 3],
    transfer_function: TransferFunction,
)
Expand description

This function converts XYZ to BGR. This is much more effective than naive direct transformation

§Arguments

  • src - A slice contains XYZ data
  • src_stride - Bytes per row for src data.
  • width - Image width
  • height - Image height
  • dst - A mutable slice to receive BGR data
  • dst_stride - Bytes per row for dst data
  • matrix - Transformation matrix from BGR to XYZ. If you don’t have specific just pick XYZ_TO_SRGB_D65
  • transfer_function - Transfer function. If you don’t have specific pick Srgb