pub struct Context { /* private fields */ }Expand description
RAII wrapper around a lepcc_ContextHdl.
Each method operates on a fresh decode pass — the underlying C context is
reset by each call. Context is not Send + Sync because the raw
pointer is single-threaded; create one per thread / per decode call.
Implementations§
Source§impl Context
impl Context
Sourcepub fn blob_info(&self, data: &[u8]) -> Result<(u32, u32)>
pub fn blob_info(&self, data: &[u8]) -> Result<(u32, u32)>
Identify the type and byte-length of the next blob in data.
Returns (blob_type, blob_size_in_bytes).
Sourcepub fn decode_xyz(&self, data: &[u8]) -> Result<Vec<[f64; 3]>>
pub fn decode_xyz(&self, data: &[u8]) -> Result<Vec<[f64; 3]>>
Decode a lepcc-xyz blob into a vector of [x, y, z] coordinates.
Sourcepub fn decode_rgb(&self, data: &[u8]) -> Result<Vec<[u8; 3]>>
pub fn decode_rgb(&self, data: &[u8]) -> Result<Vec<[u8; 3]>>
Decode a lepcc-rgb blob into a vector of [r, g, b] byte triples.
Sourcepub fn decode_intensity(&self, data: &[u8]) -> Result<Vec<u16>>
pub fn decode_intensity(&self, data: &[u8]) -> Result<Vec<u16>>
Decode a lepcc-intensity blob into a vector of u16 intensity values.
Sourcepub fn decode_flag_bytes(&self, data: &[u8]) -> Result<Vec<u8>>
pub fn decode_flag_bytes(&self, data: &[u8]) -> Result<Vec<u8>>
Decode a lepcc-flagbytes blob into a vector of classification bytes.
Sourcepub fn encode_xyz(&self, points: &[[f64; 3]], max_err: f64) -> Result<Vec<u8>>
pub fn encode_xyz(&self, points: &[[f64; 3]], max_err: f64) -> Result<Vec<u8>>
Encode XYZ coordinates into a LEPCC blob.
max_err is the maximum absolute error per axis (e.g. 0.001 metres).
Sourcepub fn encode_rgb(&self, colours: &[[u8; 3]]) -> Result<Vec<u8>>
pub fn encode_rgb(&self, colours: &[[u8; 3]]) -> Result<Vec<u8>>
Encode RGB colours into a LEPCC blob.