(width: usize, height: usize)
| 132 | } |
| 133 | |
| 134 | fn build_positions(width: usize, height: usize) -> Vec<[f64; 2]> { |
| 135 | let mut positions = Vec::with_capacity(width * height); |
| 136 | for y in 0..height { |
| 137 | for x in 0..width { |
| 138 | let py = (height - 1 - y) as f64; |
| 139 | positions.push([x as f64, py]); |
| 140 | } |
| 141 | } |
| 142 | positions |
| 143 | } |
| 144 | |
| 145 | fn frame_colors(frame_idx: usize, frames: &[u8], width: usize, height: usize) -> Vec<Color> { |
| 146 | let pixels_per_frame = width * height; |