This commit is contained in:
2026-07-11 00:14:41 +02:00
parent 87dd8e1190
commit c9e463bb9a
15 changed files with 183 additions and 51 deletions
+1 -1
View File
@@ -251,7 +251,7 @@ fn upload_texture(
/// verfälschen. Mittelung im (gamma-kodierten) Speicherraum — für den
/// stilisierten Look unkritisch.
fn downsample(src: &[u8], w: u32, h: u32) -> (Vec<u8>, u32, u32) {
let (nw, nh) = ((w + 1) / 2, (h + 1) / 2);
let (nw, nh) = (w.div_ceil(2), h.div_ceil(2));
let mut dst = vec![0u8; (nw * nh * 4) as usize];
for y in 0..nh {
for x in 0..nw {