Gesture Library
multistroke.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "gesturelib.h"
4 #include "recognizer.h"
5 #include "stroke.h"
6 
8 typedef struct multistroke {
9  // recognizer state
11  // user id of tracked group
12  int uid;
13  // number of tracked strokes
14  int size;
15  // translation
16  float dx;
17  float dy;
18  // rotation counterclockwise in radians
19  float rotation;
20  // scale factor
21  float scale;
22 
23  // 1 if stroke is tracked, else 0
25  // last complete translation
26  float dx0;
27  float dy0;
28  // last rotation
29  float rotation0;
30  // last scaling
31  float scale0;
32  // center position of time of last touch change
33  float cx;
34  float cy;
35  // scaled offsets since last center change
36  float sx[MAX_TOUCHES];
37  float sy[MAX_TOUCHES];
39 
41 void init_multistroke();
42 
45 void recognize_multistroke(const touch_event_t* event);
46 
#define MAX_TOUCHES
Definition: gestureparams.h:5
void recognize_multistroke(const touch_event_t *event)
Recognize multistroke gesture. This gesture allows the number of fingers to change.
Definition: multistroke.c:37
void init_multistroke()
Initialize multistroke data structures.
Definition: multistroke.c:9
struct multistroke multistroke_t
Data structure for stroke gesture data.
const multistroke_t * get_multistroke()
Access array of multistroke_t of size MAX_TOUCHES.
Definition: multistroke.c:53
enum state state_t
This represents the state of individual gesture recognizers.
Data structure for stroke gesture data.
Definition: multistroke.h:8
float sy[MAX_TOUCHES]
Definition: multistroke.h:37
float scale
Definition: multistroke.h:21
float rotation
Definition: multistroke.h:19
float scale0
Definition: multistroke.h:31
char strokes[MAX_TOUCHES]
Definition: multistroke.h:24
state_t state
Definition: multistroke.h:10
float rotation0
Definition: multistroke.h:29
float sx[MAX_TOUCHES]
Definition: multistroke.h:36
To use the gesture library, users create touch events and fill in the appropriate fields.
Definition: gesturelib.h:17