colorutils_rs

Function lab_with_alpha_to_bgra

Source
pub fn lab_with_alpha_to_bgra(
    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 LAB with separate alpha channel to BGRA. This is much more effective than naive direct transformation

§Arguments

  • src - A slice contains LAB data
  • src_stride - Bytes per row for src data.
  • dst - A mutable slice to receive BGRA data
  • dst_stride - Bytes per row for dst data
  • width - Image width
  • height - Image height
  • matrix - Transformation matrix from RGB 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