From 62c039a63a8afdea4ec2da081d0173d7dd1d4578 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 14 Oct 2012 17:07:01 +0200 Subject: [PATCH] The white balance effect was computing all wrong LMS scaling factors, since it was multiplying with the wrong matrices. Fixed. --- white_balance_effect.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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); -- 2.39.2