Struct dds::DDS
[−]
[src]
pub struct DDS { pub header: Header, pub layers: Vec<Vec<Pixel>>, }
Represents a parsed DDS file
Fields
header: Header
The parsed DDS header
layers: Vec<Vec<Pixel>>
Mipmap layers
Methods
impl DDS
[src]
fn parse_header<R: Read>(buf: &mut R) -> Result<Header, ParseError>
Parses a Header
object from a raw u8
buffer.
fn decode<R: Read>(buf: &mut R) -> Result<DDS, ParseError>
Decodes a buffer into a header and a series of mipmap images. Handles uncompressed and DXT1-5 compressed images.
fn encode(
pixels: &Vec<Pixel>,
size: (u32, u32),
compression: Compression
) -> Result<Vec<u8>, EncodeError>
pixels: &Vec<Pixel>,
size: (u32, u32),
compression: Compression
) -> Result<Vec<u8>, EncodeError>
Encodes a series of Pixels as a bunch of bytes, suitable for writing to disk, etc. Currently only supports uncompressed RGBA images