| Crates.io | texture2ddecoder |
| lib.rs | texture2ddecoder |
| version | 0.1.2 |
| created_at | 2023-07-09 16:09:21.276079+00 |
| updated_at | 2025-03-21 00:04:19.550483+00 |
| description | pure Rust no-std texture decoder |
| homepage | https://crates.io/crates/texture2ddecoder |
| repository | https://github.com/UniversalGameExtraction/texture2ddecoder |
| max_upload_size | |
| id | 912133 |
| size | 384,238 |
A pure Rust no-std texture decoder for the following formats:
and with alloc:
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], outbuf: &mut [u32]) -> Result<(), &'static str>
// data: the compressed data (block), expected to be block_size in size
// outbuf: the buffer to write the decoded image to, expected to be block_size in size
The exceptions are:
Here is a list of the formats and their corresponding functions:
This crate itself is dual-licensed under MIT + Apache2.
The texture compression codecs themselves have following licenses:
| Codec | License | Source |
|---|---|---|
| ATC | MIT | Perfare/AssetStudio - Texture2DDecoderNative/atc.cpp |
| ASTC | MIT | Ishotihadus/mikunyan - ext/decoders/native/astc.c |
| BCn | MIT | Perfare/AssetStudio - Texture2DDecoderNative/bcn.cpp |
| ETC | MIT | Ishotihadus/mikunyan - ext/decoders/native/etc.c |
| f16 | MIT | Maratyszcza/FP16 |
| PVRTC | MIT | Ishotihadus/mikunyan - ext/decoders/native/pvrtc.c |
| Crunch | PUBLIC DOMAIN | BinomialLLC/crunch |
| Crunch (Unity) | ZLIB | Unity-Technologies/crunch |