colorutils_rs

Function bgr_to_lab

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

This function converts BGR to CIE L*ab against D65 white point. This is much more effective than naive direct transformation

§Arguments

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