Add length assertion
All checks were successful
All checks were successful
This commit is contained in:
parent
8f79825c2e
commit
b1cefd7863
|
@ -122,6 +122,7 @@ impl Encoder {
|
|||
for (ComponentState { x, y, .. }, rgb) in self.factors.iter_mut() {
|
||||
let basis = f32::cos(*x as f32 * scale_x) * f32::cos(*y as f32 * scale_y);
|
||||
|
||||
assert_eq!(chunk.len(), rgb.len());
|
||||
for (val, slot) in chunk
|
||||
.iter()
|
||||
.map(|byte| basis * srgb_to_linear(*byte))
|
||||
|
|
Loading…
Reference in a new issue