correct for both 4 bytes per pixel and 2 bytes

This commit is contained in:
devdesk 2024-02-19 22:38:58 +02:00
parent e43f8b0efb
commit a512e710fa

View File

@ -126,7 +126,7 @@ fn main() -> anyhow::Result<()> {
};
let g = frame[i * 2];
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]);
}
}