Crate dds [] [src]

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

Structs

DDS

Represents a parsed DDS file

Header

Represents a parsed DDS header. Has several convenience attributes.

RawHeader

Header as represented in the DDS file

RawPixelFormat

Pixel information as represented in the DDS file

Enums

Compression

Represents the compression format of a DDS file, aka the four-cc bytes.

EncodeError

Represents an error encountered while encoding a Vec<RGBA> into Vec<u8>.

ParseError

Represents an error encountered while parsing a DDS file

PixelFormat

Convenience enum for storing common pixel formats