Skip to main content

read_tpc_from_bytes

Function read_tpc_from_bytes 

Source
pub fn read_tpc_from_bytes(bytes: &[u8]) -> Result<Tpc, TpcBinaryError>
Expand description

Reads TPC data from bytes.

ยงErrors

TpcBinaryError::InvalidHeader when bytes are shorter than the header or its declared sizes run past the end, TpcBinaryError::UnsupportedPixelType for an encoding this reader has no layout for, and TpcBinaryError::InvalidData when the payload does not match the dimensions the header gives. TPC carries no magic, so a file that is not one fails on its declared sizes rather than on a signature.