Function decode_to_buf
pub fn decode_to_buf(buf: impl AsMut<[u8]>, data: impl AsRef<[u8]>) -> Result<Header>
Decode the image into a pre-allocated buffer.
Note: the resulting number of channels will match the header. In order to change
the number of channels, use Decoder::with_channels.