Skip to content

Commit

Permalink
fn invert: Translate for loops.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkysen committed Sep 18, 2023
1 parent 309aabf commit b747b59
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/wedge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,11 @@ const fn hflip(src: &[u8; 64 * 64]) -> [u8; 64 * 64] {
}

fn invert(dst: &mut [u8], src: &[u8], w: usize, h: usize) {
let mut y = 0;
let mut y_off = 0;
while y < h {
let mut x = 0;
while x < w {
for _ in 0..h {
for x in 0..w {
dst[y_off + x] = 64 - src[y_off + x];
x += 1;
}
y += 1;
y_off += w;
}
}
Expand Down

0 comments on commit b747b59

Please sign in to comment.