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-gauss-blur.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/blind-gauss-blur.c') diff --git a/src/blind-gauss-blur.c b/src/blind-gauss-blur.c index 2dc6d08..031860d 100644 --- a/src/blind-gauss-blur.c +++ b/src/blind-gauss-blur.c @@ -31,15 +31,12 @@ process_xyza(char *restrict output, char *restrict cbuf, char *restrict sbuf, pixel_t *img = (pixel_t *)output; pixel_t c, k; size_t x1, y1, i1, x2, y2, i2; - double d, m, X, Z; + double d, m; int i, blurred, blur[3] = {0, 0, 0}; size_t start, end, x2start, x2end, y2start, y2end; int is_master; pid_t *children; - X = D65_XYY_X / D65_XYY_Y; - Z = 1 / D65_XYY_Y - 1 - X; - y2start = x2start = 0; x2end = colour->width; y2end = colour->height; @@ -65,8 +62,8 @@ process_xyza(char *restrict output, char *restrict cbuf, char *restrict sbuf, i1 = start * colour->width; for (y1 = start; y1 < end; y1++) { for (x1 = 0; x1 < colour->width; x1++, i1++) { - clr[i1][0] = clr[i1][0] / X - clr[i1][1]; - clr[i1][2] = clr[i1][2] / Z - clr[i1][1]; + clr[i1][0] = clr[i1][0] / D65_XYZ_X - clr[i1][1]; + clr[i1][2] = clr[i1][2] / D65_XYZ_Z - clr[i1][1]; /* * Explaination: * Y is the luma and ((X / Xn - Y / Yn), (Z / Zn - Y / Yn)) @@ -260,8 +257,8 @@ process_xyza(char *restrict output, char *restrict cbuf, char *restrict sbuf, i1 = start * colour->width; for (y1 = start; y1 < end; y1++) { for (x1 = 0; x1 < colour->width; x1++, i1++) { - img[i1][0] = (img[i1][0] + img[i1][1]) * X; - img[i1][2] = (img[i1][2] + img[i1][1]) * Z; + img[i1][0] = (img[i1][0] + img[i1][1]) * D65_XYZ_X; + img[i1][2] = (img[i1][2] + img[i1][1]) * D65_XYZ_Z; } } } -- cgit v1.2.3-70-g09d2