From eba337c7114593bffb9a5d57cc2a163b12619b68 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 7 Jan 2016 17:16:16 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libclut.h | 73 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/src/libclut.h b/src/libclut.h index eba99d3..891c7c4 100644 --- a/src/libclut.h +++ b/src/libclut.h @@ -131,24 +131,24 @@ break; \ libclut_model_srgb_to_ciexyy(rs__[i__] / ((double)(max)), gs__[i__] / ((double)(max)), \ bs__[i__] / ((double)(max)), &x__, &y__, &Y__); \ - for (i__ = 0; i__ < rn__; i__) \ - { \ - if (r != 1.0) \ - { \ - libclut_model_ciexyy_to_srgb(x__, y__, (Y__ - 0.5) * r + 0.5, &r__, &g__, &b__); \ - rs__[i__] = (type)(r__ * (double)(max)); \ - } \ - if (g != 1.0) \ - { \ - libclut_model_ciexyy_to_srgb(x__, y__, (Y__ - 0.5) * g + 0.5, &r__, &g__, &b__); \ - gs__[i__] = (type)(g__ * (double)(max)); \ - } \ - if (b != 1.0) \ - { \ - libclut_model_ciexyy_to_srgb(x__, y__, (Y__ - 0.5) * b + 0.5, &r__, &g__, &b__); \ - bs__[i__] = (type)(b__ * (double)(max)); \ - } \ - } \ + if (r != 1.0) \ + for (i__ = 0; i__ < rn__; i__) \ + { \ + libclut_model_ciexyy_to_srgb(x__, y__, (Y__ - 0.5) * r + 0.5, &r__, &g__, &b__); \ + rs__[i__] = (type)(r__ * (double)(max)); \ + } \ + if (g != 1.0) \ + for (i__ = 0; i__ < gn__; i__) \ + { \ + libclut_model_ciexyy_to_srgb(x__, y__, (Y__ - 0.5) * g + 0.5, &r__, &g__, &b__); \ + gs__[i__] = (type)(g__ * (double)(max)); \ + } \ + if (b != 1.0) \ + for (i__ = 0; i__ < bn__; i__) \ + { \ + libclut_model_ciexyy_to_srgb(x__, y__, (Y__ - 0.5) * b + 0.5, &r__, &g__, &b__); \ + bs__[i__] = (type)(b__ * (double)(max)); \ + } \ } \ } \ while (0) @@ -229,28 +229,29 @@ break; \ libclut_model_srgb_to_ciexyy(rs__[i__] / ((double)(max)), gs__[i__] / ((double)(max)), \ bs__[i__] / ((double)(max)), &x__, &y__, &Y__); \ - for (i__ = 0; i__ < rn__; i__) \ - { \ - if (r != 1.0) \ - { \ - libclut_model_ciexyy_to_srgb(x__, y__, Y__ * r, &r__, &g__, &b__); \ - rs__[i__] = (type)(r__ * (double)(max)); \ - } \ - if (g != 1.0) \ - { \ - libclut_model_ciexyy_to_srgb(x__, y__, Y__ * g, &r__, &g__, &b__); \ - gs__[i__] = (type)(g__ * (double)(max)); \ - } \ - if (b != 1.0) \ - { \ - libclut_model_ciexyy_to_srgb(x__, y__, Y__ * b, &r__, &g__, &b__); \ - bs__[i__] = (type)(b__ * (double)(max)); \ - } \ - } \ + if (r != 1.0) \ + for (i__ = 0; i__ < rn__; i__) \ + { \ + libclut_model_ciexyy_to_srgb(x__, y__, Y__ * r, &r__, &g__, &b__); \ + rs__[i__] = (type)(r__ * (double)(max)); \ + } \ + if (g != 1.0) \ + for (i__ = 0; i__ < gn__; i__) \ + { \ + libclut_model_ciexyy_to_srgb(x__, y__, Y__ * g, &r__, &g__, &b__); \ + gs__[i__] = (type)(g__ * (double)(max)); \ + } \ + if (b != 1.0) \ + for (i__ = 0; i__ < bn__; i__) \ + { \ + libclut_model_ciexyy_to_srgb(x__, y__, Y__ * b, &r__, &g__, &b__); \ + bs__[i__] = (type)(b__ * (double)(max)); \ + } \ } \ } \ while (0) + #endif -- cgit v1.2.3-70-g09d2