correct for both 4 bytes per pixel and 2 bytes
This commit is contained in:
parent
e43f8b0efb
commit
a512e710fa
|
@ -126,7 +126,7 @@ fn main() -> anyhow::Result<()> {
|
||||||
};
|
};
|
||||||
let g = frame[i * 2];
|
let g = frame[i * 2];
|
||||||
let b = frame[i * 2 + 1];
|
let b = frame[i * 2 + 1];
|
||||||
let out_i = (y + x * HEIGHT) * 2;
|
let out_i = ((HEIGHT - 1 - y) + (WIDTH - 1 - x) * HEIGHT) * 4;
|
||||||
swapped[out_i..out_i + 4].copy_from_slice(&[0, r, g, b]);
|
swapped[out_i..out_i + 4].copy_from_slice(&[0, r, g, b]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user