colorutils_rs

Function rgb_to_linear

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

This function converts RGB to linear colorspace

This function converts RGB to linear color space. This is much more effective than naive direct transformation

§Arguments

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