Skip to main content

write_dds

Function write_dds 

Source
pub fn write_dds<W: Write>(
    writer: &mut W,
    dds: &Dds,
) -> Result<(), DdsBinaryError>
Expand description

Writes DDS data to a writer.

Dispatches on source_flavor: if the container was decoded from a CResDDS prefix header, the output is re-emitted in that format (20-byte prefix + raw payload). Otherwise the standard DDS container is written.

ยงErrors

DdsBinaryError::InvalidHeader when a standard container carries DXT3, which vanilla never writes and this crate refuses to emit; the check runs before anything is written. DdsBinaryError::Io and DdsBinaryError::Ddsfile come from the write itself and can leave a partial file. The prefixed CResDDS flavour skips the format check, since its payload is copied rather than re-encoded.