mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
rustfmt modals tests
This commit is contained in:
parent
dda78b4ef3
commit
5be713d09e
1 changed files with 22 additions and 20 deletions
|
|
@ -182,13 +182,15 @@ fn clifford() -> Img {
|
||||||
let mut buf = vec![255u8; (SIZE * SIZE).try_into().unwrap()];
|
let mut buf = vec![255u8; (SIZE * SIZE).try_into().unwrap()];
|
||||||
let (a, b, c, d) = (-2.0, -2.4, 1.1, -0.9);
|
let (a, b, c, d) = (-2.0, -2.4, 1.1, -0.9);
|
||||||
let (mut x, mut y): (f32, f32) = (0.0, 0.0);
|
let (mut x, mut y): (f32, f32) = (0.0, 0.0);
|
||||||
for _ in 0..=10000000 {
|
for _ in 0..=4000000 {
|
||||||
let x1 = f32::sin(a * y) + c * f32::cos(a * x);
|
let x1 = f32::sin(a * y) + c * f32::cos(a * x);
|
||||||
let y1 = f32::sin(b * x) + d * f32::cos(b * y);
|
let y1 = f32::sin(b * x) + d * f32::cos(b * y);
|
||||||
(x, y) = (x1, y1);
|
(x, y) = (x1, y1);
|
||||||
let (a, b): (u32, u32) = ((x * SCALE + CENTER) as u32, (y * SCALE + CENTER) as u32);
|
let (a, b): (u32, u32) = ((x * SCALE + CENTER) as u32, (y * SCALE + CENTER) as u32);
|
||||||
let i: usize = (a + SIZE * b).try_into().unwrap();
|
let i: usize = (a + SIZE * b).try_into().unwrap();
|
||||||
if buf[i] >0 { buf[i] -= 1; }
|
if buf[i] > 0 {
|
||||||
|
buf[i] -= 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let mut rgb = vec![0u8; 3 * buf.len()];
|
let mut rgb = vec![0u8; 3 * buf.len()];
|
||||||
let mut i: usize = 0;
|
let mut i: usize = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue