From: Steinar H. Gunderson Date: Sun, 14 Oct 2012 15:07:01 +0000 (+0200) Subject: The white balance effect was computing all wrong LMS scaling factors, since it was... X-Git-Tag: 1.0~242 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=62c039a63a8afdea4ec2da081d0173d7dd1d4578;hp=f8677dc447b42b95aee6a9c75df3c698ee67d999 The white balance effect was computing all wrong LMS scaling factors, since it was multiplying with the wrong matrices. Fixed. --- diff --git a/white_balance_effect.cpp b/white_balance_effect.cpp index 4c24cd2..6612120 100644 --- a/white_balance_effect.cpp +++ b/white_balance_effect.cpp @@ -72,11 +72,8 @@ static const Matrix3x3 xyz_to_lms_matrix = { */ static void compute_lms_scaling_factors(float x, float y, float z, float *scale_l, float *scale_m, float *scale_s) { - Matrix3x3 xyz_to_rgb_matrix; - invert_3x3_matrix(rgb_to_xyz_matrix, xyz_to_rgb_matrix); - float l, m, s; - multiply_3x3_matrix_float3(xyz_to_rgb_matrix, x, y, z, &l, &m, &s); + multiply_3x3_matrix_float3(xyz_to_lms_matrix, x, y, z, &l, &m, &s); *scale_l = y / l; *scale_m = *scale_l * (l / m);