diff options
author | Mattias Andrée <maandree@kth.se> | 2016-08-05 23:28:03 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-08-05 23:28:08 +0200 |
commit | 686d45b21b3faaf266358337657a6c3e1eb5a139 (patch) | |
tree | 9b8ad78178fdf0a63292288bf79f43237f1799f7 /src | |
parent | Fix bug in libclut_apply__ (diff) | |
download | libclut-686d45b21b3faaf266358337657a6c3e1eb5a139.tar.gz libclut-686d45b21b3faaf266358337657a6c3e1eb5a139.tar.bz2 libclut-686d45b21b3faaf266358337657a6c3e1eb5a139.tar.xz |
Fix bugs in cie functions0.3
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | src/libclut.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libclut.h b/src/libclut.h index 0b5f081..973ac0a 100644 --- a/src/libclut.h +++ b/src/libclut.h @@ -786,12 +786,12 @@ static inline int libclut_0__(double x) { return libclut_eq__(x, 0); } size_t sn__ = (sclut)->channel##_size; \ double dm__ = (double)(dmax); \ double sm__ = (double)(smax); \ - double smdm__ = sm__ / dm__; \ + double dmsm__ = dm__ / sm__; \ double x__, y__; \ if (dn__ == sn__) \ for (di__ = 0; di__ < dn__; di__++) \ { \ - y__ = (double)((sclut)->channel[si__]) * smdm__; \ + y__ = (double)((sclut)->channel[di__]) * dmsm__; \ (dclut)->channel[di__] = (dtype)y__; \ } \ else \ @@ -803,7 +803,7 @@ static inline int libclut_0__(double x) { return libclut_eq__(x, 0); } x__ -= (double)si__; \ y__ = (double)((sclut)->channel[si__]) * (1 - x__); \ y__ += (double)((sclut)->channel[sj__]) * (x__); \ - y__ *= smdm__; \ + y__ *= dmsm__; \ (dclut)->channel[di__] = (dtype)y__; \ } \ } \ @@ -1007,7 +1007,7 @@ static inline int libclut_0__(double x) { return libclut_eq__(x, 0); } } \ if (btest) \ { \ - libclut_model_ciexyy_to_srgb(x__, y__, nexpr, &r__, &g__, &b__); \ + libclut_model_ciexyy_to_srgb(x__, y__, bexpr, &r__, &g__, &b__); \ bs__[i__] = (type)(b__ * m__); \ } \ } \ @@ -1016,17 +1016,17 @@ static inline int libclut_0__(double x) { return libclut_eq__(x, 0); } { \ if (rtest) \ for (i__ = 0; i__ < rn__; i__++) \ - libclut_cie___(clut, max, type, rexpr, i__, \ + libclut_cie___(clut, max, type, r, rexpr, i__, \ libclut_i__(i__, rn__, gn__), \ libclut_i__(i__, rn__, bn__)); \ if (gtest) \ for (i__ = 0; i__ < rn__; i__++) \ - libclut_cie___(clut, max, type, gexpr, \ + libclut_cie___(clut, max, type, g, gexpr, \ libclut_i__(i__, gn__, rn__), i__, \ libclut_i__(i__, gn__, bn__)); \ if (btest) \ for (i__ = 0; i__ < rn__; i__++) \ - libclut_cie___(clut, max, type, bexpr, i__, \ + libclut_cie___(clut, max, type, b, bexpr, \ libclut_i__(i__, bn__, rn__), \ libclut_i__(i__, bn__, gn__), i__); \ } \ |