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/assets/ground.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, as well as a reference to the raw header.

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<Pixel> into Vec<u8>.

ParseError

Represents an error encountered while parsing a DDS file

PixelFormat

Convenience enum for storing common pixel formats

Type Definitions

Pixel

Normalized internal RGBA pixel representation