} \
return true; \
} \
- DEFVEC(type)
+ DEFVEC(type) \
+ type type ## _mix(type a, type b, type f) \
+ { \
+ return (1.0 - f) * a + b * f; \
+ } \
+ v2 ## type v2 ## type ## _mix(v2 ## type a, v2 ## type b, type f) \
+ { \
+ return (v2 ## type) {type ## _mix(a.x, b.x, f), type ## _mix(a.y, b.y, f)}; \
+ } \
+ v3 ## type v3 ## type ## _mix(v3 ## type a, v3 ## type b, type f) \
+ { \
+ return (v3 ## type) {type ## _mix(a.x, b.x, f), type ## _mix(a.y, b.y, f), type ## _mix(a.z, b.z, f)}; \
+ } \
+ v4 ## type v4 ## type ## _mix(v4 ## type a, v4 ## type b, type f) \
+ { \
+ return (v4 ## type) {type ## _mix(a.x, b.x, f), type ## _mix(a.y, b.y, f), type ## _mix(a.z, b.z, f), type ## _mix(a.w, b.w, f)}; \
+ }
DEFFLOAT(f32)
DEFFLOAT(f64)
DEFTYP(int ## bits ## _t, s ## bits) \
DEFTYP(uint ## bits ## _t, u ## bits)
+#define DEFMIX(bits) \
+ f ## bits f ## bits ## _mix(f ## bits a, f ## bits b, f ## bits f); \
+ v2f ## bits v2f ## bits ## _mix(v2f ## bits a, v2f ## bits b, f ## bits f); \
+ v3f ## bits v3f ## bits ## _mix(v3f ## bits a, v3f ## bits b, f ## bits f); \
+ v4f ## bits v4f ## bits ## _mix(v4f ## bits a, v4f ## bits b, f ## bits f);
+
DEFTYPES(8)
DEFTYPES(16)
DEFTYPES(32)
DEFTYP(float, f32)
DEFTYP(double, f64)
+DEFMIX(32)
+DEFMIX(64)
+
#undef DEFRW
#undef DEFBOX
#undef DEFVEC