zenilib
0.5.3.0
|
#include "SDL_config.h"
#include "SDL_events.h"
#include "SDL_events_c.h"
#include "SDL_gesture_c.h"
#include <memory.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
Go to the source code of this file.
Macros | |
#define | DOLLARNPOINTS 64 |
#define | DOLLARSIZE 256 |
#define | ENABLE_DOLLAR |
#define | MAXPATHSIZE 1024 |
#define | PHI 0.618033989 |
Functions | |
static float | bestDollarDifference (SDL_FloatPoint *points, SDL_FloatPoint *templ) |
static float | dollarDifference (SDL_FloatPoint *points, SDL_FloatPoint *templ, float ang) |
static int | dollarNormalize (const SDL_DollarPath *path, SDL_FloatPoint *points) |
static float | dollarRecognize (const SDL_DollarPath *path, int *bestTempl, SDL_GestureTouch *touch) |
static int | SaveTemplate (SDL_DollarTemplate *templ, SDL_RWops *src) |
static int | SDL_AddDollarGesture (SDL_GestureTouch *inTouch, SDL_FloatPoint *path) |
static int | SDL_AddDollarGesture_one (SDL_GestureTouch *inTouch, SDL_FloatPoint *path) |
int | SDL_GestureAddTouch (SDL_TouchID touchId) |
void | SDL_GestureProcessEvent (SDL_Event *event) |
static SDL_GestureTouch * | SDL_GetGestureTouch (SDL_TouchID id) |
static unsigned long | SDL_HashDollar (SDL_FloatPoint *points) |
int | SDL_LoadDollarTemplates (SDL_TouchID touchId, SDL_RWops *src) |
Load Dollar Gesture templates from a file. More... | |
int | SDL_RecordGesture (SDL_TouchID touchId) |
Begin Recording a gesture on the specified touch, or all touches (-1) More... | |
int | SDL_SaveAllDollarTemplates (SDL_RWops *src) |
Save all currently loaded Dollar Gesture templates. More... | |
int | SDL_SaveDollarTemplate (SDL_GestureID gestureId, SDL_RWops *src) |
Save a currently loaded Dollar Gesture template. More... | |
static int | SDL_SendDollarRecord (SDL_GestureTouch *touch, SDL_GestureID gestureId) |
static int | SDL_SendGestureDollar (SDL_GestureTouch *touch, SDL_GestureID gestureId, float error) |
int | SDL_SendGestureMulti (SDL_GestureTouch *touch, float dTheta, float dDist) |
Variables | |
SDL_bool | recordAll |
SDL_GestureTouch * | SDL_gestureTouch |
int | SDL_numGestureTouches = 0 |
#define DOLLARNPOINTS 64 |
Definition at line 42 of file SDL_gesture.c.
Referenced by dollarDifference(), dollarNormalize(), dollarRecognize(), SaveTemplate(), SDL_AddDollarGesture_one(), SDL_GestureProcessEvent(), SDL_HashDollar(), and SDL_LoadDollarTemplates().
#define DOLLARSIZE 256 |
Definition at line 43 of file SDL_gesture.c.
Referenced by dollarNormalize().
#define ENABLE_DOLLAR |
Definition at line 45 of file SDL_gesture.c.
#define MAXPATHSIZE 1024 |
Definition at line 40 of file SDL_gesture.c.
Referenced by SDL_GestureProcessEvent().
#define PHI 0.618033989 |
Definition at line 47 of file SDL_gesture.c.
Referenced by bestDollarDifference().
|
static |
Definition at line 262 of file SDL_gesture.c.
References dollarDifference(), M_PI, PHI, SDL_fabs(), and SDL_min.
Referenced by dollarRecognize().
|
static |
Definition at line 246 of file SDL_gesture.c.
References DOLLARNPOINTS, i, SDL_cos(), SDL_sin(), and SDL_sqrt().
Referenced by bestDollarDifference().
Definition at line 301 of file SDL_gesture.c.
References d, DOLLARNPOINTS, DOLLARSIZE, i, SDL_atan2(), SDL_cos(), SDL_sin(), and SDL_sqrt().
Referenced by dollarRecognize(), and SDL_GestureProcessEvent().
|
static |
Definition at line 393 of file SDL_gesture.c.
References bestDollarDifference(), dollarNormalize(), DOLLARNPOINTS, i, and SDL_memset().
Referenced by SDL_GestureProcessEvent().
Definition at line 119 of file SDL_gesture.c.
References DOLLARNPOINTS, NULL, and SDL_RWwrite.
Referenced by SDL_SaveAllDollarTemplates(), and SDL_SaveDollarTemplate().
|
static |
Definition at line 187 of file SDL_gesture.c.
References i, NULL, SDL_AddDollarGesture_one(), SDL_gestureTouch, and SDL_numGestureTouches.
Referenced by SDL_GestureProcessEvent(), and SDL_LoadDollarTemplates().
|
static |
Definition at line 163 of file SDL_gesture.c.
References DOLLARNPOINTS, SDL_HashDollar(), SDL_memcpy(), SDL_OutOfMemory, and SDL_realloc().
Referenced by SDL_AddDollarGesture().
int SDL_GestureAddTouch | ( | SDL_TouchID | touchId | ) |
Definition at line 412 of file SDL_gesture.c.
References SDL_FALSE, SDL_gestureTouch, SDL_numGestureTouches, SDL_OutOfMemory, and SDL_realloc().
Referenced by SDL_AddTouch().
Definition at line 485 of file SDL_gesture.c.
References dollarNormalize(), DOLLARNPOINTS, dollarRecognize(), error, i, MAXPATHSIZE, NULL, recordAll, SDL_AddDollarGesture(), SDL_atan2(), SDL_FALSE, SDL_FINGERDOWN, SDL_FINGERMOTION, SDL_FINGERUP, SDL_gestureTouch, SDL_GetGestureTouch(), SDL_numGestureTouches, SDL_SendDollarRecord(), SDL_SendGestureDollar(), SDL_SendGestureMulti(), SDL_sqrt(), SDL_Event::tfinger, SDL_TouchFingerEvent::touchId, and SDL_Event::type.
Referenced by SDL_PushEvent().
|
static |
Definition at line 435 of file SDL_gesture.c.
References i, NULL, SDL_gestureTouch, and SDL_numGestureTouches.
Referenced by SDL_GestureProcessEvent().
|
static |
Definition at line 107 of file SDL_gesture.c.
References DOLLARNPOINTS, and i.
Referenced by SDL_AddDollarGesture_one().
int SDL_LoadDollarTemplates | ( | SDL_TouchID | touchId, |
SDL_RWops * | src | ||
) |
Load Dollar Gesture templates from a file.
Definition at line 207 of file SDL_gesture.c.
References DOLLARNPOINTS, i, NULL, SDL_AddDollarGesture(), SDL_gestureTouch, SDL_numGestureTouches, and SDL_RWread.
int SDL_RecordGesture | ( | SDL_TouchID | touchId | ) |
Begin Recording a gesture on the specified touch, or all touches (-1)
Definition at line 93 of file SDL_gesture.c.
References i, recordAll, SDL_gestureTouch, SDL_numGestureTouches, and SDL_TRUE.
Save all currently loaded Dollar Gesture templates.
Definition at line 135 of file SDL_gesture.c.
References i, j, SaveTemplate(), SDL_gestureTouch, and SDL_numGestureTouches.
int SDL_SaveDollarTemplate | ( | SDL_GestureID | gestureId, |
SDL_RWops * | src | ||
) |
Save a currently loaded Dollar Gesture template.
Definition at line 147 of file SDL_gesture.c.
References i, j, SaveTemplate(), SDL_gestureTouch, SDL_numGestureTouches, and SDL_SetError().
|
static |
Definition at line 475 of file SDL_gesture.c.
References SDL_DOLLARRECORD, and SDL_PushEvent().
Referenced by SDL_GestureProcessEvent().
|
static |
Definition at line 459 of file SDL_gesture.c.
References error, SDL_DOLLARGESTURE, and SDL_PushEvent().
Referenced by SDL_GestureProcessEvent().
int SDL_SendGestureMulti | ( | SDL_GestureTouch * | touch, |
float | dTheta, | ||
float | dDist | ||
) |
Definition at line 446 of file SDL_gesture.c.
References SDL_MULTIGESTURE, and SDL_PushEvent().
Referenced by SDL_GestureProcessEvent().
SDL_bool recordAll |
Definition at line 79 of file SDL_gesture.c.
Referenced by SDL_GestureProcessEvent(), and SDL_RecordGesture().
SDL_GestureTouch* SDL_gestureTouch |
Definition at line 77 of file SDL_gesture.c.
Referenced by SDL_AddDollarGesture(), SDL_GestureAddTouch(), SDL_GestureProcessEvent(), SDL_GetGestureTouch(), SDL_LoadDollarTemplates(), SDL_RecordGesture(), SDL_SaveAllDollarTemplates(), and SDL_SaveDollarTemplate().
int SDL_numGestureTouches = 0 |
Definition at line 78 of file SDL_gesture.c.
Referenced by SDL_AddDollarGesture(), SDL_GestureAddTouch(), SDL_GestureProcessEvent(), SDL_GetGestureTouch(), SDL_LoadDollarTemplates(), SDL_RecordGesture(), SDL_SaveAllDollarTemplates(), and SDL_SaveDollarTemplate().