From 06b8e2576f952e8f8b097ee906f662d2ac38e2e8 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 3 May 2017 20:20:12 +0200 Subject: Add constants D65_XYZ_X and D65_XYZ_Z MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blind-set-saturation.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/blind-set-saturation.c') diff --git a/src/blind-set-saturation.c b/src/blind-set-saturation.c index 94e994c..ce0dd40 100644 --- a/src/blind-set-saturation.c +++ b/src/blind-set-saturation.c @@ -13,17 +13,15 @@ static void process_xyza(struct stream *colour, struct stream *satur, size_t n) { size_t i; - double s, *x, y, *z, X, Z; - X = D65_XYY_X / D65_XYY_Y; - Z = 1 / D65_XYY_Y - 1 - X; + double s, *x, y, *z; for (i = 0; i < n; i += colour->pixel_size) { s = ((double *)(satur->buf + i))[1]; s *= ((double *)(satur->buf + i))[3]; x = ((double *)(colour->buf + i)) + 0; y = ((double *)(colour->buf + i))[1]; z = ((double *)(colour->buf + i)) + 2; - *x = ((*x / X - y) * s + y) * X; - *z = ((*z / Z - y) * s + y) * Z; + *x = ((*x / D65_XYZ_X - y) * s + y) * D65_XYZ_X; + *z = ((*z / D65_XYZ_Z - y) * s + y) * D65_XYZ_Z; /* * Explaination: * Y is the luma and ((X / Xn - Y / Yn), (Z / Zn - Y / Yn)) -- cgit v1.2.3-70-g09d2