struct motion_filter *filter,
const struct normalized_coords *unaccelerated,
void *data, uint64_t time);
+ struct normalized_coords (*filter_constant)(
+ struct motion_filter *filter,
+ const struct normalized_coords *unaccelerated,
+ void *data, uint64_t time);
void (*restart)(struct motion_filter *filter,
void *data,
uint64_t time);
return filter->interface->filter(filter, unaccelerated, data, time);
}
+struct normalized_coords
+filter_dispatch_constant(struct motion_filter *filter,
+ const struct normalized_coords *unaccelerated,
+ void *data, uint64_t time)
+{
+ return filter->interface->filter_constant(filter, unaccelerated, data, time);
+}
+
void
filter_restart(struct motion_filter *filter,
void *data, uint64_t time)
return accelerated;
}
+static struct normalized_coords
+accelerator_filter_noop(struct motion_filter *filter,
+ const struct normalized_coords *unaccelerated,
+ void *data, uint64_t time)
+{
+ return *unaccelerated;
+}
+
static struct normalized_coords
accelerator_filter_low_dpi(struct motion_filter *filter,
const struct normalized_coords *unaccelerated,
struct motion_filter_interface accelerator_interface = {
.filter = accelerator_filter,
+ .filter_constant = accelerator_filter_noop,
.restart = accelerator_restart,
.destroy = accelerator_destroy,
.set_speed = accelerator_set_speed,
struct motion_filter_interface accelerator_interface_low_dpi = {
.filter = accelerator_filter_low_dpi,
+ .filter_constant = accelerator_filter_noop,
.restart = accelerator_restart,
.destroy = accelerator_destroy,
.set_speed = accelerator_set_speed,
struct motion_filter_interface accelerator_interface_x230 = {
.filter = accelerator_filter_x230,
+ .filter_constant = accelerator_filter_noop,
.restart = accelerator_restart,
.destroy = accelerator_destroy,
.set_speed = accelerator_set_speed,
struct motion_filter_interface accelerator_interface_trackpoint = {
.filter = accelerator_filter_trackpoint,
+ .filter_constant = accelerator_filter_noop,
.restart = accelerator_restart,
.destroy = accelerator_destroy,
.set_speed = accelerator_set_speed,
struct motion_filter;
+/**
+ * Accelerate the given coordinates.
+ * Takes a set of unaccelerated deltas and accelerates them based on the
+ * current and previous motion.
+ *
+ * This is a superset of filter_dispatch_constant()
+ *
+ * @see filter_dispatch_constant
+ */
struct normalized_coords
filter_dispatch(struct motion_filter *filter,
const struct normalized_coords *unaccelerated,
void *data, uint64_t time);
+/**
+ * Apply constant motion filters, but no acceleration.
+ *
+ * Takes a set of unaccelerated deltas and applies any constant filters to
+ * it but does not accelerate the delta in the conventional sense.
+ *
+ * @see filter_dispatch
+ */
+struct normalized_coords
+filter_dispatch_constant(struct motion_filter *filter,
+ const struct normalized_coords *unaccelerated,
+ void *data, uint64_t time);
+
void
filter_restart(struct motion_filter *filter,
void *data, uint64_t time);