Crate texture2ddecoder

source ·
Expand description

A pure Rust no-std texture decoder for the following formats:

Functions

Provides a decode function for each format, as well as a block decode function all formats besides PVRTC. Besides some exceptions, the signature of the decode functions is as follows:

    fn decode_format(data: &[u8], width: usize, height: usize, image: &mut [u32]) -> Result<(), &'static str>
    // data: the compressed data, expected to be width * height / block_size in size
    // width: the width of the image
    // height: the height of the image
    // image: the buffer to write the decoded image to, expected to be width * height in size
    fn decode_format_block(data: &[u8], image: &mut [u32]) -> Result<(), &'static str>
    // data: the compressed data (block), expected to be block_size in size
    // image: the buffer to write the decoded image to, expected to be block_size in size

The exceptions are:

Functions