Skip to main content

read_tga_from_bytes_with_options

Function read_tga_from_bytes_with_options 

Source
pub fn read_tga_from_bytes_with_options(
    bytes: &[u8],
    options: TgaReadOptions,
) -> Result<Tga, TgaBinaryError>
Expand description

Reads TGA data from bytes with explicit options.

ยงErrors

TgaBinaryError::InvalidHeader when bytes are shorter than the header or its dimensions run past the end, TgaBinaryError::Parse for an image or colour-map type this reader has no decoder for, and TgaBinaryError::InvalidData when the pixel data is short for the dimensions declared. TgaBinaryError::ValueOverflow when those dimensions multiply past usize. TGA carries no magic, so a file that is not one fails on its declared layout rather than on a signature.