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 |
#1094 in Images
49 downloads per month
Used in oculante
29KB
506 lines
dds-rs
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
~0.7–1.4MB
~28K SLoC