Skip to content

Commit

Permalink
clean up lib test
Browse files Browse the repository at this point in the history
  • Loading branch information
vk2seb committed Feb 28, 2024
1 parent 130226b commit a81a09e
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions firmware/polyvec-lib/src/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,22 +404,19 @@ mod tests {
voice_manager.tick(50u32, &opts);
voice_manager.tick(200u32, &opts);

opts.screen.value = Screen::Adsr;
draw_main(&mut disp, opts.clone(), voice_manager.voices.clone(), &scope_samples, &touch, 1, 2).unwrap();
let rz = resize(&disp.img, 256*4, 64*4, FilterType::Nearest);
rz.save("screen_adsr.png").unwrap();

opts.screen.value = Screen::Scope;
disp.img = ImageBuffer::new(256, 64);
draw_main(&mut disp, opts.clone(), voice_manager.voices.clone(), &scope_samples, &touch, 1, 2).unwrap();
let rz = resize(&disp.img, 256*4, 64*4, FilterType::Nearest);
rz.save("screen_scope.png").unwrap();

opts.screen.value = Screen::Touch;
disp.img = ImageBuffer::new(256, 64);
draw_main(&mut disp, opts.clone(), voice_manager.voices.clone(), &scope_samples, &touch, 1, 2).unwrap();
let rz = resize(&disp.img, 256*4, 64*4, FilterType::Nearest);
rz.save("screen_touch.png").unwrap();
let screens = [
(Screen::Adsr, "adsr.png"),
(Screen::Scope, "scope.png"),
(Screen::Touch, "touch.png"),
];

for (screen, filename) in screens {
opts.screen.value = screen;
disp.img = ImageBuffer::new(256, 64);
draw_main(&mut disp, opts.clone(), voice_manager.voices.clone(), &scope_samples, &touch, 1, 2).unwrap();
let rz = resize(&disp.img, 256*4, 64*4, FilterType::Nearest);
rz.save(filename).unwrap();
}
}

#[test]
Expand Down

0 comments on commit a81a09e

Please sign in to comment.