[][src]Function mandalas::util::yuv_to_rgb

pub fn yuv_to_rgb(yuv: [f64; 3]) -> [f64; 3]

Translate a YUV colour point (translated to 0–1 as opposed to -0.5–0.5) into an RGB colour point according to the BT.709 recommendation.

Based on https://en.wikipedia.org/wiki/YUV#HDTV_with_BT.709, https://goo.gl/kd6DPm and https://goo.gl/C9w4qT (original URLs too long).

Effectively computes

YUV to RGB matrix multiplicaiton

Examples

assert_eq!(yuv_to_rgb([0f64, 0f64, 0f64]), [0f64, 0.297705, 0f64]);