Struct adder_codec_rs::framer::event_framer::FrameSequence
source · pub struct FrameSequence<T> {
pub chunk_rows: usize,
/* private fields */
}
Fields
chunk_rows: usize
Implementations
sourceimpl<T: Clone + Default + FrameValue<Output = T> + Serialize> FrameSequence<T>
impl<T: Clone + Default + FrameValue<Output = T> + Serialize> FrameSequence<T>
pub fn px_at_current(&self, row: usize, col: usize, channel: usize) -> &Option<T>
pub fn px_at_frame(
&self,
row: usize,
col: usize,
channel: usize,
frame_idx: usize
) -> Result<&Option<T>, FrameSequenceError>
pub fn is_frame_filled(
&self,
frame_idx: usize
) -> Result<bool, FrameSequenceError>
pub fn is_frame_0_filled(&self) -> Result<bool, FrameSequenceError>
pub fn pop_next_frame(&mut self) -> Option<Vec<Array3<Option<T>>>>
pub fn pop_next_frame_for_chunk(
&mut self,
chunk_num: usize
) -> Option<Array3<Option<T>>>
pub fn write_frame_bytes(&mut self, writer: &mut BufWriter<File>)
pub fn write_multi_frame_bytes(&mut self, writer: &mut BufWriter<File>) -> i32
Trait Implementations
sourceimpl<T: Clone + Default + FrameValue<Output = T> + Copy + Serialize + Send + Sync + Zero> Framer for FrameSequence<T>
impl<T: Clone + Default + FrameValue<Output = T> + Copy + Serialize + Send + Sync + Zero> Framer for FrameSequence<T>
sourcefn ingest_event(&mut self, event: &mut Event) -> bool
fn ingest_event(&mut self, event: &mut Event) -> bool
Examples
use adder_codec_rs::SourceCamera::FramedU8;
let mut frame_sequence: FrameSequence<u8> =
FramerBuilder::new(
10, 10, 3, 64)
.codec_version(1)
.time_parameters(50000, 1500, 50.0)
.mode(INSTANTANEOUS)
.source(U8, FramedU8)
.finish();
let mut event: Event = Event {
coord: Coord {
x: 5,
y: 5,
c: Some(1)
},
d: 5,
delta_t: 1000
};
frame_sequence.ingest_event(&mut event);
let elem = frame_sequence.px_at_current(5, 5, 1);
assert_eq!(*elem, Some(32));
type Output = T
fn new(builder: FramerBuilder) -> Self
fn ingest_events_events(&mut self, events: Vec<Vec<Event>>) -> bool
Auto Trait Implementations
impl<T> RefUnwindSafe for FrameSequence<T>where
T: RefUnwindSafe,
impl<T> Send for FrameSequence<T>where
T: Send,
impl<T> Sync for FrameSequence<T>where
T: Sync,
impl<T> Unpin for FrameSequence<T>
impl<T> UnwindSafe for FrameSequence<T>where
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T, U> IntoCv<U> for Twhere
U: FromCv<T>,
impl<T, U> IntoCv<U> for Twhere
U: FromCv<T>,
fn into_cv(self) -> U
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read morefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.