Struct dds::DDS
[−]
[src]
pub struct DDS { pub header: Header, pub layers: Vec<Vec<RGBA<u8>>>, }
Represents a parsed DDS file
Fields
header: Header
The parsed DDS header
layers: Vec<Vec<RGBA<u8>>>
Mipmap layers
Methods
impl DDS
[src]
fn parse_header<R: Read>(buf: &mut R) -> Result<Header, ParseError>
[src]
Parses a Header
object from a raw u8
buffer.
fn parse_header_raw<R: Read>(buf: &mut R) -> Result<RawHeader, ParseError>
[src]
Parses the raw header from the image. Useful for getting information not contained in the normal parsed Header struct.
fn decode<R: Read>(buf: &mut R) -> Result<DDS, ParseError>
[src]
Decodes a buffer into a header and a series of mipmap images. Handles uncompressed and DXT1-5 compressed images.
fn encode(
pixels: &Vec<RGBA<u8>>,
size: (u32, u32),
compression: Compression
) -> Result<Vec<u8>, EncodeError>
[src]
pixels: &Vec<RGBA<u8>>,
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