Struct adder_codec_core::codec::decoder::Decoder
source · pub struct Decoder<R> { /* private fields */ }
Expand description
Struct for decoding Event
s from a stream
Implementations§
source§impl<R: Read + Seek> Decoder<R>
impl<R: Read + Seek> Decoder<R>
sourcepub fn new(
compression: Box<dyn ReadCompression<R>>,
reader: &mut BitReader<R, BigEndian>
) -> Result<Self, CodecError>where
Self: Sized,
pub fn new( compression: Box<dyn ReadCompression<R>>, reader: &mut BitReader<R, BigEndian> ) -> Result<Self, CodecError>where Self: Sized,
Create a new decoder with the given compression scheme
sourcepub fn meta(&self) -> &CodecMetadata
pub fn meta(&self) -> &CodecMetadata
Returns a reference to the metadata of the underlying compression scheme
sourcepub fn meta_mut(&mut self) -> &mut CodecMetadata
pub fn meta_mut(&mut self) -> &mut CodecMetadata
Returns a mutable reference to the metadata of the underlying compression scheme
sourcepub fn get_source_type(&self) -> SourceType
pub fn get_source_type(&self) -> SourceType
Get the source data representation, based on the source camera
sourcepub fn digest_event(
&mut self,
reader: &mut BitReader<R, BigEndian>
) -> Result<Event, CodecError>
pub fn digest_event( &mut self, reader: &mut BitReader<R, BigEndian> ) -> Result<Event, CodecError>
Read and decode the next event from the input stream
sourcepub fn set_input_stream_position(
&mut self,
reader: &mut BitReader<R, BigEndian>,
position: u64
) -> Result<(), CodecError>
pub fn set_input_stream_position( &mut self, reader: &mut BitReader<R, BigEndian>, position: u64 ) -> Result<(), CodecError>
Sets the input stream position to the given absolute byte position
sourcepub fn get_input_stream_position(
&self,
reader: &mut BitReader<R, BigEndian>
) -> Result<u64, CodecError>
pub fn get_input_stream_position( &self, reader: &mut BitReader<R, BigEndian> ) -> Result<u64, CodecError>
Returns the current position of the input stream in bytes
sourcepub fn get_eof_position(
&mut self,
reader: &mut BitReader<R, BigEndian>
) -> Result<u64, CodecError>
pub fn get_eof_position( &mut self, reader: &mut BitReader<R, BigEndian> ) -> Result<u64, CodecError>
Returns the EOF position, in bytes. This is the position of the first byte of the raw event which demarcates the end of the stream.