mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-16 23:42:27 +00:00
cms: index the primaries with an iterator in the 16-way sum
clippy's needless_range_loop (stable) flags the loop variable indexing self.prim_n; the offset is still the bit mask.
This commit is contained in:
1 parent
88271c006c
commit
714b1f8b3f
1 file changed
+2
-2
@@ -133,7 +133,7 @@ impl CmykModel {
|
||||
(v + 4.0 * self.tvi[i] * v * (1.0 - v)).clamp(0.0, 1.0)
|
||||
});
|
||||
let mut s = [0.0; 3];
|
||||
for m in 0..16 {
|
||||
for (m, prim) in self.prim_n.iter().enumerate().take(16) {
|
||||
let mut w = 1.0;
|
||||
for (i, ai) in a.iter().enumerate() {
|
||||
w *= if m & (1 << i) != 0 { *ai } else { 1.0 - ai };
|
||||
@@ -141,7 +141,7 @@ impl CmykModel {
|
||||
if w == 0.0 {
|
||||
continue;
|
||||
}
|
||||
for (acc, p) in s.iter_mut().zip(&self.prim_n[m]) {
|
||||
for (acc, p) in s.iter_mut().zip(prim) {
|
||||
*acc += w * p;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user