pub struct FrameSequence<T> {
    pub state: FrameSequenceState,
    pub chunk_rows: usize,
    /* private fields */
}

Fields§

§state: FrameSequenceState§chunk_rows: usize

Implementations§

Get the number of frames queue’d up to be written

Get the number of chunks in a frame

Get the reference for the pixel at the given coordinates

Arguments
  • y - The y coordinate of the pixel
  • x - The x coordinate of the pixel
  • c - The channel of the pixel
Returns
  • Option<&T> - The reference to the pixel value
Errors
  • If the frame has not been initialized

Get the reference for the pixel at the given coordinates and frame index

Arguments
  • y - The y coordinate of the pixel
  • x - The x coordinate of the pixel
  • c - The channel of the pixel
  • frame_idx - The index of the frame to get the pixel from
Returns
  • Option<&T> - The reference to the pixel value
Errors
  • If the frame at the given index has not been initialized

Get whether or not the frame at the given index is “filled” (i.e., all pixels have been written to)

Arguments
  • frame_idx - The index of the frame to check
Returns
  • bool - Whether or not the frame is filled
Errors
  • If the frame at the given index has not been initialized
  • If the frame index is out of bounds
  • If the frame is not aligned with the chunk division

Write out the next frame to the given writer

Arguments
  • writer - The writer to write the frame to
Returns
  • Result<(), FrameSequenceError> - Whether or not the write was successful
Errors
  • If the frame chunk has not been initialized
  • If the data cannot be written

Write out next frames to the given writer so long as the frame is filled

Arguments
  • writer - The writer to write the frames to
Returns
  • Result<(), FrameSequenceError> - Whether or not the write was successful
Errors
  • If a frame could not be written

Trait Implementations§

Examples
use adder_codec_rs::SourceCamera::FramedU8;

let mut frame_sequence: FrameSequence<u8> =
FramerBuilder::new(
            PlaneSize::new(10,10,3).unwrap(), 64)
            .codec_version(1, TimeMode::DeltaT)
            .time_parameters(50000, 1000, 1000, 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).unwrap();
assert_eq!(*elem, Some(32));

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more