pub struct CameraFrame {
pub bytes: Vec<u8>,
pub mime_type: String,
pub width: u32,
pub height: u32,
pub at: DateTime<Utc>,
pub latency_ms: u32,
pub overlays: Vec<Overlay>,
}Expand description
One frame offered to the hub: the encoded picture, in the camera’s pixels, with what was found on it (spec 3.7 §7.13: frames stay ephemeral).
Fields§
§bytes: Vec<u8>The encoded picture: image/jpeg or image/png.
mime_type: StringIts media type.
width: u32Width in pixels.
height: u32Height in pixels.
at: DateTime<Utc>When it was captured.
latency_ms: u32How long after capture its overlays were ready, in milliseconds (board choice C10).
overlays: Vec<Overlay>What was found on it, in its pixels.
Implementations§
Source§impl CameraFrame
impl CameraFrame
Sourcepub fn new(
bytes: Vec<u8>,
mime_type: impl Into<String>,
width: u32,
height: u32,
at: DateTime<Utc>,
) -> Self
pub fn new( bytes: Vec<u8>, mime_type: impl Into<String>, width: u32, height: u32, at: DateTime<Utc>, ) -> Self
A JPEG or PNG frame of width × height captured at, nothing found on it yet.
Sourcepub fn with_overlays(self, overlays: Vec<Overlay>) -> Self
pub fn with_overlays(self, overlays: Vec<Overlay>) -> Self
What was found on it.
Sourcepub fn with_latency_ms(self, latency_ms: u32) -> Self
pub fn with_latency_ms(self, latency_ms: u32) -> Self
How long after capture its overlays were ready.
Trait Implementations§
Source§impl Clone for CameraFrame
impl Clone for CameraFrame
Source§impl Debug for CameraFrame
impl Debug for CameraFrame
Source§impl PartialEq for CameraFrame
impl PartialEq for CameraFrame
impl StructuralPartialEq for CameraFrame
Auto Trait Implementations§
impl Forget for CameraFrame
impl Freeze for CameraFrame
impl Move for CameraFrame
impl RefUnwindSafe for CameraFrame
impl Send for CameraFrame
impl Sync for CameraFrame
impl Unpin for CameraFrame
impl UnsafeUnpin for CameraFramewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
NonZeroI32Inner: UnsafeUnpin,
Utc: UnsafeUnpin,
PhantomData<Overlay>: UnsafeUnpin,
impl UnwindSafe for CameraFrame
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more