decrunch-unity 0.1.2

Decoder for crunch-compressed texture data, using the Unity fork of the crunch library.
Documentation
  • Coverage
  • 26.19%
    11 out of 42 items documented1 out of 9 items with examples
  • Size
  • Source code size: 4.63 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 514.05 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • miwig/decrunch-unity
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • miwig

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);