Function dib::decode_into

source ·
pub unsafe fn decode_into(
    r: &mut impl Read,
    buf: impl FnOnce(usize) -> Result<*mut MaybeUninit<u8>, Box<dyn Any + Send + 'static>>
) -> Result<(Color, (u32, u32)), Error>
Expand description

Decodes a DIB/BMP. Takes a function that will allocate n bytes, and return a pointer to the allocation.

§Safety

undefined behaviour if the allocation is not n bytes

ideally this would be unsafe impl FnOnce, but that doesnt work.