10 releases (6 breaking)

Uses old Rust 2015

0.7.0 Jan 2, 2018
0.6.0 Dec 19, 2017
0.5.2 Jul 28, 2017
0.5.1 Mar 28, 2017

#617 in Images

Download history 98/week @ 2024-03-11 49/week @ 2024-03-18 72/week @ 2024-03-25 108/week @ 2024-04-01 46/week @ 2024-04-08 97/week @ 2024-04-15 50/week @ 2024-04-22 92/week @ 2024-04-29 159/week @ 2024-05-06 145/week @ 2024-05-13 118/week @ 2024-05-20 84/week @ 2024-05-27 56/week @ 2024-06-03 88/week @ 2024-06-10 62/week @ 2024-06-17 75/week @ 2024-06-24

290 downloads per month
Used in oculante

LGPL-3.0

29KB
506 lines

dds-rs

pipeline status

Introduction

A library for decoding and encoding DirectDraw Surface files. Currently handles decoding some uncompressed DX9 formats, as well as DXT1-5. Supports encoding in the A8R8G8B8 format. Support for cubemaps and volumes, as well as DX10 is planned.

Project Layout

The dds-rs crate lives in the dds-rs subdirectory of this repo. There also exist several utilities in dds-utils that may eventually get published to crates.io. They also function as examples of how to use dds-rs.

Example input files can be found under examples/.

Examples

extern crate dds;

use std::fs::File;
use std::io::BufReader;
use std::path::Path;

use dds::DDS;

fn main() {
    let file = File::open(Path::new("foo.dds")).unwrap();
    let mut reader = BufReader::new(file);

    let dds = DDS::decode(&mut reader).unwrap();
}

lib.rs:

Handles decoding (and someday encoding) DirectDraw Surface files.

Examples

extern crate dds;

use std::fs::File;
use std::io::BufReader;
use std::path::Path;

use dds::DDS;

fn main() {
    let file = File::open(Path::new("../examples/dxt1.dds")).unwrap();
    let mut reader = BufReader::new(file);

    let dds = DDS::decode(&mut reader).unwrap();
}

Dependencies

~1–1.7MB
~37K SLoC