Struct MotionVector2d
#[repr(C)]pub struct MotionVector2d {
pub du: f32,
pub dv: f32,
}Expand description
A 2D motion vector expressed as a UV-space delta: [du, dv].
Values point from current frame UV to previous frame UV:
motion = previous_uv - current_uv.
Positive values point towards increasing UV coordinates (rightwards and downwards
in top-left origin coordinates).
Fields§
§du: f32§dv: f32Implementations§
§impl MotionVector2d
impl MotionVector2d
pub const ZERO: MotionVector2d
pub const fn new(du: f32, dv: f32) -> MotionVector2d
pub const fn new(du: f32, dv: f32) -> MotionVector2d
Creates a default MotionVector2d.
pub fn length_squared(self) -> f32
pub fn length_squared(self) -> f32
Magnitude squared of the motion vector in UV coordinates.
Trait Implementations§
§impl Clone for MotionVector2d
impl Clone for MotionVector2d
§fn clone(&self) -> MotionVector2d
fn clone(&self) -> MotionVector2d
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MotionVector2d
§impl Debug for MotionVector2d
impl Debug for MotionVector2d
§impl PartialEq for MotionVector2d
impl PartialEq for MotionVector2d
impl Pod for MotionVector2d
impl StructuralPartialEq for MotionVector2d
Auto Trait Implementations§
impl Freeze for MotionVector2d
impl RefUnwindSafe for MotionVector2d
impl Send for MotionVector2d
impl Sync for MotionVector2d
impl Unpin for MotionVector2d
impl UnsafeUnpin for MotionVector2d
impl UnwindSafe for MotionVector2d
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
impl<T> AnyBitPattern for Twhere
T: Pod,
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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Interleave for Twhere
T: Pod,
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