Skip to main content

write_tpc

Function write_tpc 

Source
pub fn write_tpc<W: Write>(
    writer: &mut W,
    tpc: &Tpc,
) -> Result<(), TpcBinaryError>
Expand description

Writes TPC data to a writer.

ยงErrors

Everything except the I/O failure is raised while sizing the payload, before any byte is written: TpcBinaryError::InvalidHeader for a zero dimension or a zero mipmap count, TpcBinaryError::UnsupportedPixelType for a pixel-format code with no known layout, TpcBinaryError::ValueOverflow when data_size will not fit usize, and TpcBinaryError::InvalidData when the payload length disagrees with the size the header implies. TpcBinaryError::Io comes from the writer and can leave a partial file.