use crate::kernels::raster::halve_rgba;
pub fn assemble_parent(children: [Option<&[u8]>; 4], size: usize, out: &mut [u8]) {
let half = size / 2;
let mut small = vec![0u8; half * half * 4];
for (i, child) in children.into_iter().enumerate() {
let (dx, dy) = (i % 2, i / 2);
small.fill(0);
if let Some(child) = child {
halve_rgba(child, size, size, &mut small);
}
for r in 0..half {
let dst = ((dy * half + r) * size + dx * half) * 4;
out[dst..dst + half * 4].copy_from_slice(&small[r * half * 4..(r + 1) * half * 4]);
}
}
}