aboutsummaryrefslogtreecommitdiffstats
path: root/src/libclut.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-08-05 23:28:03 +0200
committerMattias Andrée <maandree@kth.se>2016-08-05 23:28:08 +0200
commit686d45b21b3faaf266358337657a6c3e1eb5a139 (patch)
tree9b8ad78178fdf0a63292288bf79f43237f1799f7 /src/libclut.h
parentFix bug in libclut_apply__ (diff)
downloadlibclut-0.3.tar.gz
libclut-0.3.tar.bz2
libclut-0.3.tar.xz
Fix bugs in cie functions0.3
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/libclut.h')
-rw-r--r--src/libclut.h14
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__); \
} \