Skip to main content

decode

Function decode 

Source
pub fn decode(
    format: Format,
    data: &[u8],
    width: i32,
    height: i32,
    meter: &Arc<Meter>,
) -> Result<Image, DecodeError>
Expand description

Decodes a texture’s mip 0, data being its image data from the start (image_data, or what its m_StreamData names: Texture2D.get_image_data), mips and all, as UnityPy 1.25.2 with Pillow 9.5.0 does (module docs), charging the output to meter before it is allocated. Its pixel loop runs under crate::contain(), so a panic there is DecodeError::Panicked, with the output’s charge returned.