Function colorutils_rs::linear_to_bgra

source ·
pub fn linear_to_bgra(
    src: &[f32],
    src_stride: u32,
    dst: &mut [u8],
    dst_stride: u32,
    width: u32,
    height: u32,
    transfer_function: TransferFunction,
)
Expand description

This function converts Linear BGRA to BGRA, Alpha channel will de dernormalizaed. This is much more effective than naive direct transformation

§Arguments

  • src - A slice contains Linear BGRA data
  • src_stride - Bytes per row for src data.
  • dst - A mutable slice to receive Gamma BGRA data
  • dst_stride - Bytes per row for dst data
  • width - Image width
  • height - Image height
  • transfer_function - Transfer function from gamma to linear space. If you don’t have specific pick Srgb