From d619da633517175ffa6977a80760673628f91583 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 16 Feb 2011 18:20:14 +0100 Subject: Add velocity estimate The per-touch velocity is useful in many contexts. This patch adds a simple estimator of the velocity, which also smooths out position jumps caused by course-grained event updates. Signed-off-by: Henrik Rydberg --- include/utouch/frame.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/utouch/frame.h') diff --git a/include/utouch/frame.h b/include/utouch/frame.h index 03a44aa..60195ef 100644 --- a/include/utouch/frame.h +++ b/include/utouch/frame.h @@ -115,6 +115,8 @@ struct utouch_surface { * @orientation: direction of ellipse (left: -Pi/2, up: 0, right: Pi/2) * @pressure: pressure of contact (pressure units) * @distance: distance of contact (surface units) + * @vx: horizontal velocity coordinate (units / millisecond) + * @vy: vertical velocity coordinate (units / millisecond) * * Surface contact details. Later versions of this struct may grow in * size, but will remain binary compatible with older versions. @@ -138,6 +140,8 @@ struct utouch_contact { float orientation; float pressure; float distance; + float vx; + float vy; }; /* time in milliseconds */ -- cgit v1.2.3