#dds #surface #directdraw

dds-rs

Decodes DirectDraw Surface files

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

#707 in Images

Download history 139/week @ 2024-07-27 41/week @ 2024-08-03 51/week @ 2024-08-10 61/week @ 2024-08-17 56/week @ 2024-08-24 88/week @ 2024-08-31 70/week @ 2024-09-07 101/week @ 2024-09-14 212/week @ 2024-09-21 54/week @ 2024-09-28 84/week @ 2024-10-05 69/week @ 2024-10-12 104/week @ 2024-10-19 100/week @ 2024-10-26 74/week @ 2024-11-02 53/week @ 2024-11-09

335 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
~36K SLoC