decrunch-unity

Crates.iodecrunch-unity
lib.rsdecrunch-unity
version0.1.2
created_at2025-05-18 19:52:06.337728+00
updated_at2025-05-18 19:52:06.337728+00
descriptionDecoder for crunch-compressed texture data, using the Unity fork of the crunch library.
homepagehttps://github.com/miwig/decrunch-unity
repositoryhttps://github.com/miwig/decrunch-unity
max_upload_size
id1678873
size4,630,523
Michael Wigard (miwig)

documentation

README

Decoder for crunch-compressed texture data

Crates.io Documentation

This crate provides a Rust wrapper around the Unity fork of the crunch decompressor.

Example

use decrunch::*;
use std::fs::File;
use std::io::Read;

let mut compressed_file = File::open("testdata/copyright_2048_compressed.dat")?;
let mut compressed_data = Vec::new();

compressed_file.read_to_end(&mut compressed_data)?;

let c_data = CrunchedData::new(&compressed_data);
let decompressed_data = match c_data.decode_level(0) {
    None => {
        panic!("Failed to decompress texture data");
    }
    Some(res) => res,
};

assert!(decompressed_data.len() > 0);
Commit count: 16

cargo fmt