Tizen 2.1 base
[framework/uifw/ecore.git] / src / lib / ecore_psl1ght / moveutil.h
1 /*
2  * Copyright (C) Antonio José Ramos Márquez (bigboss)
3  * Copyright (C) Youness Alaoui (KaKaRoTo)
4  */
5
6 #ifndef __MOVEUTIL_H__
7 #define __MOVEUTIL_H__
8
9 #include <ppu-types.h>
10 #include <spurs/spurs.h>
11 #include <io/camera.h>
12 #include <io/move.h>
13
14 typedef struct
15 {
16    Spurs         *spurs;
17    cameraInfoEx   camInfo;
18    cameraReadInfo camRead;
19    gemState       state;
20 } moveContext;
21
22 static inline float
23 vec_array(vec_float4 vec, unsigned int idx)
24 {
25    union {
26       vec_float4 vec;
27       float      array[4];
28    } v;
29
30    v.vec = vec;
31
32    if (idx > 3)
33      return -1;
34    return v.array[idx];
35 }
36
37 moveContext *initMove();
38 void         endMove(moveContext *context);
39 void         readGemState(moveContext *context);
40 int          processMove(moveContext *context);
41 void         moveGet3DPosition(moveContext *context, float *x, float *y, float *z);
42
43 #endif /* __MOVEUTIL_H__ */