Crates.io | texture2ddecoder |
lib.rs | texture2ddecoder |
version | 0.1.1 |
source | src |
created_at | 2023-07-09 16:09:21.276079 |
updated_at | 2024-06-25 18:00:19.801082 |
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 | 374,346 |
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 |
* in doubt if these are the original source and have not just taken/adopted the code from somewhere else |