pub struct EmotionSpace { /* private fields */ }Expand description
A collection of EmotionAnchors that defines an interpolatable emotion space.
Implementations§
Source§impl EmotionSpace
impl EmotionSpace
Sourcepub fn add_anchor(&mut self, anchor: EmotionAnchor)
pub fn add_anchor(&mut self, anchor: EmotionAnchor)
Add an anchor to the space.
Sourcepub fn anchor_count(&self) -> usize
pub fn anchor_count(&self) -> usize
Return the number of anchors.
Sourcepub fn find_anchor(&self, name: &str) -> Option<&EmotionAnchor>
pub fn find_anchor(&self, name: &str) -> Option<&EmotionAnchor>
Find an anchor by name (case-sensitive).
Sourcepub fn default_space() -> Self
pub fn default_space() -> Self
Build the default space with Ekman’s seven basic emotions mapped to PAD space.
Each emotion has a canonical set of facial morph target weights drawn from common MakeHuman-style expression unit names.
Sourcepub fn evaluate(&self, pad: &PadPoint) -> HashMap<String, f32>
pub fn evaluate(&self, pad: &PadPoint) -> HashMap<String, f32>
Evaluate expression weights at pad using inverse-distance weighting (IDW).
Uses power = 2.0 (standard Shepard’s method).
Sourcepub fn evaluate_rbf(&self, pad: &PadPoint, sigma: f32) -> HashMap<String, f32>
pub fn evaluate_rbf(&self, pad: &PadPoint, sigma: f32) -> HashMap<String, f32>
Evaluate expression weights using Gaussian RBF interpolation.
sigma controls the width of influence: smaller = sharper, larger = broader.
Sourcepub fn nearest_anchor(&self, pad: &PadPoint) -> Option<&EmotionAnchor>
pub fn nearest_anchor(&self, pad: &PadPoint) -> Option<&EmotionAnchor>
Find the nearest anchor to pad in PAD space.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EmotionSpace
impl RefUnwindSafe for EmotionSpace
impl Send for EmotionSpace
impl Sync for EmotionSpace
impl Unpin for EmotionSpace
impl UnsafeUnpin for EmotionSpace
impl UnwindSafe for EmotionSpace
Blanket Implementations§
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
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