Skip to main content

compute_luminance

Function compute_luminance 

Source
pub fn compute_luminance(r: &[f64], g: &[f64], b: &[f64]) -> Vec<f64>
Expand description

Computes per-pixel luminance L = 0.299·R + 0.587·G + 0.114·B.

All three channel slices must have the same length nrows * ncols. Returns a flat row-major luminance vector of the same length, with each value clamped to [0, 1].