diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-05-03 20:20:12 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-05-03 20:20:12 +0200 |
| commit | 06b8e2576f952e8f8b097ee906f662d2ac38e2e8 (patch) | |
| tree | 35b0b9dc614f5f097ffb82e4c2d032958833fc3e /src/blind-gauss-blur.c | |
| parent | Fixes and improvements to stream.c (diff) | |
| download | blind-06b8e2576f952e8f8b097ee906f662d2ac38e2e8.tar.gz blind-06b8e2576f952e8f8b097ee906f662d2ac38e2e8.tar.bz2 blind-06b8e2576f952e8f8b097ee906f662d2ac38e2e8.tar.xz | |
Add constants D65_XYZ_X and D65_XYZ_Z
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/blind-gauss-blur.c')
| -rw-r--r-- | src/blind-gauss-blur.c | 13 |
1 files changed, 5 insertions, 8 deletions
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; } } } |
